mhz-ui 1.3.10 → 1.3.12

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.
@@ -3503,12 +3503,13 @@ function bu(n, e, t) {
3503
3503
  }
3504
3504
  function zt(n) {
3505
3505
  let t = n.parent.content.cutByIndex(n.startIndex, n.endIndex);
3506
- for (let r = n.depth; ; --r) {
3507
- let s = n.$from.node(r), i = n.$from.index(r), o = n.$to.indexAfter(r);
3508
- if (r < n.depth && s.canReplace(i, o, t))
3506
+ for (let r = n.depth, s = 0, i = 0; ; --r) {
3507
+ let o = n.$from.node(r), l = n.$from.index(r) + s, a = n.$to.indexAfter(r) - i;
3508
+ if (r < n.depth && o.canReplace(l, a, t))
3509
3509
  return r;
3510
- if (r == 0 || s.type.spec.isolating || !bu(s, i, o))
3510
+ if (r == 0 || o.type.spec.isolating || !bu(o, l, a))
3511
3511
  break;
3512
+ l && (s = 1), a < o.childCount && (i = 1);
3512
3513
  }
3513
3514
  return null;
3514
3515
  }
@@ -3922,7 +3923,7 @@ function Pu(n, e, t, r) {
3922
3923
  let s = n.doc.resolve(e), i = n.doc.resolve(t);
3923
3924
  if (Il(s, i, r))
3924
3925
  return n.step(new K(e, t, r));
3925
- let o = Pl(s, n.doc.resolve(t));
3926
+ let o = Pl(s, i);
3926
3927
  o[o.length - 1] == 0 && o.pop();
3927
3928
  let l = -(s.depth + 1);
3928
3929
  o.unshift(l);
@@ -10003,13 +10004,17 @@ var Dh = (n, e) => ({ tr: t, state: r, dispatch: s }) => {
10003
10004
  typeof n == "string" ? n : n.name,
10004
10005
  r.schema
10005
10006
  );
10006
- return l ? (l === "node" && (i = _(n, r.schema)), l === "mark" && (o = Le(n, r.schema)), s && t.selection.ranges.forEach((a) => {
10007
- r.doc.nodesBetween(a.$from.pos, a.$to.pos, (c, u) => {
10008
- i && i === c.type && t.setNodeMarkup(u, void 0, Lo(c.attrs, e)), o && c.marks.length && c.marks.forEach((d) => {
10009
- o === d.type && t.addMark(u, u + c.nodeSize, o.create(Lo(d.attrs, e)));
10007
+ if (!l)
10008
+ return !1;
10009
+ l === "node" && (i = _(n, r.schema)), l === "mark" && (o = Le(n, r.schema));
10010
+ let a = !1;
10011
+ return t.selection.ranges.forEach((c) => {
10012
+ r.doc.nodesBetween(c.$from.pos, c.$to.pos, (u, d) => {
10013
+ i && i === u.type && (a = !0, s && t.setNodeMarkup(d, void 0, Lo(u.attrs, e))), o && u.marks.length && u.marks.forEach((f) => {
10014
+ o === f.type && (a = !0, s && t.addMark(d, d + u.nodeSize, o.create(Lo(f.attrs, e))));
10010
10015
  });
10011
10016
  });
10012
- }), !0) : !1;
10017
+ }), a;
10013
10018
  }, Rh = () => ({ tr: n, dispatch: e }) => (e && n.scrollIntoView(), !0), Ph = () => ({ tr: n, dispatch: e }) => {
10014
10019
  if (e) {
10015
10020
  const t = new ue(n.doc);
@@ -10243,9 +10248,9 @@ function zo(n) {
10243
10248
  );
10244
10249
  }
10245
10250
  function $o(n) {
10246
- var e, t, r;
10247
- const s = {};
10248
- return !((e = n?.attribute) != null && e.isRequired) && ((t = n?.attribute) == null ? void 0 : t.default) !== void 0 && (s.default = n.attribute.default), ((r = n?.attribute) == null ? void 0 : r.validate) !== void 0 && (s.validate = n.attribute.validate), [n.name, s];
10251
+ var e, t;
10252
+ const r = {};
10253
+ return !((e = n?.attribute) != null && e.isRequired) && "default" in (n?.attribute || {}) && (r.default = n.attribute.default), ((t = n?.attribute) == null ? void 0 : t.validate) !== void 0 && (r.validate = n.attribute.validate), [n.name, r];
10249
10254
  }
10250
10255
  function Uh(n, e) {
10251
10256
  var t;
@@ -10821,42 +10826,46 @@ var up = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor
10821
10826
  typeof n == "string" ? n : n.name,
10822
10827
  r.schema
10823
10828
  );
10824
- return l ? (l === "node" && (i = _(n, r.schema)), l === "mark" && (o = Le(n, r.schema)), s && t.selection.ranges.forEach((a) => {
10825
- const c = a.$from.pos, u = a.$to.pos;
10826
- let d, f, h, p;
10827
- t.selection.empty ? r.doc.nodesBetween(c, u, (m, g) => {
10828
- i && i === m.type && (h = Math.max(g, c), p = Math.min(g + m.nodeSize, u), d = g, f = m);
10829
- }) : r.doc.nodesBetween(c, u, (m, g) => {
10830
- g < c && i && i === m.type && (h = Math.max(g, c), p = Math.min(g + m.nodeSize, u), d = g, f = m), g >= c && g <= u && (i && i === m.type && t.setNodeMarkup(g, void 0, {
10831
- ...m.attrs,
10829
+ if (!l)
10830
+ return !1;
10831
+ l === "node" && (i = _(n, r.schema)), l === "mark" && (o = Le(n, r.schema));
10832
+ let a = !1;
10833
+ return t.selection.ranges.forEach((c) => {
10834
+ const u = c.$from.pos, d = c.$to.pos;
10835
+ let f, h, p, m;
10836
+ t.selection.empty ? r.doc.nodesBetween(u, d, (g, y) => {
10837
+ i && i === g.type && (a = !0, p = Math.max(y, u), m = Math.min(y + g.nodeSize, d), f = y, h = g);
10838
+ }) : r.doc.nodesBetween(u, d, (g, y) => {
10839
+ y < u && i && i === g.type && (a = !0, p = Math.max(y, u), m = Math.min(y + g.nodeSize, d), f = y, h = g), y >= u && y <= d && (i && i === g.type && (a = !0, s && t.setNodeMarkup(y, void 0, {
10840
+ ...g.attrs,
10832
10841
  ...e
10833
- }), o && m.marks.length && m.marks.forEach((y) => {
10834
- if (o === y.type) {
10835
- const x = Math.max(g, c), C = Math.min(g + m.nodeSize, u);
10842
+ })), o && g.marks.length && g.marks.forEach((x) => {
10843
+ if (o === x.type && (a = !0, s)) {
10844
+ const C = Math.max(y, u), E = Math.min(y + g.nodeSize, d);
10836
10845
  t.addMark(
10837
- x,
10838
10846
  C,
10847
+ E,
10839
10848
  o.create({
10840
- ...y.attrs,
10849
+ ...x.attrs,
10841
10850
  ...e
10842
10851
  })
10843
10852
  );
10844
10853
  }
10845
10854
  }));
10846
- }), f && (d !== void 0 && t.setNodeMarkup(d, void 0, {
10847
- ...f.attrs,
10855
+ }), h && (f !== void 0 && s && t.setNodeMarkup(f, void 0, {
10856
+ ...h.attrs,
10848
10857
  ...e
10849
- }), o && f.marks.length && f.marks.forEach((m) => {
10850
- o === m.type && t.addMark(
10851
- h,
10858
+ }), o && h.marks.length && h.marks.forEach((g) => {
10859
+ o === g.type && s && t.addMark(
10852
10860
  p,
10861
+ m,
10853
10862
  o.create({
10854
- ...m.attrs,
10863
+ ...g.attrs,
10855
10864
  ...e
10856
10865
  })
10857
10866
  );
10858
10867
  }));
10859
- }), !0) : !1;
10868
+ }), a;
10860
10869
  }, xp = (n, e = {}) => ({ state: t, dispatch: r }) => {
10861
10870
  const s = _(n, t.schema);
10862
10871
  return Zu(s, e)(t, r);
@@ -12712,7 +12721,8 @@ function Ds(n, e, t) {
12712
12721
  if (a.length > 0)
12713
12722
  break;
12714
12723
  if (f.trim() === "") {
12715
- u += 1;
12724
+ u += 1, c = `${c}${f}
12725
+ `;
12716
12726
  continue;
12717
12727
  } else
12718
12728
  return;
@@ -12753,7 +12763,7 @@ function Ds(n, e, t) {
12753
12763
  if (a.length !== 0)
12754
12764
  return {
12755
12765
  items: a,
12756
- raw: c.trim()
12766
+ raw: c
12757
12767
  };
12758
12768
  }
12759
12769
  function bi(n, e, t, r) {
@@ -16050,7 +16060,7 @@ function Cg(n = {}) {
16050
16060
  handleDOMEvents: {
16051
16061
  beforeinput(e, t) {
16052
16062
  let r = t.inputType, s = r == "historyUndo" ? Nc : r == "historyRedo" ? Oc : null;
16053
- return s ? (t.preventDefault(), s(e.state, e.dispatch)) : !1;
16063
+ return !s || !e.editable ? !1 : (t.preventDefault(), s(e.state, e.dispatch));
16054
16064
  }
16055
16065
  }
16056
16066
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mhz-ui",
3
3
  "description": "Mhz ui kit",
4
- "version": "1.3.10",
4
+ "version": "1.3.12",
5
5
  "author": "Alexandr Dergunov <dergunovs@mail.ru> (https://github.com/dergunovs)",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -25,9 +25,9 @@
25
25
  "test:cov": "vitest run --coverage"
26
26
  },
27
27
  "dependencies": {
28
- "@tiptap/pm": "3.10.5",
29
- "@tiptap/starter-kit": "3.10.5",
30
- "@tiptap/vue-3": "3.10.5",
28
+ "@tiptap/pm": "3.10.8",
29
+ "@tiptap/starter-kit": "3.10.8",
30
+ "@tiptap/vue-3": "3.10.8",
31
31
  "@vueform/slider": "2.1.10",
32
32
  "@vueuse/core": "14.0.0",
33
33
  "@vueuse/integrations": "14.0.0",
@@ -40,13 +40,13 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@eslint/js": "9.39.1",
43
- "@storybook/addon-docs": "10.0.6",
44
- "@storybook/addon-themes": "10.0.6",
45
- "@storybook/vue3": "10.0.6",
46
- "@storybook/vue3-vite": "10.0.6",
47
- "@types/node": "24.10.0",
43
+ "@storybook/addon-docs": "10.0.8",
44
+ "@storybook/addon-themes": "10.0.8",
45
+ "@storybook/vue3": "10.0.8",
46
+ "@storybook/vue3-vite": "10.0.8",
47
+ "@types/node": "24.10.1",
48
48
  "@vitejs/plugin-vue": "6.0.1",
49
- "@vitest/coverage-v8": "4.0.8",
49
+ "@vitest/coverage-v8": "4.0.10",
50
50
  "@vue/test-utils": "2.4.6",
51
51
  "eslint": "9.39.1",
52
52
  "eslint-config-prettier": "10.1.8",
@@ -62,7 +62,7 @@
62
62
  "postcss-scss": "4.0.9",
63
63
  "prettier": "3.6.2",
64
64
  "sass-embedded": "1.93.3",
65
- "storybook": "10.0.6",
65
+ "storybook": "10.0.8",
66
66
  "stylelint": "16.25.0",
67
67
  "stylelint-config-recess-order": "7.4.0",
68
68
  "stylelint-config-recommended-scss": "16.0.2",
@@ -70,15 +70,15 @@
70
70
  "stylelint-order": "7.0.0",
71
71
  "stylelint-prettier": "5.0.3",
72
72
  "typescript": "5.9.3",
73
- "typescript-eslint": "8.46.3",
73
+ "typescript-eslint": "8.47.0",
74
74
  "vite": "7.2.2",
75
75
  "vite-plugin-dts": "4.5.4",
76
76
  "vite-plugin-static-copy": "3.1.4",
77
77
  "vite-svg-loader": "5.1.0",
78
- "vitest": "4.0.8",
78
+ "vitest": "4.0.10",
79
79
  "vue-eslint-parser": "10.2.0",
80
80
  "vue-linters-config": "0.5.4",
81
- "vue-tsc": "3.1.3"
81
+ "vue-tsc": "3.1.4"
82
82
  },
83
83
  "peerDependencies": {
84
84
  "vue": "3.5.24",