@harbour-enterprises/superdoc 0.23.0-next.3 → 0.23.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.
- package/dist/chunks/{PdfViewer-Cm-ziNtE.cjs → PdfViewer-D9qubRJ_.cjs} +1 -1
- package/dist/chunks/{PdfViewer-BfGJJ5Fk.es.js → PdfViewer-vQ-IdNED.es.js} +1 -1
- package/dist/chunks/{index-CJIVhJxE.cjs → index-BTv5rNmt.cjs} +2 -2
- package/dist/chunks/{index-Bl4NtKeS.es.js → index-DGxFKkbG.es.js} +2 -2
- package/dist/chunks/{super-editor.es-DQnqUJZs.es.js → super-editor.es-DRBPtyog.es.js} +56 -0
- package/dist/chunks/{super-editor.es-C7stybby.cjs → super-editor.es-wyeeDloA.cjs} +56 -0
- package/dist/super-editor/ai-writer.es.js +1 -1
- package/dist/super-editor/chunks/{editor-DIINh50j.js → editor-CqnpAm6f.js} +56 -0
- package/dist/super-editor/chunks/{toolbar-CmDmkPHL.js → toolbar-DnEbb4lv.js} +1 -1
- package/dist/super-editor/editor.es.js +1 -1
- package/dist/super-editor/src/extensions/structured-content/structuredContentHelpers/getStructuredContentTagsByAlias.d.ts +8 -0
- package/dist/super-editor/src/extensions/structured-content/structuredContentHelpers/index.d.ts +1 -0
- package/dist/super-editor/super-editor.es.js +3 -3
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +56 -0
- 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-BTv5rNmt.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-DGxFKkbG.es.js";
|
|
3
3
|
function self(vars) {
|
|
4
4
|
const {
|
|
5
5
|
opacityDisabled,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const superEditor_es = require("./super-editor.es-
|
|
2
|
+
const superEditor_es = require("./super-editor.es-wyeeDloA.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");
|
|
@@ -17414,7 +17414,7 @@ const _sfc_main = {
|
|
|
17414
17414
|
__name: "SuperDoc",
|
|
17415
17415
|
emits: ["selection-update"],
|
|
17416
17416
|
setup(__props, { emit: __emit }) {
|
|
17417
|
-
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-
|
|
17417
|
+
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-D9qubRJ_.cjs")));
|
|
17418
17418
|
const superdocStore = useSuperdocStore();
|
|
17419
17419
|
const commentsStore = useCommentsStore();
|
|
17420
17420
|
const {
|
|
@@ -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-DRBPtyog.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";
|
|
@@ -17397,7 +17397,7 @@ const _sfc_main = {
|
|
|
17397
17397
|
__name: "SuperDoc",
|
|
17398
17398
|
emits: ["selection-update"],
|
|
17399
17399
|
setup(__props, { emit: __emit }) {
|
|
17400
|
-
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-
|
|
17400
|
+
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-vQ-IdNED.es.js"));
|
|
17401
17401
|
const superdocStore = useSuperdocStore();
|
|
17402
17402
|
const commentsStore = useCommentsStore();
|
|
17403
17403
|
const {
|
|
@@ -54220,6 +54220,17 @@ function getStructuredContentTagsById(idOrIds, state2) {
|
|
|
54220
54220
|
});
|
|
54221
54221
|
return result;
|
|
54222
54222
|
}
|
|
54223
|
+
function getStructuredContentTagsByAlias(aliasOrAliases, state2) {
|
|
54224
|
+
const result = findChildren$5(state2.doc, (node) => {
|
|
54225
|
+
const isStructuredContent = ["structuredContent", "structuredContentBlock"].includes(node.type.name);
|
|
54226
|
+
if (Array.isArray(aliasOrAliases)) {
|
|
54227
|
+
return isStructuredContent && aliasOrAliases.includes(node.attrs.alias);
|
|
54228
|
+
} else {
|
|
54229
|
+
return isStructuredContent && node.attrs.alias === aliasOrAliases;
|
|
54230
|
+
}
|
|
54231
|
+
});
|
|
54232
|
+
return result;
|
|
54233
|
+
}
|
|
54223
54234
|
function getStructuredContentTags(state2) {
|
|
54224
54235
|
const result = findChildren$5(state2.doc, (node) => {
|
|
54225
54236
|
return node.type.name === "structuredContent" || node.type.name === "structuredContentBlock";
|
|
@@ -54239,6 +54250,7 @@ const structuredContentHelpers = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ O
|
|
|
54239
54250
|
getStructuredContentBlockTags,
|
|
54240
54251
|
getStructuredContentInlineTags,
|
|
54241
54252
|
getStructuredContentTags,
|
|
54253
|
+
getStructuredContentTagsByAlias,
|
|
54242
54254
|
getStructuredContentTagsById
|
|
54243
54255
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
54244
54256
|
const STRUCTURED_CONTENT_NAMES = ["structuredContent", "structuredContentBlock"];
|
|
@@ -54370,6 +54382,50 @@ const StructuredContentCommands = Extension.create({
|
|
|
54370
54382
|
}
|
|
54371
54383
|
return true;
|
|
54372
54384
|
},
|
|
54385
|
+
/**
|
|
54386
|
+
* Updates a structured content attributes or content by alias.
|
|
54387
|
+
* If the updated node does not match the schema, it will not be updated.
|
|
54388
|
+
* @category Command
|
|
54389
|
+
* @param {string} alias
|
|
54390
|
+
* @param {StructuredContentUpdate} options
|
|
54391
|
+
*/
|
|
54392
|
+
updateStructuredContentByAlias: (alias, options = {}) => ({ editor, dispatch, state: state2, tr }) => {
|
|
54393
|
+
const structuredContentTags = getStructuredContentTagsByAlias(alias, state2);
|
|
54394
|
+
if (!structuredContentTags.length) {
|
|
54395
|
+
return true;
|
|
54396
|
+
}
|
|
54397
|
+
const { schema } = editor;
|
|
54398
|
+
if (dispatch) {
|
|
54399
|
+
const structuredContent = structuredContentTags[0];
|
|
54400
|
+
const { pos, node } = structuredContent;
|
|
54401
|
+
const posFrom = pos;
|
|
54402
|
+
const posTo = pos + node.nodeSize;
|
|
54403
|
+
let content = null;
|
|
54404
|
+
if (options.text) {
|
|
54405
|
+
content = schema.text(options.text);
|
|
54406
|
+
}
|
|
54407
|
+
if (options.html) {
|
|
54408
|
+
const html = htmlHandler(options.html, editor);
|
|
54409
|
+
const doc2 = DOMParser$1.fromSchema(schema).parse(html);
|
|
54410
|
+
content = doc2.content;
|
|
54411
|
+
}
|
|
54412
|
+
if (options.json) {
|
|
54413
|
+
content = schema.nodeFromJSON(options.json);
|
|
54414
|
+
}
|
|
54415
|
+
if (!content) {
|
|
54416
|
+
content = node.content;
|
|
54417
|
+
}
|
|
54418
|
+
const updatedNode = node.type.create({ ...node.attrs, ...options.attrs }, content, node.marks);
|
|
54419
|
+
try {
|
|
54420
|
+
updatedNode.check();
|
|
54421
|
+
} catch {
|
|
54422
|
+
console.error("Updated node does not conform to the schema");
|
|
54423
|
+
return false;
|
|
54424
|
+
}
|
|
54425
|
+
tr.replaceWith(posFrom, posTo, updatedNode);
|
|
54426
|
+
}
|
|
54427
|
+
return true;
|
|
54428
|
+
},
|
|
54373
54429
|
/**
|
|
54374
54430
|
* Removes a structured content.
|
|
54375
54431
|
* @category Command
|
|
@@ -54237,6 +54237,17 @@ function getStructuredContentTagsById(idOrIds, state2) {
|
|
|
54237
54237
|
});
|
|
54238
54238
|
return result;
|
|
54239
54239
|
}
|
|
54240
|
+
function getStructuredContentTagsByAlias(aliasOrAliases, state2) {
|
|
54241
|
+
const result = findChildren$5(state2.doc, (node) => {
|
|
54242
|
+
const isStructuredContent = ["structuredContent", "structuredContentBlock"].includes(node.type.name);
|
|
54243
|
+
if (Array.isArray(aliasOrAliases)) {
|
|
54244
|
+
return isStructuredContent && aliasOrAliases.includes(node.attrs.alias);
|
|
54245
|
+
} else {
|
|
54246
|
+
return isStructuredContent && node.attrs.alias === aliasOrAliases;
|
|
54247
|
+
}
|
|
54248
|
+
});
|
|
54249
|
+
return result;
|
|
54250
|
+
}
|
|
54240
54251
|
function getStructuredContentTags(state2) {
|
|
54241
54252
|
const result = findChildren$5(state2.doc, (node) => {
|
|
54242
54253
|
return node.type.name === "structuredContent" || node.type.name === "structuredContentBlock";
|
|
@@ -54256,6 +54267,7 @@ const structuredContentHelpers = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ O
|
|
|
54256
54267
|
getStructuredContentBlockTags,
|
|
54257
54268
|
getStructuredContentInlineTags,
|
|
54258
54269
|
getStructuredContentTags,
|
|
54270
|
+
getStructuredContentTagsByAlias,
|
|
54259
54271
|
getStructuredContentTagsById
|
|
54260
54272
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
54261
54273
|
const STRUCTURED_CONTENT_NAMES = ["structuredContent", "structuredContentBlock"];
|
|
@@ -54387,6 +54399,50 @@ const StructuredContentCommands = Extension.create({
|
|
|
54387
54399
|
}
|
|
54388
54400
|
return true;
|
|
54389
54401
|
},
|
|
54402
|
+
/**
|
|
54403
|
+
* Updates a structured content attributes or content by alias.
|
|
54404
|
+
* If the updated node does not match the schema, it will not be updated.
|
|
54405
|
+
* @category Command
|
|
54406
|
+
* @param {string} alias
|
|
54407
|
+
* @param {StructuredContentUpdate} options
|
|
54408
|
+
*/
|
|
54409
|
+
updateStructuredContentByAlias: (alias, options = {}) => ({ editor, dispatch, state: state2, tr }) => {
|
|
54410
|
+
const structuredContentTags = getStructuredContentTagsByAlias(alias, state2);
|
|
54411
|
+
if (!structuredContentTags.length) {
|
|
54412
|
+
return true;
|
|
54413
|
+
}
|
|
54414
|
+
const { schema } = editor;
|
|
54415
|
+
if (dispatch) {
|
|
54416
|
+
const structuredContent = structuredContentTags[0];
|
|
54417
|
+
const { pos, node } = structuredContent;
|
|
54418
|
+
const posFrom = pos;
|
|
54419
|
+
const posTo = pos + node.nodeSize;
|
|
54420
|
+
let content = null;
|
|
54421
|
+
if (options.text) {
|
|
54422
|
+
content = schema.text(options.text);
|
|
54423
|
+
}
|
|
54424
|
+
if (options.html) {
|
|
54425
|
+
const html = htmlHandler(options.html, editor);
|
|
54426
|
+
const doc2 = DOMParser$1.fromSchema(schema).parse(html);
|
|
54427
|
+
content = doc2.content;
|
|
54428
|
+
}
|
|
54429
|
+
if (options.json) {
|
|
54430
|
+
content = schema.nodeFromJSON(options.json);
|
|
54431
|
+
}
|
|
54432
|
+
if (!content) {
|
|
54433
|
+
content = node.content;
|
|
54434
|
+
}
|
|
54435
|
+
const updatedNode = node.type.create({ ...node.attrs, ...options.attrs }, content, node.marks);
|
|
54436
|
+
try {
|
|
54437
|
+
updatedNode.check();
|
|
54438
|
+
} catch {
|
|
54439
|
+
console.error("Updated node does not conform to the schema");
|
|
54440
|
+
return false;
|
|
54441
|
+
}
|
|
54442
|
+
tr.replaceWith(posFrom, posTo, updatedNode);
|
|
54443
|
+
}
|
|
54444
|
+
return true;
|
|
54445
|
+
},
|
|
54390
54446
|
/**
|
|
54391
54447
|
* Removes a structured content.
|
|
54392
54448
|
* @category Command
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
|
|
2
2
|
import { T as TextSelection } from "./chunks/converter-BVirrB35.js";
|
|
3
|
-
import { _ as _export_sfc } from "./chunks/editor-
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/editor-CqnpAm6f.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 = {}) {
|
|
@@ -17357,6 +17357,17 @@ function getStructuredContentTagsById(idOrIds, state) {
|
|
|
17357
17357
|
});
|
|
17358
17358
|
return result;
|
|
17359
17359
|
}
|
|
17360
|
+
function getStructuredContentTagsByAlias(aliasOrAliases, state) {
|
|
17361
|
+
const result = findChildren$5(state.doc, (node) => {
|
|
17362
|
+
const isStructuredContent = ["structuredContent", "structuredContentBlock"].includes(node.type.name);
|
|
17363
|
+
if (Array.isArray(aliasOrAliases)) {
|
|
17364
|
+
return isStructuredContent && aliasOrAliases.includes(node.attrs.alias);
|
|
17365
|
+
} else {
|
|
17366
|
+
return isStructuredContent && node.attrs.alias === aliasOrAliases;
|
|
17367
|
+
}
|
|
17368
|
+
});
|
|
17369
|
+
return result;
|
|
17370
|
+
}
|
|
17360
17371
|
function getStructuredContentTags(state) {
|
|
17361
17372
|
const result = findChildren$5(state.doc, (node) => {
|
|
17362
17373
|
return node.type.name === "structuredContent" || node.type.name === "structuredContentBlock";
|
|
@@ -17376,6 +17387,7 @@ const structuredContentHelpers = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ O
|
|
|
17376
17387
|
getStructuredContentBlockTags,
|
|
17377
17388
|
getStructuredContentInlineTags,
|
|
17378
17389
|
getStructuredContentTags,
|
|
17390
|
+
getStructuredContentTagsByAlias,
|
|
17379
17391
|
getStructuredContentTagsById
|
|
17380
17392
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
17381
17393
|
const STRUCTURED_CONTENT_NAMES = ["structuredContent", "structuredContentBlock"];
|
|
@@ -17507,6 +17519,50 @@ const StructuredContentCommands = Extension.create({
|
|
|
17507
17519
|
}
|
|
17508
17520
|
return true;
|
|
17509
17521
|
},
|
|
17522
|
+
/**
|
|
17523
|
+
* Updates a structured content attributes or content by alias.
|
|
17524
|
+
* If the updated node does not match the schema, it will not be updated.
|
|
17525
|
+
* @category Command
|
|
17526
|
+
* @param {string} alias
|
|
17527
|
+
* @param {StructuredContentUpdate} options
|
|
17528
|
+
*/
|
|
17529
|
+
updateStructuredContentByAlias: (alias, options = {}) => ({ editor, dispatch, state, tr }) => {
|
|
17530
|
+
const structuredContentTags = getStructuredContentTagsByAlias(alias, state);
|
|
17531
|
+
if (!structuredContentTags.length) {
|
|
17532
|
+
return true;
|
|
17533
|
+
}
|
|
17534
|
+
const { schema } = editor;
|
|
17535
|
+
if (dispatch) {
|
|
17536
|
+
const structuredContent = structuredContentTags[0];
|
|
17537
|
+
const { pos, node } = structuredContent;
|
|
17538
|
+
const posFrom = pos;
|
|
17539
|
+
const posTo = pos + node.nodeSize;
|
|
17540
|
+
let content = null;
|
|
17541
|
+
if (options.text) {
|
|
17542
|
+
content = schema.text(options.text);
|
|
17543
|
+
}
|
|
17544
|
+
if (options.html) {
|
|
17545
|
+
const html = htmlHandler(options.html, editor);
|
|
17546
|
+
const doc2 = DOMParser$1.fromSchema(schema).parse(html);
|
|
17547
|
+
content = doc2.content;
|
|
17548
|
+
}
|
|
17549
|
+
if (options.json) {
|
|
17550
|
+
content = schema.nodeFromJSON(options.json);
|
|
17551
|
+
}
|
|
17552
|
+
if (!content) {
|
|
17553
|
+
content = node.content;
|
|
17554
|
+
}
|
|
17555
|
+
const updatedNode = node.type.create({ ...node.attrs, ...options.attrs }, content, node.marks);
|
|
17556
|
+
try {
|
|
17557
|
+
updatedNode.check();
|
|
17558
|
+
} catch {
|
|
17559
|
+
console.error("Updated node does not conform to the schema");
|
|
17560
|
+
return false;
|
|
17561
|
+
}
|
|
17562
|
+
tr.replaceWith(posFrom, posTo, updatedNode);
|
|
17563
|
+
}
|
|
17564
|
+
return true;
|
|
17565
|
+
},
|
|
17510
17566
|
/**
|
|
17511
17567
|
* Removes a structured content.
|
|
17512
17568
|
* @category Command
|
|
@@ -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
2
|
import { p as process$1 } from "./converter-BVirrB35.js";
|
|
3
|
-
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-CqnpAm6f.js";
|
|
4
4
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
5
5
|
let sanitized = value.replace(/[^0-9.]/g, "");
|
|
6
6
|
sanitized = parseFloat(sanitized);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gets structured content tags by alias in the state.
|
|
3
|
+
* @param {string | string[]} aliasOrAliases
|
|
4
|
+
* @param {EditorState} state Editor state.
|
|
5
|
+
* @returns {Array}
|
|
6
|
+
*/
|
|
7
|
+
export function getStructuredContentTagsByAlias(aliasOrAliases: string | string[], state: EditorState): any[];
|
|
8
|
+
import { EditorState } from 'prosemirror-state';
|
|
@@ -11,10 +11,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
11
11
|
var _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, runCommandWithArgumentOnly_fn;
|
|
12
12
|
import { ax as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, aA as vClickOutside, H as findParentNode, aB as getActiveFormatting, at as isInTable, aC as readFromClipboard, aD as handleClipboardPaste, aE as getFileObject, aF as runPropertyTranslators, aG as translator, aH as translator$1, aI as translator$2, aJ as translator$3, aK as translator$4, aL as translator$5, aM as translator$6, aN as translator$7, aO as translator$8, aP as translator$9, aQ as translator$a, aR as translator$b, aS as translator$c, aT as translator$d, aU as translator$e, aV as translator$f, aW as translator$g, aX as translator$h, aY as translator$i, aZ as translator$j, a_ as translator$k, a$ as translator$l, b0 as translator$m, b1 as translator$n, b2 as translator$o, b3 as translator$p, b4 as translator$q, b5 as translator$r, b6 as translator$s, b7 as translator$t, b8 as translator$u, b9 as translator$v, ba as translator$w, bb as translator$x, bc as translator$y, bd as translator$z, be as translator$A, bf as translator$B, bg as translator$C, bh as translator$D, bi as translator$E, bj as translator$F, bk as translator$G, bl as translator$H, bm as translator$I, bn as translator$J, bo as translator$K, bp as translator$L, bq as translator$M, br as translator$N, bs as translator$O, bt as translator$P, bu as translator$Q, bv as translator$R, bw as translator$S, bx as translator$T, by as translator$U, bz as translator$V, bA as translator$W, bB as translator$X, bC as translator$Y, bD as translator$Z, bE as translator$_, bF as translator$$, bG as translator$10, bH as translator$11, bI as translator$12, a as Plugin } from "./chunks/converter-BVirrB35.js";
|
|
13
13
|
import { bJ, a5, i, a2 } from "./chunks/converter-BVirrB35.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, y as yUndoPluginKey, f as undoDepth, h as redoDepth, s as shouldBypassContextMenu, S as SlashMenuPluginKey, E as Editor, i as getStarterExtensions, P as Placeholder, j as getRichTextExtensions, M as Mark, k as Extension, A as Attribute, N as Node } from "./chunks/editor-
|
|
15
|
-
import { n, C, o, T, l, p, m } from "./chunks/editor-
|
|
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, y as yUndoPluginKey, f as undoDepth, h as redoDepth, s as shouldBypassContextMenu, S as SlashMenuPluginKey, E as Editor, i as getStarterExtensions, P as Placeholder, j as getRichTextExtensions, M as Mark, k as Extension, A as Attribute, N as Node } from "./chunks/editor-CqnpAm6f.js";
|
|
15
|
+
import { n, C, o, T, l, p, m } from "./chunks/editor-CqnpAm6f.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-DnEbb4lv.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
19
|
import { D } from "./chunks/docx-zipper-Cpb9d2an.js";
|
|
20
20
|
import { createZip } from "./file-zipper.es.js";
|
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-wyeeDloA.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-DRBPtyog.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-wyeeDloA.cjs");
|
|
4
|
+
const superdoc = require("./chunks/index-BTv5rNmt.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-DRBPtyog.es.js";
|
|
2
|
+
import { D, H, P, S as S2, m, l } from "./chunks/index-DGxFKkbG.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
|
@@ -61935,6 +61935,17 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
61935
61935
|
});
|
|
61936
61936
|
return result;
|
|
61937
61937
|
}
|
|
61938
|
+
function getStructuredContentTagsByAlias(aliasOrAliases, state2) {
|
|
61939
|
+
const result = findChildren$5(state2.doc, (node) => {
|
|
61940
|
+
const isStructuredContent = ["structuredContent", "structuredContentBlock"].includes(node.type.name);
|
|
61941
|
+
if (Array.isArray(aliasOrAliases)) {
|
|
61942
|
+
return isStructuredContent && aliasOrAliases.includes(node.attrs.alias);
|
|
61943
|
+
} else {
|
|
61944
|
+
return isStructuredContent && node.attrs.alias === aliasOrAliases;
|
|
61945
|
+
}
|
|
61946
|
+
});
|
|
61947
|
+
return result;
|
|
61948
|
+
}
|
|
61938
61949
|
function getStructuredContentTags(state2) {
|
|
61939
61950
|
const result = findChildren$5(state2.doc, (node) => {
|
|
61940
61951
|
return node.type.name === "structuredContent" || node.type.name === "structuredContentBlock";
|
|
@@ -61954,6 +61965,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
61954
61965
|
getStructuredContentBlockTags,
|
|
61955
61966
|
getStructuredContentInlineTags,
|
|
61956
61967
|
getStructuredContentTags,
|
|
61968
|
+
getStructuredContentTagsByAlias,
|
|
61957
61969
|
getStructuredContentTagsById
|
|
61958
61970
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
61959
61971
|
const STRUCTURED_CONTENT_NAMES = ["structuredContent", "structuredContentBlock"];
|
|
@@ -62085,6 +62097,50 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
62085
62097
|
}
|
|
62086
62098
|
return true;
|
|
62087
62099
|
},
|
|
62100
|
+
/**
|
|
62101
|
+
* Updates a structured content attributes or content by alias.
|
|
62102
|
+
* If the updated node does not match the schema, it will not be updated.
|
|
62103
|
+
* @category Command
|
|
62104
|
+
* @param {string} alias
|
|
62105
|
+
* @param {StructuredContentUpdate} options
|
|
62106
|
+
*/
|
|
62107
|
+
updateStructuredContentByAlias: (alias, options = {}) => ({ editor, dispatch, state: state2, tr }) => {
|
|
62108
|
+
const structuredContentTags = getStructuredContentTagsByAlias(alias, state2);
|
|
62109
|
+
if (!structuredContentTags.length) {
|
|
62110
|
+
return true;
|
|
62111
|
+
}
|
|
62112
|
+
const { schema } = editor;
|
|
62113
|
+
if (dispatch) {
|
|
62114
|
+
const structuredContent = structuredContentTags[0];
|
|
62115
|
+
const { pos, node } = structuredContent;
|
|
62116
|
+
const posFrom = pos;
|
|
62117
|
+
const posTo = pos + node.nodeSize;
|
|
62118
|
+
let content = null;
|
|
62119
|
+
if (options.text) {
|
|
62120
|
+
content = schema.text(options.text);
|
|
62121
|
+
}
|
|
62122
|
+
if (options.html) {
|
|
62123
|
+
const html = htmlHandler(options.html, editor);
|
|
62124
|
+
const doc2 = DOMParser$1.fromSchema(schema).parse(html);
|
|
62125
|
+
content = doc2.content;
|
|
62126
|
+
}
|
|
62127
|
+
if (options.json) {
|
|
62128
|
+
content = schema.nodeFromJSON(options.json);
|
|
62129
|
+
}
|
|
62130
|
+
if (!content) {
|
|
62131
|
+
content = node.content;
|
|
62132
|
+
}
|
|
62133
|
+
const updatedNode = node.type.create({ ...node.attrs, ...options.attrs }, content, node.marks);
|
|
62134
|
+
try {
|
|
62135
|
+
updatedNode.check();
|
|
62136
|
+
} catch {
|
|
62137
|
+
console.error("Updated node does not conform to the schema");
|
|
62138
|
+
return false;
|
|
62139
|
+
}
|
|
62140
|
+
tr.replaceWith(posFrom, posTo, updatedNode);
|
|
62141
|
+
}
|
|
62142
|
+
return true;
|
|
62143
|
+
},
|
|
62088
62144
|
/**
|
|
62089
62145
|
* Removes a structured content.
|
|
62090
62146
|
* @category Command
|