@syntrologie/adapt-nav 2.2.0-canary.8 → 2.2.0
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/NavWidget.js +1 -1
- package/dist/cdn.d.ts +1 -6
- package/dist/cdn.d.ts.map +1 -1
- package/dist/cdn.js +1 -21
- package/dist/editor.js +2 -2
- package/dist/runtime.d.ts +16 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +41 -1
- package/dist/schema.d.ts +417 -33
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +8 -3
- package/dist/types.d.ts +4 -2
- package/dist/types.d.ts.map +1 -1
- package/node_modules/@syntro/design-system/dist/tailwind-preset.d.ts.map +1 -1
- package/node_modules/@syntro/design-system/dist/tailwind-preset.js +23 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/BeforeAfterToggle.test.js +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ConditionStatusLine.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ConditionStatusLine.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ConditionStatusLine.test.js +158 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DismissedSection.test.js +6 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorCard.test.js +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorHeader.test.js +4 -5
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorPanelShell.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorPanelShell.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorPanelShell.test.js +25 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ElementHighlight.test.js +22 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/TriggerJourney.test.js +77 -14
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/formatConditionLabel.test.js +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.d.ts +1 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.d.ts.map +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.js +4 -4
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.d.ts.map +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.js +4 -4
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.js +5 -5
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.js +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.d.ts.map +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.js +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.d.ts.map +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.js +10 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.d.ts.map +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.js +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.d.ts +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.d.ts.map +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.js +5 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.d.ts.map +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.js +4 -4
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.d.ts +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.d.ts.map +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.js +5 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.d.ts +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.d.ts.map +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.js +6 -4
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.d.ts.map +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.js +24 -12
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.d.ts.map +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.js +4 -4
- package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts.map +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.js +12 -20
- package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts.map +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/NavWidget.js
CHANGED
|
@@ -303,7 +303,7 @@ export function NavWidget({ config, runtime, instanceId }) {
|
|
|
303
303
|
const hasCategories = useMemo(() => visibleTips.some((t) => t.config.category), [visibleTips]);
|
|
304
304
|
// Resolve theme (auto → detect system preference)
|
|
305
305
|
const resolvedTheme = useMemo(() => {
|
|
306
|
-
if (config.theme !== 'auto')
|
|
306
|
+
if (config.theme && config.theme !== 'auto')
|
|
307
307
|
return config.theme;
|
|
308
308
|
if (typeof window !== 'undefined') {
|
|
309
309
|
return window.matchMedia?.('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
package/dist/cdn.d.ts
CHANGED
|
@@ -33,12 +33,7 @@ export declare const manifest: {
|
|
|
33
33
|
icon: string;
|
|
34
34
|
};
|
|
35
35
|
}[];
|
|
36
|
-
|
|
37
|
-
* Extract notify watcher entries from tile config props.
|
|
38
|
-
* The runtime evaluates these continuously (even with drawer closed)
|
|
39
|
-
* and publishes nav:tip_revealed when showWhen transitions false → true.
|
|
40
|
-
*/
|
|
41
|
-
notifyWatchers(props: Record<string, unknown>): {
|
|
36
|
+
notifyWatchers: (props: Record<string, unknown>) => {
|
|
42
37
|
id: string;
|
|
43
38
|
strategy: import("./types").DecisionStrategy<boolean>;
|
|
44
39
|
eventName: string;
|
package/dist/cdn.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdn.d.ts","sourceRoot":"","sources":["../src/cdn.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,SAA0B,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"cdn.d.ts","sourceRoot":"","sources":["../src/cdn.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,SAA0B,MAAM,UAAU,CAAC;AAGlD;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;2BAsC07Z,CAAC;8BAA8B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAtBp9Z,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;CAQjD,CAAC;AAaF,eAAe,QAAQ,CAAC"}
|
package/dist/cdn.js
CHANGED
|
@@ -21,27 +21,7 @@ export const manifest = {
|
|
|
21
21
|
executor,
|
|
22
22
|
})),
|
|
23
23
|
widgets: runtime.widgets,
|
|
24
|
-
|
|
25
|
-
* Extract notify watcher entries from tile config props.
|
|
26
|
-
* The runtime evaluates these continuously (even with drawer closed)
|
|
27
|
-
* and publishes nav:tip_revealed when showWhen transitions false → true.
|
|
28
|
-
*/
|
|
29
|
-
notifyWatchers(props) {
|
|
30
|
-
const actions = (props.actions ?? []);
|
|
31
|
-
return actions
|
|
32
|
-
.filter((a) => a.notify && a.showWhen)
|
|
33
|
-
.map((a) => ({
|
|
34
|
-
id: `nav:${a.config.id}`,
|
|
35
|
-
strategy: a.showWhen,
|
|
36
|
-
eventName: 'nav:tip_revealed',
|
|
37
|
-
eventProps: {
|
|
38
|
-
tipId: a.config.id,
|
|
39
|
-
title: a.notify.title,
|
|
40
|
-
body: a.notify.body,
|
|
41
|
-
icon: a.notify.icon,
|
|
42
|
-
},
|
|
43
|
-
}));
|
|
44
|
-
},
|
|
24
|
+
notifyWatchers: runtime.notifyWatchers,
|
|
45
25
|
},
|
|
46
26
|
editor: {
|
|
47
27
|
component: NavEditor,
|
package/dist/editor.js
CHANGED
|
@@ -124,7 +124,7 @@ export function NavEditor({ config, onChange, editor }) {
|
|
|
124
124
|
const typedConfig = config;
|
|
125
125
|
const [dismissedKeys, setDismissedKeys] = useState(() => editor.getDismissedKeys?.() ?? new Set());
|
|
126
126
|
const [editingKey, setEditingKey] = useState(null);
|
|
127
|
-
const [
|
|
127
|
+
const [_previewMode, setPreviewMode] = useState('after');
|
|
128
128
|
const [_hoveredKey, setHoveredKey] = useState(null);
|
|
129
129
|
// Sync dismissed keys back to navigation context on every change
|
|
130
130
|
useEffect(() => {
|
|
@@ -209,7 +209,7 @@ export function NavEditor({ config, onChange, editor }) {
|
|
|
209
209
|
editor.setBackHandler?.(editingKey !== null ? handleBackToList : null);
|
|
210
210
|
return () => editor.setBackHandler?.(null);
|
|
211
211
|
}, [editingKey, handleBackToList, editor]);
|
|
212
|
-
const
|
|
212
|
+
const _handleBeforeAfter = useCallback((mode) => {
|
|
213
213
|
setPreviewMode(mode);
|
|
214
214
|
if (mode === 'before') {
|
|
215
215
|
const filtered = filterConfig(typedConfig, new Set([editingKey]));
|
package/dist/runtime.d.ts
CHANGED
|
@@ -64,6 +64,22 @@ export declare const runtime: {
|
|
|
64
64
|
icon: string;
|
|
65
65
|
};
|
|
66
66
|
}[];
|
|
67
|
+
/**
|
|
68
|
+
* Extract notify watcher entries from tile config props.
|
|
69
|
+
* The runtime evaluates these continuously (even with drawer closed)
|
|
70
|
+
* and publishes nav:tip_revealed when showWhen transitions false → true.
|
|
71
|
+
*/
|
|
72
|
+
notifyWatchers(props: Record<string, unknown>): {
|
|
73
|
+
id: string;
|
|
74
|
+
strategy: import("./types").DecisionStrategy<boolean>;
|
|
75
|
+
eventName: string;
|
|
76
|
+
eventProps: {
|
|
77
|
+
tipId: string;
|
|
78
|
+
title: string | undefined;
|
|
79
|
+
body: string | undefined;
|
|
80
|
+
icon: string | undefined;
|
|
81
|
+
};
|
|
82
|
+
}[];
|
|
67
83
|
};
|
|
68
84
|
export default runtime;
|
|
69
85
|
//# sourceMappingURL=runtime.d.ts.map
|
package/dist/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EACV,cAAc,EAEd,cAAc,EAEd,cAAc,EACf,MAAM,SAAS,CAAC;AAMjB;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,cAAc,CA4B1D,CAAC;AAgBF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,cAAc,CAoC1D,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,SAAS;;;;;;EAGZ,CAAC;AAMX;;;;;;GAMG;AACH,eAAO,MAAM,OAAO;;;;;IAMlB;;OAEG;;;;;;;;IAGH;;OAEG;;;;;uBAqCu1S,CAAC;0BAA8B,CAAC;;;;;;;;;IAxB13S;;;;OAIG;0BACmB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;CAgB9C,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/dist/runtime.js
CHANGED
|
@@ -35,6 +35,20 @@ export const executeScrollTo = async (action, context) => {
|
|
|
35
35
|
},
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
|
+
/**
|
|
39
|
+
* Check if a URL is same-origin as the current page.
|
|
40
|
+
* Relative URLs (e.g. "/dashboard") are always same-origin.
|
|
41
|
+
*/
|
|
42
|
+
function isSameOrigin(url) {
|
|
43
|
+
try {
|
|
44
|
+
const parsed = new URL(url, window.location.origin);
|
|
45
|
+
return parsed.origin === window.location.origin;
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
// If URL parsing fails, fall back to full navigation
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
38
52
|
/**
|
|
39
53
|
* Execute a navigate action
|
|
40
54
|
*/
|
|
@@ -55,8 +69,13 @@ export const executeNavigate = async (action, context) => {
|
|
|
55
69
|
// Open in new tab
|
|
56
70
|
window.open(url, '_blank', 'noopener,noreferrer');
|
|
57
71
|
}
|
|
72
|
+
else if (!action.forceFullNavigation && isSameOrigin(url)) {
|
|
73
|
+
// SPA-aware: use pushState for same-origin URLs to avoid full page reload
|
|
74
|
+
window.history.pushState(null, '', url);
|
|
75
|
+
window.dispatchEvent(new PopStateEvent('popstate'));
|
|
76
|
+
}
|
|
58
77
|
else {
|
|
59
|
-
//
|
|
78
|
+
// Full navigation for cross-origin URLs or when explicitly requested
|
|
60
79
|
window.location.href = url;
|
|
61
80
|
}
|
|
62
81
|
return {
|
|
@@ -109,5 +128,26 @@ export const runtime = {
|
|
|
109
128
|
},
|
|
110
129
|
},
|
|
111
130
|
],
|
|
131
|
+
/**
|
|
132
|
+
* Extract notify watcher entries from tile config props.
|
|
133
|
+
* The runtime evaluates these continuously (even with drawer closed)
|
|
134
|
+
* and publishes nav:tip_revealed when showWhen transitions false → true.
|
|
135
|
+
*/
|
|
136
|
+
notifyWatchers(props) {
|
|
137
|
+
const actions = (props.actions ?? []);
|
|
138
|
+
return actions
|
|
139
|
+
.filter((a) => a.notify && a.showWhen)
|
|
140
|
+
.map((a) => ({
|
|
141
|
+
id: `nav:${a.config.id}`,
|
|
142
|
+
strategy: a.showWhen,
|
|
143
|
+
eventName: 'nav:tip_revealed',
|
|
144
|
+
eventProps: {
|
|
145
|
+
tipId: a.config.id,
|
|
146
|
+
title: a.notify.title,
|
|
147
|
+
body: a.notify.body,
|
|
148
|
+
icon: a.notify.icon,
|
|
149
|
+
},
|
|
150
|
+
}));
|
|
151
|
+
},
|
|
112
152
|
};
|
|
113
153
|
export default runtime;
|