@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.
@@ -31,8 +31,8 @@ import {
31
31
  WaitZ,
32
32
  WidgetConfigZ,
33
33
  coreActionStepSchemas
34
- } from "../chunk-NM5Y27GX.js";
35
- import "../chunk-WILWIL6L.js";
34
+ } from "../chunk-YZ27S3HX.js";
35
+ import "../chunk-7OZFA3CQ.js";
36
36
  import "../chunk-BU4Z6PD7.js";
37
37
  export {
38
38
  AddClassZ,
@@ -2407,7 +2407,7 @@ var WorkflowMountableWidget = {
2407
2407
 
2408
2408
  // ../adaptives/adaptive-overlays/dist/runtime.js
2409
2409
  var executeHighlight = async (action, context) => {
2410
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
2410
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
2411
2411
  let anchorEl = context.resolveAnchor(action.anchorId);
2412
2412
  if (!anchorEl && context.waitForAnchor) {
2413
2413
  anchorEl = await context.waitForAnchor(action.anchorId, 3e3);
@@ -2417,14 +2417,29 @@ var executeHighlight = async (action, context) => {
2417
2417
  return { cleanup: () => {
2418
2418
  } };
2419
2419
  }
2420
+ const existing = anchorEl.getAttribute("data-syntro-highlight");
2421
+ if (existing) {
2422
+ const prev = context.overlayRoot.querySelectorAll(".syntro-spotlight-scrim, .syntro-spotlight-ring");
2423
+ prev.forEach((el) => el.remove());
2424
+ }
2425
+ anchorEl.setAttribute("data-syntro-highlight", "true");
2426
+ let ringColor = (_a2 = action.style) == null ? void 0 : _a2.color;
2427
+ if (!ringColor) {
2428
+ try {
2429
+ const primary = (_b = getComputedStyle(context.overlayRoot).getPropertyValue("--sc-color-primary")) == null ? void 0 : _b.trim();
2430
+ if (primary)
2431
+ ringColor = primary;
2432
+ } catch {
2433
+ }
2434
+ }
2420
2435
  const handle = showHighlight(anchorEl, context.overlayRoot, {
2421
- paddingPx: (_b = (_a2 = action.style) == null ? void 0 : _a2.paddingPx) != null ? _b : 12,
2422
- radiusPx: (_d = (_c = action.style) == null ? void 0 : _c.radiusPx) != null ? _d : 12,
2423
- scrimOpacity: (_f = (_e = action.style) == null ? void 0 : _e.scrimOpacity) != null ? _f : 0.55,
2424
- ringColor: (_g = action.style) == null ? void 0 : _g.color,
2425
- blocking: (_h = action.blocking) != null ? _h : false,
2426
- onClickOutside: (_i = action.onClickOutside) != null ? _i : true,
2427
- onEsc: (_j = action.onEsc) != null ? _j : true
2436
+ paddingPx: (_d = (_c = action.style) == null ? void 0 : _c.paddingPx) != null ? _d : 12,
2437
+ radiusPx: (_f = (_e = action.style) == null ? void 0 : _e.radiusPx) != null ? _f : 12,
2438
+ scrimOpacity: (_h = (_g = action.style) == null ? void 0 : _g.scrimOpacity) != null ? _h : 0.55,
2439
+ ringColor,
2440
+ blocking: (_i = action.blocking) != null ? _i : false,
2441
+ onClickOutside: (_j = action.onClickOutside) != null ? _j : true,
2442
+ onEsc: (_k = action.onEsc) != null ? _k : true
2428
2443
  });
2429
2444
  context.publishEvent("action.applied", {
2430
2445
  id: context.generateId(),
@@ -2434,6 +2449,7 @@ var executeHighlight = async (action, context) => {
2434
2449
  return {
2435
2450
  cleanup: () => {
2436
2451
  handle.destroy();
2452
+ anchorEl.removeAttribute("data-syntro-highlight");
2437
2453
  }
2438
2454
  };
2439
2455
  };
@@ -3316,7 +3332,7 @@ function getAntiFlickerSnippet(config = {}) {
3316
3332
  }
3317
3333
 
3318
3334
  // src/version.ts
3319
- var SDK_VERSION = "2.4.0-canary.24";
3335
+ var SDK_VERSION = "2.4.0-canary.25";
3320
3336
 
3321
3337
  // src/types.ts
3322
3338
  var SDK_SCHEMA_VERSION = "2.0";
@@ -4659,7 +4675,10 @@ var darkDefaults = {
4659
4675
  background: withAlpha(slateGrey[1], 0.6),
4660
4676
  blur: "blur(24px)",
4661
4677
  border: "none",
4662
- width: "clamp(380px, 25vw, 520px)"
4678
+ width: "clamp(380px, 25vw, 520px)",
4679
+ transitionDuration: "300ms",
4680
+ transitionEasing: "cubic-bezier(0.16, 1, 0.3, 1)",
4681
+ transitionFade: "6%"
4663
4682
  },
4664
4683
  launcher: {
4665
4684
  background: button.primary.backgroundDefault,
@@ -4739,7 +4758,10 @@ var lightDefaults = {
4739
4758
  background: withAlpha(slateGrey[12], 0.7),
4740
4759
  blur: "blur(24px)",
4741
4760
  border: "none",
4742
- width: "clamp(380px, 25vw, 520px)"
4761
+ width: "clamp(380px, 25vw, 520px)",
4762
+ transitionDuration: "300ms",
4763
+ transitionEasing: "cubic-bezier(0.16, 1, 0.3, 1)",
4764
+ transitionFade: "6%"
4743
4765
  },
4744
4766
  launcher: {
4745
4767
  background: brand[3],
@@ -4941,7 +4963,7 @@ function ShadowCanvasOverlay({
4941
4963
  canvasTitle,
4942
4964
  displayMode = "standard"
4943
4965
  }) {
4944
- var _a2, _b, _c, _d, _e;
4966
+ var _a2, _b, _c, _d;
4945
4967
  const [mounted, setMounted] = useState5(false);
4946
4968
  const [launcherPos, setLauncherPos] = useState5(null);
4947
4969
  const dragRef = useRef5(null);
@@ -5063,7 +5085,7 @@ function ShadowCanvasOverlay({
5063
5085
  }
5064
5086
  }, []);
5065
5087
  const onLauncherPointerUp = useCallback4(
5066
- (_e2) => {
5088
+ (_e) => {
5067
5089
  const drag = dragRef.current;
5068
5090
  dragRef.current = null;
5069
5091
  if (drag && !drag.dragged) {
@@ -5075,17 +5097,20 @@ function ShadowCanvasOverlay({
5075
5097
  const isFocused = displayMode === "focused";
5076
5098
  const isRight = config.canvas.position === "right";
5077
5099
  const isPush = config.canvas.layout === "push";
5100
+ const canvasBorder = (_b = config.canvas.border) != null ? _b : "none";
5078
5101
  const containerRef = useRef5(null);
5079
5102
  const zIndex = 2147483600;
5080
5103
  useEffect7(() => {
5081
- var _a3, _b2;
5104
+ var _a3, _b2, _c2, _d2;
5082
5105
  if (!isPush) return;
5083
5106
  const root = document.documentElement;
5084
5107
  const prop = isRight ? "marginRight" : "marginLeft";
5108
+ const duration = (_a3 = config.canvas.transitionDuration) != null ? _a3 : "300ms";
5109
+ const easing = (_b2 = config.canvas.transitionEasing) != null ? _b2 : "cubic-bezier(0.16, 1, 0.3, 1)";
5085
5110
  const prevTransition = root.style.transition;
5086
- root.style.transition = `${prop} 340ms cubic-bezier(0.16, 1, 0.3, 1)`;
5111
+ root.style.transition = `${prop} ${duration} ${easing}`;
5087
5112
  if (isOpen) {
5088
- const width = (_b2 = (_a3 = containerRef.current) == null ? void 0 : _a3.offsetWidth) != null ? _b2 : 380;
5113
+ const width = (_d2 = (_c2 = containerRef.current) == null ? void 0 : _c2.offsetWidth) != null ? _d2 : 380;
5089
5114
  root.style[prop] = `${width}px`;
5090
5115
  } else {
5091
5116
  root.style[prop] = "0px";
@@ -5094,7 +5119,7 @@ function ShadowCanvasOverlay({
5094
5119
  root.style[prop] = "";
5095
5120
  root.style.transition = prevTransition;
5096
5121
  };
5097
- }, [isPush, isOpen, isRight]);
5122
+ }, [isPush, isOpen, isRight, config.canvas.transitionDuration, config.canvas.transitionEasing]);
5098
5123
  useEffect7(() => {
5099
5124
  if (!isPush || !isOpen) return;
5100
5125
  const container = containerRef.current;
@@ -5115,19 +5140,31 @@ function ShadowCanvasOverlay({
5115
5140
  maxHeight: "100%",
5116
5141
  pointerEvents: "auto",
5117
5142
  opacity: isOpen ? 1 : 0,
5118
- transition: isOpen ? "transform 340ms cubic-bezier(0.16, 1, 0.3, 1), opacity 280ms ease-out" : "transform 280ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease-in",
5143
+ transition: (() => {
5144
+ var _a3, _b2;
5145
+ const dur = (_a3 = config.canvas.transitionDuration) != null ? _a3 : "300ms";
5146
+ const ease = (_b2 = config.canvas.transitionEasing) != null ? _b2 : "cubic-bezier(0.16, 1, 0.3, 1)";
5147
+ return isOpen ? `transform ${dur} ${ease}, opacity ${dur} ease-out` : `transform ${dur} ${ease}, opacity ${dur} ease-in`;
5148
+ })(),
5119
5149
  color: "var(--sc-overlay-text-color)",
5120
- // Standard mode: no tint, just blur with a tight fade mask at the leading edge
5121
- // Focused mode: full frosted glass
5122
- background: isFocused ? "var(--sc-canvas-background)" : "var(--sc-canvas-background, transparent)",
5123
- backdropFilter: isFocused ? `${(_b = config.canvas.blur) != null ? _b : "blur(24px)"} saturate(1.2)` : "blur(6px)",
5124
- WebkitBackdropFilter: isFocused ? `${(_c = config.canvas.blur) != null ? _c : "blur(24px)"} saturate(1.2)` : "blur(6px)",
5125
- // Tight fade mask so blur cuts off sharply at the leading edge
5126
- ...!isFocused ? {
5127
- maskImage: isRight ? "linear-gradient(to right, transparent, black 6%)" : "linear-gradient(to left, transparent, black 6%)",
5128
- WebkitMaskImage: isRight ? "linear-gradient(to right, transparent, black 6%)" : "linear-gradient(to left, transparent, black 6%)"
5129
- } : {},
5130
- border: "none",
5150
+ background: "var(--sc-canvas-background)",
5151
+ // Standard mode: config blur only. Focused mode: config blur + saturate boost.
5152
+ ...(() => {
5153
+ var _a3;
5154
+ const blur = (_a3 = config.canvas.blur) != null ? _a3 : "blur(24px)";
5155
+ const filter = isFocused && blur !== "none" ? `${blur} saturate(1.2)` : blur;
5156
+ return { backdropFilter: filter, WebkitBackdropFilter: filter };
5157
+ })(),
5158
+ // Tight fade mask so blur cuts off sharply at the leading edge.
5159
+ // Disabled when a visible border is configured (mask would fade the border).
5160
+ ...(() => {
5161
+ var _a3;
5162
+ if (isFocused || canvasBorder && canvasBorder !== "none") return {};
5163
+ const fade = (_a3 = config.canvas.transitionFade) != null ? _a3 : "6%";
5164
+ const mask = isRight ? `linear-gradient(to right, transparent, black ${fade})` : `linear-gradient(to left, transparent, black ${fade})`;
5165
+ return { maskImage: mask, WebkitMaskImage: mask };
5166
+ })(),
5167
+ border: canvasBorder,
5131
5168
  borderRadius: "var(--sc-overlay-border-radius, 0)",
5132
5169
  boxShadow: "none",
5133
5170
  // Transform logic
@@ -5256,7 +5293,7 @@ function ShadowCanvasOverlay({
5256
5293
  notifications,
5257
5294
  onDismiss: dismissNotification,
5258
5295
  onClickNotification: handleNotificationClick,
5259
- position: (_d = config.canvas.position) != null ? _d : "right"
5296
+ position: (_c = config.canvas.position) != null ? _c : "right"
5260
5297
  }
5261
5298
  ),
5262
5299
  /* @__PURE__ */ jsxs3(
@@ -5286,7 +5323,7 @@ function ShadowCanvasOverlay({
5286
5323
  padding: 0,
5287
5324
  border: "none",
5288
5325
  backgroundColor: "var(--sc-launcher-background)",
5289
- cursor: ((_e = dragRef.current) == null ? void 0 : _e.dragged) ? "grabbing" : "pointer",
5326
+ cursor: ((_d = dragRef.current) == null ? void 0 : _d.dragged) ? "grabbing" : "pointer",
5290
5327
  touchAction: "none"
5291
5328
  },
5292
5329
  onPointerDown: onLauncherPointerDown,
@@ -5413,7 +5450,7 @@ function ShadowCanvasOverlay({
5413
5450
  ),
5414
5451
  portalRoot
5415
5452
  ),
5416
- isOpen ? createPortal(content, portalRoot) : null
5453
+ createPortal(content, portalRoot)
5417
5454
  ] });
5418
5455
  }
5419
5456
 
@@ -5667,6 +5704,7 @@ function SmartCanvasAppInner({
5667
5704
  }, [controller, hasContent, configState.isLoading]);
5668
5705
  const batchHandleRef = useRef7(initialBatchHandle != null ? initialBatchHandle : null);
5669
5706
  const adoptedInitialRef = useRef7(!!initialBatchHandle);
5707
+ const runVersionRef = useRef7(0);
5670
5708
  useEffect9(() => {
5671
5709
  if (!(runtime3 == null ? void 0 : runtime3.actions)) return;
5672
5710
  if (adoptedInitialRef.current) {
@@ -5675,7 +5713,8 @@ function SmartCanvasAppInner({
5675
5713
  }
5676
5714
  return;
5677
5715
  }
5678
- let cancelled = false;
5716
+ const version = ++runVersionRef.current;
5717
+ const stale = () => version !== runVersionRef.current;
5679
5718
  const run = async () => {
5680
5719
  if (batchHandleRef.current) {
5681
5720
  try {
@@ -5685,17 +5724,17 @@ function SmartCanvasAppInner({
5685
5724
  }
5686
5725
  batchHandleRef.current = null;
5687
5726
  }
5688
- if (cancelled) return;
5727
+ if (stale()) return;
5689
5728
  if (configState.actions.length > 0) {
5690
5729
  try {
5691
5730
  const handle = await runtime3.actions.applyBatch(configState.actions);
5692
- if (cancelled) {
5731
+ if (stale()) {
5693
5732
  await handle.revertAll();
5694
5733
  } else {
5695
5734
  batchHandleRef.current = handle;
5696
5735
  }
5697
5736
  } catch (err) {
5698
- if (!cancelled) {
5737
+ if (!stale()) {
5699
5738
  console.error("[SmartCanvasApp] Failed to apply actions:", err);
5700
5739
  }
5701
5740
  }
@@ -5703,7 +5742,6 @@ function SmartCanvasAppInner({
5703
5742
  };
5704
5743
  run();
5705
5744
  return () => {
5706
- cancelled = true;
5707
5745
  if (batchHandleRef.current) {
5708
5746
  batchHandleRef.current.revertAll().catch((err) => {
5709
5747
  console.error("[SmartCanvasApp] Failed to revert actions on cleanup:", err);
@@ -8682,7 +8720,7 @@ function evaluateCondition(condition, evalContext) {
8682
8720
  switch (condition.type) {
8683
8721
  case "page_url": {
8684
8722
  const { url } = condition;
8685
- const currentUrl = context.page.url;
8723
+ const currentUrl = context.page.url.split("?")[0].split("#")[0];
8686
8724
  const pattern = url.replace(/\*\*/g, "\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^/]*").replace(/\0GLOBSTAR\0/g, ".*");
8687
8725
  const regex = new RegExp(`^${pattern}$`);
8688
8726
  return regex.test(currentUrl);
@@ -10358,7 +10396,7 @@ function matchesRouteFilter(url, filter) {
10358
10396
  function matchRoutePattern(pathname, pattern) {
10359
10397
  const normalizedPattern = pattern.replace(/\/$/, "") || "/";
10360
10398
  if (pathname === normalizedPattern) return true;
10361
- const regexPattern = normalizedPattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*\*/g, ".*").replace(/\*/g, "[^/]*").replace(/:[^/]+/g, "[^/]+");
10399
+ const regexPattern = normalizedPattern.replace(/\*\*/g, "\0GLOBSTAR\0").replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^/]*").replace(/\0GLOBSTAR\0/g, ".*").replace(/:[^/]+/g, "[^/]+");
10362
10400
  const regex = new RegExp(`^${regexPattern}$`);
10363
10401
  return regex.test(pathname);
10364
10402
  }
@@ -11249,4 +11287,4 @@ export {
11249
11287
  encodeToken,
11250
11288
  Syntro
11251
11289
  };
11252
- //# sourceMappingURL=chunk-LD22WJ44.js.map
11290
+ //# sourceMappingURL=chunk-2WDY7YGN.js.map