@ones-editor/editor 2.4.1 → 2.5.1-beta.2
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/server-tools/package.json +22 -0
- package/@ones-editor/server-tools/src/fake-browser.d.ts +1 -0
- package/@ones-editor/server-tools/src/from-markdown/index.d.ts +1 -0
- package/@ones-editor/server-tools/src/index.d.ts +2 -0
- package/@ones-editor/server-tools/src/to-markdown/blocks/code.d.ts +3 -0
- package/@ones-editor/server-tools/src/to-markdown/blocks/index.d.ts +12 -0
- package/@ones-editor/server-tools/src/to-markdown/blocks/list.d.ts +14 -0
- package/@ones-editor/server-tools/src/to-markdown/blocks/table.d.ts +3 -0
- package/@ones-editor/server-tools/src/to-markdown/blocks/text.d.ts +4 -0
- package/@ones-editor/server-tools/src/to-markdown/boxes/br.d.ts +1 -0
- package/@ones-editor/server-tools/src/to-markdown/boxes/date.d.ts +2 -0
- package/@ones-editor/server-tools/src/to-markdown/boxes/file.d.ts +11 -0
- package/@ones-editor/server-tools/src/to-markdown/boxes/index.d.ts +16 -0
- package/@ones-editor/server-tools/src/to-markdown/boxes/known-link.d.ts +11 -0
- package/@ones-editor/server-tools/src/to-markdown/boxes/mathjax.d.ts +2 -0
- package/@ones-editor/server-tools/src/to-markdown/boxes/mention.d.ts +7 -0
- package/@ones-editor/server-tools/src/to-markdown/boxes/task-link.d.ts +2 -0
- package/@ones-editor/server-tools/src/to-markdown/convert-block.d.ts +3 -0
- package/@ones-editor/server-tools/src/to-markdown/convert-box.d.ts +3 -0
- package/@ones-editor/server-tools/src/to-markdown/embeds/drawio.d.ts +2 -0
- package/@ones-editor/server-tools/src/to-markdown/embeds/file-list.d.ts +5 -0
- package/@ones-editor/server-tools/src/to-markdown/embeds/file.d.ts +2 -0
- package/@ones-editor/server-tools/src/to-markdown/embeds/flowchart.d.ts +2 -0
- package/@ones-editor/server-tools/src/to-markdown/embeds/hr.d.ts +1 -0
- package/@ones-editor/server-tools/src/to-markdown/embeds/image.d.ts +18 -0
- package/@ones-editor/server-tools/src/to-markdown/embeds/index.d.ts +3 -0
- package/@ones-editor/server-tools/src/to-markdown/embeds/mathjax.d.ts +2 -0
- package/@ones-editor/server-tools/src/to-markdown/embeds/media.d.ts +2 -0
- package/@ones-editor/server-tools/src/to-markdown/embeds/mermaid.d.ts +2 -0
- package/@ones-editor/server-tools/src/to-markdown/embeds/plantuml.d.ts +2 -0
- package/@ones-editor/server-tools/src/to-markdown/embeds/sub-pages.d.ts +2 -0
- package/@ones-editor/server-tools/src/to-markdown/embeds/task-list.d.ts +7 -0
- package/@ones-editor/server-tools/src/to-markdown/embeds/toc.d.ts +2 -0
- package/@ones-editor/server-tools/src/to-markdown/embeds/webpage.d.ts +5 -0
- package/@ones-editor/server-tools/src/to-markdown/embeds/xmind.d.ts +8 -0
- package/@ones-editor/server-tools/src/to-markdown/index.d.ts +1 -0
- package/@ones-editor/server-tools/src/to-markdown/types.d.ts +7 -0
- package/@ones-editor/server-tools/src/tools.d.ts +1 -0
- package/@ones-editor/server-tools/src/utils/editor-doc.d.ts +22 -0
- package/@ones-editor/server-tools/src/utils/object.d.ts +1 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/dist/index.js +30 -20
- package/package.json +9 -1
package/dist/index.js
CHANGED
|
@@ -10907,22 +10907,29 @@ var __publicField = (obj, key, value) => {
|
|
|
10907
10907
|
return elementFont;
|
|
10908
10908
|
}
|
|
10909
10909
|
function getTextWidth(text2, font) {
|
|
10910
|
-
|
|
10911
|
-
|
|
10912
|
-
|
|
10913
|
-
|
|
10914
|
-
|
|
10915
|
-
|
|
10916
|
-
if (!
|
|
10917
|
-
|
|
10918
|
-
} else {
|
|
10919
|
-
context.font = font;
|
|
10910
|
+
try {
|
|
10911
|
+
if (window.fakebrowser) {
|
|
10912
|
+
return 200;
|
|
10913
|
+
}
|
|
10914
|
+
const canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement("canvas"));
|
|
10915
|
+
const context = canvas.getContext("2d");
|
|
10916
|
+
if (!context) {
|
|
10917
|
+
return 200;
|
|
10920
10918
|
}
|
|
10921
|
-
|
|
10922
|
-
|
|
10919
|
+
if (typeof font === "string") {
|
|
10920
|
+
if (!font) {
|
|
10921
|
+
context.font = getStyleFont(window.getComputedStyle(document.body));
|
|
10922
|
+
} else {
|
|
10923
|
+
context.font = font;
|
|
10924
|
+
}
|
|
10925
|
+
} else if (font instanceof Element) {
|
|
10926
|
+
context.font = getStyleFont(window.getComputedStyle(font));
|
|
10927
|
+
}
|
|
10928
|
+
const metrics = context.measureText(text2);
|
|
10929
|
+
return metrics.width + 4;
|
|
10930
|
+
} catch (err) {
|
|
10931
|
+
return 200;
|
|
10923
10932
|
}
|
|
10924
|
-
const metrics = context.measureText(text2);
|
|
10925
|
-
return metrics.width + 4;
|
|
10926
10933
|
}
|
|
10927
10934
|
const logger$4M = getLogger("editor-clipboard");
|
|
10928
10935
|
async function setClipboardDataByEvent(items, event) {
|
|
@@ -73672,6 +73679,8 @@ ${codeText}
|
|
|
73672
73679
|
});
|
|
73673
73680
|
}
|
|
73674
73681
|
const StyleTags = {
|
|
73682
|
+
i: "style-italic",
|
|
73683
|
+
b: "style-bold",
|
|
73675
73684
|
u: "style-underline",
|
|
73676
73685
|
strong: "style-bold",
|
|
73677
73686
|
em: "style-italic",
|
|
@@ -75521,8 +75530,8 @@ ${content}
|
|
|
75521
75530
|
const container = document.createElement("div");
|
|
75522
75531
|
container.classList.add("highlight-text-wizdoc");
|
|
75523
75532
|
const code = document.createElement("pre");
|
|
75533
|
+
code.textContent = base64;
|
|
75524
75534
|
container.appendChild(code);
|
|
75525
|
-
code.innerText = base64;
|
|
75526
75535
|
node.insertAdjacentElement("beforebegin", container);
|
|
75527
75536
|
node.remove();
|
|
75528
75537
|
return;
|
|
@@ -84816,10 +84825,11 @@ ${data2.flowchartText}
|
|
|
84816
84825
|
checker: () => !!(window.mxUtils && window.mxGraph && window.mxCodec),
|
|
84817
84826
|
maxRetryTime: 5e3
|
|
84818
84827
|
})).then(() => {
|
|
84819
|
-
const { mxUtils, mxGraph: MxGraph, mxCodec: MxCodec } = window;
|
|
84828
|
+
const { mxUtils, mxGraph: MxGraph, mxCodec: MxCodec, Graph } = window;
|
|
84820
84829
|
assert(logger$i, mxUtils, "External resource loading exception: mxUtils");
|
|
84821
84830
|
assert(logger$i, MxGraph, "External resource loading exception: MxGraph");
|
|
84822
84831
|
assert(logger$i, MxCodec, "External resource loading exception: MxCodec");
|
|
84832
|
+
assert(logger$i, Graph, "External resource loading exception: Graph");
|
|
84823
84833
|
const file2 = mxUtils.parseXml(mxFile);
|
|
84824
84834
|
embed.innerHTML = "";
|
|
84825
84835
|
const node = file2.documentElement;
|
|
@@ -84841,7 +84851,7 @@ ${data2.flowchartText}
|
|
|
84841
84851
|
const xml = new XMLSerializer().serializeToString(data2.firstElementChild);
|
|
84842
84852
|
xmlDoc = mxUtils.parseXml(xml);
|
|
84843
84853
|
}
|
|
84844
|
-
const graph = new
|
|
84854
|
+
const graph = new Graph(embed);
|
|
84845
84855
|
graph.resetViewOnRootChange = false;
|
|
84846
84856
|
graph.foldingEnabled = false;
|
|
84847
84857
|
graph.setTooltips(false);
|
|
@@ -85094,7 +85104,7 @@ ${data2.flowchartText}
|
|
|
85094
85104
|
const block = blocks[i];
|
|
85095
85105
|
if (block.type === "embed" && block.embedType === "drawio") {
|
|
85096
85106
|
const src = ((_a = block.embedData) == null ? void 0 : _a.src) || "";
|
|
85097
|
-
if (!this.isSameOrigin(editor, doc2, src)) {
|
|
85107
|
+
if (src && !this.isSameOrigin(editor, doc2, src)) {
|
|
85098
85108
|
blocks.splice(i, 1);
|
|
85099
85109
|
}
|
|
85100
85110
|
}
|
|
@@ -92115,7 +92125,7 @@ ${data2.plantumlText}
|
|
|
92115
92125
|
}
|
|
92116
92126
|
}
|
|
92117
92127
|
});
|
|
92118
|
-
editor.version = "2.
|
|
92128
|
+
editor.version = "2.5.1-beta.2";
|
|
92119
92129
|
return editor;
|
|
92120
92130
|
}
|
|
92121
92131
|
function isDoc(doc2) {
|
|
@@ -92228,7 +92238,7 @@ ${data2.plantumlText}
|
|
|
92228
92238
|
}
|
|
92229
92239
|
});
|
|
92230
92240
|
OnesEditorToolbar.register(editor);
|
|
92231
|
-
editor.version = "2.
|
|
92241
|
+
editor.version = "2.5.1-beta.2";
|
|
92232
92242
|
return editor;
|
|
92233
92243
|
}
|
|
92234
92244
|
async function showDocVersions(editor, options, serverUrl) {
|
package/package.json
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ones-editor/editor",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1-beta.2",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@better-scroll/core": "^2.5.0",
|
|
8
8
|
"@excalidraw/excalidraw": "0.15.3",
|
|
9
9
|
"@guyplusplus/turndown-plugin-gfm": "^1.0.7",
|
|
10
|
+
"@types/jsdom": "^21.1.1",
|
|
11
|
+
"@types/lodash.clonedeep": "^4.5.7",
|
|
10
12
|
"@types/lodash.findlastindex": "^4.6.7",
|
|
13
|
+
"@types/node": "^18.15.11",
|
|
11
14
|
"axios": "^1.2.6",
|
|
12
15
|
"blueimp-md5": "^2.19.0",
|
|
13
16
|
"buffer": "^6.0.3",
|
|
17
|
+
"chardet": "^2.0.0",
|
|
18
|
+
"commander": "9.0.0",
|
|
14
19
|
"css-color-converter": "^2.0.0",
|
|
15
20
|
"docx": "^7.2.0",
|
|
16
21
|
"dom-to-image": "^2.6.0",
|
|
17
22
|
"events": "^3.3.0",
|
|
18
23
|
"fast-sha256": "^1.3.0",
|
|
19
24
|
"flowchart.js": "^1.17.1",
|
|
25
|
+
"fs-extra": "^11.2.0",
|
|
20
26
|
"graphemer": "^1.4.0",
|
|
21
27
|
"html-entities": "^2.0.6",
|
|
28
|
+
"iconv-lite": "^0.6.3",
|
|
22
29
|
"image-size": "^1.0.0",
|
|
23
30
|
"js-base64": "*",
|
|
31
|
+
"jsdom": "^22.0.0",
|
|
24
32
|
"kiwi-intl": "^1.2.6-beta.0",
|
|
25
33
|
"lodash": "^4.0.8",
|
|
26
34
|
"lodash-es": "4.17.21",
|