@syntrologie/adapt-overlays 2.16.0 → 2.18.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.
Files changed (226) hide show
  1. package/dist/chunk-VHAA22YE.js +14 -0
  2. package/dist/chunk-VHAA22YE.js.map +7 -0
  3. package/dist/runtime.d.ts +2 -1
  4. package/dist/runtime.d.ts.map +1 -1
  5. package/dist/runtime.js +2596 -354
  6. package/dist/runtime.js.map +7 -0
  7. package/dist/schema.d.ts +90 -21
  8. package/dist/schema.d.ts.map +1 -1
  9. package/dist/schema.js +440 -151
  10. package/dist/schema.js.map +7 -0
  11. package/dist/types.d.ts +1 -1
  12. package/dist/types.d.ts.map +1 -1
  13. package/package.json +5 -22
  14. package/dist/WorkflowTracker.d.ts +0 -10
  15. package/dist/WorkflowTracker.d.ts.map +0 -1
  16. package/dist/WorkflowTracker.js +0 -19
  17. package/dist/WorkflowWidget.d.ts +0 -70
  18. package/dist/WorkflowWidget.d.ts.map +0 -1
  19. package/dist/WorkflowWidget.js +0 -330
  20. package/dist/WorkflowWidgetLit.js +0 -617
  21. package/dist/cdn.d.ts +0 -35
  22. package/dist/cdn.d.ts.map +0 -1
  23. package/dist/cdn.js +0 -39
  24. package/dist/celebrations/__tests__/engine.test.js +0 -130
  25. package/dist/celebrations/__tests__/executor.test.js +0 -102
  26. package/dist/celebrations/__tests__/reduced-motion.test.js +0 -97
  27. package/dist/celebrations/effects/__tests__/confetti.test.js +0 -89
  28. package/dist/celebrations/effects/__tests__/emoji-rain.test.js +0 -88
  29. package/dist/celebrations/effects/__tests__/fireworks.test.js +0 -87
  30. package/dist/celebrations/effects/__tests__/sparkles.test.js +0 -79
  31. package/dist/celebrations/effects/confetti.js +0 -80
  32. package/dist/celebrations/effects/emoji-rain.js +0 -73
  33. package/dist/celebrations/effects/fireworks.js +0 -69
  34. package/dist/celebrations/effects/sparkles.js +0 -83
  35. package/dist/celebrations/engine.js +0 -93
  36. package/dist/celebrations/index.js +0 -73
  37. package/dist/celebrations/types.js +0 -1
  38. package/dist/editor.d.ts +0 -27
  39. package/dist/editor.d.ts.map +0 -1
  40. package/dist/editor.js +0 -22
  41. package/dist/executors/tour.js +0 -335
  42. package/dist/highlight.js +0 -180
  43. package/dist/modal.js +0 -218
  44. package/dist/overlay-editor-state.d.ts +0 -41
  45. package/dist/overlay-editor-state.d.ts.map +0 -1
  46. package/dist/overlay-editor-state.js +0 -131
  47. package/dist/overlay-editor-ui.d.ts +0 -9
  48. package/dist/overlay-editor-ui.d.ts.map +0 -1
  49. package/dist/overlay-editor-ui.js +0 -306
  50. package/dist/runtime-lit.d.ts +0 -94
  51. package/dist/runtime-lit.d.ts.map +0 -1
  52. package/dist/runtime-lit.js +0 -402
  53. package/dist/sanitizer.js +0 -84
  54. package/dist/summarize.js +0 -86
  55. package/dist/tooltip.js +0 -279
  56. package/dist/tour-types.js +0 -7
  57. package/dist/types.js +0 -7
  58. package/dist/workflow-types.js +0 -1
  59. package/node_modules/@syntro/design-system/README.md +0 -335
  60. package/node_modules/@syntro/design-system/dist/assets/syntrologie-logo.svg +0 -21
  61. package/node_modules/@syntro/design-system/dist/assets/syntrologie-logomark.svg +0 -10
  62. package/node_modules/@syntro/design-system/dist/index.d.ts +0 -8
  63. package/node_modules/@syntro/design-system/dist/index.d.ts.map +0 -1
  64. package/node_modules/@syntro/design-system/dist/index.js +0 -7
  65. package/node_modules/@syntro/design-system/dist/tailwind-preset.d.ts +0 -19
  66. package/node_modules/@syntro/design-system/dist/tailwind-preset.d.ts.map +0 -1
  67. package/node_modules/@syntro/design-system/dist/tailwind-preset.js +0 -455
  68. package/node_modules/@syntro/design-system/dist/tokens/colors.css +0 -464
  69. package/node_modules/@syntro/design-system/dist/tokens/colors.d.ts +0 -874
  70. package/node_modules/@syntro/design-system/dist/tokens/colors.d.ts.map +0 -1
  71. package/node_modules/@syntro/design-system/dist/tokens/colors.js +0 -564
  72. package/node_modules/@syntro/design-system/dist/tokens/effects.css +0 -43
  73. package/node_modules/@syntro/design-system/dist/tokens/effects.d.ts +0 -139
  74. package/node_modules/@syntro/design-system/dist/tokens/effects.d.ts.map +0 -1
  75. package/node_modules/@syntro/design-system/dist/tokens/effects.js +0 -121
  76. package/node_modules/@syntro/design-system/dist/tokens/index.d.ts +0 -12
  77. package/node_modules/@syntro/design-system/dist/tokens/index.d.ts.map +0 -1
  78. package/node_modules/@syntro/design-system/dist/tokens/index.js +0 -11
  79. package/node_modules/@syntro/design-system/dist/tokens/panel-shell.d.ts +0 -93
  80. package/node_modules/@syntro/design-system/dist/tokens/panel-shell.d.ts.map +0 -1
  81. package/node_modules/@syntro/design-system/dist/tokens/panel-shell.js +0 -72
  82. package/node_modules/@syntro/design-system/package.json +0 -55
  83. package/node_modules/@syntro/design-system/src/assets/syntrologie-logo.svg +0 -21
  84. package/node_modules/@syntro/design-system/src/assets/syntrologie-logomark.svg +0 -10
  85. package/node_modules/@syntrologie/shared-editor-ui/dist/cn.d.ts +0 -2
  86. package/node_modules/@syntrologie/shared-editor-ui/dist/cn.d.ts.map +0 -1
  87. package/node_modules/@syntrologie/shared-editor-ui/dist/cn.js +0 -3
  88. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.d.ts +0 -34
  89. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.d.ts.map +0 -1
  90. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.js +0 -161
  91. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPickerLit.d.ts +0 -84
  92. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPickerLit.d.ts.map +0 -1
  93. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPickerLit.js +0 -323
  94. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.d.ts +0 -7
  95. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.d.ts.map +0 -1
  96. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.js +0 -9
  97. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggleLit.d.ts +0 -25
  98. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggleLit.d.ts.map +0 -1
  99. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggleLit.js +0 -55
  100. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts +0 -23
  101. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts.map +0 -1
  102. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.js +0 -40
  103. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLineLit.d.ts +0 -33
  104. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLineLit.d.ts.map +0 -1
  105. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLineLit.js +0 -118
  106. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.d.ts +0 -7
  107. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.d.ts.map +0 -1
  108. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.js +0 -22
  109. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadgeLit.d.ts +0 -32
  110. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadgeLit.d.ts.map +0 -1
  111. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadgeLit.js +0 -68
  112. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.d.ts +0 -8
  113. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.d.ts.map +0 -1
  114. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.js +0 -9
  115. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSectionLit.d.ts +0 -34
  116. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSectionLit.d.ts.map +0 -1
  117. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSectionLit.js +0 -57
  118. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.d.ts +0 -7
  119. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.d.ts.map +0 -1
  120. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.js +0 -4
  121. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButtonLit.d.ts +0 -13
  122. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButtonLit.d.ts.map +0 -1
  123. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButtonLit.js +0 -31
  124. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.d.ts +0 -7
  125. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.d.ts.map +0 -1
  126. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.js +0 -4
  127. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBodyLit.d.ts +0 -7
  128. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBodyLit.d.ts.map +0 -1
  129. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBodyLit.js +0 -15
  130. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.d.ts +0 -13
  131. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.d.ts.map +0 -1
  132. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.js +0 -15
  133. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCardLit.d.ts +0 -36
  134. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCardLit.d.ts.map +0 -1
  135. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCardLit.js +0 -102
  136. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.d.ts +0 -7
  137. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.d.ts.map +0 -1
  138. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.js +0 -4
  139. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooterLit.d.ts +0 -20
  140. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooterLit.d.ts.map +0 -1
  141. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooterLit.js +0 -48
  142. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.d.ts +0 -9
  143. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.d.ts.map +0 -1
  144. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.js +0 -4
  145. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeaderLit.d.ts +0 -16
  146. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeaderLit.d.ts.map +0 -1
  147. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeaderLit.js +0 -25
  148. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.d.ts +0 -8
  149. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.d.ts.map +0 -1
  150. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.js +0 -8
  151. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInputLit.d.ts +0 -66
  152. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInputLit.d.ts.map +0 -1
  153. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInputLit.js +0 -87
  154. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.d.ts +0 -7
  155. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.d.ts.map +0 -1
  156. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.js +0 -4
  157. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayoutLit.d.ts +0 -7
  158. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayoutLit.d.ts.map +0 -1
  159. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayoutLit.js +0 -15
  160. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.d.ts +0 -25
  161. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.d.ts.map +0 -1
  162. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.js +0 -390
  163. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShellLit.d.ts +0 -66
  164. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShellLit.d.ts.map +0 -1
  165. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShellLit.js +0 -528
  166. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.d.ts +0 -8
  167. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.d.ts.map +0 -1
  168. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.js +0 -8
  169. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelectLit.d.ts +0 -41
  170. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelectLit.d.ts.map +0 -1
  171. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelectLit.js +0 -63
  172. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.d.ts +0 -8
  173. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.d.ts.map +0 -1
  174. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.js +0 -17
  175. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextareaLit.d.ts +0 -55
  176. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextareaLit.d.ts.map +0 -1
  177. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextareaLit.js +0 -92
  178. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.d.ts +0 -32
  179. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.d.ts.map +0 -1
  180. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.js +0 -85
  181. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlightLit.d.ts +0 -90
  182. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlightLit.d.ts.map +0 -1
  183. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlightLit.js +0 -242
  184. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.d.ts +0 -6
  185. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.d.ts.map +0 -1
  186. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.js +0 -4
  187. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyStateLit.d.ts +0 -12
  188. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyStateLit.d.ts.map +0 -1
  189. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyStateLit.js +0 -21
  190. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.d.ts +0 -8
  191. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.d.ts.map +0 -1
  192. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.js +0 -5
  193. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeaderLit.d.ts +0 -21
  194. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeaderLit.d.ts.map +0 -1
  195. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeaderLit.js +0 -33
  196. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.d.ts +0 -12
  197. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.d.ts.map +0 -1
  198. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.js +0 -40
  199. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourneyLit.d.ts +0 -28
  200. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourneyLit.d.ts.map +0 -1
  201. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourneyLit.js +0 -121
  202. package/node_modules/@syntrologie/shared-editor-ui/dist/controllers/PanelShellController.d.ts +0 -110
  203. package/node_modules/@syntrologie/shared-editor-ui/dist/controllers/PanelShellController.d.ts.map +0 -1
  204. package/node_modules/@syntrologie/shared-editor-ui/dist/controllers/PanelShellController.js +0 -481
  205. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts +0 -26
  206. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts.map +0 -1
  207. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.js +0 -202
  208. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.d.ts +0 -8
  209. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.d.ts.map +0 -1
  210. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.js +0 -46
  211. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.d.ts +0 -24
  212. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.d.ts.map +0 -1
  213. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.js +0 -86
  214. package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts +0 -36
  215. package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts.map +0 -1
  216. package/node_modules/@syntrologie/shared-editor-ui/dist/index.js +0 -26
  217. package/node_modules/@syntrologie/shared-editor-ui/dist/lit-elements.d.ts +0 -15
  218. package/node_modules/@syntrologie/shared-editor-ui/dist/lit-elements.d.ts.map +0 -1
  219. package/node_modules/@syntrologie/shared-editor-ui/dist/lit-elements.js +0 -14
  220. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/elementChainRecommender.d.ts +0 -33
  221. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/elementChainRecommender.d.ts.map +0 -1
  222. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/elementChainRecommender.js +0 -68
  223. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.d.ts +0 -22
  224. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.d.ts.map +0 -1
  225. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.js +0 -143
  226. package/node_modules/@syntrologie/shared-editor-ui/package.json +0 -55
package/dist/modal.js DELETED
@@ -1,218 +0,0 @@
1
- /**
2
- * Modal Executor
3
- *
4
- * Displays a centered modal dialog with optional CTA buttons.
5
- * Uses CSS custom properties (var()) directly in inline styles so theming
6
- * is live — no timing dependency on when ThemeProvider injects vars.
7
- */
8
- import { sanitizeHtml } from './sanitizer';
9
- // CSS var shorthands with fallbacks (mirrors tooltip/toast pattern)
10
- const V = {
11
- bg: 'var(--sc-overlay-background, #ffffff)',
12
- title: 'var(--sc-overlay-title-color, var(--sc-overlay-text-color, #111827))',
13
- text: 'var(--sc-overlay-text-color, #4b5563)',
14
- accent: 'var(--sc-color-primary, #4f46e5)',
15
- radius: 'var(--sc-border-radius, 12px)',
16
- };
17
- /**
18
- * Execute a modal action
19
- */
20
- export const executeModal = async (action, context) => {
21
- const { content, size = 'md', blocking = false, scrim, dismiss, ctaButtons } = action;
22
- // Create scrim backdrop
23
- const scrimEl = document.createElement('div');
24
- scrimEl.className = 'syntro-modal-scrim';
25
- scrimEl.style.cssText = `
26
- position: fixed;
27
- inset: 0;
28
- background: rgba(0, 0, 0, ${scrim?.opacity ?? 0.6});
29
- z-index: 2147483645;
30
- opacity: 0;
31
- transition: opacity 200ms ease-out;
32
- `;
33
- context.overlayRoot.appendChild(scrimEl);
34
- // Create modal container
35
- const modal = document.createElement('div');
36
- modal.className = `syntro-modal syntro-modal-${size}`;
37
- modal.setAttribute('role', 'dialog');
38
- modal.setAttribute('aria-modal', 'true');
39
- // Size-based max-widths
40
- const sizeMap = { sm: '360px', md: '480px', lg: '640px' };
41
- modal.style.cssText = `
42
- position: fixed;
43
- top: 50%;
44
- left: 50%;
45
- transform: translate(-50%, -50%) scale(0.95);
46
- max-width: ${sizeMap[size]};
47
- width: 90%;
48
- background: ${V.bg};
49
- border-radius: ${V.radius};
50
- box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
51
- z-index: 2147483646;
52
- opacity: 0;
53
- transition: opacity 200ms ease-out, transform 200ms ease-out;
54
- padding: 24px;
55
- `;
56
- // Build modal HTML content
57
- let html = '';
58
- if (content.title) {
59
- html += `<h2 class="syntro-modal-title" style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600; color: ${V.title};">${sanitizeHtml(content.title)}</h2>`;
60
- }
61
- html += `<div class="syntro-modal-body" style="color: ${V.text}; line-height: 1.5;">${sanitizeHtml(content.body)}</div>`;
62
- // Add close button if enabled
63
- if (dismiss?.closeButton !== false) {
64
- html += `
65
- <button class="syntro-modal-close" data-syntro-action="dismiss" style="
66
- position: absolute;
67
- top: 16px;
68
- right: 16px;
69
- background: none;
70
- border: none;
71
- cursor: pointer;
72
- padding: 4px;
73
- color: ${V.text};
74
- opacity: 0.6;
75
- " aria-label="Close">
76
- <svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor">
77
- <path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/>
78
- </svg>
79
- </button>
80
- `;
81
- }
82
- // Add CTA buttons
83
- if (ctaButtons && ctaButtons.length > 0) {
84
- html += `<div class="syntro-modal-actions" style="display: flex; gap: 12px; margin-top: 24px; justify-content: flex-end;">`;
85
- for (const btn of ctaButtons) {
86
- const isPrimary = btn.primary ?? false;
87
- html += `
88
- <button
89
- class="syntro-modal-btn ${isPrimary ? 'syntro-modal-btn-primary' : ''}"
90
- data-syntro-action="${sanitizeHtml(btn.actionId)}"
91
- style="
92
- padding: 10px 20px;
93
- border-radius: 8px;
94
- font-size: 14px;
95
- font-weight: 500;
96
- cursor: pointer;
97
- transition: background 150ms ease;
98
- ${isPrimary
99
- ? `background: ${V.accent}; color: white; border: none;`
100
- : `background: transparent; color: ${V.accent}; border: 1px solid currentColor; opacity: 0.7;`}
101
- "
102
- >
103
- ${sanitizeHtml(btn.label)}
104
- </button>
105
- `;
106
- }
107
- html += `</div>`;
108
- }
109
- modal.innerHTML = html;
110
- context.overlayRoot.appendChild(modal);
111
- // Track state for waitFor
112
- let actionClicked = null;
113
- // Handle action button clicks
114
- const actionBtns = modal.querySelectorAll('[data-syntro-action]');
115
- const actionHandler = (e) => {
116
- const btn = e.currentTarget;
117
- const actionId = btn.getAttribute('data-syntro-action');
118
- if (actionId) {
119
- actionClicked = actionId;
120
- context.publishEvent('action.modal_cta_clicked', {
121
- actionId,
122
- });
123
- handle.destroy();
124
- }
125
- };
126
- actionBtns.forEach((btn) => btn.addEventListener('click', actionHandler));
127
- // Handle escape key
128
- const onKey = (e) => {
129
- if (e.key === 'Escape' && dismiss?.onEsc !== false) {
130
- handle.destroy();
131
- }
132
- };
133
- window.addEventListener('keydown', onKey);
134
- // Handle click outside (on scrim)
135
- const onScrimClick = () => {
136
- if (!blocking) {
137
- handle.destroy();
138
- }
139
- };
140
- scrimEl.addEventListener('click', onScrimClick);
141
- // Blocking mode - make siblings inert (except editor panel)
142
- const originalInert = [];
143
- if (blocking) {
144
- Array.from(document.body.children).forEach((el) => {
145
- if (el !== context.overlayRoot &&
146
- el.getAttribute('inert') === null &&
147
- !el.querySelector('[data-syntro-editor-panel]') &&
148
- !el.hasAttribute('data-syntro-editor-panel')) {
149
- el.setAttribute('inert', '');
150
- originalInert.push(el);
151
- }
152
- });
153
- }
154
- // Set up timeout if specified
155
- let timeoutId;
156
- if (dismiss?.timeoutMs) {
157
- timeoutId = setTimeout(() => {
158
- handle.destroy();
159
- }, dismiss.timeoutMs);
160
- }
161
- // Focus first focusable element
162
- const focusableEls = modal.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
163
- if (focusableEls.length > 0) {
164
- requestAnimationFrame(() => focusableEls[0].focus());
165
- }
166
- // Fade in
167
- requestAnimationFrame(() => {
168
- scrimEl.style.opacity = '1';
169
- modal.style.opacity = '1';
170
- modal.style.transform = 'translate(-50%, -50%) scale(1)';
171
- });
172
- context.publishEvent('action.applied', {
173
- id: context.generateId(),
174
- kind: 'overlays:modal',
175
- size,
176
- blocking,
177
- });
178
- const handle = {
179
- destroy() {
180
- if (timeoutId) {
181
- clearTimeout(timeoutId);
182
- }
183
- window.removeEventListener('keydown', onKey);
184
- scrimEl.removeEventListener('click', onScrimClick);
185
- actionBtns.forEach((btn) => btn.removeEventListener('click', actionHandler));
186
- // Restore inert state
187
- originalInert.forEach((el) => el.removeAttribute('inert'));
188
- // Fade out then remove
189
- modal.style.pointerEvents = 'none';
190
- scrimEl.style.pointerEvents = 'none';
191
- modal.style.opacity = '0';
192
- modal.style.transform = 'translate(-50%, -50%) scale(0.95)';
193
- scrimEl.style.opacity = '0';
194
- setTimeout(() => {
195
- try {
196
- modal.remove();
197
- }
198
- catch {
199
- /* already detached */
200
- }
201
- try {
202
- scrimEl.remove();
203
- }
204
- catch {
205
- /* already detached */
206
- }
207
- }, 200);
208
- context.publishEvent('action.modal_dismissed', {
209
- actionClicked,
210
- });
211
- },
212
- };
213
- return {
214
- cleanup: () => {
215
- handle.destroy();
216
- },
217
- };
218
- };
@@ -1,41 +0,0 @@
1
- /**
2
- * Adaptive Overlays - Editor State & Helpers
3
- *
4
- * Pure logic: anchor resolution, types, section configuration,
5
- * flatten/filter helpers, tour step utilities, and dismissal logic.
6
- * No React or JSX — consumed by the UI module.
7
- */
8
- import type { OverlaysConfig } from './schema';
9
- import type { TourStep } from './types';
10
- /** Extract the CSS selector string from an anchorId object. */
11
- export declare function resolveAnchorSelector(anchorId: unknown): string;
12
- /** Extract the target route from an AnchorId object, ignoring wildcard '**'. */
13
- export declare function resolveAnchorRoute(anchorId: unknown): string | null;
14
- /** Save a pending highlight selector to sessionStorage (inlined to avoid cross-package import). */
15
- export declare function savePendingHighlight(selector: string): void;
16
- export type OverlaySection = 'tooltips' | 'highlights' | 'badges' | 'pulses' | 'modals';
17
- export type SectionKey = OverlaySection | 'tours';
18
- export declare function itemKey(section: SectionKey, index: number): string;
19
- export declare const OVERLAY_SECTIONS: OverlaySection[];
20
- export interface FlatItem {
21
- key: string;
22
- section: SectionKey;
23
- index: number;
24
- summary: string;
25
- anchorId: string;
26
- rawAnchorId: unknown;
27
- isTour: boolean;
28
- }
29
- export declare function flattenItems(config: OverlaysConfig): FlatItem[];
30
- export declare function filterConfig(config: OverlaysConfig, dismissedKeys: Set<string>): OverlaysConfig;
31
- export declare function getStepIcon(step: TourStep): string;
32
- export declare function getStepLabel(step: TourStep): string;
33
- export interface DetectionEntry {
34
- found: boolean;
35
- element: HTMLElement | null;
36
- }
37
- export declare function parseOverlayItemKey(key: string): {
38
- section: OverlaySection;
39
- index: number;
40
- };
41
- //# sourceMappingURL=overlay-editor-state.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"overlay-editor-state.d.ts","sourceRoot":"","sources":["../src/overlay-editor-state.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAMxC,+DAA+D;AAC/D,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAK/D;AAED,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CASnE;AAED,mGAAmG;AACnG,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,QAMpD;AAMD,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACxF,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC;AAElD,wBAAgB,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAElE;AAMD,eAAO,MAAM,gBAAgB,EAAE,cAAc,EAM5C,CAAC;AAMF,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ,EAAE,CAkC/D;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,cAAc,CAW/F;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CASlD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAQnD;AAMD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;CAC7B;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAG3F"}
@@ -1,131 +0,0 @@
1
- /**
2
- * Adaptive Overlays - Editor State & Helpers
3
- *
4
- * Pure logic: anchor resolution, types, section configuration,
5
- * flatten/filter helpers, tour step utilities, and dismissal logic.
6
- * No React or JSX — consumed by the UI module.
7
- */
8
- import { summarizeOverlayItem } from './summarize';
9
- // ============================================================================
10
- // Anchor Helpers
11
- // ============================================================================
12
- /** Extract the CSS selector string from an anchorId object. */
13
- export function resolveAnchorSelector(anchorId) {
14
- if (!anchorId)
15
- return '';
16
- if (typeof anchorId === 'string')
17
- return anchorId;
18
- if (typeof anchorId === 'object')
19
- return anchorId.selector ?? '';
20
- return '';
21
- }
22
- /** Extract the target route from an AnchorId object, ignoring wildcard '**'. */
23
- export function resolveAnchorRoute(anchorId) {
24
- if (!anchorId || typeof anchorId !== 'object')
25
- return null;
26
- const route = anchorId.route;
27
- if (typeof route === 'string' && route !== '**')
28
- return route;
29
- if (Array.isArray(route)) {
30
- const first = route.find((r) => typeof r === 'string' && r !== '**');
31
- return first ?? null;
32
- }
33
- return null;
34
- }
35
- /** Save a pending highlight selector to sessionStorage (inlined to avoid cross-package import). */
36
- export function savePendingHighlight(selector) {
37
- try {
38
- sessionStorage.setItem('syntro:editor:pending-highlight', selector);
39
- }
40
- catch {
41
- // Silently ignore
42
- }
43
- }
44
- export function itemKey(section, index) {
45
- return `${section}:${index}`;
46
- }
47
- // ============================================================================
48
- // Section Config
49
- // ============================================================================
50
- export const OVERLAY_SECTIONS = [
51
- 'tooltips',
52
- 'highlights',
53
- 'badges',
54
- 'pulses',
55
- 'modals',
56
- ];
57
- export function flattenItems(config) {
58
- const items = [];
59
- for (const section of OVERLAY_SECTIONS) {
60
- const arr = config[section] || [];
61
- arr.forEach((item, i) => {
62
- const rec = item;
63
- items.push({
64
- key: itemKey(section, i),
65
- section,
66
- index: i,
67
- summary: summarizeOverlayItem(section, rec),
68
- anchorId: resolveAnchorSelector(rec.anchorId),
69
- rawAnchorId: rec.anchorId,
70
- isTour: false,
71
- });
72
- });
73
- }
74
- // Tours
75
- const tours = config.tours || [];
76
- tours.forEach((tour, i) => {
77
- items.push({
78
- key: itemKey('tours', i),
79
- section: 'tours',
80
- index: i,
81
- summary: summarizeOverlayItem('tours', tour),
82
- anchorId: '',
83
- rawAnchorId: undefined,
84
- isTour: true,
85
- });
86
- });
87
- return items;
88
- }
89
- export function filterConfig(config, dismissedKeys) {
90
- const result = { ...config };
91
- const allSections = [...OVERLAY_SECTIONS, 'tours'];
92
- for (const section of allSections) {
93
- const arr = config[section] || [];
94
- const filtered = arr.filter((_, i) => !dismissedKeys.has(itemKey(section, i)));
95
- if (filtered.length > 0 || config[section] !== undefined) {
96
- result[section] = filtered;
97
- }
98
- }
99
- return result;
100
- }
101
- export function getStepIcon(step) {
102
- const action = step.action;
103
- const kind = action.kind || '';
104
- if (kind.includes('tooltip'))
105
- return '\u{1f4ac}';
106
- if (kind.includes('highlight'))
107
- return '\u{2728}';
108
- if (kind.includes('modal'))
109
- return '\u{1f4e6}';
110
- if (kind.includes('badge'))
111
- return '\u{1f3f7}\u{fe0f}';
112
- if (kind.includes('pulse'))
113
- return '\u{1f4ab}';
114
- return '\u{25cf}';
115
- }
116
- export function getStepLabel(step) {
117
- const action = step.action;
118
- const anchor = resolveAnchorSelector(action.anchorId);
119
- if (anchor)
120
- return anchor;
121
- const content = action.content;
122
- if (content?.title)
123
- return content.title;
124
- if (content?.body)
125
- return content.body.slice(0, 30);
126
- return step.id;
127
- }
128
- export function parseOverlayItemKey(key) {
129
- const [section, indexStr] = key.split(':');
130
- return { section: section, index: Number(indexStr) };
131
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * Adaptive Overlays - Editor UI Component
3
- *
4
- * Main editor component, tabs, forms, tour drill-in, item editing, save/publish.
5
- * All React/JSX lives here; pure logic is imported from overlay-editor-state.
6
- */
7
- import type { EditorPanelProps } from './types';
8
- export declare function OverlaysEditor({ config, onChange, editor }: EditorPanelProps): import("react/jsx-runtime").JSX.Element;
9
- //# sourceMappingURL=overlay-editor-ui.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"overlay-editor-ui.d.ts","sourceRoot":"","sources":["../src/overlay-editor-ui.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgCH,OAAO,KAAK,EAAE,gBAAgB,EAAY,MAAM,SAAS,CAAC;AAkF1D,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,gBAAgB,2CA+e5E"}