@harbour-enterprises/superdoc 0.18.0-next.7 → 0.18.0-next.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{PdfViewer-D8DhK7x_.cjs → PdfViewer-B6aQ9Btm.cjs} +1 -1
- package/dist/chunks/{PdfViewer-Db-y1BOK.es.js → PdfViewer-bV0Nu1AE.es.js} +1 -1
- package/dist/chunks/{index-gPQ_psn7.es.js → index-B4iJqRzO.es.js} +2 -2
- package/dist/chunks/{index-B2vhAyq8.cjs → index-DHYO80_n.cjs} +2 -2
- package/dist/chunks/{super-editor.es-DQ7fZbC0.cjs → super-editor.es-CLOaeb5i.cjs} +29 -3
- package/dist/chunks/{super-editor.es-BxGYOWJs.es.js → super-editor.es-CW3H3ZkZ.es.js} +29 -3
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-Cd1Nn-Yo.js → converter-w8KtZzlN.js} +29 -3
- package/dist/super-editor/chunks/{docx-zipper-Bb5bKoz2.js → docx-zipper-HBvnt_-z.js} +1 -1
- package/dist/super-editor/chunks/{editor-BeAxGXb9.js → editor-C2iCXpca.js} +2 -2
- package/dist/super-editor/chunks/{toolbar-C_zg3l4P.js → toolbar-BYNEDGz5.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/src/core/super-converter/v2/importer/docxImporter.d.ts +15 -0
- package/dist/super-editor/super-editor.es.js +6 -6
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +29 -3
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const vue = require("./vue-DWle4Cai.cjs");
|
|
4
|
-
const superdoc = require("./index-
|
|
4
|
+
const superdoc = require("./index-DHYO80_n.cjs");
|
|
5
5
|
function self(vars) {
|
|
6
6
|
const {
|
|
7
7
|
opacityDisabled,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as defineComponent, B as h, O as Transition, $ as process$1, I as watchEffect, d as computed, r as ref, j as onMounted, W as onUnmounted, c as createElementBlock, o as openBlock, a as createBaseVNode, f as createCommentVNode, v as createVNode, x as unref } from "./vue-CXxsqYcP.es.js";
|
|
2
|
-
import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-
|
|
2
|
+
import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-B4iJqRzO.es.js";
|
|
3
3
|
function self(vars) {
|
|
4
4
|
const {
|
|
5
5
|
opacityDisabled,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { q as index$1, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-
|
|
1
|
+
import { q as index$1, 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-CW3H3ZkZ.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-CXxsqYcP.es.js";
|
|
3
3
|
import { B as Buffer$2 } from "./jszip-B8KIZSNe.es.js";
|
|
4
4
|
import { B as BlankDOCX } from "./blank-docx-iwdyG9RH.es.js";
|
|
@@ -17248,7 +17248,7 @@ const _sfc_main = {
|
|
|
17248
17248
|
__name: "SuperDoc",
|
|
17249
17249
|
emits: ["selection-update"],
|
|
17250
17250
|
setup(__props, { emit: __emit }) {
|
|
17251
|
-
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-
|
|
17251
|
+
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-bV0Nu1AE.es.js"));
|
|
17252
17252
|
const superdocStore = useSuperdocStore();
|
|
17253
17253
|
const commentsStore = useCommentsStore();
|
|
17254
17254
|
const {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const superEditor_es = require("./super-editor.es-
|
|
2
|
+
const superEditor_es = require("./super-editor.es-CLOaeb5i.cjs");
|
|
3
3
|
const vue = require("./vue-DWle4Cai.cjs");
|
|
4
4
|
const jszip = require("./jszip-b7l8QkfH.cjs");
|
|
5
5
|
const blankDocx = require("./blank-docx-CPqX9RF5.cjs");
|
|
@@ -17265,7 +17265,7 @@ const _sfc_main = {
|
|
|
17265
17265
|
__name: "SuperDoc",
|
|
17266
17266
|
emits: ["selection-update"],
|
|
17267
17267
|
setup(__props, { emit: __emit }) {
|
|
17268
|
-
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-
|
|
17268
|
+
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-B6aQ9Btm.cjs")));
|
|
17269
17269
|
const superdocStore = useSuperdocStore();
|
|
17270
17270
|
const commentsStore = useCommentsStore();
|
|
17271
17271
|
const {
|
|
@@ -30180,7 +30180,7 @@ const createDocumentJson = (docx, converter, editor) => {
|
|
|
30180
30180
|
const content = pruneIgnoredNodes(contentElements);
|
|
30181
30181
|
const comments = importCommentData({ docx, converter, editor });
|
|
30182
30182
|
const lists = {};
|
|
30183
|
-
|
|
30183
|
+
let parsedContent = nodeListHandler2.handler({
|
|
30184
30184
|
nodes: content,
|
|
30185
30185
|
nodeListHandler: nodeListHandler2,
|
|
30186
30186
|
docx,
|
|
@@ -30189,6 +30189,7 @@ const createDocumentJson = (docx, converter, editor) => {
|
|
|
30189
30189
|
lists,
|
|
30190
30190
|
path: []
|
|
30191
30191
|
});
|
|
30192
|
+
parsedContent = filterOutRootInlineNodes(parsedContent);
|
|
30192
30193
|
const result = {
|
|
30193
30194
|
type: "doc",
|
|
30194
30195
|
content: parsedContent,
|
|
@@ -30465,7 +30466,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
|
|
|
30465
30466
|
let sectionType = sectPrHeader?.attributes["w:type"];
|
|
30466
30467
|
if (converter.headerIds[sectionType]) sectionType = null;
|
|
30467
30468
|
const nodeListHandler2 = defaultNodeListHandler();
|
|
30468
|
-
|
|
30469
|
+
let schema = nodeListHandler2.handler({
|
|
30469
30470
|
nodes: referenceFile.elements[0].elements,
|
|
30470
30471
|
nodeListHandler: nodeListHandler2,
|
|
30471
30472
|
docx,
|
|
@@ -30474,6 +30475,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
|
|
|
30474
30475
|
filename: currentFileName,
|
|
30475
30476
|
path: []
|
|
30476
30477
|
});
|
|
30478
|
+
schema = filterOutRootInlineNodes(schema);
|
|
30477
30479
|
if (!converter.headerIds.ids) converter.headerIds.ids = [];
|
|
30478
30480
|
converter.headerIds.ids.push(rId);
|
|
30479
30481
|
converter.headers[rId] = { type: "doc", content: [...schema] };
|
|
@@ -30488,7 +30490,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
|
|
|
30488
30490
|
);
|
|
30489
30491
|
const sectionType = sectPrFooter?.attributes["w:type"];
|
|
30490
30492
|
const nodeListHandler2 = defaultNodeListHandler();
|
|
30491
|
-
|
|
30493
|
+
let schema = nodeListHandler2.handler({
|
|
30492
30494
|
nodes: referenceFile.elements[0].elements,
|
|
30493
30495
|
nodeListHandler: nodeListHandler2,
|
|
30494
30496
|
docx,
|
|
@@ -30497,6 +30499,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
|
|
|
30497
30499
|
filename: currentFileName,
|
|
30498
30500
|
path: []
|
|
30499
30501
|
});
|
|
30502
|
+
schema = filterOutRootInlineNodes(schema);
|
|
30500
30503
|
if (!converter.footerIds.ids) converter.footerIds.ids = [];
|
|
30501
30504
|
converter.footerIds.ids.push(rId);
|
|
30502
30505
|
converter.footers[rId] = { type: "doc", content: [...schema] };
|
|
@@ -30524,6 +30527,29 @@ const getHeaderFooterSectionData = (sectionData, docx) => {
|
|
|
30524
30527
|
currentFileName
|
|
30525
30528
|
};
|
|
30526
30529
|
};
|
|
30530
|
+
function filterOutRootInlineNodes(content = []) {
|
|
30531
|
+
if (!Array.isArray(content) || content.length === 0) return content;
|
|
30532
|
+
const INLINE_TYPES = /* @__PURE__ */ new Set([
|
|
30533
|
+
"text",
|
|
30534
|
+
"bookmarkStart",
|
|
30535
|
+
"lineBreak",
|
|
30536
|
+
"hardBreak",
|
|
30537
|
+
"pageNumber",
|
|
30538
|
+
"totalPageCount",
|
|
30539
|
+
"runItem",
|
|
30540
|
+
"image",
|
|
30541
|
+
"tab",
|
|
30542
|
+
"fieldAnnotation",
|
|
30543
|
+
"mention",
|
|
30544
|
+
"contentBlock",
|
|
30545
|
+
"aiLoaderNode",
|
|
30546
|
+
"commentRangeStart",
|
|
30547
|
+
"commentRangeEnd",
|
|
30548
|
+
"commentReference",
|
|
30549
|
+
"structuredContent"
|
|
30550
|
+
]);
|
|
30551
|
+
return content.filter((node2) => node2 && typeof node2.type === "string" && !INLINE_TYPES.has(node2.type));
|
|
30552
|
+
}
|
|
30527
30553
|
function getNumberingDefinitions(docx) {
|
|
30528
30554
|
let numbering = docx["word/numbering.xml"];
|
|
30529
30555
|
if (!numbering || !numbering.elements?.length || !numbering.elements[0].elements?.length) numbering = baseNumbering;
|
|
@@ -30163,7 +30163,7 @@ const createDocumentJson = (docx, converter, editor) => {
|
|
|
30163
30163
|
const content = pruneIgnoredNodes(contentElements);
|
|
30164
30164
|
const comments = importCommentData({ docx, converter, editor });
|
|
30165
30165
|
const lists = {};
|
|
30166
|
-
|
|
30166
|
+
let parsedContent = nodeListHandler2.handler({
|
|
30167
30167
|
nodes: content,
|
|
30168
30168
|
nodeListHandler: nodeListHandler2,
|
|
30169
30169
|
docx,
|
|
@@ -30172,6 +30172,7 @@ const createDocumentJson = (docx, converter, editor) => {
|
|
|
30172
30172
|
lists,
|
|
30173
30173
|
path: []
|
|
30174
30174
|
});
|
|
30175
|
+
parsedContent = filterOutRootInlineNodes(parsedContent);
|
|
30175
30176
|
const result = {
|
|
30176
30177
|
type: "doc",
|
|
30177
30178
|
content: parsedContent,
|
|
@@ -30448,7 +30449,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
|
|
|
30448
30449
|
let sectionType = sectPrHeader?.attributes["w:type"];
|
|
30449
30450
|
if (converter.headerIds[sectionType]) sectionType = null;
|
|
30450
30451
|
const nodeListHandler2 = defaultNodeListHandler();
|
|
30451
|
-
|
|
30452
|
+
let schema = nodeListHandler2.handler({
|
|
30452
30453
|
nodes: referenceFile.elements[0].elements,
|
|
30453
30454
|
nodeListHandler: nodeListHandler2,
|
|
30454
30455
|
docx,
|
|
@@ -30457,6 +30458,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
|
|
|
30457
30458
|
filename: currentFileName,
|
|
30458
30459
|
path: []
|
|
30459
30460
|
});
|
|
30461
|
+
schema = filterOutRootInlineNodes(schema);
|
|
30460
30462
|
if (!converter.headerIds.ids) converter.headerIds.ids = [];
|
|
30461
30463
|
converter.headerIds.ids.push(rId);
|
|
30462
30464
|
converter.headers[rId] = { type: "doc", content: [...schema] };
|
|
@@ -30471,7 +30473,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
|
|
|
30471
30473
|
);
|
|
30472
30474
|
const sectionType = sectPrFooter?.attributes["w:type"];
|
|
30473
30475
|
const nodeListHandler2 = defaultNodeListHandler();
|
|
30474
|
-
|
|
30476
|
+
let schema = nodeListHandler2.handler({
|
|
30475
30477
|
nodes: referenceFile.elements[0].elements,
|
|
30476
30478
|
nodeListHandler: nodeListHandler2,
|
|
30477
30479
|
docx,
|
|
@@ -30480,6 +30482,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
|
|
|
30480
30482
|
filename: currentFileName,
|
|
30481
30483
|
path: []
|
|
30482
30484
|
});
|
|
30485
|
+
schema = filterOutRootInlineNodes(schema);
|
|
30483
30486
|
if (!converter.footerIds.ids) converter.footerIds.ids = [];
|
|
30484
30487
|
converter.footerIds.ids.push(rId);
|
|
30485
30488
|
converter.footers[rId] = { type: "doc", content: [...schema] };
|
|
@@ -30507,6 +30510,29 @@ const getHeaderFooterSectionData = (sectionData, docx) => {
|
|
|
30507
30510
|
currentFileName
|
|
30508
30511
|
};
|
|
30509
30512
|
};
|
|
30513
|
+
function filterOutRootInlineNodes(content = []) {
|
|
30514
|
+
if (!Array.isArray(content) || content.length === 0) return content;
|
|
30515
|
+
const INLINE_TYPES = /* @__PURE__ */ new Set([
|
|
30516
|
+
"text",
|
|
30517
|
+
"bookmarkStart",
|
|
30518
|
+
"lineBreak",
|
|
30519
|
+
"hardBreak",
|
|
30520
|
+
"pageNumber",
|
|
30521
|
+
"totalPageCount",
|
|
30522
|
+
"runItem",
|
|
30523
|
+
"image",
|
|
30524
|
+
"tab",
|
|
30525
|
+
"fieldAnnotation",
|
|
30526
|
+
"mention",
|
|
30527
|
+
"contentBlock",
|
|
30528
|
+
"aiLoaderNode",
|
|
30529
|
+
"commentRangeStart",
|
|
30530
|
+
"commentRangeEnd",
|
|
30531
|
+
"commentReference",
|
|
30532
|
+
"structuredContent"
|
|
30533
|
+
]);
|
|
30534
|
+
return content.filter((node2) => node2 && typeof node2.type === "string" && !INLINE_TYPES.has(node2.type));
|
|
30535
|
+
}
|
|
30510
30536
|
function getNumberingDefinitions(docx) {
|
|
30511
30537
|
let numbering = docx["word/numbering.xml"];
|
|
30512
30538
|
if (!numbering || !numbering.elements?.length || !numbering.elements[0].elements?.length) numbering = baseNumbering;
|
|
@@ -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-
|
|
3
|
-
import { _ as _export_sfc } from "./chunks/editor-
|
|
2
|
+
import { T as TextSelection } from "./chunks/converter-w8KtZzlN.js";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/editor-C2iCXpca.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 = {}) {
|
|
@@ -30170,7 +30170,7 @@ const createDocumentJson = (docx, converter, editor) => {
|
|
|
30170
30170
|
const content = pruneIgnoredNodes(contentElements);
|
|
30171
30171
|
const comments = importCommentData({ docx, converter, editor });
|
|
30172
30172
|
const lists = {};
|
|
30173
|
-
|
|
30173
|
+
let parsedContent = nodeListHandler2.handler({
|
|
30174
30174
|
nodes: content,
|
|
30175
30175
|
nodeListHandler: nodeListHandler2,
|
|
30176
30176
|
docx,
|
|
@@ -30179,6 +30179,7 @@ const createDocumentJson = (docx, converter, editor) => {
|
|
|
30179
30179
|
lists,
|
|
30180
30180
|
path: []
|
|
30181
30181
|
});
|
|
30182
|
+
parsedContent = filterOutRootInlineNodes(parsedContent);
|
|
30182
30183
|
const result = {
|
|
30183
30184
|
type: "doc",
|
|
30184
30185
|
content: parsedContent,
|
|
@@ -30455,7 +30456,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
|
|
|
30455
30456
|
let sectionType = sectPrHeader?.attributes["w:type"];
|
|
30456
30457
|
if (converter.headerIds[sectionType]) sectionType = null;
|
|
30457
30458
|
const nodeListHandler2 = defaultNodeListHandler();
|
|
30458
|
-
|
|
30459
|
+
let schema = nodeListHandler2.handler({
|
|
30459
30460
|
nodes: referenceFile.elements[0].elements,
|
|
30460
30461
|
nodeListHandler: nodeListHandler2,
|
|
30461
30462
|
docx,
|
|
@@ -30464,6 +30465,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
|
|
|
30464
30465
|
filename: currentFileName,
|
|
30465
30466
|
path: []
|
|
30466
30467
|
});
|
|
30468
|
+
schema = filterOutRootInlineNodes(schema);
|
|
30467
30469
|
if (!converter.headerIds.ids) converter.headerIds.ids = [];
|
|
30468
30470
|
converter.headerIds.ids.push(rId);
|
|
30469
30471
|
converter.headers[rId] = { type: "doc", content: [...schema] };
|
|
@@ -30478,7 +30480,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
|
|
|
30478
30480
|
);
|
|
30479
30481
|
const sectionType = sectPrFooter?.attributes["w:type"];
|
|
30480
30482
|
const nodeListHandler2 = defaultNodeListHandler();
|
|
30481
|
-
|
|
30483
|
+
let schema = nodeListHandler2.handler({
|
|
30482
30484
|
nodes: referenceFile.elements[0].elements,
|
|
30483
30485
|
nodeListHandler: nodeListHandler2,
|
|
30484
30486
|
docx,
|
|
@@ -30487,6 +30489,7 @@ const importHeadersFooters = (docx, converter, mainEditor) => {
|
|
|
30487
30489
|
filename: currentFileName,
|
|
30488
30490
|
path: []
|
|
30489
30491
|
});
|
|
30492
|
+
schema = filterOutRootInlineNodes(schema);
|
|
30490
30493
|
if (!converter.footerIds.ids) converter.footerIds.ids = [];
|
|
30491
30494
|
converter.footerIds.ids.push(rId);
|
|
30492
30495
|
converter.footers[rId] = { type: "doc", content: [...schema] };
|
|
@@ -30514,6 +30517,29 @@ const getHeaderFooterSectionData = (sectionData, docx) => {
|
|
|
30514
30517
|
currentFileName
|
|
30515
30518
|
};
|
|
30516
30519
|
};
|
|
30520
|
+
function filterOutRootInlineNodes(content = []) {
|
|
30521
|
+
if (!Array.isArray(content) || content.length === 0) return content;
|
|
30522
|
+
const INLINE_TYPES = /* @__PURE__ */ new Set([
|
|
30523
|
+
"text",
|
|
30524
|
+
"bookmarkStart",
|
|
30525
|
+
"lineBreak",
|
|
30526
|
+
"hardBreak",
|
|
30527
|
+
"pageNumber",
|
|
30528
|
+
"totalPageCount",
|
|
30529
|
+
"runItem",
|
|
30530
|
+
"image",
|
|
30531
|
+
"tab",
|
|
30532
|
+
"fieldAnnotation",
|
|
30533
|
+
"mention",
|
|
30534
|
+
"contentBlock",
|
|
30535
|
+
"aiLoaderNode",
|
|
30536
|
+
"commentRangeStart",
|
|
30537
|
+
"commentRangeEnd",
|
|
30538
|
+
"commentReference",
|
|
30539
|
+
"structuredContent"
|
|
30540
|
+
]);
|
|
30541
|
+
return content.filter((node2) => node2 && typeof node2.type === "string" && !INLINE_TYPES.has(node2.type));
|
|
30542
|
+
}
|
|
30517
30543
|
function getNumberingDefinitions(docx) {
|
|
30518
30544
|
let numbering = docx["word/numbering.xml"];
|
|
30519
30545
|
if (!numbering || !numbering.elements?.length || !numbering.elements[0].elements?.length) numbering = baseNumbering;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as process$1, av as commonjsGlobal, I as Buffer, aw as getDefaultExportFromCjs, ax as getContentTypesFromXml, ay as xmljs } from "./converter-
|
|
1
|
+
import { H as process$1, av as commonjsGlobal, I as Buffer, aw as getDefaultExportFromCjs, ax as getContentTypesFromXml, ay as xmljs } from "./converter-w8KtZzlN.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, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_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, _ListItemNodeView_instances, init_fn2, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _DocumentSectionView_instances, init_fn3, addToolTip_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, c as callOrGet, g as getExtensionConfigField, b as getMarkType, d as getMarksFromSelection, e as getNodeType, f as getSchemaTypeNameByName, S as Schema$1, h as cleanSchemaItem, T as TextSelection, N as NodeSelection, i as canSplit, j as defaultBlockAt$1, l as liftTarget, A as AllSelection, k as canJoin, m as joinPoint, n as Selection, r as replaceStep$1, o as Slice, F as Fragment, R as ReplaceAroundStep$1, p as isTextSelection, q as getMarkRange, s as isMarkActive, t as isNodeActive, u as deleteProps, D as DOMParser$1, v as ReplaceStep, w as NodeRange, x as findWrapping, L as ListHelpers, y as findParentNode, z as isMacOS, B as isIOS, C as DOMSerializer, E as Mark$1, G as dropPoint, H as process$1, I as Buffer2, J as getSchemaTypeByName, K as inputRulesPlugin, O as TrackDeleteMarkName, Q as TrackInsertMarkName, U as v4, V as TrackFormatMarkName, W as comments_module_events, X as findMark, Y as objectIncludes, Z as AddMarkStep, _ as RemoveMarkStep, $ as twipsToLines, a0 as pixelsToTwips, a1 as helpers, a2 as posToDOMRect, a3 as CommandService, a4 as SuperConverter, a5 as createDocument, a6 as createDocFromMarkdown, a7 as createDocFromHTML, a8 as EditorState, a9 as hasSomeParentWithClass, aa as isActive, ab as unflattenListsInHtml, ac as parseSizeUnit, ad as minMax, ae as getLineHeightValueString, af as InputRule, ag as kebabCase, ah as findParentNodeClosestToPos, ai as getListItemStyleDefinitions, aj as docxNumberigHelpers, ak as parseIndentElement, al as combineIndents, am as StepMap, an as getColStyleDeclaration, ao as SelectionRange, ap as Transform, aq as isInTable$1, ar as createColGroup, as as generateDocxRandomId, at as insertNewRelationship, au as htmlHandler } from "./converter-
|
|
15
|
+
import { P as PluginKey, a as Plugin, M as Mapping, c as callOrGet, g as getExtensionConfigField, b as getMarkType, d as getMarksFromSelection, e as getNodeType, f as getSchemaTypeNameByName, S as Schema$1, h as cleanSchemaItem, T as TextSelection, N as NodeSelection, i as canSplit, j as defaultBlockAt$1, l as liftTarget, A as AllSelection, k as canJoin, m as joinPoint, n as Selection, r as replaceStep$1, o as Slice, F as Fragment, R as ReplaceAroundStep$1, p as isTextSelection, q as getMarkRange, s as isMarkActive, t as isNodeActive, u as deleteProps, D as DOMParser$1, v as ReplaceStep, w as NodeRange, x as findWrapping, L as ListHelpers, y as findParentNode, z as isMacOS, B as isIOS, C as DOMSerializer, E as Mark$1, G as dropPoint, H as process$1, I as Buffer2, J as getSchemaTypeByName, K as inputRulesPlugin, O as TrackDeleteMarkName, Q as TrackInsertMarkName, U as v4, V as TrackFormatMarkName, W as comments_module_events, X as findMark, Y as objectIncludes, Z as AddMarkStep, _ as RemoveMarkStep, $ as twipsToLines, a0 as pixelsToTwips, a1 as helpers, a2 as posToDOMRect, a3 as CommandService, a4 as SuperConverter, a5 as createDocument, a6 as createDocFromMarkdown, a7 as createDocFromHTML, a8 as EditorState, a9 as hasSomeParentWithClass, aa as isActive, ab as unflattenListsInHtml, ac as parseSizeUnit, ad as minMax, ae as getLineHeightValueString, af as InputRule, ag as kebabCase, ah as findParentNodeClosestToPos, ai as getListItemStyleDefinitions, aj as docxNumberigHelpers, ak as parseIndentElement, al as combineIndents, am as StepMap, an as getColStyleDeclaration, ao as SelectionRange, ap as Transform, aq as isInTable$1, ar as createColGroup, as as generateDocxRandomId, at as insertNewRelationship, au as htmlHandler } from "./converter-w8KtZzlN.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-
|
|
17
|
+
import { D as DocxZipper } from "./docx-zipper-HBvnt_-z.js";
|
|
18
18
|
var GOOD_LEAF_SIZE = 200;
|
|
19
19
|
var RopeSequence = function RopeSequence2() {
|
|
20
20
|
};
|
|
@@ -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 { H as process$1 } from "./converter-
|
|
3
|
-
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-
|
|
2
|
+
import { H as process$1 } from "./converter-w8KtZzlN.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-C2iCXpca.js";
|
|
4
4
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
5
5
|
let sanitized = value.replace(/[^0-9.]/g, "");
|
|
6
6
|
sanitized = parseFloat(sanitized);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E } from "./chunks/editor-
|
|
2
|
-
import "./chunks/converter-
|
|
3
|
-
import "./chunks/docx-zipper-
|
|
1
|
+
import { E } from "./chunks/editor-C2iCXpca.js";
|
|
2
|
+
import "./chunks/converter-w8KtZzlN.js";
|
|
3
|
+
import "./chunks/docx-zipper-HBvnt_-z.js";
|
|
4
4
|
export {
|
|
5
5
|
E as Editor
|
|
6
6
|
};
|
|
@@ -8,6 +8,21 @@
|
|
|
8
8
|
* @returns {Object | null} The updated styles object with default styles
|
|
9
9
|
*/
|
|
10
10
|
export function addDefaultStylesIfMissing(styles: any): any | null;
|
|
11
|
+
/**
|
|
12
|
+
* Remove any nodes that belong to the inline group when they appear at the root.
|
|
13
|
+
* ProseMirror's doc node only accepts block-level content; inline nodes here cause
|
|
14
|
+
* Invalid content for node doc errors. This is a conservative filter that only
|
|
15
|
+
* drops clearly inline node types if they somehow escape their paragraph.
|
|
16
|
+
*
|
|
17
|
+
* @param {Array<{type: string, content?: any, attrs?: any, marks?: any[]}>} content
|
|
18
|
+
* @returns {Array}
|
|
19
|
+
*/
|
|
20
|
+
export function filterOutRootInlineNodes(content?: Array<{
|
|
21
|
+
type: string;
|
|
22
|
+
content?: any;
|
|
23
|
+
attrs?: any;
|
|
24
|
+
marks?: any[];
|
|
25
|
+
}>): any[];
|
|
11
26
|
export function createDocumentJson(docx: ParsedDocx, converter: SuperConverter, editor: Editor): {
|
|
12
27
|
pmDoc: PmNodeJson;
|
|
13
28
|
savedTagsToRestore: XmlNode;
|
|
@@ -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, runCommandWithArgumentOnly_fn;
|
|
12
|
-
import { aw as getDefaultExportFromCjs, U as v4, T as TextSelection$1, q as getMarkRange, az as vClickOutside, y as findParentNode, aA as getActiveFormatting, aq as isInTable, aB as readFromClipboard, aC as handleClipboardPaste, aD as getFileObject, aE as translator, aF as translator$1, aG as translator$2, a as Plugin } from "./chunks/converter-
|
|
13
|
-
import { aH, a4, d, a1 } from "./chunks/converter-
|
|
14
|
-
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, s as startImageUpload, y as yUndoPluginKey, d as undoDepth, r as redoDepth, S as SlashMenuPluginKey, E as Editor, e as getStarterExtensions, P as Placeholder, f as getRichTextExtensions, M as Mark, h as Extension, A as Attribute, N as Node } from "./chunks/editor-
|
|
15
|
-
import { k, C, l, T, i, m, j } from "./chunks/editor-
|
|
12
|
+
import { aw as getDefaultExportFromCjs, U as v4, T as TextSelection$1, q as getMarkRange, az as vClickOutside, y as findParentNode, aA as getActiveFormatting, aq as isInTable, aB as readFromClipboard, aC as handleClipboardPaste, aD as getFileObject, aE as translator, aF as translator$1, aG as translator$2, a as Plugin } from "./chunks/converter-w8KtZzlN.js";
|
|
13
|
+
import { aH, a4, d, a1 } from "./chunks/converter-w8KtZzlN.js";
|
|
14
|
+
import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, s as startImageUpload, y as yUndoPluginKey, d as undoDepth, r as redoDepth, S as SlashMenuPluginKey, E as Editor, e as getStarterExtensions, P as Placeholder, f as getRichTextExtensions, M as Mark, h as Extension, A as Attribute, N as Node } from "./chunks/editor-C2iCXpca.js";
|
|
15
|
+
import { k, C, l, T, i, m, j } from "./chunks/editor-C2iCXpca.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, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-
|
|
17
|
+
import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-BYNEDGz5.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
|
-
import { D } from "./chunks/docx-zipper-
|
|
19
|
+
import { D } from "./chunks/docx-zipper-HBvnt_-z.js";
|
|
20
20
|
import { createZip } from "./file-zipper.es.js";
|
|
21
21
|
var eventemitter3 = { exports: {} };
|
|
22
22
|
var hasRequiredEventemitter3;
|
package/dist/super-editor.cjs
CHANGED
|
@@ -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-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-CLOaeb5i.cjs");
|
|
4
4
|
require("./chunks/vue-DWle4Cai.cjs");
|
|
5
5
|
exports.AIWriter = superEditor_es.AIWriter;
|
|
6
6
|
exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
|
package/dist/super-editor.es.js
CHANGED
|
@@ -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-
|
|
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-CW3H3ZkZ.es.js";
|
|
2
2
|
import "./chunks/vue-CXxsqYcP.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-
|
|
4
|
-
const superdoc = require("./chunks/index-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-CLOaeb5i.cjs");
|
|
4
|
+
const superdoc = require("./chunks/index-DHYO80_n.cjs");
|
|
5
5
|
require("./chunks/vue-DWle4Cai.cjs");
|
|
6
6
|
require("./chunks/jszip-b7l8QkfH.cjs");
|
|
7
7
|
const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
|
package/dist/superdoc.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-
|
|
2
|
-
import { D, H, P, S as S2, m, l } from "./chunks/index-
|
|
1
|
+
import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-CW3H3ZkZ.es.js";
|
|
2
|
+
import { D, H, P, S as S2, m, l } from "./chunks/index-B4iJqRzO.es.js";
|
|
3
3
|
import "./chunks/vue-CXxsqYcP.es.js";
|
|
4
4
|
import "./chunks/jszip-B8KIZSNe.es.js";
|
|
5
5
|
import { B } from "./chunks/blank-docx-iwdyG9RH.es.js";
|
package/dist/superdoc.umd.js
CHANGED
|
@@ -37878,7 +37878,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
37878
37878
|
const content = pruneIgnoredNodes(contentElements);
|
|
37879
37879
|
const comments = importCommentData({ docx, converter, editor });
|
|
37880
37880
|
const lists = {};
|
|
37881
|
-
|
|
37881
|
+
let parsedContent = nodeListHandler2.handler({
|
|
37882
37882
|
nodes: content,
|
|
37883
37883
|
nodeListHandler: nodeListHandler2,
|
|
37884
37884
|
docx,
|
|
@@ -37887,6 +37887,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
37887
37887
|
lists,
|
|
37888
37888
|
path: []
|
|
37889
37889
|
});
|
|
37890
|
+
parsedContent = filterOutRootInlineNodes(parsedContent);
|
|
37890
37891
|
const result = {
|
|
37891
37892
|
type: "doc",
|
|
37892
37893
|
content: parsedContent,
|
|
@@ -38163,7 +38164,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
38163
38164
|
let sectionType = sectPrHeader?.attributes["w:type"];
|
|
38164
38165
|
if (converter.headerIds[sectionType]) sectionType = null;
|
|
38165
38166
|
const nodeListHandler2 = defaultNodeListHandler();
|
|
38166
|
-
|
|
38167
|
+
let schema = nodeListHandler2.handler({
|
|
38167
38168
|
nodes: referenceFile.elements[0].elements,
|
|
38168
38169
|
nodeListHandler: nodeListHandler2,
|
|
38169
38170
|
docx,
|
|
@@ -38172,6 +38173,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
38172
38173
|
filename: currentFileName,
|
|
38173
38174
|
path: []
|
|
38174
38175
|
});
|
|
38176
|
+
schema = filterOutRootInlineNodes(schema);
|
|
38175
38177
|
if (!converter.headerIds.ids) converter.headerIds.ids = [];
|
|
38176
38178
|
converter.headerIds.ids.push(rId);
|
|
38177
38179
|
converter.headers[rId] = { type: "doc", content: [...schema] };
|
|
@@ -38186,7 +38188,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
38186
38188
|
);
|
|
38187
38189
|
const sectionType = sectPrFooter?.attributes["w:type"];
|
|
38188
38190
|
const nodeListHandler2 = defaultNodeListHandler();
|
|
38189
|
-
|
|
38191
|
+
let schema = nodeListHandler2.handler({
|
|
38190
38192
|
nodes: referenceFile.elements[0].elements,
|
|
38191
38193
|
nodeListHandler: nodeListHandler2,
|
|
38192
38194
|
docx,
|
|
@@ -38195,6 +38197,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
38195
38197
|
filename: currentFileName,
|
|
38196
38198
|
path: []
|
|
38197
38199
|
});
|
|
38200
|
+
schema = filterOutRootInlineNodes(schema);
|
|
38198
38201
|
if (!converter.footerIds.ids) converter.footerIds.ids = [];
|
|
38199
38202
|
converter.footerIds.ids.push(rId);
|
|
38200
38203
|
converter.footers[rId] = { type: "doc", content: [...schema] };
|
|
@@ -38222,6 +38225,29 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
38222
38225
|
currentFileName
|
|
38223
38226
|
};
|
|
38224
38227
|
};
|
|
38228
|
+
function filterOutRootInlineNodes(content = []) {
|
|
38229
|
+
if (!Array.isArray(content) || content.length === 0) return content;
|
|
38230
|
+
const INLINE_TYPES = /* @__PURE__ */ new Set([
|
|
38231
|
+
"text",
|
|
38232
|
+
"bookmarkStart",
|
|
38233
|
+
"lineBreak",
|
|
38234
|
+
"hardBreak",
|
|
38235
|
+
"pageNumber",
|
|
38236
|
+
"totalPageCount",
|
|
38237
|
+
"runItem",
|
|
38238
|
+
"image",
|
|
38239
|
+
"tab",
|
|
38240
|
+
"fieldAnnotation",
|
|
38241
|
+
"mention",
|
|
38242
|
+
"contentBlock",
|
|
38243
|
+
"aiLoaderNode",
|
|
38244
|
+
"commentRangeStart",
|
|
38245
|
+
"commentRangeEnd",
|
|
38246
|
+
"commentReference",
|
|
38247
|
+
"structuredContent"
|
|
38248
|
+
]);
|
|
38249
|
+
return content.filter((node2) => node2 && typeof node2.type === "string" && !INLINE_TYPES.has(node2.type));
|
|
38250
|
+
}
|
|
38225
38251
|
function getNumberingDefinitions(docx) {
|
|
38226
38252
|
let numbering = docx["word/numbering.xml"];
|
|
38227
38253
|
if (!numbering || !numbering.elements?.length || !numbering.elements[0].elements?.length) numbering = baseNumbering;
|