@syntrologie/runtime-sdk 2.4.0-canary.22 → 2.4.0-canary.24
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.d.ts +3603 -36279
- package/dist/actions/schema.js +3 -3
- package/dist/{chunk-P5G4KT2U.js → chunk-BU4Z6PD7.js} +9 -4
- package/dist/chunk-BU4Z6PD7.js.map +7 -0
- package/dist/{chunk-WCQCVPJ7.js → chunk-LD22WJ44.js} +440 -132
- package/dist/chunk-LD22WJ44.js.map +7 -0
- package/dist/{chunk-HF3D7YFQ.js → chunk-NM5Y27GX.js} +24 -26
- package/dist/chunk-NM5Y27GX.js.map +7 -0
- package/dist/{chunk-2UYZ5DWI.js → chunk-WILWIL6L.js} +43 -5
- package/dist/chunk-WILWIL6L.js.map +7 -0
- package/dist/components/ShadowCanvasOverlay.d.ts +2 -1
- package/dist/components/TileIcon.d.ts +14 -0
- package/dist/config/schema.d.ts +914 -3656
- package/dist/config/schema.js +4 -2
- package/dist/decisions/schema.d.ts +19 -1467
- package/dist/decisions/schema.js +3 -1
- package/dist/decisions/types.d.ts +2 -2
- package/dist/index.js +87 -94
- package/dist/index.js.map +2 -2
- package/dist/react.js +4 -4
- package/dist/smart-canvas.esm.js +105 -62
- package/dist/smart-canvas.esm.js.map +4 -4
- package/dist/smart-canvas.js +849 -295
- package/dist/smart-canvas.js.map +4 -4
- package/dist/smart-canvas.min.js +105 -62
- package/dist/smart-canvas.min.js.map +4 -4
- package/dist/theme/types.d.ts +2 -1
- package/dist/version.d.ts +1 -1
- package/dist/widgets/WidgetRegistry.d.ts +1 -0
- package/package.json +9 -8
- package/schema/canvas-config.schema.json +1346 -372
- package/dist/chunk-2UYZ5DWI.js.map +0 -7
- package/dist/chunk-HF3D7YFQ.js.map +0 -7
- package/dist/chunk-P5G4KT2U.js.map +0 -7
- package/dist/chunk-WCQCVPJ7.js.map +0 -7
package/dist/decisions/schema.js
CHANGED
|
@@ -20,12 +20,13 @@ import {
|
|
|
20
20
|
ScoreStrategyZ,
|
|
21
21
|
SessionMetricConditionZ,
|
|
22
22
|
StateEqualsConditionZ,
|
|
23
|
+
TriggerWhenZ,
|
|
23
24
|
ViewportConditionZ,
|
|
24
25
|
decisionSchemas,
|
|
25
26
|
validateActivationConfig,
|
|
26
27
|
validateCondition,
|
|
27
28
|
validateStrategy
|
|
28
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-BU4Z6PD7.js";
|
|
29
30
|
export {
|
|
30
31
|
ActivationConfigZ,
|
|
31
32
|
AnchorVisibleConditionZ,
|
|
@@ -48,6 +49,7 @@ export {
|
|
|
48
49
|
ScoreStrategyZ,
|
|
49
50
|
SessionMetricConditionZ,
|
|
50
51
|
StateEqualsConditionZ,
|
|
52
|
+
TriggerWhenZ,
|
|
51
53
|
ViewportConditionZ,
|
|
52
54
|
decisionSchemas,
|
|
53
55
|
validateActivationConfig,
|
|
@@ -256,8 +256,8 @@ export interface RouteFilter {
|
|
|
256
256
|
export interface ActivationConfig {
|
|
257
257
|
/** Route-based filtering */
|
|
258
258
|
routes?: RouteFilter;
|
|
259
|
-
/**
|
|
260
|
-
|
|
259
|
+
/** When true, tile is hidden if none of its props.actions[] have an active triggerWhen. Default: false. */
|
|
260
|
+
onlyIfPopulated?: boolean;
|
|
261
261
|
}
|
|
262
262
|
/**
|
|
263
263
|
* Extended context for strategy evaluation.
|
package/dist/index.js
CHANGED
|
@@ -100,7 +100,7 @@ import {
|
|
|
100
100
|
validateAction,
|
|
101
101
|
validateActions,
|
|
102
102
|
widgetRegistry
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-LD22WJ44.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-
|
|
138
|
-
import "./chunk-
|
|
137
|
+
} from "./chunk-NM5Y27GX.js";
|
|
138
|
+
import "./chunk-WILWIL6L.js";
|
|
139
139
|
import {
|
|
140
140
|
ActivationConfigZ,
|
|
141
141
|
AnchorVisibleConditionZ,
|
|
@@ -158,12 +158,13 @@ import {
|
|
|
158
158
|
ScoreStrategyZ,
|
|
159
159
|
SessionMetricConditionZ,
|
|
160
160
|
StateEqualsConditionZ,
|
|
161
|
+
TriggerWhenZ,
|
|
161
162
|
ViewportConditionZ,
|
|
162
163
|
decisionSchemas,
|
|
163
164
|
validateActivationConfig,
|
|
164
165
|
validateCondition,
|
|
165
166
|
validateStrategy
|
|
166
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-BU4Z6PD7.js";
|
|
167
168
|
|
|
168
169
|
// src/index.ts
|
|
169
170
|
import React4 from "react";
|
|
@@ -659,12 +660,12 @@ function getFeedbackPrompt(feedbackConfig) {
|
|
|
659
660
|
}
|
|
660
661
|
var baseStyles = {
|
|
661
662
|
container: {
|
|
662
|
-
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
663
|
+
fontFamily: "var(--sc-font-family, system-ui, -apple-system, sans-serif)",
|
|
663
664
|
maxWidth: "800px",
|
|
664
665
|
margin: "0 auto"
|
|
665
666
|
},
|
|
666
667
|
searchWrapper: {
|
|
667
|
-
marginBottom: "
|
|
668
|
+
marginBottom: "8px"
|
|
668
669
|
},
|
|
669
670
|
searchInput: {
|
|
670
671
|
width: "100%",
|
|
@@ -672,38 +673,41 @@ var baseStyles = {
|
|
|
672
673
|
borderRadius: "8px",
|
|
673
674
|
fontSize: "14px",
|
|
674
675
|
outline: "none",
|
|
675
|
-
transition: "border-color 0.15s ease"
|
|
676
|
+
transition: "border-color 0.15s ease",
|
|
677
|
+
backgroundColor: "var(--sc-content-search-background)",
|
|
678
|
+
color: "var(--sc-content-search-color)"
|
|
676
679
|
},
|
|
677
680
|
accordion: {
|
|
678
681
|
display: "flex",
|
|
679
682
|
flexDirection: "column",
|
|
680
|
-
gap: "
|
|
683
|
+
gap: "var(--sc-content-item-gap, 6px)"
|
|
681
684
|
},
|
|
682
685
|
item: {
|
|
683
|
-
borderRadius: "8px",
|
|
686
|
+
borderRadius: "var(--sc-content-border-radius, 8px)",
|
|
684
687
|
overflow: "hidden",
|
|
685
688
|
transition: "box-shadow 0.15s ease"
|
|
686
689
|
},
|
|
687
690
|
question: {
|
|
688
691
|
width: "100%",
|
|
689
|
-
padding: "16px
|
|
692
|
+
padding: "var(--sc-content-item-padding, 12px 16px)",
|
|
690
693
|
display: "flex",
|
|
691
694
|
alignItems: "center",
|
|
692
695
|
justifyContent: "space-between",
|
|
693
696
|
border: "none",
|
|
694
697
|
cursor: "pointer",
|
|
695
|
-
fontSize: "15px",
|
|
698
|
+
fontSize: "var(--sc-content-item-font-size, 15px)",
|
|
696
699
|
fontWeight: 500,
|
|
697
700
|
textAlign: "left",
|
|
698
701
|
transition: "background-color 0.15s ease"
|
|
699
702
|
},
|
|
700
703
|
chevron: {
|
|
701
|
-
fontSize: "
|
|
702
|
-
transition: "transform 0.2s ease"
|
|
704
|
+
fontSize: "20px",
|
|
705
|
+
transition: "transform 0.2s ease",
|
|
706
|
+
color: "var(--sc-content-chevron-color, currentColor)"
|
|
703
707
|
},
|
|
704
708
|
answer: {
|
|
705
|
-
padding: "0
|
|
706
|
-
fontSize: "14px",
|
|
709
|
+
padding: "var(--sc-content-body-padding, 0 16px 12px 16px)",
|
|
710
|
+
fontSize: "var(--sc-content-body-font-size, 14px)",
|
|
707
711
|
lineHeight: 1.6,
|
|
708
712
|
overflow: "hidden",
|
|
709
713
|
transition: "max-height 0.2s ease, padding 0.2s ease"
|
|
@@ -719,12 +723,12 @@ var baseStyles = {
|
|
|
719
723
|
marginBottom: "8px"
|
|
720
724
|
},
|
|
721
725
|
categoryHeader: {
|
|
722
|
-
fontSize: "
|
|
726
|
+
fontSize: "var(--sc-content-category-font-size, 12px)",
|
|
723
727
|
fontWeight: 700,
|
|
724
728
|
textTransform: "uppercase",
|
|
725
729
|
letterSpacing: "0.05em",
|
|
726
|
-
padding: "
|
|
727
|
-
marginTop: "
|
|
730
|
+
padding: "var(--sc-content-category-padding, 8px 4px 4px 4px)",
|
|
731
|
+
marginTop: "var(--sc-content-category-gap, 4px)"
|
|
728
732
|
},
|
|
729
733
|
feedback: {
|
|
730
734
|
display: "flex",
|
|
@@ -762,30 +766,28 @@ var baseStyles = {
|
|
|
762
766
|
var themeStyles = {
|
|
763
767
|
light: {
|
|
764
768
|
container: {
|
|
765
|
-
backgroundColor:
|
|
766
|
-
color:
|
|
769
|
+
backgroundColor: "transparent",
|
|
770
|
+
color: "inherit"
|
|
767
771
|
},
|
|
768
772
|
searchInput: {
|
|
769
|
-
|
|
770
|
-
border: `1px solid ${slateGrey[11]}`,
|
|
771
|
-
color: slateGrey[1]
|
|
773
|
+
border: `1px solid ${slateGrey[11]}`
|
|
772
774
|
},
|
|
773
775
|
item: {
|
|
774
|
-
backgroundColor:
|
|
775
|
-
border:
|
|
776
|
+
backgroundColor: "var(--sc-content-background)",
|
|
777
|
+
border: "var(--sc-content-border)"
|
|
776
778
|
},
|
|
777
779
|
itemExpanded: {
|
|
778
780
|
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.08)"
|
|
779
781
|
},
|
|
780
782
|
question: {
|
|
781
783
|
backgroundColor: "transparent",
|
|
782
|
-
color:
|
|
784
|
+
color: "var(--sc-content-text-color)"
|
|
783
785
|
},
|
|
784
786
|
questionHover: {
|
|
785
|
-
backgroundColor:
|
|
787
|
+
backgroundColor: "var(--sc-content-background-hover)"
|
|
786
788
|
},
|
|
787
789
|
answer: {
|
|
788
|
-
color:
|
|
790
|
+
color: "var(--sc-content-text-secondary-color)"
|
|
789
791
|
},
|
|
790
792
|
category: {
|
|
791
793
|
backgroundColor: purple[8],
|
|
@@ -803,30 +805,28 @@ var themeStyles = {
|
|
|
803
805
|
},
|
|
804
806
|
dark: {
|
|
805
807
|
container: {
|
|
806
|
-
backgroundColor:
|
|
807
|
-
color:
|
|
808
|
+
backgroundColor: "transparent",
|
|
809
|
+
color: "inherit"
|
|
808
810
|
},
|
|
809
811
|
searchInput: {
|
|
810
|
-
|
|
811
|
-
border: `1px solid ${slateGrey[5]}`,
|
|
812
|
-
color: slateGrey[12]
|
|
812
|
+
border: `1px solid ${slateGrey[5]}`
|
|
813
813
|
},
|
|
814
814
|
item: {
|
|
815
|
-
backgroundColor:
|
|
816
|
-
border:
|
|
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.
|
|
819
|
+
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)"
|
|
820
820
|
},
|
|
821
821
|
question: {
|
|
822
822
|
backgroundColor: "transparent",
|
|
823
|
-
color:
|
|
823
|
+
color: "var(--sc-content-text-color)"
|
|
824
824
|
},
|
|
825
825
|
questionHover: {
|
|
826
|
-
backgroundColor:
|
|
826
|
+
backgroundColor: "var(--sc-content-background-hover)"
|
|
827
827
|
},
|
|
828
828
|
answer: {
|
|
829
|
-
color:
|
|
829
|
+
color: "var(--sc-content-text-secondary-color)"
|
|
830
830
|
},
|
|
831
831
|
category: {
|
|
832
832
|
backgroundColor: purple[0],
|
|
@@ -843,7 +843,7 @@ var themeStyles = {
|
|
|
843
843
|
}
|
|
844
844
|
}
|
|
845
845
|
};
|
|
846
|
-
function FAQItem({ item, isExpanded, isHighlighted, onToggle, theme, feedbackConfig, feedbackValue, onFeedback }) {
|
|
846
|
+
function FAQItem({ item, isExpanded, isHighlighted, isLast, onToggle, theme, feedbackConfig, feedbackValue, onFeedback }) {
|
|
847
847
|
const [isHovered, setIsHovered] = useState2(false);
|
|
848
848
|
const colors = themeStyles[theme];
|
|
849
849
|
const { question, answer } = item.config;
|
|
@@ -854,7 +854,8 @@ function FAQItem({ item, isExpanded, isHighlighted, onToggle, theme, feedbackCon
|
|
|
854
854
|
...isHighlighted ? {
|
|
855
855
|
boxShadow: "0 0 0 2px #6366f1, 0 0 12px rgba(99, 102, 241, 0.4)",
|
|
856
856
|
transition: "box-shadow 0.3s ease"
|
|
857
|
-
} : {}
|
|
857
|
+
} : {},
|
|
858
|
+
...!isLast ? { borderBottom: "var(--sc-content-item-divider, none)" } : {}
|
|
858
859
|
};
|
|
859
860
|
const questionStyle = {
|
|
860
861
|
...baseStyles.question,
|
|
@@ -863,7 +864,7 @@ function FAQItem({ item, isExpanded, isHighlighted, onToggle, theme, feedbackCon
|
|
|
863
864
|
};
|
|
864
865
|
const chevronStyle = {
|
|
865
866
|
...baseStyles.chevron,
|
|
866
|
-
transform: isExpanded ? "rotate(
|
|
867
|
+
transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)"
|
|
867
868
|
};
|
|
868
869
|
const answerStyle = {
|
|
869
870
|
...baseStyles.answer,
|
|
@@ -875,7 +876,7 @@ function FAQItem({ item, isExpanded, isHighlighted, onToggle, theme, feedbackCon
|
|
|
875
876
|
...baseStyles.feedback,
|
|
876
877
|
...colors.feedbackPrompt
|
|
877
878
|
};
|
|
878
|
-
return _jsxs2("div", { style: itemStyle, "data-faq-item-id": item.config.id, children: [_jsxs2("button", { type: "button", style: questionStyle, onClick: onToggle, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), "aria-expanded": isExpanded, children: [_jsx2("span", { children: question }), _jsx2("span", { style: chevronStyle, children: "\
|
|
879
|
+
return _jsxs2("div", { style: itemStyle, "data-faq-item-id": item.config.id, children: [_jsxs2("button", { type: "button", style: questionStyle, onClick: onToggle, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), "aria-expanded": isExpanded, children: [_jsx2("span", { children: question }), _jsx2("span", { style: chevronStyle, children: "\u203A" })] }), _jsxs2("div", { style: answerStyle, "aria-hidden": !isExpanded, children: [renderAnswer(answer), isExpanded && feedbackConfig && _jsxs2("div", { style: feedbackStyle, children: [_jsx2("span", { children: getFeedbackPrompt(feedbackConfig) }), _jsx2("button", { type: "button", style: {
|
|
879
880
|
...baseStyles.feedbackButton,
|
|
880
881
|
...feedbackValue === "up" ? baseStyles.feedbackButtonSelected : {}
|
|
881
882
|
}, "aria-label": "Thumbs up", onClick: () => onFeedback(item.config.id, question, "up"), children: "\u{1F44D}" }), _jsx2("button", { type: "button", style: {
|
|
@@ -1070,11 +1071,11 @@ function FAQWidget({ config, runtime: runtime7, instanceId }) {
|
|
|
1070
1071
|
...baseStyles.categoryHeader,
|
|
1071
1072
|
...themeStyles[resolvedTheme].categoryHeader
|
|
1072
1073
|
};
|
|
1073
|
-
const renderItems = (items) => items.map((q) => _jsx2(FAQItem, { item: q, isExpanded: expandedIds.has(q.config.id), isHighlighted: highlightId === q.config.id, onToggle: () => handleToggle(q.config.id), theme: resolvedTheme, feedbackConfig, feedbackValue: feedbackState.get(q.config.id), onFeedback: handleFeedback }, q.config.id));
|
|
1074
|
+
const renderItems = (items) => items.map((q, index) => _jsx2(FAQItem, { item: q, isExpanded: expandedIds.has(q.config.id), isHighlighted: highlightId === q.config.id, isLast: index === items.length - 1, onToggle: () => handleToggle(q.config.id), theme: resolvedTheme, feedbackConfig, feedbackValue: feedbackState.get(q.config.id), onFeedback: handleFeedback }, q.config.id));
|
|
1074
1075
|
if (visibleQuestions.length === 0) {
|
|
1075
1076
|
return _jsx2("div", { style: containerStyle, "data-adaptive-id": instanceId, "data-adaptive-type": "adaptive-faq", children: _jsx2("div", { style: emptyStateStyle, children: "No FAQ questions available." }) });
|
|
1076
1077
|
}
|
|
1077
|
-
return _jsxs2("div", { style: containerStyle, "data-adaptive-id": instanceId, "data-adaptive-type": "adaptive-faq", children: [config.searchable &&
|
|
1078
|
+
return _jsxs2("div", { style: containerStyle, "data-adaptive-id": instanceId, "data-adaptive-type": "adaptive-faq", children: [config.searchable && _jsxs2("div", { style: baseStyles.searchWrapper, children: [_jsx2("style", { children: `[data-adaptive-id="${instanceId}"] input::placeholder { color: var(--sc-content-search-color, inherit); opacity: 0.7; }` }), _jsx2("input", { type: "text", placeholder: "Search questions...", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), style: searchInputStyle })] }), _jsx2("div", { style: baseStyles.accordion, children: hasCategories ? Array.from(categoryGroups.entries()).map(([category, items]) => _jsxs2(React2.Fragment, { children: [category && _jsx2("div", { style: categoryHeaderStyle, "data-category-header": category, children: category }), renderItems(items)] }, category != null ? category : "__ungrouped")) : renderItems(filteredQuestions) }), config.searchable && filteredQuestions.length === 0 && searchQuery && _jsxs2("div", { style: { ...baseStyles.noResults, ...themeStyles[resolvedTheme].emptyState }, children: ['No questions found matching "', searchQuery, '"'] })] });
|
|
1078
1079
|
}
|
|
1079
1080
|
var FAQMountableWidget = {
|
|
1080
1081
|
mount(container, config) {
|
|
@@ -1132,7 +1133,8 @@ var runtime4 = {
|
|
|
1132
1133
|
metadata: {
|
|
1133
1134
|
name: "FAQ Accordion",
|
|
1134
1135
|
description: "Collapsible Q&A accordion with search, categories, and feedback",
|
|
1135
|
-
icon: "\u2753"
|
|
1136
|
+
icon: "\u2753",
|
|
1137
|
+
subtitle: "Curated just for you."
|
|
1136
1138
|
}
|
|
1137
1139
|
}
|
|
1138
1140
|
],
|
|
@@ -1212,18 +1214,17 @@ function escapeHtml(str) {
|
|
|
1212
1214
|
}
|
|
1213
1215
|
var baseStyles2 = {
|
|
1214
1216
|
container: {
|
|
1215
|
-
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
1216
|
-
padding: "8px",
|
|
1217
|
+
fontFamily: "var(--sc-font-family, system-ui, -apple-system, sans-serif)",
|
|
1217
1218
|
maxWidth: "100%",
|
|
1218
1219
|
overflow: "hidden"
|
|
1219
1220
|
},
|
|
1220
1221
|
accordion: {
|
|
1221
1222
|
display: "flex",
|
|
1222
1223
|
flexDirection: "column",
|
|
1223
|
-
gap: "
|
|
1224
|
+
gap: "var(--sc-content-item-gap, 6px)"
|
|
1224
1225
|
},
|
|
1225
1226
|
item: {
|
|
1226
|
-
borderRadius: "8px",
|
|
1227
|
+
borderRadius: "var(--sc-content-border-radius, 8px)",
|
|
1227
1228
|
overflow: "hidden",
|
|
1228
1229
|
transition: "box-shadow 0.2s ease"
|
|
1229
1230
|
},
|
|
@@ -1232,20 +1233,21 @@ var baseStyles2 = {
|
|
|
1232
1233
|
alignItems: "center",
|
|
1233
1234
|
gap: "8px",
|
|
1234
1235
|
width: "100%",
|
|
1235
|
-
padding: "12px 16px",
|
|
1236
|
+
padding: "var(--sc-content-item-padding, 12px 16px)",
|
|
1236
1237
|
border: "none",
|
|
1237
1238
|
cursor: "pointer",
|
|
1238
|
-
fontSize: "
|
|
1239
|
+
fontSize: "var(--sc-content-item-font-size, 15px)",
|
|
1239
1240
|
fontWeight: 500,
|
|
1240
1241
|
fontFamily: "inherit",
|
|
1241
1242
|
textAlign: "left",
|
|
1242
1243
|
transition: "background-color 0.15s ease"
|
|
1243
1244
|
},
|
|
1244
1245
|
chevron: {
|
|
1245
|
-
fontSize: "
|
|
1246
|
+
fontSize: "20px",
|
|
1246
1247
|
transition: "transform 0.2s ease",
|
|
1247
1248
|
marginLeft: "auto",
|
|
1248
|
-
flexShrink: 0
|
|
1249
|
+
flexShrink: 0,
|
|
1250
|
+
color: "var(--sc-content-chevron-color, currentColor)"
|
|
1249
1251
|
},
|
|
1250
1252
|
icon: {
|
|
1251
1253
|
fontSize: "16px",
|
|
@@ -1254,10 +1256,10 @@ var baseStyles2 = {
|
|
|
1254
1256
|
body: {
|
|
1255
1257
|
overflow: "hidden",
|
|
1256
1258
|
transition: "max-height 0.25s ease, padding-bottom 0.25s ease",
|
|
1257
|
-
padding: "0 16px"
|
|
1259
|
+
padding: "var(--sc-content-body-padding, 0 16px 12px 16px)"
|
|
1258
1260
|
},
|
|
1259
1261
|
description: {
|
|
1260
|
-
fontSize: "
|
|
1262
|
+
fontSize: "var(--sc-content-body-font-size, 14px)",
|
|
1261
1263
|
lineHeight: "1.5",
|
|
1262
1264
|
margin: 0
|
|
1263
1265
|
},
|
|
@@ -1276,11 +1278,11 @@ var baseStyles2 = {
|
|
|
1276
1278
|
transition: "background-color 0.15s ease"
|
|
1277
1279
|
},
|
|
1278
1280
|
categoryHeader: {
|
|
1279
|
-
fontSize: "
|
|
1281
|
+
fontSize: "var(--sc-content-category-font-size, 12px)",
|
|
1280
1282
|
fontWeight: 600,
|
|
1281
1283
|
textTransform: "uppercase",
|
|
1282
1284
|
letterSpacing: "0.05em",
|
|
1283
|
-
padding: "
|
|
1285
|
+
padding: "var(--sc-content-category-padding, 8px 4px 4px 4px)"
|
|
1284
1286
|
},
|
|
1285
1287
|
emptyState: {
|
|
1286
1288
|
fontSize: "13px",
|
|
@@ -1291,29 +1293,29 @@ var baseStyles2 = {
|
|
|
1291
1293
|
var themeStyles2 = {
|
|
1292
1294
|
light: {
|
|
1293
1295
|
container: {
|
|
1294
|
-
backgroundColor:
|
|
1295
|
-
color:
|
|
1296
|
+
backgroundColor: "transparent",
|
|
1297
|
+
color: "inherit"
|
|
1296
1298
|
},
|
|
1297
1299
|
item: {
|
|
1298
|
-
backgroundColor:
|
|
1299
|
-
border:
|
|
1300
|
+
backgroundColor: "var(--sc-content-background)",
|
|
1301
|
+
border: "var(--sc-content-border)"
|
|
1300
1302
|
},
|
|
1301
1303
|
itemExpanded: {
|
|
1302
1304
|
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.08)"
|
|
1303
1305
|
},
|
|
1304
1306
|
header: {
|
|
1305
1307
|
backgroundColor: "transparent",
|
|
1306
|
-
color:
|
|
1308
|
+
color: "var(--sc-content-text-color)"
|
|
1307
1309
|
},
|
|
1308
1310
|
headerHover: {
|
|
1309
|
-
backgroundColor:
|
|
1311
|
+
backgroundColor: "var(--sc-content-background-hover)"
|
|
1310
1312
|
},
|
|
1311
1313
|
body: {
|
|
1312
|
-
color:
|
|
1314
|
+
color: "var(--sc-content-text-secondary-color)"
|
|
1313
1315
|
},
|
|
1314
1316
|
linkButton: {
|
|
1315
|
-
backgroundColor:
|
|
1316
|
-
color:
|
|
1317
|
+
backgroundColor: "var(--sc-color-primary, #6366f1)",
|
|
1318
|
+
color: "#ffffff"
|
|
1317
1319
|
},
|
|
1318
1320
|
categoryHeader: {
|
|
1319
1321
|
color: slateGrey[7]
|
|
@@ -1324,29 +1326,29 @@ var themeStyles2 = {
|
|
|
1324
1326
|
},
|
|
1325
1327
|
dark: {
|
|
1326
1328
|
container: {
|
|
1327
|
-
backgroundColor:
|
|
1328
|
-
color:
|
|
1329
|
+
backgroundColor: "transparent",
|
|
1330
|
+
color: "inherit"
|
|
1329
1331
|
},
|
|
1330
1332
|
item: {
|
|
1331
|
-
backgroundColor:
|
|
1332
|
-
border:
|
|
1333
|
+
backgroundColor: "var(--sc-content-background)",
|
|
1334
|
+
border: "var(--sc-content-border)"
|
|
1333
1335
|
},
|
|
1334
1336
|
itemExpanded: {
|
|
1335
|
-
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.
|
|
1337
|
+
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)"
|
|
1336
1338
|
},
|
|
1337
1339
|
header: {
|
|
1338
1340
|
backgroundColor: "transparent",
|
|
1339
|
-
color:
|
|
1341
|
+
color: "var(--sc-content-text-color)"
|
|
1340
1342
|
},
|
|
1341
1343
|
headerHover: {
|
|
1342
|
-
backgroundColor:
|
|
1344
|
+
backgroundColor: "var(--sc-content-background-hover)"
|
|
1343
1345
|
},
|
|
1344
1346
|
body: {
|
|
1345
|
-
color:
|
|
1347
|
+
color: "var(--sc-content-text-secondary-color)"
|
|
1346
1348
|
},
|
|
1347
1349
|
linkButton: {
|
|
1348
|
-
backgroundColor:
|
|
1349
|
-
color:
|
|
1350
|
+
backgroundColor: "var(--sc-color-primary, #6366f1)",
|
|
1351
|
+
color: "#ffffff"
|
|
1350
1352
|
},
|
|
1351
1353
|
categoryHeader: {
|
|
1352
1354
|
color: slateGrey[8]
|
|
@@ -1356,14 +1358,15 @@ var themeStyles2 = {
|
|
|
1356
1358
|
}
|
|
1357
1359
|
}
|
|
1358
1360
|
};
|
|
1359
|
-
function NavTipItem({ item, isExpanded, onToggle, onNavigate, theme }) {
|
|
1361
|
+
function NavTipItem({ item, isExpanded, isLast, onToggle, onNavigate, theme }) {
|
|
1360
1362
|
const [isHovered, setIsHovered] = useState3(false);
|
|
1361
1363
|
const colors = themeStyles2[theme];
|
|
1362
1364
|
const { title, description, href, icon, external } = item.config;
|
|
1363
1365
|
const itemStyle = {
|
|
1364
1366
|
...baseStyles2.item,
|
|
1365
1367
|
...colors.item,
|
|
1366
|
-
...isExpanded ? colors.itemExpanded : {}
|
|
1368
|
+
...isExpanded ? colors.itemExpanded : {},
|
|
1369
|
+
...!isLast ? { borderBottom: "var(--sc-content-item-divider, none)" } : {}
|
|
1367
1370
|
};
|
|
1368
1371
|
const headerStyle = {
|
|
1369
1372
|
...baseStyles2.header,
|
|
@@ -1372,7 +1375,7 @@ function NavTipItem({ item, isExpanded, onToggle, onNavigate, theme }) {
|
|
|
1372
1375
|
};
|
|
1373
1376
|
const chevronStyle = {
|
|
1374
1377
|
...baseStyles2.chevron,
|
|
1375
|
-
transform: isExpanded ? "rotate(
|
|
1378
|
+
transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)"
|
|
1376
1379
|
};
|
|
1377
1380
|
const bodyStyle = {
|
|
1378
1381
|
...baseStyles2.body,
|
|
@@ -1387,7 +1390,7 @@ function NavTipItem({ item, isExpanded, onToggle, onNavigate, theme }) {
|
|
|
1387
1390
|
onNavigate(href, external != null ? external : false);
|
|
1388
1391
|
}
|
|
1389
1392
|
};
|
|
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: "\
|
|
1393
|
+
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
1394
|
}
|
|
1392
1395
|
function NavWidget({ config, runtime: runtime7, instanceId }) {
|
|
1393
1396
|
const [renderTick, forceUpdate] = useReducer2((x) => x + 1, 0);
|
|
@@ -1501,7 +1504,7 @@ function NavWidget({ config, runtime: runtime7, instanceId }) {
|
|
|
1501
1504
|
...baseStyles2.emptyState,
|
|
1502
1505
|
...themeStyles2[resolvedTheme].emptyState
|
|
1503
1506
|
};
|
|
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));
|
|
1507
|
+
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
1508
|
if (visibleTips.length === 0) {
|
|
1506
1509
|
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
1510
|
}
|
|
@@ -1830,18 +1833,7 @@ function migrateV1ToV2(config) {
|
|
|
1830
1833
|
if (config.tiles && Array.isArray(config.tiles)) {
|
|
1831
1834
|
migrated.tiles = config.tiles.map((tile) => {
|
|
1832
1835
|
const migratedTile = { ...tile };
|
|
1833
|
-
if (tile.experiment
|
|
1834
|
-
const exp = tile.experiment;
|
|
1835
|
-
if (exp.featureKey) {
|
|
1836
|
-
migratedTile.activation = {
|
|
1837
|
-
strategy: {
|
|
1838
|
-
type: "external",
|
|
1839
|
-
provider: "growthbook",
|
|
1840
|
-
featureKey: exp.featureKey,
|
|
1841
|
-
fallback: false
|
|
1842
|
-
}
|
|
1843
|
-
};
|
|
1844
|
-
}
|
|
1836
|
+
if (tile.experiment) {
|
|
1845
1837
|
delete migratedTile.experiment;
|
|
1846
1838
|
}
|
|
1847
1839
|
return migratedTile;
|
|
@@ -2149,6 +2141,7 @@ export {
|
|
|
2149
2141
|
TooltipZ,
|
|
2150
2142
|
TourStepForSchemaZ,
|
|
2151
2143
|
TourZ,
|
|
2144
|
+
TriggerWhenZ,
|
|
2152
2145
|
ViewportConditionZ,
|
|
2153
2146
|
ViewportContextZ,
|
|
2154
2147
|
WaitZ,
|