@01.software/sdk 0.15.0 → 0.17.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 +39 -18
- package/dist/const-D2K5HxpP.d.cts +24 -0
- package/dist/const-DG8TrouX.d.ts +24 -0
- package/dist/index.cjs +33 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-Cjbr7XZZ.d.cts → payload-types-CMoyAOjJ.d.cts} +614 -95
- package/dist/{payload-types-Cjbr7XZZ.d.ts → payload-types-CMoyAOjJ.d.ts} +614 -95
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/ui/canvas.cjs +4 -14
- package/dist/ui/canvas.cjs.map +1 -1
- package/dist/ui/canvas.js +4 -14
- package/dist/ui/canvas.js.map +1 -1
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/{webhook-BVA28ptL.d.cts → webhook-Dm2zz7FQ.d.cts} +2 -2
- package/dist/{webhook-2zxdCwB4.d.ts → webhook-IhuUWnt5.d.ts} +2 -2
- package/dist/webhook.d.cts +3 -3
- package/dist/webhook.d.ts +3 -3
- package/package.json +1 -1
- package/dist/const-9RunqFfj.d.cts +0 -19
- package/dist/const-ovU3MmND.d.ts +0 -19
package/dist/ui/canvas.js
CHANGED
|
@@ -363,15 +363,9 @@ function useQuickJS() {
|
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
// src/ui/Canvas/template-compiler.ts
|
|
366
|
+
var WIRE_FORMAT_VERSION = 1;
|
|
366
367
|
var MAX_CACHE_SIZE = 100;
|
|
367
368
|
var MAX_MATERIALIZE_DEPTH = 20;
|
|
368
|
-
var IFRAME_BLOCKED_PROPS = /* @__PURE__ */ new Set([
|
|
369
|
-
"srcdoc",
|
|
370
|
-
"allow",
|
|
371
|
-
"allowpaymentrequest",
|
|
372
|
-
"name",
|
|
373
|
-
"sandbox"
|
|
374
|
-
]);
|
|
375
369
|
var ALLOWED_ELEMENTS = /* @__PURE__ */ new Set([
|
|
376
370
|
"div",
|
|
377
371
|
"span",
|
|
@@ -405,8 +399,7 @@ var ALLOWED_ELEMENTS = /* @__PURE__ */ new Set([
|
|
|
405
399
|
"path",
|
|
406
400
|
"g",
|
|
407
401
|
"circle",
|
|
408
|
-
"rect"
|
|
409
|
-
"iframe"
|
|
402
|
+
"rect"
|
|
410
403
|
]);
|
|
411
404
|
var BLOCKED_PATTERNS = [
|
|
412
405
|
/\bdocument\s*\./,
|
|
@@ -438,7 +431,7 @@ var VM_SETUP = `
|
|
|
438
431
|
var React = {
|
|
439
432
|
createElement: function(type, props) {
|
|
440
433
|
var args = Array.prototype.slice.call(arguments, 2);
|
|
441
|
-
return { $$t: 'el', type: String(type), props: props || {}, ch: args };
|
|
434
|
+
return { $$t: 'el', $$v: 1, type: String(type), props: props || {}, ch: args };
|
|
442
435
|
},
|
|
443
436
|
Fragment: '__frag__'
|
|
444
437
|
};
|
|
@@ -530,6 +523,7 @@ function materialize(node, depth = 0) {
|
|
|
530
523
|
}
|
|
531
524
|
if (typeof node !== "object") return null;
|
|
532
525
|
const d = node;
|
|
526
|
+
if (d.$$v !== WIRE_FORMAT_VERSION) return null;
|
|
533
527
|
if (d.$$t === "frag") {
|
|
534
528
|
const ch = Array.isArray(d.ch) ? d.ch : [];
|
|
535
529
|
return React.createElement(
|
|
@@ -547,7 +541,6 @@ function materialize(node, depth = 0) {
|
|
|
547
541
|
for (const [k, v] of Object.entries(props)) {
|
|
548
542
|
if (k.startsWith("on")) continue;
|
|
549
543
|
if (k === "dangerouslySetInnerHTML" || k === "ref") continue;
|
|
550
|
-
if (type === "iframe" && IFRAME_BLOCKED_PROPS.has(k)) continue;
|
|
551
544
|
if ((k === "src" || k === "href") && !isSafeUrl(v)) continue;
|
|
552
545
|
if (k === "style") {
|
|
553
546
|
safeProps[k] = sanitizeStyle(v);
|
|
@@ -555,9 +548,6 @@ function materialize(node, depth = 0) {
|
|
|
555
548
|
}
|
|
556
549
|
safeProps[k] = v;
|
|
557
550
|
}
|
|
558
|
-
if (type === "iframe") {
|
|
559
|
-
safeProps["sandbox"] = "allow-scripts allow-same-origin";
|
|
560
|
-
}
|
|
561
551
|
const children = ch.map((c) => materialize(c, depth + 1));
|
|
562
552
|
return React.createElement(type, safeProps, ...children);
|
|
563
553
|
}
|