@harbour-enterprises/superdoc 0.5.12 → 0.5.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/chunks/{super-editor.es-DImmA9mQ.js → super-editor.es-B6rY2YRc.js} +41 -24
  2. package/dist/chunks/{super-editor.es-DImmA9mQ.js.map → super-editor.es-B6rY2YRc.js.map} +1 -1
  3. package/dist/style.css +6 -6
  4. package/dist/super-editor/chunks/{converter-CFLxtL2x.js → converter-DqGOEldA.js} +3 -3
  5. package/dist/super-editor/chunks/{converter-CFLxtL2x.js.map → converter-DqGOEldA.js.map} +1 -1
  6. package/dist/super-editor/chunks/{docx-zipper-BaNAQU0O.js → docx-zipper-C_fO6-wY.js} +2 -2
  7. package/dist/super-editor/chunks/{docx-zipper-BaNAQU0O.js.map → docx-zipper-C_fO6-wY.js.map} +1 -1
  8. package/dist/super-editor/chunks/{editor-BmHE-S8u.js → editor-BgLA0msH.js} +26 -19
  9. package/dist/super-editor/chunks/editor-BgLA0msH.js.map +1 -0
  10. package/dist/super-editor/chunks/{toolbar-p9qCNyMX.js → toolbar-C1VGqCF6.js} +3 -3
  11. package/dist/super-editor/chunks/{toolbar-p9qCNyMX.js.map → toolbar-C1VGqCF6.js.map} +1 -1
  12. package/dist/super-editor/components/toolbar/defaultItems.d.ts.map +1 -1
  13. package/dist/super-editor/components/toolbar/super-toolbar.d.ts +1 -0
  14. package/dist/super-editor/components/toolbar/super-toolbar.d.ts.map +1 -1
  15. package/dist/super-editor/converter.es.js +1 -1
  16. package/dist/super-editor/docx-zipper.es.js +2 -2
  17. package/dist/super-editor/editor.es.js +3 -3
  18. package/dist/super-editor/extensions/linked-styles/linked-styles.d.ts.map +1 -1
  19. package/dist/super-editor/file-zipper.es.js +1 -1
  20. package/dist/super-editor/style.css +6 -6
  21. package/dist/super-editor/super-editor.es.js +21 -11
  22. package/dist/super-editor/super-editor.es.js.map +1 -1
  23. package/dist/super-editor/toolbar.es.js +2 -2
  24. package/dist/super-editor.es.js +1 -1
  25. package/dist/superdoc.es.js +3 -3
  26. package/package.json +1 -1
  27. package/dist/super-editor/chunks/editor-BmHE-S8u.js.map +0 -1
@@ -12,9 +12,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
12
12
  var _events, _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _commandService, _css, _Editor_instances, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, endCollaboration_fn, _FieldAnnotationView_instances, createAnnotation_fn;
13
13
  import * as Y from "yjs";
14
14
  import { UndoManager, Item as Item$1, ContentType, Text as Text$1, XmlElement } from "yjs";
15
- import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, f as Schema$1, g as canSplit, l as liftTarget, h as canJoin, j as joinPoint, r as replaceStep$1, R as ReplaceAroundStep, o as objectIncludes, i as ReplaceStep, k as NodeRange, m as findWrapping, n as TrackDeleteMarkName, q as TrackInsertMarkName, v as v4, s as generateDocxRandomId, t as TrackFormatMarkName, u as AddMarkStep, w as RemoveMarkStep, x as comments_module_events, y as twipsToLines, z as pixelsToTwips, B as SuperConverter, E as EditorState, C as toKebabCase, G as kebabCase } from "./converter-CFLxtL2x.js";
15
+ import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, f as Schema$1, g as canSplit, l as liftTarget, h as canJoin, j as joinPoint, r as replaceStep$1, R as ReplaceAroundStep, o as objectIncludes, i as ReplaceStep, k as NodeRange, m as findWrapping, n as TrackDeleteMarkName, q as TrackInsertMarkName, v as v4, s as generateDocxRandomId, t as TrackFormatMarkName, u as AddMarkStep, w as RemoveMarkStep, x as comments_module_events, y as twipsToLines, z as pixelsToTwips, B as SuperConverter, E as EditorState, C as toKebabCase, G as kebabCase } from "./converter-DqGOEldA.js";
16
16
  import { ref, computed, createElementBlock, openBlock, withModifiers, Fragment as Fragment$1, renderList, normalizeClass, createElementVNode, toDisplayString, createApp } from "vue";
17
- import { D as DocxZipper } from "./docx-zipper-BaNAQU0O.js";
17
+ import { D as DocxZipper } from "./docx-zipper-C_fO6-wY.js";
18
18
  function getMarksFromSelection(state) {
19
19
  const { from: from2, to, empty: empty2 } = state.selection;
20
20
  const marks = [];
@@ -6171,24 +6171,29 @@ const ySyncPlugin = (yXmlFragment, {
6171
6171
  };
6172
6172
  const restoreRelativeSelection = (tr, relSel, binding) => {
6173
6173
  if (relSel !== null && relSel.anchor !== null && relSel.head !== null) {
6174
- const anchor = relativePositionToAbsolutePosition(
6175
- binding.doc,
6176
- binding.type,
6177
- relSel.anchor,
6178
- binding.mapping
6179
- );
6180
- const head = relativePositionToAbsolutePosition(
6181
- binding.doc,
6182
- binding.type,
6183
- relSel.head,
6184
- binding.mapping
6185
- );
6186
- if (anchor !== null && head !== null) {
6187
- tr = tr.setSelection(TextSelection.create(tr.doc, anchor, head));
6174
+ if (relSel.type === "all") {
6175
+ tr.setSelection(new AllSelection(tr.doc));
6176
+ } else {
6177
+ const anchor = relativePositionToAbsolutePosition(
6178
+ binding.doc,
6179
+ binding.type,
6180
+ relSel.anchor,
6181
+ binding.mapping
6182
+ );
6183
+ const head = relativePositionToAbsolutePosition(
6184
+ binding.doc,
6185
+ binding.type,
6186
+ relSel.head,
6187
+ binding.mapping
6188
+ );
6189
+ if (anchor !== null && head !== null) {
6190
+ tr = tr.setSelection(TextSelection.create(tr.doc, anchor, head));
6191
+ }
6188
6192
  }
6189
6193
  }
6190
6194
  };
6191
6195
  const getRelativeSelection = (pmbinding, state) => ({
6196
+ type: state.selection.jsonID,
6192
6197
  anchor: absolutePositionToRelativePosition(
6193
6198
  state.selection.anchor,
6194
6199
  pmbinding.type,
@@ -11340,7 +11345,7 @@ const _Editor = class _Editor extends EventEmitter {
11340
11345
  * @returns {Y.Doc | undefined} Updated Y.Doc if any, otherwise undefined
11341
11346
  */
11342
11347
  processCollaborationMigrations() {
11343
- console.debug("[checkVersionMigrations] Current editor version", "0.5.12");
11348
+ console.debug("[checkVersionMigrations] Current editor version", "0.5.14");
11344
11349
  if (!this.options.ydoc) return;
11345
11350
  const metaMap = this.options.ydoc.getMap("meta");
11346
11351
  let docVersion = metaMap.get("version");
@@ -13196,7 +13201,7 @@ const createLinkedStylesPlugin = (editor) => {
13196
13201
  key: LinkedStylesPluginKey,
13197
13202
  state: {
13198
13203
  init(_, { doc: doc2, selection }) {
13199
- if (!editor.converter) return;
13204
+ if (!editor.converter || editor.options.mode !== "docx") return {};
13200
13205
  const styles = editor.converter?.linkedStyles || [];
13201
13206
  return {
13202
13207
  styles,
@@ -13204,6 +13209,7 @@ const createLinkedStylesPlugin = (editor) => {
13204
13209
  };
13205
13210
  },
13206
13211
  apply(tr, prev, oldEditorState, newEditorState) {
13212
+ if (!editor.converter || editor.options.mode !== "docx") return { ...prev };
13207
13213
  let decorations = prev.decorations || DecorationSet.empty;
13208
13214
  if (tr.docChanged) {
13209
13215
  const styles = LinkedStylesPluginKey.getState(editor.state).styles;
@@ -13294,6 +13300,7 @@ const getSpacingStyleString = (spacing) => {
13294
13300
  `.trim();
13295
13301
  };
13296
13302
  const getQuickFormatList = (editor) => {
13303
+ if (!editor?.converter) return [];
13297
13304
  const styles = editor.converter.linkedStyles || [];
13298
13305
  return styles.filter((style) => {
13299
13306
  return style.type === "paragraph" && style.definition.attrs;
@@ -19377,4 +19384,4 @@ export {
19377
19384
  redoDepth as r,
19378
19385
  undoDepth as u
19379
19386
  };
19380
- //# sourceMappingURL=editor-BmHE-S8u.js.map
19387
+ //# sourceMappingURL=editor-BgLA0msH.js.map