sibujs 1.0.0-beta.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/LICENSE +21 -0
- package/README.md +1630 -0
- package/dist/browser.cjs +815 -0
- package/dist/browser.d.cts +174 -0
- package/dist/browser.d.ts +174 -0
- package/dist/browser.js +458 -0
- package/dist/build.cjs +4970 -0
- package/dist/build.d.cts +630 -0
- package/dist/build.d.ts +630 -0
- package/dist/build.js +2478 -0
- package/dist/cdn.global.js +115 -0
- package/dist/chunk-27QC4FPL.js +67 -0
- package/dist/chunk-2ABBWCGC.js +65 -0
- package/dist/chunk-2MUNQYZ7.js +26 -0
- package/dist/chunk-2PSPKNUI.js +1711 -0
- package/dist/chunk-35CDLDX5.js +1758 -0
- package/dist/chunk-36MU4CFV.js +41 -0
- package/dist/chunk-3FIQOFI6.js +182 -0
- package/dist/chunk-3GHNC2BN.js +28 -0
- package/dist/chunk-3HLWWEPU.js +909 -0
- package/dist/chunk-3IVI3J54.js +252 -0
- package/dist/chunk-3KZ72WNW.js +944 -0
- package/dist/chunk-4AU64SQV.js +182 -0
- package/dist/chunk-4MOK7HAR.js +84 -0
- package/dist/chunk-4QK6FBDH.js +1429 -0
- package/dist/chunk-566Z7HXB.js +737 -0
- package/dist/chunk-5CRBB7XP.js +358 -0
- package/dist/chunk-5G67D3IZ.js +168 -0
- package/dist/chunk-5NCPAWBE.js +99 -0
- package/dist/chunk-5O2RKXR3.js +1444 -0
- package/dist/chunk-6BTBDO6A.js +633 -0
- package/dist/chunk-6IWEHW57.js +43 -0
- package/dist/chunk-6JGMNCD6.js +282 -0
- package/dist/chunk-6QRLJNXR.js +1425 -0
- package/dist/chunk-7HM5UE5T.js +270 -0
- package/dist/chunk-7JOLTGUH.js +58 -0
- package/dist/chunk-7MCWJCQK.js +909 -0
- package/dist/chunk-7RIIFP3E.js +1758 -0
- package/dist/chunk-7UASYN3G.js +254 -0
- package/dist/chunk-7W2WYHDI.js +741 -0
- package/dist/chunk-7Y35RDSJ.js +872 -0
- package/dist/chunk-A65GFJBL.js +65 -0
- package/dist/chunk-AD6ZIEDK.js +67 -0
- package/dist/chunk-AK5Y72F3.js +1426 -0
- package/dist/chunk-APOMMWH4.js +282 -0
- package/dist/chunk-ARZVTWIQ.js +1750 -0
- package/dist/chunk-AWWBM2BI.js +664 -0
- package/dist/chunk-AX5VEQTY.js +58 -0
- package/dist/chunk-AYTXVOW3.js +1708 -0
- package/dist/chunk-BG4A246G.js +1746 -0
- package/dist/chunk-BNFJJA2L.js +1425 -0
- package/dist/chunk-BPKPBVU5.js +59 -0
- package/dist/chunk-BPKPPSXC.js +282 -0
- package/dist/chunk-BPWKKK7F.js +1711 -0
- package/dist/chunk-CCKX6YTC.js +1735 -0
- package/dist/chunk-CIF5Z3MP.js +58 -0
- package/dist/chunk-CSXYU7IO.js +457 -0
- package/dist/chunk-D6JD4FDC.js +26 -0
- package/dist/chunk-E7NGA7X2.js +59 -0
- package/dist/chunk-EEPPJKAE.js +443 -0
- package/dist/chunk-EJMYGAGQ.js +717 -0
- package/dist/chunk-EL6Z5MDY.js +55 -0
- package/dist/chunk-EP7VRLEB.js +41 -0
- package/dist/chunk-ETMEC6FH.js +99 -0
- package/dist/chunk-EZ2WHYVL.js +65 -0
- package/dist/chunk-EZRVMSZK.js +67 -0
- package/dist/chunk-F2TRGINX.js +254 -0
- package/dist/chunk-F5JCIH3Q.js +642 -0
- package/dist/chunk-FGK3JKMN.js +909 -0
- package/dist/chunk-FQWPKSTD.js +1437 -0
- package/dist/chunk-FWHVLMCI.js +26 -0
- package/dist/chunk-GBEYQRO2.js +303 -0
- package/dist/chunk-GBLES3NK.js +248 -0
- package/dist/chunk-GQVGUQW6.js +1436 -0
- package/dist/chunk-HCV2T76T.js +457 -0
- package/dist/chunk-HS7ZKVPR.js +182 -0
- package/dist/chunk-HXDVV7HZ.js +909 -0
- package/dist/chunk-IB23VMO3.js +1746 -0
- package/dist/chunk-IEMZ7RTT.js +99 -0
- package/dist/chunk-IPGRSN42.js +1750 -0
- package/dist/chunk-IVMOK2QN.js +1750 -0
- package/dist/chunk-JCLGQO7T.js +443 -0
- package/dist/chunk-JDXL7KDB.js +1436 -0
- package/dist/chunk-JIIFW636.js +270 -0
- package/dist/chunk-JWGEEH7H.js +944 -0
- package/dist/chunk-K2BESAG7.js +1688 -0
- package/dist/chunk-K2U5YGF4.js +877 -0
- package/dist/chunk-K45FQ4Y4.js +175 -0
- package/dist/chunk-K7BPE427.js +1432 -0
- package/dist/chunk-KL3266RS.js +26 -0
- package/dist/chunk-KNN4P7DZ.js +84 -0
- package/dist/chunk-KP2DZH5Q.js +254 -0
- package/dist/chunk-KZHAJSQR.js +1636 -0
- package/dist/chunk-LBKGHMQV.js +1750 -0
- package/dist/chunk-LBTEPL7A.js +1731 -0
- package/dist/chunk-LEBBPTDB.js +1444 -0
- package/dist/chunk-LLH63WVQ.js +98 -0
- package/dist/chunk-LWVR2C4G.js +1711 -0
- package/dist/chunk-M3MDTVV2.js +896 -0
- package/dist/chunk-M5GNLDEO.js +303 -0
- package/dist/chunk-MFHVGKET.js +267 -0
- package/dist/chunk-MGWSG3PM.js +358 -0
- package/dist/chunk-MJNB47HB.js +19 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/chunk-MQWTY3JY.js +944 -0
- package/dist/chunk-MZZOQHNI.js +642 -0
- package/dist/chunk-NIHWGZS4.js +1426 -0
- package/dist/chunk-NSVVHQK5.js +41 -0
- package/dist/chunk-NVI2WE7D.js +443 -0
- package/dist/chunk-O7QBO3PH.js +58 -0
- package/dist/chunk-OAUPQBO2.js +270 -0
- package/dist/chunk-OB2LMD7C.js +297 -0
- package/dist/chunk-OHEYBWQU.js +58 -0
- package/dist/chunk-OI6OXUHJ.js +443 -0
- package/dist/chunk-OX2VMRMV.js +633 -0
- package/dist/chunk-P4FYE5TX.js +866 -0
- package/dist/chunk-P5KFWM4H.js +98 -0
- package/dist/chunk-PUMLE7RJ.js +1711 -0
- package/dist/chunk-Q4MFANBF.js +282 -0
- package/dist/chunk-QLEKZMMU.js +282 -0
- package/dist/chunk-RGGNGVO3.js +98 -0
- package/dist/chunk-RKJDRVV6.js +443 -0
- package/dist/chunk-S5BHU353.js +43 -0
- package/dist/chunk-SHQUSFH7.js +1426 -0
- package/dist/chunk-SMB4DBMD.js +182 -0
- package/dist/chunk-SNYHQP3D.js +743 -0
- package/dist/chunk-T24L3TBF.js +1717 -0
- package/dist/chunk-TAQNSOKT.js +692 -0
- package/dist/chunk-TDNY4SUA.js +41 -0
- package/dist/chunk-TNNF56IQ.js +1750 -0
- package/dist/chunk-TR7E6LYX.js +457 -0
- package/dist/chunk-URWUFH45.js +98 -0
- package/dist/chunk-UUSIH3XH.js +1429 -0
- package/dist/chunk-UYFNXLKR.js +1436 -0
- package/dist/chunk-V6F7KUWD.js +270 -0
- package/dist/chunk-VCZLXRMR.js +254 -0
- package/dist/chunk-VDHXSSBT.js +1426 -0
- package/dist/chunk-VM4QMKVK.js +254 -0
- package/dist/chunk-VWGYKYL2.js +737 -0
- package/dist/chunk-VX2OFBJN.js +1426 -0
- package/dist/chunk-VXVIE6DG.js +84 -0
- package/dist/chunk-W4OH7HG4.js +40 -0
- package/dist/chunk-WBVJX4GZ.js +98 -0
- package/dist/chunk-WDU2ZV4I.js +1426 -0
- package/dist/chunk-X6VUCICU.js +457 -0
- package/dist/chunk-XAY7FM7Y.js +618 -0
- package/dist/chunk-XJZ5Z2CM.js +642 -0
- package/dist/chunk-XKVFQTJJ.js +254 -0
- package/dist/chunk-XRLFASCY.js +22 -0
- package/dist/chunk-XYU6TZOW.js +182 -0
- package/dist/chunk-Y745CBVB.js +944 -0
- package/dist/chunk-YLBJSXYY.js +944 -0
- package/dist/chunk-YQJIKVPZ.js +1429 -0
- package/dist/chunk-YRM2VCZF.js +457 -0
- package/dist/chunk-YS33KBVJ.js +944 -0
- package/dist/chunk-Z27DZPDG.js +41 -0
- package/dist/chunk-ZXQ5NAEN.js +32 -0
- package/dist/contracts-B552GopR.d.cts +245 -0
- package/dist/contracts-B552GopR.d.ts +245 -0
- package/dist/contracts-Bg1ECISC.d.cts +245 -0
- package/dist/contracts-Bg1ECISC.d.ts +245 -0
- package/dist/contracts-CMriKJ6P.d.cts +245 -0
- package/dist/contracts-CMriKJ6P.d.ts +245 -0
- package/dist/contracts-DOrhwbke.d.cts +245 -0
- package/dist/contracts-DOrhwbke.d.ts +245 -0
- package/dist/data.cjs +1373 -0
- package/dist/data.d.cts +434 -0
- package/dist/data.d.ts +434 -0
- package/dist/data.js +945 -0
- package/dist/devtools.cjs +1357 -0
- package/dist/devtools.d.cts +473 -0
- package/dist/devtools.d.ts +473 -0
- package/dist/devtools.js +1084 -0
- package/dist/ecosystem.cjs +1046 -0
- package/dist/ecosystem.d.cts +247 -0
- package/dist/ecosystem.d.ts +247 -0
- package/dist/ecosystem.js +369 -0
- package/dist/extras.cjs +8457 -0
- package/dist/extras.d.cts +2356 -0
- package/dist/extras.d.ts +2356 -0
- package/dist/extras.js +5152 -0
- package/dist/index.cjs +2648 -0
- package/dist/index.d.cts +869 -0
- package/dist/index.d.ts +869 -0
- package/dist/index.js +386 -0
- package/dist/motion.cjs +604 -0
- package/dist/motion.d.cts +146 -0
- package/dist/motion.d.ts +146 -0
- package/dist/motion.js +346 -0
- package/dist/patterns.cjs +815 -0
- package/dist/patterns.d.cts +163 -0
- package/dist/patterns.d.ts +163 -0
- package/dist/patterns.js +296 -0
- package/dist/performance.cjs +927 -0
- package/dist/performance.d.cts +416 -0
- package/dist/performance.d.ts +416 -0
- package/dist/performance.js +654 -0
- package/dist/plugins.cjs +2487 -0
- package/dist/plugins.d.cts +393 -0
- package/dist/plugins.d.ts +393 -0
- package/dist/plugins.js +1504 -0
- package/dist/signal-BnWpq6WB.d.cts +5 -0
- package/dist/signal-BnWpq6WB.d.ts +5 -0
- package/dist/src/components/ErrorBoundary.d.ts +15 -0
- package/dist/src/components/ErrorBoundary.js +119 -0
- package/dist/src/core/catch.d.ts +11 -0
- package/dist/src/core/catch.js +28 -0
- package/dist/src/core/each.d.ts +13 -0
- package/dist/src/core/each.js +68 -0
- package/dist/src/core/for.d.ts +12 -0
- package/dist/src/core/for.js +67 -0
- package/dist/src/core/html.d.ts +137 -0
- package/dist/src/core/html.js +155 -0
- package/dist/src/core/htmlIf.d.ts +11 -0
- package/dist/src/core/htmlIf.js +18 -0
- package/dist/src/core/lazy.d.ts +7 -0
- package/dist/src/core/lazy.js +16 -0
- package/dist/src/core/mount.d.ts +7 -0
- package/dist/src/core/mount.js +12 -0
- package/dist/src/core/slots.d.ts +3 -0
- package/dist/src/core/slots.js +3 -0
- package/dist/src/core/suspense.d.ts +10 -0
- package/dist/src/core/suspense.js +33 -0
- package/dist/src/core/tagFactory.d.ts +13 -0
- package/dist/src/core/tagFactory.js +86 -0
- package/dist/src/core/test.d.ts +11 -0
- package/dist/src/core/test.js +28 -0
- package/dist/src/core/types.d.ts +2 -0
- package/dist/src/core/types.js +1 -0
- package/dist/src/core/useComputed.d.ts +6 -0
- package/dist/src/core/useComputed.js +30 -0
- package/dist/src/core/useEffect.d.ts +6 -0
- package/dist/src/core/useEffect.js +23 -0
- package/dist/src/core/useState.d.ts +10 -0
- package/dist/src/core/useState.js +34 -0
- package/dist/src/core/useStore.d.ts +19 -0
- package/dist/src/core/useStore.js +53 -0
- package/dist/src/core/useWatch.d.ts +8 -0
- package/dist/src/core/useWatch.js +23 -0
- package/dist/src/plugins/i18n.d.ts +6 -0
- package/dist/src/plugins/i18n.js +16 -0
- package/dist/src/plugins/router.d.ts +188 -0
- package/dist/src/plugins/router.js +1178 -0
- package/dist/src/reactivity/bindAttribute.d.ts +5 -0
- package/dist/src/reactivity/bindAttribute.js +31 -0
- package/dist/src/reactivity/bindChildNode.d.ts +10 -0
- package/dist/src/reactivity/bindChildNode.js +46 -0
- package/dist/src/reactivity/bindTextNode.d.ts +10 -0
- package/dist/src/reactivity/bindTextNode.js +27 -0
- package/dist/src/reactivity/signal.d.ts +3 -0
- package/dist/src/reactivity/signal.js +1 -0
- package/dist/src/reactivity/track.d.ts +18 -0
- package/dist/src/reactivity/track.js +73 -0
- package/dist/src/reactivity/useComputed.d.ts +6 -0
- package/dist/src/reactivity/useComputed.js +30 -0
- package/dist/src/reactivity/useEffect.d.ts +6 -0
- package/dist/src/reactivity/useEffect.js +23 -0
- package/dist/src/reactivity/useState.d.ts +10 -0
- package/dist/src/reactivity/useState.js +34 -0
- package/dist/src/reactivity/useStore.d.ts +19 -0
- package/dist/src/reactivity/useStore.js +53 -0
- package/dist/src/reactivity/useWatch.d.ts +8 -0
- package/dist/src/reactivity/useWatch.js +23 -0
- package/dist/src/utils/sanitize.d.ts +1 -0
- package/dist/src/utils/sanitize.js +8 -0
- package/dist/ssr-27FOM46T.js +35 -0
- package/dist/ssr-GFUTTSJD.js +22 -0
- package/dist/ssr-K7DCR6BZ.js +35 -0
- package/dist/ssr-O6LFMRFP.js +35 -0
- package/dist/ssr-QZEVGMMK.js +35 -0
- package/dist/ssr-SGVBCAGC.js +35 -0
- package/dist/ssr-UB2IXCYX.js +35 -0
- package/dist/ssr-XBZQNV4O.js +22 -0
- package/dist/ssr-Y76FSXDU.js +35 -0
- package/dist/ssr-YQJ4AYBD.js +35 -0
- package/dist/ssr.cjs +1757 -0
- package/dist/ssr.d.cts +478 -0
- package/dist/ssr.d.ts +478 -0
- package/dist/ssr.js +743 -0
- package/dist/tagFactory-CZPO4RXF.d.cts +34 -0
- package/dist/tagFactory-CZPO4RXF.d.ts +34 -0
- package/dist/tagFactory-CgImPVMY.d.cts +22 -0
- package/dist/tagFactory-CgImPVMY.d.ts +22 -0
- package/dist/tagFactory-Cw1iv5if.d.cts +22 -0
- package/dist/tagFactory-Cw1iv5if.d.ts +22 -0
- package/dist/tagFactory-DeAXq9ef.d.cts +30 -0
- package/dist/tagFactory-DeAXq9ef.d.ts +30 -0
- package/dist/tagFactory-SkY0a7L1.d.cts +22 -0
- package/dist/tagFactory-SkY0a7L1.d.ts +22 -0
- package/dist/testing.cjs +1919 -0
- package/dist/testing.d.cts +491 -0
- package/dist/testing.d.ts +491 -0
- package/dist/testing.js +1862 -0
- package/dist/ui.cjs +1497 -0
- package/dist/ui.d.cts +264 -0
- package/dist/ui.d.ts +264 -0
- package/dist/ui.js +900 -0
- package/dist/widgets.cjs +919 -0
- package/dist/widgets.d.cts +165 -0
- package/dist/widgets.d.ts +165 -0
- package/dist/widgets.js +545 -0
- package/package.json +134 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2648 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
DynamicComponent: () => DynamicComponent,
|
|
24
|
+
ErrorBoundary: () => ErrorBoundary,
|
|
25
|
+
Fragment: () => Fragment,
|
|
26
|
+
Loading: () => Loading,
|
|
27
|
+
Portal: () => Portal,
|
|
28
|
+
SVG_NS: () => SVG_NS,
|
|
29
|
+
Suspense: () => Suspense,
|
|
30
|
+
a: () => a,
|
|
31
|
+
abbr: () => abbr,
|
|
32
|
+
address: () => address,
|
|
33
|
+
area: () => area,
|
|
34
|
+
array: () => array,
|
|
35
|
+
article: () => article,
|
|
36
|
+
aside: () => aside,
|
|
37
|
+
audio: () => audio,
|
|
38
|
+
b: () => b,
|
|
39
|
+
base: () => base,
|
|
40
|
+
batch: () => batch,
|
|
41
|
+
bdi: () => bdi,
|
|
42
|
+
bdo: () => bdo,
|
|
43
|
+
bindDynamic: () => bindDynamic,
|
|
44
|
+
blockquote: () => blockquote,
|
|
45
|
+
body: () => body,
|
|
46
|
+
br: () => br,
|
|
47
|
+
button: () => button,
|
|
48
|
+
canvas: () => canvas,
|
|
49
|
+
caption: () => caption,
|
|
50
|
+
catchError: () => catchError,
|
|
51
|
+
catchErrorAsync: () => catchErrorAsync,
|
|
52
|
+
center: () => center,
|
|
53
|
+
checkLeaks: () => checkLeaks,
|
|
54
|
+
circle: () => circle,
|
|
55
|
+
cite: () => cite,
|
|
56
|
+
clipPath: () => clipPath,
|
|
57
|
+
code: () => code,
|
|
58
|
+
col: () => col,
|
|
59
|
+
colgroup: () => colgroup,
|
|
60
|
+
context: () => context,
|
|
61
|
+
customElement: () => customElement,
|
|
62
|
+
data: () => data,
|
|
63
|
+
datalist: () => datalist,
|
|
64
|
+
dd: () => dd,
|
|
65
|
+
deepSignal: () => deepSignal,
|
|
66
|
+
defs: () => defs,
|
|
67
|
+
del: () => del,
|
|
68
|
+
derived: () => derived,
|
|
69
|
+
details: () => details,
|
|
70
|
+
dfn: () => dfn,
|
|
71
|
+
dialog: () => dialog,
|
|
72
|
+
disableSSR: () => disableSSR,
|
|
73
|
+
dispose: () => dispose,
|
|
74
|
+
div: () => div,
|
|
75
|
+
dl: () => dl,
|
|
76
|
+
dt: () => dt,
|
|
77
|
+
each: () => each,
|
|
78
|
+
effect: () => effect,
|
|
79
|
+
ellipse: () => ellipse,
|
|
80
|
+
em: () => em,
|
|
81
|
+
embed: () => embed,
|
|
82
|
+
enableSSR: () => enableSSR,
|
|
83
|
+
enqueueBatchedSignal: () => enqueueBatchedSignal,
|
|
84
|
+
fieldset: () => fieldset,
|
|
85
|
+
figcaption: () => figcaption,
|
|
86
|
+
figure: () => figure,
|
|
87
|
+
font: () => font,
|
|
88
|
+
footer: () => footer,
|
|
89
|
+
form: () => form,
|
|
90
|
+
g: () => g,
|
|
91
|
+
getSlot: () => getSlot,
|
|
92
|
+
h1: () => h1,
|
|
93
|
+
h2: () => h2,
|
|
94
|
+
h3: () => h3,
|
|
95
|
+
h4: () => h4,
|
|
96
|
+
h5: () => h5,
|
|
97
|
+
h6: () => h6,
|
|
98
|
+
head: () => head,
|
|
99
|
+
header: () => header,
|
|
100
|
+
hr: () => hr,
|
|
101
|
+
html: () => html2,
|
|
102
|
+
i: () => i,
|
|
103
|
+
iframe: () => iframe,
|
|
104
|
+
img: () => img,
|
|
105
|
+
input: () => input,
|
|
106
|
+
ins: () => ins,
|
|
107
|
+
isBatching: () => isBatching,
|
|
108
|
+
isSSR: () => isSSR,
|
|
109
|
+
kbd: () => kbd,
|
|
110
|
+
label: () => label,
|
|
111
|
+
lazy: () => lazy,
|
|
112
|
+
legend: () => legend,
|
|
113
|
+
li: () => li,
|
|
114
|
+
line: () => line,
|
|
115
|
+
linearGradient: () => linearGradient,
|
|
116
|
+
link: () => link,
|
|
117
|
+
main: () => main,
|
|
118
|
+
map: () => map,
|
|
119
|
+
mark: () => mark,
|
|
120
|
+
marker: () => marker,
|
|
121
|
+
marquee: () => marquee,
|
|
122
|
+
mask: () => mask,
|
|
123
|
+
match: () => match,
|
|
124
|
+
math: () => math,
|
|
125
|
+
memo: () => memo,
|
|
126
|
+
memoFn: () => memoFn,
|
|
127
|
+
menu: () => menu,
|
|
128
|
+
meta: () => meta,
|
|
129
|
+
meter: () => meter,
|
|
130
|
+
mount: () => mount,
|
|
131
|
+
nav: () => nav,
|
|
132
|
+
noscript: () => noscript,
|
|
133
|
+
object: () => object,
|
|
134
|
+
ol: () => ol,
|
|
135
|
+
onMount: () => onMount,
|
|
136
|
+
onUnmount: () => onUnmount,
|
|
137
|
+
optgroup: () => optgroup,
|
|
138
|
+
option: () => option,
|
|
139
|
+
output: () => output,
|
|
140
|
+
p: () => p,
|
|
141
|
+
param: () => param,
|
|
142
|
+
path: () => path,
|
|
143
|
+
pattern: () => pattern,
|
|
144
|
+
picture: () => picture,
|
|
145
|
+
polygon: () => polygon,
|
|
146
|
+
polyline: () => polyline,
|
|
147
|
+
portal: () => portal,
|
|
148
|
+
pre: () => pre,
|
|
149
|
+
progress: () => progress,
|
|
150
|
+
q: () => q,
|
|
151
|
+
radialGradient: () => radialGradient,
|
|
152
|
+
reactiveArray: () => reactiveArray,
|
|
153
|
+
rect: () => rect,
|
|
154
|
+
ref: () => ref,
|
|
155
|
+
registerComponent: () => registerComponent,
|
|
156
|
+
registerDisposer: () => registerDisposer,
|
|
157
|
+
resolveComponent: () => resolveComponent,
|
|
158
|
+
rp: () => rp,
|
|
159
|
+
rt: () => rt,
|
|
160
|
+
ruby: () => ruby,
|
|
161
|
+
s: () => s,
|
|
162
|
+
samp: () => samp,
|
|
163
|
+
script: () => script,
|
|
164
|
+
section: () => section,
|
|
165
|
+
select: () => select,
|
|
166
|
+
setGlobalErrorHandler: () => setGlobalErrorHandler,
|
|
167
|
+
show: () => show,
|
|
168
|
+
signal: () => signal,
|
|
169
|
+
slot: () => slot,
|
|
170
|
+
small: () => small,
|
|
171
|
+
source: () => source,
|
|
172
|
+
span: () => span,
|
|
173
|
+
stop: () => stop,
|
|
174
|
+
store: () => store,
|
|
175
|
+
strong: () => strong,
|
|
176
|
+
style: () => style,
|
|
177
|
+
sub: () => sub,
|
|
178
|
+
summary: () => summary,
|
|
179
|
+
sup: () => sup,
|
|
180
|
+
svg: () => svg,
|
|
181
|
+
symbol: () => symbol,
|
|
182
|
+
table: () => table,
|
|
183
|
+
tagFactory: () => tagFactory,
|
|
184
|
+
tbody: () => tbody,
|
|
185
|
+
td: () => td,
|
|
186
|
+
template: () => template,
|
|
187
|
+
text: () => text,
|
|
188
|
+
textarea: () => textarea,
|
|
189
|
+
tfoot: () => tfoot,
|
|
190
|
+
th: () => th,
|
|
191
|
+
thead: () => thead,
|
|
192
|
+
time: () => time,
|
|
193
|
+
title: () => title,
|
|
194
|
+
tr: () => tr,
|
|
195
|
+
track: () => track2,
|
|
196
|
+
tspan: () => tspan,
|
|
197
|
+
u: () => u,
|
|
198
|
+
ul: () => ul,
|
|
199
|
+
unregisterComponent: () => unregisterComponent,
|
|
200
|
+
use: () => use,
|
|
201
|
+
var_: () => var_,
|
|
202
|
+
video: () => video,
|
|
203
|
+
watch: () => watch,
|
|
204
|
+
when: () => when,
|
|
205
|
+
withSSR: () => withSSR
|
|
206
|
+
});
|
|
207
|
+
module.exports = __toCommonJS(index_exports);
|
|
208
|
+
|
|
209
|
+
// src/utils/sanitize.ts
|
|
210
|
+
function sanitize(value) {
|
|
211
|
+
return String(value).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
212
|
+
}
|
|
213
|
+
function sanitizeUrl(url) {
|
|
214
|
+
const trimmed = url.replace(/[\x00-\x20\x7f-\x9f]+/g, "").trim();
|
|
215
|
+
if (!trimmed) return "";
|
|
216
|
+
const lower = trimmed.toLowerCase();
|
|
217
|
+
if (lower.startsWith("javascript:") || lower.startsWith("data:") || lower.startsWith("vbscript:") || lower.startsWith("blob:")) {
|
|
218
|
+
return "";
|
|
219
|
+
}
|
|
220
|
+
return trimmed;
|
|
221
|
+
}
|
|
222
|
+
var URL_ATTRIBUTES = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "cite", "poster", "background", "srcset"]);
|
|
223
|
+
function isUrlAttribute(attr) {
|
|
224
|
+
return URL_ATTRIBUTES.has(attr);
|
|
225
|
+
}
|
|
226
|
+
function sanitizeAttribute(attr, value) {
|
|
227
|
+
if (isUrlAttribute(attr)) {
|
|
228
|
+
return sanitizeUrl(value);
|
|
229
|
+
}
|
|
230
|
+
return sanitize(value);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// src/reactivity/track.ts
|
|
234
|
+
var subscriberStack = [];
|
|
235
|
+
var currentSubscriber = null;
|
|
236
|
+
var signalSubscribers = /* @__PURE__ */ new WeakMap();
|
|
237
|
+
var SUBS = "__s";
|
|
238
|
+
var notifyDepth = 0;
|
|
239
|
+
var pendingQueue = [];
|
|
240
|
+
var pendingSet = /* @__PURE__ */ new Set();
|
|
241
|
+
var suspendDepth = 0;
|
|
242
|
+
var trackingSuspended = false;
|
|
243
|
+
function track(effectFn, subscriber) {
|
|
244
|
+
if (!subscriber) subscriber = effectFn;
|
|
245
|
+
cleanup(subscriber);
|
|
246
|
+
subscriberStack.push(subscriber);
|
|
247
|
+
currentSubscriber = subscriber;
|
|
248
|
+
effectFn();
|
|
249
|
+
subscriberStack.pop();
|
|
250
|
+
currentSubscriber = subscriberStack[subscriberStack.length - 1] || null;
|
|
251
|
+
return () => cleanup(subscriber);
|
|
252
|
+
}
|
|
253
|
+
function suspendTracking() {
|
|
254
|
+
if (suspendDepth === 0) {
|
|
255
|
+
subscriberStack.push(null);
|
|
256
|
+
currentSubscriber = null;
|
|
257
|
+
trackingSuspended = true;
|
|
258
|
+
}
|
|
259
|
+
suspendDepth++;
|
|
260
|
+
}
|
|
261
|
+
function resumeTracking() {
|
|
262
|
+
suspendDepth--;
|
|
263
|
+
if (suspendDepth === 0) {
|
|
264
|
+
subscriberStack.pop();
|
|
265
|
+
currentSubscriber = subscriberStack[subscriberStack.length - 1] || null;
|
|
266
|
+
trackingSuspended = false;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
function recordDependency(signal2) {
|
|
270
|
+
if (!currentSubscriber) return;
|
|
271
|
+
let deps = currentSubscriber._deps;
|
|
272
|
+
if (!deps) {
|
|
273
|
+
deps = /* @__PURE__ */ new Set();
|
|
274
|
+
currentSubscriber._deps = deps;
|
|
275
|
+
}
|
|
276
|
+
if (!deps.has(signal2)) {
|
|
277
|
+
deps.add(signal2);
|
|
278
|
+
let subs = signal2[SUBS];
|
|
279
|
+
if (!subs) {
|
|
280
|
+
subs = /* @__PURE__ */ new Set();
|
|
281
|
+
signalSubscribers.set(signal2, subs);
|
|
282
|
+
signal2[SUBS] = subs;
|
|
283
|
+
}
|
|
284
|
+
subs.add(currentSubscriber);
|
|
285
|
+
if (subs.size === 1) {
|
|
286
|
+
signal2.__f = currentSubscriber;
|
|
287
|
+
} else if (signal2.__f !== void 0) {
|
|
288
|
+
signal2.__f = void 0;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
function queueSignalNotification(signal2) {
|
|
293
|
+
const subs = signal2[SUBS];
|
|
294
|
+
if (!subs) return;
|
|
295
|
+
for (const sub2 of subs) {
|
|
296
|
+
if (sub2._c) {
|
|
297
|
+
propagateDirty(sub2);
|
|
298
|
+
} else if (!pendingSet.has(sub2)) {
|
|
299
|
+
pendingSet.add(sub2);
|
|
300
|
+
pendingQueue.push(sub2);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
function drainNotificationQueue() {
|
|
305
|
+
if (notifyDepth > 0) return;
|
|
306
|
+
notifyDepth++;
|
|
307
|
+
try {
|
|
308
|
+
let i2 = 0;
|
|
309
|
+
while (i2 < pendingQueue.length) {
|
|
310
|
+
pendingQueue[i2]();
|
|
311
|
+
i2++;
|
|
312
|
+
}
|
|
313
|
+
} finally {
|
|
314
|
+
pendingQueue.length = 0;
|
|
315
|
+
pendingSet.clear();
|
|
316
|
+
notifyDepth--;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
function propagateDirty(sub2) {
|
|
320
|
+
sub2();
|
|
321
|
+
let sig = sub2._sig;
|
|
322
|
+
let suspended = false;
|
|
323
|
+
if (sig && sig._g) {
|
|
324
|
+
const sDeps = sub2._deps;
|
|
325
|
+
if (sDeps && sDeps.size === 1) {
|
|
326
|
+
suspendTracking();
|
|
327
|
+
suspended = true;
|
|
328
|
+
const s2 = sig;
|
|
329
|
+
s2._d = false;
|
|
330
|
+
s2._v = s2._g();
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
while (sig) {
|
|
334
|
+
const first = sig.__f;
|
|
335
|
+
if (first) {
|
|
336
|
+
if (first._c) {
|
|
337
|
+
const nSig = first._sig;
|
|
338
|
+
nSig._d = true;
|
|
339
|
+
if (suspended && nSig._g) {
|
|
340
|
+
const fDeps = first._deps;
|
|
341
|
+
if (fDeps && fDeps.size === 1) {
|
|
342
|
+
nSig._d = false;
|
|
343
|
+
nSig._v = nSig._g();
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
sig = nSig;
|
|
347
|
+
continue;
|
|
348
|
+
}
|
|
349
|
+
if (!pendingSet.has(first)) {
|
|
350
|
+
pendingSet.add(first);
|
|
351
|
+
pendingQueue.push(first);
|
|
352
|
+
}
|
|
353
|
+
break;
|
|
354
|
+
}
|
|
355
|
+
const subs = sig[SUBS];
|
|
356
|
+
if (!subs) break;
|
|
357
|
+
let nextSig;
|
|
358
|
+
for (const s2 of subs) {
|
|
359
|
+
if (s2._c) {
|
|
360
|
+
s2();
|
|
361
|
+
const nSig = s2._sig;
|
|
362
|
+
if (nSig && !nextSig) {
|
|
363
|
+
nextSig = nSig;
|
|
364
|
+
} else if (nSig) {
|
|
365
|
+
propagateDirty(s2);
|
|
366
|
+
}
|
|
367
|
+
} else if (!pendingSet.has(s2)) {
|
|
368
|
+
pendingSet.add(s2);
|
|
369
|
+
pendingQueue.push(s2);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
sig = nextSig;
|
|
373
|
+
}
|
|
374
|
+
if (suspended) resumeTracking();
|
|
375
|
+
}
|
|
376
|
+
function notifySubscribers(signal2) {
|
|
377
|
+
const first = signal2.__f;
|
|
378
|
+
if (first) {
|
|
379
|
+
if (notifyDepth > 0) {
|
|
380
|
+
if (first._c) {
|
|
381
|
+
propagateDirty(first);
|
|
382
|
+
} else if (!pendingSet.has(first)) {
|
|
383
|
+
pendingSet.add(first);
|
|
384
|
+
pendingQueue.push(first);
|
|
385
|
+
}
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
notifyDepth++;
|
|
389
|
+
try {
|
|
390
|
+
if (first._c) {
|
|
391
|
+
propagateDirty(first);
|
|
392
|
+
} else {
|
|
393
|
+
first();
|
|
394
|
+
}
|
|
395
|
+
let i2 = 0;
|
|
396
|
+
while (i2 < pendingQueue.length) {
|
|
397
|
+
pendingQueue[i2]();
|
|
398
|
+
i2++;
|
|
399
|
+
}
|
|
400
|
+
} finally {
|
|
401
|
+
pendingQueue.length = 0;
|
|
402
|
+
pendingSet.clear();
|
|
403
|
+
notifyDepth--;
|
|
404
|
+
}
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
const subs = signal2[SUBS];
|
|
408
|
+
if (!subs || subs.size === 0) return;
|
|
409
|
+
if (notifyDepth > 0) {
|
|
410
|
+
for (const sub2 of subs) {
|
|
411
|
+
if (sub2._c) {
|
|
412
|
+
propagateDirty(sub2);
|
|
413
|
+
} else if (!pendingSet.has(sub2)) {
|
|
414
|
+
pendingSet.add(sub2);
|
|
415
|
+
pendingQueue.push(sub2);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
notifyDepth++;
|
|
421
|
+
try {
|
|
422
|
+
let directCount = 0;
|
|
423
|
+
for (const sub2 of subs) {
|
|
424
|
+
pendingQueue[directCount++] = sub2;
|
|
425
|
+
}
|
|
426
|
+
for (let i3 = 0; i3 < directCount; i3++) {
|
|
427
|
+
if (pendingQueue[i3]._c) {
|
|
428
|
+
propagateDirty(pendingQueue[i3]);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
for (let i3 = 0; i3 < directCount; i3++) {
|
|
432
|
+
if (!pendingQueue[i3]._c) {
|
|
433
|
+
if (!pendingSet.has(pendingQueue[i3])) {
|
|
434
|
+
pendingQueue[i3]();
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
let i2 = directCount;
|
|
439
|
+
while (i2 < pendingQueue.length) {
|
|
440
|
+
pendingQueue[i2]();
|
|
441
|
+
i2++;
|
|
442
|
+
}
|
|
443
|
+
} finally {
|
|
444
|
+
pendingQueue.length = 0;
|
|
445
|
+
pendingSet.clear();
|
|
446
|
+
notifyDepth--;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
function cleanup(subscriber) {
|
|
450
|
+
const deps = subscriber._deps;
|
|
451
|
+
if (!deps || deps.size === 0) return;
|
|
452
|
+
for (const signal2 of deps) {
|
|
453
|
+
const subs = signal2[SUBS];
|
|
454
|
+
if (subs) {
|
|
455
|
+
subs.delete(subscriber);
|
|
456
|
+
if (signal2.__f === subscriber) {
|
|
457
|
+
signal2.__f = void 0;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
deps.clear();
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// src/reactivity/bindAttribute.ts
|
|
465
|
+
function bindAttribute(el, attr, getter) {
|
|
466
|
+
function commit() {
|
|
467
|
+
let value;
|
|
468
|
+
try {
|
|
469
|
+
value = getter();
|
|
470
|
+
} catch {
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
if (typeof value === "boolean") {
|
|
474
|
+
if (attr in el && (attr === "checked" || attr === "disabled" || attr === "selected")) {
|
|
475
|
+
el[attr] = value;
|
|
476
|
+
} else if (value) {
|
|
477
|
+
el.setAttribute(attr, "");
|
|
478
|
+
} else {
|
|
479
|
+
el.removeAttribute(attr);
|
|
480
|
+
}
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
const str = sanitizeAttribute(attr, String(value));
|
|
484
|
+
if ((attr === "value" || attr === "checked") && attr in el) {
|
|
485
|
+
el[attr] = attr === "checked" ? Boolean(value) : str;
|
|
486
|
+
} else {
|
|
487
|
+
el.setAttribute(attr, str);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
const teardown = track(commit);
|
|
491
|
+
return teardown;
|
|
492
|
+
}
|
|
493
|
+
function bindDynamic(el, nameGetter, valueGetter) {
|
|
494
|
+
let prevName = null;
|
|
495
|
+
function commit() {
|
|
496
|
+
let name;
|
|
497
|
+
try {
|
|
498
|
+
name = typeof nameGetter === "function" ? nameGetter() : nameGetter;
|
|
499
|
+
} catch {
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
let value;
|
|
503
|
+
try {
|
|
504
|
+
value = typeof valueGetter === "function" ? valueGetter() : valueGetter;
|
|
505
|
+
} catch {
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
if (name.toLowerCase().startsWith("on")) return;
|
|
509
|
+
if (prevName !== null && prevName !== name) {
|
|
510
|
+
el.removeAttribute(prevName);
|
|
511
|
+
}
|
|
512
|
+
const str = sanitizeAttribute(name, String(value));
|
|
513
|
+
if ((name === "value" || name === "checked") && name in el) {
|
|
514
|
+
el[name] = name === "checked" ? Boolean(value) : str;
|
|
515
|
+
} else {
|
|
516
|
+
el.setAttribute(name, str);
|
|
517
|
+
}
|
|
518
|
+
prevName = name;
|
|
519
|
+
}
|
|
520
|
+
const teardown = track(commit);
|
|
521
|
+
return () => {
|
|
522
|
+
teardown();
|
|
523
|
+
if (prevName !== null) {
|
|
524
|
+
el.removeAttribute(prevName);
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// src/reactivity/bindChildNode.ts
|
|
530
|
+
function bindChildNode(placeholder, getter) {
|
|
531
|
+
let lastNodes = [];
|
|
532
|
+
function commit() {
|
|
533
|
+
let result;
|
|
534
|
+
try {
|
|
535
|
+
result = getter();
|
|
536
|
+
} catch {
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
for (const node of lastNodes) {
|
|
540
|
+
node.parentNode?.removeChild(node);
|
|
541
|
+
}
|
|
542
|
+
lastNodes = [];
|
|
543
|
+
if (result == null) return;
|
|
544
|
+
const parent = placeholder.parentNode;
|
|
545
|
+
if (!parent) return;
|
|
546
|
+
const anchor = placeholder.nextSibling;
|
|
547
|
+
const newNodes = [];
|
|
548
|
+
const insertItem = (item) => {
|
|
549
|
+
const node = item instanceof Node ? item : document.createTextNode(String(item));
|
|
550
|
+
parent.insertBefore(node, anchor);
|
|
551
|
+
newNodes.push(node);
|
|
552
|
+
};
|
|
553
|
+
if (Array.isArray(result)) {
|
|
554
|
+
for (const item of result) insertItem(item);
|
|
555
|
+
} else {
|
|
556
|
+
insertItem(result);
|
|
557
|
+
}
|
|
558
|
+
lastNodes = newNodes;
|
|
559
|
+
}
|
|
560
|
+
return track(commit);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
// src/core/dev.ts
|
|
564
|
+
function isDev() {
|
|
565
|
+
return typeof globalThis.__SIBU_DEV__ !== "undefined" ? !!globalThis.__SIBU_DEV__ : typeof __SIBU_DEV__ !== "undefined" ? __SIBU_DEV__ : true;
|
|
566
|
+
}
|
|
567
|
+
function devAssert(condition, message) {
|
|
568
|
+
if (isDev() && !condition) {
|
|
569
|
+
throw new Error(`[Sibu] ${message}`);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
function devWarn(message) {
|
|
573
|
+
if (isDev()) {
|
|
574
|
+
console.warn(`[Sibu] ${message}`);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
// src/core/rendering/dispose.ts
|
|
579
|
+
var elementDisposers = /* @__PURE__ */ new WeakMap();
|
|
580
|
+
var activeBindingCount = 0;
|
|
581
|
+
function registerDisposer(node, teardown) {
|
|
582
|
+
let disposers = elementDisposers.get(node);
|
|
583
|
+
if (!disposers) {
|
|
584
|
+
disposers = [];
|
|
585
|
+
elementDisposers.set(node, disposers);
|
|
586
|
+
}
|
|
587
|
+
disposers.push(teardown);
|
|
588
|
+
activeBindingCount++;
|
|
589
|
+
}
|
|
590
|
+
function dispose(node) {
|
|
591
|
+
const children = node.childNodes;
|
|
592
|
+
for (const child of children) {
|
|
593
|
+
dispose(child);
|
|
594
|
+
}
|
|
595
|
+
const disposers = elementDisposers.get(node);
|
|
596
|
+
if (disposers) {
|
|
597
|
+
activeBindingCount -= disposers.length;
|
|
598
|
+
for (const d of disposers) d();
|
|
599
|
+
elementDisposers.delete(node);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
function checkLeaks(warnThreshold = 0) {
|
|
603
|
+
if (activeBindingCount > warnThreshold) {
|
|
604
|
+
devWarn(
|
|
605
|
+
`checkLeaks: ${activeBindingCount} active DOM bindings detected. Expected \u2264${warnThreshold}. This may indicate a component was removed from the DOM without calling dispose().`
|
|
606
|
+
);
|
|
607
|
+
}
|
|
608
|
+
return activeBindingCount;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
// src/core/rendering/tagFactory.ts
|
|
612
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
613
|
+
var kebabCache = /* @__PURE__ */ new Map();
|
|
614
|
+
function toKebab(prop) {
|
|
615
|
+
let cached = kebabCache.get(prop);
|
|
616
|
+
if (cached !== void 0) return cached;
|
|
617
|
+
cached = prop.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
|
|
618
|
+
kebabCache.set(prop, cached);
|
|
619
|
+
return cached;
|
|
620
|
+
}
|
|
621
|
+
function applyStyle(el, style2) {
|
|
622
|
+
if (!style2) return;
|
|
623
|
+
if (typeof style2 === "function") {
|
|
624
|
+
const teardown = track(() => {
|
|
625
|
+
el.setAttribute("style", style2());
|
|
626
|
+
});
|
|
627
|
+
registerDisposer(el, teardown);
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
if (typeof style2 === "string") {
|
|
631
|
+
el.setAttribute("style", style2);
|
|
632
|
+
return;
|
|
633
|
+
}
|
|
634
|
+
const htmlEl = el;
|
|
635
|
+
for (const prop in style2) {
|
|
636
|
+
const val = style2[prop];
|
|
637
|
+
const name = toKebab(prop);
|
|
638
|
+
if (typeof val === "function") {
|
|
639
|
+
const getter = val;
|
|
640
|
+
const teardown = track(() => {
|
|
641
|
+
htmlEl.style.setProperty(name, String(getter()));
|
|
642
|
+
});
|
|
643
|
+
registerDisposer(el, teardown);
|
|
644
|
+
} else {
|
|
645
|
+
htmlEl.style.setProperty(name, String(val));
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
function applyClass(el, cls) {
|
|
650
|
+
if (cls == null) return;
|
|
651
|
+
if (typeof cls === "string") {
|
|
652
|
+
el.setAttribute("class", cls);
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
if (typeof cls === "function") {
|
|
656
|
+
const getter = cls;
|
|
657
|
+
const teardown = track(() => {
|
|
658
|
+
el.setAttribute("class", getter());
|
|
659
|
+
});
|
|
660
|
+
registerDisposer(el, teardown);
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
if (typeof cls === "object") {
|
|
664
|
+
const obj = cls;
|
|
665
|
+
let hasReactive = false;
|
|
666
|
+
for (const name in obj) {
|
|
667
|
+
if (typeof obj[name] === "function") {
|
|
668
|
+
hasReactive = true;
|
|
669
|
+
break;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
if (hasReactive) {
|
|
673
|
+
const update = () => {
|
|
674
|
+
let result = "";
|
|
675
|
+
for (const name in obj) {
|
|
676
|
+
const val = obj[name];
|
|
677
|
+
const active = typeof val === "function" ? val() : val;
|
|
678
|
+
if (active) result = result ? `${result} ${name}` : name;
|
|
679
|
+
}
|
|
680
|
+
el.setAttribute("class", result);
|
|
681
|
+
};
|
|
682
|
+
const teardown = track(update);
|
|
683
|
+
registerDisposer(el, teardown);
|
|
684
|
+
} else {
|
|
685
|
+
let result = "";
|
|
686
|
+
for (const name in obj) {
|
|
687
|
+
if (obj[name]) result = result ? `${result} ${name}` : name;
|
|
688
|
+
}
|
|
689
|
+
el.setAttribute("class", result);
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
function renderChild(child) {
|
|
694
|
+
if (child == null) {
|
|
695
|
+
return document.createTextNode("");
|
|
696
|
+
}
|
|
697
|
+
if (child instanceof Node) {
|
|
698
|
+
return child;
|
|
699
|
+
}
|
|
700
|
+
return document.createTextNode(String(child));
|
|
701
|
+
}
|
|
702
|
+
function appendOneChild(el, child) {
|
|
703
|
+
if (typeof child === "function") {
|
|
704
|
+
const placeholder = document.createComment("bind:child");
|
|
705
|
+
el.appendChild(placeholder);
|
|
706
|
+
const teardown = bindChildNode(placeholder, child);
|
|
707
|
+
registerDisposer(el, teardown);
|
|
708
|
+
} else {
|
|
709
|
+
el.appendChild(renderChild(child));
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
function appendChildren(el, nodes) {
|
|
713
|
+
if (Array.isArray(nodes)) {
|
|
714
|
+
for (let i2 = 0; i2 < nodes.length; i2++) {
|
|
715
|
+
const c = nodes[i2];
|
|
716
|
+
if (Array.isArray(c)) {
|
|
717
|
+
for (let j = 0; j < c.length; j++) {
|
|
718
|
+
appendOneChild(el, c[j]);
|
|
719
|
+
}
|
|
720
|
+
} else {
|
|
721
|
+
appendOneChild(el, c);
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
} else {
|
|
725
|
+
appendOneChild(el, nodes);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
function isTagProps(value) {
|
|
729
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) && !(value instanceof Node);
|
|
730
|
+
}
|
|
731
|
+
var tagFactory = (tag, ns) => (first, second) => {
|
|
732
|
+
let props;
|
|
733
|
+
if (first === void 0) {
|
|
734
|
+
props = {};
|
|
735
|
+
} else if (isTagProps(first)) {
|
|
736
|
+
props = first;
|
|
737
|
+
} else if (second !== void 0) {
|
|
738
|
+
props = { class: first, nodes: second };
|
|
739
|
+
} else {
|
|
740
|
+
props = { nodes: first };
|
|
741
|
+
}
|
|
742
|
+
const el = ns ? document.createElementNS(ns, tag) : document.createElement(tag);
|
|
743
|
+
for (const key in props) {
|
|
744
|
+
const value = props[key];
|
|
745
|
+
if (value == null) continue;
|
|
746
|
+
switch (key) {
|
|
747
|
+
case "id":
|
|
748
|
+
el.id = value;
|
|
749
|
+
break;
|
|
750
|
+
case "class":
|
|
751
|
+
applyClass(el, value);
|
|
752
|
+
break;
|
|
753
|
+
case "style":
|
|
754
|
+
applyStyle(el, value);
|
|
755
|
+
break;
|
|
756
|
+
case "ref":
|
|
757
|
+
if (value && typeof value === "object" && "current" in value) {
|
|
758
|
+
value.current = el;
|
|
759
|
+
}
|
|
760
|
+
break;
|
|
761
|
+
case "on": {
|
|
762
|
+
const handlers = value;
|
|
763
|
+
const eventNames = [];
|
|
764
|
+
for (const ev in handlers) {
|
|
765
|
+
el.addEventListener(ev, handlers[ev]);
|
|
766
|
+
eventNames.push(ev);
|
|
767
|
+
}
|
|
768
|
+
if (eventNames.length) {
|
|
769
|
+
el.__sibu_events__ = eventNames;
|
|
770
|
+
}
|
|
771
|
+
break;
|
|
772
|
+
}
|
|
773
|
+
case "nodes":
|
|
774
|
+
appendChildren(el, value);
|
|
775
|
+
break;
|
|
776
|
+
default:
|
|
777
|
+
if (key.toLowerCase().startsWith("on")) break;
|
|
778
|
+
if (typeof value === "function") {
|
|
779
|
+
const teardown = bindAttribute(el, key, value);
|
|
780
|
+
registerDisposer(el, teardown);
|
|
781
|
+
} else if (typeof value === "boolean") {
|
|
782
|
+
if (value) el.setAttribute(key, "");
|
|
783
|
+
else el.removeAttribute(key);
|
|
784
|
+
} else {
|
|
785
|
+
el.setAttribute(key, sanitizeAttribute(key, String(value)));
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
return el;
|
|
790
|
+
};
|
|
791
|
+
|
|
792
|
+
// src/core/rendering/html.ts
|
|
793
|
+
var html = tagFactory("html");
|
|
794
|
+
var head = tagFactory("head");
|
|
795
|
+
var body = tagFactory("body");
|
|
796
|
+
var title = tagFactory("title");
|
|
797
|
+
var div = tagFactory("div");
|
|
798
|
+
var span = tagFactory("span");
|
|
799
|
+
var section = tagFactory("section");
|
|
800
|
+
var article = tagFactory("article");
|
|
801
|
+
var header = tagFactory("header");
|
|
802
|
+
var footer = tagFactory("footer");
|
|
803
|
+
var nav = tagFactory("nav");
|
|
804
|
+
var main = tagFactory("main");
|
|
805
|
+
var aside = tagFactory("aside");
|
|
806
|
+
var address = tagFactory("address");
|
|
807
|
+
var p = tagFactory("p");
|
|
808
|
+
var h1 = tagFactory("h1");
|
|
809
|
+
var h2 = tagFactory("h2");
|
|
810
|
+
var h3 = tagFactory("h3");
|
|
811
|
+
var h4 = tagFactory("h4");
|
|
812
|
+
var h5 = tagFactory("h5");
|
|
813
|
+
var h6 = tagFactory("h6");
|
|
814
|
+
var blockquote = tagFactory("blockquote");
|
|
815
|
+
var dd = tagFactory("dd");
|
|
816
|
+
var dl = tagFactory("dl");
|
|
817
|
+
var dt = tagFactory("dt");
|
|
818
|
+
var figcaption = tagFactory("figcaption");
|
|
819
|
+
var figure = tagFactory("figure");
|
|
820
|
+
var hr = tagFactory("hr");
|
|
821
|
+
var li = tagFactory("li");
|
|
822
|
+
var ol = tagFactory("ol");
|
|
823
|
+
var ul = tagFactory("ul");
|
|
824
|
+
var pre = tagFactory("pre");
|
|
825
|
+
var a = tagFactory("a");
|
|
826
|
+
var abbr = tagFactory("abbr");
|
|
827
|
+
var b = tagFactory("b");
|
|
828
|
+
var bdi = tagFactory("bdi");
|
|
829
|
+
var bdo = tagFactory("bdo");
|
|
830
|
+
var br = tagFactory("br");
|
|
831
|
+
var cite = tagFactory("cite");
|
|
832
|
+
var code = tagFactory("code");
|
|
833
|
+
var data = tagFactory("data");
|
|
834
|
+
var dfn = tagFactory("dfn");
|
|
835
|
+
var em = tagFactory("em");
|
|
836
|
+
var i = tagFactory("i");
|
|
837
|
+
var kbd = tagFactory("kbd");
|
|
838
|
+
var mark = tagFactory("mark");
|
|
839
|
+
var q = tagFactory("q");
|
|
840
|
+
var rp = tagFactory("rp");
|
|
841
|
+
var rt = tagFactory("rt");
|
|
842
|
+
var ruby = tagFactory("ruby");
|
|
843
|
+
var s = tagFactory("s");
|
|
844
|
+
var samp = tagFactory("samp");
|
|
845
|
+
var small = tagFactory("small");
|
|
846
|
+
var strong = tagFactory("strong");
|
|
847
|
+
var sub = tagFactory("sub");
|
|
848
|
+
var sup = tagFactory("sup");
|
|
849
|
+
var time = tagFactory("time");
|
|
850
|
+
var u = tagFactory("u");
|
|
851
|
+
var var_ = tagFactory("var");
|
|
852
|
+
var area = tagFactory("area");
|
|
853
|
+
var audio = tagFactory("audio");
|
|
854
|
+
var img = tagFactory("img");
|
|
855
|
+
var map = tagFactory("map");
|
|
856
|
+
var track2 = tagFactory("track");
|
|
857
|
+
var video = tagFactory("video");
|
|
858
|
+
var embed = tagFactory("embed");
|
|
859
|
+
var iframe = tagFactory("iframe");
|
|
860
|
+
var object = tagFactory("object");
|
|
861
|
+
var param = tagFactory("param");
|
|
862
|
+
var picture = tagFactory("picture");
|
|
863
|
+
var portal = tagFactory("portal");
|
|
864
|
+
var source = tagFactory("source");
|
|
865
|
+
var svg = tagFactory("svg", SVG_NS);
|
|
866
|
+
var math = tagFactory("math");
|
|
867
|
+
var canvas = tagFactory("canvas");
|
|
868
|
+
var noscript = tagFactory("noscript");
|
|
869
|
+
var script = tagFactory("script");
|
|
870
|
+
var del = tagFactory("del");
|
|
871
|
+
var ins = tagFactory("ins");
|
|
872
|
+
var caption = tagFactory("caption");
|
|
873
|
+
var col = tagFactory("col");
|
|
874
|
+
var colgroup = tagFactory("colgroup");
|
|
875
|
+
var table = tagFactory("table");
|
|
876
|
+
var tbody = tagFactory("tbody");
|
|
877
|
+
var td = tagFactory("td");
|
|
878
|
+
var tfoot = tagFactory("tfoot");
|
|
879
|
+
var th = tagFactory("th");
|
|
880
|
+
var thead = tagFactory("thead");
|
|
881
|
+
var tr = tagFactory("tr");
|
|
882
|
+
var button = tagFactory("button");
|
|
883
|
+
var datalist = tagFactory("datalist");
|
|
884
|
+
var fieldset = tagFactory("fieldset");
|
|
885
|
+
var form = tagFactory("form");
|
|
886
|
+
var input = tagFactory("input");
|
|
887
|
+
var label = tagFactory("label");
|
|
888
|
+
var legend = tagFactory("legend");
|
|
889
|
+
var meter = tagFactory("meter");
|
|
890
|
+
var optgroup = tagFactory("optgroup");
|
|
891
|
+
var option = tagFactory("option");
|
|
892
|
+
var output = tagFactory("output");
|
|
893
|
+
var progress = tagFactory("progress");
|
|
894
|
+
var select = tagFactory("select");
|
|
895
|
+
var textarea = tagFactory("textarea");
|
|
896
|
+
var details = tagFactory("details");
|
|
897
|
+
var dialog = tagFactory("dialog");
|
|
898
|
+
var menu = tagFactory("menu");
|
|
899
|
+
var summary = tagFactory("summary");
|
|
900
|
+
var slot = tagFactory("slot");
|
|
901
|
+
var template = tagFactory("template");
|
|
902
|
+
var base = tagFactory("base");
|
|
903
|
+
var link = tagFactory("link");
|
|
904
|
+
var meta = tagFactory("meta");
|
|
905
|
+
var style = tagFactory("style");
|
|
906
|
+
var circle = tagFactory("circle", SVG_NS);
|
|
907
|
+
var ellipse = tagFactory("ellipse", SVG_NS);
|
|
908
|
+
var g = tagFactory("g", SVG_NS);
|
|
909
|
+
var line = tagFactory("line", SVG_NS);
|
|
910
|
+
var path = tagFactory("path", SVG_NS);
|
|
911
|
+
var polygon = tagFactory("polygon", SVG_NS);
|
|
912
|
+
var polyline = tagFactory("polyline", SVG_NS);
|
|
913
|
+
var rect = tagFactory("rect", SVG_NS);
|
|
914
|
+
var text = tagFactory("text", SVG_NS);
|
|
915
|
+
var tspan = tagFactory("tspan", SVG_NS);
|
|
916
|
+
var defs = tagFactory("defs", SVG_NS);
|
|
917
|
+
var clipPath = tagFactory("clipPath", SVG_NS);
|
|
918
|
+
var mask = tagFactory("mask", SVG_NS);
|
|
919
|
+
var pattern = tagFactory("pattern", SVG_NS);
|
|
920
|
+
var linearGradient = tagFactory("linearGradient", SVG_NS);
|
|
921
|
+
var radialGradient = tagFactory("radialGradient", SVG_NS);
|
|
922
|
+
var stop = tagFactory("stop", SVG_NS);
|
|
923
|
+
var use = tagFactory("use", SVG_NS);
|
|
924
|
+
var symbol = tagFactory("symbol", SVG_NS);
|
|
925
|
+
var marker = tagFactory("marker", SVG_NS);
|
|
926
|
+
var center = tagFactory("center");
|
|
927
|
+
var font = tagFactory("font");
|
|
928
|
+
var marquee = tagFactory("marquee");
|
|
929
|
+
var customElement = (tagName) => tagFactory(tagName);
|
|
930
|
+
|
|
931
|
+
// src/core/rendering/htm.ts
|
|
932
|
+
var VOID_ELEMENTS = /* @__PURE__ */ new Set([
|
|
933
|
+
"area",
|
|
934
|
+
"base",
|
|
935
|
+
"br",
|
|
936
|
+
"col",
|
|
937
|
+
"embed",
|
|
938
|
+
"hr",
|
|
939
|
+
"img",
|
|
940
|
+
"input",
|
|
941
|
+
"link",
|
|
942
|
+
"meta",
|
|
943
|
+
"param",
|
|
944
|
+
"source",
|
|
945
|
+
"track",
|
|
946
|
+
"wbr"
|
|
947
|
+
]);
|
|
948
|
+
var SVG_TAGS = /* @__PURE__ */ new Set([
|
|
949
|
+
"svg",
|
|
950
|
+
"circle",
|
|
951
|
+
"ellipse",
|
|
952
|
+
"g",
|
|
953
|
+
"line",
|
|
954
|
+
"path",
|
|
955
|
+
"polygon",
|
|
956
|
+
"polyline",
|
|
957
|
+
"rect",
|
|
958
|
+
"text",
|
|
959
|
+
"tspan",
|
|
960
|
+
"defs",
|
|
961
|
+
"clipPath",
|
|
962
|
+
"mask",
|
|
963
|
+
"pattern",
|
|
964
|
+
"linearGradient",
|
|
965
|
+
"radialGradient",
|
|
966
|
+
"stop",
|
|
967
|
+
"use",
|
|
968
|
+
"symbol",
|
|
969
|
+
"marker"
|
|
970
|
+
]);
|
|
971
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
972
|
+
function parseTemplate(strings) {
|
|
973
|
+
const exprCount = strings.length - 1;
|
|
974
|
+
let template2 = strings[0];
|
|
975
|
+
for (let i2 = 0; i2 < exprCount; i2++) {
|
|
976
|
+
template2 += `\0${i2}\0${strings[i2 + 1]}`;
|
|
977
|
+
}
|
|
978
|
+
let pos = 0;
|
|
979
|
+
const len = template2.length;
|
|
980
|
+
function skipWs() {
|
|
981
|
+
while (pos < len && (template2[pos] === " " || template2[pos] === " " || template2[pos] === "\n" || template2[pos] === "\r"))
|
|
982
|
+
pos++;
|
|
983
|
+
}
|
|
984
|
+
function tryExprIdx() {
|
|
985
|
+
if (template2[pos] !== "\0") return -1;
|
|
986
|
+
const start = pos;
|
|
987
|
+
pos++;
|
|
988
|
+
let idxStr = "";
|
|
989
|
+
while (pos < len && template2[pos] !== "\0") idxStr += template2[pos++];
|
|
990
|
+
if (pos < len) pos++;
|
|
991
|
+
const idx = Number.parseInt(idxStr, 10);
|
|
992
|
+
if (Number.isNaN(idx) || idx < 0 || idx >= exprCount) {
|
|
993
|
+
pos = start;
|
|
994
|
+
return -1;
|
|
995
|
+
}
|
|
996
|
+
return idx;
|
|
997
|
+
}
|
|
998
|
+
function readTagName() {
|
|
999
|
+
let name = "";
|
|
1000
|
+
while (pos < len && /[a-zA-Z0-9-]/.test(template2[pos])) name += template2[pos++];
|
|
1001
|
+
return name;
|
|
1002
|
+
}
|
|
1003
|
+
function parseAttrValue() {
|
|
1004
|
+
skipWs();
|
|
1005
|
+
if (template2[pos] !== "=") return { kind: "bool" };
|
|
1006
|
+
pos++;
|
|
1007
|
+
skipWs();
|
|
1008
|
+
const exprIdx = tryExprIdx();
|
|
1009
|
+
if (exprIdx >= 0) return { kind: "expr", idx: exprIdx };
|
|
1010
|
+
const quote = template2[pos];
|
|
1011
|
+
if (quote === '"' || quote === "'") {
|
|
1012
|
+
pos++;
|
|
1013
|
+
const statics = [];
|
|
1014
|
+
const exprs = [];
|
|
1015
|
+
let current = "";
|
|
1016
|
+
while (pos < len && template2[pos] !== quote) {
|
|
1017
|
+
const innerIdx = tryExprIdx();
|
|
1018
|
+
if (innerIdx >= 0) {
|
|
1019
|
+
statics.push(current);
|
|
1020
|
+
current = "";
|
|
1021
|
+
exprs.push(innerIdx);
|
|
1022
|
+
} else {
|
|
1023
|
+
current += template2[pos++];
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
if (pos < len) pos++;
|
|
1027
|
+
statics.push(current);
|
|
1028
|
+
if (exprs.length === 0) {
|
|
1029
|
+
return { kind: "static", value: statics[0] };
|
|
1030
|
+
}
|
|
1031
|
+
return { kind: "mixed", statics, exprs };
|
|
1032
|
+
}
|
|
1033
|
+
let val = "";
|
|
1034
|
+
while (pos < len && !/[\s>/]/.test(template2[pos])) val += template2[pos++];
|
|
1035
|
+
return { kind: "static", value: val };
|
|
1036
|
+
}
|
|
1037
|
+
function parseAttrs() {
|
|
1038
|
+
const attrs = [];
|
|
1039
|
+
while (pos < len) {
|
|
1040
|
+
skipWs();
|
|
1041
|
+
if (template2[pos] === ">" || template2[pos] === "/") break;
|
|
1042
|
+
let attrName = "";
|
|
1043
|
+
while (pos < len && /[a-zA-Z0-9\-:_.]/.test(template2[pos])) attrName += template2[pos++];
|
|
1044
|
+
if (!attrName) break;
|
|
1045
|
+
const val = parseAttrValue();
|
|
1046
|
+
if (attrName.startsWith("on:")) {
|
|
1047
|
+
if (val.kind === "expr") {
|
|
1048
|
+
attrs.push({ t: 3, name: attrName.slice(3), idx: val.idx });
|
|
1049
|
+
}
|
|
1050
|
+
} else if (val.kind === "bool") {
|
|
1051
|
+
attrs.push({ t: 4, name: attrName });
|
|
1052
|
+
} else if (val.kind === "static") {
|
|
1053
|
+
attrs.push({ t: 0, name: attrName, value: val.value });
|
|
1054
|
+
} else if (val.kind === "expr") {
|
|
1055
|
+
attrs.push({ t: 1, name: attrName, idx: val.idx });
|
|
1056
|
+
} else if (val.kind === "mixed") {
|
|
1057
|
+
attrs.push({ t: 2, name: attrName, statics: val.statics, exprs: val.exprs });
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
return attrs;
|
|
1061
|
+
}
|
|
1062
|
+
function collapseWs(s2) {
|
|
1063
|
+
return s2.replace(/\s+/g, " ");
|
|
1064
|
+
}
|
|
1065
|
+
function parseTextChildren(children) {
|
|
1066
|
+
let text2 = "";
|
|
1067
|
+
while (pos < len && template2[pos] !== "<") {
|
|
1068
|
+
const idx = tryExprIdx();
|
|
1069
|
+
if (idx >= 0) {
|
|
1070
|
+
const collapsed2 = collapseWs(text2);
|
|
1071
|
+
if (collapsed2) children.push({ t: 1, value: collapsed2 });
|
|
1072
|
+
text2 = "";
|
|
1073
|
+
children.push({ t: 2, idx });
|
|
1074
|
+
} else {
|
|
1075
|
+
text2 += template2[pos++];
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
const collapsed = collapseWs(text2);
|
|
1079
|
+
if (collapsed) children.push({ t: 1, value: collapsed });
|
|
1080
|
+
}
|
|
1081
|
+
function parseChildren() {
|
|
1082
|
+
const children = [];
|
|
1083
|
+
while (pos < len) {
|
|
1084
|
+
if (template2[pos] === "<" && pos + 1 < len && template2[pos + 1] === "/") break;
|
|
1085
|
+
if (template2[pos] === "<") {
|
|
1086
|
+
pos++;
|
|
1087
|
+
const tag = readTagName();
|
|
1088
|
+
const attrs = parseAttrs();
|
|
1089
|
+
skipWs();
|
|
1090
|
+
const isVoid = VOID_ELEMENTS.has(tag);
|
|
1091
|
+
const isSelfClosing = template2[pos] === "/";
|
|
1092
|
+
if (isSelfClosing) pos++;
|
|
1093
|
+
if (pos < len) pos++;
|
|
1094
|
+
if (isVoid || isSelfClosing) {
|
|
1095
|
+
children.push({ t: 0, el: { tag, svg: SVG_TAGS.has(tag), attrs, children: [] } });
|
|
1096
|
+
} else {
|
|
1097
|
+
const inner = parseChildren();
|
|
1098
|
+
if (template2[pos] === "<" && pos + 1 < len && template2[pos + 1] === "/") {
|
|
1099
|
+
pos += 2;
|
|
1100
|
+
readTagName();
|
|
1101
|
+
skipWs();
|
|
1102
|
+
if (pos < len && template2[pos] === ">") pos++;
|
|
1103
|
+
}
|
|
1104
|
+
children.push({ t: 0, el: { tag, svg: SVG_TAGS.has(tag), attrs, children: inner } });
|
|
1105
|
+
}
|
|
1106
|
+
} else {
|
|
1107
|
+
parseTextChildren(children);
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
return children;
|
|
1111
|
+
}
|
|
1112
|
+
return parseChildren();
|
|
1113
|
+
}
|
|
1114
|
+
var factoryCache = /* @__PURE__ */ new Map();
|
|
1115
|
+
function getFactory(tag, svg2) {
|
|
1116
|
+
const key = svg2 ? `svg:${tag}` : tag;
|
|
1117
|
+
let f = factoryCache.get(key);
|
|
1118
|
+
if (!f) {
|
|
1119
|
+
f = tagFactory(tag, svg2 ? SVG_NS : void 0);
|
|
1120
|
+
factoryCache.set(key, f);
|
|
1121
|
+
}
|
|
1122
|
+
return f;
|
|
1123
|
+
}
|
|
1124
|
+
function executeElement(tmpl, values) {
|
|
1125
|
+
const props = {};
|
|
1126
|
+
const events = {};
|
|
1127
|
+
let hasEvents = false;
|
|
1128
|
+
for (let i2 = 0; i2 < tmpl.attrs.length; i2++) {
|
|
1129
|
+
const attr = tmpl.attrs[i2];
|
|
1130
|
+
switch (attr.t) {
|
|
1131
|
+
case 0:
|
|
1132
|
+
props[attr.name] = attr.value;
|
|
1133
|
+
break;
|
|
1134
|
+
case 1:
|
|
1135
|
+
props[attr.name] = values[attr.idx];
|
|
1136
|
+
break;
|
|
1137
|
+
case 2: {
|
|
1138
|
+
let val = attr.statics[0];
|
|
1139
|
+
for (let j = 0; j < attr.exprs.length; j++) {
|
|
1140
|
+
val += String(values[attr.exprs[j]]) + attr.statics[j + 1];
|
|
1141
|
+
}
|
|
1142
|
+
props[attr.name] = val;
|
|
1143
|
+
break;
|
|
1144
|
+
}
|
|
1145
|
+
case 3:
|
|
1146
|
+
events[attr.name] = values[attr.idx];
|
|
1147
|
+
hasEvents = true;
|
|
1148
|
+
break;
|
|
1149
|
+
case 4:
|
|
1150
|
+
props[attr.name] = true;
|
|
1151
|
+
break;
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
if (hasEvents) props.on = events;
|
|
1155
|
+
if (tmpl.children.length > 0) {
|
|
1156
|
+
const nodes = executeChildList(tmpl.children, values);
|
|
1157
|
+
props.nodes = nodes.length === 1 ? nodes[0] : nodes;
|
|
1158
|
+
}
|
|
1159
|
+
return getFactory(tmpl.tag, tmpl.svg)(props);
|
|
1160
|
+
}
|
|
1161
|
+
function executeChildList(children, values) {
|
|
1162
|
+
const nodes = [];
|
|
1163
|
+
for (let i2 = 0; i2 < children.length; i2++) {
|
|
1164
|
+
const child = children[i2];
|
|
1165
|
+
switch (child.t) {
|
|
1166
|
+
case 0:
|
|
1167
|
+
nodes.push(executeElement(child.el, values));
|
|
1168
|
+
break;
|
|
1169
|
+
case 1:
|
|
1170
|
+
nodes.push(child.value);
|
|
1171
|
+
break;
|
|
1172
|
+
case 2:
|
|
1173
|
+
nodes.push(values[child.idx]);
|
|
1174
|
+
break;
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
return nodes;
|
|
1178
|
+
}
|
|
1179
|
+
function html2(strings, ...values) {
|
|
1180
|
+
let tmpl = cache.get(strings);
|
|
1181
|
+
if (!tmpl) {
|
|
1182
|
+
tmpl = parseTemplate(strings);
|
|
1183
|
+
cache.set(strings, tmpl);
|
|
1184
|
+
}
|
|
1185
|
+
const result = executeChildList(tmpl, values);
|
|
1186
|
+
if (result.length === 1 && result[0] instanceof Node) {
|
|
1187
|
+
return result[0];
|
|
1188
|
+
}
|
|
1189
|
+
const wrapper = document.createElement("div");
|
|
1190
|
+
for (const node of result) {
|
|
1191
|
+
if (node instanceof Node) {
|
|
1192
|
+
wrapper.appendChild(node);
|
|
1193
|
+
} else if (typeof node === "function") {
|
|
1194
|
+
const placeholder = document.createComment("bind:htm");
|
|
1195
|
+
wrapper.appendChild(placeholder);
|
|
1196
|
+
const teardown = bindChildNode(placeholder, node);
|
|
1197
|
+
registerDisposer(wrapper, teardown);
|
|
1198
|
+
} else if (node != null) {
|
|
1199
|
+
wrapper.appendChild(document.createTextNode(String(node)));
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
return wrapper;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
// src/core/rendering/mount.ts
|
|
1206
|
+
function mount(component, container) {
|
|
1207
|
+
if (!container) {
|
|
1208
|
+
throw new Error(
|
|
1209
|
+
"[Sibu] mount: container element not found. Make sure the DOM element exists before calling mount()."
|
|
1210
|
+
);
|
|
1211
|
+
}
|
|
1212
|
+
devAssert(
|
|
1213
|
+
typeof component === "function" || component instanceof Node,
|
|
1214
|
+
"mount: first argument must be a component function or a DOM Node."
|
|
1215
|
+
);
|
|
1216
|
+
const startTime = typeof performance !== "undefined" ? performance.now() : 0;
|
|
1217
|
+
const node = typeof component === "function" ? component() : component;
|
|
1218
|
+
const duration = typeof performance !== "undefined" ? performance.now() - startTime : 0;
|
|
1219
|
+
container.appendChild(node);
|
|
1220
|
+
const hook = globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
1221
|
+
if (hook) {
|
|
1222
|
+
hook.emit("app:init", { rootElement: node, container, duration });
|
|
1223
|
+
}
|
|
1224
|
+
return {
|
|
1225
|
+
node,
|
|
1226
|
+
unmount() {
|
|
1227
|
+
if (hook) hook.emit("app:unmount", { rootElement: node });
|
|
1228
|
+
dispose(node);
|
|
1229
|
+
if (node.parentNode) {
|
|
1230
|
+
node.parentNode.removeChild(node);
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
};
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
// src/core/rendering/each.ts
|
|
1237
|
+
function resolveNodeChild(child) {
|
|
1238
|
+
if (typeof child === "function") {
|
|
1239
|
+
return resolveNodeChild(child());
|
|
1240
|
+
}
|
|
1241
|
+
if (child instanceof Node) {
|
|
1242
|
+
return child;
|
|
1243
|
+
}
|
|
1244
|
+
return document.createTextNode(String(child));
|
|
1245
|
+
}
|
|
1246
|
+
function longestIncreasingSubsequence(arr, len) {
|
|
1247
|
+
if (len === 0) return [];
|
|
1248
|
+
const tails = [];
|
|
1249
|
+
const predecessor = new Array(len);
|
|
1250
|
+
for (let i2 = 0; i2 < len; i2++) {
|
|
1251
|
+
const val = arr[i2];
|
|
1252
|
+
let lo = 0;
|
|
1253
|
+
let hi = tails.length;
|
|
1254
|
+
while (lo < hi) {
|
|
1255
|
+
const mid = lo + hi >> 1;
|
|
1256
|
+
if (arr[tails[mid]] < val) {
|
|
1257
|
+
lo = mid + 1;
|
|
1258
|
+
} else {
|
|
1259
|
+
hi = mid;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
tails[lo] = i2;
|
|
1263
|
+
predecessor[i2] = lo > 0 ? tails[lo - 1] : -1;
|
|
1264
|
+
}
|
|
1265
|
+
const lisLength = tails.length;
|
|
1266
|
+
const result = new Array(lisLength);
|
|
1267
|
+
let k = tails[lisLength - 1];
|
|
1268
|
+
for (let i2 = lisLength - 1; i2 >= 0; i2--) {
|
|
1269
|
+
result[i2] = k;
|
|
1270
|
+
k = predecessor[k];
|
|
1271
|
+
}
|
|
1272
|
+
return result;
|
|
1273
|
+
}
|
|
1274
|
+
function each(getArray, render, options) {
|
|
1275
|
+
devAssert(typeof getArray === "function", "each: first argument must be a function that returns an array.");
|
|
1276
|
+
devAssert(typeof render === "function", "each: second argument must be a render function.");
|
|
1277
|
+
devAssert(
|
|
1278
|
+
options && typeof options.key === "function",
|
|
1279
|
+
"each: options.key must be a function that returns a unique key per item."
|
|
1280
|
+
);
|
|
1281
|
+
const anchor = document.createComment("each:anchor");
|
|
1282
|
+
const end = document.createComment("each:end");
|
|
1283
|
+
let oldKeys = [];
|
|
1284
|
+
let nodeMap = /* @__PURE__ */ new Map();
|
|
1285
|
+
let workMap = /* @__PURE__ */ new Map();
|
|
1286
|
+
let newNodes = [];
|
|
1287
|
+
const oldKeyIndex = /* @__PURE__ */ new Map();
|
|
1288
|
+
let reusedNewBuf = [];
|
|
1289
|
+
let reusedOldBuf = [];
|
|
1290
|
+
let initialized = false;
|
|
1291
|
+
let sentinelInserted = false;
|
|
1292
|
+
const keyFn = options.key;
|
|
1293
|
+
const update = () => {
|
|
1294
|
+
const arr = getArray();
|
|
1295
|
+
const newLen = arr.length;
|
|
1296
|
+
const parent = anchor.parentNode;
|
|
1297
|
+
if (!parent) return;
|
|
1298
|
+
if (!sentinelInserted) {
|
|
1299
|
+
parent.insertBefore(end, anchor.nextSibling);
|
|
1300
|
+
sentinelInserted = true;
|
|
1301
|
+
}
|
|
1302
|
+
const newKeys = new Array(newLen);
|
|
1303
|
+
for (let i2 = 0; i2 < newLen; i2++) {
|
|
1304
|
+
newKeys[i2] = keyFn(arr[i2]);
|
|
1305
|
+
}
|
|
1306
|
+
if (newNodes.length < newLen) {
|
|
1307
|
+
newNodes = new Array(newLen);
|
|
1308
|
+
}
|
|
1309
|
+
workMap.clear();
|
|
1310
|
+
for (let i2 = 0; i2 < newLen; i2++) {
|
|
1311
|
+
const key = newKeys[i2];
|
|
1312
|
+
const existing = nodeMap.get(key);
|
|
1313
|
+
let node;
|
|
1314
|
+
if (existing !== void 0) {
|
|
1315
|
+
node = existing;
|
|
1316
|
+
} else {
|
|
1317
|
+
node = resolveNodeChild(render(arr[i2], i2));
|
|
1318
|
+
}
|
|
1319
|
+
workMap.set(key, node);
|
|
1320
|
+
newNodes[i2] = node;
|
|
1321
|
+
}
|
|
1322
|
+
for (const [key, node] of nodeMap) {
|
|
1323
|
+
if (!workMap.has(key) && node.parentNode) {
|
|
1324
|
+
parent.removeChild(node);
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
if (newLen === 0) {
|
|
1328
|
+
oldKeys = newKeys;
|
|
1329
|
+
const tmp2 = nodeMap;
|
|
1330
|
+
nodeMap = workMap;
|
|
1331
|
+
workMap = tmp2;
|
|
1332
|
+
return;
|
|
1333
|
+
}
|
|
1334
|
+
const oldLen = oldKeys.length;
|
|
1335
|
+
oldKeyIndex.clear();
|
|
1336
|
+
for (let i2 = 0; i2 < oldLen; i2++) {
|
|
1337
|
+
oldKeyIndex.set(oldKeys[i2], i2);
|
|
1338
|
+
}
|
|
1339
|
+
if (reusedNewBuf.length < newLen) {
|
|
1340
|
+
reusedNewBuf = new Array(newLen);
|
|
1341
|
+
reusedOldBuf = new Array(newLen);
|
|
1342
|
+
}
|
|
1343
|
+
let reusedCount = 0;
|
|
1344
|
+
for (let i2 = 0; i2 < newLen; i2++) {
|
|
1345
|
+
const oldIdx = oldKeyIndex.get(newKeys[i2]);
|
|
1346
|
+
if (oldIdx !== void 0) {
|
|
1347
|
+
reusedNewBuf[reusedCount] = i2;
|
|
1348
|
+
reusedOldBuf[reusedCount] = oldIdx;
|
|
1349
|
+
reusedCount++;
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
const lisIndices = longestIncreasingSubsequence(reusedOldBuf, reusedCount);
|
|
1353
|
+
const isStable = new Uint8Array(newLen);
|
|
1354
|
+
for (let i2 = 0; i2 < lisIndices.length; i2++) {
|
|
1355
|
+
isStable[reusedNewBuf[lisIndices[i2]]] = 1;
|
|
1356
|
+
}
|
|
1357
|
+
let nextRef = end;
|
|
1358
|
+
for (let i2 = newLen - 1; i2 >= 0; i2--) {
|
|
1359
|
+
const node = newNodes[i2];
|
|
1360
|
+
if (isStable[i2]) {
|
|
1361
|
+
nextRef = node;
|
|
1362
|
+
} else {
|
|
1363
|
+
if (node.nextSibling !== nextRef) {
|
|
1364
|
+
parent.insertBefore(node, nextRef);
|
|
1365
|
+
}
|
|
1366
|
+
nextRef = node;
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
oldKeys = newKeys;
|
|
1370
|
+
const tmp = nodeMap;
|
|
1371
|
+
nodeMap = workMap;
|
|
1372
|
+
workMap = tmp;
|
|
1373
|
+
initialized = true;
|
|
1374
|
+
};
|
|
1375
|
+
track(update);
|
|
1376
|
+
if (!initialized) {
|
|
1377
|
+
queueMicrotask(() => {
|
|
1378
|
+
if (!initialized && anchor.parentNode) {
|
|
1379
|
+
update();
|
|
1380
|
+
}
|
|
1381
|
+
});
|
|
1382
|
+
}
|
|
1383
|
+
return anchor;
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
// src/core/rendering/fragment.ts
|
|
1387
|
+
function Fragment(nodes) {
|
|
1388
|
+
const frag = document.createDocumentFragment();
|
|
1389
|
+
for (const child of nodes) {
|
|
1390
|
+
if (child == null) continue;
|
|
1391
|
+
if (Array.isArray(child)) {
|
|
1392
|
+
for (const nested of child) {
|
|
1393
|
+
frag.appendChild(resolveChild(nested));
|
|
1394
|
+
}
|
|
1395
|
+
} else {
|
|
1396
|
+
frag.appendChild(resolveChild(child));
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
return frag;
|
|
1400
|
+
}
|
|
1401
|
+
function resolveChild(child) {
|
|
1402
|
+
if (child == null) {
|
|
1403
|
+
return document.createTextNode("");
|
|
1404
|
+
}
|
|
1405
|
+
if (child instanceof Node) {
|
|
1406
|
+
return child;
|
|
1407
|
+
}
|
|
1408
|
+
if (typeof child === "function") {
|
|
1409
|
+
const result = child();
|
|
1410
|
+
if (result instanceof Node) return result;
|
|
1411
|
+
return document.createTextNode(String(result ?? ""));
|
|
1412
|
+
}
|
|
1413
|
+
return document.createTextNode(String(child));
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
// src/core/rendering/portal.ts
|
|
1417
|
+
function Portal(nodes, target) {
|
|
1418
|
+
const anchor = document.createComment("portal");
|
|
1419
|
+
const container = target || document.body;
|
|
1420
|
+
let portalContent = null;
|
|
1421
|
+
queueMicrotask(() => {
|
|
1422
|
+
try {
|
|
1423
|
+
portalContent = nodes();
|
|
1424
|
+
container.appendChild(portalContent);
|
|
1425
|
+
} catch (err) {
|
|
1426
|
+
console.error("[Portal] Render error:", err);
|
|
1427
|
+
}
|
|
1428
|
+
});
|
|
1429
|
+
const observer = new MutationObserver(() => {
|
|
1430
|
+
if (!anchor.isConnected && portalContent) {
|
|
1431
|
+
portalContent.remove();
|
|
1432
|
+
portalContent = null;
|
|
1433
|
+
observer.disconnect();
|
|
1434
|
+
}
|
|
1435
|
+
});
|
|
1436
|
+
queueMicrotask(() => {
|
|
1437
|
+
if (anchor.parentNode) {
|
|
1438
|
+
observer.observe(anchor.parentNode, { childList: true });
|
|
1439
|
+
}
|
|
1440
|
+
});
|
|
1441
|
+
return anchor;
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
// src/core/rendering/dynamic.ts
|
|
1445
|
+
var componentRegistry = /* @__PURE__ */ new Map();
|
|
1446
|
+
function registerComponent(name, component) {
|
|
1447
|
+
componentRegistry.set(name, component);
|
|
1448
|
+
}
|
|
1449
|
+
function unregisterComponent(name) {
|
|
1450
|
+
componentRegistry.delete(name);
|
|
1451
|
+
}
|
|
1452
|
+
function resolveComponent(name) {
|
|
1453
|
+
const component = componentRegistry.get(name);
|
|
1454
|
+
if (component) {
|
|
1455
|
+
return component();
|
|
1456
|
+
}
|
|
1457
|
+
return div({ nodes: `[Component "${name}" not found]` });
|
|
1458
|
+
}
|
|
1459
|
+
function DynamicComponent(is) {
|
|
1460
|
+
const container = div({ class: "sibu-dynamic" });
|
|
1461
|
+
function render() {
|
|
1462
|
+
const target = is();
|
|
1463
|
+
let el;
|
|
1464
|
+
if (typeof target === "function") {
|
|
1465
|
+
el = target();
|
|
1466
|
+
} else {
|
|
1467
|
+
el = resolveComponent(target);
|
|
1468
|
+
}
|
|
1469
|
+
container.replaceChildren(el);
|
|
1470
|
+
}
|
|
1471
|
+
track(render);
|
|
1472
|
+
return container;
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
// src/core/rendering/slots.ts
|
|
1476
|
+
function getSlot(slots, name = "default") {
|
|
1477
|
+
return slots?.[name];
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
// src/core/rendering/directives.ts
|
|
1481
|
+
function show(condition, element) {
|
|
1482
|
+
const update = () => {
|
|
1483
|
+
element.style.display = condition() ? "" : "none";
|
|
1484
|
+
};
|
|
1485
|
+
track(update);
|
|
1486
|
+
return element;
|
|
1487
|
+
}
|
|
1488
|
+
function when(condition, thenBranch, elseBranch) {
|
|
1489
|
+
const anchor = document.createComment("when");
|
|
1490
|
+
let currentNode = null;
|
|
1491
|
+
let initialized = false;
|
|
1492
|
+
const update = () => {
|
|
1493
|
+
const show2 = condition();
|
|
1494
|
+
const parent = anchor.parentNode;
|
|
1495
|
+
if (!parent) return;
|
|
1496
|
+
if (currentNode?.parentNode) {
|
|
1497
|
+
currentNode.parentNode.removeChild(currentNode);
|
|
1498
|
+
currentNode = null;
|
|
1499
|
+
}
|
|
1500
|
+
const result = show2 ? thenBranch() : elseBranch ? elseBranch() : null;
|
|
1501
|
+
if (result != null) {
|
|
1502
|
+
const node = result instanceof Node ? result : document.createTextNode(String(result));
|
|
1503
|
+
parent.insertBefore(node, anchor.nextSibling);
|
|
1504
|
+
currentNode = node;
|
|
1505
|
+
}
|
|
1506
|
+
initialized = true;
|
|
1507
|
+
};
|
|
1508
|
+
track(update);
|
|
1509
|
+
if (!initialized) {
|
|
1510
|
+
queueMicrotask(() => {
|
|
1511
|
+
if (!initialized && anchor.parentNode) update();
|
|
1512
|
+
});
|
|
1513
|
+
}
|
|
1514
|
+
return anchor;
|
|
1515
|
+
}
|
|
1516
|
+
function match(value, cases, fallback) {
|
|
1517
|
+
const anchor = document.createComment("match");
|
|
1518
|
+
let currentNode = null;
|
|
1519
|
+
let initialized = false;
|
|
1520
|
+
const update = () => {
|
|
1521
|
+
const key = String(value());
|
|
1522
|
+
const parent = anchor.parentNode;
|
|
1523
|
+
if (!parent) return;
|
|
1524
|
+
if (currentNode?.parentNode) {
|
|
1525
|
+
currentNode.parentNode.removeChild(currentNode);
|
|
1526
|
+
currentNode = null;
|
|
1527
|
+
}
|
|
1528
|
+
const renderFn = cases[key] || fallback;
|
|
1529
|
+
if (renderFn) {
|
|
1530
|
+
const result = renderFn();
|
|
1531
|
+
if (result != null) {
|
|
1532
|
+
const node = result instanceof Node ? result : document.createTextNode(String(result));
|
|
1533
|
+
parent.insertBefore(node, anchor.nextSibling);
|
|
1534
|
+
currentNode = node;
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
initialized = true;
|
|
1538
|
+
};
|
|
1539
|
+
track(update);
|
|
1540
|
+
if (!initialized) {
|
|
1541
|
+
queueMicrotask(() => {
|
|
1542
|
+
if (!initialized && anchor.parentNode) update();
|
|
1543
|
+
});
|
|
1544
|
+
}
|
|
1545
|
+
return anchor;
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
// src/core/rendering/catch.ts
|
|
1549
|
+
var globalErrorHandler = null;
|
|
1550
|
+
function catchError(fn, onError) {
|
|
1551
|
+
try {
|
|
1552
|
+
const result = fn();
|
|
1553
|
+
if (result && typeof result.then === "function") {
|
|
1554
|
+
result.catch((err) => {
|
|
1555
|
+
if (onError) {
|
|
1556
|
+
onError(err, "async");
|
|
1557
|
+
} else if (globalErrorHandler) {
|
|
1558
|
+
globalErrorHandler(err, "async");
|
|
1559
|
+
} else {
|
|
1560
|
+
console.error("Unhandled async error in Sibu.catchError:", err);
|
|
1561
|
+
}
|
|
1562
|
+
});
|
|
1563
|
+
}
|
|
1564
|
+
return result;
|
|
1565
|
+
} catch (err) {
|
|
1566
|
+
if (onError) {
|
|
1567
|
+
onError(err, "sync");
|
|
1568
|
+
} else if (globalErrorHandler) {
|
|
1569
|
+
globalErrorHandler(err, "sync");
|
|
1570
|
+
} else {
|
|
1571
|
+
console.error("Unhandled error in Sibu.catchError:", err);
|
|
1572
|
+
}
|
|
1573
|
+
return null;
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
async function catchErrorAsync(fn, onError) {
|
|
1577
|
+
try {
|
|
1578
|
+
return await fn();
|
|
1579
|
+
} catch (err) {
|
|
1580
|
+
if (onError) {
|
|
1581
|
+
onError(err, "async");
|
|
1582
|
+
} else if (globalErrorHandler) {
|
|
1583
|
+
globalErrorHandler(err, "async");
|
|
1584
|
+
} else {
|
|
1585
|
+
console.error("Unhandled async error in Sibu.catchErrorAsync:", err);
|
|
1586
|
+
}
|
|
1587
|
+
return null;
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
function setGlobalErrorHandler(handler) {
|
|
1591
|
+
globalErrorHandler = handler;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
// src/reactivity/batch.ts
|
|
1595
|
+
var batchDepth = 0;
|
|
1596
|
+
var pendingSignals = /* @__PURE__ */ new Set();
|
|
1597
|
+
function batch(fn) {
|
|
1598
|
+
batchDepth++;
|
|
1599
|
+
try {
|
|
1600
|
+
fn();
|
|
1601
|
+
} finally {
|
|
1602
|
+
batchDepth--;
|
|
1603
|
+
if (batchDepth === 0) {
|
|
1604
|
+
flushBatch();
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
function enqueueBatchedSignal(signal2) {
|
|
1609
|
+
if (batchDepth === 0) return false;
|
|
1610
|
+
pendingSignals.add(signal2);
|
|
1611
|
+
return true;
|
|
1612
|
+
}
|
|
1613
|
+
function isBatching() {
|
|
1614
|
+
return batchDepth > 0;
|
|
1615
|
+
}
|
|
1616
|
+
function flushBatch() {
|
|
1617
|
+
const signals = Array.from(pendingSignals);
|
|
1618
|
+
pendingSignals.clear();
|
|
1619
|
+
for (const signal2 of signals) {
|
|
1620
|
+
queueSignalNotification(signal2);
|
|
1621
|
+
}
|
|
1622
|
+
drainNotificationQueue();
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
// src/core/signals/signal.ts
|
|
1626
|
+
function signal(initial, options) {
|
|
1627
|
+
const state = { value: initial };
|
|
1628
|
+
const debugName = options?.name;
|
|
1629
|
+
if (debugName) {
|
|
1630
|
+
state.__name = debugName;
|
|
1631
|
+
}
|
|
1632
|
+
function get() {
|
|
1633
|
+
recordDependency(state);
|
|
1634
|
+
return state.value;
|
|
1635
|
+
}
|
|
1636
|
+
get.__signal = state;
|
|
1637
|
+
if (debugName) get.__name = debugName;
|
|
1638
|
+
function set(next) {
|
|
1639
|
+
const newValue = typeof next === "function" ? next(state.value) : next;
|
|
1640
|
+
if (Object.is(newValue, state.value)) return;
|
|
1641
|
+
const oldValue = state.value;
|
|
1642
|
+
state.value = newValue;
|
|
1643
|
+
const hook2 = globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
1644
|
+
if (hook2) hook2.emit("signal:update", { signal: state, name: debugName, oldValue, newValue });
|
|
1645
|
+
if (!enqueueBatchedSignal(state)) {
|
|
1646
|
+
notifySubscribers(state);
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
const hook = globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
1650
|
+
if (hook) hook.emit("signal:create", { signal: state, name: debugName, getter: get, initial });
|
|
1651
|
+
return [get, set];
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
// src/core/ssr-context.ts
|
|
1655
|
+
var ssrMode = false;
|
|
1656
|
+
function isSSR() {
|
|
1657
|
+
return ssrMode;
|
|
1658
|
+
}
|
|
1659
|
+
function enableSSR() {
|
|
1660
|
+
ssrMode = true;
|
|
1661
|
+
}
|
|
1662
|
+
function disableSSR() {
|
|
1663
|
+
ssrMode = false;
|
|
1664
|
+
}
|
|
1665
|
+
function withSSR(fn) {
|
|
1666
|
+
enableSSR();
|
|
1667
|
+
try {
|
|
1668
|
+
return fn();
|
|
1669
|
+
} finally {
|
|
1670
|
+
disableSSR();
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
// src/core/signals/effect.ts
|
|
1675
|
+
function effect(effectFn) {
|
|
1676
|
+
devAssert(typeof effectFn === "function", "effect: argument must be a function.");
|
|
1677
|
+
if (isSSR()) return () => {
|
|
1678
|
+
};
|
|
1679
|
+
let runCount = 0;
|
|
1680
|
+
let cleanupHandle = () => {
|
|
1681
|
+
};
|
|
1682
|
+
const hook = globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
1683
|
+
const subscriber = () => {
|
|
1684
|
+
cleanupHandle();
|
|
1685
|
+
runCount++;
|
|
1686
|
+
if (hook) hook.emit("effect:run", { effectFn, runCount });
|
|
1687
|
+
cleanupHandle = track(effectFn, subscriber);
|
|
1688
|
+
};
|
|
1689
|
+
cleanupHandle = track(effectFn, subscriber);
|
|
1690
|
+
runCount = 1;
|
|
1691
|
+
if (hook) hook.emit("effect:create", { effectFn });
|
|
1692
|
+
return () => {
|
|
1693
|
+
if (hook) hook.emit("effect:destroy", { effectFn });
|
|
1694
|
+
cleanupHandle();
|
|
1695
|
+
};
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
// src/core/signals/derived.ts
|
|
1699
|
+
function derived(getter, options) {
|
|
1700
|
+
devAssert(typeof getter === "function", "derived: argument must be a getter function.");
|
|
1701
|
+
const debugName = options?.name;
|
|
1702
|
+
const cs = {};
|
|
1703
|
+
cs._d = false;
|
|
1704
|
+
cs._g = getter;
|
|
1705
|
+
const markDirty = () => {
|
|
1706
|
+
if (cs._d) return;
|
|
1707
|
+
cs._d = true;
|
|
1708
|
+
};
|
|
1709
|
+
markDirty._c = 1;
|
|
1710
|
+
markDirty._sig = cs;
|
|
1711
|
+
track(() => {
|
|
1712
|
+
cs._d = false;
|
|
1713
|
+
cs._v = getter();
|
|
1714
|
+
}, markDirty);
|
|
1715
|
+
const hook = globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
1716
|
+
function computedGetter() {
|
|
1717
|
+
if (trackingSuspended) {
|
|
1718
|
+
if (cs._d) {
|
|
1719
|
+
cs._d = false;
|
|
1720
|
+
cs._v = getter();
|
|
1721
|
+
}
|
|
1722
|
+
return cs._v;
|
|
1723
|
+
}
|
|
1724
|
+
recordDependency(cs);
|
|
1725
|
+
if (cs._d) {
|
|
1726
|
+
const oldValue = cs._v;
|
|
1727
|
+
cs._d = false;
|
|
1728
|
+
suspendTracking();
|
|
1729
|
+
try {
|
|
1730
|
+
cs._v = getter();
|
|
1731
|
+
} finally {
|
|
1732
|
+
resumeTracking();
|
|
1733
|
+
}
|
|
1734
|
+
if (hook && oldValue !== cs._v) {
|
|
1735
|
+
hook.emit("computed:update", { signal: cs, oldValue, newValue: cs._v });
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
return cs._v;
|
|
1739
|
+
}
|
|
1740
|
+
if (debugName) {
|
|
1741
|
+
computedGetter.__name = debugName;
|
|
1742
|
+
cs.__name = debugName;
|
|
1743
|
+
}
|
|
1744
|
+
computedGetter.__signal = cs;
|
|
1745
|
+
if (hook) hook.emit("computed:create", { signal: cs, name: debugName, getter: computedGetter });
|
|
1746
|
+
return computedGetter;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
// src/core/signals/watch.ts
|
|
1750
|
+
function watch(getter, callback) {
|
|
1751
|
+
devAssert(typeof getter === "function", "watch: first argument must be a getter function.");
|
|
1752
|
+
devAssert(typeof callback === "function", "watch: second argument must be a callback function.");
|
|
1753
|
+
if (isSSR()) return () => {
|
|
1754
|
+
};
|
|
1755
|
+
let oldValue = getter();
|
|
1756
|
+
const subscriber = () => {
|
|
1757
|
+
const newValue = getter();
|
|
1758
|
+
if (!Object.is(newValue, oldValue)) {
|
|
1759
|
+
callback(newValue, oldValue);
|
|
1760
|
+
oldValue = newValue;
|
|
1761
|
+
}
|
|
1762
|
+
};
|
|
1763
|
+
const teardown = track(subscriber);
|
|
1764
|
+
return teardown;
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
// src/core/signals/store.ts
|
|
1768
|
+
function store(initialState) {
|
|
1769
|
+
devAssert(
|
|
1770
|
+
initialState !== null && typeof initialState === "object" && !Array.isArray(initialState),
|
|
1771
|
+
"store: argument must be a plain object. For arrays, use array() instead."
|
|
1772
|
+
);
|
|
1773
|
+
const signals = {};
|
|
1774
|
+
Object.keys(initialState).forEach((key) => {
|
|
1775
|
+
const [getter, setter] = signal(initialState[key]);
|
|
1776
|
+
signals[key] = [getter, setter];
|
|
1777
|
+
});
|
|
1778
|
+
const store2 = new Proxy({}, {
|
|
1779
|
+
get(_, prop) {
|
|
1780
|
+
if (prop in signals) {
|
|
1781
|
+
const getter = signals[prop][0];
|
|
1782
|
+
return getter();
|
|
1783
|
+
}
|
|
1784
|
+
return void 0;
|
|
1785
|
+
},
|
|
1786
|
+
set() {
|
|
1787
|
+
throw new Error(
|
|
1788
|
+
"[Sibu] store: Direct mutation is not allowed. Use actions.setState() to update store properties."
|
|
1789
|
+
);
|
|
1790
|
+
}
|
|
1791
|
+
});
|
|
1792
|
+
const getSnapshot = () => {
|
|
1793
|
+
const snapshot = {};
|
|
1794
|
+
Object.keys(signals).forEach((key) => {
|
|
1795
|
+
snapshot[key] = signals[key][0]();
|
|
1796
|
+
});
|
|
1797
|
+
return snapshot;
|
|
1798
|
+
};
|
|
1799
|
+
const setState = (patch) => {
|
|
1800
|
+
const current = getSnapshot();
|
|
1801
|
+
const nextState = typeof patch === "function" ? patch(current) : patch;
|
|
1802
|
+
Object.entries(nextState).forEach(([key, value]) => {
|
|
1803
|
+
if (key in signals) {
|
|
1804
|
+
signals[key][1](value);
|
|
1805
|
+
}
|
|
1806
|
+
});
|
|
1807
|
+
};
|
|
1808
|
+
const reset = () => {
|
|
1809
|
+
Object.keys(initialState).forEach((key) => {
|
|
1810
|
+
const setter = signals[key][1];
|
|
1811
|
+
setter(initialState[key]);
|
|
1812
|
+
});
|
|
1813
|
+
};
|
|
1814
|
+
const subscribe = (callback) => {
|
|
1815
|
+
return effect(() => {
|
|
1816
|
+
const snapshot = getSnapshot();
|
|
1817
|
+
callback(snapshot);
|
|
1818
|
+
});
|
|
1819
|
+
};
|
|
1820
|
+
const subscribeKey = (key, callback) => {
|
|
1821
|
+
let prev = signals[key][0]();
|
|
1822
|
+
return effect(() => {
|
|
1823
|
+
const current = signals[key][0]();
|
|
1824
|
+
if (!Object.is(current, prev)) {
|
|
1825
|
+
const oldPrev = prev;
|
|
1826
|
+
prev = current;
|
|
1827
|
+
callback(current, oldPrev);
|
|
1828
|
+
}
|
|
1829
|
+
});
|
|
1830
|
+
};
|
|
1831
|
+
return [store2, { setState, reset, subscribe, subscribeKey, getSnapshot }];
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
// src/core/signals/ref.ts
|
|
1835
|
+
function ref(initial) {
|
|
1836
|
+
return { current: initial };
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
// src/core/signals/memo.ts
|
|
1840
|
+
function memo(factory) {
|
|
1841
|
+
return derived(factory);
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
// src/core/signals/memoFn.ts
|
|
1845
|
+
function memoFn(callback) {
|
|
1846
|
+
return derived(callback);
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
// src/core/signals/array.ts
|
|
1850
|
+
function array(initial = []) {
|
|
1851
|
+
const [arr, setArr] = signal([...initial]);
|
|
1852
|
+
const actions = {
|
|
1853
|
+
push(...items) {
|
|
1854
|
+
setArr((prev) => [...prev, ...items]);
|
|
1855
|
+
},
|
|
1856
|
+
pop() {
|
|
1857
|
+
let removed;
|
|
1858
|
+
setArr((prev) => {
|
|
1859
|
+
const copy = [...prev];
|
|
1860
|
+
removed = copy.pop();
|
|
1861
|
+
return copy;
|
|
1862
|
+
});
|
|
1863
|
+
return removed;
|
|
1864
|
+
},
|
|
1865
|
+
shift() {
|
|
1866
|
+
let removed;
|
|
1867
|
+
setArr((prev) => {
|
|
1868
|
+
const copy = [...prev];
|
|
1869
|
+
removed = copy.shift();
|
|
1870
|
+
return copy;
|
|
1871
|
+
});
|
|
1872
|
+
return removed;
|
|
1873
|
+
},
|
|
1874
|
+
unshift(...items) {
|
|
1875
|
+
setArr((prev) => [...items, ...prev]);
|
|
1876
|
+
},
|
|
1877
|
+
splice(start, deleteCount = 0, ...items) {
|
|
1878
|
+
let removed = [];
|
|
1879
|
+
setArr((prev) => {
|
|
1880
|
+
const copy = [...prev];
|
|
1881
|
+
removed = copy.splice(start, deleteCount, ...items);
|
|
1882
|
+
return copy;
|
|
1883
|
+
});
|
|
1884
|
+
return removed;
|
|
1885
|
+
},
|
|
1886
|
+
remove(index) {
|
|
1887
|
+
setArr((prev) => prev.filter((_, i2) => i2 !== index));
|
|
1888
|
+
},
|
|
1889
|
+
removeWhere(predicate) {
|
|
1890
|
+
setArr((prev) => {
|
|
1891
|
+
const idx = prev.findIndex(predicate);
|
|
1892
|
+
if (idx === -1) return prev;
|
|
1893
|
+
return prev.filter((_, i2) => i2 !== idx);
|
|
1894
|
+
});
|
|
1895
|
+
},
|
|
1896
|
+
set(items) {
|
|
1897
|
+
setArr([...items]);
|
|
1898
|
+
},
|
|
1899
|
+
update(index, value) {
|
|
1900
|
+
setArr((prev) => prev.map((item, i2) => i2 === index ? value : item));
|
|
1901
|
+
},
|
|
1902
|
+
updateWhere(predicate, updater) {
|
|
1903
|
+
setArr((prev) => prev.map((item) => predicate(item) ? updater(item) : item));
|
|
1904
|
+
},
|
|
1905
|
+
sort(compareFn) {
|
|
1906
|
+
setArr((prev) => [...prev].sort(compareFn));
|
|
1907
|
+
},
|
|
1908
|
+
reverse() {
|
|
1909
|
+
setArr((prev) => [...prev].reverse());
|
|
1910
|
+
},
|
|
1911
|
+
filter(predicate) {
|
|
1912
|
+
setArr((prev) => prev.filter(predicate));
|
|
1913
|
+
},
|
|
1914
|
+
map(transform) {
|
|
1915
|
+
setArr((prev) => prev.map(transform));
|
|
1916
|
+
},
|
|
1917
|
+
clear() {
|
|
1918
|
+
setArr([]);
|
|
1919
|
+
}
|
|
1920
|
+
};
|
|
1921
|
+
return [arr, actions];
|
|
1922
|
+
}
|
|
1923
|
+
function reactiveArray(initial = []) {
|
|
1924
|
+
let data2 = [...initial];
|
|
1925
|
+
let snapshot = null;
|
|
1926
|
+
const signal2 = {};
|
|
1927
|
+
function notify() {
|
|
1928
|
+
snapshot = null;
|
|
1929
|
+
if (!enqueueBatchedSignal(signal2)) {
|
|
1930
|
+
notifySubscribers(signal2);
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
function get() {
|
|
1934
|
+
recordDependency(signal2);
|
|
1935
|
+
if (snapshot === null) {
|
|
1936
|
+
snapshot = Object.freeze([...data2]);
|
|
1937
|
+
}
|
|
1938
|
+
return snapshot;
|
|
1939
|
+
}
|
|
1940
|
+
const actions = {
|
|
1941
|
+
push(...items) {
|
|
1942
|
+
if (items.length === 0) return;
|
|
1943
|
+
data2.push(...items);
|
|
1944
|
+
notify();
|
|
1945
|
+
},
|
|
1946
|
+
pop() {
|
|
1947
|
+
if (data2.length === 0) return void 0;
|
|
1948
|
+
const removed = data2.pop();
|
|
1949
|
+
notify();
|
|
1950
|
+
return removed;
|
|
1951
|
+
},
|
|
1952
|
+
shift() {
|
|
1953
|
+
if (data2.length === 0) return void 0;
|
|
1954
|
+
const removed = data2.shift();
|
|
1955
|
+
notify();
|
|
1956
|
+
return removed;
|
|
1957
|
+
},
|
|
1958
|
+
unshift(...items) {
|
|
1959
|
+
if (items.length === 0) return;
|
|
1960
|
+
data2.unshift(...items);
|
|
1961
|
+
notify();
|
|
1962
|
+
},
|
|
1963
|
+
splice(start, deleteCount = 0, ...items) {
|
|
1964
|
+
const removed = data2.splice(start, deleteCount, ...items);
|
|
1965
|
+
if (removed.length > 0 || items.length > 0) {
|
|
1966
|
+
notify();
|
|
1967
|
+
}
|
|
1968
|
+
return removed;
|
|
1969
|
+
},
|
|
1970
|
+
remove(index) {
|
|
1971
|
+
if (index < 0 || index >= data2.length) return;
|
|
1972
|
+
data2.splice(index, 1);
|
|
1973
|
+
notify();
|
|
1974
|
+
},
|
|
1975
|
+
removeWhere(predicate) {
|
|
1976
|
+
const idx = data2.findIndex(predicate);
|
|
1977
|
+
if (idx === -1) return;
|
|
1978
|
+
data2.splice(idx, 1);
|
|
1979
|
+
notify();
|
|
1980
|
+
},
|
|
1981
|
+
set(items) {
|
|
1982
|
+
data2 = [...items];
|
|
1983
|
+
notify();
|
|
1984
|
+
},
|
|
1985
|
+
update(index, value) {
|
|
1986
|
+
if (index < 0 || index >= data2.length) return;
|
|
1987
|
+
if (Object.is(data2[index], value)) return;
|
|
1988
|
+
data2[index] = value;
|
|
1989
|
+
notify();
|
|
1990
|
+
},
|
|
1991
|
+
updateWhere(predicate, updater) {
|
|
1992
|
+
let changed = false;
|
|
1993
|
+
for (let i2 = 0; i2 < data2.length; i2++) {
|
|
1994
|
+
if (predicate(data2[i2])) {
|
|
1995
|
+
const updated = updater(data2[i2]);
|
|
1996
|
+
if (!Object.is(data2[i2], updated)) {
|
|
1997
|
+
data2[i2] = updated;
|
|
1998
|
+
changed = true;
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
if (changed) notify();
|
|
2003
|
+
},
|
|
2004
|
+
sort(compareFn) {
|
|
2005
|
+
if (data2.length <= 1) return;
|
|
2006
|
+
data2.sort(compareFn);
|
|
2007
|
+
notify();
|
|
2008
|
+
},
|
|
2009
|
+
reverse() {
|
|
2010
|
+
if (data2.length <= 1) return;
|
|
2011
|
+
data2.reverse();
|
|
2012
|
+
notify();
|
|
2013
|
+
},
|
|
2014
|
+
filter(predicate) {
|
|
2015
|
+
const filtered = data2.filter(predicate);
|
|
2016
|
+
if (filtered.length === data2.length) return;
|
|
2017
|
+
data2 = filtered;
|
|
2018
|
+
notify();
|
|
2019
|
+
},
|
|
2020
|
+
map(transform) {
|
|
2021
|
+
let changed = false;
|
|
2022
|
+
for (let i2 = 0; i2 < data2.length; i2++) {
|
|
2023
|
+
const transformed = transform(data2[i2], i2);
|
|
2024
|
+
if (!Object.is(data2[i2], transformed)) {
|
|
2025
|
+
data2[i2] = transformed;
|
|
2026
|
+
changed = true;
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
2029
|
+
if (changed) notify();
|
|
2030
|
+
},
|
|
2031
|
+
clear() {
|
|
2032
|
+
if (data2.length === 0) return;
|
|
2033
|
+
data2 = [];
|
|
2034
|
+
notify();
|
|
2035
|
+
}
|
|
2036
|
+
};
|
|
2037
|
+
return [get, actions];
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
// src/core/signals/deepSignal.ts
|
|
2041
|
+
function deepEqual(a2, b2) {
|
|
2042
|
+
if (Object.is(a2, b2)) return true;
|
|
2043
|
+
if (a2 == null || b2 == null) return false;
|
|
2044
|
+
if (typeof a2 !== typeof b2) return false;
|
|
2045
|
+
if (typeof a2 !== "object") return false;
|
|
2046
|
+
if (Array.isArray(a2)) {
|
|
2047
|
+
if (!Array.isArray(b2)) return false;
|
|
2048
|
+
if (a2.length !== b2.length) return false;
|
|
2049
|
+
return a2.every((val, i2) => deepEqual(val, b2[i2]));
|
|
2050
|
+
}
|
|
2051
|
+
const keysA = Object.keys(a2);
|
|
2052
|
+
const keysB = Object.keys(b2);
|
|
2053
|
+
if (keysA.length !== keysB.length) return false;
|
|
2054
|
+
return keysA.every((key) => deepEqual(a2[key], b2[key]));
|
|
2055
|
+
}
|
|
2056
|
+
function deepSignal(initial) {
|
|
2057
|
+
const state = { value: initial };
|
|
2058
|
+
function get() {
|
|
2059
|
+
recordDependency(state);
|
|
2060
|
+
return state.value;
|
|
2061
|
+
}
|
|
2062
|
+
function set(next) {
|
|
2063
|
+
const newValue = typeof next === "function" ? next(state.value) : next;
|
|
2064
|
+
if (deepEqual(newValue, state.value)) return;
|
|
2065
|
+
state.value = newValue;
|
|
2066
|
+
if (!enqueueBatchedSignal(state)) {
|
|
2067
|
+
notifySubscribers(state);
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
return [get, set];
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
// src/core/rendering/lifecycle.ts
|
|
2074
|
+
function onMount(callback, element) {
|
|
2075
|
+
if (typeof document === "undefined") return;
|
|
2076
|
+
if (element) {
|
|
2077
|
+
if (element.isConnected) {
|
|
2078
|
+
queueMicrotask(() => {
|
|
2079
|
+
callback();
|
|
2080
|
+
});
|
|
2081
|
+
return;
|
|
2082
|
+
}
|
|
2083
|
+
const observer = new MutationObserver(() => {
|
|
2084
|
+
if (element.isConnected) {
|
|
2085
|
+
observer.disconnect();
|
|
2086
|
+
callback();
|
|
2087
|
+
}
|
|
2088
|
+
});
|
|
2089
|
+
queueMicrotask(() => {
|
|
2090
|
+
if (element.isConnected) {
|
|
2091
|
+
callback();
|
|
2092
|
+
} else {
|
|
2093
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
|
2094
|
+
}
|
|
2095
|
+
});
|
|
2096
|
+
} else {
|
|
2097
|
+
queueMicrotask(() => {
|
|
2098
|
+
callback();
|
|
2099
|
+
});
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
function onUnmount(callback, element) {
|
|
2103
|
+
const startObserving = () => {
|
|
2104
|
+
const observer = new MutationObserver(() => {
|
|
2105
|
+
if (!element.isConnected) {
|
|
2106
|
+
observer.disconnect();
|
|
2107
|
+
callback();
|
|
2108
|
+
}
|
|
2109
|
+
});
|
|
2110
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
|
2111
|
+
};
|
|
2112
|
+
if (element.isConnected) {
|
|
2113
|
+
startObserving();
|
|
2114
|
+
} else {
|
|
2115
|
+
onMount(() => {
|
|
2116
|
+
startObserving();
|
|
2117
|
+
return void 0;
|
|
2118
|
+
}, element);
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
// src/core/rendering/context.ts
|
|
2123
|
+
function context(defaultValue) {
|
|
2124
|
+
const [getValue, setValue] = signal(defaultValue);
|
|
2125
|
+
return {
|
|
2126
|
+
provide(value) {
|
|
2127
|
+
setValue(value);
|
|
2128
|
+
},
|
|
2129
|
+
use() {
|
|
2130
|
+
return getValue;
|
|
2131
|
+
},
|
|
2132
|
+
get() {
|
|
2133
|
+
return getValue();
|
|
2134
|
+
},
|
|
2135
|
+
set(value) {
|
|
2136
|
+
setValue(value);
|
|
2137
|
+
}
|
|
2138
|
+
};
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
// src/core/rendering/lazy.ts
|
|
2142
|
+
function lazy(importFn) {
|
|
2143
|
+
let cached = null;
|
|
2144
|
+
return function LazyComponent() {
|
|
2145
|
+
if (cached) {
|
|
2146
|
+
return cached();
|
|
2147
|
+
}
|
|
2148
|
+
const [_status, setStatus] = signal("loading");
|
|
2149
|
+
const [_error, setError] = signal(null);
|
|
2150
|
+
const container = div({ class: "sibu-lazy" });
|
|
2151
|
+
importFn().then((mod) => {
|
|
2152
|
+
cached = mod.default;
|
|
2153
|
+
const rendered = cached();
|
|
2154
|
+
container.replaceChildren(rendered);
|
|
2155
|
+
setStatus("loaded");
|
|
2156
|
+
}).catch((err) => {
|
|
2157
|
+
const errorObj = err instanceof Error ? err : new Error(String(err));
|
|
2158
|
+
setError(errorObj);
|
|
2159
|
+
setStatus("error");
|
|
2160
|
+
container.replaceChildren(
|
|
2161
|
+
div({
|
|
2162
|
+
class: "sibu-lazy-error",
|
|
2163
|
+
nodes: `Failed to load component: ${errorObj.message}`
|
|
2164
|
+
})
|
|
2165
|
+
);
|
|
2166
|
+
});
|
|
2167
|
+
container.appendChild(span({ class: "sibu-lazy-loading", nodes: "Loading..." }));
|
|
2168
|
+
return container;
|
|
2169
|
+
};
|
|
2170
|
+
}
|
|
2171
|
+
function Suspense({ nodes, fallback }) {
|
|
2172
|
+
const container = div({ class: "sibu-suspense" });
|
|
2173
|
+
const fallbackEl = fallback();
|
|
2174
|
+
container.appendChild(fallbackEl);
|
|
2175
|
+
queueMicrotask(() => {
|
|
2176
|
+
try {
|
|
2177
|
+
const childEl = nodes();
|
|
2178
|
+
if (childEl.classList.contains("sibu-lazy")) {
|
|
2179
|
+
const observer = new MutationObserver(() => {
|
|
2180
|
+
const loading = childEl.querySelector(".sibu-lazy-loading");
|
|
2181
|
+
if (!loading) {
|
|
2182
|
+
observer.disconnect();
|
|
2183
|
+
container.replaceChildren(childEl);
|
|
2184
|
+
}
|
|
2185
|
+
});
|
|
2186
|
+
observer.observe(childEl, { childList: true, subtree: true });
|
|
2187
|
+
if (!childEl.querySelector(".sibu-lazy-loading")) {
|
|
2188
|
+
container.replaceChildren(childEl);
|
|
2189
|
+
}
|
|
2190
|
+
} else {
|
|
2191
|
+
container.replaceChildren(childEl);
|
|
2192
|
+
}
|
|
2193
|
+
} catch {
|
|
2194
|
+
}
|
|
2195
|
+
});
|
|
2196
|
+
return container;
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
// src/components/ErrorBoundary.ts
|
|
2200
|
+
var errorBoundaryStyles = `
|
|
2201
|
+
.sibu-error-boundary {
|
|
2202
|
+
position: relative;
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
.sibu-error-fallback {
|
|
2206
|
+
border: 2px solid #dc3545;
|
|
2207
|
+
border-radius: 8px;
|
|
2208
|
+
padding: 20px;
|
|
2209
|
+
margin: 10px 0;
|
|
2210
|
+
background: linear-gradient(135deg, #fff5f5 0%, #ffebee 100%);
|
|
2211
|
+
box-shadow: 0 2px 12px rgba(220, 53, 69, 0.15);
|
|
2212
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
.sibu-error-fallback .sibu-error-title {
|
|
2216
|
+
margin: 0 0 12px 0;
|
|
2217
|
+
color: #dc3545;
|
|
2218
|
+
font-size: 1.1em;
|
|
2219
|
+
font-weight: 600;
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
.sibu-error-fallback .sibu-error-message {
|
|
2223
|
+
font-family: 'SF Mono', 'Fira Code', 'Roboto Mono', monospace;
|
|
2224
|
+
background-color: rgba(0, 0, 0, 0.04);
|
|
2225
|
+
padding: 10px 14px;
|
|
2226
|
+
border-radius: 6px;
|
|
2227
|
+
border: 1px solid rgba(0, 0, 0, 0.08);
|
|
2228
|
+
margin: 10px 0;
|
|
2229
|
+
color: #495057;
|
|
2230
|
+
word-break: break-word;
|
|
2231
|
+
font-size: 0.9em;
|
|
2232
|
+
line-height: 1.5;
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
.sibu-error-fallback .sibu-error-btn {
|
|
2236
|
+
display: inline-flex;
|
|
2237
|
+
align-items: center;
|
|
2238
|
+
gap: 6px;
|
|
2239
|
+
padding: 8px 18px;
|
|
2240
|
+
border: none;
|
|
2241
|
+
border-radius: 6px;
|
|
2242
|
+
cursor: pointer;
|
|
2243
|
+
font-size: 14px;
|
|
2244
|
+
font-weight: 500;
|
|
2245
|
+
transition: all 0.2s ease;
|
|
2246
|
+
margin-top: 8px;
|
|
2247
|
+
background-color: #dc3545;
|
|
2248
|
+
color: white;
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
.sibu-error-fallback .sibu-error-btn:hover {
|
|
2252
|
+
background-color: #c82333;
|
|
2253
|
+
transform: translateY(-1px);
|
|
2254
|
+
box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
|
|
2255
|
+
}
|
|
2256
|
+
|
|
2257
|
+
.sibu-error-fallback .sibu-error-btn:active {
|
|
2258
|
+
transform: translateY(0);
|
|
2259
|
+
}
|
|
2260
|
+
`;
|
|
2261
|
+
var stylesInjected = false;
|
|
2262
|
+
function injectStyles() {
|
|
2263
|
+
if (!stylesInjected && typeof document !== "undefined") {
|
|
2264
|
+
const styleElement = style({ nodes: errorBoundaryStyles });
|
|
2265
|
+
document.head.appendChild(styleElement);
|
|
2266
|
+
stylesInjected = true;
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
var fallbackCache = /* @__PURE__ */ new WeakMap();
|
|
2270
|
+
function getMemoizedFallback(fallbackFn, error, retry) {
|
|
2271
|
+
let cache2 = fallbackCache.get(fallbackFn);
|
|
2272
|
+
if (!cache2) {
|
|
2273
|
+
cache2 = /* @__PURE__ */ new Map();
|
|
2274
|
+
fallbackCache.set(fallbackFn, cache2);
|
|
2275
|
+
}
|
|
2276
|
+
const key = error.message;
|
|
2277
|
+
if (!cache2.has(key)) {
|
|
2278
|
+
cache2.set(key, fallbackFn(error, retry));
|
|
2279
|
+
}
|
|
2280
|
+
return cache2.get(key);
|
|
2281
|
+
}
|
|
2282
|
+
function ErrorBoundary({ nodes, fallback, onError }) {
|
|
2283
|
+
injectStyles();
|
|
2284
|
+
const [error, setError] = signal(null);
|
|
2285
|
+
const retry = () => {
|
|
2286
|
+
if (fallback) {
|
|
2287
|
+
fallbackCache.delete(fallback);
|
|
2288
|
+
}
|
|
2289
|
+
setError(null);
|
|
2290
|
+
};
|
|
2291
|
+
const handleError = (e) => {
|
|
2292
|
+
const errorObj = e instanceof Error ? e : new Error(String(e));
|
|
2293
|
+
setError(errorObj);
|
|
2294
|
+
onError?.(errorObj);
|
|
2295
|
+
return errorObj;
|
|
2296
|
+
};
|
|
2297
|
+
const defaultFallback = (err, retryFn) => div({
|
|
2298
|
+
class: "sibu-error-fallback",
|
|
2299
|
+
nodes: [
|
|
2300
|
+
h3({
|
|
2301
|
+
nodes: "Something went wrong",
|
|
2302
|
+
class: "sibu-error-title"
|
|
2303
|
+
}),
|
|
2304
|
+
p({
|
|
2305
|
+
nodes: err.message,
|
|
2306
|
+
class: "sibu-error-message"
|
|
2307
|
+
}),
|
|
2308
|
+
button({
|
|
2309
|
+
nodes: "Retry",
|
|
2310
|
+
class: "sibu-error-btn",
|
|
2311
|
+
on: { click: retryFn }
|
|
2312
|
+
})
|
|
2313
|
+
]
|
|
2314
|
+
});
|
|
2315
|
+
const tryRenderFallback = (err) => {
|
|
2316
|
+
const fn = fallback || defaultFallback;
|
|
2317
|
+
try {
|
|
2318
|
+
return getMemoizedFallback(fn, err, retry);
|
|
2319
|
+
} catch (fallbackError) {
|
|
2320
|
+
const propagateError = fallbackError instanceof Error ? fallbackError : new Error(String(fallbackError));
|
|
2321
|
+
queueMicrotask(() => {
|
|
2322
|
+
if (container.parentNode) {
|
|
2323
|
+
container.dispatchEvent(
|
|
2324
|
+
new CustomEvent("sibu:error-propagate", {
|
|
2325
|
+
bubbles: true,
|
|
2326
|
+
detail: { error: propagateError }
|
|
2327
|
+
})
|
|
2328
|
+
);
|
|
2329
|
+
}
|
|
2330
|
+
});
|
|
2331
|
+
return document.createComment("error-boundary-failed");
|
|
2332
|
+
}
|
|
2333
|
+
};
|
|
2334
|
+
const container = div({
|
|
2335
|
+
class: "sibu-error-boundary",
|
|
2336
|
+
nodes: () => {
|
|
2337
|
+
const currentError = error();
|
|
2338
|
+
if (currentError) {
|
|
2339
|
+
return tryRenderFallback(currentError);
|
|
2340
|
+
}
|
|
2341
|
+
try {
|
|
2342
|
+
const result = nodes();
|
|
2343
|
+
if (result && typeof result.then === "function") {
|
|
2344
|
+
const asyncContainer = div({ class: "sibu-error-async" });
|
|
2345
|
+
asyncContainer.appendChild(span({ class: "sibu-lazy-loading", nodes: "Loading..." }));
|
|
2346
|
+
result.then((el) => {
|
|
2347
|
+
asyncContainer.replaceChildren(el);
|
|
2348
|
+
}).catch((e) => {
|
|
2349
|
+
const err = handleError(e);
|
|
2350
|
+
asyncContainer.replaceChildren(tryRenderFallback(err));
|
|
2351
|
+
});
|
|
2352
|
+
return asyncContainer;
|
|
2353
|
+
}
|
|
2354
|
+
return result;
|
|
2355
|
+
} catch (e) {
|
|
2356
|
+
const errorObj = handleError(e);
|
|
2357
|
+
return tryRenderFallback(errorObj);
|
|
2358
|
+
}
|
|
2359
|
+
}
|
|
2360
|
+
});
|
|
2361
|
+
container.addEventListener("sibu:error-propagate", (e) => {
|
|
2362
|
+
if (error()) return;
|
|
2363
|
+
e.stopPropagation();
|
|
2364
|
+
const customEvent = e;
|
|
2365
|
+
const propagatedError = customEvent.detail?.error;
|
|
2366
|
+
if (propagatedError) {
|
|
2367
|
+
handleError(propagatedError);
|
|
2368
|
+
}
|
|
2369
|
+
});
|
|
2370
|
+
return container;
|
|
2371
|
+
}
|
|
2372
|
+
|
|
2373
|
+
// src/components/Loading.ts
|
|
2374
|
+
var loadingStyles = `
|
|
2375
|
+
@keyframes sibu-spin {
|
|
2376
|
+
to { transform: rotate(360deg); }
|
|
2377
|
+
}
|
|
2378
|
+
|
|
2379
|
+
@keyframes sibu-pulse {
|
|
2380
|
+
0%, 100% { opacity: 1; }
|
|
2381
|
+
50% { opacity: 0.4; }
|
|
2382
|
+
}
|
|
2383
|
+
|
|
2384
|
+
.sibu-loading {
|
|
2385
|
+
display: flex;
|
|
2386
|
+
align-items: center;
|
|
2387
|
+
justify-content: center;
|
|
2388
|
+
padding: 20px;
|
|
2389
|
+
gap: 10px;
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
.sibu-loading-spinner {
|
|
2393
|
+
width: 24px;
|
|
2394
|
+
height: 24px;
|
|
2395
|
+
border: 3px solid #e0e0e0;
|
|
2396
|
+
border-top-color: #3b82f6;
|
|
2397
|
+
border-radius: 50%;
|
|
2398
|
+
animation: sibu-spin 0.8s linear infinite;
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2401
|
+
.sibu-loading-dots {
|
|
2402
|
+
display: flex;
|
|
2403
|
+
gap: 4px;
|
|
2404
|
+
}
|
|
2405
|
+
|
|
2406
|
+
.sibu-loading-dot {
|
|
2407
|
+
width: 8px;
|
|
2408
|
+
height: 8px;
|
|
2409
|
+
border-radius: 50%;
|
|
2410
|
+
background-color: #3b82f6;
|
|
2411
|
+
animation: sibu-pulse 1.2s ease-in-out infinite;
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2414
|
+
.sibu-loading-dot:nth-child(2) { animation-delay: 0.2s; }
|
|
2415
|
+
.sibu-loading-dot:nth-child(3) { animation-delay: 0.4s; }
|
|
2416
|
+
|
|
2417
|
+
.sibu-loading-text {
|
|
2418
|
+
color: #6b7280;
|
|
2419
|
+
font-size: 14px;
|
|
2420
|
+
}
|
|
2421
|
+
|
|
2422
|
+
.sibu-loading-sm .sibu-loading-spinner { width: 16px; height: 16px; border-width: 2px; }
|
|
2423
|
+
.sibu-loading-sm .sibu-loading-dot { width: 6px; height: 6px; }
|
|
2424
|
+
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
2425
|
+
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
2426
|
+
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
2427
|
+
`;
|
|
2428
|
+
var loadingStylesInjected = false;
|
|
2429
|
+
function injectLoadingStyles() {
|
|
2430
|
+
if (!loadingStylesInjected && typeof document !== "undefined") {
|
|
2431
|
+
document.head.appendChild(style({ nodes: loadingStyles }));
|
|
2432
|
+
loadingStylesInjected = true;
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
function Loading(props = {}) {
|
|
2436
|
+
injectLoadingStyles();
|
|
2437
|
+
const { text: text2, variant = "spinner", size = "md" } = props;
|
|
2438
|
+
const sizeClass = size !== "md" ? ` sibu-loading-${size}` : "";
|
|
2439
|
+
if (variant === "dots") {
|
|
2440
|
+
return div({
|
|
2441
|
+
class: `sibu-loading${sizeClass}`,
|
|
2442
|
+
nodes: [
|
|
2443
|
+
div({
|
|
2444
|
+
class: "sibu-loading-dots",
|
|
2445
|
+
nodes: [
|
|
2446
|
+
span({ class: "sibu-loading-dot" }),
|
|
2447
|
+
span({ class: "sibu-loading-dot" }),
|
|
2448
|
+
span({ class: "sibu-loading-dot" })
|
|
2449
|
+
]
|
|
2450
|
+
}),
|
|
2451
|
+
text2 ? span({ class: "sibu-loading-text", nodes: text2 }) : null
|
|
2452
|
+
].filter(Boolean)
|
|
2453
|
+
});
|
|
2454
|
+
}
|
|
2455
|
+
return div({
|
|
2456
|
+
class: `sibu-loading${sizeClass}`,
|
|
2457
|
+
nodes: [
|
|
2458
|
+
div({ class: "sibu-loading-spinner" }),
|
|
2459
|
+
text2 ? span({ class: "sibu-loading-text", nodes: text2 }) : null
|
|
2460
|
+
].filter(Boolean)
|
|
2461
|
+
});
|
|
2462
|
+
}
|
|
2463
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
2464
|
+
0 && (module.exports = {
|
|
2465
|
+
DynamicComponent,
|
|
2466
|
+
ErrorBoundary,
|
|
2467
|
+
Fragment,
|
|
2468
|
+
Loading,
|
|
2469
|
+
Portal,
|
|
2470
|
+
SVG_NS,
|
|
2471
|
+
Suspense,
|
|
2472
|
+
a,
|
|
2473
|
+
abbr,
|
|
2474
|
+
address,
|
|
2475
|
+
area,
|
|
2476
|
+
array,
|
|
2477
|
+
article,
|
|
2478
|
+
aside,
|
|
2479
|
+
audio,
|
|
2480
|
+
b,
|
|
2481
|
+
base,
|
|
2482
|
+
batch,
|
|
2483
|
+
bdi,
|
|
2484
|
+
bdo,
|
|
2485
|
+
bindDynamic,
|
|
2486
|
+
blockquote,
|
|
2487
|
+
body,
|
|
2488
|
+
br,
|
|
2489
|
+
button,
|
|
2490
|
+
canvas,
|
|
2491
|
+
caption,
|
|
2492
|
+
catchError,
|
|
2493
|
+
catchErrorAsync,
|
|
2494
|
+
center,
|
|
2495
|
+
checkLeaks,
|
|
2496
|
+
circle,
|
|
2497
|
+
cite,
|
|
2498
|
+
clipPath,
|
|
2499
|
+
code,
|
|
2500
|
+
col,
|
|
2501
|
+
colgroup,
|
|
2502
|
+
context,
|
|
2503
|
+
customElement,
|
|
2504
|
+
data,
|
|
2505
|
+
datalist,
|
|
2506
|
+
dd,
|
|
2507
|
+
deepSignal,
|
|
2508
|
+
defs,
|
|
2509
|
+
del,
|
|
2510
|
+
derived,
|
|
2511
|
+
details,
|
|
2512
|
+
dfn,
|
|
2513
|
+
dialog,
|
|
2514
|
+
disableSSR,
|
|
2515
|
+
dispose,
|
|
2516
|
+
div,
|
|
2517
|
+
dl,
|
|
2518
|
+
dt,
|
|
2519
|
+
each,
|
|
2520
|
+
effect,
|
|
2521
|
+
ellipse,
|
|
2522
|
+
em,
|
|
2523
|
+
embed,
|
|
2524
|
+
enableSSR,
|
|
2525
|
+
enqueueBatchedSignal,
|
|
2526
|
+
fieldset,
|
|
2527
|
+
figcaption,
|
|
2528
|
+
figure,
|
|
2529
|
+
font,
|
|
2530
|
+
footer,
|
|
2531
|
+
form,
|
|
2532
|
+
g,
|
|
2533
|
+
getSlot,
|
|
2534
|
+
h1,
|
|
2535
|
+
h2,
|
|
2536
|
+
h3,
|
|
2537
|
+
h4,
|
|
2538
|
+
h5,
|
|
2539
|
+
h6,
|
|
2540
|
+
head,
|
|
2541
|
+
header,
|
|
2542
|
+
hr,
|
|
2543
|
+
html,
|
|
2544
|
+
i,
|
|
2545
|
+
iframe,
|
|
2546
|
+
img,
|
|
2547
|
+
input,
|
|
2548
|
+
ins,
|
|
2549
|
+
isBatching,
|
|
2550
|
+
isSSR,
|
|
2551
|
+
kbd,
|
|
2552
|
+
label,
|
|
2553
|
+
lazy,
|
|
2554
|
+
legend,
|
|
2555
|
+
li,
|
|
2556
|
+
line,
|
|
2557
|
+
linearGradient,
|
|
2558
|
+
link,
|
|
2559
|
+
main,
|
|
2560
|
+
map,
|
|
2561
|
+
mark,
|
|
2562
|
+
marker,
|
|
2563
|
+
marquee,
|
|
2564
|
+
mask,
|
|
2565
|
+
match,
|
|
2566
|
+
math,
|
|
2567
|
+
memo,
|
|
2568
|
+
memoFn,
|
|
2569
|
+
menu,
|
|
2570
|
+
meta,
|
|
2571
|
+
meter,
|
|
2572
|
+
mount,
|
|
2573
|
+
nav,
|
|
2574
|
+
noscript,
|
|
2575
|
+
object,
|
|
2576
|
+
ol,
|
|
2577
|
+
onMount,
|
|
2578
|
+
onUnmount,
|
|
2579
|
+
optgroup,
|
|
2580
|
+
option,
|
|
2581
|
+
output,
|
|
2582
|
+
p,
|
|
2583
|
+
param,
|
|
2584
|
+
path,
|
|
2585
|
+
pattern,
|
|
2586
|
+
picture,
|
|
2587
|
+
polygon,
|
|
2588
|
+
polyline,
|
|
2589
|
+
portal,
|
|
2590
|
+
pre,
|
|
2591
|
+
progress,
|
|
2592
|
+
q,
|
|
2593
|
+
radialGradient,
|
|
2594
|
+
reactiveArray,
|
|
2595
|
+
rect,
|
|
2596
|
+
ref,
|
|
2597
|
+
registerComponent,
|
|
2598
|
+
registerDisposer,
|
|
2599
|
+
resolveComponent,
|
|
2600
|
+
rp,
|
|
2601
|
+
rt,
|
|
2602
|
+
ruby,
|
|
2603
|
+
s,
|
|
2604
|
+
samp,
|
|
2605
|
+
script,
|
|
2606
|
+
section,
|
|
2607
|
+
select,
|
|
2608
|
+
setGlobalErrorHandler,
|
|
2609
|
+
show,
|
|
2610
|
+
signal,
|
|
2611
|
+
slot,
|
|
2612
|
+
small,
|
|
2613
|
+
source,
|
|
2614
|
+
span,
|
|
2615
|
+
stop,
|
|
2616
|
+
store,
|
|
2617
|
+
strong,
|
|
2618
|
+
style,
|
|
2619
|
+
sub,
|
|
2620
|
+
summary,
|
|
2621
|
+
sup,
|
|
2622
|
+
svg,
|
|
2623
|
+
symbol,
|
|
2624
|
+
table,
|
|
2625
|
+
tagFactory,
|
|
2626
|
+
tbody,
|
|
2627
|
+
td,
|
|
2628
|
+
template,
|
|
2629
|
+
text,
|
|
2630
|
+
textarea,
|
|
2631
|
+
tfoot,
|
|
2632
|
+
th,
|
|
2633
|
+
thead,
|
|
2634
|
+
time,
|
|
2635
|
+
title,
|
|
2636
|
+
tr,
|
|
2637
|
+
track,
|
|
2638
|
+
tspan,
|
|
2639
|
+
u,
|
|
2640
|
+
ul,
|
|
2641
|
+
unregisterComponent,
|
|
2642
|
+
use,
|
|
2643
|
+
var_,
|
|
2644
|
+
video,
|
|
2645
|
+
watch,
|
|
2646
|
+
when,
|
|
2647
|
+
withSSR
|
|
2648
|
+
});
|