@threadlabs/looma 0.5.1 → 0.5.2

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 (309) hide show
  1. package/README.md +1 -1
  2. package/components/ui-button/ui-button.html +13 -0
  3. package/components/ui-combobox/ui-combobox.html +12 -4
  4. package/components/ui-dialog/ui-dialog.html +13 -0
  5. package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.html +1 -1
  6. package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +1 -1
  7. package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.html +6 -2
  8. package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +20 -4
  9. package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +8 -4
  10. package/components/ui-form-field/ui-form-field.html +18 -7
  11. package/components/ui-icon/ui-icon.html +5 -1
  12. package/components/ui-icon-button/ui-icon-button.html +30 -0
  13. package/components/ui-popover/ui-popover.js +10 -2
  14. package/components/ui-search-shell/ui-search-shell.html +7 -0
  15. package/components/ui-search-shell/ui-search-shell.js +9 -0
  16. package/components/ui-tabs/ui-tabs.html +1 -1
  17. package/components/ui-toast-region/ui-toast-region.html +1 -1
  18. package/components/ui-tree-item/ui-tree-item.html +6 -1
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.js +2 -2
  21. package/package.json +2 -2
  22. package/styles/ui-affordance-scope.css +1 -1
  23. package/styles/ui-avatar-group.css +1 -1
  24. package/styles/ui-avatar.css +1 -1
  25. package/styles/ui-badge.css +1 -1
  26. package/styles/ui-button.css +11 -1
  27. package/styles/ui-callout.css +1 -1
  28. package/styles/ui-checkbox.css +1 -1
  29. package/styles/ui-cluster.css +1 -1
  30. package/styles/ui-combobox.css +1 -1
  31. package/styles/ui-container.css +1 -1
  32. package/styles/ui-context-menu.css +1 -1
  33. package/styles/ui-dialog.css +18 -1
  34. package/styles/ui-disclosure.css +1 -1
  35. package/styles/ui-editable.css +1 -1
  36. package/styles/ui-editor-insert-table-grid.css +1 -1
  37. package/styles/ui-editor-mention-menu.css +1 -1
  38. package/styles/ui-editor-slash-menu.css +1 -1
  39. package/styles/ui-editor-table-context-menu.css +1 -1
  40. package/styles/ui-editor-table-overlay.css +1 -1
  41. package/styles/ui-editor-table-toolbar.css +1 -1
  42. package/styles/ui-editor-toolbar.css +1 -1
  43. package/styles/ui-floating-action-button.css +1 -1
  44. package/styles/ui-form-field.css +24 -10
  45. package/styles/ui-grid.css +1 -1
  46. package/styles/ui-icon-button.css +36 -1
  47. package/styles/ui-icon.css +1 -1
  48. package/styles/ui-input.css +1 -1
  49. package/styles/ui-menu-item.css +1 -1
  50. package/styles/ui-menu.css +1 -1
  51. package/styles/ui-popover.css +1 -1
  52. package/styles/ui-radio-group.css +1 -1
  53. package/styles/ui-radio.css +1 -1
  54. package/styles/ui-reel.css +1 -1
  55. package/styles/ui-search-result-row.css +1 -1
  56. package/styles/ui-search-shell.css +11 -2
  57. package/styles/ui-select.css +1 -1
  58. package/styles/ui-separator.css +1 -1
  59. package/styles/ui-sidebar.css +1 -1
  60. package/styles/ui-stack.css +1 -1
  61. package/styles/ui-switch.css +1 -1
  62. package/styles/ui-switcher.css +1 -1
  63. package/styles/ui-tabs.css +1 -1
  64. package/styles/ui-textarea.css +1 -1
  65. package/styles/ui-toast-region.css +1 -1
  66. package/styles/ui-tooltip.css +1 -1
  67. package/styles/ui-top-bar.css +1 -1
  68. package/styles/ui-tree-item.css +10 -2
  69. package/styles/ui-tree.css +1 -1
  70. package/vanilla/UiAffordanceScope.d.ts +1 -1
  71. package/vanilla/UiAffordanceScope.js +2 -2
  72. package/vanilla/UiAvatar.d.ts +1 -1
  73. package/vanilla/UiAvatar.js +2 -2
  74. package/vanilla/UiAvatarGroup.d.ts +1 -1
  75. package/vanilla/UiAvatarGroup.js +2 -2
  76. package/vanilla/UiBadge.d.ts +1 -1
  77. package/vanilla/UiBadge.js +2 -2
  78. package/vanilla/UiButton.d.ts +3 -1
  79. package/vanilla/UiButton.js +3 -3
  80. package/vanilla/UiCallout.d.ts +1 -1
  81. package/vanilla/UiCallout.js +2 -2
  82. package/vanilla/UiCheckbox.d.ts +1 -1
  83. package/vanilla/UiCheckbox.js +2 -2
  84. package/vanilla/UiCluster.d.ts +1 -1
  85. package/vanilla/UiCluster.js +2 -2
  86. package/vanilla/UiCombobox.d.ts +1 -1
  87. package/vanilla/UiCombobox.js +3 -3
  88. package/vanilla/UiContainer.d.ts +1 -1
  89. package/vanilla/UiContainer.js +2 -2
  90. package/vanilla/UiContextMenu.d.ts +1 -1
  91. package/vanilla/UiContextMenu.js +2 -2
  92. package/vanilla/UiDialog.d.ts +1 -1
  93. package/vanilla/UiDialog.js +2 -2
  94. package/vanilla/UiDisclosure.d.ts +1 -1
  95. package/vanilla/UiDisclosure.js +2 -2
  96. package/vanilla/UiEditable.d.ts +1 -1
  97. package/vanilla/UiEditable.js +2 -2
  98. package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
  99. package/vanilla/UiEditorInsertTableGrid.js +3 -3
  100. package/vanilla/UiEditorMentionMenu.d.ts +1 -1
  101. package/vanilla/UiEditorMentionMenu.js +3 -3
  102. package/vanilla/UiEditorSlashMenu.d.ts +1 -1
  103. package/vanilla/UiEditorSlashMenu.js +2 -2
  104. package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
  105. package/vanilla/UiEditorTableContextMenu.js +3 -3
  106. package/vanilla/UiEditorTableOverlay.d.ts +1 -1
  107. package/vanilla/UiEditorTableOverlay.js +3 -3
  108. package/vanilla/UiEditorTableToolbar.d.ts +1 -1
  109. package/vanilla/UiEditorTableToolbar.js +3 -3
  110. package/vanilla/UiEditorToolbar.d.ts +1 -1
  111. package/vanilla/UiEditorToolbar.js +2 -2
  112. package/vanilla/UiFloatingActionButton.d.ts +1 -1
  113. package/vanilla/UiFloatingActionButton.js +2 -2
  114. package/vanilla/UiFormField.d.ts +1 -1
  115. package/vanilla/UiFormField.js +15 -6
  116. package/vanilla/UiGrid.d.ts +1 -1
  117. package/vanilla/UiGrid.js +2 -2
  118. package/vanilla/UiIcon.d.ts +1 -1
  119. package/vanilla/UiIcon.js +3 -3
  120. package/vanilla/UiIconButton.d.ts +1 -1
  121. package/vanilla/UiIconButton.js +2 -2
  122. package/vanilla/UiInput.d.ts +1 -1
  123. package/vanilla/UiInput.js +2 -2
  124. package/vanilla/UiMenu.d.ts +1 -1
  125. package/vanilla/UiMenu.js +2 -2
  126. package/vanilla/UiMenuItem.d.ts +1 -1
  127. package/vanilla/UiMenuItem.js +2 -2
  128. package/vanilla/UiPopover.d.ts +1 -1
  129. package/vanilla/UiPopover.js +2 -2
  130. package/vanilla/UiRadio.d.ts +1 -1
  131. package/vanilla/UiRadio.js +2 -2
  132. package/vanilla/UiRadioGroup.d.ts +1 -1
  133. package/vanilla/UiRadioGroup.js +2 -2
  134. package/vanilla/UiReel.d.ts +1 -1
  135. package/vanilla/UiReel.js +2 -2
  136. package/vanilla/UiSearchResultRow.d.ts +1 -1
  137. package/vanilla/UiSearchResultRow.js +2 -2
  138. package/vanilla/UiSearchShell.d.ts +1 -1
  139. package/vanilla/UiSearchShell.js +2 -2
  140. package/vanilla/UiSelect.d.ts +1 -1
  141. package/vanilla/UiSelect.js +2 -2
  142. package/vanilla/UiSeparator.d.ts +1 -1
  143. package/vanilla/UiSeparator.js +2 -2
  144. package/vanilla/UiSidebar.d.ts +1 -1
  145. package/vanilla/UiSidebar.js +2 -2
  146. package/vanilla/UiStack.d.ts +1 -1
  147. package/vanilla/UiStack.js +2 -2
  148. package/vanilla/UiSwitch.d.ts +1 -1
  149. package/vanilla/UiSwitch.js +2 -2
  150. package/vanilla/UiSwitcher.d.ts +1 -1
  151. package/vanilla/UiSwitcher.js +2 -2
  152. package/vanilla/UiTabs.d.ts +1 -1
  153. package/vanilla/UiTabs.js +3 -3
  154. package/vanilla/UiTextarea.d.ts +1 -1
  155. package/vanilla/UiTextarea.js +2 -2
  156. package/vanilla/UiToastRegion.d.ts +1 -1
  157. package/vanilla/UiToastRegion.js +3 -3
  158. package/vanilla/UiTooltip.d.ts +1 -1
  159. package/vanilla/UiTooltip.js +2 -2
  160. package/vanilla/UiTopBar.d.ts +1 -1
  161. package/vanilla/UiTopBar.js +1 -1
  162. package/vanilla/UiTree.d.ts +1 -1
  163. package/vanilla/UiTree.js +2 -2
  164. package/vanilla/UiTreeItem.d.ts +1 -1
  165. package/vanilla/UiTreeItem.js +2 -2
  166. package/vue/UiAffordanceScope.d.ts +2 -2
  167. package/vue/UiAffordanceScope.vue +92 -73
  168. package/vue/UiAvatar.d.ts +7 -7
  169. package/vue/UiAvatar.vue +145 -105
  170. package/vue/UiAvatarGroup.d.ts +4 -4
  171. package/vue/UiAvatarGroup.vue +134 -118
  172. package/vue/UiBadge.d.ts +4 -4
  173. package/vue/UiBadge.vue +113 -114
  174. package/vue/UiButton.d.ts +10 -6
  175. package/vue/UiButton.vue +289 -248
  176. package/vue/UiCallout.d.ts +2 -2
  177. package/vue/UiCallout.vue +154 -87
  178. package/vue/UiCheckbox.d.ts +14 -10
  179. package/vue/UiCheckbox.vue +228 -162
  180. package/vue/UiCluster.d.ts +2 -2
  181. package/vue/UiCluster.vue +53 -60
  182. package/vue/UiCombobox.d.ts +36 -32
  183. package/vue/UiCombobox.vue +1005 -416
  184. package/vue/UiContainer.d.ts +2 -2
  185. package/vue/UiContainer.vue +48 -51
  186. package/vue/UiContextMenu.d.ts +6 -4
  187. package/vue/UiContextMenu.vue +205 -116
  188. package/vue/UiDialog.d.ts +11 -9
  189. package/vue/UiDialog.vue +287 -212
  190. package/vue/UiDisclosure.d.ts +8 -6
  191. package/vue/UiDisclosure.vue +248 -159
  192. package/vue/UiEditable.d.ts +16 -12
  193. package/vue/UiEditable.vue +325 -205
  194. package/vue/UiEditorInsertTableGrid.d.ts +8 -8
  195. package/vue/UiEditorInsertTableGrid.vue +216 -157
  196. package/vue/UiEditorMentionMenu.d.ts +9 -9
  197. package/vue/UiEditorMentionMenu.vue +265 -222
  198. package/vue/UiEditorSlashMenu.d.ts +7 -7
  199. package/vue/UiEditorSlashMenu.vue +286 -240
  200. package/vue/UiEditorTableContextMenu.d.ts +5 -5
  201. package/vue/UiEditorTableContextMenu.vue +306 -193
  202. package/vue/UiEditorTableOverlay.d.ts +2 -2
  203. package/vue/UiEditorTableOverlay.vue +609 -369
  204. package/vue/UiEditorTableToolbar.d.ts +7 -7
  205. package/vue/UiEditorTableToolbar.vue +443 -268
  206. package/vue/UiEditorToolbar.d.ts +2 -2
  207. package/vue/UiEditorToolbar.vue +134 -121
  208. package/vue/UiFloatingActionButton.d.ts +6 -6
  209. package/vue/UiFloatingActionButton.vue +100 -99
  210. package/vue/UiFormField.d.ts +6 -6
  211. package/vue/UiFormField.vue +112 -80
  212. package/vue/UiGrid.d.ts +2 -2
  213. package/vue/UiGrid.vue +51 -57
  214. package/vue/UiIcon.d.ts +2 -2
  215. package/vue/UiIcon.vue +118 -89
  216. package/vue/UiIconButton.d.ts +11 -11
  217. package/vue/UiIconButton.vue +283 -217
  218. package/vue/UiInput.d.ts +9 -9
  219. package/vue/UiInput.vue +153 -127
  220. package/vue/UiMenu.d.ts +8 -6
  221. package/vue/UiMenu.vue +217 -143
  222. package/vue/UiMenuItem.d.ts +4 -4
  223. package/vue/UiMenuItem.vue +52 -46
  224. package/vue/UiPopover.d.ts +8 -6
  225. package/vue/UiPopover.vue +197 -137
  226. package/vue/UiRadio.d.ts +14 -10
  227. package/vue/UiRadio.vue +183 -117
  228. package/vue/UiRadioGroup.d.ts +14 -12
  229. package/vue/UiRadioGroup.vue +172 -111
  230. package/vue/UiReel.d.ts +3 -3
  231. package/vue/UiReel.vue +77 -77
  232. package/vue/UiSearchResultRow.d.ts +4 -4
  233. package/vue/UiSearchResultRow.vue +124 -115
  234. package/vue/UiSearchShell.d.ts +10 -8
  235. package/vue/UiSearchShell.vue +245 -176
  236. package/vue/UiSelect.d.ts +9 -9
  237. package/vue/UiSelect.vue +162 -134
  238. package/vue/UiSeparator.d.ts +2 -2
  239. package/vue/UiSeparator.vue +22 -27
  240. package/vue/UiSidebar.d.ts +20 -18
  241. package/vue/UiSidebar.vue +312 -224
  242. package/vue/UiStack.d.ts +3 -3
  243. package/vue/UiStack.vue +64 -70
  244. package/vue/UiSwitch.d.ts +12 -8
  245. package/vue/UiSwitch.vue +218 -150
  246. package/vue/UiSwitcher.d.ts +3 -3
  247. package/vue/UiSwitcher.vue +73 -75
  248. package/vue/UiTabs.d.ts +10 -8
  249. package/vue/UiTabs.vue +251 -210
  250. package/vue/UiTextarea.d.ts +11 -11
  251. package/vue/UiTextarea.vue +155 -128
  252. package/vue/UiToastRegion.d.ts +10 -8
  253. package/vue/UiToastRegion.vue +261 -198
  254. package/vue/UiTooltip.d.ts +14 -12
  255. package/vue/UiTooltip.vue +241 -177
  256. package/vue/UiTopBar.vue +51 -42
  257. package/vue/UiTree.d.ts +8 -6
  258. package/vue/UiTree.vue +157 -70
  259. package/vue/UiTreeItem.d.ts +24 -22
  260. package/vue/UiTreeItem.vue +456 -339
  261. package/vue/chunks/UiAffordanceScope.js +9 -16
  262. package/vue/chunks/UiAvatar.js +23 -29
  263. package/vue/chunks/UiAvatarGroup.js +16 -39
  264. package/vue/chunks/UiBadge.js +3 -12
  265. package/vue/chunks/UiButton.js +15 -18
  266. package/vue/chunks/UiCallout.js +8 -17
  267. package/vue/chunks/UiCheckbox.js +37 -40
  268. package/vue/chunks/UiCluster.js +3 -12
  269. package/vue/chunks/UiCombobox.js +224 -266
  270. package/vue/chunks/UiContainer.js +3 -12
  271. package/vue/chunks/UiContextMenu.js +39 -34
  272. package/vue/chunks/UiDialog.js +36 -39
  273. package/vue/chunks/UiDisclosure.js +43 -48
  274. package/vue/chunks/UiEditable.js +55 -57
  275. package/vue/chunks/UiEditorInsertTableGrid.js +55 -73
  276. package/vue/chunks/UiEditorMentionMenu.js +40 -81
  277. package/vue/chunks/UiEditorSlashMenu.js +28 -52
  278. package/vue/chunks/UiEditorTableContextMenu.js +32 -56
  279. package/vue/chunks/UiEditorTableOverlay.js +58 -82
  280. package/vue/chunks/UiEditorTableToolbar.js +61 -85
  281. package/vue/chunks/UiEditorToolbar.js +4 -13
  282. package/vue/chunks/UiFloatingActionButton.js +7 -21
  283. package/vue/chunks/UiFormField.js +15 -12
  284. package/vue/chunks/UiGrid.js +3 -12
  285. package/vue/chunks/UiIcon.js +20 -43
  286. package/vue/chunks/UiIconButton.js +16 -28
  287. package/vue/chunks/UiInput.js +20 -25
  288. package/vue/chunks/UiMenu.js +29 -33
  289. package/vue/chunks/UiMenuItem.js +4 -10
  290. package/vue/chunks/UiPopover.js +28 -29
  291. package/vue/chunks/UiRadio.js +36 -39
  292. package/vue/chunks/UiRadioGroup.js +30 -34
  293. package/vue/chunks/UiReel.js +6 -15
  294. package/vue/chunks/UiSearchResultRow.js +6 -19
  295. package/vue/chunks/UiSearchShell.js +25 -28
  296. package/vue/chunks/UiSelect.js +20 -23
  297. package/vue/chunks/UiSeparator.js +2 -8
  298. package/vue/chunks/UiSidebar.js +39 -44
  299. package/vue/chunks/UiStack.js +6 -15
  300. package/vue/chunks/UiSwitch.js +35 -38
  301. package/vue/chunks/UiSwitcher.js +6 -15
  302. package/vue/chunks/UiTabs.js +47 -85
  303. package/vue/chunks/UiTextarea.js +21 -26
  304. package/vue/chunks/UiToastRegion.js +38 -72
  305. package/vue/chunks/UiTooltip.js +34 -35
  306. package/vue/chunks/UiTopBar.js +1 -1
  307. package/vue/chunks/UiTree.js +20 -15
  308. package/vue/chunks/UiTreeItem.js +85 -102
  309. package/vue/components.css +3994 -3801
@@ -1,455 +1,695 @@
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, #c8c8c4));
422
+ border-radius: var(--ui-radius-round, 999px);
423
+ background: color-mix(in srgb, var(--ui-surface-elevated, #fff) 96%, transparent);
424
+ color: var(--ui-affordance-near-color, var(--ui-text-secondary, #5c5c5c));
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, 120ms)) var(--ui-motion-ease, ease),
433
+ scale var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease),
434
+ color var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease),
435
+ background-color var(--ui-affordance-motion, var(--ui-motion-fast, 120ms))
436
+ var(--ui-motion-ease, ease),
437
+ border-color var(--ui-affordance-motion, var(--ui-motion-fast, 120ms))
438
+ var(--ui-motion-ease, ease);
439
+ pointer-events: auto;
440
+ cursor: pointer;
441
+ }
209
442
 
210
- .handle {
211
- --ui-icon-size: 14px;
212
- --ui-icon-stroke-width: var(--ui-editor-table-affordance-icon-stroke-width, 2);
213
- }
443
+ .handle {
444
+ --ui-icon-size: 14px;
445
+ --ui-icon-stroke-width: var(--ui-editor-table-affordance-icon-stroke-width, 2);
446
+ }
214
447
 
215
- .handle[data-ui-proximity="near"],
216
- .control.active .handle,
217
- .handle:focus-visible {
218
- opacity: 1;
219
- scale: 1;
220
- }
448
+ .handle[data-ui-proximity="near"],
449
+ .control.active .handle,
450
+ .handle:focus-visible {
451
+ opacity: 1;
452
+ scale: 1;
453
+ }
221
454
 
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
- }
455
+ .control.active .handle,
456
+ .handle:focus-visible {
457
+ border-color: var(--ui-affordance-direct-color, var(--ui-accent-solid, #5b55d6));
458
+ background: var(--ui-affordance-direct-color, var(--ui-accent-solid, #5b55d6));
459
+ color: var(--ui-text-on-accent, #fff);
460
+ box-shadow: var(--ui-shadow-sm, 0 1px 3px rgb(0 0 0 / 0.1));
461
+ }
229
462
 
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
- }
463
+ .handle:focus-visible,
464
+ .selector:focus-visible,
465
+ .cell-menu:focus-visible {
466
+ outline: 2px solid var(--ui-focus-ring, #5b55d6);
467
+ outline-offset: 2px;
468
+ }
236
469
 
237
- .control.row {
238
- left: 0;
239
- width: 100%;
240
- height: 0;
241
- }
470
+ .control.row {
471
+ left: 0;
472
+ width: 100%;
473
+ height: 0;
474
+ }
242
475
 
243
- .control.row .handle {
244
- top: -12px;
245
- left: -30px;
246
- }
476
+ .control.row .handle {
477
+ top: -12px;
478
+ left: -30px;
479
+ }
247
480
 
248
- .control.col {
249
- top: 0;
250
- width: 0;
251
- height: 100%;
252
- }
481
+ .control.col {
482
+ top: 0;
483
+ width: 0;
484
+ height: 100%;
485
+ }
253
486
 
254
- .control.col .handle {
255
- top: -30px;
256
- left: -12px;
257
- }
487
+ .control.col .handle {
488
+ top: -30px;
489
+ left: -12px;
490
+ }
258
491
 
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
- }
492
+ .line {
493
+ position: absolute;
494
+ background: var(--ui-affordance-direct-color, var(--ui-accent-solid, #5b55d6));
495
+ opacity: 0;
496
+ transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast, 120ms))
497
+ var(--ui-motion-ease, ease);
498
+ }
265
499
 
266
- .control.row .line {
267
- inset: -1px 0 auto;
268
- height: 2px;
269
- }
500
+ .control.row .line {
501
+ inset: -1px 0 auto;
502
+ height: 2px;
503
+ }
270
504
 
271
- .control.col .line {
272
- inset: 0 auto 0 -1px;
273
- width: 2px;
274
- }
505
+ .control.col .line {
506
+ inset: 0 auto 0 -1px;
507
+ width: 2px;
508
+ }
275
509
 
276
- .control.active .line {
277
- opacity: 0.8;
278
- }
510
+ .control.active .line {
511
+ opacity: 0.8;
512
+ }
279
513
 
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
- }
514
+ .guide {
515
+ position: absolute;
516
+ width: var(--ui-affordance-guide-size, 4px);
517
+ height: var(--ui-affordance-guide-size, 4px);
518
+ border-radius: var(--ui-radius-round, 999px);
519
+ background: var(--ui-affordance-guide-color, var(--ui-border-strong, #c8c8c4));
520
+ opacity: var(--ui-affordance-guide-opacity, 0.42);
521
+ transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast, 120ms))
522
+ var(--ui-motion-ease, ease);
523
+ }
289
524
 
290
- .control.row .guide {
291
- left: -10px;
292
- top: -2px;
293
- }
525
+ .control.row .guide {
526
+ left: -10px;
527
+ top: -2px;
528
+ }
294
529
 
295
- .control.col .guide {
296
- left: -2px;
297
- top: -10px;
298
- }
530
+ .control.col .guide {
531
+ left: -2px;
532
+ top: -10px;
533
+ }
299
534
 
300
- .control:has(.handle[data-ui-proximity="near"]) .guide,
301
- .control.active .guide {
302
- opacity: 0;
303
- }
535
+ .control:has(.handle[data-ui-proximity="near"]) .guide,
536
+ .control.active .guide {
537
+ opacity: 0;
538
+ }
304
539
 
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
- }
540
+ .tooltip {
541
+ position: absolute;
542
+ z-index: 2;
543
+ top: calc(100% + 6px);
544
+ left: 50%;
545
+ width: max-content;
546
+ max-width: 14rem;
547
+ padding: var(--ui-space-1, 4px) var(--ui-space-2, 8px);
548
+ border-radius: var(--ui-radius-1, 4px);
549
+ background: var(--ui-text-primary, #1a1a1a);
550
+ color: var(--ui-surface-elevated, #fff);
551
+ font-size: var(--ui-font-size-xs, 0.75rem);
552
+ font-weight: var(--ui-font-medium, 500);
553
+ line-height: var(--ui-line-height-md, 1.4);
554
+ opacity: 0;
555
+ transform: translateX(-50%);
556
+ transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast, 120ms))
557
+ var(--ui-motion-ease, ease);
558
+ pointer-events: none;
559
+ }
324
560
 
325
- .control.row .tooltip {
326
- top: 50%;
327
- left: auto;
328
- right: calc(100% + 8px);
329
- transform: translateY(-50%);
330
- }
561
+ .control.row .tooltip {
562
+ top: 50%;
563
+ left: auto;
564
+ right: calc(100% + 8px);
565
+ transform: translateY(-50%);
566
+ }
331
567
 
332
- .control.active .tooltip,
333
- .handle:focus-visible .tooltip {
334
- opacity: 1;
335
- }
568
+ .control.active .tooltip,
569
+ .handle:focus-visible .tooltip {
570
+ opacity: 1;
571
+ }
336
572
 
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
- }
573
+ .selector,
574
+ .cell-menu {
575
+ position: absolute;
576
+ z-index: 2;
577
+ display: inline-flex;
578
+ align-items: center;
579
+ justify-content: center;
580
+ padding: 0;
581
+ border: 1px solid transparent;
582
+ background: transparent;
583
+ color: var(--ui-text-secondary, #5c5c5c);
584
+ box-shadow: none;
585
+ pointer-events: auto;
586
+ cursor: pointer;
587
+ transition:
588
+ color var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease),
589
+ background-color var(--ui-affordance-motion, var(--ui-motion-fast, 120ms))
590
+ var(--ui-motion-ease, ease),
591
+ border-color var(--ui-affordance-motion, var(--ui-motion-fast, 120ms))
592
+ var(--ui-motion-ease, ease),
593
+ box-shadow var(--ui-affordance-motion, var(--ui-motion-fast, 120ms))
594
+ var(--ui-motion-ease, ease);
595
+ }
357
596
 
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
- }
597
+ .selector:hover,
598
+ .cell-menu:hover {
599
+ background: var(--ui-icon-button-hover-bg, var(--ui-surface-muted, #f3f4f6));
600
+ color: var(--ui-icon-button-hover-color, var(--ui-text-primary, #1a1a1a));
601
+ box-shadow: var(--ui-shadow-xs, 0 1px 2px rgb(0 0 0 / 0.05));
602
+ }
364
603
 
365
- .selector {
366
- border-radius: var(--ui-radius-round, 999px);
367
- }
604
+ .selector {
605
+ border-radius: var(--ui-radius-round, 999px);
606
+ }
368
607
 
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
- }
608
+ .selector::before {
609
+ content: "";
610
+ position: absolute;
611
+ inset: 50% auto auto 50%;
612
+ border-radius: var(--ui-radius-round, 999px);
613
+ background: var(--ui-affordance-guide-color, var(--ui-border-strong, #c8c8c4));
614
+ opacity: var(--ui-affordance-guide-opacity, 0.42);
615
+ transform: translate(-50%, -50%);
616
+ transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast, 120ms))
617
+ var(--ui-motion-ease, ease);
618
+ pointer-events: none;
619
+ }
380
620
 
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
- }
621
+ .selector .glyph {
622
+ display: block;
623
+ width: 14px;
624
+ height: 14px;
625
+ --ui-icon-size: 14px;
626
+ --ui-icon-stroke-width: var(--ui-editor-table-affordance-icon-stroke-width, 2);
627
+ opacity: 0;
628
+ transform: scale(0.72);
629
+ transition:
630
+ opacity var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease),
631
+ transform var(--ui-affordance-motion, var(--ui-motion-fast, 120ms)) var(--ui-motion-ease, ease);
632
+ }
393
633
 
394
- .selector:hover::before,
395
- .selector:focus-visible::before {
396
- opacity: 0;
397
- }
634
+ .selector:hover::before,
635
+ .selector:focus-visible::before {
636
+ opacity: 0;
637
+ }
398
638
 
399
- .selector:hover .glyph,
400
- .selector:focus-visible .glyph {
401
- opacity: 1;
402
- transform: scale(1);
403
- }
639
+ .selector:hover .glyph,
640
+ .selector:focus-visible .glyph {
641
+ opacity: 1;
642
+ transform: scale(1);
643
+ }
404
644
 
405
- .selector.row {
406
- left: -9px;
407
- width: 18px;
408
- height: 32px;
409
- transform: translateY(-50%);
410
- }
645
+ .selector.row {
646
+ left: -9px;
647
+ width: 18px;
648
+ height: 32px;
649
+ transform: translateY(-50%);
650
+ }
411
651
 
412
- .selector.row::before {
413
- width: 2px;
414
- height: 16px;
415
- }
652
+ .selector.row::before {
653
+ width: 2px;
654
+ height: 16px;
655
+ }
416
656
 
417
- .selector.column {
418
- top: -9px;
419
- width: 32px;
420
- height: 18px;
421
- transform: translateX(-50%);
422
- }
657
+ .selector.column {
658
+ top: -9px;
659
+ width: 32px;
660
+ height: 18px;
661
+ transform: translateX(-50%);
662
+ }
423
663
 
424
- .selector.column::before {
425
- width: 16px;
426
- height: 2px;
427
- }
664
+ .selector.column::before {
665
+ width: 16px;
666
+ height: 2px;
667
+ }
428
668
 
429
- @media (hover: none), (pointer: coarse) {
430
- .selector::before {
431
- opacity: 0;
432
- }
669
+ @media (hover: none), (pointer: coarse) {
670
+ .selector::before {
671
+ opacity: 0;
672
+ }
433
673
 
434
- .selector .glyph {
435
- opacity: 1;
436
- transform: none;
437
- }
438
- }
674
+ .selector .glyph {
675
+ opacity: 1;
676
+ transform: none;
677
+ }
678
+ }
439
679
 
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
- }
680
+ .cell-menu {
681
+ width: 24px;
682
+ height: 24px;
683
+ border-radius: var(--ui-radius-1, 4px);
684
+ background: color-mix(in srgb, var(--ui-surface-muted, #f3f4f6) 78%, transparent);
685
+ }
446
686
 
447
- .cell-menu {
448
- --ui-icon-size: 15px;
449
- --ui-icon-stroke-width: var(--ui-editor-table-affordance-icon-stroke-width, 2);
450
- }
687
+ .cell-menu {
688
+ --ui-icon-size: 15px;
689
+ --ui-icon-stroke-width: var(--ui-editor-table-affordance-icon-stroke-width, 2);
690
+ }
451
691
 
452
- [data-component~="ui-editor-table-overlay"][hidden] {
453
- display: none;
454
- }
692
+ [data-component~="ui-editor-table-overlay"][hidden] {
693
+ display: none;
694
+ }
455
695
  </style>