@harbour-enterprises/superdoc 0.13.2-rev6 → 0.13.2-rev8
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/{eventemitter3-DfVviFzP.cjs → eventemitter3-CHxWXmuK.cjs} +1 -1
- package/dist/chunks/{eventemitter3-BrspJk8q.es.js → eventemitter3-KKY27oz-.es.js} +1 -1
- package/dist/chunks/{index-KzH9VKHh.es.js → index-B1TbritH.es.js} +2 -2
- package/dist/chunks/{index-B0t3i_io.cjs → index-Bd4H2zrq.cjs} +2 -2
- package/dist/chunks/{index-Bk160jQ2.cjs → index-Bdjh4ZPT.cjs} +4 -4
- package/dist/chunks/{index-D_HUrFWV.es.js → index-DuSTYEOs.es.js} +4 -4
- package/dist/chunks/{jszip-BTAcmbVg.cjs → jszip-9bCX1h2W.cjs} +1 -1
- package/dist/chunks/{jszip-DckFs3A7.es.js → jszip-Cl3s9njw.es.js} +1 -1
- package/dist/chunks/{super-editor.es-Dc89JIQn.es.js → super-editor.es-BY5Eoi9A.es.js} +72 -40
- package/dist/chunks/{super-editor.es-BTxObl3D.cjs → super-editor.es-Cz-ceaxn.cjs} +72 -40
- package/dist/chunks/{url-CWyTQ-Xy.cjs → url-CJP-Jmfp.cjs} +2 -2
- package/dist/chunks/{url-DsBQArCl.es.js → url-CLwIePTG.es.js} +2 -2
- package/dist/chunks/{vue-Bi1uWinj.es.js → vue-BBJVqxjL.es.js} +10 -3
- package/dist/chunks/{vue-HIY1g7dm.cjs → vue-BBjMeYfo.cjs} +10 -3
- package/dist/chunks/{xml-js-CdiD26MJ.es.js → xml-js-Bp5Hoq_3.es.js} +160 -125
- package/dist/chunks/{xml-js-Bu1ZZzmb.cjs → xml-js-k_RETz76.cjs} +160 -125
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-DZFBaVFd.js → converter-RV0QN3HE.js} +2 -2
- package/dist/super-editor/chunks/{docx-zipper-dbI_Pbue.js → docx-zipper-C5TBRQNB.js} +1 -1
- package/dist/super-editor/chunks/{editor-Bz5BbOEe.js → editor-XlwZxMCI.js} +62 -26
- package/dist/super-editor/chunks/{toolbar-C07jc7pa.js → toolbar-52_BMgdJ.js} +2 -3
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/core/Editor.d.ts.map +1 -1
- package/dist/super-editor/core/helpers/setImageNodeSelection.d.ts +2 -0
- package/dist/super-editor/core/helpers/setImageNodeSelection.d.ts.map +1 -0
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/extensions/field-annotation/fieldAnnotationHelpers/findRemovedFieldAnnotations.d.ts.map +1 -1
- package/dist/super-editor/extensions/image/imageHelpers/startImageUpload.d.ts.map +1 -1
- package/dist/super-editor/extensions/noderesizer/noderesizer.d.ts.map +1 -1
- package/dist/super-editor/extensions/pagination/pagination.d.ts.map +1 -1
- package/dist/super-editor/extensions/paragraph/paragraph.d.ts.map +1 -1
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/super-editor.es.js +6 -6
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +2 -2
- package/dist/super-editor.es.js +2 -2
- package/dist/superdoc.cjs +8 -9
- package/dist/superdoc.es.js +9 -10
- package/dist/superdoc.umd.js +82 -44
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs } from "./jszip-
|
|
2
|
-
import { s as streamHttp, r as require$$1 } from "./index-
|
|
1
|
+
import { g as getDefaultExportFromCjs } from "./jszip-Cl3s9njw.es.js";
|
|
2
|
+
import { s as streamHttp, r as require$$1 } from "./index-DuSTYEOs.es.js";
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
for (var i = 0; i < m.length; i++) {
|
|
5
5
|
const e = m[i];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const jszip = require("./jszip-
|
|
3
|
-
const index$2 = require("./index-
|
|
2
|
+
const jszip = require("./jszip-9bCX1h2W.cjs");
|
|
3
|
+
const index$2 = require("./index-Bdjh4ZPT.cjs");
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
5
5
|
for (var i = 0; i < m.length; i++) {
|
|
6
6
|
const e = m[i];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const jszip = require("./jszip-
|
|
3
|
-
const vue = require("./vue-
|
|
4
|
-
const xmlJs = require("./xml-js-
|
|
5
|
-
const url = require("./url-
|
|
2
|
+
const jszip = require("./jszip-9bCX1h2W.cjs");
|
|
3
|
+
const vue = require("./vue-BBjMeYfo.cjs");
|
|
4
|
+
const xmlJs = require("./xml-js-k_RETz76.cjs");
|
|
5
|
+
const url = require("./url-CJP-Jmfp.cjs");
|
|
6
6
|
function _mergeNamespaces(n, m) {
|
|
7
7
|
for (var i = 0; i < m.length; i++) {
|
|
8
8
|
const e = m[i];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as commonjsGlobal, B as Buffer, a as getAugmentedNamespace, g as getDefaultExportFromCjs } from "./jszip-
|
|
2
|
-
import { p as process$1 } from "./vue-
|
|
3
|
-
import { e as eventsExports, r as require$$2, u as util, i as inherits_browserExports, b as browser$1, a as requireString_decoder } from "./xml-js-
|
|
4
|
-
import { u as url } from "./url-
|
|
1
|
+
import { c as commonjsGlobal, B as Buffer, a as getAugmentedNamespace, g as getDefaultExportFromCjs } from "./jszip-Cl3s9njw.es.js";
|
|
2
|
+
import { p as process$1 } from "./vue-BBJVqxjL.es.js";
|
|
3
|
+
import { e as eventsExports, r as require$$2, u as util, i as inherits_browserExports, b as browser$1, a as requireString_decoder } from "./xml-js-Bp5Hoq_3.es.js";
|
|
4
|
+
import { u as url } from "./url-CLwIePTG.es.js";
|
|
5
5
|
function _mergeNamespaces(n, m) {
|
|
6
6
|
for (var i = 0; i < m.length; i++) {
|
|
7
7
|
const e = m[i];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as global$2, r as ref$1, c as createApp, a as computed, b as createElementBlock, o as openBlock, F as Fragment$1, d as renderList, n as normalizeClass, w as withModifiers, e as createCommentVNode, t as toDisplayString, f as createBaseVNode, i as inject, h as onBeforeMount, j as onMounted, k as onBeforeUnmount, l as watch, m as defineComponent, q as getCurrentInstance, s as onDeactivated, u as nextTick, v as createBlock, x as createVNode, y as unref, z as withCtx, A as createTextVNode, B as normalizeStyle, C as h, D as toRef, E as provide, G as mergeProps, H as cloneVNode, T as Text$2, I as withDirectives, J as watchEffect, K as shallowRef, L as vModelText, M as withKeys, N as reactive, O as readonly, P as Transition, Q as vShow, R as Comment, S as renderSlot, U as onActivated, V as Teleport, W as isVNode, X as onUnmounted } from "./vue-
|
|
1
|
+
import { g as global$2, r as ref$1, c as createApp, a as computed, b as createElementBlock, o as openBlock, F as Fragment$1, d as renderList, n as normalizeClass, w as withModifiers, e as createCommentVNode, t as toDisplayString, f as createBaseVNode, i as inject, h as onBeforeMount, j as onMounted, k as onBeforeUnmount, l as watch, m as defineComponent, q as getCurrentInstance, s as onDeactivated, u as nextTick, v as createBlock, x as createVNode, y as unref, z as withCtx, A as createTextVNode, B as normalizeStyle, C as h, D as toRef, E as provide, G as mergeProps, H as cloneVNode, T as Text$2, I as withDirectives, J as watchEffect, K as shallowRef, L as vModelText, M as withKeys, N as reactive, O as readonly, P as Transition, Q as vShow, R as Comment, S as renderSlot, U as onActivated, V as Teleport, W as isVNode, X as onUnmounted } from "./vue-BBJVqxjL.es.js";
|
|
2
2
|
import * as Y from "yjs";
|
|
3
3
|
import { UndoManager, Item as Item$2, ContentType, Text as Text$1, XmlElement, encodeStateAsUpdate } from "yjs";
|
|
4
4
|
var __defProp$2 = Object.defineProperty;
|
|
@@ -13726,7 +13726,7 @@ class ReplaceStep extends Step {
|
|
|
13726
13726
|
}
|
|
13727
13727
|
}
|
|
13728
13728
|
Step.jsonID("replace", ReplaceStep);
|
|
13729
|
-
|
|
13729
|
+
let ReplaceAroundStep$1 = class ReplaceAroundStep2 extends Step {
|
|
13730
13730
|
/**
|
|
13731
13731
|
Create a replace-around step with the given range and gap.
|
|
13732
13732
|
`insert` should be the point in the slice into which the content
|
|
@@ -13766,7 +13766,7 @@ class ReplaceAroundStep extends Step {
|
|
|
13766
13766
|
}
|
|
13767
13767
|
invert(doc2) {
|
|
13768
13768
|
let gap = this.gapTo - this.gapFrom;
|
|
13769
|
-
return new
|
|
13769
|
+
return new ReplaceAroundStep2(this.from, this.from + this.slice.size + gap, this.from + this.insert, this.from + this.insert + gap, doc2.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);
|
|
13770
13770
|
}
|
|
13771
13771
|
map(mapping) {
|
|
13772
13772
|
let from2 = mapping.mapResult(this.from, 1), to = mapping.mapResult(this.to, -1);
|
|
@@ -13774,7 +13774,7 @@ class ReplaceAroundStep extends Step {
|
|
|
13774
13774
|
let gapTo = this.to == this.gapTo ? to.pos : mapping.map(this.gapTo, 1);
|
|
13775
13775
|
if (from2.deletedAcross && to.deletedAcross || gapFrom < from2.pos || gapTo > to.pos)
|
|
13776
13776
|
return null;
|
|
13777
|
-
return new
|
|
13777
|
+
return new ReplaceAroundStep2(from2.pos, to.pos, gapFrom, gapTo, this.slice, this.insert, this.structure);
|
|
13778
13778
|
}
|
|
13779
13779
|
toJSON() {
|
|
13780
13780
|
let json = {
|
|
@@ -13797,10 +13797,10 @@ class ReplaceAroundStep extends Step {
|
|
|
13797
13797
|
static fromJSON(schema, json) {
|
|
13798
13798
|
if (typeof json.from != "number" || typeof json.to != "number" || typeof json.gapFrom != "number" || typeof json.gapTo != "number" || typeof json.insert != "number")
|
|
13799
13799
|
throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");
|
|
13800
|
-
return new
|
|
13800
|
+
return new ReplaceAroundStep2(json.from, json.to, json.gapFrom, json.gapTo, Slice.fromJSON(schema, json.slice), json.insert, !!json.structure);
|
|
13801
13801
|
}
|
|
13802
|
-
}
|
|
13803
|
-
Step.jsonID("replaceAround", ReplaceAroundStep);
|
|
13802
|
+
};
|
|
13803
|
+
Step.jsonID("replaceAround", ReplaceAroundStep$1);
|
|
13804
13804
|
function contentBetween(doc2, from2, to) {
|
|
13805
13805
|
let $from = doc2.resolve(from2), dist2 = to - from2, depth = $from.depth;
|
|
13806
13806
|
while (dist2 > 0 && depth > 0 && $from.indexAfter(depth) == $from.node(depth).childCount) {
|
|
@@ -13953,7 +13953,7 @@ function lift(tr, range2, target) {
|
|
|
13953
13953
|
} else {
|
|
13954
13954
|
end2++;
|
|
13955
13955
|
}
|
|
13956
|
-
tr.step(new ReplaceAroundStep(start2, end2, gapStart, gapEnd, new Slice(before.append(after), openStart, openEnd), before.size - openStart, true));
|
|
13956
|
+
tr.step(new ReplaceAroundStep$1(start2, end2, gapStart, gapEnd, new Slice(before.append(after), openStart, openEnd), before.size - openStart, true));
|
|
13957
13957
|
}
|
|
13958
13958
|
function findWrapping(range2, nodeType, attrs = null, innerRange = range2) {
|
|
13959
13959
|
let around = findWrappingOutside(range2, nodeType);
|
|
@@ -13998,7 +13998,7 @@ function wrap(tr, range2, wrappers) {
|
|
|
13998
13998
|
content = Fragment.from(wrappers[i].type.create(wrappers[i].attrs, content));
|
|
13999
13999
|
}
|
|
14000
14000
|
let start2 = range2.start, end2 = range2.end;
|
|
14001
|
-
tr.step(new ReplaceAroundStep(start2, end2, start2, end2, new Slice(content, 0, 0), wrappers.length, true));
|
|
14001
|
+
tr.step(new ReplaceAroundStep$1(start2, end2, start2, end2, new Slice(content, 0, 0), wrappers.length, true));
|
|
14002
14002
|
}
|
|
14003
14003
|
function setBlockType$1(tr, from2, to, type2, attrs) {
|
|
14004
14004
|
if (!type2.isTextblock)
|
|
@@ -14020,7 +14020,7 @@ function setBlockType$1(tr, from2, to, type2, attrs) {
|
|
|
14020
14020
|
clearIncompatible(tr, tr.mapping.slice(mapFrom).map(pos, 1), type2, void 0, convertNewlines === null);
|
|
14021
14021
|
let mapping = tr.mapping.slice(mapFrom);
|
|
14022
14022
|
let startM = mapping.map(pos, 1), endM = mapping.map(pos + node2.nodeSize, 1);
|
|
14023
|
-
tr.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(Fragment.from(type2.create(attrsHere, null, node2.marks)), 0, 0), 1, true));
|
|
14023
|
+
tr.step(new ReplaceAroundStep$1(startM, endM, startM + 1, endM - 1, new Slice(Fragment.from(type2.create(attrsHere, null, node2.marks)), 0, 0), 1, true));
|
|
14024
14024
|
if (convertNewlines === true)
|
|
14025
14025
|
replaceNewlines(tr, node2, pos, mapFrom);
|
|
14026
14026
|
return false;
|
|
@@ -14061,7 +14061,7 @@ function setNodeMarkup(tr, pos, type2, attrs, marks) {
|
|
|
14061
14061
|
return tr.replaceWith(pos, pos + node2.nodeSize, newNode);
|
|
14062
14062
|
if (!type2.validContent(node2.content))
|
|
14063
14063
|
throw new RangeError("Invalid content for node type " + type2.name);
|
|
14064
|
-
tr.step(new ReplaceAroundStep(pos, pos + node2.nodeSize, pos + 1, pos + node2.nodeSize - 1, new Slice(Fragment.from(newNode), 0, 0), 1, true));
|
|
14064
|
+
tr.step(new ReplaceAroundStep$1(pos, pos + node2.nodeSize, pos + 1, pos + node2.nodeSize - 1, new Slice(Fragment.from(newNode), 0, 0), 1, true));
|
|
14065
14065
|
}
|
|
14066
14066
|
function canSplit(doc2, pos, depth = 1, typesAfter) {
|
|
14067
14067
|
let $pos = doc2.resolve(pos), base2 = $pos.depth - depth;
|
|
@@ -14262,7 +14262,7 @@ class Fitter {
|
|
|
14262
14262
|
}
|
|
14263
14263
|
let slice2 = new Slice(content, openStart, openEnd);
|
|
14264
14264
|
if (moveInline > -1)
|
|
14265
|
-
return new ReplaceAroundStep($from.pos, moveInline, this.$to.pos, this.$to.end(), slice2, placedSize);
|
|
14265
|
+
return new ReplaceAroundStep$1($from.pos, moveInline, this.$to.pos, this.$to.end(), slice2, placedSize);
|
|
14266
14266
|
if (slice2.size || $from.pos != this.$to.pos)
|
|
14267
14267
|
return new ReplaceStep($from.pos, $to.pos, slice2);
|
|
14268
14268
|
return null;
|
|
@@ -15345,7 +15345,7 @@ function selectionToInsertionEnd$1(tr, startLen, bias) {
|
|
|
15345
15345
|
if (last < startLen)
|
|
15346
15346
|
return;
|
|
15347
15347
|
let step = tr.steps[last];
|
|
15348
|
-
if (!(step instanceof ReplaceStep || step instanceof ReplaceAroundStep))
|
|
15348
|
+
if (!(step instanceof ReplaceStep || step instanceof ReplaceAroundStep$1))
|
|
15349
15349
|
return;
|
|
15350
15350
|
let map3 = tr.mapping.maps[last], end2;
|
|
15351
15351
|
map3.forEach((_from, _to, _newFrom, newTo) => {
|
|
@@ -23972,7 +23972,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
23972
23972
|
return;
|
|
23973
23973
|
}
|
|
23974
23974
|
}
|
|
23975
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.13.2-
|
|
23975
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.13.2-rev8") {
|
|
23976
23976
|
const customLocation = "docProps/custom.xml";
|
|
23977
23977
|
if (!docx[customLocation]) {
|
|
23978
23978
|
docx[customLocation] = generateCustomXml();
|
|
@@ -24439,7 +24439,7 @@ function storeSuperdocVersion(docx) {
|
|
|
24439
24439
|
function generateCustomXml() {
|
|
24440
24440
|
return DEFAULT_CUSTOM_XML;
|
|
24441
24441
|
}
|
|
24442
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.13.2-
|
|
24442
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.13.2-rev8") {
|
|
24443
24443
|
return {
|
|
24444
24444
|
type: "element",
|
|
24445
24445
|
name: "property",
|
|
@@ -26972,7 +26972,7 @@ var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "rea
|
|
|
26972
26972
|
var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
26973
26973
|
var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
|
|
26974
26974
|
var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
|
|
26975
|
-
var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _commandService, _css, _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, createDocFromHTML_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn;
|
|
26975
|
+
var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _commandService, _css, _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, createDocFromHTML_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn;
|
|
26976
26976
|
function getMarksFromSelection(state2) {
|
|
26977
26977
|
const { from: from2, to, empty: empty2 } = state2.selection;
|
|
26978
26978
|
const marks = [];
|
|
@@ -28522,7 +28522,7 @@ function deleteBarrier(state2, $cut, dispatch, dir) {
|
|
|
28522
28522
|
for (let i = conn.length - 1; i >= 0; i--)
|
|
28523
28523
|
wrap2 = Fragment.from(conn[i].create(null, wrap2));
|
|
28524
28524
|
wrap2 = Fragment.from(before.copy(wrap2));
|
|
28525
|
-
let tr = state2.tr.step(new ReplaceAroundStep($cut.pos - 1, end2, $cut.pos, end2, new Slice(wrap2, 1, 0), conn.length, true));
|
|
28525
|
+
let tr = state2.tr.step(new ReplaceAroundStep$1($cut.pos - 1, end2, $cut.pos, end2, new Slice(wrap2, 1, 0), conn.length, true));
|
|
28526
28526
|
let $joinAt = tr.doc.resolve(end2 + 2 * conn.length);
|
|
28527
28527
|
if ($joinAt.nodeAfter && $joinAt.nodeAfter.type == before.type && canJoin(tr.doc, $joinAt.pos))
|
|
28528
28528
|
tr.join($joinAt.pos);
|
|
@@ -28553,7 +28553,7 @@ function deleteBarrier(state2, $cut, dispatch, dir) {
|
|
|
28553
28553
|
let end2 = Fragment.empty;
|
|
28554
28554
|
for (let i = wrap2.length - 1; i >= 0; i--)
|
|
28555
28555
|
end2 = Fragment.from(wrap2[i].copy(end2));
|
|
28556
|
-
let tr = state2.tr.step(new ReplaceAroundStep($cut.pos - wrap2.length, $cut.pos + after.nodeSize, $cut.pos + afterDepth, $cut.pos + after.nodeSize - afterDepth, new Slice(end2, wrap2.length, 0), 0, true));
|
|
28556
|
+
let tr = state2.tr.step(new ReplaceAroundStep$1($cut.pos - wrap2.length, $cut.pos + after.nodeSize, $cut.pos + afterDepth, $cut.pos + after.nodeSize - afterDepth, new Slice(end2, wrap2.length, 0), 0, true));
|
|
28557
28557
|
dispatch(tr.scrollIntoView());
|
|
28558
28558
|
}
|
|
28559
28559
|
return true;
|
|
@@ -29126,7 +29126,7 @@ function selectionToInsertionEnd(tr, startLen, bias) {
|
|
|
29126
29126
|
return;
|
|
29127
29127
|
}
|
|
29128
29128
|
const step = tr.steps[last];
|
|
29129
|
-
if (!(step instanceof ReplaceStep || step instanceof ReplaceAroundStep)) {
|
|
29129
|
+
if (!(step instanceof ReplaceStep || step instanceof ReplaceAroundStep$1)) {
|
|
29130
29130
|
return;
|
|
29131
29131
|
}
|
|
29132
29132
|
const map22 = tr.mapping.maps[last];
|
|
@@ -29272,7 +29272,7 @@ function doWrapInList(tr, range2, wrappers, joinBefore, listType) {
|
|
|
29272
29272
|
let content = Fragment.empty;
|
|
29273
29273
|
for (let i = wrappers.length - 1; i >= 0; i--)
|
|
29274
29274
|
content = Fragment.from(wrappers[i].type.create(wrappers[i].attrs, content));
|
|
29275
|
-
tr.step(new ReplaceAroundStep(range2.start - (joinBefore ? 2 : 0), range2.end, range2.start, range2.end, new Slice(content, 0, 0), wrappers.length, true));
|
|
29275
|
+
tr.step(new ReplaceAroundStep$1(range2.start - (joinBefore ? 2 : 0), range2.end, range2.start, range2.end, new Slice(content, 0, 0), wrappers.length, true));
|
|
29276
29276
|
let found2 = 0;
|
|
29277
29277
|
for (let i = 0; i < wrappers.length; i++)
|
|
29278
29278
|
if (wrappers[i].type == listType)
|
|
@@ -29305,7 +29305,7 @@ function liftListItem$1(itemType) {
|
|
|
29305
29305
|
function liftToOuterList(state2, dispatch, itemType, range2) {
|
|
29306
29306
|
let tr = state2.tr, end2 = range2.end, endOfList = range2.$to.end(range2.depth);
|
|
29307
29307
|
if (end2 < endOfList) {
|
|
29308
|
-
tr.step(new ReplaceAroundStep(end2 - 1, endOfList, end2, endOfList, new Slice(Fragment.from(itemType.create(null, range2.parent.copy())), 1, 0), 1, true));
|
|
29308
|
+
tr.step(new ReplaceAroundStep$1(end2 - 1, endOfList, end2, endOfList, new Slice(Fragment.from(itemType.create(null, range2.parent.copy())), 1, 0), 1, true));
|
|
29309
29309
|
range2 = new NodeRange(tr.doc.resolve(range2.$from.pos), tr.doc.resolve(endOfList), range2.depth);
|
|
29310
29310
|
}
|
|
29311
29311
|
const target = liftTarget(range2);
|
|
@@ -29332,7 +29332,7 @@ function liftOutOfList(state2, dispatch, range2) {
|
|
|
29332
29332
|
if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ? Fragment.empty : Fragment.from(list))))
|
|
29333
29333
|
return false;
|
|
29334
29334
|
let start2 = $start.pos, end2 = start2 + item.nodeSize;
|
|
29335
|
-
tr.step(new ReplaceAroundStep(start2 - (atStart ? 1 : 0), end2 + (atEnd ? 1 : 0), start2 + 1, end2 - 1, new Slice((atStart ? Fragment.empty : Fragment.from(list.copy(Fragment.empty))).append(atEnd ? Fragment.empty : Fragment.from(list.copy(Fragment.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
|
|
29335
|
+
tr.step(new ReplaceAroundStep$1(start2 - (atStart ? 1 : 0), end2 + (atEnd ? 1 : 0), start2 + 1, end2 - 1, new Slice((atStart ? Fragment.empty : Fragment.from(list.copy(Fragment.empty))).append(atEnd ? Fragment.empty : Fragment.from(list.copy(Fragment.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
|
|
29336
29336
|
dispatch(tr.scrollIntoView());
|
|
29337
29337
|
return true;
|
|
29338
29338
|
}
|
|
@@ -29353,7 +29353,7 @@ function sinkListItem$1(itemType) {
|
|
|
29353
29353
|
let inner = Fragment.from(nestedBefore ? itemType.create() : null);
|
|
29354
29354
|
let slice2 = new Slice(Fragment.from(itemType.create(null, Fragment.from(parent.type.create(null, inner)))), nestedBefore ? 3 : 1, 0);
|
|
29355
29355
|
let before = range2.start, after = range2.end;
|
|
29356
|
-
dispatch(state2.tr.step(new ReplaceAroundStep(before - (nestedBefore ? 3 : 1), after, before, after, slice2, 1, true)).scrollIntoView());
|
|
29356
|
+
dispatch(state2.tr.step(new ReplaceAroundStep$1(before - (nestedBefore ? 3 : 1), after, before, after, slice2, 1, true)).scrollIntoView());
|
|
29357
29357
|
}
|
|
29358
29358
|
return true;
|
|
29359
29359
|
};
|
|
@@ -36946,7 +36946,8 @@ const restoreRelativeSelection = (tr, relSel, binding) => {
|
|
|
36946
36946
|
binding.mapping
|
|
36947
36947
|
);
|
|
36948
36948
|
if (anchor !== null && head !== null) {
|
|
36949
|
-
|
|
36949
|
+
const sel = TextSelection.between(tr.doc.resolve(anchor), tr.doc.resolve(head));
|
|
36950
|
+
tr.setSelection(sel);
|
|
36950
36951
|
}
|
|
36951
36952
|
}
|
|
36952
36953
|
}
|
|
@@ -37727,7 +37728,7 @@ const setMeta = (view, key, value) => {
|
|
|
37727
37728
|
};
|
|
37728
37729
|
const absolutePositionToRelativePosition = (pos, type2, mapping) => {
|
|
37729
37730
|
if (pos === 0) {
|
|
37730
|
-
return Y.createRelativePositionFromTypeIndex(type2, 0, -1);
|
|
37731
|
+
return Y.createRelativePositionFromTypeIndex(type2, 0, type2.length === 0 ? -1 : 0);
|
|
37731
37732
|
}
|
|
37732
37733
|
let n = type2._first === null ? null : (
|
|
37733
37734
|
/** @type {Y.ContentType} */
|
|
@@ -37736,7 +37737,7 @@ const absolutePositionToRelativePosition = (pos, type2, mapping) => {
|
|
|
37736
37737
|
while (n !== null && type2 !== n) {
|
|
37737
37738
|
if (n instanceof Y.XmlText) {
|
|
37738
37739
|
if (n._length >= pos) {
|
|
37739
|
-
return Y.createRelativePositionFromTypeIndex(n, pos, -1);
|
|
37740
|
+
return Y.createRelativePositionFromTypeIndex(n, pos, type2.length === 0 ? -1 : 0);
|
|
37740
37741
|
} else {
|
|
37741
37742
|
pos -= n._length;
|
|
37742
37743
|
}
|
|
@@ -37800,7 +37801,7 @@ const absolutePositionToRelativePosition = (pos, type2, mapping) => {
|
|
|
37800
37801
|
return createRelativePosition(n._item.parent, n._item);
|
|
37801
37802
|
}
|
|
37802
37803
|
}
|
|
37803
|
-
return Y.createRelativePositionFromTypeIndex(type2, type2._length, -1);
|
|
37804
|
+
return Y.createRelativePositionFromTypeIndex(type2, type2._length, type2.length === 0 ? -1 : 0);
|
|
37804
37805
|
};
|
|
37805
37806
|
const createRelativePosition = (type2, item) => {
|
|
37806
37807
|
let typeid = null;
|
|
@@ -40609,6 +40610,16 @@ const setWordSelection = (view, pos) => {
|
|
|
40609
40610
|
const tr = state2.tr.setSelection(TextSelection.create(state2.doc, word.from, word.to));
|
|
40610
40611
|
dispatch(tr);
|
|
40611
40612
|
};
|
|
40613
|
+
const setImageNodeSelection = (view, pos) => {
|
|
40614
|
+
const { doc: doc2 } = view.state;
|
|
40615
|
+
const node2 = doc2.nodeAt(pos);
|
|
40616
|
+
if (node2 && node2.type.name === "image") {
|
|
40617
|
+
const tr = view.state.tr.setSelection(NodeSelection.create(doc2, pos));
|
|
40618
|
+
view.dispatch(tr);
|
|
40619
|
+
return true;
|
|
40620
|
+
}
|
|
40621
|
+
return false;
|
|
40622
|
+
};
|
|
40612
40623
|
const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
40613
40624
|
/**
|
|
40614
40625
|
* Create a new Editor instance
|
|
@@ -41308,7 +41319,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
41308
41319
|
* @returns {Object | void} Migration results
|
|
41309
41320
|
*/
|
|
41310
41321
|
processCollaborationMigrations() {
|
|
41311
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.13.2-
|
|
41322
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.13.2-rev8");
|
|
41312
41323
|
if (!this.options.ydoc) return;
|
|
41313
41324
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
41314
41325
|
let docVersion = metaMap.get("version");
|
|
@@ -41678,6 +41689,7 @@ createView_fn = function(element) {
|
|
|
41678
41689
|
...this.options.editorProps,
|
|
41679
41690
|
dispatchTransaction: __privateMethod$1(this, _Editor_instances, dispatchTransaction_fn).bind(this),
|
|
41680
41691
|
state: EditorState.create(state2),
|
|
41692
|
+
handleClick: __privateMethod$1(this, _Editor_instances, handleNodeSelection_fn).bind(this),
|
|
41681
41693
|
handleDoubleClick: async (view, pos, event) => {
|
|
41682
41694
|
if (this.options.documentMode !== "editing") return;
|
|
41683
41695
|
const isHeader = hasSomeParentWithClass(event.target, "pagination-section-header");
|
|
@@ -41801,6 +41813,11 @@ dispatchTransaction_fn = function(transaction) {
|
|
|
41801
41813
|
transaction
|
|
41802
41814
|
});
|
|
41803
41815
|
};
|
|
41816
|
+
handleNodeSelection_fn = function(view, pos) {
|
|
41817
|
+
if (this.options.isHeaderOrFooter) {
|
|
41818
|
+
return setImageNodeSelection(view, pos);
|
|
41819
|
+
}
|
|
41820
|
+
};
|
|
41804
41821
|
prepareDocumentForImport_fn = function(doc2) {
|
|
41805
41822
|
const newState = EditorState.create({
|
|
41806
41823
|
schema: this.schema,
|
|
@@ -44143,7 +44160,7 @@ const Paragraph = Node$1.create({
|
|
|
44143
44160
|
},
|
|
44144
44161
|
addPmPlugins() {
|
|
44145
44162
|
const { view } = this.editor;
|
|
44146
|
-
|
|
44163
|
+
new Plugin({
|
|
44147
44164
|
name: "dropcapPlugin",
|
|
44148
44165
|
key: new PluginKey("dropcapPlugin"),
|
|
44149
44166
|
state: {
|
|
@@ -44163,7 +44180,7 @@ const Paragraph = Node$1.create({
|
|
|
44163
44180
|
}
|
|
44164
44181
|
}
|
|
44165
44182
|
});
|
|
44166
|
-
return [
|
|
44183
|
+
return [];
|
|
44167
44184
|
}
|
|
44168
44185
|
});
|
|
44169
44186
|
const getDropcapDecorations = (state2, view) => {
|
|
@@ -47522,6 +47539,8 @@ function findRemovedFieldAnnotations(tr) {
|
|
|
47522
47539
|
if (!tr.steps.length || tr.meta && !Object.keys(tr.meta).every((meta) => ["inputType", "uiEvent", "paste"].includes(meta)) || ["historyUndo", "historyRedo"].includes(tr.getMeta("inputType")) || ["drop"].includes(tr.getMeta("uiEvent")) || tr.getMeta("fieldAnnotationUpdate") === true) {
|
|
47523
47540
|
return removedNodes;
|
|
47524
47541
|
}
|
|
47542
|
+
const hasDeletion = transactionDeletedAnything(tr);
|
|
47543
|
+
if (!hasDeletion) return removedNodes;
|
|
47525
47544
|
tr.steps.forEach((step, stepIndex) => {
|
|
47526
47545
|
if (step instanceof ReplaceStep && step.from !== step.to) {
|
|
47527
47546
|
let mapping = tr.mapping.maps[stepIndex];
|
|
@@ -47538,6 +47557,14 @@ function findRemovedFieldAnnotations(tr) {
|
|
|
47538
47557
|
});
|
|
47539
47558
|
return removedNodes;
|
|
47540
47559
|
}
|
|
47560
|
+
function transactionDeletedAnything(tr) {
|
|
47561
|
+
return tr.steps.some((step) => {
|
|
47562
|
+
if (step instanceof ReplaceStep || step instanceof ReplaceAroundStep) {
|
|
47563
|
+
return step.from !== step.to;
|
|
47564
|
+
}
|
|
47565
|
+
return false;
|
|
47566
|
+
});
|
|
47567
|
+
}
|
|
47541
47568
|
function trackFieldAnnotationsDeletion(editor, tr) {
|
|
47542
47569
|
let removedAnnotations = [];
|
|
47543
47570
|
try {
|
|
@@ -49063,12 +49090,16 @@ const startImageUpload = async ({ editor, view, file }) => {
|
|
|
49063
49090
|
}
|
|
49064
49091
|
let id = {};
|
|
49065
49092
|
let { tr, schema } = view.state;
|
|
49066
|
-
|
|
49093
|
+
let { selection } = tr;
|
|
49094
|
+
if (editor.options.isHeaderOrFooter) {
|
|
49095
|
+
selection = editor.options.lastSelection;
|
|
49096
|
+
}
|
|
49097
|
+
if (!selection.empty && !editor.options.isHeaderOrFooter) {
|
|
49067
49098
|
tr.deleteSelection();
|
|
49068
49099
|
}
|
|
49069
49100
|
let imageMeta = {
|
|
49070
49101
|
type: "add",
|
|
49071
|
-
pos:
|
|
49102
|
+
pos: selection.from,
|
|
49072
49103
|
id
|
|
49073
49104
|
};
|
|
49074
49105
|
tr.setMeta(ImagePlaceholderPluginKey, imageMeta);
|
|
@@ -54368,10 +54399,7 @@ const Pagination = Extension.create({
|
|
|
54368
54399
|
const imagePluginTransaction = tr.getMeta(ImagePlaceholderPluginKey);
|
|
54369
54400
|
if (imagePluginTransaction) {
|
|
54370
54401
|
if (imagePluginTransaction.type === "remove") {
|
|
54371
|
-
|
|
54372
|
-
const domImage = editor.view.domAtPos(imagePos).node.querySelector("img");
|
|
54373
|
-
if (domImage.complete) onImageLoad(editor);
|
|
54374
|
-
else domImage.onload = () => onImageLoad(editor);
|
|
54402
|
+
onImageLoad(editor);
|
|
54375
54403
|
}
|
|
54376
54404
|
return { ...oldState };
|
|
54377
54405
|
}
|
|
@@ -55317,7 +55345,7 @@ const Search = Extension.create({
|
|
|
55317
55345
|
}
|
|
55318
55346
|
});
|
|
55319
55347
|
const NodeResizerKey = new PluginKey("node-resizer");
|
|
55320
|
-
const nodeResizer = (nodeNames = ["image"]) => {
|
|
55348
|
+
const nodeResizer = (nodeNames = ["image"], editor) => {
|
|
55321
55349
|
let resizeState = {
|
|
55322
55350
|
dragging: false,
|
|
55323
55351
|
startX: 0,
|
|
@@ -55342,8 +55370,13 @@ const nodeResizer = (nodeNames = ["image"]) => {
|
|
|
55342
55370
|
if (tr.getMeta(NodeResizerKey)) {
|
|
55343
55371
|
return oldState;
|
|
55344
55372
|
}
|
|
55345
|
-
|
|
55373
|
+
if (typeof document === "undefined" || editor.options.isHeadless) return oldState;
|
|
55346
55374
|
const { selection } = newState;
|
|
55375
|
+
const node2 = selection.node;
|
|
55376
|
+
if (!node2 || !nodeNames.includes(node2.type.name)) {
|
|
55377
|
+
return DecorationSet.empty;
|
|
55378
|
+
}
|
|
55379
|
+
const decorations = [];
|
|
55347
55380
|
if (nodeNames.includes(selection.node?.type.name)) {
|
|
55348
55381
|
decorations.push(
|
|
55349
55382
|
Decoration.node(selection.from, selection.to, {
|
|
@@ -55546,7 +55579,7 @@ const nodeResizer = (nodeNames = ["image"]) => {
|
|
|
55546
55579
|
const NodeResizer = Extension.create({
|
|
55547
55580
|
name: "nodeResizer",
|
|
55548
55581
|
addPmPlugins() {
|
|
55549
|
-
return [nodeResizer(["image"])];
|
|
55582
|
+
return [nodeResizer(["image"], this.editor)];
|
|
55550
55583
|
}
|
|
55551
55584
|
});
|
|
55552
55585
|
const getRichTextExtensions = () => {
|
|
@@ -64222,7 +64255,6 @@ const style$2 = cB("icon", `
|
|
|
64222
64255
|
display: inline-block;
|
|
64223
64256
|
position: relative;
|
|
64224
64257
|
fill: currentColor;
|
|
64225
|
-
transform: translateZ(0);
|
|
64226
64258
|
`, [cM("color-transition", {
|
|
64227
64259
|
transition: "color .3s var(--n-bezier)"
|
|
64228
64260
|
}), cM("depth", {
|