@oliasoft-open-source/react-ui-library 9.1.0-beta-3 → 9.1.0-beta-5-beta-1

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/index.js CHANGED
@@ -6591,101 +6591,96 @@ var ko = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Ao =
6591
6591
  },
6592
6592
  render: t
6593
6593
  } }), sf = {
6594
- inputInTable: "_inputInTable_1os7l_1",
6595
- inputHover: "_inputHover_1os7l_13",
6596
- inputFocus: "_inputFocus_1os7l_18",
6597
- controlFocusVisible: "_controlFocusVisible_1os7l_25",
6598
- inputError: "_inputError_1os7l_29",
6599
- inputWarning: "_inputWarning_1os7l_30",
6600
- inputDisabled: "_inputDisabled_1os7l_65",
6601
- hideScrollbars: "_hideScrollbars_1os7l_71",
6602
- richTextInput: "_richTextInput_1os7l_81",
6603
- mention: "_mention_1os7l_125",
6604
- mentionLayer: "_mentionLayer_1os7l_133",
6605
- mentionEmpty: "_mentionEmpty_1os7l_144",
6606
- mentionOption: "_mentionOption_1os7l_149",
6607
- focused: "_focused_1os7l_155"
6608
- }, cf = o(({ editable: e, emptyLabel: t, getRect: n, items: r, onDismiss: i, onSelect: a }, o) => {
6609
- let [s, c] = v(0), u = r.length > 0 || !!t, m = f(), g = l((e) => `${m}-option-${e}`, [m]), { renderLayer: y, layerProps: x, triggerProps: w } = aa({
6610
- isOpen: u,
6594
+ inputInTable: "_inputInTable_1xhvx_1",
6595
+ inputHover: "_inputHover_1xhvx_13",
6596
+ inputFocus: "_inputFocus_1xhvx_18",
6597
+ controlFocusVisible: "_controlFocusVisible_1xhvx_25",
6598
+ inputError: "_inputError_1xhvx_29",
6599
+ inputWarning: "_inputWarning_1xhvx_30",
6600
+ inputDisabled: "_inputDisabled_1xhvx_65",
6601
+ hideScrollbars: "_hideScrollbars_1xhvx_71",
6602
+ richTextInput: "_richTextInput_1xhvx_81",
6603
+ editable: "_editable_1xhvx_81",
6604
+ mention: "_mention_1xhvx_125",
6605
+ mentionLayer: "_mentionLayer_1xhvx_133",
6606
+ mentionOption: "_mentionOption_1xhvx_144",
6607
+ focused: "_focused_1xhvx_150"
6608
+ }, cf = o(({ editable: e, getRect: t, items: n, onDismiss: r, onSelect: i }, a) => {
6609
+ let [o, s] = v(0), c = n.length > 0, u = f(), m = l((e) => `${u}-option-${e}`, [u]), { renderLayer: g, layerProps: y, triggerProps: x } = aa({
6610
+ isOpen: c,
6611
6611
  placement: "bottom-start",
6612
6612
  triggerOffset: 2,
6613
- onOutsideClick: i
6613
+ onOutsideClick: r
6614
6614
  });
6615
6615
  d(() => {
6616
- c(0);
6617
- }, [r]);
6618
- let T = _(n), E = _(null);
6619
- d(() => {
6620
- T.current = n;
6616
+ s(0);
6621
6617
  }, [n]);
6622
- let D = h(() => ({
6618
+ let C = _(t), w = _(null);
6619
+ d(() => {
6620
+ C.current = t;
6621
+ }, [t]);
6622
+ let T = h(() => ({
6623
6623
  getBoundingClientRect: () => {
6624
6624
  var e, t, n;
6625
- return E.current = (e = (t = T.current) == null ? void 0 : t.call(T)) == null ? E.current : e, (n = E.current) == null ? new DOMRect() : n;
6625
+ return w.current = (e = (t = C.current) == null ? void 0 : t.call(C)) == null ? w.current : e, (n = w.current) == null ? new DOMRect() : n;
6626
6626
  },
6627
6627
  contextElement: e == null ? void 0 : e
6628
6628
  }), [e]);
6629
6629
  return d(() => {
6630
- w.ref(e ? D : null);
6630
+ x.ref(e ? T : null);
6631
6631
  }, [
6632
6632
  e,
6633
- D,
6634
- w.ref
6633
+ T,
6634
+ x.ref
6635
6635
  ]), d(() => {
6636
- if (!e || !u) return;
6636
+ if (!e) return;
6637
6637
  let t = {
6638
6638
  role: "combobox",
6639
6639
  "aria-autocomplete": "list",
6640
- "aria-expanded": "true",
6641
- "aria-controls": m
6640
+ "aria-expanded": String(c),
6641
+ "aria-controls": u
6642
6642
  };
6643
- return Object.entries(t).forEach(([t, n]) => e.setAttribute(t, n)), r.length && e.setAttribute("aria-activedescendant", g(s)), () => {
6643
+ return Object.entries(t).forEach(([t, n]) => e.setAttribute(t, n)), c ? e.setAttribute("aria-activedescendant", m(o)) : e.removeAttribute("aria-activedescendant"), () => {
6644
6644
  Object.keys(t).forEach((t) => e.removeAttribute(t)), e.removeAttribute("aria-activedescendant");
6645
6645
  };
6646
6646
  }, [
6647
- s,
6647
+ o,
6648
6648
  e,
6649
+ c,
6649
6650
  u,
6650
- r.length,
6651
- m,
6652
- g
6653
- ]), p(o, () => ({ onKeyDown: (e) => {
6654
- if (!u) return !1;
6655
- if (e.key === "Escape") return i(), !0;
6656
- if (!r.length) return !1;
6651
+ m
6652
+ ]), p(a, () => ({ onKeyDown: (e) => {
6653
+ if (!c) return !1;
6657
6654
  switch (e.key) {
6658
- case "ArrowDown": return c((e) => (e + 1) % r.length), !0;
6659
- case "ArrowUp": return c((e) => (e + r.length - 1) % r.length), !0;
6655
+ case "ArrowDown": return s((e) => (e + 1) % n.length), !0;
6656
+ case "ArrowUp": return s((e) => (e + n.length - 1) % n.length), !0;
6660
6657
  case "Tab":
6661
- case "Enter": return a(r[s]), !0;
6658
+ case "Enter": return i(n[o]), !0;
6659
+ case "Escape": return r(), !0;
6662
6660
  default: return !1;
6663
6661
  }
6664
6662
  } }), [
6665
- s,
6666
- u,
6663
+ o,
6664
+ c,
6665
+ n,
6667
6666
  r,
6668
- i,
6669
- a
6670
- ]), u ? y(/* @__PURE__ */ C("div", {
6671
- ...x,
6667
+ i
6668
+ ]), c ? g(/* @__PURE__ */ S("div", {
6669
+ ...y,
6672
6670
  className: sf.mentionLayer,
6673
- id: m,
6671
+ id: u,
6674
6672
  role: "listbox",
6675
- children: [!r.length && /* @__PURE__ */ S("div", {
6676
- className: sf.mentionEmpty,
6677
- children: t
6678
- }), r.map((e, t) => /* @__PURE__ */ S("div", {
6679
- id: g(t),
6673
+ children: n.map((e, t) => /* @__PURE__ */ S("div", {
6674
+ id: m(t),
6680
6675
  role: "option",
6681
- "aria-selected": t === s,
6682
- className: b(sf.mentionOption, { [sf.focused]: t === s }),
6683
- onMouseEnter: () => c(t),
6676
+ "aria-selected": t === o,
6677
+ className: b(sf.mentionOption, { [sf.focused]: t === o }),
6678
+ onMouseEnter: () => s(t),
6684
6679
  onMouseDown: (t) => {
6685
- t.preventDefault(), a(e);
6680
+ t.preventDefault(), i(e);
6686
6681
  },
6687
6682
  children: e.label
6688
- }, e.id))]
6683
+ }, e.id))
6689
6684
  })) : null;
6690
6685
  }), lf = ({ clientRect: e, command: t, editor: n, items: r }) => ({
6691
6686
  clientRect: e,
@@ -6716,6 +6711,7 @@ var ko = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Ao =
6716
6711
  content: w.current,
6717
6712
  contentType: "markdown",
6718
6713
  editable: !g,
6714
+ editorProps: { attributes: { class: sf.editable } },
6719
6715
  onUpdate: ({ editor: e }) => {
6720
6716
  t == null || t(e.getMarkdown(), { mentionedIds: rf(e) });
6721
6717
  }
@@ -6744,7 +6740,6 @@ var ko = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Ao =
6744
6740
  y && /* @__PURE__ */ S(Xi, { children: /* @__PURE__ */ S(cf, {
6745
6741
  ref: x,
6746
6742
  editable: (c = T == null ? void 0 : T.editable) == null ? null : c,
6747
- emptyLabel: a == null ? void 0 : a.emptyLabel,
6748
6743
  getRect: (l = T == null ? void 0 : T.clientRect) == null ? null : l,
6749
6744
  items: (f = T == null ? void 0 : T.items) == null ? [] : f,
6750
6745
  onDismiss: () => E(null),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/react-ui-library",
3
- "version": "9.1.0-beta-3",
3
+ "version": "9.1.0-beta-5-beta-1",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
6
6
  "bugs": {