@harbour-enterprises/superdoc 1.8.2-next.1 → 1.8.2-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.
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-De9wkgLl.cjs");
4
- const superdoc = require("./index-BTwCQoeP.cjs");
5
- const index = require("./index-CAbg8dAQ.cjs");
4
+ const superdoc = require("./index-CmcLCoAA.cjs");
5
+ const index = require("./index-DT0-49y4.cjs");
6
6
  function self(vars) {
7
7
  const {
8
8
  opacityDisabled,
@@ -1,6 +1,6 @@
1
1
  import { d as defineComponent, h, T as Transition, p as process$1, w as watchEffect, c as computed, r as ref, f as onMounted, X as onUnmounted, E as createElementBlock, G as openBlock, K as createBaseVNode, M as createCommentVNode, I as createVNode, v as unref } from "./vue-BnBKJwCW.es.js";
2
- import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-DHWm6zEW.es.js";
3
- import { C as derived, r as c, q as cB, aF as fadeInTransition, y as cM, I as warnOnce, J as useConfig, N as useTheme, aG as pxfy, P as createKey, Q as useThemeClass, aH as useCompitable, ai as _export_sfc } from "./index-DR6N6rCG.es.js";
2
+ import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-BpO3FO9M.es.js";
3
+ import { C as derived, r as c, q as cB, aF as fadeInTransition, y as cM, I as warnOnce, J as useConfig, N as useTheme, aG as pxfy, P as createKey, Q as useThemeClass, aH as useCompitable, ai as _export_sfc } from "./index-DXRy_ln-.es.js";
4
4
  function self(vars) {
5
5
  const {
6
6
  opacityDisabled,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const jszip = require("./jszip-C8_CqJxM.cjs");
3
- const helpers = require("./helpers-nOdwpmwb.cjs");
3
+ const helpers = require("./helpers-CnY-716k.cjs");
4
4
  const uuid = require("./uuid-R7L08bOx.cjs");
5
5
  function getDefaultExportFromCjs(x2) {
6
6
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
@@ -7292,7 +7292,7 @@ function combineIndentProperties(indentChain) {
7292
7292
  });
7293
7293
  }
7294
7294
  function resolveRunProperties(params, inlineRpr, resolvedPpr, tableInfo = null, isListNumber = false, numberingDefinedInline = false) {
7295
- if (!params.translatedLinkedStyles) {
7295
+ if (!params.translatedLinkedStyles?.styles) {
7296
7296
  return inlineRpr ?? {};
7297
7297
  }
7298
7298
  if (!inlineRpr) {
@@ -7348,7 +7348,7 @@ function resolveParagraphProperties(params, inlineProps, tableInfo) {
7348
7348
  if (!inlineProps) {
7349
7349
  inlineProps = {};
7350
7350
  }
7351
- if (!params.translatedLinkedStyles) {
7351
+ if (!params.translatedLinkedStyles?.styles) {
7352
7352
  return inlineProps;
7353
7353
  }
7354
7354
  const defaultProps = params.translatedLinkedStyles.docDefaults?.paragraphProperties ?? {};
@@ -31063,7 +31063,8 @@ const findSectPr = (obj, result = []) => {
31063
31063
  const getHeaderFooterSectionData = (sectionData, docx) => {
31064
31064
  const rId = sectionData.attributes.Id;
31065
31065
  const target = sectionData.attributes.Target;
31066
- const referenceFile = docx[`word/${target}`];
31066
+ const filePath = helpers.resolveOpcTargetPath(target, "word");
31067
+ const referenceFile = filePath ? docx[filePath] : void 0;
31067
31068
  const currentFileName = target;
31068
31069
  return {
31069
31070
  rId,
@@ -33509,7 +33510,7 @@ class SuperConverter {
33509
33510
  static getStoredSuperdocVersion(docx) {
33510
33511
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
33511
33512
  }
33512
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.8.2-next.1") {
33513
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.8.2-next.2") {
33513
33514
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
33514
33515
  }
33515
33516
  /**
@@ -1,5 +1,5 @@
1
1
  import { B as Buffer, c as commonjsGlobal, g as getDefaultExportFromCjs$1 } from "./jszip-B1fkPkPJ.es.js";
2
- import { j as getDocxHighlightKeywordFromHex, n as normalizeHexColor, p as ptToTwips, k as isValidHexColor, m as getHexColorFromDocxSystem, h as halfPointToPoints, o as twipsToPt, c as twipsToPixels, q as eighthPointsToPixels, l as linesToTwips, a as twipsToLines, t as twipsToInches, b as pixelsToTwips, i as inchesToTwips, r as pixelsToEightPoints, s as emuToPixels, u as polygonToObj, v as rotToDegrees, w as pointsToTwips, x as pixelsToEmu, y as degreesToRot, z as objToPolygon, f as libExports, A as rgbToHex, B as deobfuscateFont, C as getArrayBufferFromUrl } from "./helpers-C8e9wR5l.es.js";
2
+ import { j as getDocxHighlightKeywordFromHex, n as normalizeHexColor, p as ptToTwips, k as isValidHexColor, m as getHexColorFromDocxSystem, h as halfPointToPoints, o as twipsToPt, c as twipsToPixels, q as eighthPointsToPixels, l as linesToTwips, a as twipsToLines, t as twipsToInches, b as pixelsToTwips, i as inchesToTwips, s as pixelsToEightPoints, u as emuToPixels, v as polygonToObj, w as rotToDegrees, x as pointsToTwips, y as pixelsToEmu, z as degreesToRot, A as objToPolygon, f as libExports, r as resolveOpcTargetPath, B as rgbToHex, C as deobfuscateFont, D as getArrayBufferFromUrl } from "./helpers-BZLaTnr3.es.js";
3
3
  import { v as v4 } from "./uuid-CjlX8hrF.es.js";
4
4
  function getDefaultExportFromCjs(x2) {
5
5
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
@@ -7291,7 +7291,7 @@ function combineIndentProperties(indentChain) {
7291
7291
  });
7292
7292
  }
7293
7293
  function resolveRunProperties(params, inlineRpr, resolvedPpr, tableInfo = null, isListNumber = false, numberingDefinedInline = false) {
7294
- if (!params.translatedLinkedStyles) {
7294
+ if (!params.translatedLinkedStyles?.styles) {
7295
7295
  return inlineRpr ?? {};
7296
7296
  }
7297
7297
  if (!inlineRpr) {
@@ -7347,7 +7347,7 @@ function resolveParagraphProperties(params, inlineProps, tableInfo) {
7347
7347
  if (!inlineProps) {
7348
7348
  inlineProps = {};
7349
7349
  }
7350
- if (!params.translatedLinkedStyles) {
7350
+ if (!params.translatedLinkedStyles?.styles) {
7351
7351
  return inlineProps;
7352
7352
  }
7353
7353
  const defaultProps = params.translatedLinkedStyles.docDefaults?.paragraphProperties ?? {};
@@ -31062,7 +31062,8 @@ const findSectPr = (obj, result = []) => {
31062
31062
  const getHeaderFooterSectionData = (sectionData, docx) => {
31063
31063
  const rId = sectionData.attributes.Id;
31064
31064
  const target = sectionData.attributes.Target;
31065
- const referenceFile = docx[`word/${target}`];
31065
+ const filePath = resolveOpcTargetPath(target, "word");
31066
+ const referenceFile = filePath ? docx[filePath] : void 0;
31066
31067
  const currentFileName = target;
31067
31068
  return {
31068
31069
  rId,
@@ -33508,7 +33509,7 @@ class SuperConverter {
33508
33509
  static getStoredSuperdocVersion(docx) {
33509
33510
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
33510
33511
  }
33511
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.8.2-next.1") {
33512
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.8.2-next.2") {
33512
33513
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
33513
33514
  }
33514
33515
  /**
@@ -208,6 +208,23 @@ const getContentTypesFromXml = (contentTypesXml) => {
208
208
  return [];
209
209
  }
210
210
  };
211
+ const resolveOpcTargetPath = (target, baseDir = "word") => {
212
+ if (!target) return null;
213
+ if (target.includes("://")) return null;
214
+ if (target.startsWith("/")) {
215
+ return target.slice(1);
216
+ }
217
+ const segments = `${baseDir}/${target}`.split("/");
218
+ const resolved = [];
219
+ for (const seg of segments) {
220
+ if (seg === "..") {
221
+ resolved.pop();
222
+ } else if (seg !== "." && seg !== "") {
223
+ resolved.push(seg);
224
+ }
225
+ }
226
+ return resolved.join("/");
227
+ };
211
228
  const DOCX_HIGHLIGHT_KEYWORD_MAP = /* @__PURE__ */ new Map([
212
229
  ["yellow", "FFFF00"],
213
230
  ["green", "00FF00"],
@@ -321,9 +338,10 @@ function convertSizeToCSS(value, type) {
321
338
  }
322
339
  }
323
340
  export {
324
- rgbToHex as A,
325
- deobfuscateFont as B,
326
- getArrayBufferFromUrl as C,
341
+ objToPolygon as A,
342
+ rgbToHex as B,
343
+ deobfuscateFont as C,
344
+ getArrayBufferFromUrl as D,
327
345
  twipsToLines as a,
328
346
  pixelsToTwips as b,
329
347
  twipsToPixels as c,
@@ -341,13 +359,13 @@ export {
341
359
  twipsToPt as o,
342
360
  ptToTwips as p,
343
361
  eighthPointsToPixels as q,
344
- pixelsToEightPoints as r,
345
- emuToPixels as s,
362
+ resolveOpcTargetPath as r,
363
+ pixelsToEightPoints as s,
346
364
  twipsToInches as t,
347
- polygonToObj as u,
348
- rotToDegrees as v,
349
- pointsToTwips as w,
350
- pixelsToEmu as x,
351
- degreesToRot as y,
352
- objToPolygon as z
365
+ emuToPixels as u,
366
+ polygonToObj as v,
367
+ rotToDegrees as w,
368
+ pointsToTwips as x,
369
+ pixelsToEmu as y,
370
+ degreesToRot as z
353
371
  };
@@ -209,6 +209,23 @@ const getContentTypesFromXml = (contentTypesXml) => {
209
209
  return [];
210
210
  }
211
211
  };
212
+ const resolveOpcTargetPath = (target, baseDir = "word") => {
213
+ if (!target) return null;
214
+ if (target.includes("://")) return null;
215
+ if (target.startsWith("/")) {
216
+ return target.slice(1);
217
+ }
218
+ const segments = `${baseDir}/${target}`.split("/");
219
+ const resolved = [];
220
+ for (const seg of segments) {
221
+ if (seg === "..") {
222
+ resolved.pop();
223
+ } else if (seg !== "." && seg !== "") {
224
+ resolved.push(seg);
225
+ }
226
+ }
227
+ return resolved.join("/");
228
+ };
212
229
  const DOCX_HIGHLIGHT_KEYWORD_MAP = /* @__PURE__ */ new Map([
213
230
  ["yellow", "FFFF00"],
214
231
  ["green", "00FF00"],
@@ -344,6 +361,7 @@ exports.pixelsToTwips = pixelsToTwips;
344
361
  exports.pointsToTwips = pointsToTwips;
345
362
  exports.polygonToObj = polygonToObj;
346
363
  exports.ptToTwips = ptToTwips;
364
+ exports.resolveOpcTargetPath = resolveOpcTargetPath;
347
365
  exports.rgbToHex = rgbToHex;
348
366
  exports.rotToDegrees = rotToDegrees;
349
367
  exports.twipsToInches = twipsToInches;
@@ -1,10 +1,10 @@
1
- import { B as BIT8, M as MAX_SAFE_INTEGER, c as create, a as BITS7, u as utf8TextDecoder, b as create$1, s as setIfUndefined, d as create$2, f as from, e as floor$1, g as equalityDeep, w as writeVarUint, h as writeVarString, t as toUint8Array, i as createEncoder, j as createInjectionKey, k as toString, l as throwError, m as useSsrAdapter, n as configProviderInjectionKey, o as cssrAnchorMetaName, p as globalStyle, q as cB, r as c, v as isMounted, x as commonVariables$2, y as cM, z as cNotM, A as cE, C as derived, D as changeColor, E as insideModal, F as insidePopover, G as resolveWrappedSlot, H as on, I as warnOnce, J as useConfig, K as useMergedState, L as useMemo, N as useTheme, O as useRtl, P as createKey, Q as useThemeClass, R as createId, S as call, T as render, U as messageProviderInjectionKey, V as messageApiInjectionKey, W as fromBase64, X as onChange, Y as varStorage, Z as toBase64, _ as createUint8ArrayFromArrayBuffer, $ as offChange, a0 as writeVarUint8Array, a1 as map, a2 as length, a3 as isNode, a4 as min, a5 as pow, a6 as comments_module_events, a7 as getFileObject, a8 as getTrackChanges, a9 as CommentsPluginKey, aa as TrackChangesBasePluginKey, ab as Editor, ac as getRichTextExtensions, ad as ellipsisVerticalSvg, ae as xmarkIconSvg, af as checkIconSvg, ag as caretDownIconSvg, ah as commentIconSvg, ai as _export_sfc, aj as NDropdown, ak as SuperInput, al as vClickOutside, am as PresentationEditor, an as SuperEditor, ao as AIWriter, ap as NConfigProvider, aq as SuperToolbar } from "./index-DR6N6rCG.es.js";
1
+ import { B as BIT8, M as MAX_SAFE_INTEGER, c as create, a as BITS7, u as utf8TextDecoder, b as create$1, s as setIfUndefined, d as create$2, f as from, e as floor$1, g as equalityDeep, w as writeVarUint, h as writeVarString, t as toUint8Array, i as createEncoder, j as createInjectionKey, k as toString, l as throwError, m as useSsrAdapter, n as configProviderInjectionKey, o as cssrAnchorMetaName, p as globalStyle, q as cB, r as c, v as isMounted, x as commonVariables$2, y as cM, z as cNotM, A as cE, C as derived, D as changeColor, E as insideModal, F as insidePopover, G as resolveWrappedSlot, H as on, I as warnOnce, J as useConfig, K as useMergedState, L as useMemo, N as useTheme, O as useRtl, P as createKey, Q as useThemeClass, R as createId, S as call, T as render, U as messageProviderInjectionKey, V as messageApiInjectionKey, W as fromBase64, X as onChange, Y as varStorage, Z as toBase64, _ as createUint8ArrayFromArrayBuffer, $ as offChange, a0 as writeVarUint8Array, a1 as map, a2 as length, a3 as isNode, a4 as min, a5 as pow, a6 as comments_module_events, a7 as getFileObject, a8 as getTrackChanges, a9 as CommentsPluginKey, aa as TrackChangesBasePluginKey, ab as Editor, ac as getRichTextExtensions, ad as ellipsisVerticalSvg, ae as xmarkIconSvg, af as checkIconSvg, ag as caretDownIconSvg, ah as commentIconSvg, ai as _export_sfc, aj as NDropdown, ak as SuperInput, al as vClickOutside, am as PresentationEditor, an as SuperEditor, ao as AIWriter, ap as NConfigProvider, aq as SuperToolbar } from "./index-DXRy_ln-.es.js";
2
2
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
3
3
  import { E as EventEmitter } from "./eventemitter3-CwrdEv8r.es.js";
4
4
  import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
5
5
  import "./jszip-B1fkPkPJ.es.js";
6
- import "./helpers-C8e9wR5l.es.js";
7
- import "./SuperConverter-CLZ8o__p.es.js";
6
+ import "./helpers-BZLaTnr3.es.js";
7
+ import "./SuperConverter-BwBuaGR-.es.js";
8
8
  import { i as inject, a as provide, c as computed, o as onBeforeUnmount, p as process$1, b as onBeforeMount, d as defineComponent, h, t as toRef, T as Transition, e as TransitionGroup, w as watchEffect, r as ref, f as onMounted, g as Teleport, F as Fragment, j as reactive, k as effectScope, m as markRaw, l as toRaw, n as isRef, q as isReactive, s as getCurrentInstance, u as watch, v as unref, x as hasInjectionContext, y as nextTick, z as getCurrentScope, A as onScopeDispose, B as toRefs, C as global, D as shallowRef, E as createElementBlock, G as openBlock, H as toDisplayString, I as createVNode, J as withCtx, K as createBaseVNode, L as normalizeStyle, M as createCommentVNode, N as createBlock, O as withModifiers, P as normalizeClass, Q as resolveDirective, R as withDirectives, S as renderList, U as createApp, V as resolveDynamicComponent, W as defineAsyncComponent } from "./vue-BnBKJwCW.es.js";
9
9
  import "./jszip.min-DCl8qkFO.es.js";
10
10
  import { createZip } from "../super-editor/file-zipper.es.js";
@@ -7672,7 +7672,7 @@ const _sfc_main = {
7672
7672
  __name: "SuperDoc",
7673
7673
  emits: ["selection-update"],
7674
7674
  setup(__props, { emit: __emit }) {
7675
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-B8zn6M2I.es.js"));
7675
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-CRhrGEsL.es.js"));
7676
7676
  const superdocStore = useSuperdocStore();
7677
7677
  const commentsStore = useCommentsStore();
7678
7678
  const {
@@ -8657,7 +8657,7 @@ class SuperDoc extends EventEmitter {
8657
8657
  this.config.colors = shuffleArray(this.config.colors);
8658
8658
  this.userColorMap = /* @__PURE__ */ new Map();
8659
8659
  this.colorIndex = 0;
8660
- this.version = "1.8.2-next.1";
8660
+ this.version = "1.8.2-next.2";
8661
8661
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
8662
8662
  this.superdocId = config.superdocId || v4();
8663
8663
  this.colors = this.config.colors;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
- const index = require("./index-CAbg8dAQ.cjs");
2
+ const index = require("./index-DT0-49y4.cjs");
3
3
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
4
4
  const eventemitter3 = require("./eventemitter3-BQuRcMPI.cjs");
5
5
  const provider = require("@hocuspocus/provider");
6
6
  require("./jszip-C8_CqJxM.cjs");
7
- require("./helpers-nOdwpmwb.cjs");
8
- require("./SuperConverter-CzZpTS13.cjs");
7
+ require("./helpers-CnY-716k.cjs");
8
+ require("./SuperConverter-B39dCut-.cjs");
9
9
  const vue = require("./vue-De9wkgLl.cjs");
10
10
  require("./jszip.min-BPh2MMAa.cjs");
11
11
  const superEditor_fileZipper = require("../super-editor/file-zipper.cjs");
@@ -7689,7 +7689,7 @@ const _sfc_main = {
7689
7689
  __name: "SuperDoc",
7690
7690
  emits: ["selection-update"],
7691
7691
  setup(__props, { emit: __emit }) {
7692
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-DBHRMd3z.cjs")));
7692
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-BwFluCQM.cjs")));
7693
7693
  const superdocStore = useSuperdocStore();
7694
7694
  const commentsStore = useCommentsStore();
7695
7695
  const {
@@ -8674,7 +8674,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
8674
8674
  this.config.colors = shuffleArray(this.config.colors);
8675
8675
  this.userColorMap = /* @__PURE__ */ new Map();
8676
8676
  this.colorIndex = 0;
8677
- this.version = "1.8.2-next.1";
8677
+ this.version = "1.8.2-next.2";
8678
8678
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
8679
8679
  this.superdocId = config.superdocId || uuid.v4();
8680
8680
  this.colors = this.config.colors;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const jszip = require("./jszip-C8_CqJxM.cjs");
3
- const helpers$1 = require("./helpers-nOdwpmwb.cjs");
4
- const superEditor_converter = require("./SuperConverter-CzZpTS13.cjs");
3
+ const helpers$1 = require("./helpers-CnY-716k.cjs");
4
+ const superEditor_converter = require("./SuperConverter-B39dCut-.cjs");
5
5
  const vue = require("./vue-De9wkgLl.cjs");
6
6
  require("./jszip.min-BPh2MMAa.cjs");
7
7
  const eventemitter3 = require("./eventemitter3-BQuRcMPI.cjs");
@@ -15439,18 +15439,13 @@ function processRelationships(root2, convertedXml, results) {
15439
15439
  wasProcessed = true;
15440
15440
  }
15441
15441
  if (isImageType(type)) {
15442
- const relPath = `word/${target.replace(/^\.?\//, "")}`;
15443
- if (/^media\/.+\.bin$/i.test(target) && relPath in convertedXml) {
15442
+ const relPath = helpers$1.resolveOpcTargetPath(target, "word");
15443
+ if (relPath && /^media\/.+\.bin$/i.test(target) && relPath in convertedXml) {
15444
15444
  binMediaTargets.add(`/${relPath}`);
15445
15445
  }
15446
15446
  }
15447
15447
  if (targetMode.toLowerCase() !== "external" && !looksExternal(target)) {
15448
- let likelyPath;
15449
- if (target.startsWith("../")) {
15450
- likelyPath = target.replace(/^\.\.\//, "");
15451
- } else {
15452
- likelyPath = `word/${target.replace(/^\.?\//, "")}`;
15453
- }
15448
+ const likelyPath = helpers$1.resolveOpcTargetPath(target, "word");
15454
15449
  if (!(likelyPath in convertedXml)) {
15455
15450
  if (!isImageType(type)) {
15456
15451
  results.push(`Removed relationship ${id} with missing target: ${target}`);
@@ -15795,7 +15790,7 @@ const canUseDOM = () => {
15795
15790
  return false;
15796
15791
  }
15797
15792
  };
15798
- const summaryVersion = "1.8.2-next.1";
15793
+ const summaryVersion = "1.8.2-next.2";
15799
15794
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
15800
15795
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
15801
15796
  function mapAttributes(attrs) {
@@ -18518,7 +18513,7 @@ class Editor extends EventEmitter {
18518
18513
  * Process collaboration migrations
18519
18514
  */
18520
18515
  processCollaborationMigrations() {
18521
- console.debug("[checkVersionMigrations] Current editor version", "1.8.2-next.1");
18516
+ console.debug("[checkVersionMigrations] Current editor version", "1.8.2-next.2");
18522
18517
  if (!this.options.ydoc) return;
18523
18518
  const metaMap = this.options.ydoc.getMap("meta");
18524
18519
  let docVersion = metaMap.get("version");
@@ -47963,6 +47958,14 @@ class EditorInputManager {
47963
47958
  #handleDoubleClick(event) {
47964
47959
  if (!this.#deps) return;
47965
47960
  if (event.button !== 0) return;
47961
+ const target = event.target;
47962
+ const annotationEl = target?.closest?.(".annotation[data-pm-start]");
47963
+ if (annotationEl) {
47964
+ event.preventDefault();
47965
+ event.stopPropagation();
47966
+ this.#handleAnnotationDoubleClick(event, annotationEl);
47967
+ return;
47968
+ }
47966
47969
  const layoutState = this.#deps.getLayoutState();
47967
47970
  if (!layoutState.layout) return;
47968
47971
  const viewportHost = this.#deps.getViewportHost();
@@ -47988,6 +47991,25 @@ class EditorInputManager {
47988
47991
  this.#callbacks.exitHeaderFooterMode?.();
47989
47992
  }
47990
47993
  }
47994
+ #handleAnnotationDoubleClick(event, annotationEl) {
47995
+ const editor = this.#deps?.getEditor();
47996
+ if (!editor?.isEditable) return;
47997
+ const resolved = this.#callbacks.resolveFieldAnnotationSelectionFromElement?.(annotationEl);
47998
+ if (resolved) {
47999
+ try {
48000
+ const tr = editor.state.tr.setSelection(superEditor_converter.NodeSelection.create(editor.state.doc, resolved.pos));
48001
+ editor.view?.dispatch(tr);
48002
+ } catch {
48003
+ }
48004
+ editor.emit("fieldAnnotationDoubleClicked", {
48005
+ editor,
48006
+ node: resolved.node,
48007
+ nodePos: resolved.pos,
48008
+ event,
48009
+ currentTarget: annotationEl
48010
+ });
48011
+ }
48012
+ }
47991
48013
  #handleKeyDown(event) {
47992
48014
  if (!this.#deps) return;
47993
48015
  const sessionMode = this.#deps.getHeaderFooterSession()?.session?.mode ?? "body";
@@ -1,6 +1,6 @@
1
1
  import { B as Buffer$2 } from "./jszip-B1fkPkPJ.es.js";
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, F as Fragment, 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, 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, O as TrackInsertMarkName, Q as TrackFormatMarkName, U as AddMarkStep, V as RemoveMarkStep, W as CommandService, S as SuperConverter, X as EditorState, Y as unflattenListsInHtml, Z as SelectionRange, _ as Transform, $ as resolveParagraphProperties, a0 as resolveDocxFontFamily, a1 as _getReferencedTableStyles, a2 as decodeRPrFromMarks, a3 as calculateResolvedParagraphProperties, a4 as encodeCSSFromPPr, a5 as encodeCSSFromRPr, a6 as generateOrderedListIndex, a7 as docxNumberingHelpers, a8 as InputRule, a9 as insertNewRelationship, aa as kebabCase$1, ab as getUnderlineCssString } from "./SuperConverter-CLZ8o__p.es.js";
2
+ import { t as twipsToInches, i as inchesToTwips, p as ptToTwips, l as linesToTwips, a as twipsToLines, b as pixelsToTwips, r as resolveOpcTargetPath, h as halfPointToPoints, c as twipsToPixels$2, d as convertSizeToCSS, e as inchesToPixels } from "./helpers-BZLaTnr3.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, F as Fragment, 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, 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, O as TrackInsertMarkName, Q as TrackFormatMarkName, U as AddMarkStep, V as RemoveMarkStep, W as CommandService, S as SuperConverter, X as EditorState, Y as unflattenListsInHtml, Z as SelectionRange, _ as Transform, $ as resolveParagraphProperties, a0 as resolveDocxFontFamily, a1 as _getReferencedTableStyles, a2 as decodeRPrFromMarks, a3 as calculateResolvedParagraphProperties, a4 as encodeCSSFromPPr, a5 as encodeCSSFromRPr, a6 as generateOrderedListIndex, a7 as docxNumberingHelpers, a8 as InputRule, a9 as insertNewRelationship, aa as kebabCase$1, ab as getUnderlineCssString } from "./SuperConverter-BwBuaGR-.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 h$1, $ 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";
@@ -15422,18 +15422,13 @@ function processRelationships(root2, convertedXml, results) {
15422
15422
  wasProcessed = true;
15423
15423
  }
15424
15424
  if (isImageType(type)) {
15425
- const relPath = `word/${target.replace(/^\.?\//, "")}`;
15426
- if (/^media\/.+\.bin$/i.test(target) && relPath in convertedXml) {
15425
+ const relPath = resolveOpcTargetPath(target, "word");
15426
+ if (relPath && /^media\/.+\.bin$/i.test(target) && relPath in convertedXml) {
15427
15427
  binMediaTargets.add(`/${relPath}`);
15428
15428
  }
15429
15429
  }
15430
15430
  if (targetMode.toLowerCase() !== "external" && !looksExternal(target)) {
15431
- let likelyPath;
15432
- if (target.startsWith("../")) {
15433
- likelyPath = target.replace(/^\.\.\//, "");
15434
- } else {
15435
- likelyPath = `word/${target.replace(/^\.?\//, "")}`;
15436
- }
15431
+ const likelyPath = resolveOpcTargetPath(target, "word");
15437
15432
  if (!(likelyPath in convertedXml)) {
15438
15433
  if (!isImageType(type)) {
15439
15434
  results.push(`Removed relationship ${id} with missing target: ${target}`);
@@ -15778,7 +15773,7 @@ const canUseDOM = () => {
15778
15773
  return false;
15779
15774
  }
15780
15775
  };
15781
- const summaryVersion = "1.8.2-next.1";
15776
+ const summaryVersion = "1.8.2-next.2";
15782
15777
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
15783
15778
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
15784
15779
  function mapAttributes(attrs) {
@@ -18501,7 +18496,7 @@ class Editor extends EventEmitter {
18501
18496
  * Process collaboration migrations
18502
18497
  */
18503
18498
  processCollaborationMigrations() {
18504
- console.debug("[checkVersionMigrations] Current editor version", "1.8.2-next.1");
18499
+ console.debug("[checkVersionMigrations] Current editor version", "1.8.2-next.2");
18505
18500
  if (!this.options.ydoc) return;
18506
18501
  const metaMap = this.options.ydoc.getMap("meta");
18507
18502
  let docVersion = metaMap.get("version");
@@ -47946,6 +47941,14 @@ class EditorInputManager {
47946
47941
  #handleDoubleClick(event) {
47947
47942
  if (!this.#deps) return;
47948
47943
  if (event.button !== 0) return;
47944
+ const target = event.target;
47945
+ const annotationEl = target?.closest?.(".annotation[data-pm-start]");
47946
+ if (annotationEl) {
47947
+ event.preventDefault();
47948
+ event.stopPropagation();
47949
+ this.#handleAnnotationDoubleClick(event, annotationEl);
47950
+ return;
47951
+ }
47949
47952
  const layoutState = this.#deps.getLayoutState();
47950
47953
  if (!layoutState.layout) return;
47951
47954
  const viewportHost = this.#deps.getViewportHost();
@@ -47971,6 +47974,25 @@ class EditorInputManager {
47971
47974
  this.#callbacks.exitHeaderFooterMode?.();
47972
47975
  }
47973
47976
  }
47977
+ #handleAnnotationDoubleClick(event, annotationEl) {
47978
+ const editor = this.#deps?.getEditor();
47979
+ if (!editor?.isEditable) return;
47980
+ const resolved = this.#callbacks.resolveFieldAnnotationSelectionFromElement?.(annotationEl);
47981
+ if (resolved) {
47982
+ try {
47983
+ const tr = editor.state.tr.setSelection(NodeSelection.create(editor.state.doc, resolved.pos));
47984
+ editor.view?.dispatch(tr);
47985
+ } catch {
47986
+ }
47987
+ editor.emit("fieldAnnotationDoubleClicked", {
47988
+ editor,
47989
+ node: resolved.node,
47990
+ nodePos: resolved.pos,
47991
+ event,
47992
+ currentTarget: annotationEl
47993
+ });
47994
+ }
47995
+ }
47974
47996
  #handleKeyDown(event) {
47975
47997
  if (!this.#deps) return;
47976
47998
  const sessionMode = this.#deps.getHeaderFooterSession()?.session?.mode ?? "body";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("../chunks/jszip-C8_CqJxM.cjs");
4
- require("../chunks/helpers-nOdwpmwb.cjs");
5
- const superEditor_converter = require("../chunks/SuperConverter-CzZpTS13.cjs");
4
+ require("../chunks/helpers-CnY-716k.cjs");
5
+ const superEditor_converter = require("../chunks/SuperConverter-B39dCut-.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
- import "../chunks/helpers-C8e9wR5l.es.js";
3
- import { S } from "../chunks/SuperConverter-CLZ8o__p.es.js";
2
+ import "../chunks/helpers-BZLaTnr3.es.js";
3
+ import { S } from "../chunks/SuperConverter-BwBuaGR-.es.js";
4
4
  import "../chunks/uuid-CjlX8hrF.es.js";
5
5
  export {
6
6
  S as SuperConverter
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const jszip = require("../chunks/jszip-C8_CqJxM.cjs");
3
- const helpers = require("../chunks/helpers-nOdwpmwb.cjs");
3
+ const helpers = require("../chunks/helpers-CnY-716k.cjs");
4
4
  const jszip_min = require("../chunks/jszip.min-BPh2MMAa.cjs");
5
5
  const isXmlLike = (name) => /\.xml$|\.rels$/i.test(name);
6
6
  function sniffEncoding(u8) {
@@ -1,5 +1,5 @@
1
1
  import { B as Buffer } from "../chunks/jszip-B1fkPkPJ.es.js";
2
- import { g as getContentTypesFromXml, f as libExports } from "../chunks/helpers-C8e9wR5l.es.js";
2
+ import { g as getContentTypesFromXml, f as libExports } from "../chunks/helpers-BZLaTnr3.es.js";
3
3
  import { J as JSZip } from "../chunks/jszip.min-DCl8qkFO.es.js";
4
4
  const isXmlLike = (name) => /\.xml$|\.rels$/i.test(name);
5
5
  function sniffEncoding(u8) {
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./chunks/index-CAbg8dAQ.cjs");
3
+ const index = require("./chunks/index-DT0-49y4.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-CzZpTS13.cjs");
7
+ const superEditor_converter = require("./chunks/SuperConverter-B39dCut-.cjs");
8
8
  function isNodeType(node, name) {
9
9
  return node.type.name === name;
10
10
  }
@@ -1,9 +1,9 @@
1
- import { ax as Node, ay as Mark } from "./chunks/index-DR6N6rCG.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-DR6N6rCG.es.js";
1
+ import { ax as Node, ay as Mark } from "./chunks/index-DXRy_ln-.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-DXRy_ln-.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-CLZ8o__p.es.js";
6
+ import { S, r } from "./chunks/SuperConverter-BwBuaGR-.es.js";
7
7
  function isNodeType(node, name) {
8
8
  return node.type.name === name;
9
9
  }
@@ -0,0 +1,5 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {
2
+ $emit: (event: "close", ...args: any[]) => void;
3
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
4
+ export default _default;
5
+ //# sourceMappingURL=SidebarFieldAnnotations.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarFieldAnnotations.vue.d.ts","sourceRoot":"","sources":["../../../../../../src/dev/components/sidebar/SidebarFieldAnnotations.vue"],"names":[],"mappings":""}
package/dist/superdoc.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./chunks/index-CAbg8dAQ.cjs");
4
- const superdoc = require("./chunks/index-BTwCQoeP.cjs");
3
+ const index = require("./chunks/index-DT0-49y4.cjs");
4
+ const superdoc = require("./chunks/index-CmcLCoAA.cjs");
5
5
  const blankDocx = require("./chunks/blank-docx-DfW3Eeh2.cjs");
6
- const superEditor_converter = require("./chunks/SuperConverter-CzZpTS13.cjs");
6
+ const superEditor_converter = require("./chunks/SuperConverter-B39dCut-.cjs");
7
7
  require("./chunks/jszip-C8_CqJxM.cjs");
8
- require("./chunks/helpers-nOdwpmwb.cjs");
8
+ require("./chunks/helpers-CnY-716k.cjs");
9
9
  require("./chunks/jszip.min-BPh2MMAa.cjs");
10
10
  const superEditor_fileZipper = require("./super-editor/file-zipper.cjs");
11
11
  exports.AnnotatorHelpers = index.AnnotatorHelpers;
@@ -1,9 +1,9 @@
1
- import { au, ab, aw, av, as, a7, ac, ar, at } from "./chunks/index-DR6N6rCG.es.js";
2
- import { D, H, P, S, c } from "./chunks/index-DHWm6zEW.es.js";
1
+ import { au, ab, aw, av, as, a7, ac, ar, at } from "./chunks/index-DXRy_ln-.es.js";
2
+ import { D, H, P, S, c } from "./chunks/index-BpO3FO9M.es.js";
3
3
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
4
- import { S as S2, r } from "./chunks/SuperConverter-CLZ8o__p.es.js";
4
+ import { S as S2, r } from "./chunks/SuperConverter-BwBuaGR-.es.js";
5
5
  import "./chunks/jszip-B1fkPkPJ.es.js";
6
- import "./chunks/helpers-C8e9wR5l.es.js";
6
+ import "./chunks/helpers-BZLaTnr3.es.js";
7
7
  import "./chunks/jszip.min-DCl8qkFO.es.js";
8
8
  import { createZip } from "./super-editor/file-zipper.es.js";
9
9
  export {