@oliasoft-open-source/react-ui-library 9.2.0-beta-7 → 9.2.0-beta-9
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/components/rich-text-input/rich-text-input.d.ts +1 -0
- package/dist/components/rich-text-input/rich-text-input.d.ts.map +1 -1
- package/dist/components/rich-text-input/rich-text-input.stories.d.ts.map +1 -1
- package/dist/components/rich-text-input/rich-text-toolbar/rich-text-toolbar.d.ts +2 -1
- package/dist/components/rich-text-input/rich-text-toolbar/rich-text-toolbar.d.ts.map +1 -1
- package/dist/global.css +1 -1
- package/dist/index.js +75 -62
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2566,21 +2566,21 @@ var ko = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Ao =
|
|
|
2566
2566
|
]
|
|
2567
2567
|
}) : null });
|
|
2568
2568
|
}, Ks = {
|
|
2569
|
-
inputInTable: "
|
|
2570
|
-
inputHover: "
|
|
2571
|
-
inputFocus: "
|
|
2572
|
-
controlFocusVisible: "
|
|
2573
|
-
inputError: "
|
|
2574
|
-
inputWarning: "
|
|
2575
|
-
inputDisabled: "
|
|
2576
|
-
hideScrollbars: "
|
|
2577
|
-
wrapper: "
|
|
2578
|
-
bordered: "
|
|
2579
|
-
scroll: "
|
|
2580
|
-
virtualScroll: "
|
|
2581
|
-
table: "
|
|
2582
|
-
dragOverlay: "
|
|
2583
|
-
striped: "
|
|
2569
|
+
inputInTable: "_inputInTable_mq0ls_1",
|
|
2570
|
+
inputHover: "_inputHover_mq0ls_13",
|
|
2571
|
+
inputFocus: "_inputFocus_mq0ls_18",
|
|
2572
|
+
controlFocusVisible: "_controlFocusVisible_mq0ls_25",
|
|
2573
|
+
inputError: "_inputError_mq0ls_29",
|
|
2574
|
+
inputWarning: "_inputWarning_mq0ls_30",
|
|
2575
|
+
inputDisabled: "_inputDisabled_mq0ls_65",
|
|
2576
|
+
hideScrollbars: "_hideScrollbars_mq0ls_71",
|
|
2577
|
+
wrapper: "_wrapper_mq0ls_89",
|
|
2578
|
+
bordered: "_bordered_mq0ls_97",
|
|
2579
|
+
scroll: "_scroll_mq0ls_102",
|
|
2580
|
+
virtualScroll: "_virtualScroll_mq0ls_113",
|
|
2581
|
+
table: "_table_mq0ls_116",
|
|
2582
|
+
dragOverlay: "_dragOverlay_mq0ls_152",
|
|
2583
|
+
striped: "_striped_mq0ls_207"
|
|
2584
2584
|
}, qs = { title: "_title_zn5s7_1" }, Js = ({ name: e = null, actions: t = null, actionsRight: n = !1, testId: r }) => {
|
|
2585
2585
|
let i = e !== null, a = t !== null;
|
|
2586
2586
|
return !i && !a ? null : /* @__PURE__ */ C("div", {
|
|
@@ -6502,48 +6502,55 @@ var ko = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Ao =
|
|
|
6502
6502
|
richTextToolbarContainer: "_richTextToolbarContainer_1gbkk_5"
|
|
6503
6503
|
}, Zd = /* @__PURE__ */ function(e) {
|
|
6504
6504
|
return e.BOLD = "bold", e.ITALIC = "italic", e.CODE = "code", e.UL = "ul", e.OL = "ol", e.MENTION = "at", e;
|
|
6505
|
-
}({}), Qd = ({ editor: e, disabled: t = !1, showMentionButton: n = !1, toolbarComponent: r = null }) => {
|
|
6506
|
-
var
|
|
6507
|
-
let
|
|
6505
|
+
}({}), Qd = ({ editor: e, disabled: t = !1, showMentionButton: n = !1, toolbarComponent: r = null, testId: i }) => {
|
|
6506
|
+
var a, o, s, c, l;
|
|
6507
|
+
let u = [
|
|
6508
6508
|
{
|
|
6509
6509
|
icon: Zd.BOLD,
|
|
6510
6510
|
onClick: () => e == null ? void 0 : e.chain().focus().toggleBold().run(),
|
|
6511
|
-
active: (
|
|
6511
|
+
active: (a = e == null ? void 0 : e.isActive("bold")) != null && a,
|
|
6512
|
+
testId: "bold"
|
|
6512
6513
|
},
|
|
6513
6514
|
{
|
|
6514
6515
|
icon: Zd.ITALIC,
|
|
6515
6516
|
onClick: () => e == null ? void 0 : e.chain().focus().toggleItalic().run(),
|
|
6516
|
-
active: (
|
|
6517
|
+
active: (o = e == null ? void 0 : e.isActive("italic")) != null && o,
|
|
6518
|
+
testId: "italic"
|
|
6517
6519
|
},
|
|
6518
6520
|
{
|
|
6519
6521
|
icon: Zd.CODE,
|
|
6520
6522
|
onClick: () => e == null ? void 0 : e.chain().focus().toggleCode().run(),
|
|
6521
|
-
active: (
|
|
6523
|
+
active: (s = e == null ? void 0 : e.isActive("code")) != null && s,
|
|
6524
|
+
testId: "code"
|
|
6522
6525
|
},
|
|
6523
6526
|
{
|
|
6524
6527
|
icon: Zd.UL,
|
|
6525
6528
|
onClick: () => e == null ? void 0 : e.chain().focus().toggleBulletList().run(),
|
|
6526
|
-
active: (
|
|
6529
|
+
active: (c = e == null ? void 0 : e.isActive("bulletList")) != null && c,
|
|
6530
|
+
testId: "bulletList"
|
|
6527
6531
|
},
|
|
6528
6532
|
{
|
|
6529
6533
|
icon: Zd.OL,
|
|
6530
6534
|
onClick: () => e == null ? void 0 : e.chain().focus().toggleOrderedList().run(),
|
|
6531
|
-
active: (
|
|
6535
|
+
active: (l = e == null ? void 0 : e.isActive("orderedList")) != null && l,
|
|
6536
|
+
testId: "orderedList"
|
|
6532
6537
|
}
|
|
6533
6538
|
];
|
|
6534
6539
|
if (n) {
|
|
6535
|
-
var
|
|
6536
|
-
|
|
6540
|
+
var d;
|
|
6541
|
+
u.push({
|
|
6537
6542
|
icon: Zd.MENTION,
|
|
6538
6543
|
onClick: () => e == null ? void 0 : e.chain().focus().insertContent("@").run(),
|
|
6539
|
-
active: (
|
|
6544
|
+
active: (d = e == null ? void 0 : e.isActive("mention")) != null && d,
|
|
6545
|
+
testId: "mention"
|
|
6540
6546
|
});
|
|
6541
6547
|
}
|
|
6542
6548
|
return /* @__PURE__ */ C("div", {
|
|
6543
6549
|
className: Xd.richTextToolbarContainer,
|
|
6550
|
+
"data-testid": i,
|
|
6544
6551
|
children: [/* @__PURE__ */ S("div", {
|
|
6545
6552
|
className: Xd.richTextToolbar,
|
|
6546
|
-
children:
|
|
6553
|
+
children: u.map((e, n) => /* @__PURE__ */ S(q, {
|
|
6547
6554
|
small: !0,
|
|
6548
6555
|
round: !0,
|
|
6549
6556
|
basic: !0,
|
|
@@ -6551,7 +6558,8 @@ var ko = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Ao =
|
|
|
6551
6558
|
colored: Ti.MUTED,
|
|
6552
6559
|
onClick: e.onClick,
|
|
6553
6560
|
active: e.active,
|
|
6554
|
-
disabled: t
|
|
6561
|
+
disabled: t,
|
|
6562
|
+
testId: i && `${i}-${e.testId}`
|
|
6555
6563
|
}, n))
|
|
6556
6564
|
}), r]
|
|
6557
6565
|
});
|
|
@@ -6701,63 +6709,68 @@ var ko = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Ao =
|
|
|
6701
6709
|
command: t,
|
|
6702
6710
|
items: r,
|
|
6703
6711
|
editable: n.view.dom
|
|
6704
|
-
}), ff = c(o(({ placeholder: e, onChange: t, value: n, disabled: r, toolbarComponent: i, mentions: a },
|
|
6705
|
-
var
|
|
6706
|
-
let
|
|
6712
|
+
}), ff = c(o(({ placeholder: e, onChange: t, value: n, disabled: r, toolbarComponent: i, mentions: a, testId: o }, s) => {
|
|
6713
|
+
var c, l, f, m;
|
|
6714
|
+
let g = u(W), y = r || g, b = !!a, x = _(a), w = _(null), T = _(n == null ? "" : n), [E, D] = v(null);
|
|
6707
6715
|
d(() => {
|
|
6708
|
-
|
|
6716
|
+
x.current = a;
|
|
6709
6717
|
}, [a]);
|
|
6710
|
-
let
|
|
6718
|
+
let O = h(() => [
|
|
6711
6719
|
ci,
|
|
6712
6720
|
li.configure({ placeholder: e }),
|
|
6713
6721
|
ui,
|
|
6714
|
-
cf(() =>
|
|
6715
|
-
onStart: (e) =>
|
|
6716
|
-
onUpdate: (e) =>
|
|
6717
|
-
onExit: () =>
|
|
6722
|
+
cf(() => x.current, () => ({
|
|
6723
|
+
onStart: (e) => D(df(e)),
|
|
6724
|
+
onUpdate: (e) => D(df(e)),
|
|
6725
|
+
onExit: () => D(null),
|
|
6718
6726
|
onKeyDown: ({ event: e }) => {
|
|
6719
6727
|
var t, n;
|
|
6720
|
-
return (t = (n =
|
|
6728
|
+
return (t = (n = w.current) == null ? void 0 : n.onKeyDown(e)) != null && t;
|
|
6721
6729
|
}
|
|
6722
6730
|
}))
|
|
6723
|
-
], []),
|
|
6724
|
-
extensions:
|
|
6725
|
-
content:
|
|
6731
|
+
], []), k = si({
|
|
6732
|
+
extensions: O,
|
|
6733
|
+
content: T.current,
|
|
6726
6734
|
contentType: "markdown",
|
|
6727
|
-
editable: !
|
|
6735
|
+
editable: !y,
|
|
6728
6736
|
editorProps: { attributes: { class: lf.editable } },
|
|
6729
6737
|
onUpdate: ({ editor: e }) => {
|
|
6730
6738
|
t == null || t(e.getMarkdown(), { mentionedIds: of(e) });
|
|
6731
6739
|
}
|
|
6732
6740
|
});
|
|
6733
6741
|
return d(() => {
|
|
6734
|
-
|
|
6742
|
+
k && n !== void 0 && n !== k.getMarkdown() && k.commands.setContent(n, {
|
|
6735
6743
|
emitUpdate: !1,
|
|
6736
6744
|
contentType: "markdown"
|
|
6737
6745
|
});
|
|
6738
|
-
}, [n,
|
|
6739
|
-
|
|
6740
|
-
}, [
|
|
6741
|
-
clearContent: () =>
|
|
6742
|
-
editor:
|
|
6743
|
-
getMentionedIds: () => of(
|
|
6744
|
-
}), [
|
|
6746
|
+
}, [n, k]), d(() => {
|
|
6747
|
+
k && k.setEditable(!y);
|
|
6748
|
+
}, [y, k]), p(s, () => ({
|
|
6749
|
+
clearContent: () => k == null ? void 0 : k.commands.clearContent(!1),
|
|
6750
|
+
editor: k,
|
|
6751
|
+
getMentionedIds: () => of(k)
|
|
6752
|
+
}), [k]), /* @__PURE__ */ C("div", {
|
|
6745
6753
|
className: lf.richTextInput,
|
|
6754
|
+
"data-testid": o,
|
|
6746
6755
|
children: [
|
|
6747
6756
|
/* @__PURE__ */ S(Qd, {
|
|
6748
|
-
editor:
|
|
6749
|
-
disabled:
|
|
6750
|
-
showMentionButton:
|
|
6751
|
-
toolbarComponent: i
|
|
6757
|
+
editor: k,
|
|
6758
|
+
disabled: y,
|
|
6759
|
+
showMentionButton: b && ((c = a == null ? void 0 : a.showMentionButton) == null || c),
|
|
6760
|
+
toolbarComponent: i,
|
|
6761
|
+
testId: o && `${o}-toolbar`
|
|
6762
|
+
}),
|
|
6763
|
+
/* @__PURE__ */ S(oi, {
|
|
6764
|
+
editor: k,
|
|
6765
|
+
"data-testid": o && `${o}-editor`
|
|
6752
6766
|
}),
|
|
6753
|
-
/* @__PURE__ */ S(
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
onSelect: (e) => T == null ? void 0 : T.command(e)
|
|
6767
|
+
b && /* @__PURE__ */ S(Xi, { children: /* @__PURE__ */ S(uf, {
|
|
6768
|
+
ref: w,
|
|
6769
|
+
editable: (l = E == null ? void 0 : E.editable) == null ? null : l,
|
|
6770
|
+
getRect: (f = E == null ? void 0 : E.clientRect) == null ? null : f,
|
|
6771
|
+
items: (m = E == null ? void 0 : E.items) == null ? [] : m,
|
|
6772
|
+
onDismiss: () => D(null),
|
|
6773
|
+
onSelect: (e) => E == null ? void 0 : E.command(e)
|
|
6761
6774
|
}) })
|
|
6762
6775
|
]
|
|
6763
6776
|
});
|
package/package.json
CHANGED