@oneclick.dev/cms-kit 0.0.55 → 0.0.56

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/cms-kit.js CHANGED
@@ -39191,7 +39191,7 @@ function domPosInText(node, x, y) {
39191
39191
  let right = x >= (rect.left + rect.right) / 2, after = right;
39192
39192
  if (browser$1.chrome || browser$1.gecko) {
39193
39193
  let rectBefore = textRange(node, i).getBoundingClientRect();
39194
- if (rectBefore.left == rect.right)
39194
+ if (Math.abs(rectBefore.left - rect.right) < 0.1)
39195
39195
  after = !right;
39196
39196
  }
39197
39197
  if (dy <= 0)
@@ -39613,7 +39613,10 @@ class DOMChange {
39613
39613
  anchor = view.state.doc.length;
39614
39614
  }
39615
39615
  }
39616
- this.newSel = EditorSelection.single(anchor, head);
39616
+ if (view.inputState.composing > -1 && view.state.selection.ranges.length > 1)
39617
+ this.newSel = view.state.selection.replaceRange(EditorSelection.range(anchor, head));
39618
+ else
39619
+ this.newSel = EditorSelection.single(anchor, head);
39617
39620
  }
39618
39621
  }
39619
39622
  }
@@ -39720,7 +39723,7 @@ function applyDefaultInsert(view, change, newSel) {
39720
39723
  } else {
39721
39724
  let changes = startState.changes(change);
39722
39725
  let mainSel = newSel && newSel.main.to <= changes.newLength ? newSel.main : void 0;
39723
- if (startState.selection.ranges.length > 1 && view.inputState.composing >= 0 && change.to <= sel.to + 10 && change.to >= sel.to - 10) {
39726
+ if (startState.selection.ranges.length > 1 && (view.inputState.composing >= 0 || view.inputState.compositionPendingChange) && change.to <= sel.to + 10 && change.to >= sel.to - 10) {
39724
39727
  let replaced = view.state.sliceDoc(change.from, change.to);
39725
39728
  let compositionRange, composition = newSel && findCompositionNode(view, newSel.main.head);
39726
39729
  if (composition) {
@@ -39729,16 +39732,16 @@ function applyDefaultInsert(view, change, newSel) {
39729
39732
  } else {
39730
39733
  compositionRange = view.state.doc.lineAt(sel.head);
39731
39734
  }
39732
- let offset = sel.to - change.to, size = sel.to - sel.from;
39735
+ let offset = sel.to - change.to;
39733
39736
  tr2 = startState.changeByRange((range) => {
39734
39737
  if (range.from == sel.from && range.to == sel.to)
39735
39738
  return { changes, range: mainSel || range.map(changes) };
39736
39739
  let to2 = range.to - offset, from = to2 - replaced.length;
39737
- if (range.to - range.from != size || view.state.sliceDoc(from, to2) != replaced || // Unfortunately, there's no way to make multiple
39740
+ if (view.state.sliceDoc(from, to2) != replaced || // Unfortunately, there's no way to make multiple
39738
39741
  // changes in the same node work without aborting
39739
39742
  // composition, so cursors in the composition range are
39740
39743
  // ignored.
39741
- range.to >= compositionRange.from && range.from <= compositionRange.to)
39744
+ to2 >= compositionRange.from && from <= compositionRange.to)
39742
39745
  return { range };
39743
39746
  let rangeChanges = startState.changes({ from, to: to2, insert: change.insert }), selOff = range.to - sel.to;
39744
39747
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneclick.dev/cms-kit",
3
- "version": "0.0.55",
3
+ "version": "0.0.56",
4
4
  "type": "module",
5
5
  "main": "./dist/cms-kit.cjs",
6
6
  "module": "./dist/cms-kit.js",
@@ -25,7 +25,7 @@
25
25
  "peerDependencies": {
26
26
  "nuxt": "^3.17.0",
27
27
  "vue": "^3.3.0",
28
- "vue-sonner": "^2.0.2"
28
+ "vue-sonner": "2.0.7"
29
29
  },
30
30
  "scripts": {
31
31
  "build": "vite build",