sibujs 1.0.0 → 1.0.2
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/dist/browser.js +4 -3
- package/dist/build.cjs +11 -3
- package/dist/build.js +10 -9
- package/dist/cdn.global.js +4 -4
- package/dist/chunk-24WSRM54.js +2002 -0
- package/dist/chunk-3CRQALYP.js +877 -0
- package/dist/chunk-6HLLIF3K.js +398 -0
- package/dist/chunk-7TQKR4PP.js +294 -0
- package/dist/chunk-CZUGLNJS.js +37 -0
- package/dist/chunk-DTCOOBMX.js +725 -0
- package/dist/chunk-FGOEVHY3.js +60 -0
- package/dist/chunk-HGMJFBC7.js +654 -0
- package/dist/chunk-HS6OOE3Q.js +365 -0
- package/dist/chunk-L36YN45V.js +949 -0
- package/dist/chunk-MJ4LVHGX.js +712 -0
- package/dist/chunk-N6IZB6KJ.js +567 -0
- package/dist/chunk-NMRUZALC.js +1097 -0
- package/dist/chunk-OHQQWZ7P.js +969 -0
- package/dist/chunk-ONCYDOK6.js +466 -0
- package/dist/chunk-OWLQ4HZI.js +282 -0
- package/dist/chunk-PZEGYCF5.js +61 -0
- package/dist/chunk-QVKGGB2S.js +300 -0
- package/dist/chunk-SDLZDHKP.js +107 -0
- package/dist/chunk-Y6GP4QGG.js +276 -0
- package/dist/chunk-YECR7UIA.js +347 -0
- package/dist/chunk-Z65KYU7I.js +26 -0
- package/dist/data.cjs +24 -4
- package/dist/data.js +6 -5
- package/dist/devtools.cjs +1 -1
- package/dist/devtools.js +4 -3
- package/dist/ecosystem.cjs +9 -2
- package/dist/ecosystem.js +7 -6
- package/dist/extras.cjs +68 -24
- package/dist/extras.js +21 -20
- package/dist/index.cjs +11 -3
- package/dist/index.js +10 -9
- package/dist/motion.js +3 -2
- package/dist/patterns.cjs +7 -2
- package/dist/patterns.d.cts +15 -0
- package/dist/patterns.d.ts +15 -0
- package/dist/patterns.js +5 -4
- package/dist/performance.js +3 -2
- package/dist/plugins.cjs +65 -29
- package/dist/plugins.js +9 -8
- package/dist/ssr-WKUPVSSK.js +36 -0
- package/dist/ssr.cjs +60 -41
- package/dist/ssr.d.cts +9 -3
- package/dist/ssr.d.ts +9 -3
- package/dist/ssr.js +8 -7
- package/dist/ui.js +6 -5
- package/dist/widgets.js +5 -4
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
signal
|
|
3
|
+
} from "./chunk-YECR7UIA.js";
|
|
4
|
+
|
|
5
|
+
// src/core/rendering/context.ts
|
|
6
|
+
function context(defaultValue) {
|
|
7
|
+
const [getValue, setValue] = signal(defaultValue);
|
|
8
|
+
return {
|
|
9
|
+
provide(value) {
|
|
10
|
+
setValue(value);
|
|
11
|
+
},
|
|
12
|
+
use() {
|
|
13
|
+
return getValue;
|
|
14
|
+
},
|
|
15
|
+
get() {
|
|
16
|
+
return getValue();
|
|
17
|
+
},
|
|
18
|
+
set(value) {
|
|
19
|
+
setValue(value);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
context
|
|
26
|
+
};
|
package/dist/data.cjs
CHANGED
|
@@ -546,8 +546,13 @@ function query(key, fetcher, options = {}) {
|
|
|
546
546
|
async function doFetch() {
|
|
547
547
|
if (disposed || !currentKey || !enabled) return;
|
|
548
548
|
const key2 = currentKey;
|
|
549
|
-
|
|
550
|
-
if (!entry)
|
|
549
|
+
let entry = queryCache.get(key2);
|
|
550
|
+
if (!entry) {
|
|
551
|
+
entry = getOrCreateEntry(key2);
|
|
552
|
+
entry.subscribers++;
|
|
553
|
+
entry.listeners.add(onCacheUpdate);
|
|
554
|
+
entry.refetchers.add(doFetch);
|
|
555
|
+
}
|
|
551
556
|
if (entry.promise) {
|
|
552
557
|
setIsFetching(true);
|
|
553
558
|
try {
|
|
@@ -596,9 +601,16 @@ function query(key, fetcher, options = {}) {
|
|
|
596
601
|
function onCacheUpdate() {
|
|
597
602
|
if (disposed || !currentKey) return;
|
|
598
603
|
const entry = queryCache.get(currentKey);
|
|
599
|
-
if (!entry)
|
|
604
|
+
if (!entry) {
|
|
605
|
+
batch(() => {
|
|
606
|
+
setData(void 0);
|
|
607
|
+
setError(void 0);
|
|
608
|
+
setIsFetching(false);
|
|
609
|
+
});
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
600
612
|
batch(() => {
|
|
601
|
-
|
|
613
|
+
setData(entry.data);
|
|
602
614
|
setError(entry.error);
|
|
603
615
|
if (!entry.promise) setIsFetching(false);
|
|
604
616
|
});
|
|
@@ -709,10 +721,18 @@ function setQueryData(key, data) {
|
|
|
709
721
|
for (const listener of entry.listeners) listener();
|
|
710
722
|
}
|
|
711
723
|
function clearQueryCache() {
|
|
724
|
+
const activeListeners = [];
|
|
725
|
+
const activeRefetchers = [];
|
|
712
726
|
for (const entry of queryCache.values()) {
|
|
713
727
|
if (entry.gcTimer) clearTimeout(entry.gcTimer);
|
|
728
|
+
if (entry.subscribers > 0) {
|
|
729
|
+
for (const listener of entry.listeners) activeListeners.push(listener);
|
|
730
|
+
for (const refetcher of entry.refetchers) activeRefetchers.push(refetcher);
|
|
731
|
+
}
|
|
714
732
|
}
|
|
715
733
|
queryCache.clear();
|
|
734
|
+
for (const listener of activeListeners) listener();
|
|
735
|
+
for (const refetcher of activeRefetchers) refetcher();
|
|
716
736
|
}
|
|
717
737
|
|
|
718
738
|
// src/data/mutation.ts
|
package/dist/data.js
CHANGED
|
@@ -19,12 +19,13 @@ import {
|
|
|
19
19
|
syncAdapter,
|
|
20
20
|
throttle,
|
|
21
21
|
withRetry
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-OHQQWZ7P.js";
|
|
23
|
+
import "./chunk-Z65KYU7I.js";
|
|
24
|
+
import "./chunk-FGOEVHY3.js";
|
|
25
|
+
import "./chunk-PZEGYCF5.js";
|
|
26
26
|
import "./chunk-CHJ27IGK.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-YECR7UIA.js";
|
|
28
|
+
import "./chunk-4MYMUBRS.js";
|
|
28
29
|
import "./chunk-MLKGABMK.js";
|
|
29
30
|
export {
|
|
30
31
|
calculateDelay,
|
package/dist/devtools.cjs
CHANGED
|
@@ -476,7 +476,7 @@ function getActiveDevTools() {
|
|
|
476
476
|
}
|
|
477
477
|
function initDevTools(config) {
|
|
478
478
|
const maxEvents = config?.maxEvents ?? 1e3;
|
|
479
|
-
const enabled = config?.enabled ??
|
|
479
|
+
const enabled = config?.enabled ?? isDev();
|
|
480
480
|
if (!enabled) return createNoopApi();
|
|
481
481
|
const hook = getOrCreateHook();
|
|
482
482
|
nextNodeId = 0;
|
package/dist/devtools.js
CHANGED
|
@@ -33,10 +33,11 @@ import {
|
|
|
33
33
|
trackCleanup,
|
|
34
34
|
walkDependencyGraph,
|
|
35
35
|
withErrorTracking
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import "./chunk-
|
|
36
|
+
} from "./chunk-NMRUZALC.js";
|
|
37
|
+
import "./chunk-PZEGYCF5.js";
|
|
38
38
|
import "./chunk-CHJ27IGK.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-YECR7UIA.js";
|
|
40
|
+
import "./chunk-4MYMUBRS.js";
|
|
40
41
|
import "./chunk-MLKGABMK.js";
|
|
41
42
|
export {
|
|
42
43
|
SibuError,
|
package/dist/ecosystem.cjs
CHANGED
|
@@ -525,6 +525,13 @@ function sanitizeUrl(url) {
|
|
|
525
525
|
}
|
|
526
526
|
return trimmed;
|
|
527
527
|
}
|
|
528
|
+
function sanitizeCSSValue(value) {
|
|
529
|
+
const lower = value.toLowerCase().replace(/\s+/g, "");
|
|
530
|
+
if (lower.includes("url(") || lower.includes("expression(") || lower.includes("javascript:") || lower.includes("-moz-binding")) {
|
|
531
|
+
return "";
|
|
532
|
+
}
|
|
533
|
+
return value;
|
|
534
|
+
}
|
|
528
535
|
var URL_ATTRIBUTES = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "cite", "poster", "background", "srcset"]);
|
|
529
536
|
function isUrlAttribute(attr) {
|
|
530
537
|
return URL_ATTRIBUTES.has(attr);
|
|
@@ -651,11 +658,11 @@ function applyStyle(el, style) {
|
|
|
651
658
|
if (typeof val === "function") {
|
|
652
659
|
const getter = val;
|
|
653
660
|
const teardown = track(() => {
|
|
654
|
-
htmlEl.style.setProperty(name, String(getter()));
|
|
661
|
+
htmlEl.style.setProperty(name, sanitizeCSSValue(String(getter())));
|
|
655
662
|
});
|
|
656
663
|
registerDisposer(el, teardown);
|
|
657
664
|
} else {
|
|
658
|
-
htmlEl.style.setProperty(name, String(val));
|
|
665
|
+
htmlEl.style.setProperty(name, sanitizeCSSValue(String(val)));
|
|
659
666
|
}
|
|
660
667
|
}
|
|
661
668
|
}
|
package/dist/ecosystem.js
CHANGED
|
@@ -7,14 +7,15 @@ import {
|
|
|
7
7
|
mobXAdapter,
|
|
8
8
|
reduxAdapter,
|
|
9
9
|
zustandAdapter
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HS6OOE3Q.js";
|
|
11
11
|
import "./chunk-K5ZUMYVS.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-QVKGGB2S.js";
|
|
13
|
+
import "./chunk-SDLZDHKP.js";
|
|
14
|
+
import "./chunk-FGOEVHY3.js";
|
|
15
|
+
import "./chunk-PZEGYCF5.js";
|
|
16
16
|
import "./chunk-CHJ27IGK.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-YECR7UIA.js";
|
|
18
|
+
import "./chunk-4MYMUBRS.js";
|
|
18
19
|
import "./chunk-MLKGABMK.js";
|
|
19
20
|
export {
|
|
20
21
|
antdAdapter,
|
package/dist/extras.cjs
CHANGED
|
@@ -789,8 +789,13 @@ function query(key, fetcher, options = {}) {
|
|
|
789
789
|
async function doFetch() {
|
|
790
790
|
if (disposed || !currentKey || !enabled) return;
|
|
791
791
|
const key2 = currentKey;
|
|
792
|
-
|
|
793
|
-
if (!entry)
|
|
792
|
+
let entry = queryCache.get(key2);
|
|
793
|
+
if (!entry) {
|
|
794
|
+
entry = getOrCreateEntry(key2);
|
|
795
|
+
entry.subscribers++;
|
|
796
|
+
entry.listeners.add(onCacheUpdate);
|
|
797
|
+
entry.refetchers.add(doFetch);
|
|
798
|
+
}
|
|
794
799
|
if (entry.promise) {
|
|
795
800
|
setIsFetching(true);
|
|
796
801
|
try {
|
|
@@ -839,9 +844,16 @@ function query(key, fetcher, options = {}) {
|
|
|
839
844
|
function onCacheUpdate() {
|
|
840
845
|
if (disposed || !currentKey) return;
|
|
841
846
|
const entry = queryCache.get(currentKey);
|
|
842
|
-
if (!entry)
|
|
847
|
+
if (!entry) {
|
|
848
|
+
batch(() => {
|
|
849
|
+
setData(void 0);
|
|
850
|
+
setError(void 0);
|
|
851
|
+
setIsFetching(false);
|
|
852
|
+
});
|
|
853
|
+
return;
|
|
854
|
+
}
|
|
843
855
|
batch(() => {
|
|
844
|
-
|
|
856
|
+
setData(entry.data);
|
|
845
857
|
setError(entry.error);
|
|
846
858
|
if (!entry.promise) setIsFetching(false);
|
|
847
859
|
});
|
|
@@ -952,10 +964,18 @@ function setQueryData(key, data2) {
|
|
|
952
964
|
for (const listener of entry.listeners) listener();
|
|
953
965
|
}
|
|
954
966
|
function clearQueryCache() {
|
|
967
|
+
const activeListeners = [];
|
|
968
|
+
const activeRefetchers = [];
|
|
955
969
|
for (const entry of queryCache.values()) {
|
|
956
970
|
if (entry.gcTimer) clearTimeout(entry.gcTimer);
|
|
971
|
+
if (entry.subscribers > 0) {
|
|
972
|
+
for (const listener of entry.listeners) activeListeners.push(listener);
|
|
973
|
+
for (const refetcher of entry.refetchers) activeRefetchers.push(refetcher);
|
|
974
|
+
}
|
|
957
975
|
}
|
|
958
976
|
queryCache.clear();
|
|
977
|
+
for (const listener of activeListeners) listener();
|
|
978
|
+
for (const refetcher of activeRefetchers) refetcher();
|
|
959
979
|
}
|
|
960
980
|
|
|
961
981
|
// src/data/mutation.ts
|
|
@@ -2121,10 +2141,13 @@ function persisted(key, initial, options = {}) {
|
|
|
2121
2141
|
const storage = options.session ? sessionStorage : localStorage;
|
|
2122
2142
|
const serialize = options.serialize || JSON.stringify;
|
|
2123
2143
|
const deserialize = options.deserialize || JSON.parse;
|
|
2144
|
+
const encrypt = options.encrypt;
|
|
2145
|
+
const decrypt = options.decrypt;
|
|
2124
2146
|
let restored = initial;
|
|
2125
2147
|
try {
|
|
2126
|
-
|
|
2148
|
+
let raw = storage.getItem(key);
|
|
2127
2149
|
if (raw !== null) {
|
|
2150
|
+
if (decrypt) raw = decrypt(raw);
|
|
2128
2151
|
const parsed = deserialize(raw);
|
|
2129
2152
|
restored = options.validate && !options.validate(parsed) ? initial : parsed;
|
|
2130
2153
|
}
|
|
@@ -2134,7 +2157,9 @@ function persisted(key, initial, options = {}) {
|
|
|
2134
2157
|
effect(() => {
|
|
2135
2158
|
const current = value();
|
|
2136
2159
|
try {
|
|
2137
|
-
|
|
2160
|
+
let serialized = serialize(current);
|
|
2161
|
+
if (encrypt) serialized = encrypt(serialized);
|
|
2162
|
+
storage.setItem(key, serialized);
|
|
2138
2163
|
} catch {
|
|
2139
2164
|
}
|
|
2140
2165
|
});
|
|
@@ -3331,6 +3356,13 @@ function sanitizeUrl(url) {
|
|
|
3331
3356
|
}
|
|
3332
3357
|
return trimmed;
|
|
3333
3358
|
}
|
|
3359
|
+
function sanitizeCSSValue(value) {
|
|
3360
|
+
const lower = value.toLowerCase().replace(/\s+/g, "");
|
|
3361
|
+
if (lower.includes("url(") || lower.includes("expression(") || lower.includes("javascript:") || lower.includes("-moz-binding")) {
|
|
3362
|
+
return "";
|
|
3363
|
+
}
|
|
3364
|
+
return value;
|
|
3365
|
+
}
|
|
3334
3366
|
var URL_ATTRIBUTES = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "cite", "poster", "background", "srcset"]);
|
|
3335
3367
|
function isUrlAttribute(attr) {
|
|
3336
3368
|
return URL_ATTRIBUTES.has(attr);
|
|
@@ -4352,6 +4384,13 @@ function setCanonical(url) {
|
|
|
4352
4384
|
}
|
|
4353
4385
|
|
|
4354
4386
|
// src/platform/ssr.ts
|
|
4387
|
+
var _isDev5 = isDev();
|
|
4388
|
+
function ssrErrorComment(err) {
|
|
4389
|
+
if (_isDev5) {
|
|
4390
|
+
return `<!--SSR error: ${escapeHtml(err instanceof Error ? err.message : String(err))}-->`;
|
|
4391
|
+
}
|
|
4392
|
+
return "<!--SSR error-->";
|
|
4393
|
+
}
|
|
4355
4394
|
var VOID_ELEMENTS = /* @__PURE__ */ new Set([
|
|
4356
4395
|
"area",
|
|
4357
4396
|
"base",
|
|
@@ -4374,7 +4413,7 @@ function renderToString(element) {
|
|
|
4374
4413
|
try {
|
|
4375
4414
|
return renderToString(child);
|
|
4376
4415
|
} catch (err) {
|
|
4377
|
-
return
|
|
4416
|
+
return ssrErrorComment(err);
|
|
4378
4417
|
}
|
|
4379
4418
|
}).join("");
|
|
4380
4419
|
}
|
|
@@ -4404,7 +4443,7 @@ function renderToString(element) {
|
|
|
4404
4443
|
try {
|
|
4405
4444
|
html2 += renderToString(child);
|
|
4406
4445
|
} catch (err) {
|
|
4407
|
-
html2 +=
|
|
4446
|
+
html2 += ssrErrorComment(err);
|
|
4408
4447
|
}
|
|
4409
4448
|
}
|
|
4410
4449
|
html2 += `</${tag}>`;
|
|
@@ -4428,7 +4467,7 @@ function renderToDocument(component, options = {}) {
|
|
|
4428
4467
|
try {
|
|
4429
4468
|
content = renderToString(component());
|
|
4430
4469
|
} catch (err) {
|
|
4431
|
-
content =
|
|
4470
|
+
content = ssrErrorComment(err);
|
|
4432
4471
|
}
|
|
4433
4472
|
const metaTags = (options.meta || []).map(
|
|
4434
4473
|
(attrs) => `<meta ${Object.entries(attrs).map(([k, v]) => `${k}="${escapeAttr(v)}"`).join(" ")} />`
|
|
@@ -4460,7 +4499,7 @@ async function* renderToStream(element) {
|
|
|
4460
4499
|
try {
|
|
4461
4500
|
yield* renderToStream(child);
|
|
4462
4501
|
} catch (err) {
|
|
4463
|
-
yield
|
|
4502
|
+
yield ssrErrorComment(err);
|
|
4464
4503
|
}
|
|
4465
4504
|
}
|
|
4466
4505
|
return;
|
|
@@ -4492,7 +4531,7 @@ async function* renderToStream(element) {
|
|
|
4492
4531
|
try {
|
|
4493
4532
|
yield* renderToStream(child);
|
|
4494
4533
|
} catch (err) {
|
|
4495
|
-
yield
|
|
4534
|
+
yield ssrErrorComment(err);
|
|
4496
4535
|
}
|
|
4497
4536
|
}
|
|
4498
4537
|
yield `</${tag}>`;
|
|
@@ -4582,9 +4621,10 @@ function ssrSuspense(props) {
|
|
|
4582
4621
|
}));
|
|
4583
4622
|
return { element: wrapper, promise };
|
|
4584
4623
|
}
|
|
4585
|
-
function suspenseSwapScript(id) {
|
|
4624
|
+
function suspenseSwapScript(id, nonce) {
|
|
4586
4625
|
const safeId = id.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/</g, "\\u003c").replace(/>/g, "\\u003e");
|
|
4587
|
-
|
|
4626
|
+
const nonceAttr = nonce ? ` nonce="${escapeAttr(nonce)}"` : "";
|
|
4627
|
+
return `<script${nonceAttr}>(function(){var t=document.getElementById("sibu-resolved-${safeId}");var f=document.querySelector('[data-sibu-suspense-id="${safeId}"]');if(t&&f){while(t.firstChild)f.appendChild(t.firstChild);t.remove();f.removeAttribute("data-sibu-suspense-id");}})()</script>`;
|
|
4588
4628
|
}
|
|
4589
4629
|
async function* renderToSuspenseStream(element, pendingBoundaries = []) {
|
|
4590
4630
|
yield* renderToStream(element);
|
|
@@ -4597,13 +4637,17 @@ async function* renderToSuspenseStream(element, pendingBoundaries = []) {
|
|
|
4597
4637
|
}
|
|
4598
4638
|
}
|
|
4599
4639
|
var SSR_DATA_ATTR = "__SIBU_SSR_DATA__";
|
|
4600
|
-
function serializeState(state) {
|
|
4640
|
+
function serializeState(state, nonce) {
|
|
4601
4641
|
const json = JSON.stringify(state).replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/&/g, "\\u0026");
|
|
4602
|
-
|
|
4642
|
+
const nonceAttr = nonce ? ` nonce="${escapeAttr(nonce)}"` : "";
|
|
4643
|
+
return `<script${nonceAttr}>window.${SSR_DATA_ATTR}=${json}</script>`;
|
|
4603
4644
|
}
|
|
4604
|
-
function deserializeState() {
|
|
4645
|
+
function deserializeState(validate) {
|
|
4605
4646
|
if (typeof window === "undefined") return void 0;
|
|
4606
|
-
|
|
4647
|
+
const raw = window[SSR_DATA_ATTR];
|
|
4648
|
+
if (raw === void 0) return void 0;
|
|
4649
|
+
if (validate && !validate(raw)) return void 0;
|
|
4650
|
+
return raw;
|
|
4607
4651
|
}
|
|
4608
4652
|
function escapeHtml(str) {
|
|
4609
4653
|
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
@@ -4953,7 +4997,7 @@ function isWasmCached(key) {
|
|
|
4953
4997
|
}
|
|
4954
4998
|
|
|
4955
4999
|
// src/reactivity/bindChildNode.ts
|
|
4956
|
-
var
|
|
5000
|
+
var _isDev6 = isDev();
|
|
4957
5001
|
function bindChildNode(placeholder, getter) {
|
|
4958
5002
|
let lastNodes = [];
|
|
4959
5003
|
function commit() {
|
|
@@ -4961,7 +5005,7 @@ function bindChildNode(placeholder, getter) {
|
|
|
4961
5005
|
try {
|
|
4962
5006
|
result = getter();
|
|
4963
5007
|
} catch (err) {
|
|
4964
|
-
if (
|
|
5008
|
+
if (_isDev6) devWarn(`bindChildNode: getter threw: ${err instanceof Error ? err.message : String(err)}`);
|
|
4965
5009
|
return;
|
|
4966
5010
|
}
|
|
4967
5011
|
for (let i2 = 0; i2 < lastNodes.length; i2++) {
|
|
@@ -5000,7 +5044,7 @@ function bindChildNode(placeholder, getter) {
|
|
|
5000
5044
|
|
|
5001
5045
|
// src/core/rendering/dispose.ts
|
|
5002
5046
|
var elementDisposers = /* @__PURE__ */ new WeakMap();
|
|
5003
|
-
var
|
|
5047
|
+
var _isDev7 = isDev();
|
|
5004
5048
|
var activeBindingCount = 0;
|
|
5005
5049
|
function registerDisposer(node, teardown) {
|
|
5006
5050
|
let disposers = elementDisposers.get(node);
|
|
@@ -5009,7 +5053,7 @@ function registerDisposer(node, teardown) {
|
|
|
5009
5053
|
elementDisposers.set(node, disposers);
|
|
5010
5054
|
}
|
|
5011
5055
|
disposers.push(teardown);
|
|
5012
|
-
if (
|
|
5056
|
+
if (_isDev7) activeBindingCount++;
|
|
5013
5057
|
}
|
|
5014
5058
|
|
|
5015
5059
|
// src/core/rendering/tagFactory.ts
|
|
@@ -5041,11 +5085,11 @@ function applyStyle(el, style2) {
|
|
|
5041
5085
|
if (typeof val === "function") {
|
|
5042
5086
|
const getter = val;
|
|
5043
5087
|
const teardown = track(() => {
|
|
5044
|
-
htmlEl.style.setProperty(name, String(getter()));
|
|
5088
|
+
htmlEl.style.setProperty(name, sanitizeCSSValue(String(getter())));
|
|
5045
5089
|
});
|
|
5046
5090
|
registerDisposer(el, teardown);
|
|
5047
5091
|
} else {
|
|
5048
|
-
htmlEl.style.setProperty(name, String(val));
|
|
5092
|
+
htmlEl.style.setProperty(name, sanitizeCSSValue(String(val)));
|
|
5049
5093
|
}
|
|
5050
5094
|
}
|
|
5051
5095
|
}
|
|
@@ -6582,7 +6626,7 @@ function getActiveDevTools() {
|
|
|
6582
6626
|
}
|
|
6583
6627
|
function initDevTools(config) {
|
|
6584
6628
|
const maxEvents = config?.maxEvents ?? 1e3;
|
|
6585
|
-
const enabled = config?.enabled ??
|
|
6629
|
+
const enabled = config?.enabled ?? isDev();
|
|
6586
6630
|
if (!enabled) return createNoopApi();
|
|
6587
6631
|
const hook = getOrCreateHook();
|
|
6588
6632
|
nextNodeId = 0;
|
package/dist/extras.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
optimisticList,
|
|
9
9
|
persisted,
|
|
10
10
|
timeline
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-Y6GP4QGG.js";
|
|
12
12
|
import {
|
|
13
13
|
DOMPool,
|
|
14
14
|
Features,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
transitionState,
|
|
45
45
|
uniqueId,
|
|
46
46
|
yieldToMain
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-HGMJFBC7.js";
|
|
48
48
|
import {
|
|
49
49
|
VERSION,
|
|
50
50
|
bundlerMetadata,
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
preloadCritical,
|
|
66
66
|
prerenderRoutes,
|
|
67
67
|
satisfies
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-DTCOOBMX.js";
|
|
69
69
|
import {
|
|
70
70
|
Head,
|
|
71
71
|
clearWasmCache,
|
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
wasm,
|
|
91
91
|
worker,
|
|
92
92
|
workerFn
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-MJ4LVHGX.js";
|
|
94
94
|
import {
|
|
95
95
|
FocusTrap,
|
|
96
96
|
VirtualList,
|
|
@@ -129,7 +129,7 @@ import {
|
|
|
129
129
|
toast,
|
|
130
130
|
withScopedStyle,
|
|
131
131
|
zipMask
|
|
132
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-3CRQALYP.js";
|
|
133
133
|
import {
|
|
134
134
|
RenderProp,
|
|
135
135
|
assertType,
|
|
@@ -157,7 +157,7 @@ import {
|
|
|
157
157
|
select,
|
|
158
158
|
tabs,
|
|
159
159
|
tooltip
|
|
160
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-N6IZB6KJ.js";
|
|
161
161
|
import {
|
|
162
162
|
collectStream,
|
|
163
163
|
deserializeState,
|
|
@@ -174,7 +174,7 @@ import {
|
|
|
174
174
|
serializeState,
|
|
175
175
|
ssrSuspense,
|
|
176
176
|
suspenseSwapScript
|
|
177
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-7TQKR4PP.js";
|
|
178
178
|
import {
|
|
179
179
|
battery,
|
|
180
180
|
clipboard,
|
|
@@ -189,7 +189,7 @@ import {
|
|
|
189
189
|
resize,
|
|
190
190
|
scroll,
|
|
191
191
|
title
|
|
192
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-ONCYDOK6.js";
|
|
193
193
|
import {
|
|
194
194
|
calculateDelay,
|
|
195
195
|
clearQueryCache,
|
|
@@ -211,7 +211,7 @@ import {
|
|
|
211
211
|
syncAdapter,
|
|
212
212
|
throttle,
|
|
213
213
|
withRetry
|
|
214
|
-
} from "./chunk-
|
|
214
|
+
} from "./chunk-OHQQWZ7P.js";
|
|
215
215
|
import {
|
|
216
216
|
SibuError,
|
|
217
217
|
checkLeaks,
|
|
@@ -247,7 +247,7 @@ import {
|
|
|
247
247
|
trackCleanup,
|
|
248
248
|
walkDependencyGraph,
|
|
249
249
|
withErrorTracking
|
|
250
|
-
} from "./chunk-
|
|
250
|
+
} from "./chunk-NMRUZALC.js";
|
|
251
251
|
import {
|
|
252
252
|
antdAdapter,
|
|
253
253
|
chakraAdapter,
|
|
@@ -257,7 +257,7 @@ import {
|
|
|
257
257
|
mobXAdapter,
|
|
258
258
|
reduxAdapter,
|
|
259
259
|
zustandAdapter
|
|
260
|
-
} from "./chunk-
|
|
260
|
+
} from "./chunk-HS6OOE3Q.js";
|
|
261
261
|
import {
|
|
262
262
|
createPlugin,
|
|
263
263
|
inject,
|
|
@@ -267,13 +267,13 @@ import {
|
|
|
267
267
|
triggerPluginMount,
|
|
268
268
|
triggerPluginUnmount
|
|
269
269
|
} from "./chunk-K5ZUMYVS.js";
|
|
270
|
-
import "./chunk-
|
|
271
|
-
import "./chunk-
|
|
272
|
-
import "./chunk-
|
|
273
|
-
import "./chunk-
|
|
274
|
-
import "./chunk-
|
|
275
|
-
import "./chunk-
|
|
276
|
-
import "./chunk-
|
|
270
|
+
import "./chunk-OWLQ4HZI.js";
|
|
271
|
+
import "./chunk-CZUGLNJS.js";
|
|
272
|
+
import "./chunk-Z65KYU7I.js";
|
|
273
|
+
import "./chunk-QVKGGB2S.js";
|
|
274
|
+
import "./chunk-SDLZDHKP.js";
|
|
275
|
+
import "./chunk-FGOEVHY3.js";
|
|
276
|
+
import "./chunk-PZEGYCF5.js";
|
|
277
277
|
import "./chunk-CHJ27IGK.js";
|
|
278
278
|
import {
|
|
279
279
|
TransitionGroup,
|
|
@@ -296,8 +296,9 @@ import {
|
|
|
296
296
|
stagger,
|
|
297
297
|
transition,
|
|
298
298
|
viewTransition
|
|
299
|
-
} from "./chunk-
|
|
300
|
-
import "./chunk-
|
|
299
|
+
} from "./chunk-6HLLIF3K.js";
|
|
300
|
+
import "./chunk-YECR7UIA.js";
|
|
301
|
+
import "./chunk-4MYMUBRS.js";
|
|
301
302
|
import "./chunk-MLKGABMK.js";
|
|
302
303
|
export {
|
|
303
304
|
DOMPool,
|
package/dist/index.cjs
CHANGED
|
@@ -241,6 +241,13 @@ function sanitizeUrl(url) {
|
|
|
241
241
|
}
|
|
242
242
|
return trimmed;
|
|
243
243
|
}
|
|
244
|
+
function sanitizeCSSValue(value) {
|
|
245
|
+
const lower = value.toLowerCase().replace(/\s+/g, "");
|
|
246
|
+
if (lower.includes("url(") || lower.includes("expression(") || lower.includes("javascript:") || lower.includes("-moz-binding")) {
|
|
247
|
+
return "";
|
|
248
|
+
}
|
|
249
|
+
return value;
|
|
250
|
+
}
|
|
244
251
|
var URL_ATTRIBUTES = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "cite", "poster", "background", "srcset"]);
|
|
245
252
|
function isUrlAttribute(attr) {
|
|
246
253
|
return URL_ATTRIBUTES.has(attr);
|
|
@@ -698,11 +705,11 @@ function applyStyle(el, style2) {
|
|
|
698
705
|
if (typeof val === "function") {
|
|
699
706
|
const getter = val;
|
|
700
707
|
const teardown = track(() => {
|
|
701
|
-
htmlEl.style.setProperty(name, String(getter()));
|
|
708
|
+
htmlEl.style.setProperty(name, sanitizeCSSValue(String(getter())));
|
|
702
709
|
});
|
|
703
710
|
registerDisposer(el, teardown);
|
|
704
711
|
} else {
|
|
705
|
-
htmlEl.style.setProperty(name, String(val));
|
|
712
|
+
htmlEl.style.setProperty(name, sanitizeCSSValue(String(val)));
|
|
706
713
|
}
|
|
707
714
|
}
|
|
708
715
|
}
|
|
@@ -2532,6 +2539,7 @@ function Suspense({ nodes, fallback }) {
|
|
|
2532
2539
|
}
|
|
2533
2540
|
|
|
2534
2541
|
// src/components/ErrorBoundary.ts
|
|
2542
|
+
var _isDev8 = isDev();
|
|
2535
2543
|
var errorBoundaryStyles = `
|
|
2536
2544
|
.sibu-error-boundary {
|
|
2537
2545
|
position: relative;
|
|
@@ -2637,7 +2645,7 @@ function ErrorBoundary({ nodes, fallback, onError }) {
|
|
|
2637
2645
|
class: "sibu-error-title"
|
|
2638
2646
|
}),
|
|
2639
2647
|
p({
|
|
2640
|
-
nodes: err.message,
|
|
2648
|
+
nodes: _isDev8 ? err.message : "An unexpected error occurred. Please try again.",
|
|
2641
2649
|
class: "sibu-error-message"
|
|
2642
2650
|
}),
|
|
2643
2651
|
button({
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
unregisterComponent,
|
|
36
36
|
when,
|
|
37
37
|
writable
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-24WSRM54.js";
|
|
39
39
|
import {
|
|
40
40
|
a,
|
|
41
41
|
abbr,
|
|
@@ -173,30 +173,30 @@ import {
|
|
|
173
173
|
use,
|
|
174
174
|
var_,
|
|
175
175
|
video
|
|
176
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-OWLQ4HZI.js";
|
|
177
177
|
import {
|
|
178
178
|
watch
|
|
179
|
-
} from "./chunk-
|
|
179
|
+
} from "./chunk-CZUGLNJS.js";
|
|
180
180
|
import {
|
|
181
181
|
context
|
|
182
|
-
} from "./chunk-
|
|
182
|
+
} from "./chunk-Z65KYU7I.js";
|
|
183
183
|
import {
|
|
184
184
|
SVG_NS,
|
|
185
185
|
checkLeaks,
|
|
186
186
|
dispose,
|
|
187
187
|
registerDisposer,
|
|
188
188
|
tagFactory
|
|
189
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-QVKGGB2S.js";
|
|
190
190
|
import {
|
|
191
191
|
bindDynamic
|
|
192
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-SDLZDHKP.js";
|
|
193
193
|
import {
|
|
194
194
|
derived
|
|
195
|
-
} from "./chunk-
|
|
195
|
+
} from "./chunk-FGOEVHY3.js";
|
|
196
196
|
import {
|
|
197
197
|
effect,
|
|
198
198
|
on
|
|
199
|
-
} from "./chunk-
|
|
199
|
+
} from "./chunk-PZEGYCF5.js";
|
|
200
200
|
import {
|
|
201
201
|
disableSSR,
|
|
202
202
|
enableSSR,
|
|
@@ -209,7 +209,8 @@ import {
|
|
|
209
209
|
isBatching,
|
|
210
210
|
signal,
|
|
211
211
|
untracked
|
|
212
|
-
} from "./chunk-
|
|
212
|
+
} from "./chunk-YECR7UIA.js";
|
|
213
|
+
import "./chunk-4MYMUBRS.js";
|
|
213
214
|
import "./chunk-MLKGABMK.js";
|
|
214
215
|
export {
|
|
215
216
|
DynamicComponent,
|
package/dist/motion.js
CHANGED
|
@@ -19,8 +19,9 @@ import {
|
|
|
19
19
|
stagger,
|
|
20
20
|
transition,
|
|
21
21
|
viewTransition
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-6HLLIF3K.js";
|
|
23
|
+
import "./chunk-YECR7UIA.js";
|
|
24
|
+
import "./chunk-4MYMUBRS.js";
|
|
24
25
|
import "./chunk-MLKGABMK.js";
|
|
25
26
|
export {
|
|
26
27
|
TransitionGroup,
|