@harbour-enterprises/superdoc 0.25.0-next.4 → 0.25.0-next.5
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-BETK3Bs4.cjs → PdfViewer-8kRpbCwn.cjs} +1 -1
- package/dist/chunks/{PdfViewer-D4F3H-Ay.es.js → PdfViewer-DVToyLl3.es.js} +1 -1
- package/dist/chunks/{index-BHS2aLqo.cjs → index-DisCF1vr.cjs} +2 -2
- package/dist/chunks/{index-D9KYAvvg.es.js → index-STsumey2.es.js} +2 -2
- package/dist/chunks/{super-editor.es-BJzqCihw.cjs → super-editor.es-QqtfiJGc.cjs} +148 -129
- package/dist/chunks/{super-editor.es-Beeng5kU.es.js → super-editor.es-rBPknGqQ.es.js} +148 -129
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/super-editor/ai-writer.es.js +1 -1
- package/dist/super-editor/chunks/{editor-DC9ZOqdt.js → editor-BOoGDORN.js} +148 -129
- package/dist/super-editor/chunks/{toolbar-SPGEoEi0.js → toolbar-DPI_cCm_.js} +1 -1
- package/dist/super-editor/editor.es.js +1 -1
- package/dist/super-editor/super-editor/src/core/Editor.d.ts +1 -0
- package/dist/super-editor/super-editor.es.js +3 -3
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +148 -129
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const vue = require("./vue-DKMj1I9B.cjs");
|
|
4
|
-
const superdoc = require("./index-
|
|
4
|
+
const superdoc = require("./index-DisCF1vr.cjs");
|
|
5
5
|
function self(vars) {
|
|
6
6
|
const {
|
|
7
7
|
opacityDisabled,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as defineComponent, B as h, O as Transition, $ as process$1, I as watchEffect, d as computed, r as ref, j as onMounted, W as onUnmounted, c as createElementBlock, o as openBlock, a as createBaseVNode, f as createCommentVNode, v as createVNode, x as unref } from "./vue-ZWZLQtoU.es.js";
|
|
2
|
-
import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-
|
|
2
|
+
import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-STsumey2.es.js";
|
|
3
3
|
function self(vars) {
|
|
4
4
|
const {
|
|
5
5
|
opacityDisabled,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const superEditor_es = require("./super-editor.es-
|
|
2
|
+
const superEditor_es = require("./super-editor.es-QqtfiJGc.cjs");
|
|
3
3
|
const vue = require("./vue-DKMj1I9B.cjs");
|
|
4
4
|
const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
|
|
5
5
|
const eventemitter3 = require("./eventemitter3-DkXkH2rT.cjs");
|
|
@@ -17164,7 +17164,7 @@ const _sfc_main = {
|
|
|
17164
17164
|
__name: "SuperDoc",
|
|
17165
17165
|
emits: ["selection-update"],
|
|
17166
17166
|
setup(__props, { emit: __emit }) {
|
|
17167
|
-
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-
|
|
17167
|
+
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-8kRpbCwn.cjs")));
|
|
17168
17168
|
const superdocStore = useSuperdocStore();
|
|
17169
17169
|
const commentsStore = useCommentsStore();
|
|
17170
17170
|
const {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-
|
|
1
|
+
import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-rBPknGqQ.es.js";
|
|
2
2
|
import { a0 as effectScope, r as ref, _ as markRaw, $ as process$1, a1 as toRaw, d as computed, a2 as isRef, a3 as isReactive, C as toRef, i as inject, p as getCurrentInstance, l as watch, x as unref, a4 as hasInjectionContext, M as reactive, s as nextTick, a5 as getCurrentScope, a6 as onScopeDispose, a7 as toRefs, g as global$1, J as shallowRef, N as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, S as onActivated, q as onDeactivated, z as createTextVNode, F as Fragment, Q as Comment, m as defineComponent, D as provide, H as withDirectives, B as h, U as Teleport, R as renderSlot, V as isVNode, I as watchEffect, O as Transition, a8 as TransitionGroup, E as mergeProps, P as vShow, G as cloneVNode, T as Text, c as createElementBlock, o as openBlock, t as toDisplayString, v as createVNode, y as withCtx, a as createBaseVNode, A as normalizeStyle, f as createCommentVNode, u as createBlock, w as withModifiers, n as normalizeClass, a9 as resolveDirective, e as renderList, b as createApp, X as resolveDynamicComponent, aa as defineAsyncComponent } from "./vue-ZWZLQtoU.es.js";
|
|
3
3
|
import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
|
|
4
4
|
import { E as EventEmitter } from "./eventemitter3-BWEnUdTY.es.js";
|
|
@@ -17147,7 +17147,7 @@ const _sfc_main = {
|
|
|
17147
17147
|
__name: "SuperDoc",
|
|
17148
17148
|
emits: ["selection-update"],
|
|
17149
17149
|
setup(__props, { emit: __emit }) {
|
|
17150
|
-
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-
|
|
17150
|
+
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-DVToyLl3.es.js"));
|
|
17151
17151
|
const superdocStore = useSuperdocStore();
|
|
17152
17152
|
const commentsStore = useCommentsStore();
|
|
17153
17153
|
const {
|
|
@@ -52584,7 +52584,9 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
52584
52584
|
isHeaderFooterChanged: false,
|
|
52585
52585
|
isCustomXmlChanged: false,
|
|
52586
52586
|
focusTarget: null,
|
|
52587
|
-
permissionResolver: null
|
|
52587
|
+
permissionResolver: null,
|
|
52588
|
+
// header/footer editors may have parent(main) editor set
|
|
52589
|
+
parentEditor: null
|
|
52588
52590
|
});
|
|
52589
52591
|
__privateMethod$1(this, _Editor_instances, initContainerElement_fn).call(this, options);
|
|
52590
52592
|
__privateMethod$1(this, _Editor_instances, checkHeadless_fn).call(this, options);
|
|
@@ -64792,58 +64794,6 @@ const registerImages = async (foundImages, editor, view) => {
|
|
|
64792
64794
|
}
|
|
64793
64795
|
});
|
|
64794
64796
|
};
|
|
64795
|
-
const normalizeWrap = (attrs = {}) => {
|
|
64796
|
-
const wrap2 = attrs.wrap;
|
|
64797
|
-
if (wrap2?.type && wrap2.type !== "Inline") {
|
|
64798
|
-
return {
|
|
64799
|
-
type: wrap2.type,
|
|
64800
|
-
attrs: wrap2.attrs ?? {}
|
|
64801
|
-
};
|
|
64802
|
-
}
|
|
64803
|
-
if (wrap2?.type === "Inline" && Object.keys(wrap2.attrs ?? {}).length) {
|
|
64804
|
-
return {
|
|
64805
|
-
type: "Inline",
|
|
64806
|
-
attrs: wrap2.attrs
|
|
64807
|
-
};
|
|
64808
|
-
}
|
|
64809
|
-
if (!wrap2 && attrs.wrapText) {
|
|
64810
|
-
return {
|
|
64811
|
-
type: "Square",
|
|
64812
|
-
attrs: {
|
|
64813
|
-
wrapText: attrs.wrapText
|
|
64814
|
-
}
|
|
64815
|
-
};
|
|
64816
|
-
}
|
|
64817
|
-
if (!wrap2 && attrs.wrapTopAndBottom) {
|
|
64818
|
-
return {
|
|
64819
|
-
type: "TopAndBottom",
|
|
64820
|
-
attrs: {}
|
|
64821
|
-
};
|
|
64822
|
-
}
|
|
64823
|
-
if (wrap2?.type === "Inline") {
|
|
64824
|
-
return {
|
|
64825
|
-
type: "Inline",
|
|
64826
|
-
attrs: wrap2.attrs ?? {}
|
|
64827
|
-
};
|
|
64828
|
-
}
|
|
64829
|
-
return {
|
|
64830
|
-
type: "Inline",
|
|
64831
|
-
attrs: {}
|
|
64832
|
-
};
|
|
64833
|
-
};
|
|
64834
|
-
const normalizeMarginOffset = (marginOffset = {}) => {
|
|
64835
|
-
const { left: left2, horizontal, ...rest } = marginOffset;
|
|
64836
|
-
return {
|
|
64837
|
-
...rest,
|
|
64838
|
-
horizontal: horizontal ?? left2
|
|
64839
|
-
};
|
|
64840
|
-
};
|
|
64841
|
-
const getNormalizedImageAttrs = (attrs = {}) => {
|
|
64842
|
-
return {
|
|
64843
|
-
wrap: normalizeWrap(attrs),
|
|
64844
|
-
marginOffset: normalizeMarginOffset(attrs.marginOffset ?? {})
|
|
64845
|
-
};
|
|
64846
|
-
};
|
|
64847
64797
|
const ImagePositionPluginKey = new PluginKey("ImagePosition");
|
|
64848
64798
|
const ImagePositionPlugin = ({ editor }) => {
|
|
64849
64799
|
const { view } = editor;
|
|
@@ -64856,8 +64806,9 @@ const ImagePositionPlugin = ({ editor }) => {
|
|
|
64856
64806
|
return DecorationSet.empty;
|
|
64857
64807
|
},
|
|
64858
64808
|
apply(tr, oldDecorationSet, oldState, newState) {
|
|
64859
|
-
if (!tr.docChanged) return oldDecorationSet;
|
|
64809
|
+
if (!tr.docChanged && !shouldUpdate) return oldDecorationSet;
|
|
64860
64810
|
const decorations = getImagePositionDecorations(newState, view);
|
|
64811
|
+
shouldUpdate = false;
|
|
64861
64812
|
return DecorationSet.create(newState.doc, decorations);
|
|
64862
64813
|
}
|
|
64863
64814
|
},
|
|
@@ -64866,7 +64817,6 @@ const ImagePositionPlugin = ({ editor }) => {
|
|
|
64866
64817
|
update: (view2, lastState) => {
|
|
64867
64818
|
const pagination = PaginationPluginKey.getState(lastState);
|
|
64868
64819
|
if (shouldUpdate) {
|
|
64869
|
-
shouldUpdate = false;
|
|
64870
64820
|
const decorations = getImagePositionDecorations(lastState, view2);
|
|
64871
64821
|
const updateTransaction = view2.state.tr.setMeta(ImagePositionPluginKey, { decorations });
|
|
64872
64822
|
view2.dispatch(updateTransaction);
|
|
@@ -64892,41 +64842,35 @@ const getImagePositionDecorations = (state2, view) => {
|
|
|
64892
64842
|
let className = "";
|
|
64893
64843
|
const { vRelativeFrom, alignH } = node.attrs.anchorData;
|
|
64894
64844
|
const { size: size2, padding } = node.attrs;
|
|
64895
|
-
const { marginOffset } = getNormalizedImageAttrs(node.attrs);
|
|
64896
64845
|
const pageBreak = findPreviousDomNodeWithClass(view, pos, "pagination-break-wrapper");
|
|
64897
|
-
if (pageBreak) {
|
|
64898
|
-
|
|
64899
|
-
|
|
64900
|
-
|
|
64901
|
-
|
|
64902
|
-
|
|
64903
|
-
|
|
64904
|
-
|
|
64905
|
-
|
|
64906
|
-
|
|
64907
|
-
|
|
64846
|
+
if (pageBreak && vRelativeFrom === "margin" && alignH) {
|
|
64847
|
+
const topPos = pageBreak?.offsetTop + pageBreak?.offsetHeight;
|
|
64848
|
+
let horizontalAlignment = `${alignH}: 0;`;
|
|
64849
|
+
if (alignH === "center") horizontalAlignment = "left: 50%; transform: translateX(-50%);";
|
|
64850
|
+
style2 += vRelativeFrom === "margin" ? `position: absolute; top: ${topPos}px; ${horizontalAlignment}` : "";
|
|
64851
|
+
const nextPos = view.posAtDOM(pageBreak, 1);
|
|
64852
|
+
if (nextPos < 0) {
|
|
64853
|
+
const $pos = view.state.doc.resolve(pos);
|
|
64854
|
+
decorations.push(
|
|
64855
|
+
Decoration.node(pos - 1, pos + $pos.parent.nodeSize - 1, {
|
|
64856
|
+
style: `height: ${size2.height + parseInt(padding.top) + parseInt(padding.bottom)}px`
|
|
64857
|
+
})
|
|
64858
|
+
);
|
|
64908
64859
|
}
|
|
64909
|
-
const
|
|
64910
|
-
|
|
64911
|
-
|
|
64912
|
-
|
|
64913
|
-
|
|
64914
|
-
|
|
64915
|
-
|
|
64916
|
-
|
|
64917
|
-
style: `height: ${size2.height + parseInt(padding.top) + parseInt(padding.bottom)}px`
|
|
64918
|
-
})
|
|
64919
|
-
);
|
|
64920
|
-
}
|
|
64921
|
-
const imageBlock = document.createElement("div");
|
|
64922
|
-
imageBlock.className = "anchor-image-placeholder";
|
|
64923
|
-
imageBlock.style.float = alignH;
|
|
64924
|
-
imageBlock.style.width = size2.width + parseInt(padding[alignH]) + "px";
|
|
64925
|
-
imageBlock.style.height = size2.height + parseInt(padding.top) + parseInt(padding.bottom) + "px";
|
|
64926
|
-
decorations.push(Decoration.widget(nextPos, imageBlock, { key: "stable-key" }));
|
|
64860
|
+
const imageBlock = document.createElement("div");
|
|
64861
|
+
imageBlock.className = "anchor-image-placeholder";
|
|
64862
|
+
imageBlock.style.float = alignH === "left" || alignH === "right" ? alignH : "none";
|
|
64863
|
+
let paddingHorizontal;
|
|
64864
|
+
if (alignH === "center") {
|
|
64865
|
+
paddingHorizontal = (parseInt(padding.left) || 0) + (parseInt(padding.right) || 0);
|
|
64866
|
+
} else {
|
|
64867
|
+
paddingHorizontal = parseInt(padding[alignH]) || 0;
|
|
64927
64868
|
}
|
|
64869
|
+
imageBlock.style.width = size2.width + paddingHorizontal + "px";
|
|
64870
|
+
imageBlock.style.height = size2.height + parseInt(padding.top) + parseInt(padding.bottom) + "px";
|
|
64871
|
+
decorations.push(Decoration.widget(nextPos, imageBlock, { key: "stable-key" }));
|
|
64872
|
+
decorations.push(Decoration.inline(pos, pos + node.nodeSize, { style: style2, class: className }));
|
|
64928
64873
|
}
|
|
64929
|
-
decorations.push(Decoration.inline(pos, pos + node.nodeSize, { style: style2, class: className }));
|
|
64930
64874
|
}
|
|
64931
64875
|
});
|
|
64932
64876
|
return decorations;
|
|
@@ -64951,6 +64895,58 @@ const findPreviousDomNodeWithClass = (view, pos, className) => {
|
|
|
64951
64895
|
}
|
|
64952
64896
|
return null;
|
|
64953
64897
|
};
|
|
64898
|
+
const normalizeWrap = (attrs = {}) => {
|
|
64899
|
+
const wrap2 = attrs.wrap;
|
|
64900
|
+
if (wrap2?.type && wrap2.type !== "Inline") {
|
|
64901
|
+
return {
|
|
64902
|
+
type: wrap2.type,
|
|
64903
|
+
attrs: wrap2.attrs ?? {}
|
|
64904
|
+
};
|
|
64905
|
+
}
|
|
64906
|
+
if (wrap2?.type === "Inline" && Object.keys(wrap2.attrs ?? {}).length) {
|
|
64907
|
+
return {
|
|
64908
|
+
type: "Inline",
|
|
64909
|
+
attrs: wrap2.attrs
|
|
64910
|
+
};
|
|
64911
|
+
}
|
|
64912
|
+
if (!wrap2 && attrs.wrapText) {
|
|
64913
|
+
return {
|
|
64914
|
+
type: "Square",
|
|
64915
|
+
attrs: {
|
|
64916
|
+
wrapText: attrs.wrapText
|
|
64917
|
+
}
|
|
64918
|
+
};
|
|
64919
|
+
}
|
|
64920
|
+
if (!wrap2 && attrs.wrapTopAndBottom) {
|
|
64921
|
+
return {
|
|
64922
|
+
type: "TopAndBottom",
|
|
64923
|
+
attrs: {}
|
|
64924
|
+
};
|
|
64925
|
+
}
|
|
64926
|
+
if (wrap2?.type === "Inline") {
|
|
64927
|
+
return {
|
|
64928
|
+
type: "Inline",
|
|
64929
|
+
attrs: wrap2.attrs ?? {}
|
|
64930
|
+
};
|
|
64931
|
+
}
|
|
64932
|
+
return {
|
|
64933
|
+
type: "Inline",
|
|
64934
|
+
attrs: {}
|
|
64935
|
+
};
|
|
64936
|
+
};
|
|
64937
|
+
const normalizeMarginOffset = (marginOffset = {}) => {
|
|
64938
|
+
const { left: left2, horizontal, ...rest } = marginOffset;
|
|
64939
|
+
return {
|
|
64940
|
+
...rest,
|
|
64941
|
+
horizontal: horizontal ?? left2
|
|
64942
|
+
};
|
|
64943
|
+
};
|
|
64944
|
+
const getNormalizedImageAttrs = (attrs = {}) => {
|
|
64945
|
+
return {
|
|
64946
|
+
wrap: normalizeWrap(attrs),
|
|
64947
|
+
marginOffset: normalizeMarginOffset(attrs.marginOffset ?? {})
|
|
64948
|
+
};
|
|
64949
|
+
};
|
|
64954
64950
|
const getRotationMargins = (w2, h2, angleDegrees) => {
|
|
64955
64951
|
const rad = angleDegrees * (Math.PI / 180);
|
|
64956
64952
|
const cos = Math.abs(Math.cos(rad));
|
|
@@ -65159,27 +65155,15 @@ const Image = Node$1.create({
|
|
|
65159
65155
|
style2 += "float: right;";
|
|
65160
65156
|
floatRight = true;
|
|
65161
65157
|
} else if (["largest", "bothSides"].includes(attrs.wrapText)) {
|
|
65162
|
-
const
|
|
65163
|
-
|
|
65164
|
-
|
|
65165
|
-
|
|
65166
|
-
|
|
65167
|
-
|
|
65168
|
-
|
|
65169
|
-
|
|
65170
|
-
|
|
65171
|
-
if (rightSpace < 0) {
|
|
65172
|
-
style2 += "float: left;";
|
|
65173
|
-
} else if (rightSpace > leftSpace) {
|
|
65174
|
-
style2 += "float: left;";
|
|
65175
|
-
} else {
|
|
65176
|
-
style2 += "float: right;";
|
|
65177
|
-
floatRight = true;
|
|
65178
|
-
baseHorizontal = rightSpace;
|
|
65179
|
-
}
|
|
65180
|
-
} else {
|
|
65181
|
-
style2 += "float: left;";
|
|
65182
|
-
}
|
|
65158
|
+
const pageStylesData2 = getDataFromPageStyles({
|
|
65159
|
+
editor: this.editor,
|
|
65160
|
+
marginOffset,
|
|
65161
|
+
size: size2,
|
|
65162
|
+
attrs
|
|
65163
|
+
});
|
|
65164
|
+
style2 += pageStylesData2.style;
|
|
65165
|
+
floatRight = pageStylesData2.floatRight;
|
|
65166
|
+
baseHorizontal = pageStylesData2.baseHorizontal;
|
|
65183
65167
|
}
|
|
65184
65168
|
if (attrs.distTop) margin.top += attrs.distTop;
|
|
65185
65169
|
if (attrs.distBottom) margin.bottom += attrs.distBottom;
|
|
@@ -65189,27 +65173,15 @@ const Image = Node$1.create({
|
|
|
65189
65173
|
case "Through":
|
|
65190
65174
|
case "Tight":
|
|
65191
65175
|
style2 += "clear: both;";
|
|
65192
|
-
const
|
|
65193
|
-
|
|
65194
|
-
|
|
65195
|
-
|
|
65196
|
-
|
|
65197
|
-
|
|
65198
|
-
|
|
65199
|
-
|
|
65200
|
-
|
|
65201
|
-
if (rightSpace < 0) {
|
|
65202
|
-
style2 += "float: left;";
|
|
65203
|
-
} else if (rightSpace > leftSpace) {
|
|
65204
|
-
style2 += "float: left;";
|
|
65205
|
-
} else {
|
|
65206
|
-
style2 += "float: right;";
|
|
65207
|
-
floatRight = true;
|
|
65208
|
-
baseHorizontal = rightSpace;
|
|
65209
|
-
}
|
|
65210
|
-
} else {
|
|
65211
|
-
style2 += "float: left;";
|
|
65212
|
-
}
|
|
65176
|
+
const pageStylesData = getDataFromPageStyles({
|
|
65177
|
+
editor: this.editor,
|
|
65178
|
+
marginOffset,
|
|
65179
|
+
size: size2,
|
|
65180
|
+
attrs
|
|
65181
|
+
});
|
|
65182
|
+
style2 += pageStylesData.style;
|
|
65183
|
+
floatRight = pageStylesData.floatRight;
|
|
65184
|
+
baseHorizontal = pageStylesData.baseHorizontal;
|
|
65213
65185
|
if (attrs.distTop) margin.top += attrs.distTop;
|
|
65214
65186
|
if (attrs.distBottom) margin.bottom += attrs.distBottom;
|
|
65215
65187
|
if (attrs.distLeft) margin.left += attrs.distLeft;
|
|
@@ -65246,6 +65218,22 @@ const Image = Node$1.create({
|
|
|
65246
65218
|
}
|
|
65247
65219
|
const hasAnchorData = Boolean(anchorData);
|
|
65248
65220
|
const hasMarginOffsets = marginOffset?.horizontal != null || marginOffset?.top != null;
|
|
65221
|
+
if (hasAnchorData) {
|
|
65222
|
+
switch (anchorData.hRelativeFrom) {
|
|
65223
|
+
case "page":
|
|
65224
|
+
const pageStyles = this.editor?.converter?.pageStyles || this.editor?.options.parentEditor?.converter?.pageStyles;
|
|
65225
|
+
margin.left -= inchesToPixels(pageStyles?.pageMargins?.left) || 0;
|
|
65226
|
+
break;
|
|
65227
|
+
case "margin":
|
|
65228
|
+
if (anchorData.alignH === "center") {
|
|
65229
|
+
style2 += "position: absolute; left: 50%; transform: translateX(-50%);";
|
|
65230
|
+
}
|
|
65231
|
+
if (anchorData.alignH === "left" || anchorData.alignH === "right") {
|
|
65232
|
+
style2 += `position: absolute; ${anchorData.alignH}: 0;`;
|
|
65233
|
+
}
|
|
65234
|
+
break;
|
|
65235
|
+
}
|
|
65236
|
+
}
|
|
65249
65237
|
if (hasAnchorData || hasMarginOffsets) {
|
|
65250
65238
|
const relativeFromPageV = anchorData?.vRelativeFrom === "page";
|
|
65251
65239
|
const maxMarginV = 500;
|
|
@@ -65394,6 +65382,37 @@ const Image = Node$1.create({
|
|
|
65394
65382
|
return [ImageRegistrationPlugin({ editor: this.editor }), ImagePositionPlugin({ editor: this.editor })];
|
|
65395
65383
|
}
|
|
65396
65384
|
});
|
|
65385
|
+
const getDataFromPageStyles = ({ editor, marginOffset, size: size2, attrs }) => {
|
|
65386
|
+
let style2 = "";
|
|
65387
|
+
let floatRight = false;
|
|
65388
|
+
let baseHorizontal = marginOffset?.horizontal || 0;
|
|
65389
|
+
const pageStyles = editor?.converter?.pageStyles || editor?.options.parentEditor?.converter?.pageStyles;
|
|
65390
|
+
if (pageStyles?.pageSize && pageStyles?.pageMargins && size2.width) {
|
|
65391
|
+
const pageWidth = inchesToPixels(pageStyles.pageSize.width);
|
|
65392
|
+
const leftMargin = inchesToPixels(pageStyles.pageMargins.left);
|
|
65393
|
+
const rightMargin = inchesToPixels(pageStyles.pageMargins.right);
|
|
65394
|
+
const contentWidth = pageWidth - leftMargin - rightMargin;
|
|
65395
|
+
const imageWidth = size2.width + (attrs.distLeft || 0) + (attrs.distRight || 0);
|
|
65396
|
+
const leftSpace = marginOffset.horizontal;
|
|
65397
|
+
const rightSpace = contentWidth - leftSpace - imageWidth;
|
|
65398
|
+
if (rightSpace < 0) {
|
|
65399
|
+
style2 += "float: left;";
|
|
65400
|
+
} else if (rightSpace > leftSpace) {
|
|
65401
|
+
style2 += "float: left;";
|
|
65402
|
+
} else {
|
|
65403
|
+
style2 += "float: right;";
|
|
65404
|
+
floatRight = true;
|
|
65405
|
+
baseHorizontal = rightSpace;
|
|
65406
|
+
}
|
|
65407
|
+
} else {
|
|
65408
|
+
style2 += "float: left;";
|
|
65409
|
+
}
|
|
65410
|
+
return {
|
|
65411
|
+
style: style2,
|
|
65412
|
+
floatRight,
|
|
65413
|
+
baseHorizontal
|
|
65414
|
+
};
|
|
65415
|
+
};
|
|
65397
65416
|
const ACCEPT_IMAGE_TYPES = [".jpg", ".jpeg", ".png", "image/jpeg", "image/png"];
|
|
65398
65417
|
const getFileOpener = () => {
|
|
65399
65418
|
let fileInput = document.createElement("input");
|
|
@@ -72836,7 +72855,7 @@ const nodeResizer = (nodeNames = ["image"], editor) => {
|
|
|
72836
72855
|
return oldState;
|
|
72837
72856
|
}
|
|
72838
72857
|
if (typeof document === "undefined" || editor.options.isHeadless) return oldState;
|
|
72839
|
-
if (editor.options.documentMode === "viewing" || !editor.isEditable) {
|
|
72858
|
+
if (!editor.options.isHeaderOrFooter && (editor.options.documentMode === "viewing" || !editor.isEditable)) {
|
|
72840
72859
|
return DecorationSet.empty;
|
|
72841
72860
|
}
|
|
72842
72861
|
const { selection } = newState;
|