@harbour-enterprises/superdoc 0.25.0-next.4 → 0.25.0-next.6

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.
@@ -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-D9KYAvvg.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-DDGjYIm1.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -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-BHS2aLqo.cjs");
4
+ const superdoc = require("./index-7exCeEb1.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-BJzqCihw.cjs");
2
+ const superEditor_es = require("./super-editor.es-GExnUB7l.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-BETK3Bs4.cjs")));
17167
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-BeQy7uL0.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-Beeng5kU.es.js";
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-XXbEUVCc.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-D4F3H-Ay.es.js"));
17150
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-BOrm7Awj.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
- switch (alignH) {
64899
- case "left":
64900
- style2 += "float: left; left: 0; margin-left: 0; ";
64901
- break;
64902
- case "right":
64903
- style2 += "float: right; right: 0; margin-right: 0; ";
64904
- break;
64905
- case "center":
64906
- style2 += "display: block; margin-left: auto; margin-right: auto; ";
64907
- break;
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 topPos = marginOffset.top !== void 0 ? marginOffset.top : pageBreak?.offsetTop + pageBreak?.offsetHeight;
64910
- style2 += vRelativeFrom === "margin" ? `position: absolute; top: ${topPos}px; ` : "";
64911
- if (vRelativeFrom === "margin") {
64912
- const nextPos = view.posAtDOM(pageBreak, 1);
64913
- if (nextPos < 0) {
64914
- const $pos = view.state.doc.resolve(pos);
64915
- decorations.push(
64916
- Decoration.node(pos - 1, pos + $pos.parent.nodeSize - 1, {
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 pageStyles2 = this.editor?.converter?.pageStyles;
65163
- if (pageStyles2?.pageSize && pageStyles2?.pageMargins && size2.width) {
65164
- const pageWidth = inchesToPixels(pageStyles2.pageSize.width);
65165
- const leftMargin = inchesToPixels(pageStyles2.pageMargins.left);
65166
- const rightMargin = inchesToPixels(pageStyles2.pageMargins.right);
65167
- const contentWidth = pageWidth - leftMargin - rightMargin;
65168
- const imageWidth = size2.width + (attrs.distLeft || 0) + (attrs.distRight || 0);
65169
- const leftSpace = marginOffset.horizontal;
65170
- const rightSpace = contentWidth - leftSpace - imageWidth;
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 pageStyles = this.editor?.converter?.pageStyles;
65193
- if (pageStyles?.pageSize && pageStyles?.pageMargins && size2.width) {
65194
- const pageWidth = inchesToPixels(pageStyles.pageSize.width);
65195
- const leftMargin = inchesToPixels(pageStyles.pageMargins.left);
65196
- const rightMargin = inchesToPixels(pageStyles.pageMargins.right);
65197
- const contentWidth = pageWidth - leftMargin - rightMargin;
65198
- const imageWidth = size2.width + (attrs.distLeft || 0) + (attrs.distRight || 0);
65199
- const leftSpace = marginOffset.horizontal;
65200
- const rightSpace = contentWidth - leftSpace - imageWidth;
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");
@@ -67515,6 +67534,15 @@ const TrackChanges = Extension.create({
67515
67534
  const { from: from2, to } = state2.selection;
67516
67535
  return commands2.acceptTrackedChangesBetween(from2, to);
67517
67536
  },
67537
+ acceptTrackedChangeFromToolbar: () => ({ state: state2, commands: commands2 }) => {
67538
+ const commentsPluginState = CommentsPluginKey.getState(state2);
67539
+ const activeThreadId = commentsPluginState?.activeThreadId;
67540
+ if (activeThreadId && commentsPluginState?.trackedChanges?.[activeThreadId]) {
67541
+ return commands2.acceptTrackedChangeById(activeThreadId);
67542
+ } else {
67543
+ return commands2.acceptTrackedChangeBySelection();
67544
+ }
67545
+ },
67518
67546
  acceptTrackedChangeById: (id) => ({ state: state2, tr, commands: commands2 }) => {
67519
67547
  const toResolve = getChangesByIdToResolve(state2, id) || [];
67520
67548
  return toResolve.map(({ from: from2, to }) => {
@@ -67543,6 +67571,15 @@ const TrackChanges = Extension.create({
67543
67571
  const { from: from2, to } = state2.selection;
67544
67572
  return commands2.rejectTrackedChangesBetween(from2, to);
67545
67573
  },
67574
+ rejectTrackedChangeFromToolbar: () => ({ state: state2, commands: commands2 }) => {
67575
+ const commentsPluginState = CommentsPluginKey.getState(state2);
67576
+ const activeThreadId = commentsPluginState?.activeThreadId;
67577
+ if (activeThreadId && commentsPluginState?.trackedChanges?.[activeThreadId]) {
67578
+ return commands2.rejectTrackedChangeById(activeThreadId);
67579
+ } else {
67580
+ return commands2.rejectTrackedChangeOnSelection();
67581
+ }
67582
+ },
67546
67583
  rejectAllTrackedChanges: () => ({ state: state2, commands: commands2 }) => {
67547
67584
  const from2 = 0, to = state2.doc.content.size;
67548
67585
  return commands2.rejectTrackedChangesBetween(from2, to);
@@ -72836,7 +72873,7 @@ const nodeResizer = (nodeNames = ["image"], editor) => {
72836
72873
  return oldState;
72837
72874
  }
72838
72875
  if (typeof document === "undefined" || editor.options.isHeadless) return oldState;
72839
- if (editor.options.documentMode === "viewing" || !editor.isEditable) {
72876
+ if (!editor.options.isHeaderOrFooter && (editor.options.documentMode === "viewing" || !editor.isEditable)) {
72840
72877
  return DecorationSet.empty;
72841
72878
  }
72842
72879
  const { selection } = newState;
@@ -85945,7 +85982,7 @@ const makeDefaultItems = ({
85945
85982
  disabled: false,
85946
85983
  name: "acceptTrackedChangeBySelection",
85947
85984
  tooltip: toolbarTexts2.trackChangesAccept,
85948
- command: "acceptTrackedChangeBySelection",
85985
+ command: "acceptTrackedChangeFromToolbar",
85949
85986
  icon: toolbarIcons2.trackChangesAccept,
85950
85987
  group: "left",
85951
85988
  attributes: {
@@ -85957,7 +85994,7 @@ const makeDefaultItems = ({
85957
85994
  disabled: false,
85958
85995
  name: "rejectTrackedChangeOnSelection",
85959
85996
  tooltip: toolbarTexts2.trackChangesReject,
85960
- command: "rejectTrackedChangeOnSelection",
85997
+ command: "rejectTrackedChangeFromToolbar",
85961
85998
  icon: toolbarIcons2.trackChangesReject,
85962
85999
  group: "left",
85963
86000
  attributes: {