mhz-ui 1.2.21 → 1.2.23

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.
@@ -8372,28 +8372,28 @@ function lf(n, e, t, r, i) {
8372
8372
  return T(n, Ze(13, "Enter"));
8373
8373
  });
8374
8374
  }, 20));
8375
- let N = p.start, w = p.endA, I = (T) => {
8376
- let R = T || n.state.tr.replace(N, w, c.doc.slice(p.start - c.from, p.endB - c.from));
8375
+ let A = p.start, w = p.endA, I = (T) => {
8376
+ let R = T || n.state.tr.replace(A, w, c.doc.slice(p.start - c.from, p.endB - c.from));
8377
8377
  if (c.sel) {
8378
8378
  let H = So(n, R.doc, c.sel);
8379
- H && !(ee && n.composing && H.empty && (p.start != p.endB || n.input.lastChromeDelete < Date.now() - 100) && (H.head == N || H.head == R.mapping.map(w) - 1) || le && H.empty && H.head == N) && R.setSelection(H);
8379
+ H && !(ee && n.composing && H.empty && (p.start != p.endB || n.input.lastChromeDelete < Date.now() - 100) && (H.head == A || H.head == R.mapping.map(w) - 1) || le && H.empty && H.head == A) && R.setSelection(H);
8380
8380
  }
8381
8381
  return s && R.setMeta("composition", s), R.scrollIntoView();
8382
8382
  }, B;
8383
8383
  if (S) {
8384
8384
  if (m.pos == g.pos) {
8385
8385
  le && Ke <= 11 && m.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => Ie(n), 20));
8386
- let T = I(n.state.tr.delete(N, w)), R = u.resolve(p.start).marksAcross(u.resolve(p.endA));
8386
+ let T = I(n.state.tr.delete(A, w)), R = u.resolve(p.start).marksAcross(u.resolve(p.endA));
8387
8387
  R && T.ensureMarks(R), n.dispatch(T);
8388
8388
  } else if (
8389
8389
  // Adding or removing a mark
8390
8390
  p.endA == p.endB && (B = af(m.parent.content.cut(m.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
8391
8391
  ) {
8392
8392
  let T = I(n.state.tr);
8393
- B.type == "add" ? T.addMark(N, w, B.mark) : T.removeMark(N, w, B.mark), n.dispatch(T);
8393
+ B.type == "add" ? T.addMark(A, w, B.mark) : T.removeMark(A, w, B.mark), n.dispatch(T);
8394
8394
  } else if (m.parent.child(m.index()).isText && m.index() == g.index() - (g.textOffset ? 0 : 1)) {
8395
- let T = m.parent.textBetween(m.parentOffset, g.parentOffset), R = () => I(n.state.tr.insertText(T, N, w));
8396
- n.someProp("handleTextInput", (H) => H(n, N, w, T, R)) || n.dispatch(R());
8395
+ let T = m.parent.textBetween(m.parentOffset, g.parentOffset), R = () => I(n.state.tr.insertText(T, A, w));
8396
+ n.someProp("handleTextInput", (H) => H(n, A, w, T, R)) || n.dispatch(R());
8397
8397
  }
8398
8398
  } else
8399
8399
  n.dispatch(I());
@@ -10154,8 +10154,8 @@ function Oi(n, e, t = {}) {
10154
10154
  return;
10155
10155
  const y = Math.max(h, g), S = Math.min(p, g + m.nodeSize), E = S - y;
10156
10156
  o += E, l.push(
10157
- ...m.marks.map((N) => ({
10158
- mark: N,
10157
+ ...m.marks.map((A) => ({
10158
+ mark: A,
10159
10159
  from: y,
10160
10160
  to: S
10161
10161
  }))
@@ -10509,7 +10509,7 @@ function fh(n) {
10509
10509
  var m, g, y, S, E;
10510
10510
  if ((g = (m = h.type) == null ? void 0 : m.spec) != null && g.code || !(h.isText || h.isTextblock || h.isInline))
10511
10511
  return;
10512
- const N = (E = (S = (y = h.content) == null ? void 0 : y.size) != null ? S : h.nodeSize) != null ? E : 0, w = Math.max(r, p), I = Math.min(i, p + N);
10512
+ const A = (E = (S = (y = h.content) == null ? void 0 : y.size) != null ? S : h.nodeSize) != null ? E : 0, w = Math.max(r, p), I = Math.min(i, p + A);
10513
10513
  if (w >= I)
10514
10514
  return;
10515
10515
  const B = h.isText ? h.text || "" : h.textBetween(w - p, I - p, void 0, "");
@@ -10626,13 +10626,13 @@ function ph(n) {
10626
10626
  pasteEvt: T
10627
10627
  });
10628
10628
  }
10629
- const E = f.doc.content.findDiffStart(h.doc.content), N = f.doc.content.findDiffEnd(h.doc.content);
10630
- if (!(!ch(E) || !N || E === N.b))
10629
+ const E = f.doc.content.findDiffStart(h.doc.content), A = f.doc.content.findDiffEnd(h.doc.content);
10630
+ if (!(!ch(E) || !A || E === A.b))
10631
10631
  return a({
10632
10632
  rule: u,
10633
10633
  state: h,
10634
10634
  from: E,
10635
- to: N,
10635
+ to: A,
10636
10636
  pasteEvt: o
10637
10637
  });
10638
10638
  }
@@ -11205,7 +11205,7 @@ function sp(n, e, t) {
11205
11205
  let s = null;
11206
11206
  if (Ba(i) && (s = i.$cursor), s) {
11207
11207
  const l = (r = n.storedMarks) != null ? r : s.marks();
11208
- return !!t.isInSet(l) || !l.some((a) => a.type.excludes(t));
11208
+ return s.parent.type.allowsMarkType(t) && (!!t.isInSet(l) || !l.some((c) => c.type.excludes(t)));
11209
11209
  }
11210
11210
  const { ranges: o } = i;
11211
11211
  return o.some(({ $from: l, $to: a }) => {
@@ -11323,10 +11323,10 @@ var fp = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor
11323
11323
  const E = (
11324
11324
  // eslint-disable-next-line no-nested-ternary
11325
11325
  a.indexAfter(-1) < a.node(-2).childCount ? 1 : a.indexAfter(-2) < a.node(-3).childCount ? 2 : 3
11326
- ), N = {
11326
+ ), A = {
11327
11327
  ...Dn(f, a.node().type.name, a.node().attrs),
11328
11328
  ...e
11329
- }, w = ((o = l.contentMatch.defaultType) == null ? void 0 : o.createAndFill(N)) || void 0;
11329
+ }, w = ((o = l.contentMatch.defaultType) == null ? void 0 : o.createAndFill(A)) || void 0;
11330
11330
  y = y.append(b.from(l.createAndFill(null, w) || void 0));
11331
11331
  const I = a.before(a.depth - (S - 1));
11332
11332
  t.replace(I, a.after(-E), new x(y, 4 - S, 0));
@@ -11354,10 +11354,10 @@ var fp = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor
11354
11354
  if (!De(t.doc, a.pos, 2))
11355
11355
  return !1;
11356
11356
  if (i) {
11357
- const { selection: y, storedMarks: S } = r, { splittableMarks: E } = s.extensionManager, N = S || y.$to.parentOffset && y.$from.marks();
11358
- if (t.split(a.pos, 2, g).scrollIntoView(), !N || !i)
11357
+ const { selection: y, storedMarks: S } = r, { splittableMarks: E } = s.extensionManager, A = S || y.$to.parentOffset && y.$from.marks();
11358
+ if (t.split(a.pos, 2, g).scrollIntoView(), !A || !i)
11359
11359
  return !0;
11360
- const w = N.filter((I) => E.includes(I.type.name));
11360
+ const w = A.filter((I) => E.includes(I.type.name));
11361
11361
  t.ensureMarks(w);
11362
11362
  }
11363
11363
  return !0;
@@ -11380,7 +11380,7 @@ var fp = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor
11380
11380
  const i = n.doc.nodeAt(r);
11381
11381
  return t.node.type === i?.type && Ye(n.doc, r) && n.join(r), !0;
11382
11382
  }, pp = (n, e, t, r = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: u }) => {
11383
- const { extensions: d, splittableMarks: f } = i.extensionManager, h = _(n, o.schema), p = _(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: S } = m, E = y.blockRange(S), N = g || m.$to.parentOffset && m.$from.marks();
11383
+ const { extensions: d, splittableMarks: f } = i.extensionManager, h = _(n, o.schema), p = _(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: S } = m, E = y.blockRange(S), A = g || m.$to.parentOffset && m.$from.marks();
11384
11384
  if (!E)
11385
11385
  return !1;
11386
11386
  const w = Ir((I) => Io(I.type.name, d))(m);
@@ -11390,8 +11390,8 @@ var fp = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor
11390
11390
  if (Io(w.node.type.name, d) && h.validContent(w.node.content) && l)
11391
11391
  return a().command(() => (s.setNodeMarkup(w.pos, h), !0)).command(() => ti(s, h)).command(() => ni(s, h)).run();
11392
11392
  }
11393
- return !t || !N || !l ? a().command(() => u().wrapInList(h, r) ? !0 : c.clearNodes()).wrapInList(h, r).command(() => ti(s, h)).command(() => ni(s, h)).run() : a().command(() => {
11394
- const I = u().wrapInList(h, r), B = N.filter((T) => f.includes(T.type.name));
11393
+ return !t || !A || !l ? a().command(() => u().wrapInList(h, r) ? !0 : c.clearNodes()).wrapInList(h, r).command(() => ti(s, h)).command(() => ni(s, h)).run() : a().command(() => {
11394
+ const I = u().wrapInList(h, r), B = A.filter((T) => f.includes(T.type.name));
11395
11395
  return s.ensureMarks(B), I ? !0 : c.clearNodes();
11396
11396
  }).wrapInList(h, r).command(() => ti(s, h)).command(() => ni(s, h)).run();
11397
11397
  }, mp = (n, e = {}, t = {}) => ({ state: r, commands: i }) => {
@@ -11530,7 +11530,7 @@ var fp = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor
11530
11530
  u.steps.forEach((h, p) => {
11531
11531
  var m, g;
11532
11532
  if (h instanceof ye) {
11533
- const y = f.slice(p).map(h.from, -1), S = f.slice(p).map(h.to), E = f.invert().map(y, -1), N = f.invert().map(S), w = (m = u.doc.nodeAt(y - 1)) == null ? void 0 : m.marks.some((B) => B.eq(h.mark)), I = (g = u.doc.nodeAt(S)) == null ? void 0 : g.marks.some((B) => B.eq(h.mark));
11533
+ const y = f.slice(p).map(h.from, -1), S = f.slice(p).map(h.to), E = f.invert().map(y, -1), A = f.invert().map(S), w = (m = u.doc.nodeAt(y - 1)) == null ? void 0 : m.marks.some((B) => B.eq(h.mark)), I = (g = u.doc.nodeAt(S)) == null ? void 0 : g.marks.some((B) => B.eq(h.mark));
11534
11534
  this.editor.emit("delete", {
11535
11535
  type: "mark",
11536
11536
  mark: h.mark,
@@ -11538,7 +11538,7 @@ var fp = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor
11538
11538
  to: h.to,
11539
11539
  deletedRange: {
11540
11540
  from: E,
11541
- to: N
11541
+ to: A
11542
11542
  },
11543
11543
  newRange: {
11544
11544
  from: y,
@@ -11940,6 +11940,8 @@ var vp = class extends jf {
11940
11940
  emitContentError: !1,
11941
11941
  onBeforeCreate: () => null,
11942
11942
  onCreate: () => null,
11943
+ onMount: () => null,
11944
+ onUnmount: () => null,
11943
11945
  onUpdate: () => null,
11944
11946
  onSelectionUpdate: () => null,
11945
11947
  onTransaction: () => null,
@@ -11952,7 +11954,7 @@ var vp = class extends jf {
11952
11954
  onPaste: () => null,
11953
11955
  onDrop: () => null,
11954
11956
  onDelete: () => null
11955
- }, this.isCapturingTransaction = !1, this.capturedTransaction = null, this.setOptions(e), this.createExtensionManager(), this.createCommandManager(), this.createSchema(), this.on("beforeCreate", this.options.onBeforeCreate), this.emit("beforeCreate", { editor: this }), this.on("contentError", this.options.onContentError), this.on("create", this.options.onCreate), this.on("update", this.options.onUpdate), this.on("selectionUpdate", this.options.onSelectionUpdate), this.on("transaction", this.options.onTransaction), this.on("focus", this.options.onFocus), this.on("blur", this.options.onBlur), this.on("destroy", this.options.onDestroy), this.on("drop", ({ event: i, slice: s, moved: o }) => this.options.onDrop(i, s, o)), this.on("paste", ({ event: i, slice: s }) => this.options.onPaste(i, s)), this.on("delete", this.options.onDelete);
11957
+ }, this.isCapturingTransaction = !1, this.capturedTransaction = null, this.setOptions(e), this.createExtensionManager(), this.createCommandManager(), this.createSchema(), this.on("beforeCreate", this.options.onBeforeCreate), this.emit("beforeCreate", { editor: this }), this.on("mount", this.options.onMount), this.on("unmount", this.options.onUnmount), this.on("contentError", this.options.onContentError), this.on("create", this.options.onCreate), this.on("update", this.options.onUpdate), this.on("selectionUpdate", this.options.onSelectionUpdate), this.on("transaction", this.options.onTransaction), this.on("focus", this.options.onFocus), this.on("blur", this.options.onBlur), this.on("destroy", this.options.onDestroy), this.on("drop", ({ event: i, slice: s, moved: o }) => this.options.onDrop(i, s, o)), this.on("paste", ({ event: i, slice: s }) => this.options.onPaste(i, s)), this.on("delete", this.options.onDelete);
11956
11958
  const t = this.createDoc(), r = za(t, this.options.autofocus);
11957
11959
  this.editorState = wt.create({
11958
11960
  doc: t,
@@ -11968,7 +11970,7 @@ var vp = class extends jf {
11968
11970
  throw new Error(
11969
11971
  "[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment."
11970
11972
  );
11971
- this.createView(e), window.setTimeout(() => {
11973
+ this.createView(e), this.emit("mount", { editor: this }), window.setTimeout(() => {
11972
11974
  this.isDestroyed || (this.commands.focus(this.options.autofocus), this.emit("create", { editor: this }), this.isInitialized = !0);
11973
11975
  }, 0);
11974
11976
  }
@@ -11986,7 +11988,7 @@ var vp = class extends jf {
11986
11988
  } catch (e) {
11987
11989
  console.warn("Failed to remove CSS element:", e);
11988
11990
  }
11989
- this.css = null;
11991
+ this.css = null, this.emit("unmount", { editor: this });
11990
11992
  }
11991
11993
  /**
11992
11994
  * Returns the editor storage.
@@ -12746,7 +12748,7 @@ var qn = (n, e) => {
12746
12748
  })
12747
12749
  ];
12748
12750
  }
12749
- }), Hp = /(^|[^`])`([^`]+)`(?!`)/, jp = /(^|[^`])`([^`]+)`(?!`)/g, Wp = mt.create({
12751
+ }), Hp = /(^|[^`])`([^`]+)`(?!`)$/, jp = /(^|[^`])`([^`]+)`(?!`)/g, Wp = mt.create({
12750
12752
  name: "code",
12751
12753
  addOptions() {
12752
12754
  return {
@@ -12798,6 +12800,8 @@ var qn = (n, e) => {
12798
12800
  exitOnTripleEnter: !0,
12799
12801
  exitOnArrowDown: !0,
12800
12802
  defaultLanguage: null,
12803
+ enableTabIndentation: !1,
12804
+ tabSize: 4,
12801
12805
  HTMLAttributes: {}
12802
12806
  };
12803
12807
  },
@@ -12854,6 +12858,63 @@ var qn = (n, e) => {
12854
12858
  const { empty: n, $anchor: e } = this.editor.state.selection, t = e.pos === 1;
12855
12859
  return !n || e.parent.type.name !== this.name ? !1 : t || !e.parent.textContent.length ? this.editor.commands.clearNodes() : !1;
12856
12860
  },
12861
+ // handle tab indentation
12862
+ Tab: ({ editor: n }) => {
12863
+ if (!this.options.enableTabIndentation)
12864
+ return !1;
12865
+ const { state: e } = n, { selection: t } = e, { $from: r, empty: i } = t;
12866
+ if (r.parent.type !== this.type)
12867
+ return !1;
12868
+ const s = " ".repeat(this.options.tabSize);
12869
+ return i ? n.commands.insertContent(s) : n.commands.command(({ tr: o }) => {
12870
+ const { from: l, to: a } = t, d = e.doc.textBetween(l, a, `
12871
+ `, `
12872
+ `).split(`
12873
+ `).map((f) => s + f).join(`
12874
+ `);
12875
+ return o.replaceWith(l, a, e.schema.text(d)), !0;
12876
+ });
12877
+ },
12878
+ // handle shift+tab reverse indentation
12879
+ "Shift-Tab": ({ editor: n }) => {
12880
+ if (!this.options.enableTabIndentation)
12881
+ return !1;
12882
+ const { state: e } = n, { selection: t } = e, { $from: r, empty: i } = t;
12883
+ return r.parent.type !== this.type ? !1 : i ? n.commands.command(({ tr: s }) => {
12884
+ var o;
12885
+ const { pos: l } = r, a = r.start(), c = r.end(), d = e.doc.textBetween(a, c, `
12886
+ `, `
12887
+ `).split(`
12888
+ `);
12889
+ let f = 0, h = 0;
12890
+ const p = l - a;
12891
+ for (let A = 0; A < d.length; A += 1) {
12892
+ if (h + d[A].length >= p) {
12893
+ f = A;
12894
+ break;
12895
+ }
12896
+ h += d[A].length + 1;
12897
+ }
12898
+ const g = ((o = d[f].match(/^ */)) == null ? void 0 : o[0]) || "", y = Math.min(g.length, this.options.tabSize);
12899
+ if (y === 0)
12900
+ return !0;
12901
+ let S = a;
12902
+ for (let A = 0; A < f; A += 1)
12903
+ S += d[A].length + 1;
12904
+ return s.delete(S, S + y), l - S <= y && s.setSelection(v.create(s.doc, S)), !0;
12905
+ }) : n.commands.command(({ tr: s }) => {
12906
+ const { from: o, to: l } = t, u = e.doc.textBetween(o, l, `
12907
+ `, `
12908
+ `).split(`
12909
+ `).map((d) => {
12910
+ var f;
12911
+ const h = ((f = d.match(/^ */)) == null ? void 0 : f[0]) || "", p = Math.min(h.length, this.options.tabSize);
12912
+ return d.slice(p);
12913
+ }).join(`
12914
+ `);
12915
+ return s.replaceWith(o, l, e.schema.text(u)), !0;
12916
+ });
12917
+ },
12857
12918
  // exit node on triple enter
12858
12919
  Enter: ({ editor: n }) => {
12859
12920
  if (!this.options.exitOnTripleEnter)
@@ -13275,7 +13336,7 @@ oe.prototype = {
13275
13336
  return i.j[n] = o, o;
13276
13337
  }
13277
13338
  };
13278
- const A = (n, e, t, r, i) => n.ta(e, t, r, i), F = (n, e, t, r, i) => n.tr(e, t, r, i), Bo = (n, e, t, r, i) => n.ts(e, t, r, i), k = (n, e, t, r, i) => n.tt(e, t, r, i), Oe = "WORD", Pi = "UWORD", tc = "ASCIINUMERICAL", nc = "ALPHANUMERICAL", an = "LOCALHOST", Li = "TLD", Bi = "UTLD", In = "SCHEME", Mt = "SLASH_SCHEME", ps = "NUM", zi = "WS", ms = "NL", qt = "OPENBRACE", Jt = "CLOSEBRACE", Jn = "OPENBRACKET", Gn = "CLOSEBRACKET", Yn = "OPENPAREN", Xn = "CLOSEPAREN", Qn = "OPENANGLEBRACKET", Zn = "CLOSEANGLEBRACKET", er = "FULLWIDTHLEFTPAREN", tr = "FULLWIDTHRIGHTPAREN", nr = "LEFTCORNERBRACKET", rr = "RIGHTCORNERBRACKET", ir = "LEFTWHITECORNERBRACKET", sr = "RIGHTWHITECORNERBRACKET", or = "FULLWIDTHLESSTHAN", lr = "FULLWIDTHGREATERTHAN", ar = "AMPERSAND", cr = "APOSTROPHE", ur = "ASTERISK", ze = "AT", dr = "BACKSLASH", fr = "BACKTICK", hr = "CARET", Ve = "COLON", gs = "COMMA", pr = "DOLLAR", Se = "DOT", mr = "EQUALS", ys = "EXCLAMATION", fe = "HYPHEN", Gt = "PERCENT", gr = "PIPE", yr = "PLUS", br = "POUND", Yt = "QUERY", bs = "QUOTE", rc = "FULLWIDTHMIDDLEDOT", ks = "SEMI", xe = "SLASH", Xt = "TILDE", kr = "UNDERSCORE", ic = "EMOJI", Sr = "SYM";
13339
+ const N = (n, e, t, r, i) => n.ta(e, t, r, i), F = (n, e, t, r, i) => n.tr(e, t, r, i), Bo = (n, e, t, r, i) => n.ts(e, t, r, i), k = (n, e, t, r, i) => n.tt(e, t, r, i), Oe = "WORD", Pi = "UWORD", tc = "ASCIINUMERICAL", nc = "ALPHANUMERICAL", an = "LOCALHOST", Li = "TLD", Bi = "UTLD", In = "SCHEME", Mt = "SLASH_SCHEME", ps = "NUM", zi = "WS", ms = "NL", qt = "OPENBRACE", Jt = "CLOSEBRACE", Jn = "OPENBRACKET", Gn = "CLOSEBRACKET", Yn = "OPENPAREN", Xn = "CLOSEPAREN", Qn = "OPENANGLEBRACKET", Zn = "CLOSEANGLEBRACKET", er = "FULLWIDTHLEFTPAREN", tr = "FULLWIDTHRIGHTPAREN", nr = "LEFTCORNERBRACKET", rr = "RIGHTCORNERBRACKET", ir = "LEFTWHITECORNERBRACKET", sr = "RIGHTWHITECORNERBRACKET", or = "FULLWIDTHLESSTHAN", lr = "FULLWIDTHGREATERTHAN", ar = "AMPERSAND", cr = "APOSTROPHE", ur = "ASTERISK", ze = "AT", dr = "BACKSLASH", fr = "BACKTICK", hr = "CARET", Ve = "COLON", gs = "COMMA", pr = "DOLLAR", Se = "DOT", mr = "EQUALS", ys = "EXCLAMATION", fe = "HYPHEN", Gt = "PERCENT", gr = "PIPE", yr = "PLUS", br = "POUND", Yt = "QUERY", bs = "QUOTE", rc = "FULLWIDTHMIDDLEDOT", ks = "SEMI", xe = "SLASH", Xt = "TILDE", kr = "UNDERSCORE", ic = "EMOJI", Sr = "SYM";
13279
13340
  var sc = /* @__PURE__ */ Object.freeze({
13280
13341
  __proto__: null,
13281
13342
  ALPHANUMERICAL: nc,
@@ -13698,33 +13759,33 @@ function hm({
13698
13759
  groups: n
13699
13760
  }) {
13700
13761
  const e = n.domain.concat([ar, ur, ze, dr, fr, hr, pr, mr, fe, ps, Gt, gr, yr, br, xe, Sr, Xt, kr]), t = [cr, Ve, gs, Se, ys, Gt, Yt, bs, ks, Qn, Zn, qt, Jt, Gn, Jn, Yn, Xn, er, tr, nr, rr, ir, sr, or, lr], r = [ar, cr, ur, dr, fr, hr, pr, mr, fe, qt, Jt, Gt, gr, yr, br, Yt, xe, Sr, Xt, kr], i = de(), s = k(i, Xt);
13701
- A(s, r, s), A(s, n.domain, s);
13762
+ N(s, r, s), N(s, n.domain, s);
13702
13763
  const o = de(), l = de(), a = de();
13703
- A(i, n.domain, o), A(i, n.scheme, l), A(i, n.slashscheme, a), A(o, r, s), A(o, n.domain, o);
13764
+ N(i, n.domain, o), N(i, n.scheme, l), N(i, n.slashscheme, a), N(o, r, s), N(o, n.domain, o);
13704
13765
  const c = k(o, ze);
13705
13766
  k(s, ze, c), k(l, ze, c), k(a, ze, c);
13706
13767
  const u = k(s, Se);
13707
- A(u, r, s), A(u, n.domain, s);
13768
+ N(u, r, s), N(u, n.domain, s);
13708
13769
  const d = de();
13709
- A(c, n.domain, d), A(d, n.domain, d);
13770
+ N(c, n.domain, d), N(d, n.domain, d);
13710
13771
  const f = k(d, Se);
13711
- A(f, n.domain, d);
13772
+ N(f, n.domain, d);
13712
13773
  const h = de(Vo);
13713
- A(f, n.tld, h), A(f, n.utld, h), k(c, an, h);
13774
+ N(f, n.tld, h), N(f, n.utld, h), k(c, an, h);
13714
13775
  const p = k(d, fe);
13715
- k(p, fe, p), A(p, n.domain, d), A(h, n.domain, d), k(h, Se, f), k(h, fe, p);
13776
+ k(p, fe, p), N(p, n.domain, d), N(h, n.domain, d), k(h, Se, f), k(h, fe, p);
13716
13777
  const m = k(h, Ve);
13717
- A(m, n.numeric, Vo);
13778
+ N(m, n.numeric, Vo);
13718
13779
  const g = k(o, fe), y = k(o, Se);
13719
- k(g, fe, g), A(g, n.domain, o), A(y, r, s), A(y, n.domain, o);
13780
+ k(g, fe, g), N(g, n.domain, o), N(y, r, s), N(y, n.domain, o);
13720
13781
  const S = de(vn);
13721
- A(y, n.tld, S), A(y, n.utld, S), A(S, n.domain, o), A(S, r, s), k(S, Se, y), k(S, fe, g), k(S, ze, c);
13722
- const E = k(S, Ve), N = de(vn);
13723
- A(E, n.numeric, N);
13782
+ N(y, n.tld, S), N(y, n.utld, S), N(S, n.domain, o), N(S, r, s), k(S, Se, y), k(S, fe, g), k(S, ze, c);
13783
+ const E = k(S, Ve), A = de(vn);
13784
+ N(E, n.numeric, A);
13724
13785
  const w = de(vn), I = de();
13725
- A(w, e, w), A(w, t, I), A(I, e, w), A(I, t, I), k(S, xe, w), k(N, xe, w);
13786
+ N(w, e, w), N(w, t, I), N(I, e, w), N(I, t, I), k(S, xe, w), k(A, xe, w);
13726
13787
  const B = k(l, Ve), T = k(a, Ve), R = k(T, xe), H = k(R, xe);
13727
- A(l, n.domain, o), k(l, Se, y), k(l, fe, g), A(a, n.domain, o), k(a, Se, y), k(a, fe, g), A(B, n.domain, w), k(B, xe, w), k(B, Yt, w), A(H, n.domain, w), A(H, e, w), k(H, xe, w);
13788
+ N(l, n.domain, o), k(l, Se, y), k(l, fe, g), N(a, n.domain, o), k(a, Se, y), k(a, fe, g), N(B, n.domain, w), k(B, xe, w), k(B, Yt, w), N(H, n.domain, w), N(H, e, w), k(H, xe, w);
13728
13789
  const gt = [
13729
13790
  [qt, Jt],
13730
13791
  // {}
@@ -13747,9 +13808,9 @@ function hm({
13747
13808
  const [mn, Fr] = gt[Pt], gn = k(w, mn);
13748
13809
  k(I, mn, gn), k(gn, Fr, w);
13749
13810
  const yt = de(vn);
13750
- A(gn, e, yt);
13811
+ N(gn, e, yt);
13751
13812
  const Lt = de();
13752
- A(gn, t), A(yt, e, yt), A(yt, t, Lt), A(Lt, e, yt), A(Lt, t, Lt), k(yt, Fr, w), k(Lt, Fr, w);
13813
+ N(gn, t), N(yt, e, yt), N(yt, t, Lt), N(Lt, e, yt), N(Lt, t, Lt), k(yt, Fr, w), k(Lt, Fr, w);
13753
13814
  }
13754
13815
  return k(i, an, S), k(i, ms, fm), {
13755
13816
  start: i,
@@ -1 +1 @@
1
- ._container_15v9t_1{position:fixed;inset:0;z-index:999;display:flex;align-items:center;justify-content:center;width:100%;height:100dvh;background-color:var(--color-gray-transparent)}._modal_15v9t_13{position:relative;display:flex;flex-direction:column;gap:12px;width:var(--313d4130);max-width:calc(100% - 32px);height:auto;padding:24px;outline:none;background-color:var(--color-white);border-radius:16px;box-shadow:0 0 16px 0 var(--color-gray-transparent)}._header_15v9t_28{display:flex;justify-content:flex-end}._buttons_15v9t_33{display:flex;gap:16px}
1
+ ._container_7ok0x_1{position:fixed;inset:0;z-index:999;display:flex;align-items:center;justify-content:center;width:100%;height:100dvh;background-color:var(--color-gray-transparent)}._modal_7ok0x_13{position:relative;display:flex;flex-direction:column;gap:12px;width:var(--2507b6f8);max-width:100%;height:auto;padding:24px;outline:none;background-color:var(--color-white);border-radius:16px;box-shadow:0 0 16px 0 var(--color-gray-transparent)}._modal_7ok0x_13[data-scrollable=true]{max-height:64dvh;overflow-y:auto}._header_7ok0x_32{display:flex;justify-content:flex-end}._buttons_7ok0x_37{display:flex;gap:16px}
@@ -1,6 +1,7 @@
1
1
  import { TLocale } from '../locales/types';
2
2
  interface IProps {
3
3
  modelValue: boolean;
4
+ isScrollable?: boolean;
4
5
  isConfirm?: boolean;
5
6
  width?: string;
6
7
  lang?: TLocale;
@@ -1,24 +1,25 @@
1
1
  import "./UiModal.css";
2
- import { defineComponent as b, useCssVars as k, computed as $, ref as S, watch as B, createElementBlock as u, createCommentVNode as c, openBlock as m, normalizeClass as l, createElementVNode as a, withModifiers as g, createVNode as d, renderSlot as E, withCtx as f, createTextVNode as p, toDisplayString as _, unref as y } from "vue";
3
- import v from "../UiButton/UiButton.js";
4
- import N from "../UiClose/UiClose.js";
2
+ import { defineComponent as w, useCssVars as M, computed as S, ref as $, watch as x, createElementBlock as u, createCommentVNode as c, openBlock as m, normalizeClass as l, createElementVNode as n, withModifiers as B, createVNode as d, renderSlot as g, withCtx as f, createTextVNode as p, toDisplayString as _, unref as y } from "vue";
3
+ import b from "../UiButton/UiButton.js";
4
+ import E from "../UiClose/UiClose.js";
5
5
  import { M as C } from "../index-DajWja1y.js";
6
- import { _ as U } from "../_plugin-vue_export-helper-CHgC5LLL.js";
7
- const x = /* @__PURE__ */ b({
6
+ import { _ as N } from "../_plugin-vue_export-helper-CHgC5LLL.js";
7
+ const U = ["data-scrollable"], T = /* @__PURE__ */ w({
8
8
  __name: "UiModal",
9
9
  props: {
10
10
  modelValue: { type: Boolean },
11
+ isScrollable: { type: Boolean },
11
12
  isConfirm: { type: Boolean },
12
13
  width: { default: "360" },
13
14
  lang: { default: "ru" }
14
15
  },
15
16
  emits: ["update:modelValue", "confirm"],
16
17
  setup(V, { emit: h }) {
17
- k((o) => ({
18
- "313d4130": w.value
18
+ M((o) => ({
19
+ "2507b6f8": v.value
19
20
  }));
20
- const e = V, n = h, w = $(() => `${e.width}px`), r = document.querySelector("body"), t = S(!1);
21
- B(
21
+ const e = V, a = h, v = S(() => `${e.width}px`), r = document.querySelector("body"), t = $(!1);
22
+ x(
22
23
  () => e.modelValue,
23
24
  () => {
24
25
  const o = e.modelValue ? "hidden" : "auto";
@@ -27,41 +28,42 @@ const x = /* @__PURE__ */ b({
27
28
  }, 100));
28
29
  }
29
30
  );
30
- function M() {
31
- n("confirm"), n("update:modelValue", !1);
31
+ function k() {
32
+ a("confirm"), a("update:modelValue", !1);
32
33
  }
33
34
  function s() {
34
- t.value || n("update:modelValue", !1), t.value = !1;
35
+ t.value || a("update:modelValue", !1), t.value = !1;
35
36
  }
36
37
  return (o, i) => e.modelValue ? (m(), u("div", {
37
38
  key: 0,
38
39
  onMousedown: s,
39
40
  class: l(o.$style.container)
40
41
  }, [
41
- a("div", {
42
- onMousedown: i[0] || (i[0] = g(() => {
42
+ n("div", {
43
+ onMousedown: i[0] || (i[0] = B(() => {
43
44
  }, ["stop"])),
44
- class: l(o.$style.modal)
45
+ class: l(o.$style.modal),
46
+ "data-scrollable": e.isScrollable
45
47
  }, [
46
- a("div", {
48
+ n("div", {
47
49
  class: l(o.$style.header)
48
50
  }, [
49
- d(N, { onClick: s })
51
+ d(E, { onClick: s })
50
52
  ], 2),
51
- a("div", null, [
52
- E(o.$slots, "default")
53
+ n("div", null, [
54
+ g(o.$slots, "default")
53
55
  ]),
54
56
  e.isConfirm ? (m(), u("div", {
55
57
  key: 0,
56
58
  class: l(o.$style.buttons)
57
59
  }, [
58
- d(v, { onClick: M }, {
60
+ d(b, { onClick: k }, {
59
61
  default: f(() => [
60
62
  p(_(y(C)[e.lang].confirm), 1)
61
63
  ]),
62
64
  _: 1
63
65
  }),
64
- d(v, {
66
+ d(b, {
65
67
  layout: "secondary",
66
68
  onClick: s
67
69
  }, {
@@ -71,17 +73,17 @@ const x = /* @__PURE__ */ b({
71
73
  _: 1
72
74
  })
73
75
  ], 2)) : c("", !0)
74
- ], 34)
76
+ ], 42, U)
75
77
  ], 34)) : c("", !0);
76
78
  }
77
- }), T = "_container_15v9t_1", q = "_modal_15v9t_13", z = "_header_15v9t_28", A = "_buttons_15v9t_33", D = {
78
- container: T,
79
- modal: q,
80
- header: z,
81
- buttons: A
82
- }, G = {
83
- $style: D
84
- }, K = /* @__PURE__ */ U(x, [["__cssModules", G]]);
79
+ }), q = "_container_7ok0x_1", z = "_modal_7ok0x_13", A = "_header_7ok0x_32", D = "_buttons_7ok0x_37", G = {
80
+ container: q,
81
+ modal: z,
82
+ header: A,
83
+ buttons: D
84
+ }, H = {
85
+ $style: G
86
+ }, L = /* @__PURE__ */ N(T, [["__cssModules", H]]);
85
87
  export {
86
- K as default
88
+ L as default
87
89
  };
@@ -51,7 +51,7 @@ const ee = { render: Z }, te = { key: 0 }, oe = ["onClick", "onKeydown", "onMous
51
51
  setup(h, { emit: i }) {
52
52
  const t = h, k = i, f = a(""), u = a(!1), V = a(!1), v = a(), r = a(), _ = a(), B = a([]), $ = b(() => {
53
53
  const e = t.options?.[0];
54
- return e !== void 0 && typeof e == "object";
54
+ return e != null && typeof e == "object";
55
55
  }), S = (e) => e !== null && (typeof e == "string" || typeof e == "number"), w = b(() => {
56
56
  if (!t.options?.length) return [];
57
57
  const e = $.value ? [...t.options] : t.options.map((o) => ({ _id: String(o), title: String(o) }));
@@ -109,8 +109,8 @@ const U = { key: 0 }, j = ["data-error"], x = ["accept", "multiple"], P = ["data
109
109
  default: _(() => [
110
110
  p(a(d(y)[e.lang].remove), 1)
111
111
  ]),
112
- _: 2
113
- }, 1032, ["onClick"])
112
+ _: 1
113
+ }, 8, ["onClick"])
114
114
  ], 2))), 128)) : u("", !0),
115
115
  e.isSingle && e.file ? (s(), o("div", {
116
116
  key: 2,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mhz-ui",
3
3
  "description": "Mhz ui kit",
4
- "version": "1.2.21",
4
+ "version": "1.2.23",
5
5
  "author": "Alexandr Dergunov <dergunovs@mail.ru> (https://github.com/dergunovs)",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -25,26 +25,26 @@
25
25
  "test:cov": "vitest run --coverage"
26
26
  },
27
27
  "dependencies": {
28
- "@tiptap/pm": "3.3.0",
29
- "@tiptap/starter-kit": "3.3.0",
30
- "@tiptap/vue-3": "3.3.0",
28
+ "@tiptap/pm": "3.4.1",
29
+ "@tiptap/starter-kit": "3.4.1",
30
+ "@tiptap/vue-3": "3.4.1",
31
31
  "@vueform/slider": "2.1.10",
32
- "@vueuse/core": "13.8.0",
33
- "@vueuse/integrations": "13.8.0",
32
+ "@vueuse/core": "13.9.0",
33
+ "@vueuse/integrations": "13.9.0",
34
34
  "chart.js": "4.5.0",
35
35
  "mhz-helpers": "*",
36
36
  "perfect-debounce": "2.0.0",
37
- "vue": "3.5.20",
37
+ "vue": "3.5.21",
38
38
  "vue-cal": "5.0.1-rc.28",
39
39
  "vue-chartjs": "5.3.2",
40
40
  "vue-router": "4.5.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@eslint/js": "9.34.0",
44
- "@storybook/addon-docs": "9.1.3",
45
- "@storybook/vue3": "9.1.3",
46
- "@storybook/vue3-vite": "9.1.3",
47
- "@types/node": "24.3.0",
44
+ "@storybook/addon-docs": "9.1.4",
45
+ "@storybook/vue3": "9.1.4",
46
+ "@storybook/vue3-vite": "9.1.4",
47
+ "@types/node": "24.3.1",
48
48
  "@vitejs/plugin-vue": "6.0.1",
49
49
  "@vitest/coverage-istanbul": "3.2.4",
50
50
  "@vue/test-utils": "2.4.6",
@@ -61,8 +61,8 @@
61
61
  "postcss-html": "1.8.0",
62
62
  "postcss-scss": "4.0.9",
63
63
  "prettier": "3.6.2",
64
- "sass-embedded": "1.91.0",
65
- "storybook": "9.1.3",
64
+ "sass-embedded": "1.92.0",
65
+ "storybook": "9.1.4",
66
66
  "stylelint": "16.23.1",
67
67
  "stylelint-config-recess-order": "7.2.0",
68
68
  "stylelint-config-recommended-scss": "16.0.0",
@@ -70,18 +70,18 @@
70
70
  "stylelint-order": "7.0.0",
71
71
  "stylelint-prettier": "5.0.3",
72
72
  "typescript": "5.9.2",
73
- "typescript-eslint": "8.41.0",
74
- "vite": "7.1.3",
73
+ "typescript-eslint": "8.42.0",
74
+ "vite": "7.1.4",
75
75
  "vite-plugin-dts": "4.5.4",
76
76
  "vite-plugin-static-copy": "3.1.2",
77
77
  "vite-svg-loader": "5.1.0",
78
78
  "vitest": "3.2.4",
79
79
  "vue-eslint-parser": "10.2.0",
80
- "vue-linters-config": "0.4.2",
80
+ "vue-linters-config": "0.5.3",
81
81
  "vue-tsc": "3.0.6"
82
82
  },
83
83
  "peerDependencies": {
84
- "vue": "3.5.20",
84
+ "vue": "3.5.21",
85
85
  "vue-router": "4.5.1"
86
86
  },
87
87
  "engines": {