@zaflun/lumio-sdk 0.6.3 → 0.6.6
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/index.js +21 -3
- package/dist/lumio-runtime.global.js +178 -35
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -3,6 +3,15 @@ import { createRoot } from "react-dom/client";
|
|
|
3
3
|
var RENDER_TIMEOUT_MS = 1e4;
|
|
4
4
|
var hasRendered = false;
|
|
5
5
|
var renderTimeout = null;
|
|
6
|
+
function hostOrigin() {
|
|
7
|
+
try {
|
|
8
|
+
if (typeof document !== "undefined" && document.referrer) {
|
|
9
|
+
return new URL(document.referrer).origin;
|
|
10
|
+
}
|
|
11
|
+
} catch {
|
|
12
|
+
}
|
|
13
|
+
return "*";
|
|
14
|
+
}
|
|
6
15
|
function startRenderTimeout() {
|
|
7
16
|
if (renderTimeout) return;
|
|
8
17
|
renderTimeout = setTimeout(() => {
|
|
@@ -16,7 +25,7 @@ function startRenderTimeout() {
|
|
|
16
25
|
code: "RENDER_TIMEOUT",
|
|
17
26
|
message: "Extension did not render within 10 seconds"
|
|
18
27
|
},
|
|
19
|
-
|
|
28
|
+
hostOrigin()
|
|
20
29
|
);
|
|
21
30
|
}
|
|
22
31
|
}, RENDER_TIMEOUT_MS);
|
|
@@ -39,7 +48,7 @@ var Lumio = {
|
|
|
39
48
|
}
|
|
40
49
|
const root = createRoot(rootElement);
|
|
41
50
|
root.render(element);
|
|
42
|
-
window.parent.postMessage({ type: "READY" },
|
|
51
|
+
window.parent.postMessage({ type: "READY" }, hostOrigin());
|
|
43
52
|
void options;
|
|
44
53
|
}
|
|
45
54
|
};
|
|
@@ -1007,12 +1016,21 @@ function formatFromPath(path) {
|
|
|
1007
1016
|
if (lower.endsWith(".woff")) return "woff";
|
|
1008
1017
|
return "truetype";
|
|
1009
1018
|
}
|
|
1019
|
+
var FAMILY_RE = /^[\w -]+$/;
|
|
1020
|
+
function escapeCssUrl(src) {
|
|
1021
|
+
return src.replace(/[\\"\n\r\f]/g, (c) => `\\${c}`);
|
|
1022
|
+
}
|
|
1010
1023
|
function buildFontFace(family, src, display, weight, style) {
|
|
1024
|
+
if (!FAMILY_RE.test(family)) {
|
|
1025
|
+
throw new Error(
|
|
1026
|
+
`Invalid font family "${family}": only letters, digits, spaces, "-" and "_" are allowed.`
|
|
1027
|
+
);
|
|
1028
|
+
}
|
|
1011
1029
|
const format = formatFromPath(src);
|
|
1012
1030
|
const lines = [
|
|
1013
1031
|
"@font-face {",
|
|
1014
1032
|
` font-family: "${family}";`,
|
|
1015
|
-
` src: url("${src}") format("${format}");`,
|
|
1033
|
+
` src: url("${escapeCssUrl(src)}") format("${format}");`,
|
|
1016
1034
|
` font-display: ${display};`
|
|
1017
1035
|
];
|
|
1018
1036
|
if (weight !== void 0) {
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
mod
|
|
32
32
|
));
|
|
33
33
|
|
|
34
|
-
// ../../node_modules/.pnpm/react@19.2.
|
|
34
|
+
// ../../node_modules/.pnpm/react@19.2.8/node_modules/react/cjs/react.production.js
|
|
35
35
|
var require_react_production = __commonJS({
|
|
36
|
-
"../../node_modules/.pnpm/react@19.2.
|
|
36
|
+
"../../node_modules/.pnpm/react@19.2.8/node_modules/react/cjs/react.production.js"(exports$1) {
|
|
37
37
|
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
|
|
38
38
|
var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
|
|
39
39
|
var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
@@ -467,22 +467,22 @@
|
|
|
467
467
|
exports$1.useTransition = function() {
|
|
468
468
|
return ReactSharedInternals.H.useTransition();
|
|
469
469
|
};
|
|
470
|
-
exports$1.version = "19.2.
|
|
470
|
+
exports$1.version = "19.2.8";
|
|
471
471
|
}
|
|
472
472
|
});
|
|
473
473
|
|
|
474
|
-
// ../../node_modules/.pnpm/react@19.2.
|
|
474
|
+
// ../../node_modules/.pnpm/react@19.2.8/node_modules/react/index.js
|
|
475
475
|
var require_react = __commonJS({
|
|
476
|
-
"../../node_modules/.pnpm/react@19.2.
|
|
476
|
+
"../../node_modules/.pnpm/react@19.2.8/node_modules/react/index.js"(exports$1, module) {
|
|
477
477
|
{
|
|
478
478
|
module.exports = require_react_production();
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
481
|
});
|
|
482
482
|
|
|
483
|
-
// ../../node_modules/.pnpm/react@19.2.
|
|
483
|
+
// ../../node_modules/.pnpm/react@19.2.8/node_modules/react/cjs/react-jsx-runtime.production.js
|
|
484
484
|
var require_react_jsx_runtime_production = __commonJS({
|
|
485
|
-
"../../node_modules/.pnpm/react@19.2.
|
|
485
|
+
"../../node_modules/.pnpm/react@19.2.8/node_modules/react/cjs/react-jsx-runtime.production.js"(exports$1) {
|
|
486
486
|
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
|
|
487
487
|
var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
488
488
|
function jsxProd(type, config2, maybeKey) {
|
|
@@ -509,9 +509,9 @@
|
|
|
509
509
|
}
|
|
510
510
|
});
|
|
511
511
|
|
|
512
|
-
// ../../node_modules/.pnpm/react@19.2.
|
|
512
|
+
// ../../node_modules/.pnpm/react@19.2.8/node_modules/react/jsx-runtime.js
|
|
513
513
|
var require_jsx_runtime = __commonJS({
|
|
514
|
-
"../../node_modules/.pnpm/react@19.2.
|
|
514
|
+
"../../node_modules/.pnpm/react@19.2.8/node_modules/react/jsx-runtime.js"(exports$1, module) {
|
|
515
515
|
{
|
|
516
516
|
module.exports = require_react_jsx_runtime_production();
|
|
517
517
|
}
|
|
@@ -799,9 +799,9 @@
|
|
|
799
799
|
}
|
|
800
800
|
});
|
|
801
801
|
|
|
802
|
-
// ../../node_modules/.pnpm/react-dom@19.2.
|
|
802
|
+
// ../../node_modules/.pnpm/react-dom@19.2.8_react@19.2.8/node_modules/react-dom/cjs/react-dom.production.js
|
|
803
803
|
var require_react_dom_production = __commonJS({
|
|
804
|
-
"../../node_modules/.pnpm/react-dom@19.2.
|
|
804
|
+
"../../node_modules/.pnpm/react-dom@19.2.8_react@19.2.8/node_modules/react-dom/cjs/react-dom.production.js"(exports$1) {
|
|
805
805
|
var React33 = require_react();
|
|
806
806
|
function formatProdErrorMessage(code) {
|
|
807
807
|
var url2 = "https://react.dev/errors/" + code;
|
|
@@ -943,13 +943,13 @@
|
|
|
943
943
|
exports$1.useFormStatus = function() {
|
|
944
944
|
return ReactSharedInternals.H.useHostTransitionStatus();
|
|
945
945
|
};
|
|
946
|
-
exports$1.version = "19.2.
|
|
946
|
+
exports$1.version = "19.2.8";
|
|
947
947
|
}
|
|
948
948
|
});
|
|
949
949
|
|
|
950
|
-
// ../../node_modules/.pnpm/react-dom@19.2.
|
|
950
|
+
// ../../node_modules/.pnpm/react-dom@19.2.8_react@19.2.8/node_modules/react-dom/index.js
|
|
951
951
|
var require_react_dom = __commonJS({
|
|
952
|
-
"../../node_modules/.pnpm/react-dom@19.2.
|
|
952
|
+
"../../node_modules/.pnpm/react-dom@19.2.8_react@19.2.8/node_modules/react-dom/index.js"(exports$1, module) {
|
|
953
953
|
function checkDCE() {
|
|
954
954
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") {
|
|
955
955
|
return;
|
|
@@ -967,9 +967,9 @@
|
|
|
967
967
|
}
|
|
968
968
|
});
|
|
969
969
|
|
|
970
|
-
// ../../node_modules/.pnpm/react-dom@19.2.
|
|
970
|
+
// ../../node_modules/.pnpm/react-dom@19.2.8_react@19.2.8/node_modules/react-dom/cjs/react-dom-client.production.js
|
|
971
971
|
var require_react_dom_client_production = __commonJS({
|
|
972
|
-
"../../node_modules/.pnpm/react-dom@19.2.
|
|
972
|
+
"../../node_modules/.pnpm/react-dom@19.2.8_react@19.2.8/node_modules/react-dom/cjs/react-dom-client.production.js"(exports$1) {
|
|
973
973
|
var Scheduler = require_scheduler();
|
|
974
974
|
var React33 = require_react();
|
|
975
975
|
var ReactDOM = require_react_dom();
|
|
@@ -12608,12 +12608,12 @@
|
|
|
12608
12608
|
}
|
|
12609
12609
|
};
|
|
12610
12610
|
var isomorphicReactPackageVersion$jscomp$inline_1840 = React33.version;
|
|
12611
|
-
if ("19.2.
|
|
12611
|
+
if ("19.2.8" !== isomorphicReactPackageVersion$jscomp$inline_1840)
|
|
12612
12612
|
throw Error(
|
|
12613
12613
|
formatProdErrorMessage(
|
|
12614
12614
|
527,
|
|
12615
12615
|
isomorphicReactPackageVersion$jscomp$inline_1840,
|
|
12616
|
-
"19.2.
|
|
12616
|
+
"19.2.8"
|
|
12617
12617
|
)
|
|
12618
12618
|
);
|
|
12619
12619
|
ReactDOMSharedInternals.findDOMNode = function(componentOrElement) {
|
|
@@ -12631,10 +12631,10 @@
|
|
|
12631
12631
|
};
|
|
12632
12632
|
var internals$jscomp$inline_2347 = {
|
|
12633
12633
|
bundleType: 0,
|
|
12634
|
-
version: "19.2.
|
|
12634
|
+
version: "19.2.8",
|
|
12635
12635
|
rendererPackageName: "react-dom",
|
|
12636
12636
|
currentDispatcherRef: ReactSharedInternals,
|
|
12637
|
-
reconcilerVersion: "19.2.
|
|
12637
|
+
reconcilerVersion: "19.2.8"
|
|
12638
12638
|
};
|
|
12639
12639
|
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
|
12640
12640
|
hook$jscomp$inline_2348 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
@@ -12702,13 +12702,13 @@
|
|
|
12702
12702
|
listenToAllSupportedEvents(container);
|
|
12703
12703
|
return new ReactDOMHydrationRoot(initialChildren);
|
|
12704
12704
|
};
|
|
12705
|
-
exports$1.version = "19.2.
|
|
12705
|
+
exports$1.version = "19.2.8";
|
|
12706
12706
|
}
|
|
12707
12707
|
});
|
|
12708
12708
|
|
|
12709
|
-
// ../../node_modules/.pnpm/react-dom@19.2.
|
|
12709
|
+
// ../../node_modules/.pnpm/react-dom@19.2.8_react@19.2.8/node_modules/react-dom/client.js
|
|
12710
12710
|
var require_client = __commonJS({
|
|
12711
|
-
"../../node_modules/.pnpm/react-dom@19.2.
|
|
12711
|
+
"../../node_modules/.pnpm/react-dom@19.2.8_react@19.2.8/node_modules/react-dom/client.js"(exports$1, module) {
|
|
12712
12712
|
function checkDCE() {
|
|
12713
12713
|
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") {
|
|
12714
12714
|
return;
|
|
@@ -13007,9 +13007,9 @@
|
|
|
13007
13007
|
}
|
|
13008
13008
|
});
|
|
13009
13009
|
|
|
13010
|
-
// ../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.2.
|
|
13010
|
+
// ../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.2.8/node_modules/react-reconciler/cjs/react-reconciler.production.js
|
|
13011
13011
|
var require_react_reconciler_production = __commonJS({
|
|
13012
|
-
"../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.2.
|
|
13012
|
+
"../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.2.8/node_modules/react-reconciler/cjs/react-reconciler.production.js"(exports$1, module) {
|
|
13013
13013
|
module.exports = function($$$config) {
|
|
13014
13014
|
function createFiber(tag, pendingProps, key, mode) {
|
|
13015
13015
|
return new FiberNode(tag, pendingProps, key, mode);
|
|
@@ -20834,9 +20834,9 @@
|
|
|
20834
20834
|
}
|
|
20835
20835
|
});
|
|
20836
20836
|
|
|
20837
|
-
// ../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.2.
|
|
20837
|
+
// ../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.2.8/node_modules/react-reconciler/index.js
|
|
20838
20838
|
var require_react_reconciler = __commonJS({
|
|
20839
|
-
"../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.2.
|
|
20839
|
+
"../../node_modules/.pnpm/react-reconciler@0.32.0_react@19.2.8/node_modules/react-reconciler/index.js"(exports$1, module) {
|
|
20840
20840
|
{
|
|
20841
20841
|
module.exports = require_react_reconciler_production();
|
|
20842
20842
|
}
|
|
@@ -20909,6 +20909,15 @@
|
|
|
20909
20909
|
var RENDER_TIMEOUT_MS = 1e4;
|
|
20910
20910
|
var hasRendered = false;
|
|
20911
20911
|
var renderTimeout = null;
|
|
20912
|
+
function hostOrigin() {
|
|
20913
|
+
try {
|
|
20914
|
+
if (typeof document !== "undefined" && document.referrer) {
|
|
20915
|
+
return new URL(document.referrer).origin;
|
|
20916
|
+
}
|
|
20917
|
+
} catch {
|
|
20918
|
+
}
|
|
20919
|
+
return "*";
|
|
20920
|
+
}
|
|
20912
20921
|
function startRenderTimeout() {
|
|
20913
20922
|
if (renderTimeout) return;
|
|
20914
20923
|
renderTimeout = setTimeout(() => {
|
|
@@ -20922,7 +20931,7 @@
|
|
|
20922
20931
|
code: "RENDER_TIMEOUT",
|
|
20923
20932
|
message: "Extension did not render within 10 seconds"
|
|
20924
20933
|
},
|
|
20925
|
-
|
|
20934
|
+
hostOrigin()
|
|
20926
20935
|
);
|
|
20927
20936
|
}
|
|
20928
20937
|
}, RENDER_TIMEOUT_MS);
|
|
@@ -20945,7 +20954,7 @@
|
|
|
20945
20954
|
}
|
|
20946
20955
|
const root = (0, import_client.createRoot)(rootElement);
|
|
20947
20956
|
root.render(element);
|
|
20948
|
-
window.parent.postMessage({ type: "READY" },
|
|
20957
|
+
window.parent.postMessage({ type: "READY" }, hostOrigin());
|
|
20949
20958
|
}
|
|
20950
20959
|
};
|
|
20951
20960
|
|
|
@@ -21360,6 +21369,7 @@
|
|
|
21360
21369
|
var dist_exports = {};
|
|
21361
21370
|
__export(dist_exports, {
|
|
21362
21371
|
ACTION_TYPES: () => ACTION_TYPES,
|
|
21372
|
+
EXTENSION_RUNTIME_LABEL_PLACEHOLDER: () => EXTENSION_RUNTIME_LABEL_PLACEHOLDER,
|
|
21363
21373
|
HOST_METHODS: () => HOST_METHODS,
|
|
21364
21374
|
LUMIO_COMPONENT_TYPES: () => LUMIO_COMPONENT_TYPES,
|
|
21365
21375
|
LUMIO_EVENT_TYPES: () => LUMIO_EVENT_TYPES,
|
|
@@ -21371,7 +21381,11 @@
|
|
|
21371
21381
|
errorMessageSchema: () => errorMessageSchema,
|
|
21372
21382
|
eventMessageSchema: () => eventMessageSchema,
|
|
21373
21383
|
extensionConfigSchema: () => extensionConfigSchema,
|
|
21384
|
+
extensionRuntimeLabel: () => extensionRuntimeLabel,
|
|
21385
|
+
extensionRuntimeOrigin: () => extensionRuntimeOrigin,
|
|
21386
|
+
extensionRuntimeOriginLabel: () => extensionRuntimeOriginLabel,
|
|
21374
21387
|
initMessageSchema: () => initMessageSchema,
|
|
21388
|
+
isValidExtensionRuntimeOriginTemplate: () => isValidExtensionRuntimeOriginTemplate,
|
|
21375
21389
|
lumioActionTypeSchema: () => lumioActionTypeSchema,
|
|
21376
21390
|
lumioEventTypeSchema: () => lumioEventTypeSchema,
|
|
21377
21391
|
lumioMessageSchema: () => lumioMessageSchema,
|
|
@@ -21387,6 +21401,50 @@
|
|
|
21387
21401
|
themeSchema: () => themeSchema
|
|
21388
21402
|
});
|
|
21389
21403
|
|
|
21404
|
+
// ../protocol/dist/chunk-746VSR4E.js
|
|
21405
|
+
var EXTENSION_RUNTIME_LABEL_PLACEHOLDER = "{label}";
|
|
21406
|
+
var UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
21407
|
+
var LABEL_PATTERN = /^[0-9a-f]{32}$/;
|
|
21408
|
+
var DNS_LABEL_PATTERN = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
|
|
21409
|
+
var TEMPLATE_PATTERN = /^(https:\/\/|http:\/\/)\{label\}(\.[a-z0-9.-]+(?::[0-9]{1,5})?)$/;
|
|
21410
|
+
function parseTemplate(template) {
|
|
21411
|
+
const match = TEMPLATE_PATTERN.exec(template);
|
|
21412
|
+
if (!match) return null;
|
|
21413
|
+
const prefix = match[1];
|
|
21414
|
+
const suffix = match[2];
|
|
21415
|
+
const host = suffix.slice(1).replace(/:[0-9]+$/, "");
|
|
21416
|
+
if (prefix === "http://" && host !== "localhost") return null;
|
|
21417
|
+
if (!host.split(".").every((label) => DNS_LABEL_PATTERN.test(label))) return null;
|
|
21418
|
+
const sample = `${prefix}${"0".repeat(32)}${suffix}`;
|
|
21419
|
+
try {
|
|
21420
|
+
if (new URL(sample).origin !== sample) return null;
|
|
21421
|
+
} catch {
|
|
21422
|
+
return null;
|
|
21423
|
+
}
|
|
21424
|
+
return { prefix, suffix };
|
|
21425
|
+
}
|
|
21426
|
+
function extensionRuntimeLabel(extensionId) {
|
|
21427
|
+
if (typeof extensionId !== "string" || !UUID_PATTERN.test(extensionId)) return null;
|
|
21428
|
+
return extensionId.replaceAll("-", "");
|
|
21429
|
+
}
|
|
21430
|
+
function extensionRuntimeOrigin(extensionId, template) {
|
|
21431
|
+
const label = extensionRuntimeLabel(extensionId);
|
|
21432
|
+
if (!label) return null;
|
|
21433
|
+
const parsed = parseTemplate(template);
|
|
21434
|
+
if (!parsed) return null;
|
|
21435
|
+
return `${parsed.prefix}${label}${parsed.suffix}`;
|
|
21436
|
+
}
|
|
21437
|
+
function extensionRuntimeOriginLabel(origin, template) {
|
|
21438
|
+
const parsed = parseTemplate(template);
|
|
21439
|
+
if (!parsed) return null;
|
|
21440
|
+
if (!origin.startsWith(parsed.prefix) || !origin.endsWith(parsed.suffix)) return null;
|
|
21441
|
+
const label = origin.slice(parsed.prefix.length, origin.length - parsed.suffix.length);
|
|
21442
|
+
return LABEL_PATTERN.test(label) ? label : null;
|
|
21443
|
+
}
|
|
21444
|
+
function isValidExtensionRuntimeOriginTemplate(template) {
|
|
21445
|
+
return parseTemplate(template) !== null;
|
|
21446
|
+
}
|
|
21447
|
+
|
|
21390
21448
|
// ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/external.js
|
|
21391
21449
|
var external_exports = {};
|
|
21392
21450
|
__export(external_exports, {
|
|
@@ -35286,15 +35344,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
35286
35344
|
"youtube:gift_membership",
|
|
35287
35345
|
"youtube:gift_membership_received",
|
|
35288
35346
|
"youtube:poll",
|
|
35289
|
-
//
|
|
35347
|
+
// YouTube stream lifecycle (ZAF-1444 / ZAF-622 §75) — emitted by the poll-driven
|
|
35348
|
+
// YouTube worker on the channel-status online/offline edge, mirroring Twitch/Kick.
|
|
35349
|
+
"youtube:stream_online",
|
|
35350
|
+
"youtube:stream_offline",
|
|
35351
|
+
// Kick — the webhook receiver normalizes every Kick payload into these types
|
|
35352
|
+
// (ZAF-1624): canonical fields on top, the original payload kept in `raw`.
|
|
35290
35353
|
"kick:follower",
|
|
35291
35354
|
"kick:subscribe",
|
|
35355
|
+
"kick:resub",
|
|
35292
35356
|
"kick:gift",
|
|
35357
|
+
"kick:kicks",
|
|
35358
|
+
"kick:reward",
|
|
35359
|
+
"kick:reward_status",
|
|
35293
35360
|
"kick:stream_online",
|
|
35294
35361
|
"kick:stream_offline",
|
|
35295
|
-
|
|
35296
|
-
"trovo:subscribe",
|
|
35297
|
-
"trovo:spell",
|
|
35362
|
+
"kick:stream_update",
|
|
35298
35363
|
// Spotify
|
|
35299
35364
|
"spotify:track",
|
|
35300
35365
|
"spotify:play",
|
|
@@ -35314,7 +35379,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
35314
35379
|
"twitch:chat",
|
|
35315
35380
|
"youtube:chat",
|
|
35316
35381
|
"kick:chat",
|
|
35317
|
-
"trovo:chat",
|
|
35318
35382
|
// Chat (cross-platform catch-all — fires for ALL platforms)
|
|
35319
35383
|
"chat:message"
|
|
35320
35384
|
];
|
|
@@ -36009,12 +36073,21 @@ ${stops}
|
|
|
36009
36073
|
if (lower.endsWith(".woff")) return "woff";
|
|
36010
36074
|
return "truetype";
|
|
36011
36075
|
}
|
|
36076
|
+
var FAMILY_RE = /^[\w -]+$/;
|
|
36077
|
+
function escapeCssUrl(src) {
|
|
36078
|
+
return src.replace(/[\\"\n\r\f]/g, (c) => `\\${c}`);
|
|
36079
|
+
}
|
|
36012
36080
|
function buildFontFace(family, src, display, weight, style) {
|
|
36081
|
+
if (!FAMILY_RE.test(family)) {
|
|
36082
|
+
throw new Error(
|
|
36083
|
+
`Invalid font family "${family}": only letters, digits, spaces, "-" and "_" are allowed.`
|
|
36084
|
+
);
|
|
36085
|
+
}
|
|
36013
36086
|
const format = formatFromPath(src);
|
|
36014
36087
|
const lines = [
|
|
36015
36088
|
"@font-face {",
|
|
36016
36089
|
` font-family: "${family}";`,
|
|
36017
|
-
` src: url("${src}") format("${format}");`,
|
|
36090
|
+
` src: url("${escapeCssUrl(src)}") format("${format}");`,
|
|
36018
36091
|
` font-display: ${display};`
|
|
36019
36092
|
];
|
|
36020
36093
|
if (weight !== void 0) {
|
|
@@ -36567,7 +36640,77 @@ ${stops}
|
|
|
36567
36640
|
}
|
|
36568
36641
|
};
|
|
36569
36642
|
|
|
36643
|
+
// src/runtime/lockdown.ts
|
|
36644
|
+
var BLOCKED_GLOBAL_PROPS = [
|
|
36645
|
+
// Origin-scoped storage
|
|
36646
|
+
"indexedDB",
|
|
36647
|
+
"caches",
|
|
36648
|
+
// Cross-context channels on the shared origin
|
|
36649
|
+
"BroadcastChannel",
|
|
36650
|
+
// Nested workers would start with a fresh, un-locked global
|
|
36651
|
+
"Worker",
|
|
36652
|
+
"SharedWorker",
|
|
36653
|
+
// Legacy origin-scoped file systems (Chromium)
|
|
36654
|
+
"webkitRequestFileSystem",
|
|
36655
|
+
"webkitRequestFileSystemSync",
|
|
36656
|
+
"webkitResolveLocalFileSystemURL",
|
|
36657
|
+
"webkitResolveLocalFileSystemSyncURL"
|
|
36658
|
+
];
|
|
36659
|
+
var BLOCKED_NAVIGATOR_PROPS = [
|
|
36660
|
+
// StorageManager — quota, persistence and the origin-private file system
|
|
36661
|
+
"storage",
|
|
36662
|
+
// Web Locks are shared by every context on the origin
|
|
36663
|
+
"locks",
|
|
36664
|
+
// Service workers are registered per origin
|
|
36665
|
+
"serviceWorker",
|
|
36666
|
+
// Storage Buckets (Chromium 122+) — each bucket opens its own indexedDB,
|
|
36667
|
+
// caches and getDirectory(), all shared across the origin
|
|
36668
|
+
"storageBuckets"
|
|
36669
|
+
];
|
|
36670
|
+
function blockedError(prop) {
|
|
36671
|
+
const message = `${prop} is not available in the Lumio extension sandbox`;
|
|
36672
|
+
return typeof DOMException === "function" ? new DOMException(message, "SecurityError") : new Error(message);
|
|
36673
|
+
}
|
|
36674
|
+
function blockProperty(target, prop) {
|
|
36675
|
+
const descriptor = {
|
|
36676
|
+
get() {
|
|
36677
|
+
throw blockedError(prop);
|
|
36678
|
+
},
|
|
36679
|
+
set() {
|
|
36680
|
+
throw blockedError(prop);
|
|
36681
|
+
},
|
|
36682
|
+
enumerable: false,
|
|
36683
|
+
configurable: false
|
|
36684
|
+
};
|
|
36685
|
+
let obj = Object.getPrototypeOf(target);
|
|
36686
|
+
while (obj && obj !== Object.prototype) {
|
|
36687
|
+
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
|
36688
|
+
try {
|
|
36689
|
+
Object.defineProperty(obj, prop, descriptor);
|
|
36690
|
+
} catch {
|
|
36691
|
+
}
|
|
36692
|
+
}
|
|
36693
|
+
obj = Object.getPrototypeOf(obj);
|
|
36694
|
+
}
|
|
36695
|
+
try {
|
|
36696
|
+
Object.defineProperty(target, prop, descriptor);
|
|
36697
|
+
} catch {
|
|
36698
|
+
}
|
|
36699
|
+
}
|
|
36700
|
+
function lockDownWorkerGlobal(scope = globalThis) {
|
|
36701
|
+
const nav = scope.navigator;
|
|
36702
|
+
for (const prop of BLOCKED_GLOBAL_PROPS) {
|
|
36703
|
+
blockProperty(scope, prop);
|
|
36704
|
+
}
|
|
36705
|
+
if (nav && typeof nav === "object") {
|
|
36706
|
+
for (const prop of BLOCKED_NAVIGATOR_PROPS) {
|
|
36707
|
+
blockProperty(nav, prop);
|
|
36708
|
+
}
|
|
36709
|
+
}
|
|
36710
|
+
}
|
|
36711
|
+
|
|
36570
36712
|
// src/runtime/worker-entry.ts
|
|
36713
|
+
lockDownWorkerGlobal();
|
|
36571
36714
|
var LumioSDK = {
|
|
36572
36715
|
...src_exports,
|
|
36573
36716
|
Lumio: Lumio2
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zaflun/lumio-sdk",
|
|
3
|
-
"version": "0.6.
|
|
4
|
-
"description": "Lumio Extension SDK
|
|
3
|
+
"version": "0.6.6",
|
|
4
|
+
"description": "Lumio Extension SDK - React components, hooks, and server utilities for building Lumio extensions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"react-reconciler": "^0.32.0",
|
|
26
|
-
"@zaflun/lumio-
|
|
27
|
-
"@zaflun/lumio-
|
|
26
|
+
"@zaflun/lumio-extension-types": "0.3.3",
|
|
27
|
+
"@zaflun/lumio-protocol": "0.6.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@testing-library/react": "^16.1.0",
|
|
35
|
-
"@types/react": "^19.
|
|
36
|
-
"@types/react-dom": "^19.
|
|
35
|
+
"@types/react": "^19.2.18",
|
|
36
|
+
"@types/react-dom": "^19.2.4",
|
|
37
37
|
"@types/react-reconciler": "^0.32.0",
|
|
38
38
|
"jsdom": "^26.1.0",
|
|
39
|
-
"lucide-static": "^1.
|
|
40
|
-
"react": "^19.
|
|
41
|
-
"react-dom": "^19.
|
|
39
|
+
"lucide-static": "^1.30.0",
|
|
40
|
+
"react": "^19.2.8",
|
|
41
|
+
"react-dom": "^19.2.8",
|
|
42
42
|
"tsup": "^8.4.0",
|
|
43
|
-
"typescript": "^
|
|
43
|
+
"typescript": "^6.0.3",
|
|
44
44
|
"unicode-emoji-json": "^0.9.0",
|
|
45
|
-
"vitest": "^
|
|
45
|
+
"vitest": "^4.1.10"
|
|
46
46
|
},
|
|
47
47
|
"license": "MIT",
|
|
48
48
|
"publishConfig": {
|