@threadlabs/looma 0.1.8 → 0.1.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 (210) hide show
  1. package/dist/{chunk-UMFO4QNN.js → chunk-DYIMEQY7.js} +27 -26
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/looma.cjs.js +1 -1
  4. package/dist/cjs/ui-affordance-scope.cjs.entry.js +152 -0
  5. package/dist/cjs/ui-avatar-group.cjs.entry.js +1 -1
  6. package/dist/cjs/ui-avatar.cjs.entry.js +1 -1
  7. package/dist/cjs/ui-badge.cjs.entry.js +1 -1
  8. package/dist/cjs/ui-button.cjs.entry.js +1 -1
  9. package/dist/cjs/ui-checkbox.cjs.entry.js +1 -1
  10. package/dist/cjs/ui-context-menu.cjs.entry.js +1 -1
  11. package/dist/cjs/ui-dialog.cjs.entry.js +1 -1
  12. package/dist/cjs/ui-disclosure.cjs.entry.js +1 -1
  13. package/dist/cjs/ui-floating-action-button.cjs.entry.js +1 -1
  14. package/dist/cjs/ui-form-field.cjs.entry.js +1 -1
  15. package/dist/cjs/ui-icon-button.cjs.entry.js +4 -2
  16. package/dist/cjs/ui-input.cjs.entry.js +1 -1
  17. package/dist/cjs/ui-menu-item.cjs.entry.js +1 -1
  18. package/dist/cjs/ui-menu.cjs.entry.js +1 -1
  19. package/dist/cjs/ui-popover.cjs.entry.js +1 -1
  20. package/dist/cjs/ui-radio-group.cjs.entry.js +1 -1
  21. package/dist/cjs/ui-radio.cjs.entry.js +1 -1
  22. package/dist/cjs/ui-search-result-row.cjs.entry.js +1 -1
  23. package/dist/cjs/ui-search-shell.cjs.entry.js +1 -1
  24. package/dist/cjs/ui-select.cjs.entry.js +1 -1
  25. package/dist/cjs/ui-switch.cjs.entry.js +2 -2
  26. package/dist/cjs/ui-tabs.cjs.entry.js +1 -1
  27. package/dist/cjs/ui-textarea.cjs.entry.js +1 -1
  28. package/dist/cjs/ui-toast-region.cjs.entry.js +1 -1
  29. package/dist/cjs/ui-tooltip.cjs.entry.js +1 -1
  30. package/dist/cjs/ui-top-bar.cjs.entry.js +1 -1
  31. package/dist/collection/collection-manifest.json +1 -0
  32. package/dist/collection/components/ui-affordance-scope/ui-affordance-scope.css +8 -0
  33. package/dist/collection/components/ui-affordance-scope/ui-affordance-scope.js +70 -0
  34. package/dist/collection/components/ui-avatar/ui-avatar.js +1 -1
  35. package/dist/collection/components/ui-avatar-group/ui-avatar-group.js +1 -1
  36. package/dist/collection/components/ui-badge/ui-badge.js +1 -1
  37. package/dist/collection/components/ui-button/ui-button.js +1 -1
  38. package/dist/collection/components/ui-checkbox/ui-checkbox.js +1 -1
  39. package/dist/collection/components/ui-context-menu/ui-context-menu.js +1 -1
  40. package/dist/collection/components/ui-dialog/ui-dialog.js +1 -1
  41. package/dist/collection/components/ui-disclosure/ui-disclosure.js +1 -1
  42. package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +1 -1
  43. package/dist/collection/components/ui-form-field/ui-form-field.js +1 -1
  44. package/dist/collection/components/ui-icon-button/ui-icon-button.css +53 -0
  45. package/dist/collection/components/ui-icon-button/ui-icon-button.js +23 -1
  46. package/dist/collection/components/ui-input/ui-input.js +1 -1
  47. package/dist/collection/components/ui-menu/ui-menu.js +1 -1
  48. package/dist/collection/components/ui-menu-item/ui-menu-item.js +1 -1
  49. package/dist/collection/components/ui-popover/ui-popover.js +1 -1
  50. package/dist/collection/components/ui-radio/ui-radio.js +1 -1
  51. package/dist/collection/components/ui-radio-group/ui-radio-group.js +1 -1
  52. package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +1 -1
  53. package/dist/collection/components/ui-search-shell/ui-search-shell.js +1 -1
  54. package/dist/collection/components/ui-select/ui-select.js +1 -1
  55. package/dist/collection/components/ui-switch/ui-switch.js +2 -2
  56. package/dist/collection/components/ui-tabs/ui-tabs.js +1 -1
  57. package/dist/collection/components/ui-textarea/ui-textarea.js +1 -1
  58. package/dist/collection/components/ui-toast-region/ui-toast-region.js +1 -1
  59. package/dist/collection/components/ui-tooltip/ui-tooltip.js +1 -1
  60. package/dist/collection/components/ui-top-bar/ui-top-bar.js +1 -1
  61. package/dist/collection/overlay/positioning.js +135 -0
  62. package/dist/components/index.d.ts +2 -0
  63. package/dist/components/index.js +1 -1
  64. package/dist/components/{p-gHC_Ei92.js → p-QiwSQmKJ.js} +1 -1
  65. package/dist/components/ui-affordance-scope.d.ts +11 -0
  66. package/dist/components/ui-affordance-scope.js +1 -0
  67. package/dist/components/ui-avatar-group.js +1 -1
  68. package/dist/components/ui-avatar.js +1 -1
  69. package/dist/components/ui-badge.js +1 -1
  70. package/dist/components/ui-button.js +1 -1
  71. package/dist/components/ui-checkbox.js +1 -1
  72. package/dist/components/ui-context-menu.js +1 -1
  73. package/dist/components/ui-dialog.js +1 -1
  74. package/dist/components/ui-disclosure.js +1 -1
  75. package/dist/components/ui-floating-action-button.js +1 -1
  76. package/dist/components/ui-form-field.js +1 -1
  77. package/dist/components/ui-icon-button.js +1 -1
  78. package/dist/components/ui-input.js +1 -1
  79. package/dist/components/ui-menu-item.js +1 -1
  80. package/dist/components/ui-menu.js +1 -1
  81. package/dist/components/ui-popover.js +1 -1
  82. package/dist/components/ui-radio-group.js +1 -1
  83. package/dist/components/ui-radio.js +1 -1
  84. package/dist/components/ui-search-result-row.js +1 -1
  85. package/dist/components/ui-search-shell.js +1 -1
  86. package/dist/components/ui-select.js +1 -1
  87. package/dist/components/ui-switch.js +1 -1
  88. package/dist/components/ui-tabs.js +1 -1
  89. package/dist/components/ui-textarea.js +1 -1
  90. package/dist/components/ui-toast-region.js +1 -1
  91. package/dist/components/ui-tooltip.js +1 -1
  92. package/dist/components/ui-top-bar.js +1 -1
  93. package/dist/esm/loader.js +1 -1
  94. package/dist/esm/looma.js +1 -1
  95. package/dist/esm/ui-affordance-scope.entry.js +150 -0
  96. package/dist/esm/ui-avatar-group.entry.js +1 -1
  97. package/dist/esm/ui-avatar.entry.js +1 -1
  98. package/dist/esm/ui-badge.entry.js +1 -1
  99. package/dist/esm/ui-button.entry.js +1 -1
  100. package/dist/esm/ui-checkbox.entry.js +1 -1
  101. package/dist/esm/ui-context-menu.entry.js +1 -1
  102. package/dist/esm/ui-dialog.entry.js +1 -1
  103. package/dist/esm/ui-disclosure.entry.js +1 -1
  104. package/dist/esm/ui-floating-action-button.entry.js +1 -1
  105. package/dist/esm/ui-form-field.entry.js +1 -1
  106. package/dist/esm/ui-icon-button.entry.js +4 -2
  107. package/dist/esm/ui-input.entry.js +1 -1
  108. package/dist/esm/ui-menu-item.entry.js +1 -1
  109. package/dist/esm/ui-menu.entry.js +1 -1
  110. package/dist/esm/ui-popover.entry.js +1 -1
  111. package/dist/esm/ui-radio-group.entry.js +1 -1
  112. package/dist/esm/ui-radio.entry.js +1 -1
  113. package/dist/esm/ui-search-result-row.entry.js +1 -1
  114. package/dist/esm/ui-search-shell.entry.js +1 -1
  115. package/dist/esm/ui-select.entry.js +1 -1
  116. package/dist/esm/ui-switch.entry.js +2 -2
  117. package/dist/esm/ui-tabs.entry.js +1 -1
  118. package/dist/esm/ui-textarea.entry.js +1 -1
  119. package/dist/esm/ui-toast-region.entry.js +1 -1
  120. package/dist/esm/ui-tooltip.entry.js +1 -1
  121. package/dist/esm/ui-top-bar.entry.js +1 -1
  122. package/dist/index.cjs +306 -29
  123. package/dist/index.d.cts +42 -1
  124. package/dist/index.d.ts +42 -1
  125. package/dist/index.js +127 -2
  126. package/dist/looma/looma.esm.js +1 -1
  127. package/dist/looma/p-0198bb21.entry.js +1 -0
  128. package/dist/looma/{p-d39905f9.entry.js → p-051f578c.entry.js} +1 -1
  129. package/dist/looma/{p-c14233bc.entry.js → p-0584a051.entry.js} +1 -1
  130. package/dist/looma/{p-cb15e8e3.entry.js → p-078f9fb8.entry.js} +1 -1
  131. package/dist/looma/{p-dc857ed4.entry.js → p-0f45c5f0.entry.js} +1 -1
  132. package/dist/looma/{p-201243dc.entry.js → p-1681b218.entry.js} +1 -1
  133. package/dist/looma/{p-41d62a83.entry.js → p-2ae73d5b.entry.js} +1 -1
  134. package/dist/looma/{p-5a645647.entry.js → p-2ed7e241.entry.js} +1 -1
  135. package/dist/looma/{p-5717a4c4.entry.js → p-34417499.entry.js} +1 -1
  136. package/dist/looma/{p-610b2eca.entry.js → p-4b422d40.entry.js} +1 -1
  137. package/dist/looma/{p-15e619fd.entry.js → p-5ba9d496.entry.js} +1 -1
  138. package/dist/looma/p-5d4713a6.entry.js +1 -0
  139. package/dist/looma/{p-96de71ad.entry.js → p-624ba086.entry.js} +1 -1
  140. package/dist/looma/{p-01425a37.entry.js → p-65c25c94.entry.js} +1 -1
  141. package/dist/looma/{p-66a203a1.entry.js → p-7e94d90d.entry.js} +1 -1
  142. package/dist/looma/p-8c09c724.entry.js +1 -0
  143. package/dist/looma/{p-4c54d489.entry.js → p-8d5adb17.entry.js} +1 -1
  144. package/dist/looma/p-95340a13.entry.js +1 -0
  145. package/dist/looma/{p-07167650.entry.js → p-95cd639d.entry.js} +1 -1
  146. package/dist/looma/{p-03f0594b.entry.js → p-96f73d07.entry.js} +1 -1
  147. package/dist/looma/p-a33522a2.entry.js +1 -0
  148. package/dist/looma/{p-ee31c7b4.entry.js → p-a5127c7d.entry.js} +1 -1
  149. package/dist/looma/{p-dfcb2cca.entry.js → p-a9f46811.entry.js} +1 -1
  150. package/dist/looma/{p-93ce1c62.entry.js → p-b7aa4488.entry.js} +1 -1
  151. package/dist/looma/{p-5df568d8.entry.js → p-c6721aba.entry.js} +1 -1
  152. package/dist/looma/{p-3ecd7120.entry.js → p-d273b857.entry.js} +1 -1
  153. package/dist/looma/{p-24d7aa5b.entry.js → p-ed5abf6d.entry.js} +1 -1
  154. package/dist/types/components/ui-affordance-scope/ui-affordance-scope.d.ts +11 -0
  155. package/dist/types/components/ui-icon-button/ui-icon-button.d.ts +2 -0
  156. package/dist/types/components.d.ts +37 -0
  157. package/dist/types/overlay/positioning.d.ts +40 -0
  158. package/dist/ui-affordance-scope.entry-ZKUJ5AT4.js +144 -0
  159. package/dist/{ui-avatar-group.entry-S6DFXYB7.js → ui-avatar-group.entry-I4XM44BI.js} +2 -2
  160. package/dist/{ui-avatar.entry-MDRGXLWQ.js → ui-avatar.entry-ZZAMZAVF.js} +2 -2
  161. package/dist/{ui-badge.entry-RLL4YKPD.js → ui-badge.entry-DQXYMC3E.js} +2 -2
  162. package/dist/{ui-button.entry-IYMYLBFY.js → ui-button.entry-DM7BUZLI.js} +2 -2
  163. package/dist/{ui-checkbox.entry-K5FGWDG2.js → ui-checkbox.entry-X3PPWKIJ.js} +2 -2
  164. package/dist/{ui-context-menu.entry-KWXXJ3ZV.js → ui-context-menu.entry-KAW4NIFE.js} +2 -2
  165. package/dist/{ui-dialog.entry-RKHLQLQM.js → ui-dialog.entry-D23SNXWB.js} +2 -2
  166. package/dist/{ui-disclosure.entry-FRZKGEJP.js → ui-disclosure.entry-DOG6JZU7.js} +2 -2
  167. package/dist/{ui-floating-action-button.entry-BH4FDSTL.js → ui-floating-action-button.entry-VPQ7VBFS.js} +2 -2
  168. package/dist/{ui-form-field.entry-3CR2KSUH.js → ui-form-field.entry-SYZ6XSCG.js} +2 -2
  169. package/dist/ui-icon-button.entry-2SZBOIH5.js +26 -0
  170. package/dist/{ui-input.entry-5PQR37HS.js → ui-input.entry-PALICYLZ.js} +2 -2
  171. package/dist/{ui-menu-item.entry-2T3QWHLK.js → ui-menu-item.entry-W6TEFP5Y.js} +2 -2
  172. package/dist/{ui-menu.entry-Q5Z5YO5P.js → ui-menu.entry-7NARDV6S.js} +2 -2
  173. package/dist/{ui-popover.entry-4P2NWWAY.js → ui-popover.entry-ZXYHLDTP.js} +2 -2
  174. package/dist/{ui-radio-group.entry-QKPRNV26.js → ui-radio-group.entry-XEUKMD6J.js} +2 -2
  175. package/dist/{ui-radio.entry-O4DOMFNU.js → ui-radio.entry-4ABBHDLN.js} +2 -2
  176. package/dist/{ui-search-result-row.entry-BR5O3UCH.js → ui-search-result-row.entry-3HHM7OV4.js} +2 -2
  177. package/dist/{ui-search-shell.entry-2ZBP7SA3.js → ui-search-shell.entry-PJTFOBPT.js} +2 -2
  178. package/dist/{ui-select.entry-L75HQY72.js → ui-select.entry-A3RI5XCG.js} +2 -2
  179. package/dist/{ui-switch.entry-L5QWD3BT.js → ui-switch.entry-JNRS2YTN.js} +3 -3
  180. package/dist/{ui-tabs.entry-KWRD6Y7J.js → ui-tabs.entry-MQ4V5XCP.js} +2 -2
  181. package/dist/{ui-textarea.entry-JC3HPEBS.js → ui-textarea.entry-JJXJQZQR.js} +2 -2
  182. package/dist/{ui-toast-region.entry-C6KK4OM4.js → ui-toast-region.entry-STHVESL5.js} +2 -2
  183. package/dist/{ui-tooltip.entry-G5EOCWP4.js → ui-tooltip.entry-4W7CRIKI.js} +2 -2
  184. package/dist/{ui-top-bar.entry-YLKVAQFH.js → ui-top-bar.entry-WM3SS2HR.js} +2 -2
  185. package/editor/{chunk-OK5NARJI.js → chunk-4VGVEHU2.js} +244 -70
  186. package/editor/{chunk-NJ2KAMS2.js → chunk-CCDKTWYA.js} +70 -34
  187. package/editor/extensions/index.d.ts +2 -2
  188. package/editor/extensions/index.js +1 -1
  189. package/editor/index.d.ts +1 -1
  190. package/editor/index.js +7 -2
  191. package/editor/table-overlay-jjvdARTJ.d.ts +95 -0
  192. package/editor/ui.d.ts +1 -1
  193. package/editor/ui.js +7 -2
  194. package/editor.css +232 -73
  195. package/layout/index.cjs +5 -0
  196. package/layout/index.css +22 -3
  197. package/layout/index.js +5 -0
  198. package/layout.css +24 -3
  199. package/package.json +1 -1
  200. package/tokens.css +9 -0
  201. package/vue/{chunk-KDA4RFLQ.js → chunk-YN4IUYVY.js} +16 -4
  202. package/vue/editor/index.js +94 -37
  203. package/vue/index.d.ts +5 -1
  204. package/vue/index.js +3 -1
  205. package/dist/looma/p-754cfff3.entry.js +0 -1
  206. package/dist/looma/p-940a931a.entry.js +0 -1
  207. package/dist/looma/p-941221ad.entry.js +0 -1
  208. package/dist/looma/p-955fb814.entry.js +0 -1
  209. package/dist/ui-icon-button.entry-LB54U25M.js +0 -24
  210. package/editor/table-overlay-Bq0F5xPg.d.ts +0 -64
@@ -24,9 +24,10 @@ function toHTMLElement(value) {
24
24
  if (value instanceof HTMLElement) return value;
25
25
  return null;
26
26
  }
27
- function createAdapterComponent(tagName, displayName, additionalEventBindings = []) {
27
+ function createAdapterComponent(tagName, displayName, additionalEventBindings = [], defaultHydrationMismatch = "class", propertyBindings = []) {
28
28
  const eventBindings = [...BASE_EVENT_BINDINGS, ...additionalEventBindings];
29
29
  const callbackAttrs = new Set(eventBindings.map(([, callbackAttr]) => callbackAttr));
30
+ const propertyAttrs = new Set(propertyBindings);
30
31
  return defineComponent({
31
32
  name: displayName,
32
33
  inheritAttrs: false,
@@ -36,6 +37,12 @@ function createAdapterComponent(tagName, displayName, additionalEventBindings =
36
37
  const element = elementRef.value;
37
38
  if (!element) return;
38
39
  const adapterAttrs = attrs;
40
+ const propertyTarget = element;
41
+ for (const propertyName of propertyBindings) {
42
+ if (propertyTarget[propertyName] !== adapterAttrs[propertyName]) {
43
+ propertyTarget[propertyName] = adapterAttrs[propertyName];
44
+ }
45
+ }
39
46
  const handlers = eventBindings.map(
40
47
  ([eventName, callbackAttr]) => {
41
48
  const callback = adapterAttrs[callbackAttr];
@@ -56,7 +63,9 @@ function createAdapterComponent(tagName, displayName, additionalEventBindings =
56
63
  });
57
64
  return () => {
58
65
  const forwardedAttrs = Object.fromEntries(
59
- Object.entries(attrs).filter(([name]) => !callbackAttrs.has(name))
66
+ Object.entries(attrs).filter(
67
+ ([name]) => !callbackAttrs.has(name) && !propertyAttrs.has(name)
68
+ )
60
69
  );
61
70
  const children = Object.entries(slots).flatMap(([slotName, slotFn]) => {
62
71
  if (!slotFn) return [];
@@ -69,7 +78,7 @@ function createAdapterComponent(tagName, displayName, additionalEventBindings =
69
78
  return h(
70
79
  tagName,
71
80
  {
72
- "data-allow-mismatch": forwardedAttrs["data-allow-mismatch"] ?? "class",
81
+ "data-allow-mismatch": forwardedAttrs["data-allow-mismatch"] ?? defaultHydrationMismatch,
73
82
  ...forwardedAttrs,
74
83
  ref: (value) => {
75
84
  elementRef.value = toHTMLElement(value);
@@ -89,7 +98,7 @@ var Cluster = createAdapterComponent("ui-cluster", "Cluster");
89
98
  var Grid = createAdapterComponent("ui-grid", "Grid");
90
99
  var Center = createAdapterComponent("ui-center", "Center");
91
100
  var Switcher = createAdapterComponent("ui-switcher", "Switcher");
92
- var Sidebar = createAdapterComponent("ui-sidebar", "Sidebar");
101
+ var Sidebar = createAdapterComponent("ui-sidebar", "Sidebar", [], "");
93
102
  var Reel = createAdapterComponent("ui-reel", "Reel");
94
103
  var Separator = createAdapterComponent("ui-separator", "Separator");
95
104
  var Disclosure = createAdapterComponent("ui-disclosure", "Disclosure");
@@ -99,6 +108,7 @@ var Popover = createAdapterComponent("ui-popover", "Popover");
99
108
  var Menu = createAdapterComponent("ui-menu", "Menu");
100
109
  var MenuItem = createAdapterComponent("ui-menu-item", "MenuItem");
101
110
  var ContextMenu = createAdapterComponent("ui-context-menu", "ContextMenu");
111
+ var AffordanceScope = createAdapterComponent("ui-affordance-scope", "AffordanceScope");
102
112
  var Button = createAdapterComponent("ui-button", "Button");
103
113
  var IconButton = createAdapterComponent("ui-icon-button", "IconButton");
104
114
  var Input = createAdapterComponent("ui-input", "Input");
@@ -138,6 +148,7 @@ var ADAPTER_COMPONENT_TAG_MAP = {
138
148
  Menu: "ui-menu",
139
149
  MenuItem: "ui-menu-item",
140
150
  ContextMenu: "ui-context-menu",
151
+ AffordanceScope: "ui-affordance-scope",
141
152
  Button: "ui-button",
142
153
  IconButton: "ui-icon-button",
143
154
  Input: "ui-input",
@@ -179,6 +190,7 @@ export {
179
190
  Menu,
180
191
  MenuItem,
181
192
  ContextMenu,
193
+ AffordanceScope,
182
194
  Button,
183
195
  IconButton,
184
196
  Input,
@@ -2,7 +2,7 @@ import {
2
2
  IconButton,
3
3
  createAdapterComponent,
4
4
  toHTMLElement
5
- } from "../chunk-KDA4RFLQ.js";
5
+ } from "../chunk-YN4IUYVY.js";
6
6
 
7
7
  // src/editor/index.ts
8
8
  import "@threadlabs/looma/editor";
@@ -86,7 +86,13 @@ var EditorToolbar = createAdapterComponent("ui-editor-toolbar", "EditorToolbar",
86
86
  var EditorTableContextMenu = createAdapterComponent("ui-editor-table-context-menu", "EditorTableContextMenu", EDITOR_EVENT_BINDINGS);
87
87
  var EditorTableToolbar = createAdapterComponent("ui-editor-table-toolbar", "EditorTableToolbar", EDITOR_EVENT_BINDINGS);
88
88
  var EditorInsertTableGrid = createAdapterComponent("ui-editor-insert-table-grid", "EditorInsertTableGrid", EDITOR_EVENT_BINDINGS);
89
- var EditorTableOverlay = createAdapterComponent("ui-editor-table-overlay", "EditorTableOverlay", EDITOR_EVENT_BINDINGS);
89
+ var EditorTableOverlay = createAdapterComponent(
90
+ "ui-editor-table-overlay",
91
+ "EditorTableOverlay",
92
+ EDITOR_EVENT_BINDINGS,
93
+ "class",
94
+ ["geometry"]
95
+ );
90
96
  var EDITOR_ADAPTER_COMPONENT_TAG_MAP = {
91
97
  EditorToolbar: "ui-editor-toolbar",
92
98
  EditorSlashMenu: "ui-editor-slash-menu",
@@ -114,9 +120,12 @@ import {
114
120
  getDefaultEditorExtensions,
115
121
  handleTableAction,
116
122
  handleTableOverlayAction,
123
+ measureTableOverlayGeometry,
117
124
  normalizeActiveTableColumnWidths,
125
+ resolveTableCellAt,
118
126
  shouldShowTextFormattingToolbar
119
127
  } from "@threadlabs/looma/editor";
128
+ import { clampRectToViewport, getVisualViewportRect } from "@threadlabs/looma/core";
120
129
  var EMPTY_DOCUMENT = { type: "doc", content: [] };
121
130
  var EMPTY_CAPABILITIES = {
122
131
  canAddRowBefore: false,
@@ -137,13 +146,10 @@ function selectedTableElement(editor) {
137
146
  const element = node instanceof HTMLElement ? node : node.parentElement;
138
147
  return element?.closest("table");
139
148
  }
140
- function selectedTableNode(editor) {
141
- const { $from } = editor.state.selection;
142
- for (let depth = $from.depth; depth > 0; depth -= 1) {
143
- const node = $from.node(depth);
144
- if (node.type.name === "table") return node;
145
- }
146
- return null;
149
+ function selectedTableCellElement(editor) {
150
+ const { node } = editor.view.domAtPos(editor.state.selection.from);
151
+ const element = node instanceof HTMLElement ? node : node.parentElement;
152
+ return element?.closest("td, th");
147
153
  }
148
154
  var LoomaEditor = defineComponent2({
149
155
  name: "LoomaEditor",
@@ -194,6 +200,8 @@ var LoomaEditor = defineComponent2({
194
200
  let tableResizeActive = false;
195
201
  let tableInteractionActive = false;
196
202
  let mobileTableControlsDismissed = false;
203
+ let hoveredTableCell = null;
204
+ let tablePointerFrame = null;
197
205
  const slash = reactive({
198
206
  active: false,
199
207
  items: [],
@@ -210,6 +218,7 @@ var LoomaEditor = defineComponent2({
210
218
  background: null,
211
219
  rows: 0,
212
220
  cols: 0,
221
+ geometry: null,
213
222
  toolbarStyle: {},
214
223
  overlayStyle: {},
215
224
  menuStyle: {},
@@ -248,6 +257,7 @@ var LoomaEditor = defineComponent2({
248
257
  tableUi.menuOpen = false;
249
258
  tableUi.alignment = "left";
250
259
  tableUi.background = null;
260
+ tableUi.geometry = null;
251
261
  tableUi.capabilities = { ...EMPTY_CAPABILITIES };
252
262
  mobileTableControlsDismissed = false;
253
263
  mobileToolbarMode.value = "formatting";
@@ -259,16 +269,12 @@ var LoomaEditor = defineComponent2({
259
269
  return;
260
270
  }
261
271
  nextTick(() => {
262
- const viewport = window.visualViewport;
263
- const viewportLeft = viewport?.offsetLeft ?? 0;
264
- const viewportTop = viewport?.offsetTop ?? 0;
265
- const viewportWidth = viewport?.width ?? window.innerWidth;
266
- const viewportHeight = viewport?.height ?? window.innerHeight;
272
+ const viewport = getVisualViewportRect(window);
267
273
  const toolbarHeight = mobileToolbarShell.value?.getBoundingClientRect().height || 56;
268
274
  mobileToolbarStyle.value = {
269
- left: `${viewportLeft}px`,
270
- top: `${Math.max(viewportTop, viewportTop + viewportHeight - toolbarHeight)}px`,
271
- width: `${viewportWidth}px`
275
+ left: `${viewport.left}px`,
276
+ top: `${Math.max(viewport.top, viewport.bottom - toolbarHeight)}px`,
277
+ width: `${viewport.width}px`
272
278
  };
273
279
  });
274
280
  };
@@ -280,8 +286,7 @@ var LoomaEditor = defineComponent2({
280
286
  }
281
287
  const state = getActiveTableUiState(instance);
282
288
  const table = selectedTableElement(instance);
283
- const tableNode = selectedTableNode(instance);
284
- if (!state.active || !table || !tableNode) {
289
+ if (!state.active || !table) {
285
290
  closeTableUi();
286
291
  return;
287
292
  }
@@ -297,8 +302,14 @@ var LoomaEditor = defineComponent2({
297
302
  tableUi.alignment = state.cellAlignment;
298
303
  tableUi.background = state.cellBackground;
299
304
  tableUi.capabilities = state.capabilities;
300
- tableUi.rows = tableNode.childCount;
301
- tableUi.cols = tableNode.childCount ? tableNode.child(0).childCount : 0;
305
+ const selectedCell = selectedTableCellElement(instance);
306
+ const geometry = measureTableOverlayGeometry(
307
+ table,
308
+ hoveredTableCell && table.contains(hoveredTableCell) ? hoveredTableCell : selectedCell
309
+ );
310
+ tableUi.rows = Math.max(0, geometry.rowBoundaries.length - 1);
311
+ tableUi.cols = Math.max(0, geometry.columnBoundaries.length - 1);
312
+ tableUi.geometry = geometry;
302
313
  tableUi.toolbarStyle = {
303
314
  top: `${rect.top > 76 ? rect.top - 52 : rect.bottom + 12}px`,
304
315
  left: `${toolbarLeft}px`,
@@ -345,25 +356,28 @@ var LoomaEditor = defineComponent2({
345
356
  const anchor = tablePickerAnchor.value;
346
357
  if (!anchor) return;
347
358
  const rect = anchor.getBoundingClientRect();
348
- const viewport = window.visualViewport;
349
- const viewportLeft = viewport?.offsetLeft ?? 0;
350
- const viewportTop = viewport?.offsetTop ?? 0;
351
- const viewportWidth = viewport?.width ?? window.innerWidth;
352
- const viewportHeight = viewport?.height ?? window.innerHeight;
359
+ const viewport = getVisualViewportRect(window);
353
360
  const width = 220;
354
- const left = Math.min(
355
- Math.max(viewportLeft + 12, rect.left),
356
- Math.max(viewportLeft + 12, viewportLeft + viewportWidth - width - 12)
357
- );
358
361
  const popoverHeight = tablePickerPopover.value?.getBoundingClientRect().height || 300;
359
- const top = Math.min(
360
- Math.max(viewportTop + 12, rect.bottom + 8),
361
- Math.max(viewportTop + 12, viewportTop + viewportHeight - popoverHeight - 12)
362
+ const target = {
363
+ left: rect.left,
364
+ top: rect.bottom + 8,
365
+ right: rect.left + width,
366
+ bottom: rect.bottom + 8 + popoverHeight,
367
+ width,
368
+ height: popoverHeight
369
+ };
370
+ const offset = clampRectToViewport(
371
+ target,
372
+ viewport,
373
+ 12
362
374
  );
375
+ const left = target.left + offset.x;
376
+ const top = target.top + offset.y;
363
377
  tablePickerStyle.value = window.innerWidth <= 767 ? {
364
378
  position: "fixed",
365
379
  left: `${left}px`,
366
- top: `${Math.max(viewportTop + 12, viewportTop + viewportHeight - popoverHeight - 64)}px`
380
+ top: `${Math.max(viewport.top + 12, viewport.bottom - popoverHeight - 64)}px`
367
381
  } : { position: "fixed", top: `${top}px`, left: `${left}px` };
368
382
  };
369
383
  const onViewportChange = () => {
@@ -422,6 +436,7 @@ var LoomaEditor = defineComponent2({
422
436
  document.removeEventListener("pointerup", onResizePointerUp, true);
423
437
  unbindEditorUi(editor.value);
424
438
  if (dragLeaveTimer) clearTimeout(dragLeaveTimer);
439
+ if (tablePointerFrame !== null) cancelAnimationFrame(tablePointerFrame);
425
440
  });
426
441
  const insertImage = async (file) => {
427
442
  if (!props.uploadImage || !editor.value) return;
@@ -457,7 +472,10 @@ var LoomaEditor = defineComponent2({
457
472
  return;
458
473
  }
459
474
  event.preventDefault();
460
- instance.chain().focus().setTextSelection(instance.view.posAtDOM(cell, 0) + 1).run();
475
+ const currentCell = selectedTableCellElement(instance);
476
+ if (currentCell !== cell && !cell.classList.contains("selectedCell")) {
477
+ instance.chain().focus().setTextSelection(instance.view.posAtDOM(cell, 0) + 1).run();
478
+ }
461
479
  updateTableUi();
462
480
  tableUi.menuOpen = true;
463
481
  tableUi.menuStyle = { top: `${event.clientY}px`, left: `${event.clientX}px` };
@@ -469,8 +487,44 @@ var LoomaEditor = defineComponent2({
469
487
  nextTick(updateTableUi);
470
488
  };
471
489
  const runOverlayAction = (detail) => {
472
- if (!editor.value) return;
473
- handleTableOverlayAction(editor.value, detail);
490
+ const instance = editor.value;
491
+ if (!instance) return;
492
+ if (detail.action === "open-cell-menu") {
493
+ const selectedCell = selectedTableCellElement(instance);
494
+ const table = selectedTableElement(instance);
495
+ const cell = table ? resolveTableCellAt(table, detail.rowIndex, detail.columnIndex) ?? selectedCell : selectedCell;
496
+ if (cell && selectedCell !== cell && !cell.classList.contains("selectedCell")) {
497
+ instance.chain().focus().setTextSelection(instance.view.posAtDOM(cell, 0) + 1).run();
498
+ } else {
499
+ instance.commands.focus();
500
+ }
501
+ updateTableUi();
502
+ tableUi.menuStyle = {
503
+ top: `${detail.anchor.bottom + 4}px`,
504
+ left: `${detail.anchor.right}px`
505
+ };
506
+ tableUi.menuOpen = true;
507
+ return;
508
+ }
509
+ handleTableOverlayAction(instance, detail);
510
+ nextTick(updateTableUi);
511
+ };
512
+ const onEditorPointerOver = (event) => {
513
+ const cell = event.target instanceof HTMLElement ? event.target.closest("td, th") : null;
514
+ if (!cell) return;
515
+ if (cell === hoveredTableCell) return;
516
+ hoveredTableCell = cell;
517
+ if (tablePointerFrame !== null) return;
518
+ tablePointerFrame = requestAnimationFrame(() => {
519
+ tablePointerFrame = null;
520
+ updateTableUi();
521
+ });
522
+ };
523
+ const onEditorPointerLeave = (event) => {
524
+ const next = event.relatedTarget;
525
+ if (next instanceof Node && (tableOverlayShell.value?.contains(next) || tableToolbarShell.value?.contains(next) || tableMenuShell.value?.contains(next))) return;
526
+ if (!hoveredTableCell) return;
527
+ hoveredTableCell = null;
474
528
  nextTick(updateTableUi);
475
529
  };
476
530
  const commandButton = (label, icon, active, disabled, run) => h2(IconButton, {
@@ -541,6 +595,8 @@ var LoomaEditor = defineComponent2({
541
595
  ref: root,
542
596
  class: ["looma-editor", attrs.class, { "looma-editor--readonly": !props.editable, "looma-editor--drag-over": dragOver.value }],
543
597
  onContextmenu: onContextMenu,
598
+ onPointerover: onEditorPointerOver,
599
+ onPointerleave: onEditorPointerLeave,
544
600
  onDragover: (event) => {
545
601
  event.preventDefault();
546
602
  if (props.editable && Array.from(event.dataTransfer?.types ?? []).includes("Files")) dragOver.value = true;
@@ -637,6 +693,7 @@ var LoomaEditor = defineComponent2({
637
693
  open: true,
638
694
  rows: tableUi.rows,
639
695
  cols: tableUi.cols,
696
+ geometry: tableUi.geometry,
640
697
  onTableOverlayAction: runOverlayAction
641
698
  })]) : null,
642
699
  tableUi.menuOpen ? h2("div", {
package/vue/index.d.ts CHANGED
@@ -80,6 +80,9 @@ declare const MenuItem: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode
80
80
  declare const ContextMenu: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
81
81
  [key: string]: any;
82
82
  }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
83
+ declare const AffordanceScope: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
84
+ [key: string]: any;
85
+ }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
83
86
  declare const Button: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
84
87
  [key: string]: any;
85
88
  }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
@@ -154,6 +157,7 @@ declare const ADAPTER_COMPONENT_TAG_MAP: {
154
157
  readonly Menu: "ui-menu";
155
158
  readonly MenuItem: "ui-menu-item";
156
159
  readonly ContextMenu: "ui-context-menu";
160
+ readonly AffordanceScope: "ui-affordance-scope";
157
161
  readonly Button: "ui-button";
158
162
  readonly IconButton: "ui-icon-button";
159
163
  readonly Input: "ui-input";
@@ -176,4 +180,4 @@ declare const ADAPTER_COMPONENT_TAG_MAP: {
176
180
  };
177
181
  declare const VUE_ADAPTER_NOTE = "Thin adapter only: attrs and slots pass through to custom elements and DOM events map to typed callbacks.";
178
182
 
179
- export { ADAPTER_COMPONENT_TAG_MAP, Avatar, AvatarGroup, Badge, Button, Center, Checkbox, Cluster, ContextMenu, Dialog, Disclosure, FloatingActionButton, FormField, Grid, IconButton, Inline, Input, Menu, MenuItem, Popover, Radio, RadioGroup, Reel, SearchResultRow, SearchShell, Select, Separator, Sidebar, Stack, Switch, Switcher, Tabs, Textarea, ToastRegion, Tooltip, TopBar, VUE_ADAPTER_NOTE, type VueAdapterEventMap };
183
+ export { ADAPTER_COMPONENT_TAG_MAP, AffordanceScope, Avatar, AvatarGroup, Badge, Button, Center, Checkbox, Cluster, ContextMenu, Dialog, Disclosure, FloatingActionButton, FormField, Grid, IconButton, Inline, Input, Menu, MenuItem, Popover, Radio, RadioGroup, Reel, SearchResultRow, SearchShell, Select, Separator, Sidebar, Stack, Switch, Switcher, Tabs, Textarea, ToastRegion, Tooltip, TopBar, VUE_ADAPTER_NOTE, type VueAdapterEventMap };
package/vue/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  ADAPTER_COMPONENT_TAG_MAP,
3
+ AffordanceScope,
3
4
  Avatar,
4
5
  AvatarGroup,
5
6
  Badge,
@@ -36,9 +37,10 @@ import {
36
37
  Tooltip,
37
38
  TopBar,
38
39
  VUE_ADAPTER_NOTE
39
- } from "./chunk-KDA4RFLQ.js";
40
+ } from "./chunk-YN4IUYVY.js";
40
41
  export {
41
42
  ADAPTER_COMPONENT_TAG_MAP,
43
+ AffordanceScope,
42
44
  Avatar,
43
45
  AvatarGroup,
44
46
  Badge,
@@ -1 +0,0 @@
1
- import{r as i,h as o,H as t}from"./p-CEeiinfk.js";const n=class{constructor(o){i(this,o)}disabled=!1;label="";size="md";variant="ghost";render(){return o(t,{key:"8f4c7271505fa061da954f1e989fc526dc980407","data-disabled":this.disabled?"":void 0},o("button",{key:"c56009d4028a557cd6f7f19833b0af6412b90c1c",type:"button","aria-label":this.label||void 0,disabled:this.disabled},o("slot",{key:"ac2f201b0fbedb23106f72135ff8c3b6f25fca60"})))}};n.style=":host{display:inline-flex;color:var(--ui-text-secondary)}button{appearance:none;inline-size:var(--ui-icon-button-size, 2.5rem);block-size:var(--ui-icon-button-size, 2.5rem);min-inline-size:var(--ui-icon-button-size, 2.5rem);min-block-size:var(--ui-icon-button-size, 2.5rem);padding:0;margin:0;border:1px solid transparent;border-radius:var(--ui-icon-button-radius, var(--ui-radius-2));background:var(--ui-icon-button-bg, transparent);color:inherit;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color var(--ui-motion-fast) var(--ui-motion-ease), border-color var(--ui-motion-fast) var(--ui-motion-ease), color var(--ui-motion-fast) var(--ui-motion-ease), box-shadow var(--ui-motion-fast) var(--ui-motion-ease), transform var(--ui-motion-fast) var(--ui-motion-ease)}:host([size='sm']) button{inline-size:var(--ui-icon-button-size-sm, 2rem);block-size:var(--ui-icon-button-size-sm, 2rem);min-inline-size:var(--ui-icon-button-size-sm, 2rem);min-block-size:var(--ui-icon-button-size-sm, 2rem)}:host([size='lg']) button{inline-size:var(--ui-icon-button-size-lg, 2.75rem);block-size:var(--ui-icon-button-size-lg, 2.75rem);min-inline-size:var(--ui-icon-button-size-lg, 2.75rem);min-block-size:var(--ui-icon-button-size-lg, 2.75rem)}:host([variant='outline']) button{border-color:var(--ui-icon-button-border, var(--ui-border-default));background:var(--ui-icon-button-outline-bg, var(--ui-surface-default));color:var(--ui-icon-button-outline-color, var(--ui-text-primary))}:host([variant='solid']) button{background:var(--ui-icon-button-solid-bg, var(--ui-accent-solid));color:var(--ui-icon-button-solid-color, var(--ui-text-on-accent));box-shadow:var( --ui-icon-button-solid-shadow, 0 1px 2px color-mix(in srgb, var(--ui-accent-solid) 18%, transparent) )}button:hover:enabled{background:var(--ui-icon-button-hover-bg, var(--ui-surface-muted));color:var(--ui-icon-button-hover-color, var(--ui-text-primary))}:host([variant='outline']) button:hover:enabled{border-color:var(--ui-icon-button-hover-border, var(--ui-border-strong))}:host([variant='solid']) button:hover:enabled{background:var(--ui-icon-button-solid-hover-bg, var(--ui-accent-hover))}button:active:enabled{transform:scale(var(--ui-icon-button-active-scale, 0.96))}button:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:2px}button:disabled,:host([disabled]){opacity:0.6;cursor:not-allowed}::slotted(svg){inline-size:var(--ui-icon-button-icon-size, 1.125rem);block-size:var(--ui-icon-button-icon-size, 1.125rem);flex-shrink:0;stroke-width:var(--ui-icon-button-icon-stroke-width, 1.75)}";export{n as ui_icon_button}
@@ -1 +0,0 @@
1
- import{r as a,g as e,h as i,H as t}from"./p-CEeiinfk.js";function s(a){return!!a&&a.assignedNodes({flatten:!0}).some((a=>a.nodeType!==Node.TEXT_NODE||Boolean(a.textContent?.trim())))}const n=class{constructor(e){a(this,e)}get host(){return e(this)}hasLeading=!1;hasSearch=!1;hasActions=!1;leadingSlot;searchSlot;actionsSlot;componentDidLoad(){this.syncSlots()}syncSlots=()=>{this.hasLeading=s(this.leadingSlot),this.hasSearch=s(this.searchSlot),this.hasActions=s(this.actionsSlot)};render(){return i(t,{key:"23cbff2fdb06a40f0380dbf217d064cb1b9f7a9c"},i("header",{key:"9472960f4445f8ed7d0800d71db3cbac020fca3f",class:"top-bar",part:"base"},i("div",{key:"d408be025d90fdcf1416213b9e76f3b780f47d97",class:"top-bar__leading",hidden:!this.hasLeading},i("slot",{key:"3dc4db316a040ff10a8b8b218b42799d3e1a7b97",name:"leading",ref:a=>this.leadingSlot=a,onSlotchange:this.syncSlots})),i("div",{key:"1b362f19f9a738600afb266e9641c0ee5c8870c9",class:"top-bar__title"},i("slot",{key:"bb93d34a3dea15c697dcd19dc0ecc3488ee390c8"})),i("div",{key:"3d61d781b654ee1d91a6ce5ba64db9732ee1f8ee",class:"top-bar__search",hidden:!this.hasSearch},i("slot",{key:"5731817be644f10ed745fdc0868b85b66a9c06d4",name:"search",ref:a=>this.searchSlot=a,onSlotchange:this.syncSlots})),i("div",{key:"2ee868b93f5195832830900382545b2131e78bb8",class:"top-bar__actions",hidden:!this.hasActions},i("slot",{key:"1d410fa60f112904cfb866cff5a3f2fb18021c93",name:"actions",ref:a=>this.actionsSlot=a,onSlotchange:this.syncSlots}))))}};n.style=":host{position:sticky;inset-block-start:0;z-index:var(--ui-top-bar-z-index, 100);display:block}.top-bar{min-block-size:calc(var(--ui-top-bar-height, 56px) + env(safe-area-inset-top));display:flex;align-items:center;gap:var(--ui-top-bar-gap, var(--ui-space-3, 0.75rem));padding-block-start:env(safe-area-inset-top);padding-inline-start:max( var(--ui-top-bar-padding-inline, var(--ui-space-4, 1rem)), env(safe-area-inset-left) );padding-inline-end:max( var(--ui-top-bar-padding-inline, var(--ui-space-4, 1rem)), env(safe-area-inset-right) );background:var(--ui-top-bar-bg, var(--ui-surface, #ffffff));border-block-end:1px solid var(--ui-top-bar-border, var(--ui-border, #e5e7eb))}.top-bar__leading,.top-bar__search,.top-bar__actions{display:flex;align-items:center;flex-shrink:0}.top-bar__actions{gap:var(--ui-top-bar-actions-gap, var(--ui-space-1, 0.25rem))}.top-bar__title{min-inline-size:0;flex:1}[hidden]{display:none}@media (min-width: 768px){:host{display:none}}";export{n as ui_top_bar}
@@ -1 +0,0 @@
1
- import{r as t,g as a,h as i,H as s}from"./p-CEeiinfk.js";import{d as r,e}from"./p-JwSoedEO.js";const o=class{constructor(a){t(this,a)}get host(){return a(this)}open=!0;internalOpen=!0;syncFromProp(){this.internalOpen=this.open}componentDidLoad(){this.syncFromProp(),this.host.addEventListener("click",this.onClick)}disconnectedCallback(){this.host.removeEventListener("click",this.onClick)}getToasts(){return Array.from(this.host.querySelectorAll("[data-ui-toast]"))}updateOpenState(){const t=this.getToasts();this.internalOpen=t.length>0}onClick=t=>{const a=t.target.closest?.("[data-ui-toast-dismiss]");if(!a)return;const i=a.closest?.("[data-ui-toast]");if(!i)return;const s=i.id??"";i.setAttribute("aria-hidden","true"),i.remove(),r(this.host,"dismiss",{id:s,reason:"action",trigger:e(t)}),this.updateOpenState(),0===this.getToasts().length&&r(this.host,"close",{open:!1,reason:"action",trigger:e(t)})};render(){return i(s,{key:"8e99577d8770984b8d6d29e442931570c1f1bc4d",role:"region","aria-label":"Notifications","data-open":this.internalOpen?"":void 0},i("slot",{key:"06f2c6cf39c4795afc0937669aa2104821aef3d6"}))}static get watchers(){return{open:[{syncFromProp:0}]}}};o.style=":host{position:fixed;top:calc(var(--ui-space-4) + env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:9999;display:grid;gap:var(--ui-space-2);inline-size:min(24rem, calc(100vw - (var(--ui-space-4) * 2)));max-inline-size:100%;pointer-events:none}:host>*{pointer-events:auto}::slotted([data-ui-toast]){display:grid;grid-template-columns:1fr auto;gap:var(--ui-space-2);align-items:start;border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-3);padding:var(--ui-space-3) var(--ui-space-4);background:var(--ui-surface-elevated);color:var(--ui-text-primary);box-shadow:var(--ui-shadow-lg);animation:ui-toast-enter 0.25s var(--ui-motion-ease) forwards}@keyframes ui-toast-enter{from{opacity:0;transform:translateY(-0.5rem)}to{opacity:1;transform:translateY(0)}}::slotted([data-ui-toast][aria-hidden='true']){display:none}::slotted([data-ui-toast-dismiss]){border:0;background:transparent;color:var(--ui-text-secondary);cursor:pointer;font:inherit}";export{o as ui_toast_region}
@@ -1 +0,0 @@
1
- import{r as e,g as t,h as r,H as i}from"./p-CEeiinfk.js";import{c as a}from"./p-hgBUJRDa.js";const o=class{constructor(t){e(this,t)}get host(){return t(this)}invalid=!1;disabled=!1;required=!1;componentDidLoad(){this.wire()}componentDidUpdate(){this.wire()}wire(){const e=this.host.querySelector("label"),t=this.host.querySelector("input, textarea, select"),r=this.host.querySelector('[data-slot="help"]'),i=this.host.querySelector('[data-slot="error"], [role="alert"]');if(!t)return;t.id||(t.id=a("form-field-input")),e&&!e.getAttribute("for")&&e.setAttribute("for",t.id);const o=[];r&&(r.id||(r.id=a("form-field-help")),o.push(r.id)),i&&(i.id||(i.id=a("form-field-error")),o.push(i.id)),o.length&&t.setAttribute("aria-describedby",o.join(" ")),t.disabled=this.disabled,t.required=this.required,t.setAttribute("aria-invalid",this.invalid?"true":"false")}render(){return r(i,{key:"f2eb3a7bf493c0630ef27ee21fca1ffee94be536","data-invalid":this.invalid?"":void 0,"data-disabled":this.disabled?"":void 0,"data-required":this.required?"":void 0},r("slot",{key:"f5f30e388ed9473ee50103f12527a1dd9cfb0b0b"}))}};o.style=":host{display:grid;gap:var(--ui-space-2);color:var(--ui-text-primary)}::slotted(label){color:var(--ui-text-secondary);font-size:0.95rem}::slotted([data-slot='help']){color:var(--ui-text-muted);font-size:0.875rem}::slotted([data-slot='error']),::slotted([role='alert']){color:var(--ui-accent-active);font-size:0.875rem}";export{o as ui_form_field}
@@ -1,24 +0,0 @@
1
- import {
2
- Host,
3
- h,
4
- registerInstance
5
- } from "./chunk-UMFO4QNN.js";
6
-
7
- // dist/esm/ui-icon-button.entry.js
8
- var uiIconButtonCss = () => `:host{display:inline-flex;color:var(--ui-text-secondary)}button{appearance:none;inline-size:var(--ui-icon-button-size, 2.5rem);block-size:var(--ui-icon-button-size, 2.5rem);min-inline-size:var(--ui-icon-button-size, 2.5rem);min-block-size:var(--ui-icon-button-size, 2.5rem);padding:0;margin:0;border:1px solid transparent;border-radius:var(--ui-icon-button-radius, var(--ui-radius-2));background:var(--ui-icon-button-bg, transparent);color:inherit;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color var(--ui-motion-fast) var(--ui-motion-ease), border-color var(--ui-motion-fast) var(--ui-motion-ease), color var(--ui-motion-fast) var(--ui-motion-ease), box-shadow var(--ui-motion-fast) var(--ui-motion-ease), transform var(--ui-motion-fast) var(--ui-motion-ease)}:host([size='sm']) button{inline-size:var(--ui-icon-button-size-sm, 2rem);block-size:var(--ui-icon-button-size-sm, 2rem);min-inline-size:var(--ui-icon-button-size-sm, 2rem);min-block-size:var(--ui-icon-button-size-sm, 2rem)}:host([size='lg']) button{inline-size:var(--ui-icon-button-size-lg, 2.75rem);block-size:var(--ui-icon-button-size-lg, 2.75rem);min-inline-size:var(--ui-icon-button-size-lg, 2.75rem);min-block-size:var(--ui-icon-button-size-lg, 2.75rem)}:host([variant='outline']) button{border-color:var(--ui-icon-button-border, var(--ui-border-default));background:var(--ui-icon-button-outline-bg, var(--ui-surface-default));color:var(--ui-icon-button-outline-color, var(--ui-text-primary))}:host([variant='solid']) button{background:var(--ui-icon-button-solid-bg, var(--ui-accent-solid));color:var(--ui-icon-button-solid-color, var(--ui-text-on-accent));box-shadow:var( --ui-icon-button-solid-shadow, 0 1px 2px color-mix(in srgb, var(--ui-accent-solid) 18%, transparent) )}button:hover:enabled{background:var(--ui-icon-button-hover-bg, var(--ui-surface-muted));color:var(--ui-icon-button-hover-color, var(--ui-text-primary))}:host([variant='outline']) button:hover:enabled{border-color:var(--ui-icon-button-hover-border, var(--ui-border-strong))}:host([variant='solid']) button:hover:enabled{background:var(--ui-icon-button-solid-hover-bg, var(--ui-accent-hover))}button:active:enabled{transform:scale(var(--ui-icon-button-active-scale, 0.96))}button:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:2px}button:disabled,:host([disabled]){opacity:0.6;cursor:not-allowed}::slotted(svg){inline-size:var(--ui-icon-button-icon-size, 1.125rem);block-size:var(--ui-icon-button-icon-size, 1.125rem);flex-shrink:0;stroke-width:var(--ui-icon-button-icon-stroke-width, 1.75)}`;
9
- var UIIconButton = class {
10
- constructor(hostRef) {
11
- registerInstance(this, hostRef);
12
- }
13
- disabled = false;
14
- label = "";
15
- size = "md";
16
- variant = "ghost";
17
- render() {
18
- return h(Host, { key: "8f4c7271505fa061da954f1e989fc526dc980407", "data-disabled": this.disabled ? "" : void 0 }, h("button", { key: "c56009d4028a557cd6f7f19833b0af6412b90c1c", type: "button", "aria-label": this.label || void 0, disabled: this.disabled }, h("slot", { key: "ac2f201b0fbedb23106f72135ff8c3b6f25fca60" })));
19
- }
20
- };
21
- UIIconButton.style = uiIconButtonCss();
22
- export {
23
- UIIconButton as ui_icon_button
24
- };
@@ -1,64 +0,0 @@
1
- declare const TABLE_CELL_BACKGROUND_PRESETS: {
2
- readonly none: null;
3
- readonly gray: "#f3f4f6";
4
- readonly yellow: "#fef3c7";
5
- readonly blue: "#dbeafe";
6
- readonly green: "#dcfce7";
7
- readonly red: "#fee2e2";
8
- };
9
- declare const TABLE_CELL_BACKGROUND_OPTIONS: readonly [{
10
- readonly action: "background-none";
11
- readonly label: "Default";
12
- readonly value: null;
13
- readonly swatch: null;
14
- }, {
15
- readonly action: "background-gray";
16
- readonly label: "Gray";
17
- readonly value: "#f3f4f6";
18
- readonly swatch: "#f3f4f6";
19
- }, {
20
- readonly action: "background-yellow";
21
- readonly label: "Yellow";
22
- readonly value: "#fef3c7";
23
- readonly swatch: "#fef3c7";
24
- }, {
25
- readonly action: "background-blue";
26
- readonly label: "Blue";
27
- readonly value: "#dbeafe";
28
- readonly swatch: "#dbeafe";
29
- }, {
30
- readonly action: "background-green";
31
- readonly label: "Green";
32
- readonly value: "#dcfce7";
33
- readonly swatch: "#dcfce7";
34
- }, {
35
- readonly action: "background-red";
36
- readonly label: "Red";
37
- readonly value: "#fee2e2";
38
- readonly swatch: "#fee2e2";
39
- }];
40
- type TableCellBackgroundAction = typeof TABLE_CELL_BACKGROUND_OPTIONS[number]["action"];
41
-
42
- /**
43
- * ui-editor-table-context-menu — web component for table cell context menu.
44
- * Emits custom events for each action; the adapter (Vue/React) wires Tiptap commands.
45
- * Domain-neutral: no Tiptap dependency.
46
- */
47
-
48
- type TableContextMenuAction = "align-left" | "align-center" | "align-right" | TableCellBackgroundAction | "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after" | "delete-row" | "delete-column" | "delete-table" | "merge-cells" | "split-cell";
49
- interface TableContextMenuActionEventDetail {
50
- action: TableContextMenuAction;
51
- }
52
-
53
- /**
54
- * ui-editor-table-overlay — table edge controls for row/column insertion.
55
- * Emits looma-editor-table-overlay-action with insertion intent.
56
- * Domain-neutral: no Tiptap dependency.
57
- */
58
- type TableOverlayAction = "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after";
59
- interface TableOverlayActionEventDetail {
60
- action: TableOverlayAction;
61
- boundaryIndex: number;
62
- }
63
-
64
- export { TABLE_CELL_BACKGROUND_OPTIONS as T, TABLE_CELL_BACKGROUND_PRESETS as a, type TableCellBackgroundAction as b, type TableContextMenuAction as c, type TableContextMenuActionEventDetail as d, type TableOverlayAction as e, type TableOverlayActionEventDetail as f };