@syntrologie/runtime-sdk 2.4.0-canary.21 → 2.4.0-canary.23

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.
@@ -2,6 +2,7 @@ import {
2
2
  CanvasConfigResponseZ,
3
3
  CanvasElementConfigZ,
4
4
  CanvasThemeConfigZ,
5
+ ContentElementConfigZ,
5
6
  LauncherConfigZ,
6
7
  LauncherElementConfigZ,
7
8
  NotificationDeepLinkZ,
@@ -11,12 +12,13 @@ import {
11
12
  TileNotificationRuleZ,
12
13
  TileZ,
13
14
  configSchemas
14
- } from "../chunk-2UYZ5DWI.js";
15
+ } from "../chunk-5SKKLUOS.js";
15
16
  import "../chunk-P5G4KT2U.js";
16
17
  export {
17
18
  CanvasConfigResponseZ,
18
19
  CanvasElementConfigZ,
19
20
  CanvasThemeConfigZ,
21
+ ContentElementConfigZ,
20
22
  LauncherConfigZ,
21
23
  LauncherElementConfigZ,
22
24
  NotificationDeepLinkZ,
@@ -10,6 +10,8 @@ export interface UseShadowCanvasConfigOptions {
10
10
  /** Current page URL — triggers re-filter when URL changes (route-based activation).
11
11
  * Full URL (not just pathname) so hash-based routing also triggers re-filter. */
12
12
  pageUrl?: string;
13
+ /** Polling interval in milliseconds. Set to 0 or omit to disable polling. */
14
+ pollIntervalMs?: number;
13
15
  }
14
16
  export interface ShadowCanvasConfigState {
15
17
  tiles: TileConfig[];
@@ -26,4 +28,4 @@ export interface ShadowCanvasConfigState {
26
28
  /** Launcher button configuration */
27
29
  launcher?: LauncherConfig;
28
30
  }
29
- export declare function useShadowCanvasConfig({ fetcher, experiments, runtime, pageUrl, }: UseShadowCanvasConfigOptions): ShadowCanvasConfigState;
31
+ export declare function useShadowCanvasConfig({ fetcher, experiments, runtime, pageUrl, pollIntervalMs, }: UseShadowCanvasConfigOptions): ShadowCanvasConfigState;
package/dist/index.js CHANGED
@@ -100,7 +100,7 @@ import {
100
100
  validateAction,
101
101
  validateActions,
102
102
  widgetRegistry
103
- } from "./chunk-IPU3WVPY.js";
103
+ } from "./chunk-FFIHKDHW.js";
104
104
  import {
105
105
  AddClassZ,
106
106
  AnchorIdZ,
@@ -134,8 +134,8 @@ import {
134
134
  WaitZ,
135
135
  WidgetConfigZ,
136
136
  coreActionStepSchemas
137
- } from "./chunk-HF3D7YFQ.js";
138
- import "./chunk-2UYZ5DWI.js";
137
+ } from "./chunk-MCX3AKSH.js";
138
+ import "./chunk-5SKKLUOS.js";
139
139
  import {
140
140
  ActivationConfigZ,
141
141
  AnchorVisibleConditionZ,
@@ -664,7 +664,7 @@ var baseStyles = {
664
664
  margin: "0 auto"
665
665
  },
666
666
  searchWrapper: {
667
- marginBottom: "16px"
667
+ marginBottom: "8px"
668
668
  },
669
669
  searchInput: {
670
670
  width: "100%",
@@ -677,22 +677,22 @@ var baseStyles = {
677
677
  accordion: {
678
678
  display: "flex",
679
679
  flexDirection: "column",
680
- gap: "8px"
680
+ gap: "var(--sc-content-item-gap, 6px)"
681
681
  },
682
682
  item: {
683
- borderRadius: "8px",
683
+ borderRadius: "var(--sc-content-border-radius, 8px)",
684
684
  overflow: "hidden",
685
685
  transition: "box-shadow 0.15s ease"
686
686
  },
687
687
  question: {
688
688
  width: "100%",
689
- padding: "16px 20px",
689
+ padding: "var(--sc-content-item-padding, 12px 16px)",
690
690
  display: "flex",
691
691
  alignItems: "center",
692
692
  justifyContent: "space-between",
693
693
  border: "none",
694
694
  cursor: "pointer",
695
- fontSize: "15px",
695
+ fontSize: "var(--sc-content-item-font-size, 15px)",
696
696
  fontWeight: 500,
697
697
  textAlign: "left",
698
698
  transition: "background-color 0.15s ease"
@@ -702,8 +702,8 @@ var baseStyles = {
702
702
  transition: "transform 0.2s ease"
703
703
  },
704
704
  answer: {
705
- padding: "0 20px 16px 20px",
706
- fontSize: "14px",
705
+ padding: "var(--sc-content-body-padding, 0 16px 12px 16px)",
706
+ fontSize: "var(--sc-content-body-font-size, 14px)",
707
707
  lineHeight: 1.6,
708
708
  overflow: "hidden",
709
709
  transition: "max-height 0.2s ease, padding 0.2s ease"
@@ -719,12 +719,12 @@ var baseStyles = {
719
719
  marginBottom: "8px"
720
720
  },
721
721
  categoryHeader: {
722
- fontSize: "13px",
722
+ fontSize: "var(--sc-content-category-font-size, 12px)",
723
723
  fontWeight: 700,
724
724
  textTransform: "uppercase",
725
725
  letterSpacing: "0.05em",
726
- padding: "12px 4px 6px 4px",
727
- marginTop: "8px"
726
+ padding: "var(--sc-content-category-padding, 8px 4px 4px 4px)",
727
+ marginTop: "var(--sc-content-category-gap, 4px)"
728
728
  },
729
729
  feedback: {
730
730
  display: "flex",
@@ -762,8 +762,8 @@ var baseStyles = {
762
762
  var themeStyles = {
763
763
  light: {
764
764
  container: {
765
- backgroundColor: base.white,
766
- color: slateGrey[1]
765
+ backgroundColor: "transparent",
766
+ color: "inherit"
767
767
  },
768
768
  searchInput: {
769
769
  backgroundColor: slateGrey[12],
@@ -771,21 +771,21 @@ var themeStyles = {
771
771
  color: slateGrey[1]
772
772
  },
773
773
  item: {
774
- backgroundColor: slateGrey[12],
775
- border: `1px solid ${slateGrey[11]}`
774
+ backgroundColor: "var(--sc-content-background)",
775
+ border: "var(--sc-content-border)"
776
776
  },
777
777
  itemExpanded: {
778
778
  boxShadow: "0 4px 12px rgba(0, 0, 0, 0.08)"
779
779
  },
780
780
  question: {
781
781
  backgroundColor: "transparent",
782
- color: slateGrey[1]
782
+ color: "var(--sc-content-text-color)"
783
783
  },
784
784
  questionHover: {
785
- backgroundColor: slateGrey[12]
785
+ backgroundColor: "var(--sc-content-background-hover)"
786
786
  },
787
787
  answer: {
788
- color: slateGrey[6]
788
+ color: "var(--sc-content-text-secondary-color)"
789
789
  },
790
790
  category: {
791
791
  backgroundColor: purple[8],
@@ -803,8 +803,8 @@ var themeStyles = {
803
803
  },
804
804
  dark: {
805
805
  container: {
806
- backgroundColor: slateGrey[1],
807
- color: slateGrey[12]
806
+ backgroundColor: "transparent",
807
+ color: "inherit"
808
808
  },
809
809
  searchInput: {
810
810
  backgroundColor: slateGrey[3],
@@ -812,21 +812,21 @@ var themeStyles = {
812
812
  color: slateGrey[12]
813
813
  },
814
814
  item: {
815
- backgroundColor: slateGrey[3],
816
- border: `1px solid ${slateGrey[5]}`
815
+ backgroundColor: "var(--sc-content-background)",
816
+ border: "var(--sc-content-border)"
817
817
  },
818
818
  itemExpanded: {
819
- boxShadow: "0 4px 12px rgba(0, 0, 0, 0.3)"
819
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)"
820
820
  },
821
821
  question: {
822
822
  backgroundColor: "transparent",
823
- color: slateGrey[12]
823
+ color: "var(--sc-content-text-color)"
824
824
  },
825
825
  questionHover: {
826
- backgroundColor: slateGrey[5]
826
+ backgroundColor: "var(--sc-content-background-hover)"
827
827
  },
828
828
  answer: {
829
- color: slateGrey[8]
829
+ color: "var(--sc-content-text-secondary-color)"
830
830
  },
831
831
  category: {
832
832
  backgroundColor: purple[0],
@@ -1212,18 +1212,17 @@ function escapeHtml(str) {
1212
1212
  }
1213
1213
  var baseStyles2 = {
1214
1214
  container: {
1215
- fontFamily: "system-ui, -apple-system, sans-serif",
1216
- padding: "8px",
1215
+ fontFamily: "var(--sc-font-family, system-ui, -apple-system, sans-serif)",
1217
1216
  maxWidth: "100%",
1218
1217
  overflow: "hidden"
1219
1218
  },
1220
1219
  accordion: {
1221
1220
  display: "flex",
1222
1221
  flexDirection: "column",
1223
- gap: "4px"
1222
+ gap: "var(--sc-content-item-gap, 6px)"
1224
1223
  },
1225
1224
  item: {
1226
- borderRadius: "8px",
1225
+ borderRadius: "var(--sc-content-border-radius, 8px)",
1227
1226
  overflow: "hidden",
1228
1227
  transition: "box-shadow 0.2s ease"
1229
1228
  },
@@ -1232,20 +1231,21 @@ var baseStyles2 = {
1232
1231
  alignItems: "center",
1233
1232
  gap: "8px",
1234
1233
  width: "100%",
1235
- padding: "12px 16px",
1234
+ padding: "var(--sc-content-item-padding, 12px 16px)",
1236
1235
  border: "none",
1237
1236
  cursor: "pointer",
1238
- fontSize: "14px",
1237
+ fontSize: "var(--sc-content-item-font-size, 15px)",
1239
1238
  fontWeight: 500,
1240
1239
  fontFamily: "inherit",
1241
1240
  textAlign: "left",
1242
1241
  transition: "background-color 0.15s ease"
1243
1242
  },
1244
1243
  chevron: {
1245
- fontSize: "10px",
1244
+ fontSize: "20px",
1246
1245
  transition: "transform 0.2s ease",
1247
1246
  marginLeft: "auto",
1248
- flexShrink: 0
1247
+ flexShrink: 0,
1248
+ color: "var(--sc-content-chevron-color, currentColor)"
1249
1249
  },
1250
1250
  icon: {
1251
1251
  fontSize: "16px",
@@ -1254,10 +1254,10 @@ var baseStyles2 = {
1254
1254
  body: {
1255
1255
  overflow: "hidden",
1256
1256
  transition: "max-height 0.25s ease, padding-bottom 0.25s ease",
1257
- padding: "0 16px"
1257
+ padding: "var(--sc-content-body-padding, 0 16px 12px 16px)"
1258
1258
  },
1259
1259
  description: {
1260
- fontSize: "13px",
1260
+ fontSize: "var(--sc-content-body-font-size, 14px)",
1261
1261
  lineHeight: "1.5",
1262
1262
  margin: 0
1263
1263
  },
@@ -1276,11 +1276,11 @@ var baseStyles2 = {
1276
1276
  transition: "background-color 0.15s ease"
1277
1277
  },
1278
1278
  categoryHeader: {
1279
- fontSize: "11px",
1279
+ fontSize: "var(--sc-content-category-font-size, 12px)",
1280
1280
  fontWeight: 600,
1281
1281
  textTransform: "uppercase",
1282
1282
  letterSpacing: "0.05em",
1283
- padding: "12px 4px 4px"
1283
+ padding: "var(--sc-content-category-padding, 8px 4px 4px 4px)"
1284
1284
  },
1285
1285
  emptyState: {
1286
1286
  fontSize: "13px",
@@ -1291,29 +1291,29 @@ var baseStyles2 = {
1291
1291
  var themeStyles2 = {
1292
1292
  light: {
1293
1293
  container: {
1294
- backgroundColor: base.white,
1295
- color: slateGrey[1]
1294
+ backgroundColor: "transparent",
1295
+ color: "inherit"
1296
1296
  },
1297
1297
  item: {
1298
- backgroundColor: slateGrey[12],
1299
- border: `1px solid ${slateGrey[11]}`
1298
+ backgroundColor: "var(--sc-content-background)",
1299
+ border: "var(--sc-content-border)"
1300
1300
  },
1301
1301
  itemExpanded: {
1302
1302
  boxShadow: "0 4px 12px rgba(0, 0, 0, 0.08)"
1303
1303
  },
1304
1304
  header: {
1305
1305
  backgroundColor: "transparent",
1306
- color: slateGrey[1]
1306
+ color: "var(--sc-content-text-color)"
1307
1307
  },
1308
1308
  headerHover: {
1309
- backgroundColor: slateGrey[12]
1309
+ backgroundColor: "var(--sc-content-background-hover)"
1310
1310
  },
1311
1311
  body: {
1312
- color: slateGrey[6]
1312
+ color: "var(--sc-content-text-secondary-color)"
1313
1313
  },
1314
1314
  linkButton: {
1315
- backgroundColor: purple[8],
1316
- color: purple[2]
1315
+ backgroundColor: "var(--sc-color-primary, #6366f1)",
1316
+ color: "#ffffff"
1317
1317
  },
1318
1318
  categoryHeader: {
1319
1319
  color: slateGrey[7]
@@ -1324,29 +1324,29 @@ var themeStyles2 = {
1324
1324
  },
1325
1325
  dark: {
1326
1326
  container: {
1327
- backgroundColor: slateGrey[1],
1328
- color: slateGrey[12]
1327
+ backgroundColor: "transparent",
1328
+ color: "inherit"
1329
1329
  },
1330
1330
  item: {
1331
- backgroundColor: slateGrey[3],
1332
- border: `1px solid ${slateGrey[5]}`
1331
+ backgroundColor: "var(--sc-content-background)",
1332
+ border: "var(--sc-content-border)"
1333
1333
  },
1334
1334
  itemExpanded: {
1335
- boxShadow: "0 4px 12px rgba(0, 0, 0, 0.3)"
1335
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)"
1336
1336
  },
1337
1337
  header: {
1338
1338
  backgroundColor: "transparent",
1339
- color: slateGrey[12]
1339
+ color: "var(--sc-content-text-color)"
1340
1340
  },
1341
1341
  headerHover: {
1342
- backgroundColor: slateGrey[5]
1342
+ backgroundColor: "var(--sc-content-background-hover)"
1343
1343
  },
1344
1344
  body: {
1345
- color: slateGrey[8]
1345
+ color: "var(--sc-content-text-secondary-color)"
1346
1346
  },
1347
1347
  linkButton: {
1348
- backgroundColor: purple[0],
1349
- color: purple[6]
1348
+ backgroundColor: "var(--sc-color-primary, #6366f1)",
1349
+ color: "#ffffff"
1350
1350
  },
1351
1351
  categoryHeader: {
1352
1352
  color: slateGrey[8]
@@ -1356,14 +1356,15 @@ var themeStyles2 = {
1356
1356
  }
1357
1357
  }
1358
1358
  };
1359
- function NavTipItem({ item, isExpanded, onToggle, onNavigate, theme }) {
1359
+ function NavTipItem({ item, isExpanded, isLast, onToggle, onNavigate, theme }) {
1360
1360
  const [isHovered, setIsHovered] = useState3(false);
1361
1361
  const colors = themeStyles2[theme];
1362
1362
  const { title, description, href, icon, external } = item.config;
1363
1363
  const itemStyle = {
1364
1364
  ...baseStyles2.item,
1365
1365
  ...colors.item,
1366
- ...isExpanded ? colors.itemExpanded : {}
1366
+ ...isExpanded ? colors.itemExpanded : {},
1367
+ ...!isLast ? { borderBottom: "var(--sc-content-item-divider, none)" } : {}
1367
1368
  };
1368
1369
  const headerStyle = {
1369
1370
  ...baseStyles2.header,
@@ -1372,7 +1373,7 @@ function NavTipItem({ item, isExpanded, onToggle, onNavigate, theme }) {
1372
1373
  };
1373
1374
  const chevronStyle = {
1374
1375
  ...baseStyles2.chevron,
1375
- transform: isExpanded ? "rotate(180deg)" : "rotate(0deg)"
1376
+ transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)"
1376
1377
  };
1377
1378
  const bodyStyle = {
1378
1379
  ...baseStyles2.body,
@@ -1387,7 +1388,7 @@ function NavTipItem({ item, isExpanded, onToggle, onNavigate, theme }) {
1387
1388
  onNavigate(href, external != null ? external : false);
1388
1389
  }
1389
1390
  };
1390
- return _jsxs3("div", { style: itemStyle, "data-nav-tip-id": item.config.id, children: [_jsxs3("button", { type: "button", style: headerStyle, onClick: onToggle, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), "aria-expanded": isExpanded, children: [icon && _jsx3("span", { style: baseStyles2.icon, children: icon }), _jsx3("span", { children: title }), _jsx3("span", { style: chevronStyle, children: "\u25BC" })] }), _jsxs3("div", { style: bodyStyle, "aria-hidden": !isExpanded, children: [_jsx3("p", { style: baseStyles2.description, children: description }), href && _jsxs3("a", { href, onClick: handleLinkClick, style: { ...baseStyles2.linkButton, ...colors.linkButton }, target: external ? "_blank" : void 0, rel: external ? "noopener noreferrer" : void 0, children: ["Go ", external ? "\u2197" : "\u2192"] })] })] });
1391
+ return _jsxs3("div", { style: itemStyle, "data-nav-tip-id": item.config.id, children: [_jsxs3("button", { type: "button", style: headerStyle, onClick: onToggle, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), "aria-expanded": isExpanded, children: [icon && _jsx3("span", { style: baseStyles2.icon, children: icon }), _jsx3("span", { children: title }), _jsx3("span", { style: chevronStyle, children: "\u203A" })] }), _jsxs3("div", { style: bodyStyle, "aria-hidden": !isExpanded, children: [_jsx3("p", { style: baseStyles2.description, children: description }), href && _jsxs3("a", { href, onClick: handleLinkClick, style: { ...baseStyles2.linkButton, ...colors.linkButton }, target: external ? "_blank" : void 0, rel: external ? "noopener noreferrer" : void 0, children: ["Go ", external ? "\u2197" : "\u2192"] })] })] });
1391
1392
  }
1392
1393
  function NavWidget({ config, runtime: runtime7, instanceId }) {
1393
1394
  const [renderTick, forceUpdate] = useReducer2((x) => x + 1, 0);
@@ -1501,7 +1502,7 @@ function NavWidget({ config, runtime: runtime7, instanceId }) {
1501
1502
  ...baseStyles2.emptyState,
1502
1503
  ...themeStyles2[resolvedTheme].emptyState
1503
1504
  };
1504
- const renderItems = (items) => items.map((tip) => _jsx3(NavTipItem, { item: tip, isExpanded: expandedIds.has(tip.config.id), onToggle: () => handleToggle(tip.config.id), onNavigate: handleNavigate, theme: resolvedTheme }, tip.config.id));
1505
+ const renderItems = (items) => items.map((tip, index) => _jsx3(NavTipItem, { item: tip, isExpanded: expandedIds.has(tip.config.id), isLast: index === items.length - 1, onToggle: () => handleToggle(tip.config.id), onNavigate: handleNavigate, theme: resolvedTheme }, tip.config.id));
1505
1506
  if (visibleTips.length === 0) {
1506
1507
  return _jsx3("div", { style: containerStyle, "data-adaptive-id": instanceId, "data-adaptive-type": "adaptive-nav", children: _jsx3("div", { style: emptyStateStyle, children: "No navigation tips available." }) });
1507
1508
  }