sibujs 4.11.0 → 4.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/browser.cjs +1 -1
- package/dist/browser.js +4 -4
- package/dist/build.cjs +19 -1
- package/dist/build.js +13 -12
- package/dist/cdn.dev.global.js +12 -12
- package/dist/cdn.full.dev.global.js +13 -13
- package/dist/cdn.full.global.js +12 -12
- package/dist/cdn.global.js +12 -12
- package/dist/{chunk-FC6KCJSA.js → chunk-2F4PSJ5Z.js} +162 -67
- package/dist/{chunk-R244COCR.js → chunk-653KGQS2.js} +3 -3
- package/dist/chunk-AM6DZLBM.js +181 -0
- package/dist/{chunk-ADWDDJ5M.js → chunk-B2Y5BJSP.js} +1 -1
- package/dist/{chunk-KREPZR2U.js → chunk-CI4W6XAU.js} +4 -4
- package/dist/{chunk-NBBFF5VA.js → chunk-DFZL3AX7.js} +6 -6
- package/dist/{chunk-OJV2RW4D.js → chunk-EMB5PG7V.js} +1 -1
- package/dist/{chunk-3ACAAQIN.js → chunk-F2UWOZ6J.js} +4 -0
- package/dist/{chunk-REOAVT2M.js → chunk-HXT2RNH5.js} +1 -1
- package/dist/{chunk-F6B5CKF7.js → chunk-IHA62NGJ.js} +1 -1
- package/dist/{chunk-VZDMHDVA.js → chunk-LEUEKK4G.js} +2 -2
- package/dist/{chunk-WQ7M57JJ.js → chunk-LXBMVGVB.js} +3 -3
- package/dist/{chunk-RRKGQKPU.js → chunk-LYTUTXQP.js} +4 -4
- package/dist/{chunk-5IODQRR3.js → chunk-NAVLCP4S.js} +4 -4
- package/dist/{chunk-YXJHLMRH.js → chunk-NB7TFSJE.js} +5 -5
- package/dist/{chunk-5G53CC6L.js → chunk-QLG5IK7F.js} +4 -4
- package/dist/{chunk-KFJUMC3Q.js → chunk-RK7EPQPG.js} +1 -1
- package/dist/{chunk-LQ2C44YH.js → chunk-T5O2CUHV.js} +1 -1
- package/dist/{chunk-CHQPJY47.js → chunk-WFRQ6D7H.js} +1 -1
- package/dist/{chunk-3Z7AEJMQ.js → chunk-WH4U2VUE.js} +5 -3
- package/dist/{chunk-HMOPAC2Z.js → chunk-XX4BRMWF.js} +15 -3
- package/dist/{chunk-7V7VFT7E.js → chunk-ZJCHY2IB.js} +1 -1
- package/dist/{chunk-MCPL5WKQ.js → chunk-ZPY2UAKM.js} +3 -3
- package/dist/{chunk-DEUONJYR.js → chunk-ZTYCCBU3.js} +19 -11
- package/dist/data.cjs +1 -1
- package/dist/data.js +5 -5
- package/dist/devtools.cjs +1 -1
- package/dist/devtools.js +4 -4
- package/dist/ecosystem.cjs +9 -1
- package/dist/ecosystem.d.cts +1 -1
- package/dist/ecosystem.d.ts +1 -1
- package/dist/ecosystem.js +8 -8
- package/dist/extras.cjs +368 -154
- package/dist/extras.d.cts +2 -2
- package/dist/extras.d.ts +2 -2
- package/dist/extras.js +23 -22
- package/dist/index.cjs +19 -1
- package/dist/index.d.cts +91 -90
- package/dist/index.d.ts +91 -90
- package/dist/index.js +13 -12
- package/dist/motion.cjs +1 -1
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +1 -1
- package/dist/patterns.js +5 -5
- package/dist/performance.cjs +1 -1
- package/dist/performance.d.cts +2 -2
- package/dist/performance.d.ts +2 -2
- package/dist/performance.js +7 -6
- package/dist/plugins.cjs +344 -109
- package/dist/plugins.d.cts +1 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +15 -12
- package/dist/{ssr-C8hgIAw7.d.cts → ssr-Db0Sgdu3.d.cts} +7 -4
- package/dist/{ssr-C8hgIAw7.d.ts → ssr-Db0Sgdu3.d.ts} +7 -4
- package/dist/{ssr-5OWAH3U2.js → ssr-VBM6J5SJ.js} +4 -2
- package/dist/ssr.cjs +346 -128
- package/dist/ssr.d.cts +1 -1
- package/dist/ssr.d.ts +1 -1
- package/dist/ssr.js +10 -9
- package/dist/{tagFactory-BL2fymez.d.ts → tagFactory-Bnd_Nph9.d.ts} +1 -1
- package/dist/{tagFactory-8qL9LCIx.d.cts → tagFactory-DkytnJws.d.cts} +1 -1
- package/dist/testing.cjs +1 -1
- package/dist/testing.js +2 -2
- package/dist/ui.cjs +251 -24
- package/dist/ui.d.cts +111 -1
- package/dist/ui.d.ts +111 -1
- package/dist/ui.js +130 -8
- package/dist/widgets.cjs +1 -1
- package/dist/widgets.js +6 -6
- package/package.json +1 -1
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
embedSerializationTail,
|
|
3
|
+
embedSerializedAttribute,
|
|
4
|
+
getEmbedRecord
|
|
5
|
+
} from "./chunk-AM6DZLBM.js";
|
|
1
6
|
import {
|
|
2
7
|
readOwnGlobal
|
|
3
8
|
} from "./chunk-62BDYGAG.js";
|
|
@@ -5,8 +10,9 @@ import {
|
|
|
5
10
|
isCodeTextElement,
|
|
6
11
|
isForbiddenMetaEntry,
|
|
7
12
|
isForbiddenMetaSnapshot,
|
|
13
|
+
isRefusedAnimationAttribute,
|
|
8
14
|
resolveMetaRefreshPolicy
|
|
9
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-F2UWOZ6J.js";
|
|
10
16
|
import {
|
|
11
17
|
canonicalAttrName,
|
|
12
18
|
isEventHandlerAttr,
|
|
@@ -160,69 +166,180 @@ function childNodesOf(node) {
|
|
|
160
166
|
function getAttributeOf(el, name) {
|
|
161
167
|
return nativeAccessors().getAttribute.call(el, name);
|
|
162
168
|
}
|
|
163
|
-
|
|
169
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
170
|
+
var MATHML_NS = "http://www.w3.org/1998/Math/MathML";
|
|
171
|
+
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
172
|
+
var XML_NS = "http://www.w3.org/XML/1998/namespace";
|
|
173
|
+
var XMLNS_NS = "http://www.w3.org/2000/xmlns/";
|
|
174
|
+
var BREAKOUT_TAGS = /* @__PURE__ */ new Set([
|
|
175
|
+
"b",
|
|
176
|
+
"big",
|
|
177
|
+
"blockquote",
|
|
178
|
+
"body",
|
|
179
|
+
"br",
|
|
180
|
+
"center",
|
|
181
|
+
"code",
|
|
182
|
+
"dd",
|
|
183
|
+
"div",
|
|
184
|
+
"dl",
|
|
185
|
+
"dt",
|
|
186
|
+
"em",
|
|
187
|
+
"embed",
|
|
188
|
+
"h1",
|
|
189
|
+
"h2",
|
|
190
|
+
"h3",
|
|
191
|
+
"h4",
|
|
192
|
+
"h5",
|
|
193
|
+
"h6",
|
|
194
|
+
"head",
|
|
195
|
+
"hr",
|
|
196
|
+
"i",
|
|
197
|
+
"img",
|
|
198
|
+
"li",
|
|
199
|
+
"listing",
|
|
200
|
+
"menu",
|
|
201
|
+
"meta",
|
|
202
|
+
"nobr",
|
|
203
|
+
"ol",
|
|
204
|
+
"p",
|
|
205
|
+
"pre",
|
|
206
|
+
"ruby",
|
|
207
|
+
"s",
|
|
208
|
+
"small",
|
|
209
|
+
"span",
|
|
210
|
+
"strong",
|
|
211
|
+
"strike",
|
|
212
|
+
"sub",
|
|
213
|
+
"sup",
|
|
214
|
+
"table",
|
|
215
|
+
"tt",
|
|
216
|
+
"u",
|
|
217
|
+
"ul",
|
|
218
|
+
"var"
|
|
219
|
+
]);
|
|
220
|
+
function isBreakout(lowerName, element) {
|
|
221
|
+
if (BREAKOUT_TAGS.has(lowerName)) return true;
|
|
222
|
+
return lowerName === "font" && (element.hasAttribute("color") || element.hasAttribute("face") || element.hasAttribute("size"));
|
|
223
|
+
}
|
|
224
|
+
function fitsParseContext(ns, lowerName, element, context) {
|
|
225
|
+
if (ns === SVG_NS) {
|
|
226
|
+
if (context === 1 /* Svg */) return !isBreakout(lowerName, element);
|
|
227
|
+
return lowerName === "svg" && (context === 0 /* Html */ || context === 3 /* Annotation */);
|
|
228
|
+
}
|
|
229
|
+
if (ns === MATHML_NS) {
|
|
230
|
+
if (context === 2 /* Math */ || context === 3 /* Annotation */) return !isBreakout(lowerName, element);
|
|
231
|
+
return lowerName === "math" && context === 0 /* Html */;
|
|
232
|
+
}
|
|
233
|
+
return context === 0 /* Html */;
|
|
234
|
+
}
|
|
235
|
+
function childParseContext(ns, lowerName, element) {
|
|
236
|
+
if (ns === SVG_NS) {
|
|
237
|
+
return lowerName === "foreignobject" || lowerName === "desc" || lowerName === "title" ? 0 /* Html */ : 1 /* Svg */;
|
|
238
|
+
}
|
|
239
|
+
if (ns === MATHML_NS) {
|
|
240
|
+
if (lowerName === "mi" || lowerName === "mo" || lowerName === "mn" || lowerName === "ms" || lowerName === "mtext") {
|
|
241
|
+
return 0 /* Html */;
|
|
242
|
+
}
|
|
243
|
+
if (lowerName === "annotation-xml") {
|
|
244
|
+
const encoding = (element.getAttribute("encoding") ?? "").toLowerCase();
|
|
245
|
+
return encoding === "text/html" || encoding === "application/xhtml+xml" ? 0 /* Html */ : 3 /* Annotation */;
|
|
246
|
+
}
|
|
247
|
+
return 2 /* Math */;
|
|
248
|
+
}
|
|
249
|
+
return 0 /* Html */;
|
|
250
|
+
}
|
|
251
|
+
function foreignAttrName(attr) {
|
|
252
|
+
const ns = attr.namespaceURI;
|
|
253
|
+
if (ns === XLINK_NS) return `xlink:${attr.localName}`;
|
|
254
|
+
if (ns === XML_NS) return `xml:${attr.localName}`;
|
|
255
|
+
if (ns === XMLNS_NS) return attr.localName === "xmlns" ? "xmlns" : `xmlns:${attr.localName}`;
|
|
256
|
+
return attr.name;
|
|
257
|
+
}
|
|
258
|
+
function serializeOpenTag(element, tag, foreign) {
|
|
164
259
|
let html = `<${tag}`;
|
|
165
|
-
const meta = tag === "meta" ? /* @__PURE__ */ new Map() : null;
|
|
260
|
+
const meta = tag === "meta" && !foreign ? /* @__PURE__ */ new Map() : null;
|
|
261
|
+
const embed = tag === "iframe" && !foreign ? getEmbedRecord(element) : void 0;
|
|
262
|
+
const embedSeen = embed ? { sandbox: false, referrer: false, title: false, fullscreen: false } : null;
|
|
166
263
|
const attrs = attributesOf(element);
|
|
167
264
|
for (let i = 0; i < attrs.length; i++) {
|
|
168
265
|
const attr = attrs[i];
|
|
169
|
-
const rawName = attr.name;
|
|
266
|
+
const rawName = foreign ? foreignAttrName(attr) : attr.name;
|
|
170
267
|
if (!isSafeAttrName(rawName)) continue;
|
|
171
268
|
if (isEventHandlerAttr(rawName)) continue;
|
|
172
269
|
if (isForbiddenSsrAttr(rawName)) continue;
|
|
173
|
-
const
|
|
270
|
+
const lowerName = rawName.toLowerCase();
|
|
271
|
+
let value = resolveAttributeValue(lowerName, attr.value);
|
|
174
272
|
if (value === null) continue;
|
|
273
|
+
if (foreign && isRefusedAnimationAttribute(element, rawName, value)) continue;
|
|
274
|
+
if (embed && embedSeen) {
|
|
275
|
+
value = embedSerializedAttribute(embed, embedSeen, lowerName, value);
|
|
276
|
+
if (value === null) continue;
|
|
277
|
+
}
|
|
175
278
|
meta?.set(rawName, value);
|
|
176
279
|
html += ` ${rawName}="${escapeAttr(value)}"`;
|
|
177
280
|
}
|
|
178
281
|
if (meta && isForbiddenMetaSnapshot(meta)) return null;
|
|
282
|
+
if (embed && embedSeen) {
|
|
283
|
+
const tail = embedSerializationTail(embed, embedSeen);
|
|
284
|
+
if (tail === null) return null;
|
|
285
|
+
html += tail;
|
|
286
|
+
}
|
|
179
287
|
if (!getAttributeOf(element, "data-sibu-hydrate")) {
|
|
180
288
|
html += ` data-sibu-ssr="true"`;
|
|
181
289
|
}
|
|
182
290
|
return html;
|
|
183
291
|
}
|
|
292
|
+
function serializeNode(node, context) {
|
|
293
|
+
if (node.nodeType === 3) return escapeHtml(node.textContent || "");
|
|
294
|
+
if (node.nodeType === 8) return `<!--${safeCommentText(node.textContent || "")}-->`;
|
|
295
|
+
let foreign = false;
|
|
296
|
+
if (!(node instanceof HTMLElement)) {
|
|
297
|
+
const ns2 = node.nodeType === 1 ? node.namespaceURI : null;
|
|
298
|
+
if (ns2 !== SVG_NS && ns2 !== MATHML_NS) return escapeHtml(node.textContent || "");
|
|
299
|
+
foreign = true;
|
|
300
|
+
}
|
|
301
|
+
const element = node;
|
|
302
|
+
const tag = foreign ? element.localName : tagNameOf(element).toLowerCase();
|
|
303
|
+
if (isCodeTextElement(tag)) return DEV ? `<!--ssr:${tag}-stripped-->` : "";
|
|
304
|
+
if (!/^[a-z][a-z0-9-]*$/i.test(tag)) return DEV ? "<!--ssr:invalid-tag-->" : "";
|
|
305
|
+
const ns = foreign ? element.namespaceURI : null;
|
|
306
|
+
const lowerName = tag.toLowerCase();
|
|
307
|
+
if (!fitsParseContext(ns, lowerName, element, context)) return DEV ? `<!--ssr:${tag}-misplaced-->` : "";
|
|
308
|
+
const openTag = serializeOpenTag(element, tag, foreign);
|
|
309
|
+
if (openTag === null) return DEV ? `<!--ssr:${tag}-stripped-->` : "";
|
|
310
|
+
const children = childNodesOf(element);
|
|
311
|
+
if (foreign ? children.length === 0 : VOID_ELEMENTS.has(tag)) return `${openTag} />`;
|
|
312
|
+
return {
|
|
313
|
+
open: `${openTag}>`,
|
|
314
|
+
close: `</${tag}>`,
|
|
315
|
+
children: Array.from(children),
|
|
316
|
+
context: childParseContext(ns, lowerName, element)
|
|
317
|
+
};
|
|
318
|
+
}
|
|
184
319
|
function renderToString(element) {
|
|
320
|
+
return renderNodeToString(element, 0 /* Html */);
|
|
321
|
+
}
|
|
322
|
+
function renderNodeToString(element, context) {
|
|
185
323
|
if (element instanceof DocumentFragment) {
|
|
186
324
|
return Array.from(element.childNodes).map((child) => {
|
|
187
325
|
try {
|
|
188
|
-
return
|
|
326
|
+
return renderNodeToString(child, context);
|
|
189
327
|
} catch (err) {
|
|
190
328
|
return ssrErrorComment(err);
|
|
191
329
|
}
|
|
192
330
|
}).join("");
|
|
193
331
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return `<!--${safeCommentText(element.textContent || "")}-->`;
|
|
199
|
-
}
|
|
200
|
-
if (!(element instanceof HTMLElement)) {
|
|
201
|
-
return escapeHtml(element.textContent || "");
|
|
202
|
-
}
|
|
203
|
-
const tag = tagNameOf(element).toLowerCase();
|
|
204
|
-
if (isCodeTextElement(tag)) {
|
|
205
|
-
return DEV ? `<!--ssr:${tag}-stripped-->` : "";
|
|
206
|
-
}
|
|
207
|
-
if (!/^[a-z][a-z0-9-]*$/i.test(tag)) {
|
|
208
|
-
return DEV ? "<!--ssr:invalid-tag-->" : "";
|
|
209
|
-
}
|
|
210
|
-
const openTag = serializeOpenTag(element, tag);
|
|
211
|
-
if (openTag === null) return DEV ? `<!--ssr:${tag}-stripped-->` : "";
|
|
212
|
-
let html = openTag;
|
|
213
|
-
if (VOID_ELEMENTS.has(tag)) {
|
|
214
|
-
return `${html} />`;
|
|
215
|
-
}
|
|
216
|
-
html += ">";
|
|
217
|
-
for (const child of Array.from(childNodesOf(element))) {
|
|
332
|
+
const frame = serializeNode(element, context);
|
|
333
|
+
if (typeof frame === "string") return frame;
|
|
334
|
+
let html = frame.open;
|
|
335
|
+
for (const child of frame.children) {
|
|
218
336
|
try {
|
|
219
|
-
html +=
|
|
337
|
+
html += renderNodeToString(child, frame.context);
|
|
220
338
|
} catch (err) {
|
|
221
339
|
html += ssrErrorComment(err);
|
|
222
340
|
}
|
|
223
341
|
}
|
|
224
|
-
html
|
|
225
|
-
return html;
|
|
342
|
+
return html + frame.close;
|
|
226
343
|
}
|
|
227
344
|
function hydrate(component, container, options = {}) {
|
|
228
345
|
const clientTree = component();
|
|
@@ -405,56 +522,34 @@ function renderToDocument(component, options = {}) {
|
|
|
405
522
|
</body>
|
|
406
523
|
</html>`;
|
|
407
524
|
}
|
|
408
|
-
|
|
525
|
+
function renderToStream(element) {
|
|
526
|
+
return streamNode(element, 0 /* Html */);
|
|
527
|
+
}
|
|
528
|
+
async function* streamNode(element, context) {
|
|
409
529
|
if (element instanceof DocumentFragment) {
|
|
410
530
|
for (const child of Array.from(element.childNodes)) {
|
|
411
531
|
try {
|
|
412
|
-
yield*
|
|
532
|
+
yield* streamNode(child, context);
|
|
413
533
|
} catch (err) {
|
|
414
534
|
yield ssrErrorComment(err);
|
|
415
535
|
}
|
|
416
536
|
}
|
|
417
537
|
return;
|
|
418
538
|
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
}
|
|
423
|
-
if (element.nodeType === 8) {
|
|
424
|
-
yield `<!--${safeCommentText(element.textContent || "")}-->`;
|
|
425
|
-
return;
|
|
426
|
-
}
|
|
427
|
-
if (!(element instanceof HTMLElement)) {
|
|
428
|
-
yield escapeHtml(element.textContent || "");
|
|
429
|
-
return;
|
|
430
|
-
}
|
|
431
|
-
const tag = tagNameOf(element).toLowerCase();
|
|
432
|
-
if (isCodeTextElement(tag)) {
|
|
433
|
-
if (DEV) yield `<!--ssr:${tag}-stripped-->`;
|
|
434
|
-
return;
|
|
435
|
-
}
|
|
436
|
-
if (!/^[a-z][a-z0-9-]*$/i.test(tag)) {
|
|
437
|
-
if (DEV) yield "<!--ssr:invalid-tag-->";
|
|
438
|
-
return;
|
|
439
|
-
}
|
|
440
|
-
const openTag = serializeOpenTag(element, tag);
|
|
441
|
-
if (openTag === null) {
|
|
442
|
-
if (DEV) yield `<!--ssr:${tag}-stripped-->`;
|
|
443
|
-
return;
|
|
444
|
-
}
|
|
445
|
-
if (VOID_ELEMENTS.has(tag)) {
|
|
446
|
-
yield `${openTag} />`;
|
|
539
|
+
const frame = serializeNode(element, context);
|
|
540
|
+
if (typeof frame === "string") {
|
|
541
|
+
if (frame) yield frame;
|
|
447
542
|
return;
|
|
448
543
|
}
|
|
449
|
-
yield
|
|
450
|
-
for (const child of
|
|
544
|
+
yield frame.open;
|
|
545
|
+
for (const child of frame.children) {
|
|
451
546
|
try {
|
|
452
|
-
yield*
|
|
547
|
+
yield* streamNode(child, frame.context);
|
|
453
548
|
} catch (err) {
|
|
454
549
|
yield ssrErrorComment(err);
|
|
455
550
|
}
|
|
456
551
|
}
|
|
457
|
-
yield
|
|
552
|
+
yield frame.close;
|
|
458
553
|
}
|
|
459
554
|
async function collectStream(stream) {
|
|
460
555
|
let result = "";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderToString
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2F4PSJ5Z.js";
|
|
4
4
|
import {
|
|
5
5
|
globalSingleton
|
|
6
6
|
} from "./chunk-7ZHH77QA.js";
|
|
@@ -170,7 +170,7 @@ var CDN_ENTRY_POINTS = {
|
|
|
170
170
|
};
|
|
171
171
|
var packageInfo = {
|
|
172
172
|
name: "sibujs",
|
|
173
|
-
version: true ? "4.
|
|
173
|
+
version: true ? "4.12.0" : "dev",
|
|
174
174
|
entryPoints: MODULE_ENTRY_POINTS,
|
|
175
175
|
/**
|
|
176
176
|
* Generate the package.json `exports` map. Module entries resolve to the
|
|
@@ -315,7 +315,7 @@ var env = {
|
|
|
315
315
|
};
|
|
316
316
|
|
|
317
317
|
// src/plugins/versioning.ts
|
|
318
|
-
var VERSION = true ? "4.
|
|
318
|
+
var VERSION = true ? "4.12.0" : "dev";
|
|
319
319
|
var NUM = "(?:0|[1-9]\\d*)";
|
|
320
320
|
var PRE_ID = `(?:${NUM}|\\d*[a-zA-Z-][0-9a-zA-Z-]*)`;
|
|
321
321
|
var BUILD_ID = "[0-9a-zA-Z-]+";
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import {
|
|
2
|
+
globalSingleton
|
|
3
|
+
} from "./chunk-7ZHH77QA.js";
|
|
4
|
+
import {
|
|
5
|
+
sanitizeUrl
|
|
6
|
+
} from "./chunk-EXXSN3BW.js";
|
|
7
|
+
import {
|
|
8
|
+
getRequestStore
|
|
9
|
+
} from "./chunk-7XHATCIH.js";
|
|
10
|
+
|
|
11
|
+
// src/utils/embedPolicy.ts
|
|
12
|
+
var state = globalSingleton(/* @__PURE__ */ Symbol.for("sibujs.embed.v2"), () => ({
|
|
13
|
+
allowed: [],
|
|
14
|
+
frames: /* @__PURE__ */ new WeakMap()
|
|
15
|
+
}));
|
|
16
|
+
var REQUEST_CACHE = "embed";
|
|
17
|
+
function currentEmbedAllowlist() {
|
|
18
|
+
const scoped = getRequestStore()?.caches?.get(REQUEST_CACHE)?.get("allowed");
|
|
19
|
+
return scoped ?? state.allowed;
|
|
20
|
+
}
|
|
21
|
+
function setEmbedPolicy(policy) {
|
|
22
|
+
const allowed = [];
|
|
23
|
+
for (const entry of policy.allowedOrigins) {
|
|
24
|
+
let url = null;
|
|
25
|
+
try {
|
|
26
|
+
url = new URL(entry);
|
|
27
|
+
} catch {
|
|
28
|
+
url = null;
|
|
29
|
+
}
|
|
30
|
+
if (!url || url.protocol !== "https:" || url.username || url.password || url.search || url.hash) {
|
|
31
|
+
throw new TypeError(
|
|
32
|
+
`setEmbedPolicy: "${entry}" is not an allowed embed origin. Use an absolute https: URL, optionally with a path prefix, and no credentials, query or fragment.`
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
allowed.push({ origin: url.origin, path: url.pathname === "/" ? "" : url.pathname });
|
|
36
|
+
}
|
|
37
|
+
const store = getRequestStore();
|
|
38
|
+
if (store) {
|
|
39
|
+
const caches = store.caches ?? (store.caches = /* @__PURE__ */ new Map());
|
|
40
|
+
let scoped = caches.get(REQUEST_CACHE);
|
|
41
|
+
if (!scoped) {
|
|
42
|
+
scoped = /* @__PURE__ */ new Map();
|
|
43
|
+
caches.set(REQUEST_CACHE, scoped);
|
|
44
|
+
}
|
|
45
|
+
scoped.set("allowed", allowed);
|
|
46
|
+
} else {
|
|
47
|
+
state.allowed = allowed;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function resolveEmbedSrc(value, allowed = currentEmbedAllowlist()) {
|
|
51
|
+
if (typeof value !== "string" || sanitizeUrl(value) === "") return null;
|
|
52
|
+
let url;
|
|
53
|
+
try {
|
|
54
|
+
url = new URL(value);
|
|
55
|
+
} catch {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
if (url.protocol !== "https:" || url.username || url.password) return null;
|
|
59
|
+
if (typeof location !== "undefined" && url.origin === location.origin) return null;
|
|
60
|
+
for (const entry of allowed) {
|
|
61
|
+
if (url.origin !== entry.origin) continue;
|
|
62
|
+
const path = entry.path;
|
|
63
|
+
if (path === "" || url.pathname === path || url.pathname.startsWith(path.endsWith("/") ? path : `${path}/`)) {
|
|
64
|
+
return url.href;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
var DEFAULT_EMBED_SANDBOX = [
|
|
70
|
+
"allow-scripts",
|
|
71
|
+
"allow-same-origin",
|
|
72
|
+
"allow-presentation",
|
|
73
|
+
"allow-popups",
|
|
74
|
+
"allow-popups-to-escape-sandbox"
|
|
75
|
+
];
|
|
76
|
+
var EMBED_FEATURES = /* @__PURE__ */ new Set([
|
|
77
|
+
"accelerometer",
|
|
78
|
+
"autoplay",
|
|
79
|
+
"clipboard-write",
|
|
80
|
+
"encrypted-media",
|
|
81
|
+
"fullscreen",
|
|
82
|
+
"gyroscope",
|
|
83
|
+
"picture-in-picture",
|
|
84
|
+
"web-share"
|
|
85
|
+
]);
|
|
86
|
+
var EMBED_REFERRER_POLICIES = /* @__PURE__ */ new Set([
|
|
87
|
+
"no-referrer",
|
|
88
|
+
"same-origin",
|
|
89
|
+
"strict-origin",
|
|
90
|
+
"strict-origin-when-cross-origin"
|
|
91
|
+
]);
|
|
92
|
+
var DEFAULT_EMBED_REFERRER_POLICY = "strict-origin-when-cross-origin";
|
|
93
|
+
function narrowEmbedSandbox(value) {
|
|
94
|
+
const out = [];
|
|
95
|
+
for (const token of value.toLowerCase().split(/[\t\n\f\r ]+/)) {
|
|
96
|
+
if (token && DEFAULT_EMBED_SANDBOX.includes(token) && !out.includes(token)) out.push(token);
|
|
97
|
+
}
|
|
98
|
+
return out.join(" ");
|
|
99
|
+
}
|
|
100
|
+
function narrowEmbedAllow(value) {
|
|
101
|
+
const granted = [];
|
|
102
|
+
const denied = [];
|
|
103
|
+
for (const directive of value.split(";")) {
|
|
104
|
+
const tokens = directive.trim().split(/[\t\n\f\r ]+/);
|
|
105
|
+
const feature = tokens[0];
|
|
106
|
+
if (!feature) continue;
|
|
107
|
+
const list = tokens.slice(1).map((token) => token.toLowerCase());
|
|
108
|
+
const grantsSrc = (list.length === 0 || list.includes("'src'") || list.includes("*")) && !list.includes("'none'");
|
|
109
|
+
if (!grantsSrc) denied.push(feature);
|
|
110
|
+
else if (EMBED_FEATURES.has(feature) && !granted.includes(feature)) granted.push(feature);
|
|
111
|
+
}
|
|
112
|
+
return granted.filter((feature) => !denied.includes(feature)).join("; ");
|
|
113
|
+
}
|
|
114
|
+
function narrowEmbedReferrerPolicy(value) {
|
|
115
|
+
const lower = value.trim().toLowerCase();
|
|
116
|
+
return EMBED_REFERRER_POLICIES.has(lower) ? lower : DEFAULT_EMBED_REFERRER_POLICY;
|
|
117
|
+
}
|
|
118
|
+
function recordEmbedFrame(frame, record) {
|
|
119
|
+
state.frames.set(frame, record);
|
|
120
|
+
}
|
|
121
|
+
function getEmbedRecord(frame) {
|
|
122
|
+
return state.frames.get(frame);
|
|
123
|
+
}
|
|
124
|
+
function intersect(current, permitted, separator) {
|
|
125
|
+
const allowed = permitted.split(separator);
|
|
126
|
+
return current.split(separator).filter((token) => token && allowed.includes(token)).join(separator);
|
|
127
|
+
}
|
|
128
|
+
function embedSerializedAttribute(record, seen, name, value) {
|
|
129
|
+
switch (name) {
|
|
130
|
+
case "src":
|
|
131
|
+
return resolveEmbedSrc(value, record.allowed);
|
|
132
|
+
case "title":
|
|
133
|
+
if (!value.trim()) return null;
|
|
134
|
+
seen.title = true;
|
|
135
|
+
return value;
|
|
136
|
+
case "sandbox":
|
|
137
|
+
seen.sandbox = true;
|
|
138
|
+
return intersect(narrowEmbedSandbox(value), record.sandbox, " ");
|
|
139
|
+
case "allow": {
|
|
140
|
+
const allow = intersect(narrowEmbedAllow(value), record.allow, "; ");
|
|
141
|
+
if (allow.split("; ").includes("fullscreen")) seen.fullscreen = true;
|
|
142
|
+
return allow || null;
|
|
143
|
+
}
|
|
144
|
+
case "referrerpolicy":
|
|
145
|
+
seen.referrer = true;
|
|
146
|
+
return value.trim().toLowerCase() === "no-referrer" ? "no-referrer" : record.referrer;
|
|
147
|
+
case "loading":
|
|
148
|
+
return value === "eager" ? "eager" : "lazy";
|
|
149
|
+
case "id":
|
|
150
|
+
case "class":
|
|
151
|
+
case "style":
|
|
152
|
+
case "width":
|
|
153
|
+
case "height":
|
|
154
|
+
return value;
|
|
155
|
+
default:
|
|
156
|
+
return name.startsWith("data-") || name.startsWith("aria-") ? value : null;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function embedSerializationTail(record, seen) {
|
|
160
|
+
if (!seen.title) return null;
|
|
161
|
+
let tail = "";
|
|
162
|
+
if (!seen.sandbox) tail += ` sandbox="${record.sandbox}"`;
|
|
163
|
+
if (!seen.referrer) tail += ` referrerpolicy="${record.referrer}"`;
|
|
164
|
+
if (seen.fullscreen) tail += ' allowfullscreen=""';
|
|
165
|
+
return tail;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export {
|
|
169
|
+
currentEmbedAllowlist,
|
|
170
|
+
setEmbedPolicy,
|
|
171
|
+
resolveEmbedSrc,
|
|
172
|
+
DEFAULT_EMBED_SANDBOX,
|
|
173
|
+
DEFAULT_EMBED_REFERRER_POLICY,
|
|
174
|
+
narrowEmbedSandbox,
|
|
175
|
+
narrowEmbedAllow,
|
|
176
|
+
narrowEmbedReferrerPolicy,
|
|
177
|
+
recordEmbedFrame,
|
|
178
|
+
getEmbedRecord,
|
|
179
|
+
embedSerializedAttribute,
|
|
180
|
+
embedSerializationTail
|
|
181
|
+
};
|
|
@@ -524,7 +524,7 @@ function forEachSubscriber(signal, visit) {
|
|
|
524
524
|
}
|
|
525
525
|
|
|
526
526
|
// src/reactivity/track.ts
|
|
527
|
-
var _runtimeVersion = true ? "4.
|
|
527
|
+
var _runtimeVersion = true ? "4.12.0" : "dev";
|
|
528
528
|
var REGISTRY_KEY = /* @__PURE__ */ Symbol.for("sibujs.reactive.v1");
|
|
529
529
|
function resolveReactiveApi() {
|
|
530
530
|
const g = globalThis;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isBlockedElement
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-F2UWOZ6J.js";
|
|
4
4
|
import {
|
|
5
5
|
globalSingleton
|
|
6
6
|
} from "./chunk-7ZHH77QA.js";
|
|
7
7
|
import {
|
|
8
8
|
effect
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-EMB5PG7V.js";
|
|
10
10
|
import {
|
|
11
11
|
sanitizeUrl
|
|
12
12
|
} from "./chunk-EXXSN3BW.js";
|
|
13
13
|
import {
|
|
14
14
|
signal
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-IHA62NGJ.js";
|
|
16
16
|
import {
|
|
17
17
|
bindOwnerScope
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-B2Y5BJSP.js";
|
|
19
19
|
import {
|
|
20
20
|
DEV,
|
|
21
21
|
devWarn,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
domBinding
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WFRQ6D7H.js";
|
|
4
4
|
import {
|
|
5
5
|
bindAttribute,
|
|
6
6
|
setSafeAttribute
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XX4BRMWF.js";
|
|
8
8
|
import {
|
|
9
9
|
isBlockedElement
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-F2UWOZ6J.js";
|
|
11
11
|
import {
|
|
12
12
|
derived
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-RK7EPQPG.js";
|
|
14
14
|
import {
|
|
15
15
|
globalSingleton
|
|
16
16
|
} from "./chunk-7ZHH77QA.js";
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
} from "./chunk-5HZXGZ6T.js";
|
|
24
24
|
import {
|
|
25
25
|
signal
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-IHA62NGJ.js";
|
|
27
27
|
import {
|
|
28
28
|
reactiveBinding,
|
|
29
29
|
track
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-B2Y5BJSP.js";
|
|
31
31
|
import {
|
|
32
32
|
dispose,
|
|
33
33
|
disposeNodeOwn,
|
|
@@ -203,6 +203,9 @@ function contextualAttributeRefusal(el, name, value, origin) {
|
|
|
203
203
|
if (SVG_ANIMATION_ELEMENTS.has(local) && el.namespaceURI === SVG_NS) return animationRefusal(name, value);
|
|
204
204
|
return ContextualRefusal.None;
|
|
205
205
|
}
|
|
206
|
+
function isRefusedAnimationAttribute(el, name, value) {
|
|
207
|
+
return SVG_ANIMATION_ELEMENTS.has(el.localName) && el.namespaceURI === SVG_NS && animationRefusal(name, value) !== ContextualRefusal.None;
|
|
208
|
+
}
|
|
206
209
|
function settleAttributeProvenance(el, name, origin) {
|
|
207
210
|
if (el.localName !== "link" || canonicalAttrName(name) !== "href") return;
|
|
208
211
|
if (origin !== "static" && el.hasAttribute("href")) runtimeHrefLinks.add(el);
|
|
@@ -219,6 +222,7 @@ export {
|
|
|
219
222
|
isCodeTextElement,
|
|
220
223
|
ContextualRefusal,
|
|
221
224
|
contextualAttributeRefusal,
|
|
225
|
+
isRefusedAnimationAttribute,
|
|
222
226
|
settleAttributeProvenance,
|
|
223
227
|
isForbiddenMetaSnapshot
|
|
224
228
|
};
|
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
} from "./chunk-7ZHH77QA.js";
|
|
10
10
|
import {
|
|
11
11
|
effect
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-EMB5PG7V.js";
|
|
13
13
|
import {
|
|
14
14
|
sanitizeUrl
|
|
15
15
|
} from "./chunk-EXXSN3BW.js";
|
|
16
16
|
import {
|
|
17
17
|
batch,
|
|
18
18
|
signal
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-IHA62NGJ.js";
|
|
20
20
|
import {
|
|
21
21
|
reportError
|
|
22
22
|
} from "./chunk-NYNYSPK7.js";
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-62BDYGAG.js";
|
|
5
5
|
import {
|
|
6
6
|
derived
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-RK7EPQPG.js";
|
|
8
8
|
import {
|
|
9
9
|
effect
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EMB5PG7V.js";
|
|
11
11
|
import {
|
|
12
12
|
batch,
|
|
13
13
|
signal
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-IHA62NGJ.js";
|
|
15
15
|
import {
|
|
16
16
|
DEV,
|
|
17
17
|
devWarn,
|