@syntrologie/adapt-nav 2.4.0 → 2.5.1
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.d.ts +3 -3
- package/dist/NavWidget.d.ts.map +1 -1
- package/dist/NavWidget.js +47 -81
- package/dist/cdn.d.ts.map +1 -1
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +50 -20
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +5 -4
- package/dist/schema.d.ts +554 -95
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +6 -8
- package/dist/summarize.d.ts +2 -2
- package/dist/summarize.d.ts.map +1 -1
- package/dist/summarize.js +5 -5
- package/dist/types.d.ts +7 -49
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/node_modules/@syntrologie/sdk-contracts/dist/index.d.ts +105 -2
- package/node_modules/@syntrologie/sdk-contracts/dist/index.js +5 -3
- package/node_modules/@syntrologie/sdk-contracts/dist/schemas.d.ts +798 -1
- package/node_modules/@syntrologie/sdk-contracts/dist/schemas.js +21 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/AnchorPicker.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/AnchorPicker.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/AnchorPicker.test.js +224 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ConditionStatusLine.test.js +102 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DetectionBadge.test.js +58 -6
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DismissedSection.test.js +18 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorCard.test.js +61 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorPanelShell.test.js +478 -7
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ElementHighlight.test.js +54 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/selectorGenerator.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/selectorGenerator.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/selectorGenerator.test.js +257 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/useTriggerWhenStatus.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/useTriggerWhenStatus.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/useTriggerWhenStatus.test.js +1015 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.js +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts +4 -4
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts.map +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.js +2 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.d.ts +2 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.d.ts.map +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.js +20 -3
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.d.ts +10 -8
- 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 +350 -87
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.js +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.d.ts +3 -3
- 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 +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts.map +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.js +5 -2
- package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.d.ts +24 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/{useShowWhenStatus.js → useTriggerWhenStatus.js} +18 -15
- package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts +3 -3
- 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/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useShowWhenStatus.d.ts +0 -24
- package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useShowWhenStatus.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerJourney.d.ts","sourceRoot":"","sources":["../../src/components/TriggerJourney.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAmB,
|
|
1
|
+
{"version":3,"file":"TriggerJourney.d.ts","sourceRoot":"","sources":["../../src/components/TriggerJourney.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAmB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEhF,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAClC;AA4FD,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,EAAE,mBAAmB,2CA+B7D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
|
-
* TriggerJourney — compact horizontal node graph for
|
|
3
|
+
* TriggerJourney — compact horizontal node graph for triggerWhen conditions.
|
|
4
4
|
*
|
|
5
5
|
* Displays each condition as a small circle node connected by lines.
|
|
6
6
|
* Nodes light up green as conditions are met.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatConditionLabel.d.ts","sourceRoot":"","sources":["../src/formatConditionLabel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAgDD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAMD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,aAAa,EACxB,gBAAgB,CAAC,EAAE,MAAM,GACxB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"formatConditionLabel.d.ts","sourceRoot":"","sources":["../src/formatConditionLabel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAgDD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAMD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,aAAa,EACxB,gBAAgB,CAAC,EAAE,MAAM,GACxB,kBAAkB,CAoKpB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Format a
|
|
2
|
+
* Format a triggerWhen condition into a human-readable label.
|
|
3
3
|
* Pure function — no runtime dependency.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -104,7 +104,10 @@ export function formatConditionLabel(condition, accumulatorCount) {
|
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
case 'anchor_visible': {
|
|
107
|
-
const
|
|
107
|
+
const rawAnchor = condition.anchorId;
|
|
108
|
+
const anchorId = typeof rawAnchor === 'string'
|
|
109
|
+
? rawAnchor
|
|
110
|
+
: (rawAnchor?.selector ?? '');
|
|
108
111
|
const state = condition.state;
|
|
109
112
|
return {
|
|
110
113
|
label: `${anchorId} (${state})`,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { TriggerWhenStatus } from '../components/ConditionStatusLine';
|
|
2
|
+
/**
|
|
3
|
+
* Minimal type for a triggerWhen action item.
|
|
4
|
+
* Works with both FAQQuestionAction and NavTipAction.
|
|
5
|
+
*/
|
|
6
|
+
export interface TriggerWhenItem {
|
|
7
|
+
id: string;
|
|
8
|
+
triggerWhen?: {
|
|
9
|
+
type: string;
|
|
10
|
+
rules?: Array<{
|
|
11
|
+
conditions: Array<Record<string, unknown>>;
|
|
12
|
+
value: unknown;
|
|
13
|
+
}>;
|
|
14
|
+
default?: unknown;
|
|
15
|
+
} | null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Hook: live triggerWhen evaluation for a list of action items.
|
|
19
|
+
*
|
|
20
|
+
* @param items Array of items with id + optional triggerWhen
|
|
21
|
+
* @returns Map from item id → TriggerWhenStatus (null for items without triggerWhen)
|
|
22
|
+
*/
|
|
23
|
+
export declare function useTriggerWhenStatus(items: TriggerWhenItem[]): Map<string, TriggerWhenStatus | null>;
|
|
24
|
+
//# sourceMappingURL=useTriggerWhenStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTriggerWhenStatus.d.ts","sourceRoot":"","sources":["../../src/hooks/useTriggerWhenStatus.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAmB,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAG5F;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,KAAK,CAAC;YACZ,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;YAC3C,KAAK,EAAE,OAAO,CAAC;SAChB,CAAC,CAAC;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,GAAG,IAAI,CAAC;CACV;AA2ND;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,eAAe,EAAE,GACvB,GAAG,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC,CA0CvC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* useTriggerWhenStatus — live triggerWhen evaluation for editor diagnostics.
|
|
3
3
|
*
|
|
4
4
|
* Subscribes to the runtime's EventAccumulator for reactive updates.
|
|
5
|
-
* Evaluates each item's
|
|
5
|
+
* Evaluates each item's triggerWhen strategy locally to get
|
|
6
6
|
* per-condition breakdowns.
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This hook accesses `window.SynOS.handle.runtime` directly
|
|
@@ -65,7 +65,10 @@ function evaluateConditionLocally(condition, runtime) {
|
|
|
65
65
|
break;
|
|
66
66
|
case 'anchor_visible': {
|
|
67
67
|
const anchors = ctx.anchors;
|
|
68
|
-
const
|
|
68
|
+
const condSelector = typeof condition.anchorId === 'string'
|
|
69
|
+
? condition.anchorId
|
|
70
|
+
: (condition.anchorId?.selector ?? '');
|
|
71
|
+
const anchor = anchors?.find((a) => a.anchorId === condSelector);
|
|
69
72
|
switch (condition.state) {
|
|
70
73
|
case 'visible':
|
|
71
74
|
passed = anchor?.visible === true;
|
|
@@ -143,15 +146,15 @@ function evaluateConditionLocally(condition, runtime) {
|
|
|
143
146
|
};
|
|
144
147
|
}
|
|
145
148
|
/**
|
|
146
|
-
* Evaluate all conditions in a
|
|
149
|
+
* Evaluate all conditions in a triggerWhen RuleStrategy.
|
|
147
150
|
*/
|
|
148
|
-
function
|
|
149
|
-
if (
|
|
150
|
-
return { visible: !!
|
|
151
|
+
function evaluateTriggerWhen(triggerWhen, runtime) {
|
|
152
|
+
if (triggerWhen.type !== 'rules' || !triggerWhen.rules?.length) {
|
|
153
|
+
return { visible: !!triggerWhen.default, isFallback: true, conditions: [] };
|
|
151
154
|
}
|
|
152
155
|
// Evaluate ALL rules' conditions for diagnostic display
|
|
153
156
|
const allConditions = [];
|
|
154
|
-
for (const rule of
|
|
157
|
+
for (const rule of triggerWhen.rules) {
|
|
155
158
|
let ruleMatched = true;
|
|
156
159
|
for (const condition of rule.conditions) {
|
|
157
160
|
const { passed, cs } = evaluateConditionLocally(condition, runtime);
|
|
@@ -165,18 +168,18 @@ function evaluateShowWhen(showWhen, runtime) {
|
|
|
165
168
|
}
|
|
166
169
|
// No rules matched — use default
|
|
167
170
|
return {
|
|
168
|
-
visible:
|
|
171
|
+
visible: triggerWhen.default ?? false,
|
|
169
172
|
isFallback: true,
|
|
170
173
|
conditions: allConditions,
|
|
171
174
|
};
|
|
172
175
|
}
|
|
173
176
|
/**
|
|
174
|
-
* Hook: live
|
|
177
|
+
* Hook: live triggerWhen evaluation for a list of action items.
|
|
175
178
|
*
|
|
176
|
-
* @param items Array of items with id + optional
|
|
177
|
-
* @returns Map from item id →
|
|
179
|
+
* @param items Array of items with id + optional triggerWhen
|
|
180
|
+
* @returns Map from item id → TriggerWhenStatus (null for items without triggerWhen)
|
|
178
181
|
*/
|
|
179
|
-
export function
|
|
182
|
+
export function useTriggerWhenStatus(items) {
|
|
180
183
|
const [statuses, setStatuses] = useState(new Map());
|
|
181
184
|
const itemsRef = useRef(items);
|
|
182
185
|
itemsRef.current = items;
|
|
@@ -186,11 +189,11 @@ export function useShowWhenStatus(items) {
|
|
|
186
189
|
return;
|
|
187
190
|
const map = new Map();
|
|
188
191
|
for (const item of itemsRef.current) {
|
|
189
|
-
if (!item.
|
|
192
|
+
if (!item.triggerWhen) {
|
|
190
193
|
map.set(item.id, null);
|
|
191
194
|
}
|
|
192
195
|
else {
|
|
193
|
-
map.set(item.id,
|
|
196
|
+
map.set(item.id, evaluateTriggerWhen(item.triggerWhen, runtime));
|
|
194
197
|
}
|
|
195
198
|
}
|
|
196
199
|
setStatuses(map);
|
|
@@ -2,7 +2,7 @@ export { cn } from './cn';
|
|
|
2
2
|
export type { AnchorPickerProps, PickedElement } from './components/AnchorPicker';
|
|
3
3
|
export { AnchorPicker } from './components/AnchorPicker';
|
|
4
4
|
export { BeforeAfterToggle } from './components/BeforeAfterToggle';
|
|
5
|
-
export type { ConditionStatus,
|
|
5
|
+
export type { ConditionStatus, TriggerWhenStatus } from './components/ConditionStatusLine';
|
|
6
6
|
export { ConditionStatusLine } from './components/ConditionStatusLine';
|
|
7
7
|
export { DetectionBadge } from './components/DetectionBadge';
|
|
8
8
|
export { DismissedSection } from './components/DismissedSection';
|
|
@@ -26,8 +26,8 @@ export { TriggerJourney } from './components/TriggerJourney';
|
|
|
26
26
|
export type { ConditionProgress, FormattedCondition } from './formatConditionLabel';
|
|
27
27
|
export { formatConditionLabel } from './formatConditionLabel';
|
|
28
28
|
export { useElementRect } from './hooks/useElementRect';
|
|
29
|
-
export type {
|
|
30
|
-
export {
|
|
29
|
+
export type { TriggerWhenItem } from './hooks/useTriggerWhenStatus';
|
|
30
|
+
export { useTriggerWhenStatus } from './hooks/useTriggerWhenStatus';
|
|
31
31
|
export type { SelectorOptions } from './utils/selectorGenerator';
|
|
32
32
|
export { generateSelector, getElementDescription, validateSelector, } from './utils/selectorGenerator';
|
|
33
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,YAAY,EAAE,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,YAAY,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,YAAY,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC"}
|
|
@@ -20,5 +20,5 @@ export { GroupHeader } from './components/GroupHeader';
|
|
|
20
20
|
export { TriggerJourney } from './components/TriggerJourney';
|
|
21
21
|
export { formatConditionLabel } from './formatConditionLabel';
|
|
22
22
|
export { useElementRect } from './hooks/useElementRect';
|
|
23
|
-
export {
|
|
23
|
+
export { useTriggerWhenStatus } from './hooks/useTriggerWhenStatus';
|
|
24
24
|
export { generateSelector, getElementDescription, validateSelector, } from './utils/selectorGenerator';
|
package/package.json
CHANGED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ShowWhenStatus } from '../components/ConditionStatusLine';
|
|
2
|
-
/**
|
|
3
|
-
* Minimal type for a showWhen action item.
|
|
4
|
-
* Works with both FAQQuestionAction and NavTipAction.
|
|
5
|
-
*/
|
|
6
|
-
export interface ShowWhenItem {
|
|
7
|
-
id: string;
|
|
8
|
-
showWhen?: {
|
|
9
|
-
type: string;
|
|
10
|
-
rules?: Array<{
|
|
11
|
-
conditions: Array<Record<string, unknown>>;
|
|
12
|
-
value: unknown;
|
|
13
|
-
}>;
|
|
14
|
-
default?: unknown;
|
|
15
|
-
} | null;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Hook: live showWhen evaluation for a list of action items.
|
|
19
|
-
*
|
|
20
|
-
* @param items Array of items with id + optional showWhen
|
|
21
|
-
* @returns Map from item id → ShowWhenStatus (null for items without showWhen)
|
|
22
|
-
*/
|
|
23
|
-
export declare function useShowWhenStatus(items: ShowWhenItem[]): Map<string, ShowWhenStatus | null>;
|
|
24
|
-
//# sourceMappingURL=useShowWhenStatus.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useShowWhenStatus.d.ts","sourceRoot":"","sources":["../../src/hooks/useShowWhenStatus.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAGzF;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,KAAK,CAAC;YACZ,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;YAC3C,KAAK,EAAE,OAAO,CAAC;SAChB,CAAC,CAAC;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,GAAG,IAAI,CAAC;CACV;AAuND;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC,CA0C3F"}
|