@alixex/ranview 0.1.0-alpha.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -26
- package/dist/builder.d.ts +128 -0
- package/dist/builder.d.ts.map +1 -0
- package/dist/core.d.ts +5 -116
- package/dist/core.d.ts.map +1 -1
- package/dist/events.d.ts +2 -63
- package/dist/events.d.ts.map +1 -1
- package/dist/factories-DYUNLmkS.js +203 -0
- package/dist/factories-DYUNLmkS.js.map +1 -0
- package/dist/factories.d.ts +22 -0
- package/dist/factories.d.ts.map +1 -0
- package/dist/factory.d.ts +1 -32
- package/dist/factory.d.ts.map +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +95 -248
- package/dist/index.js.map +1 -1
- package/dist/mocks-Bxv4c1qp.js.map +1 -1
- package/dist/mocks.js +1 -2
- package/dist/selectors.d.ts +1 -1
- package/dist/signal.js +1 -1
- package/dist/signal.js.map +1 -1
- package/dist/static.d.ts +18 -0
- package/dist/static.d.ts.map +1 -0
- package/dist/static.js +25 -0
- package/dist/static.js.map +1 -0
- package/package.json +16 -13
- package/dist/index.cjs +0 -2
- package/dist/index.cjs.map +0 -1
- package/dist/mocks-DvJQ7jGP.cjs +0 -2
- package/dist/mocks-DvJQ7jGP.cjs.map +0 -1
- package/dist/mocks.cjs +0 -1
- package/dist/signal.cjs +0 -2
- package/dist/signal.cjs.map +0 -1
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { n as e } from "./mocks-Bxv4c1qp.js";
|
|
2
|
+
import { EventManager as t } from "ranuts/utils";
|
|
3
|
+
//#region src/env.ts
|
|
4
|
+
var n = typeof document > "u", r = {
|
|
5
|
+
bind(e, t) {
|
|
6
|
+
t(typeof e == "function" ? e() : e);
|
|
7
|
+
},
|
|
8
|
+
append(e, t) {
|
|
9
|
+
for (let i of t) {
|
|
10
|
+
if (i == null) continue;
|
|
11
|
+
if (Array.isArray(i)) {
|
|
12
|
+
r.append(e, i);
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
if (typeof i == "function") {
|
|
16
|
+
r.append(e, [i()]);
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
if (typeof i == "object" && ("__ranFor" in i || "__ranIndex" in i)) throw TypeError("Import For and Index from the static entry when using static builders");
|
|
20
|
+
let t = i instanceof o ? i.build() : typeof i == "string" && !n ? document.createTextNode(i) : i;
|
|
21
|
+
e.appendChild(t);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}, i = "http://www.w3.org/2000/svg", a = /* @__PURE__ */ new Set(/* @__PURE__ */ "svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use".split(".")), o = class {
|
|
25
|
+
runtime;
|
|
26
|
+
el;
|
|
27
|
+
constructor(t, i, o = r) {
|
|
28
|
+
this.runtime = o;
|
|
29
|
+
let s = i ?? (a.has(t) ? "http://www.w3.org/2000/svg" : void 0);
|
|
30
|
+
this.el = n ? new e(t) : s ? document.createElementNS(s, t) : document.createElement(t);
|
|
31
|
+
}
|
|
32
|
+
id(e) {
|
|
33
|
+
return this.el.setAttribute("id", e), this;
|
|
34
|
+
}
|
|
35
|
+
bind(e, t) {
|
|
36
|
+
this.runtime.bind(e, t);
|
|
37
|
+
}
|
|
38
|
+
class(e) {
|
|
39
|
+
return this.bind(e, (e) => {
|
|
40
|
+
n ? this.el.attributes.set("class", e) : this.el.setAttribute("class", e);
|
|
41
|
+
}), this;
|
|
42
|
+
}
|
|
43
|
+
addClass(...e) {
|
|
44
|
+
return e.forEach((e) => this.el.classList.add(e)), this;
|
|
45
|
+
}
|
|
46
|
+
removeClass(...e) {
|
|
47
|
+
return e.forEach((e) => this.el.classList.remove(e)), this;
|
|
48
|
+
}
|
|
49
|
+
attr(e, t) {
|
|
50
|
+
return this.bind(t, (t) => this.el.setAttribute(e, t)), this;
|
|
51
|
+
}
|
|
52
|
+
attrs(e) {
|
|
53
|
+
return Object.entries(e).forEach(([e, t]) => {
|
|
54
|
+
t != null && this.el.setAttribute(e, String(t));
|
|
55
|
+
}), this;
|
|
56
|
+
}
|
|
57
|
+
boolAttr(e, t, n = "") {
|
|
58
|
+
return this.bind(t, (t) => {
|
|
59
|
+
t ? this.el.setAttribute(e, n) : this.el.removeAttribute(e);
|
|
60
|
+
}), this;
|
|
61
|
+
}
|
|
62
|
+
part(e) {
|
|
63
|
+
return this.attr("part", e);
|
|
64
|
+
}
|
|
65
|
+
data(e, t) {
|
|
66
|
+
return this.attr(`data-${e}`, t);
|
|
67
|
+
}
|
|
68
|
+
style(e, t) {
|
|
69
|
+
return typeof e == "string" ? this.bind(t ?? "", (t) => this.el.style.setProperty(e, t)) : Object.entries(e).forEach(([e, t]) => this.el.style.setProperty(e, t)), this;
|
|
70
|
+
}
|
|
71
|
+
cssVar(e, t) {
|
|
72
|
+
let n = e.startsWith("--") ? e : `--${e}`;
|
|
73
|
+
return this.style(n, t);
|
|
74
|
+
}
|
|
75
|
+
aria(e, t) {
|
|
76
|
+
return this.attr(`aria-${e}`, t);
|
|
77
|
+
}
|
|
78
|
+
role(e) {
|
|
79
|
+
return this.attr("role", e);
|
|
80
|
+
}
|
|
81
|
+
tabIndex(e) {
|
|
82
|
+
return this.attr("tabindex", String(e));
|
|
83
|
+
}
|
|
84
|
+
label(e) {
|
|
85
|
+
return this.aria("label", e);
|
|
86
|
+
}
|
|
87
|
+
labelledBy(e) {
|
|
88
|
+
return this.aria("labelledby", e);
|
|
89
|
+
}
|
|
90
|
+
describedBy(e) {
|
|
91
|
+
return this.aria("describedby", e);
|
|
92
|
+
}
|
|
93
|
+
ariaHidden(e = !0) {
|
|
94
|
+
return this.aria("hidden", String(e));
|
|
95
|
+
}
|
|
96
|
+
on(e, t, n) {
|
|
97
|
+
return this.el.addEventListener(e, t, n), this;
|
|
98
|
+
}
|
|
99
|
+
listen(e, t, n, r) {
|
|
100
|
+
return e.on(this.el, t, n, r), this;
|
|
101
|
+
}
|
|
102
|
+
delegate(e, t, n, r, i) {
|
|
103
|
+
return e.delegate(this.el, t, n, r, i), this;
|
|
104
|
+
}
|
|
105
|
+
children(...e) {
|
|
106
|
+
return this.runtime.append(this.el, e), this;
|
|
107
|
+
}
|
|
108
|
+
replaceChildren(...e) {
|
|
109
|
+
if (n) {
|
|
110
|
+
let e = this.el;
|
|
111
|
+
e.childrenList = [];
|
|
112
|
+
} else this.el.replaceChildren();
|
|
113
|
+
return this.children(...e);
|
|
114
|
+
}
|
|
115
|
+
text(e) {
|
|
116
|
+
return this.bind(e, (e) => {
|
|
117
|
+
this.el.textContent = e;
|
|
118
|
+
}), this;
|
|
119
|
+
}
|
|
120
|
+
unsafeHtml(e) {
|
|
121
|
+
return this.bind(e, (e) => {
|
|
122
|
+
this.el.innerHTML = e;
|
|
123
|
+
}), this;
|
|
124
|
+
}
|
|
125
|
+
ref(e) {
|
|
126
|
+
return e.current = this.el, this;
|
|
127
|
+
}
|
|
128
|
+
shadow(e = { mode: "closed" }) {
|
|
129
|
+
let t = this.el.attachShadow(e);
|
|
130
|
+
return new s(this.el, t, e, this.runtime);
|
|
131
|
+
}
|
|
132
|
+
build() {
|
|
133
|
+
return this.el;
|
|
134
|
+
}
|
|
135
|
+
serialize() {
|
|
136
|
+
if (n) return this.el.serialize();
|
|
137
|
+
let e = document.createElement("div");
|
|
138
|
+
return e.appendChild(this.el.cloneNode(!0)), e.innerHTML;
|
|
139
|
+
}
|
|
140
|
+
}, s = class {
|
|
141
|
+
runtime;
|
|
142
|
+
root;
|
|
143
|
+
hostEl;
|
|
144
|
+
constructor(e, t, n, i = r) {
|
|
145
|
+
this.runtime = i, this.hostEl = e, this.root = t;
|
|
146
|
+
}
|
|
147
|
+
children(...e) {
|
|
148
|
+
return this.runtime.append(this.root, e), this;
|
|
149
|
+
}
|
|
150
|
+
adoptSheet(...e) {
|
|
151
|
+
return this.root.adoptedStyleSheets = [...this.root.adoptedStyleSheets, ...e], this;
|
|
152
|
+
}
|
|
153
|
+
css(e) {
|
|
154
|
+
if (n) return this.root.adoptedStyleSheets.push(e), this;
|
|
155
|
+
if (typeof CSSStyleSheet < "u") try {
|
|
156
|
+
let t = new CSSStyleSheet();
|
|
157
|
+
return t.replaceSync(e), this.root.adoptedStyleSheets = [...this.root.adoptedStyleSheets, t], this;
|
|
158
|
+
} catch {}
|
|
159
|
+
let t = document.createElement("style");
|
|
160
|
+
return t.textContent = e, this.root.appendChild(t), this;
|
|
161
|
+
}
|
|
162
|
+
done() {
|
|
163
|
+
return {
|
|
164
|
+
host: this.hostEl,
|
|
165
|
+
shadow: this.root
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
serialize() {
|
|
169
|
+
return n ? this.root.serialize() : this.root.innerHTML;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/factories.ts
|
|
174
|
+
function c(e) {
|
|
175
|
+
let t = (t) => new e(t);
|
|
176
|
+
return {
|
|
177
|
+
View: t,
|
|
178
|
+
Div: () => t("div"),
|
|
179
|
+
Svg: (t) => new e(t, i),
|
|
180
|
+
Span: () => t("span"),
|
|
181
|
+
Slot: () => t("slot"),
|
|
182
|
+
ButtonBuilder: () => t("button"),
|
|
183
|
+
InputBuilder: () => t("input"),
|
|
184
|
+
Style: () => t("style"),
|
|
185
|
+
Label: () => t("label"),
|
|
186
|
+
Ul: () => t("ul"),
|
|
187
|
+
Li: () => t("li"),
|
|
188
|
+
Section: () => t("section"),
|
|
189
|
+
Article: () => t("article"),
|
|
190
|
+
Nav: () => t("nav"),
|
|
191
|
+
Header: () => t("header"),
|
|
192
|
+
Footer: () => t("footer"),
|
|
193
|
+
Main: () => t("main"),
|
|
194
|
+
DeclarativeShadow: (e = "open", n = !1) => {
|
|
195
|
+
let r = t("template");
|
|
196
|
+
return r.attr("shadowrootmode", e), n && r.attr("shadowrootdelegatesfocus", ""), r;
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
//#endregion
|
|
201
|
+
export { t as a, s as i, o as n, n as o, i as r, c as t };
|
|
202
|
+
|
|
203
|
+
//# sourceMappingURL=factories-DYUNLmkS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factories-DYUNLmkS.js","names":["HTMLElementMock","isSSR","staticRuntime","value","item","items","parent","node","ElementBuilder","SVG_NAMESPACE","SVG_ONLY_TAGS","runtime","ns","namespace","tag","apply","name","n","names","v","values","enabledValue","key","keyOrMap","k","property","id","hidden","type","listener","options","manager","handler","selector","mock","root","ShadowBuilder","outer","host","sheets","cssText","sheet","style","createFactories","View","Builder","tpl","mode","delegatesFocus","EventManager"],"sources":["../src/env.ts","../src/builder.ts","../src/factories.ts"],"sourcesContent":["export const isSSR = typeof document === 'undefined';\n","import { isSSR } from './env';\nimport { DocumentFragmentMock, HTMLElementMock, ShadowRootMock } from './mocks';\nimport type { EventManager } from './events';\nimport type { Child, Ref } from './core';\ntype Getter<T> = () => T;\n\nexport interface BuilderRuntime {\n bind<V>(value: V | Getter<V>, apply: (value: V) => void): void;\n append(parent: Node, items: Child[]): void;\n}\n\n/** One-shot node operations shared by SSR and the signal-free static entry. */\nexport const staticRuntime: BuilderRuntime = {\n bind(value, apply) {\n apply(typeof value === 'function' ? (value as Getter<any>)() : value);\n },\n append(parent, items) {\n for (const item of items) {\n if (item == null) continue;\n if (Array.isArray(item)) {\n staticRuntime.append(parent, item);\n continue;\n }\n if (typeof item === 'function') {\n staticRuntime.append(parent, [item()]);\n continue;\n }\n if (typeof item === 'object' && ('__ranFor' in item || '__ranIndex' in item)) {\n throw new TypeError('Import For and Index from the static entry when using static builders');\n }\n const node =\n item instanceof ElementBuilder\n ? item.build()\n : typeof item === 'string' && !isSSR\n ? document.createTextNode(item)\n : item;\n (parent as unknown as { appendChild(node: unknown): unknown }).appendChild(node);\n }\n },\n};\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n\n/**\n * Tags that exist only in SVG, so a builder can create them correctly without\n * being told which namespace they belong to.\n *\n * Deliberately excludes the tags SVG shares with HTML -- `a`, `script`,\n * `style`, `title` -- since guessing wrong there would silently produce the\n * wrong kind of element for the far more common HTML case. Reach for `Svg()`\n * when one of those is meant as SVG.\n */\nconst SVG_ONLY_TAGS = new Set([\n 'svg',\n 'circle',\n 'clipPath',\n 'defs',\n 'desc',\n 'ellipse',\n 'feBlend',\n 'feColorMatrix',\n 'feComposite',\n 'feDropShadow',\n 'feFlood',\n 'feGaussianBlur',\n 'feMerge',\n 'feMergeNode',\n 'feOffset',\n 'filter',\n 'foreignObject',\n 'g',\n 'image',\n 'line',\n 'linearGradient',\n 'marker',\n 'mask',\n 'path',\n 'pattern',\n 'polygon',\n 'polyline',\n 'radialGradient',\n 'rect',\n 'stop',\n 'switch',\n 'symbol',\n 'text',\n 'textPath',\n 'tspan',\n 'use',\n]);\n\nexport class ElementBuilder<T extends HTMLElement = HTMLElement> {\n private el: T;\n\n /**\n * @param tag element name\n * @param namespace element namespace; inferred for SVG-only tags, and forced\n * by `Svg()` for the tags SVG shares with HTML.\n *\n * The namespace matters more than it looks. `document.createElement('svg')`\n * yields an `HTMLUnknownElement`: the browser does not render it as SVG, and\n * -- because HTML lowercases attribute names -- `viewBox` lands as `viewbox`,\n * which SVG reads case-sensitively and therefore ignores. An icon built that\n * way is invisible, with markup that looks right in a serialized page.\n */\n constructor(\n tag: string,\n namespace?: string,\n private runtime: BuilderRuntime = staticRuntime,\n ) {\n const ns = namespace ?? (SVG_ONLY_TAGS.has(tag) ? SVG_NAMESPACE : undefined);\n this.el = (isSSR\n ? new HTMLElementMock(tag)\n : ns\n ? document.createElementNS(ns, tag)\n : document.createElement(tag)) as unknown as T;\n }\n\n id(value: string): this {\n this.el.setAttribute('id', value);\n return this;\n }\n\n /**\n * Apply a value now, or bind it reactively when a getter is passed.\n * A getter creates an effect owned by the current reactive scope (createRoot),\n * so the binding is disposed automatically when that scope is torn down.\n */\n private bind<V>(value: V | Getter<V>, apply: (v: V) => void): void {\n this.runtime.bind(value, apply);\n }\n\n /**\n * Sets the element's class.\n *\n * Written through `setAttribute` rather than `className`. On an SVG element `className`\n * is a read-only `SVGAnimatedString`, so assigning to it throws\n * `Cannot set property className of [object SVGElement] which has only a getter` — which,\n * happening inside a custom element's constructor, leaves the element un-upgraded with\n * no shadow root rather than reporting a styling problem. `setAttribute` is equivalent\n * for HTML elements and correct for both.\n */\n class(name: string | Getter<string>): this {\n this.bind(name, (n) => {\n if (isSSR) (this.el as unknown as HTMLElementMock).attributes.set('class', n);\n else this.el.setAttribute('class', n);\n });\n return this;\n }\n\n addClass(...names: string[]): this {\n names.forEach((n) => this.el.classList.add(n));\n return this;\n }\n\n removeClass(...names: string[]): this {\n names.forEach((n) => this.el.classList.remove(n));\n return this;\n }\n\n attr(name: string, value: string | Getter<string>): this {\n this.bind(value, (v) => this.el.setAttribute(name, v));\n return this;\n }\n\n attrs(values: Record<string, string | number | boolean | null | undefined>): this {\n Object.entries(values).forEach(([name, value]) => {\n if (value == null) return;\n this.el.setAttribute(name, String(value));\n });\n return this;\n }\n\n boolAttr(name: string, value: boolean | Getter<boolean>, enabledValue = ''): this {\n this.bind(value, (v) => {\n if (v) this.el.setAttribute(name, enabledValue);\n else this.el.removeAttribute(name);\n });\n return this;\n }\n\n part(value: string | Getter<string>): this {\n return this.attr('part', value);\n }\n\n data(key: string, value: string | Getter<string>): this {\n return this.attr(`data-${key}`, value);\n }\n\n style(keyOrMap: string | Record<string, string>, value?: string | Getter<string>): this {\n if (typeof keyOrMap === 'string') {\n this.bind(value ?? '', (v) => this.el.style.setProperty(keyOrMap, v));\n } else {\n Object.entries(keyOrMap).forEach(([k, v]) => this.el.style.setProperty(k, v));\n }\n return this;\n }\n\n cssVar(name: string, value: string | Getter<string>): this {\n const property = name.startsWith('--') ? name : `--${name}`;\n return this.style(property, value);\n }\n\n aria(key: string, value: string | Getter<string>): this {\n return this.attr(`aria-${key}`, value);\n }\n\n role(value: string | Getter<string>): this {\n return this.attr('role', value);\n }\n\n tabIndex(value: number): this {\n return this.attr('tabindex', String(value));\n }\n\n label(value: string | Getter<string>): this {\n return this.aria('label', value);\n }\n\n labelledBy(id: string | Getter<string>): this {\n return this.aria('labelledby', id);\n }\n\n describedBy(id: string | Getter<string>): this {\n return this.aria('describedby', id);\n }\n\n ariaHidden(hidden = true): this {\n return this.aria('hidden', String(hidden));\n }\n\n /**\n * Permanent build-time listener — tied to the element's lifetime.\n * Use for internal shadow DOM elements created in the constructor.\n */\n on<K extends keyof HTMLElementEventMap>(\n type: K,\n listener: (this: T, ev: HTMLElementEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions,\n ): this {\n this.el.addEventListener(type, listener as EventListener, options);\n return this;\n }\n\n /**\n * Lifecycle-managed listener — registered into an EventManager.\n * Use in connectedCallback when building elements that need cleanup on disconnect.\n * Call manager.abort() in disconnectedCallback to remove all listeners at once.\n */\n listen<K extends keyof HTMLElementEventMap>(\n manager: EventManager,\n type: K,\n handler: (this: T, ev: HTMLElementEventMap[K]) => any,\n options?: Omit<AddEventListenerOptions, 'signal'>,\n ): this {\n manager.on(this.el, type, handler as EventListener, options);\n return this;\n }\n\n /**\n * Delegated listener — the built element acts as the parent container.\n * Fires handler only when the event originates from a descendant matching selector.\n * Registered into an EventManager so it is cleaned up with manager.abort().\n *\n * Div().class('list')\n * .children(...)\n * .delegate(scope, '.item', 'click', (ev, item) => handleItem(item))\n * .build();\n */\n delegate<K extends keyof HTMLElementEventMap>(\n manager: EventManager,\n selector: string,\n type: K,\n handler: (ev: HTMLElementEventMap[K], target: Element) => void,\n options?: Omit<AddEventListenerOptions, 'signal'>,\n ): this {\n manager.delegate(this.el, selector, type, handler, options);\n return this;\n }\n\n children(...items: Child[]): this {\n this.runtime.append(this.el, items);\n return this;\n }\n\n replaceChildren(...items: Child[]): this {\n if (isSSR) {\n const mock = this.el as unknown as HTMLElementMock | DocumentFragmentMock;\n mock.childrenList = [];\n } else {\n this.el.replaceChildren();\n }\n return this.children(...items);\n }\n\n text(value: string | Getter<string>): this {\n this.bind(value, (v) => {\n this.el.textContent = v;\n });\n return this;\n }\n\n /**\n * Set the element's content from a string of markup, without escaping it.\n *\n * The counterpart to `text()`, and named for the difference: `text()` escapes,\n * this does not. Everything handed here is parsed as HTML, so anything that\n * came from outside the program must be sanitized before it arrives.\n *\n * It exists because some content simply *is* HTML, and a builder without this\n * cannot express it at all: markdown rendered for a page, a fragment assembled\n * somewhere else, a translated string that carries its own emphasis\n * (`Local-first · <b>open source</b>`). That gap is why a static-site\n * generator with markdown in it could not be written against this API and had\n * to concatenate strings instead.\n *\n * Like `textContent`, this replaces whatever content the element had --\n * including anything set by `text()` or `children()` before it.\n */\n unsafeHtml(value: string | Getter<string>): this {\n this.bind(value, (v) => {\n this.el.innerHTML = v;\n });\n return this;\n }\n\n ref(holder: Ref<T>): this {\n holder.current = this.el;\n return this;\n }\n\n shadow(options: ShadowRootInit = { mode: 'closed' }): ShadowBuilder<T> {\n const root = this.el.attachShadow(options);\n return new ShadowBuilder<T>(this.el, root, options, this.runtime);\n }\n\n build(): T {\n return this.el;\n }\n\n serialize(): string {\n if (isSSR) return (this.el as unknown as HTMLElementMock).serialize();\n const outer = document.createElement('div');\n outer.appendChild(this.el.cloneNode(true));\n return outer.innerHTML;\n }\n}\n\nexport class ShadowBuilder<T extends HTMLElement = HTMLElement> {\n private root: ShadowRoot;\n private hostEl: T;\n\n /**\n * `options` is taken and discarded: `attachShadow` has already consumed it by the time\n * a builder exists, and nothing ever read the copy this class used to keep. The\n * parameter stays so the call signature is unchanged.\n */\n constructor(\n host: T,\n root: ShadowRoot,\n _options: ShadowRootInit,\n private runtime: BuilderRuntime = staticRuntime,\n ) {\n this.hostEl = host;\n this.root = root;\n }\n\n children(...items: Child[]): this {\n this.runtime.append(this.root, items);\n return this;\n }\n\n adoptSheet(...sheets: CSSStyleSheet[]): this {\n this.root.adoptedStyleSheets = [...this.root.adoptedStyleSheets, ...sheets];\n return this;\n }\n\n css(cssText: string): this {\n if (isSSR) {\n (this.root as unknown as ShadowRootMock).adoptedStyleSheets.push(cssText);\n return this;\n }\n if (typeof CSSStyleSheet !== 'undefined') {\n try {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(cssText);\n this.root.adoptedStyleSheets = [...this.root.adoptedStyleSheets, sheet];\n return this;\n } catch {\n // Fallback to style injection when adoptedStyleSheets is unavailable.\n }\n }\n const style = document.createElement('style');\n style.textContent = cssText;\n this.root.appendChild(style);\n return this;\n }\n\n done(): { host: T; shadow: ShadowRoot } {\n return { host: this.hostEl, shadow: this.root };\n }\n\n serialize(): string {\n if (isSSR) return (this.root as unknown as ShadowRootMock).serialize();\n return (this.root as ShadowRoot).innerHTML;\n }\n}\n","import { ElementBuilder, SVG_NAMESPACE } from './builder';\nexport function createFactories(Builder: typeof ElementBuilder) {\n const View = <T extends HTMLElement = HTMLElement>(tag: string): ElementBuilder<T> => new Builder<T>(tag);\n const Div = (): ElementBuilder<HTMLDivElement> => View<HTMLDivElement>('div');\n\n /**\n * An element in the SVG namespace.\n *\n * `View()` already infers it for tags that only exist in SVG (`path`, `circle`,\n * `g`, …), so this is for the ones SVG shares with HTML -- `a`, `script`,\n * `style`, `title` -- where guessing would break the commoner HTML case.\n *\n * ```ts\n * View('svg').attrs({ viewBox: '0 0 16 16' }).children(\n * Svg('a').attr('href', '#').children(View('path').attr('d', 'M1 1').build()).build(),\n * );\n * ```\n */\n const Svg = <T extends HTMLElement = HTMLElement>(tag: string): ElementBuilder<T> =>\n new Builder<T>(tag, SVG_NAMESPACE);\n const Span = (): ElementBuilder<HTMLSpanElement> => View<HTMLSpanElement>('span');\n const Slot = (): ElementBuilder<HTMLSlotElement> => View<HTMLSlotElement>('slot');\n const ButtonBuilder = (): ElementBuilder<HTMLButtonElement> => View<HTMLButtonElement>('button');\n const InputBuilder = (): ElementBuilder<HTMLInputElement> => View<HTMLInputElement>('input');\n const Style = (): ElementBuilder<HTMLStyleElement> => View<HTMLStyleElement>('style');\n const Label = (): ElementBuilder<HTMLLabelElement> => View<HTMLLabelElement>('label');\n const Ul = (): ElementBuilder<HTMLUListElement> => View<HTMLUListElement>('ul');\n const Li = (): ElementBuilder<HTMLLIElement> => View<HTMLLIElement>('li');\n const Section = (): ElementBuilder<HTMLElement> => View<HTMLElement>('section');\n const Article = (): ElementBuilder<HTMLElement> => View<HTMLElement>('article');\n const Nav = (): ElementBuilder<HTMLElement> => View<HTMLElement>('nav');\n const Header = (): ElementBuilder<HTMLElement> => View<HTMLElement>('header');\n const Footer = (): ElementBuilder<HTMLElement> => View<HTMLElement>('footer');\n const Main = (): ElementBuilder<HTMLElement> => View<HTMLElement>('main');\n\n const DeclarativeShadow = (\n mode: 'open' | 'closed' = 'open',\n delegatesFocus = false,\n ): ElementBuilder<HTMLTemplateElement> => {\n const tpl = View<HTMLTemplateElement>('template');\n tpl.attr('shadowrootmode', mode);\n if (delegatesFocus) tpl.attr('shadowrootdelegatesfocus', '');\n return tpl;\n };\n\n return {\n View,\n Div,\n Svg,\n Span,\n Slot,\n ButtonBuilder,\n InputBuilder,\n Style,\n Label,\n Ul,\n Li,\n Section,\n Article,\n Nav,\n Header,\n Footer,\n Main,\n DeclarativeShadow,\n };\n}\n"],"mappings":";;;AAAA,IAAaC,IAAQ,OAAO,WAAa,KCY5BC,IAAgC;CAC3C,KAAK,GAAO,GAAO;EACjB,EAAM,OAAOC,KAAU,aAAcA,EAAsB,IAAIA,CAAK;CACtE;CACA,OAAO,GAAQ,GAAO;EACpB,KAAK,IAAMC,KAAQC,GAAO;GACxB,IAAID,KAAQ,MAAM;GAClB,IAAI,MAAM,QAAQA,CAAI,GAAG;IACvB,EAAc,OAAOE,GAAQF,CAAI;IACjC;GACF;GACA,IAAI,OAAOA,KAAS,YAAY;IAC9B,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C,EAAW/B,GAAKL,CAAa;EA8BjC,YA7BkDmC,EAAsB,MAAM;EA8B9E,YA7BkDA,EAAsB,MAAM;EA8B9E,qBA7B6DA,EAAwB,QAAQ;EA8B7F,oBA7B2DA,EAAuB,OAAO;EA8BzF,aA7BoDA,EAAuB,OAAO;EA8BlF,aA7BoDA,EAAuB,OAAO;EA8BlF,UA7BiDA,EAAuB,IAAI;EA8B5E,UA7B8CA,EAAoB,IAAI;EA8BtE,eA7BiDA,EAAkB,SAAS;EA8B5E,eA7BiDA,EAAkB,SAAS;EA8B5E,WA7B6CA,EAAkB,KAAK;EA8BpE,cA7BgDA,EAAkB,QAAQ;EA8B1E,cA7BgDA,EAAkB,QAAQ;EA8B1E,YA7B8CA,EAAkB,MAAM;EA8BtE,oBA3BA,IAA0B,QAC1B,IAAiB,OACuB;GACxC,IAAME,IAAMF,EAA0B,UAAU;GAGhD,OAFAE,EAAI,KAAK,kBAAkBC,CAAI,GAC3BC,KAAgBF,EAAI,KAAK,4BAA4B,EAAE,GACpDA;EACT;CAqBA;AACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ElementBuilder } from "./builder.js";
|
|
2
|
+
export declare function createFactories(Builder: typeof ElementBuilder): {
|
|
3
|
+
View: <T extends HTMLElement = HTMLElement>(tag: string) => ElementBuilder<T>;
|
|
4
|
+
Div: () => ElementBuilder<HTMLDivElement>;
|
|
5
|
+
Svg: <T extends HTMLElement = HTMLElement>(tag: string) => ElementBuilder<T>;
|
|
6
|
+
Span: () => ElementBuilder<HTMLSpanElement>;
|
|
7
|
+
Slot: () => ElementBuilder<HTMLSlotElement>;
|
|
8
|
+
ButtonBuilder: () => ElementBuilder<HTMLButtonElement>;
|
|
9
|
+
InputBuilder: () => ElementBuilder<HTMLInputElement>;
|
|
10
|
+
Style: () => ElementBuilder<HTMLStyleElement>;
|
|
11
|
+
Label: () => ElementBuilder<HTMLLabelElement>;
|
|
12
|
+
Ul: () => ElementBuilder<HTMLUListElement>;
|
|
13
|
+
Li: () => ElementBuilder<HTMLLIElement>;
|
|
14
|
+
Section: () => ElementBuilder<HTMLElement>;
|
|
15
|
+
Article: () => ElementBuilder<HTMLElement>;
|
|
16
|
+
Nav: () => ElementBuilder<HTMLElement>;
|
|
17
|
+
Header: () => ElementBuilder<HTMLElement>;
|
|
18
|
+
Footer: () => ElementBuilder<HTMLElement>;
|
|
19
|
+
Main: () => ElementBuilder<HTMLElement>;
|
|
20
|
+
DeclarativeShadow: (mode?: 'open' | 'closed', delegatesFocus?: boolean) => ElementBuilder<HTMLTemplateElement>;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=factories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factories.d.ts","sourceRoot":"","sources":["../src/factories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,WAAW,CAAC;AAC1D,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,cAAc;WAC9C,CAAC,SAAS,WAAW,qBAAqB,MAAM,KAAG,cAAc,CAAC,CAAC,CAAC;eAClE,cAAc,CAAC,cAAc,CAAC;UAejC,CAAC,SAAS,WAAW,qBAAqB,MAAM,KAAG,cAAc,CAAC,CAAC,CAAC;gBAEhE,cAAc,CAAC,eAAe,CAAC;gBAC/B,cAAc,CAAC,eAAe,CAAC;yBACtB,cAAc,CAAC,iBAAiB,CAAC;wBAClC,cAAc,CAAC,gBAAgB,CAAC;iBACvC,cAAc,CAAC,gBAAgB,CAAC;iBAChC,cAAc,CAAC,gBAAgB,CAAC;cACnC,cAAc,CAAC,gBAAgB,CAAC;cAChC,cAAc,CAAC,aAAa,CAAC;mBACxB,cAAc,CAAC,WAAW,CAAC;mBAC3B,cAAc,CAAC,WAAW,CAAC;eAC/B,cAAc,CAAC,WAAW,CAAC;kBACxB,cAAc,CAAC,WAAW,CAAC;kBAC3B,cAAc,CAAC,WAAW,CAAC;gBAC7B,cAAc,CAAC,WAAW,CAAC;+BAGpC,MAAM,GAAG,QAAQ,+BAEtB,cAAc,CAAC,mBAAmB,CAAC;EA2BvC"}
|
package/dist/factory.d.ts
CHANGED
|
@@ -1,33 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const View: <T extends HTMLElement = HTMLElement>(tag: string) => ElementBuilder<T>;
|
|
3
|
-
export declare const Div: () => ElementBuilder<HTMLDivElement>;
|
|
4
|
-
/**
|
|
5
|
-
* An element in the SVG namespace.
|
|
6
|
-
*
|
|
7
|
-
* `View()` already infers it for tags that only exist in SVG (`path`, `circle`,
|
|
8
|
-
* `g`, …), so this is for the ones SVG shares with HTML -- `a`, `script`,
|
|
9
|
-
* `style`, `title` -- where guessing would break the commoner HTML case.
|
|
10
|
-
*
|
|
11
|
-
* ```ts
|
|
12
|
-
* View('svg').attrs({ viewBox: '0 0 16 16' }).children(
|
|
13
|
-
* Svg('a').attr('href', '#').children(View('path').attr('d', 'M1 1').build()).build(),
|
|
14
|
-
* );
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export declare const Svg: <T extends HTMLElement = HTMLElement>(tag: string) => ElementBuilder<T>;
|
|
18
|
-
export declare const Span: () => ElementBuilder<HTMLSpanElement>;
|
|
19
|
-
export declare const Slot: () => ElementBuilder<HTMLSlotElement>;
|
|
20
|
-
export declare const ButtonBuilder: () => ElementBuilder<HTMLButtonElement>;
|
|
21
|
-
export declare const InputBuilder: () => ElementBuilder<HTMLInputElement>;
|
|
22
|
-
export declare const Style: () => ElementBuilder<HTMLStyleElement>;
|
|
23
|
-
export declare const Label: () => ElementBuilder<HTMLLabelElement>;
|
|
24
|
-
export declare const Ul: () => ElementBuilder<HTMLUListElement>;
|
|
25
|
-
export declare const Li: () => ElementBuilder<HTMLLIElement>;
|
|
26
|
-
export declare const Section: () => ElementBuilder<HTMLElement>;
|
|
27
|
-
export declare const Article: () => ElementBuilder<HTMLElement>;
|
|
28
|
-
export declare const Nav: () => ElementBuilder<HTMLElement>;
|
|
29
|
-
export declare const Header: () => ElementBuilder<HTMLElement>;
|
|
30
|
-
export declare const Footer: () => ElementBuilder<HTMLElement>;
|
|
31
|
-
export declare const Main: () => ElementBuilder<HTMLElement>;
|
|
32
|
-
export declare const DeclarativeShadow: (mode?: 'open' | 'closed', delegatesFocus?: boolean) => ElementBuilder<HTMLTemplateElement>;
|
|
1
|
+
export declare const View: <T extends HTMLElement = HTMLElement>(tag: string) => import("./builder.js").ElementBuilder<T>, Div: () => import("./builder.js").ElementBuilder<HTMLDivElement>, Svg: <T extends HTMLElement = HTMLElement>(tag: string) => import("./builder.js").ElementBuilder<T>, Span: () => import("./builder.js").ElementBuilder<HTMLSpanElement>, Slot: () => import("./builder.js").ElementBuilder<HTMLSlotElement>, ButtonBuilder: () => import("./builder.js").ElementBuilder<HTMLButtonElement>, InputBuilder: () => import("./builder.js").ElementBuilder<HTMLInputElement>, Style: () => import("./builder.js").ElementBuilder<HTMLStyleElement>, Label: () => import("./builder.js").ElementBuilder<HTMLLabelElement>, Ul: () => import("./builder.js").ElementBuilder<HTMLUListElement>, Li: () => import("./builder.js").ElementBuilder<HTMLLIElement>, Section: () => import("./builder.js").ElementBuilder<HTMLElement>, Article: () => import("./builder.js").ElementBuilder<HTMLElement>, Nav: () => import("./builder.js").ElementBuilder<HTMLElement>, Header: () => import("./builder.js").ElementBuilder<HTMLElement>, Footer: () => import("./builder.js").ElementBuilder<HTMLElement>, Main: () => import("./builder.js").ElementBuilder<HTMLElement>, DeclarativeShadow: (mode?: 'open' | 'closed', delegatesFocus?: boolean) => import("./builder.js").ElementBuilder<HTMLTemplateElement>;
|
|
33
2
|
//# sourceMappingURL=factory.d.ts.map
|
package/dist/factory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAEA,eAAO,MACL,IAAI,+FACJ,GAAG,4DACH,GAAG,+FACH,IAAI,6DACJ,IAAI,6DACJ,aAAa,+DACb,YAAY,8DACZ,KAAK,8DACL,KAAK,8DACL,EAAE,8DACF,EAAE,2DACF,OAAO,yDACP,OAAO,yDACP,GAAG,yDACH,MAAM,yDACN,MAAM,yDACN,IAAI,yDACJ,iBAAiB,iHACgB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { isSSR } from
|
|
2
|
-
export { EventManager } from
|
|
3
|
-
export { signal, createEffect, computed, batch, untrack, createRoot, onCleanup, getOwner, runWithOwner, } from
|
|
4
|
-
export type { Getter, Setter, SignalOptions, Owner } from
|
|
5
|
-
export { escapeHtml, escapeHtmlAttribute } from
|
|
6
|
-
export { type MockNode, matchSelector, collectMatches } from
|
|
7
|
-
export { DocumentFragmentMock, HTMLElementMock, ShadowRootMock } from
|
|
8
|
-
export { type Ref, type Child, type ForOptions, type ForHandle, type IndexOptions, type IndexHandle, type ShowOptions, type SwitchOptions, type MatchClause, createRef, For, Index, Show, Switch, Match, ElementBuilder, ShadowBuilder,
|
|
9
|
-
export { View, Div, Svg, Span, Slot, ButtonBuilder, InputBuilder, Style, Label, Ul, Li, Section, Article, Nav, Header, Footer, Main, DeclarativeShadow, } from
|
|
1
|
+
export { isSSR } from "./env.js";
|
|
2
|
+
export { EventManager } from "./events.js";
|
|
3
|
+
export { signal, createEffect, computed, batch, untrack, createRoot, onCleanup, getOwner, runWithOwner, } from "./signal.js";
|
|
4
|
+
export type { Getter, Setter, SignalOptions, Owner } from "./signal.js";
|
|
5
|
+
export { escapeHtml, escapeHtmlAttribute } from "./escape.js";
|
|
6
|
+
export { type MockNode, matchSelector, collectMatches } from "./selectors.js";
|
|
7
|
+
export { DocumentFragmentMock, HTMLElementMock, ShadowRootMock } from "./mocks.js";
|
|
8
|
+
export { type Ref, type Child, type ForOptions, type ForHandle, type IndexOptions, type IndexHandle, type ShowOptions, type SwitchOptions, type MatchClause, createRef, For, Index, Show, Switch, Match, ElementBuilder, ShadowBuilder, } from "./core.js";
|
|
9
|
+
export { View, Div, Svg, Span, Slot, ButtonBuilder, InputBuilder, Style, Label, Ul, Li, Section, Article, Nav, Header, Footer, Main, DeclarativeShadow, } from "./factory.js";
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EACL,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,OAAO,EACP,UAAU,EACV,SAAS,EACT,QAAQ,EACR,YAAY,GACb,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,KAAK,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAChF,OAAO,EACL,KAAK,GAAG,EACR,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,SAAS,EACT,GAAG,EACH,KAAK,EACL,IAAI,EACJ,MAAM,EACN,KAAK,EACL,cAAc,EACd,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,K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