microtags 0.0.1 → 0.0.5
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 +508 -89
- package/dist/chunk-7QVYU63E.js +7 -0
- package/dist/chunk-7QVYU63E.js.map +7 -0
- package/dist/chunk-CCYWRJW6.js +98 -0
- package/dist/chunk-CCYWRJW6.js.map +7 -0
- package/dist/chunk-E7ZGOHL3.js +51 -0
- package/dist/chunk-E7ZGOHL3.js.map +7 -0
- package/dist/context.cjs +10 -4
- package/dist/context.cjs.map +3 -3
- package/dist/context.js +7 -63
- package/dist/context.js.map +3 -3
- package/dist/index.cjs +416 -5
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +345 -2
- package/dist/index.js.map +3 -3
- package/dist/meta.json +276 -26
- package/dist/render.cjs +6 -4
- package/dist/render.cjs.map +2 -2
- package/dist/render.d.ts +4 -6
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +9 -6
- package/dist/render.js.map +2 -2
- package/dist/render.min.js +1 -1
- package/dist/render.min.js.map +2 -2
- package/dist/util.cjs +68 -0
- package/dist/util.cjs.map +7 -0
- package/dist/util.js +16 -0
- package/dist/util.js.map +7 -0
- package/dist/util.min.js +2 -0
- package/dist/util.min.js.map +7 -0
- package/package.json +26 -14
package/dist/index.js
CHANGED
|
@@ -1,5 +1,348 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
effect,
|
|
3
|
+
onContextAvailable,
|
|
4
|
+
peek,
|
|
5
|
+
resolveContextSignal,
|
|
6
|
+
signal,
|
|
7
|
+
untracked
|
|
8
|
+
} from "./chunk-CCYWRJW6.js";
|
|
9
|
+
import {
|
|
10
|
+
coerceBoolean,
|
|
11
|
+
coerceJson,
|
|
12
|
+
coerceNumber,
|
|
13
|
+
coerceString,
|
|
14
|
+
runCleanups
|
|
15
|
+
} from "./chunk-E7ZGOHL3.js";
|
|
16
|
+
import {
|
|
17
|
+
__name
|
|
18
|
+
} from "./chunk-7QVYU63E.js";
|
|
19
|
+
|
|
20
|
+
// src/setup-context.ts
|
|
21
|
+
function makeSetupContext(host, props, refs, contexts, cleanups) {
|
|
22
|
+
return {
|
|
23
|
+
host,
|
|
24
|
+
props,
|
|
25
|
+
refs,
|
|
26
|
+
contexts,
|
|
27
|
+
peek,
|
|
28
|
+
on(target, type, handler, options) {
|
|
29
|
+
target.addEventListener(
|
|
30
|
+
type,
|
|
31
|
+
handler,
|
|
32
|
+
options
|
|
33
|
+
);
|
|
34
|
+
cleanups.push(() => {
|
|
35
|
+
target.removeEventListener(
|
|
36
|
+
type,
|
|
37
|
+
handler,
|
|
38
|
+
options
|
|
39
|
+
);
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
effect(fn) {
|
|
43
|
+
const dispose = effect(fn);
|
|
44
|
+
cleanups.push(dispose);
|
|
45
|
+
},
|
|
46
|
+
bind(source, control, opts) {
|
|
47
|
+
const input = control instanceof HTMLInputElement ? control : void 0;
|
|
48
|
+
let prop = "value";
|
|
49
|
+
let autoEvent = "change";
|
|
50
|
+
if (input?.type === "checkbox") {
|
|
51
|
+
prop = "checked";
|
|
52
|
+
} else if (input?.type === "number" || input?.type === "range") {
|
|
53
|
+
prop = "valueAsNumber";
|
|
54
|
+
autoEvent = "input";
|
|
55
|
+
} else if (input || control instanceof HTMLTextAreaElement) {
|
|
56
|
+
autoEvent = "input";
|
|
57
|
+
}
|
|
58
|
+
const boundProp = opts?.prop ?? prop;
|
|
59
|
+
const event = opts ? opts.event : autoEvent;
|
|
60
|
+
const el = control;
|
|
61
|
+
if (event) {
|
|
62
|
+
const handler = /* @__PURE__ */ __name(() => {
|
|
63
|
+
const writable = source;
|
|
64
|
+
writable(el[boundProp]);
|
|
65
|
+
}, "handler");
|
|
66
|
+
control.addEventListener(event, handler);
|
|
67
|
+
cleanups.push(() => {
|
|
68
|
+
control.removeEventListener(event, handler);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
const dispose = effect(() => {
|
|
72
|
+
el[boundProp] = source();
|
|
73
|
+
});
|
|
74
|
+
cleanups.push(dispose);
|
|
75
|
+
},
|
|
76
|
+
onCleanup(fn) {
|
|
77
|
+
cleanups.push(fn);
|
|
78
|
+
},
|
|
79
|
+
consume(token) {
|
|
80
|
+
const sig = resolveContextSignal(host, token);
|
|
81
|
+
return sig ? sig() : void 0;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
__name(makeSetupContext, "makeSetupContext");
|
|
86
|
+
|
|
87
|
+
// src/factory.ts
|
|
88
|
+
var HTMLElementBase = typeof HTMLElement !== "undefined" ? HTMLElement : class {
|
|
89
|
+
};
|
|
90
|
+
function collectRefs(host, defs) {
|
|
91
|
+
const result = {};
|
|
92
|
+
const missing = [];
|
|
93
|
+
for (const [key, def] of Object.entries(defs)) {
|
|
94
|
+
const sel = def.selector ?? `[data-ref="${key}"]`;
|
|
95
|
+
if (def._microtag === "ref:all") {
|
|
96
|
+
result[key] = Array.from(host.querySelectorAll(sel));
|
|
97
|
+
} else {
|
|
98
|
+
const el = host.querySelector(sel);
|
|
99
|
+
if (!el) {
|
|
100
|
+
missing.push(key);
|
|
101
|
+
} else {
|
|
102
|
+
result[key] = el;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (missing.length > 0) {
|
|
107
|
+
throw new Error(
|
|
108
|
+
`${host.tagName}: missing refs: ${missing.join(", ")}`
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
__name(collectRefs, "collectRefs");
|
|
114
|
+
function factory(config) {
|
|
115
|
+
const {
|
|
116
|
+
props: propDefs,
|
|
117
|
+
observedAttrNames,
|
|
118
|
+
setup,
|
|
119
|
+
refs: refDefs = {},
|
|
120
|
+
contexts: ctxDefs = {}
|
|
121
|
+
} = config;
|
|
122
|
+
class MicrotagElement extends HTMLElementBase {
|
|
123
|
+
static {
|
|
124
|
+
__name(this, "MicrotagElement");
|
|
125
|
+
}
|
|
126
|
+
static get observedAttributes() {
|
|
127
|
+
return observedAttrNames;
|
|
128
|
+
}
|
|
129
|
+
_props = {};
|
|
130
|
+
_cleanups = [];
|
|
131
|
+
constructor() {
|
|
132
|
+
super();
|
|
133
|
+
for (const [name, coercer] of Object.entries(propDefs)) {
|
|
134
|
+
this._props[name] = signal(coercer(null));
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
connectedCallback() {
|
|
138
|
+
this._cleanups = [];
|
|
139
|
+
for (const [name, coercer] of Object.entries(propDefs)) {
|
|
140
|
+
const attrVal = this.getAttribute(name);
|
|
141
|
+
if (attrVal !== null) {
|
|
142
|
+
this._props[name](coercer(attrVal));
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
const cleanups = this._cleanups;
|
|
146
|
+
const props = this._props;
|
|
147
|
+
const contexts = new Proxy({}, {
|
|
148
|
+
get: /* @__PURE__ */ __name((_target, key) => {
|
|
149
|
+
if (typeof key !== "string") return void 0;
|
|
150
|
+
const token = ctxDefs[key];
|
|
151
|
+
if (!token) return void 0;
|
|
152
|
+
const sig = resolveContextSignal(this, token);
|
|
153
|
+
return sig ? sig() : void 0;
|
|
154
|
+
}, "get"),
|
|
155
|
+
has: /* @__PURE__ */ __name((_target, key) => {
|
|
156
|
+
if (typeof key !== "string") return false;
|
|
157
|
+
return key in ctxDefs;
|
|
158
|
+
}, "has")
|
|
159
|
+
});
|
|
160
|
+
let setupRan = false;
|
|
161
|
+
const cancelCallbacks = [];
|
|
162
|
+
const tryRunSetup = /* @__PURE__ */ __name(() => {
|
|
163
|
+
if (setupRan) return;
|
|
164
|
+
for (const token of Object.values(ctxDefs)) {
|
|
165
|
+
if (!resolveContextSignal(this, token)) return;
|
|
166
|
+
}
|
|
167
|
+
setupRan = true;
|
|
168
|
+
for (const cancel of cancelCallbacks) cancel();
|
|
169
|
+
cancelCallbacks.length = 0;
|
|
170
|
+
const refs = collectRefs(this, refDefs);
|
|
171
|
+
const ctx = makeSetupContext(
|
|
172
|
+
this,
|
|
173
|
+
props,
|
|
174
|
+
refs,
|
|
175
|
+
contexts,
|
|
176
|
+
cleanups
|
|
177
|
+
);
|
|
178
|
+
setup(ctx);
|
|
179
|
+
}, "tryRunSetup");
|
|
180
|
+
const tryRunSetupIfConnected = /* @__PURE__ */ __name(() => {
|
|
181
|
+
if (!this.isConnected) return;
|
|
182
|
+
tryRunSetup();
|
|
183
|
+
}, "tryRunSetupIfConnected");
|
|
184
|
+
for (const token of Object.values(ctxDefs)) {
|
|
185
|
+
if (!resolveContextSignal(this, token)) {
|
|
186
|
+
const cancel = onContextAvailable(
|
|
187
|
+
token.id,
|
|
188
|
+
tryRunSetupIfConnected
|
|
189
|
+
);
|
|
190
|
+
cancelCallbacks.push(cancel);
|
|
191
|
+
cleanups.push(cancel);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
tryRunSetup();
|
|
195
|
+
}
|
|
196
|
+
attributeChangedCallback(name, _old, next) {
|
|
197
|
+
const coercer = propDefs[name];
|
|
198
|
+
if (coercer !== void 0 && this._props[name] !== void 0) {
|
|
199
|
+
this._props[name](coercer(next));
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
disconnectedCallback() {
|
|
203
|
+
const fns = this._cleanups;
|
|
204
|
+
this._cleanups = [];
|
|
205
|
+
runCleanups(fns);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return MicrotagElement;
|
|
209
|
+
}
|
|
210
|
+
__name(factory, "factory");
|
|
211
|
+
|
|
212
|
+
// src/builders.ts
|
|
213
|
+
function isPropOnly(def) {
|
|
214
|
+
return typeof def === "object" && def !== null && "_microtag" in def && def._microtag === "prop";
|
|
215
|
+
}
|
|
216
|
+
__name(isPropOnly, "isPropOnly");
|
|
217
|
+
function isStandardSchema(def) {
|
|
218
|
+
return typeof def === "object" && def !== null && "~standard" in def;
|
|
219
|
+
}
|
|
220
|
+
__name(isStandardSchema, "isStandardSchema");
|
|
221
|
+
function normalizePropDef(name, def) {
|
|
222
|
+
if (isPropOnly(def)) {
|
|
223
|
+
return (_raw) => def.initial;
|
|
224
|
+
}
|
|
225
|
+
if (isStandardSchema(def)) {
|
|
226
|
+
const schema = def;
|
|
227
|
+
return (raw) => {
|
|
228
|
+
const result = schema["~standard"].validate(raw);
|
|
229
|
+
if (result instanceof Promise) {
|
|
230
|
+
throw new TypeError(
|
|
231
|
+
`withProps: async schemas are not supported (prop "${name}")`
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
if (result.issues) return void 0;
|
|
235
|
+
return result.value;
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
return def;
|
|
239
|
+
}
|
|
240
|
+
__name(normalizePropDef, "normalizePropDef");
|
|
241
|
+
var propDSL = {
|
|
242
|
+
number: /* @__PURE__ */ __name(() => coerceNumber, "number"),
|
|
243
|
+
string: /* @__PURE__ */ __name(() => coerceString, "string"),
|
|
244
|
+
boolean: /* @__PURE__ */ __name(() => coerceBoolean, "boolean"),
|
|
245
|
+
json: /* @__PURE__ */ __name(() => coerceJson, "json"),
|
|
246
|
+
schema: /* @__PURE__ */ __name((v) => v, "schema"),
|
|
247
|
+
prop: /* @__PURE__ */ __name((initial) => ({ _microtag: "prop", initial }), "prop")
|
|
248
|
+
};
|
|
249
|
+
var refsDSL = {
|
|
250
|
+
one: /* @__PURE__ */ __name(((selector) => ({ _microtag: "ref:one", selector })), "one"),
|
|
251
|
+
all: /* @__PURE__ */ __name(((selector) => ({ _microtag: "ref:all", selector })), "all")
|
|
252
|
+
};
|
|
253
|
+
var contextDSL = {};
|
|
254
|
+
var ComponentBuilder = class _ComponentBuilder {
|
|
255
|
+
constructor(tagName, coercers = {}, observed = [], refDefs = {}, ctxDefs = {}) {
|
|
256
|
+
this.tagName = tagName;
|
|
257
|
+
this._coercers = coercers;
|
|
258
|
+
this._observed = observed;
|
|
259
|
+
this._refDefs = refDefs;
|
|
260
|
+
this._ctxDefs = ctxDefs;
|
|
261
|
+
}
|
|
262
|
+
tagName;
|
|
263
|
+
static {
|
|
264
|
+
__name(this, "ComponentBuilder");
|
|
265
|
+
}
|
|
266
|
+
_coercers;
|
|
267
|
+
_observed;
|
|
268
|
+
_refDefs;
|
|
269
|
+
_ctxDefs;
|
|
270
|
+
/**
|
|
271
|
+
* The custom element tag name, e.g. 'my-counter'. Available at every
|
|
272
|
+
* point in the fluent chain since each builder method returns a new
|
|
273
|
+
* builder carrying the same tag name.
|
|
274
|
+
*/
|
|
275
|
+
get TAG() {
|
|
276
|
+
return this.tagName;
|
|
277
|
+
}
|
|
278
|
+
withProps(fn) {
|
|
279
|
+
const defs = fn(propDSL);
|
|
280
|
+
const coercers = {};
|
|
281
|
+
const observed = [];
|
|
282
|
+
for (const [name, def] of Object.entries(defs)) {
|
|
283
|
+
coercers[name] = normalizePropDef(name, def);
|
|
284
|
+
if (!isPropOnly(def)) {
|
|
285
|
+
observed.push(name);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return new _ComponentBuilder(
|
|
289
|
+
this.tagName,
|
|
290
|
+
coercers,
|
|
291
|
+
observed,
|
|
292
|
+
this._refDefs,
|
|
293
|
+
this._ctxDefs
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
withRefs(fn) {
|
|
297
|
+
const defs = fn(refsDSL);
|
|
298
|
+
return new _ComponentBuilder(
|
|
299
|
+
this.tagName,
|
|
300
|
+
this._coercers,
|
|
301
|
+
this._observed,
|
|
302
|
+
defs,
|
|
303
|
+
this._ctxDefs
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
withContexts(fn) {
|
|
307
|
+
const defs = fn(contextDSL);
|
|
308
|
+
return new _ComponentBuilder(
|
|
309
|
+
this.tagName,
|
|
310
|
+
this._coercers,
|
|
311
|
+
this._observed,
|
|
312
|
+
this._refDefs,
|
|
313
|
+
defs
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
setup(fn) {
|
|
317
|
+
const El = factory({
|
|
318
|
+
props: this._coercers,
|
|
319
|
+
observedAttrNames: this._observed,
|
|
320
|
+
refs: this._refDefs,
|
|
321
|
+
contexts: this._ctxDefs,
|
|
322
|
+
setup: fn
|
|
323
|
+
});
|
|
324
|
+
Object.defineProperty(El, "TAG", {
|
|
325
|
+
value: this.tagName,
|
|
326
|
+
enumerable: true
|
|
327
|
+
});
|
|
328
|
+
const refNames = {};
|
|
329
|
+
for (const key of Object.keys(this._refDefs)) {
|
|
330
|
+
refNames[key] = key;
|
|
331
|
+
}
|
|
332
|
+
Object.defineProperty(El, "refs", {
|
|
333
|
+
value: Object.freeze(refNames),
|
|
334
|
+
enumerable: true
|
|
335
|
+
});
|
|
336
|
+
if (typeof customElements !== "undefined") {
|
|
337
|
+
customElements.define(this.tagName, El);
|
|
338
|
+
}
|
|
339
|
+
return El;
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
function define(tagName) {
|
|
343
|
+
return new ComponentBuilder(tagName);
|
|
344
|
+
}
|
|
345
|
+
__name(define, "define");
|
|
3
346
|
export {
|
|
4
347
|
define,
|
|
5
348
|
peek,
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/
|
|
4
|
-
"sourcesContent": ["export { peek, untracked } from './reactivity.js'\nexport { define } from './builders.js'\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,MAAM,
|
|
3
|
+
"sources": ["../src/setup-context.ts", "../src/factory.ts", "../src/builders.ts"],
|
|
4
|
+
"sourcesContent": ["import { effect, peek } from './reactivity.js'\nimport { resolveContextSignal } from './context.js'\nimport type {\n SetupContext,\n Cleanup,\n Signal,\n PropsSignals,\n PropDef,\n ContextToken,\n} from './types.js'\n\n/**\n * Build the ctx object passed to a component's setup() callback.\n * The cleanups array is mutated in place so factory.ts can drain it\n * on disconnect without copying.\n */\nexport function makeSetupContext<\n Props extends Record<string, PropDef> = Record<string, PropDef>,\n> (\n host:HTMLElement,\n props:PropsSignals<Props>,\n refs:Record<string, Element | Element[]>,\n contexts:Record<string, unknown>,\n cleanups:Cleanup[]\n):SetupContext<Props, any, any> {\n return {\n host,\n props,\n refs,\n contexts,\n\n peek,\n\n on (target, type, handler, options?) {\n target.addEventListener(\n type as string,\n handler as EventListener,\n options\n )\n cleanups.push(() => {\n target.removeEventListener(\n type as string,\n handler as EventListener,\n options\n )\n })\n },\n\n effect (fn) {\n const dispose = effect(fn)\n cleanups.push(dispose)\n },\n\n bind (source, control, opts) {\n const input = control instanceof HTMLInputElement ?\n control :\n undefined\n let prop = 'value'\n let autoEvent = 'change'\n if (input?.type === 'checkbox') {\n prop = 'checked'\n } else if (input?.type === 'number' ||\n input?.type === 'range') {\n prop = 'valueAsNumber'\n autoEvent = 'input'\n } else if (input || control instanceof HTMLTextAreaElement) {\n autoEvent = 'input'\n }\n\n const boundProp = opts?.prop ?? prop\n const event = opts ? opts.event : autoEvent\n const el = control as unknown as Record<string, unknown>\n\n if (event) {\n const handler = () => {\n const writable = source as Signal<unknown>\n writable(el[boundProp])\n }\n control.addEventListener(event, handler)\n cleanups.push(() => {\n control.removeEventListener(event, handler)\n })\n }\n\n const dispose = effect(() => {\n el[boundProp] = source()\n })\n cleanups.push(dispose)\n },\n\n onCleanup (fn) {\n cleanups.push(fn)\n },\n\n consume<T> (token:ContextToken<T>):T | undefined {\n const sig = resolveContextSignal(host, token)\n return sig ? sig() : undefined\n },\n }\n}\n", "import { signal } from './reactivity.js'\nimport { runCleanups } from './util.js'\nimport { makeSetupContext } from './setup-context.js'\nimport {\n resolveContextSignal,\n onContextAvailable,\n} from './context.js'\nimport type {\n PropsSignals,\n Signal,\n SetupContext,\n Cleanup,\n Coercer,\n ContextToken,\n RefDef,\n} from './types.js'\n\n/**\n * Map of prop name to coercer function.\n * The factory accepts coercers exclusively; Standard Schema support is\n * layered on top in the withProps builder (US-005).\n */\nexport type FactoryProps = Record<string, Coercer<unknown>>\n\n/**\n * The class to extend for custom elements. In the browser this is the\n * real HTMLElement; in Node (e.g. reading `.TAG` for SSR) it falls back\n * to an empty stub so the class can be defined without a DOM. The stub\n * is never instantiated or registered outside the browser.\n */\nconst HTMLElementBase = typeof HTMLElement !== 'undefined' ?\n HTMLElement :\n (class {} as unknown as typeof HTMLElement)\n\n/** Configuration passed to factory(). */\nexport interface FactoryConfig<Props extends FactoryProps = FactoryProps> {\n /** Coercer for each observed attribute / prop. */\n props:Props\n /** Attribute names to pass to observedAttributes. */\n observedAttrNames:string[]\n /** Ref definitions keyed by name. */\n refs?:Record<string, RefDef>\n /** Context tokens keyed by name. */\n contexts?:Record<string, ContextToken<unknown>>\n /** Setup callback receiving the component context. */\n setup:(ctx:SetupContext<Props, any, any>) => void\n}\n\n/**\n * Collect resolved DOM refs from within a host element.\n * Throws if any single-ref element is missing.\n */\nfunction collectRefs (\n host:HTMLElement,\n defs:Record<string, RefDef>\n):Record<string, Element | Element[]> {\n const result:Record<string, Element | Element[]> = {}\n const missing:string[] = []\n for (const [key, def] of Object.entries(defs)) {\n const sel = def.selector ?? `[data-ref=\"${key}\"]`\n if (def._microtag === 'ref:all') {\n result[key] = Array.from(host.querySelectorAll(sel))\n } else {\n const el = host.querySelector(sel)\n if (!el) {\n missing.push(key)\n } else {\n result[key] = el\n }\n }\n }\n if (missing.length > 0) {\n throw new Error(\n `${host.tagName}: missing refs: ${missing.join(', ')}`\n )\n }\n return result\n}\n\n/**\n * Create an HTMLElement subclass with the microtags lifecycle.\n * The returned class has no Shadow DOM, tracks its own prop signals,\n * and runs setup() on connect / cleanups on disconnect.\n */\nexport function factory<Props extends FactoryProps = FactoryProps> (\n config:FactoryConfig<Props>\n):typeof HTMLElement {\n const {\n props: propDefs,\n observedAttrNames,\n setup,\n refs: refDefs = {},\n contexts: ctxDefs = {},\n } = config\n\n class MicrotagElement extends HTMLElementBase {\n static get observedAttributes () { return observedAttrNames }\n\n _props:Record<string, Signal<unknown>> = {}\n _cleanups:Cleanup[] = []\n\n constructor () {\n super()\n for (const [name, coercer] of Object.entries(propDefs)) {\n this._props[name] = signal(coercer(null))\n }\n }\n\n connectedCallback () {\n // Start a fresh cleanup scope for each connection cycle.\n this._cleanups = []\n\n // Hydrate prop signals from attributes; preserve any\n // programmatically-set value when the attribute is absent.\n for (const [name, coercer] of Object.entries(propDefs)) {\n const attrVal = this.getAttribute(name)\n if (attrVal !== null) {\n (this._props[name] as Signal<unknown>)(coercer(attrVal))\n }\n }\n\n const cleanups = this._cleanups\n const props = this._props as PropsSignals<Props>\n\n // Reactive Proxy: reading a key inside a ctx.effect creates\n // a subscription to the provider's alien-signals signal.\n const contexts = new Proxy({} as Record<string, unknown>, {\n get: (_target, key) => {\n if (typeof key !== 'string') return undefined\n const token = ctxDefs[key]\n if (!token) return undefined\n const sig = resolveContextSignal(this, token)\n return sig ? sig() : undefined\n },\n has: (_target, key) => {\n if (typeof key !== 'string') return false\n return key in ctxDefs\n },\n })\n\n let setupRan = false\n // Tracks pending-context cancel functions so they are\n // removed from the global registry when setup runs or\n // when the element disconnects.\n const cancelCallbacks:(() => void)[] = []\n\n const tryRunSetup = ():void => {\n if (setupRan) return\n for (const token of Object.values(ctxDefs)) {\n if (!resolveContextSignal(this, token)) return\n }\n setupRan = true\n for (const cancel of cancelCallbacks) cancel()\n cancelCallbacks.length = 0\n\n const refs = collectRefs(this, refDefs)\n const ctx = makeSetupContext(\n this, props, refs, contexts, cleanups\n )\n setup(ctx)\n }\n\n // Deferred variant: skip if element was disconnected before\n // the context became available.\n const tryRunSetupIfConnected = ():void => {\n if (!this.isConnected) return\n tryRunSetup()\n }\n\n // Register pending listeners for any missing contexts.\n for (const token of Object.values(ctxDefs)) {\n if (!resolveContextSignal(this, token)) {\n const cancel = onContextAvailable(\n token.id, tryRunSetupIfConnected\n )\n cancelCallbacks.push(cancel)\n // Also cancel on disconnect so we don't leak.\n cleanups.push(cancel)\n }\n }\n\n tryRunSetup()\n }\n\n attributeChangedCallback (\n name:string,\n _old:string | null,\n next:string | null\n ) {\n const coercer = propDefs[name]\n if (coercer !== undefined && this._props[name] !== undefined) {\n (this._props[name] as Signal<unknown>)(coercer(next))\n }\n }\n\n disconnectedCallback () {\n // Snapshot and clear BEFORE running so re-entrant calls are safe\n // and the array is always empty after this returns (or throws).\n const fns = this._cleanups\n this._cleanups = []\n runCleanups(fns)\n }\n }\n\n return MicrotagElement\n}\n", "import type { StandardSchemaV1 } from '@standard-schema/spec'\nimport type {\n PropDef,\n PropertyOnlyProp,\n SetupContext,\n Coercer,\n RefDef,\n SingleRefDef,\n MultipleRefDef,\n RefsMap,\n ContextToken,\n ContextsMap,\n} from './types.js'\nimport {\n coerceNumber,\n coerceString,\n coerceBoolean,\n coerceJson,\n} from './util.js'\nimport { factory } from './factory.js'\n\nfunction isPropOnly (def:unknown):def is PropertyOnlyProp<unknown> {\n return (\n typeof def === 'object' &&\n def !== null &&\n '_microtag' in def &&\n (def as { _microtag: unknown })._microtag === 'prop'\n )\n}\n\nfunction isStandardSchema (def:unknown):def is StandardSchemaV1 {\n return (\n typeof def === 'object' &&\n def !== null &&\n '~standard' in def\n )\n}\n\nfunction normalizePropDef (\n name:string,\n def:PropDef<unknown>\n):Coercer<unknown> {\n if (isPropOnly(def)) {\n return (_raw:string | null) => def.initial\n }\n if (isStandardSchema(def)) {\n const schema = def as StandardSchemaV1\n return (raw:string | null):unknown => {\n const result = schema['~standard'].validate(raw)\n if (result instanceof Promise) {\n throw new TypeError(\n `withProps: async schemas are not supported (prop \"${name}\")`\n )\n }\n if (result.issues) return undefined\n return result.value\n }\n }\n return def as Coercer<unknown>\n}\n\n/** The DSL object passed to the withProps callback. */\nexport type PropDSL = {\n number():Coercer<number>\n string():Coercer<string>\n boolean():Coercer<boolean>\n json<T>():Coercer<T | undefined>\n schema<T>(validator:StandardSchemaV1<unknown, T>):StandardSchemaV1<unknown, T>\n prop<T>(initial:T):PropertyOnlyProp<T>\n}\n\nexport const propDSL:PropDSL = {\n number: () => coerceNumber,\n string: () => coerceString,\n boolean: () => coerceBoolean,\n json: <T>() => coerceJson as Coercer<T | undefined>,\n schema: <T>(v:StandardSchemaV1<unknown, T>) => v,\n prop: <T>(initial:T):PropertyOnlyProp<T> => (\n { _microtag: 'prop', initial }\n ),\n}\n\n/**\n * DSL object passed to the withRefs callback.\n * Call `r.one()` for a single element or `r.all()` for multiple. Pass a\n * CSS selector to query by it, or omit it to match `[data-ref=\"<key>\"]`.\n *\n * Element typing:\n * - `r.one()` defaults to `HTMLElement`.\n * - `r.one<T>()` sets the type and keeps the `[data-ref]` selector.\n * - `r.one('button')` infers the type from the tag AND queries by that\n * tag, exactly like `document.querySelector('button')`.\n */\nexport type RefsDSL = {\n one<K extends keyof HTMLElementTagNameMap>(\n selector:K\n ):SingleRefDef<HTMLElementTagNameMap[K]>\n one<T extends HTMLElement = HTMLElement>(selector?:string):SingleRefDef<T>\n\n all<K extends keyof HTMLElementTagNameMap>(\n selector:K\n ):MultipleRefDef<HTMLElementTagNameMap[K]>\n all<T extends HTMLElement = HTMLElement>(selector?:string):MultipleRefDef<T>\n}\n\nexport const refsDSL:RefsDSL = {\n one: ((selector?:string):SingleRefDef => (\n { _microtag: 'ref:one', selector }\n )) as RefsDSL['one'],\n all: ((selector?:string):MultipleRefDef => (\n { _microtag: 'ref:all', selector }\n )) as RefsDSL['all'],\n}\n\n/**\n * DSL object passed to the withContexts callback.\n * Currently a no-op placeholder; the user references imported\n * context tokens directly in the returned record.\n */\nexport type ContextDSL = Record<never, never>\nconst contextDSL:ContextDSL = {}\n\n/**\n * Maps each declared ref key to its own name as a string literal. Exposed\n * as the static `refs` on a registered element so server-rendered templates\n * can fill in `data-ref` values without hardcoding the names, e.g.\n * `data-ref=\"${myCounter.refs.dec}\"`.\n */\nexport type RefNames<RefDefs extends Record<string, RefDef>> = {\n readonly [K in keyof RefDefs]:K & string\n}\n\n/**\n * A registered custom element class that also exposes, as static members,\n * the tag name it was registered under (`TAG`) and the names of its\n * declared refs (`refs`).\n */\nexport type MicrotagElementClass<\n RefDefs extends Record<string, RefDef> = Record<never, never>\n> = typeof HTMLElement & {\n /** The custom element tag name, e.g. 'my-counter'. */\n readonly TAG:string\n /**\n * The declared ref names, each mapping to its own `data-ref` string.\n * Lets server-rendered markup reference refs by key instead of a magic\n * string: `myCounter.refs.dec`.\n */\n readonly refs:RefNames<RefDefs>\n}\n\n/**\n * Fluent builder that accumulates props/refs/contexts config\n * before registering a custom element via `.setup()`.\n */\nexport class ComponentBuilder<\n Props extends Record<string, PropDef> = Record<never, never>,\n RefDefs extends Record<string, RefDef> = Record<never, never>,\n CtxDefs extends Record<string, ContextToken<unknown>> =\n Record<never, never>,\n> {\n private readonly _coercers:Record<string, Coercer<unknown>>\n private readonly _observed:string[]\n private readonly _refDefs:Record<string, RefDef>\n private readonly _ctxDefs:Record<string, ContextToken<unknown>>\n\n constructor (\n readonly tagName:string,\n coercers:Record<string, Coercer<unknown>> = {},\n observed:string[] = [],\n refDefs:Record<string, RefDef> = {},\n ctxDefs:Record<string, ContextToken<unknown>> = {}\n ) {\n this._coercers = coercers\n this._observed = observed\n this._refDefs = refDefs\n this._ctxDefs = ctxDefs\n }\n\n /**\n * The custom element tag name, e.g. 'my-counter'. Available at every\n * point in the fluent chain since each builder method returns a new\n * builder carrying the same tag name.\n */\n get TAG ():string {\n return this.tagName\n }\n\n withProps<P extends Record<string, PropDef>> (\n fn:(p:PropDSL) => P\n ):ComponentBuilder<P, RefDefs, CtxDefs> {\n const defs = fn(propDSL)\n const coercers:Record<string, Coercer<unknown>> = {}\n const observed:string[] = []\n\n for (const [name, def] of Object.entries(defs)) {\n coercers[name] = normalizePropDef(name, def as PropDef<unknown>)\n if (!isPropOnly(def)) {\n observed.push(name)\n }\n }\n\n return new ComponentBuilder<P, RefDefs, CtxDefs>(\n this.tagName, coercers, observed, this._refDefs, this._ctxDefs\n )\n }\n\n withRefs<R extends Record<string, RefDef>> (\n fn:(r:RefsDSL) => R\n ):ComponentBuilder<Props, R, CtxDefs> {\n const defs = fn(refsDSL)\n return new ComponentBuilder<Props, R, CtxDefs>(\n this.tagName,\n this._coercers,\n this._observed,\n defs,\n this._ctxDefs\n )\n }\n\n withContexts<C extends Record<string, ContextToken<unknown>>> (\n fn:(c:ContextDSL) => C\n ):ComponentBuilder<Props, RefDefs, C> {\n const defs = fn(contextDSL)\n return new ComponentBuilder<Props, RefDefs, C>(\n this.tagName,\n this._coercers,\n this._observed,\n this._refDefs,\n defs\n )\n }\n\n setup (\n fn:(ctx:SetupContext<\n Props,\n RefsMap<RefDefs>,\n ContextsMap<CtxDefs>\n >) => void\n ):MicrotagElementClass<RefDefs> {\n const El = factory({\n props: this._coercers,\n observedAttrNames: this._observed,\n refs: this._refDefs,\n contexts: this._ctxDefs,\n setup: fn as any,\n })\n Object.defineProperty(El, 'TAG', {\n value: this.tagName,\n enumerable: true,\n })\n\n // Expose each ref key as its own `data-ref` name so server-rendered\n // markup can reference refs by key instead of a hardcoded string.\n const refNames:Record<string, string> = {}\n for (const key of Object.keys(this._refDefs)) {\n refNames[key] = key\n }\n Object.defineProperty(El, 'refs', {\n value: Object.freeze(refNames),\n enumerable: true,\n })\n\n if (typeof customElements !== 'undefined') {\n customElements.define(this.tagName, El)\n }\n return El as MicrotagElementClass<RefDefs>\n }\n}\n\n/** Create a new component builder for the given tag name. */\nexport function define (tagName:string):ComponentBuilder {\n return new ComponentBuilder(tagName)\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAgBO,SAAS,iBAGZ,MACA,OACA,MACA,UACA,UAC4B;AAC5B,SAAO;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IAEA,GAAI,QAAQ,MAAM,SAAS,SAAU;AACjC,aAAO;AAAA,QACH;AAAA,QACA;AAAA,QACA;AAAA,MACJ;AACA,eAAS,KAAK,MAAM;AAChB,eAAO;AAAA,UACH;AAAA,UACA;AAAA,UACA;AAAA,QACJ;AAAA,MACJ,CAAC;A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