@syntrologie/runtime-sdk 2.4.0-canary.25 → 2.4.0-canary.26
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/actions/schema.js +2 -2
- package/dist/{chunk-2WDY7YGN.js → chunk-E26VPJAS.js} +62 -21
- package/dist/chunk-E26VPJAS.js.map +7 -0
- package/dist/{chunk-YZ27S3HX.js → chunk-R5DNAIRI.js} +2 -2
- package/dist/{chunk-7OZFA3CQ.js → chunk-XDYJ64IN.js} +14 -3
- package/dist/chunk-XDYJ64IN.js.map +7 -0
- package/dist/config/schema.d.ts +3046 -6
- package/dist/config/schema.js +1 -1
- package/dist/index.js +3 -3
- package/dist/react.js +3 -3
- package/dist/smart-canvas.esm.js +28 -28
- package/dist/smart-canvas.esm.js.map +3 -3
- package/dist/smart-canvas.js +69 -20
- package/dist/smart-canvas.js.map +2 -2
- package/dist/smart-canvas.min.js +28 -28
- package/dist/smart-canvas.min.js.map +3 -3
- package/dist/version.d.ts +1 -1
- package/package.json +7 -7
- package/schema/canvas-config.schema.json +322 -5
- package/scripts/validate-config.mjs +31 -0
- package/dist/chunk-2WDY7YGN.js.map +0 -7
- package/dist/chunk-7OZFA3CQ.js.map +0 -7
- /package/dist/{chunk-YZ27S3HX.js.map → chunk-R5DNAIRI.js.map} +0 -0
package/dist/smart-canvas.js
CHANGED
|
@@ -13082,8 +13082,19 @@ var SyntrologieSDK = (() => {
|
|
|
13082
13082
|
} };
|
|
13083
13083
|
}
|
|
13084
13084
|
const sanitizedHtml = sanitizeHtml(action.html);
|
|
13085
|
+
const dedupAttr = "data-syntro-insert-label";
|
|
13086
|
+
const label = action.label;
|
|
13087
|
+
if (label) {
|
|
13088
|
+
const escapedLabel = CSS.escape(label);
|
|
13089
|
+
const searchRoot = anchorEl.parentElement ?? anchorEl;
|
|
13090
|
+
const existing = searchRoot.querySelector(`[${dedupAttr}="${escapedLabel}"]`);
|
|
13091
|
+
if (existing)
|
|
13092
|
+
existing.remove();
|
|
13093
|
+
}
|
|
13085
13094
|
const container = document.createElement("div");
|
|
13086
13095
|
container.setAttribute("data-syntro-action-id", context.generateId());
|
|
13096
|
+
if (label)
|
|
13097
|
+
container.setAttribute(dedupAttr, label);
|
|
13087
13098
|
container.innerHTML = sanitizedHtml;
|
|
13088
13099
|
let originalContent = null;
|
|
13089
13100
|
switch (action.position) {
|
|
@@ -16449,26 +16460,40 @@ var SyntrologieSDK = (() => {
|
|
|
16449
16460
|
}
|
|
16450
16461
|
const attachTrigger = () => {
|
|
16451
16462
|
if (opts.trigger === "hover") {
|
|
16452
|
-
|
|
16463
|
+
let hideTimeout = null;
|
|
16464
|
+
const show = () => {
|
|
16465
|
+
if (hideTimeout) {
|
|
16466
|
+
clearTimeout(hideTimeout);
|
|
16467
|
+
hideTimeout = null;
|
|
16468
|
+
}
|
|
16453
16469
|
div.style.visibility = "visible";
|
|
16454
16470
|
div.style.opacity = "1";
|
|
16455
16471
|
};
|
|
16456
|
-
const
|
|
16457
|
-
|
|
16458
|
-
|
|
16472
|
+
const scheduleHide = () => {
|
|
16473
|
+
hideTimeout = setTimeout(() => {
|
|
16474
|
+
div.style.visibility = "hidden";
|
|
16475
|
+
div.style.opacity = "0";
|
|
16476
|
+
hideTimeout = null;
|
|
16477
|
+
}, 100);
|
|
16459
16478
|
};
|
|
16460
16479
|
div.style.visibility = "hidden";
|
|
16461
16480
|
div.style.opacity = "0";
|
|
16462
16481
|
div.style.transition = "opacity 200ms ease, visibility 200ms";
|
|
16463
|
-
anchorEl.addEventListener("mouseenter",
|
|
16464
|
-
anchorEl.addEventListener("mouseleave",
|
|
16465
|
-
|
|
16466
|
-
|
|
16482
|
+
anchorEl.addEventListener("mouseenter", show);
|
|
16483
|
+
anchorEl.addEventListener("mouseleave", scheduleHide);
|
|
16484
|
+
div.addEventListener("mouseenter", show);
|
|
16485
|
+
div.addEventListener("mouseleave", scheduleHide);
|
|
16486
|
+
anchorEl.addEventListener("focus", show);
|
|
16487
|
+
anchorEl.addEventListener("blur", scheduleHide);
|
|
16467
16488
|
return () => {
|
|
16468
|
-
|
|
16469
|
-
|
|
16470
|
-
anchorEl.removeEventListener("
|
|
16471
|
-
anchorEl.removeEventListener("
|
|
16489
|
+
if (hideTimeout)
|
|
16490
|
+
clearTimeout(hideTimeout);
|
|
16491
|
+
anchorEl.removeEventListener("mouseenter", show);
|
|
16492
|
+
anchorEl.removeEventListener("mouseleave", scheduleHide);
|
|
16493
|
+
div.removeEventListener("mouseenter", show);
|
|
16494
|
+
div.removeEventListener("mouseleave", scheduleHide);
|
|
16495
|
+
anchorEl.removeEventListener("focus", show);
|
|
16496
|
+
anchorEl.removeEventListener("blur", scheduleHide);
|
|
16472
16497
|
};
|
|
16473
16498
|
}
|
|
16474
16499
|
if (opts.trigger === "click") {
|
|
@@ -19260,7 +19285,7 @@ var SyntrologieSDK = (() => {
|
|
|
19260
19285
|
}
|
|
19261
19286
|
|
|
19262
19287
|
// src/version.ts
|
|
19263
|
-
var SDK_VERSION = "2.4.0-canary.
|
|
19288
|
+
var SDK_VERSION = "2.4.0-canary.26";
|
|
19264
19289
|
|
|
19265
19290
|
// src/types.ts
|
|
19266
19291
|
var SDK_SCHEMA_VERSION = "2.0";
|
|
@@ -21310,10 +21335,12 @@ ${cssRules}
|
|
|
21310
21335
|
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
|
|
21311
21336
|
function WidgetMount({ widgetId, props }) {
|
|
21312
21337
|
const runtime7 = useRuntime();
|
|
21313
|
-
const
|
|
21338
|
+
const parentRef = (0, import_react13.useRef)(null);
|
|
21314
21339
|
const handleRef = (0, import_react13.useRef)(null);
|
|
21315
21340
|
const registry = runtime7?.widgets;
|
|
21316
21341
|
const widgetAvailable = registry?.has(widgetId) ?? false;
|
|
21342
|
+
const propsRef = (0, import_react13.useRef)(props);
|
|
21343
|
+
propsRef.current = props;
|
|
21317
21344
|
const [, forceUpdate] = (0, import_react13.useReducer)((x2) => x2 + 1, 0);
|
|
21318
21345
|
(0, import_react13.useEffect)(() => {
|
|
21319
21346
|
if (!registry || widgetAvailable) return;
|
|
@@ -21324,14 +21351,26 @@ ${cssRules}
|
|
|
21324
21351
|
});
|
|
21325
21352
|
}, [registry, widgetId, widgetAvailable]);
|
|
21326
21353
|
(0, import_react13.useEffect)(() => {
|
|
21327
|
-
if (!
|
|
21328
|
-
const
|
|
21354
|
+
if (!parentRef.current || !registry || !widgetAvailable) return;
|
|
21355
|
+
const container = document.createElement("div");
|
|
21356
|
+
container.style.width = "100%";
|
|
21357
|
+
container.style.minHeight = "40px";
|
|
21358
|
+
parentRef.current.appendChild(container);
|
|
21359
|
+
const handle = registry.mount(widgetId, container, propsRef.current);
|
|
21329
21360
|
handleRef.current = handle;
|
|
21330
21361
|
return () => {
|
|
21331
21362
|
handle.unmount();
|
|
21332
21363
|
handleRef.current = null;
|
|
21364
|
+
container.remove();
|
|
21333
21365
|
};
|
|
21334
|
-
}, [registry, widgetId,
|
|
21366
|
+
}, [registry, widgetId, widgetAvailable]);
|
|
21367
|
+
const propsJson = JSON.stringify(props);
|
|
21368
|
+
const prevPropsJsonRef = (0, import_react13.useRef)(propsJson);
|
|
21369
|
+
(0, import_react13.useEffect)(() => {
|
|
21370
|
+
if (prevPropsJsonRef.current === propsJson) return;
|
|
21371
|
+
prevPropsJsonRef.current = propsJson;
|
|
21372
|
+
handleRef.current?.update(propsRef.current);
|
|
21373
|
+
}, [propsJson]);
|
|
21335
21374
|
if (!registry || !registry.has(widgetId)) {
|
|
21336
21375
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
21337
21376
|
"div",
|
|
@@ -21349,7 +21388,7 @@ ${cssRules}
|
|
|
21349
21388
|
}
|
|
21350
21389
|
);
|
|
21351
21390
|
}
|
|
21352
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ref:
|
|
21391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ref: parentRef });
|
|
21353
21392
|
}
|
|
21354
21393
|
function TileCard({
|
|
21355
21394
|
config,
|
|
@@ -36190,7 +36229,17 @@ ${cssRules}
|
|
|
36190
36229
|
actions: external_exports.array(external_exports.any()),
|
|
36191
36230
|
theme: CanvasThemeConfigZ.optional(),
|
|
36192
36231
|
launcher: LauncherConfigZ.optional(),
|
|
36193
|
-
|
|
36232
|
+
meta: external_exports.object({
|
|
36233
|
+
verificationSteps: external_exports.array(
|
|
36234
|
+
external_exports.union([
|
|
36235
|
+
external_exports.string(),
|
|
36236
|
+
external_exports.object({
|
|
36237
|
+
text: external_exports.string(),
|
|
36238
|
+
check: ConditionZ.optional()
|
|
36239
|
+
})
|
|
36240
|
+
])
|
|
36241
|
+
).optional()
|
|
36242
|
+
}).passthrough().optional()
|
|
36194
36243
|
}).strict();
|
|
36195
36244
|
|
|
36196
36245
|
// src/actions/schema.ts
|
|
@@ -39300,7 +39349,7 @@ ${cssRules}
|
|
|
39300
39349
|
}
|
|
39301
39350
|
|
|
39302
39351
|
// src/index.ts
|
|
39303
|
-
var RUNTIME_SDK_BUILD = true ? `${"2026-03-
|
|
39352
|
+
var RUNTIME_SDK_BUILD = true ? `${"2026-03-04T23:23:37.890Z"} (${"a49ba3d7ef"})` : "dev";
|
|
39304
39353
|
if (typeof window !== "undefined") {
|
|
39305
39354
|
console.log(`[Syntro Runtime] Build: ${RUNTIME_SDK_BUILD}`);
|
|
39306
39355
|
const existing = window.SynOS;
|