@harbour-enterprises/superdoc 0.5.36 → 0.5.38

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 (74) hide show
  1. package/dist/chunks/{index-CtEWl-ZH.js → index-B_N4inTK.js} +2 -2
  2. package/dist/chunks/{index-CtEWl-ZH.js.map → index-B_N4inTK.js.map} +1 -1
  3. package/dist/chunks/{index-9S4X_ywo.js → index-DQD_ZI0o.js} +3 -3
  4. package/dist/chunks/{index-9S4X_ywo.js.map → index-DQD_ZI0o.js.map} +1 -1
  5. package/dist/chunks/{super-editor.es-qZ3KZirs.js → super-editor.es-jmlT-Bwo.js} +2409 -2073
  6. package/dist/chunks/super-editor.es-jmlT-Bwo.js.map +1 -0
  7. package/dist/chunks/{url-mmnBIIf_.js → url-RFOJMKKF.js} +2 -2
  8. package/dist/chunks/{url-mmnBIIf_.js.map → url-RFOJMKKF.js.map} +1 -1
  9. package/dist/chunks/{xml-js-Bp3TZtDC.js → xml-js-ETODspvn.js} +3 -6
  10. package/dist/chunks/xml-js-ETODspvn.js.map +1 -0
  11. package/dist/super-editor/chunks/{converter-Ddgo09YG.js → converter-BZL7oASW.js} +2327 -1983
  12. package/dist/super-editor/chunks/converter-BZL7oASW.js.map +1 -0
  13. package/dist/super-editor/chunks/{docx-zipper-DOKk393z.js → docx-zipper-C68mWF6V.js} +2 -2
  14. package/dist/super-editor/chunks/{docx-zipper-DOKk393z.js.map → docx-zipper-C68mWF6V.js.map} +1 -1
  15. package/dist/super-editor/chunks/{editor-DMbaJ3Hc.js → editor-gxrdRLwy.js} +11 -19
  16. package/dist/super-editor/chunks/editor-gxrdRLwy.js.map +1 -0
  17. package/dist/super-editor/chunks/{toolbar-HMCBUVgd.js → toolbar-BYrXFUF6.js} +3 -3
  18. package/dist/super-editor/chunks/{toolbar-HMCBUVgd.js.map → toolbar-BYrXFUF6.js.map} +1 -1
  19. package/dist/super-editor/components/toolbar/defaultItems.d.ts.map +1 -1
  20. package/dist/super-editor/converter.es.js +1 -1
  21. package/dist/super-editor/core/Editor.d.ts.map +1 -1
  22. package/dist/super-editor/core/commands/clearNodes.d.ts.map +1 -1
  23. package/dist/super-editor/core/commands/command.d.ts.map +1 -1
  24. package/dist/super-editor/core/commands/createParagraphNear.d.ts.map +1 -1
  25. package/dist/super-editor/core/commands/deleteSelection.d.ts.map +1 -1
  26. package/dist/super-editor/core/commands/exitCode.d.ts.map +1 -1
  27. package/dist/super-editor/core/commands/first.d.ts.map +1 -1
  28. package/dist/super-editor/core/commands/insertContent.d.ts.map +1 -1
  29. package/dist/super-editor/core/commands/insertContentAt.d.ts.map +1 -1
  30. package/dist/super-editor/core/commands/insertTabChar.d.ts.map +1 -1
  31. package/dist/super-editor/core/commands/insertTabNode.d.ts.map +1 -1
  32. package/dist/super-editor/core/commands/joinBackward.d.ts.map +1 -1
  33. package/dist/super-editor/core/commands/joinDown.d.ts.map +1 -1
  34. package/dist/super-editor/core/commands/joinForward.d.ts.map +1 -1
  35. package/dist/super-editor/core/commands/joinUp.d.ts.map +1 -1
  36. package/dist/super-editor/core/commands/liftEmptyBlock.d.ts.map +1 -1
  37. package/dist/super-editor/core/commands/liftListItem.d.ts.map +1 -1
  38. package/dist/super-editor/core/commands/newlineInCode.d.ts.map +1 -1
  39. package/dist/super-editor/core/commands/resetAttributes.d.ts.map +1 -1
  40. package/dist/super-editor/core/commands/selectAll.d.ts.map +1 -1
  41. package/dist/super-editor/core/commands/selectNodeBackward.d.ts.map +1 -1
  42. package/dist/super-editor/core/commands/selectNodeForward.d.ts.map +1 -1
  43. package/dist/super-editor/core/commands/selectTextblockEnd.d.ts.map +1 -1
  44. package/dist/super-editor/core/commands/selectTextblockStart.d.ts.map +1 -1
  45. package/dist/super-editor/core/commands/setMark.d.ts.map +1 -1
  46. package/dist/super-editor/core/commands/setMeta.d.ts.map +1 -1
  47. package/dist/super-editor/core/commands/setNode.d.ts.map +1 -1
  48. package/dist/super-editor/core/commands/sinkListItem.d.ts.map +1 -1
  49. package/dist/super-editor/core/commands/splitBlock.d.ts.map +1 -1
  50. package/dist/super-editor/core/commands/splitListItem.d.ts.map +1 -1
  51. package/dist/super-editor/core/commands/toggleList.d.ts.map +1 -1
  52. package/dist/super-editor/core/commands/toggleMark.d.ts.map +1 -1
  53. package/dist/super-editor/core/commands/toggleNode.d.ts.map +1 -1
  54. package/dist/super-editor/core/commands/unsetAllMarks.d.ts.map +1 -1
  55. package/dist/super-editor/core/commands/unsetMark.d.ts.map +1 -1
  56. package/dist/super-editor/core/commands/updateAttributes.d.ts.map +1 -1
  57. package/dist/super-editor/core/commands/wrapInList.d.ts.map +1 -1
  58. package/dist/super-editor/core/helpers/findParentNode.d.ts.map +1 -1
  59. package/dist/super-editor/core/super-converter/SuperConverter.d.ts +1 -1
  60. package/dist/super-editor/core/super-converter/SuperConverter.d.ts.map +1 -1
  61. package/dist/super-editor/core/super-converter/exporter.d.ts +1 -1
  62. package/dist/super-editor/core/super-converter/exporter.d.ts.map +1 -1
  63. package/dist/super-editor/docx-zipper.es.js +2 -2
  64. package/dist/super-editor/editor.es.js +3 -3
  65. package/dist/super-editor/file-zipper.es.js +1 -1
  66. package/dist/super-editor/super-editor.es.js +6 -6
  67. package/dist/super-editor/toolbar.es.js +2 -2
  68. package/dist/super-editor.es.js +1 -1
  69. package/dist/superdoc.es.js +7 -7
  70. package/package.json +1 -1
  71. package/dist/chunks/super-editor.es-qZ3KZirs.js.map +0 -1
  72. package/dist/chunks/xml-js-Bp3TZtDC.js.map +0 -1
  73. package/dist/super-editor/chunks/converter-Ddgo09YG.js.map +0 -1
  74. package/dist/super-editor/chunks/editor-DMbaJ3Hc.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-Ddgo09YG.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-BZL7oASW.js";
16
16
  import { ref, computed, createElementBlock, openBlock, withModifiers, Fragment as Fragment$1, renderList, normalizeClass, toDisplayString, createApp } from "vue";
17
- import { D as DocxZipper } from "./docx-zipper-DOKk393z.js";
17
+ import { D as DocxZipper } from "./docx-zipper-C68mWF6V.js";
18
18
  function getMarksFromSelection(state) {
19
19
  const { from: from2, to, empty: empty2 } = state.selection;
20
20
  const marks = [];
@@ -914,13 +914,11 @@ function clientRect(node) {
914
914
  function scrollRectIntoView(view, rect, startDOM) {
915
915
  let scrollThreshold = view.someProp("scrollThreshold") || 0, scrollMargin = view.someProp("scrollMargin") || 5;
916
916
  let doc2 = view.dom.ownerDocument;
917
- for (let parent = startDOM || view.dom; ; ) {
917
+ for (let parent = startDOM || view.dom; ; parent = parentNode(parent)) {
918
918
  if (!parent)
919
919
  break;
920
- if (parent.nodeType != 1) {
921
- parent = parentNode(parent);
920
+ if (parent.nodeType != 1)
922
921
  continue;
923
- }
924
922
  let elt = parent;
925
923
  let atTop = elt == doc2.body;
926
924
  let bounding = atTop ? windowRect(doc2) : clientRect(elt);
@@ -946,10 +944,8 @@ function scrollRectIntoView(view, rect, startDOM) {
946
944
  rect = { left: rect.left - dX, top: rect.top - dY, right: rect.right - dX, bottom: rect.bottom - dY };
947
945
  }
948
946
  }
949
- let pos = atTop ? "fixed" : getComputedStyle(parent).position;
950
- if (/^(fixed|sticky)$/.test(pos))
947
+ if (atTop || /^(fixed|sticky)$/.test(getComputedStyle(parent).position))
951
948
  break;
952
- parent = pos == "absolute" ? parent.offsetParent : parentNode(parent);
953
949
  }
954
950
  }
955
951
  function storeScrollPos(view) {
@@ -4944,7 +4940,6 @@ class DOMObserver {
4944
4940
  view.input.lastFocus = 0;
4945
4941
  selectionToDOM(view);
4946
4942
  this.currentSelection.set(sel);
4947
- view.scrollToSelection();
4948
4943
  } else if (from2 > -1 || newSel) {
4949
4944
  if (from2 > -1) {
4950
4945
  view.docView.markDirty(from2, to);
@@ -9417,9 +9412,9 @@ function liftToOuterList(state, dispatch, itemType, range) {
9417
9412
  if (target == null)
9418
9413
  return false;
9419
9414
  tr.lift(range, target);
9420
- let $after = tr.doc.resolve(tr.mapping.map(end2, -1) - 1);
9421
- if (canJoin(tr.doc, $after.pos) && $after.nodeBefore.type == $after.nodeAfter.type)
9422
- tr.join($after.pos);
9415
+ let after = tr.mapping.map(end2, -1) - 1;
9416
+ if (canJoin(tr.doc, after))
9417
+ tr.join(after);
9423
9418
  dispatch(tr.scrollIntoView());
9424
9419
  return true;
9425
9420
  }
@@ -11338,11 +11333,9 @@ const _Editor = class _Editor extends EventEmitter {
11338
11333
  );
11339
11334
  const relsData = this.converter.convertedXml["word/_rels/document.xml.rels"];
11340
11335
  const rels = this.converter.schemaToXml(relsData.elements[0]);
11341
- const customXml = this.converter.schemaToXml(this.converter.convertedXml["docProps/custom.xml"].elements[0]);
11336
+ const customXml = this.converter.schemaToXml(this.converter.convertedXml["docProps/custom.xml"].elements[0], true);
11342
11337
  const customSettings = this.converter.schemaToXml(this.converter.convertedXml["word/settings.xml"].elements[0]);
11343
11338
  const contentTypes = this.converter.schemaToXml(this.converter.convertedXml["[Content_Types].xml"].elements[0]);
11344
- const originalCommentsXml = this.converter.convertedXml["word/comments.xml"];
11345
- const updatedCommentsXml = originalCommentsXml ? this.converter.schemaToXml(originalCommentsXml.elements[0]) : null;
11346
11339
  const media = this.converter.addedMedia;
11347
11340
  const updatedDocs = {
11348
11341
  "word/document.xml": String(documentXml),
@@ -11351,7 +11344,6 @@ const _Editor = class _Editor extends EventEmitter {
11351
11344
  "word/settings.xml": String(customSettings),
11352
11345
  "[Content_Types].xml": String(contentTypes)
11353
11346
  };
11354
- if (updatedCommentsXml) updatedDocs["word/comments.xml"] = String(updatedCommentsXml);
11355
11347
  const zipper = new DocxZipper();
11356
11348
  const result = await zipper.updateZip({
11357
11349
  docx: this.options.content,
@@ -11388,7 +11380,7 @@ const _Editor = class _Editor extends EventEmitter {
11388
11380
  * @returns {Y.Doc | undefined} Updated Y.Doc if any, otherwise undefined
11389
11381
  */
11390
11382
  processCollaborationMigrations() {
11391
- console.debug("[checkVersionMigrations] Current editor version", "0.5.36");
11383
+ console.debug("[checkVersionMigrations] Current editor version", "0.5.38");
11392
11384
  if (!this.options.ydoc) return;
11393
11385
  const metaMap = this.options.ydoc.getMap("meta");
11394
11386
  let docVersion = metaMap.get("version");
@@ -19429,4 +19421,4 @@ export {
19429
19421
  redoDepth as r,
19430
19422
  undoDepth as u
19431
19423
  };
19432
- //# sourceMappingURL=editor-DMbaJ3Hc.js.map
19424
+ //# sourceMappingURL=editor-gxrdRLwy.js.map