@harbour-enterprises/superdoc 1.3.1-next.3 → 1.4.0-next.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/dist/chunks/{PdfViewer-CPnVLLJm.es.js → PdfViewer-Dnv-LGqI.es.js} +2 -2
- package/dist/chunks/{PdfViewer-BXbmY3Fc.cjs → PdfViewer-DqN1vOXI.cjs} +2 -2
- package/dist/chunks/{SuperConverter-BQ6PNaJ8.es.js → SuperConverter-DxlpZQZQ.es.js} +266 -6
- package/dist/chunks/{SuperConverter-p1tQGIew.cjs → SuperConverter-Dy4wkQEB.cjs} +266 -6
- package/dist/chunks/{index-DXSUcHli.es.js → index-D246eEeJ.es.js} +109 -17
- package/dist/chunks/{index-DLX_v-vr.cjs → index-DJuBZura.cjs} +106 -27
- package/dist/chunks/{index-BQYtE-5U.cjs → index-DpgrTjYC.cjs} +109 -17
- package/dist/chunks/{index-CJec1cbb.es.js → index-dnQEKI-e.es.js} +106 -27
- package/dist/style.css +32 -32
- package/dist/super-editor/converter.cjs +1 -1
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor.cjs +2 -2
- package/dist/super-editor.es.js +3 -3
- package/dist/superdoc/src/components/CommentsLayer/types.d.ts +3 -157
- package/dist/superdoc/src/components/CommentsLayer/types.d.ts.map +1 -1
- package/dist/superdoc/src/core/SuperDoc.d.ts.map +1 -1
- package/dist/superdoc/src/core/types/index.d.ts +12 -0
- package/dist/superdoc/src/core/types/index.d.ts.map +1 -1
- package/dist/superdoc/src/stores/comments-store.d.ts +4 -1
- package/dist/superdoc/src/stores/comments-store.d.ts.map +1 -1
- package/dist/superdoc/src/stores/superdoc-store.d.ts +12 -3
- package/dist/superdoc/src/stores/superdoc-store.d.ts.map +1 -1
- package/dist/superdoc.cjs +3 -3
- package/dist/superdoc.es.js +3 -3
- package/dist/superdoc.umd.js +477 -46
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/super-editor/src/core/Extension.d.ts +0 -33
- package/dist/super-editor/src/core/Extension.d.ts.map +0 -1
- package/dist/super-editor/src/core/helpers/getExtensionConfigField.d.ts +0 -35
- package/dist/super-editor/src/core/helpers/getExtensionConfigField.d.ts.map +0 -1
- package/dist/super-editor/src/core/utilities/callOrGet.d.ts +0 -13
- package/dist/super-editor/src/core/utilities/callOrGet.d.ts.map +0 -1
- package/dist/super-editor/src/extensions/comment/comments-constants.d.ts +0 -2
- package/dist/super-editor/src/extensions/comment/comments-constants.d.ts.map +0 -1
- package/dist/super-editor/src/extensions/comment/comments-plugin.d.ts +0 -1
- package/dist/superdoc/src/SuperDoc.test.d.ts +0 -2
- package/dist/superdoc/src/SuperDoc.test.d.ts.map +0 -1
- package/dist/superdoc/src/components/CommentsLayer/CommentDialog.test.d.ts +0 -2
- package/dist/superdoc/src/components/CommentsLayer/CommentDialog.test.d.ts.map +0 -1
- package/dist/superdoc/src/components/CommentsLayer/use-comment.test.d.ts +0 -2
- package/dist/superdoc/src/components/CommentsLayer/use-comment.test.d.ts.map +0 -1
- package/dist/superdoc/src/core/SuperDoc.test.d.ts +0 -2
- package/dist/superdoc/src/core/SuperDoc.test.d.ts.map +0 -1
- package/dist/superdoc/src/core/collaboration/collaboration.test.d.ts +0 -2
- package/dist/superdoc/src/core/collaboration/collaboration.test.d.ts.map +0 -1
- package/dist/superdoc/src/core/helpers/export.test.d.ts +0 -2
- package/dist/superdoc/src/core/helpers/export.test.d.ts.map +0 -1
- package/dist/superdoc/src/core/helpers/file.test.d.ts +0 -2
- package/dist/superdoc/src/core/helpers/file.test.d.ts.map +0 -1
- package/dist/superdoc/src/stores/comments-store.test.d.ts +0 -2
- package/dist/superdoc/src/stores/comments-store.test.d.ts.map +0 -1
- package/dist/superdoc/src/stores/hrbr-fields-store.test.d.ts +0 -2
- package/dist/superdoc/src/stores/hrbr-fields-store.test.d.ts.map +0 -1
- package/dist/superdoc/src/stores/superdoc-store.test.d.ts +0 -2
- package/dist/superdoc/src/stores/superdoc-store.test.d.ts.map +0 -1
- package/dist/superdoc/src/tests/helpers/group-changes.test.d.ts +0 -2
- package/dist/superdoc/src/tests/helpers/group-changes.test.d.ts.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { B as Buffer$2 } from "./jszip-B1fkPkPJ.es.js";
|
|
2
2
|
import { t as twipsToInches, i as inchesToTwips, p as ptToTwips, l as linesToTwips, a as twipsToLines, b as pixelsToTwips, h as halfPointToPoints, c as twipsToPixels$2, d as convertSizeToCSS, e as inchesToPixels } from "./helpers-C8e9wR5l.es.js";
|
|
3
|
-
import { g as generateDocxRandomId, T as TextSelection$1, o as objectIncludes, w as wrapTextsInRuns, D as DOMParser$1, c as createDocFromMarkdown, a as createDocFromHTML, b as chainableEditorState, d as convertMarkdownToHTML, f as findParentNode, e as findParentNodeClosestToPos, h as generateRandom32BitHex, i as generateRandomSigned32BitIntStrId, P as PluginKey, j as Plugin, M as Mapping, N as NodeSelection, k as Selection, l as Slice, m as DOMSerializer, F as Fragment, n as Mark$1, p as dropPoint, A as AllSelection, q as Schema$1, s as canSplit, t as resolveRunProperties, u as encodeMarksFromRPr, v as liftTarget, x as canJoin, y as joinPoint, z as replaceStep$1, R as ReplaceAroundStep$1, B as htmlHandler, C as ReplaceStep, E as getResolvedParagraphProperties, G as changeListLevel, H as isList$1, I as updateNumberingProperties, L as ListHelpers, J as inputRulesPlugin, K as TrackDeleteMarkName$1, O as TrackInsertMarkName$1, Q as TrackFormatMarkName$1, U as AddMarkStep, V as RemoveMarkStep, W as CommandService, S as SuperConverter, X as EditorState, Y as unflattenListsInHtml, Z as SelectionRange, _ as Transform, $ as createOoxmlResolver, a0 as translator, a1 as translator$1, a2 as resolveDocxFontFamily, a3 as combineIndentProperties, a4 as _getReferencedTableStyles, a5 as decodeRPrFromMarks, a6 as calculateResolvedParagraphProperties, a7 as encodeCSSFromPPr, a8 as encodeCSSFromRPr, a9 as generateOrderedListIndex, aa as docxNumberingHelpers, ab as InputRule, ac as insertNewRelationship, ad as kebabCase$1, ae as getUnderlineCssString } from "./SuperConverter-
|
|
3
|
+
import { g as generateDocxRandomId, T as TextSelection$1, o as objectIncludes, w as wrapTextsInRuns, D as DOMParser$1, c as createDocFromMarkdown, a as createDocFromHTML, b as chainableEditorState, d as convertMarkdownToHTML, f as findParentNode, e as findParentNodeClosestToPos, h as generateRandom32BitHex, i as generateRandomSigned32BitIntStrId, P as PluginKey, j as Plugin, M as Mapping, N as NodeSelection, k as Selection, l as Slice, m as DOMSerializer, F as Fragment, n as Mark$1, p as dropPoint, A as AllSelection, q as Schema$1, s as canSplit, t as resolveRunProperties, u as encodeMarksFromRPr, v as liftTarget, x as canJoin, y as joinPoint, z as replaceStep$1, R as ReplaceAroundStep$1, B as htmlHandler, C as ReplaceStep, E as getResolvedParagraphProperties, G as changeListLevel, H as isList$1, I as updateNumberingProperties, L as ListHelpers, J as inputRulesPlugin, K as TrackDeleteMarkName$1, O as TrackInsertMarkName$1, Q as TrackFormatMarkName$1, U as AddMarkStep, V as RemoveMarkStep, W as CommandService, S as SuperConverter, X as EditorState, Y as unflattenListsInHtml, Z as SelectionRange, _ as Transform, $ as createOoxmlResolver, a0 as translator, a1 as translator$1, a2 as resolveDocxFontFamily, a3 as combineIndentProperties, a4 as _getReferencedTableStyles, a5 as decodeRPrFromMarks, a6 as calculateResolvedParagraphProperties, a7 as encodeCSSFromPPr, a8 as encodeCSSFromRPr, a9 as generateOrderedListIndex, aa as docxNumberingHelpers, ab as InputRule, ac as insertNewRelationship, ad as kebabCase$1, ae as getUnderlineCssString } from "./SuperConverter-DxlpZQZQ.es.js";
|
|
4
4
|
import { p as process$1, r as ref, C as global$1, c as computed, E as createElementBlock, F as Fragment$1, S as renderList, O as withModifiers, G as openBlock, P as normalizeClass, M as createCommentVNode, H as toDisplayString, K as createBaseVNode, U as createApp, f as onMounted, X as onUnmounted, R as withDirectives, v as unref, Y as vModelText, y as nextTick, L as normalizeStyle, u as watch, Z as withKeys, _ as createTextVNode, I as createVNode, h, $ as readonly, s as getCurrentInstance, o as onBeforeUnmount, j as reactive, b as onBeforeMount, i as inject, a0 as onActivated, a1 as onDeactivated, a2 as Comment, d as defineComponent, a as provide, g as Teleport, t as toRef, a3 as renderSlot, a4 as isVNode, D as shallowRef, w as watchEffect, T as Transition, a5 as mergeProps, a6 as vShow, a7 as cloneVNode, a8 as Text$2, m as markRaw, N as createBlock, J as withCtx, a9 as useCssVars, V as resolveDynamicComponent, aa as normalizeProps, ab as guardReactiveProps } from "./vue-BnBKJwCW.es.js";
|
|
5
5
|
import "./jszip.min-DCl8qkFO.es.js";
|
|
6
6
|
import { E as EventEmitter$1 } from "./eventemitter3-CwrdEv8r.es.js";
|
|
@@ -15440,7 +15440,7 @@ const canUseDOM = () => {
|
|
|
15440
15440
|
return false;
|
|
15441
15441
|
}
|
|
15442
15442
|
};
|
|
15443
|
-
const summaryVersion = "1.
|
|
15443
|
+
const summaryVersion = "1.4.0-next.2";
|
|
15444
15444
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
15445
15445
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
15446
15446
|
function mapAttributes(attrs) {
|
|
@@ -18072,7 +18072,7 @@ class Editor extends EventEmitter {
|
|
|
18072
18072
|
* Process collaboration migrations
|
|
18073
18073
|
*/
|
|
18074
18074
|
processCollaborationMigrations() {
|
|
18075
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.
|
|
18075
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.4.0-next.2");
|
|
18076
18076
|
if (!this.options.ydoc) return;
|
|
18077
18077
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
18078
18078
|
let docVersion = metaMap.get("version");
|
|
@@ -23805,6 +23805,9 @@ const renderTableCell = (deps) => {
|
|
|
23805
23805
|
imgEl.style.width = "100%";
|
|
23806
23806
|
imgEl.style.height = "100%";
|
|
23807
23807
|
imgEl.style.objectFit = block.objectFit ?? "contain";
|
|
23808
|
+
if (block.objectFit === "cover") {
|
|
23809
|
+
imgEl.style.objectPosition = "left top";
|
|
23810
|
+
}
|
|
23808
23811
|
imgEl.style.display = "block";
|
|
23809
23812
|
imageWrapper.appendChild(imgEl);
|
|
23810
23813
|
content.appendChild(imageWrapper);
|
|
@@ -23834,6 +23837,9 @@ const renderTableCell = (deps) => {
|
|
|
23834
23837
|
img.style.width = "100%";
|
|
23835
23838
|
img.style.height = "100%";
|
|
23836
23839
|
img.style.objectFit = block.objectFit ?? "contain";
|
|
23840
|
+
if (block.objectFit === "cover") {
|
|
23841
|
+
img.style.objectPosition = "left top";
|
|
23842
|
+
}
|
|
23837
23843
|
drawingInner.appendChild(img);
|
|
23838
23844
|
} else if (renderDrawingContent) {
|
|
23839
23845
|
const drawingContent = renderDrawingContent(block);
|
|
@@ -26405,7 +26411,7 @@ class DomPainter {
|
|
|
26405
26411
|
if (fragment.pmEnd != null) {
|
|
26406
26412
|
fragmentEl.dataset.pmEnd = String(fragment.pmEnd);
|
|
26407
26413
|
}
|
|
26408
|
-
if (fragment.metadata) {
|
|
26414
|
+
if (fragment.metadata && !block.attrs?.vmlWatermark) {
|
|
26409
26415
|
fragmentEl.setAttribute("data-image-metadata", JSON.stringify(fragment.metadata));
|
|
26410
26416
|
}
|
|
26411
26417
|
const img = this.doc.createElement("img");
|
|
@@ -26416,7 +26422,28 @@ class DomPainter {
|
|
|
26416
26422
|
img.style.width = "100%";
|
|
26417
26423
|
img.style.height = "100%";
|
|
26418
26424
|
img.style.objectFit = block.objectFit ?? "contain";
|
|
26425
|
+
if (block.objectFit === "cover") {
|
|
26426
|
+
img.style.objectPosition = "left top";
|
|
26427
|
+
}
|
|
26419
26428
|
img.style.display = block.display === "inline" ? "inline-block" : "block";
|
|
26429
|
+
const filters = [];
|
|
26430
|
+
if (block.gain != null || block.blacklevel != null) {
|
|
26431
|
+
if (block.gain && typeof block.gain === "string" && block.gain.endsWith("f")) {
|
|
26432
|
+
const contrast = Math.max(0, parseInt(block.gain) / 65536);
|
|
26433
|
+
if (contrast > 0) {
|
|
26434
|
+
filters.push(`contrast(${contrast})`);
|
|
26435
|
+
}
|
|
26436
|
+
}
|
|
26437
|
+
if (block.blacklevel && typeof block.blacklevel === "string" && block.blacklevel.endsWith("f")) {
|
|
26438
|
+
const brightness = Math.max(0, 1 + parseInt(block.blacklevel) / 327 / 100) + 0.5;
|
|
26439
|
+
if (brightness > 0) {
|
|
26440
|
+
filters.push(`brightness(${brightness})`);
|
|
26441
|
+
}
|
|
26442
|
+
}
|
|
26443
|
+
if (filters.length > 0) {
|
|
26444
|
+
img.style.filter = filters.join(" ");
|
|
26445
|
+
}
|
|
26446
|
+
}
|
|
26420
26447
|
fragmentEl.appendChild(img);
|
|
26421
26448
|
return fragmentEl;
|
|
26422
26449
|
} catch (error) {
|
|
@@ -26496,6 +26523,9 @@ class DomPainter {
|
|
|
26496
26523
|
img.style.width = "100%";
|
|
26497
26524
|
img.style.height = "100%";
|
|
26498
26525
|
img.style.objectFit = drawing.objectFit ?? "contain";
|
|
26526
|
+
if (drawing.objectFit === "cover") {
|
|
26527
|
+
img.style.objectPosition = "left top";
|
|
26528
|
+
}
|
|
26499
26529
|
img.style.display = "block";
|
|
26500
26530
|
return img;
|
|
26501
26531
|
}
|
|
@@ -31246,13 +31276,8 @@ function computeAnchorX(anchor, columnIndex, columns, imageWidth, margins, pageW
|
|
|
31246
31276
|
let baseX;
|
|
31247
31277
|
let availableWidth;
|
|
31248
31278
|
if (relativeFrom === "page") {
|
|
31249
|
-
|
|
31250
|
-
|
|
31251
|
-
availableWidth = contentWidth;
|
|
31252
|
-
} else {
|
|
31253
|
-
baseX = 0;
|
|
31254
|
-
availableWidth = pageWidth != null ? pageWidth : contentWidth;
|
|
31255
|
-
}
|
|
31279
|
+
baseX = 0;
|
|
31280
|
+
availableWidth = pageWidth != null ? pageWidth : contentWidth + marginLeft + marginRight;
|
|
31256
31281
|
} else if (relativeFrom === "margin") {
|
|
31257
31282
|
baseX = contentLeft;
|
|
31258
31283
|
availableWidth = contentWidth;
|
|
@@ -32741,7 +32766,9 @@ function collectPreRegisteredAnchors(blocks, measures) {
|
|
|
32741
32766
|
if (!isImage && !isDrawing) continue;
|
|
32742
32767
|
const drawingBlock = block;
|
|
32743
32768
|
const drawingMeasure = measure;
|
|
32744
|
-
if (!drawingBlock.anchor?.isAnchored)
|
|
32769
|
+
if (!drawingBlock.anchor?.isAnchored) {
|
|
32770
|
+
continue;
|
|
32771
|
+
}
|
|
32745
32772
|
if (isPageRelativeAnchor(drawingBlock)) {
|
|
32746
32773
|
result.push({ block: drawingBlock, measure: drawingMeasure });
|
|
32747
32774
|
}
|
|
@@ -41851,7 +41878,13 @@ const spacingPxToPt = (spacing) => {
|
|
|
41851
41878
|
const result = {};
|
|
41852
41879
|
if (spacing.before != null) result.before = pxToPt(spacing.before);
|
|
41853
41880
|
if (spacing.after != null) result.after = pxToPt(spacing.after);
|
|
41854
|
-
if (spacing.line != null)
|
|
41881
|
+
if (spacing.line != null) {
|
|
41882
|
+
if (spacing.lineRule === "auto" && spacing.line > 0 && spacing.line <= MAX_AUTO_LINE_MULTIPLIER) {
|
|
41883
|
+
result.line = spacing.line;
|
|
41884
|
+
} else {
|
|
41885
|
+
result.line = pxToPt(spacing.line);
|
|
41886
|
+
}
|
|
41887
|
+
}
|
|
41855
41888
|
if (spacing.lineRule) result.lineRule = spacing.lineRule;
|
|
41856
41889
|
return result;
|
|
41857
41890
|
};
|
|
@@ -41875,8 +41908,13 @@ const spacingPtToPx = (spacing, rawSpacing) => {
|
|
|
41875
41908
|
if (after != null) result.after = after;
|
|
41876
41909
|
}
|
|
41877
41910
|
if (rawSpacing.line != null) {
|
|
41878
|
-
const
|
|
41879
|
-
if (
|
|
41911
|
+
const isAutoMultiplier = spacing.lineRule === "auto" && spacing.line != null && spacing.line > 0 && spacing.line <= MAX_AUTO_LINE_MULTIPLIER;
|
|
41912
|
+
if (isAutoMultiplier) {
|
|
41913
|
+
result.line = spacing.line;
|
|
41914
|
+
} else {
|
|
41915
|
+
const line = ptToPx(spacing.line);
|
|
41916
|
+
if (line != null) result.line = line;
|
|
41917
|
+
}
|
|
41880
41918
|
if (spacing.lineRule) result.lineRule = spacing.lineRule;
|
|
41881
41919
|
}
|
|
41882
41920
|
}
|
|
@@ -41956,7 +41994,7 @@ const normalizeLineValue = (value, lineRule) => {
|
|
|
41956
41994
|
if (value > 0 && value <= MAX_AUTO_LINE_MULTIPLIER) {
|
|
41957
41995
|
return value;
|
|
41958
41996
|
}
|
|
41959
|
-
return
|
|
41997
|
+
return value / 240;
|
|
41960
41998
|
}
|
|
41961
41999
|
return twipsToPx$1(value);
|
|
41962
42000
|
};
|
|
@@ -45878,8 +45916,9 @@ function imageNodeToBlock(node, nextBlockId, positions, _trackedMeta, _trackedCh
|
|
|
45878
45916
|
const isInline2 = normalizedWrap?.type === "Inline" || typeof attrs.inline === "boolean" && attrs.inline;
|
|
45879
45917
|
const display = explicitDisplay === "inline" || explicitDisplay === "block" ? explicitDisplay : isInline2 ? "inline" : "block";
|
|
45880
45918
|
const explicitObjectFit = typeof attrs.objectFit === "string" ? attrs.objectFit : void 0;
|
|
45919
|
+
const shouldCover = attrs.shouldCover === true;
|
|
45881
45920
|
const isAnchor = anchor?.isAnchored ?? (typeof attrs.isAnchor === "boolean" ? attrs.isAnchor : false);
|
|
45882
|
-
const objectFit = isAllowedObjectFit(explicitObjectFit) ? explicitObjectFit : display === "inline" ? "scale-down" : isAnchor ? "contain" : "contain";
|
|
45921
|
+
const objectFit = isAllowedObjectFit(explicitObjectFit) ? explicitObjectFit : shouldCover ? "cover" : display === "inline" ? "scale-down" : isAnchor ? "contain" : "contain";
|
|
45883
45922
|
return {
|
|
45884
45923
|
kind: "image",
|
|
45885
45924
|
id: nextBlockId("image"),
|
|
@@ -45894,7 +45933,10 @@ function imageNodeToBlock(node, nextBlockId, positions, _trackedMeta, _trackedCh
|
|
|
45894
45933
|
margin: toBoxSpacing(attrs.marginOffset),
|
|
45895
45934
|
anchor,
|
|
45896
45935
|
wrap: normalizedWrap,
|
|
45897
|
-
attrs: attrsWithPm
|
|
45936
|
+
attrs: attrsWithPm,
|
|
45937
|
+
// VML image adjustments for watermark effects
|
|
45938
|
+
gain: typeof attrs.gain === "string" || typeof attrs.gain === "number" ? attrs.gain : void 0,
|
|
45939
|
+
blacklevel: typeof attrs.blacklevel === "string" || typeof attrs.blacklevel === "number" ? attrs.blacklevel : void 0
|
|
45898
45940
|
};
|
|
45899
45941
|
}
|
|
45900
45942
|
function handleImageNode(node, context) {
|
|
@@ -49844,11 +49886,13 @@ async function measureImageBlock(block, constraints) {
|
|
|
49844
49886
|
const intrinsic = getIntrinsicImageSize(block, constraints.maxWidth);
|
|
49845
49887
|
const isBlockBehindDoc = block.anchor?.behindDoc;
|
|
49846
49888
|
const isBlockWrapBehindDoc = block.wrap?.type === "None" && block.wrap?.behindDoc;
|
|
49847
|
-
const
|
|
49889
|
+
const isPageRelativeAnchor2 = block.anchor?.isAnchored && (block.anchor?.hRelativeFrom === "page" || block.anchor?.hRelativeFrom === "margin");
|
|
49890
|
+
const bypassWidthConstraint = isBlockBehindDoc || isBlockWrapBehindDoc || isPageRelativeAnchor2;
|
|
49848
49891
|
const isWidthConstraintBypassed = bypassWidthConstraint || constraints.maxWidth <= 0;
|
|
49849
49892
|
const maxWidth = isWidthConstraintBypassed ? intrinsic.width : constraints.maxWidth;
|
|
49850
49893
|
const hasNegativeVerticalPosition = block.anchor?.isAnchored && (typeof block.anchor?.offsetV === "number" && block.anchor.offsetV < 0 || typeof block.margin?.top === "number" && block.margin.top < 0);
|
|
49851
|
-
const
|
|
49894
|
+
const shouldBypassHeightConstraint = hasNegativeVerticalPosition || block.objectFit === "cover";
|
|
49895
|
+
const maxHeight = shouldBypassHeightConstraint || !constraints.maxHeight || constraints.maxHeight <= 0 ? Infinity : constraints.maxHeight;
|
|
49852
49896
|
const widthScale = maxWidth / intrinsic.width;
|
|
49853
49897
|
const heightScale = maxHeight / intrinsic.height;
|
|
49854
49898
|
const scale = Math.min(1, widthScale, heightScale);
|
|
@@ -50097,7 +50141,8 @@ const resolveLineHeight = (spacing, baseLineHeight) => {
|
|
|
50097
50141
|
return baseLineHeight;
|
|
50098
50142
|
}
|
|
50099
50143
|
const raw = spacing.line;
|
|
50100
|
-
const
|
|
50144
|
+
const isAuto = spacing.lineRule === "auto";
|
|
50145
|
+
const treatAsMultiplier = (isAuto || spacing.lineRule == null) && raw > 0 && (isAuto || raw <= 10);
|
|
50101
50146
|
if (treatAsMultiplier) {
|
|
50102
50147
|
return raw * baseLineHeight;
|
|
50103
50148
|
}
|
|
@@ -50444,6 +50489,8 @@ class PresentationEditor extends EventEmitter {
|
|
|
50444
50489
|
debugLabel: options.layoutEngineOptions?.debugLabel,
|
|
50445
50490
|
layoutMode: options.layoutEngineOptions?.layoutMode ?? "vertical",
|
|
50446
50491
|
trackedChanges: options.layoutEngineOptions?.trackedChanges,
|
|
50492
|
+
emitCommentPositionsInViewing: options.layoutEngineOptions?.emitCommentPositionsInViewing,
|
|
50493
|
+
enableCommentsInViewing: options.layoutEngineOptions?.enableCommentsInViewing,
|
|
50447
50494
|
presence: validatedPresence
|
|
50448
50495
|
};
|
|
50449
50496
|
this.#trackedChangesOverrides = options.layoutEngineOptions?.trackedChanges;
|
|
@@ -51032,6 +51079,33 @@ class PresentationEditor extends EventEmitter {
|
|
|
51032
51079
|
this.#scheduleRerender();
|
|
51033
51080
|
}
|
|
51034
51081
|
}
|
|
51082
|
+
/**
|
|
51083
|
+
* Update viewing-mode comment rendering behavior and re-render if needed.
|
|
51084
|
+
*
|
|
51085
|
+
* @param options - Viewing mode comment options.
|
|
51086
|
+
*/
|
|
51087
|
+
setViewingCommentOptions(options = {}) {
|
|
51088
|
+
if (options !== void 0 && (typeof options !== "object" || options === null || Array.isArray(options))) {
|
|
51089
|
+
throw new TypeError("[PresentationEditor] setViewingCommentOptions expects an object or undefined");
|
|
51090
|
+
}
|
|
51091
|
+
let hasChanges = false;
|
|
51092
|
+
if (typeof options.emitCommentPositionsInViewing === "boolean") {
|
|
51093
|
+
if (this.#layoutOptions.emitCommentPositionsInViewing !== options.emitCommentPositionsInViewing) {
|
|
51094
|
+
this.#layoutOptions.emitCommentPositionsInViewing = options.emitCommentPositionsInViewing;
|
|
51095
|
+
hasChanges = true;
|
|
51096
|
+
}
|
|
51097
|
+
}
|
|
51098
|
+
if (typeof options.enableCommentsInViewing === "boolean") {
|
|
51099
|
+
if (this.#layoutOptions.enableCommentsInViewing !== options.enableCommentsInViewing) {
|
|
51100
|
+
this.#layoutOptions.enableCommentsInViewing = options.enableCommentsInViewing;
|
|
51101
|
+
hasChanges = true;
|
|
51102
|
+
}
|
|
51103
|
+
}
|
|
51104
|
+
if (hasChanges) {
|
|
51105
|
+
this.#pendingDocChange = true;
|
|
51106
|
+
this.#scheduleRerender();
|
|
51107
|
+
}
|
|
51108
|
+
}
|
|
51035
51109
|
/**
|
|
51036
51110
|
* Toggle the custom context menu at runtime to respect host-level guardrails.
|
|
51037
51111
|
*/
|
|
@@ -53413,7 +53487,7 @@ class PresentationEditor extends EventEmitter {
|
|
|
53413
53487
|
} : void 0;
|
|
53414
53488
|
const atomNodeTypes = getAtomNodeTypes(this.#editor?.schema ?? null);
|
|
53415
53489
|
const positionMap = this.#editor?.state?.doc && docJson ? buildPositionMapFromPmDoc(this.#editor.state.doc, docJson) : null;
|
|
53416
|
-
const commentsEnabled = this.#documentMode !== "viewing";
|
|
53490
|
+
const commentsEnabled = this.#documentMode !== "viewing" || this.#layoutOptions.enableCommentsInViewing === true;
|
|
53417
53491
|
const result = toFlowBlocks(docJson, {
|
|
53418
53492
|
mediaFiles: this.#editor?.storage?.image?.media,
|
|
53419
53493
|
emitSectionBreaks: true,
|
|
@@ -53553,7 +53627,8 @@ class PresentationEditor extends EventEmitter {
|
|
|
53553
53627
|
const payload = { layout, blocks, measures, metrics };
|
|
53554
53628
|
this.emit("layoutUpdated", payload);
|
|
53555
53629
|
this.emit("paginationUpdate", payload);
|
|
53556
|
-
|
|
53630
|
+
const allowViewingCommentPositions = this.#layoutOptions.emitCommentPositionsInViewing === true;
|
|
53631
|
+
if (this.#documentMode !== "viewing" || allowViewingCommentPositions) {
|
|
53557
53632
|
const commentPositions = this.#collectCommentPositions();
|
|
53558
53633
|
const positionKeys = Object.keys(commentPositions);
|
|
53559
53634
|
if (positionKeys.length > 0) {
|
|
@@ -64479,18 +64554,18 @@ const Image = Node$1.create({
|
|
|
64479
64554
|
// Used during DOCX export to restore the original metafile format.
|
|
64480
64555
|
originalExtension: { rendered: false },
|
|
64481
64556
|
originalSrc: { rendered: false },
|
|
64482
|
-
|
|
64557
|
+
shouldCover: {
|
|
64483
64558
|
default: false,
|
|
64484
64559
|
rendered: false
|
|
64485
64560
|
},
|
|
64486
64561
|
size: {
|
|
64487
64562
|
default: {},
|
|
64488
|
-
renderDOM: ({ size: size2,
|
|
64563
|
+
renderDOM: ({ size: size2, shouldCover }) => {
|
|
64489
64564
|
let style2 = "";
|
|
64490
64565
|
let { width, height } = size2 ?? {};
|
|
64491
64566
|
if (width) style2 += `width: ${width}px;`;
|
|
64492
|
-
if (height &&
|
|
64493
|
-
style2 += `height: ${height}px; object-fit:
|
|
64567
|
+
if (height && shouldCover) {
|
|
64568
|
+
style2 += `height: ${height}px; object-fit: cover; object-position: left top;`;
|
|
64494
64569
|
} else if (height) style2 += "height: auto;";
|
|
64495
64570
|
return { style: style2 };
|
|
64496
64571
|
}
|
|
@@ -72773,6 +72848,9 @@ const nodeResizer = (nodeNames = ["image"], editor) => {
|
|
|
72773
72848
|
if (!node || !nodeNames.includes(node.type.name)) {
|
|
72774
72849
|
return DecorationSet.empty;
|
|
72775
72850
|
}
|
|
72851
|
+
if (node.attrs?.vmlWatermark === true) {
|
|
72852
|
+
return DecorationSet.empty;
|
|
72853
|
+
}
|
|
72776
72854
|
const decorations = [];
|
|
72777
72855
|
if (nodeNames.includes(selection.node?.type.name)) {
|
|
72778
72856
|
decorations.push(
|
|
@@ -72855,6 +72933,7 @@ const nodeResizer = (nodeNames = ["image"], editor) => {
|
|
|
72855
72933
|
const pos = Number.parseInt(wrapper.getAttribute("data-pos"), 10);
|
|
72856
72934
|
const node = view.state.doc.nodeAt(pos);
|
|
72857
72935
|
if (!nodeNames.includes(node?.type.name)) return;
|
|
72936
|
+
if (node?.attrs?.vmlWatermark === true) return;
|
|
72858
72937
|
currentWrapper = wrapper;
|
|
72859
72938
|
resizeContainer = document.createElement("div");
|
|
72860
72939
|
resizeContainer.className = "sd-editor-resize-container";
|
package/dist/style.css
CHANGED
|
@@ -2420,23 +2420,23 @@ span[data-v-53e13009] {
|
|
|
2420
2420
|
background-color: #1355ff7f;
|
|
2421
2421
|
}
|
|
2422
2422
|
|
|
2423
|
-
.comment-doc[data-v-
|
|
2423
|
+
.comment-doc[data-v-7d21d613] {
|
|
2424
2424
|
position: relative;
|
|
2425
2425
|
}
|
|
2426
|
-
.comments-layer[data-v-
|
|
2426
|
+
.comments-layer[data-v-7d21d613] {
|
|
2427
2427
|
position: relative;
|
|
2428
2428
|
}
|
|
2429
|
-
.sd-comment-anchor[data-v-
|
|
2429
|
+
.sd-comment-anchor[data-v-7d21d613] {
|
|
2430
2430
|
position: absolute;
|
|
2431
2431
|
cursor: pointer;
|
|
2432
2432
|
z-index: 3;
|
|
2433
2433
|
border-radius: 4px;
|
|
2434
2434
|
transition: background-color 250ms ease;
|
|
2435
2435
|
}
|
|
2436
|
-
.bypass[data-v-
|
|
2436
|
+
.bypass[data-v-7d21d613] {
|
|
2437
2437
|
display: none;
|
|
2438
2438
|
}
|
|
2439
|
-
.comments-container[data-v-
|
|
2439
|
+
.comments-container[data-v-7d21d613] {
|
|
2440
2440
|
/* pointer-events: none; */
|
|
2441
2441
|
}
|
|
2442
2442
|
|
|
@@ -2559,46 +2559,46 @@ img[data-v-7dd69850] {
|
|
|
2559
2559
|
display: none;
|
|
2560
2560
|
}
|
|
2561
2561
|
|
|
2562
|
-
.superdoc[data-v-
|
|
2562
|
+
.superdoc[data-v-78737564] {
|
|
2563
2563
|
display: flex;
|
|
2564
2564
|
}
|
|
2565
|
-
.right-sidebar[data-v-
|
|
2565
|
+
.right-sidebar[data-v-78737564] {
|
|
2566
2566
|
min-width: 320px;
|
|
2567
2567
|
}
|
|
2568
|
-
.floating-comments[data-v-
|
|
2568
|
+
.floating-comments[data-v-78737564] {
|
|
2569
2569
|
min-width: 300px;
|
|
2570
2570
|
width: 300px;
|
|
2571
2571
|
}
|
|
2572
|
-
.superdoc__layers[data-v-
|
|
2572
|
+
.superdoc__layers[data-v-78737564] {
|
|
2573
2573
|
height: 100%;
|
|
2574
2574
|
position: relative;
|
|
2575
2575
|
box-sizing: border-box;
|
|
2576
2576
|
}
|
|
2577
|
-
.superdoc__document[data-v-
|
|
2577
|
+
.superdoc__document[data-v-78737564] {
|
|
2578
2578
|
width: 100%;
|
|
2579
2579
|
position: relative;
|
|
2580
2580
|
}
|
|
2581
|
-
.superdoc__sub-document[data-v-
|
|
2581
|
+
.superdoc__sub-document[data-v-78737564] {
|
|
2582
2582
|
width: 100%;
|
|
2583
2583
|
position: relative;
|
|
2584
2584
|
}
|
|
2585
|
-
.superdoc__selection-layer[data-v-
|
|
2585
|
+
.superdoc__selection-layer[data-v-78737564] {
|
|
2586
2586
|
position: absolute;
|
|
2587
2587
|
min-width: 100%;
|
|
2588
2588
|
min-height: 100%;
|
|
2589
2589
|
z-index: 10;
|
|
2590
2590
|
pointer-events: none;
|
|
2591
2591
|
}
|
|
2592
|
-
.superdoc__temp-selection[data-v-
|
|
2592
|
+
.superdoc__temp-selection[data-v-78737564] {
|
|
2593
2593
|
position: absolute;
|
|
2594
2594
|
}
|
|
2595
|
-
.superdoc__comments-layer[data-v-
|
|
2595
|
+
.superdoc__comments-layer[data-v-78737564] {
|
|
2596
2596
|
/* position: absolute; */
|
|
2597
2597
|
top: 0;
|
|
2598
2598
|
height: 100%;
|
|
2599
2599
|
position: relative;
|
|
2600
2600
|
}
|
|
2601
|
-
.superdoc__right-sidebar[data-v-
|
|
2601
|
+
.superdoc__right-sidebar[data-v-78737564] {
|
|
2602
2602
|
width: 320px;
|
|
2603
2603
|
min-width: 320px;
|
|
2604
2604
|
padding: 0 10px;
|
|
@@ -2608,14 +2608,14 @@ img[data-v-7dd69850] {
|
|
|
2608
2608
|
}
|
|
2609
2609
|
|
|
2610
2610
|
/* Tools styles */
|
|
2611
|
-
.tools[data-v-
|
|
2611
|
+
.tools[data-v-78737564] {
|
|
2612
2612
|
position: absolute;
|
|
2613
2613
|
z-index: 3;
|
|
2614
2614
|
display: flex;
|
|
2615
2615
|
flex-direction: column;
|
|
2616
2616
|
gap: 6px;
|
|
2617
2617
|
}
|
|
2618
|
-
.tools .tool-icon[data-v-
|
|
2618
|
+
.tools .tool-icon[data-v-78737564] {
|
|
2619
2619
|
font-size: 20px;
|
|
2620
2620
|
border-radius: 12px;
|
|
2621
2621
|
border: none;
|
|
@@ -2623,7 +2623,7 @@ img[data-v-7dd69850] {
|
|
|
2623
2623
|
background-color: #dbdbdb;
|
|
2624
2624
|
cursor: pointer;
|
|
2625
2625
|
}
|
|
2626
|
-
.tools-item[data-v-
|
|
2626
|
+
.tools-item[data-v-78737564] {
|
|
2627
2627
|
display: flex;
|
|
2628
2628
|
align-items: center;
|
|
2629
2629
|
justify-content: center;
|
|
@@ -2633,10 +2633,10 @@ img[data-v-7dd69850] {
|
|
|
2633
2633
|
border-radius: 12px;
|
|
2634
2634
|
cursor: pointer;
|
|
2635
2635
|
}
|
|
2636
|
-
.tools-item i[data-v-
|
|
2636
|
+
.tools-item i[data-v-78737564] {
|
|
2637
2637
|
cursor: pointer;
|
|
2638
2638
|
}
|
|
2639
|
-
.superdoc__tools-icon[data-v-
|
|
2639
|
+
.superdoc__tools-icon[data-v-78737564] {
|
|
2640
2640
|
width: 20px;
|
|
2641
2641
|
height: 20px;
|
|
2642
2642
|
flex-shrink: 0;
|
|
@@ -2651,15 +2651,15 @@ img[data-v-7dd69850] {
|
|
|
2651
2651
|
|
|
2652
2652
|
/* 834px is iPad screen size in portrait orientation */
|
|
2653
2653
|
@media (max-width: 834px) {
|
|
2654
|
-
.superdoc .superdoc__layers[data-v-
|
|
2654
|
+
.superdoc .superdoc__layers[data-v-78737564] {
|
|
2655
2655
|
margin: 0;
|
|
2656
2656
|
border: 0 !important;
|
|
2657
2657
|
box-shadow: none;
|
|
2658
2658
|
}
|
|
2659
|
-
.superdoc__sub-document[data-v-
|
|
2659
|
+
.superdoc__sub-document[data-v-78737564] {
|
|
2660
2660
|
max-width: 100%;
|
|
2661
2661
|
}
|
|
2662
|
-
.superdoc__right-sidebar[data-v-
|
|
2662
|
+
.superdoc__right-sidebar[data-v-78737564] {
|
|
2663
2663
|
padding: 10px;
|
|
2664
2664
|
width: 55px;
|
|
2665
2665
|
position: relative;
|
|
@@ -2667,7 +2667,7 @@ img[data-v-7dd69850] {
|
|
|
2667
2667
|
}
|
|
2668
2668
|
|
|
2669
2669
|
/* AI Writer styles */
|
|
2670
|
-
.ai-writer-container[data-v-
|
|
2670
|
+
.ai-writer-container[data-v-78737564] {
|
|
2671
2671
|
position: fixed;
|
|
2672
2672
|
z-index: 1000;
|
|
2673
2673
|
background: white;
|
|
@@ -2685,13 +2685,13 @@ img[data-v-7dd69850] {
|
|
|
2685
2685
|
} */
|
|
2686
2686
|
|
|
2687
2687
|
/* Tools styles */
|
|
2688
|
-
.tools[data-v-
|
|
2688
|
+
.tools[data-v-78737564] {
|
|
2689
2689
|
position: absolute;
|
|
2690
2690
|
z-index: 3;
|
|
2691
2691
|
display: flex;
|
|
2692
2692
|
gap: 6px;
|
|
2693
2693
|
}
|
|
2694
|
-
.tools .tool-icon[data-v-
|
|
2694
|
+
.tools .tool-icon[data-v-78737564] {
|
|
2695
2695
|
font-size: 20px;
|
|
2696
2696
|
border-radius: 12px;
|
|
2697
2697
|
border: none;
|
|
@@ -2699,7 +2699,7 @@ img[data-v-7dd69850] {
|
|
|
2699
2699
|
background-color: #dbdbdb;
|
|
2700
2700
|
cursor: pointer;
|
|
2701
2701
|
}
|
|
2702
|
-
.tools-item[data-v-
|
|
2702
|
+
.tools-item[data-v-78737564] {
|
|
2703
2703
|
display: flex;
|
|
2704
2704
|
align-items: center;
|
|
2705
2705
|
justify-content: center;
|
|
@@ -2710,18 +2710,18 @@ img[data-v-7dd69850] {
|
|
|
2710
2710
|
border-radius: 12px;
|
|
2711
2711
|
cursor: pointer;
|
|
2712
2712
|
}
|
|
2713
|
-
.tools-item i[data-v-
|
|
2713
|
+
.tools-item i[data-v-78737564] {
|
|
2714
2714
|
cursor: pointer;
|
|
2715
2715
|
}
|
|
2716
|
-
.superdoc__tools-icon[data-v-
|
|
2716
|
+
.superdoc__tools-icon[data-v-78737564] {
|
|
2717
2717
|
width: 20px;
|
|
2718
2718
|
height: 20px;
|
|
2719
2719
|
flex-shrink: 0;
|
|
2720
2720
|
}
|
|
2721
|
-
.ai-tool > svg[data-v-
|
|
2721
|
+
.ai-tool > svg[data-v-78737564] {
|
|
2722
2722
|
fill: transparent;
|
|
2723
2723
|
}
|
|
2724
|
-
.ai-tool[data-v-
|
|
2724
|
+
.ai-tool[data-v-78737564]::before {
|
|
2725
2725
|
content: '';
|
|
2726
2726
|
position: absolute;
|
|
2727
2727
|
width: 20px;
|
|
@@ -2742,7 +2742,7 @@ img[data-v-7dd69850] {
|
|
|
2742
2742
|
filter: brightness(1.2);
|
|
2743
2743
|
transition: filter 0.2s ease;
|
|
2744
2744
|
}
|
|
2745
|
-
.ai-tool[data-v-
|
|
2745
|
+
.ai-tool[data-v-78737564]:hover::before {
|
|
2746
2746
|
filter: brightness(1.3);
|
|
2747
2747
|
}
|
|
2748
2748
|
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
require("../chunks/jszip-C8_CqJxM.cjs");
|
|
4
4
|
require("../chunks/helpers-nOdwpmwb.cjs");
|
|
5
|
-
const superEditor_converter = require("../chunks/SuperConverter-
|
|
5
|
+
const superEditor_converter = require("../chunks/SuperConverter-Dy4wkQEB.cjs");
|
|
6
6
|
require("../chunks/uuid-R7L08bOx.cjs");
|
|
7
7
|
exports.SuperConverter = superEditor_converter.SuperConverter;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunks/jszip-B1fkPkPJ.es.js";
|
|
2
2
|
import "../chunks/helpers-C8e9wR5l.es.js";
|
|
3
|
-
import { S } from "../chunks/SuperConverter-
|
|
3
|
+
import { S } from "../chunks/SuperConverter-DxlpZQZQ.es.js";
|
|
4
4
|
import "../chunks/uuid-CjlX8hrF.es.js";
|
|
5
5
|
export {
|
|
6
6
|
S as SuperConverter
|
package/dist/super-editor.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("./chunks/index-
|
|
3
|
+
const index = require("./chunks/index-DJuBZura.cjs");
|
|
4
4
|
const superEditor_docxZipper = require("./super-editor/docx-zipper.cjs");
|
|
5
5
|
const superEditor_fileZipper = require("./super-editor/file-zipper.cjs");
|
|
6
6
|
const vue = require("./chunks/vue-De9wkgLl.cjs");
|
|
7
|
-
const superEditor_converter = require("./chunks/SuperConverter-
|
|
7
|
+
const superEditor_converter = require("./chunks/SuperConverter-Dy4wkQEB.cjs");
|
|
8
8
|
function isNodeType(node, name) {
|
|
9
9
|
return node.type.name === name;
|
|
10
10
|
}
|
package/dist/super-editor.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ax as Node, ay as Mark } from "./chunks/index-
|
|
2
|
-
import { ao, au, a9, ab, aw, am, av, aA, an, ak, aq, az, aa, as, aC, aE, aB, ac, aD, ar, at } from "./chunks/index-
|
|
1
|
+
import { ax as Node, ay as Mark } from "./chunks/index-dnQEKI-e.es.js";
|
|
2
|
+
import { ao, au, a9, ab, aw, am, av, aA, an, ak, aq, az, aa, as, aC, aE, aB, ac, aD, ar, at } from "./chunks/index-dnQEKI-e.es.js";
|
|
3
3
|
import { default as default2 } from "./super-editor/docx-zipper.es.js";
|
|
4
4
|
import { createZip } from "./super-editor/file-zipper.es.js";
|
|
5
5
|
import { d as defineComponent, E as createElementBlock, G as openBlock, K as createBaseVNode } from "./chunks/vue-BnBKJwCW.es.js";
|
|
6
|
-
import { S, r } from "./chunks/SuperConverter-
|
|
6
|
+
import { S, r } from "./chunks/SuperConverter-DxlpZQZQ.es.js";
|
|
7
7
|
function isNodeType(node, name) {
|
|
8
8
|
return node.type.name === name;
|
|
9
9
|
}
|