mhz-ui 1.4.13 → 1.4.15

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.
@@ -6559,7 +6559,13 @@ var Ns = {
6559
6559
  if (s.some((e) => e.nodeName == "BR") && (e.input.lastKeyCode == 8 || e.input.lastKeyCode == 46)) {
6560
6560
  for (let e of s) if (e.nodeName == "BR" && e.parentNode) {
6561
6561
  let t = e.nextSibling;
6562
- t && t.nodeType == 1 && t.contentEditable == "false" && e.parentNode.removeChild(e);
6562
+ for (; t && t.nodeType == 1;) {
6563
+ if (t.contentEditable == "false") {
6564
+ e.parentNode.removeChild(e);
6565
+ break;
6566
+ }
6567
+ t = t.firstChild;
6568
+ }
6563
6569
  }
6564
6570
  } else if (mi && s.length) {
6565
6571
  let t = s.filter((e) => e.nodeName == "BR");
@@ -6939,10 +6945,10 @@ var ec = class {
6939
6945
  }
6940
6946
  updateDraggedNode(e, t) {
6941
6947
  let n = e.node, r = -1;
6942
- if (this.state.doc.nodeAt(n.from) == n.node) r = n.from;
6948
+ if (n.from < this.state.doc.content.size && this.state.doc.nodeAt(n.from) == n.node) r = n.from;
6943
6949
  else {
6944
6950
  let e = n.from + (this.state.doc.content.size - t.doc.content.size);
6945
- (e > 0 && this.state.doc.nodeAt(e)) == n.node && (r = e);
6951
+ (e > 0 && e < this.state.doc.content.size && this.state.doc.nodeAt(e)) == n.node && (r = e);
6946
6952
  }
6947
6953
  this.dragging = new ds(e.slice, e.move, r < 0 ? void 0 : A.create(this.state.doc, r));
6948
6954
  }
@@ -8274,7 +8280,7 @@ function Su(e, t) {
8274
8280
  function Cu(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
8275
8281
  if (n) {
8276
8282
  if (e.type.name === "hardBreak") return !0;
8277
- if (e.isText) return /^\s*$/m.test(e.text ?? "");
8283
+ if (e.isText) return !/\S/.test(e.text ?? "");
8278
8284
  }
8279
8285
  if (e.isText) return !e.text;
8280
8286
  if (e.isAtom || e.isLeaf) return !1;
@@ -10107,14 +10113,17 @@ function Ud(e, t, n) {
10107
10113
  }
10108
10114
  function Wd(e, t, n, r) {
10109
10115
  if (!e || !Array.isArray(e.content)) return "";
10110
- let i = typeof n == "function" ? n(r) : n, [a, ...o] = e.content, s = [`${i}${t.renderChildren([a])}`];
10111
- return o && o.length > 0 && o.forEach((e) => {
10112
- let n = t.renderChildren([e]);
10113
- if (n) {
10114
- let e = n.split("\n").map((e) => e ? t.indent(e) : "").join("\n");
10115
- s.push(e);
10116
+ let i = typeof n == "function" ? n(r) : n, [a, ...o] = e.content, s = `${i}${t.renderChildren([a])}`;
10117
+ return o && o.length > 0 && o.forEach((e, n) => {
10118
+ let r = t.renderChild?.call(t, e, n + 1) ?? t.renderChildren([e]);
10119
+ if (r != null) {
10120
+ let n = r.split("\n").map((e) => e ? t.indent(e) : t.indent("")).join("\n");
10121
+ s += e.type === "paragraph" ? `
10122
+
10123
+ ${n}` : `
10124
+ ${n}`;
10116
10125
  }
10117
- }), s.join("\n");
10126
+ }), s;
10118
10127
  }
10119
10128
  function Gd(e, t, n = {}) {
10120
10129
  let { state: r } = t, { doc: i, tr: a } = r, o = e;
@@ -10312,13 +10321,16 @@ var Qd = (e, t) => {
10312
10321
  children: /* @__PURE__ */ Qd("slot", {})
10313
10322
  });
10314
10323
  },
10315
- parseMarkdown: (e, t) => t.createNode("blockquote", void 0, t.parseChildren(e.tokens || [])),
10324
+ parseMarkdown: (e, t) => {
10325
+ let n = t.parseBlockChildren ?? t.parseChildren;
10326
+ return t.createNode("blockquote", void 0, n(e.tokens || []));
10327
+ },
10316
10328
  renderMarkdown: (e, t) => {
10317
10329
  if (!e.content) return "";
10318
10330
  let n = [];
10319
- return e.content.forEach((e) => {
10320
- let r = t.renderChildren([e]).split("\n").map((e) => e.trim() === "" ? ">" : `> ${e}`);
10321
- n.push(r.join("\n"));
10331
+ return e.content.forEach((e, r) => {
10332
+ let i = (t.renderChild?.call(t, e, r) ?? t.renderChildren([e])).split("\n").map((e) => e.trim() === "" ? ">" : `> ${e}`);
10333
+ n.push(i.join("\n"));
10322
10334
  }), n.join("\n>\n");
10323
10335
  },
10324
10336
  addCommands() {
@@ -10367,6 +10379,10 @@ var Qd = (e, t) => {
10367
10379
  },
10368
10380
  markdownTokenName: "strong",
10369
10381
  parseMarkdown: (e, t) => t.applyMark("bold", t.parseInline(e.tokens || [])),
10382
+ markdownOptions: { htmlReopen: {
10383
+ open: "<strong>",
10384
+ close: "</strong>"
10385
+ } },
10370
10386
  renderMarkdown: (e, t) => `**${t.renderChildren(e)}**`,
10371
10387
  addCommands() {
10372
10388
  return {
@@ -10776,6 +10792,10 @@ var Qd = (e, t) => {
10776
10792
  },
10777
10793
  markdownTokenName: "em",
10778
10794
  parseMarkdown: (e, t) => t.applyMark("italic", t.parseInline(e.tokens || [])),
10795
+ markdownOptions: { htmlReopen: {
10796
+ open: "<em>",
10797
+ close: "</em>"
10798
+ } },
10779
10799
  renderMarkdown: (e, t) => `*${t.renderChildren(e)}*`,
10780
10800
  addKeyboardShortcuts() {
10781
10801
  return {
@@ -11651,26 +11671,26 @@ var Nm = sd.create({
11651
11671
  markdownTokenName: "list_item",
11652
11672
  parseMarkdown: (e, t) => {
11653
11673
  if (e.type !== "list_item") return [];
11654
- let n = [];
11655
- if (e.tokens && e.tokens.length > 0) if (e.tokens.some((e) => e.type === "paragraph")) n = t.parseChildren(e.tokens);
11674
+ let n = t.parseBlockChildren ?? t.parseChildren, r = [];
11675
+ if (e.tokens && e.tokens.length > 0) if (e.tokens.some((e) => e.type === "paragraph")) r = n(e.tokens);
11656
11676
  else {
11657
- let r = e.tokens[0];
11658
- if (r && r.type === "text" && r.tokens && r.tokens.length > 0) {
11659
- if (n = [{
11677
+ let i = e.tokens[0];
11678
+ if (i && i.type === "text" && i.tokens && i.tokens.length > 0) {
11679
+ if (r = [{
11660
11680
  type: "paragraph",
11661
- content: t.parseInline(r.tokens)
11681
+ content: t.parseInline(i.tokens)
11662
11682
  }], e.tokens.length > 1) {
11663
- let r = e.tokens.slice(1), i = t.parseChildren(r);
11664
- n.push(...i);
11683
+ let t = n(e.tokens.slice(1));
11684
+ r.push(...t);
11665
11685
  }
11666
- } else n = t.parseChildren(e.tokens);
11686
+ } else r = n(e.tokens);
11667
11687
  }
11668
- return n.length === 0 && (n = [{
11688
+ return r.length === 0 && (r = [{
11669
11689
  type: "paragraph",
11670
11690
  content: []
11671
11691
  }]), {
11672
11692
  type: "listItem",
11673
- content: n
11693
+ content: r
11674
11694
  };
11675
11695
  },
11676
11696
  renderMarkdown: (e, t, n) => Wd(e, t, (e) => e.parentType === "bulletList" ? "- " : e.parentType === "orderedList" ? `${(e.meta?.parentAttrs?.start || 1) + e.index}. ` : "- ", n),
@@ -12221,10 +12241,14 @@ var uh = "&nbsp;", dh = "\xA0", fh = Kd.create({
12221
12241
  let r = t.parseInline(n);
12222
12242
  return r.length === 1 && r[0].type === "text" && (r[0].text === uh || r[0].text === dh) ? t.createNode("paragraph", void 0, []) : t.createNode("paragraph", void 0, r);
12223
12243
  },
12224
- renderMarkdown: (e, t) => {
12244
+ renderMarkdown: (e, t, n) => {
12225
12245
  if (!e) return "";
12226
- let n = Array.isArray(e.content) ? e.content : [];
12227
- return n.length === 0 ? uh : t.renderChildren(n);
12246
+ let r = Array.isArray(e.content) ? e.content : [];
12247
+ if (r.length === 0) {
12248
+ let e = Array.isArray(n?.previousNode?.content) ? n.previousNode.content : [];
12249
+ return n?.previousNode?.type === "paragraph" && e.length === 0 ? uh : "";
12250
+ }
12251
+ return t.renderChildren(r);
12228
12252
  },
12229
12253
  addCommands() {
12230
12254
  return { setParagraph: () => ({ commands: e }) => e.setNode(this.name) };
@@ -13038,6 +13062,7 @@ K.create({
13038
13062
  let o = this.editor.isEmpty;
13039
13063
  return t.descendants((t, n) => {
13040
13064
  let r = i >= n && i <= n + t.nodeSize, s = !t.isLeaf && Cu(t);
13065
+ if (!t.type.isTextblock) return this.options.includeChildren;
13041
13066
  if ((r || !this.options.showOnlyCurrent) && s) {
13042
13067
  let i = [this.options.emptyNodeClass];
13043
13068
  o && i.push(this.options.emptyEditorClass);
@@ -8,6 +8,7 @@ interface IProps {
8
8
  isDisabled?: boolean;
9
9
  isRequired?: boolean;
10
10
  isSingle?: boolean;
11
+ isHideUploadButton?: boolean;
11
12
  lang?: TLocale;
12
13
  limit?: number;
13
14
  uploadButtonText?: string;
@@ -31,6 +31,7 @@ var T = ["data-error"], E = ["accept", "multiple"], D = ["data-label"], O = /* @
31
31
  isDisabled: { type: Boolean },
32
32
  isRequired: { type: Boolean },
33
33
  isSingle: { type: Boolean },
34
+ isHideUploadButton: { type: Boolean },
34
35
  lang: { default: "ru" },
35
36
  limit: { default: w },
36
37
  uploadButtonText: { default: "" }
@@ -110,7 +111,8 @@ var T = ["data-error"], E = ["accept", "multiple"], D = ["data-label"], O = /* @
110
111
  default: y(() => [l(g(_(n)[d.lang].remove), 1)]),
111
112
  _: 1
112
113
  }, 8, ["isDisabled"])], 2)) : a("", !0)
113
- ], 2), b(s("div", {
114
+ ], 2), d.isHideUploadButton ? a("", !0) : b((p(), o("div", {
115
+ key: 0,
114
116
  class: f(i.$style.uploadButton),
115
117
  "data-label": !!d.label
116
118
  }, [u(t, {
@@ -119,7 +121,7 @@ var T = ["data-error"], E = ["accept", "multiple"], D = ["data-label"], O = /* @
119
121
  }, {
120
122
  default: y(() => [l(g(d.uploadButtonText || _(n)[d.lang].upload), 1)]),
121
123
  _: 1
122
- }, 8, ["isDisabled"])], 10, D), [[v, d.isSingle && d.file || d.files.length > 0]])], 2));
124
+ }, 8, ["isDisabled"])], 10, D)), [[v, d.isSingle && d.file || d.files.length > 0]])], 2));
123
125
  }
124
126
  }), [["__cssModules", { $style: {
125
127
  container: "_container_t6pvx_1",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mhz-ui",
3
3
  "description": "Mhz ui kit",
4
- "version": "1.4.13",
4
+ "version": "1.4.15",
5
5
  "author": "Alexandr Dergunov <dergunovs@mail.ru> (https://github.com/dergunovs)",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -25,25 +25,25 @@
25
25
  "test:cov": "vitest run --coverage"
26
26
  },
27
27
  "dependencies": {
28
- "@tiptap/pm": "3.20.1",
29
- "@tiptap/starter-kit": "3.20.1",
30
- "@tiptap/vue-3": "3.20.1",
28
+ "@tiptap/pm": "3.20.4",
29
+ "@tiptap/starter-kit": "3.20.4",
30
+ "@tiptap/vue-3": "3.20.4",
31
31
  "@vueform/slider": "2.1.10",
32
32
  "@vueuse/core": "14.2.1",
33
33
  "@vueuse/integrations": "14.2.1",
34
34
  "chart.js": "4.5.1",
35
35
  "mhz-helpers": "*",
36
36
  "perfect-debounce": "2.1.0",
37
- "vue": "3.6.0-beta.7",
37
+ "vue": "3.6.0-beta.8",
38
38
  "vue-chartjs": "5.3.3",
39
39
  "vue-router": "5.0.3"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@eslint/js": "10.0.1",
43
- "@storybook/addon-docs": "10.2.17",
44
- "@storybook/addon-themes": "10.2.17",
45
- "@storybook/vue3": "10.2.17",
46
- "@storybook/vue3-vite": "10.2.17",
43
+ "@storybook/addon-docs": "10.3.0",
44
+ "@storybook/addon-themes": "10.3.0",
45
+ "@storybook/vue3": "10.3.0",
46
+ "@storybook/vue3-vite": "10.3.0",
47
47
  "@types/node": "25.5.0",
48
48
  "@vitejs/plugin-vue": "6.0.5",
49
49
  "@vitest/coverage-v8": "4.1.0",
@@ -57,31 +57,31 @@
57
57
  "eslint-plugin-unicorn": "63.0.0",
58
58
  "eslint-plugin-vue": "10.8.0",
59
59
  "globals": "17.4.0",
60
- "happy-dom": "20.8.3",
60
+ "happy-dom": "20.8.4",
61
61
  "postcss-html": "1.8.1",
62
62
  "postcss-scss": "4.0.9",
63
63
  "prettier": "3.8.1",
64
64
  "sass-embedded": "1.98.0",
65
- "storybook": "10.2.17",
65
+ "storybook": "10.3.0",
66
66
  "stylelint": "17.4.0",
67
- "stylelint-config-recess-order": "7.6.1",
67
+ "stylelint-config-recess-order": "7.7.0",
68
68
  "stylelint-config-recommended-scss": "17.0.0",
69
69
  "stylelint-config-recommended-vue": "1.6.1",
70
- "stylelint-order": "8.0.0",
70
+ "stylelint-order": "8.1.1",
71
71
  "stylelint-prettier": "5.0.3",
72
72
  "typescript": "5.9.3",
73
- "typescript-eslint": "8.57.0",
73
+ "typescript-eslint": "8.57.1",
74
74
  "vite": "8.0.0",
75
75
  "vite-plugin-dts": "4.5.4",
76
- "vite-plugin-static-copy": "3.2.0",
76
+ "vite-plugin-static-copy": "3.3.0",
77
77
  "vite-svg-loader": "5.1.1",
78
78
  "vitest": "4.1.0",
79
79
  "vue-eslint-parser": "10.4.0",
80
80
  "vue-linters-config": "0.5.5",
81
- "vue-tsc": "3.2.5"
81
+ "vue-tsc": "3.2.6"
82
82
  },
83
83
  "peerDependencies": {
84
- "vue": "3.6.0-beta.7",
84
+ "vue": "3.6.0-beta.8",
85
85
  "vue-router": "5.0.3"
86
86
  },
87
87
  "engines": {