@threadlabs/looma 0.22.13 → 0.23.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 (257) hide show
  1. package/components/shared/icons.js +6 -0
  2. package/components/ui-avatar/ui-avatar.html +3 -3
  3. package/components/ui-avatar-group/ui-avatar-group.html +1 -1
  4. package/components/ui-badge/ui-badge.html +1 -1
  5. package/components/ui-button/ui-button.html +3 -3
  6. package/components/ui-callout/ui-callout.html +3 -2
  7. package/components/ui-card/ui-card.html +23 -4
  8. package/components/ui-checkbox/ui-checkbox.html +3 -3
  9. package/components/ui-combobox/ui-combobox.html +8 -8
  10. package/components/ui-context-menu/ui-context-menu.html +2 -2
  11. package/components/ui-description-list/ui-description-list.html +1 -1
  12. package/components/ui-dialog/ui-dialog.html +3 -3
  13. package/components/ui-disclosure/ui-disclosure.html +43 -3
  14. package/components/ui-editable/ui-editable.html +2 -2
  15. package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.html +5 -5
  16. package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +2 -2
  17. package/components/ui-editor-slash-menu/ui-editor-slash-menu.html +6 -6
  18. package/components/ui-editor-slash-menu-item/ui-editor-slash-menu-item.html +1 -1
  19. package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.html +2 -2
  20. package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +11 -11
  21. package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +5 -5
  22. package/components/ui-editor-toolbar/ui-editor-toolbar.html +4 -4
  23. package/components/ui-floating-action-button/ui-floating-action-button.html +2 -2
  24. package/components/ui-icon/ui-icon.html +6 -0
  25. package/components/ui-icon-button/ui-icon-button.html +1 -1
  26. package/components/ui-input/ui-input.html +9 -4
  27. package/components/ui-input-group/ui-input-group.html +21 -6
  28. package/components/ui-list/ui-list.html +1 -1
  29. package/components/ui-list-item/ui-list-item.html +20 -4
  30. package/components/ui-listbox/ui-listbox.html +3 -3
  31. package/components/ui-menu/ui-menu.html +2 -2
  32. package/components/ui-menu-item/ui-menu-item.html +4 -4
  33. package/components/ui-meter/ui-meter.html +1 -1
  34. package/components/ui-nav-item/ui-nav-item.html +46 -14
  35. package/components/ui-popover/ui-popover.html +16 -1
  36. package/components/ui-radio/ui-radio.html +2 -2
  37. package/components/ui-scroll-area/ui-scroll-area.html +12 -0
  38. package/components/ui-search-result-row/ui-search-result-row.html +24 -5
  39. package/components/ui-search-shell/ui-search-shell.html +4 -4
  40. package/components/ui-section/ui-section.html +3 -3
  41. package/components/ui-select/ui-select.html +6 -2
  42. package/components/ui-separator/ui-separator.html +2 -2
  43. package/components/ui-sidebar/ui-sidebar.html +3 -3
  44. package/components/ui-stack/ui-stack.html +6 -3
  45. package/components/ui-status-message/ui-status-message.html +1 -1
  46. package/components/ui-switch/ui-switch.html +3 -3
  47. package/components/ui-table/ui-table.html +3 -3
  48. package/components/ui-tabs/ui-tabs.html +7 -7
  49. package/components/ui-text/ui-text.html +12 -0
  50. package/components/ui-textarea/ui-textarea.html +6 -2
  51. package/components/ui-toast/ui-toast.html +2 -2
  52. package/components/ui-toast-region/ui-toast-region.html +5 -5
  53. package/components/ui-tooltip/ui-tooltip.html +15 -15
  54. package/components/ui-top-bar/ui-top-bar.html +1 -1
  55. package/components/ui-tree-item/ui-tree-item.html +27 -8
  56. package/dist/index.js +1 -1
  57. package/editor/chunks/extensions.js +55 -2
  58. package/editor/extensions/index.d.ts +1 -0
  59. package/editor/extensions/index.js +2 -2
  60. package/editor/extensions/preset.d.ts +2 -0
  61. package/editor/extensions/relative-links.d.ts +8 -0
  62. package/editor/icons.d.ts +6 -0
  63. package/editor/index.js +9 -3
  64. package/package.json +1 -1
  65. package/styles/ui-avatar-group.css +1 -1
  66. package/styles/ui-avatar.css +3 -3
  67. package/styles/ui-badge.css +1 -1
  68. package/styles/ui-button.css +3 -3
  69. package/styles/ui-callout.css +3 -2
  70. package/styles/ui-card.css +19 -2
  71. package/styles/ui-checkbox.css +3 -3
  72. package/styles/ui-combobox.css +8 -8
  73. package/styles/ui-context-menu.css +2 -2
  74. package/styles/ui-description-list.css +1 -1
  75. package/styles/ui-dialog.css +3 -3
  76. package/styles/ui-disclosure.css +42 -2
  77. package/styles/ui-editable.css +2 -2
  78. package/styles/ui-editor-insert-table-grid.css +5 -5
  79. package/styles/ui-editor-mention-menu.css +2 -2
  80. package/styles/ui-editor-slash-menu-item.css +1 -1
  81. package/styles/ui-editor-slash-menu.css +6 -6
  82. package/styles/ui-editor-table-context-menu.css +2 -2
  83. package/styles/ui-editor-table-overlay.css +11 -11
  84. package/styles/ui-editor-table-toolbar.css +5 -5
  85. package/styles/ui-editor-toolbar.css +4 -4
  86. package/styles/ui-floating-action-button.css +2 -2
  87. package/styles/ui-icon-button.css +1 -1
  88. package/styles/ui-input-group.css +19 -6
  89. package/styles/ui-input.css +9 -4
  90. package/styles/ui-list-item.css +23 -4
  91. package/styles/ui-list.css +1 -1
  92. package/styles/ui-listbox.css +3 -3
  93. package/styles/ui-menu-item.css +4 -4
  94. package/styles/ui-menu.css +2 -2
  95. package/styles/ui-meter.css +1 -1
  96. package/styles/ui-nav-item.css +46 -12
  97. package/styles/ui-popover.css +14 -1
  98. package/styles/ui-radio.css +2 -2
  99. package/styles/ui-scroll-area.css +10 -0
  100. package/styles/ui-search-result-row.css +25 -5
  101. package/styles/ui-search-shell.css +4 -4
  102. package/styles/ui-section.css +3 -3
  103. package/styles/ui-select.css +6 -2
  104. package/styles/ui-separator.css +2 -2
  105. package/styles/ui-sidebar.css +3 -3
  106. package/styles/ui-stack.css +3 -0
  107. package/styles/ui-status-message.css +1 -1
  108. package/styles/ui-switch.css +3 -3
  109. package/styles/ui-table.css +3 -3
  110. package/styles/ui-tabs.css +7 -7
  111. package/styles/ui-text.css +8 -0
  112. package/styles/ui-textarea.css +6 -2
  113. package/styles/ui-toast-region.css +5 -5
  114. package/styles/ui-toast.css +2 -2
  115. package/styles/ui-tooltip.css +15 -15
  116. package/styles/ui-top-bar.css +1 -1
  117. package/styles/ui-tree-item.css +32 -8
  118. package/tokens.css +30 -9
  119. package/vanilla/UiCard.d.ts +2 -1
  120. package/vanilla/UiCard.js +1 -1
  121. package/vanilla/UiDisclosure.d.ts +1 -0
  122. package/vanilla/UiDisclosure.js +10 -1
  123. package/vanilla/UiIcon.js +1 -1
  124. package/vanilla/UiInputGroup.d.ts +1 -0
  125. package/vanilla/UiInputGroup.js +1 -1
  126. package/vanilla/UiNavItem.d.ts +2 -0
  127. package/vanilla/UiNavItem.js +1 -1
  128. package/vanilla/UiPopover.d.ts +1 -0
  129. package/vanilla/UiPopover.js +1 -1
  130. package/vanilla/UiScrollArea.d.ts +1 -0
  131. package/vanilla/UiScrollArea.js +1 -1
  132. package/vanilla/UiSearchResultRow.d.ts +1 -0
  133. package/vanilla/UiSearchResultRow.js +1 -1
  134. package/vanilla/UiStack.d.ts +1 -1
  135. package/vanilla/UiStack.js +1 -1
  136. package/vanilla/UiText.d.ts +2 -0
  137. package/vanilla/UiText.js +1 -1
  138. package/vue/UiAvatar.vue +3 -3
  139. package/vue/UiAvatarGroup.vue +1 -1
  140. package/vue/UiBadge.vue +2 -1
  141. package/vue/UiButton.vue +3 -3
  142. package/vue/UiCallout.vue +2 -2
  143. package/vue/UiCard.d.ts +12 -3
  144. package/vue/UiCard.vue +51 -7
  145. package/vue/UiCheckbox.vue +3 -3
  146. package/vue/UiCombobox.vue +11 -8
  147. package/vue/UiContextMenu.vue +2 -2
  148. package/vue/UiDescriptionList.vue +1 -1
  149. package/vue/UiDialog.vue +4 -3
  150. package/vue/UiDisclosure.d.ts +13 -2
  151. package/vue/UiDisclosure.vue +61 -4
  152. package/vue/UiEditable.vue +2 -2
  153. package/vue/UiEditorInsertTableGrid.vue +5 -5
  154. package/vue/UiEditorMentionMenu.vue +2 -2
  155. package/vue/UiEditorSlashMenu.vue +6 -6
  156. package/vue/UiEditorSlashMenuItem.vue +1 -1
  157. package/vue/UiEditorTableContextMenu.vue +2 -2
  158. package/vue/UiEditorTableOverlay.vue +11 -11
  159. package/vue/UiEditorTableToolbar.vue +5 -5
  160. package/vue/UiEditorToolbar.vue +6 -4
  161. package/vue/UiFloatingActionButton.vue +2 -2
  162. package/vue/UiIcon.vue +31 -0
  163. package/vue/UiIconButton.vue +1 -1
  164. package/vue/UiInput.vue +8 -4
  165. package/vue/UiInputGroup.d.ts +9 -0
  166. package/vue/UiInputGroup.vue +39 -8
  167. package/vue/UiList.vue +1 -1
  168. package/vue/UiListItem.vue +20 -4
  169. package/vue/UiListbox.vue +3 -3
  170. package/vue/UiMenu.vue +3 -2
  171. package/vue/UiMenuItem.vue +4 -4
  172. package/vue/UiMeter.vue +1 -1
  173. package/vue/UiNavItem.d.ts +18 -0
  174. package/vue/UiNavItem.vue +96 -12
  175. package/vue/UiPopover.d.ts +9 -0
  176. package/vue/UiPopover.vue +45 -3
  177. package/vue/UiRadio.vue +2 -2
  178. package/vue/UiScrollArea.d.ts +9 -0
  179. package/vue/UiScrollArea.vue +35 -2
  180. package/vue/UiSearchResultRow.d.ts +9 -0
  181. package/vue/UiSearchResultRow.vue +51 -6
  182. package/vue/UiSearchShell.vue +4 -4
  183. package/vue/UiSection.vue +3 -3
  184. package/vue/UiSelect.vue +3 -2
  185. package/vue/UiSeparator.vue +4 -2
  186. package/vue/UiSidebar.vue +5 -3
  187. package/vue/UiStack.d.ts +3 -3
  188. package/vue/UiStack.vue +10 -4
  189. package/vue/UiStatusMessage.vue +1 -1
  190. package/vue/UiSwitch.vue +3 -3
  191. package/vue/UiTable.vue +3 -3
  192. package/vue/UiTabs.vue +8 -7
  193. package/vue/UiText.d.ts +18 -0
  194. package/vue/UiText.vue +70 -0
  195. package/vue/UiTextarea.vue +2 -2
  196. package/vue/UiToast.vue +4 -2
  197. package/vue/UiToastRegion.vue +5 -5
  198. package/vue/UiTooltip.vue +19 -15
  199. package/vue/UiTopBar.vue +1 -1
  200. package/vue/UiTreeItem.vue +31 -8
  201. package/vue/chunks/UiAvatar.js +1 -1
  202. package/vue/chunks/UiAvatarGroup.js +1 -1
  203. package/vue/chunks/UiBadge.js +1 -1
  204. package/vue/chunks/UiButton.js +1 -1
  205. package/vue/chunks/UiCallout.js +1 -1
  206. package/vue/chunks/UiCard.js +39 -3
  207. package/vue/chunks/UiCheckbox.js +1 -1
  208. package/vue/chunks/UiCombobox.js +1 -1
  209. package/vue/chunks/UiContextMenu.js +1 -1
  210. package/vue/chunks/UiDescriptionList.js +1 -1
  211. package/vue/chunks/UiDialog.js +1 -1
  212. package/vue/chunks/UiDisclosure.js +27 -4
  213. package/vue/chunks/UiEditable.js +1 -1
  214. package/vue/chunks/UiEditorInsertTableGrid.js +1 -1
  215. package/vue/chunks/UiEditorMentionMenu.js +1 -1
  216. package/vue/chunks/UiEditorSlashMenu.js +1 -1
  217. package/vue/chunks/UiEditorSlashMenuItem.js +1 -1
  218. package/vue/chunks/UiEditorTableContextMenu.js +1 -1
  219. package/vue/chunks/UiEditorTableOverlay.js +1 -1
  220. package/vue/chunks/UiEditorTableToolbar.js +1 -1
  221. package/vue/chunks/UiEditorToolbar.js +1 -1
  222. package/vue/chunks/UiFloatingActionButton.js +1 -1
  223. package/vue/chunks/UiIcon.js +92 -1
  224. package/vue/chunks/UiIconButton.js +1 -1
  225. package/vue/chunks/UiInput.js +1 -1
  226. package/vue/chunks/UiInputGroup.js +59 -22
  227. package/vue/chunks/UiList.js +1 -1
  228. package/vue/chunks/UiListItem.js +1 -1
  229. package/vue/chunks/UiListbox.js +1 -1
  230. package/vue/chunks/UiMenu.js +1 -1
  231. package/vue/chunks/UiMenuItem.js +1 -1
  232. package/vue/chunks/UiMeter.js +1 -1
  233. package/vue/chunks/UiNavItem.js +65 -6
  234. package/vue/chunks/UiPopover.js +37 -5
  235. package/vue/chunks/UiRadio.js +1 -1
  236. package/vue/chunks/UiScrollArea.js +66 -23
  237. package/vue/chunks/UiSearchResultRow.js +28 -2
  238. package/vue/chunks/UiSearchShell.js +1 -1
  239. package/vue/chunks/UiSection.js +1 -1
  240. package/vue/chunks/UiSelect.js +1 -1
  241. package/vue/chunks/UiSeparator.js +1 -1
  242. package/vue/chunks/UiSidebar.js +1 -1
  243. package/vue/chunks/UiStack.js +3 -2
  244. package/vue/chunks/UiStatusMessage.js +1 -1
  245. package/vue/chunks/UiSwitch.js +1 -1
  246. package/vue/chunks/UiTable.js +1 -1
  247. package/vue/chunks/UiTabs.js +1 -1
  248. package/vue/chunks/UiText.js +92 -4
  249. package/vue/chunks/UiTextarea.js +1 -1
  250. package/vue/chunks/UiToast.js +1 -1
  251. package/vue/chunks/UiToastRegion.js +1 -1
  252. package/vue/chunks/UiTooltip.js +1 -1
  253. package/vue/chunks/UiTopBar.js +1 -1
  254. package/vue/chunks/UiTreeItem.js +1 -1
  255. package/vue/components.css +1431 -1429
  256. package/vue/editor/LoomaEditor.d.ts +11 -0
  257. package/vue/editor/index.js +261 -145
@@ -7,6 +7,7 @@ import { dropCursor } from "@tiptap/pm/dropcursor";
7
7
  import { gapCursor } from "@tiptap/pm/gapcursor";
8
8
  import { createLowlight } from "lowlight";
9
9
  import { DOMParser, Node as Node$2, Slice } from "@tiptap/pm/model";
10
+ import { Mapping } from "@tiptap/pm/transform";
10
11
  import MarkdownIt from "markdown-it";
11
12
  import { CellSelection, TableMap, addColumn, addColumnAfter, addColumnBefore, addRow, addRowAfter, addRowBefore, cellAround, columnResizing, deleteCellSelection, deleteColumn, deleteRow, deleteTable, fixTables, goToNextCell, mergeCells, moveTableColumn, moveTableRow, setCellAttr, splitCell, tableEditing, toggleHeader, toggleHeaderCell } from "@tiptap/pm/tables";
12
13
  //#region src/editor/extensions/active-block.ts
@@ -6198,6 +6199,57 @@ function createLoomaMentionExtension(options = {}) {
6198
6199
  });
6199
6200
  }
6200
6201
  //#endregion
6202
+ //#region src/editor/extensions/relative-links.ts
6203
+ /** Keep other origins and non-web schemes intact; same-origin links retain path, query, and fragment. */
6204
+ function siteRelativeHref(href, baseUrl) {
6205
+ if (!/^(https?:\/\/|\/\/)/i.test(href.trim())) return href;
6206
+ try {
6207
+ const base = new URL(baseUrl);
6208
+ const url = new URL(href, base);
6209
+ if (!/^https?:$/.test(base.protocol) || url.origin !== base.origin || url.username || url.password) return href;
6210
+ return `${url.pathname}${url.search}${url.hash}`;
6211
+ } catch {
6212
+ return href;
6213
+ }
6214
+ }
6215
+ /** Normalize newly created links in the same transaction batch, including paste rules and the picker.
6216
+ * @contract Existing document links are preserved until replaced; undo/redo keeps the original editing step.
6217
+ * @ownership The editor owns normalization; callers supply a site URL rather than a host callback.
6218
+ */
6219
+ function createSiteRelativeLinks(baseUrl) {
6220
+ const key = new PluginKey("looma-site-relative-links");
6221
+ return Extension.create({
6222
+ name: "loomaSiteRelativeLinks",
6223
+ addProseMirrorPlugins() {
6224
+ const editor = this.editor;
6225
+ return [new Plugin({
6226
+ key,
6227
+ appendTransaction(transactions, oldState, newState) {
6228
+ if (!editor.isEditable || !transactions.some((transaction) => transaction.docChanged) || transactions.some((transaction) => transaction.getMeta(key))) return null;
6229
+ const mapping = new Mapping();
6230
+ for (const transaction of transactions) mapping.appendMapping(transaction.mapping);
6231
+ const inverse = mapping.invert();
6232
+ const tr = newState.tr;
6233
+ newState.doc.descendants((node, position) => {
6234
+ if (!node.isText) return;
6235
+ const mark = node.marks.find((candidate) => candidate.type.name === "link");
6236
+ if (!mark || typeof mark.attrs.href !== "string") return;
6237
+ const href = siteRelativeHref(mark.attrs.href, baseUrl);
6238
+ if (href === mark.attrs.href) return;
6239
+ const before = inverse.mapResult(position, 1);
6240
+ if ((before.deleted ? null : oldState.doc.nodeAt(before.pos)?.marks.find((candidate) => candidate.type.name === "link"))?.attrs.href === mark.attrs.href) return;
6241
+ tr.addMark(position, position + node.nodeSize, mark.type.create({
6242
+ ...mark.attrs,
6243
+ href
6244
+ }));
6245
+ });
6246
+ return tr.docChanged ? tr.setMeta(key, true) : null;
6247
+ }
6248
+ })];
6249
+ }
6250
+ });
6251
+ }
6252
+ //#endregion
6201
6253
  //#region ../../node_modules/.pnpm/dompurify@3.4.15/node_modules/dompurify/dist/purify.es.mjs
6202
6254
  /*! @license DOMPurify 3.4.15 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.15/LICENSE */
6203
6255
  function _arrayLikeToArray(r, a) {
@@ -9290,7 +9342,7 @@ function getLoomaTableExtensions() {
9290
9342
  * the code and explicit language stay in the document schema.
9291
9343
  */
9292
9344
  function getDefaultEditorExtensions(options = {}) {
9293
- const { placeholder = "Type “/” for commands, or start writing…", linkOpenOnClick = false, imageInline = false, mention = createLoomaMentionExtension(), disableHighlight = false, codeLanguages, codeLowlight, codeBlockNodeView } = options;
9345
+ const { placeholder = "Type “/” for commands, or start writing…", linkOpenOnClick = false, linkBaseUrl, imageInline = false, mention = createLoomaMentionExtension(), disableHighlight = false, codeLanguages, codeLowlight, codeBlockNodeView } = options;
9294
9346
  const codeBlock = LoomaCodeBlock.configure({ lowlight: codeLowlight ?? createLowlight(codeLanguages) });
9295
9347
  return [
9296
9348
  Document,
@@ -9325,6 +9377,7 @@ function getDefaultEditorExtensions(options = {}) {
9325
9377
  target: "_blank"
9326
9378
  }
9327
9379
  }),
9380
+ ...linkBaseUrl ? [createSiteRelativeLinks(linkBaseUrl)] : [],
9328
9381
  Image.configure({ inline: imageInline }),
9329
9382
  (disableHighlight ? StoredOnlyHighlight : Highlight).configure({ multicolor: false }),
9330
9383
  Code,
@@ -10103,4 +10156,4 @@ function createLoomaSlashCommandExtension(options = {}) {
10103
10156
  });
10104
10157
  }
10105
10158
  //#endregion
10106
- export { LOOMA_CALLOUT_TONES as A, DEFAULT_MENTION_RESULT_LIMIT as C, LOOMA_CHIP_COLORS as D, normalizeMentionResultLimit as E, LoomaActiveBlock as F, LoomaActiveBlockPluginKey as I, LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS as M, LOOMA_ACTIVE_BLOCK_CLASS as N, LoomaChip as O, LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS as P, createLoomaMentionExtension as S, filterLoomaMentionItems as T, getActiveTableCellBackground as _, handleTableAction as a, LoomaSmartPaste as b, normalizeActiveTableColumnWidths as c, getDefaultEditorExtensions as d, getLoomaTableExtensions as f, getActiveTableCellAlignment as g, LoomaTableHeader as h, getActiveTableUiState as i, LoomaCallout as j, normalizeLoomaChipColor as k, shouldShowTextFormattingToolbar as l, LoomaTableCell as m, createLoomaSlashCommandExtension as n, handleTableOverlayAction as o, LoomaTable as p, getDefaultSlashCommands as r, insertTableAtRange as s, LoomaSlashCommand as t, LoomaTableKit as u, setActiveTableCellAlignment as v, MAX_MENTION_RESULT_LIMIT as w, LoomaMentionSuggestionPluginKey as x, setActiveTableCellBackground as y };
10159
+ export { LoomaChip as A, LoomaMentionSuggestionPluginKey as C, filterLoomaMentionItems as D, MAX_MENTION_RESULT_LIMIT as E, LOOMA_ACTIVE_BLOCK_CLASS as F, LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS as I, LoomaActiveBlock as L, LOOMA_CALLOUT_TONES as M, LoomaCallout as N, normalizeMentionResultLimit as O, LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS as P, LoomaActiveBlockPluginKey as R, siteRelativeHref as S, DEFAULT_MENTION_RESULT_LIMIT as T, getActiveTableCellBackground as _, handleTableAction as a, LoomaSmartPaste as b, normalizeActiveTableColumnWidths as c, getDefaultEditorExtensions as d, getLoomaTableExtensions as f, getActiveTableCellAlignment as g, LoomaTableHeader as h, getActiveTableUiState as i, normalizeLoomaChipColor as j, LOOMA_CHIP_COLORS as k, shouldShowTextFormattingToolbar as l, LoomaTableCell as m, createLoomaSlashCommandExtension as n, handleTableOverlayAction as o, LoomaTable as p, getDefaultSlashCommands as r, insertTableAtRange as s, LoomaSlashCommand as t, LoomaTableKit as u, setActiveTableCellAlignment as v, createLoomaMentionExtension as w, createSiteRelativeLinks as x, setActiveTableCellBackground as y };
@@ -15,3 +15,4 @@ export { getActiveTableUiState, handleTableAction, handleTableOverlayAction, ins
15
15
  export { LoomaTable, getActiveTableCellAlignment, getActiveTableCellBackground, LoomaTableCell, LoomaTableHeader, setActiveTableCellAlignment, setActiveTableCellBackground, TABLE_CELL_BACKGROUND_PRESETS, type TableCellAlignment, type TableCellBackground, } from "./table-formatting.js";
16
16
  export { createLoomaMentionExtension, DEFAULT_MENTION_RESULT_LIMIT, filterLoomaMentionItems, LoomaMentionSuggestionPluginKey, MAX_MENTION_RESULT_LIMIT, normalizeMentionResultLimit, type LoomaMentionItem, type LoomaMentionMenuSnapshot, type LoomaMentionOptions, type LoomaMentionProvider, type LoomaMentionProviderContext, } from "./mention.js";
17
17
  export { createLoomaSlashCommandExtension, getDefaultSlashCommands, LoomaSlashCommand, type LoomaSlashCommand as LoomaSlashCommandItem, type LoomaSlashCommandContext, type LoomaSlashCommandOptions, type LoomaSlashMenuSnapshot, } from "./slash-command.js";
18
+ export { siteRelativeHref, createSiteRelativeLinks } from "./relative-links.js";
@@ -1,3 +1,3 @@
1
1
  import { n as TABLE_CELL_BACKGROUND_PRESETS } from "../chunks/table-backgrounds.js";
2
- import { A as LOOMA_CALLOUT_TONES, C as DEFAULT_MENTION_RESULT_LIMIT, D as LOOMA_CHIP_COLORS, E as normalizeMentionResultLimit, F as LoomaActiveBlock, I as LoomaActiveBlockPluginKey, M as LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, N as LOOMA_ACTIVE_BLOCK_CLASS, O as LoomaChip, P as LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, S as createLoomaMentionExtension, T as filterLoomaMentionItems, _ as getActiveTableCellBackground, a as handleTableAction, b as LoomaSmartPaste, c as normalizeActiveTableColumnWidths, d as getDefaultEditorExtensions, f as getLoomaTableExtensions, g as getActiveTableCellAlignment, h as LoomaTableHeader, i as getActiveTableUiState, j as LoomaCallout, k as normalizeLoomaChipColor, l as shouldShowTextFormattingToolbar, m as LoomaTableCell, n as createLoomaSlashCommandExtension, o as handleTableOverlayAction, p as LoomaTable, r as getDefaultSlashCommands, s as insertTableAtRange, t as LoomaSlashCommand, u as LoomaTableKit, v as setActiveTableCellAlignment, w as MAX_MENTION_RESULT_LIMIT, x as LoomaMentionSuggestionPluginKey, y as setActiveTableCellBackground } from "../chunks/extensions.js";
3
- export { DEFAULT_MENTION_RESULT_LIMIT, LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, LOOMA_ACTIVE_BLOCK_CLASS, LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, LOOMA_CALLOUT_TONES, LOOMA_CHIP_COLORS, LoomaActiveBlock, LoomaActiveBlockPluginKey, LoomaCallout, LoomaChip, LoomaMentionSuggestionPluginKey, LoomaSlashCommand, LoomaSmartPaste, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, MAX_MENTION_RESULT_LIMIT, TABLE_CELL_BACKGROUND_PRESETS, createLoomaMentionExtension, createLoomaSlashCommandExtension, filterLoomaMentionItems, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, handleTableAction, handleTableOverlayAction, insertTableAtRange, normalizeActiveTableColumnWidths, normalizeLoomaChipColor, normalizeMentionResultLimit, setActiveTableCellAlignment, setActiveTableCellBackground, shouldShowTextFormattingToolbar };
2
+ import { A as LoomaChip, C as LoomaMentionSuggestionPluginKey, D as filterLoomaMentionItems, E as MAX_MENTION_RESULT_LIMIT, F as LOOMA_ACTIVE_BLOCK_CLASS, I as LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, L as LoomaActiveBlock, M as LOOMA_CALLOUT_TONES, N as LoomaCallout, O as normalizeMentionResultLimit, P as LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, R as LoomaActiveBlockPluginKey, S as siteRelativeHref, T as DEFAULT_MENTION_RESULT_LIMIT, _ as getActiveTableCellBackground, a as handleTableAction, b as LoomaSmartPaste, c as normalizeActiveTableColumnWidths, d as getDefaultEditorExtensions, f as getLoomaTableExtensions, g as getActiveTableCellAlignment, h as LoomaTableHeader, i as getActiveTableUiState, j as normalizeLoomaChipColor, k as LOOMA_CHIP_COLORS, l as shouldShowTextFormattingToolbar, m as LoomaTableCell, n as createLoomaSlashCommandExtension, o as handleTableOverlayAction, p as LoomaTable, r as getDefaultSlashCommands, s as insertTableAtRange, t as LoomaSlashCommand, u as LoomaTableKit, v as setActiveTableCellAlignment, w as createLoomaMentionExtension, x as createSiteRelativeLinks, y as setActiveTableCellBackground } from "../chunks/extensions.js";
3
+ export { DEFAULT_MENTION_RESULT_LIMIT, LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, LOOMA_ACTIVE_BLOCK_CLASS, LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, LOOMA_CALLOUT_TONES, LOOMA_CHIP_COLORS, LoomaActiveBlock, LoomaActiveBlockPluginKey, LoomaCallout, LoomaChip, LoomaMentionSuggestionPluginKey, LoomaSlashCommand, LoomaSmartPaste, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, MAX_MENTION_RESULT_LIMIT, TABLE_CELL_BACKGROUND_PRESETS, createLoomaMentionExtension, createLoomaSlashCommandExtension, createSiteRelativeLinks, filterLoomaMentionItems, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, handleTableAction, handleTableOverlayAction, insertTableAtRange, normalizeActiveTableColumnWidths, normalizeLoomaChipColor, normalizeMentionResultLimit, setActiveTableCellAlignment, setActiveTableCellBackground, shouldShowTextFormattingToolbar, siteRelativeHref };
@@ -16,6 +16,8 @@ export interface DefaultEditorExtensionsOptions {
16
16
  placeholder?: string;
17
17
  /** Passed to Tiptap Link; defaults false to keep editing clicks in the editor. */
18
18
  linkOpenOnClick?: boolean;
19
+ /** Site origin whose newly inserted links become relative, across paste and editor commands. */
20
+ linkBaseUrl?: string;
19
21
  /** Passed to Tiptap Image; block images are the default document policy. */
20
22
  imageInline?: boolean;
21
23
  /** Custom mention extension, the Looma default, or false to omit mentions. */
@@ -0,0 +1,8 @@
1
+ import { Extension } from '@tiptap/core';
2
+ /** Keep other origins and non-web schemes intact; same-origin links retain path, query, and fragment. */
3
+ export declare function siteRelativeHref(href: string, baseUrl: string): string;
4
+ /** Normalize newly created links in the same transaction batch, including paste rules and the picker.
5
+ * @contract Existing document links are preserved until replaced; undo/redo keeps the original editing step.
6
+ * @ownership The editor owns normalization; callers supply a site URL rather than a host callback.
7
+ */
8
+ export declare function createSiteRelativeLinks(baseUrl: string): Extension<any, any>;
package/editor/icons.d.ts CHANGED
@@ -7,6 +7,10 @@ export declare const LOOMA_ICONS: {
7
7
  'arrow-left': IconNode;
8
8
  bold: IconNode;
9
9
  'book-user': IconNode;
10
+ search: IconNode;
11
+ 'external-link': IconNode;
12
+ pencil: IconNode;
13
+ unlink: IconNode;
10
14
  braces: IconNode;
11
15
  calculator: IconNode;
12
16
  check: IconNode;
@@ -18,6 +22,7 @@ export declare const LOOMA_ICONS: {
18
22
  'chevron-right': IconNode;
19
23
  'code-xml': IconNode;
20
24
  columns: IconNode;
25
+ compass: IconNode;
21
26
  'credit-card': IconNode;
22
27
  ellipsis: IconNode;
23
28
  eraser: IconNode;
@@ -30,6 +35,7 @@ export declare const LOOMA_ICONS: {
30
35
  'heading-3': IconNode;
31
36
  help: IconNode;
32
37
  highlighter: IconNode;
38
+ history: IconNode;
33
39
  image: IconNode;
34
40
  info: IconNode;
35
41
  italic: IconNode;
package/editor/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { n as TABLE_CELL_BACKGROUND_PRESETS, t as TABLE_CELL_BACKGROUND_OPTIONS } from "./chunks/table-backgrounds.js";
2
2
  import { n as resolveTableCellAt, t as measureTableOverlayGeometry } from "./chunks/ui.js";
3
- import { A as LOOMA_CALLOUT_TONES, C as DEFAULT_MENTION_RESULT_LIMIT, D as LOOMA_CHIP_COLORS, E as normalizeMentionResultLimit, F as LoomaActiveBlock, I as LoomaActiveBlockPluginKey, M as LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, N as LOOMA_ACTIVE_BLOCK_CLASS, O as LoomaChip, P as LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, S as createLoomaMentionExtension, T as filterLoomaMentionItems, _ as getActiveTableCellBackground, a as handleTableAction, b as LoomaSmartPaste, c as normalizeActiveTableColumnWidths, d as getDefaultEditorExtensions, f as getLoomaTableExtensions, g as getActiveTableCellAlignment, h as LoomaTableHeader, i as getActiveTableUiState, j as LoomaCallout, k as normalizeLoomaChipColor, l as shouldShowTextFormattingToolbar, m as LoomaTableCell, n as createLoomaSlashCommandExtension, o as handleTableOverlayAction, p as LoomaTable, r as getDefaultSlashCommands, s as insertTableAtRange, t as LoomaSlashCommand, u as LoomaTableKit, v as setActiveTableCellAlignment, w as MAX_MENTION_RESULT_LIMIT, x as LoomaMentionSuggestionPluginKey, y as setActiveTableCellBackground } from "./chunks/extensions.js";
4
- import { AlignCenter, AlignLeft, AlignRight, ArrowLeft, Bold, BookUser, Braces, Calculator, Check, ChevronDown, ChevronLeft, ChevronRight, CircleCheck, CircleDot, CircleQuestionMark, CircleX, CodeXml, Columns3, CreditCard, Ellipsis, Eraser, FileText, Folder, GripHorizontal, GripVertical, Heading1, Heading2, Heading3, Highlighter, Image, Info, Italic, LayoutDashboard, Link, List, ListOrdered, ListTodo, LoaderCircle, Merge, Minus, NotebookPen, PaintBucket, PanelBottom, PanelLeft, PanelRight, PanelTop, Pilcrow, Plus, Quote, Receipt, Redo2, Rows3, Settings, Split, Strikethrough, Table2, Tag, Trash2, TriangleAlert, Truck, Underline, Undo2, UserRound, Users, X } from "lucide";
3
+ import { A as LoomaChip, C as LoomaMentionSuggestionPluginKey, D as filterLoomaMentionItems, E as MAX_MENTION_RESULT_LIMIT, F as LOOMA_ACTIVE_BLOCK_CLASS, I as LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, L as LoomaActiveBlock, M as LOOMA_CALLOUT_TONES, N as LoomaCallout, O as normalizeMentionResultLimit, P as LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, R as LoomaActiveBlockPluginKey, S as siteRelativeHref, T as DEFAULT_MENTION_RESULT_LIMIT, _ as getActiveTableCellBackground, a as handleTableAction, b as LoomaSmartPaste, c as normalizeActiveTableColumnWidths, d as getDefaultEditorExtensions, f as getLoomaTableExtensions, g as getActiveTableCellAlignment, h as LoomaTableHeader, i as getActiveTableUiState, j as normalizeLoomaChipColor, k as LOOMA_CHIP_COLORS, l as shouldShowTextFormattingToolbar, m as LoomaTableCell, n as createLoomaSlashCommandExtension, o as handleTableOverlayAction, p as LoomaTable, r as getDefaultSlashCommands, s as insertTableAtRange, t as LoomaSlashCommand, u as LoomaTableKit, v as setActiveTableCellAlignment, w as createLoomaMentionExtension, x as createSiteRelativeLinks, y as setActiveTableCellBackground } from "./chunks/extensions.js";
4
+ import { AlignCenter, AlignLeft, AlignRight, ArrowLeft, Bold, BookUser, Braces, Calculator, Check, ChevronDown, ChevronLeft, ChevronRight, CircleCheck, CircleDot, CircleQuestionMark, CircleX, CodeXml, Columns3, Compass, CreditCard, Ellipsis, Eraser, ExternalLink, FileText, Folder, GripHorizontal, GripVertical, Heading1, Heading2, Heading3, Highlighter, History, Image, Info, Italic, LayoutDashboard, Link, List, ListOrdered, ListTodo, LoaderCircle, Merge, Minus, NotebookPen, PaintBucket, PanelBottom, PanelLeft, PanelRight, PanelTop, Pencil, Pilcrow, Plus, Quote, Receipt, Redo2, Rows3, Search, Settings, Split, Strikethrough, Table2, Tag, Trash2, TriangleAlert, Truck, Underline, Undo2, Unlink, UserRound, Users, X } from "lucide";
5
5
  //#region src/editor/icons.ts
6
6
  /** The opinionated Lucide set used by Looma's shipped interaction surfaces. */
7
7
  var LOOMA_ICONS = {
@@ -11,6 +11,10 @@ var LOOMA_ICONS = {
11
11
  "arrow-left": ArrowLeft,
12
12
  bold: Bold,
13
13
  "book-user": BookUser,
14
+ "search": Search,
15
+ "external-link": ExternalLink,
16
+ "pencil": Pencil,
17
+ "unlink": Unlink,
14
18
  braces: Braces,
15
19
  calculator: Calculator,
16
20
  check: Check,
@@ -22,6 +26,7 @@ var LOOMA_ICONS = {
22
26
  "chevron-right": ChevronRight,
23
27
  "code-xml": CodeXml,
24
28
  columns: Columns3,
29
+ compass: Compass,
25
30
  "credit-card": CreditCard,
26
31
  ellipsis: Ellipsis,
27
32
  eraser: Eraser,
@@ -34,6 +39,7 @@ var LOOMA_ICONS = {
34
39
  "heading-3": Heading3,
35
40
  help: CircleQuestionMark,
36
41
  highlighter: Highlighter,
42
+ history: History,
37
43
  image: Image,
38
44
  info: Info,
39
45
  italic: Italic,
@@ -114,4 +120,4 @@ function getVisualViewportRect(owner = window) {
114
120
  };
115
121
  }
116
122
  //#endregion
117
- export { DEFAULT_MENTION_RESULT_LIMIT, LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, LOOMA_ACTIVE_BLOCK_CLASS, LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, LOOMA_CALLOUT_TONES, LOOMA_CHIP_COLORS, LOOMA_ICONS, LoomaActiveBlock, LoomaActiveBlockPluginKey, LoomaCallout, LoomaChip, LoomaMentionSuggestionPluginKey, LoomaSlashCommand, LoomaSmartPaste, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, MAX_MENTION_RESULT_LIMIT, TABLE_CELL_BACKGROUND_OPTIONS, TABLE_CELL_BACKGROUND_PRESETS, createLoomaMentionExtension, createLoomaSlashCommandExtension, filterLoomaMentionItems, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, getVisualViewportRect, handleTableAction, handleTableOverlayAction, insertTableAtRange, loomaIconMarkup, measureTableOverlayGeometry, normalizeActiveTableColumnWidths, normalizeLoomaChipColor, normalizeMentionResultLimit, resolveTableCellAt, setActiveTableCellAlignment, setActiveTableCellBackground, shouldShowTextFormattingToolbar };
123
+ export { DEFAULT_MENTION_RESULT_LIMIT, LOOMA_ACTIVE_BLOCK_BLUR_GRACE_MS, LOOMA_ACTIVE_BLOCK_CLASS, LOOMA_ACTIVE_BLOCK_TYPING_IDLE_MS, LOOMA_CALLOUT_TONES, LOOMA_CHIP_COLORS, LOOMA_ICONS, LoomaActiveBlock, LoomaActiveBlockPluginKey, LoomaCallout, LoomaChip, LoomaMentionSuggestionPluginKey, LoomaSlashCommand, LoomaSmartPaste, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, MAX_MENTION_RESULT_LIMIT, TABLE_CELL_BACKGROUND_OPTIONS, TABLE_CELL_BACKGROUND_PRESETS, createLoomaMentionExtension, createLoomaSlashCommandExtension, createSiteRelativeLinks, filterLoomaMentionItems, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, getVisualViewportRect, handleTableAction, handleTableOverlayAction, insertTableAtRange, loomaIconMarkup, measureTableOverlayGeometry, normalizeActiveTableColumnWidths, normalizeLoomaChipColor, normalizeMentionResultLimit, resolveTableCellAt, setActiveTableCellAlignment, setActiveTableCellBackground, shouldShowTextFormattingToolbar, siteRelativeHref };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.22.13",
3
+ "version": "0.23.0",
4
4
  "type": "module",
5
5
  "description": "Looma components as HTML, Vue, and plain DOM, with design tokens.",
6
6
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  inline-size: 2.5rem;
41
41
  block-size: 2.5rem;
42
42
  border-radius: var(--ui-radius-round);
43
- border: 1px solid var(--ui-border-strong);
43
+ border: var(--ui-border-width) solid var(--ui-border-strong);
44
44
  background: var(--ui-surface-elevated);
45
45
  color: var(--ui-text-primary);
46
46
  box-shadow:
@@ -30,7 +30,7 @@
30
30
  inline-size: 2.5rem;
31
31
  block-size: 2.5rem;
32
32
  border-radius: var(--ui-avatar-radius, var(--ui-radius-round));
33
- border: 1px solid var(--ui-avatar-border, color-mix(in srgb, var(--ui-accent-solid) 35%, var(--ui-surface-default)));
33
+ border: var(--ui-border-width) solid var(--ui-avatar-border, color-mix(in srgb, var(--ui-accent-solid) 35%, var(--ui-surface-default)));
34
34
  background: var(--ui-avatar-surface, var(--ui-accent-soft));
35
35
  color: var(--ui-avatar-text, var(--ui-accent-subtle-text, var(--ui-accent-solid)));
36
36
  font: inherit;
@@ -68,8 +68,8 @@
68
68
  /* An outline, not a dot: the avatar clips its content to the circle, and an outline is drawn
69
69
  outside the box, so the ring survives the clip and the overlap in an Avatar Group. */
70
70
  :scope[data-ui-avatar-state~="active"] {
71
- outline: 1px solid var(--ui-avatar-active-ring, var(--ui-accent-solid));
72
- outline-offset: 1px;
71
+ outline: var(--ui-border-width) solid var(--ui-avatar-active-ring, var(--ui-accent-solid));
72
+ outline-offset: var(--ui-border-width);
73
73
  }
74
74
 
75
75
  .fallback {
@@ -67,7 +67,7 @@
67
67
  justify-content: center;
68
68
  max-width: 100%;
69
69
  padding: var(--ui-badge-padding-block, var(--ui-space-0-5)) var(--ui-badge-padding-inline, var(--ui-space-2));
70
- border: 1px solid var(--ui-badge-border, var(--_badge-color-border, var(--_badge-border)));
70
+ border: var(--ui-border-width) solid var(--ui-badge-border, var(--_badge-color-border, var(--_badge-border)));
71
71
  border-radius: var(--ui-radius-round);
72
72
  background: var(--_badge-outline-surface);
73
73
  color: var(--ui-badge-text, var(--_badge-color-text, var(--_badge-text)));
@@ -108,7 +108,7 @@
108
108
  appearance: none;
109
109
  min-block-size: var(--ui-button-min-block-size, var(--ui-control-size-md));
110
110
  border-style: solid;
111
- border-width: 1px;
111
+ border-width: var(--ui-border-width);
112
112
  border-color: var(--ui-button-border, var(--_tone));
113
113
  border-radius: var(--ui-button-radius, var(--ui-action-radius, var(--ui-radius-md)));
114
114
  background-color: var(--ui-button-surface, oklch(from var(--_tone) l c h / 5%));
@@ -371,8 +371,8 @@
371
371
  :scope[data-ui-button-state~="variant=link"]:focus-visible {
372
372
  box-shadow: none;
373
373
  /* Fallback keeps the ring if the token is missing: an unresolved var() would void the outline. */
374
- outline: 2px solid var(--ui-focus-ring);
375
- outline-offset: 2px;
374
+ outline: var(--ui-focus-width) solid var(--ui-focus-ring);
375
+ outline-offset: var(--ui-focus-width);
376
376
  }
377
377
 
378
378
  /* A component that sets its display still honours the hidden attribute on its root. */
@@ -64,8 +64,9 @@
64
64
  padding-block: var(--ui-callout-padding-block, var(--ui-space-2));
65
65
  padding-inline-start: var(--ui-callout-padding-inline, var(--ui-space-2));
66
66
  padding-inline-end: var(--ui-callout-padding-inline, var(--ui-space-3));
67
- border: var(--ui-callout-border-width, 1px) solid color-mix(in srgb, var(--ui-callout-border, var(--_callout-border)) 35%, transparent);
68
- border-inline-start: var(--ui-callout-leading-border-width, 4px) solid var(--ui-callout-border, var(--_callout-border));
67
+ border: var(--ui-callout-border-width, var(--ui-border-width)) solid
68
+ color-mix(in srgb, var(--ui-callout-border, var(--_callout-border)) 35%, transparent);
69
+ border-inline-start: var(--ui-callout-leading-border-width, var(--ui-accent-line-width)) solid var(--ui-callout-border, var(--_callout-border));
69
70
  border-radius: var(--ui-radius-md);
70
71
  background: var(--ui-callout-surface, var(--_callout-surface));
71
72
  color: var(--ui-callout-text, var(--ui-text-primary));
@@ -9,12 +9,16 @@
9
9
  box-sizing: border-box;
10
10
  min-inline-size: 0;
11
11
  padding: var(--ui-space-5);
12
- border: 1px solid var(--ui-border-strong);
12
+ border: var(--ui-border-width) solid var(--ui-border-strong);
13
13
  border-radius: var(--ui-radius-lg);
14
14
  background: var(--ui-surface-raised);
15
15
  color: var(--ui-text-primary);
16
16
  }
17
17
 
18
+ :scope[data-ui-card-state~="padding=xs"] {
19
+ gap: var(--ui-space-1);
20
+ padding: var(--ui-space-2);
21
+ }
18
22
  :scope[data-ui-card-state~="padding=sm"] {
19
23
  gap: var(--ui-space-2);
20
24
  padding: var(--ui-space-3);
@@ -36,10 +40,23 @@
36
40
 
37
41
  :scope[data-ui-card-state~="tone=danger"] {
38
42
  border-color: color-mix(in srgb, var(--ui-danger) 45%, var(--ui-border-default));
39
- border-inline-start: 4px solid var(--ui-danger);
43
+ border-inline-start: var(--ui-accent-line-width) solid var(--ui-danger);
40
44
  background: var(--ui-danger-soft);
41
45
  }
42
46
 
47
+ :scope[data-ui-card-state~="size=sm"] {
48
+ inline-size: min(22rem, calc(100vw - var(--ui-space-2) * 2));
49
+ max-inline-size: min(22rem, calc(100vw - var(--ui-space-2) * 2));
50
+ }
51
+ :scope[data-ui-card-state~="size=md"] {
52
+ inline-size: min(28rem, calc(100vw - var(--ui-space-2) * 2));
53
+ max-inline-size: min(28rem, calc(100vw - var(--ui-space-2) * 2));
54
+ }
55
+ :scope[data-ui-card-state~="size=lg"] {
56
+ inline-size: min(36rem, calc(100vw - var(--ui-space-2) * 2));
57
+ max-inline-size: min(36rem, calc(100vw - var(--ui-space-2) * 2));
58
+ }
59
+
43
60
  /* A component that sets its display still honours the hidden attribute on its root. */
44
61
  :scope[hidden] {
45
62
  display: none;
@@ -72,7 +72,7 @@
72
72
  inline-size: var(--_ui-checkbox-size, 1.125rem);
73
73
  block-size: var(--_ui-checkbox-size, 1.125rem);
74
74
  margin: 0.125em 0 0;
75
- border: 1px solid var(--ui-control-border, var(--ui-border-strong));
75
+ border: var(--ui-border-width) solid var(--ui-control-border, var(--ui-border-strong));
76
76
  border-radius: var(--ui-radius-sm);
77
77
  background: var(--ui-control-surface, var(--ui-surface-default));
78
78
  box-shadow: var(--ui-control-inset);
@@ -134,8 +134,8 @@
134
134
  }
135
135
 
136
136
  input:focus-visible {
137
- outline: 2px solid var(--ui-focus-ring, var(--ui-accent-solid));
138
- outline-offset: 2px;
137
+ outline: var(--ui-focus-width) solid var(--ui-focus-ring, var(--ui-accent-solid));
138
+ outline-offset: var(--ui-focus-width);
139
139
  }
140
140
 
141
141
  :scope[data-ui-checkbox-state~="invalid"] input {
@@ -109,7 +109,7 @@
109
109
  flex: 1 1 auto;
110
110
  display: flex;
111
111
  min-inline-size: 0;
112
- border: 1px solid var(--ui-control-border, var(--ui-border-default));
112
+ border: var(--ui-border-width) solid var(--ui-control-border, var(--ui-border-default));
113
113
  border-radius: var(--_ui-combobox-radius, var(--ui-field-radius, var(--ui-radius-md)));
114
114
  background: var(--ui-control-surface, var(--ui-surface-default));
115
115
  box-shadow: var(--ui-control-inset);
@@ -224,7 +224,7 @@
224
224
  button:focus-visible {
225
225
  outline: none;
226
226
  background: var(--ui-surface-muted);
227
- box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ui-focus-ring) 45%, transparent);
227
+ box-shadow: inset 0 0 0 var(--ui-focus-width) color-mix(in srgb, var(--ui-focus-ring) 45%, transparent);
228
228
  }
229
229
  input:disabled, button:disabled {
230
230
  color: var(--ui-disabled-text);
@@ -245,7 +245,7 @@
245
245
  overflow: auto;
246
246
  margin: 0;
247
247
  padding: var(--ui-space-1);
248
- border: 1px solid var(--_ui-combobox-popup-border, var(--ui-overlay-border, var(--ui-border-strong)));
248
+ border: var(--ui-border-width) solid var(--_ui-combobox-popup-border, var(--ui-overlay-border, var(--ui-border-strong)));
249
249
  border-radius: var(--_ui-combobox-popup-radius, var(--ui-overlay-radius, var(--ui-radius-md)));
250
250
  background: var(--_ui-combobox-popup-surface, var(--ui-overlay-surface, var(--ui-surface-elevated)));
251
251
  color: var(--ui-text-primary);
@@ -260,7 +260,7 @@
260
260
  }
261
261
  .primary {
262
262
  display: block;
263
- color: var(--_ui-combobox-option-text, var(--ui-text-primary));
263
+ color: var(--_ui-combobox-option-text, inherit);
264
264
  font-weight: 500;
265
265
  }
266
266
  /* A row with a tag or a description: the label and its tag on one line, the description under them. */
@@ -349,7 +349,7 @@
349
349
  padding: var(--ui-space-0-5);
350
350
  }
351
351
  :scope[data-ui-combobox-state~="multiple"]:scope[data-ui-combobox-state~="size=sm"] input {
352
- min-block-size: calc(var(--_row) - 2px - 2 * var(--ui-space-0-5));
352
+ min-block-size: calc(var(--_row) - 2 * var(--ui-border-width) - 2 * var(--ui-space-0-5));
353
353
  padding: 0 var(--ui-space-1);
354
354
  }
355
355
  /* A large multiple field starts at the large control height, as sm starts at the small one. */
@@ -357,7 +357,7 @@
357
357
  min-block-size: 0;
358
358
  }
359
359
  :scope[data-ui-combobox-state~="multiple"]:scope[data-ui-combobox-state~="size=lg"] input {
360
- min-block-size: calc(var(--ui-control-size-lg) - 2px - 2 * var(--ui-space-1));
360
+ min-block-size: calc(var(--ui-control-size-lg) - 2 * var(--ui-border-width) - 2 * var(--ui-space-1));
361
361
  }
362
362
  .item {
363
363
  appearance: none;
@@ -375,8 +375,8 @@
375
375
  cursor: default;
376
376
  }
377
377
  .item:focus-visible {
378
- outline: 2px solid var(--ui-focus-ring);
379
- outline-offset: 1px;
378
+ outline: var(--ui-focus-width) solid var(--ui-focus-ring);
379
+ outline-offset: var(--ui-border-width);
380
380
  }
381
381
  .item:disabled {
382
382
  color: var(--ui-disabled-text);
@@ -42,7 +42,7 @@
42
42
  box-sizing: border-box;
43
43
  padding: var(--ui-space-1);
44
44
  background: var(--_ui-context-menu-surface, var(--ui-overlay-surface, var(--ui-surface-elevated)));
45
- border: 1px solid var(--_ui-context-menu-border, var(--ui-overlay-border, var(--ui-border-strong)));
45
+ border: var(--ui-border-width) solid var(--_ui-context-menu-border, var(--ui-overlay-border, var(--ui-border-strong)));
46
46
  border-radius: var(--_ui-context-menu-radius, var(--ui-overlay-radius, var(--ui-radius-lg)));
47
47
  box-shadow: var(--_ui-context-menu-shadow, var(--ui-overlay-shadow, var(--ui-elevation-overlay, var(--ui-shadow-lg))));
48
48
  outline: 0;
@@ -63,7 +63,7 @@
63
63
  block-size: 0;
64
64
  margin: var(--ui-space-1) 0;
65
65
  border: 0;
66
- border-block-start: 1px solid var(--ui-border-divider);
66
+ border-block-start: var(--ui-border-width) solid var(--ui-border-divider);
67
67
  }
68
68
 
69
69
  .menu:popover-open {
@@ -41,7 +41,7 @@
41
41
  --_ui-description-align: flex-start;
42
42
  --_ui-description-value-size: var(--ui-font-size-lg);
43
43
  --_ui-description-padding: var(--_tile-padding);
44
- --_ui-description-border-width: 1px;
44
+ --_ui-description-border-width: var(--ui-border-width);
45
45
  --_ui-description-border-color: var(--ui-border-strong);
46
46
  --_gap: var(--ui-space-3);
47
47
  --_gap-compact: var(--ui-space-2);
@@ -59,7 +59,7 @@
59
59
  overflow: hidden;
60
60
  flex-direction: column;
61
61
  background: var(--ui-dialog-surface, var(--ui-overlay-surface, var(--ui-surface-elevated)));
62
- border: 1px solid var(--ui-dialog-border, var(--ui-overlay-border, var(--ui-border-strong)));
62
+ border: var(--ui-border-width) solid var(--ui-dialog-border, var(--ui-overlay-border, var(--ui-border-strong)));
63
63
  border-radius: var(--ui-dialog-radius, var(--ui-overlay-radius, var(--ui-radius-dialog)));
64
64
  box-shadow: var(--ui-dialog-shadow, var(--ui-overlay-shadow, var(--ui-elevation-dialog, var(--ui-shadow-xl))));
65
65
  visibility: hidden;
@@ -165,8 +165,8 @@
165
165
  }
166
166
 
167
167
  .close:focus-visible {
168
- outline: 2px solid var(--ui-focus-ring);
169
- outline-offset: 2px;
168
+ outline: var(--ui-focus-width) solid var(--ui-focus-ring);
169
+ outline-offset: var(--ui-focus-width);
170
170
  }
171
171
 
172
172
  /* A touch target, like Button on coarse pointers. */
@@ -38,7 +38,7 @@
38
38
  display: block;
39
39
  inline-size: 100%;
40
40
  overflow: clip;
41
- border-block-end: 1px solid var(--ui-border-divider);
41
+ border-block-end: var(--ui-border-width) solid var(--ui-border-divider);
42
42
  color: var(--ui-text-primary);
43
43
  }
44
44
 
@@ -67,7 +67,7 @@
67
67
  }
68
68
  .trigger:focus-visible {
69
69
  outline: none;
70
- box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ui-focus-ring) 45%, transparent);
70
+ box-shadow: inset 0 0 0 var(--ui-focus-width) color-mix(in srgb, var(--ui-focus-ring) 45%, transparent);
71
71
  }
72
72
  .trigger:disabled {
73
73
  color: var(--ui-disabled-text);
@@ -105,6 +105,43 @@
105
105
  transform: rotate(225deg) translate(-1px, -1px);
106
106
  }
107
107
 
108
+ /* A bounded accordion owns one flexible body, so its trigger never scrolls away. The
109
+ * normal content-sized layout and its animation remain unchanged when fill is omitted. */
110
+ :scope[data-ui-disclosure-state~="fill"] {
111
+ display: flex;
112
+ flex-direction: column;
113
+ flex: none;
114
+ min-block-size: 0;
115
+ border-block-end: 0;
116
+ border-block-start: var(--ui-border-width) solid var(--ui-border-divider);
117
+ }
118
+ :scope[data-ui-disclosure-state~="fill"][data-ui-disclosure-state~="internalOpen"] {
119
+ flex: 1;
120
+ }
121
+ :scope[data-ui-disclosure-state~="fill"] .heading {
122
+ flex: none;
123
+ }
124
+ :scope[data-ui-disclosure-state~="fill"] .trigger {
125
+ border-radius: 0;
126
+ }
127
+ :scope[data-ui-disclosure-state~="fill"] .panel {
128
+ display: flex;
129
+ flex: 1;
130
+ min-block-size: 0;
131
+ transition: none;
132
+ }
133
+ :scope[data-ui-disclosure-state~="fill"] .panel[hidden] {
134
+ flex: none;
135
+ block-size: 0;
136
+ }
137
+ :scope[data-ui-disclosure-state~="fill"] .panel-inner {
138
+ display: flex;
139
+ flex-direction: column;
140
+ flex: 1;
141
+ min-block-size: 0;
142
+ padding: 0;
143
+ }
144
+
108
145
  @media (prefers-reduced-motion: reduce) {
109
146
  .panel,
110
147
  .chevron {
@@ -125,6 +162,9 @@
125
162
  /* An accordion row, not a field: no enclosing box, just a divider, so it never reads as a
126
163
  * select or combobox. Stacked disclosures share their dividers. */
127
164
 
165
+ /* A bounded accordion owns one flexible body, so its trigger never scrolls away. The
166
+ * normal content-sized layout and its animation remain unchanged when fill is omitted. */
167
+
128
168
  @media (prefers-reduced-motion: reduce) {
129
169
  }
130
170
 
@@ -24,7 +24,7 @@
24
24
  min-block-size: var(--ui-control-size-sm);
25
25
  margin: 0;
26
26
  padding: var(--ui-space-1) var(--ui-space-2);
27
- border: 1px solid transparent;
27
+ border: var(--ui-border-width) solid transparent;
28
28
  border-radius: var(--ui-radius-md);
29
29
  font: inherit;
30
30
  line-height: var(--ui-line-height-md);
@@ -97,7 +97,7 @@
97
97
  .actions button {
98
98
  min-block-size: var(--ui-control-size-sm);
99
99
  padding: 0 var(--ui-space-3);
100
- border: 1px solid var(--ui-border-strong);
100
+ border: var(--ui-border-width) solid var(--ui-border-strong);
101
101
  border-radius: var(--ui-radius-md);
102
102
  background: var(--ui-surface-elevated);
103
103
  background-image: var(--ui-raised-highlight);
@@ -3,7 +3,7 @@
3
3
  :scope {
4
4
  padding: var(--ui-space-3);
5
5
  background: var(--ui-surface);
6
- border: 1px solid var(--ui-border-strong);
6
+ border: var(--ui-border-width) solid var(--ui-border-strong);
7
7
  border-radius: var(--ui-radius-md);
8
8
  box-shadow: var(--ui-shadow-lg, 0 10px 15px -3px rgb(0 0 0 / 0.1));
9
9
  }
@@ -48,8 +48,8 @@
48
48
  width: 1.25rem;
49
49
  height: 1.25rem;
50
50
  padding: 0;
51
- border: 1px solid var(--ui-control-border);
52
- border-radius: 2px;
51
+ border: var(--ui-border-width) solid var(--ui-control-border);
52
+ border-radius: var(--ui-radius-sm);
53
53
  background: var(--ui-surface);
54
54
  cursor: pointer;
55
55
  }
@@ -60,8 +60,8 @@
60
60
  }
61
61
 
62
62
  .cell:focus-visible {
63
- outline: 2px solid var(--ui-focus-ring);
64
- outline-offset: -2px;
63
+ outline: var(--ui-focus-width) solid var(--ui-focus-ring);
64
+ outline-offset: calc(-1 * var(--ui-focus-width));
65
65
  }
66
66
 
67
67
  .header {
@@ -9,7 +9,7 @@
9
9
  overflow: hidden;
10
10
  flex-direction: column;
11
11
  background: var(--ui-surface);
12
- border: 1px solid var(--ui-border-strong);
12
+ border: var(--ui-border-width) solid var(--ui-border-strong);
13
13
  border-radius: var(--ui-radius-dialog);
14
14
  box-shadow: var(--ui-shadow-lg, 0 8px 24px rgb(0 0 0 / 0.12));
15
15
  }
@@ -21,7 +21,7 @@
21
21
  gap: var(--ui-space-3);
22
22
  padding: var(--ui-space-2) var(--ui-space-3);
23
23
  color: var(--ui-text-secondary);
24
- border-bottom: 1px solid var(--ui-border-divider);
24
+ border-bottom: var(--ui-border-width) solid var(--ui-border-divider);
25
25
  font-size: var(--ui-font-size-xs);
26
26
  font-weight: var(--ui-font-semibold);
27
27
  }
@@ -32,7 +32,7 @@
32
32
  flex: 0 0 auto;
33
33
  color: var(--ui-text-secondary);
34
34
  background: var(--ui-surface-hover);
35
- border: 1px solid var(--ui-border);
35
+ border: var(--ui-border-width) solid var(--ui-border);
36
36
  border-radius: var(--ui-radius-md);
37
37
  }
38
38