@harbour-enterprises/superdoc 0.28.0-next.2 → 0.28.0-next.4

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.
Files changed (26) hide show
  1. package/dist/chunks/{PdfViewer-9z5hlRyt.es.js → PdfViewer-BEJ067au.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-Jb55JUCS.cjs → PdfViewer-DN_z8Gm_.cjs} +1 -1
  3. package/dist/chunks/{index-DqP-8_tO.es.js → index-2JqeR82k.es.js} +2 -2
  4. package/dist/chunks/{index-D0UvyM8m.cjs → index-DtdQc9FC.cjs} +2 -2
  5. package/dist/chunks/{super-editor.es-Ca5D3ZTW.cjs → super-editor.es-Bt97-Mx2.cjs} +53 -4
  6. package/dist/chunks/{super-editor.es-BBJIKdhr.es.js → super-editor.es-D2IuDGPV.es.js} +53 -4
  7. package/dist/super-editor/ai-writer.es.js +2 -2
  8. package/dist/super-editor/chunks/{converter-AR-76siZ.js → converter-CSVDRdnO.js} +52 -3
  9. package/dist/super-editor/chunks/{docx-zipper-DVb-VGgt.js → docx-zipper-rJLEcjUK.js} +1 -1
  10. package/dist/super-editor/chunks/{editor-mK_uimq6.js → editor-C0mzj9mg.js} +3 -3
  11. package/dist/super-editor/chunks/{toolbar-ByoNwr7x.js → toolbar-DDWcDJlY.js} +2 -2
  12. package/dist/super-editor/converter.es.js +1 -1
  13. package/dist/super-editor/docx-zipper.es.js +2 -2
  14. package/dist/super-editor/editor.es.js +3 -3
  15. package/dist/super-editor/file-zipper.es.js +1 -1
  16. package/dist/super-editor/super-editor/src/core/super-converter/exporter.d.ts +6 -0
  17. package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/sdt/helpers/translate-structured-content.d.ts +2 -2
  18. package/dist/super-editor/super-editor.es.js +6 -6
  19. package/dist/super-editor/toolbar.es.js +2 -2
  20. package/dist/super-editor.cjs +1 -1
  21. package/dist/super-editor.es.js +1 -1
  22. package/dist/superdoc.cjs +2 -2
  23. package/dist/superdoc.es.js +2 -2
  24. package/dist/superdoc.umd.js +53 -4
  25. package/dist/superdoc.umd.js.map +1 -1
  26. package/package.json +1 -1
@@ -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-DqP-8_tO.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-2JqeR82k.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-D0UvyM8m.cjs");
4
+ const superdoc = require("./index-DtdQc9FC.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -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-BBJIKdhr.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-D2IuDGPV.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";
@@ -17156,7 +17156,7 @@ const _sfc_main = {
17156
17156
  __name: "SuperDoc",
17157
17157
  emits: ["selection-update"],
17158
17158
  setup(__props, { emit: __emit }) {
17159
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-9z5hlRyt.es.js"));
17159
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-BEJ067au.es.js"));
17160
17160
  const superdocStore = useSuperdocStore();
17161
17161
  const commentsStore = useCommentsStore();
17162
17162
  const {
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-Ca5D3ZTW.cjs");
2
+ const superEditor_es = require("./super-editor.es-Bt97-Mx2.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");
@@ -17173,7 +17173,7 @@ const _sfc_main = {
17173
17173
  __name: "SuperDoc",
17174
17174
  emits: ["selection-update"],
17175
17175
  setup(__props, { emit: __emit }) {
17176
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-Jb55JUCS.cjs")));
17176
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-DN_z8Gm_.cjs")));
17177
17177
  const superdocStore = useSuperdocStore();
17178
17178
  const commentsStore = useCommentsStore();
17179
17179
  const {
@@ -30905,9 +30905,18 @@ function translateDocumentPartObj(params2) {
30905
30905
  return result;
30906
30906
  }
30907
30907
  function translateStructuredContent(params2) {
30908
- const { node } = params2;
30909
- const childContent = translateChildNodes({ ...params2, nodes: node.content });
30910
- const sdtContent = { name: "w:sdtContent", elements: childContent };
30908
+ const { node, isFinalDoc } = params2;
30909
+ const childContent = translateChildNodes({ ...params2, node });
30910
+ const childElements = Array.isArray(childContent) ? childContent : [childContent];
30911
+ if (isFinalDoc) {
30912
+ if (node?.type === "structuredContent") {
30913
+ return convertSdtContentToRuns(childElements);
30914
+ }
30915
+ if (node?.type === "structuredContentBlock") {
30916
+ return childElements.length === 1 ? childElements[0] : childElements;
30917
+ }
30918
+ }
30919
+ const sdtContent = { name: "w:sdtContent", elements: childElements };
30911
30920
  const sdtPr = generateSdtPrTagForStructuredContent({ node });
30912
30921
  const nodeElements = [sdtPr, sdtContent];
30913
30922
  const result = {
@@ -34120,6 +34129,7 @@ const config = {
34120
34129
  attributes: validXmlAttributes
34121
34130
  };
34122
34131
  const translator = NodeTranslator.from(config);
34132
+ const RUN_LEVEL_WRAPPERS = /* @__PURE__ */ new Set(["w:hyperlink", "w:ins", "w:del"]);
34123
34133
  const DEFAULT_SECTION_PROPS_TWIPS = Object.freeze({
34124
34134
  pageSize: Object.freeze({ width: "12240", height: "15840" }),
34125
34135
  pageMargins: Object.freeze({
@@ -34185,6 +34195,45 @@ const isLineBreakOnlyRun = (node) => {
34185
34195
  if (!runContent.length) return false;
34186
34196
  return runContent.every((child) => child?.type === "lineBreak" || child?.type === "hardBreak");
34187
34197
  };
34198
+ function convertSdtContentToRuns(elements) {
34199
+ const normalized = Array.isArray(elements) ? elements : [elements];
34200
+ const runs = [];
34201
+ normalized.forEach((element) => {
34202
+ if (!element) return;
34203
+ if (element.name === "w:sdtPr") {
34204
+ return;
34205
+ }
34206
+ if (element.name === "w:r") {
34207
+ runs.push(element);
34208
+ return;
34209
+ }
34210
+ if (element.name === "w:sdt") {
34211
+ const sdtContent = (element.elements || []).find((child) => child?.name === "w:sdtContent");
34212
+ if (sdtContent?.elements) {
34213
+ runs.push(...convertSdtContentToRuns(sdtContent.elements));
34214
+ }
34215
+ return;
34216
+ }
34217
+ if (RUN_LEVEL_WRAPPERS.has(element.name)) {
34218
+ const wrapperElements = convertSdtContentToRuns(element.elements || []);
34219
+ if (wrapperElements.length) {
34220
+ runs.push({
34221
+ ...element,
34222
+ elements: wrapperElements
34223
+ });
34224
+ }
34225
+ return;
34226
+ }
34227
+ if (element.name) {
34228
+ runs.push({
34229
+ name: "w:r",
34230
+ type: "element",
34231
+ elements: element.elements || [element]
34232
+ });
34233
+ }
34234
+ });
34235
+ return runs.filter((run2) => Array.isArray(run2.elements) && run2.elements.length > 0);
34236
+ }
34188
34237
  function exportSchemaToJson(params2) {
34189
34238
  const { type: type2 } = params2.node || {};
34190
34239
  const router = {
@@ -65595,7 +65644,7 @@ const Image = Node$1.create({
65595
65644
  return {
65596
65645
  allowBase64: true,
65597
65646
  htmlAttributes: {
65598
- style: "display: inline-block; content-visibility: auto; contain-intrinsic-size: auto 600px;",
65647
+ style: "display: inline-block;",
65599
65648
  "aria-label": "Image node"
65600
65649
  }
65601
65650
  };
@@ -30888,9 +30888,18 @@ function translateDocumentPartObj(params2) {
30888
30888
  return result;
30889
30889
  }
30890
30890
  function translateStructuredContent(params2) {
30891
- const { node } = params2;
30892
- const childContent = translateChildNodes({ ...params2, nodes: node.content });
30893
- const sdtContent = { name: "w:sdtContent", elements: childContent };
30891
+ const { node, isFinalDoc } = params2;
30892
+ const childContent = translateChildNodes({ ...params2, node });
30893
+ const childElements = Array.isArray(childContent) ? childContent : [childContent];
30894
+ if (isFinalDoc) {
30895
+ if (node?.type === "structuredContent") {
30896
+ return convertSdtContentToRuns(childElements);
30897
+ }
30898
+ if (node?.type === "structuredContentBlock") {
30899
+ return childElements.length === 1 ? childElements[0] : childElements;
30900
+ }
30901
+ }
30902
+ const sdtContent = { name: "w:sdtContent", elements: childElements };
30894
30903
  const sdtPr = generateSdtPrTagForStructuredContent({ node });
30895
30904
  const nodeElements = [sdtPr, sdtContent];
30896
30905
  const result = {
@@ -34103,6 +34112,7 @@ const config = {
34103
34112
  attributes: validXmlAttributes
34104
34113
  };
34105
34114
  const translator = NodeTranslator.from(config);
34115
+ const RUN_LEVEL_WRAPPERS = /* @__PURE__ */ new Set(["w:hyperlink", "w:ins", "w:del"]);
34106
34116
  const DEFAULT_SECTION_PROPS_TWIPS = Object.freeze({
34107
34117
  pageSize: Object.freeze({ width: "12240", height: "15840" }),
34108
34118
  pageMargins: Object.freeze({
@@ -34168,6 +34178,45 @@ const isLineBreakOnlyRun = (node) => {
34168
34178
  if (!runContent.length) return false;
34169
34179
  return runContent.every((child) => child?.type === "lineBreak" || child?.type === "hardBreak");
34170
34180
  };
34181
+ function convertSdtContentToRuns(elements) {
34182
+ const normalized = Array.isArray(elements) ? elements : [elements];
34183
+ const runs = [];
34184
+ normalized.forEach((element) => {
34185
+ if (!element) return;
34186
+ if (element.name === "w:sdtPr") {
34187
+ return;
34188
+ }
34189
+ if (element.name === "w:r") {
34190
+ runs.push(element);
34191
+ return;
34192
+ }
34193
+ if (element.name === "w:sdt") {
34194
+ const sdtContent = (element.elements || []).find((child) => child?.name === "w:sdtContent");
34195
+ if (sdtContent?.elements) {
34196
+ runs.push(...convertSdtContentToRuns(sdtContent.elements));
34197
+ }
34198
+ return;
34199
+ }
34200
+ if (RUN_LEVEL_WRAPPERS.has(element.name)) {
34201
+ const wrapperElements = convertSdtContentToRuns(element.elements || []);
34202
+ if (wrapperElements.length) {
34203
+ runs.push({
34204
+ ...element,
34205
+ elements: wrapperElements
34206
+ });
34207
+ }
34208
+ return;
34209
+ }
34210
+ if (element.name) {
34211
+ runs.push({
34212
+ name: "w:r",
34213
+ type: "element",
34214
+ elements: element.elements || [element]
34215
+ });
34216
+ }
34217
+ });
34218
+ return runs.filter((run2) => Array.isArray(run2.elements) && run2.elements.length > 0);
34219
+ }
34171
34220
  function exportSchemaToJson(params2) {
34172
34221
  const { type: type2 } = params2.node || {};
34173
34222
  const router = {
@@ -65578,7 +65627,7 @@ const Image = Node$1.create({
65578
65627
  return {
65579
65628
  allowBase64: true,
65580
65629
  htmlAttributes: {
65581
- style: "display: inline-block; content-visibility: auto; contain-intrinsic-size: auto 600px;",
65630
+ style: "display: inline-block;",
65582
65631
  "aria-label": "Image node"
65583
65632
  }
65584
65633
  };
@@ -1,6 +1,6 @@
1
1
  import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
2
- import { T as TextSelection } from "./chunks/converter-AR-76siZ.js";
3
- import { _ as _export_sfc } from "./chunks/editor-mK_uimq6.js";
2
+ import { T as TextSelection } from "./chunks/converter-CSVDRdnO.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-C0mzj9mg.js";
4
4
  const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
5
5
  const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
6
6
  async function baseInsightsFetch(payload, options = {}) {
@@ -30895,9 +30895,18 @@ function translateDocumentPartObj(params) {
30895
30895
  return result;
30896
30896
  }
30897
30897
  function translateStructuredContent(params) {
30898
- const { node } = params;
30899
- const childContent = translateChildNodes({ ...params, nodes: node.content });
30900
- const sdtContent = { name: "w:sdtContent", elements: childContent };
30898
+ const { node, isFinalDoc } = params;
30899
+ const childContent = translateChildNodes({ ...params, node });
30900
+ const childElements = Array.isArray(childContent) ? childContent : [childContent];
30901
+ if (isFinalDoc) {
30902
+ if (node?.type === "structuredContent") {
30903
+ return convertSdtContentToRuns(childElements);
30904
+ }
30905
+ if (node?.type === "structuredContentBlock") {
30906
+ return childElements.length === 1 ? childElements[0] : childElements;
30907
+ }
30908
+ }
30909
+ const sdtContent = { name: "w:sdtContent", elements: childElements };
30901
30910
  const sdtPr = generateSdtPrTagForStructuredContent({ node });
30902
30911
  const nodeElements = [sdtPr, sdtContent];
30903
30912
  const result = {
@@ -34110,6 +34119,7 @@ const config = {
34110
34119
  attributes: validXmlAttributes
34111
34120
  };
34112
34121
  const translator = NodeTranslator.from(config);
34122
+ const RUN_LEVEL_WRAPPERS = /* @__PURE__ */ new Set(["w:hyperlink", "w:ins", "w:del"]);
34113
34123
  const DEFAULT_SECTION_PROPS_TWIPS = Object.freeze({
34114
34124
  pageSize: Object.freeze({ width: "12240", height: "15840" }),
34115
34125
  pageMargins: Object.freeze({
@@ -34175,6 +34185,45 @@ const isLineBreakOnlyRun = (node) => {
34175
34185
  if (!runContent.length) return false;
34176
34186
  return runContent.every((child) => child?.type === "lineBreak" || child?.type === "hardBreak");
34177
34187
  };
34188
+ function convertSdtContentToRuns(elements) {
34189
+ const normalized = Array.isArray(elements) ? elements : [elements];
34190
+ const runs = [];
34191
+ normalized.forEach((element) => {
34192
+ if (!element) return;
34193
+ if (element.name === "w:sdtPr") {
34194
+ return;
34195
+ }
34196
+ if (element.name === "w:r") {
34197
+ runs.push(element);
34198
+ return;
34199
+ }
34200
+ if (element.name === "w:sdt") {
34201
+ const sdtContent = (element.elements || []).find((child) => child?.name === "w:sdtContent");
34202
+ if (sdtContent?.elements) {
34203
+ runs.push(...convertSdtContentToRuns(sdtContent.elements));
34204
+ }
34205
+ return;
34206
+ }
34207
+ if (RUN_LEVEL_WRAPPERS.has(element.name)) {
34208
+ const wrapperElements = convertSdtContentToRuns(element.elements || []);
34209
+ if (wrapperElements.length) {
34210
+ runs.push({
34211
+ ...element,
34212
+ elements: wrapperElements
34213
+ });
34214
+ }
34215
+ return;
34216
+ }
34217
+ if (element.name) {
34218
+ runs.push({
34219
+ name: "w:r",
34220
+ type: "element",
34221
+ elements: element.elements || [element]
34222
+ });
34223
+ }
34224
+ });
34225
+ return runs.filter((run2) => Array.isArray(run2.elements) && run2.elements.length > 0);
34226
+ }
34178
34227
  function exportSchemaToJson(params) {
34179
34228
  const { type: type2 } = params.node || {};
34180
34229
  const router = {
@@ -1,4 +1,4 @@
1
- import { p as process$1, az as commonjsGlobal, B as Buffer, aA as getDefaultExportFromCjs, aB as getContentTypesFromXml, aC as xmljs } from "./converter-AR-76siZ.js";
1
+ import { p as process$1, az as commonjsGlobal, B as Buffer, aA as getDefaultExportFromCjs, aB as getContentTypesFromXml, aC as xmljs } from "./converter-CSVDRdnO.js";
2
2
  function commonjsRequire(path) {
3
3
  throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
4
4
  }
@@ -12,9 +12,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
12
12
  var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, checkFonts_fn, determineUnsupportedFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ListItemNodeView_instances, init_fn3, applyIndentStyling_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn;
13
13
  import * as Y from "yjs";
14
14
  import { UndoManager, Item as Item$1, ContentType, Text as Text$1, XmlElement, encodeStateAsUpdate } from "yjs";
15
- import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as ReplaceStep, E as NodeRange, G as findWrapping, L as ListHelpers, H as findParentNode, I as isMacOS, J as isIOS, K as getSchemaTypeByName, O as inputRulesPlugin, Q as TrackDeleteMarkName, U as TrackInsertMarkName, V as v4, W as TrackFormatMarkName, X as comments_module_events, Y as findMark, Z as objectIncludes, _ as AddMarkStep, $ as RemoveMarkStep, a0 as twipsToLines, a1 as pixelsToTwips, a2 as helpers, a3 as posToDOMRect, a4 as CommandService, a5 as SuperConverter, a6 as createDocument, a7 as createDocFromMarkdown, a8 as createDocFromHTML, a9 as EditorState, aa as hasSomeParentWithClass, ab as isActive, ac as unflattenListsInHtml, ad as parseSizeUnit, ae as minMax, af as getLineHeightValueString, ag as updateDOMAttributes, ah as findChildren$5, ai as htmlHandler, aj as generateRandomSigned32BitIntStrId, ak as InputRule, al as kebabCase, am as findParentNodeClosestToPos, an as getListItemStyleDefinitions, ao as docxNumberingHelpers, ap as parseIndentElement, aq as combineIndents, ar as twipsToPixels, as as PIXELS_PER_INCH, at as SelectionRange, au as Transform, av as isInTable$1, aw as generateDocxRandomId, ax as insertNewRelationship, ay as inchesToPixels } from "./converter-AR-76siZ.js";
15
+ import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as ReplaceStep, E as NodeRange, G as findWrapping, L as ListHelpers, H as findParentNode, I as isMacOS, J as isIOS, K as getSchemaTypeByName, O as inputRulesPlugin, Q as TrackDeleteMarkName, U as TrackInsertMarkName, V as v4, W as TrackFormatMarkName, X as comments_module_events, Y as findMark, Z as objectIncludes, _ as AddMarkStep, $ as RemoveMarkStep, a0 as twipsToLines, a1 as pixelsToTwips, a2 as helpers, a3 as posToDOMRect, a4 as CommandService, a5 as SuperConverter, a6 as createDocument, a7 as createDocFromMarkdown, a8 as createDocFromHTML, a9 as EditorState, aa as hasSomeParentWithClass, ab as isActive, ac as unflattenListsInHtml, ad as parseSizeUnit, ae as minMax, af as getLineHeightValueString, ag as updateDOMAttributes, ah as findChildren$5, ai as htmlHandler, aj as generateRandomSigned32BitIntStrId, ak as InputRule, al as kebabCase, am as findParentNodeClosestToPos, an as getListItemStyleDefinitions, ao as docxNumberingHelpers, ap as parseIndentElement, aq as combineIndents, ar as twipsToPixels, as as PIXELS_PER_INCH, at as SelectionRange, au as Transform, av as isInTable$1, aw as generateDocxRandomId, ax as insertNewRelationship, ay as inchesToPixels } from "./converter-CSVDRdnO.js";
16
16
  import { ref, computed, createElementBlock, openBlock, withModifiers, Fragment as Fragment$1, renderList, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, createApp } from "vue";
17
- import { D as DocxZipper } from "./docx-zipper-DVb-VGgt.js";
17
+ import { D as DocxZipper } from "./docx-zipper-rJLEcjUK.js";
18
18
  var GOOD_LEAF_SIZE = 200;
19
19
  var RopeSequence = function RopeSequence2() {
20
20
  };
@@ -27162,7 +27162,7 @@ const Image = Node$1.create({
27162
27162
  return {
27163
27163
  allowBase64: true,
27164
27164
  htmlAttributes: {
27165
- style: "display: inline-block; content-visibility: auto; contain-intrinsic-size: auto 600px;",
27165
+ style: "display: inline-block;",
27166
27166
  "aria-label": "Image node"
27167
27167
  }
27168
27168
  };
@@ -1,6 +1,6 @@
1
1
  import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
2
- import { p as process$1 } from "./converter-AR-76siZ.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-mK_uimq6.js";
2
+ import { p as process$1 } from "./converter-CSVDRdnO.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-C0mzj9mg.js";
4
4
  const sanitizeNumber = (value, defaultNumber) => {
5
5
  let sanitized = value.replace(/[^0-9.]/g, "");
6
6
  sanitized = parseFloat(sanitized);
@@ -1,4 +1,4 @@
1
- import { a5 } from "./chunks/converter-AR-76siZ.js";
1
+ import { a5 } from "./chunks/converter-CSVDRdnO.js";
2
2
  import "vue";
3
3
  export {
4
4
  a5 as SuperConverter
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-AR-76siZ.js";
2
- import { D } from "./chunks/docx-zipper-DVb-VGgt.js";
1
+ import "./chunks/converter-CSVDRdnO.js";
2
+ import { D } from "./chunks/docx-zipper-rJLEcjUK.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-mK_uimq6.js";
2
- import "./chunks/converter-AR-76siZ.js";
3
- import "./chunks/docx-zipper-DVb-VGgt.js";
1
+ import { E } from "./chunks/editor-C0mzj9mg.js";
2
+ import "./chunks/converter-CSVDRdnO.js";
3
+ import "./chunks/docx-zipper-rJLEcjUK.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-DVb-VGgt.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-rJLEcjUK.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Convert SDT child elements into Word run elements.
3
+ * @param {Array<Object>|Object} elements
4
+ * @returns {Array<Object>}
5
+ */
6
+ export function convertSdtContentToRuns(elements: Array<any> | any): Array<any>;
1
7
  /**
2
8
  * @typedef {Object} ExportParams
3
9
  * @property {Object} node JSON node to translate (from PM schema)
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * @param {Object} params - The parameters for translation.
3
- * @returns {Object} The XML representation.
3
+ * @returns {Object|Array|Object[]} The XML representation.
4
4
  */
5
- export function translateStructuredContent(params: any): any;
5
+ export function translateStructuredContent(params: any): any | any[] | any[];
@@ -9,14 +9,14 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
11
11
  var _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, enrichTrackedChanges_fn, runCommandWithArgumentOnly_fn;
12
- import { aA as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, aD as vClickOutside, H as findParentNode, aE as getActiveFormatting, av as isInTable, aF as readFromClipboard, aG as handleClipboardPaste, aH as getFileObject, aI as runPropertyTranslators, aJ as translator, aK as translator$1, aL as translator$2, aM as translator$3, aN as translator$4, aO as translator$5, aP as translator$6, aQ as translator$7, aR as translator$8, aS as translator$9, aT as translator$a, aU as translator$b, aV as translator$c, aW as translator$d, aX as translator$e, aY as commentRangeEndTranslator, aZ as commentRangeStartTranslator, a_ as translator$f, a$ as translator$g, b0 as translator$h, b1 as translator$i, b2 as translator$j, b3 as translator$k, b4 as translator$l, b5 as translator$m, b6 as translator$n, b7 as translator$o, b8 as translator$p, b9 as translator$q, ba as translator$r, bb as translator$s, bc as translator$t, bd as translator$u, be as translator$v, bf as translator$w, bg as translator$x, bh as translator$y, bi as translator$z, bj as translator$A, bk as translator$B, bl as translator$C, bm as translator$D, bn as translator$E, bo as translator$F, bp as translator$G, bq as translator$H, br as translator$I, bs as translator$J, bt as translator$K, bu as translator$L, bv as translator$M, bw as translator$N, bx as translator$O, by as translator$P, bz as translator$Q, bA as translator$R, bB as translator$S, bC as translator$T, bD as translator$U, bE as translator$V, bF as translator$W, bG as translator$X, bH as translator$Y, bI as translator$Z, bJ as translator$_, bK as translator$$, bL as translator$10, bM as translator$11, bN as translator$12, bO as translator$13, bP as translator$14, bQ as translator$15, bR as translator$16, bS as translator$17, bT as translator$18, bU as translator$19, bV as translator$1a, bW as translator$1b, bX as translator$1c, bY as translator$1d, bZ as translator$1e, b_ as translator$1f, b$ as translator$1g, c0 as translator$1h, P as PluginKey, a as Plugin } from "./chunks/converter-AR-76siZ.js";
13
- import { c1, a5, i, a2 } from "./chunks/converter-AR-76siZ.js";
14
- import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, f as collectTrackedChanges, i as isTrackedChangeActionAllowed, y as yUndoPluginKey, h as undoDepth, j as redoDepth, k as collectTrackedChangesForContext, s as shouldBypassContextMenu, S as SlashMenuPluginKey, E as Editor, l as getStarterExtensions, P as Placeholder, m as getRichTextExtensions, D as DecorationSet, n as Decoration, M as Mark, o as Extension, A as Attribute, N as Node } from "./chunks/editor-mK_uimq6.js";
15
- import { t, C, v, T, p, w, q } from "./chunks/editor-mK_uimq6.js";
12
+ import { aA as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, aD as vClickOutside, H as findParentNode, aE as getActiveFormatting, av as isInTable, aF as readFromClipboard, aG as handleClipboardPaste, aH as getFileObject, aI as runPropertyTranslators, aJ as translator, aK as translator$1, aL as translator$2, aM as translator$3, aN as translator$4, aO as translator$5, aP as translator$6, aQ as translator$7, aR as translator$8, aS as translator$9, aT as translator$a, aU as translator$b, aV as translator$c, aW as translator$d, aX as translator$e, aY as commentRangeEndTranslator, aZ as commentRangeStartTranslator, a_ as translator$f, a$ as translator$g, b0 as translator$h, b1 as translator$i, b2 as translator$j, b3 as translator$k, b4 as translator$l, b5 as translator$m, b6 as translator$n, b7 as translator$o, b8 as translator$p, b9 as translator$q, ba as translator$r, bb as translator$s, bc as translator$t, bd as translator$u, be as translator$v, bf as translator$w, bg as translator$x, bh as translator$y, bi as translator$z, bj as translator$A, bk as translator$B, bl as translator$C, bm as translator$D, bn as translator$E, bo as translator$F, bp as translator$G, bq as translator$H, br as translator$I, bs as translator$J, bt as translator$K, bu as translator$L, bv as translator$M, bw as translator$N, bx as translator$O, by as translator$P, bz as translator$Q, bA as translator$R, bB as translator$S, bC as translator$T, bD as translator$U, bE as translator$V, bF as translator$W, bG as translator$X, bH as translator$Y, bI as translator$Z, bJ as translator$_, bK as translator$$, bL as translator$10, bM as translator$11, bN as translator$12, bO as translator$13, bP as translator$14, bQ as translator$15, bR as translator$16, bS as translator$17, bT as translator$18, bU as translator$19, bV as translator$1a, bW as translator$1b, bX as translator$1c, bY as translator$1d, bZ as translator$1e, b_ as translator$1f, b$ as translator$1g, c0 as translator$1h, P as PluginKey, a as Plugin } from "./chunks/converter-CSVDRdnO.js";
13
+ import { c1, a5, i, a2 } from "./chunks/converter-CSVDRdnO.js";
14
+ import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, f as collectTrackedChanges, i as isTrackedChangeActionAllowed, y as yUndoPluginKey, h as undoDepth, j as redoDepth, k as collectTrackedChangesForContext, s as shouldBypassContextMenu, S as SlashMenuPluginKey, E as Editor, l as getStarterExtensions, P as Placeholder, m as getRichTextExtensions, D as DecorationSet, n as Decoration, M as Mark, o as Extension, A as Attribute, N as Node } from "./chunks/editor-C0mzj9mg.js";
15
+ import { t, C, v, T, p, w, q } from "./chunks/editor-C0mzj9mg.js";
16
16
  import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, toDisplayString, createCommentVNode, normalizeStyle, computed, watch, withDirectives, withKeys, vModelText, createTextVNode, createVNode, h, createApp, markRaw, nextTick, onBeforeUnmount, reactive, onUnmounted, renderSlot, shallowRef, createBlock, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps } from "vue";
17
- import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, p as plusIconSvg, a as trashIconSvg, b as borderNoneIconSvg, c as arrowsToDotIconSvg, d as arrowsLeftRightIconSvg, w as wrenchIconSvg, m as magicWandIcon, e as checkIconSvg$1, x as xMarkIconSvg, l as linkIconSvg, f as tableIconSvg, g as scissorsIconSvg, h as copyIconSvg, i as pasteIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-ByoNwr7x.js";
17
+ import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, p as plusIconSvg, a as trashIconSvg, b as borderNoneIconSvg, c as arrowsToDotIconSvg, d as arrowsLeftRightIconSvg, w as wrenchIconSvg, m as magicWandIcon, e as checkIconSvg$1, x as xMarkIconSvg, l as linkIconSvg, f as tableIconSvg, g as scissorsIconSvg, h as copyIconSvg, i as pasteIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-DDWcDJlY.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-DVb-VGgt.js";
19
+ import { D } from "./chunks/docx-zipper-rJLEcjUK.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  var hasRequiredEventemitter3;
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-ByoNwr7x.js";
3
- import "./chunks/editor-mK_uimq6.js";
2
+ import { T } from "./chunks/toolbar-DDWcDJlY.js";
3
+ import "./chunks/editor-C0mzj9mg.js";
4
4
  export {
5
5
  T as default
6
6
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-Ca5D3ZTW.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-Bt97-Mx2.cjs");
4
4
  require("./chunks/vue-DKMj1I9B.cjs");
5
5
  exports.AIWriter = superEditor_es.AIWriter;
6
6
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
@@ -1,4 +1,4 @@
1
- import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-BBJIKdhr.es.js";
1
+ import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-D2IuDGPV.es.js";
2
2
  import "./chunks/vue-ZWZLQtoU.es.js";
3
3
  export {
4
4
  A as AIWriter,
package/dist/superdoc.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-Ca5D3ZTW.cjs");
4
- const superdoc = require("./chunks/index-D0UvyM8m.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-Bt97-Mx2.cjs");
4
+ const superdoc = require("./chunks/index-DtdQc9FC.cjs");
5
5
  require("./chunks/vue-DKMj1I9B.cjs");
6
6
  const blankDocx = require("./chunks/blank-docx-DfW3Eeh2.cjs");
7
7
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
@@ -1,5 +1,5 @@
1
- import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-BBJIKdhr.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-DqP-8_tO.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-D2IuDGPV.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-2JqeR82k.es.js";
3
3
  import "./chunks/vue-ZWZLQtoU.es.js";
4
4
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
5
5
  export {
@@ -38630,9 +38630,18 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38630
38630
  return result;
38631
38631
  }
38632
38632
  function translateStructuredContent(params2) {
38633
- const { node } = params2;
38634
- const childContent = translateChildNodes({ ...params2, nodes: node.content });
38635
- const sdtContent = { name: "w:sdtContent", elements: childContent };
38633
+ const { node, isFinalDoc } = params2;
38634
+ const childContent = translateChildNodes({ ...params2, node });
38635
+ const childElements = Array.isArray(childContent) ? childContent : [childContent];
38636
+ if (isFinalDoc) {
38637
+ if (node?.type === "structuredContent") {
38638
+ return convertSdtContentToRuns(childElements);
38639
+ }
38640
+ if (node?.type === "structuredContentBlock") {
38641
+ return childElements.length === 1 ? childElements[0] : childElements;
38642
+ }
38643
+ }
38644
+ const sdtContent = { name: "w:sdtContent", elements: childElements };
38636
38645
  const sdtPr = generateSdtPrTagForStructuredContent({ node });
38637
38646
  const nodeElements = [sdtPr, sdtContent];
38638
38647
  const result = {
@@ -41818,6 +41827,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
41818
41827
  attributes: validXmlAttributes
41819
41828
  };
41820
41829
  const translator = NodeTranslator.from(config);
41830
+ const RUN_LEVEL_WRAPPERS = /* @__PURE__ */ new Set(["w:hyperlink", "w:ins", "w:del"]);
41821
41831
  const DEFAULT_SECTION_PROPS_TWIPS = Object.freeze({
41822
41832
  pageSize: Object.freeze({ width: "12240", height: "15840" }),
41823
41833
  pageMargins: Object.freeze({
@@ -41883,6 +41893,45 @@ Please report this to https://github.com/markedjs/marked.`, e) {
41883
41893
  if (!runContent.length) return false;
41884
41894
  return runContent.every((child) => child?.type === "lineBreak" || child?.type === "hardBreak");
41885
41895
  };
41896
+ function convertSdtContentToRuns(elements) {
41897
+ const normalized = Array.isArray(elements) ? elements : [elements];
41898
+ const runs = [];
41899
+ normalized.forEach((element) => {
41900
+ if (!element) return;
41901
+ if (element.name === "w:sdtPr") {
41902
+ return;
41903
+ }
41904
+ if (element.name === "w:r") {
41905
+ runs.push(element);
41906
+ return;
41907
+ }
41908
+ if (element.name === "w:sdt") {
41909
+ const sdtContent = (element.elements || []).find((child) => child?.name === "w:sdtContent");
41910
+ if (sdtContent?.elements) {
41911
+ runs.push(...convertSdtContentToRuns(sdtContent.elements));
41912
+ }
41913
+ return;
41914
+ }
41915
+ if (RUN_LEVEL_WRAPPERS.has(element.name)) {
41916
+ const wrapperElements = convertSdtContentToRuns(element.elements || []);
41917
+ if (wrapperElements.length) {
41918
+ runs.push({
41919
+ ...element,
41920
+ elements: wrapperElements
41921
+ });
41922
+ }
41923
+ return;
41924
+ }
41925
+ if (element.name) {
41926
+ runs.push({
41927
+ name: "w:r",
41928
+ type: "element",
41929
+ elements: element.elements || [element]
41930
+ });
41931
+ }
41932
+ });
41933
+ return runs.filter((run2) => Array.isArray(run2.elements) && run2.elements.length > 0);
41934
+ }
41886
41935
  function exportSchemaToJson(params2) {
41887
41936
  const { type: type2 } = params2.node || {};
41888
41937
  const router = {
@@ -73293,7 +73342,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
73293
73342
  return {
73294
73343
  allowBase64: true,
73295
73344
  htmlAttributes: {
73296
- style: "display: inline-block; content-visibility: auto; contain-intrinsic-size: auto 600px;",
73345
+ style: "display: inline-block;",
73297
73346
  "aria-label": "Image node"
73298
73347
  }
73299
73348
  };