@syntrologie/adapt-content 2.1.0 → 2.2.0-canary.10

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 (148) hide show
  1. package/dist/cdn.d.ts +1 -1
  2. package/dist/components/AnchorPicker.d.ts +5 -20
  3. package/dist/components/AnchorPicker.d.ts.map +1 -1
  4. package/dist/components/AnchorPicker.js +4 -181
  5. package/dist/editor.d.ts.map +1 -1
  6. package/dist/editor.js +51 -27
  7. package/dist/runtime.d.ts +1 -1
  8. package/dist/runtime.d.ts.map +1 -1
  9. package/dist/schema.d.ts +28 -28
  10. package/dist/types.d.ts +5 -15
  11. package/dist/types.d.ts.map +1 -1
  12. package/dist/utils/selectorGenerator.d.ts +3 -19
  13. package/dist/utils/selectorGenerator.d.ts.map +1 -1
  14. package/dist/utils/selectorGenerator.js +2 -119
  15. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/BeforeAfterToggle.test.d.ts +2 -0
  16. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/BeforeAfterToggle.test.d.ts.map +1 -0
  17. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/BeforeAfterToggle.test.js +28 -0
  18. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DetectionBadge.test.d.ts +2 -0
  19. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DetectionBadge.test.d.ts.map +1 -0
  20. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DetectionBadge.test.js +18 -0
  21. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DismissedSection.test.d.ts +2 -0
  22. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DismissedSection.test.d.ts.map +1 -0
  23. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DismissedSection.test.js +22 -0
  24. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditBackButton.test.d.ts +2 -0
  25. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditBackButton.test.d.ts.map +1 -0
  26. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditBackButton.test.js +20 -0
  27. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorBody.test.d.ts +2 -0
  28. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorBody.test.d.ts.map +1 -0
  29. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorBody.test.js +12 -0
  30. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorCard.test.d.ts +2 -0
  31. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorCard.test.d.ts.map +1 -0
  32. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorCard.test.js +25 -0
  33. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorFooter.test.d.ts +2 -0
  34. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorFooter.test.d.ts.map +1 -0
  35. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorFooter.test.js +23 -0
  36. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorHeader.test.d.ts +2 -0
  37. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorHeader.test.d.ts.map +1 -0
  38. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorHeader.test.js +24 -0
  39. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorInput.test.d.ts +2 -0
  40. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorInput.test.d.ts.map +1 -0
  41. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorInput.test.js +26 -0
  42. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorLayout.test.d.ts +2 -0
  43. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorLayout.test.d.ts.map +1 -0
  44. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorLayout.test.js +13 -0
  45. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorSelect.test.d.ts +2 -0
  46. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorSelect.test.d.ts.map +1 -0
  47. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorSelect.test.js +22 -0
  48. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorTextarea.test.d.ts +2 -0
  49. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorTextarea.test.d.ts.map +1 -0
  50. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorTextarea.test.js +20 -0
  51. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ElementHighlight.test.d.ts +2 -0
  52. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ElementHighlight.test.d.ts.map +1 -0
  53. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ElementHighlight.test.js +100 -0
  54. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EmptyState.test.d.ts +2 -0
  55. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EmptyState.test.d.ts.map +1 -0
  56. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EmptyState.test.js +10 -0
  57. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/GroupHeader.test.d.ts +2 -0
  58. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/GroupHeader.test.d.ts.map +1 -0
  59. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/GroupHeader.test.js +14 -0
  60. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/TriggerJourney.test.d.ts +2 -0
  61. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/TriggerJourney.test.d.ts.map +1 -0
  62. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/TriggerJourney.test.js +126 -0
  63. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/cn.test.d.ts +2 -0
  64. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/cn.test.d.ts.map +1 -0
  65. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/cn.test.js +16 -0
  66. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/formatConditionLabel.test.d.ts +2 -0
  67. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/formatConditionLabel.test.d.ts.map +1 -0
  68. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/formatConditionLabel.test.js +329 -0
  69. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/useElementRect.test.d.ts +2 -0
  70. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/useElementRect.test.d.ts.map +1 -0
  71. package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/useElementRect.test.js +112 -0
  72. package/node_modules/@syntrologie/shared-editor-ui/dist/cn.d.ts +2 -0
  73. package/node_modules/@syntrologie/shared-editor-ui/dist/cn.d.ts.map +1 -0
  74. package/node_modules/@syntrologie/shared-editor-ui/dist/cn.js +3 -0
  75. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.d.ts +31 -0
  76. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.d.ts.map +1 -0
  77. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.js +152 -0
  78. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.d.ts +7 -0
  79. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.d.ts.map +1 -0
  80. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.js +9 -0
  81. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts +23 -0
  82. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts.map +1 -0
  83. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.js +40 -0
  84. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.d.ts +6 -0
  85. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.d.ts.map +1 -0
  86. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.js +5 -0
  87. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.d.ts +8 -0
  88. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.d.ts.map +1 -0
  89. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.js +9 -0
  90. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.d.ts +7 -0
  91. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.d.ts.map +1 -0
  92. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.js +4 -0
  93. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.d.ts +7 -0
  94. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.d.ts.map +1 -0
  95. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.js +4 -0
  96. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.d.ts +13 -0
  97. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.d.ts.map +1 -0
  98. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.js +6 -0
  99. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.d.ts +7 -0
  100. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.d.ts.map +1 -0
  101. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.js +4 -0
  102. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.d.ts +9 -0
  103. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.d.ts.map +1 -0
  104. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.js +4 -0
  105. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.d.ts +8 -0
  106. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.d.ts.map +1 -0
  107. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.js +5 -0
  108. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.d.ts +7 -0
  109. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.d.ts.map +1 -0
  110. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.js +4 -0
  111. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.d.ts +23 -0
  112. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.d.ts.map +1 -0
  113. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.js +116 -0
  114. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.d.ts +8 -0
  115. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.d.ts.map +1 -0
  116. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.js +5 -0
  117. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.d.ts +8 -0
  118. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.d.ts.map +1 -0
  119. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.js +15 -0
  120. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.d.ts +32 -0
  121. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.d.ts.map +1 -0
  122. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.js +75 -0
  123. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.d.ts +6 -0
  124. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.d.ts.map +1 -0
  125. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.js +4 -0
  126. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.d.ts +8 -0
  127. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.d.ts.map +1 -0
  128. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.js +5 -0
  129. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.d.ts +12 -0
  130. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.d.ts.map +1 -0
  131. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.js +40 -0
  132. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts +26 -0
  133. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts.map +1 -0
  134. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.js +207 -0
  135. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.d.ts +8 -0
  136. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.d.ts.map +1 -0
  137. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.js +46 -0
  138. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useShowWhenStatus.d.ts +24 -0
  139. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useShowWhenStatus.d.ts.map +1 -0
  140. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useShowWhenStatus.js +215 -0
  141. package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts +33 -0
  142. package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts.map +1 -0
  143. package/node_modules/@syntrologie/shared-editor-ui/dist/index.js +24 -0
  144. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.d.ts +22 -0
  145. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.d.ts.map +1 -0
  146. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.js +143 -0
  147. package/node_modules/@syntrologie/shared-editor-ui/package.json +45 -0
  148. package/package.json +17 -12
package/dist/types.d.ts CHANGED
@@ -22,6 +22,8 @@ export interface EditorPanelProps {
22
22
  getCurrentRoute: () => string;
23
23
  /** Push a temporary config to the live page preview without saving to state. */
24
24
  previewConfig: (config: Record<string, unknown>) => void;
25
+ /** Global before/after preview mode set by the panel's toggle. */
26
+ previewMode?: 'before' | 'after';
25
27
  /** Flat action index to open in edit mode (from accordion navigation). */
26
28
  initialEditKey?: string;
27
29
  /** Open the editor in create mode. */
@@ -32,6 +34,8 @@ export interface EditorPanelProps {
32
34
  getDismissedKeys?: () => Set<string>;
33
35
  /** Sync dismissed keys back to navigation context. */
34
36
  setDismissedKeys?: (keys: Set<string>) => void;
37
+ /** Register a back handler shown in the panel header. Pass null to clear. */
38
+ setBackHandler?: (handler: (() => void) | null) => void;
35
39
  };
36
40
  platformClient?: unknown;
37
41
  }
@@ -71,19 +75,5 @@ export interface SetStyleAction extends BaseAction {
71
75
  anchorId: string;
72
76
  styles: Record<string, string>;
73
77
  }
74
- export type ExecutorCleanup = () => void | Promise<void>;
75
- export type ExecutorUpdate = (changes: Record<string, unknown>) => void | Promise<void>;
76
- export interface ExecutorResult {
77
- cleanup: ExecutorCleanup;
78
- updateFn?: ExecutorUpdate;
79
- }
80
- export interface ExecutorContext {
81
- overlayRoot: HTMLElement;
82
- resolveAnchor: (anchorId: string) => HTMLElement | null;
83
- generateId: () => string;
84
- publishEvent: (name: string, props?: Record<string, unknown>) => void;
85
- adaptiveId?: string;
86
- }
87
- export type ActionExecutor<T> = (action: T, context: ExecutorContext) => Promise<ExecutorResult>;
88
- export {};
78
+ export type { ActionExecutor, ExecutorCleanup, ExecutorContext, ExecutorResult, ExecutorUpdate, } from '@syntrologie/sdk-contracts';
89
79
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAA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I,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD,IAAI,EAAE,qBAAqB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAMD,YAAY,EACV,cAAc,EACd,eAAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,GACf,MAAM,4BAA4B,CAAC"}
@@ -1,22 +1,6 @@
1
1
  /**
2
- * CSS Selector Generator
3
- *
4
- * Generates stable, readable CSS selectors for picked DOM elements.
5
- * Ported from editor-sdk for use in adaptive-content's element picker.
2
+ * Re-export selector utilities from shared-editor-ui.
6
3
  */
7
- export interface SelectorOptions {
8
- includeTag?: boolean;
9
- preferTestIds?: boolean;
10
- maxCombinations?: number;
11
- }
12
- /**
13
- * Generates a CSS selector for a given DOM element.
14
- * Uses css-selector-generator with settings optimized for:
15
- * - Stability (prefers IDs, data-testid, stable classes)
16
- * - Readability (includes tag names)
17
- * - Uniqueness (generates unique selectors)
18
- */
19
- export declare function generateSelector(element: Element, options?: SelectorOptions): string;
20
- export declare function validateSelector(selector: string, expectedElement: Element): boolean;
21
- export declare function getElementDescription(element: Element): string;
4
+ export type { SelectorOptions } from '@syntrologie/shared-editor-ui';
5
+ export { generateSelector, getElementDescription, validateSelector, } from '@syntrologie/shared-editor-ui';
22
6
  //# sourceMappingURL=selectorGenerator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"selectorGenerator.d.ts","sourceRoot":"","sources":["../../src/utils/selectorGenerator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAQD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE,eAAoB,GAAG,MAAM,CAmDxF;AA6BD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,GAAG,OAAO,CAOpF;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAgB9D"}
1
+ {"version":3,"file":"selectorGenerator.d.ts","sourceRoot":"","sources":["../../src/utils/selectorGenerator.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,+BAA+B,CAAC"}
@@ -1,121 +1,4 @@
1
1
  /**
2
- * CSS Selector Generator
3
- *
4
- * Generates stable, readable CSS selectors for picked DOM elements.
5
- * Ported from editor-sdk for use in adaptive-content's element picker.
2
+ * Re-export selector utilities from shared-editor-ui.
6
3
  */
7
- import { getCssSelector } from 'css-selector-generator';
8
- const DEFAULT_OPTIONS = {
9
- includeTag: true,
10
- preferTestIds: true,
11
- maxCombinations: 100,
12
- };
13
- /**
14
- * Generates a CSS selector for a given DOM element.
15
- * Uses css-selector-generator with settings optimized for:
16
- * - Stability (prefers IDs, data-testid, stable classes)
17
- * - Readability (includes tag names)
18
- * - Uniqueness (generates unique selectors)
19
- */
20
- export function generateSelector(element, options = {}) {
21
- const opts = { ...DEFAULT_OPTIONS, ...options };
22
- const selectors = [];
23
- selectors.push('id');
24
- if (opts.preferTestIds) {
25
- selectors.push('attribute');
26
- }
27
- selectors.push('class');
28
- selectors.push('tag');
29
- selectors.push('nthchild');
30
- selectors.push('nthoftype');
31
- try {
32
- const selector = getCssSelector(element, {
33
- selectors,
34
- includeTag: opts.includeTag,
35
- maxCombinations: opts.maxCombinations,
36
- blacklist: [
37
- /^[a-z]+-[a-f0-9]{5,}$/i,
38
- /^_[a-zA-Z0-9]+$/,
39
- /^svelte-[a-z0-9]+$/i,
40
- /^vue-[a-z0-9]+$/i,
41
- /^emotion-[0-9]+$/,
42
- /^sc-[a-zA-Z]+$/,
43
- /^(is-|has-|js-)/,
44
- /^(active|selected|focused|disabled|hidden|visible)$/,
45
- /^(fade|slide|animate)/,
46
- /-(enter|leave|active)(-active|-done)?$/,
47
- ],
48
- whitelist: [
49
- /^data-testid$/,
50
- /^data-cy$/,
51
- /^data-test$/,
52
- /^data-qa$/,
53
- /^aria-label$/,
54
- /^role$/,
55
- /^name$/,
56
- /^type$/,
57
- /^href$/,
58
- ],
59
- });
60
- return selector;
61
- }
62
- catch (error) {
63
- console.warn('[SelectorGenerator] Failed to generate selector:', error);
64
- return generateFallbackSelector(element);
65
- }
66
- }
67
- function generateFallbackSelector(element) {
68
- const path = [];
69
- let current = element;
70
- while (current && current !== document.body && current !== document.documentElement) {
71
- let selector = current.tagName.toLowerCase();
72
- if (current.id) {
73
- selector = `#${CSS.escape(current.id)}`;
74
- path.unshift(selector);
75
- break;
76
- }
77
- const parent = current.parentElement;
78
- if (parent) {
79
- const siblings = Array.from(parent.children);
80
- const index = siblings.indexOf(current) + 1;
81
- selector += `:nth-child(${index})`;
82
- }
83
- path.unshift(selector);
84
- current = parent;
85
- }
86
- return path.join(' > ');
87
- }
88
- export function validateSelector(selector, expectedElement) {
89
- try {
90
- const matched = document.querySelector(selector);
91
- return matched === expectedElement;
92
- }
93
- catch {
94
- return false;
95
- }
96
- }
97
- export function getElementDescription(element) {
98
- const tag = element.tagName.toLowerCase();
99
- const id = element.id ? `#${element.id}` : '';
100
- const classes = element.className && typeof element.className === 'string'
101
- ? `.${element.className
102
- .split(' ')
103
- .filter((c) => c && !isDynamicClass(c))
104
- .slice(0, 2)
105
- .join('.')}`
106
- : '';
107
- const text = element.textContent?.trim().slice(0, 30) || '';
108
- const textPreview = text ? ` "${text}${text.length >= 30 ? '...' : ''}"` : '';
109
- return `${tag}${id}${classes}${textPreview}`.trim();
110
- }
111
- function isDynamicClass(className) {
112
- const dynamicPatterns = [
113
- /^[a-z]+-[a-f0-9]{5,}$/i,
114
- /^_[a-zA-Z0-9]+$/,
115
- /^svelte-[a-z0-9]+$/i,
116
- /^vue-[a-z0-9]+$/i,
117
- /^emotion-[0-9]+$/,
118
- /^sc-[a-zA-Z]+$/,
119
- ];
120
- return dynamicPatterns.some((pattern) => pattern.test(className));
121
- }
4
+ export { generateSelector, getElementDescription, validateSelector, } from '@syntrologie/shared-editor-ui';
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BeforeAfterToggle.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BeforeAfterToggle.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/BeforeAfterToggle.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { fireEvent, render } from '@testing-library/react';
3
+ import { describe, expect, it, vi } from 'vitest';
4
+ import { BeforeAfterToggle } from '../components/BeforeAfterToggle';
5
+ describe('BeforeAfterToggle', () => {
6
+ it('renders Before and After buttons', () => {
7
+ const { getByText } = render(_jsx(BeforeAfterToggle, { mode: "before", onToggle: () => { } }));
8
+ expect(getByText('Before')).toBeTruthy();
9
+ expect(getByText('After')).toBeTruthy();
10
+ });
11
+ it('calls onToggle with "before" when Before is clicked', () => {
12
+ const onToggle = vi.fn();
13
+ const { getByText } = render(_jsx(BeforeAfterToggle, { mode: "after", onToggle: onToggle }));
14
+ fireEvent.click(getByText('Before'));
15
+ expect(onToggle).toHaveBeenCalledWith('before');
16
+ });
17
+ it('calls onToggle with "after" when After is clicked', () => {
18
+ const onToggle = vi.fn();
19
+ const { getByText } = render(_jsx(BeforeAfterToggle, { mode: "before", onToggle: onToggle }));
20
+ fireEvent.click(getByText('After'));
21
+ expect(onToggle).toHaveBeenCalledWith('after');
22
+ });
23
+ it('highlights active mode with blue class', () => {
24
+ const { getByText } = render(_jsx(BeforeAfterToggle, { mode: "before", onToggle: () => { } }));
25
+ expect(getByText('Before').className).toContain('se-text-blue-5');
26
+ expect(getByText('After').className).toContain('se-text-text-secondary');
27
+ });
28
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DetectionBadge.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DetectionBadge.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/DetectionBadge.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { render } from '@testing-library/react';
3
+ import { describe, expect, it } from 'vitest';
4
+ import { DetectionBadge } from '../components/DetectionBadge';
5
+ describe('DetectionBadge', () => {
6
+ it('shows green dot class when found is true', () => {
7
+ const { container } = render(_jsx(DetectionBadge, { found: true }));
8
+ const badge = container.firstElementChild;
9
+ expect(badge.className).toContain('se-bg-green-4');
10
+ expect(badge.title).toBe('Found on this page');
11
+ });
12
+ it('shows gray dot class when found is false', () => {
13
+ const { container } = render(_jsx(DetectionBadge, { found: false }));
14
+ const badge = container.firstElementChild;
15
+ expect(badge.className).toContain('se-bg-text-tertiary');
16
+ expect(badge.title).toBe('Not found on this page');
17
+ });
18
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DismissedSection.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DismissedSection.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/DismissedSection.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { fireEvent, render } from '@testing-library/react';
3
+ import { describe, expect, it } from 'vitest';
4
+ import { DismissedSection } from '../components/DismissedSection';
5
+ describe('DismissedSection', () => {
6
+ it('is collapsed by default (children hidden)', () => {
7
+ const { queryByText } = render(_jsx(DismissedSection, { count: 3, children: _jsx("span", { children: "hidden content" }) }));
8
+ expect(queryByText('hidden content')).toBeNull();
9
+ });
10
+ it('expands on click to show children', () => {
11
+ const { getByText, queryByText } = render(_jsx(DismissedSection, { count: 2, children: _jsx("span", { children: "revealed" }) }));
12
+ fireEvent.click(getByText('Dismissed (2)'));
13
+ expect(queryByText('revealed')).toBeTruthy();
14
+ });
15
+ it('collapses again on second click', () => {
16
+ const { getByText, queryByText } = render(_jsx(DismissedSection, { count: 1, children: _jsx("span", { children: "content" }) }));
17
+ fireEvent.click(getByText('Dismissed (1)'));
18
+ expect(queryByText('content')).toBeTruthy();
19
+ fireEvent.click(getByText('Dismissed (1)'));
20
+ expect(queryByText('content')).toBeNull();
21
+ });
22
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=EditBackButton.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditBackButton.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/EditBackButton.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { fireEvent, render } from '@testing-library/react';
3
+ import { describe, expect, it, vi } from 'vitest';
4
+ import { EditBackButton } from '../components/EditBackButton';
5
+ describe('EditBackButton', () => {
6
+ it('renders with default label', () => {
7
+ const { getByText } = render(_jsx(EditBackButton, { onClick: () => { } }));
8
+ expect(getByText('← List')).toBeTruthy();
9
+ });
10
+ it('calls onClick when clicked', () => {
11
+ const onClick = vi.fn();
12
+ const { getByRole } = render(_jsx(EditBackButton, { onClick: onClick }));
13
+ fireEvent.click(getByRole('button'));
14
+ expect(onClick).toHaveBeenCalledOnce();
15
+ });
16
+ it('accepts a custom label', () => {
17
+ const { getByText } = render(_jsx(EditBackButton, { onClick: () => { }, label: "Go Back" }));
18
+ expect(getByText('Go Back')).toBeTruthy();
19
+ });
20
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=EditorBody.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorBody.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/EditorBody.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { render } from '@testing-library/react';
3
+ import { describe, expect, it } from 'vitest';
4
+ import { EditorBody } from '../components/EditorBody';
5
+ describe('EditorBody', () => {
6
+ it('renders children in a scrollable body wrapper', () => {
7
+ const { getByText, container } = render(_jsx(EditorBody, { children: _jsx("p", { children: "body content" }) }));
8
+ expect(getByText('body content')).toBeTruthy();
9
+ const wrapper = container.firstElementChild;
10
+ expect(wrapper.className).toContain('se-overflow-auto');
11
+ });
12
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=EditorCard.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorCard.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/EditorCard.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { render } from '@testing-library/react';
3
+ import { describe, expect, it } from 'vitest';
4
+ import { EditorCard } from '../components/EditorCard';
5
+ describe('EditorCard', () => {
6
+ it('renders children', () => {
7
+ const { getByText } = render(_jsx(EditorCard, { itemKey: "k1", children: "Card content" }));
8
+ expect(getByText('Card content')).toBeTruthy();
9
+ });
10
+ it('sets data-item-key attribute', () => {
11
+ const { container } = render(_jsx(EditorCard, { itemKey: "my-key", children: "child" }));
12
+ const card = container.firstElementChild;
13
+ expect(card.getAttribute('data-item-key')).toBe('my-key');
14
+ });
15
+ it('applies green border class when validated is true', () => {
16
+ const { container } = render(_jsx(EditorCard, { itemKey: "k", validated: true, children: "child" }));
17
+ const card = container.firstElementChild;
18
+ expect(card.className).toContain('se-border-green-4/40');
19
+ });
20
+ it('applies default border class when validated is false', () => {
21
+ const { container } = render(_jsx(EditorCard, { itemKey: "k", validated: false, children: "child" }));
22
+ const card = container.firstElementChild;
23
+ expect(card.className).toContain('se-border-border-primary');
24
+ });
25
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=EditorFooter.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorFooter.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/EditorFooter.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { fireEvent, render } from '@testing-library/react';
3
+ import { describe, expect, it, vi } from 'vitest';
4
+ import { EditorFooter } from '../components/EditorFooter';
5
+ describe('EditorFooter', () => {
6
+ it('renders Save Draft and Publish buttons', () => {
7
+ const { getByText } = render(_jsx(EditorFooter, { onSave: () => { }, onPublish: () => { } }));
8
+ expect(getByText('Save Draft')).toBeTruthy();
9
+ expect(getByText('Publish')).toBeTruthy();
10
+ });
11
+ it('calls onSave when Save Draft is clicked', () => {
12
+ const onSave = vi.fn();
13
+ const { getByText } = render(_jsx(EditorFooter, { onSave: onSave, onPublish: () => { } }));
14
+ fireEvent.click(getByText('Save Draft'));
15
+ expect(onSave).toHaveBeenCalledOnce();
16
+ });
17
+ it('calls onPublish when Publish is clicked', () => {
18
+ const onPublish = vi.fn();
19
+ const { getByText } = render(_jsx(EditorFooter, { onSave: () => { }, onPublish: onPublish }));
20
+ fireEvent.click(getByText('Publish'));
21
+ expect(onPublish).toHaveBeenCalledOnce();
22
+ });
23
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=EditorHeader.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorHeader.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/EditorHeader.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { fireEvent, render } from '@testing-library/react';
3
+ import { describe, expect, it, vi } from 'vitest';
4
+ import { EditorHeader } from '../components/EditorHeader';
5
+ describe('EditorHeader', () => {
6
+ it('renders title', () => {
7
+ const { getByText } = render(_jsx(EditorHeader, { title: "My Title", onBack: () => { } }));
8
+ expect(getByText('My Title')).toBeTruthy();
9
+ });
10
+ it('renders optional subtitle', () => {
11
+ const { getByText } = render(_jsx(EditorHeader, { title: "T", subtitle: "Sub", onBack: () => { } }));
12
+ expect(getByText('Sub')).toBeTruthy();
13
+ });
14
+ it('does not render subtitle when not provided', () => {
15
+ const { queryByText } = render(_jsx(EditorHeader, { title: "T", onBack: () => { } }));
16
+ expect(queryByText('Sub')).toBeNull();
17
+ });
18
+ it('calls onBack when back button is clicked', () => {
19
+ const onBack = vi.fn();
20
+ const { getByText } = render(_jsx(EditorHeader, { title: "T", onBack: onBack }));
21
+ fireEvent.click(getByText('← Back'));
22
+ expect(onBack).toHaveBeenCalledOnce();
23
+ });
24
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=EditorInput.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorInput.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/EditorInput.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { render } from '@testing-library/react';
3
+ import { describe, expect, it } from 'vitest';
4
+ import { EditorInput } from '../components/EditorInput';
5
+ describe('EditorInput', () => {
6
+ it('renders label when provided', () => {
7
+ const { getByText } = render(_jsx(EditorInput, { label: "Name" }));
8
+ expect(getByText('Name')).toBeTruthy();
9
+ });
10
+ it('renders an input element', () => {
11
+ const { container } = render(_jsx(EditorInput, {}));
12
+ expect(container.querySelector('input')).toBeTruthy();
13
+ });
14
+ it('spreads HTML attributes onto the input', () => {
15
+ const { container } = render(_jsx(EditorInput, { placeholder: "type here", disabled: true }));
16
+ const input = container.querySelector('input');
17
+ expect(input.placeholder).toBe('type here');
18
+ expect(input.disabled).toBe(true);
19
+ });
20
+ it('merges custom className', () => {
21
+ const { container } = render(_jsx(EditorInput, { className: "custom" }));
22
+ const input = container.querySelector('input');
23
+ expect(input.className).toContain('custom');
24
+ expect(input.className).toContain('se-w-full');
25
+ });
26
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=EditorLayout.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorLayout.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/EditorLayout.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { render } from '@testing-library/react';
3
+ import { describe, expect, it } from 'vitest';
4
+ import { EditorLayout } from '../components/EditorLayout';
5
+ describe('EditorLayout', () => {
6
+ it('renders children in a flex column container', () => {
7
+ const { getByText, container } = render(_jsx(EditorLayout, { children: _jsx("span", { children: "child" }) }));
8
+ expect(getByText('child')).toBeTruthy();
9
+ const wrapper = container.firstElementChild;
10
+ expect(wrapper.className).toContain('se-flex');
11
+ expect(wrapper.className).toContain('se-flex-col');
12
+ });
13
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=EditorSelect.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorSelect.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/EditorSelect.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { render } from '@testing-library/react';
3
+ import { describe, expect, it } from 'vitest';
4
+ import { EditorSelect } from '../components/EditorSelect';
5
+ describe('EditorSelect', () => {
6
+ it('renders label when provided', () => {
7
+ const { getByText } = render(_jsx(EditorSelect, { label: "Color", children: _jsx("option", { children: "Red" }) }));
8
+ expect(getByText('Color')).toBeTruthy();
9
+ });
10
+ it('renders a select with children options', () => {
11
+ const { container, getByText } = render(_jsxs(EditorSelect, { children: [_jsx("option", { value: "a", children: "Alpha" }), _jsx("option", { value: "b", children: "Beta" })] }));
12
+ expect(container.querySelector('select')).toBeTruthy();
13
+ expect(getByText('Alpha')).toBeTruthy();
14
+ expect(getByText('Beta')).toBeTruthy();
15
+ });
16
+ it('merges custom className', () => {
17
+ const { container } = render(_jsx(EditorSelect, { className: "extra", children: _jsx("option", { children: "X" }) }));
18
+ const select = container.querySelector('select');
19
+ expect(select.className).toContain('extra');
20
+ expect(select.className).toContain('se-w-full');
21
+ });
22
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=EditorTextarea.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorTextarea.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/EditorTextarea.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { render } from '@testing-library/react';
3
+ import { describe, expect, it } from 'vitest';
4
+ import { EditorTextarea } from '../components/EditorTextarea';
5
+ describe('EditorTextarea', () => {
6
+ it('renders label when provided', () => {
7
+ const { getByText } = render(_jsx(EditorTextarea, { label: "Notes" }));
8
+ expect(getByText('Notes')).toBeTruthy();
9
+ });
10
+ it('renders a textarea element', () => {
11
+ const { container } = render(_jsx(EditorTextarea, {}));
12
+ expect(container.querySelector('textarea')).toBeTruthy();
13
+ });
14
+ it('merges custom className', () => {
15
+ const { container } = render(_jsx(EditorTextarea, { className: "my-class" }));
16
+ const ta = container.querySelector('textarea');
17
+ expect(ta.className).toContain('my-class');
18
+ expect(ta.className).toContain('se-w-full');
19
+ });
20
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ElementHighlight.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ElementHighlight.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/ElementHighlight.test.tsx"],"names":[],"mappings":""}