@ones-editor/editor 2.1.7-beta.20 → 2.1.7-beta.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/@ones-editor/core/src/core/blocks/complex-blocks/complex-block-helper.d.ts +2 -5
- package/@ones-editor/core/src/core/blocks/text-blocks/base/child.d.ts +1 -2
- package/@ones-editor/core/src/core/blocks/text-blocks/base/line-breaks.d.ts +1 -2
- package/@ones-editor/core/src/core/blocks/text-blocks/base/range.d.ts +1 -2
- package/@ones-editor/core/src/core/blocks/text-blocks/base/text-offset.d.ts +1 -2
- package/@ones-editor/core/src/core/insertions/editor-insertions.d.ts +1 -0
- package/@ones-editor/core/src/core/selection/adjust-selection-pos.d.ts +5 -1
- package/@ones-editor/core/src/core/types.d.ts +1 -0
- package/@ones-editor/core/src/helper/hovering-block.d.ts +1 -2
- package/@ones-editor/excalidraw/package.json +4 -0
- package/@ones-editor/mobile-helper/src/fixed-toolbar/toolbar-handler.d.ts +1 -0
- package/@ones-editor/to-docx/src/doc2other/core.d.ts +1 -1
- package/@ones-editor/to-docx/src/doc2other/table.d.ts +1 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui-base/src/input/create-input.d.ts +1 -0
- package/dist/index.js +557 -442
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1358,6 +1358,9 @@ div[data-command-bar-id=mobile-bottom-menu] .tippy-content .mobile-menu-wrap .mo
|
|
|
1358
1358
|
margin-right: 12px;
|
|
1359
1359
|
color: #2d2d2e;
|
|
1360
1360
|
}
|
|
1361
|
+
div[data-command-bar-id=mobile-bottom-menu] .tippy-content .mobile-menu-wrap .mobile-menu-header [data-button-id=mobile-bottom-menu-close] svg {
|
|
1362
|
+
stroke-width: 1.5;
|
|
1363
|
+
}
|
|
1361
1364
|
div[data-command-bar-id=mobile-bottom-menu] .editor-command-bar-root {
|
|
1362
1365
|
box-shadow: none !important;
|
|
1363
1366
|
}.editor-text-button {
|
|
@@ -1610,6 +1613,7 @@ div.tippy-box[data-theme=menu] .tippy-content .editor-command-bar.menu .menu-ite
|
|
|
1610
1613
|
line-height: 1.4;
|
|
1611
1614
|
color: #000;
|
|
1612
1615
|
width: 100%;
|
|
1616
|
+
resize: none;
|
|
1613
1617
|
}
|
|
1614
1618
|
.editor-input-wrap .editor-input-container .editor-input:hover {
|
|
1615
1619
|
border-color: #0064ff;
|
|
@@ -1916,7 +1920,7 @@ div.scroll-container-root.mac > div.container-scroll-tool .container-scrollbar::
|
|
|
1916
1920
|
[data-command-bar-id=quick-menu],
|
|
1917
1921
|
[data-command-bar-id=empty-block-menu] {
|
|
1918
1922
|
box-sizing: border-box;
|
|
1919
|
-
width: 240px;
|
|
1923
|
+
min-width: 240px;
|
|
1920
1924
|
}
|
|
1921
1925
|
[data-command-bar-id=quick-menu] .command-item.menu-item,
|
|
1922
1926
|
[data-command-bar-id=empty-block-menu] .command-item.menu-item {
|
|
@@ -2045,6 +2049,12 @@ div.tippy-box[data-theme=editor-tooltip] > .tippy-content {
|
|
|
2045
2049
|
[data-command-bar-id=paste-special-button].mobile .tippy-box,
|
|
2046
2050
|
[data-command-bar-id=editor-toolbar].mobile .tippy-box {
|
|
2047
2051
|
border-radius: 8px;
|
|
2052
|
+
background: none;
|
|
2053
|
+
}
|
|
2054
|
+
[data-command-bar-id=cursor-toolbar].mobile .tippy-box .tippy-content .editor-command-bar-root,
|
|
2055
|
+
[data-command-bar-id=paste-special-button].mobile .tippy-box .tippy-content .editor-command-bar-root,
|
|
2056
|
+
[data-command-bar-id=editor-toolbar].mobile .tippy-box .tippy-content .editor-command-bar-root {
|
|
2057
|
+
box-shadow: none;
|
|
2048
2058
|
}
|
|
2049
2059
|
[data-command-bar-id=cursor-toolbar].mobile .tippy-content,
|
|
2050
2060
|
[data-command-bar-id=cursor-toolbar].mobile .editor-command-bar-root,
|
|
@@ -2070,11 +2080,13 @@ div.tippy-box[data-theme=editor-tooltip] > .tippy-content {
|
|
|
2070
2080
|
[data-command-bar-id=editor-toolbar].mobile .editor-command-bar.toolbar .command-item:not(.separator) {
|
|
2071
2081
|
height: 40px;
|
|
2072
2082
|
padding: 0 16px;
|
|
2083
|
+
line-height: initial;
|
|
2073
2084
|
}
|
|
2074
2085
|
[data-command-bar-id=cursor-toolbar].mobile .editor-command-bar.toolbar .command-item.separator,
|
|
2075
2086
|
[data-command-bar-id=paste-special-button].mobile .editor-command-bar.toolbar .command-item.separator,
|
|
2076
2087
|
[data-command-bar-id=editor-toolbar].mobile .editor-command-bar.toolbar .command-item.separator {
|
|
2077
2088
|
height: 40px;
|
|
2089
|
+
transform: scaleX(0.5);
|
|
2078
2090
|
background-color: var(--Fills-Vibrant-Secondary, rgba(127, 127, 127, 0.4));
|
|
2079
2091
|
}div[data-type=editor-block].block-exclusive:after {
|
|
2080
2092
|
content: attr(data-exclusive-tips);
|
|
@@ -2601,6 +2613,9 @@ div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container
|
|
|
2601
2613
|
display: flex;
|
|
2602
2614
|
align-items: center;
|
|
2603
2615
|
}
|
|
2616
|
+
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar-header .link-popup-header .link-popup-button-wrap svg {
|
|
2617
|
+
stroke-width: 1.5;
|
|
2618
|
+
}
|
|
2604
2619
|
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar-header .link-popup-header .link-popup-button-wrap:last-of-type {
|
|
2605
2620
|
justify-content: flex-end;
|
|
2606
2621
|
}
|
|
@@ -2620,7 +2635,7 @@ div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container
|
|
|
2620
2635
|
width: 100%;
|
|
2621
2636
|
}
|
|
2622
2637
|
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] {
|
|
2623
|
-
height:
|
|
2638
|
+
height: 495px;
|
|
2624
2639
|
align-items: start;
|
|
2625
2640
|
}
|
|
2626
2641
|
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup].selected {
|
|
@@ -2629,15 +2644,40 @@ div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container
|
|
|
2629
2644
|
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content {
|
|
2630
2645
|
width: 100%;
|
|
2631
2646
|
}
|
|
2632
|
-
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap {
|
|
2633
|
-
|
|
2647
|
+
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap.error .editor-input-container.textarea {
|
|
2648
|
+
border: 1px solid #e82100;
|
|
2634
2649
|
}
|
|
2635
2650
|
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap .editor-input-container {
|
|
2636
2651
|
padding: 0;
|
|
2637
2652
|
}
|
|
2638
2653
|
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap .editor-input-container .editor-input {
|
|
2639
2654
|
line-height: 1.4;
|
|
2640
|
-
|
|
2655
|
+
height: 100%;
|
|
2656
|
+
white-space: nowrap;
|
|
2657
|
+
}
|
|
2658
|
+
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap .editor-input-container.textarea {
|
|
2659
|
+
padding: 0px 10px;
|
|
2660
|
+
border: 1px solid #c7c7c7;
|
|
2661
|
+
height: 44px;
|
|
2662
|
+
}
|
|
2663
|
+
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap .editor-input-container.textarea:hover {
|
|
2664
|
+
border-color: #0064ff;
|
|
2665
|
+
}
|
|
2666
|
+
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap .editor-input-container.textarea.focus {
|
|
2667
|
+
border-color: #0064ff;
|
|
2668
|
+
box-shadow: 0px 0px 0px 2px rgba(51, 143, 229, 0.2);
|
|
2669
|
+
}
|
|
2670
|
+
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap .editor-input-container.textarea .editor-input {
|
|
2671
|
+
border: none;
|
|
2672
|
+
padding: 11px 0px;
|
|
2673
|
+
width: calc(100% - 20px);
|
|
2674
|
+
}
|
|
2675
|
+
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap .editor-input-container.textarea .editor-input:hover {
|
|
2676
|
+
border: none;
|
|
2677
|
+
}
|
|
2678
|
+
[data-command-bar-id=mobile-bottom-menu] .link-popup .editor-command-bar .command-item[data-id=link-popup] .link-form-content .editor-input-wrap .editor-input-container.textarea .editor-input:focus {
|
|
2679
|
+
border: none;
|
|
2680
|
+
box-shadow: none;
|
|
2641
2681
|
}div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] > span.math-box {
|
|
2642
2682
|
display: inline-flex;
|
|
2643
2683
|
vertical-align: middle;
|
|
@@ -3494,6 +3534,9 @@ div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container
|
|
|
3494
3534
|
bottom: 0;
|
|
3495
3535
|
content: attr(data-title-placeholder);
|
|
3496
3536
|
color: #bebfc2;
|
|
3537
|
+
white-space: nowrap;
|
|
3538
|
+
overflow: hidden;
|
|
3539
|
+
text-overflow: ellipsis;
|
|
3497
3540
|
}
|
|
3498
3541
|
div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] div[data-type=editor-block] [data-type=block-content][data-content-placeholder]::before {
|
|
3499
3542
|
position: absolute;
|
|
@@ -7611,7 +7654,7 @@ div.editor-root div.editor-content div[data-type=editor-container] div[data-embe
|
|
|
7611
7654
|
.video-tooltip-align-style-section .style-icon.active {
|
|
7612
7655
|
color: blue;
|
|
7613
7656
|
}div.editor-root.compact div.editor-content div[data-type=editor-container].root > .container-blocks > * + * {
|
|
7614
|
-
margin: 0.2em;
|
|
7657
|
+
margin: 0.2em 0;
|
|
7615
7658
|
}
|
|
7616
7659
|
div.editor-root.compact.no-heading-collapse.no-block-menu > .editor-content {
|
|
7617
7660
|
padding-left: 10px;
|
|
@@ -7637,8 +7680,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7637
7680
|
return value;
|
|
7638
7681
|
};
|
|
7639
7682
|
(function(global2, factory) {
|
|
7640
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("kiwi-intl"), require("lodash.merge"), require("string-template"), require("nanoid"), require("events"), require("query-string"), require("js-base64"), require("snabbdom"), require("
|
|
7641
|
-
})(this, function(exports2, KiwiIntl, merge, stringFormat, nanoid$1, events, queryString, jsBase64, snabbdom,
|
|
7683
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("kiwi-intl"), require("lodash.merge"), require("string-template"), require("nanoid"), require("events"), require("query-string"), require("js-base64"), require("snabbdom"), require("lodash.clonedeep"), require("lodash.isequal"), require("quill-delta"), require("tiny-typed-emitter"), require("lodash.debounce"), require("lodash.intersection"), require("axios"), require("ot-json1"), require("lodash.findlastindex"), require("reconnecting-websocket"), require("fast-sha256"), require("tippy.js"), require("blueimp-md5"), require("css-color-converter"), require("markmap-view"), require("mime-db"), require("prismjs"), require("prismjs/components/prism-c"), require("prismjs/components/prism-cpp"), require("prismjs/components/prism-abap"), require("prismjs/components/prism-arduino"), require("prismjs/components/prism-bash"), require("prismjs/components/prism-basic"), require("prismjs/components/prism-clojure"), require("prismjs/components/prism-coffeescript"), require("prismjs/components/prism-csharp"), require("prismjs/components/prism-css"), require("prismjs/components/prism-dart"), require("prismjs/components/prism-diff"), require("prismjs/components/prism-docker"), require("prismjs/components/prism-elixir"), require("prismjs/components/prism-elm"), require("prismjs/components/prism-erlang"), require("prismjs/components/prism-flow"), require("prismjs/components/prism-fortran"), require("prismjs/components/prism-fsharp"), require("prismjs/components/prism-gherkin"), require("prismjs/components/prism-glsl"), require("prismjs/components/prism-go"), require("prismjs/components/prism-graphql"), require("prismjs/components/prism-groovy"), require("prismjs/components/prism-haskell"), require("prismjs/components/prism-java"), require("prismjs/components/prism-javascript"), require("prismjs/components/prism-json"), require("prismjs/components/prism-julia"), require("prismjs/components/prism-kotlin"), require("prismjs/components/prism-latex"), require("prismjs/components/prism-less"), require("prismjs/components/prism-lisp"), require("prismjs/components/prism-livescript"), require("prismjs/components/prism-lua"), require("prismjs/components/prism-makefile"), require("prismjs/components/prism-markdown"), require("prismjs/components/prism-markup"), require("prismjs/components/prism-matlab"), require("prismjs/components/prism-mermaid"), require("prismjs/components/prism-nix"), require("prismjs/components/prism-objectivec"), require("prismjs/components/prism-ocaml"), require("prismjs/components/prism-pascal"), require("prismjs/components/prism-perl"), require("prismjs/components/prism-php"), require("prismjs/components/prism-powershell"), require("prismjs/components/prism-prolog"), require("prismjs/components/prism-protobuf"), require("prismjs/components/prism-python"), require("prismjs/components/prism-r"), require("prismjs/components/prism-reason"), require("prismjs/components/prism-ruby"), require("prismjs/components/prism-rust"), require("prismjs/components/prism-sass"), require("prismjs/components/prism-scala"), require("prismjs/components/prism-scheme"), require("prismjs/components/prism-scss"), require("prismjs/components/prism-solidity"), require("prismjs/components/prism-sql"), require("prismjs/components/prism-swift"), require("prismjs/components/prism-typescript"), require("prismjs/components/prism-vbnet"), require("prismjs/components/prism-verilog"), require("prismjs/components/prism-vhdl"), require("prismjs/components/prism-visual-basic"), require("prismjs/components/prism-wasm"), require("prismjs/components/prism-yaml"), require("@better-scroll/core"), require("dom-to-image"), require("lodash.throttle"), require("@guyplusplus/turndown-plugin-gfm"), require("marked"), require("plantuml-encoder"), require("docx")) : typeof define === "function" && define.amd ? define(["exports", "kiwi-intl", "lodash.merge", "string-template", "nanoid", "events", "query-string", "js-base64", "snabbdom", "lodash.clonedeep", "lodash.isequal", "quill-delta", "tiny-typed-emitter", "lodash.debounce", "lodash.intersection", "axios", "ot-json1", "lodash.findlastindex", "reconnecting-websocket", "fast-sha256", "tippy.js", "blueimp-md5", "css-color-converter", "markmap-view", "mime-db", "prismjs", "prismjs/components/prism-c", "prismjs/components/prism-cpp", "prismjs/components/prism-abap", "prismjs/components/prism-arduino", "prismjs/components/prism-bash", "prismjs/components/prism-basic", "prismjs/components/prism-clojure", "prismjs/components/prism-coffeescript", "prismjs/components/prism-csharp", "prismjs/components/prism-css", "prismjs/components/prism-dart", "prismjs/components/prism-diff", "prismjs/components/prism-docker", "prismjs/components/prism-elixir", "prismjs/components/prism-elm", "prismjs/components/prism-erlang", "prismjs/components/prism-flow", "prismjs/components/prism-fortran", "prismjs/components/prism-fsharp", "prismjs/components/prism-gherkin", "prismjs/components/prism-glsl", "prismjs/components/prism-go", "prismjs/components/prism-graphql", "prismjs/components/prism-groovy", "prismjs/components/prism-haskell", "prismjs/components/prism-java", "prismjs/components/prism-javascript", "prismjs/components/prism-json", "prismjs/components/prism-julia", "prismjs/components/prism-kotlin", "prismjs/components/prism-latex", "prismjs/components/prism-less", "prismjs/components/prism-lisp", "prismjs/components/prism-livescript", "prismjs/components/prism-lua", "prismjs/components/prism-makefile", "prismjs/components/prism-markdown", "prismjs/components/prism-markup", "prismjs/components/prism-matlab", "prismjs/components/prism-mermaid", "prismjs/components/prism-nix", "prismjs/components/prism-objectivec", "prismjs/components/prism-ocaml", "prismjs/components/prism-pascal", "prismjs/components/prism-perl", "prismjs/components/prism-php", "prismjs/components/prism-powershell", "prismjs/components/prism-prolog", "prismjs/components/prism-protobuf", "prismjs/components/prism-python", "prismjs/components/prism-r", "prismjs/components/prism-reason", "prismjs/components/prism-ruby", "prismjs/components/prism-rust", "prismjs/components/prism-sass", "prismjs/components/prism-scala", "prismjs/components/prism-scheme", "prismjs/components/prism-scss", "prismjs/components/prism-solidity", "prismjs/components/prism-sql", "prismjs/components/prism-swift", "prismjs/components/prism-typescript", "prismjs/components/prism-vbnet", "prismjs/components/prism-verilog", "prismjs/components/prism-vhdl", "prismjs/components/prism-visual-basic", "prismjs/components/prism-wasm", "prismjs/components/prism-yaml", "@better-scroll/core", "dom-to-image", "lodash.throttle", "@guyplusplus/turndown-plugin-gfm", "marked", "plantuml-encoder", "docx"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2["oneseditor-editor"] = {}, global2.KiwiIntl, global2.merge, global2.stringFormat, global2.nanoid$1, global2.events, global2.queryString, global2.jsBase64, global2.snabbdom, global2.cloneDeep, global2.isEqual, global2.Delta, global2.tinyTypedEmitter, global2.debounce, global2.intersection, global2.axios, global2.json1, global2.findLastIndex, global2.ReconnectingWebSocket, global2.sha256, global2.tippy$1, global2.md5, global2.cssColorConverter, global2.markmap, global2.mime, global2.Prism, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, global2.BetterScroll, global2.domToImage, global2.throttle$1, global2.turndownPluginGfm, global2.marked, global2.plantumlEncoder, global2.docx));
|
|
7684
|
+
})(this, function(exports2, KiwiIntl, merge, stringFormat, nanoid$1, events, queryString, jsBase64, snabbdom, cloneDeep, isEqual, Delta, tinyTypedEmitter, debounce, intersection, axios, json1, findLastIndex, ReconnectingWebSocket, sha256, tippy$1, md5, cssColorConverter, markmap, mime, Prism, prismC, prismCpp, prismAbap, prismArduino, prismBash, prismBasic, prismClojure, prismCoffeescript, prismCsharp, prismCss, prismDart, prismDiff, prismDocker, prismElixir, prismElm, prismErlang, prismFlow, prismFortran, prismFsharp, prismGherkin, prismGlsl, prismGo, prismGraphql, prismGroovy, prismHaskell, prismJava, prismJavascript, prismJson, prismJulia, prismKotlin, prismLatex, prismLess, prismLisp, prismLivescript, prismLua, prismMakefile, prismMarkdown, prismMarkup, prismMatlab, prismMermaid, prismNix, prismObjectivec, prismOcaml, prismPascal, prismPerl, prismPhp, prismPowershell, prismProlog, prismProtobuf, prismPython, prismR, prismReason, prismRuby, prismRust, prismSass, prismScala, prismScheme, prismScss, prismSolidity, prismSql, prismSwift, prismTypescript, prismVbnet, prismVerilog, prismVhdl, prismVisualBasic, prismWasm, prismYaml, BetterScroll, domToImage, throttle$1, turndownPluginGfm, marked, plantumlEncoder, docx) {
|
|
7642
7685
|
"use strict";
|
|
7643
7686
|
const _interopDefaultLegacy = (e2) => e2 && typeof e2 === "object" && "default" in e2 ? e2 : { default: e2 };
|
|
7644
7687
|
function _interopNamespace(e2) {
|
|
@@ -10480,322 +10523,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10480
10523
|
var _a;
|
|
10481
10524
|
return (_a = getChildBlocks(container)[blockIndex]) != null ? _a : null;
|
|
10482
10525
|
}
|
|
10483
|
-
|
|
10484
|
-
constructor(editor) {
|
|
10485
|
-
__publicField(this, "renders", []);
|
|
10486
|
-
this.editor = editor;
|
|
10487
|
-
}
|
|
10488
|
-
registerRender(render) {
|
|
10489
|
-
this.renders.push(render);
|
|
10490
|
-
}
|
|
10491
|
-
renderBox(path, attributes) {
|
|
10492
|
-
const result = {
|
|
10493
|
-
classes: [],
|
|
10494
|
-
attributes: {},
|
|
10495
|
-
styles: {}
|
|
10496
|
-
};
|
|
10497
|
-
this.renders.forEach((render) => {
|
|
10498
|
-
if (render.renderBox) {
|
|
10499
|
-
const ret = render.renderBox(this.editor, path, attributes);
|
|
10500
|
-
if (ret.classes) {
|
|
10501
|
-
result.classes.push(...ret.classes);
|
|
10502
|
-
}
|
|
10503
|
-
if (ret.attributes) {
|
|
10504
|
-
result.attributes = {
|
|
10505
|
-
...result.attributes,
|
|
10506
|
-
...ret.attributes
|
|
10507
|
-
};
|
|
10508
|
-
}
|
|
10509
|
-
if (ret.styles) {
|
|
10510
|
-
result.styles = {
|
|
10511
|
-
...result.styles,
|
|
10512
|
-
...ret.styles
|
|
10513
|
-
};
|
|
10514
|
-
}
|
|
10515
|
-
}
|
|
10516
|
-
});
|
|
10517
|
-
return result;
|
|
10518
|
-
}
|
|
10519
|
-
renderText(path, attributes) {
|
|
10520
|
-
const result = {
|
|
10521
|
-
classes: [],
|
|
10522
|
-
attributes: {},
|
|
10523
|
-
styles: {}
|
|
10524
|
-
};
|
|
10525
|
-
this.renders.forEach((render) => {
|
|
10526
|
-
if (render.renderText) {
|
|
10527
|
-
const ret = render.renderText(this.editor, path, attributes);
|
|
10528
|
-
if (ret.classes) {
|
|
10529
|
-
result.classes.push(...ret.classes);
|
|
10530
|
-
}
|
|
10531
|
-
if (ret.attributes) {
|
|
10532
|
-
result.attributes = {
|
|
10533
|
-
...result.attributes,
|
|
10534
|
-
...ret.attributes
|
|
10535
|
-
};
|
|
10536
|
-
}
|
|
10537
|
-
if (ret.styles) {
|
|
10538
|
-
result.styles = {
|
|
10539
|
-
...result.styles,
|
|
10540
|
-
...ret.styles
|
|
10541
|
-
};
|
|
10542
|
-
}
|
|
10543
|
-
}
|
|
10544
|
-
});
|
|
10545
|
-
return result;
|
|
10546
|
-
}
|
|
10547
|
-
renderBlock(editor, path, blockData) {
|
|
10548
|
-
const result = {
|
|
10549
|
-
classes: [],
|
|
10550
|
-
attributes: {},
|
|
10551
|
-
styles: {}
|
|
10552
|
-
};
|
|
10553
|
-
this.renders.forEach((render) => {
|
|
10554
|
-
if (render.renderBlock) {
|
|
10555
|
-
const ret = render.renderBlock(this.editor, path, blockData);
|
|
10556
|
-
if (ret.classes) {
|
|
10557
|
-
result.classes.push(...ret.classes);
|
|
10558
|
-
}
|
|
10559
|
-
if (ret.attributes) {
|
|
10560
|
-
result.attributes = {
|
|
10561
|
-
...result.attributes,
|
|
10562
|
-
...ret.attributes
|
|
10563
|
-
};
|
|
10564
|
-
}
|
|
10565
|
-
if (ret.styles) {
|
|
10566
|
-
result.styles = {
|
|
10567
|
-
...result.styles,
|
|
10568
|
-
...ret.styles
|
|
10569
|
-
};
|
|
10570
|
-
}
|
|
10571
|
-
}
|
|
10572
|
-
});
|
|
10573
|
-
return result;
|
|
10574
|
-
}
|
|
10575
|
-
updateBlock(editor, path, blockElement, blockData) {
|
|
10576
|
-
this.renders.forEach((render) => {
|
|
10577
|
-
var _a;
|
|
10578
|
-
(_a = render.updateBlock) == null ? void 0 : _a.call(render, editor, path, blockElement, blockData);
|
|
10579
|
-
});
|
|
10580
|
-
}
|
|
10581
|
-
}
|
|
10582
|
-
const logger$4t = getLogger("block-class");
|
|
10583
|
-
function getBlockClass(editor, block) {
|
|
10584
|
-
return editor.editorBlocks.getBlockClass(getBlockType(block));
|
|
10585
|
-
}
|
|
10586
|
-
function getTextBlockClass(editor, block) {
|
|
10587
|
-
const text2 = editor.editorBlocks.getBlockClass(getBlockType(block));
|
|
10588
|
-
assert(logger$4t, text2.blockKind === "text", `is not a text block, ${text2.blockType}`);
|
|
10589
|
-
return text2;
|
|
10590
|
-
}
|
|
10591
|
-
function getComplexBlockClass(editor, block) {
|
|
10592
|
-
const complex = editor.editorBlocks.getBlockClass(getBlockType(block));
|
|
10593
|
-
assert(logger$4t, complex.blockKind === "complex", `is not a text block, ${complex.blockType}`);
|
|
10594
|
-
return complex;
|
|
10595
|
-
}
|
|
10596
|
-
function getBlockClassByType(editor, type) {
|
|
10597
|
-
return editor.editorBlocks.getBlockClass(type);
|
|
10598
|
-
}
|
|
10599
|
-
function isTextKindBlock(editor, block) {
|
|
10600
|
-
return getBlockClass(editor, block).blockKind === "text";
|
|
10601
|
-
}
|
|
10602
|
-
function isTextKindBlockType(editor, type) {
|
|
10603
|
-
return editor.editorBlocks.getBlockClass(type).blockKind === "text";
|
|
10604
|
-
}
|
|
10605
|
-
function isComplexKindBlock(editor, block) {
|
|
10606
|
-
return getBlockClass(editor, block).blockKind === "complex";
|
|
10607
|
-
}
|
|
10608
|
-
function isSimpleBlock(editor, block) {
|
|
10609
|
-
return !isComplexKindBlock(editor, block);
|
|
10610
|
-
}
|
|
10611
|
-
function getBlockKind(editor, block) {
|
|
10612
|
-
return getBlockClass(editor, block).blockKind;
|
|
10613
|
-
}
|
|
10614
|
-
class OnesEditorHoveringBlock extends tinyTypedEmitter.TypedEmitter {
|
|
10615
|
-
constructor(editor) {
|
|
10616
|
-
super();
|
|
10617
|
-
__publicField(this, "hoveringBlock", null);
|
|
10618
|
-
__publicField(this, "hoveringElem", null);
|
|
10619
|
-
__publicField(this, "hoveringTextChild", null);
|
|
10620
|
-
__publicField(this, "filters", []);
|
|
10621
|
-
__publicField(this, "finders", []);
|
|
10622
|
-
__publicField(this, "handleDocumentMouseMove", (event) => {
|
|
10623
|
-
if (this.hoveringBlock) {
|
|
10624
|
-
for (const filter of this.filters) {
|
|
10625
|
-
if (filter.isInBlock(this.hoveringBlock, event)) {
|
|
10626
|
-
return;
|
|
10627
|
-
}
|
|
10628
|
-
}
|
|
10629
|
-
}
|
|
10630
|
-
const elem = getElementFromPoint(event.x, event.y, { noFilter: true });
|
|
10631
|
-
if (!elem) {
|
|
10632
|
-
this.setHoveringBlock(null, event, null, elem);
|
|
10633
|
-
return;
|
|
10634
|
-
}
|
|
10635
|
-
let block = getParentBlock(elem);
|
|
10636
|
-
if (!block || !isChildNode(this.editor.rootContainer, block)) {
|
|
10637
|
-
block = this.findBlockByFinders(event);
|
|
10638
|
-
if (!block) {
|
|
10639
|
-
this.setHoveringBlock(null, event, null, elem);
|
|
10640
|
-
return;
|
|
10641
|
-
}
|
|
10642
|
-
}
|
|
10643
|
-
const child = this.getParentTextContentChild(block, elem);
|
|
10644
|
-
this.setHoveringBlock(block, event, child, elem);
|
|
10645
|
-
});
|
|
10646
|
-
this.editor = editor;
|
|
10647
|
-
if (clientType.isMobile) {
|
|
10648
|
-
document.addEventListener("click", this.handleDocumentMouseMove);
|
|
10649
|
-
} else {
|
|
10650
|
-
document.addEventListener("mousemove", this.handleDocumentMouseMove);
|
|
10651
|
-
}
|
|
10652
|
-
}
|
|
10653
|
-
destroy() {
|
|
10654
|
-
document.removeEventListener("mousemove", this.handleDocumentMouseMove);
|
|
10655
|
-
this.filters.forEach((filter) => filter.destroy());
|
|
10656
|
-
this.filters = [];
|
|
10657
|
-
this.finders.forEach((finder) => finder.destroy());
|
|
10658
|
-
this.finders = [];
|
|
10659
|
-
}
|
|
10660
|
-
addFilter(filter) {
|
|
10661
|
-
this.filters.push(filter);
|
|
10662
|
-
}
|
|
10663
|
-
addFinder(finder) {
|
|
10664
|
-
this.finders.push(finder);
|
|
10665
|
-
}
|
|
10666
|
-
hoveringBlockId() {
|
|
10667
|
-
if (!this.hoveringBlock) {
|
|
10668
|
-
return "";
|
|
10669
|
-
}
|
|
10670
|
-
return getBlockId(this.hoveringBlock);
|
|
10671
|
-
}
|
|
10672
|
-
findBlockByFinders(event) {
|
|
10673
|
-
for (let i = 0; i < this.finders.length; i++) {
|
|
10674
|
-
const finder = this.finders[i];
|
|
10675
|
-
const b = finder.findTargetBlock(this.editor, event);
|
|
10676
|
-
if (b) {
|
|
10677
|
-
return b;
|
|
10678
|
-
}
|
|
10679
|
-
}
|
|
10680
|
-
return null;
|
|
10681
|
-
}
|
|
10682
|
-
setHoveringBlock(block, event, child, pointElem) {
|
|
10683
|
-
if (this.hoveringBlock === block && this.hoveringTextChild === child && this.hoveringElem === event.target) {
|
|
10684
|
-
return;
|
|
10685
|
-
}
|
|
10686
|
-
if (this.hoveringBlock !== block) {
|
|
10687
|
-
const oldBlock = this.hoveringBlock && isChildNode(this.editor.rootContainer, this.hoveringBlock) ? this.hoveringBlock : null;
|
|
10688
|
-
if (oldBlock) {
|
|
10689
|
-
removeClass(oldBlock, "hover");
|
|
10690
|
-
}
|
|
10691
|
-
if (block) {
|
|
10692
|
-
addClass(block, "hover");
|
|
10693
|
-
}
|
|
10694
|
-
this.emit("change", block, oldBlock, event);
|
|
10695
|
-
}
|
|
10696
|
-
if (this.hoveringElem !== pointElem || this.hoveringBlock !== block) {
|
|
10697
|
-
this.emit("targetChange", block, this.hoveringBlock, pointElem, this.hoveringElem);
|
|
10698
|
-
}
|
|
10699
|
-
const oldChild = this.hoveringTextChild;
|
|
10700
|
-
this.hoveringTextChild = child;
|
|
10701
|
-
this.hoveringElem = pointElem;
|
|
10702
|
-
this.hoveringBlock = block;
|
|
10703
|
-
this.emit("childChange", this.hoveringBlock, child, oldChild, event);
|
|
10704
|
-
}
|
|
10705
|
-
static get(editor) {
|
|
10706
|
-
return editor.addCustom("standard-hovering-block", () => new OnesEditorHoveringBlock(editor));
|
|
10707
|
-
}
|
|
10708
|
-
getParentTextContentChild(block, elem) {
|
|
10709
|
-
if (!isTextKindBlock(this.editor, block)) {
|
|
10710
|
-
return null;
|
|
10711
|
-
}
|
|
10712
|
-
const content = getBlockContent(block);
|
|
10713
|
-
if (elem.parentElement === content) {
|
|
10714
|
-
return elem;
|
|
10715
|
-
}
|
|
10716
|
-
const box = getParentBox(elem);
|
|
10717
|
-
return box;
|
|
10718
|
-
}
|
|
10719
|
-
}
|
|
10720
|
-
const COLOR_PREFIX = "style-color-";
|
|
10721
|
-
const BACKGROUND_COLOR_PREFIX$1 = "style-bg-color-";
|
|
10722
|
-
class StandardBlockRenderer {
|
|
10723
|
-
renderText(editor, path, attributes) {
|
|
10724
|
-
return this.generateCSSCustomProperties(attributes);
|
|
10725
|
-
}
|
|
10726
|
-
renderBlock(editor, path, blockData) {
|
|
10727
|
-
var _a, _b;
|
|
10728
|
-
const attributes = {};
|
|
10729
|
-
const styles = Object.entries(blockData).filter((k) => k[0].startsWith("style-"));
|
|
10730
|
-
styles.forEach(([key, value]) => {
|
|
10731
|
-
attributes[`data-${key}`] = `${value}`;
|
|
10732
|
-
});
|
|
10733
|
-
const classes = [];
|
|
10734
|
-
if (((_b = (_a = editor.selection) == null ? void 0 : _a.range) == null ? void 0 : _b.start.blockId) === blockData.id) {
|
|
10735
|
-
classes.push("focused");
|
|
10736
|
-
}
|
|
10737
|
-
if (typeof blockData.align === "string" && blockData.align) {
|
|
10738
|
-
attributes["data-style-align"] = blockData.align;
|
|
10739
|
-
}
|
|
10740
|
-
if (blockData.heading) {
|
|
10741
|
-
attributes["data-style-heading"] = String(blockData.heading);
|
|
10742
|
-
}
|
|
10743
|
-
if (blockData.quoted) {
|
|
10744
|
-
attributes["data-style-quoted"] = "true";
|
|
10745
|
-
}
|
|
10746
|
-
if (OnesEditorHoveringBlock.get(editor).hoveringBlockId() === blockData.id) {
|
|
10747
|
-
classes.push("hover");
|
|
10748
|
-
}
|
|
10749
|
-
return { attributes, classes };
|
|
10750
|
-
}
|
|
10751
|
-
updateBlock(editor, path, blockElement, blockData) {
|
|
10752
|
-
Array.from(blockElement.attributes).forEach((a) => {
|
|
10753
|
-
if (a.name.startsWith("data-style-")) {
|
|
10754
|
-
blockElement.removeAttribute(a.name);
|
|
10755
|
-
}
|
|
10756
|
-
});
|
|
10757
|
-
const { attributes, classes } = this.renderBlock(editor, path, blockData);
|
|
10758
|
-
if (attributes) {
|
|
10759
|
-
Object.entries(attributes).forEach(([key, value]) => {
|
|
10760
|
-
blockElement.setAttribute(key, value);
|
|
10761
|
-
});
|
|
10762
|
-
}
|
|
10763
|
-
if (classes) {
|
|
10764
|
-
classes.forEach((c) => {
|
|
10765
|
-
addClass(blockElement, c);
|
|
10766
|
-
});
|
|
10767
|
-
}
|
|
10768
|
-
}
|
|
10769
|
-
generateCSSCustomProperties(attributes) {
|
|
10770
|
-
const classes = [];
|
|
10771
|
-
const newAttributes = {};
|
|
10772
|
-
const newStyles = {};
|
|
10773
|
-
Object.entries(attributes).forEach(([key, value]) => {
|
|
10774
|
-
if (value === true) {
|
|
10775
|
-
if (key.startsWith(COLOR_PREFIX)) {
|
|
10776
|
-
newAttributes["data-style-color"] = key.substring(COLOR_PREFIX.length);
|
|
10777
|
-
} else if (key.startsWith(BACKGROUND_COLOR_PREFIX$1)) {
|
|
10778
|
-
newAttributes["data-style-bg-color"] = key.substring(BACKGROUND_COLOR_PREFIX$1.length);
|
|
10779
|
-
} else if (key.startsWith("style")) {
|
|
10780
|
-
classes.push(key);
|
|
10781
|
-
}
|
|
10782
|
-
} else if (typeof value === "string") {
|
|
10783
|
-
if (key === "link") {
|
|
10784
|
-
classes.push("link");
|
|
10785
|
-
newAttributes.link = value;
|
|
10786
|
-
}
|
|
10787
|
-
if (key === "inline-style-color") {
|
|
10788
|
-
newStyles.color = value;
|
|
10789
|
-
}
|
|
10790
|
-
if (key === "inline-style-background-color") {
|
|
10791
|
-
newStyles.backgroundColor = value;
|
|
10792
|
-
}
|
|
10793
|
-
}
|
|
10794
|
-
});
|
|
10795
|
-
return { classes, attributes: newAttributes, styles: newStyles };
|
|
10796
|
-
}
|
|
10797
|
-
}
|
|
10798
|
-
const logger$4s = getLogger("block-dom");
|
|
10526
|
+
const logger$4t = getLogger("block-dom");
|
|
10799
10527
|
function isBlock$1(node) {
|
|
10800
10528
|
if (!(node instanceof HTMLDivElement)) {
|
|
10801
10529
|
return false;
|
|
@@ -10816,12 +10544,12 @@ var __publicField = (obj, key, value) => {
|
|
|
10816
10544
|
}
|
|
10817
10545
|
function getBlockId(block) {
|
|
10818
10546
|
const { id } = block;
|
|
10819
|
-
assert(logger$
|
|
10547
|
+
assert(logger$4t, id, "no block id");
|
|
10820
10548
|
return id;
|
|
10821
10549
|
}
|
|
10822
10550
|
function getBlockType(block) {
|
|
10823
10551
|
const type = block.getAttribute("data-block-type");
|
|
10824
|
-
assert(logger$
|
|
10552
|
+
assert(logger$4t, type, "invalid block dom, no data-type");
|
|
10825
10553
|
return type;
|
|
10826
10554
|
}
|
|
10827
10555
|
function getParentBlock(node) {
|
|
@@ -10844,12 +10572,12 @@ var __publicField = (obj, key, value) => {
|
|
|
10844
10572
|
}
|
|
10845
10573
|
function getParentContainer(block) {
|
|
10846
10574
|
const container = block.closest("div[data-type=editor-container]");
|
|
10847
|
-
assert(logger$
|
|
10575
|
+
assert(logger$4t, container, "failed to get block container");
|
|
10848
10576
|
return container;
|
|
10849
10577
|
}
|
|
10850
10578
|
function getBlockContent(block) {
|
|
10851
10579
|
const content = block.querySelector(":scope >div[data-type=block-content]");
|
|
10852
|
-
assert(logger$
|
|
10580
|
+
assert(logger$4t, content, "no block content");
|
|
10853
10581
|
return content;
|
|
10854
10582
|
}
|
|
10855
10583
|
function getBlockTools(block) {
|
|
@@ -10858,7 +10586,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10858
10586
|
tools = createElement("div", [], block);
|
|
10859
10587
|
tools.setAttribute("data-type", "block-tools");
|
|
10860
10588
|
}
|
|
10861
|
-
assert(logger$
|
|
10589
|
+
assert(logger$4t, tools, "no block tools");
|
|
10862
10590
|
return tools;
|
|
10863
10591
|
}
|
|
10864
10592
|
function getExistsBlockTools(block) {
|
|
@@ -10879,7 +10607,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10879
10607
|
function createBlockElement(editor, path, data2) {
|
|
10880
10608
|
const blockData = editor.editorDecorators.decorateBlock(path, data2);
|
|
10881
10609
|
const { id, type } = blockData;
|
|
10882
|
-
assert(logger$
|
|
10610
|
+
assert(logger$4t, id, "no block id");
|
|
10883
10611
|
const elem = createElement("div", [`${type}-block`], null);
|
|
10884
10612
|
elem.id = id;
|
|
10885
10613
|
elem.setAttribute("data-type", "editor-block");
|
|
@@ -10917,7 +10645,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10917
10645
|
}
|
|
10918
10646
|
function getBoxTypeFromElement(box) {
|
|
10919
10647
|
const type = box.getAttribute("data-box-type");
|
|
10920
|
-
assert(logger$
|
|
10648
|
+
assert(logger$4t, type, "not a valid box element, no type");
|
|
10921
10649
|
return type;
|
|
10922
10650
|
}
|
|
10923
10651
|
function isBox(node) {
|
|
@@ -10928,7 +10656,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10928
10656
|
}
|
|
10929
10657
|
function getBoxId(box) {
|
|
10930
10658
|
const { id } = box;
|
|
10931
|
-
assert(logger$
|
|
10659
|
+
assert(logger$4t, id, "no box id");
|
|
10932
10660
|
return id;
|
|
10933
10661
|
}
|
|
10934
10662
|
function getParentBox(node) {
|
|
@@ -10950,23 +10678,13 @@ var __publicField = (obj, key, value) => {
|
|
|
10950
10678
|
}
|
|
10951
10679
|
function getBoxContent(box) {
|
|
10952
10680
|
const content = box.querySelector("span[data-type=box-content]");
|
|
10953
|
-
assert(logger$
|
|
10681
|
+
assert(logger$4t, content, "invalid box dom, no content");
|
|
10954
10682
|
return content;
|
|
10955
10683
|
}
|
|
10956
10684
|
function createInsertionElement(type, id, attributes) {
|
|
10957
10685
|
const elem = createElement("span", [`${type}-insertion`], null);
|
|
10958
10686
|
elem.setAttribute("data-type", "editor-insertion");
|
|
10959
10687
|
elem.setAttribute("data-insertion-id", id);
|
|
10960
|
-
if (attributes) {
|
|
10961
|
-
const standardBlockRenderer = new StandardBlockRenderer();
|
|
10962
|
-
const { attributes: newAttributes } = standardBlockRenderer.generateCSSCustomProperties(attributes);
|
|
10963
|
-
if (newAttributes) {
|
|
10964
|
-
[...Object.entries(newAttributes)].forEach((item) => {
|
|
10965
|
-
const [key, value] = item;
|
|
10966
|
-
elem.setAttribute(key, value);
|
|
10967
|
-
});
|
|
10968
|
-
}
|
|
10969
|
-
}
|
|
10970
10688
|
return elem;
|
|
10971
10689
|
}
|
|
10972
10690
|
function findInsertionById(editor, id) {
|
|
@@ -10982,7 +10700,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10982
10700
|
}
|
|
10983
10701
|
function getInsertionContent(insertion) {
|
|
10984
10702
|
const content = insertion.querySelector("span[data-type=insertion-content]");
|
|
10985
|
-
assert(logger$
|
|
10703
|
+
assert(logger$4t, content, "invalid insertion-child dom, no content");
|
|
10986
10704
|
return content;
|
|
10987
10705
|
}
|
|
10988
10706
|
function getPrevBlock(block) {
|
|
@@ -11029,7 +10747,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11029
10747
|
const container = getParentContainer(block);
|
|
11030
10748
|
const children = getChildBlocks(container);
|
|
11031
10749
|
const index2 = children.indexOf(block);
|
|
11032
|
-
assert(logger$
|
|
10750
|
+
assert(logger$4t, index2 !== -1, "invalid block & container dom, failed to get block index");
|
|
11033
10751
|
return index2;
|
|
11034
10752
|
}
|
|
11035
10753
|
function isInBlock(target) {
|
|
@@ -11054,6 +10772,38 @@ var __publicField = (obj, key, value) => {
|
|
|
11054
10772
|
function isTitleBlock$2(block) {
|
|
11055
10773
|
return block.hasAttribute("data-document-title");
|
|
11056
10774
|
}
|
|
10775
|
+
const logger$4s = getLogger("block-class");
|
|
10776
|
+
function getBlockClass(editor, block) {
|
|
10777
|
+
return editor.editorBlocks.getBlockClass(getBlockType(block));
|
|
10778
|
+
}
|
|
10779
|
+
function getTextBlockClass(editor, block) {
|
|
10780
|
+
const text2 = editor.editorBlocks.getBlockClass(getBlockType(block));
|
|
10781
|
+
assert(logger$4s, text2.blockKind === "text", `is not a text block, ${text2.blockType}`);
|
|
10782
|
+
return text2;
|
|
10783
|
+
}
|
|
10784
|
+
function getComplexBlockClass(editor, block) {
|
|
10785
|
+
const complex = editor.editorBlocks.getBlockClass(getBlockType(block));
|
|
10786
|
+
assert(logger$4s, complex.blockKind === "complex", `is not a text block, ${complex.blockType}`);
|
|
10787
|
+
return complex;
|
|
10788
|
+
}
|
|
10789
|
+
function getBlockClassByType(editor, type) {
|
|
10790
|
+
return editor.editorBlocks.getBlockClass(type);
|
|
10791
|
+
}
|
|
10792
|
+
function isTextKindBlock(editor, block) {
|
|
10793
|
+
return getBlockClass(editor, block).blockKind === "text";
|
|
10794
|
+
}
|
|
10795
|
+
function isTextKindBlockType(editor, type) {
|
|
10796
|
+
return editor.editorBlocks.getBlockClass(type).blockKind === "text";
|
|
10797
|
+
}
|
|
10798
|
+
function isComplexKindBlock(editor, block) {
|
|
10799
|
+
return getBlockClass(editor, block).blockKind === "complex";
|
|
10800
|
+
}
|
|
10801
|
+
function isSimpleBlock(editor, block) {
|
|
10802
|
+
return !isComplexKindBlock(editor, block);
|
|
10803
|
+
}
|
|
10804
|
+
function getBlockKind(editor, block) {
|
|
10805
|
+
return getBlockClass(editor, block).blockKind;
|
|
10806
|
+
}
|
|
11057
10807
|
const logger$4r = getLogger("text-block-child");
|
|
11058
10808
|
function isTextBlockContentChild(elem) {
|
|
11059
10809
|
if (elem.tagName !== "SPAN") {
|
|
@@ -12450,19 +12200,6 @@ var __publicField = (obj, key, value) => {
|
|
|
12450
12200
|
}
|
|
12451
12201
|
return findTop ? getFirstChildBlock(retContainer) : getLastChildBlock(retContainer);
|
|
12452
12202
|
}
|
|
12453
|
-
function complexBlockAdjustSelectionPos(editor, complexBlock, anchor2, focus) {
|
|
12454
|
-
const blockId = getBlockId(complexBlock);
|
|
12455
|
-
assert(logger$4b, blockId === anchor2.blockId, "invalid start pos");
|
|
12456
|
-
assert(logger$4b, blockId === focus.blockId, "invalid end pos");
|
|
12457
|
-
const blockClass = getComplexBlockClass(editor, complexBlock);
|
|
12458
|
-
if (blockClass.adjustSelectionPos) {
|
|
12459
|
-
return blockClass.adjustSelectionPos(editor, complexBlock, anchor2, focus);
|
|
12460
|
-
}
|
|
12461
|
-
return {
|
|
12462
|
-
anchor: anchor2,
|
|
12463
|
-
focus
|
|
12464
|
-
};
|
|
12465
|
-
}
|
|
12466
12203
|
function isFullSelectedOneComplexBlock(editor, complexRange) {
|
|
12467
12204
|
const range = complexRange || editor.selection.range;
|
|
12468
12205
|
const { start, end } = range;
|
|
@@ -13022,6 +12759,19 @@ var __publicField = (obj, key, value) => {
|
|
|
13022
12759
|
}
|
|
13023
12760
|
assert(logger$46, false, "failed to find parent container in complex block");
|
|
13024
12761
|
}
|
|
12762
|
+
function complexBlockAdjustSelectionPos(editor, complexBlock, anchor2, focus) {
|
|
12763
|
+
const blockId = getBlockId(complexBlock);
|
|
12764
|
+
assert(logger$46, blockId === anchor2.blockId, "invalid start pos");
|
|
12765
|
+
assert(logger$46, blockId === focus.blockId, "invalid end pos");
|
|
12766
|
+
const blockClass = getComplexBlockClass(editor, complexBlock);
|
|
12767
|
+
if (blockClass.adjustSelectionPos) {
|
|
12768
|
+
return blockClass.adjustSelectionPos(editor, complexBlock, anchor2, focus);
|
|
12769
|
+
}
|
|
12770
|
+
return {
|
|
12771
|
+
anchor: anchor2,
|
|
12772
|
+
focus
|
|
12773
|
+
};
|
|
12774
|
+
}
|
|
13025
12775
|
function adjustSelectionPos$1(editor, anchor2, focus) {
|
|
13026
12776
|
const anchorBlock = editor.getBlockById(anchor2.blockId);
|
|
13027
12777
|
const focusBlock = editor.getBlockById(focus.blockId);
|
|
@@ -24603,6 +24353,289 @@ var __publicField = (obj, key, value) => {
|
|
|
24603
24353
|
insertionType: "inputting",
|
|
24604
24354
|
updateInsertionContent: updateInsertionContent$1
|
|
24605
24355
|
};
|
|
24356
|
+
class EditorBlockRenderers {
|
|
24357
|
+
constructor(editor) {
|
|
24358
|
+
__publicField(this, "renders", []);
|
|
24359
|
+
this.editor = editor;
|
|
24360
|
+
}
|
|
24361
|
+
registerRender(render) {
|
|
24362
|
+
this.renders.push(render);
|
|
24363
|
+
}
|
|
24364
|
+
renderBox(path, attributes) {
|
|
24365
|
+
const result = {
|
|
24366
|
+
classes: [],
|
|
24367
|
+
attributes: {},
|
|
24368
|
+
styles: {}
|
|
24369
|
+
};
|
|
24370
|
+
this.renders.forEach((render) => {
|
|
24371
|
+
if (render.renderBox) {
|
|
24372
|
+
const ret = render.renderBox(this.editor, path, attributes);
|
|
24373
|
+
if (ret.classes) {
|
|
24374
|
+
result.classes.push(...ret.classes);
|
|
24375
|
+
}
|
|
24376
|
+
if (ret.attributes) {
|
|
24377
|
+
result.attributes = {
|
|
24378
|
+
...result.attributes,
|
|
24379
|
+
...ret.attributes
|
|
24380
|
+
};
|
|
24381
|
+
}
|
|
24382
|
+
if (ret.styles) {
|
|
24383
|
+
result.styles = {
|
|
24384
|
+
...result.styles,
|
|
24385
|
+
...ret.styles
|
|
24386
|
+
};
|
|
24387
|
+
}
|
|
24388
|
+
}
|
|
24389
|
+
});
|
|
24390
|
+
return result;
|
|
24391
|
+
}
|
|
24392
|
+
renderText(path, attributes) {
|
|
24393
|
+
const result = {
|
|
24394
|
+
classes: [],
|
|
24395
|
+
attributes: {},
|
|
24396
|
+
styles: {}
|
|
24397
|
+
};
|
|
24398
|
+
this.renders.forEach((render) => {
|
|
24399
|
+
if (render.renderText) {
|
|
24400
|
+
const ret = render.renderText(this.editor, path, attributes);
|
|
24401
|
+
if (ret.classes) {
|
|
24402
|
+
result.classes.push(...ret.classes);
|
|
24403
|
+
}
|
|
24404
|
+
if (ret.attributes) {
|
|
24405
|
+
result.attributes = {
|
|
24406
|
+
...result.attributes,
|
|
24407
|
+
...ret.attributes
|
|
24408
|
+
};
|
|
24409
|
+
}
|
|
24410
|
+
if (ret.styles) {
|
|
24411
|
+
result.styles = {
|
|
24412
|
+
...result.styles,
|
|
24413
|
+
...ret.styles
|
|
24414
|
+
};
|
|
24415
|
+
}
|
|
24416
|
+
}
|
|
24417
|
+
});
|
|
24418
|
+
return result;
|
|
24419
|
+
}
|
|
24420
|
+
renderBlock(editor, path, blockData) {
|
|
24421
|
+
const result = {
|
|
24422
|
+
classes: [],
|
|
24423
|
+
attributes: {},
|
|
24424
|
+
styles: {}
|
|
24425
|
+
};
|
|
24426
|
+
this.renders.forEach((render) => {
|
|
24427
|
+
if (render.renderBlock) {
|
|
24428
|
+
const ret = render.renderBlock(this.editor, path, blockData);
|
|
24429
|
+
if (ret.classes) {
|
|
24430
|
+
result.classes.push(...ret.classes);
|
|
24431
|
+
}
|
|
24432
|
+
if (ret.attributes) {
|
|
24433
|
+
result.attributes = {
|
|
24434
|
+
...result.attributes,
|
|
24435
|
+
...ret.attributes
|
|
24436
|
+
};
|
|
24437
|
+
}
|
|
24438
|
+
if (ret.styles) {
|
|
24439
|
+
result.styles = {
|
|
24440
|
+
...result.styles,
|
|
24441
|
+
...ret.styles
|
|
24442
|
+
};
|
|
24443
|
+
}
|
|
24444
|
+
}
|
|
24445
|
+
});
|
|
24446
|
+
return result;
|
|
24447
|
+
}
|
|
24448
|
+
updateBlock(editor, path, blockElement, blockData) {
|
|
24449
|
+
this.renders.forEach((render) => {
|
|
24450
|
+
var _a;
|
|
24451
|
+
(_a = render.updateBlock) == null ? void 0 : _a.call(render, editor, path, blockElement, blockData);
|
|
24452
|
+
});
|
|
24453
|
+
}
|
|
24454
|
+
}
|
|
24455
|
+
class OnesEditorHoveringBlock extends tinyTypedEmitter.TypedEmitter {
|
|
24456
|
+
constructor(editor) {
|
|
24457
|
+
super();
|
|
24458
|
+
__publicField(this, "hoveringBlock", null);
|
|
24459
|
+
__publicField(this, "hoveringElem", null);
|
|
24460
|
+
__publicField(this, "hoveringTextChild", null);
|
|
24461
|
+
__publicField(this, "filters", []);
|
|
24462
|
+
__publicField(this, "finders", []);
|
|
24463
|
+
__publicField(this, "handleDocumentMouseMove", (event) => {
|
|
24464
|
+
if (this.hoveringBlock) {
|
|
24465
|
+
for (const filter of this.filters) {
|
|
24466
|
+
if (filter.isInBlock(this.hoveringBlock, event)) {
|
|
24467
|
+
return;
|
|
24468
|
+
}
|
|
24469
|
+
}
|
|
24470
|
+
}
|
|
24471
|
+
const elem = getElementFromPoint(event.x, event.y, { noFilter: true });
|
|
24472
|
+
if (!elem) {
|
|
24473
|
+
this.setHoveringBlock(null, event, null, elem);
|
|
24474
|
+
return;
|
|
24475
|
+
}
|
|
24476
|
+
let block = getParentBlock(elem);
|
|
24477
|
+
if (!block || !isChildNode(this.editor.rootContainer, block)) {
|
|
24478
|
+
block = this.findBlockByFinders(event);
|
|
24479
|
+
if (!block) {
|
|
24480
|
+
this.setHoveringBlock(null, event, null, elem);
|
|
24481
|
+
return;
|
|
24482
|
+
}
|
|
24483
|
+
}
|
|
24484
|
+
const child = this.getParentTextContentChild(block, elem);
|
|
24485
|
+
this.setHoveringBlock(block, event, child, elem);
|
|
24486
|
+
});
|
|
24487
|
+
this.editor = editor;
|
|
24488
|
+
if (clientType.isMobile) {
|
|
24489
|
+
document.addEventListener("click", this.handleDocumentMouseMove);
|
|
24490
|
+
} else {
|
|
24491
|
+
document.addEventListener("mousemove", this.handleDocumentMouseMove);
|
|
24492
|
+
}
|
|
24493
|
+
}
|
|
24494
|
+
destroy() {
|
|
24495
|
+
document.removeEventListener("mousemove", this.handleDocumentMouseMove);
|
|
24496
|
+
this.filters.forEach((filter) => filter.destroy());
|
|
24497
|
+
this.filters = [];
|
|
24498
|
+
this.finders.forEach((finder) => finder.destroy());
|
|
24499
|
+
this.finders = [];
|
|
24500
|
+
}
|
|
24501
|
+
addFilter(filter) {
|
|
24502
|
+
this.filters.push(filter);
|
|
24503
|
+
}
|
|
24504
|
+
addFinder(finder) {
|
|
24505
|
+
this.finders.push(finder);
|
|
24506
|
+
}
|
|
24507
|
+
hoveringBlockId() {
|
|
24508
|
+
if (!this.hoveringBlock) {
|
|
24509
|
+
return "";
|
|
24510
|
+
}
|
|
24511
|
+
return getBlockId(this.hoveringBlock);
|
|
24512
|
+
}
|
|
24513
|
+
findBlockByFinders(event) {
|
|
24514
|
+
for (let i = 0; i < this.finders.length; i++) {
|
|
24515
|
+
const finder = this.finders[i];
|
|
24516
|
+
const b = finder.findTargetBlock(this.editor, event);
|
|
24517
|
+
if (b) {
|
|
24518
|
+
return b;
|
|
24519
|
+
}
|
|
24520
|
+
}
|
|
24521
|
+
return null;
|
|
24522
|
+
}
|
|
24523
|
+
setHoveringBlock(block, event, child, pointElem) {
|
|
24524
|
+
if (this.hoveringBlock === block && this.hoveringTextChild === child && this.hoveringElem === event.target) {
|
|
24525
|
+
return;
|
|
24526
|
+
}
|
|
24527
|
+
if (this.hoveringBlock !== block) {
|
|
24528
|
+
const oldBlock = this.hoveringBlock && isChildNode(this.editor.rootContainer, this.hoveringBlock) ? this.hoveringBlock : null;
|
|
24529
|
+
if (oldBlock) {
|
|
24530
|
+
removeClass(oldBlock, "hover");
|
|
24531
|
+
}
|
|
24532
|
+
if (block) {
|
|
24533
|
+
addClass(block, "hover");
|
|
24534
|
+
}
|
|
24535
|
+
this.emit("change", block, oldBlock, event);
|
|
24536
|
+
}
|
|
24537
|
+
if (this.hoveringElem !== pointElem || this.hoveringBlock !== block) {
|
|
24538
|
+
this.emit("targetChange", block, this.hoveringBlock, pointElem, this.hoveringElem);
|
|
24539
|
+
}
|
|
24540
|
+
const oldChild = this.hoveringTextChild;
|
|
24541
|
+
this.hoveringTextChild = child;
|
|
24542
|
+
this.hoveringElem = pointElem;
|
|
24543
|
+
this.hoveringBlock = block;
|
|
24544
|
+
this.emit("childChange", this.hoveringBlock, child, oldChild, event);
|
|
24545
|
+
}
|
|
24546
|
+
static get(editor) {
|
|
24547
|
+
return editor.addCustom("standard-hovering-block", () => new OnesEditorHoveringBlock(editor));
|
|
24548
|
+
}
|
|
24549
|
+
getParentTextContentChild(block, elem) {
|
|
24550
|
+
if (!isTextKindBlock(this.editor, block)) {
|
|
24551
|
+
return null;
|
|
24552
|
+
}
|
|
24553
|
+
const content = getBlockContent(block);
|
|
24554
|
+
if (elem.parentElement === content) {
|
|
24555
|
+
return elem;
|
|
24556
|
+
}
|
|
24557
|
+
const box = getParentBox(elem);
|
|
24558
|
+
return box;
|
|
24559
|
+
}
|
|
24560
|
+
}
|
|
24561
|
+
const COLOR_PREFIX = "style-color-";
|
|
24562
|
+
const BACKGROUND_COLOR_PREFIX$1 = "style-bg-color-";
|
|
24563
|
+
class StandardBlockRenderer {
|
|
24564
|
+
renderText(editor, path, attributes) {
|
|
24565
|
+
return this.generateCSSCustomProperties(attributes);
|
|
24566
|
+
}
|
|
24567
|
+
renderBlock(editor, path, blockData) {
|
|
24568
|
+
var _a, _b;
|
|
24569
|
+
const attributes = {};
|
|
24570
|
+
const styles = Object.entries(blockData).filter((k) => k[0].startsWith("style-"));
|
|
24571
|
+
styles.forEach(([key, value]) => {
|
|
24572
|
+
attributes[`data-${key}`] = `${value}`;
|
|
24573
|
+
});
|
|
24574
|
+
const classes = [];
|
|
24575
|
+
if (((_b = (_a = editor.selection) == null ? void 0 : _a.range) == null ? void 0 : _b.start.blockId) === blockData.id) {
|
|
24576
|
+
classes.push("focused");
|
|
24577
|
+
}
|
|
24578
|
+
if (typeof blockData.align === "string" && blockData.align) {
|
|
24579
|
+
attributes["data-style-align"] = blockData.align;
|
|
24580
|
+
}
|
|
24581
|
+
if (blockData.heading) {
|
|
24582
|
+
attributes["data-style-heading"] = String(blockData.heading);
|
|
24583
|
+
}
|
|
24584
|
+
if (blockData.quoted) {
|
|
24585
|
+
attributes["data-style-quoted"] = "true";
|
|
24586
|
+
}
|
|
24587
|
+
if (OnesEditorHoveringBlock.get(editor).hoveringBlockId() === blockData.id) {
|
|
24588
|
+
classes.push("hover");
|
|
24589
|
+
}
|
|
24590
|
+
return { attributes, classes };
|
|
24591
|
+
}
|
|
24592
|
+
updateBlock(editor, path, blockElement, blockData) {
|
|
24593
|
+
Array.from(blockElement.attributes).forEach((a) => {
|
|
24594
|
+
if (a.name.startsWith("data-style-")) {
|
|
24595
|
+
blockElement.removeAttribute(a.name);
|
|
24596
|
+
}
|
|
24597
|
+
});
|
|
24598
|
+
const { attributes, classes } = this.renderBlock(editor, path, blockData);
|
|
24599
|
+
if (attributes) {
|
|
24600
|
+
Object.entries(attributes).forEach(([key, value]) => {
|
|
24601
|
+
blockElement.setAttribute(key, value);
|
|
24602
|
+
});
|
|
24603
|
+
}
|
|
24604
|
+
if (classes) {
|
|
24605
|
+
classes.forEach((c) => {
|
|
24606
|
+
addClass(blockElement, c);
|
|
24607
|
+
});
|
|
24608
|
+
}
|
|
24609
|
+
}
|
|
24610
|
+
generateCSSCustomProperties(attributes) {
|
|
24611
|
+
const classes = [];
|
|
24612
|
+
const newAttributes = {};
|
|
24613
|
+
const newStyles = {};
|
|
24614
|
+
Object.entries(attributes).forEach(([key, value]) => {
|
|
24615
|
+
if (value === true) {
|
|
24616
|
+
if (key.startsWith(COLOR_PREFIX)) {
|
|
24617
|
+
newAttributes["data-style-color"] = key.substring(COLOR_PREFIX.length);
|
|
24618
|
+
} else if (key.startsWith(BACKGROUND_COLOR_PREFIX$1)) {
|
|
24619
|
+
newAttributes["data-style-bg-color"] = key.substring(BACKGROUND_COLOR_PREFIX$1.length);
|
|
24620
|
+
} else if (key.startsWith("style")) {
|
|
24621
|
+
classes.push(key);
|
|
24622
|
+
}
|
|
24623
|
+
} else if (typeof value === "string") {
|
|
24624
|
+
if (key === "link") {
|
|
24625
|
+
classes.push("link");
|
|
24626
|
+
newAttributes.link = value;
|
|
24627
|
+
}
|
|
24628
|
+
if (key === "inline-style-color") {
|
|
24629
|
+
newStyles.color = value;
|
|
24630
|
+
}
|
|
24631
|
+
if (key === "inline-style-background-color") {
|
|
24632
|
+
newStyles.backgroundColor = value;
|
|
24633
|
+
}
|
|
24634
|
+
}
|
|
24635
|
+
});
|
|
24636
|
+
return { classes, attributes: newAttributes, styles: newStyles };
|
|
24637
|
+
}
|
|
24638
|
+
}
|
|
24606
24639
|
const logger$3E = getLogger("editor-insertion");
|
|
24607
24640
|
class EditorInsertions {
|
|
24608
24641
|
constructor(editor) {
|
|
@@ -24620,8 +24653,22 @@ var __publicField = (obj, key, value) => {
|
|
|
24620
24653
|
assert(logger$3E, exists, `unknown insertion type: ${type}`);
|
|
24621
24654
|
return exists;
|
|
24622
24655
|
}
|
|
24656
|
+
createInsertionElement(type, id, attributes) {
|
|
24657
|
+
const elem = createInsertionElement(type, id);
|
|
24658
|
+
if (attributes) {
|
|
24659
|
+
const standardBlockRenderer = new StandardBlockRenderer();
|
|
24660
|
+
const { attributes: newAttributes } = standardBlockRenderer.generateCSSCustomProperties(attributes);
|
|
24661
|
+
if (newAttributes) {
|
|
24662
|
+
[...Object.entries(newAttributes)].forEach((item) => {
|
|
24663
|
+
const [key, value] = item;
|
|
24664
|
+
elem.setAttribute(key, value);
|
|
24665
|
+
});
|
|
24666
|
+
}
|
|
24667
|
+
}
|
|
24668
|
+
return elem;
|
|
24669
|
+
}
|
|
24623
24670
|
createInsertion(blockContent, insertion) {
|
|
24624
|
-
const insertionElement = createInsertionElement(insertion.type, insertion.id, insertion.attributes);
|
|
24671
|
+
const insertionElement = this.createInsertionElement(insertion.type, insertion.id, insertion.attributes);
|
|
24625
24672
|
const insertionContent = createInsertionContentElement(insertionElement);
|
|
24626
24673
|
const insertionClass = this.getInsertionClass(insertion.type);
|
|
24627
24674
|
insertionClass.updateInsertionContent(this.editor, insertionElement, insertionContent, insertion);
|
|
@@ -24768,8 +24815,10 @@ var __publicField = (obj, key, value) => {
|
|
|
24768
24815
|
if (focusNode && (this.editor.contains(focusNode) || this.isInDisableScrollMask(focusNode) || this.isInCommandBar(focusNode))) {
|
|
24769
24816
|
return;
|
|
24770
24817
|
}
|
|
24771
|
-
if (
|
|
24772
|
-
|
|
24818
|
+
if (!focusNode) {
|
|
24819
|
+
if (clientType.isSafari || clientType.isIOS) {
|
|
24820
|
+
return;
|
|
24821
|
+
}
|
|
24773
24822
|
}
|
|
24774
24823
|
this.editor.emit("blur", this.editor);
|
|
24775
24824
|
this.callbacks.onBlur();
|
|
@@ -39138,10 +39187,10 @@ ${codeText}
|
|
|
39138
39187
|
const TreeIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8.80894 1.37566L9.19382 1.05649V1.05649L8.80894 1.37566ZM7.26945 1.37566L6.88457 1.05649V1.05649L7.26945 1.37566ZM12.7147 6.08541L13.0996 5.76623V5.76623L12.7147 6.08541ZM11.4874 7.72375V7.22375H10.1891L11.152 8.09459L11.4874 7.72375ZM14.159 10.1399L14.4944 9.76908L14.159 10.1399ZM10.0508 11.8816V11.3816H9.55085V11.8816H10.0508ZM10.0508 15V15.5H10.5508V15H10.0508ZM6.02806 15H5.52806V15.5H6.02806V15ZM6.02806 11.8816H6.52806V11.3816H6.02806V11.8816ZM1.91945 10.1399L2.25483 10.5108H2.25483L1.91945 10.1399ZM4.59108 7.72375L4.92646 8.09459L5.88936 7.22375H4.59108V7.72375ZM3.36368 6.0854L3.74855 6.40458L3.36368 6.0854ZM9.19382 1.05649C8.59399 0.333182 7.48441 0.333182 6.88457 1.05649L7.65432 1.69483C7.85427 1.45373 8.22413 1.45373 8.42407 1.69483L9.19382 1.05649ZM13.0996 5.76623L9.19382 1.05649L8.42407 1.69483L12.3298 6.40458L13.0996 5.76623ZM11.945 8.22375C13.215 8.22375 13.9103 6.74387 13.0996 5.76623L12.3298 6.40458C12.6001 6.73046 12.3683 7.22375 11.945 7.22375V8.22375ZM11.4874 8.22375H11.945V7.22375H11.4874V8.22375ZM14.4944 9.76908L11.8227 7.35292L11.152 8.09459L13.8236 10.5108L14.4944 9.76908ZM13.4882 12.3816C14.8612 12.3816 15.5126 10.69 14.4944 9.76908L13.8236 10.5108C14.163 10.8177 13.9459 11.3816 13.4882 11.3816V12.3816ZM10.0508 12.3816H13.4882V11.3816H10.0508V12.3816ZM9.55085 11.8816V15H10.5508V11.8816H9.55085ZM10.0508 14.5H6.02806V15.5H10.0508V14.5ZM6.52806 15V11.8816H5.52806V15H6.52806ZM2.59021 12.3816H6.02806V11.3816H2.59021V12.3816ZM1.58407 9.76909C0.565789 10.69 1.21726 12.3816 2.59021 12.3816V11.3816C2.13256 11.3816 1.9154 10.8177 2.25483 10.5108L1.58407 9.76909ZM4.2557 7.35292L1.58407 9.76909L2.25483 10.5108L4.92646 8.09459L4.2557 7.35292ZM4.13343 8.22375H4.59108V7.22375H4.13343V8.22375ZM2.97881 5.76623C2.16805 6.74387 2.86334 8.22375 4.13343 8.22375V7.22375C3.71007 7.22375 3.4783 6.73046 3.74855 6.40458L2.97881 5.76623ZM6.88457 1.05649L2.97881 5.76623L3.74855 6.40458L7.65432 1.69483L6.88457 1.05649Z" fill="currentColor"/>\n</svg>\n';
|
|
39139
39188
|
const TimeIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 8C1.5 4.41023 4.41023 1.5 8 1.5C11.5898 1.5 14.5 4.41023 14.5 8C14.5 11.5898 11.5898 14.5 8 14.5C4.41023 14.5 1.5 11.5898 1.5 8ZM8 0.5C3.85794 0.5 0.5 3.85794 0.5 8C0.5 12.1421 3.85794 15.5 8 15.5C12.1421 15.5 15.5 12.1421 15.5 8C15.5 3.85794 12.1421 0.5 8 0.5ZM7.5 3V8V8.5H8H12V7.5H8.5V3H7.5Z" fill="currentColor"/>\n</svg>\n';
|
|
39140
39189
|
const SearchIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M10.8597 11.4183L14.0962 14.8891M12.5 7.5C12.5 10.5376 10.0376 13 7 13C3.96243 13 1.5 10.5376 1.5 7.5C1.5 4.46243 3.96243 2 7 2C10.0376 2 12.5 4.46243 12.5 7.5Z" stroke="#87888A" stroke-width="2"/>\n</svg>\n';
|
|
39141
|
-
const TextGroupIcon = '<svg width="
|
|
39142
|
-
const TabIcon = '<svg width="
|
|
39143
|
-
const ShiftTabIcon = '<svg width="
|
|
39144
|
-
const TableEditIcon = '<svg width="
|
|
39190
|
+
const TextGroupIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M2.49984 9.5L7.00009 9.5" stroke="#2D2D2E"/>\n<path d="M15.0001 13.5V6.5" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M15.0001 10C15.0001 11.3807 13.8808 12.5 12.5001 12.5C11.1194 12.5 10.0001 11.3807 10.0001 10C10.0001 8.61929 11.1194 7.5 12.5001 7.5C13.8808 7.5 15.0001 8.61929 15.0001 10Z" stroke="#2D2D2E"/>\n<path d="M1.00009 13.5L4.99984 2.5L8.50009 13.5" stroke="#2D2D2E" stroke-linejoin="round"/>\n</svg>\n';
|
|
39191
|
+
const TabIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M14 2L2 2" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M14 6H7" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M2 10.5V5.5L5.5 8L2 10.5Z" fill="#2D2D2E"/>\n<path d="M14 10H7" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M14 14H2" stroke="#2D2D2E" stroke-linejoin="round"/>\n</svg>\n';
|
|
39192
|
+
const ShiftTabIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M2 2H14" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M7 6H14" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M5.5 10.5V5.5L2 8L5.5 10.5Z" fill="#2D2D2E"/>\n<path d="M7 10H14" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M2 14H14" stroke="#2D2D2E" stroke-linejoin="round"/>\n</svg>\n';
|
|
39193
|
+
const TableEditIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8 14.5H2.5C1.94772 14.5 1.5 14.0523 1.5 13.5V2.5C1.5 1.94772 1.94772 1.5 2.5 1.5H13.5C14.0523 1.5 14.5 1.94772 14.5 2.5V8" stroke="#2D2D2E"/>\n<path d="M1.6 4.8H14.4" stroke="#2D2D2E"/>\n<path d="M1.6 9.6H8.00078" stroke="#2D2D2E"/>\n<path d="M5.6 1.6L5.6 14.4" stroke="#2D2D2E"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M11.5043 8.98727L11.6789 8.22924C11.7097 8.09564 11.8387 8 11.9881 8H12.8119C12.9613 8 13.0903 8.09564 13.1211 8.22924L13.2957 8.98727C13.3177 9.08256 13.3912 9.16027 13.488 9.20102C13.569 9.23514 13.648 9.2726 13.7248 9.31318C13.8018 9.35372 13.877 9.3976 13.95 9.44477C14.037 9.50098 14.1474 9.52034 14.2487 9.49008L15.0543 9.24927C15.1963 9.20683 15.3514 9.26108 15.4261 9.37933L15.9576 10.2206C16.0323 10.3389 16.0062 10.4888 15.895 10.5799L15.2639 11.0972C15.1846 11.1622 15.1477 11.2593 15.1575 11.3562C15.1657 11.4375 15.1698 11.5189 15.1697 11.6C15.1698 11.6811 15.1658 11.7625 15.1576 11.8438C15.1478 11.9407 15.1847 12.0378 15.264 12.1028L15.895 12.62C16.0062 12.7112 16.0324 12.8611 15.9577 12.9793L15.4262 13.8206C15.3515 13.9389 15.1963 13.9931 15.0544 13.9507L14.2487 13.7099C14.1474 13.6796 14.037 13.699 13.95 13.7552C13.877 13.8024 13.8018 13.8463 13.7248 13.8868C13.648 13.9274 13.569 13.9649 13.488 13.999C13.3912 14.0397 13.3177 14.1174 13.2957 14.2127L13.1211 14.9708C13.0903 15.1044 12.9613 15.2 12.8119 15.2H11.9881C11.8387 15.2 11.7097 15.1044 11.6789 14.9708L11.5043 14.2127C11.4823 14.1174 11.4088 14.0397 11.312 13.999C11.231 13.9649 11.152 13.9274 11.0752 13.8868C10.9982 13.8463 10.923 13.8024 10.85 13.7552C10.763 13.699 10.6526 13.6796 10.5513 13.7099L9.74565 13.9507C9.60366 13.9931 9.44854 13.9389 9.37384 13.8206L8.84234 12.9793C8.76764 12.8611 8.79378 12.7112 8.905 12.62L9.53602 12.1028C9.61534 12.0378 9.6522 11.9407 9.64243 11.8438C9.63424 11.7625 9.63023 11.6811 9.63031 11.6C9.63023 11.5189 9.63426 11.4375 9.64247 11.3562C9.65226 11.2593 9.61539 11.1622 9.53607 11.0972L8.90506 10.5799C8.79384 10.4888 8.7677 10.3389 8.8424 10.2206L9.3739 9.37933C9.4486 9.26108 9.60371 9.20683 9.74571 9.24927L10.5514 9.49008C10.6526 9.52034 10.7631 9.50098 10.8501 9.44477C10.923 9.3976 10.9982 9.35372 11.0752 9.31318C11.152 9.2726 11.231 9.23514 11.312 9.20102C11.4088 9.16027 11.4823 9.08256 11.5043 8.98727ZM12.3278 12.5136C12.8866 12.5136 13.3396 12.0996 13.3396 11.5889C13.3396 11.0783 12.8866 10.6643 12.3278 10.6643C11.769 10.6643 11.316 11.0783 11.316 11.5889C11.316 12.0996 11.769 12.5136 12.3278 12.5136Z" fill="#2D2D2E"/>\n</svg>\n';
|
|
39145
39194
|
const index$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
39146
39195
|
__proto__: null,
|
|
39147
39196
|
TableEditIcon,
|
|
@@ -39490,6 +39539,9 @@ ${codeText}
|
|
|
39490
39539
|
return;
|
|
39491
39540
|
}
|
|
39492
39541
|
this.emit("click", this, item, elem);
|
|
39542
|
+
if (item.clickToClose === false) {
|
|
39543
|
+
return;
|
|
39544
|
+
}
|
|
39493
39545
|
if (this.options.autoClose) {
|
|
39494
39546
|
if ((_c = (_b = this.options).beforeClose) == null ? void 0 : _c.call(_b, event)) {
|
|
39495
39547
|
return;
|
|
@@ -40708,7 +40760,7 @@ ${codeText}
|
|
|
40708
40760
|
if (this.popper) {
|
|
40709
40761
|
this.popper.setAttribute("data-command-bar-id", "mobile-bottom-menu");
|
|
40710
40762
|
}
|
|
40711
|
-
},
|
|
40763
|
+
}, 400);
|
|
40712
40764
|
});
|
|
40713
40765
|
}
|
|
40714
40766
|
close(reason) {
|
|
@@ -41412,6 +41464,11 @@ ${codeText}
|
|
|
41412
41464
|
});
|
|
41413
41465
|
__publicField(this, "handleKeyDown", (e2, composing) => {
|
|
41414
41466
|
var _a, _b;
|
|
41467
|
+
if (this.options.mode === "textarea") {
|
|
41468
|
+
if (e2.code === "Enter") {
|
|
41469
|
+
e2.preventDefault();
|
|
41470
|
+
}
|
|
41471
|
+
}
|
|
41415
41472
|
(_b = (_a = this.options).onKeyDown) == null ? void 0 : _b.call(_a, e2, composing);
|
|
41416
41473
|
});
|
|
41417
41474
|
__publicField(this, "showSuffix", () => {
|
|
@@ -41433,6 +41490,12 @@ ${codeText}
|
|
|
41433
41490
|
});
|
|
41434
41491
|
__publicField(this, "handleInput", (e2) => {
|
|
41435
41492
|
var _a, _b;
|
|
41493
|
+
if (this.options.mode === "textarea") {
|
|
41494
|
+
const input2 = e2.target;
|
|
41495
|
+
if (input2.value.includes("\n")) {
|
|
41496
|
+
input2.value = input2.value.replace(/\n/g, "");
|
|
41497
|
+
}
|
|
41498
|
+
}
|
|
41436
41499
|
(_b = (_a = this.options).onChange) == null ? void 0 : _b.call(_a, e2);
|
|
41437
41500
|
removeClass(this.container, "error");
|
|
41438
41501
|
if (this.options.maxLength) {
|
|
@@ -41491,7 +41554,19 @@ ${codeText}
|
|
|
41491
41554
|
}
|
|
41492
41555
|
}
|
|
41493
41556
|
const inputContainer = createElement("div", ["editor-input-container"], container);
|
|
41494
|
-
|
|
41557
|
+
let input2;
|
|
41558
|
+
if ((options == null ? void 0 : options.mode) === "textarea") {
|
|
41559
|
+
addClass(inputContainer, "textarea");
|
|
41560
|
+
input2 = createElement("textarea", ["editor-input"], null);
|
|
41561
|
+
input2.onfocus = () => {
|
|
41562
|
+
addClass(inputContainer, "focus");
|
|
41563
|
+
};
|
|
41564
|
+
input2.onblur = () => {
|
|
41565
|
+
removeClass(inputContainer, "focus");
|
|
41566
|
+
};
|
|
41567
|
+
} else {
|
|
41568
|
+
input2 = createElement("input", ["editor-input"], null);
|
|
41569
|
+
}
|
|
41495
41570
|
const prefix = options.prefix;
|
|
41496
41571
|
if (prefix) {
|
|
41497
41572
|
const suffixContainer = createElement("div", ["editor-input-prefix"], inputContainer);
|
|
@@ -41729,6 +41804,13 @@ ${codeText}
|
|
|
41729
41804
|
this.menu.close();
|
|
41730
41805
|
return true;
|
|
41731
41806
|
}
|
|
41807
|
+
if (isEnterOnly(event)) {
|
|
41808
|
+
const item = this.menu.menu.getSelectedItem();
|
|
41809
|
+
if (!item) {
|
|
41810
|
+
this.menu.close();
|
|
41811
|
+
return true;
|
|
41812
|
+
}
|
|
41813
|
+
}
|
|
41732
41814
|
return this.menu.handleKeydown(event);
|
|
41733
41815
|
}
|
|
41734
41816
|
popup(block, offset, leftText, trigger) {
|
|
@@ -44812,7 +44894,7 @@ ${codeText}
|
|
|
44812
44894
|
};
|
|
44813
44895
|
editor.updateBlockData(tableBlock, newBlockData);
|
|
44814
44896
|
}
|
|
44815
|
-
const DEFAULT_COLUMN_WIDTH = 200;
|
|
44897
|
+
const DEFAULT_COLUMN_WIDTH$1 = 200;
|
|
44816
44898
|
const MIN_COLUMN_WIDTH = 40;
|
|
44817
44899
|
const logger$2i = getLogger("table-insert-column");
|
|
44818
44900
|
function insertColumn(editor, tableBlock, insertIndex) {
|
|
@@ -44846,7 +44928,7 @@ ${codeText}
|
|
|
44846
44928
|
oldBlockData[key] = oldSpan + 1;
|
|
44847
44929
|
});
|
|
44848
44930
|
const colsWidth = ((_a = oldBlockData.colsWidth) == null ? void 0 : _a.concat()) || new Array(oldBlockData.cols).fill(0);
|
|
44849
|
-
colsWidth.splice(insertIndex, 0, DEFAULT_COLUMN_WIDTH);
|
|
44931
|
+
colsWidth.splice(insertIndex, 0, DEFAULT_COLUMN_WIDTH$1);
|
|
44850
44932
|
const newChildren = TableGrid.virtualCellContainersGridToChildren(cells);
|
|
44851
44933
|
const newBlockData = {
|
|
44852
44934
|
...oldBlockData,
|
|
@@ -50291,7 +50373,8 @@ ${codeText}
|
|
|
50291
50373
|
defaultValue: linkText,
|
|
50292
50374
|
suffixClose: clientType.isMobile,
|
|
50293
50375
|
onChange: this.onChange,
|
|
50294
|
-
onKeyDown: this.handleTextKeyboard
|
|
50376
|
+
onKeyDown: this.handleTextKeyboard,
|
|
50377
|
+
mode: clientType.isMobile ? "textarea" : "input"
|
|
50295
50378
|
});
|
|
50296
50379
|
this.form.linkUrl = createInput(content, {
|
|
50297
50380
|
className: "link-popup-gap",
|
|
@@ -50301,7 +50384,8 @@ ${codeText}
|
|
|
50301
50384
|
defaultValue: linkUrl,
|
|
50302
50385
|
suffixClose: clientType.isMobile,
|
|
50303
50386
|
onChange: this.onChange,
|
|
50304
|
-
onKeyDown: this.handleUrlKeyboard
|
|
50387
|
+
onKeyDown: this.handleUrlKeyboard,
|
|
50388
|
+
mode: clientType.isMobile ? "textarea" : "input"
|
|
50305
50389
|
});
|
|
50306
50390
|
return content;
|
|
50307
50391
|
}
|
|
@@ -50944,7 +51028,9 @@ ${codeText}
|
|
|
50944
51028
|
return;
|
|
50945
51029
|
}
|
|
50946
51030
|
if (!this.editor.isWritable()) {
|
|
50947
|
-
this.
|
|
51031
|
+
if (this.toolbarType === "text") {
|
|
51032
|
+
this.toolbar.close("selectionChange");
|
|
51033
|
+
}
|
|
50948
51034
|
this.oldRange = null;
|
|
50949
51035
|
return;
|
|
50950
51036
|
}
|
|
@@ -50970,7 +51056,8 @@ ${codeText}
|
|
|
50970
51056
|
overflowBoundary: popover == null ? void 0 : popover.overflowBoundary,
|
|
50971
51057
|
refuseOverflow: true,
|
|
50972
51058
|
padding: 20,
|
|
50973
|
-
showName: clientType.isMobile
|
|
51059
|
+
showName: clientType.isMobile,
|
|
51060
|
+
autoClose: clientType.isMobile ? true : void 0
|
|
50974
51061
|
});
|
|
50975
51062
|
this.toolbar.on("click", this.handleButtonClick);
|
|
50976
51063
|
this.toolbar.on("close", this.handleClose);
|
|
@@ -51108,10 +51195,6 @@ ${codeText}
|
|
|
51108
51195
|
return;
|
|
51109
51196
|
}
|
|
51110
51197
|
this.toolbarType = "text";
|
|
51111
|
-
if (allCommands.length === 0) {
|
|
51112
|
-
this.toolbar.close("selectionChange");
|
|
51113
|
-
return;
|
|
51114
|
-
}
|
|
51115
51198
|
this.toolbar.updateItems(allCommands);
|
|
51116
51199
|
const lastBlock2 = selectedBlocks[selectedBlocks.length - 1];
|
|
51117
51200
|
let reverseToolbar = !this.editor.selection.range.isReverse() && lastBlock2 !== firstBlock;
|
|
@@ -58523,9 +58606,9 @@ $$${mathData.mathjaxText}$$
|
|
|
58523
58606
|
},
|
|
58524
58607
|
link: {
|
|
58525
58608
|
textLabel: "Text",
|
|
58526
|
-
urlLabel: "
|
|
58609
|
+
urlLabel: "URL",
|
|
58527
58610
|
textPlaceholder: "Please enter text",
|
|
58528
|
-
urlPlaceholder: "Please enter
|
|
58611
|
+
urlPlaceholder: "Please enter URL",
|
|
58529
58612
|
submitText: "Confirm",
|
|
58530
58613
|
cancelText: "Cancel",
|
|
58531
58614
|
edit: "Edit",
|
|
@@ -58581,7 +58664,7 @@ $$${mathData.mathjaxText}$$
|
|
|
58581
58664
|
textLabel: "\u30C6\u30AD\u30B9\u30C8",
|
|
58582
58665
|
urlLabel: "URL",
|
|
58583
58666
|
textPlaceholder: "\u30C6\u30AD\u30B9\u30C8\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
58584
|
-
urlPlaceholder: "URL \u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
58667
|
+
urlPlaceholder: "URL \u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
58585
58668
|
submitText: "OK",
|
|
58586
58669
|
cancelText: "\u30AD\u30E3\u30F3\u30BB\u30EB",
|
|
58587
58670
|
edit: "\u7DE8\u96C6",
|
|
@@ -69828,7 +69911,7 @@ ${codeText}
|
|
|
69828
69911
|
children.push(createEmptyContainer(editor.doc, i === 0 ? text2 : ""));
|
|
69829
69912
|
});
|
|
69830
69913
|
}
|
|
69831
|
-
const colsWidth = Array(cols).fill(DEFAULT_COLUMN_WIDTH);
|
|
69914
|
+
const colsWidth = Array(cols).fill(DEFAULT_COLUMN_WIDTH$1);
|
|
69832
69915
|
const focusContainerId = children[emptyBlock ? 0 : cols];
|
|
69833
69916
|
const focusBlockId = editor.doc.getContainerBlocks(focusContainerId)[0].id;
|
|
69834
69917
|
const blockData = {
|
|
@@ -69856,7 +69939,7 @@ ${codeText}
|
|
|
69856
69939
|
children.push(createEmptyContainer(editor.doc));
|
|
69857
69940
|
}
|
|
69858
69941
|
}
|
|
69859
|
-
const colsWidth = Array(cols).fill(DEFAULT_COLUMN_WIDTH);
|
|
69942
|
+
const colsWidth = Array(cols).fill(DEFAULT_COLUMN_WIDTH$1);
|
|
69860
69943
|
const focusContainerId = children[0];
|
|
69861
69944
|
const focusBlockId = editor.doc.getContainerBlocks(focusContainerId)[0].id;
|
|
69862
69945
|
const blockData = {
|
|
@@ -70722,8 +70805,8 @@ ${codeText}
|
|
|
70722
70805
|
abstract: "Table",
|
|
70723
70806
|
commands: {
|
|
70724
70807
|
setting: "Table settings",
|
|
70725
|
-
insertRightCol: "Insert
|
|
70726
|
-
insertBottomRow: "Insert
|
|
70808
|
+
insertRightCol: "Insert column right",
|
|
70809
|
+
insertBottomRow: "Insert row below"
|
|
70727
70810
|
}
|
|
70728
70811
|
}
|
|
70729
70812
|
};
|
|
@@ -70753,7 +70836,7 @@ ${codeText}
|
|
|
70753
70836
|
abstract: "\u30C6\u30FC\u30D6\u30EB",
|
|
70754
70837
|
commands: {
|
|
70755
70838
|
setting: "\u30C6\u30FC\u30D6\u30EB\u8A2D\u5B9A",
|
|
70756
|
-
insertRightCol: "\u53F3\
|
|
70839
|
+
insertRightCol: "\u53F3\u306B\u5217\u3092\u633F\u5165",
|
|
70757
70840
|
insertBottomRow: "\u4E0B\u306B\u884C\u3092\u633F\u5165"
|
|
70758
70841
|
}
|
|
70759
70842
|
}
|
|
@@ -70837,16 +70920,20 @@ ${codeText}
|
|
|
70837
70920
|
const tableData = editor.getBlockData(tableBlock);
|
|
70838
70921
|
const children = [{
|
|
70839
70922
|
id: "insert-right-col",
|
|
70840
|
-
name: i18n$1.t("table.commands.insertRightCol")
|
|
70923
|
+
name: i18n$1.t("table.commands.insertRightCol"),
|
|
70924
|
+
clickToClose: false
|
|
70841
70925
|
}, {
|
|
70842
70926
|
id: "insert-bottom-row",
|
|
70843
|
-
name: i18n$1.t("table.commands.insertBottomRow")
|
|
70927
|
+
name: i18n$1.t("table.commands.insertBottomRow"),
|
|
70928
|
+
clickToClose: false
|
|
70844
70929
|
}, {
|
|
70845
70930
|
id: "delete-cell",
|
|
70846
|
-
name: i18n$1.t("table.deleteCol")
|
|
70931
|
+
name: i18n$1.t("table.deleteCol"),
|
|
70932
|
+
clickToClose: false
|
|
70847
70933
|
}, {
|
|
70848
70934
|
id: "delete-row",
|
|
70849
|
-
name: i18n$1.t("table.deleteRow")
|
|
70935
|
+
name: i18n$1.t("table.deleteRow"),
|
|
70936
|
+
clickToClose: false
|
|
70850
70937
|
}, {
|
|
70851
70938
|
type: "section",
|
|
70852
70939
|
id: "section-1",
|
|
@@ -70855,17 +70942,20 @@ ${codeText}
|
|
|
70855
70942
|
id: "row-title",
|
|
70856
70943
|
name: i18n$1.t("table.tableConfig.rowTitle"),
|
|
70857
70944
|
states: tableData.hasRowTitle ? ["checked"] : [],
|
|
70858
|
-
switchable: true
|
|
70945
|
+
switchable: true,
|
|
70946
|
+
clickToClose: false
|
|
70859
70947
|
}, {
|
|
70860
70948
|
id: "col-title",
|
|
70861
70949
|
name: i18n$1.t("table.tableConfig.colTitle"),
|
|
70862
70950
|
states: tableData.hasColTitle ? ["checked"] : [],
|
|
70863
|
-
switchable: true
|
|
70951
|
+
switchable: true,
|
|
70952
|
+
clickToClose: false
|
|
70864
70953
|
}, {
|
|
70865
70954
|
id: "stripe-style",
|
|
70866
70955
|
name: i18n$1.t("table.tableConfig.stripeStyle"),
|
|
70867
70956
|
states: tableData.isStripeStyle ? ["checked"] : [],
|
|
70868
|
-
switchable: true
|
|
70957
|
+
switchable: true,
|
|
70958
|
+
clickToClose: false
|
|
70869
70959
|
}, {
|
|
70870
70960
|
type: "section",
|
|
70871
70961
|
id: "section-2",
|
|
@@ -71029,7 +71119,8 @@ ${codeText}
|
|
|
71029
71119
|
this.toolbar.updateItems(commands);
|
|
71030
71120
|
}
|
|
71031
71121
|
this.toolbar.manualShow(this.anchor, {
|
|
71032
|
-
placement: clientType.isMobile ? "top" : "bottom-start"
|
|
71122
|
+
placement: clientType.isMobile ? "top" : "bottom-start",
|
|
71123
|
+
offset: clientType.isMobile ? [0, 14] : void 0
|
|
71033
71124
|
});
|
|
71034
71125
|
}
|
|
71035
71126
|
cleaningDoc(item) {
|
|
@@ -71172,14 +71263,14 @@ ${codeText}
|
|
|
71172
71263
|
};
|
|
71173
71264
|
const enUS$j = {
|
|
71174
71265
|
pasteSpecial: {
|
|
71175
|
-
originFormats: "Keep
|
|
71266
|
+
originFormats: "Keep source formatting",
|
|
71176
71267
|
plainText: "Paste as plain text",
|
|
71177
71268
|
markdown: "Paste as markdown"
|
|
71178
71269
|
}
|
|
71179
71270
|
};
|
|
71180
71271
|
const jaJP$j = {
|
|
71181
71272
|
pasteSpecial: {
|
|
71182
|
-
originFormats: "\u5143\u306E\
|
|
71273
|
+
originFormats: "\u5143\u306E\u5F62\u5F0F\u3092\u4FDD\u6301",
|
|
71183
71274
|
plainText: "\u30D7\u30EC\u30FC\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u8CBC\u308A\u4ED8\u3051\u308B",
|
|
71184
71275
|
markdown: "Markdown \u3068\u3057\u3066\u8CBC\u308A\u4ED8\u3051"
|
|
71185
71276
|
}
|
|
@@ -80182,6 +80273,10 @@ ${content}
|
|
|
80182
80273
|
if (!isRootBlock(focusBlock)) {
|
|
80183
80274
|
return list2.filter((id) => id !== "insert-table");
|
|
80184
80275
|
}
|
|
80276
|
+
const o = this.editor.getComponentOptions("mobile");
|
|
80277
|
+
if (o == null ? void 0 : o.isAndroidApp) {
|
|
80278
|
+
return list2.filter((id) => id !== "insert-image");
|
|
80279
|
+
}
|
|
80185
80280
|
return list2;
|
|
80186
80281
|
}
|
|
80187
80282
|
}
|
|
@@ -80209,6 +80304,9 @@ ${content}
|
|
|
80209
80304
|
return groupEachCommand(commands);
|
|
80210
80305
|
});
|
|
80211
80306
|
__publicField(this, "showToolbar", () => {
|
|
80307
|
+
if (this.editor.readonly) {
|
|
80308
|
+
return;
|
|
80309
|
+
}
|
|
80212
80310
|
tippy$1.hideAll();
|
|
80213
80311
|
const commands = this.getCommands();
|
|
80214
80312
|
this.toolbar.updateItems(commands);
|
|
@@ -80504,10 +80602,10 @@ ${content}
|
|
|
80504
80602
|
__publicField(this, "mobileToolbar");
|
|
80505
80603
|
__publicField(this, "fixedProviders");
|
|
80506
80604
|
__publicField(this, "bar");
|
|
80507
|
-
__publicField(this, "subBar",
|
|
80605
|
+
__publicField(this, "subBar", []);
|
|
80508
80606
|
__publicField(this, "handleSubBarShown", (_2, subBar) => {
|
|
80509
80607
|
scrollBarIntoView(this.editor, subBar);
|
|
80510
|
-
this.subBar
|
|
80608
|
+
this.addSubBar(subBar);
|
|
80511
80609
|
});
|
|
80512
80610
|
__publicField(this, "handleSelectionChange", debounce__default.default(() => {
|
|
80513
80611
|
const commands = this.fixedProviders.getCommands(this.editor.selection.range);
|
|
@@ -80539,14 +80637,22 @@ ${content}
|
|
|
80539
80637
|
}
|
|
80540
80638
|
}, 500);
|
|
80541
80639
|
}
|
|
80640
|
+
addSubBar(subBar) {
|
|
80641
|
+
this.subBar.push(subBar);
|
|
80642
|
+
this.subBar = this.subBar.filter((item) => item.isVisible);
|
|
80643
|
+
}
|
|
80542
80644
|
layoutSubBar() {
|
|
80543
|
-
var _a
|
|
80544
|
-
|
|
80545
|
-
|
|
80645
|
+
var _a;
|
|
80646
|
+
for (const subBar of this.subBar) {
|
|
80647
|
+
if ((subBar == null ? void 0 : subBar.isVisible) && subBar.parentItem) {
|
|
80648
|
+
(_a = subBar.setProps) == null ? void 0 : _a.call(subBar, this.mobileToolbar.getSubBarOptions(subBar.parentItem));
|
|
80649
|
+
}
|
|
80546
80650
|
}
|
|
80651
|
+
this.subBar = this.subBar.filter((item) => item.isVisible);
|
|
80547
80652
|
}
|
|
80548
80653
|
destroy() {
|
|
80549
80654
|
this.editor.removeListener("selectionChanged", this.handleSelectionChange);
|
|
80655
|
+
this.subBar.forEach((item) => item.destroy());
|
|
80550
80656
|
this.mobileToolbar.destroy();
|
|
80551
80657
|
this.bar.remove();
|
|
80552
80658
|
}
|
|
@@ -85182,6 +85288,9 @@ ${data2.flowchartText}
|
|
|
85182
85288
|
this.block = block;
|
|
85183
85289
|
}
|
|
85184
85290
|
get commands() {
|
|
85291
|
+
if (clientType.isMobile) {
|
|
85292
|
+
return [];
|
|
85293
|
+
}
|
|
85185
85294
|
if (this.isHoveringImageEmpty()) {
|
|
85186
85295
|
return [];
|
|
85187
85296
|
}
|
|
@@ -85224,7 +85333,9 @@ ${data2.flowchartText}
|
|
|
85224
85333
|
video.controls = true;
|
|
85225
85334
|
video.src = url;
|
|
85226
85335
|
video.addEventListener("canplay", () => {
|
|
85227
|
-
|
|
85336
|
+
if (!clientType.isMobile) {
|
|
85337
|
+
editor.addCustom("video-resizer", () => new VideoResizer(editor));
|
|
85338
|
+
}
|
|
85228
85339
|
this.getMedia(editor, blockData.id).removeListener("mediaError", this.handleMediaError);
|
|
85229
85340
|
this.getMedia(editor, blockData.id).addListener("mediaError", this.handleMediaError);
|
|
85230
85341
|
this.getMedia(editor, blockData.id).removeFullScreen();
|
|
@@ -85266,9 +85377,11 @@ ${data2.flowchartText}
|
|
|
85266
85377
|
};
|
|
85267
85378
|
}
|
|
85268
85379
|
handleMediaError(editor, type, blockId) {
|
|
85269
|
-
|
|
85270
|
-
|
|
85271
|
-
|
|
85380
|
+
if (!clientType.isMobile) {
|
|
85381
|
+
const videoResizer = editor.addCustom("video-resizer", () => new VideoResizer(editor));
|
|
85382
|
+
const block = editor.getBlockById(blockId);
|
|
85383
|
+
videoResizer.disableBlockResize(block);
|
|
85384
|
+
}
|
|
85272
85385
|
}
|
|
85273
85386
|
updateMediaElement(editor, mediaElement, blockData, url) {
|
|
85274
85387
|
const video = mediaElement.querySelector(":scope .video-container > video");
|
|
@@ -85282,12 +85395,12 @@ ${data2.flowchartText}
|
|
|
85282
85395
|
video.style.width = "";
|
|
85283
85396
|
}
|
|
85284
85397
|
const block = editor.getBlockById(blockData.id);
|
|
85285
|
-
|
|
85286
|
-
|
|
85398
|
+
if (!clientType.isMobile) {
|
|
85399
|
+
setTimeout(() => {
|
|
85287
85400
|
const videoResizer = editor.addCustom("video-resizer", () => new VideoResizer(editor));
|
|
85288
85401
|
videoResizer.updateResizer(block);
|
|
85289
|
-
}
|
|
85290
|
-
}
|
|
85402
|
+
});
|
|
85403
|
+
}
|
|
85291
85404
|
return video;
|
|
85292
85405
|
}
|
|
85293
85406
|
}
|
|
@@ -86381,6 +86494,34 @@ ${data2.flowchartText}
|
|
|
86381
86494
|
return ret;
|
|
86382
86495
|
}
|
|
86383
86496
|
const logger$4 = getLogger("to-docx");
|
|
86497
|
+
function initEmptyLayoutMatrix(cols) {
|
|
86498
|
+
return Array.from({ length: cols }, () => ({
|
|
86499
|
+
cellId: void 0,
|
|
86500
|
+
originalWidth: 0,
|
|
86501
|
+
width: 0
|
|
86502
|
+
}));
|
|
86503
|
+
}
|
|
86504
|
+
function buildLayoutMatrix(block, maxWidth) {
|
|
86505
|
+
assert(logger$4, block.children, "no layout children");
|
|
86506
|
+
const cols = block.children.length;
|
|
86507
|
+
const colsWidth = block.colsWidth;
|
|
86508
|
+
if (colsWidth) {
|
|
86509
|
+
for (let i = 0; i < colsWidth.length; i++) {
|
|
86510
|
+
if (colsWidth[i] === 0) {
|
|
86511
|
+
colsWidth[i] = 1 / colsWidth.length;
|
|
86512
|
+
}
|
|
86513
|
+
}
|
|
86514
|
+
}
|
|
86515
|
+
const matrix = initEmptyLayoutMatrix(cols);
|
|
86516
|
+
for (let i = 0; i < cols; ++i) {
|
|
86517
|
+
matrix[i].cellId = block.children[i];
|
|
86518
|
+
matrix[i].originalWidth = colsWidth[i] * maxWidth;
|
|
86519
|
+
matrix[i].width = colsWidth[i] * maxWidth;
|
|
86520
|
+
}
|
|
86521
|
+
return matrix;
|
|
86522
|
+
}
|
|
86523
|
+
const logger$3 = getLogger("to-docx");
|
|
86524
|
+
const DEFAULT_COLUMN_WIDTH = 200;
|
|
86384
86525
|
function initEmptyTableMatrix(rows, cols) {
|
|
86385
86526
|
return Array(rows).fill(0).map(() => Array(cols).fill(0).map(() => ({
|
|
86386
86527
|
cellId: void 0,
|
|
@@ -86407,14 +86548,14 @@ ${data2.flowchartText}
|
|
|
86407
86548
|
}
|
|
86408
86549
|
}
|
|
86409
86550
|
function buildTableMatrix(block) {
|
|
86410
|
-
assert(logger$
|
|
86551
|
+
assert(logger$3, block.children, "no table children");
|
|
86411
86552
|
const rows = block.rows;
|
|
86412
86553
|
const cols = block.cols;
|
|
86413
|
-
const colsWidth = block.colsWidth;
|
|
86554
|
+
const colsWidth = new Array(block.cols).fill(DEFAULT_COLUMN_WIDTH).map((_2, i) => block.colsWidth[i] || _2);
|
|
86414
86555
|
if (colsWidth) {
|
|
86415
86556
|
for (let i = 0; i < colsWidth.length; i++) {
|
|
86416
86557
|
if (colsWidth[i] === 0) {
|
|
86417
|
-
colsWidth[i] =
|
|
86558
|
+
colsWidth[i] = DEFAULT_COLUMN_WIDTH;
|
|
86418
86559
|
}
|
|
86419
86560
|
}
|
|
86420
86561
|
}
|
|
@@ -86456,33 +86597,6 @@ ${data2.flowchartText}
|
|
|
86456
86597
|
updateMatrixByStripe(block, rows, cols, matrix);
|
|
86457
86598
|
return matrix;
|
|
86458
86599
|
}
|
|
86459
|
-
const logger$3 = getLogger("to-docx");
|
|
86460
|
-
function initEmptyLayoutMatrix(cols) {
|
|
86461
|
-
return Array.from({ length: cols }, () => ({
|
|
86462
|
-
cellId: void 0,
|
|
86463
|
-
originalWidth: 0,
|
|
86464
|
-
width: 0
|
|
86465
|
-
}));
|
|
86466
|
-
}
|
|
86467
|
-
function buildLayoutMatrix(block, maxWidth) {
|
|
86468
|
-
assert(logger$3, block.children, "no layout children");
|
|
86469
|
-
const cols = block.children.length;
|
|
86470
|
-
const colsWidth = block.colsWidth;
|
|
86471
|
-
if (colsWidth) {
|
|
86472
|
-
for (let i = 0; i < colsWidth.length; i++) {
|
|
86473
|
-
if (colsWidth[i] === 0) {
|
|
86474
|
-
colsWidth[i] = 1 / colsWidth.length;
|
|
86475
|
-
}
|
|
86476
|
-
}
|
|
86477
|
-
}
|
|
86478
|
-
const matrix = initEmptyLayoutMatrix(cols);
|
|
86479
|
-
for (let i = 0; i < cols; ++i) {
|
|
86480
|
-
matrix[i].cellId = block.children[i];
|
|
86481
|
-
matrix[i].originalWidth = colsWidth[i] * maxWidth;
|
|
86482
|
-
matrix[i].width = colsWidth[i] * maxWidth;
|
|
86483
|
-
}
|
|
86484
|
-
return matrix;
|
|
86485
|
-
}
|
|
86486
86600
|
async function convertBlocksOfDoc(parent, blocks, data2, dbg, appId, docId, md5HexFunc, getDocByBlock2, getTextsByBox, maxWidth) {
|
|
86487
86601
|
async function convertBlock(block) {
|
|
86488
86602
|
if (getDocByBlock2 && block.type !== "_exportVirtualBlock") {
|
|
@@ -86533,11 +86647,11 @@ ${data2.flowchartText}
|
|
|
86533
86647
|
const cols = block.cols;
|
|
86534
86648
|
colsWidth = new Array(cols);
|
|
86535
86649
|
for (let i = 0; i < colsWidth.length; i++) {
|
|
86536
|
-
colsWidth[i] =
|
|
86650
|
+
colsWidth[i] = DEFAULT_COLUMN_WIDTH;
|
|
86537
86651
|
}
|
|
86538
86652
|
block.colsWidth = colsWidth;
|
|
86539
86653
|
} else {
|
|
86540
|
-
colsWidth = block.colsWidth;
|
|
86654
|
+
colsWidth = new Array(block.cols).fill(DEFAULT_COLUMN_WIDTH).map((_2, i) => block.colsWidth[i] || _2);
|
|
86541
86655
|
}
|
|
86542
86656
|
const matrix = buildTableMatrix(block);
|
|
86543
86657
|
await dbg.addTableMatrix(colsWidth, matrix, data2);
|
|
@@ -87855,7 +87969,7 @@ ${data2.flowchartText}
|
|
|
87855
87969
|
}
|
|
87856
87970
|
}
|
|
87857
87971
|
});
|
|
87858
|
-
editor.version = "2.1.7-beta.
|
|
87972
|
+
editor.version = "2.1.7-beta.21";
|
|
87859
87973
|
if (Logger$2.level === LogLevel.DEBUG) {
|
|
87860
87974
|
window.setReauthFail = (fail) => {
|
|
87861
87975
|
window.isReauthError = fail;
|
|
@@ -87974,7 +88088,7 @@ ${data2.flowchartText}
|
|
|
87974
88088
|
}
|
|
87975
88089
|
}
|
|
87976
88090
|
OnesEditorToolbar.register(editor);
|
|
87977
|
-
editor.version = "2.1.7-beta.
|
|
88091
|
+
editor.version = "2.1.7-beta.21";
|
|
87978
88092
|
return editor;
|
|
87979
88093
|
}
|
|
87980
88094
|
async function showDocVersions(editor, options, serverUrl) {
|
|
@@ -134312,6 +134426,7 @@ ${data2.flowchartText}
|
|
|
134312
134426
|
exports2.loadJs = loadJs;
|
|
134313
134427
|
exports2.loadJsPromise = loadJsPromise;
|
|
134314
134428
|
exports2.lockers = lockers;
|
|
134429
|
+
exports2.logger = logger$4b;
|
|
134315
134430
|
exports2.markdownToDoc = markdownToDoc;
|
|
134316
134431
|
exports2.mergeCommands = mergeCommands;
|
|
134317
134432
|
exports2.mergeDocs = mergeDocs;
|