@ones-editor/editor 3.0.16-beta.5 → 3.0.16
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/@ones-editor/core/src/core/selection/actions/index.d.ts +2 -2
- package/@ones-editor/core/src/core/selection/actions/select-all.d.ts +1 -0
- package/@ones-editor/core/src/core/types.d.ts +2 -0
- package/@ones-editor/drawio-embed/types/index.d.ts +3 -0
- package/@ones-editor/input-handlers/src/markdown-shortcuts/markdown-input-handler.d.ts +3 -0
- package/@ones-editor/input-handlers/src/markdown-shortcuts/match-block-style.d.ts +2 -1
- package/@ones-editor/input-handlers/src/markdown-shortcuts/types.d.ts +3 -0
- package/@ones-editor/main-toolbar/src/items/text-color.d.ts +2 -0
- package/@ones-editor/markdown-to-doc/src/markdown-to-doc.d.ts +3 -1
- package/@ones-editor/markdown-to-doc/src/tokens/base.d.ts +3 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +221 -42
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export * from '../@ones-editor/layout-block';
|
|
|
30
30
|
export * from '../@ones-editor/markdown-to-doc';
|
|
31
31
|
export * from '../@ones-editor/html-to-doc';
|
|
32
32
|
export * from '../@ones-editor/main-toolbar';
|
|
33
|
+
export * from '../@ones-editor/mention';
|
|
33
34
|
export { Popup, ManualMenu, OnesEditorAutoSuggest, tippy, ManualToolbar, ManualCloseDialog, TextColorItem, shouldFocusToEditor, FixedToolbar, } from '../@ones-editor/ui-base';
|
|
34
35
|
export * from '../@ones-editor/drawio-embed';
|
|
35
36
|
export * from '../@ones-editor/block-resizer';
|
|
@@ -108,3 +109,4 @@ export interface ShowDocVersionsOptions2 {
|
|
|
108
109
|
editorOptions?: CreateOnesEditorOptions;
|
|
109
110
|
}
|
|
110
111
|
export declare function showDocVersions2(parent: HTMLElement, options: ShowDocVersionsOptions2): Promise<OnesEditorVersionsDialog>;
|
|
112
|
+
export declare function createSimpleInput(root: HTMLElement, docData: DocObject | OnesEditorDoc, options: CreateLocalEditorOptions): Promise<OnesEditor>;
|
package/dist/index.js
CHANGED
|
@@ -7802,6 +7802,38 @@ div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container
|
|
|
7802
7802
|
}
|
|
7803
7803
|
div.editor-root.readonly div.editor-content div[data-type=editor-container] .embed-block[data-embed-type=drawio] [data-src] {
|
|
7804
7804
|
cursor: zoom-in;
|
|
7805
|
+
}
|
|
7806
|
+
.command-item.menu-item[data-id=insert-drawio] {
|
|
7807
|
+
width: 100%;
|
|
7808
|
+
}
|
|
7809
|
+
.command-item.menu-item[data-id=insert-drawio] .uml-menu-item {
|
|
7810
|
+
color: #2d2d2e;
|
|
7811
|
+
user-select: none;
|
|
7812
|
+
transition: background 20ms ease-in 0s;
|
|
7813
|
+
width: 100%;
|
|
7814
|
+
height: 32px;
|
|
7815
|
+
padding: 6px 10px;
|
|
7816
|
+
display: flex;
|
|
7817
|
+
align-items: center;
|
|
7818
|
+
box-sizing: border-box;
|
|
7819
|
+
}
|
|
7820
|
+
.command-item.menu-item[data-id=insert-drawio] .uml-menu-item .menu-item-icon {
|
|
7821
|
+
display: flex;
|
|
7822
|
+
align-items: center;
|
|
7823
|
+
justify-content: center;
|
|
7824
|
+
height: 24px;
|
|
7825
|
+
width: 24px;
|
|
7826
|
+
margin-right: 5px;
|
|
7827
|
+
margin-top: -2px;
|
|
7828
|
+
display: flex;
|
|
7829
|
+
flex-direction: column;
|
|
7830
|
+
justify-content: center;
|
|
7831
|
+
}
|
|
7832
|
+
.command-item.menu-item[data-id=insert-drawio] .uml-menu-item .menu-item-name {
|
|
7833
|
+
white-space: nowrap;
|
|
7834
|
+
flex-grow: 1;
|
|
7835
|
+
display: flex;
|
|
7836
|
+
align-items: center;
|
|
7805
7837
|
}.embed-block[data-embed-type=mermaid],
|
|
7806
7838
|
.embed-block[data-embed-type=flowchart],
|
|
7807
7839
|
.embed-block[data-embed-type=plantuml] {
|
|
@@ -25216,20 +25248,20 @@ var __publicField = (obj, key, value) => {
|
|
|
25216
25248
|
function textBlockToMarkdown(editor, blockData, doc2) {
|
|
25217
25249
|
const richText2 = blockData.text || [];
|
|
25218
25250
|
const text2 = textToMarkdownText(editor, richText2, doc2);
|
|
25219
|
-
let
|
|
25251
|
+
let markdown2 = text2;
|
|
25220
25252
|
if (blockData.heading) {
|
|
25221
25253
|
const heading = blockData.heading;
|
|
25222
25254
|
const prefix = "#".repeat(heading);
|
|
25223
|
-
|
|
25255
|
+
markdown2 = `${prefix} ${markdown2}`;
|
|
25224
25256
|
}
|
|
25225
25257
|
if (blockData.quoted) {
|
|
25226
|
-
|
|
25258
|
+
markdown2 = `> ${markdown2}`;
|
|
25227
25259
|
}
|
|
25228
25260
|
if (blockData.type === "text") {
|
|
25229
|
-
|
|
25261
|
+
markdown2 = `${markdown2}
|
|
25230
25262
|
`;
|
|
25231
25263
|
}
|
|
25232
|
-
return
|
|
25264
|
+
return markdown2;
|
|
25233
25265
|
}
|
|
25234
25266
|
function styleColorToColor$1(color) {
|
|
25235
25267
|
switch (color) {
|
|
@@ -26894,8 +26926,8 @@ var __publicField = (obj, key, value) => {
|
|
|
26894
26926
|
function docToMarkdown(editor, doc2) {
|
|
26895
26927
|
const lines = doc2.blocks.root.map((b, index2) => blockToMarkdown(editor, b, doc2, [{ containerId: "root", blockIndex: index2 }]));
|
|
26896
26928
|
lines[lines.length - 1] = lines[lines.length - 1].trimEnd();
|
|
26897
|
-
const
|
|
26898
|
-
return
|
|
26929
|
+
const markdown2 = lines.join("\n");
|
|
26930
|
+
return markdown2;
|
|
26899
26931
|
}
|
|
26900
26932
|
const logger$3P = getLogger("get-text-position");
|
|
26901
26933
|
function editorGetTextPosition(editor, insertPos) {
|
|
@@ -28722,6 +28754,11 @@ var __publicField = (obj, key, value) => {
|
|
|
28722
28754
|
addClass(editor.rootContainer, "select-all");
|
|
28723
28755
|
selectParentContainer(editor, getFirstChildBlock(editor.rootContainer));
|
|
28724
28756
|
}
|
|
28757
|
+
function editorClearAll(editor) {
|
|
28758
|
+
selectParentContainer(editor, getFirstChildBlock(editor.rootContainer));
|
|
28759
|
+
editorClearSelectedContents(editor);
|
|
28760
|
+
removeClass(editor.rootContainer, "select-all");
|
|
28761
|
+
}
|
|
28725
28762
|
function editorSelectWord(editor) {
|
|
28726
28763
|
const old = editor.selection.range.focus;
|
|
28727
28764
|
if (!old.isSimple())
|
|
@@ -29898,13 +29935,13 @@ ${codeText}
|
|
|
29898
29935
|
addMetaToDoc(editor, doc2);
|
|
29899
29936
|
const htmlFragment = docToHtmlFragment(editor, doc2);
|
|
29900
29937
|
injectDocToHtmlFragment(htmlFragment, doc2);
|
|
29901
|
-
let
|
|
29938
|
+
let markdown2 = "";
|
|
29902
29939
|
if (isSelectedCodeTextBlock(editor)) {
|
|
29903
29940
|
const selectBlock = editor.selection.range.getSelectedBlocks()[0];
|
|
29904
29941
|
const container = getParentContainer(selectBlock.block);
|
|
29905
29942
|
const codeBlock2 = getParentBlock(container);
|
|
29906
29943
|
if (codeBlock2) {
|
|
29907
|
-
|
|
29944
|
+
markdown2 = getSelectedCodeBlockMarkdown(editor, docToText(editor, doc2));
|
|
29908
29945
|
}
|
|
29909
29946
|
} else {
|
|
29910
29947
|
const lines = [];
|
|
@@ -29912,11 +29949,11 @@ ${codeText}
|
|
|
29912
29949
|
lines.push(blockToMarkdown(editor, b, doc2, [{ containerId: "root", blockIndex: index2 }]));
|
|
29913
29950
|
});
|
|
29914
29951
|
lines[lines.length - 1] = lines[lines.length - 1].trimEnd();
|
|
29915
|
-
|
|
29952
|
+
markdown2 = lines.join("\n");
|
|
29916
29953
|
}
|
|
29917
29954
|
setClipboardData([{
|
|
29918
29955
|
type: "text/plain",
|
|
29919
|
-
data: new Blob([
|
|
29956
|
+
data: new Blob([markdown2], { type: "text/plain" })
|
|
29920
29957
|
}]);
|
|
29921
29958
|
return true;
|
|
29922
29959
|
}
|
|
@@ -41804,7 +41841,9 @@ ${codeText}
|
|
|
41804
41841
|
}
|
|
41805
41842
|
}
|
|
41806
41843
|
if (item.element) {
|
|
41807
|
-
|
|
41844
|
+
if (!item.useDefaultClickHandler) {
|
|
41845
|
+
return;
|
|
41846
|
+
}
|
|
41808
41847
|
}
|
|
41809
41848
|
this.emit("click", this, item, elem);
|
|
41810
41849
|
if (item.clickToClose === false) {
|
|
@@ -42731,6 +42770,9 @@ ${codeText}
|
|
|
42731
42770
|
function initMenuItem$1(item, elem) {
|
|
42732
42771
|
var _a, _b;
|
|
42733
42772
|
addClass(elem, "menu-item");
|
|
42773
|
+
if (item.className) {
|
|
42774
|
+
addClass(elem, ...item.className.split(" "));
|
|
42775
|
+
}
|
|
42734
42776
|
if (item.element) {
|
|
42735
42777
|
return;
|
|
42736
42778
|
}
|
|
@@ -42806,6 +42848,9 @@ ${codeText}
|
|
|
42806
42848
|
});
|
|
42807
42849
|
}
|
|
42808
42850
|
function initToolbarItem(item, elem, options) {
|
|
42851
|
+
if (item.className) {
|
|
42852
|
+
addClass(elem, ...item.className.split(" "));
|
|
42853
|
+
}
|
|
42809
42854
|
elem.setAttribute("data-button-id", item.id);
|
|
42810
42855
|
if (options.tooltipId && item.name && !item.disableTooltip) {
|
|
42811
42856
|
elem.setAttribute(`data-editor-tooltip-${options.tooltipId}`, item.name);
|
|
@@ -52433,7 +52478,22 @@ ${codeText}
|
|
|
52433
52478
|
var _a, _b, _c;
|
|
52434
52479
|
const list2 = blockData;
|
|
52435
52480
|
if (type === "text") {
|
|
52436
|
-
|
|
52481
|
+
let text2 = ((_a = TextBlock.convertTo) == null ? void 0 : _a.call(TextBlock, editor, blockData, doc2, "text", path)) || "";
|
|
52482
|
+
if (path.length === 1) {
|
|
52483
|
+
if (list2.checkbox === "checked") {
|
|
52484
|
+
text2 = `[x] ${text2}`;
|
|
52485
|
+
} else if (list2.checkbox === "unchecked") {
|
|
52486
|
+
text2 = `[ ] ${text2}`;
|
|
52487
|
+
}
|
|
52488
|
+
if (list2.ordered) {
|
|
52489
|
+
text2 = `${list2.start}. ${text2}`;
|
|
52490
|
+
} else {
|
|
52491
|
+
text2 = `- ${text2}`;
|
|
52492
|
+
}
|
|
52493
|
+
const level = list2.level || 0;
|
|
52494
|
+
const prefix = level > 0 ? " ".repeat(level - 1) : "";
|
|
52495
|
+
text2 = prefix + text2;
|
|
52496
|
+
}
|
|
52437
52497
|
return text2;
|
|
52438
52498
|
}
|
|
52439
52499
|
if (type === "markdown") {
|
|
@@ -67238,9 +67298,11 @@ ${codeText}
|
|
|
67238
67298
|
});
|
|
67239
67299
|
return true;
|
|
67240
67300
|
}
|
|
67241
|
-
function matchBlockStyle(editor, containerId, blockIndex, offset) {
|
|
67242
|
-
if (
|
|
67243
|
-
|
|
67301
|
+
function matchBlockStyle(editor, containerId, blockIndex, offset, options) {
|
|
67302
|
+
if ((options == null ? void 0 : options.disableHeadingShortcuts) !== true) {
|
|
67303
|
+
if (matchHeading(editor, containerId, blockIndex, offset)) {
|
|
67304
|
+
return true;
|
|
67305
|
+
}
|
|
67244
67306
|
}
|
|
67245
67307
|
if (matchBlockQuote(editor, containerId, blockIndex, offset)) {
|
|
67246
67308
|
return true;
|
|
@@ -67345,6 +67407,9 @@ ${codeText}
|
|
|
67345
67407
|
return false;
|
|
67346
67408
|
}
|
|
67347
67409
|
class MarkdownInputHandler {
|
|
67410
|
+
constructor(options) {
|
|
67411
|
+
this.options = options;
|
|
67412
|
+
}
|
|
67348
67413
|
handleAfterInsertText(editor, containerId, blockIndex, offset, text2) {
|
|
67349
67414
|
const block = editor.getBlockByIndex(containerId, blockIndex);
|
|
67350
67415
|
if (isTitleBlock$2(block)) {
|
|
@@ -67354,7 +67419,7 @@ ${codeText}
|
|
|
67354
67419
|
if (converterIntercept(editor, containerId)) {
|
|
67355
67420
|
return false;
|
|
67356
67421
|
}
|
|
67357
|
-
if (matchBlockStyle(editor, containerId, blockIndex, offset)) {
|
|
67422
|
+
if (matchBlockStyle(editor, containerId, blockIndex, offset, this.options)) {
|
|
67358
67423
|
return true;
|
|
67359
67424
|
}
|
|
67360
67425
|
if (matchTextStyle(editor, containerId, blockIndex, offset)) {
|
|
@@ -69894,8 +69959,8 @@ ${codeText}
|
|
|
69894
69959
|
return images.map((image) => `<img data-embed-type="image" data-uuid="image:${image.src}" src="${editor.doc.buildResourceUrl(image.src, { withToken: true })}">`).join("");
|
|
69895
69960
|
}
|
|
69896
69961
|
if (type === "markdown") {
|
|
69897
|
-
const
|
|
69898
|
-
return `${
|
|
69962
|
+
const markdown2 = images.map((image) => `})`).join("\n");
|
|
69963
|
+
return `${markdown2}
|
|
69899
69964
|
`;
|
|
69900
69965
|
}
|
|
69901
69966
|
return "";
|
|
@@ -75386,8 +75451,8 @@ ${codeText}
|
|
|
75386
75451
|
}
|
|
75387
75452
|
lines.push(rowText);
|
|
75388
75453
|
}
|
|
75389
|
-
const
|
|
75390
|
-
return `${
|
|
75454
|
+
const markdown2 = lines.join("\n");
|
|
75455
|
+
return `${markdown2}
|
|
75391
75456
|
`;
|
|
75392
75457
|
}
|
|
75393
75458
|
if (type === "html") {
|
|
@@ -76430,6 +76495,11 @@ ${codeText}
|
|
|
76430
76495
|
}
|
|
76431
76496
|
const logger$S = getLogger("custom-tag-to-text");
|
|
76432
76497
|
function customTagToText(token, attributes, options) {
|
|
76498
|
+
var _a;
|
|
76499
|
+
const processed = (_a = options.customTagProcess) == null ? void 0 : _a.call(options, token, attributes);
|
|
76500
|
+
if (processed) {
|
|
76501
|
+
return processed;
|
|
76502
|
+
}
|
|
76433
76503
|
const content = token.content;
|
|
76434
76504
|
try {
|
|
76435
76505
|
const base64 = content;
|
|
@@ -76642,7 +76712,7 @@ ${codeText}
|
|
|
76642
76712
|
return createTextWithReplaceSoftReturn(htmlDecode(token.text), attributes);
|
|
76643
76713
|
}
|
|
76644
76714
|
if (token.type === "custom-tag") {
|
|
76645
|
-
return customTagToText(token, attributes);
|
|
76715
|
+
return customTagToText(token, attributes, options);
|
|
76646
76716
|
}
|
|
76647
76717
|
if (token.type === "latex") {
|
|
76648
76718
|
return [{
|
|
@@ -77105,9 +77175,9 @@ ${codeText}
|
|
|
77105
77175
|
});
|
|
77106
77176
|
marked.marked.use(extendedCustomTag());
|
|
77107
77177
|
marked.marked.use(confluenceTextTag());
|
|
77108
|
-
function markdownToDoc(
|
|
77178
|
+
function markdownToDoc(markdown2, options) {
|
|
77109
77179
|
const lexer = new marked.marked.Lexer();
|
|
77110
|
-
const tokens = lexer.lex(
|
|
77180
|
+
const tokens = lexer.lex(markdown2);
|
|
77111
77181
|
const doc2 = {
|
|
77112
77182
|
blocks: {
|
|
77113
77183
|
root: []
|
|
@@ -77122,7 +77192,8 @@ ${codeText}
|
|
|
77122
77192
|
tokensToBlocks,
|
|
77123
77193
|
tokensToTextWithChildren,
|
|
77124
77194
|
htmlToDoc: options == null ? void 0 : options.htmlToDoc,
|
|
77125
|
-
listLevel: 1
|
|
77195
|
+
listLevel: 1,
|
|
77196
|
+
customTagProcess: options == null ? void 0 : options.customTagProcess
|
|
77126
77197
|
};
|
|
77127
77198
|
const rootBlocks = tokensToBlocks(tokens, tokenToBlockOptions);
|
|
77128
77199
|
if (rootBlocks.length === 0) {
|
|
@@ -77135,6 +77206,13 @@ ${codeText}
|
|
|
77135
77206
|
doc2.blocks.root.push(...rootBlocks);
|
|
77136
77207
|
return doc2;
|
|
77137
77208
|
}
|
|
77209
|
+
const markdown = `
|
|
77210
|
+
[[cursor]]
|
|
77211
|
+
`;
|
|
77212
|
+
setTimeout(() => {
|
|
77213
|
+
const doc2 = markdownToDoc(markdown);
|
|
77214
|
+
console.log(doc2);
|
|
77215
|
+
}, 100);
|
|
77138
77216
|
function extend(destination) {
|
|
77139
77217
|
for (let i = 1; i < arguments.length; i++) {
|
|
77140
77218
|
const source = arguments[i];
|
|
@@ -78700,9 +78778,9 @@ ${docStr}
|
|
|
78700
78778
|
htmlFragment = html.substring(start + "<!--StartFragment-->".length, end);
|
|
78701
78779
|
}
|
|
78702
78780
|
}
|
|
78703
|
-
const
|
|
78704
|
-
logger$P.debug(`markdown: ${
|
|
78705
|
-
return markdownToDoc(
|
|
78781
|
+
const markdown2 = turndownService.turndown(htmlFragment);
|
|
78782
|
+
logger$P.debug(`markdown: ${markdown2}`);
|
|
78783
|
+
return markdownToDoc(markdown2, {
|
|
78706
78784
|
htmlToDoc: (html2) => {
|
|
78707
78785
|
const doc2 = htmlToDocByMarkdown(html2, options);
|
|
78708
78786
|
return doc2;
|
|
@@ -88535,7 +88613,12 @@ ${data2.flowchartText}
|
|
|
88535
88613
|
function getBlockProperties$3(editor, block) {
|
|
88536
88614
|
const properties = getStandardEmbedBlockProperties(editor, block, {
|
|
88537
88615
|
handleExecuteCommand: (editor2, block2, item) => {
|
|
88616
|
+
var _a, _b;
|
|
88538
88617
|
if (item.id === "edit") {
|
|
88618
|
+
const drawioOptions = getDrawioOptions(editor2);
|
|
88619
|
+
if (((_b = (_a = drawioOptions.callbacks) == null ? void 0 : _a.onBeforeInsertDrawio) == null ? void 0 : _b.call(_a, editor2)) === false) {
|
|
88620
|
+
return true;
|
|
88621
|
+
}
|
|
88539
88622
|
const data2 = editor2.getBlockData(block2).embedData;
|
|
88540
88623
|
editGraph(editor2, block2, data2, false);
|
|
88541
88624
|
return true;
|
|
@@ -88723,30 +88806,51 @@ ${data2.flowchartText}
|
|
|
88723
88806
|
update(editor, embed, data2);
|
|
88724
88807
|
return true;
|
|
88725
88808
|
}
|
|
88726
|
-
function getOptions$3() {
|
|
88727
|
-
|
|
88728
|
-
|
|
88729
|
-
|
|
88809
|
+
function getOptions$3(editor) {
|
|
88810
|
+
var _a;
|
|
88811
|
+
const drawioOptions = getDrawioOptions(editor);
|
|
88812
|
+
const suffixElem = (_a = drawioOptions.menuItemSuffix) == null ? void 0 : _a.call(drawioOptions, editor);
|
|
88813
|
+
const element = suffixElem ? () => {
|
|
88814
|
+
const root2 = createElement("div", ["uml-menu-item"], null);
|
|
88815
|
+
const iconElem = createElement("div", ["menu-item-icon"], root2);
|
|
88816
|
+
iconElem.innerHTML = UmlIcon;
|
|
88817
|
+
createElement("div", ["menu-item-name"], root2, i18n$1.t("drawio.title"));
|
|
88818
|
+
root2.appendChild(suffixElem);
|
|
88819
|
+
return root2;
|
|
88820
|
+
} : void 0;
|
|
88821
|
+
const insertEmbedCommandItems = [];
|
|
88822
|
+
if (drawioOptions.visible !== false) {
|
|
88823
|
+
insertEmbedCommandItems.push({
|
|
88730
88824
|
id: "insert-drawio",
|
|
88731
88825
|
name: i18n$1.t("drawio.title"),
|
|
88732
88826
|
icon: UmlIcon,
|
|
88733
88827
|
group: "common",
|
|
88734
88828
|
order: 600,
|
|
88735
|
-
subText: getShortcutById("insert-drawio")
|
|
88736
|
-
|
|
88737
|
-
|
|
88829
|
+
subText: getShortcutById("insert-drawio"),
|
|
88830
|
+
element,
|
|
88831
|
+
useDefaultClickHandler: true
|
|
88832
|
+
});
|
|
88833
|
+
}
|
|
88834
|
+
return {
|
|
88835
|
+
name: "UML",
|
|
88836
|
+
insertEmbedCommandItems,
|
|
88837
|
+
handleInsertEmptyEmbed: async (editor2, options) => {
|
|
88838
|
+
var _a2, _b;
|
|
88839
|
+
if (((_b = (_a2 = drawioOptions.callbacks) == null ? void 0 : _a2.onBeforeInsertDrawio) == null ? void 0 : _b.call(_a2, editor2)) === false) {
|
|
88840
|
+
return null;
|
|
88841
|
+
}
|
|
88738
88842
|
const embedData = {
|
|
88739
88843
|
src: "",
|
|
88740
88844
|
xml: "",
|
|
88741
88845
|
xmlSvg: ""
|
|
88742
88846
|
};
|
|
88743
|
-
const block =
|
|
88847
|
+
const block = editor2.insertEmbed(options.containerId, options.blockIndex, "drawio", embedData);
|
|
88744
88848
|
setTimeout(() => {
|
|
88745
88849
|
const blockContent = getBlockContent(block);
|
|
88746
88850
|
const embed = blockContent.querySelector(":scope > .editor-drawio-content");
|
|
88747
88851
|
assert(logger$i, embed, "embed should not be null");
|
|
88748
|
-
const blockData =
|
|
88749
|
-
editDrawIO(
|
|
88852
|
+
const blockData = editor2.getBlockData(block);
|
|
88853
|
+
editDrawIO(editor2, block, embed, blockData.embedData);
|
|
88750
88854
|
}, 100);
|
|
88751
88855
|
return block;
|
|
88752
88856
|
}
|
|
@@ -96482,9 +96586,8 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
96482
96586
|
}
|
|
96483
96587
|
const elem = node;
|
|
96484
96588
|
const refId = elem.getAttribute("data-ref-id");
|
|
96485
|
-
const refType = elem.getAttribute("data-ref-type");
|
|
96486
96589
|
const uuid = elem.getAttribute("data-uuid");
|
|
96487
|
-
return Boolean(
|
|
96590
|
+
return Boolean(refId && uuid);
|
|
96488
96591
|
},
|
|
96489
96592
|
replacement: (content, node) => {
|
|
96490
96593
|
const refType = node.getAttribute("data-ref-type");
|
|
@@ -97022,7 +97125,7 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
97022
97125
|
}
|
|
97023
97126
|
}
|
|
97024
97127
|
});
|
|
97025
|
-
editor.version = "3.0.16
|
|
97128
|
+
editor.version = "3.0.16";
|
|
97026
97129
|
return editor;
|
|
97027
97130
|
}
|
|
97028
97131
|
function isDoc(doc2) {
|
|
@@ -97156,7 +97259,7 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
97156
97259
|
OnesEditorDropTarget.register(editor);
|
|
97157
97260
|
OnesEditorTocProvider.register(editor);
|
|
97158
97261
|
OnesEditorExclusiveBlock.register(editor);
|
|
97159
|
-
editor.version = "3.0.16
|
|
97262
|
+
editor.version = "3.0.16";
|
|
97160
97263
|
return editor;
|
|
97161
97264
|
}
|
|
97162
97265
|
async function showDocVersions(editor, options, serverUrl) {
|
|
@@ -97223,6 +97326,77 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
97223
97326
|
dialog.show(dialogOptions);
|
|
97224
97327
|
return dialog;
|
|
97225
97328
|
}
|
|
97329
|
+
async function createSimpleInput(root2, docData, options) {
|
|
97330
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
97331
|
+
assert(logger, root2, "app does not exists");
|
|
97332
|
+
const doc2 = isDoc(docData) ? docData : new LocalDoc(docData, {
|
|
97333
|
+
serverUrl: options.serverUrl || ""
|
|
97334
|
+
});
|
|
97335
|
+
if (options.lang) {
|
|
97336
|
+
i18n$1.setLang(options.lang);
|
|
97337
|
+
}
|
|
97338
|
+
Logger$2.level = (_a = options.logLevel) != null ? _a : LogLevel.DEBUG;
|
|
97339
|
+
const editor = createEditor(root2, doc2, {
|
|
97340
|
+
id: options.id,
|
|
97341
|
+
scrollContainer: options == null ? void 0 : options.scrollContainer,
|
|
97342
|
+
enableResolveComments: false,
|
|
97343
|
+
enableComments: false,
|
|
97344
|
+
dateTimeFormatter: options.dateTimeFormatter,
|
|
97345
|
+
components: {
|
|
97346
|
+
blocks: [ListBlock, ...(_c = (_b = options.components) == null ? void 0 : _b.blocks) != null ? _c : []],
|
|
97347
|
+
commandProviders: [],
|
|
97348
|
+
decorators: [],
|
|
97349
|
+
embeds: [...((_d = options.components) == null ? void 0 : _d.embeds) || []],
|
|
97350
|
+
boxes: [...((_e = options.components) == null ? void 0 : _e.boxes) || []],
|
|
97351
|
+
insertions: [],
|
|
97352
|
+
blockHooks: [...((_f = options.components) == null ? void 0 : _f.blockHooks) || []],
|
|
97353
|
+
textRenders: [
|
|
97354
|
+
...((_g = options.components) == null ? void 0 : _g.textRenders) || []
|
|
97355
|
+
].filter(Boolean),
|
|
97356
|
+
options: { ...options.componentsOptions }
|
|
97357
|
+
},
|
|
97358
|
+
shortcuts: [TextStyleShortcuts, DefaultShortcuts]
|
|
97359
|
+
});
|
|
97360
|
+
if (options.compact) {
|
|
97361
|
+
addClass(editor.rootElement, "compact");
|
|
97362
|
+
if (options.headingButton === false)
|
|
97363
|
+
addClass(editor.rootElement, "no-heading-collapse");
|
|
97364
|
+
if (options.blockMenuButton === false)
|
|
97365
|
+
addClass(editor.rootElement, "no-block-menu");
|
|
97366
|
+
}
|
|
97367
|
+
editor.input.addHandler(new MarkdownInputHandler({
|
|
97368
|
+
disableHeadingShortcuts: true
|
|
97369
|
+
}));
|
|
97370
|
+
editor.input.addHandler(new OnesEditorPasteHandler(editor));
|
|
97371
|
+
editor.input.addHandler(new ListPasteHandler());
|
|
97372
|
+
editor.doc.registerCallback(new HeadingBlockDocEvents(editor));
|
|
97373
|
+
if (!clientType.isMobile) {
|
|
97374
|
+
editor.addCustom("editor-tooltip", () => new OnesEditorTooltip(editor));
|
|
97375
|
+
}
|
|
97376
|
+
editor.addCustom("create-options", () => new OnesEditorCustomDataWrapper(editor, options));
|
|
97377
|
+
if ((_h = options.componentsOptions) == null ? void 0 : _h.mention) {
|
|
97378
|
+
const mentionOptions = options.componentsOptions.mention;
|
|
97379
|
+
editor.addCustom("mention", () => new OnesEditorMention(editor, mentionOptions));
|
|
97380
|
+
}
|
|
97381
|
+
if (options.autoNewLine) {
|
|
97382
|
+
editor.addCustom("auto-new-line", () => new AutoNewLine(editor));
|
|
97383
|
+
}
|
|
97384
|
+
editor.addListener("clickLink", (editor2, event, link2) => {
|
|
97385
|
+
var _a2;
|
|
97386
|
+
if ((_a2 = options == null ? void 0 : options.events) == null ? void 0 : _a2.onClickLink) {
|
|
97387
|
+
options.events.onClickLink(editor2, event, link2);
|
|
97388
|
+
return;
|
|
97389
|
+
}
|
|
97390
|
+
const href = link2.getAttribute("link") || link2.getAttribute("href");
|
|
97391
|
+
if (href) {
|
|
97392
|
+
if (editor2.readonly || event.ctrlKey || event.metaKey || !getParentBlock(link2)) {
|
|
97393
|
+
window.open(href, "_blank");
|
|
97394
|
+
}
|
|
97395
|
+
}
|
|
97396
|
+
});
|
|
97397
|
+
editor.version = "3.0.16";
|
|
97398
|
+
return editor;
|
|
97399
|
+
}
|
|
97226
97400
|
const emojis$1 = {
|
|
97227
97401
|
smileysAndPeople: [
|
|
97228
97402
|
"\u{1F600}",
|
|
@@ -143126,6 +143300,7 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
143126
143300
|
exports2.MathMenuIcon = MathMenuIcon;
|
|
143127
143301
|
exports2.MaxUserError = MaxUserError;
|
|
143128
143302
|
exports2.Mention2Icon = Mention2Icon;
|
|
143303
|
+
exports2.MentionBox = MentionBox;
|
|
143129
143304
|
exports2.MentionIcon = MentionIcon;
|
|
143130
143305
|
exports2.MergeCellIcon = MergeCellIcon;
|
|
143131
143306
|
exports2.Mindmap = Mindmap;
|
|
@@ -143138,12 +143313,14 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
143138
143313
|
exports2.MoreItem = MoreItem;
|
|
143139
143314
|
exports2.NextIcon = NextIcon;
|
|
143140
143315
|
exports2.OnesEditorAutoSuggest = OnesEditorAutoSuggest;
|
|
143316
|
+
exports2.OnesEditorBlockMention = OnesEditorBlockMention;
|
|
143141
143317
|
exports2.OnesEditorComments = OnesEditorComments;
|
|
143142
143318
|
exports2.OnesEditorCommentsRender = OnesEditorCommentsRender;
|
|
143143
143319
|
exports2.OnesEditorCustomDataWrapper = OnesEditorCustomDataWrapper;
|
|
143144
143320
|
exports2.OnesEditorExclusiveBlock = OnesEditorExclusiveBlock;
|
|
143145
143321
|
exports2.OnesEditorHoveringBlock = OnesEditorHoveringBlock;
|
|
143146
143322
|
exports2.OnesEditorIcons = index$f;
|
|
143323
|
+
exports2.OnesEditorMention = OnesEditorMention;
|
|
143147
143324
|
exports2.OnesEditorQuickMenu = OnesEditorQuickMenu;
|
|
143148
143325
|
exports2.OnesEditorToc = OnesEditorToc;
|
|
143149
143326
|
exports2.OnesEditorTocProvider = OnesEditorTocProvider;
|
|
@@ -143341,6 +143518,7 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
143341
143518
|
exports2.createSeparator = createSeparator;
|
|
143342
143519
|
exports2.createSimpleBlockPosition = createSimpleBlockPosition;
|
|
143343
143520
|
exports2.createSimpleDocPos = createSimpleDocPos;
|
|
143521
|
+
exports2.createSimpleInput = createSimpleInput;
|
|
143344
143522
|
exports2.createTextBlockData = createTextBlockData;
|
|
143345
143523
|
exports2.createTextButton = createTextButton;
|
|
143346
143524
|
exports2.createTextOp = createTextOp;
|
|
@@ -143367,6 +143545,7 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
143367
143545
|
exports2.editorAutoBreakTextBlock = editorAutoBreakTextBlock;
|
|
143368
143546
|
exports2.editorAutoInsertBlock = editorAutoInsertBlock;
|
|
143369
143547
|
exports2.editorBreakTextBlock = editorBreakTextBlock;
|
|
143548
|
+
exports2.editorClearAll = editorClearAll;
|
|
143370
143549
|
exports2.editorClearCompositionText = editorClearCompositionText;
|
|
143371
143550
|
exports2.editorClearSelectedContents = editorClearSelectedContents;
|
|
143372
143551
|
exports2.editorCopyBlock = editorCopyBlock;
|