@syntrologie/runtime-sdk 2.4.0-canary.24 → 2.4.0-canary.25
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-LD22WJ44.js → chunk-2WDY7YGN.js} +78 -40
- package/dist/chunk-2WDY7YGN.js.map +7 -0
- package/dist/{chunk-WILWIL6L.js → chunk-7OZFA3CQ.js} +5 -2
- package/dist/chunk-7OZFA3CQ.js.map +7 -0
- package/dist/{chunk-NM5Y27GX.js → chunk-YZ27S3HX.js} +2 -2
- package/dist/config/schema.d.ts +81 -0
- package/dist/config/schema.js +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +2 -2
- package/dist/react.js +3 -3
- package/dist/smart-canvas.esm.js +31 -31
- package/dist/smart-canvas.esm.js.map +3 -3
- package/dist/smart-canvas.js +68 -30
- package/dist/smart-canvas.js.map +2 -2
- package/dist/smart-canvas.min.js +31 -31
- 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 +9 -0
- package/scripts/validate-config.mjs +71 -0
- package/dist/chunk-LD22WJ44.js.map +0 -7
- package/dist/chunk-WILWIL6L.js.map +0 -7
- /package/dist/{chunk-NM5Y27GX.js.map → chunk-YZ27S3HX.js.map} +0 -0
package/dist/smart-canvas.js
CHANGED
|
@@ -16803,11 +16803,26 @@ var SyntrologieSDK = (() => {
|
|
|
16803
16803
|
return { cleanup: () => {
|
|
16804
16804
|
} };
|
|
16805
16805
|
}
|
|
16806
|
+
const existing = anchorEl.getAttribute("data-syntro-highlight");
|
|
16807
|
+
if (existing) {
|
|
16808
|
+
const prev = context.overlayRoot.querySelectorAll(".syntro-spotlight-scrim, .syntro-spotlight-ring");
|
|
16809
|
+
prev.forEach((el) => el.remove());
|
|
16810
|
+
}
|
|
16811
|
+
anchorEl.setAttribute("data-syntro-highlight", "true");
|
|
16812
|
+
let ringColor = action.style?.color;
|
|
16813
|
+
if (!ringColor) {
|
|
16814
|
+
try {
|
|
16815
|
+
const primary = getComputedStyle(context.overlayRoot).getPropertyValue("--sc-color-primary")?.trim();
|
|
16816
|
+
if (primary)
|
|
16817
|
+
ringColor = primary;
|
|
16818
|
+
} catch {
|
|
16819
|
+
}
|
|
16820
|
+
}
|
|
16806
16821
|
const handle = showHighlight(anchorEl, context.overlayRoot, {
|
|
16807
16822
|
paddingPx: action.style?.paddingPx ?? 12,
|
|
16808
16823
|
radiusPx: action.style?.radiusPx ?? 12,
|
|
16809
16824
|
scrimOpacity: action.style?.scrimOpacity ?? 0.55,
|
|
16810
|
-
ringColor
|
|
16825
|
+
ringColor,
|
|
16811
16826
|
blocking: action.blocking ?? false,
|
|
16812
16827
|
onClickOutside: action.onClickOutside ?? true,
|
|
16813
16828
|
onEsc: action.onEsc ?? true
|
|
@@ -16820,6 +16835,7 @@ var SyntrologieSDK = (() => {
|
|
|
16820
16835
|
return {
|
|
16821
16836
|
cleanup: () => {
|
|
16822
16837
|
handle.destroy();
|
|
16838
|
+
anchorEl.removeAttribute("data-syntro-highlight");
|
|
16823
16839
|
}
|
|
16824
16840
|
};
|
|
16825
16841
|
};
|
|
@@ -18517,7 +18533,7 @@ var SyntrologieSDK = (() => {
|
|
|
18517
18533
|
};
|
|
18518
18534
|
const renderItems = (items) => items.map((q2, index2) => (0, import_jsx_runtime4.jsx)(FAQItem, { item: q2, isExpanded: expandedIds.has(q2.config.id), isHighlighted: highlightId === q2.config.id, isLast: index2 === items.length - 1, onToggle: () => handleToggle(q2.config.id), theme: resolvedTheme, feedbackConfig, feedbackValue: feedbackState.get(q2.config.id), onFeedback: handleFeedback }, q2.config.id));
|
|
18519
18535
|
if (visibleQuestions.length === 0) {
|
|
18520
|
-
return (0, import_jsx_runtime4.jsx)("div", { style: containerStyle, "data-adaptive-id": instanceId, "data-adaptive-type": "adaptive-faq", children: (0, import_jsx_runtime4.jsx)("div", { style: emptyStateStyle, children: "
|
|
18536
|
+
return (0, import_jsx_runtime4.jsx)("div", { style: containerStyle, "data-adaptive-id": instanceId, "data-adaptive-type": "adaptive-faq", children: (0, import_jsx_runtime4.jsx)("div", { style: emptyStateStyle, children: "You're all set for now! We'll surface answers here when they're relevant to what you're doing." }) });
|
|
18521
18537
|
}
|
|
18522
18538
|
return (0, import_jsx_runtime4.jsxs)("div", { style: containerStyle, "data-adaptive-id": instanceId, "data-adaptive-type": "adaptive-faq", children: [config.searchable && (0, import_jsx_runtime4.jsxs)("div", { style: baseStyles.searchWrapper, children: [(0, import_jsx_runtime4.jsx)("style", { children: `[data-adaptive-id="${instanceId}"] input::placeholder { color: var(--sc-content-search-color, inherit); opacity: 0.7; }` }), (0, import_jsx_runtime4.jsx)("input", { type: "text", placeholder: "Search questions...", value: searchQuery, onChange: (e2) => setSearchQuery(e2.target.value), style: searchInputStyle })] }), (0, import_jsx_runtime4.jsx)("div", { style: baseStyles.accordion, children: hasCategories ? Array.from(categoryGroups.entries()).map(([category, items]) => (0, import_jsx_runtime4.jsxs)(import_react4.default.Fragment, { children: [category && (0, import_jsx_runtime4.jsx)("div", { style: categoryHeaderStyle, "data-category-header": category, children: category }), renderItems(items)] }, category ?? "__ungrouped")) : renderItems(filteredQuestions) }), config.searchable && filteredQuestions.length === 0 && searchQuery && (0, import_jsx_runtime4.jsxs)("div", { style: { ...baseStyles.noResults, ...themeStyles[resolvedTheme].emptyState }, children: ['No questions found matching "', searchQuery, '"'] })] });
|
|
18523
18539
|
}
|
|
@@ -18947,7 +18963,7 @@ var SyntrologieSDK = (() => {
|
|
|
18947
18963
|
};
|
|
18948
18964
|
const renderItems = (items) => items.map((tip, index2) => (0, import_jsx_runtime5.jsx)(NavTipItem, { item: tip, isExpanded: expandedIds.has(tip.config.id), isLast: index2 === items.length - 1, onToggle: () => handleToggle(tip.config.id), onNavigate: handleNavigate, theme: resolvedTheme }, tip.config.id));
|
|
18949
18965
|
if (visibleTips.length === 0) {
|
|
18950
|
-
return (0, import_jsx_runtime5.jsx)("div", { style: containerStyle, "data-adaptive-id": instanceId, "data-adaptive-type": "adaptive-nav", children: (0, import_jsx_runtime5.jsx)("div", { style: emptyStateStyle, children: "
|
|
18966
|
+
return (0, import_jsx_runtime5.jsx)("div", { style: containerStyle, "data-adaptive-id": instanceId, "data-adaptive-type": "adaptive-nav", children: (0, import_jsx_runtime5.jsx)("div", { style: emptyStateStyle, children: "You're all set for now! We'll share helpful tips here when they're relevant to what you're doing." }) });
|
|
18951
18967
|
}
|
|
18952
18968
|
return (0, import_jsx_runtime5.jsx)("div", { style: containerStyle, "data-adaptive-id": instanceId, "data-adaptive-type": "adaptive-nav", children: (0, import_jsx_runtime5.jsx)("div", { style: baseStyles2.accordion, children: hasCategories ? Array.from(categoryGroups.entries()).map(([category, items]) => (0, import_jsx_runtime5.jsxs)(import_react5.default.Fragment, { children: [category && (0, import_jsx_runtime5.jsx)("div", { style: categoryHeaderStyle, "data-category-header": category, children: category }), renderItems(items)] }, category ?? "__ungrouped")) : renderItems(visibleTips) }) });
|
|
18953
18969
|
}
|
|
@@ -19244,7 +19260,7 @@ var SyntrologieSDK = (() => {
|
|
|
19244
19260
|
}
|
|
19245
19261
|
|
|
19246
19262
|
// src/version.ts
|
|
19247
|
-
var SDK_VERSION = "2.4.0-canary.
|
|
19263
|
+
var SDK_VERSION = "2.4.0-canary.25";
|
|
19248
19264
|
|
|
19249
19265
|
// src/types.ts
|
|
19250
19266
|
var SDK_SCHEMA_VERSION = "2.0";
|
|
@@ -20788,7 +20804,10 @@ var SyntrologieSDK = (() => {
|
|
|
20788
20804
|
background: withAlpha(slateGrey[1], 0.6),
|
|
20789
20805
|
blur: "blur(24px)",
|
|
20790
20806
|
border: "none",
|
|
20791
|
-
width: "clamp(380px, 25vw, 520px)"
|
|
20807
|
+
width: "clamp(380px, 25vw, 520px)",
|
|
20808
|
+
transitionDuration: "300ms",
|
|
20809
|
+
transitionEasing: "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
20810
|
+
transitionFade: "6%"
|
|
20792
20811
|
},
|
|
20793
20812
|
launcher: {
|
|
20794
20813
|
background: button.primary.backgroundDefault,
|
|
@@ -20868,7 +20887,10 @@ var SyntrologieSDK = (() => {
|
|
|
20868
20887
|
background: withAlpha(slateGrey[12], 0.7),
|
|
20869
20888
|
blur: "blur(24px)",
|
|
20870
20889
|
border: "none",
|
|
20871
|
-
width: "clamp(380px, 25vw, 520px)"
|
|
20890
|
+
width: "clamp(380px, 25vw, 520px)",
|
|
20891
|
+
transitionDuration: "300ms",
|
|
20892
|
+
transitionEasing: "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
20893
|
+
transitionFade: "6%"
|
|
20872
20894
|
},
|
|
20873
20895
|
launcher: {
|
|
20874
20896
|
background: brand[3],
|
|
@@ -21603,14 +21625,17 @@ ${cssRules}
|
|
|
21603
21625
|
const isFocused = displayMode === "focused";
|
|
21604
21626
|
const isRight = config.canvas.position === "right";
|
|
21605
21627
|
const isPush = config.canvas.layout === "push";
|
|
21628
|
+
const canvasBorder = config.canvas.border ?? "none";
|
|
21606
21629
|
const containerRef = (0, import_react14.useRef)(null);
|
|
21607
21630
|
const zIndex = 2147483600;
|
|
21608
21631
|
(0, import_react14.useEffect)(() => {
|
|
21609
21632
|
if (!isPush) return;
|
|
21610
21633
|
const root = document.documentElement;
|
|
21611
21634
|
const prop = isRight ? "marginRight" : "marginLeft";
|
|
21635
|
+
const duration = config.canvas.transitionDuration ?? "300ms";
|
|
21636
|
+
const easing = config.canvas.transitionEasing ?? "cubic-bezier(0.16, 1, 0.3, 1)";
|
|
21612
21637
|
const prevTransition = root.style.transition;
|
|
21613
|
-
root.style.transition = `${prop}
|
|
21638
|
+
root.style.transition = `${prop} ${duration} ${easing}`;
|
|
21614
21639
|
if (isOpen) {
|
|
21615
21640
|
const width = containerRef.current?.offsetWidth ?? 380;
|
|
21616
21641
|
root.style[prop] = `${width}px`;
|
|
@@ -21621,7 +21646,7 @@ ${cssRules}
|
|
|
21621
21646
|
root.style[prop] = "";
|
|
21622
21647
|
root.style.transition = prevTransition;
|
|
21623
21648
|
};
|
|
21624
|
-
}, [isPush, isOpen, isRight]);
|
|
21649
|
+
}, [isPush, isOpen, isRight, config.canvas.transitionDuration, config.canvas.transitionEasing]);
|
|
21625
21650
|
(0, import_react14.useEffect)(() => {
|
|
21626
21651
|
if (!isPush || !isOpen) return;
|
|
21627
21652
|
const container = containerRef.current;
|
|
@@ -21642,19 +21667,28 @@ ${cssRules}
|
|
|
21642
21667
|
maxHeight: "100%",
|
|
21643
21668
|
pointerEvents: "auto",
|
|
21644
21669
|
opacity: isOpen ? 1 : 0,
|
|
21645
|
-
transition:
|
|
21670
|
+
transition: (() => {
|
|
21671
|
+
const dur = config.canvas.transitionDuration ?? "300ms";
|
|
21672
|
+
const ease = config.canvas.transitionEasing ?? "cubic-bezier(0.16, 1, 0.3, 1)";
|
|
21673
|
+
return isOpen ? `transform ${dur} ${ease}, opacity ${dur} ease-out` : `transform ${dur} ${ease}, opacity ${dur} ease-in`;
|
|
21674
|
+
})(),
|
|
21646
21675
|
color: "var(--sc-overlay-text-color)",
|
|
21647
|
-
|
|
21648
|
-
// Focused mode:
|
|
21649
|
-
|
|
21650
|
-
|
|
21651
|
-
|
|
21652
|
-
|
|
21653
|
-
|
|
21654
|
-
|
|
21655
|
-
|
|
21656
|
-
|
|
21657
|
-
|
|
21676
|
+
background: "var(--sc-canvas-background)",
|
|
21677
|
+
// Standard mode: config blur only. Focused mode: config blur + saturate boost.
|
|
21678
|
+
...(() => {
|
|
21679
|
+
const blur = config.canvas.blur ?? "blur(24px)";
|
|
21680
|
+
const filter = isFocused && blur !== "none" ? `${blur} saturate(1.2)` : blur;
|
|
21681
|
+
return { backdropFilter: filter, WebkitBackdropFilter: filter };
|
|
21682
|
+
})(),
|
|
21683
|
+
// Tight fade mask so blur cuts off sharply at the leading edge.
|
|
21684
|
+
// Disabled when a visible border is configured (mask would fade the border).
|
|
21685
|
+
...(() => {
|
|
21686
|
+
if (isFocused || canvasBorder && canvasBorder !== "none") return {};
|
|
21687
|
+
const fade = config.canvas.transitionFade ?? "6%";
|
|
21688
|
+
const mask = isRight ? `linear-gradient(to right, transparent, black ${fade})` : `linear-gradient(to left, transparent, black ${fade})`;
|
|
21689
|
+
return { maskImage: mask, WebkitMaskImage: mask };
|
|
21690
|
+
})(),
|
|
21691
|
+
border: canvasBorder,
|
|
21658
21692
|
borderRadius: "var(--sc-overlay-border-radius, 0)",
|
|
21659
21693
|
boxShadow: "none",
|
|
21660
21694
|
// Transform logic
|
|
@@ -21938,7 +21972,7 @@ ${cssRules}
|
|
|
21938
21972
|
),
|
|
21939
21973
|
portalRoot
|
|
21940
21974
|
),
|
|
21941
|
-
|
|
21975
|
+
(0, import_react_dom.createPortal)(content, portalRoot)
|
|
21942
21976
|
] });
|
|
21943
21977
|
}
|
|
21944
21978
|
|
|
@@ -22187,6 +22221,7 @@ ${cssRules}
|
|
|
22187
22221
|
}, [controller, hasContent, configState.isLoading]);
|
|
22188
22222
|
const batchHandleRef = (0, import_react16.useRef)(initialBatchHandle ?? null);
|
|
22189
22223
|
const adoptedInitialRef = (0, import_react16.useRef)(!!initialBatchHandle);
|
|
22224
|
+
const runVersionRef = (0, import_react16.useRef)(0);
|
|
22190
22225
|
(0, import_react16.useEffect)(() => {
|
|
22191
22226
|
if (!runtime7?.actions) return;
|
|
22192
22227
|
if (adoptedInitialRef.current) {
|
|
@@ -22195,7 +22230,8 @@ ${cssRules}
|
|
|
22195
22230
|
}
|
|
22196
22231
|
return;
|
|
22197
22232
|
}
|
|
22198
|
-
|
|
22233
|
+
const version = ++runVersionRef.current;
|
|
22234
|
+
const stale = () => version !== runVersionRef.current;
|
|
22199
22235
|
const run = async () => {
|
|
22200
22236
|
if (batchHandleRef.current) {
|
|
22201
22237
|
try {
|
|
@@ -22205,17 +22241,17 @@ ${cssRules}
|
|
|
22205
22241
|
}
|
|
22206
22242
|
batchHandleRef.current = null;
|
|
22207
22243
|
}
|
|
22208
|
-
if (
|
|
22244
|
+
if (stale()) return;
|
|
22209
22245
|
if (configState.actions.length > 0) {
|
|
22210
22246
|
try {
|
|
22211
22247
|
const handle = await runtime7.actions.applyBatch(configState.actions);
|
|
22212
|
-
if (
|
|
22248
|
+
if (stale()) {
|
|
22213
22249
|
await handle.revertAll();
|
|
22214
22250
|
} else {
|
|
22215
22251
|
batchHandleRef.current = handle;
|
|
22216
22252
|
}
|
|
22217
22253
|
} catch (err) {
|
|
22218
|
-
if (!
|
|
22254
|
+
if (!stale()) {
|
|
22219
22255
|
console.error("[SmartCanvasApp] Failed to apply actions:", err);
|
|
22220
22256
|
}
|
|
22221
22257
|
}
|
|
@@ -22223,7 +22259,6 @@ ${cssRules}
|
|
|
22223
22259
|
};
|
|
22224
22260
|
run();
|
|
22225
22261
|
return () => {
|
|
22226
|
-
cancelled = true;
|
|
22227
22262
|
if (batchHandleRef.current) {
|
|
22228
22263
|
batchHandleRef.current.revertAll().catch((err) => {
|
|
22229
22264
|
console.error("[SmartCanvasApp] Failed to revert actions on cleanup:", err);
|
|
@@ -36049,7 +36084,10 @@ ${cssRules}
|
|
|
36049
36084
|
background: external_exports.string().optional(),
|
|
36050
36085
|
blur: external_exports.string().optional(),
|
|
36051
36086
|
border: external_exports.string().optional(),
|
|
36052
|
-
width: external_exports.string().optional()
|
|
36087
|
+
width: external_exports.string().optional(),
|
|
36088
|
+
transitionDuration: external_exports.string().optional(),
|
|
36089
|
+
transitionEasing: external_exports.string().optional(),
|
|
36090
|
+
transitionFade: external_exports.string().optional()
|
|
36053
36091
|
});
|
|
36054
36092
|
var LauncherElementConfigZ = external_exports.object({
|
|
36055
36093
|
background: external_exports.string().optional(),
|
|
@@ -36792,7 +36830,7 @@ ${cssRules}
|
|
|
36792
36830
|
switch (condition.type) {
|
|
36793
36831
|
case "page_url": {
|
|
36794
36832
|
const { url } = condition;
|
|
36795
|
-
const currentUrl = context.page.url;
|
|
36833
|
+
const currentUrl = context.page.url.split("?")[0].split("#")[0];
|
|
36796
36834
|
const pattern = url.replace(/\*\*/g, "\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^/]*").replace(/\0GLOBSTAR\0/g, ".*");
|
|
36797
36835
|
const regex = new RegExp(`^${pattern}$`);
|
|
36798
36836
|
return regex.test(currentUrl);
|
|
@@ -38469,7 +38507,7 @@ ${cssRules}
|
|
|
38469
38507
|
function matchRoutePattern(pathname, pattern) {
|
|
38470
38508
|
const normalizedPattern = pattern.replace(/\/$/, "") || "/";
|
|
38471
38509
|
if (pathname === normalizedPattern) return true;
|
|
38472
|
-
const regexPattern = normalizedPattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(
|
|
38510
|
+
const regexPattern = normalizedPattern.replace(/\*\*/g, "\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^/]*").replace(/\0GLOBSTAR\0/g, ".*").replace(/:[^/]+/g, "[^/]+");
|
|
38473
38511
|
const regex = new RegExp(`^${regexPattern}$`);
|
|
38474
38512
|
return regex.test(pathname);
|
|
38475
38513
|
}
|
|
@@ -39262,7 +39300,7 @@ ${cssRules}
|
|
|
39262
39300
|
}
|
|
39263
39301
|
|
|
39264
39302
|
// src/index.ts
|
|
39265
|
-
var RUNTIME_SDK_BUILD = true ? `${"2026-03-
|
|
39303
|
+
var RUNTIME_SDK_BUILD = true ? `${"2026-03-04T05:03:35.535Z"} (${"485144000d"})` : "dev";
|
|
39266
39304
|
if (typeof window !== "undefined") {
|
|
39267
39305
|
console.log(`[Syntro Runtime] Build: ${RUNTIME_SDK_BUILD}`);
|
|
39268
39306
|
const existing = window.SynOS;
|