@threadlabs/looma 0.14.7 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (336) hide show
  1. package/components/shared/icons.js +5 -0
  2. package/components/shared/menu-navigation.js +49 -0
  3. package/components/shared/overlay.js +33 -60
  4. package/components/ui-avatar/ui-avatar.html +19 -2
  5. package/components/ui-avatar/ui-avatar.js +7 -1
  6. package/components/ui-avatar-group/ui-avatar-group.html +8 -3
  7. package/components/ui-avatar-group/ui-avatar-group.js +6 -2
  8. package/components/ui-badge/ui-badge.html +70 -4
  9. package/components/ui-button/ui-button.html +21 -5
  10. package/components/ui-button/ui-button.js +10 -0
  11. package/components/ui-callout/ui-callout.html +13 -5
  12. package/components/ui-checkbox/ui-checkbox.html +11 -0
  13. package/components/ui-combobox/ui-combobox.html +50 -10
  14. package/components/ui-combobox/ui-combobox.js +11 -8
  15. package/components/ui-context-menu/ui-context-menu.html +33 -5
  16. package/components/ui-context-menu/ui-context-menu.js +26 -17
  17. package/components/ui-dialog/ui-dialog.html +51 -8
  18. package/components/ui-dialog/ui-dialog.js +28 -7
  19. package/components/ui-disclosure/ui-disclosure.html +14 -5
  20. package/components/ui-disclosure/ui-disclosure.js +51 -4
  21. package/components/ui-editable/ui-editable.html +17 -3
  22. package/components/ui-editable/ui-editable.js +7 -0
  23. package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.html +48 -14
  24. package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.js +40 -6
  25. package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +22 -9
  26. package/components/ui-editor-mention-menu/ui-editor-mention-menu.js +33 -11
  27. package/components/ui-editor-mention-menu-item/ui-editor-mention-menu-item.html +67 -0
  28. package/components/ui-editor-slash-menu/ui-editor-slash-menu.html +33 -30
  29. package/components/ui-editor-slash-menu/ui-editor-slash-menu.js +42 -8
  30. package/components/ui-editor-slash-menu-group/ui-editor-slash-menu-group.html +31 -0
  31. package/components/ui-editor-slash-menu-item/ui-editor-slash-menu-item.html +75 -0
  32. package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.html +16 -5
  33. package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.js +10 -2
  34. package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +5 -5
  35. package/components/ui-editor-table-overlay/ui-editor-table-overlay.js +5 -2
  36. package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +14 -4
  37. package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.js +2 -2
  38. package/components/ui-editor-toolbar/ui-editor-toolbar.html +1 -1
  39. package/components/ui-editor-toolbar/ui-editor-toolbar.js +46 -0
  40. package/components/ui-floating-action-button/ui-floating-action-button.html +1 -1
  41. package/components/ui-form-field/ui-form-field.html +16 -3
  42. package/components/ui-form-field/ui-form-field.js +1 -1
  43. package/components/ui-grid/ui-grid.html +17 -2
  44. package/components/ui-icon/ui-icon.html +5 -0
  45. package/components/ui-icon-button/ui-icon-button.html +25 -6
  46. package/components/ui-icon-button/ui-icon-button.js +11 -1
  47. package/components/ui-input/ui-input.html +3 -3
  48. package/components/ui-input-group/ui-input-group.html +18 -4
  49. package/components/ui-listbox/ui-listbox.html +81 -0
  50. package/components/ui-listbox/ui-listbox.js +27 -0
  51. package/components/ui-menu/ui-menu.html +33 -5
  52. package/components/ui-menu/ui-menu.js +18 -12
  53. package/components/ui-menu-group/ui-menu-group.html +27 -0
  54. package/components/ui-menu-item/ui-menu-item.html +80 -8
  55. package/components/ui-menu-item/ui-menu-item.js +47 -0
  56. package/components/ui-popover/ui-popover.html +33 -5
  57. package/components/ui-popover/ui-popover.js +9 -1
  58. package/components/ui-radio-group/ui-radio-group.html +13 -1
  59. package/components/ui-search-shell/ui-search-shell.html +6 -6
  60. package/components/ui-search-shell/ui-search-shell.js +21 -5
  61. package/components/ui-select/ui-select.html +14 -4
  62. package/components/ui-switch/ui-switch.html +2 -2
  63. package/components/ui-switcher/ui-switcher.html +8 -1
  64. package/components/ui-switcher/ui-switcher.js +15 -0
  65. package/components/ui-tabs/ui-tabs.html +17 -12
  66. package/components/ui-tabs/ui-tabs.js +43 -7
  67. package/components/ui-textarea/ui-textarea.html +28 -5
  68. package/components/ui-toast/ui-toast.html +88 -0
  69. package/components/ui-toast/ui-toast.js +68 -0
  70. package/components/ui-toast-region/ui-toast-region.html +102 -19
  71. package/components/ui-toast-region/ui-toast-region.js +10 -18
  72. package/components/ui-tooltip/ui-tooltip.html +51 -7
  73. package/components/ui-tooltip/ui-tooltip.js +29 -3
  74. package/components/ui-tree/ui-tree.html +12 -0
  75. package/components/ui-tree/ui-tree.js +191 -12
  76. package/components/ui-tree-item/ui-tree-item.html +87 -8
  77. package/components/ui-tree-item/ui-tree-item.js +3 -1
  78. package/dist/index.js +38 -32
  79. package/editor/chunks/extensions.js +82 -2
  80. package/editor/extensions/table-commands.d.ts +8 -0
  81. package/editor/icons.d.ts +5 -0
  82. package/editor/index.js +7 -2
  83. package/editor/insert-table-grid.d.ts +1 -1
  84. package/editor/mention-menu.d.ts +2 -0
  85. package/editor/slash-menu.d.ts +3 -0
  86. package/editor/table-context-menu.d.ts +1 -1
  87. package/editor/table-overlay.d.ts +2 -2
  88. package/package.json +1 -1
  89. package/styles/ui-avatar-group.css +1 -2
  90. package/styles/ui-avatar.css +11 -1
  91. package/styles/ui-badge.css +73 -1
  92. package/styles/ui-button.css +9 -1
  93. package/styles/ui-callout.css +1 -1
  94. package/styles/ui-checkbox.css +9 -0
  95. package/styles/ui-combobox.css +38 -7
  96. package/styles/ui-context-menu.css +32 -4
  97. package/styles/ui-dialog.css +42 -5
  98. package/styles/ui-editor-insert-table-grid.css +48 -11
  99. package/styles/ui-editor-mention-menu-item.css +57 -0
  100. package/styles/ui-editor-mention-menu.css +11 -1
  101. package/styles/ui-editor-slash-menu-group.css +21 -0
  102. package/styles/ui-editor-slash-menu-item.css +62 -0
  103. package/styles/ui-editor-slash-menu.css +10 -21
  104. package/styles/ui-editor-table-context-menu.css +1 -1
  105. package/styles/ui-floating-action-button.css +1 -1
  106. package/styles/ui-form-field.css +14 -1
  107. package/styles/ui-grid.css +14 -1
  108. package/styles/ui-icon-button.css +17 -5
  109. package/styles/ui-input-group.css +18 -4
  110. package/styles/ui-input.css +3 -3
  111. package/styles/ui-listbox.css +69 -0
  112. package/styles/ui-menu-group.css +19 -0
  113. package/styles/ui-menu-item.css +48 -9
  114. package/styles/ui-menu.css +32 -4
  115. package/styles/ui-popover.css +28 -4
  116. package/styles/ui-radio-group.css +9 -0
  117. package/styles/ui-search-shell.css +5 -5
  118. package/styles/ui-select.css +14 -4
  119. package/styles/ui-switch.css +2 -2
  120. package/styles/ui-switcher.css +4 -0
  121. package/styles/ui-textarea.css +27 -4
  122. package/styles/ui-toast-region.css +88 -4
  123. package/styles/ui-toast.css +74 -0
  124. package/styles/ui-tooltip.css +46 -6
  125. package/styles/ui-tree-item.css +72 -4
  126. package/styles/ui-tree.css +8 -0
  127. package/tokens.css +3 -0
  128. package/vanilla/UiAvatar.d.ts +2 -0
  129. package/vanilla/UiAvatar.js +8 -1
  130. package/vanilla/UiAvatarGroup.d.ts +2 -0
  131. package/vanilla/UiAvatarGroup.js +1 -1
  132. package/vanilla/UiBadge.d.ts +1 -1
  133. package/vanilla/UiBadge.js +1 -1
  134. package/vanilla/UiButton.d.ts +1 -0
  135. package/vanilla/UiButton.js +22 -6
  136. package/vanilla/UiCallout.d.ts +1 -1
  137. package/vanilla/UiCallout.js +1 -1
  138. package/vanilla/UiCheckbox.d.ts +1 -0
  139. package/vanilla/UiCheckbox.js +12 -9
  140. package/vanilla/UiCombobox.d.ts +4 -0
  141. package/vanilla/UiCombobox.js +30 -15
  142. package/vanilla/UiContextMenu.d.ts +1 -1
  143. package/vanilla/UiContextMenu.js +1 -1
  144. package/vanilla/UiDialog.d.ts +5 -2
  145. package/vanilla/UiDialog.js +1 -1
  146. package/vanilla/UiDisclosure.d.ts +2 -0
  147. package/vanilla/UiDisclosure.js +32 -18
  148. package/vanilla/UiEditable.d.ts +5 -0
  149. package/vanilla/UiEditable.js +7 -3
  150. package/vanilla/UiEditorInsertTableGrid.js +1 -6
  151. package/vanilla/UiEditorMentionMenu.d.ts +4 -2
  152. package/vanilla/UiEditorMentionMenu.js +49 -31
  153. package/vanilla/UiEditorMentionMenuItem.d.ts +16 -0
  154. package/vanilla/UiEditorMentionMenuItem.js +56 -0
  155. package/vanilla/UiEditorSlashMenu.d.ts +4 -3
  156. package/vanilla/UiEditorSlashMenu.js +59 -46
  157. package/vanilla/UiEditorSlashMenuGroup.d.ts +14 -0
  158. package/vanilla/UiEditorSlashMenuGroup.js +48 -0
  159. package/vanilla/UiEditorSlashMenuItem.d.ts +18 -0
  160. package/vanilla/UiEditorSlashMenuItem.js +57 -0
  161. package/vanilla/UiEditorTableContextMenu.d.ts +5 -2
  162. package/vanilla/UiEditorTableContextMenu.js +1 -2
  163. package/vanilla/UiEditorTableOverlay.d.ts +1 -1
  164. package/vanilla/UiEditorTableOverlay.js +5 -5
  165. package/vanilla/UiEditorTableToolbar.d.ts +4 -2
  166. package/vanilla/UiEditorTableToolbar.js +1 -2
  167. package/vanilla/UiEditorToolbar.js +2 -0
  168. package/vanilla/UiGrid.d.ts +1 -0
  169. package/vanilla/UiGrid.js +8 -7
  170. package/vanilla/UiIcon.js +1 -1
  171. package/vanilla/UiIconButton.d.ts +1 -0
  172. package/vanilla/UiIconButton.js +11 -2
  173. package/vanilla/UiListbox.d.ts +20 -0
  174. package/vanilla/UiListbox.js +45 -0
  175. package/vanilla/UiMenu.d.ts +1 -1
  176. package/vanilla/UiMenu.js +1 -1
  177. package/vanilla/UiMenuGroup.d.ts +14 -0
  178. package/vanilla/UiMenuGroup.js +35 -0
  179. package/vanilla/UiMenuItem.d.ts +5 -1
  180. package/vanilla/UiMenuItem.js +91 -30
  181. package/vanilla/UiPopover.d.ts +1 -1
  182. package/vanilla/UiPopover.js +1 -1
  183. package/vanilla/UiRadioGroup.d.ts +1 -0
  184. package/vanilla/UiRadioGroup.js +6 -3
  185. package/vanilla/UiSwitcher.d.ts +1 -0
  186. package/vanilla/UiSwitcher.js +7 -9
  187. package/vanilla/UiTabs.d.ts +1 -0
  188. package/vanilla/UiTabs.js +9 -1
  189. package/vanilla/UiTextarea.d.ts +1 -0
  190. package/vanilla/UiTextarea.js +4 -1
  191. package/vanilla/UiToast.d.ts +16 -0
  192. package/vanilla/UiToast.js +53 -0
  193. package/vanilla/UiToastRegion.d.ts +1 -4
  194. package/vanilla/UiToastRegion.js +3 -11
  195. package/vanilla/UiTooltip.d.ts +1 -1
  196. package/vanilla/UiTooltip.js +1 -1
  197. package/vanilla/UiTree.d.ts +2 -0
  198. package/vanilla/UiTree.js +1 -1
  199. package/vanilla/UiTreeItem.d.ts +1 -0
  200. package/vanilla/UiTreeItem.js +45 -31
  201. package/vanilla/index.js +6 -0
  202. package/vue/UiAvatar.d.ts +4 -0
  203. package/vue/UiAvatar.vue +23 -3
  204. package/vue/UiAvatarGroup.d.ts +3 -0
  205. package/vue/UiAvatarGroup.vue +7 -4
  206. package/vue/UiBadge.d.ts +2 -2
  207. package/vue/UiBadge.vue +74 -2
  208. package/vue/UiButton.d.ts +5 -3
  209. package/vue/UiButton.vue +41 -7
  210. package/vue/UiCallout.d.ts +2 -2
  211. package/vue/UiCallout.vue +3 -2
  212. package/vue/UiCheckbox.d.ts +2 -0
  213. package/vue/UiCheckbox.vue +16 -0
  214. package/vue/UiCombobox.d.ts +13 -3
  215. package/vue/UiCombobox.vue +62 -11
  216. package/vue/UiContextMenu.d.ts +2 -0
  217. package/vue/UiContextMenu.vue +47 -6
  218. package/vue/UiDialog.d.ts +18 -4
  219. package/vue/UiDialog.vue +86 -11
  220. package/vue/UiDisclosure.d.ts +8 -2
  221. package/vue/UiDisclosure.vue +38 -14
  222. package/vue/UiEditable.d.ts +10 -0
  223. package/vue/UiEditable.vue +14 -2
  224. package/vue/UiEditorInsertTableGrid.vue +52 -15
  225. package/vue/UiEditorMentionMenu.d.ts +24 -2
  226. package/vue/UiEditorMentionMenu.vue +27 -11
  227. package/vue/UiEditorMentionMenuItem.d.ts +24 -0
  228. package/vue/UiEditorMentionMenuItem.js +2 -0
  229. package/vue/UiEditorMentionMenuItem.vue +88 -0
  230. package/vue/UiEditorSlashMenu.d.ts +24 -1
  231. package/vue/UiEditorSlashMenu.vue +33 -33
  232. package/vue/UiEditorSlashMenuGroup.d.ts +18 -0
  233. package/vue/UiEditorSlashMenuGroup.js +2 -0
  234. package/vue/UiEditorSlashMenuGroup.vue +43 -0
  235. package/vue/UiEditorSlashMenuItem.d.ts +26 -0
  236. package/vue/UiEditorSlashMenuItem.js +2 -0
  237. package/vue/UiEditorSlashMenuItem.vue +101 -0
  238. package/vue/UiEditorTableContextMenu.d.ts +9 -3
  239. package/vue/UiEditorTableContextMenu.vue +53 -3
  240. package/vue/UiEditorTableOverlay.d.ts +2 -2
  241. package/vue/UiEditorTableOverlay.vue +8 -6
  242. package/vue/UiEditorTableToolbar.d.ts +7 -3
  243. package/vue/UiEditorTableToolbar.vue +50 -2
  244. package/vue/UiEditorToolbar.vue +14 -1
  245. package/vue/UiFloatingActionButton.vue +1 -1
  246. package/vue/UiFormField.vue +28 -3
  247. package/vue/UiGrid.d.ts +1 -0
  248. package/vue/UiGrid.vue +26 -2
  249. package/vue/UiIcon.vue +16 -0
  250. package/vue/UiIconButton.d.ts +5 -3
  251. package/vue/UiIconButton.vue +40 -6
  252. package/vue/UiInput.vue +10 -3
  253. package/vue/UiInputGroup.vue +32 -11
  254. package/vue/UiListbox.d.ts +33 -0
  255. package/vue/UiListbox.js +2 -0
  256. package/vue/UiListbox.vue +131 -0
  257. package/vue/UiMenu.d.ts +2 -0
  258. package/vue/UiMenu.vue +43 -6
  259. package/vue/UiMenuGroup.d.ts +18 -0
  260. package/vue/UiMenuGroup.js +2 -0
  261. package/vue/UiMenuGroup.vue +39 -0
  262. package/vue/UiMenuItem.d.ts +34 -2
  263. package/vue/UiMenuItem.vue +145 -9
  264. package/vue/UiPopover.d.ts +2 -2
  265. package/vue/UiPopover.vue +44 -5
  266. package/vue/UiRadioGroup.d.ts +2 -0
  267. package/vue/UiRadioGroup.vue +17 -0
  268. package/vue/UiSearchShell.vue +12 -5
  269. package/vue/UiSelect.vue +18 -4
  270. package/vue/UiSwitch.vue +2 -2
  271. package/vue/UiSwitcher.d.ts +1 -0
  272. package/vue/UiSwitcher.vue +22 -1
  273. package/vue/UiTabs.d.ts +6 -2
  274. package/vue/UiTabs.vue +14 -12
  275. package/vue/UiTextarea.d.ts +2 -0
  276. package/vue/UiTextarea.vue +32 -4
  277. package/vue/UiToast.d.ts +34 -0
  278. package/vue/UiToast.js +2 -0
  279. package/vue/UiToast.vue +173 -0
  280. package/vue/UiToastRegion.d.ts +2 -18
  281. package/vue/UiToastRegion.vue +123 -48
  282. package/vue/UiTooltip.d.ts +2 -2
  283. package/vue/UiTooltip.vue +67 -12
  284. package/vue/UiTree.d.ts +10 -0
  285. package/vue/UiTree.vue +27 -0
  286. package/vue/UiTreeItem.d.ts +2 -0
  287. package/vue/UiTreeItem.vue +96 -4
  288. package/vue/chunks/UiAvatar.js +19 -5
  289. package/vue/chunks/UiAvatarGroup.js +10 -4
  290. package/vue/chunks/UiBadge.js +1 -1
  291. package/vue/chunks/UiButton.js +58 -11
  292. package/vue/chunks/UiCallout.js +2 -2
  293. package/vue/chunks/UiCheckbox.js +12 -2
  294. package/vue/chunks/UiCombobox.js +30 -13
  295. package/vue/chunks/UiContextMenu.js +6 -2
  296. package/vue/chunks/UiDialog.js +25 -8
  297. package/vue/chunks/UiDisclosure.js +36 -12
  298. package/vue/chunks/UiEditable.js +22 -8
  299. package/vue/chunks/UiEditorInsertTableGrid.js +11 -14
  300. package/vue/chunks/UiEditorMentionMenu.js +30 -19
  301. package/vue/chunks/UiEditorMentionMenuItem.js +36 -0
  302. package/vue/chunks/UiEditorSlashMenu.js +33 -35
  303. package/vue/chunks/UiEditorSlashMenuGroup.js +26 -0
  304. package/vue/chunks/UiEditorSlashMenuItem.js +51 -0
  305. package/vue/chunks/UiEditorTableContextMenu.js +39 -5
  306. package/vue/chunks/UiEditorTableOverlay.js +6 -6
  307. package/vue/chunks/UiEditorTableToolbar.js +37 -4
  308. package/vue/chunks/UiEditorToolbar.js +18 -4
  309. package/vue/chunks/UiFloatingActionButton.js +1 -1
  310. package/vue/chunks/UiFormField.js +13 -9
  311. package/vue/chunks/UiGrid.js +6 -2
  312. package/vue/chunks/UiIcon.js +40 -2
  313. package/vue/chunks/UiIconButton.js +35 -4
  314. package/vue/chunks/UiInput.js +1 -1
  315. package/vue/chunks/UiInputGroup.js +1 -1
  316. package/vue/chunks/UiListbox.js +70 -0
  317. package/vue/chunks/UiMenu.js +6 -2
  318. package/vue/chunks/UiMenuGroup.js +25 -0
  319. package/vue/chunks/UiMenuItem.js +128 -7
  320. package/vue/chunks/UiPopover.js +1 -1
  321. package/vue/chunks/UiRadioGroup.js +8 -2
  322. package/vue/chunks/UiSearchShell.js +1 -1
  323. package/vue/chunks/UiSelect.js +1 -1
  324. package/vue/chunks/UiSwitch.js +1 -1
  325. package/vue/chunks/UiSwitcher.js +20 -3
  326. package/vue/chunks/UiTabs.js +4 -3
  327. package/vue/chunks/UiTextarea.js +7 -2
  328. package/vue/chunks/UiToast.js +81 -0
  329. package/vue/chunks/UiToastRegion.js +25 -49
  330. package/vue/chunks/UiTooltip.js +3 -7
  331. package/vue/chunks/UiTree.js +8 -4
  332. package/vue/chunks/UiTreeItem.js +28 -10
  333. package/vue/components.css +1840 -851
  334. package/vue/editor/index.js +263 -2
  335. package/vue/index.d.ts +6 -0
  336. package/vue/index.js +9 -3
@@ -9,18 +9,28 @@ defineOptions({ inheritAttrs: false })
9
9
  const props = withDefaults(
10
10
  defineProps<{
11
11
  actions?: boolean
12
+ cancelLabel?: string
12
13
  disabled?: boolean
13
14
  edit?: boolean
14
15
  hint?: string
15
16
  label?: string
17
+ maxLength?: number
18
+ placeholder?: string
19
+ required?: boolean
20
+ saveLabel?: string
16
21
  value?: string
17
22
  }>(),
18
23
  {
19
24
  actions: false,
25
+ cancelLabel: 'Cancel',
20
26
  disabled: false,
21
27
  edit: false,
22
28
  hint: '',
23
29
  label: 'Edit value',
30
+ maxLength: 0,
31
+ placeholder: '',
32
+ required: false,
33
+ saveLabel: 'Save',
24
34
  value: '',
25
35
  },
26
36
  )
@@ -132,13 +142,15 @@ useComponentHost(controllerModule.default, {
132
142
  type="text"
133
143
  :value.prop="draft"
134
144
  :aria-label="label"
145
+ :placeholder="placeholder"
146
+ :required="required"
135
147
  :disabled="disabled || !internalEdit"
136
148
  ref="input"
137
149
  >
138
150
  </div>
139
151
  <div v-if="actions" class="actions">
140
- <button class="save" type="button">Save</button>
141
- <button class="cancel" type="button">Cancel</button>
152
+ <button class="save" type="button">{{ saveLabel }}</button>
153
+ <button class="cancel" type="button">{{ cancelLabel }}</button>
142
154
  </div>
143
155
  </div>
144
156
  </template>
@@ -27,9 +27,11 @@ const emit = defineEmits<{
27
27
  }>()
28
28
 
29
29
  const root = ref<HTMLElement | null>(null)
30
+ const gridElement = useTemplateRef<HTMLElement>('grid')
30
31
  const headerElement = useTemplateRef<HTMLElement>('header')
31
- const insertElement = useTemplateRef<HTMLElement>('insert')
32
- const cells = ref<{ key: string; row: number; col: number; label: string; selected: boolean }[]>([])
32
+ const cells = ref<
33
+ { key: string; row: number; col: number; label: string; selected: boolean; tabIndex: number }[]
34
+ >([])
33
35
  const rows = ref(8)
34
36
  const cols = ref(8)
35
37
  const hint = ref('')
@@ -51,7 +53,7 @@ useComponentHost(controllerModule.default, {
51
53
  root,
52
54
  dispatch,
53
55
  props,
54
- refs: { header: headerElement, insert: insertElement },
56
+ refs: { grid: gridElement, header: headerElement },
55
57
  state: { cells, rows, cols, hint, withHeaderRow },
56
58
  })
57
59
  </script>
@@ -64,6 +66,7 @@ useComponentHost(controllerModule.default, {
64
66
  role="group"
65
67
  aria-label="Table dimensions"
66
68
  :style="{ '--_rows': rows, '--_cols': cols }"
69
+ ref="grid"
67
70
  >
68
71
  <button
69
72
  v-for="cell in cells"
@@ -74,13 +77,13 @@ useComponentHost(controllerModule.default, {
74
77
  :data-col="cell.col"
75
78
  :aria-label="cell.label"
76
79
  :aria-pressed="cell.selected"
80
+ :tabindex="cell.tabIndex"
77
81
  :class="{ selected: cell.selected }"
78
82
  >
79
83
  </button>
80
84
  </div>
81
85
  <label class="header"><input type="checkbox" :checked.prop="withHeaderRow" ref="header"> Header
82
86
  row</label>
83
- <button type="button" class="insert" ref="insert">Insert table</button>
84
87
  </div>
85
88
  </template>
86
89
 
@@ -105,6 +108,32 @@ useComponentHost(controllerModule.default, {
105
108
  grid-template-rows: repeat(var(--_rows, 8), 1.25rem);
106
109
  gap: 2px;
107
110
  margin-bottom: var(--ui-space-2);
111
+ max-inline-size: 100%;
112
+ overflow: auto;
113
+ --_ui-scroll-fade-direction: to right;
114
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
115
+ mask-image: linear-gradient(
116
+ var(--_ui-scroll-fade-direction),
117
+ transparent,
118
+ #000 var(--_ui-scroll-fade-start),
119
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
120
+ transparent
121
+ );
122
+ animation:
123
+ ui-scroll-fade-start linear,
124
+ ui-scroll-fade-start-hold linear,
125
+ ui-scroll-fade-end-hold linear,
126
+ ui-scroll-fade-end linear;
127
+ animation-timeline: scroll(self inline);
128
+ animation-range:
129
+ 0 var(--_ui-scroll-fade-size),
130
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
131
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
132
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
133
+ }
134
+
135
+ [data-component~="ui-editor-insert-table-grid"]:dir(rtl) .grid {
136
+ --_ui-scroll-fade-direction: to left;
108
137
  }
109
138
 
110
139
  .cell {
@@ -122,6 +151,11 @@ useComponentHost(controllerModule.default, {
122
151
  border-color: var(--ui-accent-solid, var(--ui-accent));
123
152
  }
124
153
 
154
+ .cell:focus-visible {
155
+ outline: 2px solid var(--ui-focus-ring);
156
+ outline-offset: -2px;
157
+ }
158
+
125
159
  .header {
126
160
  display: block;
127
161
  margin-bottom: var(--ui-space-2);
@@ -129,19 +163,22 @@ useComponentHost(controllerModule.default, {
129
163
  cursor: pointer;
130
164
  }
131
165
 
132
- [data-component~="ui-editor-insert-table-grid"] .insert {
133
- width: 100%;
134
- padding: var(--ui-space-2) var(--ui-space-3);
135
- border: 1px solid var(--ui-border);
136
- border-radius: var(--ui-radius-sm);
137
- background: var(--ui-accent-solid, var(--ui-accent));
138
- color: var(--ui-accent-contrast);
139
- font-size: var(--ui-font-size-sm);
140
- cursor: pointer;
166
+ @media (pointer: coarse) {
167
+ .grid {
168
+ grid-template-columns: repeat(var(--_cols, 8), 44px);
169
+ grid-template-rows: repeat(var(--_rows, 8), 44px);
170
+ }
171
+
172
+ .cell {
173
+ width: 44px;
174
+ height: 44px;
175
+ }
141
176
  }
142
177
 
143
- [data-component~="ui-editor-insert-table-grid"] .insert:hover {
144
- filter: brightness(1.05);
178
+ @media (forced-colors: active) {
179
+ .cell:focus-visible {
180
+ outline-color: Highlight;
181
+ }
145
182
  }
146
183
 
147
184
  [data-component~="ui-editor-insert-table-grid"][hidden] {
@@ -15,30 +15,52 @@ type __VLS_Props = {
15
15
  readonly detail?: string;
16
16
  readonly initials?: string;
17
17
  })[];
18
+ label?: string;
18
19
  loading?: boolean;
20
+ loadingLabel?: string;
19
21
  open?: boolean;
20
22
  query?: string;
21
23
  selectedIndex?: number;
22
24
  };
23
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
25
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
26
+ type __VLS_Slots = {} & {
27
+ header?: (props: typeof __VLS_1) => any;
28
+ } & {
29
+ default?: (props: typeof __VLS_3) => any;
30
+ } & {
31
+ empty?: (props: typeof __VLS_5) => any;
32
+ };
33
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
34
  select: (detail: {
25
35
  readonly index: number;
36
+ readonly value: string;
26
37
  }) => any;
27
38
  highlight: (detail: {
28
39
  readonly index: number;
40
+ readonly value: string;
29
41
  }) => any;
30
42
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
31
43
  onSelect?: ((detail: {
32
44
  readonly index: number;
45
+ readonly value: string;
33
46
  }) => any) | undefined;
34
47
  onHighlight?: ((detail: {
35
48
  readonly index: number;
49
+ readonly value: string;
36
50
  }) => any) | undefined;
37
51
  }>, {
52
+ label: string;
38
53
  open: boolean;
39
- query: string;
40
54
  loading: boolean;
55
+ query: string;
56
+ loadingLabel: string;
41
57
  selectedIndex: number;
42
58
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
59
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
43
60
  declare const _default: typeof __VLS_export;
44
61
  export default _default;
62
+ type __VLS_WithSlots<T, S> = T & {
63
+ new (): {
64
+ $slots: S;
65
+ };
66
+ };
@@ -1,6 +1,6 @@
1
1
  <!-- Generated by HTML Next 1.0.0-alpha.7 for Vue 3.5. Do not edit. -->
2
2
  <script setup lang="ts">
3
- import { ref } from 'vue'
3
+ import { ref, useTemplateRef } from 'vue'
4
4
  import * as controllerModule from '../components/ui-editor-mention-menu/ui-editor-mention-menu.js'
5
5
  import { createDispatch, useComponentHost } from './host'
6
6
 
@@ -25,24 +25,29 @@ const props = withDefaults(
25
25
  readonly detail?: string
26
26
  readonly initials?: string
27
27
  })[]
28
+ label?: string
28
29
  loading?: boolean
30
+ loadingLabel?: string
29
31
  open?: boolean
30
32
  query?: string
31
33
  selectedIndex?: number
32
34
  }>(),
33
35
  {
36
+ label: 'Mentions',
34
37
  loading: false,
38
+ loadingLabel: 'Searching…',
35
39
  open: false,
36
40
  query: '',
37
41
  selectedIndex: 0,
38
42
  },
39
43
  )
40
44
  const emit = defineEmits<{
41
- highlight: [detail: { readonly index: number }]
42
- select: [detail: { readonly index: number }]
45
+ highlight: [detail: { readonly index: number; readonly value: string }]
46
+ select: [detail: { readonly index: number; readonly value: string }]
43
47
  }>()
44
48
 
45
49
  const root = ref<HTMLElement | null>(null)
50
+ const emptyElement = useTemplateRef<HTMLElement>('empty')
46
51
  const visible = ref(false)
47
52
  const rows = ref<{ id: string; label: string; detail?: string; initials: string }[]>([])
48
53
  const searching = ref(false)
@@ -52,7 +57,8 @@ const prefix = ref('ui-editor-mention-menu')
52
57
  const isHighlightDetail = (detail: unknown): boolean =>
53
58
  detail !== null && typeof detail === 'object' && !Array.isArray(detail)
54
59
  && Number.isInteger((detail as Record<string, unknown>)['index'])
55
- && Object.keys(detail as object).every((key) => ['index'].includes(key))
60
+ && typeof (detail as Record<string, unknown>)['value'] === 'string'
61
+ && Object.keys(detail as object).every((key) => ['index', 'value'].includes(key))
56
62
  const dispatch = createDispatch(root, emit as (name: string, detail: unknown) => void, {
57
63
  checks: {
58
64
  highlight: isHighlightDetail,
@@ -64,6 +70,7 @@ useComponentHost(controllerModule.default, {
64
70
  root,
65
71
  dispatch,
66
72
  props,
73
+ refs: { empty: emptyElement },
67
74
  state: { visible, rows, searching, active, prefix },
68
75
  })
69
76
  </script>
@@ -72,17 +79,13 @@ useComponentHost(controllerModule.default, {
72
79
  <div
73
80
  data-component="ui-editor-mention-menu"
74
81
  role="listbox"
75
- aria-label="Mention a person"
76
82
  v-bind="$attrs"
77
83
  :aria-busy="loading"
78
84
  :hidden="!visible"
79
85
  ref="root"
80
86
  >
81
- <div class="header">
82
- <span>People</span>
83
- <span class="hint">Type after @ to search</span>
84
- </div>
85
- <div v-if="searching" class="loading" role="status">Searching…</div>
87
+ <div class="header"><slot name="header" /></div>
88
+ <div v-if="searching" class="loading" role="status">{{ loadingLabel }}</div>
86
89
  <ul v-if="!searching" class="list" role="presentation">
87
90
  <li
88
91
  v-for="(row, index) in rows"
@@ -92,13 +95,16 @@ useComponentHost(controllerModule.default, {
92
95
  :id="`${prefix}-option-${index}`"
93
96
  :aria-selected="index === active"
94
97
  :data-index="index"
98
+ :data-value="row.id"
95
99
  :class="{ active: index === active }"
96
100
  >
97
101
  <span class="avatar" aria-hidden="true">{{ row.initials }}</span>
98
102
  <span class="body"><span class="label">{{ row.label }}</span>
99
103
  <span v-if="row.detail" class="detail">{{ row.detail }}</span></span>
100
104
  </li>
105
+ <slot />
101
106
  </ul>
107
+ <div class="empty" ref="empty"><slot name="empty" /></div>
102
108
  </div>
103
109
  </template>
104
110
 
@@ -129,6 +135,16 @@ useComponentHost(controllerModule.default, {
129
135
  font-weight: var(--ui-font-semibold);
130
136
  }
131
137
 
138
+ .header:not(:has(> *)), .empty:not(:has(> *)) {
139
+ display: none;
140
+ }
141
+
142
+ .empty {
143
+ padding: var(--ui-space-3);
144
+ color: var(--ui-text-muted);
145
+ font-size: var(--ui-font-size-sm);
146
+ }
147
+
132
148
  .hint {
133
149
  overflow: hidden;
134
150
  color: var(--ui-text-muted);
@@ -189,7 +205,7 @@ useComponentHost(controllerModule.default, {
189
205
  flex: 0 0 auto;
190
206
  color: var(--ui-accent-active, var(--ui-accent-solid));
191
207
  background: var(--ui-accent-soft, var(--ui-accent-subtle));
192
- border-radius: 999px;
208
+ border-radius: var(--ui-radius-round);
193
209
  font-size: var(--ui-font-size-xs);
194
210
  font-weight: var(--ui-font-semibold);
195
211
  }
@@ -0,0 +1,24 @@
1
+ type __VLS_Props = {
2
+ detail?: string;
3
+ initials?: string;
4
+ value?: string;
5
+ };
6
+ declare var __VLS_1: {}, __VLS_3: {};
7
+ type __VLS_Slots = {} & {
8
+ start?: (props: typeof __VLS_1) => any;
9
+ } & {
10
+ default?: (props: typeof __VLS_3) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
13
+ detail: string;
14
+ initials: string;
15
+ value: string;
16
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,2 @@
1
+ import { t as UiEditorMentionMenuItem_default } from "./chunks/UiEditorMentionMenuItem.js";
2
+ export { UiEditorMentionMenuItem_default as default };
@@ -0,0 +1,88 @@
1
+ <!-- Generated by HTML Next 1.0.0-alpha.7 for Vue 3.5. Do not edit. -->
2
+ <script setup lang="ts">
3
+ defineOptions({ inheritAttrs: false })
4
+
5
+ withDefaults(
6
+ defineProps<{
7
+ detail?: string
8
+ initials?: string
9
+ value?: string
10
+ }>(),
11
+ {
12
+ detail: '',
13
+ initials: '',
14
+ value: '',
15
+ },
16
+ )
17
+ </script>
18
+
19
+ <template>
20
+ <li
21
+ data-component="ui-editor-mention-menu-item"
22
+ role="option"
23
+ tabindex="-1"
24
+ v-bind="$attrs"
25
+ :data-value="value"
26
+ >
27
+ <span class="avatar" aria-hidden="true"><slot name="start">{{ initials }}</slot></span>
28
+ <span class="body"><span class="label"><slot /></span>
29
+ <span v-if="detail" class="detail">{{ detail }}</span></span>
30
+ </li>
31
+ </template>
32
+
33
+ <style scoped>
34
+ [data-component~="ui-editor-mention-menu-item"] {
35
+ display: flex;
36
+ align-items: center;
37
+ min-block-size: 44px;
38
+ padding: var(--ui-space-2) var(--ui-space-3);
39
+ gap: var(--ui-space-3);
40
+ cursor: pointer;
41
+ list-style: none;
42
+ }
43
+
44
+ [data-component~="ui-editor-mention-menu-item"][aria-selected="true"] {
45
+ background: var(--ui-accent-subtle);
46
+ }
47
+
48
+ .avatar {
49
+ display: inline-flex;
50
+ align-items: center;
51
+ justify-content: center;
52
+ inline-size: 32px;
53
+ block-size: 32px;
54
+ flex: 0 0 auto;
55
+ color: var(--ui-accent-active);
56
+ background: var(--ui-accent-soft);
57
+ border-radius: var(--ui-radius-round);
58
+ font-size: var(--ui-font-size-xs);
59
+ font-weight: var(--ui-font-semibold);
60
+ }
61
+
62
+ .body {
63
+ display: flex;
64
+ min-inline-size: 0;
65
+ flex-direction: column;
66
+ }
67
+
68
+ .label, .detail {
69
+ overflow: hidden;
70
+ text-overflow: ellipsis;
71
+ white-space: nowrap;
72
+ }
73
+
74
+ .label {
75
+ color: var(--ui-text-primary);
76
+ font-size: var(--ui-font-size-sm);
77
+ font-weight: var(--ui-font-medium);
78
+ }
79
+
80
+ .detail {
81
+ color: var(--ui-text-muted);
82
+ font-size: var(--ui-font-size-xs);
83
+ }
84
+
85
+ [data-component~="ui-editor-mention-menu-item"][hidden] {
86
+ display: none;
87
+ }
88
+ </style>
@@ -10,32 +10,55 @@ type __VLS_Props = {
10
10
  readonly height?: number;
11
11
  } | null;
12
12
  items?: readonly ({
13
+ readonly value?: string;
13
14
  readonly title: string;
14
15
  readonly description: string;
15
16
  readonly icon: string;
16
17
  })[];
18
+ label?: string;
17
19
  open?: boolean;
18
20
  query?: string;
19
21
  selectedIndex?: number;
20
22
  };
21
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
+ declare var __VLS_1: {}, __VLS_8: {}, __VLS_10: {}, __VLS_12: {};
24
+ type __VLS_Slots = {} & {
25
+ header?: (props: typeof __VLS_1) => any;
26
+ } & {
27
+ default?: (props: typeof __VLS_8) => any;
28
+ } & {
29
+ empty?: (props: typeof __VLS_10) => any;
30
+ } & {
31
+ footer?: (props: typeof __VLS_12) => any;
32
+ };
33
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
22
34
  select: (detail: {
23
35
  readonly index: number;
36
+ readonly value: string;
24
37
  }) => any;
25
38
  highlight: (detail: {
26
39
  readonly index: number;
40
+ readonly value: string;
27
41
  }) => any;
28
42
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
29
43
  onSelect?: ((detail: {
30
44
  readonly index: number;
45
+ readonly value: string;
31
46
  }) => any) | undefined;
32
47
  onHighlight?: ((detail: {
33
48
  readonly index: number;
49
+ readonly value: string;
34
50
  }) => any) | undefined;
35
51
  }>, {
52
+ label: string;
36
53
  open: boolean;
37
54
  query: string;
38
55
  selectedIndex: number;
39
56
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
57
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
40
58
  declare const _default: typeof __VLS_export;
41
59
  export default _default;
60
+ type __VLS_WithSlots<T, S> = T & {
61
+ new (): {
62
+ $slots: S;
63
+ };
64
+ };
@@ -1,6 +1,6 @@
1
1
  <!-- Generated by HTML Next 1.0.0-alpha.7 for Vue 3.5. Do not edit. -->
2
2
  <script setup lang="ts">
3
- import { ref } from 'vue'
3
+ import { ref, useTemplateRef } from 'vue'
4
4
  import * as controllerModule from '../components/ui-editor-slash-menu/ui-editor-slash-menu.js'
5
5
  import { createDispatch, useComponentHost } from './host'
6
6
  import UiIcon from './UiIcon.vue'
@@ -20,30 +20,40 @@ const props = withDefaults(
20
20
  readonly height?: number
21
21
  } | null
22
22
  items?:
23
- readonly ({ readonly title: string; readonly description: string; readonly icon: string })[]
23
+ readonly ({
24
+ readonly value?: string
25
+ readonly title: string
26
+ readonly description: string
27
+ readonly icon: string
28
+ })[]
29
+ label?: string
24
30
  open?: boolean
25
31
  query?: string
26
32
  selectedIndex?: number
27
33
  }>(),
28
34
  {
35
+ label: 'Insert block',
29
36
  open: false,
30
37
  query: '',
31
38
  selectedIndex: 0,
32
39
  },
33
40
  )
34
41
  const emit = defineEmits<{
35
- highlight: [detail: { readonly index: number }]
36
- select: [detail: { readonly index: number }]
42
+ highlight: [detail: { readonly index: number; readonly value: string }]
43
+ select: [detail: { readonly index: number; readonly value: string }]
37
44
  }>()
38
45
 
39
46
  const root = ref<HTMLElement | null>(null)
47
+ const emptyElement = useTemplateRef<HTMLElement>('empty')
40
48
  const visible = ref(false)
41
49
  const active = ref(0)
50
+ const rows = ref<{ value: string; title: string; description: string; icon: string }[]>([])
42
51
 
43
52
  const isHighlightDetail = (detail: unknown): boolean =>
44
53
  detail !== null && typeof detail === 'object' && !Array.isArray(detail)
45
54
  && Number.isInteger((detail as Record<string, unknown>)['index'])
46
- && Object.keys(detail as object).every((key) => ['index'].includes(key))
55
+ && typeof (detail as Record<string, unknown>)['value'] === 'string'
56
+ && Object.keys(detail as object).every((key) => ['index', 'value'].includes(key))
47
57
  const dispatch = createDispatch(root, emit as (name: string, detail: unknown) => void, {
48
58
  checks: {
49
59
  highlight: isHighlightDetail,
@@ -55,7 +65,8 @@ useComponentHost(controllerModule.default, {
55
65
  root,
56
66
  dispatch,
57
67
  props,
58
- state: { visible, active },
68
+ refs: { empty: emptyElement },
69
+ state: { visible, active, rows },
59
70
  })
60
71
  </script>
61
72
 
@@ -63,33 +74,30 @@ useComponentHost(controllerModule.default, {
63
74
  <div
64
75
  data-component="ui-editor-slash-menu"
65
76
  role="listbox"
66
- aria-label="Insert block"
67
77
  v-bind="$attrs"
68
78
  :hidden="!visible"
69
79
  ref="root"
70
80
  >
71
- <div class="header" aria-hidden="true">
72
- <span class="header-label">Insert</span>
73
- <span v-if="query" class="header-query">{{ query }}</span>
74
- </div>
81
+ <div class="header"><slot name="header" /></div>
75
82
  <ul class="list" role="presentation">
76
83
  <li
77
- v-for="(item, index) in items"
84
+ v-for="(item, index) in rows"
78
85
  :key="index"
79
86
  class="item"
80
87
  role="option"
81
88
  :aria-selected="index === active"
82
89
  :data-index="index"
90
+ :data-value="item.value"
83
91
  :class="{ active: index === active }"
84
92
  >
85
93
  <span class="icon" aria-hidden="true"><UiIcon :name="item.icon" /></span>
86
94
  <span class="body"><span class="title">{{ item.title }}</span>
87
95
  <span class="description">{{ item.description }}</span></span>
88
96
  </li>
97
+ <slot />
89
98
  </ul>
90
- <div class="footer" aria-hidden="true">
91
- <kbd>↑↓</kbd> navigate · <kbd>↵</kbd> insert · <kbd>Esc</kbd> close
92
- </div>
99
+ <div class="empty" ref="empty"><slot name="empty" /></div>
100
+ <div class="footer"><slot name="footer" /></div>
93
101
  </div>
94
102
  </template>
95
103
 
@@ -128,23 +136,22 @@ useComponentHost(controllerModule.default, {
128
136
  letter-spacing: 0.05em;
129
137
  }
130
138
 
139
+ .header:not(:has(> *)), .footer:not(:has(> *)), .empty:not(:has(> *)) {
140
+ display: none;
141
+ }
142
+
143
+ .empty {
144
+ padding: var(--ui-space-3);
145
+ color: var(--ui-text-muted);
146
+ font-size: var(--ui-font-size-sm);
147
+ }
148
+
131
149
  @media (max-width: 767px) {
132
150
  .header {
133
151
  display: flex;
134
152
  }
135
153
  }
136
154
 
137
- .header-query {
138
- background: var(--ui-surface-hover);
139
- border-radius: var(--ui-radius-sm);
140
- padding: 0.1em 0.4em;
141
- font-family: var(--ui-font-family-mono, ui-monospace, monospace);
142
- font-size: var(--ui-font-size-xs);
143
- color: var(--ui-accent);
144
- text-transform: none;
145
- letter-spacing: 0;
146
- }
147
-
148
155
  .list {
149
156
  list-style: none;
150
157
  margin: 0;
@@ -249,19 +256,12 @@ useComponentHost(controllerModule.default, {
249
256
  }
250
257
 
251
258
  .footer {
252
- display: none;
253
259
  padding: var(--ui-space-2) var(--ui-space-3);
254
260
  border-top: 1px solid var(--ui-border);
255
261
  font-size: var(--ui-font-size-xs);
256
262
  color: var(--ui-text-muted);
257
263
  }
258
264
 
259
- @media (min-width: 768px) {
260
- .footer {
261
- display: block;
262
- }
263
- }
264
-
265
265
  [data-component~="ui-editor-slash-menu"] kbd {
266
266
  display: inline-flex;
267
267
  align-items: center;