lego-dom 0.0.8 → 0.0.9
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 +48 -432
- package/docs/.vitepress/config.js +4 -4
- package/docs/.vitepress/dist/404.html +3 -3
- package/docs/.vitepress/dist/api/define.html +6 -6
- package/docs/.vitepress/dist/api/directives.html +6 -6
- package/docs/.vitepress/dist/api/globals.html +7 -7
- package/docs/.vitepress/dist/api/index.html +7 -7
- package/docs/.vitepress/dist/api/lifecycle.html +6 -6
- package/docs/.vitepress/dist/api/route.html +6 -6
- package/docs/.vitepress/dist/api/vite-plugin.html +7 -7
- package/docs/.vitepress/dist/assets/{api_globals.md.DOjt7AV0.js → api_globals.md.CEznyRAY.js} +1 -1
- package/docs/.vitepress/dist/assets/api_index.md.IEYUxUIr.js +1 -0
- package/docs/.vitepress/dist/assets/{api_vite-plugin.md.DNn9VhL5.js → api_vite-plugin.md.DC8Li09k.js} +1 -1
- package/docs/.vitepress/dist/assets/{app.BG5s3B0P.js → app.BfblNDJy.js} +1 -1
- package/docs/.vitepress/dist/assets/chunks/@localSearchIndexroot.Crdp7-Zp.js +1 -0
- package/docs/.vitepress/dist/assets/chunks/{VPLocalSearchBox.BO-PSxt1.js → VPLocalSearchBox.C18E44rY.js} +1 -1
- package/docs/.vitepress/dist/assets/chunks/{theme.DA-iSa9B.js → theme.VX3itTW6.js} +2 -2
- package/docs/.vitepress/dist/assets/{examples_form.md.B3stGKbu.js → examples_form.md.DQoAgbLR.js} +1 -1
- package/docs/.vitepress/dist/assets/{examples_index.md.BDEG_D4J.js → examples_index.md.CVJJjXXE.js} +3 -5
- package/docs/.vitepress/dist/assets/{examples_routing.md.bqZ9DjDK.js → examples_routing.md.sRnA5RXw.js} +4 -4
- package/docs/.vitepress/dist/assets/{examples_sfc-showcase.md.DLXaUiop.js → examples_sfc-showcase.md.DPf9Wm99.js} +4 -4
- package/docs/.vitepress/dist/assets/{examples_todo-app.md.D5RhZoo5.js → examples_todo-app.md.CqF4JaWn.js} +2 -2
- package/docs/.vitepress/dist/assets/{guide_cdn-usage.md.CAjf03Lr.js → guide_cdn-usage.md.CjIjusre.js} +8 -8
- package/docs/.vitepress/dist/assets/{guide_components.md.BIFWF1Hc.js → guide_components.md.CMU3iM6R.js} +1 -1
- package/docs/.vitepress/dist/assets/guide_contributing.md.Crrv3T_0.js +1 -0
- package/docs/.vitepress/dist/assets/{guide_directives.md.Bi3ynu1d.js → guide_directives.md.DFwqvqOv.js} +1 -1
- package/docs/.vitepress/dist/assets/{guide_getting-started.md.2Nr1lp2z.js → guide_getting-started.md.DtaJPe0i.js} +5 -5
- package/docs/.vitepress/dist/assets/guide_index.md.DtJVpLI9.js +2 -0
- package/docs/.vitepress/dist/assets/guide_index.md.DtJVpLI9.lean.js +1 -0
- package/docs/.vitepress/dist/assets/{guide_lifecycle.md.B28j1OzS.js → guide_lifecycle.md.CfY3jlU1.js} +1 -1
- package/docs/.vitepress/dist/assets/{guide_quick-start.md.CNk3VGTF.js → guide_quick-start.md.CwdNNA21.js} +4 -4
- package/docs/.vitepress/dist/assets/{guide_reactivity.md.CVsaMaPv.js → guide_reactivity.md.DgTH0MTn.js} +8 -8
- package/docs/.vitepress/dist/assets/{guide_routing.md.DSpDP25o.js → guide_routing.md.nMB0QOBR.js} +3 -3
- package/docs/.vitepress/dist/assets/{guide_sfc.md.CVUP66tS.js → guide_sfc.md.BUkWma1z.js} +39 -39
- package/docs/.vitepress/dist/assets/{guide_templating.md.BgCGe4aa.js → guide_templating.md.XI3uUlYI.js} +2 -2
- package/docs/.vitepress/dist/assets/guide_templating.md.XI3uUlYI.lean.js +1 -0
- package/docs/.vitepress/dist/assets/{index.md.xV1taCED.js → index.md.M4_o26kF.js} +2 -2
- package/docs/.vitepress/dist/assets/index.md.M4_o26kF.lean.js +1 -0
- package/docs/.vitepress/dist/examples/form.html +7 -7
- package/docs/.vitepress/dist/examples/index.html +26 -342
- package/docs/.vitepress/dist/examples/routing.html +11 -11
- package/docs/.vitepress/dist/examples/sfc-showcase.html +11 -11
- package/docs/.vitepress/dist/examples/todo-app.html +8 -8
- package/docs/.vitepress/dist/guide/cdn-usage.html +14 -14
- package/docs/.vitepress/dist/guide/components.html +7 -7
- package/docs/.vitepress/dist/guide/contributing.html +7 -7
- package/docs/.vitepress/dist/guide/directives.html +8 -8
- package/docs/.vitepress/dist/guide/getting-started.html +11 -11
- package/docs/.vitepress/dist/guide/index.html +8 -8
- package/docs/.vitepress/dist/guide/lifecycle.html +7 -7
- package/docs/.vitepress/dist/guide/quick-start.html +10 -10
- package/docs/.vitepress/dist/guide/reactivity.html +14 -14
- package/docs/.vitepress/dist/guide/routing.html +9 -9
- package/docs/.vitepress/dist/guide/sfc.html +46 -46
- package/docs/.vitepress/dist/guide/templating.html +8 -8
- package/docs/.vitepress/dist/hashmap.json +1 -1
- package/docs/.vitepress/dist/index.html +8 -8
- package/docs/.vitepress/dist/logo.svg +1 -1
- package/docs/api/globals.md +1 -1
- package/docs/api/index.md +2 -2
- package/docs/api/vite-plugin.md +1 -1
- package/docs/examples/form.md +1 -1
- package/docs/examples/index.md +3 -3
- package/docs/examples/routing.md +4 -4
- package/docs/examples/sfc-showcase.md +4 -4
- package/docs/examples/todo-app.md +2 -2
- package/docs/guide/cdn-usage.md +8 -8
- package/docs/guide/components.md +1 -1
- package/docs/guide/contributing.md +2 -2
- package/docs/guide/directives.md +1 -1
- package/docs/guide/getting-started.md +6 -6
- package/docs/guide/index.md +9 -9
- package/docs/guide/lifecycle.md +1 -1
- package/docs/guide/quick-start.md +4 -4
- package/docs/guide/reactivity.md +8 -8
- package/docs/guide/routing.md +3 -3
- package/docs/guide/sfc.md +39 -39
- package/docs/guide/templating.md +2 -2
- package/docs/index.md +10 -10
- package/docs/public/logo.svg +17 -38
- package/examples/vite-app/README.md +2 -2
- package/examples/vite-app/index.html +8 -4
- package/examples/vite-app/src/components/greeting-card.lego +25 -25
- package/examples/vite-app/src/components/sample-component.lego +44 -44
- package/examples/vite-app/src/components/todo-list.lego +242 -0
- package/examples/vite-app/src/main.js +3 -3
- package/examples/vite-app/vite.config.js +2 -1
- package/examples.js +3 -3
- package/go.html +117 -0
- package/lego.js +2 -0
- package/main.js +41 -35
- package/package.json +8 -3
- package/parse-lego.test.js +1 -1
- package/vite-plugin.js +2 -2
- package/docs/.vitepress/dist/assets/api_index.md.OS6h01ct.js +0 -1
- package/docs/.vitepress/dist/assets/chunks/@localSearchIndexroot.DQmuWC2Z.js +0 -1
- package/docs/.vitepress/dist/assets/guide_contributing.md.BgbUN-Mr.js +0 -1
- package/docs/.vitepress/dist/assets/guide_index.md.GvZq_Yf2.js +0 -2
- package/docs/.vitepress/dist/assets/guide_index.md.GvZq_Yf2.lean.js +0 -1
- package/docs/.vitepress/dist/assets/guide_templating.md.BgCGe4aa.lean.js +0 -1
- package/docs/.vitepress/dist/assets/index.md.xV1taCED.lean.js +0 -1
- /package/docs/.vitepress/dist/assets/{api_globals.md.DOjt7AV0.lean.js → api_globals.md.CEznyRAY.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{api_index.md.OS6h01ct.lean.js → api_index.md.IEYUxUIr.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{api_vite-plugin.md.DNn9VhL5.lean.js → api_vite-plugin.md.DC8Li09k.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{examples_form.md.B3stGKbu.lean.js → examples_form.md.DQoAgbLR.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{examples_index.md.BDEG_D4J.lean.js → examples_index.md.CVJJjXXE.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{examples_routing.md.bqZ9DjDK.lean.js → examples_routing.md.sRnA5RXw.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{examples_sfc-showcase.md.DLXaUiop.lean.js → examples_sfc-showcase.md.DPf9Wm99.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{examples_todo-app.md.D5RhZoo5.lean.js → examples_todo-app.md.CqF4JaWn.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{guide_cdn-usage.md.CAjf03Lr.lean.js → guide_cdn-usage.md.CjIjusre.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{guide_components.md.BIFWF1Hc.lean.js → guide_components.md.CMU3iM6R.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{guide_contributing.md.BgbUN-Mr.lean.js → guide_contributing.md.Crrv3T_0.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{guide_directives.md.Bi3ynu1d.lean.js → guide_directives.md.DFwqvqOv.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{guide_getting-started.md.2Nr1lp2z.lean.js → guide_getting-started.md.DtaJPe0i.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{guide_lifecycle.md.B28j1OzS.lean.js → guide_lifecycle.md.CfY3jlU1.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{guide_quick-start.md.CNk3VGTF.lean.js → guide_quick-start.md.CwdNNA21.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{guide_reactivity.md.CVsaMaPv.lean.js → guide_reactivity.md.DgTH0MTn.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{guide_routing.md.DSpDP25o.lean.js → guide_routing.md.nMB0QOBR.lean.js} +0 -0
- /package/docs/.vitepress/dist/assets/{guide_sfc.md.CVUP66tS.lean.js → guide_sfc.md.BUkWma1z.lean.js} +0 -0
package/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const Lego = (() => {
|
|
2
2
|
const registry = {}, proxyCache = new WeakMap(), privateData = new WeakMap();
|
|
3
3
|
const forPools = new WeakMap();
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
const sfcLogic = new Map();
|
|
6
6
|
const sharedStates = new Map(); // Track singleton states for $registry
|
|
7
7
|
const routes = [];
|
|
@@ -17,22 +17,22 @@ const Lego = (() => {
|
|
|
17
17
|
let queued = false;
|
|
18
18
|
const componentsToUpdate = new Set();
|
|
19
19
|
let isProcessing = false;
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
return {
|
|
22
22
|
add: (el) => {
|
|
23
|
-
if (!el || isProcessing) return;
|
|
23
|
+
if (!el || isProcessing) return;
|
|
24
24
|
componentsToUpdate.add(el);
|
|
25
25
|
if (queued) return;
|
|
26
26
|
queued = true;
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
requestAnimationFrame(() => {
|
|
29
29
|
isProcessing = true;
|
|
30
30
|
const batch = Array.from(componentsToUpdate);
|
|
31
31
|
componentsToUpdate.clear();
|
|
32
32
|
queued = false;
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
batch.forEach(el => render(el));
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
setTimeout(() => {
|
|
37
37
|
batch.forEach(el => {
|
|
38
38
|
const state = el._studs;
|
|
@@ -124,7 +124,7 @@ const Lego = (() => {
|
|
|
124
124
|
const safeEval = (expr, context) => {
|
|
125
125
|
try {
|
|
126
126
|
const scope = context.state || {};
|
|
127
|
-
|
|
127
|
+
|
|
128
128
|
const helpers = {
|
|
129
129
|
$ancestors: (tag) => findAncestorState(context.self, tag),
|
|
130
130
|
// Helper to access shared state by tag name
|
|
@@ -146,7 +146,7 @@ const Lego = (() => {
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
`);
|
|
149
|
-
|
|
149
|
+
|
|
150
150
|
const result = func.call(scope, context.global, context.self, context.event, helpers);
|
|
151
151
|
if (typeof result === 'function') return result.call(scope, context.event);
|
|
152
152
|
return result;
|
|
@@ -167,10 +167,10 @@ const Lego = (() => {
|
|
|
167
167
|
const bind = (container, componentRoot, loopCtx = null) => {
|
|
168
168
|
const state = componentRoot._studs;
|
|
169
169
|
const elements = container instanceof Element ? [container, ...container.querySelectorAll('*')] : container.querySelectorAll('*');
|
|
170
|
-
|
|
170
|
+
|
|
171
171
|
elements.forEach(child => {
|
|
172
172
|
const childData = getPrivateData(child);
|
|
173
|
-
if (childData.bound) return;
|
|
173
|
+
if (childData.bound) return;
|
|
174
174
|
|
|
175
175
|
[...child.attributes].forEach(attr => {
|
|
176
176
|
if (attr.name.startsWith('@')) {
|
|
@@ -234,14 +234,14 @@ const Lego = (() => {
|
|
|
234
234
|
if (node.hasAttribute('b-for')) {
|
|
235
235
|
const match = node.getAttribute('b-for').match(/^\s*(\w+)\s+in\s+(.+)\s*$/);
|
|
236
236
|
if (match) {
|
|
237
|
-
bindings.push({
|
|
238
|
-
type: 'b-for',
|
|
239
|
-
node,
|
|
240
|
-
itemName: match[1],
|
|
241
|
-
listName: match[2].trim(),
|
|
242
|
-
template: node.innerHTML
|
|
237
|
+
bindings.push({
|
|
238
|
+
type: 'b-for',
|
|
239
|
+
node,
|
|
240
|
+
itemName: match[1],
|
|
241
|
+
listName: match[2].trim(),
|
|
242
|
+
template: node.innerHTML
|
|
243
243
|
});
|
|
244
|
-
node.innerHTML = '';
|
|
244
|
+
node.innerHTML = '';
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
if (node.hasAttribute('b-text')) bindings.push({ type: 'b-text', node, path: node.getAttribute('b-text') });
|
|
@@ -326,12 +326,12 @@ const Lego = (() => {
|
|
|
326
326
|
}
|
|
327
327
|
const localScope = Object.assign(Object.create(state), { [b.itemName]: item });
|
|
328
328
|
updateNodeBindings(child, localScope);
|
|
329
|
-
|
|
329
|
+
|
|
330
330
|
child.querySelectorAll('[b-sync]').forEach(input => {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
331
|
+
const path = input.getAttribute('b-sync');
|
|
332
|
+
if (path.startsWith(b.itemName + '.')) {
|
|
333
|
+
syncModelValue(input, resolve(path.split('.').slice(1).join('.'), item));
|
|
334
|
+
}
|
|
335
335
|
});
|
|
336
336
|
if (b.node.children[i] !== child) b.node.insertBefore(child, b.node.children[i] || null);
|
|
337
337
|
});
|
|
@@ -349,23 +349,23 @@ const Lego = (() => {
|
|
|
349
349
|
if (!el || el.nodeType !== 1) return;
|
|
350
350
|
const data = getPrivateData(el);
|
|
351
351
|
const name = el.tagName.toLowerCase();
|
|
352
|
-
|
|
352
|
+
|
|
353
353
|
if (registry[name] && !data.snapped) {
|
|
354
354
|
data.snapped = true;
|
|
355
355
|
const tpl = registry[name].content.cloneNode(true);
|
|
356
356
|
const shadow = el.attachShadow({ mode: 'open' });
|
|
357
|
-
|
|
357
|
+
|
|
358
358
|
const defaultLogic = sfcLogic.get(name) || {};
|
|
359
359
|
const attrLogic = parseJSObject(el.getAttribute('b-data') || '{}');
|
|
360
360
|
el._studs = reactive({ ...defaultLogic, ...attrLogic }, el);
|
|
361
|
-
|
|
361
|
+
|
|
362
362
|
shadow.appendChild(tpl);
|
|
363
|
-
|
|
363
|
+
|
|
364
364
|
const style = shadow.querySelector('style');
|
|
365
365
|
if (style) {
|
|
366
366
|
style.textContent = style.textContent.replace(/\bself\b/g, ':host');
|
|
367
367
|
}
|
|
368
|
-
|
|
368
|
+
|
|
369
369
|
bind(shadow, el);
|
|
370
370
|
render(el);
|
|
371
371
|
|
|
@@ -373,9 +373,9 @@ const Lego = (() => {
|
|
|
373
373
|
try { el._studs.mounted.call(el._studs); } catch (e) { console.error(`[Lego] Error in mounted <${name}>:`, e); }
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
|
-
|
|
376
|
+
|
|
377
377
|
let provider = el.parentElement;
|
|
378
|
-
while(provider && !provider._studs) provider = provider.parentElement;
|
|
378
|
+
while (provider && !provider._studs) provider = provider.parentElement;
|
|
379
379
|
if (provider && provider._studs) bind(el, provider);
|
|
380
380
|
|
|
381
381
|
[...el.children].forEach(snap);
|
|
@@ -399,7 +399,7 @@ const Lego = (() => {
|
|
|
399
399
|
|
|
400
400
|
if (match.middleware) {
|
|
401
401
|
const allowed = await match.middleware(params, Lego.globals);
|
|
402
|
-
if (!allowed) return;
|
|
402
|
+
if (!allowed) return;
|
|
403
403
|
}
|
|
404
404
|
|
|
405
405
|
Lego.globals.params = params;
|
|
@@ -409,13 +409,19 @@ const Lego = (() => {
|
|
|
409
409
|
return {
|
|
410
410
|
init: () => {
|
|
411
411
|
document.querySelectorAll('template[b-id]').forEach(t => registry[t.getAttribute('b-id')] = t);
|
|
412
|
-
const observer = new MutationObserver(m => m.forEach(r => {
|
|
413
|
-
r.addedNodes.forEach(n => n.nodeType === 1 && snap(n));
|
|
414
|
-
r.removedNodes.forEach(n => n.nodeType === 1 && unsnap(n));
|
|
412
|
+
const observer = new MutationObserver(m => m.forEach(r => {
|
|
413
|
+
r.addedNodes.forEach(n => n.nodeType === 1 && snap(n));
|
|
414
|
+
r.removedNodes.forEach(n => n.nodeType === 1 && unsnap(n));
|
|
415
415
|
}));
|
|
416
416
|
observer.observe(document.body, { childList: true, subtree: true });
|
|
417
|
+
|
|
418
|
+
// Also snap the root element (body) to catch attributes like @event
|
|
417
419
|
snap(document.body);
|
|
418
420
|
|
|
421
|
+
// Bind body specifically to catch global listeners like @todo-added in go.html
|
|
422
|
+
// We pass a mock componentRoot that points to Lego.globals
|
|
423
|
+
bind(document.body, { _studs: Lego.globals, _data: { bound: false } });
|
|
424
|
+
|
|
419
425
|
if (routes.length > 0) {
|
|
420
426
|
window.addEventListener('popstate', _matchRoute);
|
|
421
427
|
document.addEventListener('click', e => {
|
|
@@ -436,10 +442,10 @@ const Lego = (() => {
|
|
|
436
442
|
t.innerHTML = templateHTML;
|
|
437
443
|
registry[tagName] = t;
|
|
438
444
|
sfcLogic.set(tagName, logic);
|
|
439
|
-
|
|
445
|
+
|
|
440
446
|
// Initialize shared state for $registry singleton
|
|
441
447
|
sharedStates.set(tagName.toLowerCase(), reactive({ ...logic }, document.body));
|
|
442
|
-
|
|
448
|
+
|
|
443
449
|
document.querySelectorAll(tagName).forEach(snap);
|
|
444
450
|
},
|
|
445
451
|
route: (path, tagName, middleware = null) => {
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lego-dom",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "A feature-rich web components + SFC frontend framework",
|
|
6
6
|
"main": "main.js",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"exports": {
|
|
9
|
-
".": "./
|
|
9
|
+
".": "./lego.js",
|
|
10
10
|
"./main.js": "./main.js",
|
|
11
|
+
"./lego.js": "./lego.js",
|
|
11
12
|
"./vite-plugin": "./vite-plugin.js",
|
|
12
13
|
"./parse-lego": "./parse-lego.js"
|
|
13
14
|
},
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
"lego",
|
|
19
20
|
"legokit"
|
|
20
21
|
],
|
|
21
|
-
"author": "",
|
|
22
|
+
"author": "Tersoo Ortserga",
|
|
22
23
|
"scripts": {
|
|
23
24
|
"test": "vitest run",
|
|
24
25
|
"docs:dev": "vitepress dev docs",
|
|
@@ -40,5 +41,9 @@
|
|
|
40
41
|
},
|
|
41
42
|
"dependencies": {
|
|
42
43
|
"fast-glob": "^3.3.2"
|
|
44
|
+
},
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "https://github.com/rayattack/legodom.git"
|
|
43
48
|
}
|
|
44
49
|
}
|
package/parse-lego.test.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
2
|
import { parseLego, generateDefineCall, validateLego, deriveComponentName } from './parse-lego.js';
|
|
3
3
|
|
|
4
|
-
describe('
|
|
4
|
+
describe('Lego SFC Parser', () => {
|
|
5
5
|
describe('deriveComponentName', () => {
|
|
6
6
|
it('should derive component name from filename', () => {
|
|
7
7
|
expect(deriveComponentName('sample-component.lego')).toBe('sample-component');
|
package/vite-plugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Vite plugin for
|
|
2
|
+
* Vite plugin for Lego Single File Components
|
|
3
3
|
* Auto-discovers and transforms .lego files
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@ const VIRTUAL_MODULE_ID = 'virtual:lego-components';
|
|
|
11
11
|
const RESOLVED_VIRTUAL_MODULE_ID = '\0' + VIRTUAL_MODULE_ID;
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Vite plugin for
|
|
14
|
+
* Vite plugin for Lego SFC support
|
|
15
15
|
* @param {object} options - Plugin options
|
|
16
16
|
* @param {string} options.componentsDir - Directory to search for .lego files
|
|
17
17
|
* @param {string[]} options.include - Glob patterns to include
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as a,c as i,o,ag as l}from"./chunks/framework.B7OFBR9X.js";const m=JSON.parse('{"title":"API Reference","description":"","frontmatter":{},"headers":[],"relativePath":"api/index.md","filePath":"api/index.md"}'),r={name:"api/index.md"};function t(n,e,s,p,c,d){return o(),i("div",null,[...e[0]||(e[0]=[l('<h1 id="api-reference" tabindex="-1">API Reference <a class="header-anchor" href="#api-reference" aria-label="Permalink to "API Reference""></a></h1><p>Welcome to the LegoJS API documentation.</p><h2 id="core" tabindex="-1">Core <a class="header-anchor" href="#core" aria-label="Permalink to "Core""></a></h2><ul><li><a href="/LegoJS/api/define.html">Lego.define()</a> - Defining components</li><li><a href="/LegoJS/api/route.html">Lego.route()</a> - Client-side routing</li><li><a href="/LegoJS/api/globals.html">Lego.globals</a> - Global state</li><li><a href="/LegoJS/api/lifecycle.html">Lifecycle Hooks</a> - Component lifecycle methods</li></ul><h2 id="templates-binding" tabindex="-1">Templates & Binding <a class="header-anchor" href="#templates-binding" aria-label="Permalink to "Templates & Binding""></a></h2><ul><li><a href="/LegoJS/api/directives.html">Directives</a> - <code>b-if</code>, <code>b-for</code>, <code>b-sync</code></li></ul><h2 id="browser-support" tabindex="-1">Browser Support <a class="header-anchor" href="#browser-support" aria-label="Permalink to "Browser Support""></a></h2><p>LegoJS requires:</p><ul><li>Web Components (Custom Elements v1)</li><li>Shadow DOM v1</li><li>ES6 Proxy</li><li>Template Literals</li><li>MutationObserver</li></ul><p>Supported browsers:</p><ul><li>Chrome 63+</li><li>Firefox 63+</li><li>Safari 11.1+</li><li>Edge 79+</li></ul>',11)])])}const u=a(r,[["render",t]]);export{m as __pageData,u as default};
|