@multiplatform.one/rich-text 6.3.0 → 6.4.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.
- package/dist/cjs/RichEditor.cjs +5 -0
- package/dist/cjs/RichEditor.native.js +22 -0
- package/dist/cjs/RichEditor.native.js.map +1 -1
- package/dist/cjs/RichTextEditor/index.cjs +2 -0
- package/dist/cjs/RichTextEditor/index.native.js +2 -0
- package/dist/cjs/RichTextEditor/index.native.js.map +1 -1
- package/dist/cjs/editor/SlashCommands.cjs +8 -1
- package/dist/cjs/editor/SlashCommands.native.js +14 -1
- package/dist/cjs/editor/SlashCommands.native.js.map +1 -1
- package/dist/cjs/editor/TentapEditor.native.js +15 -0
- package/dist/cjs/editor/TentapEditor.native.js.map +1 -1
- package/dist/cjs/editor/TiptapEditor.cjs +26 -230
- package/dist/cjs/editor/TiptapEditor.native.js +34 -280
- package/dist/cjs/editor/TiptapEditor.native.js.map +1 -1
- package/dist/cjs/editor/capabilities.cjs +37 -0
- package/dist/cjs/editor/capabilities.native.js +41 -0
- package/dist/cjs/editor/capabilities.native.js.map +1 -0
- package/dist/cjs/editor/extensions.cjs +275 -0
- package/dist/cjs/editor/extensions.native.js +328 -0
- package/dist/cjs/editor/extensions.native.js.map +1 -0
- package/dist/cjs/index.cjs +5 -2
- package/dist/cjs/index.native.js +4 -1
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/toolbar/BubbleToolbar.cjs +9 -6
- package/dist/cjs/toolbar/BubbleToolbar.native.js +12 -7
- package/dist/cjs/toolbar/BubbleToolbar.native.js.map +1 -1
- package/dist/cjs/toolbar/FixedToolbar.cjs +6 -3
- package/dist/cjs/toolbar/MoreDropdown.cjs +17 -9
- package/dist/cjs/toolbar/MoreDropdown.native.js +21 -9
- package/dist/cjs/toolbar/MoreDropdown.native.js.map +1 -1
- package/dist/cjs/toolbar/TableBubble.cjs +15 -2
- package/dist/cjs/toolbar/TableBubble.native.js +17 -2
- package/dist/cjs/toolbar/TableBubble.native.js.map +1 -1
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/esm/RichEditor.mjs +5 -0
- package/dist/esm/RichEditor.mjs.map +1 -1
- package/dist/esm/RichEditor.native.js +22 -0
- package/dist/esm/RichEditor.native.js.map +1 -1
- package/dist/esm/RichTextEditor/index.mjs +2 -0
- package/dist/esm/RichTextEditor/index.mjs.map +1 -1
- package/dist/esm/RichTextEditor/index.native.js +2 -0
- package/dist/esm/RichTextEditor/index.native.js.map +1 -1
- package/dist/esm/editor/SlashCommands.mjs +8 -1
- package/dist/esm/editor/SlashCommands.mjs.map +1 -1
- package/dist/esm/editor/SlashCommands.native.js +14 -1
- package/dist/esm/editor/SlashCommands.native.js.map +1 -1
- package/dist/esm/editor/TentapEditor.native.js +15 -0
- package/dist/esm/editor/TentapEditor.native.js.map +1 -1
- package/dist/esm/editor/TiptapEditor.mjs +28 -221
- package/dist/esm/editor/TiptapEditor.mjs.map +1 -1
- package/dist/esm/editor/TiptapEditor.native.js +36 -271
- package/dist/esm/editor/TiptapEditor.native.js.map +1 -1
- package/dist/esm/editor/capabilities.mjs +10 -0
- package/dist/esm/editor/capabilities.mjs.map +1 -0
- package/dist/esm/editor/capabilities.native.js +11 -0
- package/dist/esm/editor/capabilities.native.js.map +1 -0
- package/dist/esm/editor/extensions.mjs +236 -0
- package/dist/esm/editor/extensions.mjs.map +1 -0
- package/dist/esm/editor/extensions.native.js +286 -0
- package/dist/esm/editor/extensions.native.js.map +1 -0
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +2 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/toolbar/BubbleToolbar.mjs +9 -6
- package/dist/esm/toolbar/BubbleToolbar.mjs.map +1 -1
- package/dist/esm/toolbar/BubbleToolbar.native.js +12 -7
- package/dist/esm/toolbar/BubbleToolbar.native.js.map +1 -1
- package/dist/esm/toolbar/FixedToolbar.mjs +6 -3
- package/dist/esm/toolbar/FixedToolbar.mjs.map +1 -1
- package/dist/esm/toolbar/MoreDropdown.mjs +17 -9
- package/dist/esm/toolbar/MoreDropdown.mjs.map +1 -1
- package/dist/esm/toolbar/MoreDropdown.native.js +21 -9
- package/dist/esm/toolbar/MoreDropdown.native.js.map +1 -1
- package/dist/esm/toolbar/TableBubble.mjs +15 -2
- package/dist/esm/toolbar/TableBubble.mjs.map +1 -1
- package/dist/esm/toolbar/TableBubble.native.js +17 -2
- package/dist/esm/toolbar/TableBubble.native.js.map +1 -1
- package/dist/esm/types.mjs.map +1 -1
- package/dist/esm/types.native.js.map +1 -1
- package/dist/jsx/RichEditor.mjs +5 -0
- package/dist/jsx/RichEditor.mjs.map +1 -1
- package/dist/jsx/RichEditor.native.js +22 -0
- package/dist/jsx/RichEditor.native.js.map +1 -1
- package/dist/jsx/RichTextEditor/index.mjs +2 -0
- package/dist/jsx/RichTextEditor/index.mjs.map +1 -1
- package/dist/jsx/RichTextEditor/index.native.js +2 -0
- package/dist/jsx/RichTextEditor/index.native.js.map +1 -1
- package/dist/jsx/editor/SlashCommands.mjs +8 -1
- package/dist/jsx/editor/SlashCommands.mjs.map +1 -1
- package/dist/jsx/editor/SlashCommands.native.js +14 -1
- package/dist/jsx/editor/SlashCommands.native.js.map +1 -1
- package/dist/jsx/editor/TentapEditor.native.js +15 -0
- package/dist/jsx/editor/TentapEditor.native.js.map +1 -1
- package/dist/jsx/editor/TiptapEditor.mjs +28 -221
- package/dist/jsx/editor/TiptapEditor.mjs.map +1 -1
- package/dist/jsx/editor/TiptapEditor.native.js +34 -280
- package/dist/jsx/editor/TiptapEditor.native.js.map +1 -1
- package/dist/jsx/editor/capabilities.mjs +10 -0
- package/dist/jsx/editor/capabilities.mjs.map +1 -0
- package/dist/jsx/editor/capabilities.native.js +41 -0
- package/dist/jsx/editor/capabilities.native.js.map +1 -0
- package/dist/jsx/editor/extensions.mjs +236 -0
- package/dist/jsx/editor/extensions.mjs.map +1 -0
- package/dist/jsx/editor/extensions.native.js +328 -0
- package/dist/jsx/editor/extensions.native.js.map +1 -0
- package/dist/jsx/index.js +2 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +2 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +4 -1
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/toolbar/BubbleToolbar.mjs +9 -6
- package/dist/jsx/toolbar/BubbleToolbar.mjs.map +1 -1
- package/dist/jsx/toolbar/BubbleToolbar.native.js +12 -7
- package/dist/jsx/toolbar/BubbleToolbar.native.js.map +1 -1
- package/dist/jsx/toolbar/FixedToolbar.mjs +6 -3
- package/dist/jsx/toolbar/FixedToolbar.mjs.map +1 -1
- package/dist/jsx/toolbar/MoreDropdown.mjs +17 -9
- package/dist/jsx/toolbar/MoreDropdown.mjs.map +1 -1
- package/dist/jsx/toolbar/MoreDropdown.native.js +21 -9
- package/dist/jsx/toolbar/MoreDropdown.native.js.map +1 -1
- package/dist/jsx/toolbar/TableBubble.mjs +15 -2
- package/dist/jsx/toolbar/TableBubble.mjs.map +1 -1
- package/dist/jsx/toolbar/TableBubble.native.js +17 -2
- package/dist/jsx/toolbar/TableBubble.native.js.map +1 -1
- package/dist/jsx/types.mjs.map +1 -1
- package/dist/jsx/types.native.js.map +1 -1
- package/package.json +8 -8
- package/src/RichEditor.native.tsx +20 -0
- package/src/RichEditor.stories.tsx +32 -0
- package/src/RichEditor.tsx +5 -0
- package/src/RichTextEditor/index.tsx +14 -1
- package/src/editor/SlashCommands.tsx +10 -0
- package/src/editor/TentapEditor.native.tsx +13 -0
- package/src/editor/TiptapEditor.tsx +51 -279
- package/src/editor/capabilities.spec.ts +190 -0
- package/src/editor/capabilities.ts +76 -0
- package/src/editor/extensions.ts +315 -0
- package/src/index.ts +3 -0
- package/src/toolbar/BubbleToolbar.tsx +40 -28
- package/src/toolbar/FixedToolbar.tsx +20 -12
- package/src/toolbar/MoreDropdown.tsx +30 -6
- package/src/toolbar/TableBubble.tsx +65 -12
- package/src/types.ts +28 -1
- package/types/RichEditor.d.ts.map +1 -1
- package/types/RichEditor.native.d.ts.map +1 -1
- package/types/RichTextEditor/index.d.ts +7 -1
- package/types/RichTextEditor/index.d.ts.map +1 -1
- package/types/editor/SlashCommands.d.ts.map +1 -1
- package/types/editor/TentapEditor.native.d.ts.map +1 -1
- package/types/editor/TiptapEditor.d.ts.map +1 -1
- package/types/editor/capabilities.d.ts +29 -0
- package/types/editor/capabilities.d.ts.map +1 -0
- package/types/editor/extensions.d.ts +41 -0
- package/types/editor/extensions.d.ts.map +1 -0
- package/types/index.d.ts +2 -1
- package/types/index.d.ts.map +1 -1
- package/types/toolbar/BubbleToolbar.d.ts +4 -2
- package/types/toolbar/BubbleToolbar.d.ts.map +1 -1
- package/types/toolbar/FixedToolbar.d.ts +4 -2
- package/types/toolbar/FixedToolbar.d.ts.map +1 -1
- package/types/toolbar/MoreDropdown.d.ts +4 -2
- package/types/toolbar/MoreDropdown.d.ts.map +1 -1
- package/types/toolbar/TableBubble.d.ts +4 -1
- package/types/toolbar/TableBubble.d.ts.map +1 -1
- package/types/types.d.ts +23 -1
- package/types/types.d.ts.map +1 -1
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: true
|
|
33
|
+
}), mod);
|
|
34
|
+
var extensions_exports = {};
|
|
35
|
+
__export(extensions_exports, {
|
|
36
|
+
CodeBlockTabIndent: () => CodeBlockTabIndent,
|
|
37
|
+
ListItemKeys: () => ListItemKeys,
|
|
38
|
+
ParagraphEnterKeys: () => ParagraphEnterKeys,
|
|
39
|
+
buildEditorExtensions: () => buildEditorExtensions
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(extensions_exports);
|
|
42
|
+
var import_core = require("@tiptap/core");
|
|
43
|
+
var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
|
|
44
|
+
var import_extension_placeholder = __toESM(require("@tiptap/extension-placeholder"));
|
|
45
|
+
var import_extension_text_align = __toESM(require("@tiptap/extension-text-align"));
|
|
46
|
+
var import_extension_color = require("@tiptap/extension-color");
|
|
47
|
+
var import_extension_text_style = require("@tiptap/extension-text-style");
|
|
48
|
+
var import_extension_highlight = require("@tiptap/extension-highlight");
|
|
49
|
+
var import_extension_subscript = require("@tiptap/extension-subscript");
|
|
50
|
+
var import_extension_superscript = require("@tiptap/extension-superscript");
|
|
51
|
+
var import_extension_task_list = __toESM(require("@tiptap/extension-task-list"));
|
|
52
|
+
var import_extension_task_item = __toESM(require("@tiptap/extension-task-item"));
|
|
53
|
+
var import_extension_image = __toESM(require("@tiptap/extension-image"));
|
|
54
|
+
var import_extension_typography = __toESM(require("@tiptap/extension-typography"));
|
|
55
|
+
var import_extension_character_count = __toESM(require("@tiptap/extension-character-count"));
|
|
56
|
+
var import_extension_details = require("@tiptap/extension-details");
|
|
57
|
+
var import_extension_table = require("@tiptap/extension-table");
|
|
58
|
+
var import_extension_table_row = require("@tiptap/extension-table-row");
|
|
59
|
+
var import_extension_table_header = require("@tiptap/extension-table-header");
|
|
60
|
+
var import_extension_table_cell = require("@tiptap/extension-table-cell");
|
|
61
|
+
var import_lowlight = require("lowlight");
|
|
62
|
+
var import_capabilities = require("./capabilities.cjs");
|
|
63
|
+
var import_SlashCommands = require("./SlashCommands.cjs");
|
|
64
|
+
var import_MarkdownPaste = require("./MarkdownPaste.cjs");
|
|
65
|
+
var import_BlockDragHandle = require("./BlockDragHandle.cjs");
|
|
66
|
+
var import_media = require("./media.cjs");
|
|
67
|
+
var import_emoji = require("./emoji.cjs");
|
|
68
|
+
var import_mathematics = require("./mathematics.cjs");
|
|
69
|
+
var import_codeBlockPreview = require("./codeBlockPreview.cjs");
|
|
70
|
+
var import_suggestionPopup = require("./suggestionPopup.cjs");
|
|
71
|
+
var import_t = require("../shared/t.cjs");
|
|
72
|
+
const lowlight = (0, import_lowlight.createLowlight)(import_lowlight.common);
|
|
73
|
+
const CodeBlockTabIndent = import_core.Extension.create({
|
|
74
|
+
name: "codeBlockTabIndent",
|
|
75
|
+
addKeyboardShortcuts() {
|
|
76
|
+
return {
|
|
77
|
+
Tab: ({
|
|
78
|
+
editor
|
|
79
|
+
}) => {
|
|
80
|
+
if (!editor.isActive("codeBlock")) return false;
|
|
81
|
+
const {
|
|
82
|
+
state,
|
|
83
|
+
dispatch
|
|
84
|
+
} = editor.view;
|
|
85
|
+
const {
|
|
86
|
+
from,
|
|
87
|
+
to
|
|
88
|
+
} = state.selection;
|
|
89
|
+
if (from === to) {
|
|
90
|
+
dispatch(state.tr.insertText(" ", from, to));
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
const doc = state.doc;
|
|
94
|
+
const lines = [];
|
|
95
|
+
doc.nodesBetween(from, to, (node, pos) => {
|
|
96
|
+
if (node.isTextblock) {
|
|
97
|
+
lines.push({
|
|
98
|
+
start: pos + 1
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
if (lines.length === 0) {
|
|
103
|
+
dispatch(state.tr.insertText(" ", from, to));
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
let tr = state.tr;
|
|
107
|
+
let offset = 0;
|
|
108
|
+
for (const line of lines) {
|
|
109
|
+
const lineStart = line.start + offset;
|
|
110
|
+
tr = tr.insertText(" ", lineStart);
|
|
111
|
+
offset += 2;
|
|
112
|
+
}
|
|
113
|
+
dispatch(tr);
|
|
114
|
+
return true;
|
|
115
|
+
},
|
|
116
|
+
"Shift-Tab": ({
|
|
117
|
+
editor
|
|
118
|
+
}) => {
|
|
119
|
+
if (!editor.isActive("codeBlock")) return false;
|
|
120
|
+
const {
|
|
121
|
+
state,
|
|
122
|
+
dispatch
|
|
123
|
+
} = editor.view;
|
|
124
|
+
const {
|
|
125
|
+
from,
|
|
126
|
+
to,
|
|
127
|
+
$from
|
|
128
|
+
} = state.selection;
|
|
129
|
+
if (from === to) {
|
|
130
|
+
const lineStart = from - $from.parentOffset;
|
|
131
|
+
const text = state.doc.textBetween(lineStart, from);
|
|
132
|
+
const leadingSpaces = text.match(/^ {1,2}/)?.[0];
|
|
133
|
+
if (leadingSpaces) {
|
|
134
|
+
dispatch(state.tr.delete(lineStart, lineStart + leadingSpaces.length));
|
|
135
|
+
}
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
const doc = state.doc;
|
|
139
|
+
let tr = state.tr;
|
|
140
|
+
let offset = 0;
|
|
141
|
+
doc.nodesBetween(from, to, (node, pos) => {
|
|
142
|
+
if (node.isTextblock) {
|
|
143
|
+
const lineStart = pos + 1 + offset;
|
|
144
|
+
const text = tr.doc.textBetween(lineStart, Math.min(lineStart + node.content.size, tr.doc.content.size));
|
|
145
|
+
const leadingSpaces = text.match(/^ {1,2}/)?.[0];
|
|
146
|
+
if (leadingSpaces) {
|
|
147
|
+
tr = tr.delete(lineStart, lineStart + leadingSpaces.length);
|
|
148
|
+
offset -= leadingSpaces.length;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
dispatch(tr);
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
const ParagraphEnterKeys = import_core.Extension.create({
|
|
159
|
+
name: "paragraphEnterKeys",
|
|
160
|
+
priority: 1e3,
|
|
161
|
+
addKeyboardShortcuts() {
|
|
162
|
+
return {
|
|
163
|
+
"Shift-Enter": ({
|
|
164
|
+
editor
|
|
165
|
+
}) => editor.commands.first([() => editor.commands.newlineInCode(), () => editor.commands.splitListItem("listItem"), () => editor.commands.createParagraphNear(), () => editor.commands.liftEmptyBlock(), () => editor.commands.splitBlock()]),
|
|
166
|
+
"Mod-Enter": ({
|
|
167
|
+
editor
|
|
168
|
+
}) => editor.commands.first([() => editor.commands.newlineInCode(), () => editor.commands.createParagraphNear(), () => editor.commands.liftEmptyBlock(), () => editor.commands.splitBlock()])
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
const ListItemKeys = import_core.Extension.create({
|
|
173
|
+
name: "listItemKeys",
|
|
174
|
+
addKeyboardShortcuts() {
|
|
175
|
+
return {
|
|
176
|
+
Tab: ({
|
|
177
|
+
editor
|
|
178
|
+
}) => {
|
|
179
|
+
if (editor.isActive("codeBlock")) return false;
|
|
180
|
+
if (editor.isActive("bulletList") || editor.isActive("orderedList") || editor.isActive("taskList")) {
|
|
181
|
+
return editor.commands.sinkListItem("listItem") || editor.commands.sinkListItem("taskItem");
|
|
182
|
+
}
|
|
183
|
+
return false;
|
|
184
|
+
},
|
|
185
|
+
"Shift-Tab": ({
|
|
186
|
+
editor
|
|
187
|
+
}) => {
|
|
188
|
+
if (editor.isActive("codeBlock")) return false;
|
|
189
|
+
if (editor.isActive("bulletList") || editor.isActive("orderedList") || editor.isActive("taskList")) {
|
|
190
|
+
return editor.commands.liftListItem("listItem") || editor.commands.liftListItem("taskItem");
|
|
191
|
+
}
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
function buildEditorExtensions({
|
|
198
|
+
capabilities = "full",
|
|
199
|
+
placeholder,
|
|
200
|
+
mentionExtension = null
|
|
201
|
+
} = {}) {
|
|
202
|
+
const markdown = capabilities === "markdown";
|
|
203
|
+
return [import_starter_kit.default.configure({
|
|
204
|
+
heading: {
|
|
205
|
+
levels: [1, 2, 3, 4, 5, 6],
|
|
206
|
+
HTMLAttributes: {
|
|
207
|
+
dir: "auto"
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
paragraph: {
|
|
211
|
+
HTMLAttributes: {
|
|
212
|
+
dir: "auto"
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
link: {
|
|
216
|
+
openOnClick: false,
|
|
217
|
+
HTMLAttributes: {
|
|
218
|
+
rel: "noopener noreferrer",
|
|
219
|
+
target: "_blank"
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
bulletList: {
|
|
223
|
+
keepMarks: true
|
|
224
|
+
},
|
|
225
|
+
orderedList: {
|
|
226
|
+
keepMarks: true
|
|
227
|
+
},
|
|
228
|
+
codeBlock: false,
|
|
229
|
+
hardBreak: false,
|
|
230
|
+
// Markdown has no underline syntax — the mark must not exist
|
|
231
|
+
...(markdown && {
|
|
232
|
+
underline: false
|
|
233
|
+
})
|
|
234
|
+
}), import_codeBlockPreview.CodeBlockWithPreview.configure({
|
|
235
|
+
lowlight,
|
|
236
|
+
exitOnTripleEnter: true,
|
|
237
|
+
exitOnArrowDown: false
|
|
238
|
+
}), ParagraphEnterKeys, CodeBlockTabIndent, ListItemKeys,
|
|
239
|
+
// superscriptTwo/Three would mangle typed TeX (`$E=mc^2$` became
|
|
240
|
+
// `E=mc²` before the math input rule ran) — off, rest stays.
|
|
241
|
+
import_extension_typography.default.configure({
|
|
242
|
+
superscriptTwo: false,
|
|
243
|
+
superscriptThree: false
|
|
244
|
+
}), import_extension_character_count.default, import_SlashCommands.SlashCommands.configure({
|
|
245
|
+
excludeIds: markdown ? [...import_capabilities.MARKDOWN_EXCLUDED_SLASH_IDS] : []
|
|
246
|
+
}), import_MarkdownPaste.MarkdownPaste, import_media.MediaUpload, import_suggestionPopup.SuggestionChromeStore, import_codeBlockPreview.PreviewChromeStore,
|
|
247
|
+
// Emoji suggestions insert plain unicode characters (just text), so
|
|
248
|
+
// they stay available in markdown capabilities.
|
|
249
|
+
import_emoji.EmojiSuggestion, ...(markdown ? [] : [import_mathematics.InlineMath,
|
|
250
|
+
// Collapsible sections (GitLab <details> parity). persist: true
|
|
251
|
+
// is the extension's supported mode: its node view re-syncs the
|
|
252
|
+
// open state from node.attrs on every update, so ephemeral
|
|
253
|
+
// (persist: false) toggles get reverted by the next transaction.
|
|
254
|
+
// The open state therefore lives in the doc and serializes as
|
|
255
|
+
// `<details open>` — valid GitLab markdown.
|
|
256
|
+
import_extension_details.Details.configure({
|
|
257
|
+
persist: true
|
|
258
|
+
}), import_extension_details.DetailsSummary, import_extension_details.DetailsContent]),
|
|
259
|
+
// Mention chips have no markdown representation — full surface only
|
|
260
|
+
...(mentionExtension && !markdown ? [mentionExtension] : []), import_BlockDragHandle.BlockDragHandle, import_extension_table.Table.configure({
|
|
261
|
+
resizable: true
|
|
262
|
+
}), import_extension_table_row.TableRow, import_extension_table_header.TableHeader, import_extension_table_cell.TableCell, import_extension_placeholder.default.configure({
|
|
263
|
+
placeholder: placeholder ?? (0, import_t.t)("Start writing...")
|
|
264
|
+
}), ...(markdown ? [] : [import_extension_text_align.default.configure({
|
|
265
|
+
types: ["heading", "paragraph"],
|
|
266
|
+
defaultAlignment: "left"
|
|
267
|
+
}), import_extension_text_style.TextStyle, import_extension_color.Color, import_extension_highlight.Highlight.configure({
|
|
268
|
+
multicolor: true
|
|
269
|
+
}), import_extension_subscript.Subscript, import_extension_superscript.Superscript]), import_extension_task_list.default, import_extension_task_item.default.configure({
|
|
270
|
+
nested: true
|
|
271
|
+
}), import_extension_image.default.configure({
|
|
272
|
+
inline: true,
|
|
273
|
+
allowBase64: true
|
|
274
|
+
})];
|
|
275
|
+
}
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
+
get: () => from[key],
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
+
value: mod,
|
|
31
|
+
enumerable: true
|
|
32
|
+
}) : target, mod));
|
|
33
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
|
+
value: true
|
|
35
|
+
}), mod);
|
|
36
|
+
var extensions_exports = {};
|
|
37
|
+
__export(extensions_exports, {
|
|
38
|
+
CodeBlockTabIndent: () => CodeBlockTabIndent,
|
|
39
|
+
ListItemKeys: () => ListItemKeys,
|
|
40
|
+
ParagraphEnterKeys: () => ParagraphEnterKeys,
|
|
41
|
+
buildEditorExtensions: () => buildEditorExtensions
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(extensions_exports);
|
|
44
|
+
var import_core = require("@tiptap/core");
|
|
45
|
+
var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
|
|
46
|
+
var import_extension_placeholder = __toESM(require("@tiptap/extension-placeholder"));
|
|
47
|
+
var import_extension_text_align = __toESM(require("@tiptap/extension-text-align"));
|
|
48
|
+
var import_extension_color = require("@tiptap/extension-color");
|
|
49
|
+
var import_extension_text_style = require("@tiptap/extension-text-style");
|
|
50
|
+
var import_extension_highlight = require("@tiptap/extension-highlight");
|
|
51
|
+
var import_extension_subscript = require("@tiptap/extension-subscript");
|
|
52
|
+
var import_extension_superscript = require("@tiptap/extension-superscript");
|
|
53
|
+
var import_extension_task_list = __toESM(require("@tiptap/extension-task-list"));
|
|
54
|
+
var import_extension_task_item = __toESM(require("@tiptap/extension-task-item"));
|
|
55
|
+
var import_extension_image = __toESM(require("@tiptap/extension-image"));
|
|
56
|
+
var import_extension_typography = __toESM(require("@tiptap/extension-typography"));
|
|
57
|
+
var import_extension_character_count = __toESM(require("@tiptap/extension-character-count"));
|
|
58
|
+
var import_extension_details = require("@tiptap/extension-details");
|
|
59
|
+
var import_extension_table = require("@tiptap/extension-table");
|
|
60
|
+
var import_extension_table_row = require("@tiptap/extension-table-row");
|
|
61
|
+
var import_extension_table_header = require("@tiptap/extension-table-header");
|
|
62
|
+
var import_extension_table_cell = require("@tiptap/extension-table-cell");
|
|
63
|
+
var import_lowlight = require("lowlight");
|
|
64
|
+
var import_capabilities = require("./capabilities.native.js");
|
|
65
|
+
var import_SlashCommands = require("./SlashCommands.native.js");
|
|
66
|
+
var import_MarkdownPaste = require("./MarkdownPaste.native.js");
|
|
67
|
+
var import_BlockDragHandle = require("./BlockDragHandle.native.js");
|
|
68
|
+
var import_media = require("./media.native.js");
|
|
69
|
+
var import_emoji = require("./emoji.native.js");
|
|
70
|
+
var import_mathematics = require("./mathematics.native.js");
|
|
71
|
+
var import_codeBlockPreview = require("./codeBlockPreview.native.js");
|
|
72
|
+
var import_suggestionPopup = require("./suggestionPopup.native.js");
|
|
73
|
+
var import_t = require("../shared/t.native.js");
|
|
74
|
+
var lowlight = (0, import_lowlight.createLowlight)(import_lowlight.common);
|
|
75
|
+
var CodeBlockTabIndent = import_core.Extension.create({
|
|
76
|
+
name: "codeBlockTabIndent",
|
|
77
|
+
addKeyboardShortcuts() {
|
|
78
|
+
return {
|
|
79
|
+
Tab: function Tab(param) {
|
|
80
|
+
var {
|
|
81
|
+
editor
|
|
82
|
+
} = param;
|
|
83
|
+
if (!editor.isActive("codeBlock")) return false;
|
|
84
|
+
var {
|
|
85
|
+
state,
|
|
86
|
+
dispatch
|
|
87
|
+
} = editor.view;
|
|
88
|
+
var {
|
|
89
|
+
from,
|
|
90
|
+
to
|
|
91
|
+
} = state.selection;
|
|
92
|
+
if (from === to) {
|
|
93
|
+
dispatch(state.tr.insertText(" ", from, to));
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
var doc = state.doc;
|
|
97
|
+
var lines = [];
|
|
98
|
+
doc.nodesBetween(from, to, function (node, pos) {
|
|
99
|
+
if (node.isTextblock) {
|
|
100
|
+
lines.push({
|
|
101
|
+
start: pos + 1
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
if (lines.length === 0) {
|
|
106
|
+
dispatch(state.tr.insertText(" ", from, to));
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
var tr = state.tr;
|
|
110
|
+
var offset = 0;
|
|
111
|
+
var _iteratorNormalCompletion = true,
|
|
112
|
+
_didIteratorError = false,
|
|
113
|
+
_iteratorError = void 0;
|
|
114
|
+
try {
|
|
115
|
+
for (var _iterator = lines[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
116
|
+
var line = _step.value;
|
|
117
|
+
var lineStart = line.start + offset;
|
|
118
|
+
tr = tr.insertText(" ", lineStart);
|
|
119
|
+
offset += 2;
|
|
120
|
+
}
|
|
121
|
+
} catch (err) {
|
|
122
|
+
_didIteratorError = true;
|
|
123
|
+
_iteratorError = err;
|
|
124
|
+
} finally {
|
|
125
|
+
try {
|
|
126
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
127
|
+
_iterator.return();
|
|
128
|
+
}
|
|
129
|
+
} finally {
|
|
130
|
+
if (_didIteratorError) {
|
|
131
|
+
throw _iteratorError;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
dispatch(tr);
|
|
136
|
+
return true;
|
|
137
|
+
},
|
|
138
|
+
"Shift-Tab": function (param) {
|
|
139
|
+
var {
|
|
140
|
+
editor
|
|
141
|
+
} = param;
|
|
142
|
+
if (!editor.isActive("codeBlock")) return false;
|
|
143
|
+
var {
|
|
144
|
+
state,
|
|
145
|
+
dispatch
|
|
146
|
+
} = editor.view;
|
|
147
|
+
var {
|
|
148
|
+
from,
|
|
149
|
+
to,
|
|
150
|
+
$from
|
|
151
|
+
} = state.selection;
|
|
152
|
+
if (from === to) {
|
|
153
|
+
var _text_match;
|
|
154
|
+
var lineStart = from - $from.parentOffset;
|
|
155
|
+
var text = state.doc.textBetween(lineStart, from);
|
|
156
|
+
var leadingSpaces = (_text_match = text.match(/^ {1,2}/)) === null || _text_match === void 0 ? void 0 : _text_match[0];
|
|
157
|
+
if (leadingSpaces) {
|
|
158
|
+
dispatch(state.tr.delete(lineStart, lineStart + leadingSpaces.length));
|
|
159
|
+
}
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
var doc = state.doc;
|
|
163
|
+
var tr = state.tr;
|
|
164
|
+
var offset = 0;
|
|
165
|
+
doc.nodesBetween(from, to, function (node, pos) {
|
|
166
|
+
if (node.isTextblock) {
|
|
167
|
+
var _text_match2;
|
|
168
|
+
var lineStart2 = pos + 1 + offset;
|
|
169
|
+
var text2 = tr.doc.textBetween(lineStart2, Math.min(lineStart2 + node.content.size, tr.doc.content.size));
|
|
170
|
+
var leadingSpaces2 = (_text_match2 = text2.match(/^ {1,2}/)) === null || _text_match2 === void 0 ? void 0 : _text_match2[0];
|
|
171
|
+
if (leadingSpaces2) {
|
|
172
|
+
tr = tr.delete(lineStart2, lineStart2 + leadingSpaces2.length);
|
|
173
|
+
offset -= leadingSpaces2.length;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
dispatch(tr);
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
var ParagraphEnterKeys = import_core.Extension.create({
|
|
184
|
+
name: "paragraphEnterKeys",
|
|
185
|
+
priority: 1e3,
|
|
186
|
+
addKeyboardShortcuts() {
|
|
187
|
+
return {
|
|
188
|
+
"Shift-Enter": function (param) {
|
|
189
|
+
var {
|
|
190
|
+
editor
|
|
191
|
+
} = param;
|
|
192
|
+
return editor.commands.first([function () {
|
|
193
|
+
return editor.commands.newlineInCode();
|
|
194
|
+
}, function () {
|
|
195
|
+
return editor.commands.splitListItem("listItem");
|
|
196
|
+
}, function () {
|
|
197
|
+
return editor.commands.createParagraphNear();
|
|
198
|
+
}, function () {
|
|
199
|
+
return editor.commands.liftEmptyBlock();
|
|
200
|
+
}, function () {
|
|
201
|
+
return editor.commands.splitBlock();
|
|
202
|
+
}]);
|
|
203
|
+
},
|
|
204
|
+
"Mod-Enter": function (param) {
|
|
205
|
+
var {
|
|
206
|
+
editor
|
|
207
|
+
} = param;
|
|
208
|
+
return editor.commands.first([function () {
|
|
209
|
+
return editor.commands.newlineInCode();
|
|
210
|
+
}, function () {
|
|
211
|
+
return editor.commands.createParagraphNear();
|
|
212
|
+
}, function () {
|
|
213
|
+
return editor.commands.liftEmptyBlock();
|
|
214
|
+
}, function () {
|
|
215
|
+
return editor.commands.splitBlock();
|
|
216
|
+
}]);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
var ListItemKeys = import_core.Extension.create({
|
|
222
|
+
name: "listItemKeys",
|
|
223
|
+
addKeyboardShortcuts() {
|
|
224
|
+
return {
|
|
225
|
+
Tab: function Tab(param) {
|
|
226
|
+
var {
|
|
227
|
+
editor
|
|
228
|
+
} = param;
|
|
229
|
+
if (editor.isActive("codeBlock")) return false;
|
|
230
|
+
if (editor.isActive("bulletList") || editor.isActive("orderedList") || editor.isActive("taskList")) {
|
|
231
|
+
return editor.commands.sinkListItem("listItem") || editor.commands.sinkListItem("taskItem");
|
|
232
|
+
}
|
|
233
|
+
return false;
|
|
234
|
+
},
|
|
235
|
+
"Shift-Tab": function (param) {
|
|
236
|
+
var {
|
|
237
|
+
editor
|
|
238
|
+
} = param;
|
|
239
|
+
if (editor.isActive("codeBlock")) return false;
|
|
240
|
+
if (editor.isActive("bulletList") || editor.isActive("orderedList") || editor.isActive("taskList")) {
|
|
241
|
+
return editor.commands.liftListItem("listItem") || editor.commands.liftListItem("taskItem");
|
|
242
|
+
}
|
|
243
|
+
return false;
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
function buildEditorExtensions() {
|
|
249
|
+
var {
|
|
250
|
+
capabilities = "full",
|
|
251
|
+
placeholder,
|
|
252
|
+
mentionExtension = null
|
|
253
|
+
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
254
|
+
var markdown = capabilities === "markdown";
|
|
255
|
+
return [import_starter_kit.default.configure({
|
|
256
|
+
heading: {
|
|
257
|
+
levels: [1, 2, 3, 4, 5, 6],
|
|
258
|
+
HTMLAttributes: {
|
|
259
|
+
dir: "auto"
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
paragraph: {
|
|
263
|
+
HTMLAttributes: {
|
|
264
|
+
dir: "auto"
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
link: {
|
|
268
|
+
openOnClick: false,
|
|
269
|
+
HTMLAttributes: {
|
|
270
|
+
rel: "noopener noreferrer",
|
|
271
|
+
target: "_blank"
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
bulletList: {
|
|
275
|
+
keepMarks: true
|
|
276
|
+
},
|
|
277
|
+
orderedList: {
|
|
278
|
+
keepMarks: true
|
|
279
|
+
},
|
|
280
|
+
codeBlock: false,
|
|
281
|
+
hardBreak: false,
|
|
282
|
+
// Markdown has no underline syntax — the mark must not exist
|
|
283
|
+
...(markdown && {
|
|
284
|
+
underline: false
|
|
285
|
+
})
|
|
286
|
+
}), import_codeBlockPreview.CodeBlockWithPreview.configure({
|
|
287
|
+
lowlight,
|
|
288
|
+
exitOnTripleEnter: true,
|
|
289
|
+
exitOnArrowDown: false
|
|
290
|
+
}), ParagraphEnterKeys, CodeBlockTabIndent, ListItemKeys,
|
|
291
|
+
// superscriptTwo/Three would mangle typed TeX (`$E=mc^2$` became
|
|
292
|
+
// `E=mc²` before the math input rule ran) — off, rest stays.
|
|
293
|
+
import_extension_typography.default.configure({
|
|
294
|
+
superscriptTwo: false,
|
|
295
|
+
superscriptThree: false
|
|
296
|
+
}), import_extension_character_count.default, import_SlashCommands.SlashCommands.configure({
|
|
297
|
+
excludeIds: markdown ? [...import_capabilities.MARKDOWN_EXCLUDED_SLASH_IDS] : []
|
|
298
|
+
}), import_MarkdownPaste.MarkdownPaste, import_media.MediaUpload, import_suggestionPopup.SuggestionChromeStore, import_codeBlockPreview.PreviewChromeStore,
|
|
299
|
+
// Emoji suggestions insert plain unicode characters (just text), so
|
|
300
|
+
// they stay available in markdown capabilities.
|
|
301
|
+
import_emoji.EmojiSuggestion, ...(markdown ? [] : [import_mathematics.InlineMath,
|
|
302
|
+
// Collapsible sections (GitLab <details> parity). persist: true
|
|
303
|
+
// is the extension's supported mode: its node view re-syncs the
|
|
304
|
+
// open state from node.attrs on every update, so ephemeral
|
|
305
|
+
// (persist: false) toggles get reverted by the next transaction.
|
|
306
|
+
// The open state therefore lives in the doc and serializes as
|
|
307
|
+
// `<details open>` — valid GitLab markdown.
|
|
308
|
+
import_extension_details.Details.configure({
|
|
309
|
+
persist: true
|
|
310
|
+
}), import_extension_details.DetailsSummary, import_extension_details.DetailsContent]),
|
|
311
|
+
// Mention chips have no markdown representation — full surface only
|
|
312
|
+
...(mentionExtension && !markdown ? [mentionExtension] : []), import_BlockDragHandle.BlockDragHandle, import_extension_table.Table.configure({
|
|
313
|
+
resizable: true
|
|
314
|
+
}), import_extension_table_row.TableRow, import_extension_table_header.TableHeader, import_extension_table_cell.TableCell, import_extension_placeholder.default.configure({
|
|
315
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : (0, import_t.t)("Start writing...")
|
|
316
|
+
}), ...(markdown ? [] : [import_extension_text_align.default.configure({
|
|
317
|
+
types: ["heading", "paragraph"],
|
|
318
|
+
defaultAlignment: "left"
|
|
319
|
+
}), import_extension_text_style.TextStyle, import_extension_color.Color, import_extension_highlight.Highlight.configure({
|
|
320
|
+
multicolor: true
|
|
321
|
+
}), import_extension_subscript.Subscript, import_extension_superscript.Superscript]), import_extension_task_list.default, import_extension_task_item.default.configure({
|
|
322
|
+
nested: true
|
|
323
|
+
}), import_extension_image.default.configure({
|
|
324
|
+
inline: true,
|
|
325
|
+
allowBase64: true
|
|
326
|
+
})];
|
|
327
|
+
}
|
|
328
|
+
//# sourceMappingURL=extensions.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","extensions_exports","__export","CodeBlockTabIndent","ListItemKeys","ParagraphEnterKeys","buildEditorExtensions","module","exports","import_core","require","import_starter_kit","__toESM","import_extension_placeholder","import_extension_text_align","import_extension_color","import_extension_text_style","import_extension_highlight","import_extension_subscript","import_extension_superscript","import_extension_task_list","import_extension_task_item","import_extension_image","import_extension_typography","import_extension_character_count","import_extension_details","import_extension_table","import_extension_table_row","import_extension_table_header","import_extension_table_cell","import_lowlight","import_capabilities","import_SlashCommands","import_MarkdownPaste","import_BlockDragHandle","import_media","import_emoji","import_mathematics","import_codeBlockPreview","import_suggestionPopup","import_t","lowlight","createLowlight","common","Extension","create","name","addKeyboardShortcuts","Tab","param","editor","isActive","state","dispatch","view","from","to","selection","tr","insertText","doc","lines","nodesBetween","node","pos","isTextblock","push","start","length","offset","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Symbol","iterator","_step","next","done","line","lineStart","err","return","Shift-Tab","$from","_text_match","parentOffset","text","textBetween","leadingSpaces","match","delete","_text_match2","lineStart2","text2","Math","min","content","size","leadingSpaces2","priority","Shift-Enter","commands","first","newlineInCode","splitListItem","createParagraphNear","liftEmptyBlock","splitBlock","Mod-Enter","sinkListItem","liftListItem","capabilities","placeholder","mentionExtension","arguments","markdown","default","configure","heading","levels","HTMLAttributes","dir","paragraph","link","openOnClick","rel","target","bulletList","keepMarks","orderedList","codeBlock","hardBreak","underline","CodeBlockWithPreview","exitOnTripleEnter","exitOnArrowDown","superscriptTwo","superscriptThree"],"sources":["../../../src/editor/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= mod => __copyProps(__defProp({}, "__esModule", {
|
|
|
22
22
|
}), mod);
|
|
23
23
|
var index_exports = {};
|
|
24
24
|
__export(index_exports, {
|
|
25
|
+
MARKDOWN_COMMANDS: () => import_capabilities.MARKDOWN_COMMANDS,
|
|
25
26
|
RichEditor: () => import_RichEditor.RichEditor,
|
|
26
|
-
RichTextEditor: () => import_RichTextEditor.RichTextEditor
|
|
27
|
+
RichTextEditor: () => import_RichTextEditor.RichTextEditor,
|
|
28
|
+
isCommandInCapabilities: () => import_capabilities.isCommandInCapabilities
|
|
27
29
|
});
|
|
28
30
|
module.exports = __toCommonJS(index_exports);
|
|
29
31
|
var import_RichEditor = require("./RichEditor.cjs");
|
|
30
|
-
var import_RichTextEditor = require("./RichTextEditor/index.cjs");
|
|
32
|
+
var import_RichTextEditor = require("./RichTextEditor/index.cjs");
|
|
33
|
+
var import_capabilities = require("./editor/capabilities.cjs");
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -24,10 +24,13 @@ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
|
24
24
|
}), mod);
|
|
25
25
|
var index_exports = {};
|
|
26
26
|
__export(index_exports, {
|
|
27
|
+
MARKDOWN_COMMANDS: () => import_capabilities.MARKDOWN_COMMANDS,
|
|
27
28
|
RichEditor: () => import_RichEditor.RichEditor,
|
|
28
|
-
RichTextEditor: () => import_RichTextEditor.RichTextEditor
|
|
29
|
+
RichTextEditor: () => import_RichTextEditor.RichTextEditor,
|
|
30
|
+
isCommandInCapabilities: () => import_capabilities.isCommandInCapabilities
|
|
29
31
|
});
|
|
30
32
|
module.exports = __toCommonJS(index_exports);
|
|
31
33
|
var import_RichEditor = require("./RichEditor.native.js");
|
|
32
34
|
var import_RichTextEditor = require("./RichTextEditor/index.native.js");
|
|
35
|
+
var import_capabilities = require("./editor/capabilities.native.js");
|
|
33
36
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","__export","RichEditor","import_RichEditor","RichTextEditor","import_RichTextEditor","module","exports","require"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,QAAA,CAAAD,aAAA;EAAAE,UAAA,EAAAA,CAAA,KAAAC,iBAAA,CAAAD,UAAA;EAAAE,cAAA,EAAAA,CAAA,KAAAC,qBAAA,CAAAD;AAAA;
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","__export","MARKDOWN_COMMANDS","import_capabilities","RichEditor","import_RichEditor","RichTextEditor","import_RichTextEditor","isCommandInCapabilities","module","exports","require"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,QAAA,CAAAD,aAAA;EAAAE,iBAAA,EAAAA,CAAA,KAAAC,mBAAA,CAAAD,iBAAA;EAAAE,UAAA,EAAAA,CAAA,KAAAC,iBAAA,CAAAD,UAAA;EAAAE,cAAA,EAAAA,CAAA,KAAAC,qBAAA,CAAAD,cAAA;EAAAE,uBAAA,EAAAA,CAAA,KAAAL,mBAAA,CAAAK;AAAA;AAMAC,MAAA,CAAAC,OAAA,GAAAf,YAA2B,CAAAK,aAAA;AAG3B,IAAAK,iBAAA,GAAAM,OAA+B;AAY/B,IAAAJ,qBAAA,GAA2DI,OAAA","ignoreList":[]}
|