@threadlabs/looma 0.1.20 → 0.1.22

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 (49) hide show
  1. package/dist/{chunk-RLSUA6N5.js → chunk-NIPNHZ5W.js} +29 -29
  2. package/dist/cjs/ui-tree.cjs.entry.js +48 -15
  3. package/dist/collection/components/ui-tree/ui-tree.js +48 -15
  4. package/dist/components/ui-tree.js +1 -1
  5. package/dist/esm/ui-tree.entry.js +48 -15
  6. package/dist/index.cjs +44 -15
  7. package/dist/index.js +1 -1
  8. package/dist/looma/looma.esm.js +1 -1
  9. package/dist/looma/p-e3f99a24.entry.js +1 -0
  10. package/dist/types/components/ui-tree/ui-tree.d.ts +3 -0
  11. package/dist/{ui-affordance-scope.entry-TEYCR7NX.js → ui-affordance-scope.entry-L533MECG.js} +1 -1
  12. package/dist/{ui-avatar-group.entry-Z2JCVPMM.js → ui-avatar-group.entry-BWS7E2CM.js} +1 -1
  13. package/dist/{ui-avatar.entry-CDDUQV4B.js → ui-avatar.entry-3INAY3XP.js} +1 -1
  14. package/dist/{ui-badge.entry-ELFAXPKR.js → ui-badge.entry-2WOBVOYP.js} +1 -1
  15. package/dist/{ui-button.entry-S5GEJ55S.js → ui-button.entry-VCGSEONK.js} +1 -1
  16. package/dist/{ui-checkbox.entry-NFXU5LDX.js → ui-checkbox.entry-2PTBHSCQ.js} +1 -1
  17. package/dist/{ui-context-menu.entry-W5F6LBEC.js → ui-context-menu.entry-AYDDCIZS.js} +1 -1
  18. package/dist/{ui-dialog.entry-G2K37IUH.js → ui-dialog.entry-I2XI3ZTZ.js} +1 -1
  19. package/dist/{ui-disclosure.entry-JO3XAMCC.js → ui-disclosure.entry-5LY2BT7B.js} +1 -1
  20. package/dist/{ui-floating-action-button.entry-EXXENSSO.js → ui-floating-action-button.entry-EJAMR5AM.js} +1 -1
  21. package/dist/{ui-form-field.entry-L62S6Z62.js → ui-form-field.entry-SJ6NNFXB.js} +1 -1
  22. package/dist/{ui-icon-button.entry-D7I7BV27.js → ui-icon-button.entry-7SD2LVXE.js} +1 -1
  23. package/dist/{ui-input.entry-YDFDXMZE.js → ui-input.entry-7MM7GEQW.js} +1 -1
  24. package/dist/{ui-menu-item.entry-QH7UGDFX.js → ui-menu-item.entry-V3HIMR75.js} +1 -1
  25. package/dist/{ui-menu.entry-YIQOPJOS.js → ui-menu.entry-R4WK5QSX.js} +1 -1
  26. package/dist/{ui-popover.entry-XN2IOEYH.js → ui-popover.entry-ZRJRTXA7.js} +1 -1
  27. package/dist/{ui-radio-group.entry-C7ESTJSS.js → ui-radio-group.entry-S6RXHFSN.js} +1 -1
  28. package/dist/{ui-radio.entry-AKVI5OUS.js → ui-radio.entry-B73QZK2M.js} +1 -1
  29. package/dist/{ui-search-result-row.entry-3BY6GUCL.js → ui-search-result-row.entry-DR2Y5S7P.js} +1 -1
  30. package/dist/{ui-search-shell.entry-2Z3GUR2I.js → ui-search-shell.entry-ST5IKJBC.js} +1 -1
  31. package/dist/{ui-select.entry-2YQLACCA.js → ui-select.entry-7GPRFV67.js} +1 -1
  32. package/dist/{ui-switch.entry-N5HDUJIW.js → ui-switch.entry-XQ5IRJRH.js} +1 -1
  33. package/dist/{ui-tabs.entry-FVOVVZOQ.js → ui-tabs.entry-HPW5L5CY.js} +1 -1
  34. package/dist/{ui-textarea.entry-ZFGGCBLG.js → ui-textarea.entry-W2PSRYVS.js} +1 -1
  35. package/dist/{ui-toast-region.entry-AA2DEUUZ.js → ui-toast-region.entry-FJUHFXKZ.js} +1 -1
  36. package/dist/{ui-tooltip.entry-WN4PYNTZ.js → ui-tooltip.entry-G5WHQW7K.js} +1 -1
  37. package/dist/{ui-top-bar.entry-ZYYXC7OA.js → ui-top-bar.entry-3NCHFC4Y.js} +1 -1
  38. package/dist/{ui-tree-item.entry-HWCNTX6N.js → ui-tree-item.entry-45RR3CMP.js} +1 -1
  39. package/dist/{ui-tree.entry-6NPGKN5P.js → ui-tree.entry-SZW4Q5PY.js} +45 -16
  40. package/editor/{chunk-3QMBK3XZ.js → chunk-64GLF274.js} +12 -2
  41. package/editor/{chunk-OXFYYLUC.js → chunk-QCOYOVQL.js} +83 -15
  42. package/editor/extensions/index.d.ts +7 -2
  43. package/editor/extensions/index.js +5 -1
  44. package/editor/index.d.ts +1 -1
  45. package/editor/index.js +6 -2
  46. package/editor/ui.js +1 -1
  47. package/editor.css +49 -0
  48. package/package.json +1 -1
  49. package/dist/looma/p-979b8ab1.entry.js +0 -1
@@ -4859,6 +4859,42 @@ var TableRow = Node15.create({
4859
4859
  }
4860
4860
  });
4861
4861
 
4862
+ // src/extensions/callout.ts
4863
+ import { mergeAttributes as mergeAttributes21, Node as Node16 } from "@tiptap/core";
4864
+ var LOOMA_CALLOUT_TONES = ["info", "note", "warning"];
4865
+ function normalizeCalloutTone(value) {
4866
+ return typeof value === "string" && LOOMA_CALLOUT_TONES.includes(value) ? value : "note";
4867
+ }
4868
+ var LoomaCallout = Node16.create({
4869
+ name: "loomaCallout",
4870
+ group: "block",
4871
+ content: "block+",
4872
+ defining: true,
4873
+ addAttributes() {
4874
+ return {
4875
+ tone: {
4876
+ default: "note",
4877
+ parseHTML: (element) => normalizeCalloutTone(element.getAttribute("data-tone")),
4878
+ renderHTML: (attributes) => ({
4879
+ "data-tone": normalizeCalloutTone(attributes.tone)
4880
+ })
4881
+ }
4882
+ };
4883
+ },
4884
+ parseHTML() {
4885
+ return [{ tag: "aside[data-looma-callout]" }];
4886
+ },
4887
+ renderHTML({ HTMLAttributes }) {
4888
+ return [
4889
+ "aside",
4890
+ mergeAttributes21(HTMLAttributes, {
4891
+ "data-looma-callout": ""
4892
+ }),
4893
+ 0
4894
+ ];
4895
+ }
4896
+ });
4897
+
4862
4898
  // src/extensions/list-behavior.ts
4863
4899
  import { Extension as Extension6 } from "@tiptap/core";
4864
4900
  function isEmptyParagraphAtStart(editor) {
@@ -4895,7 +4931,7 @@ var LoomaListBehavior = Extension6.create({
4895
4931
  });
4896
4932
 
4897
4933
  // ../../node_modules/.pnpm/@tiptap+extension-mention@2.27.3_@tiptap+core@2.27.2_@tiptap+pm@2.27.2__@tiptap+pm@2.27_e4d93fc6b40c97d74d1cbe40f638e38f/node_modules/@tiptap/extension-mention/dist/index.js
4898
- import { Node as Node16, mergeAttributes as mergeAttributes21 } from "@tiptap/core";
4934
+ import { Node as Node17, mergeAttributes as mergeAttributes22 } from "@tiptap/core";
4899
4935
  import { Node as Node$1 } from "@tiptap/pm/model";
4900
4936
 
4901
4937
  // ../../node_modules/.pnpm/@tiptap+suggestion@2.27.2_@tiptap+core@2.27.2_@tiptap+pm@2.27.2__@tiptap+pm@2.27.2/node_modules/@tiptap/suggestion/dist/index.js
@@ -5174,7 +5210,7 @@ function getSuggestionFromChar(options, char) {
5174
5210
  }
5175
5211
  return null;
5176
5212
  }
5177
- var Mention = Node16.create({
5213
+ var Mention = Node17.create({
5178
5214
  name: "mention",
5179
5215
  priority: 101,
5180
5216
  addOptions() {
@@ -5189,7 +5225,7 @@ var Mention = Node16.create({
5189
5225
  var _a, _b;
5190
5226
  return [
5191
5227
  "span",
5192
- mergeAttributes21(this.HTMLAttributes, options.HTMLAttributes),
5228
+ mergeAttributes22(this.HTMLAttributes, options.HTMLAttributes),
5193
5229
  `${(_a = suggestion === null || suggestion === void 0 ? void 0 : suggestion.char) !== null && _a !== void 0 ? _a : "@"}${(_b = node.attrs.label) !== null && _b !== void 0 ? _b : node.attrs.id}`
5194
5230
  ];
5195
5231
  },
@@ -5252,7 +5288,7 @@ var Mention = Node16.create({
5252
5288
  console.warn("renderLabel is deprecated use renderText and renderHTML instead");
5253
5289
  return [
5254
5290
  "span",
5255
- mergeAttributes21({ "data-type": this.name }, this.options.HTMLAttributes, HTMLAttributes),
5291
+ mergeAttributes22({ "data-type": this.name }, this.options.HTMLAttributes, HTMLAttributes),
5256
5292
  this.options.renderLabel({
5257
5293
  options: this.options,
5258
5294
  node,
@@ -5261,7 +5297,7 @@ var Mention = Node16.create({
5261
5297
  ];
5262
5298
  }
5263
5299
  const mergedOptions = { ...this.options };
5264
- mergedOptions.HTMLAttributes = mergeAttributes21({ "data-type": this.name }, this.options.HTMLAttributes, HTMLAttributes);
5300
+ mergedOptions.HTMLAttributes = mergeAttributes22({ "data-type": this.name }, this.options.HTMLAttributes, HTMLAttributes);
5265
5301
  const html = this.options.renderHTML({
5266
5302
  options: mergedOptions,
5267
5303
  node,
@@ -5270,7 +5306,7 @@ var Mention = Node16.create({
5270
5306
  if (typeof html === "string") {
5271
5307
  return [
5272
5308
  "span",
5273
- mergeAttributes21({ "data-type": this.name }, this.options.HTMLAttributes, HTMLAttributes),
5309
+ mergeAttributes22({ "data-type": this.name }, this.options.HTMLAttributes, HTMLAttributes),
5274
5310
  html
5275
5311
  ];
5276
5312
  }
@@ -5507,7 +5543,7 @@ function createLoomaMentionExtension(options = {}) {
5507
5543
  }
5508
5544
 
5509
5545
  // ../../node_modules/.pnpm/@tiptap+extension-table@2.27.2_@tiptap+core@2.27.2_@tiptap+pm@2.27.2__@tiptap+pm@2.27.2/node_modules/@tiptap/extension-table/dist/index.js
5510
- import { findParentNodeClosestToPos, Node as Node17, mergeAttributes as mergeAttributes22, callOrReturn as callOrReturn2, getExtensionField as getExtensionField2 } from "@tiptap/core";
5546
+ import { findParentNodeClosestToPos, Node as Node18, mergeAttributes as mergeAttributes23, callOrReturn as callOrReturn2, getExtensionField as getExtensionField2 } from "@tiptap/core";
5511
5547
  import { TextSelection as TextSelection3 } from "@tiptap/pm/state";
5512
5548
  import { CellSelection, addColumnBefore, addColumnAfter, deleteColumn, addRowBefore, addRowAfter, deleteRow, deleteTable, mergeCells, splitCell, toggleHeader, toggleHeaderCell, setCellAttr, goToNextCell, fixTables, columnResizing, tableEditing } from "@tiptap/pm/tables";
5513
5549
  function getColStyleDeclaration(minWidth, width) {
@@ -5680,7 +5716,7 @@ var deleteTableWhenAllCellsSelected = ({ editor }) => {
5680
5716
  editor.commands.deleteTable();
5681
5717
  return true;
5682
5718
  };
5683
- var Table = Node17.create({
5719
+ var Table = Node18.create({
5684
5720
  name: "table",
5685
5721
  // @ts-ignore
5686
5722
  addOptions() {
@@ -5707,7 +5743,7 @@ var Table = Node17.create({
5707
5743
  const { colgroup, tableWidth, tableMinWidth } = createColGroup(node, this.options.cellMinWidth);
5708
5744
  const table = [
5709
5745
  "table",
5710
- mergeAttributes22(this.options.HTMLAttributes, HTMLAttributes, {
5746
+ mergeAttributes23(this.options.HTMLAttributes, HTMLAttributes, {
5711
5747
  style: tableWidth ? `width: ${tableWidth}` : `min-width: ${tableMinWidth}`
5712
5748
  }),
5713
5749
  colgroup,
@@ -5839,8 +5875,8 @@ var Table = Node17.create({
5839
5875
  });
5840
5876
 
5841
5877
  // ../../node_modules/.pnpm/@tiptap+extension-table-cell@2.27.2_@tiptap+core@2.27.2_@tiptap+pm@2.27.2_/node_modules/@tiptap/extension-table-cell/dist/index.js
5842
- import { Node as Node18, mergeAttributes as mergeAttributes23 } from "@tiptap/core";
5843
- var TableCell = Node18.create({
5878
+ import { Node as Node19, mergeAttributes as mergeAttributes24 } from "@tiptap/core";
5879
+ var TableCell = Node19.create({
5844
5880
  name: "tableCell",
5845
5881
  addOptions() {
5846
5882
  return {
@@ -5874,13 +5910,13 @@ var TableCell = Node18.create({
5874
5910
  ];
5875
5911
  },
5876
5912
  renderHTML({ HTMLAttributes }) {
5877
- return ["td", mergeAttributes23(this.options.HTMLAttributes, HTMLAttributes), 0];
5913
+ return ["td", mergeAttributes24(this.options.HTMLAttributes, HTMLAttributes), 0];
5878
5914
  }
5879
5915
  });
5880
5916
 
5881
5917
  // ../../node_modules/.pnpm/@tiptap+extension-table-header@2.27.2_@tiptap+core@2.27.2_@tiptap+pm@2.27.2_/node_modules/@tiptap/extension-table-header/dist/index.js
5882
- import { Node as Node19, mergeAttributes as mergeAttributes24 } from "@tiptap/core";
5883
- var TableHeader = Node19.create({
5918
+ import { Node as Node20, mergeAttributes as mergeAttributes25 } from "@tiptap/core";
5919
+ var TableHeader = Node20.create({
5884
5920
  name: "tableHeader",
5885
5921
  addOptions() {
5886
5922
  return {
@@ -5914,7 +5950,7 @@ var TableHeader = Node19.create({
5914
5950
  ];
5915
5951
  },
5916
5952
  renderHTML({ HTMLAttributes }) {
5917
- return ["th", mergeAttributes24(this.options.HTMLAttributes, HTMLAttributes), 0];
5953
+ return ["th", mergeAttributes25(this.options.HTMLAttributes, HTMLAttributes), 0];
5918
5954
  }
5919
5955
  });
5920
5956
 
@@ -6064,6 +6100,7 @@ function getDefaultEditorExtensions(options = {}) {
6064
6100
  TaskList,
6065
6101
  TaskItem.configure({ nested: false }),
6066
6102
  Blockquote,
6103
+ LoomaCallout,
6067
6104
  HorizontalRule,
6068
6105
  HardBreak,
6069
6106
  History,
@@ -6399,6 +6436,26 @@ function handleTableOverlayAction(editor, detail) {
6399
6436
 
6400
6437
  // src/extensions/slash-command.ts
6401
6438
  import { Extension as Extension8 } from "@tiptap/core";
6439
+ var CALLOUT_COMMANDS = [
6440
+ {
6441
+ title: "Info",
6442
+ description: "Informational callout",
6443
+ tone: "info",
6444
+ keywords: ["info", "information", "callout", "panel"]
6445
+ },
6446
+ {
6447
+ title: "Note",
6448
+ description: "Highlighted note",
6449
+ tone: "note",
6450
+ keywords: ["note", "callout", "panel"]
6451
+ },
6452
+ {
6453
+ title: "Warning",
6454
+ description: "Important warning",
6455
+ tone: "warning",
6456
+ keywords: ["warning", "caution", "alert", "callout", "panel"]
6457
+ }
6458
+ ];
6402
6459
  function getDefaultSlashCommands(onOpenImagePicker) {
6403
6460
  return [
6404
6461
  {
@@ -6455,6 +6512,15 @@ function getDefaultSlashCommands(onOpenImagePicker) {
6455
6512
  editor.chain().focus().deleteRange(range).toggleBlockquote().run();
6456
6513
  }
6457
6514
  },
6515
+ ...CALLOUT_COMMANDS.map(({ title, description, tone, keywords }) => ({
6516
+ title,
6517
+ description,
6518
+ icon: "panel-left",
6519
+ keywords,
6520
+ command: ({ editor, range }) => {
6521
+ editor.chain().focus().deleteRange(range).wrapIn("loomaCallout", { tone }).run();
6522
+ }
6523
+ })),
6458
6524
  {
6459
6525
  title: "Inline code",
6460
6526
  description: "Monospace code span",
@@ -6608,6 +6674,8 @@ function createLoomaSlashCommandExtension(options = {}) {
6608
6674
  }
6609
6675
 
6610
6676
  export {
6677
+ LOOMA_CALLOUT_TONES,
6678
+ LoomaCallout,
6611
6679
  LoomaMentionSuggestionPluginKey,
6612
6680
  createLoomaMentionExtension,
6613
6681
  LoomaTable,
@@ -1,4 +1,4 @@
1
- import { AnyExtension, Editor, Range, Extension } from '@tiptap/core';
1
+ import { AnyExtension, Node, Editor, Range, Extension } from '@tiptap/core';
2
2
  import { d as TableContextMenuActionEventDetail, g as TableOverlayActionEventDetail } from '../table-overlay-DoiLie4h.js';
3
3
  export { a as TABLE_CELL_BACKGROUND_PRESETS } from '../table-overlay-DoiLie4h.js';
4
4
  import { PluginKey } from '@tiptap/pm/state';
@@ -25,6 +25,11 @@ declare function getLoomaTableExtensions(): AnyExtension[];
25
25
  */
26
26
  declare function getDefaultEditorExtensions(options?: DefaultEditorExtensionsOptions): AnyExtension[];
27
27
 
28
+ declare const LOOMA_CALLOUT_TONES: readonly ["info", "note", "warning"];
29
+ type LoomaCalloutTone = (typeof LOOMA_CALLOUT_TONES)[number];
30
+ /** A durable, themeable block container for informational editor content. */
31
+ declare const LoomaCallout: Node<any, any>;
32
+
28
33
  type TableCellAlignment = "left" | "center" | "right";
29
34
  type TableCellBackground = string | null;
30
35
  declare const LoomaTable: AnyExtension;
@@ -174,4 +179,4 @@ interface LoomaSlashCommand {
174
179
  declare const LoomaSlashCommand: Extension<LoomaSlashCommandOptions, any>;
175
180
  declare function createLoomaSlashCommandExtension(options?: Partial<LoomaSlashCommandOptions>): Extension<LoomaSlashCommandOptions, any>;
176
181
 
177
- export { type ActiveTableUiState, DEFAULT_MENTION_RESULT_LIMIT, type DefaultEditorExtensionsOptions, type InsertTableAtRangeOptions, type LoomaMentionItem, type LoomaMentionMenuSnapshot, type LoomaMentionOptions, type LoomaMentionProvider, type LoomaMentionProviderContext, LoomaMentionSuggestionPluginKey, LoomaSlashCommand, type LoomaSlashCommandContext, LoomaSlashCommand as LoomaSlashCommandItem, type LoomaSlashCommandOptions, type LoomaSlashMenuSnapshot, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, MAX_MENTION_RESULT_LIMIT, type TableActionCapabilities, type TableCellAlignment, type TableCellBackground, createLoomaMentionExtension, createLoomaSlashCommandExtension, filterLoomaMentionItems, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, handleTableAction, handleTableOverlayAction, insertTableAtRange, normalizeActiveTableColumnWidths, normalizeMentionResultLimit, setActiveTableCellAlignment, setActiveTableCellBackground, shouldShowTextFormattingToolbar };
182
+ export { type ActiveTableUiState, DEFAULT_MENTION_RESULT_LIMIT, type DefaultEditorExtensionsOptions, type InsertTableAtRangeOptions, LOOMA_CALLOUT_TONES, LoomaCallout, type LoomaCalloutTone, type LoomaMentionItem, type LoomaMentionMenuSnapshot, type LoomaMentionOptions, type LoomaMentionProvider, type LoomaMentionProviderContext, LoomaMentionSuggestionPluginKey, LoomaSlashCommand, type LoomaSlashCommandContext, LoomaSlashCommand as LoomaSlashCommandItem, type LoomaSlashCommandOptions, type LoomaSlashMenuSnapshot, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, MAX_MENTION_RESULT_LIMIT, type TableActionCapabilities, type TableCellAlignment, type TableCellBackground, createLoomaMentionExtension, createLoomaSlashCommandExtension, filterLoomaMentionItems, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, handleTableAction, handleTableOverlayAction, insertTableAtRange, normalizeActiveTableColumnWidths, normalizeMentionResultLimit, setActiveTableCellAlignment, setActiveTableCellBackground, shouldShowTextFormattingToolbar };
@@ -1,4 +1,6 @@
1
1
  import {
2
+ LOOMA_CALLOUT_TONES,
3
+ LoomaCallout,
2
4
  LoomaMentionSuggestionPluginKey,
3
5
  LoomaSlashCommand,
4
6
  LoomaTable,
@@ -20,7 +22,7 @@ import {
20
22
  setActiveTableCellAlignment,
21
23
  setActiveTableCellBackground,
22
24
  shouldShowTextFormattingToolbar
23
- } from "../chunk-OXFYYLUC.js";
25
+ } from "../chunk-QCOYOVQL.js";
24
26
  import {
25
27
  DEFAULT_MENTION_RESULT_LIMIT,
26
28
  MAX_MENTION_RESULT_LIMIT,
@@ -30,6 +32,8 @@ import {
30
32
  } from "../chunk-ZOUKEZ77.js";
31
33
  export {
32
34
  DEFAULT_MENTION_RESULT_LIMIT,
35
+ LOOMA_CALLOUT_TONES,
36
+ LoomaCallout,
33
37
  LoomaMentionSuggestionPluginKey,
34
38
  LoomaSlashCommand,
35
39
  LoomaTable,
package/editor/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { A as ActiveCellRect, T as TABLE_CELL_BACKGROUND_OPTIONS, a as TABLE_CELL_BACKGROUND_PRESETS, b as TableCellBackgroundAction, c as TableContextMenuAction, d as TableContextMenuActionEventDetail, e as TableInsertionAction, f as TableOverlayAction, g as TableOverlayActionEventDetail, h as TableOverlayGeometry, d as TableToolbarActionEventDetail, m as measureTableOverlayGeometry, r as resolveTableCellAt } from './table-overlay-DoiLie4h.js';
2
2
  export { InsertTableEventDetail, MentionMenuHighlightEventDetail, MentionMenuSelectEventDetail, SlashMenuAnchorRect, SlashMenuHighlightEventDetail, SlashMenuItem, SlashMenuSelectEventDetail } from './ui.js';
3
- export { ActiveTableUiState, DEFAULT_MENTION_RESULT_LIMIT, DefaultEditorExtensionsOptions, InsertTableAtRangeOptions, LoomaMentionItem, LoomaMentionMenuSnapshot, LoomaMentionOptions, LoomaMentionProvider, LoomaMentionProviderContext, LoomaMentionSuggestionPluginKey, LoomaSlashCommand, LoomaSlashCommandContext, LoomaSlashCommand as LoomaSlashCommandItem, LoomaSlashCommandOptions, LoomaSlashMenuSnapshot, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, MAX_MENTION_RESULT_LIMIT, TableActionCapabilities, TableCellAlignment, TableCellBackground, createLoomaMentionExtension, createLoomaSlashCommandExtension, filterLoomaMentionItems, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, handleTableAction, handleTableOverlayAction, insertTableAtRange, normalizeActiveTableColumnWidths, normalizeMentionResultLimit, setActiveTableCellAlignment, setActiveTableCellBackground, shouldShowTextFormattingToolbar } from './extensions/index.js';
3
+ export { ActiveTableUiState, DEFAULT_MENTION_RESULT_LIMIT, DefaultEditorExtensionsOptions, InsertTableAtRangeOptions, LOOMA_CALLOUT_TONES, LoomaCallout, LoomaCalloutTone, LoomaMentionItem, LoomaMentionMenuSnapshot, LoomaMentionOptions, LoomaMentionProvider, LoomaMentionProviderContext, LoomaMentionSuggestionPluginKey, LoomaSlashCommand, LoomaSlashCommandContext, LoomaSlashCommand as LoomaSlashCommandItem, LoomaSlashCommandOptions, LoomaSlashMenuSnapshot, LoomaTable, LoomaTableCell, LoomaTableHeader, LoomaTableKit, MAX_MENTION_RESULT_LIMIT, TableActionCapabilities, TableCellAlignment, TableCellBackground, createLoomaMentionExtension, createLoomaSlashCommandExtension, filterLoomaMentionItems, getActiveTableCellAlignment, getActiveTableCellBackground, getActiveTableUiState, getDefaultEditorExtensions, getDefaultSlashCommands, getLoomaTableExtensions, handleTableAction, handleTableOverlayAction, insertTableAtRange, normalizeActiveTableColumnWidths, normalizeMentionResultLimit, setActiveTableCellAlignment, setActiveTableCellBackground, shouldShowTextFormattingToolbar } from './extensions/index.js';
4
4
  import '@threadlabs/looma/core';
5
5
  import '@tiptap/core';
6
6
  import '@tiptap/pm/state';
package/editor/index.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import {
2
2
  measureTableOverlayGeometry,
3
3
  resolveTableCellAt
4
- } from "./chunk-3QMBK3XZ.js";
4
+ } from "./chunk-64GLF274.js";
5
5
  import {
6
+ LOOMA_CALLOUT_TONES,
7
+ LoomaCallout,
6
8
  LoomaMentionSuggestionPluginKey,
7
9
  LoomaSlashCommand,
8
10
  LoomaTable,
@@ -24,7 +26,7 @@ import {
24
26
  setActiveTableCellAlignment,
25
27
  setActiveTableCellBackground,
26
28
  shouldShowTextFormattingToolbar
27
- } from "./chunk-OXFYYLUC.js";
29
+ } from "./chunk-QCOYOVQL.js";
28
30
  import {
29
31
  DEFAULT_MENTION_RESULT_LIMIT,
30
32
  MAX_MENTION_RESULT_LIMIT,
@@ -35,6 +37,8 @@ import {
35
37
  } from "./chunk-ZOUKEZ77.js";
36
38
  export {
37
39
  DEFAULT_MENTION_RESULT_LIMIT,
40
+ LOOMA_CALLOUT_TONES,
41
+ LoomaCallout,
38
42
  LoomaMentionSuggestionPluginKey,
39
43
  LoomaSlashCommand,
40
44
  LoomaTable,
package/editor/ui.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  measureTableOverlayGeometry,
3
3
  resolveTableCellAt
4
- } from "./chunk-3QMBK3XZ.js";
4
+ } from "./chunk-64GLF274.js";
5
5
  import {
6
6
  TABLE_CELL_BACKGROUND_OPTIONS,
7
7
  TABLE_CELL_BACKGROUND_PRESETS
package/editor.css CHANGED
@@ -77,6 +77,55 @@
77
77
  font-style: italic;
78
78
  }
79
79
 
80
+ .looma-editor .ProseMirror aside[data-looma-callout] {
81
+ --ui-editor-callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E");
82
+
83
+ display: grid;
84
+ grid-template-columns: 1.25rem minmax(0, 1fr);
85
+ align-items: start;
86
+ column-gap: var(--ui-space-3);
87
+ margin: var(--ui-space-4) 0;
88
+ padding: var(--ui-space-3) var(--ui-space-4);
89
+ border-left: 4px solid var(--ui-editor-callout-color, var(--ui-accent-solid));
90
+ border-radius: var(--ui-radius-2);
91
+ background: var(--ui-editor-callout-background, var(--ui-accent-soft));
92
+ }
93
+
94
+ .looma-editor .ProseMirror aside[data-looma-callout]::before {
95
+ width: 1.125rem;
96
+ height: 1.125rem;
97
+ margin-top: 0.2em;
98
+ background: var(--ui-editor-callout-color, var(--ui-accent-solid));
99
+ content: "";
100
+ mask: var(--ui-editor-callout-icon) center / contain no-repeat;
101
+ -webkit-mask: var(--ui-editor-callout-icon) center / contain no-repeat;
102
+ }
103
+
104
+ .looma-editor .ProseMirror aside[data-looma-callout] > * {
105
+ grid-column: 2;
106
+ }
107
+
108
+ .looma-editor .ProseMirror aside[data-looma-callout] > :last-child {
109
+ margin-bottom: 0;
110
+ }
111
+
112
+ .looma-editor .ProseMirror aside[data-looma-callout][data-tone="info"] {
113
+ --ui-editor-callout-color: var(--ui-info-solid);
114
+ --ui-editor-callout-background: var(--ui-info-soft);
115
+ --ui-editor-callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
116
+ }
117
+
118
+ .looma-editor .ProseMirror aside[data-looma-callout][data-tone="note"] {
119
+ --ui-editor-callout-color: var(--ui-accent-solid);
120
+ --ui-editor-callout-background: var(--ui-accent-soft);
121
+ }
122
+
123
+ .looma-editor .ProseMirror aside[data-looma-callout][data-tone="warning"] {
124
+ --ui-editor-callout-color: var(--ui-warning-solid);
125
+ --ui-editor-callout-background: var(--ui-warning-soft);
126
+ --ui-editor-callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
127
+ }
128
+
80
129
  .looma-editor .ProseMirror pre {
81
130
  margin: var(--ui-space-4) 0;
82
131
  padding: var(--ui-space-4);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "type": "module",
5
5
  "description": "Looma web components, responsive layout primitives, a complete editor, and supported Vue adapters.",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- import{r as t,g as i,h as e,H as s}from"./p-CEeiinfk.js";import{d as r}from"./p-JwSoedEO.js";function n(t,i,e){const s=t.height>0?Math.min(1,Math.max(0,(i-t.top)/t.height)):.5;return e?s<.25?"before":s>.75?"after":"inside":s<.5?"before":"after"}const o=class{constructor(i){t(this,i)}get host(){return i(this)}label="Tree";hoverExpandDelay=700;source=null;target=null;position=null;hoverIntent=null;componentDidLoad(){this.hoverIntent=function(t,i){let e,s;function r(){e&&clearTimeout(e),e=void 0,s=void 0}return{schedule(n){s===n&&e||(r(),s=n,e=setTimeout((()=>{e=void 0;const t=s;s=void 0,t&&i(t)}),Math.max(0,t)))},cancel:r,destroy:r}}(this.hoverExpandDelay,this.expandTarget),this.host.addEventListener("dragstart",this.onDragStart),this.host.addEventListener("dragover",this.onDragOver),this.host.addEventListener("dragleave",this.onDragLeave),this.host.addEventListener("drop",this.onDrop),this.host.addEventListener("dragend",this.onDragEnd),this.host.addEventListener("keydown",this.onKeyDown)}disconnectedCallback(){this.hoverIntent?.destroy(),this.host.removeEventListener("dragstart",this.onDragStart),this.host.removeEventListener("dragover",this.onDragOver),this.host.removeEventListener("dragleave",this.onDragLeave),this.host.removeEventListener("drop",this.onDrop),this.host.removeEventListener("dragend",this.onDragEnd),this.host.removeEventListener("keydown",this.onKeyDown)}itemFromEvent(t){return t.composedPath().find((t=>t instanceof HTMLElement&&"ui-tree-item"===t.localName))??null}itemId(t){return t.itemId||t.getAttribute("item-id")||""}rowFor(t){return t.shadowRoot?.querySelector('[part="row"]')??null}itemAtPoint(t,i){let e=this.host.ownerDocument.elementFromPoint(t,i);for(;e;){if("ui-tree-item"===e.localName&&this.host.contains(e))return e;const t=e.getRootNode();e=t instanceof ShadowRoot?t.host:e.parentElement}return null}acceptsChildren(t){return Boolean(t.container??t.hasAttribute("container"))&&!Boolean(t.disabled??t.hasAttribute("disabled"))}itemMetadata(t){return{type:t.getAttribute("data-drag-type")||t.getAttribute("drag-type")||"item",scope:t.getAttribute("data-drop-scope")||t.getAttribute("drop-scope")||"",accepts:(t.getAttribute("data-accepts")||t.getAttribute("accepts")||"").split(",").map((t=>t.trim())).filter(Boolean)}}permitsDrop(t,i,e){if(t.contains(i))return!1;const s=this.itemMetadata(t),r=this.itemMetadata(i);return"inside"===e?this.acceptsChildren(i)&&(0===r.accepts.length||r.accepts.includes(s.type)):s.type===r.type}clearTarget(){this.target?.removeAttribute("data-drop-position"),this.target=null,this.position=null,this.hoverIntent?.cancel()}finishDrag(){this.source?.removeAttribute("data-dragging"),this.source=null,this.clearTarget()}expandTarget=t=>{const i=Array.from(this.host.querySelectorAll("ui-tree-item")).find((i=>this.itemId(i)===t));i&&"false"===i.getAttribute("aria-expanded")&&i.dispatchEvent(new CustomEvent("ui-tree-auto-expand"))};onDragStart=t=>{const i=this.itemFromEvent(t);if(!i||!Boolean(i.sortable??i.hasAttribute("sortable"))||Boolean(i.disabled??i.hasAttribute("disabled")))return;if(!t.composedPath().some((t=>t instanceof HTMLElement&&"drag-handle"===t.getAttribute("part"))))return void t.preventDefault();const e=this.itemId(i),s=this.rowFor(i);e&&s?(this.source=i,i.setAttribute("data-dragging","true"),t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e)),function(t,i){if(!t||"function"!=typeof t.setDragImage)return;const{height:e}=i.getBoundingClientRect();t.setDragImage(i,16,Math.max(0,e/2))}(t.dataTransfer,s)):t.preventDefault()};onDragOver=t=>{if(!this.source)return;const i=this.itemFromEvent(t);if(!i||i===this.source)return void this.clearTarget();const e=this.rowFor(i);if(!e)return;const s=n(e.getBoundingClientRect(),t.clientY,this.acceptsChildren(i));if(!this.permitsDrop(this.source,i,s))return t.dataTransfer&&(t.dataTransfer.dropEffect="none"),void this.clearTarget();t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move"),this.target===i&&this.position===s||(this.clearTarget(),this.target=i,this.position=s,i.setAttribute("data-drop-position",s)),"inside"===s&&"false"===i.getAttribute("aria-expanded")?this.hoverIntent?.schedule(this.itemId(i)):this.hoverIntent?.cancel()};onDragLeave=t=>{const i=t.relatedTarget;i instanceof Node&&this.host.contains(i)||this.clearTarget()};dispatchReorder(t,i,e){const s=this.itemId(t),n=this.itemId(i);if(!s||!n)return;const o=this.itemMetadata(t),a=this.itemMetadata(i);r(this.host,"reorder",{sourceId:s,targetId:n,position:e,sourceType:o.type,targetType:a.type,sourceScope:o.scope,targetScope:a.scope,trigger:"pointer"})}onDrop=t=>{this.source&&this.target&&this.position&&(t.preventDefault(),this.dispatchReorder(this.source,this.target,this.position),this.finishDrag())};onDragEnd=t=>{if(this.source){const i=this.itemAtPoint(t.clientX,t.clientY);if(i&&i!==this.source){const e=this.rowFor(i);if(e){const s=n(e.getBoundingClientRect(),t.clientY,this.acceptsChildren(i));this.permitsDrop(this.source,i,s)&&this.dispatchReorder(this.source,i,s)}}}this.finishDrag()};visibleItems(){return Array.from(this.host.querySelectorAll("ui-tree-item")).filter((t=>t.getClientRects().length>0&&!t.hasAttribute("disabled")))}onKeyDown=t=>{const i=this.itemFromEvent(t);if(!i)return;const e=this.visibleItems(),s=e.indexOf(i);if(s<0)return;const r="ArrowDown"===t.key?e[s+1]:"ArrowUp"===t.key?e[s-1]:null;r&&(t.preventDefault(),r.focus())};render(){return e(s,{key:"9668f6170cec944d7b993bf0f98637d8908f5962",role:"tree","aria-label":this.label||"Tree"},e("slot",{key:"93140b9a53ca3cddfdc1206e952ca713559dbc2f"}))}};o.style=":host{--ui-tree-indent:16px;display:block;min-inline-size:0;padding-inline-start:var(--ui-tree-gutter, 22px)}::slotted(ui-tree-item){--ui-tree-indent:inherit}";export{o as ui_tree}