@syntrologie/runtime-sdk 2.4.0-canary.24 → 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-LD22WJ44.js → chunk-E26VPJAS.js} +138 -59
- package/dist/chunk-E26VPJAS.js.map +7 -0
- package/dist/{chunk-NM5Y27GX.js → chunk-R5DNAIRI.js} +2 -2
- package/dist/{chunk-WILWIL6L.js → chunk-XDYJ64IN.js} +18 -4
- package/dist/chunk-XDYJ64IN.js.map +7 -0
- package/dist/config/schema.d.ts +3127 -6
- 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 +35 -35
- package/dist/smart-canvas.esm.js.map +3 -3
- package/dist/smart-canvas.js +135 -48
- package/dist/smart-canvas.js.map +2 -2
- package/dist/smart-canvas.min.js +35 -35
- 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 +331 -5
- package/scripts/validate-config.mjs +102 -0
- package/dist/chunk-LD22WJ44.js.map +0 -7
- package/dist/chunk-WILWIL6L.js.map +0 -7
- /package/dist/{chunk-NM5Y27GX.js.map → chunk-R5DNAIRI.js.map} +0 -0
package/dist/actions/schema.js
CHANGED
|
@@ -31,8 +31,8 @@ import {
|
|
|
31
31
|
WaitZ,
|
|
32
32
|
WidgetConfigZ,
|
|
33
33
|
coreActionStepSchemas
|
|
34
|
-
} from "../chunk-
|
|
35
|
-
import "../chunk-
|
|
34
|
+
} from "../chunk-R5DNAIRI.js";
|
|
35
|
+
import "../chunk-XDYJ64IN.js";
|
|
36
36
|
import "../chunk-BU4Z6PD7.js";
|
|
37
37
|
export {
|
|
38
38
|
AddClassZ,
|
|
@@ -124,6 +124,7 @@ function sanitizeHtml(html) {
|
|
|
124
124
|
|
|
125
125
|
// ../adaptives/adaptive-content/dist/runtime.js
|
|
126
126
|
var executeInsertHtml = async (action, context) => {
|
|
127
|
+
var _a2;
|
|
127
128
|
let anchorEl = context.resolveAnchor(action.anchorId);
|
|
128
129
|
if (!anchorEl && context.waitForAnchor) {
|
|
129
130
|
anchorEl = await context.waitForAnchor(action.anchorId, 3e3);
|
|
@@ -134,8 +135,19 @@ var executeInsertHtml = async (action, context) => {
|
|
|
134
135
|
} };
|
|
135
136
|
}
|
|
136
137
|
const sanitizedHtml = sanitizeHtml(action.html);
|
|
138
|
+
const dedupAttr = "data-syntro-insert-label";
|
|
139
|
+
const label = action.label;
|
|
140
|
+
if (label) {
|
|
141
|
+
const escapedLabel = CSS.escape(label);
|
|
142
|
+
const searchRoot = (_a2 = anchorEl.parentElement) != null ? _a2 : anchorEl;
|
|
143
|
+
const existing = searchRoot.querySelector(`[${dedupAttr}="${escapedLabel}"]`);
|
|
144
|
+
if (existing)
|
|
145
|
+
existing.remove();
|
|
146
|
+
}
|
|
137
147
|
const container = document.createElement("div");
|
|
138
148
|
container.setAttribute("data-syntro-action-id", context.generateId());
|
|
149
|
+
if (label)
|
|
150
|
+
container.setAttribute(dedupAttr, label);
|
|
139
151
|
container.innerHTML = sanitizedHtml;
|
|
140
152
|
let originalContent = null;
|
|
141
153
|
switch (action.position) {
|
|
@@ -160,8 +172,8 @@ var executeInsertHtml = async (action, context) => {
|
|
|
160
172
|
if (action.deepLink) {
|
|
161
173
|
const { tileId, itemId } = action.deepLink;
|
|
162
174
|
deepLinkHandler = () => {
|
|
163
|
-
var
|
|
164
|
-
const handle = (
|
|
175
|
+
var _a3, _b, _c;
|
|
176
|
+
const handle = (_a3 = window.SynOS) == null ? void 0 : _a3.handle;
|
|
165
177
|
if (handle) {
|
|
166
178
|
handle.open();
|
|
167
179
|
(_c = (_b = handle.runtime) == null ? void 0 : _b.events) == null ? void 0 : _c.publish("notification.deep_link", { tileId, itemId });
|
|
@@ -2047,26 +2059,40 @@ function showTooltip(anchorEl, overlayRoot, opts) {
|
|
|
2047
2059
|
}
|
|
2048
2060
|
const attachTrigger = () => {
|
|
2049
2061
|
if (opts.trigger === "hover") {
|
|
2050
|
-
|
|
2062
|
+
let hideTimeout = null;
|
|
2063
|
+
const show = () => {
|
|
2064
|
+
if (hideTimeout) {
|
|
2065
|
+
clearTimeout(hideTimeout);
|
|
2066
|
+
hideTimeout = null;
|
|
2067
|
+
}
|
|
2051
2068
|
div.style.visibility = "visible";
|
|
2052
2069
|
div.style.opacity = "1";
|
|
2053
2070
|
};
|
|
2054
|
-
const
|
|
2055
|
-
|
|
2056
|
-
|
|
2071
|
+
const scheduleHide = () => {
|
|
2072
|
+
hideTimeout = setTimeout(() => {
|
|
2073
|
+
div.style.visibility = "hidden";
|
|
2074
|
+
div.style.opacity = "0";
|
|
2075
|
+
hideTimeout = null;
|
|
2076
|
+
}, 100);
|
|
2057
2077
|
};
|
|
2058
2078
|
div.style.visibility = "hidden";
|
|
2059
2079
|
div.style.opacity = "0";
|
|
2060
2080
|
div.style.transition = "opacity 200ms ease, visibility 200ms";
|
|
2061
|
-
anchorEl.addEventListener("mouseenter",
|
|
2062
|
-
anchorEl.addEventListener("mouseleave",
|
|
2063
|
-
|
|
2064
|
-
|
|
2081
|
+
anchorEl.addEventListener("mouseenter", show);
|
|
2082
|
+
anchorEl.addEventListener("mouseleave", scheduleHide);
|
|
2083
|
+
div.addEventListener("mouseenter", show);
|
|
2084
|
+
div.addEventListener("mouseleave", scheduleHide);
|
|
2085
|
+
anchorEl.addEventListener("focus", show);
|
|
2086
|
+
anchorEl.addEventListener("blur", scheduleHide);
|
|
2065
2087
|
return () => {
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
anchorEl.removeEventListener("
|
|
2069
|
-
anchorEl.removeEventListener("
|
|
2088
|
+
if (hideTimeout)
|
|
2089
|
+
clearTimeout(hideTimeout);
|
|
2090
|
+
anchorEl.removeEventListener("mouseenter", show);
|
|
2091
|
+
anchorEl.removeEventListener("mouseleave", scheduleHide);
|
|
2092
|
+
div.removeEventListener("mouseenter", show);
|
|
2093
|
+
div.removeEventListener("mouseleave", scheduleHide);
|
|
2094
|
+
anchorEl.removeEventListener("focus", show);
|
|
2095
|
+
anchorEl.removeEventListener("blur", scheduleHide);
|
|
2070
2096
|
};
|
|
2071
2097
|
}
|
|
2072
2098
|
if (opts.trigger === "click") {
|
|
@@ -2407,7 +2433,7 @@ var WorkflowMountableWidget = {
|
|
|
2407
2433
|
|
|
2408
2434
|
// ../adaptives/adaptive-overlays/dist/runtime.js
|
|
2409
2435
|
var executeHighlight = async (action, context) => {
|
|
2410
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
2436
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
2411
2437
|
let anchorEl = context.resolveAnchor(action.anchorId);
|
|
2412
2438
|
if (!anchorEl && context.waitForAnchor) {
|
|
2413
2439
|
anchorEl = await context.waitForAnchor(action.anchorId, 3e3);
|
|
@@ -2417,14 +2443,29 @@ var executeHighlight = async (action, context) => {
|
|
|
2417
2443
|
return { cleanup: () => {
|
|
2418
2444
|
} };
|
|
2419
2445
|
}
|
|
2446
|
+
const existing = anchorEl.getAttribute("data-syntro-highlight");
|
|
2447
|
+
if (existing) {
|
|
2448
|
+
const prev = context.overlayRoot.querySelectorAll(".syntro-spotlight-scrim, .syntro-spotlight-ring");
|
|
2449
|
+
prev.forEach((el) => el.remove());
|
|
2450
|
+
}
|
|
2451
|
+
anchorEl.setAttribute("data-syntro-highlight", "true");
|
|
2452
|
+
let ringColor = (_a2 = action.style) == null ? void 0 : _a2.color;
|
|
2453
|
+
if (!ringColor) {
|
|
2454
|
+
try {
|
|
2455
|
+
const primary = (_b = getComputedStyle(context.overlayRoot).getPropertyValue("--sc-color-primary")) == null ? void 0 : _b.trim();
|
|
2456
|
+
if (primary)
|
|
2457
|
+
ringColor = primary;
|
|
2458
|
+
} catch {
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2420
2461
|
const handle = showHighlight(anchorEl, context.overlayRoot, {
|
|
2421
|
-
paddingPx: (
|
|
2422
|
-
radiusPx: (
|
|
2423
|
-
scrimOpacity: (
|
|
2424
|
-
ringColor
|
|
2425
|
-
blocking: (
|
|
2426
|
-
onClickOutside: (
|
|
2427
|
-
onEsc: (
|
|
2462
|
+
paddingPx: (_d = (_c = action.style) == null ? void 0 : _c.paddingPx) != null ? _d : 12,
|
|
2463
|
+
radiusPx: (_f = (_e = action.style) == null ? void 0 : _e.radiusPx) != null ? _f : 12,
|
|
2464
|
+
scrimOpacity: (_h = (_g = action.style) == null ? void 0 : _g.scrimOpacity) != null ? _h : 0.55,
|
|
2465
|
+
ringColor,
|
|
2466
|
+
blocking: (_i = action.blocking) != null ? _i : false,
|
|
2467
|
+
onClickOutside: (_j = action.onClickOutside) != null ? _j : true,
|
|
2468
|
+
onEsc: (_k = action.onEsc) != null ? _k : true
|
|
2428
2469
|
});
|
|
2429
2470
|
context.publishEvent("action.applied", {
|
|
2430
2471
|
id: context.generateId(),
|
|
@@ -2434,6 +2475,7 @@ var executeHighlight = async (action, context) => {
|
|
|
2434
2475
|
return {
|
|
2435
2476
|
cleanup: () => {
|
|
2436
2477
|
handle.destroy();
|
|
2478
|
+
anchorEl.removeAttribute("data-syntro-highlight");
|
|
2437
2479
|
}
|
|
2438
2480
|
};
|
|
2439
2481
|
};
|
|
@@ -3316,7 +3358,7 @@ function getAntiFlickerSnippet(config = {}) {
|
|
|
3316
3358
|
}
|
|
3317
3359
|
|
|
3318
3360
|
// src/version.ts
|
|
3319
|
-
var SDK_VERSION = "2.4.0-canary.
|
|
3361
|
+
var SDK_VERSION = "2.4.0-canary.26";
|
|
3320
3362
|
|
|
3321
3363
|
// src/types.ts
|
|
3322
3364
|
var SDK_SCHEMA_VERSION = "2.0";
|
|
@@ -4319,10 +4361,12 @@ import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
|
4319
4361
|
function WidgetMount({ widgetId, props }) {
|
|
4320
4362
|
var _a2;
|
|
4321
4363
|
const runtime3 = useRuntime();
|
|
4322
|
-
const
|
|
4364
|
+
const parentRef = useRef4(null);
|
|
4323
4365
|
const handleRef = useRef4(null);
|
|
4324
4366
|
const registry = runtime3 == null ? void 0 : runtime3.widgets;
|
|
4325
4367
|
const widgetAvailable = (_a2 = registry == null ? void 0 : registry.has(widgetId)) != null ? _a2 : false;
|
|
4368
|
+
const propsRef = useRef4(props);
|
|
4369
|
+
propsRef.current = props;
|
|
4326
4370
|
const [, forceUpdate] = useReducer((x) => x + 1, 0);
|
|
4327
4371
|
useEffect5(() => {
|
|
4328
4372
|
if (!registry || widgetAvailable) return;
|
|
@@ -4333,14 +4377,27 @@ function WidgetMount({ widgetId, props }) {
|
|
|
4333
4377
|
});
|
|
4334
4378
|
}, [registry, widgetId, widgetAvailable]);
|
|
4335
4379
|
useEffect5(() => {
|
|
4336
|
-
if (!
|
|
4337
|
-
const
|
|
4380
|
+
if (!parentRef.current || !registry || !widgetAvailable) return;
|
|
4381
|
+
const container = document.createElement("div");
|
|
4382
|
+
container.style.width = "100%";
|
|
4383
|
+
container.style.minHeight = "40px";
|
|
4384
|
+
parentRef.current.appendChild(container);
|
|
4385
|
+
const handle = registry.mount(widgetId, container, propsRef.current);
|
|
4338
4386
|
handleRef.current = handle;
|
|
4339
4387
|
return () => {
|
|
4340
4388
|
handle.unmount();
|
|
4341
4389
|
handleRef.current = null;
|
|
4390
|
+
container.remove();
|
|
4342
4391
|
};
|
|
4343
|
-
}, [registry, widgetId,
|
|
4392
|
+
}, [registry, widgetId, widgetAvailable]);
|
|
4393
|
+
const propsJson = JSON.stringify(props);
|
|
4394
|
+
const prevPropsJsonRef = useRef4(propsJson);
|
|
4395
|
+
useEffect5(() => {
|
|
4396
|
+
var _a3;
|
|
4397
|
+
if (prevPropsJsonRef.current === propsJson) return;
|
|
4398
|
+
prevPropsJsonRef.current = propsJson;
|
|
4399
|
+
(_a3 = handleRef.current) == null ? void 0 : _a3.update(propsRef.current);
|
|
4400
|
+
}, [propsJson]);
|
|
4344
4401
|
if (!registry || !registry.has(widgetId)) {
|
|
4345
4402
|
return /* @__PURE__ */ jsxs2(
|
|
4346
4403
|
"div",
|
|
@@ -4358,7 +4415,7 @@ function WidgetMount({ widgetId, props }) {
|
|
|
4358
4415
|
}
|
|
4359
4416
|
);
|
|
4360
4417
|
}
|
|
4361
|
-
return /* @__PURE__ */ jsx5("div", { ref:
|
|
4418
|
+
return /* @__PURE__ */ jsx5("div", { ref: parentRef });
|
|
4362
4419
|
}
|
|
4363
4420
|
function TileCard({
|
|
4364
4421
|
config,
|
|
@@ -4659,7 +4716,10 @@ var darkDefaults = {
|
|
|
4659
4716
|
background: withAlpha(slateGrey[1], 0.6),
|
|
4660
4717
|
blur: "blur(24px)",
|
|
4661
4718
|
border: "none",
|
|
4662
|
-
width: "clamp(380px, 25vw, 520px)"
|
|
4719
|
+
width: "clamp(380px, 25vw, 520px)",
|
|
4720
|
+
transitionDuration: "300ms",
|
|
4721
|
+
transitionEasing: "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
4722
|
+
transitionFade: "6%"
|
|
4663
4723
|
},
|
|
4664
4724
|
launcher: {
|
|
4665
4725
|
background: button.primary.backgroundDefault,
|
|
@@ -4739,7 +4799,10 @@ var lightDefaults = {
|
|
|
4739
4799
|
background: withAlpha(slateGrey[12], 0.7),
|
|
4740
4800
|
blur: "blur(24px)",
|
|
4741
4801
|
border: "none",
|
|
4742
|
-
width: "clamp(380px, 25vw, 520px)"
|
|
4802
|
+
width: "clamp(380px, 25vw, 520px)",
|
|
4803
|
+
transitionDuration: "300ms",
|
|
4804
|
+
transitionEasing: "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
4805
|
+
transitionFade: "6%"
|
|
4743
4806
|
},
|
|
4744
4807
|
launcher: {
|
|
4745
4808
|
background: brand[3],
|
|
@@ -4941,7 +5004,7 @@ function ShadowCanvasOverlay({
|
|
|
4941
5004
|
canvasTitle,
|
|
4942
5005
|
displayMode = "standard"
|
|
4943
5006
|
}) {
|
|
4944
|
-
var _a2, _b, _c, _d
|
|
5007
|
+
var _a2, _b, _c, _d;
|
|
4945
5008
|
const [mounted, setMounted] = useState5(false);
|
|
4946
5009
|
const [launcherPos, setLauncherPos] = useState5(null);
|
|
4947
5010
|
const dragRef = useRef5(null);
|
|
@@ -5063,7 +5126,7 @@ function ShadowCanvasOverlay({
|
|
|
5063
5126
|
}
|
|
5064
5127
|
}, []);
|
|
5065
5128
|
const onLauncherPointerUp = useCallback4(
|
|
5066
|
-
(
|
|
5129
|
+
(_e) => {
|
|
5067
5130
|
const drag = dragRef.current;
|
|
5068
5131
|
dragRef.current = null;
|
|
5069
5132
|
if (drag && !drag.dragged) {
|
|
@@ -5075,17 +5138,20 @@ function ShadowCanvasOverlay({
|
|
|
5075
5138
|
const isFocused = displayMode === "focused";
|
|
5076
5139
|
const isRight = config.canvas.position === "right";
|
|
5077
5140
|
const isPush = config.canvas.layout === "push";
|
|
5141
|
+
const canvasBorder = (_b = config.canvas.border) != null ? _b : "none";
|
|
5078
5142
|
const containerRef = useRef5(null);
|
|
5079
5143
|
const zIndex = 2147483600;
|
|
5080
5144
|
useEffect7(() => {
|
|
5081
|
-
var _a3, _b2;
|
|
5145
|
+
var _a3, _b2, _c2, _d2;
|
|
5082
5146
|
if (!isPush) return;
|
|
5083
5147
|
const root = document.documentElement;
|
|
5084
5148
|
const prop = isRight ? "marginRight" : "marginLeft";
|
|
5149
|
+
const duration = (_a3 = config.canvas.transitionDuration) != null ? _a3 : "300ms";
|
|
5150
|
+
const easing = (_b2 = config.canvas.transitionEasing) != null ? _b2 : "cubic-bezier(0.16, 1, 0.3, 1)";
|
|
5085
5151
|
const prevTransition = root.style.transition;
|
|
5086
|
-
root.style.transition = `${prop}
|
|
5152
|
+
root.style.transition = `${prop} ${duration} ${easing}`;
|
|
5087
5153
|
if (isOpen) {
|
|
5088
|
-
const width = (
|
|
5154
|
+
const width = (_d2 = (_c2 = containerRef.current) == null ? void 0 : _c2.offsetWidth) != null ? _d2 : 380;
|
|
5089
5155
|
root.style[prop] = `${width}px`;
|
|
5090
5156
|
} else {
|
|
5091
5157
|
root.style[prop] = "0px";
|
|
@@ -5094,7 +5160,7 @@ function ShadowCanvasOverlay({
|
|
|
5094
5160
|
root.style[prop] = "";
|
|
5095
5161
|
root.style.transition = prevTransition;
|
|
5096
5162
|
};
|
|
5097
|
-
}, [isPush, isOpen, isRight]);
|
|
5163
|
+
}, [isPush, isOpen, isRight, config.canvas.transitionDuration, config.canvas.transitionEasing]);
|
|
5098
5164
|
useEffect7(() => {
|
|
5099
5165
|
if (!isPush || !isOpen) return;
|
|
5100
5166
|
const container = containerRef.current;
|
|
@@ -5115,19 +5181,31 @@ function ShadowCanvasOverlay({
|
|
|
5115
5181
|
maxHeight: "100%",
|
|
5116
5182
|
pointerEvents: "auto",
|
|
5117
5183
|
opacity: isOpen ? 1 : 0,
|
|
5118
|
-
transition:
|
|
5184
|
+
transition: (() => {
|
|
5185
|
+
var _a3, _b2;
|
|
5186
|
+
const dur = (_a3 = config.canvas.transitionDuration) != null ? _a3 : "300ms";
|
|
5187
|
+
const ease = (_b2 = config.canvas.transitionEasing) != null ? _b2 : "cubic-bezier(0.16, 1, 0.3, 1)";
|
|
5188
|
+
return isOpen ? `transform ${dur} ${ease}, opacity ${dur} ease-out` : `transform ${dur} ${ease}, opacity ${dur} ease-in`;
|
|
5189
|
+
})(),
|
|
5119
5190
|
color: "var(--sc-overlay-text-color)",
|
|
5120
|
-
|
|
5121
|
-
// Focused mode:
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5191
|
+
background: "var(--sc-canvas-background)",
|
|
5192
|
+
// Standard mode: config blur only. Focused mode: config blur + saturate boost.
|
|
5193
|
+
...(() => {
|
|
5194
|
+
var _a3;
|
|
5195
|
+
const blur = (_a3 = config.canvas.blur) != null ? _a3 : "blur(24px)";
|
|
5196
|
+
const filter = isFocused && blur !== "none" ? `${blur} saturate(1.2)` : blur;
|
|
5197
|
+
return { backdropFilter: filter, WebkitBackdropFilter: filter };
|
|
5198
|
+
})(),
|
|
5199
|
+
// Tight fade mask so blur cuts off sharply at the leading edge.
|
|
5200
|
+
// Disabled when a visible border is configured (mask would fade the border).
|
|
5201
|
+
...(() => {
|
|
5202
|
+
var _a3;
|
|
5203
|
+
if (isFocused || canvasBorder && canvasBorder !== "none") return {};
|
|
5204
|
+
const fade = (_a3 = config.canvas.transitionFade) != null ? _a3 : "6%";
|
|
5205
|
+
const mask = isRight ? `linear-gradient(to right, transparent, black ${fade})` : `linear-gradient(to left, transparent, black ${fade})`;
|
|
5206
|
+
return { maskImage: mask, WebkitMaskImage: mask };
|
|
5207
|
+
})(),
|
|
5208
|
+
border: canvasBorder,
|
|
5131
5209
|
borderRadius: "var(--sc-overlay-border-radius, 0)",
|
|
5132
5210
|
boxShadow: "none",
|
|
5133
5211
|
// Transform logic
|
|
@@ -5256,7 +5334,7 @@ function ShadowCanvasOverlay({
|
|
|
5256
5334
|
notifications,
|
|
5257
5335
|
onDismiss: dismissNotification,
|
|
5258
5336
|
onClickNotification: handleNotificationClick,
|
|
5259
|
-
position: (
|
|
5337
|
+
position: (_c = config.canvas.position) != null ? _c : "right"
|
|
5260
5338
|
}
|
|
5261
5339
|
),
|
|
5262
5340
|
/* @__PURE__ */ jsxs3(
|
|
@@ -5286,7 +5364,7 @@ function ShadowCanvasOverlay({
|
|
|
5286
5364
|
padding: 0,
|
|
5287
5365
|
border: "none",
|
|
5288
5366
|
backgroundColor: "var(--sc-launcher-background)",
|
|
5289
|
-
cursor: ((
|
|
5367
|
+
cursor: ((_d = dragRef.current) == null ? void 0 : _d.dragged) ? "grabbing" : "pointer",
|
|
5290
5368
|
touchAction: "none"
|
|
5291
5369
|
},
|
|
5292
5370
|
onPointerDown: onLauncherPointerDown,
|
|
@@ -5413,7 +5491,7 @@ function ShadowCanvasOverlay({
|
|
|
5413
5491
|
),
|
|
5414
5492
|
portalRoot
|
|
5415
5493
|
),
|
|
5416
|
-
|
|
5494
|
+
createPortal(content, portalRoot)
|
|
5417
5495
|
] });
|
|
5418
5496
|
}
|
|
5419
5497
|
|
|
@@ -5667,6 +5745,7 @@ function SmartCanvasAppInner({
|
|
|
5667
5745
|
}, [controller, hasContent, configState.isLoading]);
|
|
5668
5746
|
const batchHandleRef = useRef7(initialBatchHandle != null ? initialBatchHandle : null);
|
|
5669
5747
|
const adoptedInitialRef = useRef7(!!initialBatchHandle);
|
|
5748
|
+
const runVersionRef = useRef7(0);
|
|
5670
5749
|
useEffect9(() => {
|
|
5671
5750
|
if (!(runtime3 == null ? void 0 : runtime3.actions)) return;
|
|
5672
5751
|
if (adoptedInitialRef.current) {
|
|
@@ -5675,7 +5754,8 @@ function SmartCanvasAppInner({
|
|
|
5675
5754
|
}
|
|
5676
5755
|
return;
|
|
5677
5756
|
}
|
|
5678
|
-
|
|
5757
|
+
const version = ++runVersionRef.current;
|
|
5758
|
+
const stale = () => version !== runVersionRef.current;
|
|
5679
5759
|
const run = async () => {
|
|
5680
5760
|
if (batchHandleRef.current) {
|
|
5681
5761
|
try {
|
|
@@ -5685,17 +5765,17 @@ function SmartCanvasAppInner({
|
|
|
5685
5765
|
}
|
|
5686
5766
|
batchHandleRef.current = null;
|
|
5687
5767
|
}
|
|
5688
|
-
if (
|
|
5768
|
+
if (stale()) return;
|
|
5689
5769
|
if (configState.actions.length > 0) {
|
|
5690
5770
|
try {
|
|
5691
5771
|
const handle = await runtime3.actions.applyBatch(configState.actions);
|
|
5692
|
-
if (
|
|
5772
|
+
if (stale()) {
|
|
5693
5773
|
await handle.revertAll();
|
|
5694
5774
|
} else {
|
|
5695
5775
|
batchHandleRef.current = handle;
|
|
5696
5776
|
}
|
|
5697
5777
|
} catch (err) {
|
|
5698
|
-
if (!
|
|
5778
|
+
if (!stale()) {
|
|
5699
5779
|
console.error("[SmartCanvasApp] Failed to apply actions:", err);
|
|
5700
5780
|
}
|
|
5701
5781
|
}
|
|
@@ -5703,7 +5783,6 @@ function SmartCanvasAppInner({
|
|
|
5703
5783
|
};
|
|
5704
5784
|
run();
|
|
5705
5785
|
return () => {
|
|
5706
|
-
cancelled = true;
|
|
5707
5786
|
if (batchHandleRef.current) {
|
|
5708
5787
|
batchHandleRef.current.revertAll().catch((err) => {
|
|
5709
5788
|
console.error("[SmartCanvasApp] Failed to revert actions on cleanup:", err);
|
|
@@ -8682,7 +8761,7 @@ function evaluateCondition(condition, evalContext) {
|
|
|
8682
8761
|
switch (condition.type) {
|
|
8683
8762
|
case "page_url": {
|
|
8684
8763
|
const { url } = condition;
|
|
8685
|
-
const currentUrl = context.page.url;
|
|
8764
|
+
const currentUrl = context.page.url.split("?")[0].split("#")[0];
|
|
8686
8765
|
const pattern = url.replace(/\*\*/g, "\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^/]*").replace(/\0GLOBSTAR\0/g, ".*");
|
|
8687
8766
|
const regex = new RegExp(`^${pattern}$`);
|
|
8688
8767
|
return regex.test(currentUrl);
|
|
@@ -10358,7 +10437,7 @@ function matchesRouteFilter(url, filter) {
|
|
|
10358
10437
|
function matchRoutePattern(pathname, pattern) {
|
|
10359
10438
|
const normalizedPattern = pattern.replace(/\/$/, "") || "/";
|
|
10360
10439
|
if (pathname === normalizedPattern) return true;
|
|
10361
|
-
const regexPattern = normalizedPattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(
|
|
10440
|
+
const regexPattern = normalizedPattern.replace(/\*\*/g, "\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^/]*").replace(/\0GLOBSTAR\0/g, ".*").replace(/:[^/]+/g, "[^/]+");
|
|
10362
10441
|
const regex = new RegExp(`^${regexPattern}$`);
|
|
10363
10442
|
return regex.test(pathname);
|
|
10364
10443
|
}
|
|
@@ -11249,4 +11328,4 @@ export {
|
|
|
11249
11328
|
encodeToken,
|
|
11250
11329
|
Syntro
|
|
11251
11330
|
};
|
|
11252
|
-
//# sourceMappingURL=chunk-
|
|
11331
|
+
//# sourceMappingURL=chunk-E26VPJAS.js.map
|