Skip to content

Commit dd8587a

Browse files
committedFeb 8, 2025
chore(deps): remove broken/EOL esm.js dependency
1 parent dfc6c0b commit dd8587a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+653
-6580
lines changed
 

‎client/index.html

+2-8
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,9 @@
2424
<meta name="theme-color" content="#111111">
2525

2626
<meta name="rctf-config" content="{{ jsonConfig }}" />
27-
28-
{{ #config.renderGoogleAnalytics }}
29-
<meta name="analytics-id" content="{{ config.globalSiteTag }}">
30-
<script async src="/analytics/index.js"></script>
31-
<script async src="/analytics/autotrack.js"></script>
32-
<script async src="https://www.google-analytics.com/analytics.js"></script>
33-
{{ /config.renderGoogleAnalytics }}
3427
</head>
3528
<body>
36-
<% preact.bodyEnd %>
29+
<div id="app"></div>
30+
<script type="module" src="/src/index.jsx"></script>
3731
</body>
3832
</html>

‎client/lib/linkstate.js

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* Code from https://github.com/developit/linkstate/blob/f744563a7f7eaf5e9c3126403492474cbdb68027/src/index.js
3+
* Unmodified from the original
4+
*
5+
* Copyright (c) 2017 Jason Miller under the MIT License (MIT)
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8+
*
9+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10+
*
11+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12+
*/
13+
14+
import delve from 'dlv';
15+
16+
/** @typedef {import('preact').AnyComponent} Component */
17+
18+
/** Create an Event handler function that sets a given state property.
19+
* @param {Component} component The component whose state should be updated
20+
* @param {string} key A dot-notated key path to update in the component's state
21+
* @param {string} eventPath A dot-notated key path to the value that should be retrieved from the Event or component
22+
* @returns {function} linkedStateHandler
23+
*/
24+
export default function linkState(component, key, eventPath) {
25+
let path = key.split('.'),
26+
cache = component.__lsc || (component.__lsc = {});
27+
28+
return cache[key+eventPath] || (cache[key+eventPath] = function(e) {
29+
let t = e && e.target || this,
30+
state = {},
31+
obj = state,
32+
v = typeof eventPath==='string' ? delve(e, eventPath) : (t && t.nodeName) ? (t.type.match(/^che|rad/) ? t.checked : t.value) : e,
33+
i = 0;
34+
for ( ; i<path.length-1; i++) {
35+
obj = obj[path[i]] || (obj[path[i]] = !i && component.state[path[i]] || {});
36+
}
37+
obj[path[i]] = v;
38+
component.setState(state);
39+
});
40+
}

0 commit comments

Comments
 (0)
Please sign in to comment.