@coco-vexel/coco-office-editor 1.0.1 → 1.0.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/README.md +33 -1
- package/dist/index.cjs +352 -99
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +353 -101
- package/dist/index.js.map +1 -1
- package/dist/{model-DB6aN6uJ.d.cts → model-DNNBhhCB.d.cts} +4 -3
- package/dist/{model-DB6aN6uJ.d.ts → model-DNNBhhCB.d.ts} +4 -3
- package/dist/{native-B6B649CC.d.ts → native-OrEUvS8p.d.ts} +5 -1
- package/dist/native-TMv552dv.d.cts +317 -0
- package/dist/native-TMv552dv.d.ts +317 -0
- package/dist/{native-Ct9nN06K.d.cts → native-f2y3N8N5.d.cts} +5 -1
- package/dist/ppt-native.cjs +129 -59
- package/dist/ppt-native.cjs.map +1 -1
- package/dist/ppt-native.d.cts +1 -1
- package/dist/ppt-native.d.ts +1 -1
- package/dist/ppt-native.js +130 -60
- package/dist/ppt-native.js.map +1 -1
- package/dist/ppt.cjs +129 -58
- package/dist/ppt.cjs.map +1 -1
- package/dist/ppt.d.cts +3 -306
- package/dist/ppt.d.ts +3 -306
- package/dist/ppt.js +130 -60
- package/dist/ppt.js.map +1 -1
- package/dist/read-only-1_LQCO1d.d.cts +7 -0
- package/dist/read-only-1_LQCO1d.d.ts +7 -0
- package/dist/spreadsheet.cjs +114 -17
- package/dist/spreadsheet.cjs.map +1 -1
- package/dist/spreadsheet.d.cts +15 -3
- package/dist/spreadsheet.d.ts +15 -3
- package/dist/spreadsheet.js +114 -18
- package/dist/spreadsheet.js.map +1 -1
- package/dist/word-editing.d.cts +1 -1
- package/dist/word-editing.d.ts +1 -1
- package/dist/word-native.cjs +132 -23
- package/dist/word-native.cjs.map +1 -1
- package/dist/word-native.d.cts +2 -2
- package/dist/word-native.d.ts +2 -2
- package/dist/word-native.js +132 -23
- package/dist/word-native.js.map +1 -1
- package/dist/word-prosemirror.d.cts +1 -1
- package/dist/word-prosemirror.d.ts +1 -1
- package/dist/word.cjs +145 -23
- package/dist/word.cjs.map +1 -1
- package/dist/word.d.cts +5 -4
- package/dist/word.d.ts +5 -4
- package/dist/word.js +145 -24
- package/dist/word.js.map +1 -1
- package/package.json +3 -3
- package/src/styles/editor.css +1 -0
package/dist/index.cjs
CHANGED
|
@@ -43,6 +43,17 @@ var __objRest = (source, exclude) => {
|
|
|
43
43
|
return target;
|
|
44
44
|
};
|
|
45
45
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
46
|
+
|
|
47
|
+
// src/read-only.ts
|
|
48
|
+
var _EditorReadOnlyError = class _EditorReadOnlyError extends Error {
|
|
49
|
+
constructor(editor) {
|
|
50
|
+
super(`${editor} editor is read-only`);
|
|
51
|
+
__publicField(this, "code", "EDITOR_READ_ONLY");
|
|
52
|
+
this.name = "EditorReadOnlyError";
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
__name(_EditorReadOnlyError, "EditorReadOnlyError");
|
|
56
|
+
var EditorReadOnlyError = _EditorReadOnlyError;
|
|
46
57
|
var R_NS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
47
58
|
var RELS_NS = "http://schemas.openxmlformats.org/package/2006/relationships";
|
|
48
59
|
var A_NS = "http://schemas.openxmlformats.org/drawingml/2006/main";
|
|
@@ -2826,7 +2837,9 @@ function twipsToPt(twips) {
|
|
|
2826
2837
|
__name(twipsToPt, "twipsToPt");
|
|
2827
2838
|
function fontFamilyToCss(fontFamily) {
|
|
2828
2839
|
const families = fontFamily.split(",").map((family) => family.trim()).filter((family) => family.length > 0);
|
|
2829
|
-
const quotedFamilies = families.map(
|
|
2840
|
+
const quotedFamilies = families.map(
|
|
2841
|
+
(family) => `"${family.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/[\r\n\f]/g, " ")}"`
|
|
2842
|
+
);
|
|
2830
2843
|
return [...quotedFamilies, "SimSun", '"Songti SC"', '"Noto Serif CJK SC"', "serif"].join(", ");
|
|
2831
2844
|
}
|
|
2832
2845
|
__name(fontFamilyToCss, "fontFamilyToCss");
|
|
@@ -5433,6 +5446,37 @@ function textDiff(previousText, nextText) {
|
|
|
5433
5446
|
}
|
|
5434
5447
|
__name(textDiff, "textDiff");
|
|
5435
5448
|
|
|
5449
|
+
// src/word/native-url-safety.ts
|
|
5450
|
+
var RASTER_IMAGE_DATA_URL = /^data:(image\/(?:png|jpeg|gif|webp));base64,([a-z0-9+/]*={0,2})$/i;
|
|
5451
|
+
var SAFE_HYPERLINK_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "tel:"]);
|
|
5452
|
+
function safeEmbeddedRasterImageUrl(value) {
|
|
5453
|
+
const trimmed = value.trim();
|
|
5454
|
+
return RASTER_IMAGE_DATA_URL.test(trimmed) ? trimmed : null;
|
|
5455
|
+
}
|
|
5456
|
+
__name(safeEmbeddedRasterImageUrl, "safeEmbeddedRasterImageUrl");
|
|
5457
|
+
function embeddedRasterImageBlob(value) {
|
|
5458
|
+
const safeUrl = safeEmbeddedRasterImageUrl(value);
|
|
5459
|
+
const match = safeUrl ? RASTER_IMAGE_DATA_URL.exec(safeUrl) : null;
|
|
5460
|
+
if (!match) throw new Error("Only embedded PNG, JPEG, GIF, or WebP images are supported");
|
|
5461
|
+
const binary = atob(match[2]);
|
|
5462
|
+
const bytes = new Uint8Array(binary.length);
|
|
5463
|
+
for (let index = 0; index < binary.length; index++) bytes[index] = binary.charCodeAt(index);
|
|
5464
|
+
return new Blob([bytes], { type: match[1].toLowerCase() });
|
|
5465
|
+
}
|
|
5466
|
+
__name(embeddedRasterImageBlob, "embeddedRasterImageBlob");
|
|
5467
|
+
function safeRenderedHyperlinkHref(target, anchor) {
|
|
5468
|
+
if (target) {
|
|
5469
|
+
try {
|
|
5470
|
+
const parsed = new URL(target.trim());
|
|
5471
|
+
if (SAFE_HYPERLINK_PROTOCOLS.has(parsed.protocol)) return parsed.href;
|
|
5472
|
+
} catch (e) {
|
|
5473
|
+
}
|
|
5474
|
+
}
|
|
5475
|
+
if (anchor) return `#${encodeURIComponent(anchor)}`;
|
|
5476
|
+
return "#";
|
|
5477
|
+
}
|
|
5478
|
+
__name(safeRenderedHyperlinkHref, "safeRenderedHyperlinkHref");
|
|
5479
|
+
|
|
5436
5480
|
// src/word/native-renderer.ts
|
|
5437
5481
|
var NATIVE_ANNOTATION_RAIL_WIDTH_PX = 260;
|
|
5438
5482
|
function defineNativeWordElements() {
|
|
@@ -5470,6 +5514,10 @@ function renderNativeDocument(doc) {
|
|
|
5470
5514
|
root.classList.add("has-annotation-rail");
|
|
5471
5515
|
if (((_b = doc.pageLayout) == null ? void 0 : _b.width) !== void 0) {
|
|
5472
5516
|
root.style.minWidth = `${twipsToPxNumber(doc.pageLayout.width) + NATIVE_ANNOTATION_RAIL_WIDTH_PX}px`;
|
|
5517
|
+
} else {
|
|
5518
|
+
const scrollableWidth = `calc(100% + ${NATIVE_ANNOTATION_RAIL_WIDTH_PX}px)`;
|
|
5519
|
+
root.style.width = scrollableWidth;
|
|
5520
|
+
root.style.minWidth = scrollableWidth;
|
|
5473
5521
|
}
|
|
5474
5522
|
}
|
|
5475
5523
|
return root;
|
|
@@ -7374,7 +7422,8 @@ __name(renderNativeParagraph, "renderNativeParagraph");
|
|
|
7374
7422
|
function renderNativeImage(child) {
|
|
7375
7423
|
var _a, _b, _c, _d;
|
|
7376
7424
|
const img = document.createElement("img");
|
|
7377
|
-
|
|
7425
|
+
const safeSrc = safeEmbeddedRasterImageUrl(child.src);
|
|
7426
|
+
if (safeSrc) img.src = safeSrc;
|
|
7378
7427
|
img.alt = child.drawingId;
|
|
7379
7428
|
img.dataset.drawingId = child.drawingId;
|
|
7380
7429
|
if (child.revision) {
|
|
@@ -7629,12 +7678,6 @@ function renderNativeText(child) {
|
|
|
7629
7678
|
return span;
|
|
7630
7679
|
}
|
|
7631
7680
|
__name(renderNativeText, "renderNativeText");
|
|
7632
|
-
function safeRenderedHyperlinkHref(target, anchor) {
|
|
7633
|
-
if (target && /^(https?:|mailto:|tel:)/i.test(target.trim())) return target.trim();
|
|
7634
|
-
if (anchor) return `#${anchor}`;
|
|
7635
|
-
return "#";
|
|
7636
|
-
}
|
|
7637
|
-
__name(safeRenderedHyperlinkHref, "safeRenderedHyperlinkHref");
|
|
7638
7681
|
function renderNativeField(child) {
|
|
7639
7682
|
var _a;
|
|
7640
7683
|
const span = document.createElement("span");
|
|
@@ -8315,7 +8358,6 @@ function isRecord(value) {
|
|
|
8315
8358
|
}
|
|
8316
8359
|
__name(isRecord, "isRecord");
|
|
8317
8360
|
function serializeClipboardParagraphContent(paragraph) {
|
|
8318
|
-
var _a, _b;
|
|
8319
8361
|
let html = "";
|
|
8320
8362
|
let offset = 0;
|
|
8321
8363
|
const runs = [...paragraph.runs].map((run) => __spreadProps(__spreadValues({}, run), { from: Math.max(0, run.from), to: Math.min(paragraph.text.length, run.to) })).filter((run) => run.to > run.from).sort((left, right) => left.from - right.from || left.to - right.to);
|
|
@@ -8326,7 +8368,7 @@ function serializeClipboardParagraphContent(paragraph) {
|
|
|
8326
8368
|
const style = clipboardRunStyle(run.format);
|
|
8327
8369
|
let content = style ? `<span style="${escapeHtmlAttribute(style)}">${text}</span>` : text;
|
|
8328
8370
|
if (run.hyperlink) {
|
|
8329
|
-
const href = (
|
|
8371
|
+
const href = safeRenderedHyperlinkHref(run.hyperlink.target, run.hyperlink.anchor);
|
|
8330
8372
|
const title = run.hyperlink.tooltip ? ` title="${escapeHtmlAttribute(run.hyperlink.tooltip)}"` : "";
|
|
8331
8373
|
content = `<a href="${escapeHtmlAttribute(href)}"${title}>${content}</a>`;
|
|
8332
8374
|
}
|
|
@@ -8405,10 +8447,16 @@ function clipboardElementHyperlink(element) {
|
|
|
8405
8447
|
if (!href) return void 0;
|
|
8406
8448
|
const tooltip = (_b = element.getAttribute("title")) == null ? void 0 : _b.trim();
|
|
8407
8449
|
if (href.startsWith("#")) {
|
|
8408
|
-
|
|
8450
|
+
let anchor = href.slice(1);
|
|
8451
|
+
try {
|
|
8452
|
+
anchor = decodeURIComponent(anchor);
|
|
8453
|
+
} catch (e) {
|
|
8454
|
+
return void 0;
|
|
8455
|
+
}
|
|
8409
8456
|
return anchor ? __spreadValues({ anchor }, tooltip ? { tooltip } : {}) : void 0;
|
|
8410
8457
|
}
|
|
8411
|
-
|
|
8458
|
+
const safeHref = safeRenderedHyperlinkHref(href, void 0);
|
|
8459
|
+
return safeHref === "#" ? void 0 : __spreadValues({ target: safeHref }, tooltip ? { tooltip } : {});
|
|
8412
8460
|
}
|
|
8413
8461
|
__name(clipboardElementHyperlink, "clipboardElementHyperlink");
|
|
8414
8462
|
function clipboardElementFormat(element) {
|
|
@@ -11592,7 +11640,7 @@ function findParentDepth($pos, nodeName) {
|
|
|
11592
11640
|
__name(findParentDepth, "findParentDepth");
|
|
11593
11641
|
|
|
11594
11642
|
// src/generated/editor-styles.ts
|
|
11595
|
-
var editor_styles_default = '.coco-word-editor {\n background: #f4f5f7;\n color: #202124;\n font-family:\n Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.coco-word-shell {\n display: grid;\n grid-template-columns: minmax(0, 1fr) 280px;\n gap: 16px;\n width: 100%;\n height: 100%;\n min-width: 0;\n min-height: 0;\n padding: 16px;\n box-sizing: border-box;\n overflow: hidden;\n}\n\n.coco-word-document-scroll {\n min-width: 0;\n min-height: 0;\n overflow: auto;\n scrollbar-gutter: stable;\n}\n\n.coco-word-devbar {\n position: sticky;\n top: 0;\n z-index: 2;\n display: flex;\n gap: 10px;\n align-items: center;\n width: min(100%, 860px);\n margin: 0 auto 12px;\n padding: 8px 0;\n background: #f4f5f7;\n color: #52525b;\n font-size: 12px;\n}\n\n.coco-word-devbar select {\n min-width: 280px;\n max-width: 520px;\n height: 30px;\n border: 1px solid #c7cbd4;\n background: #ffffff;\n color: #202124;\n}\n\n.coco-word-toolbar {\n position: sticky;\n top: 46px;\n z-index: 2;\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n align-items: center;\n width: min(100%, 860px);\n margin: 0 auto 12px;\n padding: 8px;\n box-sizing: border-box;\n background: #ffffff;\n border: 1px solid #d8dbe2;\n color: #202124;\n font-size: 12px;\n}\n\n.coco-word-toolbar button,\n.coco-word-toolbar select,\n.coco-word-toolbar input {\n height: 30px;\n border: 1px solid #c7cbd4;\n background: #ffffff;\n color: #202124;\n}\n\n.coco-word-toolbar button {\n min-width: 32px;\n padding: 0 9px;\n cursor: pointer;\n}\n\n.coco-word-toolbar button:hover {\n background: #edf2ff;\n border-color: #8aa6e8;\n}\n\n.coco-word-toolbar button.is-active {\n background: #dbe7ff;\n border-color: #5b7fc7;\n}\n\n.coco-word-toolbar button.is-mixed,\n.coco-word-toolbar input.is-mixed {\n border-style: dashed;\n border-color: #5b7fc7;\n}\n\n.coco-word-toolbar button:disabled,\n.coco-word-toolbar select:disabled,\n.coco-word-toolbar input:disabled {\n cursor: default;\n opacity: 0.45;\n}\n\n.coco-word-toolbar label {\n display: inline-flex;\n gap: 6px;\n align-items: center;\n}\n\n.coco-word-toolbar input[type="color"] {\n width: 36px;\n padding: 2px;\n}\n\n.coco-word-image-size-input {\n width: 58px;\n padding: 0 4px;\n}\n\n.coco-word-table-size-input {\n width: 42px;\n}\n\n.coco-word-hyperlink {\n color: #0563c1;\n cursor: text;\n text-decoration: underline;\n}\n\n.coco-word-native-editor-host.is-hyperlink-navigation-mode .coco-word-hyperlink {\n cursor: pointer;\n}\n\n.coco-word-hyperlink-input {\n min-width: 160px;\n width: 190px;\n}\n\n.coco-word-highlight-icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 15px;\n height: 21px;\n box-sizing: border-box;\n border-bottom: 4px solid var(--coco-highlight-color, #ffff00);\n font-weight: 700;\n}\n\n.coco-word-toolbar-divider {\n width: 1px;\n height: 22px;\n margin: 0 4px;\n background: #d8dbe2;\n}\n\n.coco-word-searchbar {\n position: sticky;\n top: 46px;\n z-index: 3;\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n align-items: center;\n width: min(100%, 860px);\n margin: -6px auto 12px;\n padding: 8px;\n box-sizing: border-box;\n border: 1px solid #c7cbd4;\n background: #ffffff;\n box-shadow: 0 4px 12px rgb(15 23 42 / 10%);\n font-size: 12px;\n}\n\n.coco-word-searchbar[hidden] {\n display: none;\n}\n\n.coco-word-searchbar input[type="search"],\n.coco-word-searchbar input[type="text"] {\n width: 180px;\n height: 30px;\n padding: 0 8px;\n border: 1px solid #c7cbd4;\n}\n\n.coco-word-searchbar button {\n min-width: 32px;\n height: 30px;\n padding: 0 8px;\n border: 1px solid #c7cbd4;\n background: #ffffff;\n}\n\n.coco-word-searchbar label {\n display: inline-flex;\n gap: 4px;\n align-items: center;\n height: 30px;\n}\n\n#wordSearchCount {\n min-width: 52px;\n color: #52525b;\n text-align: center;\n}\n\n.coco-word-page {\n width: min(100%, 794px);\n min-height: calc(100% - 32px);\n margin: 0 auto;\n padding: 96px;\n box-sizing: border-box;\n background: #ffffff;\n border: 1px solid #d8dbe2;\n box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);\n}\n\n.coco-word-page .ProseMirror {\n outline: none;\n font-size: 16px;\n line-height: 1.75;\n}\n\n.coco-word-pages {\n width: 100%;\n min-height: calc(100% - 32px);\n}\n\ncoco-word-native-document {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n box-sizing: border-box;\n outline: none;\n color: #000000;\n font-family: SimSun, "Songti SC", "Noto Serif CJK SC", serif;\n font-size: 10.5pt;\n line-height: normal;\n}\n\ncoco-word-native-document.has-annotation-rail {\n padding-right: 260px;\n}\n\ncoco-word-native-document.is-paginated {\n display: grid;\n justify-items: center;\n gap: 18px;\n}\n\ncoco-word-native-page {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n max-width: 100%;\n background: #ffffff;\n border: 1px solid #d8dbe2;\n box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);\n}\n\ncoco-word-native-page-body {\n position: relative;\n z-index: 1;\n display: flex;\n flex-direction: column;\n align-items: stretch;\n flex: 1 1 auto;\n min-height: 0;\n}\n\ncoco-word-native-page-body > * {\n flex-shrink: 0;\n}\n\ncoco-word-native-document.uses-natural-paragraph-flow coco-word-native-page-body {\n display: flow-root;\n}\n\ncoco-word-native-document.uses-natural-paragraph-flow coco-word-native-page-body > * {\n display: block;\n}\n\n.coco-word-native-page-behind-layer,\n.coco-word-native-page-overlay {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n\n.coco-word-native-page-behind-layer {\n z-index: 0;\n}\n\n.coco-word-native-page-overlay {\n z-index: 3;\n}\n\n.coco-word-native-page-behind-layer > .is-page-layer-anchor,\n.coco-word-native-page-overlay > .is-page-layer-anchor {\n position: absolute;\n left: var(--coco-word-anchor-left, 0);\n top: var(--coco-word-anchor-top, 0);\n max-width: none;\n margin: 0;\n pointer-events: auto;\n}\n\n.coco-word-native-page-behind-layer > .is-page-layer-anchor {\n pointer-events: none;\n}\n\n.coco-word-native-page-behind-layer > .is-page-layer-anchor[data-position-horizontal-relative-from="page"],\n.coco-word-native-page-overlay > .is-page-layer-anchor[data-position-horizontal-relative-from="page"] {\n left: calc(var(--coco-word-anchor-left, 0) - var(--coco-word-page-margin-left, 0));\n}\n\n.coco-word-native-page-behind-layer > .is-page-layer-anchor[data-position-vertical-relative-from="page"],\n.coco-word-native-page-overlay > .is-page-layer-anchor[data-position-vertical-relative-from="page"] {\n top: calc(var(--coco-word-anchor-top, 0) - var(--coco-word-page-margin-top, 0));\n}\n\n.coco-word-native-page-behind-layer > .is-page-layer-anchor.is-anchor-right,\n.coco-word-native-page-overlay > .is-page-layer-anchor.is-anchor-right {\n right: 0;\n left: auto;\n}\n\n.coco-word-native-page-behind-layer > .is-page-layer-anchor.is-anchor-center,\n.coco-word-native-page-overlay > .is-page-layer-anchor.is-anchor-center {\n left: 50%;\n transform: translateX(-50%);\n}\n\n.coco-word-native-comment-layer {\n position: absolute;\n top: 0;\n right: -240px;\n z-index: 2;\n width: 220px;\n pointer-events: none;\n}\n\n.coco-word-native-comment-bubble {\n position: absolute;\n top: var(--coco-word-comment-top, 0px);\n box-sizing: border-box;\n width: 220px;\n min-height: 0;\n padding: 6px 8px;\n border: 1px solid #e6d7a1;\n border-left: 3px solid #d6a72c;\n border-radius: 4px;\n background: #fffdf2;\n box-shadow: 0 5px 16px rgba(72, 55, 8, 0.1);\n color: #332d1b;\n font-family: Calibri, Arial, sans-serif;\n pointer-events: auto;\n}\n\n.coco-word-native-comment-bubble.coco-word-native-comment-reply {\n border-left-color: #6b7fd7;\n background: #f5f7ff;\n color: #26345f;\n}\n\n.coco-word-native-comment-bubble.is-selected {\n outline: 2px solid #b7791f;\n outline-offset: 1px;\n}\n\n.coco-word-native-comment-meta {\n margin: 0 24px 3px 0;\n overflow: hidden;\n color: #76601f;\n font-size: 9px;\n font-weight: 700;\n line-height: 1.3;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.coco-word-comment-reply {\n box-shadow: inset 0 -2px 0 #7184df;\n}\n\n.coco-word-native-comment-body {\n display: -webkit-box;\n overflow: hidden;\n font-size: 11px;\n line-height: 1.2;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n}\n\n.coco-word-native-comment-actions {\n position: absolute;\n top: 6px;\n right: 8px;\n}\n\n.coco-word-native-comment-menu-button {\n width: 22px;\n height: 20px;\n padding: 0 0 4px;\n border: 0;\n border-radius: 3px;\n background: transparent;\n color: #76601f;\n cursor: pointer;\n font: 700 16px/16px Arial, sans-serif;\n}\n\n.coco-word-native-comment-menu-button:hover,\n.coco-word-native-comment-menu-button:focus-visible {\n background: #f3e8bd;\n outline: none;\n}\n\n.coco-word-native-comment-menu {\n position: absolute;\n top: 27px;\n right: 0;\n z-index: 4;\n min-width: 76px;\n padding: 4px;\n border: 1px solid #e0d2a2;\n border-radius: 4px;\n background: #fff;\n box-shadow: 0 5px 14px rgba(72, 55, 8, 0.16);\n}\n\n.coco-word-native-comment-menu-item {\n display: block;\n width: 100%;\n padding: 5px 9px;\n border: 0;\n background: transparent;\n color: #51451f;\n cursor: pointer;\n font: 12px/1.3 Calibri, Arial, sans-serif;\n text-align: left;\n}\n\n.coco-word-native-comment-menu-item:hover,\n.coco-word-native-comment-menu-item:focus-visible {\n border-radius: 2px;\n background: #f7f0d6;\n outline: none;\n}\n\n.coco-word-native-revision-layer {\n position: absolute;\n top: 0;\n right: -240px;\n z-index: 3;\n width: 220px;\n pointer-events: none;\n}\n\n.coco-word-native-revision-bubble {\n position: absolute;\n top: var(--coco-word-revision-top, 0px);\n box-sizing: border-box;\n width: 220px;\n min-height: 0;\n padding: 6px 8px;\n border: 1px solid #86b7fe;\n border-left: 3px solid #2563eb;\n background: #eff6ff;\n box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);\n color: #1e3a8a;\n font-family: Calibri, Arial, sans-serif;\n pointer-events: auto;\n}\n\n.coco-word-native-revision-group {\n position: absolute;\n top: var(--coco-word-revision-top, 0px);\n z-index: 0;\n width: 220px;\n pointer-events: auto;\n}\n\n.coco-word-native-revision-group.is-expanded {\n z-index: 6;\n}\n\n.coco-word-native-revision-group-toggle {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 2px 8px;\n align-items: center;\n width: 220px;\n min-height: 44px;\n padding: 6px 8px;\n border: 1px solid #93b7eb;\n border-left: 3px solid #2563eb;\n border-radius: 4px;\n background: #eff6ff;\n box-shadow: 0 4px 12px rgb(37 99 235 / 12%);\n color: #334155;\n cursor: pointer;\n font: 10px/1.25 Calibri, Arial, sans-serif;\n text-align: left;\n}\n\n.coco-word-native-revision-group-toggle strong {\n overflow: hidden;\n color: #1e3a8a;\n font-size: 11px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.coco-word-native-revision-group-affordance {\n grid-row: 1 / span 2;\n grid-column: 2;\n color: #2563eb;\n}\n\n.coco-word-native-revision-group-list {\n position: absolute;\n top: calc(100% + 4px);\n right: 0;\n display: grid;\n gap: 6px;\n width: 228px;\n max-height: min(360px, 60vh);\n padding: 4px;\n overflow-y: auto;\n box-sizing: border-box;\n border: 1px solid #93b7eb;\n border-radius: 4px;\n background: #f8fbff;\n box-shadow: 0 10px 24px rgb(30 64 175 / 20%);\n}\n\n.coco-word-native-revision-group-list[hidden] {\n display: none;\n}\n\n.coco-word-native-revision-group-list > .coco-word-native-revision-bubble {\n position: relative;\n top: auto;\n width: 100%;\n}\n\n.coco-word-native-revision-bubble.is-delete {\n border-color: #fca5a5;\n border-left-color: #dc2626;\n background: #fff1f2;\n color: #991b1b;\n}\n\n.coco-word-native-revision-bubble.is-selected {\n z-index: 1;\n outline: 2px solid #1d4ed8;\n outline-offset: 2px;\n box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.16), 0 6px 16px rgba(30, 64, 175, 0.2);\n}\n\n.coco-word-native-revision-bubble.is-delete.is-selected {\n outline-color: #b91c1c;\n box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.14), 0 6px 16px rgba(127, 29, 29, 0.18);\n}\n\n.coco-word-native-revision-header {\n display: flex;\n justify-content: flex-start;\n min-height: 13px;\n padding-right: 52px;\n margin-bottom: 3px;\n}\n\n.coco-word-native-revision-meta {\n overflow: hidden;\n color: #64748b;\n font-size: 9px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.coco-word-native-revision-content {\n display: -webkit-box;\n overflow: hidden;\n margin-bottom: 4px;\n color: #334155;\n font-size: 11px;\n line-height: 1.2;\n word-break: break-all;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n}\n\n.coco-word-native-revision-actions {\n display: none;\n position: absolute;\n top: 6px;\n right: 8px;\n z-index: 2;\n pointer-events: auto;\n gap: 4px;\n}\n\n.coco-word-native-revision-bubble.is-selected .coco-word-native-revision-actions {\n display: flex;\n}\n\n.coco-word-native-revision-bubble button {\n position: relative;\n z-index: 1;\n display: inline-grid;\n width: 22px;\n height: 20px;\n padding: 0;\n border: 1px solid #94a3b8;\n border-radius: 2px;\n background: #fff;\n color: inherit;\n cursor: pointer;\n font-size: 14px;\n line-height: 1;\n place-items: center;\n pointer-events: auto;\n}\n\n.coco-word-native-revision-bubble button:hover {\n filter: brightness(0.96);\n}\n\n.coco-word-native-revision-bubble button.is-accept {\n color: #15803d;\n}\n\n.coco-word-native-revision-bubble button.is-reject {\n color: #b91c1c;\n}\n\ncoco-word-native-story {\n display: block;\n margin: 0 0 18pt;\n padding: 0 0 8pt;\n border-bottom: 1px solid #d6d9df;\n color: #42464d;\n}\n\ncoco-word-native-page > coco-word-native-story {\n position: absolute;\n z-index: 1;\n right: var(--coco-word-page-margin-right, 0);\n left: var(--coco-word-page-margin-left, 0);\n margin: 0;\n padding: 0;\n border: 0;\n color: inherit;\n}\n\ncoco-word-native-page > coco-word-native-story[data-story-kind="header"] {\n top: var(--coco-word-header-distance, 0);\n}\n\ncoco-word-native-page > coco-word-native-story[data-story-kind="footer"] {\n bottom: var(--coco-word-footer-distance, 0);\n}\n\ncoco-word-native-story.is-empty {\n display: none;\n}\n\ncoco-word-native-story[data-story-kind="footer"] {\n margin: 18pt 0 0;\n padding: 8pt 0 0;\n border-top: 1px solid #d6d9df;\n border-bottom: 0;\n}\n\ncoco-word-native-page > coco-word-native-story[data-story-kind="footer"] {\n margin: 0;\n padding: 0;\n border: 0;\n}\n\ncoco-word-native-story coco-word-native-p {\n margin-bottom: 4pt;\n}\n\ncoco-word-native-page > coco-word-native-story coco-word-native-p {\n margin-bottom: 0;\n}\n\ncoco-word-native-p {\n position: relative;\n display: block;\n min-height: 1.4em;\n margin: 0;\n outline: none;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n word-break: break-word;\n box-sizing: border-box;\n}\n\ncoco-word-native-p.is-flow-empty {\n min-height: 0;\n height: 0;\n line-height: 0;\n margin: 0;\n padding: 0;\n}\n\ncoco-word-native-p:focus {\n background: #fffdf2;\n}\n\ncoco-word-native-p.has-tab-stops {\n text-align: initial;\n}\n\n.coco-word-tab-row {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: baseline;\n width: 100%;\n column-gap: 12pt;\n}\n\n.coco-word-tab-row.has-leader-dot,\n.coco-word-tab-row.has-leader-hyphen,\n.coco-word-tab-row.has-leader-underscore,\n.coco-word-tab-row.has-leader-heavy,\n.coco-word-tab-row.has-leader-middleDot {\n column-gap: 4pt;\n line-height: 2;\n}\n\n.coco-word-tab-row.is-three-part-tab {\n grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);\n}\n\n.coco-word-tab-segment {\n min-width: 0;\n}\n\n.coco-word-tab-segment.is-segment-0 {\n text-align: left;\n}\n\n.coco-word-tab-row.is-right-tab[class*="has-leader-"] .coco-word-tab-segment.is-segment-0 {\n display: flex;\n align-items: baseline;\n white-space: nowrap;\n}\n\n.coco-word-tab-row.is-right-tab[class*="has-leader-"] .coco-word-tab-segment.is-segment-0::after {\n content: "";\n flex: 1 1 auto;\n min-width: 12pt;\n margin: 0 3pt;\n border-bottom: 1px dotted currentColor;\n transform: translateY(-0.25em);\n}\n\n.coco-word-tab-row.is-right-tab.has-leader-hyphen .coco-word-tab-segment.is-segment-0::after {\n border-bottom-style: dashed;\n}\n\n.coco-word-tab-row.is-right-tab.has-leader-underscore .coco-word-tab-segment.is-segment-0::after,\n.coco-word-tab-row.is-right-tab.has-leader-heavy .coco-word-tab-segment.is-segment-0::after {\n border-bottom-style: solid;\n}\n\n.coco-word-tab-row.is-right-tab.has-leader-heavy .coco-word-tab-segment.is-segment-0::after {\n border-bottom-width: 2px;\n}\n\n.coco-word-tab-segment.is-segment-1 {\n text-align: center;\n}\n\n.coco-word-tab-row.is-right-tab .coco-word-tab-segment.is-segment-1,\n.coco-word-tab-segment.is-segment-2 {\n text-align: right;\n white-space: nowrap;\n}\n\n.coco-word-tab-marker {\n display: none;\n}\n\ncoco-word-native-p[data-numbering="true"] {\n margin-left: 2.8em;\n padding-right: 0.5em;\n text-indent: -2.8em;\n}\n\ncoco-word-native-p[data-numbering="true"]::before {\n content: attr(data-numbering-label) " ";\n display: inline-block;\n width: 2.4em;\n text-indent: 0;\n white-space: nowrap;\n}\n\ncoco-word-native-p[data-keep-lines="true"] {\n break-inside: avoid;\n}\n\ncoco-word-native-p[data-keep-next="true"] {\n break-after: avoid;\n}\n\ncoco-word-native-table {\n display: block;\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n margin: 0;\n max-width: 100%;\n overflow: auto;\n scrollbar-gutter: stable;\n --coco-word-doc-grid-line-height: 1em;\n white-space: pre-wrap;\n}\n\ncoco-word-native-table table {\n box-sizing: border-box;\n min-width: 100%;\n max-width: none;\n margin: 0;\n border-collapse: collapse;\n table-layout: fixed;\n}\n\ncoco-word-native-table tbody {\n display: table-row-group;\n}\n\ncoco-word-native-table tr[data-height-rule="exact"] {\n height: var(--coco-word-row-height);\n}\n\ncoco-word-native-table tr[data-height-rule="atLeast"] {\n height: var(--coco-word-row-height);\n}\n\ncoco-word-native-table td {\n min-width: 48px;\n padding: 0 5.4pt;\n border: var(--coco-word-table-border, 0);\n box-sizing: border-box;\n line-height: normal;\n vertical-align: top;\n}\n\ncoco-word-native-table td coco-word-native-p {\n min-height: 1.2em;\n margin: 0;\n}\n\ncoco-word-native-table td coco-word-native-p:last-child {\n margin-bottom: 0;\n}\n\ncoco-word-native-document.uses-compact-latin-tables coco-word-native-table td coco-word-native-p {\n font-size: 13px !important;\n line-height: 1.08 !important;\n}\n\ncoco-word-native-table td coco-word-native-table {\n margin: 0;\n}\n\ncoco-word-native-p img {\n display: inline-block;\n max-width: 100%;\n height: auto;\n vertical-align: baseline;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-float-right {\n float: right;\n max-width: 55%;\n margin: 0 0 10pt 14pt;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-float-left {\n float: left;\n max-width: 55%;\n margin: 0 14pt 10pt 0;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-top-bottom {\n display: block;\n clear: both;\n margin: 10pt auto;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-overlay-like {\n position: relative;\n left: var(--coco-word-anchor-left, 0);\n top: var(--coco-word-anchor-top, 0);\n display: block;\n margin: 8pt 0;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-absolute-anchor {\n position: absolute;\n left: var(--coco-word-anchor-left, 0);\n top: var(--coco-word-anchor-top, 0);\n max-width: none;\n margin: 0;\n pointer-events: auto;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-paragraph-relative-anchor,\ncoco-word-native-drawing.coco-word-anchor-drawing.is-paragraph-relative-anchor {\n max-width: 100%;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-column-relative-anchor,\ncoco-word-native-drawing.coco-word-anchor-drawing.is-column-relative-anchor {\n max-width: min(100%, var(--coco-word-column-width, 100%));\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-absolute-anchor.is-anchor-right {\n right: 0;\n left: auto;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-absolute-anchor.is-anchor-center {\n left: 50%;\n transform: translateX(-50%);\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-centered {\n display: block;\n clear: both;\n margin-right: auto;\n margin-left: auto;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-behind-text {\n z-index: 0;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-in-front-of-text {\n z-index: 2;\n}\n\ncoco-word-native-drawing {\n display: inline-flex;\n box-sizing: border-box;\n max-width: calc(100% - 4pt);\n min-width: 1px;\n min-height: 1px;\n margin: 0 2pt;\n padding: 2pt 4pt;\n vertical-align: baseline;\n white-space: pre-wrap;\n}\n\ncoco-word-native-drawing.has-border {\n border: 1px solid #d4d4d8;\n}\n\ncoco-word-native-drawing.is-empty {\n display: none !important;\n}\n\ncoco-word-native-drawing.has-fill {\n background: #ffffff;\n}\n\ncoco-word-native-drawing.is-line-or-connector {\n display: block;\n max-width: 100%;\n min-height: 0;\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n}\n\ncoco-word-native-drawing.is-line-or-connector.is-horizontal-line {\n height: 0;\n border-top: 1px solid #111827;\n}\n\ncoco-word-native-drawing.is-line-or-connector.is-vertical-line {\n width: 0;\n border-left: 1px solid #111827;\n}\n\ncoco-word-native-drawing .coco-word-native-drawing-text {\n display: block;\n width: 100%;\n}\n\ncoco-word-native-drawing .coco-word-native-drawing-paragraph {\n display: block;\n min-height: 1.2em;\n margin: 0;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-float-right {\n float: right;\n max-width: 55%;\n margin: 0 0 10pt 14pt;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-float-left {\n float: left;\n max-width: 55%;\n margin: 0 14pt 10pt 0;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-top-bottom {\n display: flex;\n clear: both;\n margin: 10pt auto;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-overlay-like {\n position: relative;\n left: var(--coco-word-anchor-left, 0);\n top: var(--coco-word-anchor-top, 0);\n display: flex;\n margin: 8pt 0;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-absolute-anchor {\n position: absolute;\n left: var(--coco-word-anchor-left, 0);\n top: var(--coco-word-anchor-top, 0);\n max-width: none;\n margin: 0;\n pointer-events: auto;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-paragraph-relative-anchor {\n max-width: 100%;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-column-relative-anchor {\n max-width: min(100%, var(--coco-word-column-width, 100%));\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-absolute-anchor.is-anchor-right {\n right: 0;\n left: auto;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-absolute-anchor.is-anchor-center {\n left: 50%;\n transform: translateX(-50%);\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-centered {\n display: flex;\n clear: both;\n margin-right: auto;\n margin-left: auto;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-behind-text {\n z-index: 0;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-in-front-of-text {\n z-index: 2;\n}\n\ncoco-word-native-p img.is-selected {\n outline: 2px solid #2563eb;\n outline-offset: 2px;\n}\n\ncoco-word-native-table td.is-cell-range-selected {\n position: relative;\n box-shadow: inset 0 0 0 9999px rgb(37 99 235 / 14%);\n}\n\ncoco-word-native-table td.is-cell-range-selected::after {\n position: absolute;\n z-index: 3;\n inset: -1px;\n border: 1px solid #2563eb;\n pointer-events: none;\n content: "";\n}\n\ncoco-word-native-table td.is-cell-range-anchor::after,\ncoco-word-native-table td.is-cell-range-focus::after {\n border-width: 2px;\n}\n\n.coco-word-native-editor-host {\n position: relative;\n user-select: text;\n -webkit-user-select: text;\n}\n\n.coco-word-native-editor-host coco-word-native-document,\n.coco-word-native-editor-host coco-word-native-page,\n.coco-word-native-editor-host coco-word-native-page-body,\n.coco-word-native-editor-host coco-word-native-story,\n.coco-word-native-editor-host coco-word-native-p {\n user-select: text;\n -webkit-user-select: text;\n}\n\n.coco-word-image-resize-handle {\n position: absolute;\n z-index: 20;\n box-sizing: border-box;\n width: 12px;\n height: 12px;\n min-width: 12px;\n min-height: 12px;\n padding: 0;\n border: 2px solid #ffffff;\n border-radius: 2px;\n background: #2563eb;\n box-shadow: 0 0 0 1px #1d4ed8;\n cursor: nwse-resize;\n touch-action: none;\n}\n\n.coco-word-page-break {\n display: block;\n position: relative;\n height: 28px;\n margin: 8px 0;\n border-top: 1px dashed #b8bdc7;\n}\n\n.coco-word-page-break::after {\n content: "Page break";\n position: absolute;\n top: -9px;\n left: 50%;\n padding: 0 6px;\n background: #ffffff;\n color: #777d88;\n font-size: 10px;\n line-height: 16px;\n transform: translateX(-50%);\n}\n\ncoco-word-native-document.is-paginated .coco-word-page-break {\n display: none;\n}\n\n.coco-word-page p {\n margin: 0 0 12px;\n}\n\n.coco-word-page p[data-style-id="Title"] {\n margin: 0 0 24px;\n padding-bottom: 10px;\n border-bottom: 2px solid #4472c4;\n color: #17365d;\n font-size: 30pt;\n line-height: 1.18;\n}\n\n.coco-word-page p[data-style-id="Heading1"] {\n margin-top: 26px;\n margin-bottom: 10px;\n color: #365f91;\n font-size: 16pt;\n font-weight: 700;\n line-height: 1.25;\n}\n\n.coco-word-page p[data-style-id="Heading2"] {\n margin-top: 20px;\n margin-bottom: 8px;\n color: #4f81bd;\n font-size: 14pt;\n font-weight: 700;\n line-height: 1.3;\n}\n\n.coco-word-page img {\n display: inline-block;\n max-width: 100%;\n height: auto;\n vertical-align: baseline;\n}\n\n.coco-word-table-scroll {\n overflow-x: auto;\n max-width: 100%;\n margin: 12px 0;\n}\n\n.coco-word-page table {\n margin: 0;\n border-collapse: collapse;\n table-layout: fixed;\n}\n\n.coco-word-page tbody {\n display: table-row-group;\n}\n\n.coco-word-page td {\n min-width: 48px;\n padding: 0 5.4pt;\n border: var(--coco-word-table-border, 1px solid #d4d4d8);\n box-sizing: border-box;\n line-height: normal;\n}\n\n.coco-word-page td p {\n margin: 0 0 6px;\n}\n\n.coco-word-page td p:last-child {\n margin-bottom: 0;\n}\n\n.coco-word-comment {\n background: #fff1a8;\n border-bottom: 2px solid #e4b100;\n}\n\n.coco-word-revision-insert {\n background: #dcfce7;\n color: #166534;\n text-decoration: underline;\n}\n\n.coco-word-revision-delete {\n background: #fee2e2;\n color: #991b1b;\n text-decoration: line-through;\n}\n\nimg.coco-word-revision-delete {\n outline: 2px solid #dc2626;\n opacity: 0.72;\n}\n\nimg.coco-word-revision-insert {\n outline: 2px solid #16a34a;\n}\n\nimg.coco-word-revision-format {\n outline: 2px dashed #7c3aed;\n outline-offset: 2px;\n}\n\ncoco-word-native-table.coco-word-revision-insert {\n outline: 2px solid #2563eb;\n outline-offset: 2px;\n}\n\ncoco-word-native-table.coco-word-revision-delete {\n outline: 2px solid #dc2626;\n outline-offset: 2px;\n opacity: 0.78;\n}\n\n.coco-word-inspector {\n min-width: 0;\n min-height: 0;\n overflow: auto;\n padding: 14px;\n background: #ffffff;\n border: 1px solid #d8dbe2;\n}\n\n@media (max-width: 1399px) {\n .coco-word-shell {\n grid-template-columns: minmax(0, 1fr);\n }\n\n .coco-word-inspector {\n display: none;\n }\n}\n\n.coco-word-inspector h2 {\n margin: 0 0 12px;\n font-size: 15px;\n}\n\n.coco-word-inspector h2:not(:first-child) {\n margin-top: 18px;\n}\n\n.coco-word-acceptance {\n display: grid;\n gap: 10px;\n margin-bottom: 14px;\n font-size: 12px;\n}\n\n.coco-word-acceptance-status {\n display: inline-flex;\n align-items: center;\n width: fit-content;\n height: 24px;\n padding: 0 8px;\n border: 1px solid #b7c7af;\n background: #eff8ea;\n color: #245917;\n font-weight: 700;\n}\n\n.coco-word-acceptance-status.is-warn {\n border-color: #e3c66d;\n background: #fff8df;\n color: #775400;\n}\n\n.coco-word-acceptance-grid {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 6px;\n}\n\n.coco-word-acceptance-metric {\n min-width: 0;\n padding: 7px;\n border: 1px solid #e1e4ea;\n background: #fafafa;\n}\n\n.coco-word-acceptance-metric span {\n display: block;\n color: #5f6368;\n font-size: 11px;\n}\n\n.coco-word-acceptance-metric strong {\n display: block;\n margin-top: 3px;\n color: #202124;\n font-size: 12px;\n font-weight: 700;\n overflow-wrap: anywhere;\n}\n\n.coco-word-acceptance-metric.is-good {\n border-color: #c8dac2;\n background: #f5fbf2;\n}\n\n.coco-word-acceptance-metric.is-warn {\n border-color: #efd77f;\n background: #fff9e8;\n}\n\n.coco-word-acceptance-section {\n color: #3f4247;\n font-size: 12px;\n font-weight: 700;\n}\n\n.coco-word-acceptance ul {\n margin: 0;\n padding-left: 18px;\n color: #775400;\n}\n\n.coco-word-acceptance-empty {\n color: #5f6368;\n}\n\n.coco-word-inspector pre {\n margin: 0;\n white-space: pre-wrap;\n word-break: break-word;\n font-size: 12px;\n line-height: 1.5;\n}\n\n.coco-word-context-menu {\n position: fixed;\n z-index: 10000;\n display: flex;\n min-width: 188px;\n max-height: calc(100vh - 8px);\n padding: 4px;\n overflow-y: auto;\n flex-direction: column;\n background: #ffffff;\n border: 1px solid #c8c8c8;\n border-radius: 4px;\n box-shadow: 0 8px 24px rgb(0 0 0 / 16%);\n color: #202124;\n font: 13px/1.35 Arial, "Microsoft YaHei", sans-serif;\n}\n\n.coco-word-context-menu-item {\n min-height: 30px;\n padding: 5px 10px;\n border: 0;\n border-radius: 3px;\n background: transparent;\n color: inherit;\n font: inherit;\n letter-spacing: 0;\n text-align: left;\n white-space: nowrap;\n cursor: default;\n}\n\n.coco-word-context-menu-item:hover:not(:disabled),\n.coco-word-context-menu-item:focus-visible:not(:disabled) {\n background: #e8f0fe;\n outline: none;\n}\n\n.coco-word-context-menu-item:disabled {\n color: #9aa0a6;\n}\n\n.coco-word-context-menu-separator {\n height: 1px;\n margin: 4px 6px;\n background: #dadce0;\n}\n\n.coco-word-dialog-backdrop {\n position: fixed;\n inset: 0;\n z-index: 11000;\n display: grid;\n place-items: center;\n padding: 20px;\n box-sizing: border-box;\n background: rgb(15 23 42 / 28%);\n}\n\n.coco-word-dialog {\n width: min(420px, 100%);\n padding: 20px;\n box-sizing: border-box;\n background: #ffffff;\n border: 1px solid #c7cbd4;\n box-shadow: 0 12px 32px rgb(15 23 42 / 22%);\n}\n\n.coco-word-dialog h2 {\n margin: 0 0 14px;\n color: #202124;\n font-size: 17px;\n font-weight: 600;\n}\n\n.coco-word-dialog-input {\n display: block;\n width: 100%;\n min-height: 96px;\n padding: 9px 10px;\n box-sizing: border-box;\n border: 1px solid #c7cbd4;\n color: #202124;\n font: 14px/1.5 Arial, "Microsoft YaHei", sans-serif;\n resize: vertical;\n}\n\n.coco-word-dialog-input:focus {\n outline: 2px solid rgb(59 91 219 / 22%);\n border-color: #3b5bdb;\n}\n\n.coco-word-dialog-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 16px;\n}\n\n.coco-word-dialog-button {\n min-width: 72px;\n min-height: 34px;\n padding: 6px 14px;\n border: 1px solid #c7cbd4;\n background: #ffffff;\n color: #202124;\n font: 14px Arial, "Microsoft YaHei", sans-serif;\n cursor: pointer;\n}\n\n.coco-word-dialog-button.is-primary {\n border-color: #3158c9;\n background: #3158c9;\n color: #ffffff;\n}\n\n.coco-word-dialog-button:hover {\n filter: brightness(0.96);\n}\n';
|
|
11643
|
+
var editor_styles_default = '.coco-word-editor {\n background: #f4f5f7;\n color: #202124;\n font-family:\n Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.coco-word-shell {\n display: grid;\n grid-template-columns: minmax(0, 1fr) 280px;\n gap: 16px;\n width: 100%;\n height: 100%;\n min-width: 0;\n min-height: 0;\n padding: 16px;\n box-sizing: border-box;\n overflow: hidden;\n}\n\n.coco-word-document-scroll {\n min-width: 0;\n min-height: 0;\n overflow: auto;\n scrollbar-gutter: stable;\n}\n\n.coco-word-devbar {\n position: sticky;\n top: 0;\n z-index: 2;\n display: flex;\n gap: 10px;\n align-items: center;\n width: min(100%, 860px);\n margin: 0 auto 12px;\n padding: 8px 0;\n background: #f4f5f7;\n color: #52525b;\n font-size: 12px;\n}\n\n.coco-word-devbar select {\n min-width: 280px;\n max-width: 520px;\n height: 30px;\n border: 1px solid #c7cbd4;\n background: #ffffff;\n color: #202124;\n}\n\n.coco-word-toolbar {\n position: sticky;\n top: 46px;\n z-index: 2;\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n align-items: center;\n width: min(100%, 860px);\n margin: 0 auto 12px;\n padding: 8px;\n box-sizing: border-box;\n background: #ffffff;\n border: 1px solid #d8dbe2;\n color: #202124;\n font-size: 12px;\n}\n\n.coco-word-toolbar button,\n.coco-word-toolbar select,\n.coco-word-toolbar input {\n height: 30px;\n border: 1px solid #c7cbd4;\n background: #ffffff;\n color: #202124;\n}\n\n.coco-word-toolbar button {\n min-width: 32px;\n padding: 0 9px;\n cursor: pointer;\n}\n\n.coco-word-toolbar button:hover {\n background: #edf2ff;\n border-color: #8aa6e8;\n}\n\n.coco-word-toolbar button.is-active {\n background: #dbe7ff;\n border-color: #5b7fc7;\n}\n\n.coco-word-toolbar button.is-mixed,\n.coco-word-toolbar input.is-mixed {\n border-style: dashed;\n border-color: #5b7fc7;\n}\n\n.coco-word-toolbar button:disabled,\n.coco-word-toolbar select:disabled,\n.coco-word-toolbar input:disabled {\n cursor: default;\n opacity: 0.45;\n}\n\n.coco-word-toolbar label {\n display: inline-flex;\n gap: 6px;\n align-items: center;\n}\n\n.coco-word-toolbar input[type="color"] {\n width: 36px;\n padding: 2px;\n}\n\n.coco-word-image-size-input {\n width: 58px;\n padding: 0 4px;\n}\n\n.coco-word-table-size-input {\n width: 42px;\n}\n\n.coco-word-hyperlink {\n color: #0563c1;\n cursor: text;\n text-decoration: underline;\n}\n\n.coco-word-native-editor-host.is-hyperlink-navigation-mode .coco-word-hyperlink {\n cursor: pointer;\n}\n\n.coco-word-hyperlink-input {\n min-width: 160px;\n width: 190px;\n}\n\n.coco-word-highlight-icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 15px;\n height: 21px;\n box-sizing: border-box;\n border-bottom: 4px solid var(--coco-highlight-color, #ffff00);\n font-weight: 700;\n}\n\n.coco-word-toolbar-divider {\n width: 1px;\n height: 22px;\n margin: 0 4px;\n background: #d8dbe2;\n}\n\n.coco-word-searchbar {\n position: sticky;\n top: 46px;\n z-index: 3;\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n align-items: center;\n width: min(100%, 860px);\n margin: -6px auto 12px;\n padding: 8px;\n box-sizing: border-box;\n border: 1px solid #c7cbd4;\n background: #ffffff;\n box-shadow: 0 4px 12px rgb(15 23 42 / 10%);\n font-size: 12px;\n}\n\n.coco-word-searchbar[hidden] {\n display: none;\n}\n\n.coco-word-searchbar input[type="search"],\n.coco-word-searchbar input[type="text"] {\n width: 180px;\n height: 30px;\n padding: 0 8px;\n border: 1px solid #c7cbd4;\n}\n\n.coco-word-searchbar button {\n min-width: 32px;\n height: 30px;\n padding: 0 8px;\n border: 1px solid #c7cbd4;\n background: #ffffff;\n}\n\n.coco-word-searchbar label {\n display: inline-flex;\n gap: 4px;\n align-items: center;\n height: 30px;\n}\n\n#wordSearchCount {\n min-width: 52px;\n color: #52525b;\n text-align: center;\n}\n\n.coco-word-page {\n width: min(100%, 794px);\n min-height: calc(100% - 32px);\n margin: 0 auto;\n padding: 96px;\n box-sizing: border-box;\n background: #ffffff;\n border: 1px solid #d8dbe2;\n box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);\n}\n\n.coco-word-page .ProseMirror {\n outline: none;\n font-size: 16px;\n line-height: 1.75;\n}\n\n.coco-word-pages {\n width: 100%;\n min-height: calc(100% - 32px);\n}\n\ncoco-word-native-document {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n box-sizing: border-box;\n outline: none;\n color: #000000;\n font-family: SimSun, "Songti SC", "Noto Serif CJK SC", serif;\n font-size: 10.5pt;\n line-height: normal;\n}\n\ncoco-word-native-document.has-annotation-rail {\n padding-right: 260px;\n}\n\ncoco-word-native-document.is-paginated {\n display: grid;\n justify-items: center;\n gap: 18px;\n}\n\ncoco-word-native-page {\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n max-width: 100%;\n background: #ffffff;\n border: 1px solid #d8dbe2;\n box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);\n}\n\ncoco-word-native-page-body {\n position: relative;\n z-index: 1;\n display: flex;\n flex-direction: column;\n align-items: stretch;\n flex: 1 1 auto;\n min-height: 0;\n}\n\ncoco-word-native-page-body > * {\n flex-shrink: 0;\n}\n\ncoco-word-native-document.uses-natural-paragraph-flow coco-word-native-page-body {\n display: flow-root;\n}\n\ncoco-word-native-document.uses-natural-paragraph-flow coco-word-native-page-body > * {\n display: block;\n}\n\n.coco-word-native-page-behind-layer,\n.coco-word-native-page-overlay {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n\n.coco-word-native-page-behind-layer {\n z-index: 0;\n}\n\n.coco-word-native-page-overlay {\n z-index: 3;\n}\n\n.coco-word-native-page-behind-layer > .is-page-layer-anchor,\n.coco-word-native-page-overlay > .is-page-layer-anchor {\n position: absolute;\n left: var(--coco-word-anchor-left, 0);\n top: var(--coco-word-anchor-top, 0);\n max-width: none;\n margin: 0;\n pointer-events: auto;\n}\n\n.coco-word-native-page-behind-layer > .is-page-layer-anchor {\n pointer-events: none;\n}\n\n.coco-word-native-page-behind-layer > .is-page-layer-anchor[data-position-horizontal-relative-from="page"],\n.coco-word-native-page-overlay > .is-page-layer-anchor[data-position-horizontal-relative-from="page"] {\n left: calc(var(--coco-word-anchor-left, 0) - var(--coco-word-page-margin-left, 0));\n}\n\n.coco-word-native-page-behind-layer > .is-page-layer-anchor[data-position-vertical-relative-from="page"],\n.coco-word-native-page-overlay > .is-page-layer-anchor[data-position-vertical-relative-from="page"] {\n top: calc(var(--coco-word-anchor-top, 0) - var(--coco-word-page-margin-top, 0));\n}\n\n.coco-word-native-page-behind-layer > .is-page-layer-anchor.is-anchor-right,\n.coco-word-native-page-overlay > .is-page-layer-anchor.is-anchor-right {\n right: 0;\n left: auto;\n}\n\n.coco-word-native-page-behind-layer > .is-page-layer-anchor.is-anchor-center,\n.coco-word-native-page-overlay > .is-page-layer-anchor.is-anchor-center {\n left: 50%;\n transform: translateX(-50%);\n}\n\n.coco-word-native-comment-layer {\n position: absolute;\n top: 0;\n right: -240px;\n z-index: 2;\n width: 220px;\n pointer-events: none;\n}\n\n.coco-word-native-comment-bubble {\n position: absolute;\n top: var(--coco-word-comment-top, 0px);\n box-sizing: border-box;\n width: 220px;\n min-height: 0;\n padding: 6px 8px;\n border: 1px solid #e6d7a1;\n border-left: 3px solid #d6a72c;\n border-radius: 4px;\n background: #fffdf2;\n box-shadow: 0 5px 16px rgba(72, 55, 8, 0.1);\n color: #332d1b;\n font-family: Calibri, Arial, sans-serif;\n pointer-events: auto;\n}\n\n.coco-word-native-comment-bubble.coco-word-native-comment-reply {\n border-left-color: #6b7fd7;\n background: #f5f7ff;\n color: #26345f;\n}\n\n.coco-word-native-comment-bubble.is-selected {\n outline: 2px solid #b7791f;\n outline-offset: 1px;\n}\n\n.coco-word-native-comment-meta {\n margin: 0 24px 3px 0;\n overflow: hidden;\n color: #76601f;\n font-size: 9px;\n font-weight: 700;\n line-height: 1.3;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.coco-word-comment-reply {\n box-shadow: inset 0 -2px 0 #7184df;\n}\n\n.coco-word-native-comment-body {\n display: -webkit-box;\n overflow: hidden;\n font-size: 11px;\n line-height: 1.2;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n}\n\n.coco-word-native-comment-actions {\n position: absolute;\n top: 6px;\n right: 8px;\n}\n\n.coco-word-native-comment-menu-button {\n width: 22px;\n height: 20px;\n padding: 0 0 4px;\n border: 0;\n border-radius: 3px;\n background: transparent;\n color: #76601f;\n cursor: pointer;\n font: 700 16px/16px Arial, sans-serif;\n}\n\n.coco-word-native-comment-menu-button:hover,\n.coco-word-native-comment-menu-button:focus-visible {\n background: #f3e8bd;\n outline: none;\n}\n\n.coco-word-native-comment-menu {\n position: absolute;\n top: 27px;\n right: 0;\n z-index: 4;\n min-width: 76px;\n padding: 4px;\n border: 1px solid #e0d2a2;\n border-radius: 4px;\n background: #fff;\n box-shadow: 0 5px 14px rgba(72, 55, 8, 0.16);\n}\n\n.coco-word-native-comment-menu-item {\n display: block;\n width: 100%;\n padding: 5px 9px;\n border: 0;\n background: transparent;\n color: #51451f;\n cursor: pointer;\n font: 12px/1.3 Calibri, Arial, sans-serif;\n text-align: left;\n}\n\n.coco-word-native-comment-menu-item:hover,\n.coco-word-native-comment-menu-item:focus-visible {\n border-radius: 2px;\n background: #f7f0d6;\n outline: none;\n}\n\n.coco-word-native-revision-layer {\n position: absolute;\n top: 0;\n right: -240px;\n z-index: 3;\n width: 220px;\n pointer-events: none;\n}\n\n.coco-word-native-revision-bubble {\n position: absolute;\n top: var(--coco-word-revision-top, 0px);\n box-sizing: border-box;\n width: 220px;\n min-height: 0;\n padding: 6px 8px;\n border: 1px solid #86b7fe;\n border-left: 3px solid #2563eb;\n background: #eff6ff;\n box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);\n color: #1e3a8a;\n font-family: Calibri, Arial, sans-serif;\n pointer-events: auto;\n}\n\n.coco-word-native-revision-group {\n position: absolute;\n top: var(--coco-word-revision-top, 0px);\n z-index: 0;\n width: 220px;\n pointer-events: auto;\n}\n\n.coco-word-native-revision-group.is-expanded {\n z-index: 6;\n}\n\n.coco-word-native-revision-group-toggle {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 2px 8px;\n align-items: center;\n width: 220px;\n min-height: 44px;\n padding: 6px 8px;\n border: 1px solid #93b7eb;\n border-left: 3px solid #2563eb;\n border-radius: 4px;\n background: #eff6ff;\n box-shadow: 0 4px 12px rgb(37 99 235 / 12%);\n color: #334155;\n cursor: pointer;\n font: 10px/1.25 Calibri, Arial, sans-serif;\n text-align: left;\n}\n\n.coco-word-native-revision-group-toggle strong {\n overflow: hidden;\n color: #1e3a8a;\n font-size: 11px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.coco-word-native-revision-group-affordance {\n grid-row: 1 / span 2;\n grid-column: 2;\n color: #2563eb;\n}\n\n.coco-word-native-revision-group-list {\n position: absolute;\n top: calc(100% + 4px);\n right: 0;\n display: grid;\n gap: 6px;\n width: 228px;\n max-height: min(360px, 60vh);\n padding: 4px;\n overflow-y: auto;\n box-sizing: border-box;\n border: 1px solid #93b7eb;\n border-radius: 4px;\n background: #f8fbff;\n box-shadow: 0 10px 24px rgb(30 64 175 / 20%);\n}\n\n.coco-word-native-revision-group-list[hidden] {\n display: none;\n}\n\n.coco-word-native-revision-group-list > .coco-word-native-revision-bubble {\n position: relative;\n top: auto;\n width: 100%;\n}\n\n.coco-word-native-revision-bubble.is-delete {\n border-color: #fca5a5;\n border-left-color: #dc2626;\n background: #fff1f2;\n color: #991b1b;\n}\n\n.coco-word-native-revision-bubble.is-selected {\n z-index: 1;\n outline: 2px solid #1d4ed8;\n outline-offset: 2px;\n box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.16), 0 6px 16px rgba(30, 64, 175, 0.2);\n}\n\n.coco-word-native-revision-bubble.is-delete.is-selected {\n outline-color: #b91c1c;\n box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.14), 0 6px 16px rgba(127, 29, 29, 0.18);\n}\n\n.coco-word-native-revision-header {\n display: flex;\n justify-content: flex-start;\n min-height: 13px;\n padding-right: 52px;\n margin-bottom: 3px;\n}\n\n.coco-word-native-revision-meta {\n overflow: hidden;\n color: #64748b;\n font-size: 9px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.coco-word-native-revision-content {\n display: -webkit-box;\n overflow: hidden;\n margin-bottom: 4px;\n color: #334155;\n font-size: 11px;\n line-height: 1.2;\n word-break: break-all;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n}\n\n.coco-word-native-revision-actions {\n display: none;\n position: absolute;\n top: 6px;\n right: 8px;\n z-index: 2;\n pointer-events: auto;\n gap: 4px;\n}\n\n.coco-word-native-revision-bubble.is-selected .coco-word-native-revision-actions {\n display: flex;\n}\n\n.coco-word-native-revision-bubble button {\n position: relative;\n z-index: 1;\n display: inline-grid;\n width: 22px;\n height: 20px;\n padding: 0;\n border: 1px solid #94a3b8;\n border-radius: 2px;\n background: #fff;\n color: inherit;\n cursor: pointer;\n font-size: 14px;\n line-height: 1;\n place-items: center;\n pointer-events: auto;\n}\n\n.coco-word-native-revision-bubble button:hover {\n filter: brightness(0.96);\n}\n\n.coco-word-native-revision-bubble button.is-accept {\n color: #15803d;\n}\n\n.coco-word-native-revision-bubble button.is-reject {\n color: #b91c1c;\n}\n\ncoco-word-native-story {\n display: block;\n margin: 0 0 18pt;\n padding: 0 0 8pt;\n border-bottom: 1px solid #d6d9df;\n color: #42464d;\n}\n\ncoco-word-native-page > coco-word-native-story {\n position: absolute;\n z-index: 1;\n right: var(--coco-word-page-margin-right, 0);\n left: var(--coco-word-page-margin-left, 0);\n margin: 0;\n padding: 0;\n border: 0;\n color: inherit;\n}\n\ncoco-word-native-page > coco-word-native-story[data-story-kind="header"] {\n top: var(--coco-word-header-distance, 0);\n}\n\ncoco-word-native-page > coco-word-native-story[data-story-kind="footer"] {\n bottom: var(--coco-word-footer-distance, 0);\n}\n\ncoco-word-native-story.is-empty {\n display: none;\n}\n\ncoco-word-native-story[data-story-kind="footer"] {\n margin: 18pt 0 0;\n padding: 8pt 0 0;\n border-top: 1px solid #d6d9df;\n border-bottom: 0;\n}\n\ncoco-word-native-page > coco-word-native-story[data-story-kind="footer"] {\n margin: 0;\n padding: 0;\n border: 0;\n}\n\ncoco-word-native-story coco-word-native-p {\n margin-bottom: 4pt;\n}\n\ncoco-word-native-page > coco-word-native-story coco-word-native-p {\n margin-bottom: 0;\n}\n\ncoco-word-native-p {\n position: relative;\n display: block;\n min-height: 1.4em;\n margin: 0;\n outline: none;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n word-break: break-word;\n box-sizing: border-box;\n}\n\ncoco-word-native-p.is-flow-empty {\n min-height: 0;\n height: 0;\n line-height: 0;\n margin: 0;\n padding: 0;\n}\n\ncoco-word-native-p:focus {\n background: #fffdf2;\n}\n\ncoco-word-native-p.has-tab-stops {\n text-align: initial;\n}\n\n.coco-word-tab-row {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: baseline;\n width: 100%;\n column-gap: 12pt;\n}\n\n.coco-word-tab-row.has-leader-dot,\n.coco-word-tab-row.has-leader-hyphen,\n.coco-word-tab-row.has-leader-underscore,\n.coco-word-tab-row.has-leader-heavy,\n.coco-word-tab-row.has-leader-middleDot {\n column-gap: 4pt;\n line-height: 2;\n}\n\n.coco-word-tab-row.is-three-part-tab {\n grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);\n}\n\n.coco-word-tab-segment {\n min-width: 0;\n}\n\n.coco-word-tab-segment.is-segment-0 {\n text-align: left;\n}\n\n.coco-word-tab-row.is-right-tab[class*="has-leader-"] .coco-word-tab-segment.is-segment-0 {\n display: flex;\n align-items: baseline;\n white-space: nowrap;\n}\n\n.coco-word-tab-row.is-right-tab[class*="has-leader-"] .coco-word-tab-segment.is-segment-0::after {\n content: "";\n flex: 1 1 auto;\n min-width: 12pt;\n margin: 0 3pt;\n border-bottom: 1px dotted currentColor;\n transform: translateY(-0.25em);\n}\n\n.coco-word-tab-row.is-right-tab.has-leader-hyphen .coco-word-tab-segment.is-segment-0::after {\n border-bottom-style: dashed;\n}\n\n.coco-word-tab-row.is-right-tab.has-leader-underscore .coco-word-tab-segment.is-segment-0::after,\n.coco-word-tab-row.is-right-tab.has-leader-heavy .coco-word-tab-segment.is-segment-0::after {\n border-bottom-style: solid;\n}\n\n.coco-word-tab-row.is-right-tab.has-leader-heavy .coco-word-tab-segment.is-segment-0::after {\n border-bottom-width: 2px;\n}\n\n.coco-word-tab-segment.is-segment-1 {\n text-align: center;\n}\n\n.coco-word-tab-row.is-right-tab .coco-word-tab-segment.is-segment-1,\n.coco-word-tab-segment.is-segment-2 {\n text-align: right;\n white-space: nowrap;\n}\n\n.coco-word-tab-marker {\n display: none;\n}\n\ncoco-word-native-p[data-numbering="true"] {\n margin-left: 2.8em;\n padding-right: 0.5em;\n text-indent: -2.8em;\n}\n\ncoco-word-native-p[data-numbering="true"]::before {\n content: attr(data-numbering-label) " ";\n display: inline-block;\n width: 2.4em;\n text-indent: 0;\n white-space: nowrap;\n}\n\ncoco-word-native-p[data-keep-lines="true"] {\n break-inside: avoid;\n}\n\ncoco-word-native-p[data-keep-next="true"] {\n break-after: avoid;\n}\n\ncoco-word-native-table {\n display: block;\n width: 100%;\n min-width: 0;\n box-sizing: border-box;\n margin: 0;\n max-width: 100%;\n overflow: auto;\n scrollbar-gutter: stable;\n --coco-word-doc-grid-line-height: 1em;\n white-space: pre-wrap;\n}\n\ncoco-word-native-table table {\n box-sizing: border-box;\n min-width: 100%;\n max-width: none;\n margin: 0;\n border-collapse: collapse;\n table-layout: fixed;\n}\n\ncoco-word-native-table tbody {\n display: table-row-group;\n}\n\ncoco-word-native-table tr[data-height-rule="exact"] {\n height: var(--coco-word-row-height);\n}\n\ncoco-word-native-table tr[data-height-rule="atLeast"] {\n height: var(--coco-word-row-height);\n}\n\ncoco-word-native-table td {\n min-width: 48px;\n padding: 0 5.4pt;\n border: var(--coco-word-table-border, 0);\n box-sizing: border-box;\n line-height: normal;\n vertical-align: top;\n}\n\ncoco-word-native-table td coco-word-native-p {\n min-height: 1.2em;\n margin: 0;\n}\n\ncoco-word-native-table td coco-word-native-p:last-child {\n margin-bottom: 0;\n}\n\ncoco-word-native-document.uses-compact-latin-tables coco-word-native-table td coco-word-native-p {\n font-size: 13px !important;\n line-height: 1.08 !important;\n}\n\ncoco-word-native-table td coco-word-native-table {\n margin: 0;\n}\n\ncoco-word-native-p img {\n display: inline-block;\n max-width: 100%;\n height: auto;\n vertical-align: baseline;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-float-right {\n float: right;\n max-width: 55%;\n margin: 0 0 10pt 14pt;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-float-left {\n float: left;\n max-width: 55%;\n margin: 0 14pt 10pt 0;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-top-bottom {\n display: block;\n clear: both;\n margin: 10pt auto;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-overlay-like {\n position: relative;\n left: var(--coco-word-anchor-left, 0);\n top: var(--coco-word-anchor-top, 0);\n display: block;\n margin: 8pt 0;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-absolute-anchor {\n position: absolute;\n left: var(--coco-word-anchor-left, 0);\n top: var(--coco-word-anchor-top, 0);\n max-width: none;\n margin: 0;\n pointer-events: auto;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-paragraph-relative-anchor,\ncoco-word-native-drawing.coco-word-anchor-drawing.is-paragraph-relative-anchor {\n max-width: 100%;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-column-relative-anchor,\ncoco-word-native-drawing.coco-word-anchor-drawing.is-column-relative-anchor {\n max-width: min(100%, var(--coco-word-column-width, 100%));\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-absolute-anchor.is-anchor-right {\n right: 0;\n left: auto;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-absolute-anchor.is-anchor-center {\n left: 50%;\n transform: translateX(-50%);\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-centered {\n display: block;\n clear: both;\n margin-right: auto;\n margin-left: auto;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-behind-text {\n z-index: 0;\n}\n\ncoco-word-native-p img.coco-word-anchor-image.is-in-front-of-text {\n z-index: 2;\n}\n\ncoco-word-native-drawing {\n display: inline-flex;\n box-sizing: border-box;\n max-width: calc(100% - 4pt);\n min-width: 1px;\n min-height: 1px;\n margin: 0 2pt;\n padding: 2pt 4pt;\n vertical-align: baseline;\n white-space: pre-wrap;\n}\n\ncoco-word-native-drawing.has-border {\n border: 1px solid #d4d4d8;\n}\n\ncoco-word-native-drawing.is-empty {\n display: none !important;\n}\n\ncoco-word-native-drawing.has-fill {\n background: #ffffff;\n}\n\ncoco-word-native-drawing.is-line-or-connector {\n display: block;\n max-width: 100%;\n min-height: 0;\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n}\n\ncoco-word-native-drawing.is-line-or-connector.is-horizontal-line {\n height: 0;\n border-top: 1px solid #111827;\n}\n\ncoco-word-native-drawing.is-line-or-connector.is-vertical-line {\n width: 0;\n border-left: 1px solid #111827;\n}\n\ncoco-word-native-drawing .coco-word-native-drawing-text {\n display: block;\n width: 100%;\n}\n\ncoco-word-native-drawing .coco-word-native-drawing-paragraph {\n display: block;\n min-height: 1.2em;\n margin: 0;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-float-right {\n float: right;\n max-width: 55%;\n margin: 0 0 10pt 14pt;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-float-left {\n float: left;\n max-width: 55%;\n margin: 0 14pt 10pt 0;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-top-bottom {\n display: flex;\n clear: both;\n margin: 10pt auto;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-overlay-like {\n position: relative;\n left: var(--coco-word-anchor-left, 0);\n top: var(--coco-word-anchor-top, 0);\n display: flex;\n margin: 8pt 0;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-absolute-anchor {\n position: absolute;\n left: var(--coco-word-anchor-left, 0);\n top: var(--coco-word-anchor-top, 0);\n max-width: none;\n margin: 0;\n pointer-events: auto;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-paragraph-relative-anchor {\n max-width: 100%;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-column-relative-anchor {\n max-width: min(100%, var(--coco-word-column-width, 100%));\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-absolute-anchor.is-anchor-right {\n right: 0;\n left: auto;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-absolute-anchor.is-anchor-center {\n left: 50%;\n transform: translateX(-50%);\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-centered {\n display: flex;\n clear: both;\n margin-right: auto;\n margin-left: auto;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-behind-text {\n z-index: 0;\n}\n\ncoco-word-native-drawing.coco-word-anchor-drawing.is-in-front-of-text {\n z-index: 2;\n}\n\ncoco-word-native-p img.is-selected {\n outline: 2px solid #2563eb;\n outline-offset: 2px;\n}\n\ncoco-word-native-table td.is-cell-range-selected {\n position: relative;\n box-shadow: inset 0 0 0 9999px rgb(37 99 235 / 14%);\n}\n\ncoco-word-native-table td.is-cell-range-selected::after {\n position: absolute;\n z-index: 3;\n inset: -1px;\n border: 1px solid #2563eb;\n pointer-events: none;\n content: "";\n}\n\ncoco-word-native-table td.is-cell-range-anchor::after,\ncoco-word-native-table td.is-cell-range-focus::after {\n border-width: 2px;\n}\n\n.coco-word-native-editor-host {\n position: relative;\n overflow: auto;\n user-select: text;\n -webkit-user-select: text;\n}\n\n.coco-word-native-editor-host coco-word-native-document,\n.coco-word-native-editor-host coco-word-native-page,\n.coco-word-native-editor-host coco-word-native-page-body,\n.coco-word-native-editor-host coco-word-native-story,\n.coco-word-native-editor-host coco-word-native-p {\n user-select: text;\n -webkit-user-select: text;\n}\n\n.coco-word-image-resize-handle {\n position: absolute;\n z-index: 20;\n box-sizing: border-box;\n width: 12px;\n height: 12px;\n min-width: 12px;\n min-height: 12px;\n padding: 0;\n border: 2px solid #ffffff;\n border-radius: 2px;\n background: #2563eb;\n box-shadow: 0 0 0 1px #1d4ed8;\n cursor: nwse-resize;\n touch-action: none;\n}\n\n.coco-word-page-break {\n display: block;\n position: relative;\n height: 28px;\n margin: 8px 0;\n border-top: 1px dashed #b8bdc7;\n}\n\n.coco-word-page-break::after {\n content: "Page break";\n position: absolute;\n top: -9px;\n left: 50%;\n padding: 0 6px;\n background: #ffffff;\n color: #777d88;\n font-size: 10px;\n line-height: 16px;\n transform: translateX(-50%);\n}\n\ncoco-word-native-document.is-paginated .coco-word-page-break {\n display: none;\n}\n\n.coco-word-page p {\n margin: 0 0 12px;\n}\n\n.coco-word-page p[data-style-id="Title"] {\n margin: 0 0 24px;\n padding-bottom: 10px;\n border-bottom: 2px solid #4472c4;\n color: #17365d;\n font-size: 30pt;\n line-height: 1.18;\n}\n\n.coco-word-page p[data-style-id="Heading1"] {\n margin-top: 26px;\n margin-bottom: 10px;\n color: #365f91;\n font-size: 16pt;\n font-weight: 700;\n line-height: 1.25;\n}\n\n.coco-word-page p[data-style-id="Heading2"] {\n margin-top: 20px;\n margin-bottom: 8px;\n color: #4f81bd;\n font-size: 14pt;\n font-weight: 700;\n line-height: 1.3;\n}\n\n.coco-word-page img {\n display: inline-block;\n max-width: 100%;\n height: auto;\n vertical-align: baseline;\n}\n\n.coco-word-table-scroll {\n overflow-x: auto;\n max-width: 100%;\n margin: 12px 0;\n}\n\n.coco-word-page table {\n margin: 0;\n border-collapse: collapse;\n table-layout: fixed;\n}\n\n.coco-word-page tbody {\n display: table-row-group;\n}\n\n.coco-word-page td {\n min-width: 48px;\n padding: 0 5.4pt;\n border: var(--coco-word-table-border, 1px solid #d4d4d8);\n box-sizing: border-box;\n line-height: normal;\n}\n\n.coco-word-page td p {\n margin: 0 0 6px;\n}\n\n.coco-word-page td p:last-child {\n margin-bottom: 0;\n}\n\n.coco-word-comment {\n background: #fff1a8;\n border-bottom: 2px solid #e4b100;\n}\n\n.coco-word-revision-insert {\n background: #dcfce7;\n color: #166534;\n text-decoration: underline;\n}\n\n.coco-word-revision-delete {\n background: #fee2e2;\n color: #991b1b;\n text-decoration: line-through;\n}\n\nimg.coco-word-revision-delete {\n outline: 2px solid #dc2626;\n opacity: 0.72;\n}\n\nimg.coco-word-revision-insert {\n outline: 2px solid #16a34a;\n}\n\nimg.coco-word-revision-format {\n outline: 2px dashed #7c3aed;\n outline-offset: 2px;\n}\n\ncoco-word-native-table.coco-word-revision-insert {\n outline: 2px solid #2563eb;\n outline-offset: 2px;\n}\n\ncoco-word-native-table.coco-word-revision-delete {\n outline: 2px solid #dc2626;\n outline-offset: 2px;\n opacity: 0.78;\n}\n\n.coco-word-inspector {\n min-width: 0;\n min-height: 0;\n overflow: auto;\n padding: 14px;\n background: #ffffff;\n border: 1px solid #d8dbe2;\n}\n\n@media (max-width: 1399px) {\n .coco-word-shell {\n grid-template-columns: minmax(0, 1fr);\n }\n\n .coco-word-inspector {\n display: none;\n }\n}\n\n.coco-word-inspector h2 {\n margin: 0 0 12px;\n font-size: 15px;\n}\n\n.coco-word-inspector h2:not(:first-child) {\n margin-top: 18px;\n}\n\n.coco-word-acceptance {\n display: grid;\n gap: 10px;\n margin-bottom: 14px;\n font-size: 12px;\n}\n\n.coco-word-acceptance-status {\n display: inline-flex;\n align-items: center;\n width: fit-content;\n height: 24px;\n padding: 0 8px;\n border: 1px solid #b7c7af;\n background: #eff8ea;\n color: #245917;\n font-weight: 700;\n}\n\n.coco-word-acceptance-status.is-warn {\n border-color: #e3c66d;\n background: #fff8df;\n color: #775400;\n}\n\n.coco-word-acceptance-grid {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 6px;\n}\n\n.coco-word-acceptance-metric {\n min-width: 0;\n padding: 7px;\n border: 1px solid #e1e4ea;\n background: #fafafa;\n}\n\n.coco-word-acceptance-metric span {\n display: block;\n color: #5f6368;\n font-size: 11px;\n}\n\n.coco-word-acceptance-metric strong {\n display: block;\n margin-top: 3px;\n color: #202124;\n font-size: 12px;\n font-weight: 700;\n overflow-wrap: anywhere;\n}\n\n.coco-word-acceptance-metric.is-good {\n border-color: #c8dac2;\n background: #f5fbf2;\n}\n\n.coco-word-acceptance-metric.is-warn {\n border-color: #efd77f;\n background: #fff9e8;\n}\n\n.coco-word-acceptance-section {\n color: #3f4247;\n font-size: 12px;\n font-weight: 700;\n}\n\n.coco-word-acceptance ul {\n margin: 0;\n padding-left: 18px;\n color: #775400;\n}\n\n.coco-word-acceptance-empty {\n color: #5f6368;\n}\n\n.coco-word-inspector pre {\n margin: 0;\n white-space: pre-wrap;\n word-break: break-word;\n font-size: 12px;\n line-height: 1.5;\n}\n\n.coco-word-context-menu {\n position: fixed;\n z-index: 10000;\n display: flex;\n min-width: 188px;\n max-height: calc(100vh - 8px);\n padding: 4px;\n overflow-y: auto;\n flex-direction: column;\n background: #ffffff;\n border: 1px solid #c8c8c8;\n border-radius: 4px;\n box-shadow: 0 8px 24px rgb(0 0 0 / 16%);\n color: #202124;\n font: 13px/1.35 Arial, "Microsoft YaHei", sans-serif;\n}\n\n.coco-word-context-menu-item {\n min-height: 30px;\n padding: 5px 10px;\n border: 0;\n border-radius: 3px;\n background: transparent;\n color: inherit;\n font: inherit;\n letter-spacing: 0;\n text-align: left;\n white-space: nowrap;\n cursor: default;\n}\n\n.coco-word-context-menu-item:hover:not(:disabled),\n.coco-word-context-menu-item:focus-visible:not(:disabled) {\n background: #e8f0fe;\n outline: none;\n}\n\n.coco-word-context-menu-item:disabled {\n color: #9aa0a6;\n}\n\n.coco-word-context-menu-separator {\n height: 1px;\n margin: 4px 6px;\n background: #dadce0;\n}\n\n.coco-word-dialog-backdrop {\n position: fixed;\n inset: 0;\n z-index: 11000;\n display: grid;\n place-items: center;\n padding: 20px;\n box-sizing: border-box;\n background: rgb(15 23 42 / 28%);\n}\n\n.coco-word-dialog {\n width: min(420px, 100%);\n padding: 20px;\n box-sizing: border-box;\n background: #ffffff;\n border: 1px solid #c7cbd4;\n box-shadow: 0 12px 32px rgb(15 23 42 / 22%);\n}\n\n.coco-word-dialog h2 {\n margin: 0 0 14px;\n color: #202124;\n font-size: 17px;\n font-weight: 600;\n}\n\n.coco-word-dialog-input {\n display: block;\n width: 100%;\n min-height: 96px;\n padding: 9px 10px;\n box-sizing: border-box;\n border: 1px solid #c7cbd4;\n color: #202124;\n font: 14px/1.5 Arial, "Microsoft YaHei", sans-serif;\n resize: vertical;\n}\n\n.coco-word-dialog-input:focus {\n outline: 2px solid rgb(59 91 219 / 22%);\n border-color: #3b5bdb;\n}\n\n.coco-word-dialog-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 16px;\n}\n\n.coco-word-dialog-button {\n min-width: 72px;\n min-height: 34px;\n padding: 6px 14px;\n border: 1px solid #c7cbd4;\n background: #ffffff;\n color: #202124;\n font: 14px Arial, "Microsoft YaHei", sans-serif;\n cursor: pointer;\n}\n\n.coco-word-dialog-button.is-primary {\n border-color: #3158c9;\n background: #3158c9;\n color: #ffffff;\n}\n\n.coco-word-dialog-button:hover {\n filter: brightness(0.96);\n}\n';
|
|
11596
11644
|
|
|
11597
11645
|
// src/word/native-command-state.ts
|
|
11598
11646
|
function getNativeWordCommandState(doc, selection) {
|
|
@@ -12057,6 +12105,7 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
12057
12105
|
let sourceView = initialView;
|
|
12058
12106
|
let doc = createNativeWordDocument(sourceView);
|
|
12059
12107
|
let destroyed = false;
|
|
12108
|
+
let readOnly = options.readOnly === true;
|
|
12060
12109
|
const changes = [];
|
|
12061
12110
|
let emittedChanges = [];
|
|
12062
12111
|
let revision = 0;
|
|
@@ -12254,6 +12303,10 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
12254
12303
|
imageResizeHandle.style.top = `${imageRect.bottom - hostRect.top + host.scrollTop - 6}px`;
|
|
12255
12304
|
}, "positionImageResizeHandle");
|
|
12256
12305
|
const showImageResizeHandle = /* @__PURE__ */ __name(() => {
|
|
12306
|
+
if (readOnly) {
|
|
12307
|
+
removeImageResizeHandle();
|
|
12308
|
+
return;
|
|
12309
|
+
}
|
|
12257
12310
|
if (!selectedImage2) {
|
|
12258
12311
|
removeImageResizeHandle();
|
|
12259
12312
|
return;
|
|
@@ -12337,6 +12390,15 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
12337
12390
|
const repositionSelectedImageHandle = /* @__PURE__ */ __name(() => positionImageResizeHandle(), "repositionSelectedImageHandle");
|
|
12338
12391
|
window.addEventListener("resize", repositionSelectedImageHandle);
|
|
12339
12392
|
document.addEventListener("scroll", repositionSelectedImageHandle, true);
|
|
12393
|
+
const applyReadOnlyDom = /* @__PURE__ */ __name(() => {
|
|
12394
|
+
outerHost.setAttribute("aria-readonly", String(readOnly));
|
|
12395
|
+
host.dataset.readOnly = String(readOnly);
|
|
12396
|
+
if (!readOnly) return;
|
|
12397
|
+
for (const element of Array.from(host.querySelectorAll('[contenteditable="true"]'))) {
|
|
12398
|
+
element.contentEditable = "false";
|
|
12399
|
+
}
|
|
12400
|
+
removeImageResizeHandle();
|
|
12401
|
+
}, "applyReadOnlyDom");
|
|
12340
12402
|
const render = /* @__PURE__ */ __name((cursor, preservedSelection) => {
|
|
12341
12403
|
if (deferredRenderTimer !== null) {
|
|
12342
12404
|
window.clearTimeout(deferredRenderTimer);
|
|
@@ -12350,6 +12412,7 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
12350
12412
|
const rendered = renderNativeDocument(doc);
|
|
12351
12413
|
host.replaceChildren(rendered);
|
|
12352
12414
|
paginateNativeDocument(rendered, doc);
|
|
12415
|
+
applyReadOnlyDom();
|
|
12353
12416
|
observeNativeTableSizes(rendered);
|
|
12354
12417
|
const tableSelection = (preservedSelection == null ? void 0 : preservedSelection.kind) === "table-cell-range" ? preservedSelection : (selection == null ? void 0 : selection.kind) === "table-cell-range" ? selection : null;
|
|
12355
12418
|
renderTableCellRangeSelection(tableSelection);
|
|
@@ -12377,6 +12440,7 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
12377
12440
|
for (const current of replacements) {
|
|
12378
12441
|
current.replaceWith(renderNativeParagraph(paragraph));
|
|
12379
12442
|
}
|
|
12443
|
+
applyReadOnlyDom();
|
|
12380
12444
|
const root = (_a2 = host.querySelector(":scope > coco-word-native-document")) != null ? _a2 : host.querySelector("coco-word-native-document");
|
|
12381
12445
|
if (root) refreshNativePageCommentBubbles(root);
|
|
12382
12446
|
if (selectedImage2) showImageResizeHandle();
|
|
@@ -12659,6 +12723,10 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
12659
12723
|
activeLocalTypingTransaction = transaction;
|
|
12660
12724
|
}, "beginTableBrowserTypingTransaction");
|
|
12661
12725
|
const compositionStart = /* @__PURE__ */ __name((event) => {
|
|
12726
|
+
if (readOnly) {
|
|
12727
|
+
event.preventDefault();
|
|
12728
|
+
return;
|
|
12729
|
+
}
|
|
12662
12730
|
compositionActive = true;
|
|
12663
12731
|
if (compositionFinalizeTimer !== null) {
|
|
12664
12732
|
window.clearTimeout(compositionFinalizeTimer);
|
|
@@ -13507,12 +13575,12 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
13507
13575
|
return true;
|
|
13508
13576
|
}, "applyBrowserRedoFallback");
|
|
13509
13577
|
const undo = /* @__PURE__ */ __name(() => {
|
|
13510
|
-
if (destroyed || browserUndoStack.length === 0) return false;
|
|
13578
|
+
if (destroyed || readOnly || browserUndoStack.length === 0) return false;
|
|
13511
13579
|
activate();
|
|
13512
13580
|
return applyBrowserUndoFallback();
|
|
13513
13581
|
}, "undo");
|
|
13514
13582
|
const redo = /* @__PURE__ */ __name(() => {
|
|
13515
|
-
if (destroyed || browserRedoStack.length === 0) return false;
|
|
13583
|
+
if (destroyed || readOnly || browserRedoStack.length === 0) return false;
|
|
13516
13584
|
activate();
|
|
13517
13585
|
return applyBrowserRedoFallback();
|
|
13518
13586
|
}, "redo");
|
|
@@ -14134,15 +14202,17 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
14134
14202
|
return searchMatches.length;
|
|
14135
14203
|
}, "applySearchReplacement");
|
|
14136
14204
|
const replaceCurrent = /* @__PURE__ */ __name((replacement) => {
|
|
14205
|
+
if (readOnly) return false;
|
|
14137
14206
|
const match = searchState && searchState.activeIndex >= 0 ? searchState.matches[searchState.activeIndex] : null;
|
|
14138
14207
|
return match ? applySearchReplacement([match], replacement) > 0 : false;
|
|
14139
14208
|
}, "replaceCurrent");
|
|
14140
14209
|
const replaceAll = /* @__PURE__ */ __name((replacement) => {
|
|
14210
|
+
if (readOnly) return 0;
|
|
14141
14211
|
return searchState ? applySearchReplacement(searchState.matches, replacement) : 0;
|
|
14142
14212
|
}, "replaceAll");
|
|
14143
14213
|
const dispatch = /* @__PURE__ */ __name((command) => {
|
|
14144
14214
|
var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
14145
|
-
if (destroyed) return false;
|
|
14215
|
+
if (destroyed || readOnly) return false;
|
|
14146
14216
|
activate();
|
|
14147
14217
|
const current = (_a2 = selection != null ? selection : currentNativeSelection(host)) != null ? _a2 : nativeSelectionFromCursor(host);
|
|
14148
14218
|
if (command.kind === "toggle-track-revisions") {
|
|
@@ -14930,6 +15000,10 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
14930
15000
|
}, "copySelectedImageToSystemClipboard");
|
|
14931
15001
|
const cut = /* @__PURE__ */ __name((event) => {
|
|
14932
15002
|
var _a2, _b2, _c2;
|
|
15003
|
+
if (readOnly) {
|
|
15004
|
+
copy(event);
|
|
15005
|
+
return;
|
|
15006
|
+
}
|
|
14933
15007
|
if (selectedImage2 && event.clipboardData) {
|
|
14934
15008
|
const imageSelection = selectedImage2;
|
|
14935
15009
|
const image = (_a2 = findNativeParagraph(doc, imageSelection.paraId)) == null ? void 0 : _a2.content.find(
|
|
@@ -14996,6 +15070,10 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
14996
15070
|
}, "cut");
|
|
14997
15071
|
const paste = /* @__PURE__ */ __name((event) => {
|
|
14998
15072
|
var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
15073
|
+
if (readOnly) {
|
|
15074
|
+
event.preventDefault();
|
|
15075
|
+
return;
|
|
15076
|
+
}
|
|
14999
15077
|
const tableSelection = (selection == null ? void 0 : selection.kind) === "table-cell-range" ? selection : null;
|
|
15000
15078
|
if (tableSelection) {
|
|
15001
15079
|
const rich = parseRichTableClipboard(event);
|
|
@@ -15348,6 +15426,7 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
15348
15426
|
}, "selectContextTarget");
|
|
15349
15427
|
const contextMenu = /* @__PURE__ */ __name((event) => {
|
|
15350
15428
|
var _a2;
|
|
15429
|
+
if (readOnly) return;
|
|
15351
15430
|
if (options.contextMenu === false) return;
|
|
15352
15431
|
event.preventDefault();
|
|
15353
15432
|
event.stopPropagation();
|
|
@@ -15395,6 +15474,10 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
15395
15474
|
}, "closeContextMenuFromKey");
|
|
15396
15475
|
const beforeInput = /* @__PURE__ */ __name((event) => {
|
|
15397
15476
|
var _a2;
|
|
15477
|
+
if (readOnly) {
|
|
15478
|
+
event.preventDefault();
|
|
15479
|
+
return;
|
|
15480
|
+
}
|
|
15398
15481
|
if (event.inputType === suppressedBrowserHistoryInput) {
|
|
15399
15482
|
event.preventDefault();
|
|
15400
15483
|
suppressedBrowserHistoryInput = null;
|
|
@@ -15605,6 +15688,14 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
15605
15688
|
});
|
|
15606
15689
|
return;
|
|
15607
15690
|
}
|
|
15691
|
+
if (readOnly) {
|
|
15692
|
+
const isHistory = (event.ctrlKey || event.metaKey) && (event.key.toLowerCase() === "z" || event.key.toLowerCase() === "y");
|
|
15693
|
+
if (isHistory) {
|
|
15694
|
+
event.preventDefault();
|
|
15695
|
+
event.stopPropagation();
|
|
15696
|
+
}
|
|
15697
|
+
return;
|
|
15698
|
+
}
|
|
15608
15699
|
const isUndo = (event.ctrlKey || event.metaKey) && !event.shiftKey && event.key.toLowerCase() === "z";
|
|
15609
15700
|
const isRedo = (event.ctrlKey || event.metaKey) && event.shiftKey && event.key.toLowerCase() === "z" || (event.ctrlKey || event.metaKey) && event.key.toLowerCase() === "y";
|
|
15610
15701
|
if ((isUndo || isRedo) && suppressedBrowserHistoryInput) {
|
|
@@ -15731,6 +15822,11 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
15731
15822
|
if (destroyed || event.composedPath().includes(host) || activeNativeWordHostByDocument.get(document) !== host) {
|
|
15732
15823
|
return;
|
|
15733
15824
|
}
|
|
15825
|
+
if (readOnly) {
|
|
15826
|
+
event.preventDefault();
|
|
15827
|
+
event.stopPropagation();
|
|
15828
|
+
return;
|
|
15829
|
+
}
|
|
15734
15830
|
if (event.inputType === "historyUndo" && undo()) {
|
|
15735
15831
|
event.preventDefault();
|
|
15736
15832
|
event.stopPropagation();
|
|
@@ -15903,6 +15999,7 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
15903
15999
|
}
|
|
15904
16000
|
const hyperlink = target instanceof Element ? target.closest("a.coco-word-hyperlink") : null;
|
|
15905
16001
|
if (hyperlink) {
|
|
16002
|
+
if (readOnly) return;
|
|
15906
16003
|
event.preventDefault();
|
|
15907
16004
|
if ((event.ctrlKey || event.metaKey) && safeExternalHyperlink(hyperlink.dataset.hyperlinkTarget)) {
|
|
15908
16005
|
window.open(hyperlink.dataset.hyperlinkTarget, "_blank", "noopener,noreferrer");
|
|
@@ -16099,6 +16196,9 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
16099
16196
|
preserveSelectionFromExternalPointer(event);
|
|
16100
16197
|
window.setTimeout(() => renderPreservedSelectionHighlight(true), 0);
|
|
16101
16198
|
}, "preserveSelectionAfterExternalClick");
|
|
16199
|
+
const drop = /* @__PURE__ */ __name((event) => {
|
|
16200
|
+
if (readOnly) event.preventDefault();
|
|
16201
|
+
}, "drop");
|
|
16102
16202
|
const updateHyperlinkNavigationMode = /* @__PURE__ */ __name((event) => {
|
|
16103
16203
|
host.classList.toggle("is-hyperlink-navigation-mode", event.ctrlKey || event.metaKey);
|
|
16104
16204
|
}, "updateHyperlinkNavigationMode");
|
|
@@ -16107,6 +16207,7 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
16107
16207
|
}, "clearHyperlinkNavigationMode");
|
|
16108
16208
|
const input = /* @__PURE__ */ __name((event) => {
|
|
16109
16209
|
var _a2, _b2, _c2, _d;
|
|
16210
|
+
if (readOnly) return;
|
|
16110
16211
|
const inputEvent = event;
|
|
16111
16212
|
if (inputEvent.inputType === suppressedBrowserHistoryInput) {
|
|
16112
16213
|
suppressedBrowserHistoryInput = null;
|
|
@@ -16225,6 +16326,7 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
16225
16326
|
host.addEventListener("copy", copy);
|
|
16226
16327
|
host.addEventListener("cut", cut);
|
|
16227
16328
|
host.addEventListener("paste", paste);
|
|
16329
|
+
host.addEventListener("drop", drop);
|
|
16228
16330
|
host.addEventListener("keydown", keyDown);
|
|
16229
16331
|
host.addEventListener("mousedown", mouseDown);
|
|
16230
16332
|
host.addEventListener("click", click);
|
|
@@ -16253,6 +16355,23 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
16253
16355
|
get destroyed() {
|
|
16254
16356
|
return destroyed;
|
|
16255
16357
|
},
|
|
16358
|
+
isReadOnly() {
|
|
16359
|
+
return readOnly;
|
|
16360
|
+
},
|
|
16361
|
+
setReadOnly(next) {
|
|
16362
|
+
if (destroyed || readOnly === next) return;
|
|
16363
|
+
readOnly = next;
|
|
16364
|
+
closeContextMenu();
|
|
16365
|
+
if (readOnly) {
|
|
16366
|
+
cancelImageResizeDrag == null ? void 0 : cancelImageResizeDrag();
|
|
16367
|
+
cancelImageResizeDrag = null;
|
|
16368
|
+
pendingBrowserRangeDelete = null;
|
|
16369
|
+
pendingCompositionTransaction = null;
|
|
16370
|
+
activeLocalTypingTransaction = null;
|
|
16371
|
+
compositionActive = false;
|
|
16372
|
+
}
|
|
16373
|
+
render(void 0, selection != null ? selection : void 0);
|
|
16374
|
+
},
|
|
16256
16375
|
destroy() {
|
|
16257
16376
|
if (destroyed) return;
|
|
16258
16377
|
destroyed = true;
|
|
@@ -16262,6 +16381,7 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
16262
16381
|
host.removeEventListener("copy", copy);
|
|
16263
16382
|
host.removeEventListener("cut", cut);
|
|
16264
16383
|
host.removeEventListener("paste", paste);
|
|
16384
|
+
host.removeEventListener("drop", drop);
|
|
16265
16385
|
host.removeEventListener("keydown", keyDown);
|
|
16266
16386
|
host.removeEventListener("mousedown", mouseDown);
|
|
16267
16387
|
host.removeEventListener("click", click);
|
|
@@ -16373,16 +16493,16 @@ function renderNativeWordEditor(host, initialView, options = {}) {
|
|
|
16373
16493
|
return changes.slice();
|
|
16374
16494
|
},
|
|
16375
16495
|
canUndo() {
|
|
16376
|
-
return !destroyed && browserUndoStack.length > 0;
|
|
16496
|
+
return !destroyed && !readOnly && browserUndoStack.length > 0;
|
|
16377
16497
|
},
|
|
16378
16498
|
canRedo() {
|
|
16379
|
-
return !destroyed && browserRedoStack.length > 0;
|
|
16499
|
+
return !destroyed && !readOnly && browserRedoStack.length > 0;
|
|
16380
16500
|
},
|
|
16381
16501
|
undo,
|
|
16382
16502
|
redo,
|
|
16383
16503
|
canDispatch(command) {
|
|
16384
16504
|
var _a2;
|
|
16385
|
-
if (destroyed) return false;
|
|
16505
|
+
if (destroyed || readOnly) return false;
|
|
16386
16506
|
const current = (_a2 = selection != null ? selection : currentNativeSelection(host)) != null ? _a2 : nativeSelectionFromCursor(host);
|
|
16387
16507
|
return canDispatchNativeWordCommand(doc, current, command);
|
|
16388
16508
|
},
|
|
@@ -16549,9 +16669,11 @@ function blobToDataUrl(file) {
|
|
|
16549
16669
|
}
|
|
16550
16670
|
__name(blobToDataUrl, "blobToDataUrl");
|
|
16551
16671
|
function storeNativeImageClipboardSource(src) {
|
|
16672
|
+
const safeSrc = safeEmbeddedRasterImageUrl(src);
|
|
16673
|
+
if (!safeSrc) return "";
|
|
16552
16674
|
nextNativeImageClipboardId = nextNativeImageClipboardId + 1 >>> 0;
|
|
16553
16675
|
const token = `${NATIVE_IMAGE_CLIPBOARD_PREFIX}${Date.now().toString(36)}-${nextNativeImageClipboardId.toString(36)}`;
|
|
16554
|
-
nativeImageClipboardSources.set(token,
|
|
16676
|
+
nativeImageClipboardSources.set(token, safeSrc);
|
|
16555
16677
|
while (nativeImageClipboardSources.size > 8) {
|
|
16556
16678
|
const oldest = nativeImageClipboardSources.keys().next().value;
|
|
16557
16679
|
if (!oldest) break;
|
|
@@ -16575,9 +16697,7 @@ function nativeClipboardInlineText(child) {
|
|
|
16575
16697
|
}
|
|
16576
16698
|
__name(nativeClipboardInlineText, "nativeClipboardInlineText");
|
|
16577
16699
|
async function clipboardPngBlob(src) {
|
|
16578
|
-
const
|
|
16579
|
-
if (!response.ok) throw new Error(`Unable to load clipboard image: ${response.status}`);
|
|
16580
|
-
const source = await response.blob();
|
|
16700
|
+
const source = embeddedRasterImageBlob(src);
|
|
16581
16701
|
if (source.type === "image/png") return source;
|
|
16582
16702
|
const bitmap = await createImageBitmap(source);
|
|
16583
16703
|
try {
|
|
@@ -18211,17 +18331,20 @@ __name(spreadsheetSortRows, "spreadsheetSortRows");
|
|
|
18211
18331
|
|
|
18212
18332
|
// src/spreadsheet/runtime.ts
|
|
18213
18333
|
var _SpreadsheetEditorRuntime = class _SpreadsheetEditorRuntime {
|
|
18214
|
-
constructor(state) {
|
|
18334
|
+
constructor(state, options = {}) {
|
|
18215
18335
|
__publicField(this, "state", state);
|
|
18216
18336
|
__publicField(this, "activeTransaction", null);
|
|
18217
18337
|
__publicField(this, "activeTransactionSource", null);
|
|
18218
18338
|
__publicField(this, "transactionNeedsRefresh", false);
|
|
18339
|
+
__publicField(this, "readOnlyValue");
|
|
18340
|
+
this.readOnlyValue = options.readOnly === true;
|
|
18219
18341
|
}
|
|
18220
18342
|
static async fromZip(bytes, options = {}) {
|
|
18221
|
-
const
|
|
18222
|
-
|
|
18343
|
+
const _a = options, { readOnly } = _a, loadOptions = __objRest(_a, ["readOnly"]);
|
|
18344
|
+
const workbook = await excel.ExcelWorkbook.fromZip(bytes, loadOptions);
|
|
18345
|
+
return _SpreadsheetEditorRuntime.fromWorkbook(workbook, { readOnly });
|
|
18223
18346
|
}
|
|
18224
|
-
static async fromWorkbook(workbook) {
|
|
18347
|
+
static async fromWorkbook(workbook, options = {}) {
|
|
18225
18348
|
const model = await workbook.toModel();
|
|
18226
18349
|
const firstSheet = model.sheets[0];
|
|
18227
18350
|
if (!firstSheet) throw new Error("SpreadsheetEditorRuntime: workbook has no sheets");
|
|
@@ -18234,9 +18357,17 @@ var _SpreadsheetEditorRuntime = class _SpreadsheetEditorRuntime {
|
|
|
18234
18357
|
formulaResults,
|
|
18235
18358
|
formulaEngine,
|
|
18236
18359
|
activeSheet: buildSpreadsheetSheetRenderModel(firstSheet, model.styles, { formulaResults })
|
|
18237
|
-
});
|
|
18360
|
+
}, options);
|
|
18361
|
+
}
|
|
18362
|
+
isReadOnly() {
|
|
18363
|
+
return this.readOnlyValue;
|
|
18364
|
+
}
|
|
18365
|
+
setReadOnly(readOnly) {
|
|
18366
|
+
if (this.activeTransaction) throw new Error("SpreadsheetEditorRuntime: cannot change read-only state during a transaction");
|
|
18367
|
+
this.readOnlyValue = readOnly;
|
|
18238
18368
|
}
|
|
18239
18369
|
workbook() {
|
|
18370
|
+
this.assertWritable();
|
|
18240
18371
|
return this.state.workbook;
|
|
18241
18372
|
}
|
|
18242
18373
|
model() {
|
|
@@ -18249,24 +18380,27 @@ var _SpreadsheetEditorRuntime = class _SpreadsheetEditorRuntime {
|
|
|
18249
18380
|
return this.state.activeSheet;
|
|
18250
18381
|
}
|
|
18251
18382
|
canUndo() {
|
|
18252
|
-
return this.state.workbook.history().canUndo();
|
|
18383
|
+
return !this.readOnlyValue && this.state.workbook.history().canUndo();
|
|
18253
18384
|
}
|
|
18254
18385
|
canRedo() {
|
|
18255
|
-
return this.state.workbook.history().canRedo();
|
|
18386
|
+
return !this.readOnlyValue && this.state.workbook.history().canRedo();
|
|
18256
18387
|
}
|
|
18257
18388
|
async undo() {
|
|
18389
|
+
this.assertWritable();
|
|
18258
18390
|
const result = await this.state.workbook.history().undo();
|
|
18259
18391
|
if (!result) return null;
|
|
18260
18392
|
await this.refresh();
|
|
18261
18393
|
return result;
|
|
18262
18394
|
}
|
|
18263
18395
|
async redo() {
|
|
18396
|
+
this.assertWritable();
|
|
18264
18397
|
const result = await this.state.workbook.history().redo();
|
|
18265
18398
|
if (!result) return null;
|
|
18266
18399
|
await this.refresh();
|
|
18267
18400
|
return result;
|
|
18268
18401
|
}
|
|
18269
18402
|
async runUserTransaction(options, run) {
|
|
18403
|
+
this.assertWritable();
|
|
18270
18404
|
return this.runScopedTransaction(
|
|
18271
18405
|
"user",
|
|
18272
18406
|
(apply) => this.state.workbook.history().runGroup(__spreadProps(__spreadValues({}, options), { source: "user" }), apply),
|
|
@@ -18274,6 +18408,7 @@ var _SpreadsheetEditorRuntime = class _SpreadsheetEditorRuntime {
|
|
|
18274
18408
|
);
|
|
18275
18409
|
}
|
|
18276
18410
|
async runAgentTransaction(options, run) {
|
|
18411
|
+
this.assertWritable();
|
|
18277
18412
|
return this.runScopedTransaction(
|
|
18278
18413
|
"agent",
|
|
18279
18414
|
(apply) => this.state.workbook.history().runAgentGroup(options, apply),
|
|
@@ -18829,6 +18964,7 @@ var _SpreadsheetEditorRuntime = class _SpreadsheetEditorRuntime {
|
|
|
18829
18964
|
);
|
|
18830
18965
|
}
|
|
18831
18966
|
async runUserMutation(options, mutate) {
|
|
18967
|
+
this.assertWritable();
|
|
18832
18968
|
if (this.activeTransaction) {
|
|
18833
18969
|
await mutate(this.activeTransaction);
|
|
18834
18970
|
this.transactionNeedsRefresh = true;
|
|
@@ -18845,6 +18981,7 @@ var _SpreadsheetEditorRuntime = class _SpreadsheetEditorRuntime {
|
|
|
18845
18981
|
);
|
|
18846
18982
|
}
|
|
18847
18983
|
async runWorksheetStructureMutation(recordAgentMutation, mutate) {
|
|
18984
|
+
this.assertWritable();
|
|
18848
18985
|
if (this.activeTransactionSource === "agent" && this.activeTransaction) {
|
|
18849
18986
|
await recordAgentMutation(this.activeTransaction);
|
|
18850
18987
|
this.transactionNeedsRefresh = true;
|
|
@@ -18859,6 +18996,7 @@ var _SpreadsheetEditorRuntime = class _SpreadsheetEditorRuntime {
|
|
|
18859
18996
|
return (_a = (await this.state.workbook.worksheets.getItem(this.state.activeSheetName).getRange(address).styleIds())[0]) == null ? void 0 : _a[0];
|
|
18860
18997
|
}
|
|
18861
18998
|
async runScopedTransaction(source, execute, run) {
|
|
18999
|
+
this.assertWritable();
|
|
18862
19000
|
if (this.activeTransaction) {
|
|
18863
19001
|
await run();
|
|
18864
19002
|
this.transactionNeedsRefresh = true;
|
|
@@ -18886,6 +19024,9 @@ var _SpreadsheetEditorRuntime = class _SpreadsheetEditorRuntime {
|
|
|
18886
19024
|
this.transactionNeedsRefresh = previousNeedsRefresh;
|
|
18887
19025
|
}
|
|
18888
19026
|
}
|
|
19027
|
+
assertWritable() {
|
|
19028
|
+
if (this.readOnlyValue) throw new EditorReadOnlyError("spreadsheet");
|
|
19029
|
+
}
|
|
18889
19030
|
cellEditHistoryGroup(label, address, options) {
|
|
18890
19031
|
var _a;
|
|
18891
19032
|
const base = { label };
|
|
@@ -19383,6 +19524,7 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
19383
19524
|
__publicField(this, "lastStateKey", "");
|
|
19384
19525
|
__publicField(this, "transactionDepth", 0);
|
|
19385
19526
|
__publicField(this, "transactionChanged", false);
|
|
19527
|
+
__publicField(this, "readOnlyValue");
|
|
19386
19528
|
__publicField(this, "handleClick", /* @__PURE__ */ __name((event) => {
|
|
19387
19529
|
if (this.eventPathContains(event, this.contextMenu) || this.eventPathContains(event, this.filterMenu)) return;
|
|
19388
19530
|
if (this.filterMenu.style.display === "block") this.hideFilterMenu();
|
|
@@ -19402,6 +19544,7 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
19402
19544
|
const hit = this.viewport.hitTest(this.eventPoint(event));
|
|
19403
19545
|
if (hit.kind !== "cell" && hit.kind !== "rowHeader" && hit.kind !== "columnHeader") return;
|
|
19404
19546
|
if (hit.kind === "cell" && hit.row === 1 && this.isFilterIconHit(hit.column, event)) {
|
|
19547
|
+
if (this.isReadOnly()) return;
|
|
19405
19548
|
this.openFilterMenu(hit.column, event.clientX, event.clientY);
|
|
19406
19549
|
event.preventDefault();
|
|
19407
19550
|
return;
|
|
@@ -19418,6 +19561,10 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
19418
19561
|
}, "handleClick"));
|
|
19419
19562
|
__publicField(this, "handleFilterMenuClick", /* @__PURE__ */ __name((event) => {
|
|
19420
19563
|
var _a;
|
|
19564
|
+
if (this.isReadOnly()) {
|
|
19565
|
+
this.hideFilterMenu();
|
|
19566
|
+
return;
|
|
19567
|
+
}
|
|
19421
19568
|
const target = event.target;
|
|
19422
19569
|
const action = (_a = target.closest("[data-filter-action]")) == null ? void 0 : _a.dataset.filterAction;
|
|
19423
19570
|
if (!action || this.filterMenuColumn === null) return;
|
|
@@ -19443,6 +19590,10 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
19443
19590
|
const hit = this.viewport.hitTest(this.eventPoint(event));
|
|
19444
19591
|
if (hit.kind !== "cell") return;
|
|
19445
19592
|
this.selectionState = expandSelectionForMergedRanges(createSelection(hit.row, hit.column), this.runtime().activeSheet());
|
|
19593
|
+
if (this.isReadOnly()) {
|
|
19594
|
+
this.render();
|
|
19595
|
+
return;
|
|
19596
|
+
}
|
|
19446
19597
|
this.openCellEditor();
|
|
19447
19598
|
event.preventDefault();
|
|
19448
19599
|
}, "handleDoubleClick"));
|
|
@@ -19457,6 +19608,11 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
19457
19608
|
const chartHit = this.chartAtPoint(point);
|
|
19458
19609
|
if (chartHit) {
|
|
19459
19610
|
this.selectedChartIndex = chartHit.chartIndex;
|
|
19611
|
+
if (this.isReadOnly()) {
|
|
19612
|
+
this.render();
|
|
19613
|
+
event.preventDefault();
|
|
19614
|
+
return;
|
|
19615
|
+
}
|
|
19460
19616
|
this.chartDrag = {
|
|
19461
19617
|
chartIndex: chartHit.chartIndex,
|
|
19462
19618
|
pointer: point,
|
|
@@ -19470,7 +19626,7 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
19470
19626
|
}
|
|
19471
19627
|
this.selectedChartIndex = null;
|
|
19472
19628
|
const resizeHandle = hitSpreadsheetResizeHandle(this.layout, this.viewport.viewports, point);
|
|
19473
|
-
if (resizeHandle) {
|
|
19629
|
+
if (resizeHandle && !this.isReadOnly()) {
|
|
19474
19630
|
this.resizeDrag = startSpreadsheetResizeDrag(resizeHandle, event);
|
|
19475
19631
|
this.host.setPointerCapture(event.pointerId);
|
|
19476
19632
|
this.host.style.cursor = resizeHandle.kind === "column" ? "col-resize" : "row-resize";
|
|
@@ -19480,7 +19636,7 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
19480
19636
|
}
|
|
19481
19637
|
const selectionRange = normalizeSelectionRange(this.selectionState.range);
|
|
19482
19638
|
const fillHandle = (_a = this.renderer) == null ? void 0 : _a.fillHandleRect(this.layout, this.viewport, selectionRange);
|
|
19483
|
-
if (fillHandle && containsPoint2(fillHandle, point) && supportsSpreadsheetAutoFill(this.runtime().activeSheet(), selectionRange)) {
|
|
19639
|
+
if (!this.isReadOnly() && fillHandle && containsPoint2(fillHandle, point) && supportsSpreadsheetAutoFill(this.runtime().activeSheet(), selectionRange)) {
|
|
19484
19640
|
this.autoFillDrag = { source: selectionRange, preview: null };
|
|
19485
19641
|
this.host.setPointerCapture(event.pointerId);
|
|
19486
19642
|
event.preventDefault();
|
|
@@ -19517,7 +19673,7 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
19517
19673
|
return;
|
|
19518
19674
|
}
|
|
19519
19675
|
if (!this.resizeDrag && !this.autoFillDrag && !this.selecting && !this.editingCell) {
|
|
19520
|
-
const resizeHandle = hitSpreadsheetResizeHandle(this.layout, this.viewport.viewports, this.eventPoint(event));
|
|
19676
|
+
const resizeHandle = this.isReadOnly() ? null : hitSpreadsheetResizeHandle(this.layout, this.viewport.viewports, this.eventPoint(event));
|
|
19521
19677
|
this.host.style.cursor = resizeHandle ? resizeHandle.kind === "column" ? "col-resize" : "row-resize" : "";
|
|
19522
19678
|
}
|
|
19523
19679
|
if (this.resizeDrag) {
|
|
@@ -19614,6 +19770,7 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
19614
19770
|
if (this.editingCell) return;
|
|
19615
19771
|
const { row, column } = this.selectionState.active;
|
|
19616
19772
|
if (event.key === "F2" || event.key === "Enter") {
|
|
19773
|
+
if (this.isReadOnly()) return;
|
|
19617
19774
|
event.preventDefault();
|
|
19618
19775
|
this.openCellEditor();
|
|
19619
19776
|
return;
|
|
@@ -19645,6 +19802,10 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
19645
19802
|
}, "handleCopy"));
|
|
19646
19803
|
__publicField(this, "handlePaste", /* @__PURE__ */ __name((event) => {
|
|
19647
19804
|
var _a, _b, _c, _d, _e;
|
|
19805
|
+
if (this.isReadOnly()) {
|
|
19806
|
+
event.preventDefault();
|
|
19807
|
+
return;
|
|
19808
|
+
}
|
|
19648
19809
|
const text = (_b = (_a = event.clipboardData) == null ? void 0 : _a.getData("text/plain")) != null ? _b : "";
|
|
19649
19810
|
if (!text) return;
|
|
19650
19811
|
event.preventDefault();
|
|
@@ -19688,7 +19849,11 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
19688
19849
|
}
|
|
19689
19850
|
if (hit.kind !== "cell" && hit.kind !== "rowHeader" && hit.kind !== "columnHeader") return;
|
|
19690
19851
|
event.preventDefault();
|
|
19691
|
-
this.renderContextMenu(
|
|
19852
|
+
this.renderContextMenu(
|
|
19853
|
+
event.clientX,
|
|
19854
|
+
event.clientY,
|
|
19855
|
+
this.isReadOnly() ? void 0 : hit.kind === "columnHeader" ? hit.column : void 0
|
|
19856
|
+
);
|
|
19692
19857
|
}, "handleContextMenu"));
|
|
19693
19858
|
__publicField(this, "handleDocumentPointerDown", /* @__PURE__ */ __name((event) => {
|
|
19694
19859
|
const path = event.composedPath();
|
|
@@ -19703,6 +19868,7 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
19703
19868
|
this.setScroll(next.x, next.y);
|
|
19704
19869
|
}, "handleWheel"));
|
|
19705
19870
|
var _a;
|
|
19871
|
+
this.readOnlyValue = options.readOnly === true;
|
|
19706
19872
|
host.replaceChildren();
|
|
19707
19873
|
this.renderRoot = options.styleIsolation === "none" ? host : (_a = host.shadowRoot) != null ? _a : host.attachShadow({ mode: "open" });
|
|
19708
19874
|
this.renderRoot.replaceChildren();
|
|
@@ -19830,6 +19996,24 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
19830
19996
|
if (!this.runtimeValue) throw new Error("SpreadsheetEditor: workbook is not loaded");
|
|
19831
19997
|
return this.runtimeValue;
|
|
19832
19998
|
}
|
|
19999
|
+
isReadOnly() {
|
|
20000
|
+
return this.readOnlyValue;
|
|
20001
|
+
}
|
|
20002
|
+
setReadOnly(readOnly) {
|
|
20003
|
+
if (this.disposed || this.isReadOnly() === readOnly) return;
|
|
20004
|
+
this.cellEditor.cancel();
|
|
20005
|
+
this.resizeDrag = null;
|
|
20006
|
+
this.autoFillDrag = null;
|
|
20007
|
+
this.chartDrag = null;
|
|
20008
|
+
this.selecting = false;
|
|
20009
|
+
this.hideResizeGuide();
|
|
20010
|
+
this.hideContextMenu();
|
|
20011
|
+
this.hideFilterMenu();
|
|
20012
|
+
this.runtime().setReadOnly(readOnly);
|
|
20013
|
+
this.readOnlyValue = readOnly;
|
|
20014
|
+
this.host.setAttribute("aria-readonly", String(readOnly));
|
|
20015
|
+
this.render();
|
|
20016
|
+
}
|
|
19833
20017
|
selection() {
|
|
19834
20018
|
return this.selectionState;
|
|
19835
20019
|
}
|
|
@@ -19998,8 +20182,10 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
19998
20182
|
if (previous) await previous.dispose();
|
|
19999
20183
|
this.runtimeValue = await SpreadsheetEditorRuntime.fromZip(bytes, {
|
|
20000
20184
|
workbookId: this.options.workbookId,
|
|
20001
|
-
mode: "inline"
|
|
20185
|
+
mode: "inline",
|
|
20186
|
+
readOnly: this.readOnlyValue
|
|
20002
20187
|
});
|
|
20188
|
+
this.host.setAttribute("aria-readonly", String(this.isReadOnly()));
|
|
20003
20189
|
this.renderTabs();
|
|
20004
20190
|
this.render();
|
|
20005
20191
|
}
|
|
@@ -20092,13 +20278,14 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
20092
20278
|
this.scroll
|
|
20093
20279
|
);
|
|
20094
20280
|
renderer.resize(width, height);
|
|
20095
|
-
|
|
20096
|
-
renderer.
|
|
20281
|
+
const headerFiltersEnabled = this.options.enableHeaderFilters === true && !this.isReadOnly();
|
|
20282
|
+
renderer.setHeaderFiltersEnabled(headerFiltersEnabled);
|
|
20283
|
+
renderer.setHeaderFilterColumns(headerFiltersEnabled ? Array.from({ length: layout.columnCount }, (_, index) => index + 1) : null);
|
|
20097
20284
|
renderer.setActiveHeaderFilterColumns(Array.from(this.columnFilters.keys()));
|
|
20098
20285
|
renderer.render(layout, viewport);
|
|
20099
20286
|
const selectionRange = normalizeSelectionRange(this.selectionState.range);
|
|
20100
20287
|
renderer.renderSelection(layout, viewport, selectionRange, {
|
|
20101
|
-
showFillHandle: supportsSpreadsheetAutoFill(runtime.activeSheet(), selectionRange)
|
|
20288
|
+
showFillHandle: !this.isReadOnly() && supportsSpreadsheetAutoFill(runtime.activeSheet(), selectionRange)
|
|
20102
20289
|
});
|
|
20103
20290
|
this.updateCellEditorPosition();
|
|
20104
20291
|
if ((_a = this.autoFillDrag) == null ? void 0 : _a.preview) {
|
|
@@ -20148,7 +20335,7 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
20148
20335
|
textAlign: "center",
|
|
20149
20336
|
font: "13px Arial, sans-serif",
|
|
20150
20337
|
lineHeight: "1.4",
|
|
20151
|
-
cursor: ((_c = this.chartDrag) == null ? void 0 : _c.chartIndex) === chartIndex ? "grabbing" : "move",
|
|
20338
|
+
cursor: this.isReadOnly() ? "default" : ((_c = this.chartDrag) == null ? void 0 : _c.chartIndex) === chartIndex ? "grabbing" : "move",
|
|
20152
20339
|
border: this.selectedChartIndex === chartIndex ? "2px solid #2563eb" : "1px dashed #94a3b8",
|
|
20153
20340
|
boxShadow: this.selectedChartIndex === chartIndex ? "0 0 0 1px rgba(37, 99, 235, 0.18)" : "none"
|
|
20154
20341
|
});
|
|
@@ -20211,7 +20398,7 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
20211
20398
|
this.resizeGuide.style.display = "none";
|
|
20212
20399
|
}
|
|
20213
20400
|
renderContextMenu(x, y, columnHeader) {
|
|
20214
|
-
const items = [
|
|
20401
|
+
const items = this.isReadOnly() ? [{ label: "Copy", action: /* @__PURE__ */ __name(() => this.copySelection(), "action") }] : [
|
|
20215
20402
|
{ label: "Undo", disabled: !this.canUndo(), action: /* @__PURE__ */ __name(() => this.undo(), "action") },
|
|
20216
20403
|
{ label: "Redo", disabled: !this.canRedo(), action: /* @__PURE__ */ __name(() => this.redo(), "action") },
|
|
20217
20404
|
{ label: "Copy", action: /* @__PURE__ */ __name(() => this.copySelection(), "action") },
|
|
@@ -20340,6 +20527,7 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
20340
20527
|
await this.sortColumn(this.selectionState.active.column, direction);
|
|
20341
20528
|
}
|
|
20342
20529
|
async filterColumn(column, values) {
|
|
20530
|
+
this.assertWritable();
|
|
20343
20531
|
if (values === null) this.columnFilters.delete(column);
|
|
20344
20532
|
else this.columnFilters.set(column, [...values]);
|
|
20345
20533
|
await this.applyColumnFilters();
|
|
@@ -20445,6 +20633,7 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
20445
20633
|
}
|
|
20446
20634
|
openCellEditor() {
|
|
20447
20635
|
var _a, _b;
|
|
20636
|
+
if (this.isReadOnly()) return;
|
|
20448
20637
|
if (!this.layout || !this.viewport) return;
|
|
20449
20638
|
const cell = this.selectionState.active;
|
|
20450
20639
|
const viewport = this.viewport.findViewport({
|
|
@@ -20484,6 +20673,7 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
20484
20673
|
this.editingCellStyle = null;
|
|
20485
20674
|
this.formulaReferenceRanges = [];
|
|
20486
20675
|
if (!cell) return;
|
|
20676
|
+
this.assertWritable();
|
|
20487
20677
|
const address = excel.formatCellAddress(cell.row, cell.column);
|
|
20488
20678
|
if (value.startsWith("=")) await this.runtime().setCellFormula(address, value.slice(1), { mergeUndo: true });
|
|
20489
20679
|
else await this.runtime().setCellValue(address, coerceEditorValue(value), { mergeUndo: true });
|
|
@@ -20494,6 +20684,9 @@ var _NativeSpreadsheetEditor = class _NativeSpreadsheetEditor {
|
|
|
20494
20684
|
const rect = this.host.getBoundingClientRect();
|
|
20495
20685
|
return { x: event.clientX - rect.left, y: event.clientY - rect.top };
|
|
20496
20686
|
}
|
|
20687
|
+
assertWritable() {
|
|
20688
|
+
if (this.isReadOnly()) throw new EditorReadOnlyError("spreadsheet");
|
|
20689
|
+
}
|
|
20497
20690
|
eventPathContains(event, node) {
|
|
20498
20691
|
return event.composedPath().includes(node);
|
|
20499
20692
|
}
|
|
@@ -20817,8 +21010,6 @@ function formulaReferenceCell(value) {
|
|
|
20817
21010
|
return Number.isFinite(row) && row > 0 && column > 0 ? { row, column } : null;
|
|
20818
21011
|
}
|
|
20819
21012
|
__name(formulaReferenceCell, "formulaReferenceCell");
|
|
20820
|
-
|
|
20821
|
-
// src/ppt/scene.ts
|
|
20822
21013
|
var DEFAULT_PPT_SLIDE_SIZE = {
|
|
20823
21014
|
width: 9144e3,
|
|
20824
21015
|
height: 5143500
|
|
@@ -20850,7 +21041,7 @@ function buildPptSlideScene(slide, fallbackSize) {
|
|
|
20850
21041
|
].filter(shouldRenderInheritedShape);
|
|
20851
21042
|
const shapes = [
|
|
20852
21043
|
...inheritedShapes,
|
|
20853
|
-
...slide.shapes.map((shape) => applyPlaceholderInheritance(shape,
|
|
21044
|
+
...slide.shapes.map((shape) => applyPlaceholderInheritance(shape, slide.layout))
|
|
20854
21045
|
];
|
|
20855
21046
|
const renderShapes = shapes.flatMap(flattenRenderableShape);
|
|
20856
21047
|
const background = (_j = (_g = slide.background) != null ? _g : (_f = slide.layout) == null ? void 0 : _f.background) != null ? _j : (_i = (_h = slide.layout) == null ? void 0 : _h.master) == null ? void 0 : _i.background;
|
|
@@ -20991,28 +21182,21 @@ function normalizeRotation(rotation) {
|
|
|
20991
21182
|
return normalized === 0 ? void 0 : normalized;
|
|
20992
21183
|
}
|
|
20993
21184
|
__name(normalizeRotation, "normalizeRotation");
|
|
20994
|
-
function applyPlaceholderInheritance(shape,
|
|
20995
|
-
|
|
20996
|
-
|
|
20997
|
-
|
|
20998
|
-
|
|
20999
|
-
|
|
21000
|
-
|
|
21001
|
-
|
|
21185
|
+
function applyPlaceholderInheritance(shape, layout) {
|
|
21186
|
+
if (!shape.placeholder) return shape;
|
|
21187
|
+
const effective = ppt.resolvePptEffectivePlaceholderProperties(shape, layout);
|
|
21188
|
+
return __spreadValues(__spreadProps(__spreadValues({}, shape), {
|
|
21189
|
+
placeholder: effective.placeholder,
|
|
21190
|
+
geometry: effective.geometry,
|
|
21191
|
+
style: effective.style
|
|
21192
|
+
}), shape.text ? {
|
|
21002
21193
|
text: __spreadProps(__spreadValues({}, shape.text), {
|
|
21003
|
-
style:
|
|
21194
|
+
style: effective.textStyle,
|
|
21195
|
+
body: effective.textBody
|
|
21004
21196
|
})
|
|
21005
|
-
});
|
|
21197
|
+
} : {});
|
|
21006
21198
|
}
|
|
21007
21199
|
__name(applyPlaceholderInheritance, "applyPlaceholderInheritance");
|
|
21008
|
-
function samePlaceholder(shape, candidate) {
|
|
21009
|
-
var _a, _b;
|
|
21010
|
-
if (!candidate.placeholder) return false;
|
|
21011
|
-
if (((_a = shape.placeholder) == null ? void 0 : _a.index) && candidate.placeholder.index === shape.placeholder.index)
|
|
21012
|
-
return true;
|
|
21013
|
-
return Boolean(((_b = shape.placeholder) == null ? void 0 : _b.type) && candidate.placeholder.type === shape.placeholder.type);
|
|
21014
|
-
}
|
|
21015
|
-
__name(samePlaceholder, "samePlaceholder");
|
|
21016
21200
|
function buildPptSceneNode(shape, options = {}) {
|
|
21017
21201
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
21018
21202
|
const capabilities = pptSceneNodeCapabilities(shape);
|
|
@@ -21460,6 +21644,7 @@ var _PptEditorSession = class _PptEditorSession {
|
|
|
21460
21644
|
__publicField(this, "redoStack", []);
|
|
21461
21645
|
__publicField(this, "textBodyOverrides", /* @__PURE__ */ new Map());
|
|
21462
21646
|
__publicField(this, "maxHistory");
|
|
21647
|
+
__publicField(this, "readOnlyValue");
|
|
21463
21648
|
__publicField(this, "changeListeners", /* @__PURE__ */ new Set());
|
|
21464
21649
|
__publicField(this, "selectionListeners", /* @__PURE__ */ new Set());
|
|
21465
21650
|
var _a;
|
|
@@ -21467,9 +21652,11 @@ var _PptEditorSession = class _PptEditorSession {
|
|
|
21467
21652
|
this.modelValue = view.model;
|
|
21468
21653
|
this.sceneValue = view.scene;
|
|
21469
21654
|
this.maxHistory = (_a = options.maxHistory) != null ? _a : 50;
|
|
21655
|
+
this.readOnlyValue = options.readOnly === true;
|
|
21470
21656
|
this.selectionValue = view.scene.slides[0] ? { kind: "slide", slideId: view.scene.slides[0].id } : null;
|
|
21471
21657
|
}
|
|
21472
21658
|
presentation() {
|
|
21659
|
+
this.assertWritable();
|
|
21473
21660
|
return this.presentationValue;
|
|
21474
21661
|
}
|
|
21475
21662
|
model() {
|
|
@@ -21484,11 +21671,17 @@ var _PptEditorSession = class _PptEditorSession {
|
|
|
21484
21671
|
revision() {
|
|
21485
21672
|
return this.revisionValue;
|
|
21486
21673
|
}
|
|
21674
|
+
isReadOnly() {
|
|
21675
|
+
return this.readOnlyValue;
|
|
21676
|
+
}
|
|
21677
|
+
setReadOnly(readOnly) {
|
|
21678
|
+
this.readOnlyValue = readOnly;
|
|
21679
|
+
}
|
|
21487
21680
|
canUndo() {
|
|
21488
|
-
return this.undoStack.length > 0;
|
|
21681
|
+
return !this.readOnlyValue && this.undoStack.length > 0;
|
|
21489
21682
|
}
|
|
21490
21683
|
canRedo() {
|
|
21491
|
-
return this.redoStack.length > 0;
|
|
21684
|
+
return !this.readOnlyValue && this.redoStack.length > 0;
|
|
21492
21685
|
}
|
|
21493
21686
|
subscribe(event, listener) {
|
|
21494
21687
|
const listeners = event === "change" ? this.changeListeners : this.selectionListeners;
|
|
@@ -21504,6 +21697,7 @@ var _PptEditorSession = class _PptEditorSession {
|
|
|
21504
21697
|
await this.applySelectionCommand(command);
|
|
21505
21698
|
return;
|
|
21506
21699
|
}
|
|
21700
|
+
this.assertWritable();
|
|
21507
21701
|
const before = await this.presentationValue.toZip();
|
|
21508
21702
|
const nextSelection = await this.applyEditCommand(command);
|
|
21509
21703
|
this.pushUndo(before);
|
|
@@ -21512,6 +21706,7 @@ var _PptEditorSession = class _PptEditorSession {
|
|
|
21512
21706
|
if (nextSelection !== void 0) this.setSelection(nextSelection);
|
|
21513
21707
|
}
|
|
21514
21708
|
async undo() {
|
|
21709
|
+
this.assertWritable();
|
|
21515
21710
|
const entry = this.undoStack.pop();
|
|
21516
21711
|
if (!entry) return;
|
|
21517
21712
|
const selection = this.selectionValue;
|
|
@@ -21520,6 +21715,7 @@ var _PptEditorSession = class _PptEditorSession {
|
|
|
21520
21715
|
await this.replacePresentation(entry.bytes, selection);
|
|
21521
21716
|
}
|
|
21522
21717
|
async redo() {
|
|
21718
|
+
this.assertWritable();
|
|
21523
21719
|
const entry = this.redoStack.pop();
|
|
21524
21720
|
if (!entry) return;
|
|
21525
21721
|
const selection = this.selectionValue;
|
|
@@ -21552,6 +21748,9 @@ var _PptEditorSession = class _PptEditorSession {
|
|
|
21552
21748
|
this.changeListeners.clear();
|
|
21553
21749
|
this.selectionListeners.clear();
|
|
21554
21750
|
}
|
|
21751
|
+
assertWritable() {
|
|
21752
|
+
if (this.readOnlyValue) throw new EditorReadOnlyError("ppt");
|
|
21753
|
+
}
|
|
21555
21754
|
async applySelectionCommand(command) {
|
|
21556
21755
|
const slide = findPptSceneSlide(this.sceneValue, command.slideIdOrIndex);
|
|
21557
21756
|
if (!slide) throw new Error(`PPT slide not found: ${String(command.slideIdOrIndex)}`);
|
|
@@ -21775,6 +21974,7 @@ var PPT_THUMB_WIDTH_PX = 128;
|
|
|
21775
21974
|
var PPT_THUMB_MARGIN_BOTTOM_PX = 8;
|
|
21776
21975
|
var PPT_THUMB_OVERSCAN = 2;
|
|
21777
21976
|
var PPT_THUMB_RASTER_SCALE = 2;
|
|
21977
|
+
var PPT_THUMB_LAYOUT_SCALE = 4;
|
|
21778
21978
|
function renderNativePptEditor(host, view, options = {}) {
|
|
21779
21979
|
return new NativePptEditorController(host, view, options);
|
|
21780
21980
|
}
|
|
@@ -21936,7 +22136,7 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
21936
22136
|
__publicField(this, "pendingCommands", /* @__PURE__ */ new Set());
|
|
21937
22137
|
this.options = options;
|
|
21938
22138
|
this.root = options.styleIsolation === "none" ? host : host.attachShadow({ mode: "open" });
|
|
21939
|
-
this.sessionValue = new PptEditorSession(view);
|
|
22139
|
+
this.sessionValue = new PptEditorSession(view, { readOnly: options.readOnly });
|
|
21940
22140
|
this.imageResources = view.images;
|
|
21941
22141
|
this.fontResources = view.fonts;
|
|
21942
22142
|
this.referencedFontFamilies = usedFontFamiliesInView(view);
|
|
@@ -21961,6 +22161,23 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
21961
22161
|
selection() {
|
|
21962
22162
|
return this.sessionValue.selection();
|
|
21963
22163
|
}
|
|
22164
|
+
isReadOnly() {
|
|
22165
|
+
return this.sessionValue.isReadOnly();
|
|
22166
|
+
}
|
|
22167
|
+
setReadOnly(readOnly) {
|
|
22168
|
+
if (this.isReadOnly() === readOnly) return;
|
|
22169
|
+
const editable = this.root.querySelector('[contenteditable="true"]');
|
|
22170
|
+
editable == null ? void 0 : editable.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape", bubbles: true, cancelable: true }));
|
|
22171
|
+
if (this.dragState) {
|
|
22172
|
+
this.restoreDragElementBounds(this.dragState);
|
|
22173
|
+
this.clearDragVisualState(this.dragState.element, true);
|
|
22174
|
+
this.dragState = null;
|
|
22175
|
+
this.hideSnapGuides();
|
|
22176
|
+
}
|
|
22177
|
+
this.hideContextMenu();
|
|
22178
|
+
this.sessionValue.setReadOnly(readOnly);
|
|
22179
|
+
this.render();
|
|
22180
|
+
}
|
|
21964
22181
|
async dispatch(command) {
|
|
21965
22182
|
const pending = this.dispatchAndRender(command);
|
|
21966
22183
|
this.pendingCommands.add(pending);
|
|
@@ -22030,6 +22247,8 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
22030
22247
|
${fontFaceCss(this.fontResources)}
|
|
22031
22248
|
:host, .coco-ppt-editor { box-sizing: border-box; width: 100%; height: 100%; min-height: 360px; }
|
|
22032
22249
|
.coco-ppt-editor { display: grid; grid-template-columns: 160px minmax(0, 1fr); background: #f4f6f8; color: #17202a; font: 13px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
|
|
22250
|
+
.coco-ppt-editor[data-show-slide-list="false"] { grid-template-columns: minmax(0, 1fr); }
|
|
22251
|
+
.coco-ppt-editor[data-show-slide-list="false"] .coco-ppt-slides { display: none; }
|
|
22033
22252
|
.coco-ppt-slides { overflow: auto; border-right: 1px solid #d7dde5; background: #edf1f5; padding: 8px; }
|
|
22034
22253
|
.coco-ppt-thumb { width: 128px; aspect-ratio: 16 / 9; margin: 0 0 8px; border: 1px solid #c7d0dc; background: #fff; display: block; position: relative; overflow: hidden; cursor: pointer; padding: 0; }
|
|
22035
22254
|
.coco-ppt-thumb[data-selected="true"] { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18); }
|
|
@@ -22059,6 +22278,11 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
22059
22278
|
.coco-ppt-table td[contenteditable="true"] { cursor: text; outline: 2px solid #2563eb; outline-offset: -2px; }
|
|
22060
22279
|
.coco-ppt-node[contenteditable="true"] { cursor: text; outline: 2px solid rgba(37, 99, 235, 0.3); user-select: text; }
|
|
22061
22280
|
.coco-ppt-text-layer[contenteditable="true"] { cursor: text; outline: 2px solid rgba(37, 99, 235, 0.3); user-select: text; }
|
|
22281
|
+
.coco-ppt-editor[data-read-only="true"] .coco-ppt-node,
|
|
22282
|
+
.coco-ppt-editor[data-read-only="true"] .coco-ppt-text-layer,
|
|
22283
|
+
.coco-ppt-editor[data-read-only="true"] .coco-ppt-rich-text,
|
|
22284
|
+
.coco-ppt-editor[data-read-only="true"] .coco-ppt-paragraph { user-select: text; cursor: text; }
|
|
22285
|
+
.coco-ppt-editor[data-read-only="true"] .coco-ppt-resize-handle { display: none !important; }
|
|
22062
22286
|
.coco-ppt-node[data-kind="picture"] { background: transparent; }
|
|
22063
22287
|
.coco-ppt-unsupported-image { position: absolute; inset: 0; display: grid; place-items: center; box-sizing: border-box; border: 1px dashed rgba(100, 116, 139, 0.48); background: repeating-linear-gradient(135deg, rgba(148, 163, 184, 0.12) 0 8px, rgba(248, 250, 252, 0.1) 8px 16px); color: rgba(51, 65, 85, 0.72); font: 11px/1.2 "Segoe UI", sans-serif; pointer-events: none; }
|
|
22064
22288
|
.coco-ppt-thumb-node .coco-ppt-unsupported-image { font-size: 8px; border-width: 0.5px; }
|
|
@@ -22095,6 +22319,8 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
22095
22319
|
`;
|
|
22096
22320
|
const shell = document.createElement("div");
|
|
22097
22321
|
shell.className = "coco-ppt-editor";
|
|
22322
|
+
shell.dataset.showSlideList = String(this.options.showSlideList !== false);
|
|
22323
|
+
shell.dataset.readOnly = String(this.isReadOnly());
|
|
22098
22324
|
this.slideList.className = "coco-ppt-slides";
|
|
22099
22325
|
const stage = document.createElement("div");
|
|
22100
22326
|
stage.className = "coco-ppt-stage";
|
|
@@ -22133,9 +22359,11 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
22133
22359
|
});
|
|
22134
22360
|
}
|
|
22135
22361
|
render() {
|
|
22362
|
+
const shell = this.root.querySelector(".coco-ppt-editor");
|
|
22363
|
+
if (shell) shell.dataset.readOnly = String(this.isReadOnly());
|
|
22136
22364
|
const scene = this.sessionValue.scene();
|
|
22137
22365
|
this.slideList.replaceChildren(
|
|
22138
|
-
...scene.slides.map((slide) => {
|
|
22366
|
+
...this.options.showSlideList === false ? [] : scene.slides.map((slide) => {
|
|
22139
22367
|
var _a;
|
|
22140
22368
|
const thumb = document.createElement("button");
|
|
22141
22369
|
thumb.className = "coco-ppt-thumb";
|
|
@@ -22158,7 +22386,7 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
22158
22386
|
return thumb;
|
|
22159
22387
|
})
|
|
22160
22388
|
);
|
|
22161
|
-
this.renderVisibleThumbnails(scene.slides);
|
|
22389
|
+
if (this.options.showSlideList !== false) this.renderVisibleThumbnails(scene.slides);
|
|
22162
22390
|
const selected = this.currentSlide();
|
|
22163
22391
|
if (!selected) {
|
|
22164
22392
|
this.canvas.replaceChildren();
|
|
@@ -22227,9 +22455,11 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
22227
22455
|
renderThumbnailSlide(slide) {
|
|
22228
22456
|
const wrapper = document.createElement("div");
|
|
22229
22457
|
wrapper.className = "coco-ppt-thumb-slide";
|
|
22230
|
-
const
|
|
22458
|
+
const layoutWidth = PPT_THUMB_WIDTH_PX * PPT_THUMB_LAYOUT_SCALE;
|
|
22459
|
+
const scale = layoutWidth / slide.size.width;
|
|
22231
22460
|
wrapper.style.width = `${slide.size.width * scale}px`;
|
|
22232
22461
|
wrapper.style.height = `${slide.size.height * scale}px`;
|
|
22462
|
+
wrapper.style.transform = `scale(${1 / PPT_THUMB_LAYOUT_SCALE})`;
|
|
22233
22463
|
wrapper.style.background = cssBackground(slide.background, this.imageResources);
|
|
22234
22464
|
wrapper.replaceChildren(
|
|
22235
22465
|
...slide.nodes.map((node) => this.renderNode(node, scale, slide, false))
|
|
@@ -22251,7 +22481,9 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
22251
22481
|
PPT_THUMB_WIDTH_PX,
|
|
22252
22482
|
PPT_THUMB_WIDTH_PX * (slide.size.height / slide.size.width),
|
|
22253
22483
|
PPT_THUMB_RASTER_SCALE,
|
|
22254
|
-
(_b = (_a = this.root.querySelector("style")) == null ? void 0 : _a.textContent) != null ? _b : ""
|
|
22484
|
+
(_b = (_a = this.root.querySelector("style")) == null ? void 0 : _a.textContent) != null ? _b : "",
|
|
22485
|
+
PPT_THUMB_WIDTH_PX * PPT_THUMB_LAYOUT_SCALE,
|
|
22486
|
+
PPT_THUMB_WIDTH_PX * PPT_THUMB_LAYOUT_SCALE * (slide.size.height / slide.size.width)
|
|
22255
22487
|
);
|
|
22256
22488
|
if (!canvas) return;
|
|
22257
22489
|
if (epoch !== this.thumbnailRasterEpoch || !thumb.isConnected) return;
|
|
@@ -22286,8 +22518,8 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
22286
22518
|
element.dataset.kind = node.kind;
|
|
22287
22519
|
element.dataset.locked = String(node.locked);
|
|
22288
22520
|
if (interactive) {
|
|
22289
|
-
element.dataset.draggable = String(node.capabilities.editGeometry);
|
|
22290
|
-
element.dataset.resizable = String(node.capabilities.editGeometry);
|
|
22521
|
+
element.dataset.draggable = String(!this.isReadOnly() && node.capabilities.editGeometry);
|
|
22522
|
+
element.dataset.resizable = String(!this.isReadOnly() && node.capabilities.editGeometry);
|
|
22291
22523
|
element.dataset.shapeId = node.id;
|
|
22292
22524
|
}
|
|
22293
22525
|
element.style.left = `${node.bounds.left * scale - (lineNode && lineAxis === "vertical" ? nodeWidth / 2 : 0)}px`;
|
|
@@ -22367,6 +22599,7 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
22367
22599
|
});
|
|
22368
22600
|
});
|
|
22369
22601
|
table.addEventListener("dblclick", (event) => {
|
|
22602
|
+
if (this.isReadOnly()) return;
|
|
22370
22603
|
const cell = tableCellFromEvent(event);
|
|
22371
22604
|
if (!cell || !node.capabilities.editTableCells) return;
|
|
22372
22605
|
event.stopPropagation();
|
|
@@ -22420,7 +22653,7 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
22420
22653
|
const handle = document.createElement("div");
|
|
22421
22654
|
handle.className = "coco-ppt-resize-handle";
|
|
22422
22655
|
handle.addEventListener("mousedown", (event) => {
|
|
22423
|
-
if (!node.capabilities.editGeometry) return;
|
|
22656
|
+
if (this.isReadOnly() || !node.capabilities.editGeometry) return;
|
|
22424
22657
|
event.preventDefault();
|
|
22425
22658
|
event.stopPropagation();
|
|
22426
22659
|
this.startDrag(event, "resize", slide, node, scale, element);
|
|
@@ -22475,6 +22708,7 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
22475
22708
|
});
|
|
22476
22709
|
element.addEventListener("contextmenu", (event) => {
|
|
22477
22710
|
var _a2;
|
|
22711
|
+
if (this.isReadOnly()) return;
|
|
22478
22712
|
event.preventDefault();
|
|
22479
22713
|
event.stopPropagation();
|
|
22480
22714
|
const targetNode = (_a2 = this.pointerOperationNode(slide, node, event, scale)) != null ? _a2 : node;
|
|
@@ -22488,7 +22722,7 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
22488
22722
|
var _a2, _b2;
|
|
22489
22723
|
const targetNode = (_a2 = this.pointerOperationNode(slide, node, event, scale)) != null ? _a2 : node;
|
|
22490
22724
|
const targetElement = (_b2 = elementForShape(this.canvas, targetNode.id)) != null ? _b2 : element;
|
|
22491
|
-
if (isEditingText(targetElement, event.target) || event.button !== 0 || !targetNode.capabilities.editGeometry)
|
|
22725
|
+
if (isEditingText(targetElement, event.target) || this.isReadOnly() || event.button !== 0 || !targetNode.capabilities.editGeometry)
|
|
22492
22726
|
return;
|
|
22493
22727
|
event.preventDefault();
|
|
22494
22728
|
event.stopPropagation();
|
|
@@ -22496,6 +22730,7 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
22496
22730
|
});
|
|
22497
22731
|
element.addEventListener("dblclick", (event) => {
|
|
22498
22732
|
var _a2, _b2, _c2;
|
|
22733
|
+
if (this.isReadOnly()) return;
|
|
22499
22734
|
event.stopPropagation();
|
|
22500
22735
|
const redirectedNode = redirectedEditableTextHit(slide, node, event, scale);
|
|
22501
22736
|
if (redirectedNode) {
|
|
@@ -22574,6 +22809,7 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
22574
22809
|
}
|
|
22575
22810
|
startTextEdit(element, slide, node) {
|
|
22576
22811
|
var _a, _b, _c, _d;
|
|
22812
|
+
if (this.isReadOnly()) return;
|
|
22577
22813
|
const originalText = (_a = node.text) != null ? _a : "";
|
|
22578
22814
|
const editableTarget = editableTextTarget(element);
|
|
22579
22815
|
let finished = false;
|
|
@@ -22666,6 +22902,7 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
22666
22902
|
}
|
|
22667
22903
|
startTableCellEdit(cell, slide, node, row, column) {
|
|
22668
22904
|
var _a, _b, _c;
|
|
22905
|
+
if (this.isReadOnly()) return;
|
|
22669
22906
|
const originalText = tableCellRawText(cell, node, row, column);
|
|
22670
22907
|
let finished = false;
|
|
22671
22908
|
void this.sessionValue.dispatch({ kind: "select-shape", slideIdOrIndex: slide.id, shapeIdOrName: node.id }).then(() => this.renderSelection());
|
|
@@ -22746,6 +22983,7 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
22746
22983
|
cell.addEventListener("paste", handlePaste);
|
|
22747
22984
|
}
|
|
22748
22985
|
startDrag(event, mode, slide, node, scale, element) {
|
|
22986
|
+
if (this.isReadOnly()) return;
|
|
22749
22987
|
if (mode === "resize") prepareTextResizePreview(element, node);
|
|
22750
22988
|
this.dragState = {
|
|
22751
22989
|
mode,
|
|
@@ -23051,6 +23289,7 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
23051
23289
|
const node = slide == null ? void 0 : slide.nodes.find((item) => item.id === selection.shapeId);
|
|
23052
23290
|
if (!slide || !node) return;
|
|
23053
23291
|
const commandKey = event.ctrlKey || event.metaKey;
|
|
23292
|
+
if (this.isReadOnly()) return;
|
|
23054
23293
|
if (commandKey && event.key.toLowerCase() === "c") {
|
|
23055
23294
|
event.preventDefault();
|
|
23056
23295
|
this.copySelectedShape(slide, node);
|
|
@@ -23109,6 +23348,7 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
23109
23348
|
});
|
|
23110
23349
|
}
|
|
23111
23350
|
handleSelectStart(event) {
|
|
23351
|
+
if (this.isReadOnly()) return;
|
|
23112
23352
|
if (isTypingTarget(event.target)) return;
|
|
23113
23353
|
if (event.target instanceof HTMLElement && event.target.closest('[contenteditable="true"]'))
|
|
23114
23354
|
return;
|
|
@@ -23203,6 +23443,7 @@ var _NativePptEditorController = class _NativePptEditorController {
|
|
|
23203
23443
|
});
|
|
23204
23444
|
}
|
|
23205
23445
|
showContextMenu(event, slide, node) {
|
|
23446
|
+
if (this.isReadOnly()) return;
|
|
23206
23447
|
const editable = isShapeCollectionEditable(node);
|
|
23207
23448
|
const hasClipboard = Boolean(this.clipboardShape);
|
|
23208
23449
|
const run = /* @__PURE__ */ __name((action) => () => {
|
|
@@ -23402,7 +23643,7 @@ function nextAnimationFrame() {
|
|
|
23402
23643
|
return new Promise((resolve) => requestAnimationFrame(() => resolve()));
|
|
23403
23644
|
}
|
|
23404
23645
|
__name(nextAnimationFrame, "nextAnimationFrame");
|
|
23405
|
-
async function rasterizeThumbnailElement(element, width, height, scale, cssText) {
|
|
23646
|
+
async function rasterizeThumbnailElement(element, width, height, scale, cssText, layoutWidth = width, layoutHeight = height) {
|
|
23406
23647
|
if (typeof XMLSerializer === "undefined" || typeof Blob === "undefined" || typeof URL === "undefined" || typeof URL.createObjectURL !== "function")
|
|
23407
23648
|
return null;
|
|
23408
23649
|
await waitForThumbnailImages(element);
|
|
@@ -23413,8 +23654,8 @@ async function rasterizeThumbnailElement(element, width, height, scale, cssText)
|
|
|
23413
23654
|
if (!context) return null;
|
|
23414
23655
|
const wrapper = document.createElement("div");
|
|
23415
23656
|
wrapper.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
|
|
23416
|
-
wrapper.style.width = `${
|
|
23417
|
-
wrapper.style.height = `${
|
|
23657
|
+
wrapper.style.width = `${layoutWidth}px`;
|
|
23658
|
+
wrapper.style.height = `${layoutHeight}px`;
|
|
23418
23659
|
wrapper.style.position = "relative";
|
|
23419
23660
|
wrapper.style.overflow = "hidden";
|
|
23420
23661
|
wrapper.style.background = "#fff";
|
|
@@ -23425,9 +23666,10 @@ async function rasterizeThumbnailElement(element, width, height, scale, cssText)
|
|
|
23425
23666
|
clone.style.position = "relative";
|
|
23426
23667
|
clone.style.left = "0";
|
|
23427
23668
|
clone.style.top = "0";
|
|
23669
|
+
clone.style.transform = "none";
|
|
23428
23670
|
wrapper.append(style, clone);
|
|
23429
23671
|
const serialized = new XMLSerializer().serializeToString(wrapper);
|
|
23430
|
-
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${canvas.width}" height="${canvas.height}" viewBox="0 0 ${
|
|
23672
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${canvas.width}" height="${canvas.height}" viewBox="0 0 ${layoutWidth} ${layoutHeight}"><foreignObject width="100%" height="100%">${serialized}</foreignObject></svg>`;
|
|
23431
23673
|
const url = URL.createObjectURL(new Blob([svg], { type: "image/svg+xml;charset=utf-8" }));
|
|
23432
23674
|
try {
|
|
23433
23675
|
const image = await loadRasterImage(url);
|
|
@@ -23797,13 +24039,9 @@ function googleFontCssUrl(family) {
|
|
|
23797
24039
|
}
|
|
23798
24040
|
__name(googleFontCssUrl, "googleFontCssUrl");
|
|
23799
24041
|
function cssFontFamilyStack(family) {
|
|
23800
|
-
return [
|
|
23801
|
-
|
|
23802
|
-
|
|
23803
|
-
'"Microsoft YaHei"',
|
|
23804
|
-
'"Segoe UI"',
|
|
23805
|
-
"sans-serif"
|
|
23806
|
-
].join(", ");
|
|
24042
|
+
return [cssString(family), '"Calibri"', '"Microsoft YaHei"', '"Segoe UI"', "sans-serif"].join(
|
|
24043
|
+
", "
|
|
24044
|
+
);
|
|
23807
24045
|
}
|
|
23808
24046
|
__name(cssFontFamilyStack, "cssFontFamilyStack");
|
|
23809
24047
|
function cssString(value) {
|
|
@@ -24306,8 +24544,7 @@ __name(firstExplicitFontSize, "firstExplicitFontSize");
|
|
|
24306
24544
|
function applyTextStyleToElement(element, style, scale) {
|
|
24307
24545
|
var _a, _b, _c;
|
|
24308
24546
|
if (style.fontSize) element.style.fontSize = `${Math.max(1, style.fontSize * 12700 * scale)}px`;
|
|
24309
|
-
if (style.fontFamily)
|
|
24310
|
-
element.style.fontFamily = cssFontFamilyStack(style.fontFamily);
|
|
24547
|
+
if (style.fontFamily) element.style.fontFamily = cssFontFamilyStack(style.fontFamily);
|
|
24311
24548
|
if (style.lineHeight) element.style.lineHeight = String(style.lineHeight);
|
|
24312
24549
|
if (style.characterSpacing !== void 0)
|
|
24313
24550
|
element.style.letterSpacing = `${style.characterSpacing * 12700 * scale}px`;
|
|
@@ -24602,7 +24839,10 @@ function renderPresetGeometry(node, scale) {
|
|
|
24602
24839
|
const fillOpacity = effectiveFillOpacity(node);
|
|
24603
24840
|
if (fillOpacity !== void 0 && node.presetGeometry !== "arc")
|
|
24604
24841
|
path.setAttribute("fill-opacity", String(fillOpacity));
|
|
24605
|
-
path.setAttribute(
|
|
24842
|
+
path.setAttribute(
|
|
24843
|
+
"stroke",
|
|
24844
|
+
lineGradientId ? `url(#${lineGradientId})` : (_c = node.lineColor) != null ? _c : "none"
|
|
24845
|
+
);
|
|
24606
24846
|
path.setAttribute("stroke-width", String(strokeWidth));
|
|
24607
24847
|
if (node.lineOpacity !== void 0)
|
|
24608
24848
|
path.setAttribute("stroke-opacity", String(Math.max(0, Math.min(1, node.lineOpacity))));
|
|
@@ -24816,14 +25056,18 @@ function customGeometryIsRectangular(geometry) {
|
|
|
24816
25056
|
{ x: 0, y: height }
|
|
24817
25057
|
];
|
|
24818
25058
|
return corners.every(
|
|
24819
|
-
(corner) => unique.some(
|
|
25059
|
+
(corner) => unique.some(
|
|
25060
|
+
(point) => geometryPointNear(point.x, corner.x) && geometryPointNear(point.y, corner.y)
|
|
25061
|
+
)
|
|
24820
25062
|
);
|
|
24821
25063
|
}
|
|
24822
25064
|
__name(customGeometryIsRectangular, "customGeometryIsRectangular");
|
|
24823
25065
|
function dedupeGeometryPoints(points) {
|
|
24824
25066
|
const result = [];
|
|
24825
25067
|
for (const point of points) {
|
|
24826
|
-
if (!result.some(
|
|
25068
|
+
if (!result.some(
|
|
25069
|
+
(existing) => geometryPointNear(existing.x, point.x) && geometryPointNear(existing.y, point.y)
|
|
25070
|
+
)) {
|
|
24827
25071
|
result.push(point);
|
|
24828
25072
|
}
|
|
24829
25073
|
}
|
|
@@ -24849,7 +25093,8 @@ function renderCustomGeometryPicture(node, url) {
|
|
|
24849
25093
|
for (const path of (_h = (_g = node.customGeometry) == null ? void 0 : _g.paths) != null ? _h : []) {
|
|
24850
25094
|
const clipShape = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
24851
25095
|
clipShape.setAttribute("d", customGeometryPathData(path.commands));
|
|
24852
|
-
if (customGeometryNeedsEvenOddFill(path.commands))
|
|
25096
|
+
if (customGeometryNeedsEvenOddFill(path.commands))
|
|
25097
|
+
clipShape.setAttribute("fill-rule", "evenodd");
|
|
24853
25098
|
clipPath.append(clipShape);
|
|
24854
25099
|
}
|
|
24855
25100
|
defs.append(clipPath);
|
|
@@ -24934,7 +25179,10 @@ function renderCustomGeometry(node, scale) {
|
|
|
24934
25179
|
const fillOpacity = effectiveFillOpacity(node);
|
|
24935
25180
|
if (hasFill && fillOpacity !== void 0)
|
|
24936
25181
|
shape.setAttribute("fill-opacity", String(fillOpacity));
|
|
24937
|
-
shape.setAttribute(
|
|
25182
|
+
shape.setAttribute(
|
|
25183
|
+
"stroke",
|
|
25184
|
+
lineGradientId ? `url(#${lineGradientId})` : (_j = node.lineColor) != null ? _j : "none"
|
|
25185
|
+
);
|
|
24938
25186
|
shape.setAttribute("stroke-width", String(strokeWidth));
|
|
24939
25187
|
if (node.lineOpacity !== void 0)
|
|
24940
25188
|
shape.setAttribute("stroke-opacity", String(Math.max(0, Math.min(1, node.lineOpacity))));
|
|
@@ -24958,13 +25206,7 @@ function customGeometryEllipse(path) {
|
|
|
24958
25206
|
}
|
|
24959
25207
|
const cx = width / 2;
|
|
24960
25208
|
const cy = height / 2;
|
|
24961
|
-
const endpoints = [
|
|
24962
|
-
commands[0],
|
|
24963
|
-
commands[1],
|
|
24964
|
-
commands[2],
|
|
24965
|
-
commands[3],
|
|
24966
|
-
commands[4]
|
|
24967
|
-
];
|
|
25209
|
+
const endpoints = [commands[0], commands[1], commands[2], commands[3], commands[4]];
|
|
24968
25210
|
const expected = [
|
|
24969
25211
|
{ x: width, y: cy },
|
|
24970
25212
|
{ x: cx, y: height },
|
|
@@ -25138,7 +25380,9 @@ function customGeometryPathData(commands) {
|
|
|
25138
25380
|
parts.push(`L ${command.x} ${command.y}`);
|
|
25139
25381
|
current = { x: command.x, y: command.y };
|
|
25140
25382
|
} else if (command.kind === "cubicBezierTo") {
|
|
25141
|
-
parts.push(
|
|
25383
|
+
parts.push(
|
|
25384
|
+
`C ${command.x1} ${command.y1} ${command.x2} ${command.y2} ${command.x} ${command.y}`
|
|
25385
|
+
);
|
|
25142
25386
|
current = { x: command.x, y: command.y };
|
|
25143
25387
|
} else if (command.kind === "arcTo") {
|
|
25144
25388
|
const arc = svgArcCommandForCustomGeometry(command, current);
|
|
@@ -25882,7 +26126,15 @@ function renderLineValueLabels(svg, seriesList, plot, min, max) {
|
|
|
25882
26126
|
series.values.forEach((value, pointIndex) => {
|
|
25883
26127
|
const x = plot.left + (series.values.length === 1 ? plot.width / 2 : plot.width * pointIndex / (series.values.length - 1));
|
|
25884
26128
|
const y = plot.top + plot.height - (value - min) / Math.max(1, max - min) * plot.height;
|
|
25885
|
-
appendSvgText(
|
|
26129
|
+
appendSvgText(
|
|
26130
|
+
svg,
|
|
26131
|
+
String(value),
|
|
26132
|
+
x,
|
|
26133
|
+
Math.max(plot.top + 2, y - 2.2),
|
|
26134
|
+
2.6,
|
|
26135
|
+
"#374151",
|
|
26136
|
+
"middle"
|
|
26137
|
+
);
|
|
25886
26138
|
});
|
|
25887
26139
|
});
|
|
25888
26140
|
}
|
|
@@ -26190,6 +26442,7 @@ function appendSvgMultilineText(svg, lines, x, y, size, color, anchor = "start")
|
|
|
26190
26442
|
__name(appendSvgMultilineText, "appendSvgMultilineText");
|
|
26191
26443
|
|
|
26192
26444
|
exports.DEFAULT_PPT_SLIDE_SIZE = DEFAULT_PPT_SLIDE_SIZE;
|
|
26445
|
+
exports.EditorReadOnlyError = EditorReadOnlyError;
|
|
26193
26446
|
exports.NATIVE_BLOCK_CLIPBOARD_TYPE = NATIVE_BLOCK_CLIPBOARD_TYPE;
|
|
26194
26447
|
exports.PptEditorSession = PptEditorSession;
|
|
26195
26448
|
exports.SPREADSHEET_COLUMN_RESIZE_MIN = SPREADSHEET_COLUMN_RESIZE_MIN;
|