@threadlabs/looma 0.1.19 → 0.1.21
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.
- package/dist/{chunk-NMV2BBWK.js → chunk-FSGGPFID.js} +29 -29
- package/dist/cjs/ui-tree.cjs.entry.js +59 -20
- package/dist/collection/components/ui-tree/ui-tree.js +59 -20
- package/dist/components/ui-tree.js +1 -1
- package/dist/esm/ui-tree.entry.js +59 -20
- package/dist/index.cjs +59 -20
- package/dist/index.js +1 -1
- package/dist/looma/looma.esm.js +1 -1
- package/dist/looma/p-b0431118.entry.js +1 -0
- package/dist/types/components/ui-tree/ui-tree.d.ts +3 -0
- package/dist/{ui-affordance-scope.entry-2CJOZHBF.js → ui-affordance-scope.entry-Z3H4CM6J.js} +1 -1
- package/dist/{ui-avatar-group.entry-WMDVHRVT.js → ui-avatar-group.entry-ONGVFRD3.js} +1 -1
- package/dist/{ui-avatar.entry-SHX6AOME.js → ui-avatar.entry-TBA3IEED.js} +1 -1
- package/dist/{ui-badge.entry-S5VSVEBD.js → ui-badge.entry-DKBPJ7G7.js} +1 -1
- package/dist/{ui-button.entry-HVSZQOA3.js → ui-button.entry-U2MMIHLY.js} +1 -1
- package/dist/{ui-checkbox.entry-2DWUSIEP.js → ui-checkbox.entry-QJTO2U6Z.js} +1 -1
- package/dist/{ui-context-menu.entry-ZCGK2ZM3.js → ui-context-menu.entry-CC4VXCEB.js} +1 -1
- package/dist/{ui-dialog.entry-XVTGSOKV.js → ui-dialog.entry-GPJWOH5Z.js} +1 -1
- package/dist/{ui-disclosure.entry-Z4UNBYPO.js → ui-disclosure.entry-EGG3HXD4.js} +1 -1
- package/dist/{ui-floating-action-button.entry-7QXOFMZ2.js → ui-floating-action-button.entry-XUD44HRX.js} +1 -1
- package/dist/{ui-form-field.entry-ENMTDKN2.js → ui-form-field.entry-UHLNDUXR.js} +1 -1
- package/dist/{ui-icon-button.entry-4DMRMHP2.js → ui-icon-button.entry-6HDCV3E7.js} +1 -1
- package/dist/{ui-input.entry-JQROBMAB.js → ui-input.entry-73QXAVLL.js} +1 -1
- package/dist/{ui-menu-item.entry-4KZUH65O.js → ui-menu-item.entry-HCZRSY5Y.js} +1 -1
- package/dist/{ui-menu.entry-HEKD6EUJ.js → ui-menu.entry-ASIVAX6M.js} +1 -1
- package/dist/{ui-popover.entry-MP5QS5WD.js → ui-popover.entry-WSQ7AEJN.js} +1 -1
- package/dist/{ui-radio-group.entry-YWXQLMSD.js → ui-radio-group.entry-2N7BEBJW.js} +1 -1
- package/dist/{ui-radio.entry-TYQ36J2G.js → ui-radio.entry-TOM6HBXP.js} +1 -1
- package/dist/{ui-search-result-row.entry-EV73E2AD.js → ui-search-result-row.entry-KA3P76WE.js} +1 -1
- package/dist/{ui-search-shell.entry-RRS62AZU.js → ui-search-shell.entry-ERMS7TIH.js} +1 -1
- package/dist/{ui-select.entry-NJRM2C2R.js → ui-select.entry-KDIM3SWS.js} +1 -1
- package/dist/{ui-switch.entry-JNWSBOIW.js → ui-switch.entry-VRTB6X4D.js} +1 -1
- package/dist/{ui-tabs.entry-JNBWW2G3.js → ui-tabs.entry-GIAO5W3U.js} +1 -1
- package/dist/{ui-textarea.entry-CDCRB2S3.js → ui-textarea.entry-T6YH4HVG.js} +1 -1
- package/dist/{ui-toast-region.entry-QLPSSQ5I.js → ui-toast-region.entry-DBQCXOPJ.js} +1 -1
- package/dist/{ui-tooltip.entry-FAZT5VYK.js → ui-tooltip.entry-VS26OECS.js} +1 -1
- package/dist/{ui-top-bar.entry-LNUHSZSM.js → ui-top-bar.entry-HGWP6PFQ.js} +1 -1
- package/dist/{ui-tree-item.entry-TLYU63UE.js → ui-tree-item.entry-ZRXUIZDR.js} +1 -1
- package/dist/{ui-tree.entry-3OF7ZPOH.js → ui-tree.entry-TC2SCQJF.js} +60 -21
- package/editor/{chunk-3QMBK3XZ.js → chunk-64GLF274.js} +12 -2
- package/editor/{chunk-OXFYYLUC.js → chunk-QCOYOVQL.js} +83 -15
- package/editor/extensions/index.d.ts +7 -2
- package/editor/extensions/index.js +5 -1
- package/editor/index.d.ts +1 -1
- package/editor/index.js +6 -2
- package/editor/ui.js +1 -1
- package/editor.css +49 -0
- package/package.json +1 -1
- package/dist/looma/p-95368dee.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
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
|
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 =
|
|
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
|
-
|
|
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
|
|
5843
|
-
var TableCell =
|
|
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",
|
|
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
|
|
5883
|
-
var TableHeader =
|
|
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",
|
|
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-
|
|
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-
|
|
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-
|
|
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
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 +0,0 @@
|
|
|
1
|
-
import{r as t,g as e,h as i,H as s}from"./p-CEeiinfk.js";import{d as r}from"./p-JwSoedEO.js";const n=class{constructor(e){t(this,e)}get host(){return e(this)}label="Tree";hoverExpandDelay=700;source=null;target=null;position=null;hoverIntent=null;componentDidLoad(){this.hoverIntent=function(t,e){let i,s;function r(){i&&clearTimeout(i),i=void 0,s=void 0}return{schedule(n){s===n&&i||(r(),s=n,i=setTimeout((()=>{i=void 0;const t=s;s=void 0,t&&e(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}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,e,i){if(t.contains(e))return!1;const s=this.itemMetadata(t),r=this.itemMetadata(e);return"inside"===i?this.acceptsChildren(e)&&(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 e=Array.from(this.host.querySelectorAll("ui-tree-item")).find((e=>this.itemId(e)===t));e&&"false"===e.getAttribute("aria-expanded")&&e.dispatchEvent(new CustomEvent("ui-tree-auto-expand"))};onDragStart=t=>{const e=this.itemFromEvent(t);if(!e||!Boolean(e.sortable??e.hasAttribute("sortable"))||Boolean(e.disabled??e.hasAttribute("disabled")))return;if(!t.composedPath().some((t=>t instanceof HTMLElement&&"drag-handle"===t.getAttribute("part"))))return void t.preventDefault();const i=this.itemId(e),s=this.rowFor(e);i&&s?(this.source=e,e.setAttribute("data-dragging","true"),t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",i)),function(t,e){if(!t||"function"!=typeof t.setDragImage)return;const{height:i}=e.getBoundingClientRect();t.setDragImage(e,16,Math.max(0,i/2))}(t.dataTransfer,s)):t.preventDefault()};onDragOver=t=>{if(!this.source)return;const e=this.itemFromEvent(t);if(!e||e===this.source)return void this.clearTarget();const i=this.rowFor(e);if(!i)return;const s=function(t,e,i){const s=t.height>0?Math.min(1,Math.max(0,(e-t.top)/t.height)):.5;return i?s<.25?"before":s>.75?"after":"inside":s<.5?"before":"after"}(i.getBoundingClientRect(),t.clientY,this.acceptsChildren(e));if(!this.permitsDrop(this.source,e,s))return t.dataTransfer&&(t.dataTransfer.dropEffect="none"),void this.clearTarget();t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move"),this.target===e&&this.position===s||(this.clearTarget(),this.target=e,this.position=s,e.setAttribute("data-drop-position",s)),"inside"===s&&"false"===e.getAttribute("aria-expanded")?this.hoverIntent?.schedule(this.itemId(e)):this.hoverIntent?.cancel()};onDragLeave=t=>{const e=t.relatedTarget;e instanceof Node&&this.host.contains(e)||this.clearTarget()};onDrop=t=>{if(!this.source||!this.target||!this.position)return;t.preventDefault();const e=this.itemId(this.source),i=this.itemId(this.target);if(e&&i){const t=this.itemMetadata(this.source),s=this.itemMetadata(this.target);r(this.host,"reorder",{sourceId:e,targetId:i,position:this.position,sourceType:t.type,targetType:s.type,sourceScope:t.scope,targetScope:s.scope,trigger:"pointer"})}this.finishDrag()};onDragEnd=()=>{this.finishDrag()};visibleItems(){return Array.from(this.host.querySelectorAll("ui-tree-item")).filter((t=>t.getClientRects().length>0&&!t.hasAttribute("disabled")))}onKeyDown=t=>{const e=this.itemFromEvent(t);if(!e)return;const i=this.visibleItems(),s=i.indexOf(e);if(s<0)return;const r="ArrowDown"===t.key?i[s+1]:"ArrowUp"===t.key?i[s-1]:null;r&&(t.preventDefault(),r.focus())};render(){return i(s,{key:"5761d2840d2694340a4b937d46522f15f81973ac",role:"tree","aria-label":this.label||"Tree"},i("slot",{key:"08e5a7b489eed4f4eae9de6462104fd12defd336"}))}};n.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{n as ui_tree}
|