Skip to content

Commit eb438c4

Browse files
committed
Built
1 parent 8bfb13c commit eb438c4

File tree

4 files changed

+55
-47
lines changed

4 files changed

+55
-47
lines changed

frameworks/non-keyed/kobold/bundled-dist/js-framework-benchmark-kobold.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

frameworks/non-keyed/kobold/bundled-dist/snippets/kobold-1aefc3738a915e71/js/util.js

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
const fragmentDecorators = new WeakMap();
2+
3+
export function appendChild(n,c) { n.appendChild(c); }
4+
export function appendBefore(n,i) { n.before(i); }
5+
export function removeNode(n) { n.remove(); }
6+
export function replaceNode(o,n) { o.replaceWith(n); }
7+
export function emptyNode() { return document.createTextNode(""); }
8+
export function fragment()
9+
{
10+
let f = document.createDocumentFragment();
11+
f.append("", "");
12+
return f;
13+
};
14+
export function fragmentDecorate(f) {
15+
fragmentDecorators.set(f, [f.firstChild, f.lastChild]);
16+
return f.lastChild;
17+
}
18+
export function fragmentUnmount(f)
19+
{
20+
let [b, e] = fragmentDecorators.get(f);
21+
while (b.nextSibling !== e) f.appendChild(b.nextSibling);
22+
f.appendChild(e);
23+
f.insertBefore(b, f.firstChild);
24+
}
25+
export function fragmentReplace(f,n)
26+
{
27+
let [b, e] = fragmentDecorators.get(f);
28+
while (b.nextSibling !== e) f.appendChild(b.nextSibling);
29+
b.replaceWith(n);
30+
f.appendChild(e);
31+
f.insertBefore(b, f.firstChild);
32+
}
33+
export function setTextContent(n,t) { n.textContent = t; }
34+
export function setAttribute(n,a,v) { n.setAttribute(a, v); }
35+
36+
export function setChecked(n,v) { if (n.checked !== v) n.checked = v; }
37+
export function setClassName(n,v) { n.className = v; }
38+
export function setHref(n,v) { n.href = v; }
39+
export function setStyle(n,v) { n.style = v; }
40+
export function setValue(n,v) { n.value = v; }
41+
42+
export function addClass(n,v) { n.classList.add(v); }
43+
export function removeClass(n,v) { n.classList.remove(v); }
44+
export function replaceClass(n,o,v) { n.classList.replace(o,v); }
45+
export function toggleClass(n,c,v) { n.classList.toggle(c,v); }
46+
47+
export function makeEventHandler(c,f) { return (e) => koboldCallback(e,c,f); }
48+
export function checkEventHandler() { if (typeof koboldCallback !== "function") console.error(
49+
`Missing \`koboldCallback\` in global scope.
50+
Add the following to your Trunk.toml:
51+
52+
[build]
53+
pattern_script = "<script type=\\"module\\">import init, { koboldCallback } from '{base}{js}';init('{base}{wasm}');window.koboldCallback = koboldCallback;</script>"
54+
`) }

0 commit comments

Comments
 (0)