@harbour-enterprises/superdoc 0.23.0-next.6 → 0.23.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-D89-VJvM.cjs → PdfViewer-CqRCWGPC.cjs} +1 -1
- package/dist/chunks/{PdfViewer-BlOezZGN.es.js → PdfViewer-fqIBzqak.es.js} +1 -1
- package/dist/chunks/{index-DTw4eF5D.es.js → index-CPu7VToO.es.js} +2 -2
- package/dist/chunks/{index-9hY1WuxT.cjs → index-Mh8HFZBp.cjs} +2 -2
- package/dist/chunks/{super-editor.es-C9Ql0kHS.es.js → super-editor.es-CINrYeD9.es.js} +19 -15
- package/dist/chunks/{super-editor.es-C8gNFcB_.cjs → super-editor.es-COK5ynTl.cjs} +19 -15
- package/dist/style.css +42 -27
- package/dist/super-editor/ai-writer.es.js +1 -1
- package/dist/super-editor/chunks/{editor-DLan-MJ6.js → editor-Co2_vpme.js} +17 -13
- package/dist/super-editor/chunks/{toolbar-CekMv4Mk.js → toolbar-Bevq4gO1.js} +3 -3
- package/dist/super-editor/editor.es.js +1 -1
- package/dist/super-editor/style.css +42 -27
- 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 +19 -15
- 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-DKMj1I9B.cjs");
|
|
4
|
-
const superdoc = require("./index-
|
|
4
|
+
const superdoc = require("./index-Mh8HFZBp.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-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-
|
|
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-CPu7VToO.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-CINrYeD9.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 Buffer$2 } from "./jszip-DAXEPCUv.es.js";
|
|
4
4
|
import { B as BlankDOCX } from "./blank-docx-iwdyG9RH.es.js";
|
|
@@ -17400,7 +17400,7 @@ const _sfc_main = {
|
|
|
17400
17400
|
__name: "SuperDoc",
|
|
17401
17401
|
emits: ["selection-update"],
|
|
17402
17402
|
setup(__props, { emit: __emit }) {
|
|
17403
|
-
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-
|
|
17403
|
+
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-fqIBzqak.es.js"));
|
|
17404
17404
|
const superdocStore = useSuperdocStore();
|
|
17405
17405
|
const commentsStore = useCommentsStore();
|
|
17406
17406
|
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-COK5ynTl.cjs");
|
|
3
3
|
const vue = require("./vue-DKMj1I9B.cjs");
|
|
4
4
|
const jszip = require("./jszip-B4LDL19y.cjs");
|
|
5
5
|
const blankDocx = require("./blank-docx-CPqX9RF5.cjs");
|
|
@@ -17417,7 +17417,7 @@ const _sfc_main = {
|
|
|
17417
17417
|
__name: "SuperDoc",
|
|
17418
17418
|
emits: ["selection-update"],
|
|
17419
17419
|
setup(__props, { emit: __emit }) {
|
|
17420
|
-
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-
|
|
17420
|
+
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-CqRCWGPC.cjs")));
|
|
17421
17421
|
const superdocStore = useSuperdocStore();
|
|
17422
17422
|
const commentsStore = useCommentsStore();
|
|
17423
17423
|
const {
|
|
@@ -54386,7 +54386,7 @@ const StructuredContentCommands = Extension.create({
|
|
|
54386
54386
|
* This will update every field that matches the given alias.
|
|
54387
54387
|
* If any updated node does not match the schema, no updates will be applied.
|
|
54388
54388
|
* @category Command
|
|
54389
|
-
* @param {string} alias - Shared identifier for fields (e.g., "customer_name")
|
|
54389
|
+
* @param {string | string[]} alias - Shared identifier for fields (e.g., "customer_name")
|
|
54390
54390
|
* @param {StructuredContentUpdate} options
|
|
54391
54391
|
*/
|
|
54392
54392
|
updateStructuredContentByAlias: (alias, options = {}) => ({ editor, dispatch, state: state2, tr }) => {
|
|
@@ -54395,35 +54395,39 @@ const StructuredContentCommands = Extension.create({
|
|
|
54395
54395
|
return true;
|
|
54396
54396
|
}
|
|
54397
54397
|
const { schema } = editor;
|
|
54398
|
-
const
|
|
54399
|
-
for (const { pos, node } of structuredContentTags) {
|
|
54400
|
-
let content = null;
|
|
54398
|
+
const createContent = (node) => {
|
|
54401
54399
|
if (options.text) {
|
|
54402
|
-
|
|
54400
|
+
return schema.text(options.text);
|
|
54403
54401
|
}
|
|
54404
54402
|
if (options.html) {
|
|
54405
54403
|
const html = htmlHandler(options.html, editor);
|
|
54406
54404
|
const doc2 = DOMParser$1.fromSchema(schema).parse(html);
|
|
54407
|
-
|
|
54405
|
+
return doc2.content;
|
|
54408
54406
|
}
|
|
54409
54407
|
if (options.json) {
|
|
54410
|
-
|
|
54411
|
-
}
|
|
54412
|
-
if (!content) {
|
|
54413
|
-
content = node.content;
|
|
54408
|
+
return schema.nodeFromJSON(options.json);
|
|
54414
54409
|
}
|
|
54410
|
+
return node.content;
|
|
54411
|
+
};
|
|
54412
|
+
for (const { node } of structuredContentTags) {
|
|
54413
|
+
const content = createContent(node);
|
|
54415
54414
|
const updatedNode = node.type.create({ ...node.attrs, ...options.attrs }, content, node.marks);
|
|
54416
54415
|
try {
|
|
54417
54416
|
updatedNode.check();
|
|
54418
|
-
updates.push({ pos, node: updatedNode, size: node.nodeSize });
|
|
54419
54417
|
} catch {
|
|
54420
54418
|
console.error("Updated node does not conform to the schema");
|
|
54421
54419
|
return false;
|
|
54422
54420
|
}
|
|
54423
54421
|
}
|
|
54424
54422
|
if (dispatch) {
|
|
54425
|
-
|
|
54426
|
-
tr.
|
|
54423
|
+
structuredContentTags.forEach(({ pos, node }) => {
|
|
54424
|
+
const mappedPos = tr.mapping.map(pos);
|
|
54425
|
+
const currentNode = tr.doc.nodeAt(mappedPos);
|
|
54426
|
+
if (currentNode && node.eq(currentNode)) {
|
|
54427
|
+
const content = createContent(node);
|
|
54428
|
+
const updatedNode = node.type.create({ ...node.attrs, ...options.attrs }, content, node.marks);
|
|
54429
|
+
tr.replaceWith(mappedPos, mappedPos + node.nodeSize, updatedNode);
|
|
54430
|
+
}
|
|
54427
54431
|
});
|
|
54428
54432
|
}
|
|
54429
54433
|
return true;
|
|
@@ -71369,7 +71373,7 @@ const _sfc_main$4$1 = {
|
|
|
71369
71373
|
};
|
|
71370
71374
|
const handleInputSubmit = () => {
|
|
71371
71375
|
const value = inlineTextInput.value;
|
|
71372
|
-
const cleanValue = value.
|
|
71376
|
+
const cleanValue = value.match(/^\d+(\.5)?$/) ? value : Math.floor(parseFloat(value)).toString();
|
|
71373
71377
|
emit("textSubmit", cleanValue);
|
|
71374
71378
|
inlineTextInput.value = cleanValue;
|
|
71375
71379
|
};
|
|
@@ -71451,7 +71455,7 @@ const _sfc_main$4$1 = {
|
|
|
71451
71455
|
};
|
|
71452
71456
|
}
|
|
71453
71457
|
};
|
|
71454
|
-
const ToolbarButton = /* @__PURE__ */ _export_sfc(_sfc_main$4$1, [["__scopeId", "data-v-
|
|
71458
|
+
const ToolbarButton = /* @__PURE__ */ _export_sfc(_sfc_main$4$1, [["__scopeId", "data-v-cea02a58"]]);
|
|
71455
71459
|
const _hoisted_1$2$1 = {
|
|
71456
71460
|
class: "toolbar-separator",
|
|
71457
71461
|
role: "separator",
|
|
@@ -54403,7 +54403,7 @@ const StructuredContentCommands = Extension.create({
|
|
|
54403
54403
|
* This will update every field that matches the given alias.
|
|
54404
54404
|
* If any updated node does not match the schema, no updates will be applied.
|
|
54405
54405
|
* @category Command
|
|
54406
|
-
* @param {string} alias - Shared identifier for fields (e.g., "customer_name")
|
|
54406
|
+
* @param {string | string[]} alias - Shared identifier for fields (e.g., "customer_name")
|
|
54407
54407
|
* @param {StructuredContentUpdate} options
|
|
54408
54408
|
*/
|
|
54409
54409
|
updateStructuredContentByAlias: (alias, options = {}) => ({ editor, dispatch, state: state2, tr }) => {
|
|
@@ -54412,35 +54412,39 @@ const StructuredContentCommands = Extension.create({
|
|
|
54412
54412
|
return true;
|
|
54413
54413
|
}
|
|
54414
54414
|
const { schema } = editor;
|
|
54415
|
-
const
|
|
54416
|
-
for (const { pos, node } of structuredContentTags) {
|
|
54417
|
-
let content = null;
|
|
54415
|
+
const createContent = (node) => {
|
|
54418
54416
|
if (options.text) {
|
|
54419
|
-
|
|
54417
|
+
return schema.text(options.text);
|
|
54420
54418
|
}
|
|
54421
54419
|
if (options.html) {
|
|
54422
54420
|
const html = htmlHandler(options.html, editor);
|
|
54423
54421
|
const doc2 = DOMParser$1.fromSchema(schema).parse(html);
|
|
54424
|
-
|
|
54422
|
+
return doc2.content;
|
|
54425
54423
|
}
|
|
54426
54424
|
if (options.json) {
|
|
54427
|
-
|
|
54428
|
-
}
|
|
54429
|
-
if (!content) {
|
|
54430
|
-
content = node.content;
|
|
54425
|
+
return schema.nodeFromJSON(options.json);
|
|
54431
54426
|
}
|
|
54427
|
+
return node.content;
|
|
54428
|
+
};
|
|
54429
|
+
for (const { node } of structuredContentTags) {
|
|
54430
|
+
const content = createContent(node);
|
|
54432
54431
|
const updatedNode = node.type.create({ ...node.attrs, ...options.attrs }, content, node.marks);
|
|
54433
54432
|
try {
|
|
54434
54433
|
updatedNode.check();
|
|
54435
|
-
updates.push({ pos, node: updatedNode, size: node.nodeSize });
|
|
54436
54434
|
} catch {
|
|
54437
54435
|
console.error("Updated node does not conform to the schema");
|
|
54438
54436
|
return false;
|
|
54439
54437
|
}
|
|
54440
54438
|
}
|
|
54441
54439
|
if (dispatch) {
|
|
54442
|
-
|
|
54443
|
-
tr.
|
|
54440
|
+
structuredContentTags.forEach(({ pos, node }) => {
|
|
54441
|
+
const mappedPos = tr.mapping.map(pos);
|
|
54442
|
+
const currentNode = tr.doc.nodeAt(mappedPos);
|
|
54443
|
+
if (currentNode && node.eq(currentNode)) {
|
|
54444
|
+
const content = createContent(node);
|
|
54445
|
+
const updatedNode = node.type.create({ ...node.attrs, ...options.attrs }, content, node.marks);
|
|
54446
|
+
tr.replaceWith(mappedPos, mappedPos + node.nodeSize, updatedNode);
|
|
54447
|
+
}
|
|
54444
54448
|
});
|
|
54445
54449
|
}
|
|
54446
54450
|
return true;
|
|
@@ -71386,7 +71390,7 @@ const _sfc_main$4$1 = {
|
|
|
71386
71390
|
};
|
|
71387
71391
|
const handleInputSubmit = () => {
|
|
71388
71392
|
const value = inlineTextInput.value;
|
|
71389
|
-
const cleanValue = value.
|
|
71393
|
+
const cleanValue = value.match(/^\d+(\.5)?$/) ? value : Math.floor(parseFloat(value)).toString();
|
|
71390
71394
|
emit("textSubmit", cleanValue);
|
|
71391
71395
|
inlineTextInput.value = cleanValue;
|
|
71392
71396
|
};
|
|
@@ -71468,7 +71472,7 @@ const _sfc_main$4$1 = {
|
|
|
71468
71472
|
};
|
|
71469
71473
|
}
|
|
71470
71474
|
};
|
|
71471
|
-
const ToolbarButton = /* @__PURE__ */ _export_sfc(_sfc_main$4$1, [["__scopeId", "data-v-
|
|
71475
|
+
const ToolbarButton = /* @__PURE__ */ _export_sfc(_sfc_main$4$1, [["__scopeId", "data-v-cea02a58"]]);
|
|
71472
71476
|
const _hoisted_1$2$1 = {
|
|
71473
71477
|
class: "toolbar-separator",
|
|
71474
71478
|
role: "separator",
|
package/dist/style.css
CHANGED
|
@@ -438,20 +438,20 @@ span[data-v-53e13009] {
|
|
|
438
438
|
width: 16px;
|
|
439
439
|
}
|
|
440
440
|
|
|
441
|
-
.toolbar-item[data-v-
|
|
441
|
+
.toolbar-item[data-v-cea02a58] {
|
|
442
442
|
position: relative;
|
|
443
443
|
z-index: 1;
|
|
444
444
|
min-width: 30px;
|
|
445
445
|
margin: 0 1px;
|
|
446
446
|
}
|
|
447
|
-
.visually-hidden[data-v-
|
|
447
|
+
.visually-hidden[data-v-cea02a58] {
|
|
448
448
|
position: absolute;
|
|
449
449
|
left: -9999px;
|
|
450
450
|
height: 1px;
|
|
451
451
|
width: 1px;
|
|
452
452
|
overflow: hidden;
|
|
453
453
|
}
|
|
454
|
-
.toolbar-button[data-v-
|
|
454
|
+
.toolbar-button[data-v-cea02a58] {
|
|
455
455
|
padding: 5px;
|
|
456
456
|
height: 32px;
|
|
457
457
|
max-height: 32px;
|
|
@@ -467,21 +467,21 @@ span[data-v-53e13009] {
|
|
|
467
467
|
position: relative;
|
|
468
468
|
box-sizing: border-box;
|
|
469
469
|
}
|
|
470
|
-
.toolbar-button[data-v-
|
|
470
|
+
.toolbar-button[data-v-cea02a58]:hover {
|
|
471
471
|
background-color: #dbdbdb;
|
|
472
472
|
}
|
|
473
|
-
.toolbar-button:hover .toolbar-icon.high-contrast[data-v-
|
|
473
|
+
.toolbar-button:hover .toolbar-icon.high-contrast[data-v-cea02a58] {
|
|
474
474
|
color: #fff;
|
|
475
475
|
}
|
|
476
|
-
.toolbar-button:hover.high-contrast[data-v-
|
|
476
|
+
.toolbar-button:hover.high-contrast[data-v-cea02a58] {
|
|
477
477
|
background-color: #000;
|
|
478
478
|
color: #fff;
|
|
479
479
|
}
|
|
480
|
-
.toolbar-button[data-v-
|
|
481
|
-
.active[data-v-
|
|
480
|
+
.toolbar-button[data-v-cea02a58]:active,
|
|
481
|
+
.active[data-v-cea02a58] {
|
|
482
482
|
background-color: #c8d0d8;
|
|
483
483
|
}
|
|
484
|
-
.button-label[data-v-
|
|
484
|
+
.button-label[data-v-cea02a58] {
|
|
485
485
|
overflow: hidden;
|
|
486
486
|
width: 100%;
|
|
487
487
|
text-align: center;
|
|
@@ -491,37 +491,37 @@ span[data-v-53e13009] {
|
|
|
491
491
|
font-size: 15px;
|
|
492
492
|
margin: 5px;
|
|
493
493
|
}
|
|
494
|
-
.toolbar-icon + .dropdown-caret[data-v-
|
|
494
|
+
.toolbar-icon + .dropdown-caret[data-v-cea02a58] {
|
|
495
495
|
margin-left: 4px;
|
|
496
496
|
}
|
|
497
|
-
.left[data-v-
|
|
498
|
-
.right[data-v-
|
|
497
|
+
.left[data-v-cea02a58],
|
|
498
|
+
.right[data-v-cea02a58] {
|
|
499
499
|
width: 50%;
|
|
500
500
|
height: 100%;
|
|
501
501
|
background-color: #dbdbdb;
|
|
502
502
|
border-radius: 60%;
|
|
503
503
|
}
|
|
504
|
-
.has-inline-text-input[data-v-
|
|
504
|
+
.has-inline-text-input[data-v-cea02a58]:hover {
|
|
505
505
|
cursor: text;
|
|
506
506
|
}
|
|
507
|
-
.disabled[data-v-
|
|
507
|
+
.disabled[data-v-cea02a58] {
|
|
508
508
|
cursor: default;
|
|
509
509
|
}
|
|
510
|
-
.disabled[data-v-
|
|
510
|
+
.disabled[data-v-cea02a58]:hover {
|
|
511
511
|
cursor: default;
|
|
512
512
|
background-color: initial;
|
|
513
513
|
}
|
|
514
|
-
.disabled .toolbar-icon[data-v-
|
|
515
|
-
.disabled .caret[data-v-
|
|
516
|
-
.disabled .button-label[data-v-
|
|
514
|
+
.disabled .toolbar-icon[data-v-cea02a58],
|
|
515
|
+
.disabled .caret[data-v-cea02a58],
|
|
516
|
+
.disabled .button-label[data-v-cea02a58] {
|
|
517
517
|
opacity: 0.35;
|
|
518
518
|
}
|
|
519
|
-
.caret[data-v-
|
|
519
|
+
.caret[data-v-cea02a58] {
|
|
520
520
|
font-size: 1em;
|
|
521
521
|
padding-left: 2px;
|
|
522
522
|
padding-right: 2px;
|
|
523
523
|
}
|
|
524
|
-
.button-text-input[data-v-
|
|
524
|
+
.button-text-input[data-v-cea02a58] {
|
|
525
525
|
color: #47484a;
|
|
526
526
|
border-radius: 4px;
|
|
527
527
|
text-align: center;
|
|
@@ -535,13 +535,13 @@ span[data-v-53e13009] {
|
|
|
535
535
|
border: 1px solid #d8dee5;
|
|
536
536
|
box-sizing: border-box;
|
|
537
537
|
}
|
|
538
|
-
.button-text-input.high-contrast[data-v-
|
|
538
|
+
.button-text-input.high-contrast[data-v-cea02a58] {
|
|
539
539
|
background-color: #fff;
|
|
540
540
|
}
|
|
541
|
-
.button-text-input[data-v-
|
|
541
|
+
.button-text-input[data-v-cea02a58]::placeholder {
|
|
542
542
|
color: #47484a;
|
|
543
543
|
}
|
|
544
|
-
.dropdown-caret[data-v-
|
|
544
|
+
.dropdown-caret[data-v-cea02a58] {
|
|
545
545
|
display: inline-flex;
|
|
546
546
|
align-items: center;
|
|
547
547
|
justify-content: center;
|
|
@@ -551,16 +551,16 @@ span[data-v-53e13009] {
|
|
|
551
551
|
height: 10px;
|
|
552
552
|
}
|
|
553
553
|
@media (max-width: 1280px) {
|
|
554
|
-
.toolbar-item--doc-mode .button-label[data-v-
|
|
554
|
+
.toolbar-item--doc-mode .button-label[data-v-cea02a58] {
|
|
555
555
|
display: none;
|
|
556
556
|
}
|
|
557
|
-
.toolbar-item--doc-mode .toolbar-icon[data-v-
|
|
557
|
+
.toolbar-item--doc-mode .toolbar-icon[data-v-cea02a58] {
|
|
558
558
|
margin-right: 5px;
|
|
559
559
|
}
|
|
560
|
-
.toolbar-item--linked-styles[data-v-
|
|
560
|
+
.toolbar-item--linked-styles[data-v-cea02a58] {
|
|
561
561
|
width: auto !important;
|
|
562
562
|
}
|
|
563
|
-
.toolbar-item--linked-styles .button-label[data-v-
|
|
563
|
+
.toolbar-item--linked-styles .button-label[data-v-cea02a58] {
|
|
564
564
|
display: none;
|
|
565
565
|
}
|
|
566
566
|
}
|
|
@@ -1497,6 +1497,13 @@ on the right if it is inside shape textbox.
|
|
|
1497
1497
|
white-space: nowrap;
|
|
1498
1498
|
text-overflow: ellipsis;
|
|
1499
1499
|
}
|
|
1500
|
+
.ProseMirror.view-mode .sd-document-section-block {
|
|
1501
|
+
background: none;
|
|
1502
|
+
border: none;
|
|
1503
|
+
}
|
|
1504
|
+
.ProseMirror.view-mode .sd-document-section-block-info {
|
|
1505
|
+
display: none;
|
|
1506
|
+
}
|
|
1500
1507
|
.sd-structured-content,
|
|
1501
1508
|
.sd-structured-content-block {
|
|
1502
1509
|
padding: 1px;
|
|
@@ -1540,6 +1547,14 @@ on the right if it is inside shape textbox.
|
|
|
1540
1547
|
.sd-structured-content-block:hover .sd-structured-content-draggable {
|
|
1541
1548
|
display: inline-flex;
|
|
1542
1549
|
}
|
|
1550
|
+
.ProseMirror.view-mode .sd-structured-content,
|
|
1551
|
+
.ProseMirror.view-mode .sd-structured-content-block {
|
|
1552
|
+
padding: 0;
|
|
1553
|
+
border: none;
|
|
1554
|
+
}
|
|
1555
|
+
.ProseMirror.view-mode .sd-structured-content-draggable {
|
|
1556
|
+
display: none;
|
|
1557
|
+
}
|
|
1543
1558
|
|
|
1544
1559
|
.alignment-buttons[data-v-d84f57b6] {
|
|
1545
1560
|
display: flex;
|
|
@@ -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-ClnqoStR.js";
|
|
3
|
-
import { _ as _export_sfc } from "./chunks/editor-
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/editor-Co2_vpme.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 = {}) {
|
|
@@ -17525,7 +17525,7 @@ const StructuredContentCommands = Extension.create({
|
|
|
17525
17525
|
* This will update every field that matches the given alias.
|
|
17526
17526
|
* If any updated node does not match the schema, no updates will be applied.
|
|
17527
17527
|
* @category Command
|
|
17528
|
-
* @param {string} alias - Shared identifier for fields (e.g., "customer_name")
|
|
17528
|
+
* @param {string | string[]} alias - Shared identifier for fields (e.g., "customer_name")
|
|
17529
17529
|
* @param {StructuredContentUpdate} options
|
|
17530
17530
|
*/
|
|
17531
17531
|
updateStructuredContentByAlias: (alias, options = {}) => ({ editor, dispatch, state, tr }) => {
|
|
@@ -17534,35 +17534,39 @@ const StructuredContentCommands = Extension.create({
|
|
|
17534
17534
|
return true;
|
|
17535
17535
|
}
|
|
17536
17536
|
const { schema } = editor;
|
|
17537
|
-
const
|
|
17538
|
-
for (const { pos, node } of structuredContentTags) {
|
|
17539
|
-
let content = null;
|
|
17537
|
+
const createContent = (node) => {
|
|
17540
17538
|
if (options.text) {
|
|
17541
|
-
|
|
17539
|
+
return schema.text(options.text);
|
|
17542
17540
|
}
|
|
17543
17541
|
if (options.html) {
|
|
17544
17542
|
const html = htmlHandler(options.html, editor);
|
|
17545
17543
|
const doc2 = DOMParser$1.fromSchema(schema).parse(html);
|
|
17546
|
-
|
|
17544
|
+
return doc2.content;
|
|
17547
17545
|
}
|
|
17548
17546
|
if (options.json) {
|
|
17549
|
-
|
|
17550
|
-
}
|
|
17551
|
-
if (!content) {
|
|
17552
|
-
content = node.content;
|
|
17547
|
+
return schema.nodeFromJSON(options.json);
|
|
17553
17548
|
}
|
|
17549
|
+
return node.content;
|
|
17550
|
+
};
|
|
17551
|
+
for (const { node } of structuredContentTags) {
|
|
17552
|
+
const content = createContent(node);
|
|
17554
17553
|
const updatedNode = node.type.create({ ...node.attrs, ...options.attrs }, content, node.marks);
|
|
17555
17554
|
try {
|
|
17556
17555
|
updatedNode.check();
|
|
17557
|
-
updates.push({ pos, node: updatedNode, size: node.nodeSize });
|
|
17558
17556
|
} catch {
|
|
17559
17557
|
console.error("Updated node does not conform to the schema");
|
|
17560
17558
|
return false;
|
|
17561
17559
|
}
|
|
17562
17560
|
}
|
|
17563
17561
|
if (dispatch) {
|
|
17564
|
-
|
|
17565
|
-
tr.
|
|
17562
|
+
structuredContentTags.forEach(({ pos, node }) => {
|
|
17563
|
+
const mappedPos = tr.mapping.map(pos);
|
|
17564
|
+
const currentNode = tr.doc.nodeAt(mappedPos);
|
|
17565
|
+
if (currentNode && node.eq(currentNode)) {
|
|
17566
|
+
const content = createContent(node);
|
|
17567
|
+
const updatedNode = node.type.create({ ...node.attrs, ...options.attrs }, content, node.marks);
|
|
17568
|
+
tr.replaceWith(mappedPos, mappedPos + node.nodeSize, updatedNode);
|
|
17569
|
+
}
|
|
17566
17570
|
});
|
|
17567
17571
|
}
|
|
17568
17572
|
return true;
|
|
@@ -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-ClnqoStR.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-Co2_vpme.js";
|
|
4
4
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
5
5
|
let sanitized = value.replace(/[^0-9.]/g, "");
|
|
6
6
|
sanitized = parseFloat(sanitized);
|
|
@@ -278,7 +278,7 @@ const _sfc_main$4 = {
|
|
|
278
278
|
};
|
|
279
279
|
const handleInputSubmit = () => {
|
|
280
280
|
const value = inlineTextInput.value;
|
|
281
|
-
const cleanValue = value.
|
|
281
|
+
const cleanValue = value.match(/^\d+(\.5)?$/) ? value : Math.floor(parseFloat(value)).toString();
|
|
282
282
|
emit("textSubmit", cleanValue);
|
|
283
283
|
inlineTextInput.value = cleanValue;
|
|
284
284
|
};
|
|
@@ -360,7 +360,7 @@ const _sfc_main$4 = {
|
|
|
360
360
|
};
|
|
361
361
|
}
|
|
362
362
|
};
|
|
363
|
-
const ToolbarButton = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
363
|
+
const ToolbarButton = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-cea02a58"]]);
|
|
364
364
|
const _hoisted_1$2 = {
|
|
365
365
|
class: "toolbar-separator",
|
|
366
366
|
role: "separator",
|
|
@@ -64,20 +64,20 @@
|
|
|
64
64
|
width: 16px;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
.toolbar-item[data-v-
|
|
67
|
+
.toolbar-item[data-v-cea02a58] {
|
|
68
68
|
position: relative;
|
|
69
69
|
z-index: 1;
|
|
70
70
|
min-width: 30px;
|
|
71
71
|
margin: 0 1px;
|
|
72
72
|
}
|
|
73
|
-
.visually-hidden[data-v-
|
|
73
|
+
.visually-hidden[data-v-cea02a58] {
|
|
74
74
|
position: absolute;
|
|
75
75
|
left: -9999px;
|
|
76
76
|
height: 1px;
|
|
77
77
|
width: 1px;
|
|
78
78
|
overflow: hidden;
|
|
79
79
|
}
|
|
80
|
-
.toolbar-button[data-v-
|
|
80
|
+
.toolbar-button[data-v-cea02a58] {
|
|
81
81
|
padding: 5px;
|
|
82
82
|
height: 32px;
|
|
83
83
|
max-height: 32px;
|
|
@@ -93,21 +93,21 @@
|
|
|
93
93
|
position: relative;
|
|
94
94
|
box-sizing: border-box;
|
|
95
95
|
}
|
|
96
|
-
.toolbar-button[data-v-
|
|
96
|
+
.toolbar-button[data-v-cea02a58]:hover {
|
|
97
97
|
background-color: #dbdbdb;
|
|
98
98
|
}
|
|
99
|
-
.toolbar-button:hover .toolbar-icon.high-contrast[data-v-
|
|
99
|
+
.toolbar-button:hover .toolbar-icon.high-contrast[data-v-cea02a58] {
|
|
100
100
|
color: #fff;
|
|
101
101
|
}
|
|
102
|
-
.toolbar-button:hover.high-contrast[data-v-
|
|
102
|
+
.toolbar-button:hover.high-contrast[data-v-cea02a58] {
|
|
103
103
|
background-color: #000;
|
|
104
104
|
color: #fff;
|
|
105
105
|
}
|
|
106
|
-
.toolbar-button[data-v-
|
|
107
|
-
.active[data-v-
|
|
106
|
+
.toolbar-button[data-v-cea02a58]:active,
|
|
107
|
+
.active[data-v-cea02a58] {
|
|
108
108
|
background-color: #c8d0d8;
|
|
109
109
|
}
|
|
110
|
-
.button-label[data-v-
|
|
110
|
+
.button-label[data-v-cea02a58] {
|
|
111
111
|
overflow: hidden;
|
|
112
112
|
width: 100%;
|
|
113
113
|
text-align: center;
|
|
@@ -117,37 +117,37 @@
|
|
|
117
117
|
font-size: 15px;
|
|
118
118
|
margin: 5px;
|
|
119
119
|
}
|
|
120
|
-
.toolbar-icon + .dropdown-caret[data-v-
|
|
120
|
+
.toolbar-icon + .dropdown-caret[data-v-cea02a58] {
|
|
121
121
|
margin-left: 4px;
|
|
122
122
|
}
|
|
123
|
-
.left[data-v-
|
|
124
|
-
.right[data-v-
|
|
123
|
+
.left[data-v-cea02a58],
|
|
124
|
+
.right[data-v-cea02a58] {
|
|
125
125
|
width: 50%;
|
|
126
126
|
height: 100%;
|
|
127
127
|
background-color: #dbdbdb;
|
|
128
128
|
border-radius: 60%;
|
|
129
129
|
}
|
|
130
|
-
.has-inline-text-input[data-v-
|
|
130
|
+
.has-inline-text-input[data-v-cea02a58]:hover {
|
|
131
131
|
cursor: text;
|
|
132
132
|
}
|
|
133
|
-
.disabled[data-v-
|
|
133
|
+
.disabled[data-v-cea02a58] {
|
|
134
134
|
cursor: default;
|
|
135
135
|
}
|
|
136
|
-
.disabled[data-v-
|
|
136
|
+
.disabled[data-v-cea02a58]:hover {
|
|
137
137
|
cursor: default;
|
|
138
138
|
background-color: initial;
|
|
139
139
|
}
|
|
140
|
-
.disabled .toolbar-icon[data-v-
|
|
141
|
-
.disabled .caret[data-v-
|
|
142
|
-
.disabled .button-label[data-v-
|
|
140
|
+
.disabled .toolbar-icon[data-v-cea02a58],
|
|
141
|
+
.disabled .caret[data-v-cea02a58],
|
|
142
|
+
.disabled .button-label[data-v-cea02a58] {
|
|
143
143
|
opacity: 0.35;
|
|
144
144
|
}
|
|
145
|
-
.caret[data-v-
|
|
145
|
+
.caret[data-v-cea02a58] {
|
|
146
146
|
font-size: 1em;
|
|
147
147
|
padding-left: 2px;
|
|
148
148
|
padding-right: 2px;
|
|
149
149
|
}
|
|
150
|
-
.button-text-input[data-v-
|
|
150
|
+
.button-text-input[data-v-cea02a58] {
|
|
151
151
|
color: #47484a;
|
|
152
152
|
border-radius: 4px;
|
|
153
153
|
text-align: center;
|
|
@@ -161,13 +161,13 @@
|
|
|
161
161
|
border: 1px solid #d8dee5;
|
|
162
162
|
box-sizing: border-box;
|
|
163
163
|
}
|
|
164
|
-
.button-text-input.high-contrast[data-v-
|
|
164
|
+
.button-text-input.high-contrast[data-v-cea02a58] {
|
|
165
165
|
background-color: #fff;
|
|
166
166
|
}
|
|
167
|
-
.button-text-input[data-v-
|
|
167
|
+
.button-text-input[data-v-cea02a58]::placeholder {
|
|
168
168
|
color: #47484a;
|
|
169
169
|
}
|
|
170
|
-
.dropdown-caret[data-v-
|
|
170
|
+
.dropdown-caret[data-v-cea02a58] {
|
|
171
171
|
display: inline-flex;
|
|
172
172
|
align-items: center;
|
|
173
173
|
justify-content: center;
|
|
@@ -177,16 +177,16 @@
|
|
|
177
177
|
height: 10px;
|
|
178
178
|
}
|
|
179
179
|
@media (max-width: 1280px) {
|
|
180
|
-
.toolbar-item--doc-mode .button-label[data-v-
|
|
180
|
+
.toolbar-item--doc-mode .button-label[data-v-cea02a58] {
|
|
181
181
|
display: none;
|
|
182
182
|
}
|
|
183
|
-
.toolbar-item--doc-mode .toolbar-icon[data-v-
|
|
183
|
+
.toolbar-item--doc-mode .toolbar-icon[data-v-cea02a58] {
|
|
184
184
|
margin-right: 5px;
|
|
185
185
|
}
|
|
186
|
-
.toolbar-item--linked-styles[data-v-
|
|
186
|
+
.toolbar-item--linked-styles[data-v-cea02a58] {
|
|
187
187
|
width: auto !important;
|
|
188
188
|
}
|
|
189
|
-
.toolbar-item--linked-styles .button-label[data-v-
|
|
189
|
+
.toolbar-item--linked-styles .button-label[data-v-cea02a58] {
|
|
190
190
|
display: none;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
@@ -1123,6 +1123,13 @@ on the right if it is inside shape textbox.
|
|
|
1123
1123
|
white-space: nowrap;
|
|
1124
1124
|
text-overflow: ellipsis;
|
|
1125
1125
|
}
|
|
1126
|
+
.ProseMirror.view-mode .sd-document-section-block {
|
|
1127
|
+
background: none;
|
|
1128
|
+
border: none;
|
|
1129
|
+
}
|
|
1130
|
+
.ProseMirror.view-mode .sd-document-section-block-info {
|
|
1131
|
+
display: none;
|
|
1132
|
+
}
|
|
1126
1133
|
.sd-structured-content,
|
|
1127
1134
|
.sd-structured-content-block {
|
|
1128
1135
|
padding: 1px;
|
|
@@ -1166,6 +1173,14 @@ on the right if it is inside shape textbox.
|
|
|
1166
1173
|
.sd-structured-content-block:hover .sd-structured-content-draggable {
|
|
1167
1174
|
display: inline-flex;
|
|
1168
1175
|
}
|
|
1176
|
+
.ProseMirror.view-mode .sd-structured-content,
|
|
1177
|
+
.ProseMirror.view-mode .sd-structured-content-block {
|
|
1178
|
+
padding: 0;
|
|
1179
|
+
border: none;
|
|
1180
|
+
}
|
|
1181
|
+
.ProseMirror.view-mode .sd-structured-content-draggable {
|
|
1182
|
+
display: none;
|
|
1183
|
+
}
|
|
1169
1184
|
|
|
1170
1185
|
.alignment-buttons[data-v-d84f57b6] {
|
|
1171
1186
|
display: flex;
|