@harbour-enterprises/superdoc 0.5.13 → 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.
@@ -52813,7 +52813,7 @@ const _SuperConverter = class _SuperConverter2 {
52813
52813
  return;
52814
52814
  }
52815
52815
  }
52816
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.5.13") {
52816
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.5.14") {
52817
52817
  const customLocation = "docProps/custom.xml";
52818
52818
  if (!docx[customLocation]) {
52819
52819
  docx[customLocation] = generateCustomXml();
@@ -53053,7 +53053,7 @@ function storeSuperdocVersion(docx) {
53053
53053
  function generateCustomXml() {
53054
53054
  return DEFAULT_CUSTOM_XML;
53055
53055
  }
53056
- function generateSuperdocVersion(version2 = "0.5.13") {
53056
+ function generateSuperdocVersion(version2 = "0.5.14") {
53057
53057
  return {
53058
53058
  type: "element",
53059
53059
  name: "property",
@@ -61710,24 +61710,29 @@ const ySyncPlugin = (yXmlFragment, {
61710
61710
  };
61711
61711
  const restoreRelativeSelection = (tr, relSel, binding) => {
61712
61712
  if (relSel !== null && relSel.anchor !== null && relSel.head !== null) {
61713
- const anchor = relativePositionToAbsolutePosition(
61714
- binding.doc,
61715
- binding.type,
61716
- relSel.anchor,
61717
- binding.mapping
61718
- );
61719
- const head = relativePositionToAbsolutePosition(
61720
- binding.doc,
61721
- binding.type,
61722
- relSel.head,
61723
- binding.mapping
61724
- );
61725
- if (anchor !== null && head !== null) {
61726
- tr = tr.setSelection(TextSelection.create(tr.doc, anchor, head));
61713
+ if (relSel.type === "all") {
61714
+ tr.setSelection(new AllSelection(tr.doc));
61715
+ } else {
61716
+ const anchor = relativePositionToAbsolutePosition(
61717
+ binding.doc,
61718
+ binding.type,
61719
+ relSel.anchor,
61720
+ binding.mapping
61721
+ );
61722
+ const head = relativePositionToAbsolutePosition(
61723
+ binding.doc,
61724
+ binding.type,
61725
+ relSel.head,
61726
+ binding.mapping
61727
+ );
61728
+ if (anchor !== null && head !== null) {
61729
+ tr = tr.setSelection(TextSelection.create(tr.doc, anchor, head));
61730
+ }
61727
61731
  }
61728
61732
  }
61729
61733
  };
61730
61734
  const getRelativeSelection = (pmbinding, state2) => ({
61735
+ type: state2.selection.jsonID,
61731
61736
  anchor: absolutePositionToRelativePosition(
61732
61737
  state2.selection.anchor,
61733
61738
  pmbinding.type,
@@ -66870,7 +66875,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
66870
66875
  * @returns {Y.Doc | undefined} Updated Y.Doc if any, otherwise undefined
66871
66876
  */
66872
66877
  processCollaborationMigrations() {
66873
- console.debug("[checkVersionMigrations] Current editor version", "0.5.13");
66878
+ console.debug("[checkVersionMigrations] Current editor version", "0.5.14");
66874
66879
  if (!this.options.ydoc) return;
66875
66880
  const metaMap = this.options.ydoc.getMap("meta");
66876
66881
  let docVersion = metaMap.get("version");
@@ -87131,4 +87136,4 @@ export {
87131
87136
  helpers as k,
87132
87137
  index as l
87133
87138
  };
87134
- //# sourceMappingURL=super-editor.es-D8gDx0Xk.js.map
87139
+ //# sourceMappingURL=super-editor.es-B6rY2YRc.js.map