@syntrologie/adapt-nav 2.16.0 → 2.17.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 (211) hide show
  1. package/dist/NavWidgetLit.d.ts.map +1 -1
  2. package/dist/chunk-HMLY7DHA.js +16 -0
  3. package/dist/chunk-HMLY7DHA.js.map +7 -0
  4. package/dist/chunk-ZYHZ6JAD.js +447 -0
  5. package/dist/chunk-ZYHZ6JAD.js.map +7 -0
  6. package/dist/editor.d.ts +42 -21
  7. package/dist/editor.d.ts.map +1 -1
  8. package/dist/editor.js +310 -313
  9. package/dist/editor.js.map +7 -0
  10. package/dist/resolveNavTarget.d.ts +61 -0
  11. package/dist/resolveNavTarget.d.ts.map +1 -0
  12. package/dist/resolveNavTarget.test.d.ts +2 -0
  13. package/dist/resolveNavTarget.test.d.ts.map +1 -0
  14. package/dist/runtime.d.ts +3 -4
  15. package/dist/runtime.d.ts.map +1 -1
  16. package/dist/runtime.js +612 -221
  17. package/dist/runtime.js.map +7 -0
  18. package/dist/schema.d.ts +182 -72
  19. package/dist/schema.d.ts.map +1 -1
  20. package/dist/schema.js +155 -125
  21. package/dist/schema.js.map +7 -0
  22. package/package.json +9 -24
  23. package/dist/NavWidget.d.ts +0 -31
  24. package/dist/NavWidget.d.ts.map +0 -1
  25. package/dist/NavWidget.js +0 -476
  26. package/dist/NavWidgetLit.js +0 -495
  27. package/dist/NavWidgetLit.test.js +0 -199
  28. package/dist/cdn.d.ts +0 -62
  29. package/dist/cdn.d.ts.map +0 -1
  30. package/dist/cdn.js +0 -48
  31. package/dist/editor-lit.d.ts +0 -49
  32. package/dist/editor-lit.d.ts.map +0 -1
  33. package/dist/editor-lit.js +0 -319
  34. package/dist/runtime-lit.d.ts +0 -108
  35. package/dist/runtime-lit.d.ts.map +0 -1
  36. package/dist/runtime-lit.js +0 -241
  37. package/dist/summarize.js +0 -51
  38. package/dist/types.js +0 -18
  39. package/node_modules/@syntro/design-system/README.md +0 -335
  40. package/node_modules/@syntro/design-system/dist/assets/syntrologie-logo.svg +0 -21
  41. package/node_modules/@syntro/design-system/dist/assets/syntrologie-logomark.svg +0 -10
  42. package/node_modules/@syntro/design-system/dist/index.d.ts +0 -8
  43. package/node_modules/@syntro/design-system/dist/index.d.ts.map +0 -1
  44. package/node_modules/@syntro/design-system/dist/index.js +0 -7
  45. package/node_modules/@syntro/design-system/dist/tailwind-preset.d.ts +0 -19
  46. package/node_modules/@syntro/design-system/dist/tailwind-preset.d.ts.map +0 -1
  47. package/node_modules/@syntro/design-system/dist/tailwind-preset.js +0 -455
  48. package/node_modules/@syntro/design-system/dist/tokens/colors.css +0 -464
  49. package/node_modules/@syntro/design-system/dist/tokens/colors.d.ts +0 -874
  50. package/node_modules/@syntro/design-system/dist/tokens/colors.d.ts.map +0 -1
  51. package/node_modules/@syntro/design-system/dist/tokens/colors.js +0 -564
  52. package/node_modules/@syntro/design-system/dist/tokens/effects.css +0 -43
  53. package/node_modules/@syntro/design-system/dist/tokens/effects.d.ts +0 -139
  54. package/node_modules/@syntro/design-system/dist/tokens/effects.d.ts.map +0 -1
  55. package/node_modules/@syntro/design-system/dist/tokens/effects.js +0 -121
  56. package/node_modules/@syntro/design-system/dist/tokens/index.d.ts +0 -12
  57. package/node_modules/@syntro/design-system/dist/tokens/index.d.ts.map +0 -1
  58. package/node_modules/@syntro/design-system/dist/tokens/index.js +0 -11
  59. package/node_modules/@syntro/design-system/dist/tokens/panel-shell.d.ts +0 -93
  60. package/node_modules/@syntro/design-system/dist/tokens/panel-shell.d.ts.map +0 -1
  61. package/node_modules/@syntro/design-system/dist/tokens/panel-shell.js +0 -72
  62. package/node_modules/@syntro/design-system/package.json +0 -55
  63. package/node_modules/@syntro/design-system/src/assets/syntrologie-logo.svg +0 -21
  64. package/node_modules/@syntro/design-system/src/assets/syntrologie-logomark.svg +0 -10
  65. package/node_modules/@syntrologie/sdk-contracts/dist/index.d.ts +0 -129
  66. package/node_modules/@syntrologie/sdk-contracts/dist/index.js +0 -17
  67. package/node_modules/@syntrologie/sdk-contracts/dist/schemas.d.ts +0 -2296
  68. package/node_modules/@syntrologie/sdk-contracts/dist/schemas.js +0 -361
  69. package/node_modules/@syntrologie/sdk-contracts/package.json +0 -33
  70. package/node_modules/@syntrologie/shared-editor-ui/dist/cn.d.ts +0 -2
  71. package/node_modules/@syntrologie/shared-editor-ui/dist/cn.d.ts.map +0 -1
  72. package/node_modules/@syntrologie/shared-editor-ui/dist/cn.js +0 -3
  73. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.d.ts +0 -34
  74. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.d.ts.map +0 -1
  75. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.js +0 -161
  76. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPickerLit.d.ts +0 -84
  77. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPickerLit.d.ts.map +0 -1
  78. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPickerLit.js +0 -323
  79. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.d.ts +0 -7
  80. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.d.ts.map +0 -1
  81. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.js +0 -9
  82. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggleLit.d.ts +0 -25
  83. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggleLit.d.ts.map +0 -1
  84. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggleLit.js +0 -55
  85. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts +0 -23
  86. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts.map +0 -1
  87. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.js +0 -40
  88. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLineLit.d.ts +0 -33
  89. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLineLit.d.ts.map +0 -1
  90. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLineLit.js +0 -118
  91. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.d.ts +0 -7
  92. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.d.ts.map +0 -1
  93. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.js +0 -22
  94. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadgeLit.d.ts +0 -32
  95. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadgeLit.d.ts.map +0 -1
  96. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadgeLit.js +0 -68
  97. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.d.ts +0 -8
  98. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.d.ts.map +0 -1
  99. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.js +0 -9
  100. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSectionLit.d.ts +0 -34
  101. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSectionLit.d.ts.map +0 -1
  102. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSectionLit.js +0 -57
  103. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.d.ts +0 -7
  104. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.d.ts.map +0 -1
  105. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.js +0 -4
  106. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButtonLit.d.ts +0 -13
  107. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButtonLit.d.ts.map +0 -1
  108. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButtonLit.js +0 -31
  109. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.d.ts +0 -7
  110. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.d.ts.map +0 -1
  111. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.js +0 -4
  112. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBodyLit.d.ts +0 -7
  113. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBodyLit.d.ts.map +0 -1
  114. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBodyLit.js +0 -15
  115. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.d.ts +0 -13
  116. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.d.ts.map +0 -1
  117. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.js +0 -15
  118. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCardLit.d.ts +0 -36
  119. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCardLit.d.ts.map +0 -1
  120. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCardLit.js +0 -102
  121. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.d.ts +0 -7
  122. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.d.ts.map +0 -1
  123. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.js +0 -4
  124. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooterLit.d.ts +0 -20
  125. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooterLit.d.ts.map +0 -1
  126. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooterLit.js +0 -48
  127. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.d.ts +0 -9
  128. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.d.ts.map +0 -1
  129. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.js +0 -4
  130. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeaderLit.d.ts +0 -16
  131. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeaderLit.d.ts.map +0 -1
  132. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeaderLit.js +0 -25
  133. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.d.ts +0 -8
  134. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.d.ts.map +0 -1
  135. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.js +0 -8
  136. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInputLit.d.ts +0 -66
  137. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInputLit.d.ts.map +0 -1
  138. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInputLit.js +0 -87
  139. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.d.ts +0 -7
  140. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.d.ts.map +0 -1
  141. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.js +0 -4
  142. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayoutLit.d.ts +0 -7
  143. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayoutLit.d.ts.map +0 -1
  144. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayoutLit.js +0 -15
  145. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.d.ts +0 -25
  146. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.d.ts.map +0 -1
  147. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.js +0 -390
  148. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShellLit.d.ts +0 -66
  149. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShellLit.d.ts.map +0 -1
  150. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShellLit.js +0 -528
  151. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.d.ts +0 -8
  152. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.d.ts.map +0 -1
  153. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.js +0 -8
  154. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelectLit.d.ts +0 -41
  155. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelectLit.d.ts.map +0 -1
  156. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelectLit.js +0 -63
  157. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.d.ts +0 -8
  158. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.d.ts.map +0 -1
  159. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.js +0 -17
  160. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextareaLit.d.ts +0 -55
  161. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextareaLit.d.ts.map +0 -1
  162. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextareaLit.js +0 -92
  163. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.d.ts +0 -32
  164. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.d.ts.map +0 -1
  165. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.js +0 -85
  166. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlightLit.d.ts +0 -90
  167. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlightLit.d.ts.map +0 -1
  168. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlightLit.js +0 -242
  169. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.d.ts +0 -6
  170. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.d.ts.map +0 -1
  171. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.js +0 -4
  172. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyStateLit.d.ts +0 -12
  173. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyStateLit.d.ts.map +0 -1
  174. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyStateLit.js +0 -21
  175. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.d.ts +0 -8
  176. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.d.ts.map +0 -1
  177. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.js +0 -5
  178. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeaderLit.d.ts +0 -21
  179. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeaderLit.d.ts.map +0 -1
  180. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeaderLit.js +0 -33
  181. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.d.ts +0 -12
  182. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.d.ts.map +0 -1
  183. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.js +0 -40
  184. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourneyLit.d.ts +0 -28
  185. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourneyLit.d.ts.map +0 -1
  186. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourneyLit.js +0 -121
  187. package/node_modules/@syntrologie/shared-editor-ui/dist/controllers/PanelShellController.d.ts +0 -110
  188. package/node_modules/@syntrologie/shared-editor-ui/dist/controllers/PanelShellController.d.ts.map +0 -1
  189. package/node_modules/@syntrologie/shared-editor-ui/dist/controllers/PanelShellController.js +0 -481
  190. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts +0 -26
  191. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts.map +0 -1
  192. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.js +0 -202
  193. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.d.ts +0 -8
  194. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.d.ts.map +0 -1
  195. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.js +0 -46
  196. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.d.ts +0 -24
  197. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.d.ts.map +0 -1
  198. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.js +0 -86
  199. package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts +0 -36
  200. package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts.map +0 -1
  201. package/node_modules/@syntrologie/shared-editor-ui/dist/index.js +0 -26
  202. package/node_modules/@syntrologie/shared-editor-ui/dist/lit-elements.d.ts +0 -15
  203. package/node_modules/@syntrologie/shared-editor-ui/dist/lit-elements.d.ts.map +0 -1
  204. package/node_modules/@syntrologie/shared-editor-ui/dist/lit-elements.js +0 -14
  205. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/elementChainRecommender.d.ts +0 -33
  206. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/elementChainRecommender.d.ts.map +0 -1
  207. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/elementChainRecommender.js +0 -68
  208. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.d.ts +0 -22
  209. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.d.ts.map +0 -1
  210. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.js +0 -143
  211. package/node_modules/@syntrologie/shared-editor-ui/package.json +0 -55
@@ -1,481 +0,0 @@
1
- /**
2
- * PanelShellController — Lit ReactiveController for draggable/resizable panels.
3
- *
4
- * Owns geometry state (position, size, dock), pointer-event handlers for the
5
- * drag FAB and 8 resize handles, localStorage persistence, and viewport
6
- * clamping. A consuming LitElement calls `attachFab(el)` / `attachHandle(el, dir)`
7
- * on its rendered DOM to hook up pointer events, and reads `panelStyles` /
8
- * `fabStyles` to position the panel + FAB.
9
- *
10
- * Why a controller, not a wrapper element: `<slot>`-based wrapper elements
11
- * don't compose well in light DOM (Lit wipes children on render), and shadow
12
- * DOM breaks Playwright child selectors used by E2E tests. A ReactiveController
13
- * is the Lit-idiomatic way to share stateful logic across elements.
14
- *
15
- * Emits one callback: `onToggle` when the FAB is pressed without dragging.
16
- */
17
- import { panelShell } from '@syntro/design-system';
18
- // =============================================================================
19
- // Constants
20
- // =============================================================================
21
- const DEFAULTS = {
22
- minWidth: panelShell.behavior.minWidth,
23
- minHeight: panelShell.behavior.minHeight,
24
- dragThreshold: panelShell.behavior.dragThreshold,
25
- snapThreshold: panelShell.behavior.snapThreshold,
26
- fabSize: panelShell.fab.size,
27
- fabInset: panelShell.fab.inset,
28
- storageKey: 'syntro:editor-panel',
29
- };
30
- const HANDLE_SIZE = panelShell.behavior.handleSize;
31
- // =============================================================================
32
- // Helpers
33
- // =============================================================================
34
- export function makeResizeHandles() {
35
- return [
36
- {
37
- dir: 'n',
38
- style: {
39
- top: '0',
40
- left: `${HANDLE_SIZE}px`,
41
- right: `${HANDLE_SIZE}px`,
42
- height: `${HANDLE_SIZE}px`,
43
- },
44
- cursor: 'ns-resize',
45
- },
46
- {
47
- dir: 's',
48
- style: {
49
- bottom: '0',
50
- left: `${HANDLE_SIZE}px`,
51
- right: `${HANDLE_SIZE}px`,
52
- height: `${HANDLE_SIZE}px`,
53
- },
54
- cursor: 'ns-resize',
55
- },
56
- {
57
- dir: 'e',
58
- style: {
59
- right: '0',
60
- top: `${HANDLE_SIZE}px`,
61
- bottom: `${HANDLE_SIZE}px`,
62
- width: `${HANDLE_SIZE}px`,
63
- },
64
- cursor: 'ew-resize',
65
- },
66
- {
67
- dir: 'w',
68
- style: {
69
- left: '0',
70
- top: `${HANDLE_SIZE}px`,
71
- bottom: `${HANDLE_SIZE}px`,
72
- width: `${HANDLE_SIZE}px`,
73
- },
74
- cursor: 'ew-resize',
75
- },
76
- {
77
- dir: 'ne',
78
- style: {
79
- top: '0',
80
- right: '0',
81
- width: `${HANDLE_SIZE * 2}px`,
82
- height: `${HANDLE_SIZE * 2}px`,
83
- },
84
- cursor: 'nesw-resize',
85
- },
86
- {
87
- dir: 'nw',
88
- style: {
89
- top: '0',
90
- left: '0',
91
- width: `${HANDLE_SIZE * 2}px`,
92
- height: `${HANDLE_SIZE * 2}px`,
93
- },
94
- cursor: 'nwse-resize',
95
- },
96
- {
97
- dir: 'se',
98
- style: {
99
- bottom: '0',
100
- right: '0',
101
- width: `${HANDLE_SIZE * 2}px`,
102
- height: `${HANDLE_SIZE * 2}px`,
103
- },
104
- cursor: 'nwse-resize',
105
- },
106
- {
107
- dir: 'sw',
108
- style: {
109
- bottom: '0',
110
- left: '0',
111
- width: `${HANDLE_SIZE * 2}px`,
112
- height: `${HANDLE_SIZE * 2}px`,
113
- },
114
- cursor: 'nesw-resize',
115
- },
116
- ];
117
- }
118
- // =============================================================================
119
- // Controller
120
- // =============================================================================
121
- export class PanelShellController {
122
- constructor(host, options = {}) {
123
- this._panelEl = null;
124
- this._fabEl = null;
125
- // Drag state
126
- this._isDragging = false;
127
- this._hasMoved = false;
128
- this._dragOffset = { x: 0, y: 0 };
129
- this._startPanelPos = { x: 0, y: 0 };
130
- this._pendingGeo = null;
131
- // Resize state
132
- this._activeResize = null;
133
- this._resizeStartMouse = { x: 0, y: 0 };
134
- // ---- FAB pointer handlers ----
135
- this.handleFabPointerDown = (e) => {
136
- this._isDragging = true;
137
- this._hasMoved = false;
138
- const rect = this.rect;
139
- this._startPanelPos = { x: rect.left, y: rect.top };
140
- this._dragOffset = { x: e.clientX - rect.left, y: e.clientY - rect.top };
141
- try {
142
- e.target.setPointerCapture(e.pointerId);
143
- }
144
- catch {
145
- // best-effort
146
- }
147
- e.preventDefault();
148
- };
149
- this.handleFabPointerMove = (e) => {
150
- if (!this._isDragging)
151
- return;
152
- const newX = e.clientX - this._dragOffset.x;
153
- const newY = e.clientY - this._dragOffset.y;
154
- if (!this._hasMoved) {
155
- const dx = Math.abs(newX - this._startPanelPos.x);
156
- const dy = Math.abs(newY - this._startPanelPos.y);
157
- if (dx < this.opts.dragThreshold && dy < this.opts.dragThreshold)
158
- return;
159
- this._hasMoved = true;
160
- }
161
- const geo = this._geometry;
162
- const height = geo.docked ? window.innerHeight : geo.height;
163
- this._writeStylesDuringGesture({ x: newX, y: newY, width: geo.width, height });
164
- this._pendingGeo = { x: newX, y: newY, width: geo.width, height, docked: null };
165
- };
166
- this.handleFabPointerUp = (e) => {
167
- try {
168
- e.target.releasePointerCapture(e.pointerId);
169
- }
170
- catch {
171
- // best-effort
172
- }
173
- const wasDragging = this._hasMoved;
174
- this._isDragging = false;
175
- this._hasMoved = false;
176
- if (!wasDragging) {
177
- this.opts.onToggle?.();
178
- return;
179
- }
180
- if (this._pendingGeo) {
181
- const geo = this._pendingGeo;
182
- if (geo.x <= this.opts.snapThreshold) {
183
- this._commit({ ...geo, docked: 'left', x: 0, y: 0 });
184
- }
185
- else if (geo.x + geo.width >= window.innerWidth - this.opts.snapThreshold) {
186
- this._commit({ ...geo, docked: 'right', x: 0, y: 0 });
187
- }
188
- else {
189
- this._commit(geo);
190
- }
191
- this._pendingGeo = null;
192
- }
193
- };
194
- // ---- Resize pointer handlers ----
195
- this.handleResizePointerDown = (dir, e) => {
196
- let geo = this._geometry;
197
- if (geo.docked) {
198
- geo = this._undockGeometry(geo);
199
- this._commit(geo);
200
- }
201
- this._activeResize = dir;
202
- this._resizeStartMouse = { x: e.clientX, y: e.clientY };
203
- this._resizeStartGeo = { ...geo };
204
- try {
205
- e.target.setPointerCapture(e.pointerId);
206
- }
207
- catch {
208
- // best-effort
209
- }
210
- e.preventDefault();
211
- };
212
- this.handleResizePointerMove = (e) => {
213
- if (!this._activeResize)
214
- return;
215
- const dx = e.clientX - this._resizeStartMouse.x;
216
- const dy = e.clientY - this._resizeStartMouse.y;
217
- const dir = this._activeResize;
218
- const start = this._resizeStartGeo;
219
- let { x, y, width, height } = start;
220
- if (dir.includes('e'))
221
- width = Math.max(this.opts.minWidth, start.width + dx);
222
- if (dir.includes('w')) {
223
- const newW = Math.max(this.opts.minWidth, start.width - dx);
224
- x = start.x + start.width - newW;
225
- width = newW;
226
- }
227
- if (dir.includes('s'))
228
- height = Math.max(this.opts.minHeight, start.height + dy);
229
- if (dir.includes('n')) {
230
- const newH = Math.max(this.opts.minHeight, start.height - dy);
231
- y = start.y + start.height - newH;
232
- height = newH;
233
- }
234
- this._writeStylesDuringGesture({ x, y, width, height });
235
- this._pendingGeo = { x, y, width, height, docked: null };
236
- };
237
- this.handleResizePointerUp = (e) => {
238
- try {
239
- e.target.releasePointerCapture(e.pointerId);
240
- }
241
- catch {
242
- // best-effort
243
- }
244
- this._activeResize = null;
245
- if (this._pendingGeo) {
246
- this._commit(this._pendingGeo);
247
- this._pendingGeo = null;
248
- }
249
- };
250
- this._onWindowResize = () => {
251
- this._commit(this._clampToViewport(this._geometry));
252
- };
253
- this.host = host;
254
- this.opts = {
255
- storageKey: options.storageKey ?? DEFAULTS.storageKey,
256
- minWidth: options.minWidth ?? DEFAULTS.minWidth,
257
- minHeight: options.minHeight ?? DEFAULTS.minHeight,
258
- dragThreshold: options.dragThreshold ?? DEFAULTS.dragThreshold,
259
- snapThreshold: options.snapThreshold ?? DEFAULTS.snapThreshold,
260
- fabSize: options.fabSize ?? DEFAULTS.fabSize,
261
- fabInset: options.fabInset ?? DEFAULTS.fabInset,
262
- onToggle: options.onToggle,
263
- defaultGeometry: this._resolveDefaultGeometry(options.defaultGeometry),
264
- };
265
- this._geometry = this.opts.defaultGeometry;
266
- this._resizeStartGeo = this._geometry;
267
- host.addController(this);
268
- }
269
- // ---- Public API ----
270
- /** Current geometry (read-only snapshot). */
271
- get geometry() {
272
- return this._geometry;
273
- }
274
- /** Pixel rect of the panel, resolving docked positions. */
275
- get rect() {
276
- return this._panelRect(this._geometry);
277
- }
278
- /** Pixel right edge of the panel (useful for positioning adjacent UI). */
279
- get rightEdge() {
280
- const r = this.rect;
281
- return r.left + r.width;
282
- }
283
- /** Set geometry directly — useful for testing or external state sync. */
284
- setGeometry(geo) {
285
- this._geometry = geo;
286
- this._saveGeometry(geo);
287
- this.host.requestUpdate();
288
- }
289
- /** Reset geometry to default (and clear persisted state). */
290
- reset() {
291
- this._geometry = this.opts.defaultGeometry;
292
- try {
293
- localStorage.removeItem(this.opts.storageKey);
294
- }
295
- catch {
296
- // ignore
297
- }
298
- this.host.requestUpdate();
299
- }
300
- /** Styles to apply to the panel element. */
301
- panelStyles() {
302
- const geo = this._geometry;
303
- const blur = `blur(${panelShell.backdropBlur})`;
304
- const shadow = geo.docked === 'right'
305
- ? panelShell.shadows.dockedRight
306
- : geo.docked === 'left'
307
- ? panelShell.shadows.dockedLeft
308
- : panelShell.shadows.floating;
309
- const styles = {
310
- position: 'fixed',
311
- pointerEvents: 'auto',
312
- background: panelShell.background,
313
- backdropFilter: blur,
314
- webkitBackdropFilter: blur,
315
- boxShadow: shadow,
316
- overflow: 'hidden',
317
- };
318
- if (geo.docked === 'left') {
319
- styles.top = '0';
320
- styles.left = '0';
321
- styles.width = `${geo.width}px`;
322
- styles.height = '100vh';
323
- }
324
- else if (geo.docked === 'right') {
325
- styles.top = '0';
326
- styles.right = '0';
327
- styles.width = `${geo.width}px`;
328
- styles.height = '100vh';
329
- }
330
- else {
331
- styles.top = `${geo.y}px`;
332
- styles.left = `${geo.x}px`;
333
- styles.width = `${geo.width}px`;
334
- styles.height = `${geo.height}px`;
335
- }
336
- return styles;
337
- }
338
- /** Styles to apply to the FAB button. `isOpen` adjusts the shadow. */
339
- fabStyles(isOpen) {
340
- const rect = this.rect;
341
- return {
342
- position: 'fixed',
343
- left: `${rect.left + this.opts.fabInset}px`,
344
- top: `${rect.top + rect.height - this.opts.fabSize - this.opts.fabInset}px`,
345
- pointerEvents: 'auto',
346
- width: `${this.opts.fabSize}px`,
347
- height: `${this.opts.fabSize}px`,
348
- borderRadius: '50%',
349
- border: panelShell.fab.border,
350
- cursor: 'grab',
351
- display: 'flex',
352
- alignItems: 'center',
353
- justifyContent: 'center',
354
- background: panelShell.fab.background,
355
- color: panelShell.fab.color,
356
- boxShadow: isOpen ? panelShell.fab.shadowOpen : panelShell.fab.shadowClosed,
357
- transition: 'box-shadow 150ms ease',
358
- touchAction: 'none',
359
- userSelect: 'none',
360
- webkitUserSelect: 'none',
361
- };
362
- }
363
- /** Direction descriptors for the 8 resize handles. */
364
- get handles() {
365
- return makeResizeHandles();
366
- }
367
- /** Bind the current panel element so the controller can direct-write styles during drag/resize. */
368
- attachPanel(el) {
369
- this._panelEl = el;
370
- }
371
- /** Bind the current FAB element. */
372
- attachFab(el) {
373
- this._fabEl = el;
374
- }
375
- // ---- ReactiveController lifecycle ----
376
- hostConnected() {
377
- this._geometry = this._loadGeometry();
378
- this.host.requestUpdate();
379
- if (typeof window !== 'undefined') {
380
- window.addEventListener('resize', this._onWindowResize);
381
- }
382
- }
383
- hostDisconnected() {
384
- if (typeof window !== 'undefined') {
385
- window.removeEventListener('resize', this._onWindowResize);
386
- }
387
- }
388
- // ---- Internals ----
389
- _commit(geo) {
390
- this._geometry = geo;
391
- this._saveGeometry(geo);
392
- this.host.requestUpdate();
393
- }
394
- _writeStylesDuringGesture({ x, y, width, height, }) {
395
- if (this._panelEl) {
396
- this._panelEl.style.left = `${x}px`;
397
- this._panelEl.style.top = `${y}px`;
398
- this._panelEl.style.right = 'auto';
399
- this._panelEl.style.width = `${width}px`;
400
- this._panelEl.style.height = `${height}px`;
401
- }
402
- if (this._fabEl) {
403
- this._fabEl.style.left = `${x + this.opts.fabInset}px`;
404
- this._fabEl.style.top = `${y + height - this.opts.fabSize - this.opts.fabInset}px`;
405
- }
406
- }
407
- _clampToViewport(geo) {
408
- if (geo.docked)
409
- return geo;
410
- const vw = window.innerWidth;
411
- const vh = window.innerHeight;
412
- // FAB sits at panel's bottom-left: fabTop = geo.y + geo.height - fabSize - fabInset.
413
- // Keep fabTop in [0, vh - fabSize] so the FAB stays on-screen even if the panel
414
- // extends above the viewport top or below the viewport bottom.
415
- const minY = this.opts.fabSize + this.opts.fabInset - geo.height;
416
- const maxY = vh - geo.height + this.opts.fabInset;
417
- return {
418
- ...geo,
419
- x: Math.max(-(geo.width - this.opts.fabSize), Math.min(geo.x, vw - this.opts.fabSize)),
420
- y: Math.max(minY, Math.min(geo.y, maxY)),
421
- };
422
- }
423
- _undockGeometry(geo) {
424
- const r = this._panelRect(geo);
425
- return { x: r.left, y: r.top, width: geo.width, height: r.height, docked: null };
426
- }
427
- _panelRect(geo) {
428
- if (geo.docked === 'left') {
429
- return { top: 0, left: 0, width: geo.width, height: window.innerHeight };
430
- }
431
- if (geo.docked === 'right') {
432
- return {
433
- top: 0,
434
- left: window.innerWidth - geo.width,
435
- width: geo.width,
436
- height: window.innerHeight,
437
- };
438
- }
439
- const { x: left, y: top, width, height } = geo;
440
- return { top, left, width, height };
441
- }
442
- _loadGeometry() {
443
- if (typeof window === 'undefined')
444
- return this.opts.defaultGeometry;
445
- try {
446
- const raw = localStorage.getItem(this.opts.storageKey);
447
- if (!raw)
448
- return this.opts.defaultGeometry;
449
- const p = JSON.parse(raw);
450
- return {
451
- x: typeof p.x === 'number' ? p.x : 0,
452
- y: typeof p.y === 'number' ? p.y : 0,
453
- width: Math.max(this.opts.minWidth, typeof p.width === 'number' ? p.width : this.opts.minWidth),
454
- height: Math.max(this.opts.minHeight, typeof p.height === 'number' ? p.height : window.innerHeight),
455
- docked: p.docked === 'left' || p.docked === 'right' ? p.docked : null,
456
- };
457
- }
458
- catch {
459
- return this.opts.defaultGeometry;
460
- }
461
- }
462
- _saveGeometry(geo) {
463
- try {
464
- localStorage.setItem(this.opts.storageKey, JSON.stringify(geo));
465
- }
466
- catch {
467
- // ignore
468
- }
469
- }
470
- _resolveDefaultGeometry(partial) {
471
- const w = typeof window !== 'undefined' ? window : null;
472
- const base = {
473
- x: 0,
474
- y: 0,
475
- width: DEFAULTS.minWidth,
476
- height: w ? w.innerHeight : 800,
477
- docked: 'right',
478
- };
479
- return { ...base, ...(partial ?? {}) };
480
- }
481
- }
@@ -1,26 +0,0 @@
1
- /**
2
- * Format a triggerWhen condition into a human-readable label.
3
- * Pure function — no runtime dependency.
4
- */
5
- interface ConditionLike {
6
- type: string;
7
- [key: string]: unknown;
8
- }
9
- export interface ConditionProgress {
10
- current: number;
11
- target: number;
12
- operator: string;
13
- }
14
- export interface FormattedCondition {
15
- label: string;
16
- instruction: string;
17
- shortLabel: string;
18
- progress?: ConditionProgress;
19
- }
20
- /**
21
- * Convert a Condition object into a human-readable label.
22
- * For event_count conditions, also returns progress data.
23
- */
24
- export declare function formatConditionLabel(condition: ConditionLike, accumulatorCount?: number): FormattedCondition;
25
- export {};
26
- //# sourceMappingURL=formatConditionLabel.d.ts.map
@@ -1 +0,0 @@
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"}