@threadlabs/looma 0.5.1 → 0.6.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. package/README.md +1 -1
  2. package/components/shared/overlay.js +3 -0
  3. package/components/ui-button/ui-button.html +27 -14
  4. package/components/ui-callout/ui-callout.html +1 -1
  5. package/components/ui-checkbox/ui-checkbox.html +1 -1
  6. package/components/ui-cluster/ui-cluster.html +6 -6
  7. package/components/ui-combobox/ui-combobox.html +35 -27
  8. package/components/ui-container/ui-container.html +4 -4
  9. package/components/ui-context-menu/ui-context-menu.html +2 -2
  10. package/components/ui-dialog/ui-dialog.html +21 -8
  11. package/components/ui-disclosure/ui-disclosure.html +19 -4
  12. package/components/ui-editable/ui-editable.html +6 -6
  13. package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.html +21 -21
  14. package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +26 -26
  15. package/components/ui-editor-slash-menu/ui-editor-slash-menu.html +39 -39
  16. package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.html +26 -22
  17. package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +68 -52
  18. package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +42 -38
  19. package/components/ui-editor-toolbar/ui-editor-toolbar.html +9 -9
  20. package/components/ui-floating-action-button/ui-floating-action-button.html +16 -22
  21. package/components/ui-form-field/ui-form-field.html +18 -7
  22. package/components/ui-grid/ui-grid.html +6 -6
  23. package/components/ui-icon/ui-icon.html +5 -1
  24. package/components/ui-icon-button/ui-icon-button.html +68 -34
  25. package/components/ui-input/ui-input.html +2 -2
  26. package/components/ui-menu/ui-menu.html +15 -4
  27. package/components/ui-menu-item/ui-menu-item.html +5 -5
  28. package/components/ui-popover/ui-popover.html +3 -3
  29. package/components/ui-popover/ui-popover.js +10 -2
  30. package/components/ui-reel/ui-reel.html +6 -6
  31. package/components/ui-search-result-row/ui-search-result-row.html +9 -9
  32. package/components/ui-search-shell/ui-search-shell.html +10 -3
  33. package/components/ui-search-shell/ui-search-shell.js +9 -0
  34. package/components/ui-select/ui-select.html +2 -2
  35. package/components/ui-sidebar/ui-sidebar.html +11 -11
  36. package/components/ui-stack/ui-stack.html +6 -6
  37. package/components/ui-switcher/ui-switcher.html +6 -6
  38. package/components/ui-tabs/ui-tabs.html +19 -5
  39. package/components/ui-textarea/ui-textarea.html +2 -2
  40. package/components/ui-toast-region/ui-toast-region.html +3 -3
  41. package/components/ui-tooltip/ui-tooltip.html +1 -1
  42. package/components/ui-top-bar/ui-top-bar.html +5 -5
  43. package/components/ui-tree/ui-tree.html +7 -0
  44. package/components/ui-tree-item/ui-tree-item.html +20 -7
  45. package/dist/index.d.ts +1 -1
  46. package/dist/index.js +2 -2
  47. package/package.json +2 -2
  48. package/styles/ui-affordance-scope.css +1 -1
  49. package/styles/ui-avatar-group.css +1 -1
  50. package/styles/ui-avatar.css +1 -1
  51. package/styles/ui-badge.css +1 -1
  52. package/styles/ui-button.css +25 -15
  53. package/styles/ui-callout.css +2 -2
  54. package/styles/ui-checkbox.css +2 -2
  55. package/styles/ui-cluster.css +7 -7
  56. package/styles/ui-combobox.css +24 -24
  57. package/styles/ui-container.css +5 -5
  58. package/styles/ui-context-menu.css +3 -3
  59. package/styles/ui-dialog.css +26 -9
  60. package/styles/ui-disclosure.css +23 -7
  61. package/styles/ui-editable.css +7 -7
  62. package/styles/ui-editor-insert-table-grid.css +21 -21
  63. package/styles/ui-editor-mention-menu.css +26 -26
  64. package/styles/ui-editor-slash-menu.css +40 -40
  65. package/styles/ui-editor-table-context-menu.css +21 -21
  66. package/styles/ui-editor-table-overlay.css +49 -49
  67. package/styles/ui-editor-table-toolbar.css +35 -35
  68. package/styles/ui-editor-toolbar.css +10 -10
  69. package/styles/ui-floating-action-button.css +17 -23
  70. package/styles/ui-form-field.css +24 -10
  71. package/styles/ui-grid.css +7 -7
  72. package/styles/ui-icon-button.css +74 -35
  73. package/styles/ui-icon.css +1 -1
  74. package/styles/ui-input.css +3 -3
  75. package/styles/ui-menu-item.css +6 -6
  76. package/styles/ui-menu.css +19 -7
  77. package/styles/ui-popover.css +4 -4
  78. package/styles/ui-radio-group.css +1 -1
  79. package/styles/ui-radio.css +1 -1
  80. package/styles/ui-reel.css +7 -7
  81. package/styles/ui-search-result-row.css +10 -10
  82. package/styles/ui-search-shell.css +14 -5
  83. package/styles/ui-select.css +3 -3
  84. package/styles/ui-separator.css +1 -1
  85. package/styles/ui-sidebar.css +12 -12
  86. package/styles/ui-stack.css +7 -7
  87. package/styles/ui-switch.css +1 -1
  88. package/styles/ui-switcher.css +7 -7
  89. package/styles/ui-tabs.css +21 -7
  90. package/styles/ui-textarea.css +3 -3
  91. package/styles/ui-toast-region.css +3 -3
  92. package/styles/ui-tooltip.css +2 -2
  93. package/styles/ui-top-bar.css +6 -6
  94. package/styles/ui-tree-item.css +30 -9
  95. package/styles/ui-tree.css +8 -2
  96. package/theme-dark.css +42 -103
  97. package/theme-high-contrast.css +18 -22
  98. package/theme-light.css +15 -41
  99. package/tokens.css +149 -201
  100. package/vanilla/UiAffordanceScope.d.ts +1 -1
  101. package/vanilla/UiAffordanceScope.js +2 -2
  102. package/vanilla/UiAvatar.d.ts +1 -1
  103. package/vanilla/UiAvatar.js +2 -2
  104. package/vanilla/UiAvatarGroup.d.ts +1 -1
  105. package/vanilla/UiAvatarGroup.js +2 -2
  106. package/vanilla/UiBadge.d.ts +1 -1
  107. package/vanilla/UiBadge.js +2 -2
  108. package/vanilla/UiButton.d.ts +3 -1
  109. package/vanilla/UiButton.js +3 -3
  110. package/vanilla/UiCallout.d.ts +1 -1
  111. package/vanilla/UiCallout.js +2 -2
  112. package/vanilla/UiCheckbox.d.ts +1 -1
  113. package/vanilla/UiCheckbox.js +2 -2
  114. package/vanilla/UiCluster.d.ts +1 -1
  115. package/vanilla/UiCluster.js +2 -2
  116. package/vanilla/UiCombobox.d.ts +1 -1
  117. package/vanilla/UiCombobox.js +3 -3
  118. package/vanilla/UiContainer.d.ts +1 -1
  119. package/vanilla/UiContainer.js +2 -2
  120. package/vanilla/UiContextMenu.d.ts +1 -1
  121. package/vanilla/UiContextMenu.js +2 -2
  122. package/vanilla/UiDialog.d.ts +1 -1
  123. package/vanilla/UiDialog.js +2 -2
  124. package/vanilla/UiDisclosure.d.ts +2 -1
  125. package/vanilla/UiDisclosure.js +3 -3
  126. package/vanilla/UiEditable.d.ts +1 -1
  127. package/vanilla/UiEditable.js +2 -2
  128. package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
  129. package/vanilla/UiEditorInsertTableGrid.js +3 -3
  130. package/vanilla/UiEditorMentionMenu.d.ts +1 -1
  131. package/vanilla/UiEditorMentionMenu.js +3 -3
  132. package/vanilla/UiEditorSlashMenu.d.ts +1 -1
  133. package/vanilla/UiEditorSlashMenu.js +2 -2
  134. package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
  135. package/vanilla/UiEditorTableContextMenu.js +3 -3
  136. package/vanilla/UiEditorTableOverlay.d.ts +1 -1
  137. package/vanilla/UiEditorTableOverlay.js +3 -3
  138. package/vanilla/UiEditorTableToolbar.d.ts +1 -1
  139. package/vanilla/UiEditorTableToolbar.js +3 -3
  140. package/vanilla/UiEditorToolbar.d.ts +1 -1
  141. package/vanilla/UiEditorToolbar.js +2 -2
  142. package/vanilla/UiFloatingActionButton.d.ts +1 -1
  143. package/vanilla/UiFloatingActionButton.js +2 -2
  144. package/vanilla/UiFormField.d.ts +1 -1
  145. package/vanilla/UiFormField.js +15 -6
  146. package/vanilla/UiGrid.d.ts +1 -1
  147. package/vanilla/UiGrid.js +2 -2
  148. package/vanilla/UiIcon.d.ts +1 -1
  149. package/vanilla/UiIcon.js +3 -3
  150. package/vanilla/UiIconButton.d.ts +1 -1
  151. package/vanilla/UiIconButton.js +2 -2
  152. package/vanilla/UiInput.d.ts +1 -1
  153. package/vanilla/UiInput.js +2 -2
  154. package/vanilla/UiMenu.d.ts +2 -1
  155. package/vanilla/UiMenu.js +3 -3
  156. package/vanilla/UiMenuItem.d.ts +1 -1
  157. package/vanilla/UiMenuItem.js +2 -2
  158. package/vanilla/UiPopover.d.ts +1 -1
  159. package/vanilla/UiPopover.js +2 -2
  160. package/vanilla/UiRadio.d.ts +1 -1
  161. package/vanilla/UiRadio.js +2 -2
  162. package/vanilla/UiRadioGroup.d.ts +1 -1
  163. package/vanilla/UiRadioGroup.js +2 -2
  164. package/vanilla/UiReel.d.ts +1 -1
  165. package/vanilla/UiReel.js +2 -2
  166. package/vanilla/UiSearchResultRow.d.ts +1 -1
  167. package/vanilla/UiSearchResultRow.js +2 -2
  168. package/vanilla/UiSearchShell.d.ts +1 -1
  169. package/vanilla/UiSearchShell.js +2 -2
  170. package/vanilla/UiSelect.d.ts +1 -1
  171. package/vanilla/UiSelect.js +2 -2
  172. package/vanilla/UiSeparator.d.ts +1 -1
  173. package/vanilla/UiSeparator.js +2 -2
  174. package/vanilla/UiSidebar.d.ts +1 -1
  175. package/vanilla/UiSidebar.js +2 -2
  176. package/vanilla/UiStack.d.ts +1 -1
  177. package/vanilla/UiStack.js +2 -2
  178. package/vanilla/UiSwitch.d.ts +1 -1
  179. package/vanilla/UiSwitch.js +2 -2
  180. package/vanilla/UiSwitcher.d.ts +1 -1
  181. package/vanilla/UiSwitcher.js +2 -2
  182. package/vanilla/UiTabs.d.ts +2 -1
  183. package/vanilla/UiTabs.js +3 -3
  184. package/vanilla/UiTextarea.d.ts +1 -1
  185. package/vanilla/UiTextarea.js +2 -2
  186. package/vanilla/UiToastRegion.d.ts +1 -1
  187. package/vanilla/UiToastRegion.js +3 -3
  188. package/vanilla/UiTooltip.d.ts +1 -1
  189. package/vanilla/UiTooltip.js +2 -2
  190. package/vanilla/UiTopBar.d.ts +1 -1
  191. package/vanilla/UiTopBar.js +1 -1
  192. package/vanilla/UiTree.d.ts +2 -1
  193. package/vanilla/UiTree.js +3 -3
  194. package/vanilla/UiTreeItem.d.ts +1 -1
  195. package/vanilla/UiTreeItem.js +2 -2
  196. package/vue/UiAffordanceScope.d.ts +2 -2
  197. package/vue/UiAffordanceScope.vue +92 -73
  198. package/vue/UiAvatar.d.ts +7 -7
  199. package/vue/UiAvatar.vue +145 -105
  200. package/vue/UiAvatarGroup.d.ts +4 -4
  201. package/vue/UiAvatarGroup.vue +134 -118
  202. package/vue/UiBadge.d.ts +4 -4
  203. package/vue/UiBadge.vue +113 -114
  204. package/vue/UiButton.d.ts +10 -6
  205. package/vue/UiButton.vue +295 -248
  206. package/vue/UiCallout.d.ts +2 -2
  207. package/vue/UiCallout.vue +154 -87
  208. package/vue/UiCheckbox.d.ts +14 -10
  209. package/vue/UiCheckbox.vue +228 -162
  210. package/vue/UiCluster.d.ts +2 -2
  211. package/vue/UiCluster.vue +53 -60
  212. package/vue/UiCombobox.d.ts +36 -32
  213. package/vue/UiCombobox.vue +1005 -416
  214. package/vue/UiContainer.d.ts +2 -2
  215. package/vue/UiContainer.vue +48 -51
  216. package/vue/UiContextMenu.d.ts +6 -4
  217. package/vue/UiContextMenu.vue +205 -116
  218. package/vue/UiDialog.d.ts +11 -9
  219. package/vue/UiDialog.vue +287 -212
  220. package/vue/UiDisclosure.d.ts +10 -6
  221. package/vue/UiDisclosure.vue +265 -159
  222. package/vue/UiEditable.d.ts +16 -12
  223. package/vue/UiEditable.vue +325 -205
  224. package/vue/UiEditorInsertTableGrid.d.ts +8 -8
  225. package/vue/UiEditorInsertTableGrid.vue +216 -157
  226. package/vue/UiEditorMentionMenu.d.ts +9 -9
  227. package/vue/UiEditorMentionMenu.vue +265 -222
  228. package/vue/UiEditorSlashMenu.d.ts +7 -7
  229. package/vue/UiEditorSlashMenu.vue +286 -240
  230. package/vue/UiEditorTableContextMenu.d.ts +5 -5
  231. package/vue/UiEditorTableContextMenu.vue +306 -193
  232. package/vue/UiEditorTableOverlay.d.ts +2 -2
  233. package/vue/UiEditorTableOverlay.vue +600 -369
  234. package/vue/UiEditorTableToolbar.d.ts +7 -7
  235. package/vue/UiEditorTableToolbar.vue +443 -268
  236. package/vue/UiEditorToolbar.d.ts +2 -2
  237. package/vue/UiEditorToolbar.vue +134 -121
  238. package/vue/UiFloatingActionButton.d.ts +6 -6
  239. package/vue/UiFloatingActionButton.vue +95 -99
  240. package/vue/UiFormField.d.ts +6 -6
  241. package/vue/UiFormField.vue +112 -80
  242. package/vue/UiGrid.d.ts +2 -2
  243. package/vue/UiGrid.vue +51 -57
  244. package/vue/UiIcon.d.ts +2 -2
  245. package/vue/UiIcon.vue +118 -89
  246. package/vue/UiIconButton.d.ts +11 -11
  247. package/vue/UiIconButton.vue +287 -217
  248. package/vue/UiInput.d.ts +9 -9
  249. package/vue/UiInput.vue +153 -127
  250. package/vue/UiMenu.d.ts +10 -6
  251. package/vue/UiMenu.vue +227 -143
  252. package/vue/UiMenuItem.d.ts +4 -4
  253. package/vue/UiMenuItem.vue +53 -46
  254. package/vue/UiPopover.d.ts +8 -6
  255. package/vue/UiPopover.vue +197 -137
  256. package/vue/UiRadio.d.ts +14 -10
  257. package/vue/UiRadio.vue +183 -117
  258. package/vue/UiRadioGroup.d.ts +14 -12
  259. package/vue/UiRadioGroup.vue +172 -111
  260. package/vue/UiReel.d.ts +3 -3
  261. package/vue/UiReel.vue +77 -77
  262. package/vue/UiSearchResultRow.d.ts +4 -4
  263. package/vue/UiSearchResultRow.vue +121 -115
  264. package/vue/UiSearchShell.d.ts +10 -8
  265. package/vue/UiSearchShell.vue +245 -176
  266. package/vue/UiSelect.d.ts +9 -9
  267. package/vue/UiSelect.vue +162 -134
  268. package/vue/UiSeparator.d.ts +2 -2
  269. package/vue/UiSeparator.vue +22 -27
  270. package/vue/UiSidebar.d.ts +20 -18
  271. package/vue/UiSidebar.vue +307 -224
  272. package/vue/UiStack.d.ts +3 -3
  273. package/vue/UiStack.vue +64 -70
  274. package/vue/UiSwitch.d.ts +12 -8
  275. package/vue/UiSwitch.vue +218 -150
  276. package/vue/UiSwitcher.d.ts +3 -3
  277. package/vue/UiSwitcher.vue +73 -75
  278. package/vue/UiTabs.d.ts +12 -8
  279. package/vue/UiTabs.vue +268 -210
  280. package/vue/UiTextarea.d.ts +11 -11
  281. package/vue/UiTextarea.vue +155 -128
  282. package/vue/UiToastRegion.d.ts +10 -8
  283. package/vue/UiToastRegion.vue +261 -198
  284. package/vue/UiTooltip.d.ts +14 -12
  285. package/vue/UiTooltip.vue +241 -177
  286. package/vue/UiTopBar.vue +51 -42
  287. package/vue/UiTree.d.ts +10 -6
  288. package/vue/UiTree.vue +180 -70
  289. package/vue/UiTreeItem.d.ts +24 -22
  290. package/vue/UiTreeItem.vue +464 -339
  291. package/vue/chunks/UiAffordanceScope.js +9 -16
  292. package/vue/chunks/UiAvatar.js +23 -29
  293. package/vue/chunks/UiAvatarGroup.js +16 -39
  294. package/vue/chunks/UiBadge.js +3 -12
  295. package/vue/chunks/UiButton.js +15 -18
  296. package/vue/chunks/UiCallout.js +8 -17
  297. package/vue/chunks/UiCheckbox.js +37 -40
  298. package/vue/chunks/UiCluster.js +3 -12
  299. package/vue/chunks/UiCombobox.js +224 -266
  300. package/vue/chunks/UiContainer.js +3 -12
  301. package/vue/chunks/UiContextMenu.js +39 -34
  302. package/vue/chunks/UiDialog.js +36 -39
  303. package/vue/chunks/UiDisclosure.js +44 -48
  304. package/vue/chunks/UiEditable.js +55 -57
  305. package/vue/chunks/UiEditorInsertTableGrid.js +55 -73
  306. package/vue/chunks/UiEditorMentionMenu.js +40 -81
  307. package/vue/chunks/UiEditorSlashMenu.js +28 -52
  308. package/vue/chunks/UiEditorTableContextMenu.js +32 -56
  309. package/vue/chunks/UiEditorTableOverlay.js +58 -82
  310. package/vue/chunks/UiEditorTableToolbar.js +61 -85
  311. package/vue/chunks/UiEditorToolbar.js +4 -13
  312. package/vue/chunks/UiFloatingActionButton.js +7 -21
  313. package/vue/chunks/UiFormField.js +15 -12
  314. package/vue/chunks/UiGrid.js +3 -12
  315. package/vue/chunks/UiIcon.js +20 -43
  316. package/vue/chunks/UiIconButton.js +16 -28
  317. package/vue/chunks/UiInput.js +20 -25
  318. package/vue/chunks/UiMenu.js +30 -33
  319. package/vue/chunks/UiMenuItem.js +4 -10
  320. package/vue/chunks/UiPopover.js +28 -29
  321. package/vue/chunks/UiRadio.js +36 -39
  322. package/vue/chunks/UiRadioGroup.js +30 -34
  323. package/vue/chunks/UiReel.js +6 -15
  324. package/vue/chunks/UiSearchResultRow.js +6 -19
  325. package/vue/chunks/UiSearchShell.js +25 -28
  326. package/vue/chunks/UiSelect.js +20 -23
  327. package/vue/chunks/UiSeparator.js +2 -8
  328. package/vue/chunks/UiSidebar.js +39 -44
  329. package/vue/chunks/UiStack.js +6 -15
  330. package/vue/chunks/UiSwitch.js +35 -38
  331. package/vue/chunks/UiSwitcher.js +6 -15
  332. package/vue/chunks/UiTabs.js +52 -85
  333. package/vue/chunks/UiTextarea.js +21 -26
  334. package/vue/chunks/UiToastRegion.js +38 -72
  335. package/vue/chunks/UiTooltip.js +34 -35
  336. package/vue/chunks/UiTopBar.js +1 -1
  337. package/vue/chunks/UiTree.js +27 -16
  338. package/vue/chunks/UiTreeItem.js +85 -102
  339. package/vue/components.css +4027 -3800
  340. package/vue/editor/LoomaEditor.d.ts +11 -0
  341. package/vue/editor/index.js +9 -0
@@ -1,455 +1,686 @@
1
- <!-- Generated by HTML Next 1.0.0-alpha.1 for Vue 3.5. Do not edit. -->
1
+ <!-- Generated by HTML Next 1.0.0-alpha.2 for Vue 3.5. Do not edit. -->
2
2
  <script setup lang="ts">
3
- import { computed, onBeforeUnmount, onMounted, ref, shallowRef, watchEffect } from "vue";
4
- import UiIcon from "./UiIcon.vue";
5
- import * as controllerModule from "../components/ui-editor-table-overlay/ui-editor-table-overlay.js";
6
-
7
- defineOptions({ inheritAttrs: false });
8
-
9
- const hn = {
10
- t: (v: unknown): boolean => v === true || (typeof v === "string" ? v.length > 0 : typeof v === "number" ? v !== 0 && v === v : Array.isArray(v) ? v.length > 0 : v !== null && typeof v === "object" ? Object.keys(v).length > 0 : false),
11
- text: (v: unknown): string => v === undefined || v === null ? "" : Array.isArray(v) ? v.map(hn.text).join(" ") : typeof v === "object" ? "" : String(v),
12
- attr: (v: unknown): any => v === undefined || v === null || v === false ? undefined : v === true ? "" : Array.isArray(v) ? v.map(hn.text).join(" ") : typeof v === "object" ? undefined : String(v),
13
- enumerated: (v: unknown): any => typeof v === "boolean" ? String(v) : hn.attr(v),
14
- shape: (items: unknown, where: ((item: any) => unknown) | undefined, sort: readonly string[], limit: unknown): any[] => {
15
- let list = Array.isArray(items) ? items.slice() : [];
16
- if (where !== undefined) list = list.filter((item) => hn.t(where(item)));
17
- if (sort.length > 0) {
18
- const field = (item: unknown, path: string): unknown => item !== null && typeof item === "object" && !Array.isArray(item)
19
- ? path.split(".").reduce<unknown>((value, key) => (value as Record<string, unknown> | undefined)?.[key], item)
20
- : item;
21
- const compare = (a: unknown, b: unknown): number => typeof a === "number" && typeof b === "number" ? a - b : hn.text(a).localeCompare(hn.text(b));
22
- list.sort((a, b) => {
23
- for (const key of sort) {
24
- const descending = key.startsWith("-");
25
- const order = compare(field(a, descending ? key.slice(1) : key), field(b, descending ? key.slice(1) : key));
26
- if (order !== 0) return descending ? -order : order;
27
- }
28
- return 0;
29
- });
30
- }
31
- return typeof limit === "number" ? list.slice(0, Math.max(0, Math.trunc(limit))) : list;
3
+ import { computed, onBeforeUnmount, onMounted, ref, shallowRef, watchEffect } from 'vue'
4
+ import * as controllerModule from '../components/ui-editor-table-overlay/ui-editor-table-overlay.js'
5
+ import UiIcon from './UiIcon.vue'
6
+
7
+ defineOptions({ inheritAttrs: false })
8
+
9
+ const props = withDefaults(
10
+ defineProps<{
11
+ geometry?: {
12
+ readonly rowBoundaries: readonly (number)[]
13
+ readonly columnBoundaries: readonly (number)[]
14
+ readonly activeCell: {
15
+ readonly left: number
16
+ readonly top: number
17
+ readonly width: number
18
+ readonly height: number
19
+ readonly rowIndex: number
20
+ readonly columnIndex: number
21
+ } | null
22
+ readonly hoveredCell?: {
23
+ readonly left: number
24
+ readonly top: number
25
+ readonly width: number
26
+ readonly height: number
27
+ readonly rowIndex: number
28
+ readonly columnIndex: number
29
+ } | null
30
+ } | null
31
+ open?: boolean
32
+ }>(),
33
+ {
34
+ open: false,
32
35
  },
33
- };
34
-
35
- const props = withDefaults(defineProps<{
36
- geometry?: { readonly rowBoundaries: readonly (number)[]; readonly columnBoundaries: readonly (number)[]; readonly activeCell: { readonly left: number; readonly top: number; readonly width: number; readonly height: number; readonly rowIndex: number; readonly columnIndex: number } | null; readonly hoveredCell?: { readonly left: number; readonly top: number; readonly width: number; readonly height: number; readonly rowIndex: number; readonly columnIndex: number } | null } | null;
37
- open?: boolean | null;
38
- }>(), {
39
- open: false,
40
- });
36
+ )
41
37
  const emit = defineEmits<{
42
- "action": [detail: { readonly action: "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after"; readonly boundaryIndex: number } | { readonly action: "select-row" | "select-column"; readonly rowIndex: number; readonly columnIndex: number } | { readonly action: "open-cell-menu"; readonly rowIndex: number; readonly columnIndex: number; readonly anchor: { readonly left: number; readonly top: number; readonly right: number; readonly bottom: number } }];
43
- }>();
44
- const root = ref<HTMLElement | null>(null);
45
- const refs: Record<string, Element | undefined> = {};
46
- const state_rows = ref<any>([]);
47
- const state_cols = ref<any>([]);
48
- const state_hovered = ref<any>(null);
49
- const state_active = ref<any>(null);
50
- const state_activeKey = ref<any>("");
38
+ action: [
39
+ detail: {
40
+ readonly action: 'add-row-before' | 'add-row-after' | 'add-column-before' | 'add-column-after'
41
+ readonly boundaryIndex: number
42
+ } | {
43
+ readonly action: 'select-row' | 'select-column'
44
+ readonly rowIndex: number
45
+ readonly columnIndex: number
46
+ } | {
47
+ readonly action: 'open-cell-menu'
48
+ readonly rowIndex: number
49
+ readonly columnIndex: number
50
+ readonly anchor: {
51
+ readonly left: number
52
+ readonly top: number
53
+ readonly right: number
54
+ readonly bottom: number
55
+ }
56
+ },
57
+ ]
58
+ }>()
59
+
60
+ const root = ref<HTMLElement | null>(null)
61
+ const rows = ref<
62
+ {
63
+ key: string
64
+ index: number
65
+ offset: string
66
+ affordance: 'insert-row' | 'insert-column'
67
+ action: 'add-row-before' | 'add-row-after' | 'add-column-before' | 'add-column-after'
68
+ label: string
69
+ }[]
70
+ >([])
71
+ const cols = ref<
72
+ {
73
+ key: string
74
+ index: number
75
+ offset: string
76
+ affordance: 'insert-row' | 'insert-column'
77
+ action: 'add-row-before' | 'add-row-after' | 'add-column-before' | 'add-column-after'
78
+ label: string
79
+ }[]
80
+ >([])
81
+ const hovered = ref<
82
+ {
83
+ left: number
84
+ top: number
85
+ width: number
86
+ height: number
87
+ rowIndex: number
88
+ columnIndex: number
89
+ rowOffset: string
90
+ columnOffset: string
91
+ } | null
92
+ >(null)
93
+ const active = ref<
94
+ {
95
+ left: number
96
+ top: number
97
+ width: number
98
+ height: number
99
+ rowIndex: number
100
+ columnIndex: number
101
+ menuLeft: string
102
+ menuTop: string
103
+ } | null
104
+ >(null)
105
+ const activeKey = ref('')
51
106
 
52
107
  /** Dispatches a component event to Vue listeners and, for controllers and page code, on the root. */
53
- const dispatch = (name: string, detail?: unknown): boolean => {
54
- const declared = {"action":{"bubbles":true,"composed":true,"cancelable":false}} as Record<string, EventInit | undefined>;
108
+ function dispatch(name: string, detail?: unknown): boolean {
109
+ const declared: Record<string, EventInit | undefined> = {
110
+ action: { bubbles: true, composed: true, cancelable: false },
111
+ }
55
112
  const checks: Record<string, (detail: unknown) => boolean> = {
56
- "action": (detail: unknown) => ((detail !== null && typeof detail === "object" && !Array.isArray(detail) && ((detail as Record<string, unknown>)["action"] === "add-row-before" || (detail as Record<string, unknown>)["action"] === "add-row-after" || (detail as Record<string, unknown>)["action"] === "add-column-before" || (detail as Record<string, unknown>)["action"] === "add-column-after") && Number.isInteger((detail as Record<string, unknown>)["boundaryIndex"]) && Object.keys(detail as object).every((key) => ["action","boundaryIndex"].includes(key))) || (detail !== null && typeof detail === "object" && !Array.isArray(detail) && ((detail as Record<string, unknown>)["action"] === "select-row" || (detail as Record<string, unknown>)["action"] === "select-column") && Number.isInteger((detail as Record<string, unknown>)["rowIndex"]) && Number.isInteger((detail as Record<string, unknown>)["columnIndex"]) && Object.keys(detail as object).every((key) => ["action","rowIndex","columnIndex"].includes(key))) || (detail !== null && typeof detail === "object" && !Array.isArray(detail) && (detail as Record<string, unknown>)["action"] === "open-cell-menu" && Number.isInteger((detail as Record<string, unknown>)["rowIndex"]) && Number.isInteger((detail as Record<string, unknown>)["columnIndex"]) && ((detail as Record<string, unknown>)["anchor"] !== null && typeof (detail as Record<string, unknown>)["anchor"] === "object" && !Array.isArray((detail as Record<string, unknown>)["anchor"]) && (typeof ((detail as Record<string, unknown>)["anchor"] as Record<string, unknown>)["left"] === "number" && Number.isFinite(((detail as Record<string, unknown>)["anchor"] as Record<string, unknown>)["left"])) && (typeof ((detail as Record<string, unknown>)["anchor"] as Record<string, unknown>)["top"] === "number" && Number.isFinite(((detail as Record<string, unknown>)["anchor"] as Record<string, unknown>)["top"])) && (typeof ((detail as Record<string, unknown>)["anchor"] as Record<string, unknown>)["right"] === "number" && Number.isFinite(((detail as Record<string, unknown>)["anchor"] as Record<string, unknown>)["right"])) && (typeof ((detail as Record<string, unknown>)["anchor"] as Record<string, unknown>)["bottom"] === "number" && Number.isFinite(((detail as Record<string, unknown>)["anchor"] as Record<string, unknown>)["bottom"])) && Object.keys((detail as Record<string, unknown>)["anchor"] as object).every((key) => ["left","top","right","bottom"].includes(key))) && Object.keys(detail as object).every((key) => ["action","rowIndex","columnIndex","anchor"].includes(key)))),
57
- };
113
+ action: (detail) =>
114
+ (detail !== null && typeof detail === 'object' && !Array.isArray(detail)
115
+ && ((detail as Record<string, unknown>)['action'] === 'add-row-before'
116
+ || (detail as Record<string, unknown>)['action'] === 'add-row-after'
117
+ || (detail as Record<string, unknown>)['action'] === 'add-column-before'
118
+ || (detail as Record<string, unknown>)['action'] === 'add-column-after')
119
+ && Number.isInteger((detail as Record<string, unknown>)['boundaryIndex'])
120
+ && Object.keys(detail as object).every((key) => ['action', 'boundaryIndex'].includes(key)))
121
+ || (detail !== null && typeof detail === 'object' && !Array.isArray(detail)
122
+ && ((detail as Record<string, unknown>)['action'] === 'select-row'
123
+ || (detail as Record<string, unknown>)['action'] === 'select-column')
124
+ && Number.isInteger((detail as Record<string, unknown>)['rowIndex'])
125
+ && Number.isInteger((detail as Record<string, unknown>)['columnIndex'])
126
+ && Object.keys(detail as object).every((key) =>
127
+ ['action', 'rowIndex', 'columnIndex'].includes(key)
128
+ ))
129
+ || (detail !== null && typeof detail === 'object' && !Array.isArray(detail)
130
+ && (detail as Record<string, unknown>)['action'] === 'open-cell-menu'
131
+ && Number.isInteger((detail as Record<string, unknown>)['rowIndex'])
132
+ && Number.isInteger((detail as Record<string, unknown>)['columnIndex'])
133
+ && ((detail as Record<string, unknown>)['anchor'] !== null
134
+ && typeof (detail as Record<string, unknown>)['anchor'] === 'object'
135
+ && !Array.isArray((detail as Record<string, unknown>)['anchor'])
136
+ && (typeof ((detail as Record<string, unknown>)['anchor'] as Record<string, unknown>)[
137
+ 'left'
138
+ ] === 'number'
139
+ && Number.isFinite(
140
+ ((detail as Record<string, unknown>)['anchor'] as Record<string, unknown>)['left'],
141
+ ))
142
+ && (typeof ((detail as Record<string, unknown>)['anchor'] as Record<string, unknown>)[
143
+ 'top'
144
+ ] === 'number'
145
+ && Number.isFinite(
146
+ ((detail as Record<string, unknown>)['anchor'] as Record<string, unknown>)['top'],
147
+ ))
148
+ && (typeof ((detail as Record<string, unknown>)['anchor'] as Record<string, unknown>)[
149
+ 'right'
150
+ ] === 'number'
151
+ && Number.isFinite(
152
+ ((detail as Record<string, unknown>)['anchor'] as Record<string, unknown>)['right'],
153
+ ))
154
+ && (typeof ((detail as Record<string, unknown>)['anchor'] as Record<string, unknown>)[
155
+ 'bottom'
156
+ ] === 'number'
157
+ && Number.isFinite(
158
+ ((detail as Record<string, unknown>)['anchor'] as Record<string, unknown>)['bottom'],
159
+ ))
160
+ && Object.keys((detail as Record<string, unknown>)['anchor'] as object).every((key) =>
161
+ ['left', 'top', 'right', 'bottom'].includes(key)
162
+ ))
163
+ && Object.keys(detail as object).every((key) =>
164
+ ['action', 'rowIndex', 'columnIndex', 'anchor'].includes(key)
165
+ )),
166
+ }
58
167
  if (detail !== undefined && checks[name] !== undefined && !checks[name]!(detail)) {
59
- throw new TypeError(`HR002: Event \`${name}\` detail does not satisfy its declared type.`);
168
+ throw new TypeError(`HR002: Event \`${name}\` detail does not satisfy its declared type.`)
60
169
  }
61
- (emit as (name: string, detail: unknown) => void)(name, detail);
62
- return root.value?.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, ...declared[name], detail })) ?? true;
63
- };
170
+ const emitEvent = emit as (name: string, detail: unknown) => void
171
+ emitEvent(name, detail)
172
+ return root.value?.dispatchEvent(
173
+ new CustomEvent(name, { bubbles: true, composed: true, ...declared[name], detail }),
174
+ ) ?? true
175
+ }
64
176
 
65
177
  function read(name: string): unknown {
66
- if (name === "rows") return state_rows.value;
67
- if (name === "cols") return state_cols.value;
68
- if (name === "hovered") return state_hovered.value;
69
- if (name === "active") return state_active.value;
70
- if (name === "activeKey") return state_activeKey.value;
71
- return (props as Record<string, unknown>)[name];
178
+ if (name === 'rows') return rows.value
179
+ if (name === 'cols') return cols.value
180
+ if (name === 'hovered') return hovered.value
181
+ if (name === 'active') return active.value
182
+ if (name === 'activeKey') return activeKey.value
183
+ return (props as Record<string, unknown>)[name]
72
184
  }
73
185
 
74
186
  function write(name: string, value: unknown): boolean {
75
- if (name === "rows") { state_rows.value = value; return true; }
76
- if (name === "cols") { state_cols.value = value; return true; }
77
- if (name === "hovered") { state_hovered.value = value; return true; }
78
- if (name === "active") { state_active.value = value; return true; }
79
- if (name === "activeKey") { state_activeKey.value = value; return true; }
80
- throw new TypeError(`Only declared state is writable; \`${name}\` is not.`);
187
+ if (name === 'rows') {
188
+ rows.value = value as never
189
+ return true
190
+ }
191
+ if (name === 'cols') {
192
+ cols.value = value as never
193
+ return true
194
+ }
195
+ if (name === 'hovered') {
196
+ hovered.value = value as never
197
+ return true
198
+ }
199
+ if (name === 'active') {
200
+ active.value = value as never
201
+ return true
202
+ }
203
+ if (name === 'activeKey') {
204
+ activeKey.value = value as never
205
+ return true
206
+ }
207
+ throw new TypeError(`Only declared state is writable; \`${name}\` is not.`)
81
208
  }
82
209
 
83
- const stops: Array<() => void> = [];
210
+ const stops: Array<() => void> = []
84
211
  const host = {
85
- get element(): Element { return root.value as Element; },
212
+ get element(): Element {
213
+ return root.value as Element
214
+ },
86
215
  state: new Proxy({} as Record<string, unknown>, {
87
- get: (_target, name) => typeof name === "string" ? read(name) : undefined,
88
- set: (_target, name, value) => typeof name === "string" && write(name, value),
216
+ get: (_target, name) => typeof name === 'string' ? read(name) : undefined,
217
+ set: (_target, name, value) => typeof name === 'string' && write(name, value),
89
218
  }),
90
- refs: refs as Readonly<Record<string, Element>>,
219
+ refs: {} as Readonly<Record<string, Element>>,
91
220
  elements: new Proxy({} as Record<string, Element | RadioNodeList | undefined>, {
92
221
  get: (_target, name) => {
93
- if (typeof name !== "string" || root.value === null) return undefined;
94
- const form = root.value instanceof HTMLFormElement ? root.value : root.value.querySelector("form");
95
- return form?.elements.namedItem(name) ?? root.value.querySelector(`[name="${CSS.escape(name)}"]`) ?? undefined;
222
+ if (typeof name !== 'string' || root.value === null) return undefined
223
+ const form = root.value instanceof HTMLFormElement
224
+ ? root.value
225
+ : root.value.querySelector('form')
226
+ return form?.elements.namedItem(name)
227
+ ?? root.value.querySelector(`[name="${CSS.escape(name)}"]`) ?? undefined
96
228
  },
97
229
  }),
98
230
  signal<T>(initialValue: T) {
99
- const value = shallowRef(initialValue);
231
+ const value = shallowRef(initialValue)
100
232
  return {
101
233
  get: (): T => value.value,
102
- set: (next: T): void => { if (!Object.is(value.value, next)) value.value = next; },
103
- update: (next: (current: T) => T): void => { const updated = next(value.value); if (!Object.is(value.value, updated)) value.value = updated; },
104
- };
234
+ set: (next: T): void => {
235
+ if (!Object.is(value.value, next)) value.value = next
236
+ },
237
+ update: (next: (current: T) => T): void => {
238
+ const updated = next(value.value)
239
+ if (!Object.is(value.value, updated)) value.value = updated
240
+ },
241
+ }
105
242
  },
106
243
  computed<T>(compute: () => T) {
107
- const value = computed(compute);
108
- return { get: (): T => value.value };
244
+ const value = computed(compute)
245
+ return { get: (): T => value.value }
109
246
  },
110
247
  effect(run: () => void | (() => void)): () => void {
111
248
  const stop = watchEffect((onCleanup) => {
112
- const cleanup = run();
113
- if (typeof cleanup === "function") onCleanup(cleanup);
114
- }, { flush: "post" });
115
- stops.push(stop);
116
- return stop;
249
+ const cleanup = run()
250
+ if (typeof cleanup === 'function') onCleanup(cleanup)
251
+ }, { flush: 'post' })
252
+ stops.push(stop)
253
+ return stop
117
254
  },
118
255
  on(event: string, listener: EventListener): () => void {
119
- const element = root.value;
120
- element?.addEventListener(event, listener);
121
- const off = (): void => element?.removeEventListener(event, listener);
122
- stops.push(off);
123
- return off;
256
+ const element = root.value
257
+ element?.addEventListener(event, listener)
258
+ const off = (): void => element?.removeEventListener(event, listener)
259
+ stops.push(off)
260
+ return off
124
261
  },
125
262
  dispatch,
126
- };
263
+ }
127
264
 
128
- let cleanup: void | (() => void);
129
- let ready: Promise<void> | undefined;
265
+ let cleanup: void | (() => void)
266
+ let ready: Promise<void> | undefined
130
267
  onMounted(() => {
131
- ready = Promise.resolve(controllerModule.default(host as never)).then((result) => { cleanup = result; });
132
- });
268
+ ready = Promise.resolve(controllerModule.default(host as never)).then((result) => {
269
+ cleanup = result
270
+ })
271
+ })
133
272
  onBeforeUnmount(() => {
134
- for (const stop of stops.splice(0)) stop();
135
- if (typeof cleanup === "function") cleanup();
136
- });
273
+ for (const stop of stops.splice(0)) stop()
274
+ if (typeof cleanup === 'function') cleanup()
275
+ })
137
276
  </script>
138
277
 
139
278
  <template>
140
- <div data-component="ui-editor-table-overlay" aria-label="Table controls" v-bind="$attrs" :hidden="hn.attr(!hn.t(props.open))" ref="root"><div class="rows"><template v-for="(control, index) in hn.shape(state_rows, undefined, [], undefined)" :key="(control)?.key"><div class="control row" :data-control-key="hn.attr((control)?.key)" :class="{ 'active': hn.t(((control)?.key === state_activeKey)) }" :style="{ 'top': hn.text((control)?.offset) }"><span class="line" aria-hidden="true"></span><span class="guide" data-ui-guide="" aria-hidden="true"></span><button type="button" class="handle" :data-ui-affordance="hn.attr((control)?.affordance)" :data-action="hn.attr((control)?.action)" :data-boundary-index="hn.attr((control)?.index)" :aria-label="hn.enumerated((control)?.label)"><UiIcon name="plus"></UiIcon><span class="tooltip" role="tooltip">{{ hn.text((control)?.label) }}</span></button></div></template></div><div class="cols"><template v-for="(control, index) in hn.shape(state_cols, undefined, [], undefined)" :key="(control)?.key"><div class="control col" :data-control-key="hn.attr((control)?.key)" :class="{ 'active': hn.t(((control)?.key === state_activeKey)) }" :style="{ 'left': hn.text((control)?.offset) }"><span class="line" aria-hidden="true"></span><span class="guide" data-ui-guide="" aria-hidden="true"></span><button type="button" class="handle" :data-ui-affordance="hn.attr((control)?.affordance)" :data-action="hn.attr((control)?.action)" :data-boundary-index="hn.attr((control)?.index)" :aria-label="hn.enumerated((control)?.label)"><UiIcon name="plus"></UiIcon><span class="tooltip" role="tooltip">{{ hn.text((control)?.label) }}</span></button></div></template></div><template v-if="hn.t(state_hovered)"><button type="button" class="selector row" data-action="select-row" title="Select row" aria-label="Select row" :data-row-index="hn.attr((state_hovered)?.rowIndex)" :data-column-index="hn.attr((state_hovered)?.columnIndex)" :style="{ 'top': hn.text((state_hovered)?.rowOffset) }"><span class="glyph"><UiIcon name="grip-vertical"></UiIcon></span></button><button type="button" class="selector column" data-action="select-column" title="Select column" aria-label="Select column" :data-row-index="hn.attr((state_hovered)?.rowIndex)" :data-column-index="hn.attr((state_hovered)?.columnIndex)" :style="{ 'left': hn.text((state_hovered)?.columnOffset) }"><span class="glyph"><UiIcon name="grip-horizontal"></UiIcon></span></button></template><template v-if="hn.t(state_active)"><button type="button" class="cell-menu" data-action="open-cell-menu" title="Cell actions" aria-label="Cell actions" :data-row-index="hn.attr((state_active)?.rowIndex)" :data-column-index="hn.attr((state_active)?.columnIndex)" :style="{ 'left': hn.text((state_active)?.menuLeft), 'top': hn.text((state_active)?.menuTop) }"><UiIcon name="chevron-down"></UiIcon></button></template></div>
279
+ <div
280
+ data-component="ui-editor-table-overlay"
281
+ aria-label="Table controls"
282
+ v-bind="$attrs"
283
+ :hidden="!open"
284
+ ref="root"
285
+ >
286
+ <div class="rows">
287
+ <div
288
+ v-for="control in rows"
289
+ :key="control.key"
290
+ class="control row"
291
+ :data-control-key="control.key"
292
+ :class="{ active: control.key === activeKey }"
293
+ :style="{ top: control.offset }"
294
+ >
295
+ <span class="line" aria-hidden="true"></span>
296
+ <span class="guide" data-ui-guide="" aria-hidden="true"></span>
297
+ <button
298
+ type="button"
299
+ class="handle"
300
+ :data-ui-affordance="control.affordance"
301
+ :data-action="control.action"
302
+ :data-boundary-index="control.index"
303
+ :aria-label="control.label"
304
+ >
305
+ <UiIcon name="plus" />
306
+ <span class="tooltip" role="tooltip">{{ control.label }}</span>
307
+ </button>
308
+ </div>
309
+ </div>
310
+ <div class="cols">
311
+ <div
312
+ v-for="control in cols"
313
+ :key="control.key"
314
+ class="control col"
315
+ :data-control-key="control.key"
316
+ :class="{ active: control.key === activeKey }"
317
+ :style="{ left: control.offset }"
318
+ >
319
+ <span class="line" aria-hidden="true"></span>
320
+ <span class="guide" data-ui-guide="" aria-hidden="true"></span>
321
+ <button
322
+ type="button"
323
+ class="handle"
324
+ :data-ui-affordance="control.affordance"
325
+ :data-action="control.action"
326
+ :data-boundary-index="control.index"
327
+ :aria-label="control.label"
328
+ >
329
+ <UiIcon name="plus" />
330
+ <span class="tooltip" role="tooltip">{{ control.label }}</span>
331
+ </button>
332
+ </div>
333
+ </div>
334
+ <template v-if="hovered"><button
335
+ type="button"
336
+ class="selector row"
337
+ data-action="select-row"
338
+ title="Select row"
339
+ aria-label="Select row"
340
+ :data-row-index="hovered?.rowIndex"
341
+ :data-column-index="hovered?.columnIndex"
342
+ :style="{ top: hovered?.rowOffset }"
343
+ >
344
+ <span class="glyph"><UiIcon name="grip-vertical" /></span>
345
+ </button>
346
+ <button
347
+ type="button"
348
+ class="selector column"
349
+ data-action="select-column"
350
+ title="Select column"
351
+ aria-label="Select column"
352
+ :data-row-index="hovered?.rowIndex"
353
+ :data-column-index="hovered?.columnIndex"
354
+ :style="{ left: hovered?.columnOffset }"
355
+ >
356
+ <span class="glyph"><UiIcon name="grip-horizontal" /></span>
357
+ </button></template>
358
+ <button
359
+ v-if="active"
360
+ type="button"
361
+ class="cell-menu"
362
+ data-action="open-cell-menu"
363
+ title="Cell actions"
364
+ aria-label="Cell actions"
365
+ :data-row-index="active?.rowIndex"
366
+ :data-column-index="active?.columnIndex"
367
+ :style="{ left: active?.menuLeft, top: active?.menuTop }"
368
+ >
369
+ <UiIcon name="chevron-down" />
370
+ </button>
371
+ </div>
141
372
  </template>
142
373
 
143
374
  <style scoped>
144
375
  [data-component~="ui-editor-table-overlay"] {
145
- display: block;
146
- width: 100%;
147
- height: 100%;
148
- overflow: visible;
149
- pointer-events: none;
150
- }
376
+ display: block;
377
+ width: 100%;
378
+ height: 100%;
379
+ overflow: visible;
380
+ pointer-events: none;
381
+ }
151
382
 
152
- [data-component~="ui-editor-table-overlay"] {
153
- position: relative;
154
- width: 100%;
155
- height: 100%;
156
- overflow: visible;
157
- pointer-events: none;
158
- }
383
+ [data-component~="ui-editor-table-overlay"] {
384
+ position: relative;
385
+ width: 100%;
386
+ height: 100%;
387
+ overflow: visible;
388
+ pointer-events: none;
389
+ }
159
390
 
160
- .rows,
161
- .cols {
162
- pointer-events: none;
163
- position: absolute;
164
- }
391
+ .rows,
392
+ .cols {
393
+ pointer-events: none;
394
+ position: absolute;
395
+ }
165
396
 
166
- .rows {
167
- inset: 0;
168
- width: 100%;
169
- }
397
+ .rows {
398
+ inset: 0;
399
+ width: 100%;
400
+ }
170
401
 
171
- .cols {
172
- inset: 0;
173
- height: 100%;
174
- }
402
+ .cols {
403
+ inset: 0;
404
+ height: 100%;
405
+ }
175
406
 
176
- .control {
177
- position: absolute;
178
- z-index: 1;
179
- pointer-events: none;
180
- }
407
+ .control {
408
+ position: absolute;
409
+ z-index: 1;
410
+ pointer-events: none;
411
+ }
181
412
 
182
- .handle {
183
- position: absolute;
184
- display: inline-flex;
185
- align-items: center;
186
- justify-content: center;
187
- width: 24px;
188
- height: 24px;
189
- padding: 0;
190
- border: 1px solid var(--ui-affordance-near-color, var(--ui-border-strong, #c8c8c4));
191
- border-radius: var(--ui-radius-round, 999px);
192
- background: color-mix(in srgb, var(--ui-surface-elevated, #fff) 96%, transparent);
193
- color: var(--ui-affordance-near-color, var(--ui-text-secondary, #5c5c5c));
194
- font: inherit;
195
- font-size: 16px;
196
- line-height: 1;
197
- box-shadow: var(--ui-shadow-xs, 0 1px 2px rgb(0 0 0 / 0.05));
198
- opacity: 0;
199
- scale: 0.72;
200
- transition:
201
- opacity var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease),
202
- scale var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease),
203
- color var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease),
204
- background-color var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease),
205
- border-color var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease);
206
- pointer-events: auto;
207
- cursor: pointer;
208
- }
413
+ .handle {
414
+ position: absolute;
415
+ display: inline-flex;
416
+ align-items: center;
417
+ justify-content: center;
418
+ width: 24px;
419
+ height: 24px;
420
+ padding: 0;
421
+ border: 1px solid var(--ui-affordance-near-color, var(--ui-border-strong));
422
+ border-radius: var(--ui-radius-round);
423
+ background: color-mix(in srgb, var(--ui-surface-elevated) 96%, transparent);
424
+ color: var(--ui-affordance-near-color, var(--ui-text-secondary));
425
+ font: inherit;
426
+ font-size: 16px;
427
+ line-height: 1;
428
+ box-shadow: var(--ui-shadow-xs, 0 1px 2px rgb(0 0 0 / 0.05));
429
+ opacity: 0;
430
+ scale: 0.72;
431
+ transition:
432
+ opacity var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease),
433
+ scale var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease),
434
+ color var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease),
435
+ background-color var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease),
436
+ border-color var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease);
437
+ pointer-events: auto;
438
+ cursor: pointer;
439
+ }
209
440
 
210
- .handle {
211
- --ui-icon-size: 14px;
212
- --ui-icon-stroke-width: var(--ui-editor-table-affordance-icon-stroke-width, 2);
213
- }
441
+ .handle {
442
+ --ui-icon-size: 14px;
443
+ --ui-icon-stroke-width: 2;
444
+ }
214
445
 
215
- .handle[data-ui-proximity="near"],
216
- .control.active .handle,
217
- .handle:focus-visible {
218
- opacity: 1;
219
- scale: 1;
220
- }
446
+ .handle[data-ui-proximity="near"],
447
+ .control.active .handle,
448
+ .handle:focus-visible {
449
+ opacity: 1;
450
+ scale: 1;
451
+ }
221
452
 
222
- .control.active .handle,
223
- .handle:focus-visible {
224
- border-color: var(--ui-affordance-direct-color, var(--ui-accent-solid, #5b55d6));
225
- background: var(--ui-affordance-direct-color, var(--ui-accent-solid, #5b55d6));
226
- color: var(--ui-text-on-accent, #fff);
227
- box-shadow: var(--ui-shadow-sm, 0 1px 3px rgb(0 0 0 / 0.1));
228
- }
453
+ .control.active .handle,
454
+ .handle:focus-visible {
455
+ border-color: var(--ui-affordance-direct-color, var(--ui-accent-solid));
456
+ background: var(--ui-affordance-direct-color, var(--ui-accent-solid));
457
+ color: var(--ui-text-on-accent);
458
+ box-shadow: var(--ui-shadow-sm, 0 1px 3px rgb(0 0 0 / 0.1));
459
+ }
229
460
 
230
- .handle:focus-visible,
231
- .selector:focus-visible,
232
- .cell-menu:focus-visible {
233
- outline: 2px solid var(--ui-focus-ring, #5b55d6);
234
- outline-offset: 2px;
235
- }
461
+ .handle:focus-visible,
462
+ .selector:focus-visible,
463
+ .cell-menu:focus-visible {
464
+ outline: 2px solid var(--ui-focus-ring);
465
+ outline-offset: 2px;
466
+ }
236
467
 
237
- .control.row {
238
- left: 0;
239
- width: 100%;
240
- height: 0;
241
- }
468
+ .control.row {
469
+ left: 0;
470
+ width: 100%;
471
+ height: 0;
472
+ }
242
473
 
243
- .control.row .handle {
244
- top: -12px;
245
- left: -30px;
246
- }
474
+ .control.row .handle {
475
+ top: -12px;
476
+ left: -30px;
477
+ }
247
478
 
248
- .control.col {
249
- top: 0;
250
- width: 0;
251
- height: 100%;
252
- }
479
+ .control.col {
480
+ top: 0;
481
+ width: 0;
482
+ height: 100%;
483
+ }
253
484
 
254
- .control.col .handle {
255
- top: -30px;
256
- left: -12px;
257
- }
485
+ .control.col .handle {
486
+ top: -30px;
487
+ left: -12px;
488
+ }
258
489
 
259
- .line {
260
- position: absolute;
261
- background: var(--ui-affordance-direct-color, var(--ui-accent-solid, #5b55d6));
262
- opacity: 0;
263
- transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease);
264
- }
490
+ .line {
491
+ position: absolute;
492
+ background: var(--ui-affordance-direct-color, var(--ui-accent-solid));
493
+ opacity: 0;
494
+ transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease);
495
+ }
265
496
 
266
- .control.row .line {
267
- inset: -1px 0 auto;
268
- height: 2px;
269
- }
497
+ .control.row .line {
498
+ inset: -1px 0 auto;
499
+ height: 2px;
500
+ }
270
501
 
271
- .control.col .line {
272
- inset: 0 auto 0 -1px;
273
- width: 2px;
274
- }
502
+ .control.col .line {
503
+ inset: 0 auto 0 -1px;
504
+ width: 2px;
505
+ }
275
506
 
276
- .control.active .line {
277
- opacity: 0.8;
278
- }
507
+ .control.active .line {
508
+ opacity: 0.8;
509
+ }
279
510
 
280
- .guide {
281
- position: absolute;
282
- width: var(--ui-affordance-guide-size, 4px);
283
- height: var(--ui-affordance-guide-size, 4px);
284
- border-radius: var(--ui-radius-round, 999px);
285
- background: var(--ui-affordance-guide-color, var(--ui-border-strong, #c8c8c4));
286
- opacity: var(--ui-affordance-guide-opacity, 0.42);
287
- transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease);
288
- }
511
+ .guide {
512
+ position: absolute;
513
+ width: var(--ui-affordance-guide-size);
514
+ height: var(--ui-affordance-guide-size);
515
+ border-radius: var(--ui-radius-round);
516
+ background: var(--ui-affordance-guide-color, var(--ui-border-strong));
517
+ opacity: var(--ui-affordance-guide-opacity);
518
+ transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease);
519
+ }
289
520
 
290
- .control.row .guide {
291
- left: -10px;
292
- top: -2px;
293
- }
521
+ .control.row .guide {
522
+ left: -10px;
523
+ top: -2px;
524
+ }
294
525
 
295
- .control.col .guide {
296
- left: -2px;
297
- top: -10px;
298
- }
526
+ .control.col .guide {
527
+ left: -2px;
528
+ top: -10px;
529
+ }
299
530
 
300
- .control:has(.handle[data-ui-proximity="near"]) .guide,
301
- .control.active .guide {
302
- opacity: 0;
303
- }
531
+ .control:has(.handle[data-ui-proximity="near"]) .guide,
532
+ .control.active .guide {
533
+ opacity: 0;
534
+ }
304
535
 
305
- .tooltip {
306
- position: absolute;
307
- z-index: 2;
308
- top: calc(100% + 6px);
309
- left: 50%;
310
- width: max-content;
311
- max-width: 14rem;
312
- padding: var(--ui-space-1, 4px) var(--ui-space-2, 8px);
313
- border-radius: var(--ui-radius-1, 4px);
314
- background: var(--ui-text-primary, #1a1a1a);
315
- color: var(--ui-surface-elevated, #fff);
316
- font-size: var(--ui-font-size-xs, 0.75rem);
317
- font-weight: var(--ui-font-medium, 500);
318
- line-height: var(--ui-line-height-md, 1.4);
319
- opacity: 0;
320
- transform: translateX(-50%);
321
- transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease);
322
- pointer-events: none;
323
- }
536
+ .tooltip {
537
+ position: absolute;
538
+ z-index: 2;
539
+ top: calc(100% + 6px);
540
+ left: 50%;
541
+ width: max-content;
542
+ max-width: 14rem;
543
+ padding: var(--ui-space-1) var(--ui-space-2);
544
+ border-radius: var(--ui-radius-sm);
545
+ background: var(--ui-text-primary);
546
+ color: var(--ui-surface-elevated);
547
+ font-size: var(--ui-font-size-xs);
548
+ font-weight: var(--ui-font-medium);
549
+ line-height: var(--ui-line-height-md);
550
+ opacity: 0;
551
+ transform: translateX(-50%);
552
+ transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease);
553
+ pointer-events: none;
554
+ }
324
555
 
325
- .control.row .tooltip {
326
- top: 50%;
327
- left: auto;
328
- right: calc(100% + 8px);
329
- transform: translateY(-50%);
330
- }
556
+ .control.row .tooltip {
557
+ top: 50%;
558
+ left: auto;
559
+ right: calc(100% + 8px);
560
+ transform: translateY(-50%);
561
+ }
331
562
 
332
- .control.active .tooltip,
333
- .handle:focus-visible .tooltip {
334
- opacity: 1;
335
- }
563
+ .control.active .tooltip,
564
+ .handle:focus-visible .tooltip {
565
+ opacity: 1;
566
+ }
336
567
 
337
- .selector,
338
- .cell-menu {
339
- position: absolute;
340
- z-index: 2;
341
- display: inline-flex;
342
- align-items: center;
343
- justify-content: center;
344
- padding: 0;
345
- border: 1px solid transparent;
346
- background: transparent;
347
- color: var(--ui-text-secondary, #5c5c5c);
348
- box-shadow: none;
349
- pointer-events: auto;
350
- cursor: pointer;
351
- transition:
352
- color var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease),
353
- background-color var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease),
354
- border-color var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease),
355
- box-shadow var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease);
356
- }
568
+ .selector,
569
+ .cell-menu {
570
+ position: absolute;
571
+ z-index: 2;
572
+ display: inline-flex;
573
+ align-items: center;
574
+ justify-content: center;
575
+ padding: 0;
576
+ border: 1px solid transparent;
577
+ background: transparent;
578
+ color: var(--ui-text-secondary);
579
+ box-shadow: none;
580
+ pointer-events: auto;
581
+ cursor: pointer;
582
+ transition:
583
+ color var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease),
584
+ background-color var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease),
585
+ border-color var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease),
586
+ box-shadow var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease);
587
+ }
357
588
 
358
- .selector:hover,
359
- .cell-menu:hover {
360
- background: var(--ui-icon-button-hover-bg, var(--ui-surface-muted, #f3f4f6));
361
- color: var(--ui-icon-button-hover-color, var(--ui-text-primary, #1a1a1a));
362
- box-shadow: var(--ui-shadow-xs, 0 1px 2px rgb(0 0 0 / 0.05));
363
- }
589
+ .selector:hover,
590
+ .cell-menu:hover {
591
+ background: var(--ui-icon-button-hover-surface, var(--ui-surface-muted));
592
+ color: var(--ui-icon-button-hover-text, var(--ui-text-primary));
593
+ box-shadow: var(--ui-shadow-xs, 0 1px 2px rgb(0 0 0 / 0.05));
594
+ }
364
595
 
365
- .selector {
366
- border-radius: var(--ui-radius-round, 999px);
367
- }
596
+ .selector {
597
+ border-radius: var(--ui-radius-round);
598
+ }
368
599
 
369
- .selector::before {
370
- content: "";
371
- position: absolute;
372
- inset: 50% auto auto 50%;
373
- border-radius: var(--ui-radius-round, 999px);
374
- background: var(--ui-affordance-guide-color, var(--ui-border-strong, #c8c8c4));
375
- opacity: var(--ui-affordance-guide-opacity, 0.42);
376
- transform: translate(-50%, -50%);
377
- transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease);
378
- pointer-events: none;
379
- }
600
+ .selector::before {
601
+ content: "";
602
+ position: absolute;
603
+ inset: 50% auto auto 50%;
604
+ border-radius: var(--ui-radius-round);
605
+ background: var(--ui-affordance-guide-color, var(--ui-border-strong));
606
+ opacity: var(--ui-affordance-guide-opacity);
607
+ transform: translate(-50%, -50%);
608
+ transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease);
609
+ pointer-events: none;
610
+ }
380
611
 
381
- .selector .glyph {
382
- display: block;
383
- width: 14px;
384
- height: 14px;
385
- --ui-icon-size: 14px;
386
- --ui-icon-stroke-width: var(--ui-editor-table-affordance-icon-stroke-width, 2);
387
- opacity: 0;
388
- transform: scale(0.72);
389
- transition:
390
- opacity var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease),
391
- transform var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease);
392
- }
612
+ .selector .glyph {
613
+ display: block;
614
+ width: 14px;
615
+ height: 14px;
616
+ --ui-icon-size: 14px;
617
+ --ui-icon-stroke-width: 2;
618
+ opacity: 0;
619
+ transform: scale(0.72);
620
+ transition:
621
+ opacity var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease),
622
+ transform var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease);
623
+ }
393
624
 
394
- .selector:hover::before,
395
- .selector:focus-visible::before {
396
- opacity: 0;
397
- }
625
+ .selector:hover::before,
626
+ .selector:focus-visible::before {
627
+ opacity: 0;
628
+ }
398
629
 
399
- .selector:hover .glyph,
400
- .selector:focus-visible .glyph {
401
- opacity: 1;
402
- transform: scale(1);
403
- }
630
+ .selector:hover .glyph,
631
+ .selector:focus-visible .glyph {
632
+ opacity: 1;
633
+ transform: scale(1);
634
+ }
404
635
 
405
- .selector.row {
406
- left: -9px;
407
- width: 18px;
408
- height: 32px;
409
- transform: translateY(-50%);
410
- }
636
+ .selector.row {
637
+ left: -9px;
638
+ width: 18px;
639
+ height: 32px;
640
+ transform: translateY(-50%);
641
+ }
411
642
 
412
- .selector.row::before {
413
- width: 2px;
414
- height: 16px;
415
- }
643
+ .selector.row::before {
644
+ width: 2px;
645
+ height: 16px;
646
+ }
416
647
 
417
- .selector.column {
418
- top: -9px;
419
- width: 32px;
420
- height: 18px;
421
- transform: translateX(-50%);
422
- }
648
+ .selector.column {
649
+ top: -9px;
650
+ width: 32px;
651
+ height: 18px;
652
+ transform: translateX(-50%);
653
+ }
423
654
 
424
- .selector.column::before {
425
- width: 16px;
426
- height: 2px;
427
- }
655
+ .selector.column::before {
656
+ width: 16px;
657
+ height: 2px;
658
+ }
428
659
 
429
- @media (hover: none), (pointer: coarse) {
430
- .selector::before {
431
- opacity: 0;
432
- }
660
+ @media (hover: none), (pointer: coarse) {
661
+ .selector::before {
662
+ opacity: 0;
663
+ }
433
664
 
434
- .selector .glyph {
435
- opacity: 1;
436
- transform: none;
437
- }
438
- }
665
+ .selector .glyph {
666
+ opacity: 1;
667
+ transform: none;
668
+ }
669
+ }
439
670
 
440
- .cell-menu {
441
- width: 24px;
442
- height: 24px;
443
- border-radius: var(--ui-radius-1, 4px);
444
- background: color-mix(in srgb, var(--ui-surface-muted, #f3f4f6) 78%, transparent);
445
- }
671
+ .cell-menu {
672
+ width: 24px;
673
+ height: 24px;
674
+ border-radius: var(--ui-radius-sm);
675
+ background: color-mix(in srgb, var(--ui-surface-muted) 78%, transparent);
676
+ }
446
677
 
447
- .cell-menu {
448
- --ui-icon-size: 15px;
449
- --ui-icon-stroke-width: var(--ui-editor-table-affordance-icon-stroke-width, 2);
450
- }
678
+ .cell-menu {
679
+ --ui-icon-size: 15px;
680
+ --ui-icon-stroke-width: 2;
681
+ }
451
682
 
452
- [data-component~="ui-editor-table-overlay"][hidden] {
453
- display: none;
454
- }
683
+ [data-component~="ui-editor-table-overlay"][hidden] {
684
+ display: none;
685
+ }
455
686
  </style>