@syntrologie/adapt-content 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.
Files changed (54) hide show
  1. package/dist/editor.d.ts.map +1 -1
  2. package/dist/editor.js +59 -3
  3. package/dist/runtime.d.ts.map +1 -1
  4. package/dist/runtime.js +67 -12
  5. package/dist/summarize.d.ts.map +1 -1
  6. package/dist/summarize.js +12 -1
  7. package/dist/types.d.ts +9 -42
  8. package/dist/types.d.ts.map +1 -1
  9. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/AnchorPicker.test.d.ts +2 -0
  10. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/AnchorPicker.test.d.ts.map +1 -0
  11. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/AnchorPicker.test.js +224 -0
  12. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ConditionStatusLine.test.js +102 -0
  13. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DetectionBadge.test.js +58 -6
  14. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DismissedSection.test.js +18 -0
  15. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorCard.test.js +61 -2
  16. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorPanelShell.test.js +478 -7
  17. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ElementHighlight.test.js +54 -0
  18. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/selectorGenerator.test.d.ts +2 -0
  19. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/selectorGenerator.test.d.ts.map +1 -0
  20. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/selectorGenerator.test.js +257 -0
  21. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/useTriggerWhenStatus.test.d.ts +2 -0
  22. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/useTriggerWhenStatus.test.d.ts.map +1 -0
  23. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/useTriggerWhenStatus.test.js +1015 -0
  24. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.js +1 -1
  25. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts +4 -4
  26. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts.map +1 -1
  27. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.js +2 -2
  28. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.d.ts +2 -1
  29. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.d.ts.map +1 -1
  30. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.js +20 -3
  31. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.d.ts +10 -8
  32. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.d.ts.map +1 -1
  33. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.js +350 -87
  34. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.js +1 -1
  35. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.d.ts +3 -3
  36. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.d.ts.map +1 -1
  37. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.js +1 -1
  38. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts +1 -1
  39. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts.map +1 -1
  40. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.js +5 -2
  41. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.d.ts +24 -0
  42. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.d.ts.map +1 -0
  43. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/{useShowWhenStatus.js → useTriggerWhenStatus.js} +18 -15
  44. package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts +3 -3
  45. package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts.map +1 -1
  46. package/node_modules/@syntrologie/shared-editor-ui/dist/index.js +1 -1
  47. package/package.json +4 -5
  48. package/node_modules/@syntrologie/sdk-contracts/dist/index.d.ts +0 -26
  49. package/node_modules/@syntrologie/sdk-contracts/dist/index.js +0 -13
  50. package/node_modules/@syntrologie/sdk-contracts/dist/schemas.d.ts +0 -1428
  51. package/node_modules/@syntrologie/sdk-contracts/dist/schemas.js +0 -142
  52. package/node_modules/@syntrologie/sdk-contracts/package.json +0 -33
  53. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useShowWhenStatus.d.ts +0 -24
  54. 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,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE7E,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;CAC/B;AA4FD,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,EAAE,mBAAmB,2CA+B7D"}
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 showWhen conditions.
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,5 +1,5 @@
1
1
  /**
2
- * Format a showWhen condition into a human-readable label.
2
+ * Format a triggerWhen condition into a human-readable label.
3
3
  * Pure function — no runtime dependency.
4
4
  */
5
5
  interface ConditionLike {
@@ -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,CAgKpB"}
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 showWhen condition into a human-readable label.
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 anchorId = condition.anchorId;
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
- * useShowWhenStatus — live showWhen evaluation for editor diagnostics.
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 showWhen strategy locally to get
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 anchor = anchors?.find((a) => a.anchorId === condition.anchorId);
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 showWhen RuleStrategy.
149
+ * Evaluate all conditions in a triggerWhen RuleStrategy.
147
150
  */
148
- function evaluateShowWhen(showWhen, runtime) {
149
- if (showWhen.type !== 'rules' || !showWhen.rules?.length) {
150
- return { visible: !!showWhen.default, isFallback: true, conditions: [] };
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 showWhen.rules) {
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: showWhen.default ?? false,
171
+ visible: triggerWhen.default ?? false,
169
172
  isFallback: true,
170
173
  conditions: allConditions,
171
174
  };
172
175
  }
173
176
  /**
174
- * Hook: live showWhen evaluation for a list of action items.
177
+ * Hook: live triggerWhen evaluation for a list of action items.
175
178
  *
176
- * @param items Array of items with id + optional showWhen
177
- * @returns Map from item id → ShowWhenStatus (null for items without showWhen)
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 useShowWhenStatus(items) {
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.showWhen) {
192
+ if (!item.triggerWhen) {
190
193
  map.set(item.id, null);
191
194
  }
192
195
  else {
193
- map.set(item.id, evaluateShowWhen(item.showWhen, runtime));
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, ShowWhenStatus } from './components/ConditionStatusLine';
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 { ShowWhenItem } from './hooks/useShowWhenStatus';
30
- export { useShowWhenStatus } from './hooks/useShowWhenStatus';
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,EAA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,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 { useShowWhenStatus } from './hooks/useShowWhenStatus';
23
+ export { useTriggerWhenStatus } from './hooks/useTriggerWhenStatus';
24
24
  export { generateSelector, getElementDescription, validateSelector, } from './utils/selectorGenerator';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syntrologie/adapt-content",
3
- "version": "2.4.0",
3
+ "version": "2.5.1",
4
4
  "description": "Adaptive Content app - DOM manipulation actions for text, attributes, and styles",
5
5
  "license": "Proprietary",
6
6
  "private": false,
@@ -32,8 +32,7 @@
32
32
  "dist"
33
33
  ],
34
34
  "bundledDependencies": [
35
- "@syntrologie/shared-editor-ui",
36
- "@syntrologie/sdk-contracts"
35
+ "@syntrologie/shared-editor-ui"
37
36
  ],
38
37
  "scripts": {
39
38
  "prepack": "node ../../../scripts/prepare-bundled-deps.mjs",
@@ -50,18 +49,18 @@
50
49
  "zod": "^3.0.0"
51
50
  },
52
51
  "dependencies": {
53
- "@syntrologie/sdk-contracts": "*",
54
52
  "@syntrologie/shared-editor-ui": "*",
55
53
  "css-selector-generator": "^3.8.0",
56
54
  "data-urls": "^5.0.0"
57
55
  },
58
56
  "devDependencies": {
59
57
  "@floating-ui/dom": "^1.7.5",
58
+ "@syntrologie/sdk-contracts": "*",
60
59
  "@testing-library/react": "^16.3.2",
61
60
  "@types/react": "^19.2.0",
62
61
  "@types/react-dom": "^19.2.0",
63
62
  "jsdom": "^26.1.0",
64
- "lucide-react": "^0.539.0",
63
+ "lucide-react": "^0.576.0",
65
64
  "react": "^19.2.0",
66
65
  "react-dom": "^19.2.0",
67
66
  "typescript": "^5.9.3",
@@ -1,26 +0,0 @@
1
- /**
2
- * @syntrologie/sdk-contracts
3
- *
4
- * Shared TypeScript contracts between runtime-sdk and adaptive packages.
5
- * Executor types + shared Zod schemas for decision strategies and conditions.
6
- */
7
- export { AnchorVisibleConditionZ, type ConditionSchema, ConditionZ, CooldownActiveConditionZ, type DecisionStrategySchema, DecisionStrategyZ, DismissedConditionZ, EventCountConditionZ, EventOccurredConditionZ, type EventScopeSchema, EventScopeZ, ExternalStrategyZ, FrequencyLimitConditionZ, ModelStrategyZ, NotifyZ, PageUrlConditionZ, RouteConditionZ, type RuleSchema, RuleStrategyZ, RuleZ, ScoreStrategyZ, SessionMetricConditionZ, StateEqualsConditionZ, ViewportConditionZ, } from './schemas.js';
8
- /** Cleanup function returned by executors */
9
- export type ExecutorCleanup = () => void | Promise<void>;
10
- /** Update function for actions that support in-place updates */
11
- export type ExecutorUpdate = (changes: Record<string, unknown>) => void | Promise<void>;
12
- /** Result returned by action executors */
13
- export interface ExecutorResult {
14
- cleanup: ExecutorCleanup;
15
- updateFn?: ExecutorUpdate;
16
- }
17
- /** Context passed to action executors by the runtime */
18
- export interface ExecutorContext {
19
- overlayRoot: HTMLElement;
20
- resolveAnchor: (anchorId: string) => HTMLElement | null;
21
- generateId: () => string;
22
- publishEvent: (name: string, props?: Record<string, unknown>) => void;
23
- adaptiveId?: string;
24
- }
25
- /** Executor function signature */
26
- export type ActionExecutor<T = unknown> = (action: T, context: ExecutorContext) => Promise<ExecutorResult>;
@@ -1,13 +0,0 @@
1
- /**
2
- * @syntrologie/sdk-contracts
3
- *
4
- * Shared TypeScript contracts between runtime-sdk and adaptive packages.
5
- * Executor types + shared Zod schemas for decision strategies and conditions.
6
- */
7
- export { AnchorVisibleConditionZ, ConditionZ, CooldownActiveConditionZ, DecisionStrategyZ, DismissedConditionZ, EventCountConditionZ, EventOccurredConditionZ,
8
- // Shared schemas
9
- EventScopeZ, ExternalStrategyZ, FrequencyLimitConditionZ, ModelStrategyZ, NotifyZ,
10
- // Condition schemas
11
- PageUrlConditionZ, RouteConditionZ, RuleStrategyZ,
12
- // Strategy schemas
13
- RuleZ, ScoreStrategyZ, SessionMetricConditionZ, StateEqualsConditionZ, ViewportConditionZ, } from './schemas.js';