aristid-ds 13.0.0-4e097fb → 13.0.0-d7aba6b

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 (82) hide show
  1. package/CHANGELOG.md +31 -4
  2. package/dist/Kit/Ant/index.d.ts +1 -0
  3. package/dist/Kit/App/index.js +14 -14
  4. package/dist/Kit/DataDisplay/Collapse/index.js +1 -1
  5. package/dist/Kit/DataDisplay/RedirectCard/index.js +1 -1
  6. package/dist/Kit/DataDisplay/Table/index.js +1 -1
  7. package/dist/Kit/DataDisplay/Tag/index.js +1 -1
  8. package/dist/Kit/DataDisplay/Tree/index.js +5 -5
  9. package/dist/Kit/DataEntry/ColorPicker/index.js +1 -1
  10. package/dist/Kit/DataEntry/DatePicker/index.js +1 -1
  11. package/dist/Kit/DataEntry/Input/index.js +1 -1
  12. package/dist/Kit/DataEntry/Radio/index.js +1 -1
  13. package/dist/Kit/DataEntry/RichText/EditorContentCharacterCount/index.js +1 -1
  14. package/dist/Kit/DataEntry/RichText/MenuBar/ButtonTooltip/index.js +4 -4
  15. package/dist/Kit/DataEntry/RichText/MenuBar/ButtonTooltip/types.d.ts +1 -0
  16. package/dist/Kit/DataEntry/RichText/MenuBar/FontSizeSelect/index.js +1 -1
  17. package/dist/Kit/DataEntry/RichText/MenuBar/LinkButton/index.js +1 -1
  18. package/dist/Kit/DataEntry/RichText/MenuBar/MenuActionList/index.d.ts +3 -0
  19. package/dist/Kit/DataEntry/RichText/MenuBar/MenuActionList/index.js +11 -0
  20. package/dist/Kit/DataEntry/RichText/MenuBar/MenuActionList/types.d.ts +5 -0
  21. package/dist/Kit/DataEntry/RichText/MenuBar/index.js +38 -18
  22. package/dist/Kit/DataEntry/RichText/MenuBar/miniLayout.d.ts +3 -0
  23. package/dist/Kit/DataEntry/RichText/MenuBar/types.d.ts +7 -0
  24. package/dist/Kit/DataEntry/RichText/index.js +52 -47
  25. package/dist/Kit/DataEntry/RichText/types.d.ts +1 -0
  26. package/dist/Kit/DataEntry/Select/index.js +1 -1
  27. package/dist/Kit/DataEntry/Upload/UploadedItem.d.ts +4 -0
  28. package/dist/Kit/DataEntry/Upload/convertBytes.d.ts +2 -0
  29. package/dist/Kit/DataEntry/Upload/getBase64.d.ts +2 -0
  30. package/dist/Kit/DataEntry/Upload/index.d.ts +2 -8
  31. package/dist/Kit/DataEntry/Upload/index.js +81 -26
  32. package/dist/Kit/DataEntry/Upload/types.d.ts +30 -12
  33. package/dist/Kit/Feedback/Alert/index.js +1 -1
  34. package/dist/Kit/Feedback/Modal/index.js +1 -1
  35. package/dist/Kit/Feedback/SnackBar/index.js +16 -16
  36. package/dist/Kit/General/Button/index.js +1 -1
  37. package/dist/Kit/Layout/PageLayout/index.js +1 -1
  38. package/dist/Kit/Navigation/Header/index.js +1 -1
  39. package/dist/Kit/Navigation/SideMenu/index.js +1 -1
  40. package/dist/Kit/Navigation/SidePanel/index.js +46 -43
  41. package/dist/assets/index22.css +1 -1
  42. package/dist/assets/index23.css +1 -1
  43. package/dist/assets/index24.css +1 -1
  44. package/dist/assets/index25.css +1 -1
  45. package/dist/assets/index26.css +1 -1
  46. package/dist/assets/index27.css +1 -1
  47. package/dist/assets/index31.css +1 -1
  48. package/dist/assets/index32.css +1 -1
  49. package/dist/assets/index33.css +1 -1
  50. package/dist/assets/index34.css +1 -1
  51. package/dist/assets/index35.css +1 -1
  52. package/dist/assets/index36.css +1 -1
  53. package/dist/assets/index37.css +1 -1
  54. package/dist/assets/index38.css +1 -1
  55. package/dist/assets/index39.css +1 -1
  56. package/dist/assets/index40.css +1 -1
  57. package/dist/assets/index41.css +1 -1
  58. package/dist/assets/index42.css +1 -1
  59. package/dist/assets/index43.css +1 -1
  60. package/dist/assets/index44.css +1 -1
  61. package/dist/assets/index45.css +1 -1
  62. package/dist/assets/index46.css +1 -1
  63. package/dist/assets/index6.css +1 -1
  64. package/dist/assets/index9.css +1 -1
  65. package/dist/chunks/{SnackBarProvider.nqDzpFo3.js → SnackBarProvider.T-xLQpTN.js} +10 -10
  66. package/dist/index.umd.js +4 -4
  67. package/dist/theme/types/index.d.ts +0 -2
  68. package/dist/translation/en-US/components/DataEntry/RichText/index.js +2 -1
  69. package/dist/translation/en-US/components/DataEntry/Upload/index.d.ts +2 -0
  70. package/dist/translation/en-US/components/DataEntry/Upload/index.js +11 -0
  71. package/dist/translation/en-US/index.js +6 -4
  72. package/dist/translation/fr-FR/components/DataEntry/RichText/index.js +2 -1
  73. package/dist/translation/fr-FR/components/DataEntry/Upload/index.d.ts +2 -0
  74. package/dist/translation/fr-FR/components/DataEntry/Upload/index.js +11 -0
  75. package/dist/translation/fr-FR/index.js +8 -6
  76. package/dist/translation/types/components/DataEntry/RichText/index.d.ts +1 -0
  77. package/dist/translation/types/components/DataEntry/Upload/index.d.ts +8 -0
  78. package/dist/translation/types/index.d.ts +2 -0
  79. package/package.json +1 -1
  80. package/dist/theme/aristid/components/DataEntry/Upload/index.d.ts +0 -3
  81. package/dist/theme/aristid/components/DataEntry/Upload/index.js +0 -55
  82. package/dist/theme/types/components/DataEntry/Upload/index.d.ts +0 -178
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## [X.X.X](https://www.npmjs.com/package/aristid-ds/v/X.X.X) (2025-XX-XX)
4
+
5
+ ### ✨ Features
6
+
7
+ - **⚠️ Breaking change - Upload**:
8
+ - Remove the following properties: (@philippechevieux)
9
+ - `listType`
10
+ - `itemRender`
11
+ - `openFileDialogOnClick`
12
+ - `loading`
13
+ - `isImageUrl`
14
+ - `imageUrl`
15
+ - `progress`
16
+ - `previewFile`
17
+ - `showUploadList`
18
+ - Update component render (@philippechevieux)
19
+ - **RichText**:
20
+ - Add `mini` property to display a minified version of the component (@renaudamsellem)
21
+ - **SidePanel**:
22
+ - Add opening and closing animations (@philippechevieux)
23
+
24
+ ### 📚 Documentation
25
+
26
+ - **Tree**:
27
+ - Add exemple of a long title with ellipsis (@philippechevieux)
28
+
3
29
  ## [13.0.0](https://www.npmjs.com/package/aristid-ds/v/13.0.0) (2025-02-17)
4
30
 
5
31
  ### ✨ CI
@@ -60,10 +86,6 @@ The following points are the impact of this version upgrade:
60
86
 
61
87
  ### ✨ Features
62
88
 
63
- - **Snackbar**:
64
- - Add `snackbarId` property to allow to update a snackbar (@evoiron)
65
- - **Button**:
66
- - Add `action` type button (@evoiron)
67
89
  - **⚠️ Breaking change - Tree**:
68
90
  - Remove `showLine` and `switcherIcon` properties (@philippechevieux)
69
91
  - Update component render (@philippechevieux)
@@ -72,12 +94,17 @@ The following points are the impact of this version upgrade:
72
94
  - Complete rewriting of the `Progress` component without Ant (@philippechevieux)
73
95
  - Remove all Ant props (@philippechevieux)
74
96
  - `circle` and `dashboard` type are no longer available (@philippechevieux)
97
+ - **Snackbar**:
98
+ - Add `snackbarId` property to allow to update a snackbar (@evoiron)
99
+ - **Button**:
100
+ - Add `action` type button (@evoiron)
75
101
  - **Tabs**:
76
102
  - Add controlled state to handle navigation within tabs (@renaudamsellem)
77
103
  - **SidePanel**:
78
104
  - Add `headerExtra` prop to display extra content above header title (@philippechevieux)
79
105
 
80
106
  ### 🐛 Bug Fixes
107
+
81
108
  - **SidePanel**
82
109
  - Fix `closeOnOutsideClick` behavior to listen to `click` event instead on `mousedeown` (@evoiron)
83
110
  - **ColorPicker**
@@ -66,3 +66,4 @@ export { TreeSelect as AntTreeSelect } from 'antd';
66
66
  export { Typography as AntTypography } from 'antd';
67
67
  export { Upload as AntUpload } from 'antd';
68
68
  export { Watermark as AntWatermark } from 'antd';
69
+ export type { UploadFile } from 'antd/lib';
@@ -2,20 +2,20 @@ import "../../assets/index28.css";
2
2
  import { jsx as n, jsxs as f, Fragment as h } from "react/jsx-runtime";
3
3
  import { useState as u, useLayoutEffect as L, useRef as S, useEffect as P } from "react";
4
4
  import { ConfigProvider as C } from "antd";
5
- import { I as b } from "../../chunks/SnackBarProvider.nqDzpFo3.js";
5
+ import { K as b } from "../../chunks/SnackBarProvider.T-xLQpTN.js";
6
6
  import { toCssVariables as g, uuid as y } from "../../utils/functions/index.js";
7
7
  import a from "lodash/merge";
8
8
  import { Style as m } from "react-style-tag";
9
9
  import { K as E } from "../../chunks/useKitTheme.KSAU-Pdv.js";
10
10
  import { KitAristidThemeGeneral as l } from "../../theme/aristid/general/index.js";
11
- import { antdThemeConfig as I } from "../../theme/utils/tokens-mapper/index.js";
11
+ import { antdThemeConfig as T } from "../../theme/utils/tokens-mapper/index.js";
12
12
  import { frFR as d } from "../../translation/fr-FR/index.js";
13
- import { enUS as T } from "../../translation/en-US/index.js";
14
- import { K as $, u as j } from "../../chunks/useKitLocale.96CdK3og.js";
15
- import { mapKitLocaleToAntdLocale as k } from "../../translation/utils/index.js";
16
- import { d as x } from "../../chunks/notification-provider.9msrEKBe.js";
13
+ import { enUS as $ } from "../../translation/en-US/index.js";
14
+ import { K as j, u as k } from "../../chunks/useKitLocale.96CdK3og.js";
15
+ import { mapKitLocaleToAntdLocale as x } from "../../translation/utils/index.js";
16
+ import { d as A } from "../../chunks/notification-provider.9msrEKBe.js";
17
17
  import { KitEmpty as p } from "../DataDisplay/Empty/index.js";
18
- const A = "aristid-ds-global", F = (t, e) => {
18
+ const F = "aristid-ds-global", I = (t, e) => {
19
19
  const o = g(t);
20
20
  return `
21
21
  .${e} {
@@ -27,11 +27,11 @@ const A = "aristid-ds-global", F = (t, e) => {
27
27
  return L(() => {
28
28
  const s = g(l, "--general");
29
29
  i(s);
30
- }, []), n(E.Provider, { value: { theme: v, appId: c, spacing: K }, children: r !== null && f(h, { children: [n(m, { id: A, hasSourceMap: !1, children: `
30
+ }, []), n(E.Provider, { value: { theme: v, appId: c, spacing: K }, children: r !== null && f(h, { children: [n(m, { id: F, hasSourceMap: !1, children: `
31
31
  :root {
32
32
  ${Object.keys(r).map((s) => `${s}: ${r[s]}`).join(";")}
33
33
  }
34
- ` }), e && n(m, { hasSourceMap: !1, children: F(a({ general: { utilities: l.utilities } }, e), c) }), t] }) });
34
+ ` }), e && n(m, { hasSourceMap: !1, children: I(a({ general: { utilities: l.utilities } }, e), c) }), t] }) });
35
35
  }, _ = (t, e) => {
36
36
  var o;
37
37
  const r = S(t || "ds-" + y().substring(0, 8)), i = a(l.spacing, (o = e == null ? void 0 : e.general) === null || o === void 0 ? void 0 : o.spacing);
@@ -42,7 +42,7 @@ const A = "aristid-ds-global", F = (t, e) => {
42
42
  };
43
43
  }, M = ({ children: t }) => {
44
44
  const e = N();
45
- return n($.Provider, { value: e, children: t });
45
+ return n(j.Provider, { value: e, children: t });
46
46
  }, N = () => {
47
47
  const [t, e] = u(d);
48
48
  return { locale: t, setKitLocale: (r) => {
@@ -50,18 +50,18 @@ const A = "aristid-ds-global", F = (t, e) => {
50
50
  const i = a(d, r);
51
51
  e(i);
52
52
  } else {
53
- const i = a(T, r);
53
+ const i = a($, r);
54
54
  e(i);
55
55
  }
56
56
  } };
57
57
  }, te = ({ children: t, locale: e, customTheme: o, id: r }) => n(R, { customTheme: o, id: r, children: n(M, { children: n(O, { locale: e, children: t }) }) }), O = ({ children: t, locale: e }) => {
58
- const { locale: o, setKitLocale: r } = j();
58
+ const { locale: o, setKitLocale: r } = k();
59
59
  return P(() => {
60
60
  e !== void 0 && r(e);
61
- }, [e, r]), n(C, { theme: I, locale: k(e), renderEmpty: () => {
61
+ }, [e, r]), n(C, { theme: T, locale: x(e), renderEmpty: () => {
62
62
  var i;
63
63
  return n(p, { className: "default-render", image: p.ASSET_LIST, description: (i = o.Empty) === null || i === void 0 ? void 0 : i.noData });
64
- }, children: f(x, { children: [n(b, {}), t] }) });
64
+ }, children: f(A, { children: [n(b, {}), t] }) });
65
65
  };
66
66
  export {
67
67
  te as KitApp
@@ -1,4 +1,4 @@
1
- import "../../../assets/index37.css";
1
+ import "../../../assets/index36.css";
2
2
  import { jsx as t, jsxs as f } from "react/jsx-runtime";
3
3
  import { cloneElement as C, useState as N } from "react";
4
4
  import { Collapse as E } from "antd";
@@ -1,4 +1,4 @@
1
- import "../../../assets/index25.css";
1
+ import "../../../assets/index24.css";
2
2
  import { jsx as i, jsxs as d, Fragment as x } from "react/jsx-runtime";
3
3
  import T from "classnames";
4
4
  import { forwardRef as _ } from "react";
@@ -1,4 +1,4 @@
1
- import "../../../assets/index45.css";
1
+ import "../../../assets/index44.css";
2
2
  import { jsx as o } from "react/jsx-runtime";
3
3
  import { forwardRef as z, useMemo as k } from "react";
4
4
  import { Table as w } from "antd";
@@ -1,4 +1,4 @@
1
- import "../../../assets/index38.css";
1
+ import "../../../assets/index37.css";
2
2
  import { jsx as i, Fragment as C, jsxs as x } from "react/jsx-runtime";
3
3
  import { forwardRef as D, useState as W, useRef as N, useLayoutEffect as E } from "react";
4
4
  import O from "classnames";
@@ -1,19 +1,19 @@
1
1
  import "../../../assets/index6.css";
2
2
  import { jsx as o } from "react/jsx-runtime";
3
- import { Tree as s } from "antd";
3
+ import { Tree as c } from "antd";
4
4
  import { u as p } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
5
5
  import v from "classnames";
6
6
  import { FontAwesomeIcon as n } from "@fortawesome/react-fontawesome";
7
7
  import { faCircleNotch as u, faCaretRight as f } from "@fortawesome/free-solid-svg-icons";
8
8
  import { u as g } from "../../../chunks/useKitLocale.96CdK3og.js";
9
9
  const D = {
10
- "kit-tree": "_kit-tree_1hac1_2"
10
+ "kit-tree": "_kit-tree_gh8v4_2"
11
11
  }, h = ({ className: l, switcherLoadingIcon: e, ...d }) => {
12
- const { appId: m } = p(), { locale: i } = g(), c = v(m, D["kit-tree"], l);
13
- return o(s, { ...d, switcherLoadingIcon: e ?? o(n, { icon: u, spin: !0 }), switcherIcon: (a) => {
12
+ const { appId: m } = p(), { locale: i } = g(), s = v(m, D["kit-tree"], l);
13
+ return o(c, { ...d, switcherLoadingIcon: e ?? o(n, { icon: u, spin: !0 }), switcherIcon: (a) => {
14
14
  var r, t;
15
15
  return o("span", { role: "img", "aria-label": a.expanded ? (r = i.General) === null || r === void 0 ? void 0 : r.close : (t = i.General) === null || t === void 0 ? void 0 : t.open, children: o(n, { icon: f, rotation: a.expanded ? 90 : void 0 }) });
16
- }, className: c, blockNode: !0, draggable: !1, onDragEnd: void 0, onDragEnter: void 0, onDragLeave: void 0, onDragOver: void 0, onDragStart: void 0, onDrop: void 0 });
16
+ }, className: s, blockNode: !0, draggable: !1, onDragEnd: void 0, onDragEnter: void 0, onDragLeave: void 0, onDragOver: void 0, onDragStart: void 0, onDrop: void 0 });
17
17
  };
18
18
  h.displayName = "KitTree";
19
19
  export {
@@ -1,4 +1,4 @@
1
- import "../../../assets/index26.css";
1
+ import "../../../assets/index25.css";
2
2
  import { forwardRef as Y, useRef as q, useState as m, useEffect as b, useImperativeHandle as z, createElement as J } from "react";
3
3
  import { jsxs as Q, jsx as s } from "react/jsx-runtime";
4
4
  import { K as Z } from "../../../chunks/InputWrapper.DPygx2dQ.js";
@@ -1,4 +1,4 @@
1
- import "../../../assets/index46.css";
1
+ import "../../../assets/index45.css";
2
2
  import { jsxs as R, jsx as e } from "react/jsx-runtime";
3
3
  import { forwardRef as C } from "react";
4
4
  import { DatePicker as K } from "antd";
@@ -1,4 +1,4 @@
1
- import "../../../assets/index39.css";
1
+ import "../../../assets/index38.css";
2
2
  import { jsx as l } from "react/jsx-runtime";
3
3
  import { forwardRef as p } from "react";
4
4
  import { Input as w } from "antd";
@@ -1,4 +1,4 @@
1
- import "../../../assets/index40.css";
1
+ import "../../../assets/index39.css";
2
2
  import { jsx as i } from "react/jsx-runtime";
3
3
  import k from "classnames";
4
4
  import J from "rc-util/es/hooks/useMergedState";
@@ -1,4 +1,4 @@
1
- import "../../../../assets/index23.css";
1
+ import "../../../../assets/index22.css";
2
2
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
3
3
  import h from "classnames";
4
4
  import { u as s } from "../../../../chunks/useKitTheme.KSAU-Pdv.js";
@@ -1,6 +1,6 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { KitTooltip as e } from "../../../../DataDisplay/Tooltip/index.js";
3
- const r = ({ title: o, children: t }) => p(e, { title: o, placement: "top", mouseEnterDelay: 0.8, children: t });
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { KitTooltip as i } from "../../../../DataDisplay/Tooltip/index.js";
3
+ const l = ({ title: o, open: t, children: p }) => e(i, { title: o, placement: "top", mouseEnterDelay: 0.8, open: t, children: p });
4
4
  export {
5
- r as KitButtonTooltip
5
+ l as KitButtonTooltip
6
6
  };
@@ -1,3 +1,4 @@
1
1
  export type IKitButtonTooltip = {
2
2
  title?: string;
3
+ open?: boolean;
3
4
  };
@@ -1,4 +1,4 @@
1
- import "../../../../../assets/index24.css";
1
+ import "../../../../../assets/index23.css";
2
2
  import { jsx as i, Fragment as z, jsxs as _ } from "react/jsx-runtime";
3
3
  import { KitTypography as m } from "../../../../General/Typography/index.js";
4
4
  import { KitDropDown as w } from "../../../../Navigation/DropDown/index.js";
@@ -1,4 +1,4 @@
1
- import "../../../../../assets/index36.css";
1
+ import "../../../../../assets/index35.css";
2
2
  import { jsx as t, jsxs as y, Fragment as S } from "react/jsx-runtime";
3
3
  import { faClose as q, faCheck as w, faLink as N } from "@fortawesome/free-solid-svg-icons";
4
4
  import { FontAwesomeIcon as _ } from "@fortawesome/react-fontawesome";
@@ -0,0 +1,3 @@
1
+ import { FunctionComponent, PropsWithChildren } from 'react';
2
+ import { IKitMenuActionList } from './types';
3
+ export declare const KitMenuActionList: FunctionComponent<PropsWithChildren<IKitMenuActionList>>;
@@ -0,0 +1,11 @@
1
+ import { jsxs as r, Fragment as m, jsx as t } from "react/jsx-runtime";
2
+ import { KitFontStylesButtons as n } from "../FontStylesButtons/index.js";
3
+ import { KitDivider as o } from "../../../../Layout/Divider/index.js";
4
+ import { KitTextAlignButtons as e } from "../TextAlignButtons/index.js";
5
+ import { KitLinkButton as p } from "../LinkButton/index.js";
6
+ import { KitListButtons as s } from "../ListButtons/index.js";
7
+ import { KitIndentListButtons as c } from "../IndentListButtons/index.js";
8
+ const B = ({ editor: i }) => r(m, { children: [t(n, { editor: i }), t(o, { type: "vertical" }), t(e, { editor: i }), t(o, { type: "vertical" }), t(p, { editor: i }), t(o, { type: "vertical" }), t(s, { editor: i }), t(o, { type: "vertical" }), t(c, { editor: i })] });
9
+ export {
10
+ B as KitMenuActionList
11
+ };
@@ -0,0 +1,5 @@
1
+ import {type Editor} from '@tiptap/core';
2
+
3
+ export type IKitMenuActionList = {
4
+ editor: Editor;
5
+ };
@@ -1,21 +1,41 @@
1
- import "../../../../assets/index22.css";
2
- import { jsxs as m, jsx as t } from "react/jsx-runtime";
3
- import n from "classnames";
4
- import { u as p } from "../../../../chunks/useKitTheme.KSAU-Pdv.js";
5
- import { KitDivider as r } from "../../../Layout/Divider/index.js";
6
- import { KitUndoRedoButtons as s } from "./UndoRedoButtons/index.js";
7
- import { KitFontSizeSelect as c } from "./FontSizeSelect/index.js";
8
- import { KitFontStylesButtons as a } from "./FontStylesButtons/index.js";
9
- import { KitTextAlignButtons as u } from "./TextAlignButtons/index.js";
10
- import { KitLinkButton as l } from "./LinkButton/index.js";
11
- import { KitListButtons as f } from "./ListButtons/index.js";
12
- import { KitIndentListButtons as K } from "./IndentListButtons/index.js";
13
- const v = {
14
- "kit-rich-text-menu-bar": "_kit-rich-text-menu-bar_tb1dq_2"
15
- }, I = ({ editor: i }) => {
16
- const { appId: o } = p(), e = n(o, v["kit-rich-text-menu-bar"], "menu-bar");
17
- return m("div", { className: e, children: [t(s, { editor: i }), t(r, { type: "vertical" }), t(c, { editor: i }), t(r, { type: "vertical" }), t(a, { editor: i }), t(r, { type: "vertical" }), t(u, { editor: i }), t(r, { type: "vertical" }), t(l, { editor: i }), t(r, { type: "vertical" }), t(f, { editor: i }), t(r, { type: "vertical" }), t(K, { editor: i })] });
1
+ import "../../../../assets/index27.css";
2
+ import { jsxs as f, Fragment as _, jsx as t } from "react/jsx-runtime";
3
+ import a from "classnames";
4
+ import { u as b } from "../../../../chunks/useKitTheme.KSAU-Pdv.js";
5
+ import { KitDivider as d } from "../../../Layout/Divider/index.js";
6
+ import { KitUndoRedoButtons as K } from "./UndoRedoButtons/index.js";
7
+ import { KitFontSizeSelect as O } from "./FontSizeSelect/index.js";
8
+ import { faEllipsisVertical as M } from "@fortawesome/free-solid-svg-icons";
9
+ import { FontAwesomeIcon as g } from "@fortawesome/react-fontawesome";
10
+ import { useState as L, useRef as R, useEffect as v } from "react";
11
+ import { u as S } from "../../../../chunks/useKitLocale.96CdK3og.js";
12
+ import { KitButtonTooltip as w } from "./ButtonTooltip/index.js";
13
+ import { Popover as B } from "antd";
14
+ import { KitMenuActionList as h } from "./MenuActionList/index.js";
15
+ const x = {
16
+ "kit-rich-text-menu-bar": "_kit-rich-text-menu-bar_1xmym_2",
17
+ "kit-rich-text-menu-popover": "_kit-rich-text-menu-popover_1xmym_3"
18
+ }, E = ({ editor: o, blurMenu: e }) => {
19
+ var i, r;
20
+ const { locale: c } = S(), [p, s] = L(!1), u = R(null);
21
+ return v(() => {
22
+ e && s(!1);
23
+ }, [e]), v(() => {
24
+ const m = (k) => {
25
+ var l;
26
+ const n = k.target, y = n.closest(".ant-popover") || n.contains(document.querySelector(".ant-popover"));
27
+ !(n.closest(".link-modal") || n.contains(document.querySelector(".link-modal"))) && !y && !(!((l = u.current) === null || l === void 0) && l.contains(n)) && s(!1);
28
+ };
29
+ return document.addEventListener("mousedown", m), () => {
30
+ document.removeEventListener("mousedown", m);
31
+ };
32
+ }, []), f(_, { children: [t(w, { title: (i = c.RichText) === null || i === void 0 ? void 0 : i.moreOptions, children: t("button", { ref: u, onClick: () => s((m) => !m), className: a({ "is-active": p }), "aria-label": (r = c.RichText) === null || r === void 0 ? void 0 : r.bold, children: t(g, { icon: M }) }) }), t(B, { trigger: "click", placement: "bottom", arrow: !1, open: p, overlayClassName: a(x["kit-rich-text-menu-popover"]), content: t("div", { className: "kit-rich-text-menu-popover-options", children: t(h, { editor: o }) }) })] });
33
+ }, J = ({ editor: o, mini: e, blurMenu: i }) => {
34
+ const { appId: r } = b(), c = a(r, x["kit-rich-text-menu-bar"], "menu-bar", {
35
+ "kit-rich-text-mini-layout": e
36
+ });
37
+ return f("div", { className: c, children: [t(K, { editor: o }), t(d, { type: "vertical" }), t(O, { editor: o }), t(d, { type: "vertical" }), e ? t(E, { editor: o, blurMenu: i }) : t(h, { editor: o })] });
18
38
  };
19
39
  export {
20
- I as KitMenuBar
40
+ J as KitMenuBar
21
41
  };
@@ -0,0 +1,3 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { IKitMiniLayout } from './types';
3
+ export declare const MiniLayout: FunctionComponent<IKitMiniLayout>;
@@ -2,4 +2,11 @@ import {type Editor} from '@tiptap/core';
2
2
 
3
3
  export type IKitMenuBar = {
4
4
  editor: Editor;
5
+ mini: boolean;
6
+ blurMenu: boolean;
7
+ };
8
+
9
+ export type IKitMiniLayout = {
10
+ editor: Editor;
11
+ blurMenu: boolean;
5
12
  };
@@ -1,78 +1,83 @@
1
1
  import "../../../assets/index9.css";
2
- import { jsxs as v, jsx as d } from "react/jsx-runtime";
3
- import { forwardRef as A, useRef as D, useState as G, useEffect as w } from "react";
4
- import { K as J } from "../../../chunks/InputWrapper.DPygx2dQ.js";
5
- import { u as Q } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
6
- import C from "classnames";
7
- import { useEditor as V, EditorContent as X } from "@tiptap/react";
8
- import Y from "@tiptap/starter-kit";
9
- import Z from "@tiptap/extension-underline";
10
- import $ from "@tiptap/extension-text-align";
11
- import B from "@tiptap/extension-placeholder";
12
- import tt from "@tiptap/extension-link";
13
- import et from "@tiptap/extension-character-count";
14
- import { KitMenuBar as rt } from "./MenuBar/index.js";
15
- import { KitEditorContentCharacterCount as ot } from "./EditorContentCharacterCount/index.js";
16
- import { uuid as it } from "../../../utils/functions/index.js";
17
- const E = {
18
- "kit-rich-text-wrapper": "_kit-rich-text-wrapper_1j8h5_2",
19
- "kit-rich-text": "_kit-rich-text_1j8h5_2"
20
- }, nt = A(({ label: _, helper: K, htmlFor: T, wrapperClassName: y, className: L, required: R, actions: M, extra: n, placeholder: N, disabled: c, readonly: f, status: o, defaultValue: W, value: i, onChange: u, onFocus: h, onBlur: s, maxLength: x, autoFocus: b = !1, showCount: j = !1, ...H }, S) => {
21
- const { appId: F } = Q(), k = D(null), [a, g] = G(b), O = C(F, L, E["kit-rich-text"], {
22
- "kit-rich-text-disabled": c,
23
- "kit-rich-text-readonly": f,
2
+ import { jsxs as E, jsx as u } from "react/jsx-runtime";
3
+ import { forwardRef as Q, useRef as V, useState as _, useEffect as f } from "react";
4
+ import { K as X } from "../../../chunks/InputWrapper.DPygx2dQ.js";
5
+ import { u as Y } from "../../../chunks/useKitTheme.KSAU-Pdv.js";
6
+ import K from "classnames";
7
+ import { useEditor as Z, EditorContent as $ } from "@tiptap/react";
8
+ import tt from "@tiptap/starter-kit";
9
+ import et from "@tiptap/extension-underline";
10
+ import rt from "@tiptap/extension-text-align";
11
+ import ot from "@tiptap/extension-placeholder";
12
+ import it from "@tiptap/extension-link";
13
+ import nt from "@tiptap/extension-character-count";
14
+ import { KitMenuBar as st } from "./MenuBar/index.js";
15
+ import { KitEditorContentCharacterCount as ct } from "./EditorContentCharacterCount/index.js";
16
+ import { uuid as at } from "../../../utils/functions/index.js";
17
+ const M = {
18
+ "kit-rich-text-wrapper": "_kit-rich-text-wrapper_1kq7z_2",
19
+ "kit-rich-text": "_kit-rich-text_1kq7z_2"
20
+ }, lt = Q(({ label: T, helper: L, htmlFor: R, wrapperClassName: b, className: q, required: N, actions: S, extra: n, placeholder: W, disabled: s, readonly: h, status: o, mini: x = !1, defaultValue: z, value: i, onChange: k, onFocus: v, onBlur: c, maxLength: g, autoFocus: H = !1, showCount: F = !1, ...O }, P) => {
21
+ const { appId: U } = Y(), w = V(null), [a, y] = _(H), [l, C] = _(!1), j = K(U, q, M["kit-rich-text"], {
22
+ "kit-rich-text-disabled": s,
23
+ "kit-rich-text-readonly": h,
24
24
  "kit-rich-text-error": o === "error",
25
25
  "kit-rich-text-warning": o === "warning",
26
- "kit-rich-text-focused": a
27
- }), t = V({
28
- editable: !c && !f,
29
- content: W,
26
+ "kit-rich-text-focused": a,
27
+ "kit-rich-text-mini-layout": x
28
+ }), t = Z({
29
+ editable: !s && !h,
30
+ content: z,
30
31
  editorProps: {
31
32
  attributes: {
32
33
  role: "textbox"
33
34
  }
34
35
  },
35
36
  extensions: [
36
- Y.configure({
37
+ tt.configure({
37
38
  heading: {
38
39
  levels: [1, 2, 3, 4]
39
40
  }
40
41
  }),
41
- Z,
42
- $.configure({
42
+ et,
43
+ rt.configure({
43
44
  types: ["heading", "paragraph"]
44
45
  }),
45
- tt.extend({ inclusive: !1 }).configure({
46
+ it.extend({ inclusive: !1 }).configure({
46
47
  openOnClick: !1
47
48
  }),
48
- B.configure({
49
- placeholder: N,
49
+ ot.configure({
50
+ placeholder: W,
50
51
  showOnlyWhenEditable: !1
51
52
  }),
52
- et.configure({
53
- limit: x
53
+ nt.configure({
54
+ limit: g
54
55
  })
55
56
  ],
56
57
  onUpdate: ({ editor: e }) => {
57
- u && u(e.getHTML());
58
+ k && k(e.getHTML());
58
59
  }
59
- }), l = "kit-rich-text-wrapper-" + it(), U = C(y, l, E["kit-rich-text-wrapper"]);
60
- return w(() => {
61
- const e = (q) => {
62
- var m, p;
63
- const r = q.target, z = r.closest("." + l), I = r.closest(".select-font-size"), P = r.closest(".link-modal") || r.contains(document.querySelector(".link-modal"));
64
- a && !(!((m = k.current) === null || m === void 0) && m.contains(r)) && !z && !I && !P && (s && s((p = t == null ? void 0 : t.getHTML()) !== null && p !== void 0 ? p : ""), g(!1));
60
+ });
61
+ f(() => {
62
+ l && C(!1);
63
+ }, [l]);
64
+ const p = "kit-rich-text-wrapper-" + at(), I = K(b, p, M["kit-rich-text-wrapper"]);
65
+ return f(() => {
66
+ const e = (A) => {
67
+ var m, d;
68
+ const r = A.target, D = r.closest("." + p), B = r.closest(".select-font-size"), G = r.closest(".link-modal") || r.contains(document.querySelector(".link-modal")), J = r.closest(".ant-popover") || r.contains(document.querySelector(".ant-popover"));
69
+ a && !(!((m = w.current) === null || m === void 0) && m.contains(r)) && !D && !B && !G && !J && (c && c((d = t == null ? void 0 : t.getHTML()) !== null && d !== void 0 ? d : ""), C(!0), y(!1));
65
70
  };
66
71
  return document.addEventListener("mousedown", e), document.addEventListener("focusin", e), () => {
67
72
  document.removeEventListener("mousedown", e), document.removeEventListener("focusin", e);
68
73
  };
69
- }, [l, s, t, a]), w(() => {
74
+ }, [p, c, t, a]), f(() => {
70
75
  t !== null && i !== void 0 && i !== t.getHTML() && t.commands.setContent(i);
71
- }, [i, t]), t ? v(J, { className: U, label: _, helper: K, htmlFor: T, disabled: c, status: o, required: R, extra: n ?? M, children: [v("div", { ref: k, className: O, ...H, children: [d(rt, { editor: t }), d(X, { ref: S, editor: t, className: "ant-typography", onFocus: (e) => {
72
- h && h(e), g(!0);
73
- } })] }), j && d(ot, { editor: t, status: o, maxLength: x })] }) : null;
76
+ }, [i, t]), t ? E(X, { className: I, label: T, helper: L, htmlFor: R, disabled: s, status: o, required: N, extra: n ?? S, children: [E("div", { ref: w, className: j, ...O, children: [u(st, { editor: t, mini: x, blurMenu: l }), u($, { ref: P, editor: t, className: "ant-typography", onFocus: (e) => {
77
+ v && v(e), y(!0);
78
+ } })] }), F && u(ct, { editor: t, status: o, maxLength: g })] }) : null;
74
79
  });
75
- nt.displayName = "KitRichText";
80
+ lt.displayName = "KitRichText";
76
81
  export {
77
- nt as KitRichText
82
+ lt as KitRichText
78
83
  };
@@ -11,6 +11,7 @@ export interface KitRichTextProps extends KitHTMLAttributes<HTMLSpanElement | HT
11
11
  disabled?: boolean;
12
12
  readonly?: boolean;
13
13
  status?: KitRichTextStatus;
14
+ mini?: boolean;
14
15
  showCount?: boolean;
15
16
  maxLength?: number;
16
17
  defaultValue?: string;
@@ -1,4 +1,4 @@
1
- import "../../../assets/index41.css";
1
+ import "../../../assets/index40.css";
2
2
  import { jsx as s, jsxs as pe } from "react/jsx-runtime";
3
3
  import { forwardRef as ve, useState as j, useRef as q, useEffect as fe, useMemo as me } from "react";
4
4
  import { Select as Ce } from "antd";
@@ -0,0 +1,4 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { IKitUploadedItem } from './types';
3
+ declare const KitUploadedItem: FunctionComponent<IKitUploadedItem>;
4
+ export default KitUploadedItem;
@@ -0,0 +1,2 @@
1
+ import { IKitLocale } from '../../../translation/types';
2
+ export declare const convertBytes: (value?: number, locale?: IKitLocale['locale']) => string;
@@ -0,0 +1,2 @@
1
+ import { FileType } from './types';
2
+ export declare const getBase64: (file: FileType) => Promise<string>;
@@ -1,8 +1,2 @@
1
- import { IKitDragger, IKitUpload } from './types';
2
- import { FunctionComponent } from 'react';
3
- type UploadCompoundedComponent = FunctionComponent<IKitUpload> & {
4
- KitDragger: FunctionComponent<IKitDragger>;
5
- LIST_IGNORE: string;
6
- };
7
- export declare const KitUpload: UploadCompoundedComponent;
8
- export {};
1
+ import { KitUploadCompoundedComponent } from './types';
2
+ export declare const KitUpload: KitUploadCompoundedComponent;