@baishuyun/ui-base 2.2.3 → 2.2.5

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.
Files changed (35) hide show
  1. package/dist/Card/Card-Y1ISqAp9.js +86 -0
  2. package/dist/Card/index.js +1 -1
  3. package/dist/CheckBox/{CheckBox-VlP6u_-s.js → CheckBox-C9sXWSA5.js} +1 -1
  4. package/dist/CheckBox/index.js +1 -1
  5. package/dist/ColorPicker/{ColorPicker-049kyJn6.js → ColorPicker-DNIXPakN.js} +70 -64
  6. package/dist/ColorPicker/index.js +1 -1
  7. package/dist/DropDown/{DropDown-BkTY-3y0.js → DropDown-DGkSeXQT.js} +1 -1
  8. package/dist/DropDown/index.js +1 -1
  9. package/dist/Editor/ToolbarPlugin/Buttons/index.js +6 -2
  10. package/dist/Editor/{index-C0MY9j94.js → index-CCq3AgcW.js} +426 -412
  11. package/dist/Editor/index.js +115 -108
  12. package/dist/Icon/Icon-CBlIwtp2.js +24 -0
  13. package/dist/Icon/index.js +1 -1
  14. package/dist/InputTag/{InputTag-S9hHXsyQ.js → InputTag-C6MbuO-e.js} +1 -1
  15. package/dist/InputTag/index.js +1 -1
  16. package/dist/Modal/{Modal-oRJ-Almn.js → Modal-z3TvEXwN.js} +1 -1
  17. package/dist/Modal/index.js +1 -1
  18. package/dist/Select/{Select-BiARGTPz.js → Select-hwXXDuLU.js} +3 -3
  19. package/dist/Select/{SelectInputSearch-DigfTvpo.js → SelectInputSearch-ChUpUgxa.js} +1 -1
  20. package/dist/Select/index.js +1 -1
  21. package/dist/Tabs/{TabSelect-bKB0Qe9F.js → TabSelect-DL8Bhehc.js} +1 -1
  22. package/dist/Tabs/index.js +1 -1
  23. package/dist/Tree/index.js +1 -1
  24. package/dist/components/Card/Card.type.d.ts +9 -1
  25. package/dist/components/ColorPicker/ColorPicker.type.d.ts +11 -0
  26. package/dist/components/Editor/ToolbarPlugin/Buttons/index.d.ts +6 -3
  27. package/dist/components/Editor/ToolbarPlugin/Buttons/registry.d.ts +6 -0
  28. package/dist/components/Editor/ToolbarPlugin/interface.d.ts +4 -3
  29. package/dist/components/Editor/index.d.ts +5 -0
  30. package/dist/index.js +9 -9
  31. package/dist/vendors/{Tree-CjrhMBFX.js → Tree-CLEy-xqz.js} +2 -2
  32. package/dist/vendors/{lexical-DdSmj_Kv.js → lexical-DO7eMeC2.js} +7 -7
  33. package/package.json +2 -2
  34. package/dist/Card/Card-DHOMkrEE.js +0 -74
  35. package/dist/Icon/Icon-CkHAU1fA.js +0 -24
@@ -0,0 +1,86 @@
1
+ import { jsxs as y, jsx as r } from "react/jsx-runtime";
2
+ import { useState as N, useCallback as b, useMemo as h } from "react";
3
+ import { c as i } from "../vendors/clsx-OuTLNxxd.js";
4
+ import { I as k } from "../Icon/Icon-CBlIwtp2.js";
5
+ const a = {
6
+ "bsy-card": "_bsy-card_myftj_1",
7
+ "bsy-card__header": "_bsy-card__header_myftj_6",
8
+ "bsy-card__title": "_bsy-card__title_myftj_13",
9
+ "bsy-card__icon-container": "_bsy-card__icon-container_myftj_24",
10
+ "bsy-card__icon": "_bsy-card__icon_myftj_24",
11
+ "bsy-card__icon--expanded": "_bsy-card__icon--expanded_myftj_43",
12
+ "bsy-card__content": "_bsy-card__content_myftj_46",
13
+ "bsy-card__content--expanded": "_bsy-card__content--expanded_myftj_52",
14
+ "bsy-card__content-inner": "_bsy-card__content-inner_myftj_55"
15
+ }, I = ({
16
+ title: l,
17
+ children: m,
18
+ minWidth: s = 240,
19
+ defaultExpanded: f = !1,
20
+ expanded: d,
21
+ onExpandedChange: n,
22
+ className: p,
23
+ style: o,
24
+ styles: c
25
+ }) => {
26
+ const [x, j] = N(f), e = d ?? x, t = b(() => {
27
+ const _ = !e;
28
+ d === void 0 && j(_), n == null || n(_);
29
+ }, [e, d, n]), u = b(
30
+ (_) => {
31
+ (_.key === "Enter" || _.key === " ") && (_.preventDefault(), t());
32
+ },
33
+ [t]
34
+ ), v = h(
35
+ () => ({
36
+ minWidth: `${s}px`,
37
+ ...o
38
+ }),
39
+ [s, o]
40
+ );
41
+ return /* @__PURE__ */ y("div", { className: i(a["bsy-card"], p), style: v, children: [
42
+ /* @__PURE__ */ y(
43
+ "div",
44
+ {
45
+ className: a["bsy-card__header"],
46
+ onClick: t,
47
+ onKeyDown: u,
48
+ role: "button",
49
+ tabIndex: 0,
50
+ "aria-expanded": e,
51
+ "aria-controls": "card-content",
52
+ style: c == null ? void 0 : c.header,
53
+ children: [
54
+ /* @__PURE__ */ r("div", { className: a["bsy-card__title"], id: "card-title", role: "heading", children: l }),
55
+ /* @__PURE__ */ r("div", { className: a["bsy-card__icon-container"], children: /* @__PURE__ */ r(
56
+ k,
57
+ {
58
+ name: "xialakuangxiala1",
59
+ className: i(
60
+ a["bsy-card__icon"],
61
+ e && a["bsy-card__icon--expanded"]
62
+ )
63
+ }
64
+ ) })
65
+ ]
66
+ }
67
+ ),
68
+ /* @__PURE__ */ r(
69
+ "div",
70
+ {
71
+ id: "card-content",
72
+ role: "region",
73
+ "aria-labelledby": "card-title",
74
+ className: i(
75
+ a["bsy-card__content"],
76
+ e && a["bsy-card__content--expanded"]
77
+ ),
78
+ children: /* @__PURE__ */ r("div", { className: a["bsy-card__content-inner"], style: c == null ? void 0 : c.body, children: m })
79
+ }
80
+ )
81
+ ] });
82
+ };
83
+ I.displayName = "BsyCard";
84
+ export {
85
+ I as C
86
+ };
@@ -1,4 +1,4 @@
1
- import { C as f } from "./Card-DHOMkrEE.js";
1
+ import { C as f } from "./Card-Y1ISqAp9.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import { jsxs as m, jsx as l } from "react/jsx-runtime";
2
2
  import { createContext as B, forwardRef as E, useContext as R } from "react";
3
- import { I as j } from "../Icon/Icon-CkHAU1fA.js";
3
+ import { I as j } from "../Icon/Icon-CBlIwtp2.js";
4
4
  import { c as i } from "../vendors/clsx-OuTLNxxd.js";
5
5
  import { u as O } from "../vendors/lodash-es-DFpaJB4Y.js";
6
6
  const P = B(null), V = "_checkbox_vheru_1", q = "_checkbox__inner_vheru_32", o = {
@@ -1,4 +1,4 @@
1
- import { L as o, C as c, B as n } from "./CheckBox-VlP6u_-s.js";
1
+ import { L as o, C as c, B as n } from "./CheckBox-C9sXWSA5.js";
2
2
  import { jsx as r } from "react/jsx-runtime";
3
3
  import { useControllableValue as f } from "ahooks";
4
4
  import { c as C } from "../vendors/clsx-OuTLNxxd.js";
@@ -1,17 +1,17 @@
1
- import { jsx as r, jsxs as _, Fragment as O } from "react/jsx-runtime";
2
- import { ColorPicker as w } from "antd";
3
- import { AnimatePresence as R, motion as A } from "motion/react";
4
- import { useFloating as F, offset as I, flip as x, shift as L, useClick as E, useDismiss as T, useInteractions as V, FloatingPortal as j } from "@floating-ui/react";
5
- import { useState as k, isValidElement as B, cloneElement as D, useRef as G } from "react";
6
- import { useControllableValue as M } from "ahooks";
7
- import { I as d } from "../Icon/Icon-CkHAU1fA.js";
8
- import { u as g } from "../vendors/useLocale-DgqW9M3h.js";
9
- import { c as $ } from "../vendors/clsx-OuTLNxxd.js";
10
- import { a as u } from "../vendors/color-VzwvCPhF.js";
11
- import { t as q } from "../vendors/tinycolor2-Begv3Jc8.js";
12
- import { P as z } from "../vendors/index-MTmG1Ezy.js";
13
- import { c as H } from "../vendors/lodash-es-DFpaJB4Y.js";
14
- const J = [
1
+ import { jsx as r, jsxs as m, Fragment as R } from "react/jsx-runtime";
2
+ import { ColorPicker as A } from "antd";
3
+ import { AnimatePresence as F, motion as I } from "motion/react";
4
+ import { useFloating as x, offset as L, flip as E, shift as T, useClick as V, useDismiss as j, useInteractions as B, FloatingPortal as M } from "@floating-ui/react";
5
+ import { useState as k, isValidElement as D, cloneElement as G, useRef as $, useMemo as q } from "react";
6
+ import { useControllableValue as z } from "ahooks";
7
+ import { I as g } from "../Icon/Icon-CBlIwtp2.js";
8
+ import { u } from "../vendors/useLocale-DgqW9M3h.js";
9
+ import { c as H } from "../vendors/clsx-OuTLNxxd.js";
10
+ import { a as y } from "../vendors/color-VzwvCPhF.js";
11
+ import { t as J } from "../vendors/tinycolor2-Begv3Jc8.js";
12
+ import { P as K } from "../vendors/index-MTmG1Ezy.js";
13
+ import { c as Q } from "../vendors/lodash-es-DFpaJB4Y.js";
14
+ const U = [
15
15
  "rgba(240, 102, 72, 1)",
16
16
  // #F06648
17
17
  "rgba(255, 197, 2, 1)",
@@ -48,26 +48,26 @@ const J = [
48
48
  // #e0e0e0
49
49
  "rgba(77, 96, 159, 1)"
50
50
  // #4d609f
51
- ], K = (s = "bottom-start") => {
52
- const [t, o] = k(!1), { refs: i, floatingStyles: e, context: a } = F({
51
+ ], W = (s = "bottom-start") => {
52
+ const [t, o] = k(!1), { refs: n, floatingStyles: e, context: i } = x({
53
53
  open: t,
54
54
  onOpenChange: o,
55
55
  placement: s,
56
56
  middleware: [
57
- I(4),
57
+ L(4),
58
58
  // 浮层与触发器间距
59
- x(),
59
+ E(),
60
60
  // 超出边界时自动翻转
61
- L({ padding: 8 })
61
+ T({ padding: 8 })
62
62
  // 自动避开边界
63
63
  ]
64
- }), n = E(a), l = T(a), { getReferenceProps: p, getFloatingProps: m } = V([n, l]);
64
+ }), a = V(i), l = j(i), { getReferenceProps: p, getFloatingProps: _ } = B([a, l]);
65
65
  return {
66
66
  isOpen: t,
67
- refs: i,
67
+ refs: n,
68
68
  floatingStyles: e,
69
69
  getReferenceProps: p,
70
- getFloatingProps: m,
70
+ getFloatingProps: _,
71
71
  setIsOpen: o
72
72
  };
73
73
  }, c = {
@@ -83,84 +83,90 @@ const J = [
83
83
  "bsy-color-picker__custom-color-btn--preview": "_bsy-color-picker__custom-color-btn--preview_1kfi6_65",
84
84
  "bsy-color-picker__custom-color-content": "_bsy-color-picker__custom-color-content_1kfi6_68",
85
85
  "bsy-color-picker__check-icon": "_bsy-color-picker__check-icon_1kfi6_72"
86
- }, y = ({
86
+ }, f = ({
87
87
  currentColor: s,
88
88
  onColorSelect: t,
89
89
  options: o,
90
- style: i
91
- }) => /* @__PURE__ */ r("div", { className: c["bsy-color-picker__preset-colors-grid"], style: i, children: o.map((e) => /* @__PURE__ */ r(
90
+ style: n
91
+ }) => /* @__PURE__ */ r("div", { className: c["bsy-color-picker__preset-colors-grid"], style: n, children: o.map((e) => /* @__PURE__ */ r(
92
92
  "div",
93
93
  {
94
94
  className: c["bsy-color-picker__preset-colors-item"],
95
95
  style: {
96
96
  backgroundColor: e,
97
- "--hover-color": q(e).setAlpha(0.5).toRgbString()
97
+ "--hover-color": J(e).setAlpha(0.5).toRgbString()
98
98
  },
99
99
  onClick: () => t(e),
100
- children: u(s, e) && /* @__PURE__ */ r(d, { name: "checkthebox", className: c["bsy-color-picker__check-icon"] })
100
+ children: y(s, e) && /* @__PURE__ */ r(g, { name: "checkthebox", className: c["bsy-color-picker__check-icon"] })
101
101
  },
102
102
  e
103
- )) }), Q = (s) => {
104
- const { children: t, placement: o = "bottom-start", disabled: i = !1, presetColors: e } = s, { t: a } = g(), [n, l] = M(s, {
103
+ )) }), X = (s) => {
104
+ const {
105
+ children: t,
106
+ placement: o = "bottom-start",
107
+ disabled: n = !1,
108
+ presetColors: e,
109
+ getPopupContainer: i
110
+ } = s, { t: a } = u(), [l, p] = z(s, {
105
111
  defaultValue: s.value
106
- }), { isOpen: p, refs: m, floatingStyles: f, getReferenceProps: C, getFloatingProps: h } = K(o), v = B(t) ? D(t, {
107
- ...C(),
112
+ }), { isOpen: _, refs: d, floatingStyles: C, getReferenceProps: h, getFloatingProps: v } = W(o), P = D(t) ? G(t, {
113
+ ...h(),
108
114
  // @ts-ignore
109
- ref: m.setReference,
110
- disabled: i
111
- }) : t, b = H(e) && e.length ? e : J, P = b.some((S) => u(S, n)), N = G(P ? [] : [n]);
112
- return /* @__PURE__ */ _(O, { children: [
113
- v,
114
- /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(R, { children: p && /* @__PURE__ */ r(
115
+ ref: d.setReference,
116
+ disabled: n
117
+ }) : t, b = Q(e) && e.length ? e : U, N = b.some((w) => y(w, l)), S = $(N ? [] : [l]), O = q(() => _ ? i == null ? void 0 : i() : void 0, [_, i]);
118
+ return /* @__PURE__ */ m(R, { children: [
119
+ P,
120
+ /* @__PURE__ */ r(M, { root: O, children: /* @__PURE__ */ r(F, { children: _ && /* @__PURE__ */ r(
115
121
  "div",
116
122
  {
117
- ref: m.setFloating,
118
- style: f,
119
- ...h(),
123
+ ref: d.setFloating,
124
+ style: C,
125
+ ...v(),
120
126
  className: c["bsy-color-picker__floating"],
121
- children: /* @__PURE__ */ r(A.div, { ...z, children: /* @__PURE__ */ r("div", { className: c["bsy-color-picker__content"], children: /* @__PURE__ */ _("div", { className: c["bsy-color-picker__grid"], children: [
122
- /* @__PURE__ */ _("div", { className: c["bsy-color-picker__preset-colors"], children: [
127
+ children: /* @__PURE__ */ r(I.div, { ...K, children: /* @__PURE__ */ r("div", { className: c["bsy-color-picker__content"], children: /* @__PURE__ */ m("div", { className: c["bsy-color-picker__grid"], children: [
128
+ /* @__PURE__ */ m("div", { className: c["bsy-color-picker__preset-colors"], children: [
123
129
  /* @__PURE__ */ r("div", { className: c["bsy-color-picker__preset-colors-title"], children: a("presetColors") }),
124
130
  /* @__PURE__ */ r(
125
- y,
131
+ f,
126
132
  {
127
- currentColor: n,
128
- onColorSelect: l,
133
+ currentColor: l,
134
+ onColorSelect: p,
129
135
  options: b
130
136
  }
131
137
  )
132
138
  ] }),
133
139
  /* @__PURE__ */ r(
134
- U,
140
+ Y,
135
141
  {
136
- value: n,
137
- onChange: l,
142
+ value: l,
143
+ onChange: p,
138
144
  options: b,
139
- list: N.current
145
+ list: S.current
140
146
  }
141
147
  )
142
148
  ] }) }) })
143
149
  }
144
150
  ) }) })
145
151
  ] });
146
- }, U = (s) => {
147
- const { list: t } = s, [o, i] = k(), [e, a] = k(!1), { t: n } = g();
148
- return /* @__PURE__ */ _("div", { className: c["bsy-color-picker__custom-color"], children: [
149
- /* @__PURE__ */ r("div", { className: c["bsy-color-picker__custom-color-title"], children: n("customColor") }),
150
- /* @__PURE__ */ _("div", { className: c["bsy-color-picker__custom-color-content"], children: [
152
+ }, Y = (s) => {
153
+ const { list: t } = s, [o, n] = k(), [e, i] = k(!1), { t: a } = u();
154
+ return /* @__PURE__ */ m("div", { className: c["bsy-color-picker__custom-color"], children: [
155
+ /* @__PURE__ */ r("div", { className: c["bsy-color-picker__custom-color-title"], children: a("customColor") }),
156
+ /* @__PURE__ */ m("div", { className: c["bsy-color-picker__custom-color-content"], children: [
151
157
  /* @__PURE__ */ r(
152
- w,
158
+ A,
153
159
  {
154
160
  value: o,
155
- onChange: (l) => i(l.toRgbString()),
161
+ onChange: (l) => n(l.toRgbString()),
156
162
  open: e,
157
163
  onOpenChange: (l) => {
158
- a(l), !l && o && (t.includes(o) || t.unshift(o), s.onChange(o), i(void 0));
164
+ i(l), !l && o && (t.includes(o) || t.unshift(o), s.onChange(o), n(void 0));
159
165
  },
160
166
  children: /* @__PURE__ */ r(
161
167
  "div",
162
168
  {
163
- className: $(c["bsy-color-picker__custom-color-btn"], {
169
+ className: H(c["bsy-color-picker__custom-color-btn"], {
164
170
  [c["bsy-color-picker__custom-color-btn--active"]]: e && !o,
165
171
  [c["bsy-color-picker__custom-color-btn--preview"]]: !!o
166
172
  }),
@@ -169,10 +175,10 @@ const J = [
169
175
  backgroundColor: o || void 0
170
176
  },
171
177
  onClick: () => {
172
- a(!0);
178
+ i(!0);
173
179
  },
174
180
  children: /* @__PURE__ */ r(
175
- d,
181
+ g,
176
182
  {
177
183
  name: "add",
178
184
  style: {
@@ -185,7 +191,7 @@ const J = [
185
191
  }
186
192
  ),
187
193
  /* @__PURE__ */ r(
188
- y,
194
+ f,
189
195
  {
190
196
  currentColor: s.value,
191
197
  onColorSelect: s.onChange,
@@ -198,8 +204,8 @@ const J = [
198
204
  ] })
199
205
  ] });
200
206
  };
201
- Q.displayName = "BsyColorPicker";
207
+ X.displayName = "BsyColorPicker";
202
208
  export {
203
- Q as C,
204
- J as a
209
+ X as C,
210
+ U as a
205
211
  };
@@ -1,4 +1,4 @@
1
- import { a as e, C as f } from "./ColorPicker-049kyJn6.js";
1
+ import { a as e, C as f } from "./ColorPicker-DNIXPakN.js";
2
2
  export {
3
3
  e as COLOR_OPTIONS_RGBA,
4
4
  f as default
@@ -7,7 +7,7 @@ import { u as Z } from "../vendors/useFloatingPortal-9VUFOAOG.js";
7
7
  import { F as $ } from "../vendors/fuse.js-D1DCbUBb.js";
8
8
  import { a as S, b as D } from "../vendors/lodash-es-DFpaJB4Y.js";
9
9
  import { P as ee } from "../vendors/index-MTmG1Ezy.js";
10
- import { S as ne } from "../Select/SelectInputSearch-DigfTvpo.js";
10
+ import { S as ne } from "../Select/SelectInputSearch-ChUpUgxa.js";
11
11
  import { c as h } from "../vendors/clsx-OuTLNxxd.js";
12
12
  import { N as C } from "../NotFoundContent/NotFoundContent-h0-oIXlk.js";
13
13
  import { u as z } from "../vendors/useLocale-DgqW9M3h.js";
@@ -1,4 +1,4 @@
1
- import { D as f } from "./DropDown-BkTY-3y0.js";
1
+ import { D as f } from "./DropDown-DGkSeXQT.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,8 @@
1
- import { B as f } from "../../index-C0MY9j94.js";
1
+ import { b as r, g as a, l as e, r as s, u as l } from "../../index-CCq3AgcW.js";
2
2
  export {
3
- f as default
3
+ r as default,
4
+ a as getToolbarButton,
5
+ e as listRegisteredToolbarButtons,
6
+ s as registerToolbarButton,
7
+ l as unregisterToolbarButton
4
8
  };