@layers-app/shared 0.3.1 → 0.3.2

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 (92) hide show
  1. package/dist/assets/default-workspace-avatar.jpg.js +1 -1
  2. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +14 -14
  3. package/dist/components/AppContainer/AppContainer.module.css.js +1 -1
  4. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
  5. package/dist/components/AppShell/AppShell.module.css.js +5 -5
  6. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
  7. package/dist/components/AttachmentsGalleryModal/styles.module.css.js +14 -14
  8. package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +1 -1
  9. package/dist/components/BouncingLogo/BouncingLogo.module.css.js +8 -8
  10. package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
  11. package/dist/components/ColorPicker/ColorPicker.d.ts +9 -1
  12. package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  13. package/dist/components/ColorPicker/ColorPicker.js +88 -74
  14. package/dist/components/ColorPicker/ColorPicker.module.css.js +31 -0
  15. package/dist/components/ColorPicker/ColorPickerList.d.ts +6 -0
  16. package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -0
  17. package/dist/components/ColorPicker/ColorPickerList.js +134 -0
  18. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts +13 -0
  19. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -0
  20. package/dist/components/ColorPicker/ColorPickerToolbar.js +132 -0
  21. package/dist/components/ColorPicker/icons.d.ts +11 -0
  22. package/dist/components/ColorPicker/icons.d.ts.map +1 -0
  23. package/dist/components/ColorPicker/icons.js +71 -0
  24. package/dist/components/ColorPicker/types.d.ts +49 -0
  25. package/dist/components/ColorPicker/types.d.ts.map +1 -0
  26. package/dist/components/ColorPicker/types.js +10 -0
  27. package/dist/components/ColorPicker/useRecentColors.d.ts +13 -0
  28. package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -0
  29. package/dist/components/ColorPicker/useRecentColors.js +39 -0
  30. package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
  31. package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
  32. package/dist/components/Copyright/Copyright.module.css.js +1 -1
  33. package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
  34. package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
  35. package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
  36. package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
  37. package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
  38. package/dist/components/FilePicker/FilePicker.d.ts +2 -4
  39. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  40. package/dist/components/FilePicker/FilePicker.js +226 -241
  41. package/dist/components/FilePicker/FilePicker.module.css.js +12 -14
  42. package/dist/components/FilePicker/FilePickerGallery.d.ts.map +1 -1
  43. package/dist/components/FilePicker/FilePickerGallery.js +34 -60
  44. package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
  45. package/dist/components/FilePicker/FilePickerGiphy.js +36 -35
  46. package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
  47. package/dist/components/FilePicker/FilePickerLink.js +23 -26
  48. package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
  49. package/dist/components/FilePicker/FilePickerUnsplash.js +43 -42
  50. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  51. package/dist/components/FilePicker/FilePickerUpload.js +35 -51
  52. package/dist/components/FilePicker/index.d.ts +0 -1
  53. package/dist/components/FilePicker/index.d.ts.map +1 -1
  54. package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
  55. package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
  56. package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
  57. package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
  58. package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
  59. package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
  60. package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
  61. package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
  62. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
  63. package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
  64. package/dist/components/Loaders/styles.module.css.js +6 -6
  65. package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
  66. package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
  67. package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
  68. package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
  69. package/dist/components/Notification/Notification.module.css.js +1 -1
  70. package/dist/components/OnBoarding/steps/DifferentLayouts/styles.module.css.js +3 -3
  71. package/dist/components/OnBoarding/steps/styles.module.css.js +9 -9
  72. package/dist/components/OnBoarding/styles.module.css.js +7 -7
  73. package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
  74. package/dist/components/SettingsSection/styles.module.css.js +1 -1
  75. package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
  76. package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
  77. package/dist/components/table/FrontTable.d.ts.map +1 -1
  78. package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
  79. package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
  80. package/dist/helpers/showNotifications.module.css.js +1 -1
  81. package/dist/index.css +1 -1
  82. package/dist/index.d.ts +5 -0
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +472 -462
  85. package/dist/lang/locales/ui_en.json.js +15 -15
  86. package/dist/lang/locales/ui_es.json.js +11 -11
  87. package/dist/lang/locales/ui_ru.json.js +16 -16
  88. package/docs/README.md +499 -499
  89. package/package.json +75 -75
  90. package/dist/components/FilePicker/coverCollections.d.ts +0 -4
  91. package/dist/components/FilePicker/coverCollections.d.ts.map +0 -1
  92. package/dist/components/FilePicker/coverCollections.js +0 -164
@@ -0,0 +1,134 @@
1
+ import { jsxs as y, jsx as t } from "react/jsx-runtime";
2
+ import { Tick02Icon as C } from "@hugeicons/core-free-icons";
3
+ import { HugeiconsIcon as I } from "@hugeicons/react";
4
+ import { useMantineColorScheme as g, Box as k, useMantineTheme as x, getThemeColor as F, ColorSwatch as N } from "@mantine/core";
5
+ import { TextColorIcon as S } from "./icons.js";
6
+ import { isDefaultColor as b, normalizeColorItem as L } from "./types.js";
7
+ import { useRecentColors as T } from "./useRecentColors.js";
8
+ import i from "./ColorPicker.module.css.js";
9
+ function z({
10
+ type: e,
11
+ colorValue: l,
12
+ resolvedColor: a,
13
+ border: s,
14
+ bg: c
15
+ }) {
16
+ if (e === "text")
17
+ return /* @__PURE__ */ t(
18
+ S,
19
+ {
20
+ size: 16,
21
+ color: a,
22
+ showBorder: !0
23
+ }
24
+ );
25
+ const n = b(l);
26
+ return /* @__PURE__ */ t(
27
+ N,
28
+ {
29
+ color: n ? "var(--mantine-color-body)" : c || s || l,
30
+ size: 16,
31
+ radius: "xl",
32
+ className: i.listItemSwatch,
33
+ styles: {
34
+ root: {
35
+ border: `1.5px solid ${n ? "var(--mantine-color-default-border)" : s || a}`
36
+ },
37
+ alphaOverlay: { display: "none" },
38
+ shadowOverlay: { display: "none" }
39
+ }
40
+ }
41
+ );
42
+ }
43
+ function v({
44
+ section: e,
45
+ columns: l,
46
+ onChange: a,
47
+ isDark: s
48
+ }) {
49
+ const c = x(), n = l > 1;
50
+ return /* @__PURE__ */ y("div", { className: i.section, children: [
51
+ e.label && /* @__PURE__ */ t("div", { className: i.sectionLabel, children: e.label }),
52
+ /* @__PURE__ */ t(
53
+ "div",
54
+ {
55
+ className: n ? i.grid : void 0,
56
+ style: n ? { gridTemplateColumns: `repeat(${l}, minmax(0, 1fr))` } : void 0,
57
+ children: e.colors.map((p) => {
58
+ const { value: r, label: m, border: f, bg: d } = L(p), h = b(r), o = r === e.value, u = h ? s ? "#FFFFFF" : "#000000" : F(r, c);
59
+ return /* @__PURE__ */ y(
60
+ "button",
61
+ {
62
+ type: "button",
63
+ className: `${i.listItem} ${o ? i.listItemActive : ""}`,
64
+ onClick: () => a(r, e.key),
65
+ children: [
66
+ /* @__PURE__ */ t(
67
+ z,
68
+ {
69
+ type: e.type,
70
+ colorValue: r,
71
+ resolvedColor: u,
72
+ border: f,
73
+ bg: d
74
+ }
75
+ ),
76
+ /* @__PURE__ */ t("span", { className: i.listItemLabel, children: m }),
77
+ o && /* @__PURE__ */ t(
78
+ I,
79
+ {
80
+ size: 16,
81
+ icon: C,
82
+ color: "var(--mantine-primary-color-filled)"
83
+ }
84
+ )
85
+ ]
86
+ },
87
+ r
88
+ );
89
+ })
90
+ }
91
+ )
92
+ ] });
93
+ }
94
+ function R({
95
+ sections: e,
96
+ colors: l,
97
+ value: a,
98
+ onChange: s,
99
+ columns: c = 1,
100
+ withRecentColors: n
101
+ }) {
102
+ const { colorScheme: p } = g(), r = p === "dark", { recentColors: m, addRecent: f } = T(), d = (o, u) => {
103
+ n && f(o, u), s?.(o, u);
104
+ }, h = e || (l ? [{ key: "default", label: "", colors: l, value: a }] : []);
105
+ return /* @__PURE__ */ y(k, { children: [
106
+ n && m.length > 0 && /* @__PURE__ */ t(
107
+ v,
108
+ {
109
+ section: {
110
+ key: "__recent",
111
+ label: "Recently used",
112
+ colors: m.map((o) => o.value),
113
+ value: a
114
+ },
115
+ columns: 1,
116
+ onChange: d,
117
+ isDark: r
118
+ }
119
+ ),
120
+ h.map((o) => /* @__PURE__ */ t(
121
+ v,
122
+ {
123
+ section: o,
124
+ columns: c,
125
+ onChange: d,
126
+ isDark: r
127
+ },
128
+ o.key
129
+ ))
130
+ ] });
131
+ }
132
+ export {
133
+ R as ColorPickerList
134
+ };
@@ -0,0 +1,13 @@
1
+ import type { ColorPickerOnChange, ColorSection } from './types';
2
+ /** Toolbar dropdown with text colors (A icons) + highlights (circles) + recently used.
3
+ * Use inside Menu.Dropdown, Popover, or floating toolbar. */
4
+ export interface ColorPickerToolbarProps {
5
+ sections: ColorSection[];
6
+ onChange: ColorPickerOnChange;
7
+ withRecentColors?: boolean;
8
+ maxRecentColors?: number;
9
+ disabled?: boolean;
10
+ recentColorsLabel?: string;
11
+ }
12
+ export declare const ColorPickerToolbar: import("react").ForwardRefExoticComponent<ColorPickerToolbarProps & import("react").RefAttributes<HTMLDivElement>>;
13
+ //# sourceMappingURL=ColorPickerToolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorPickerToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerToolbar.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMjE;6DAC6D;AAC7D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AA4BD,eAAO,MAAM,kBAAkB,oHAuJ7B,CAAC"}
@@ -0,0 +1,132 @@
1
+ import { jsxs as C, jsx as o } from "react/jsx-runtime";
2
+ import { forwardRef as D, useState as M, useCallback as w, useMemo as T } from "react";
3
+ import { useMantineColorScheme as z, Box as u, Flex as x, UnstyledButton as H } from "@mantine/core";
4
+ import { TextColorIcon as F, HighlightSwatch as N } from "./icons.js";
5
+ import { isDefaultColor as I, normalizeColorItem as L } from "./types.js";
6
+ import { useRecentColors as j } from "./useRecentColors.js";
7
+ import t from "./ColorPicker.module.css.js";
8
+ function k({
9
+ isActive: i,
10
+ round: m,
11
+ disabled: a,
12
+ onClick: h,
13
+ children: c
14
+ }) {
15
+ return /* @__PURE__ */ o(
16
+ H,
17
+ {
18
+ type: "button",
19
+ className: `${t.inlineSwatch}${m ? ` ${t.inlineSwatchRound}` : ""}${i ? ` ${t.inlineSwatchActive}` : ""}`,
20
+ onMouseDown: (p) => p.preventDefault(),
21
+ onClick: h,
22
+ disabled: a,
23
+ children: c
24
+ }
25
+ );
26
+ }
27
+ const Q = D(({ sections: i, onChange: m, withRecentColors: a, maxRecentColors: h = 9, disabled: c, recentColorsLabel: p = "Recently used" }, R) => {
28
+ const { colorScheme: y } = z(), S = y === "dark", { recentColors: B, addRecent: g } = j({ maxItems: h }), [v, K] = M(B), d = w(
29
+ (e, r, n) => {
30
+ a && (g(e, r, n), K((l) => {
31
+ const f = l.filter(
32
+ (s) => !(s.value === e && s.sectionKey === r)
33
+ );
34
+ return [{ value: e, sectionKey: r, border: n }, ...f].slice(0, h);
35
+ })), m(e, r);
36
+ },
37
+ [m, a, g]
38
+ ), A = T(() => {
39
+ const e = {};
40
+ for (const r of i) e[r.key] = r;
41
+ return e;
42
+ }, [i]), b = w(
43
+ (e) => I(e) ? S ? "#FFFFFF" : "#000000" : e,
44
+ [S]
45
+ );
46
+ return /* @__PURE__ */ C(u, { ref: R, children: [
47
+ a && v.length > 0 && /* @__PURE__ */ C(u, { className: t.inlineSection, children: [
48
+ /* @__PURE__ */ o(u, { className: t.inlineSectionLabel, children: p }),
49
+ /* @__PURE__ */ o(x, { className: t.inlineRow, gap: 2, children: v.map((e, r) => {
50
+ const n = e.sectionKey ? A[e.sectionKey] : void 0;
51
+ return n?.key === "textColor" || n?.key === "color" || e.sectionKey === "color" ? /* @__PURE__ */ o(
52
+ k,
53
+ {
54
+ isActive: !1,
55
+ disabled: c,
56
+ onClick: () => d(e.value, e.sectionKey ?? ""),
57
+ children: /* @__PURE__ */ o(
58
+ F,
59
+ {
60
+ size: 20,
61
+ color: b(e.value),
62
+ showBorder: !0
63
+ }
64
+ )
65
+ },
66
+ `${e.sectionKey}-${e.value}-${r}`
67
+ ) : /* @__PURE__ */ o(
68
+ k,
69
+ {
70
+ isActive: !1,
71
+ round: !0,
72
+ disabled: c,
73
+ onClick: () => d(e.value, e.sectionKey ?? ""),
74
+ children: /* @__PURE__ */ o(
75
+ N,
76
+ {
77
+ bgColor: e.value,
78
+ borderColor: e.border || "var(--mantine-color-default-border)"
79
+ }
80
+ )
81
+ },
82
+ `${e.sectionKey}-${e.value}-${r}`
83
+ );
84
+ }) })
85
+ ] }),
86
+ i.map((e) => {
87
+ const r = e.key === "highlight" || e.key === "background" || e.key === "textHighlight";
88
+ return /* @__PURE__ */ C(u, { className: t.inlineSection, children: [
89
+ e.label && /* @__PURE__ */ o(u, { className: t.inlineSectionLabel, children: e.label }),
90
+ /* @__PURE__ */ o(x, { className: t.inlineRow, gap: 2, children: e.colors.map((n) => {
91
+ const { value: l, border: f } = L(n), s = l === e.value, $ = b(l);
92
+ return r ? /* @__PURE__ */ o(
93
+ k,
94
+ {
95
+ isActive: s,
96
+ round: !0,
97
+ disabled: c,
98
+ onClick: () => d(l, e.key, f),
99
+ children: /* @__PURE__ */ o(
100
+ N,
101
+ {
102
+ bgColor: l,
103
+ borderColor: f || $
104
+ }
105
+ )
106
+ },
107
+ l
108
+ ) : /* @__PURE__ */ o(
109
+ k,
110
+ {
111
+ isActive: s,
112
+ disabled: c,
113
+ onClick: () => d(l, e.key),
114
+ children: /* @__PURE__ */ o(
115
+ F,
116
+ {
117
+ size: 20,
118
+ color: $,
119
+ showBorder: !0
120
+ }
121
+ )
122
+ },
123
+ l
124
+ );
125
+ }) })
126
+ ] }, e.key);
127
+ })
128
+ ] });
129
+ });
130
+ export {
131
+ Q as ColorPickerToolbar
132
+ };
@@ -0,0 +1,11 @@
1
+ export declare function TextColorIcon({ size, color, showBorder, }: {
2
+ size?: number;
3
+ color?: string;
4
+ showBorder?: boolean;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ export declare function HighlightSwatch({ size, bgColor, borderColor, }: {
7
+ size?: number;
8
+ bgColor: string;
9
+ borderColor: string;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/icons.tsx"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,EAC5B,IAAS,EACT,KAAoC,EACpC,UAAU,GACX,EAAE;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,2CAgCA;AAED,wBAAgB,eAAe,CAAC,EAC9B,IAAS,EACT,OAAO,EACP,WAAW,GACZ,EAAE;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,2CA4BA"}
@@ -0,0 +1,71 @@
1
+ import { jsx as n, jsxs as c } from "react/jsx-runtime";
2
+ function s({
3
+ size: t = 20,
4
+ color: r = "var(--mantine-color-white)",
5
+ showBorder: e
6
+ }) {
7
+ return /* @__PURE__ */ c(
8
+ "svg",
9
+ {
10
+ xmlns: "http://www.w3.org/2000/svg",
11
+ width: t,
12
+ height: t,
13
+ viewBox: "0 0 20 20",
14
+ fill: "none",
15
+ children: [
16
+ e && /* @__PURE__ */ n(
17
+ "rect",
18
+ {
19
+ x: "0.5",
20
+ y: "0.5",
21
+ width: "19",
22
+ height: "19",
23
+ rx: "5.5",
24
+ stroke: "var(--mantine-color-default-border)",
25
+ strokeWidth: "1",
26
+ fill: "none"
27
+ }
28
+ ),
29
+ /* @__PURE__ */ n("g", { transform: "translate(4.3, 2.85) scale(0.95)", children: /* @__PURE__ */ n(
30
+ "path",
31
+ {
32
+ d: "M5.74945 0C6.57421 0 7.09678 0.678265 7.50336 1.43555C7.93323 2.23628 8.38332 3.42022 8.95843 4.92676L11.4623 11.4873C11.5716 11.7742 11.4279 12.0955 11.1411 12.2051C10.8541 12.3144 10.5329 12.1706 10.4233 11.8838L8.5766 7.04883H2.9223L1.07562 11.8838C0.965974 12.1707 0.644849 12.3146 0.357848 12.2051C0.0710441 12.0955 -0.0726477 11.7742 0.0365593 11.4873L2.54047 4.92676C3.11563 3.42012 3.56662 2.23629 3.99652 1.43555C4.40306 0.678393 4.92485 8.51363e-05 5.74945 0ZM5.74945 1.11328C5.62925 1.11335 5.38778 1.19685 4.97699 1.96191C4.5893 2.68404 4.16803 3.7852 3.5805 5.32422L3.34711 5.93555H8.15179L7.9184 5.32422C7.33089 3.78522 6.9096 2.68403 6.52191 1.96191C6.11099 1.19664 5.86959 1.11328 5.74945 1.11328Z",
33
+ fill: r === "inherit" || r === "currentColor" ? "var(--mantine-color-white)" : r
34
+ }
35
+ ) })
36
+ ]
37
+ }
38
+ );
39
+ }
40
+ function d({
41
+ size: t = 24,
42
+ bgColor: r,
43
+ borderColor: e
44
+ }) {
45
+ const o = r === "inherit" || r === "" || r === "default", i = t * 0.375, l = o ? "var(--mantine-color-body)" : r, h = o ? "var(--mantine-color-default-border)" : e;
46
+ return /* @__PURE__ */ n(
47
+ "svg",
48
+ {
49
+ xmlns: "http://www.w3.org/2000/svg",
50
+ width: t,
51
+ height: t,
52
+ viewBox: `0 0 ${t} ${t}`,
53
+ fill: "none",
54
+ children: /* @__PURE__ */ n(
55
+ "circle",
56
+ {
57
+ cx: t / 2,
58
+ cy: t / 2,
59
+ r: i,
60
+ fill: l,
61
+ stroke: h,
62
+ strokeWidth: "1.5"
63
+ }
64
+ )
65
+ }
66
+ );
67
+ }
68
+ export {
69
+ d as HighlightSwatch,
70
+ s as TextColorIcon
71
+ };
@@ -0,0 +1,49 @@
1
+ import type { FlexProps } from '@mantine/core';
2
+ export type ColorItem = string | {
3
+ value: string;
4
+ label?: string;
5
+ border?: string;
6
+ bg?: string;
7
+ };
8
+ export interface ColorSection {
9
+ key: string;
10
+ label: string;
11
+ colors: ColorItem[];
12
+ value?: string;
13
+ type?: 'text' | 'highlight';
14
+ }
15
+ export interface RecentColorEntry {
16
+ value: string;
17
+ sectionKey?: string;
18
+ border?: string;
19
+ }
20
+ export type ColorPickerOnChange = (value: string, sectionKey?: string) => void;
21
+ export interface ColorPickerBaseProps {
22
+ colors?: ColorItem[];
23
+ sections?: ColorSection[];
24
+ value?: string;
25
+ onChange?: ColorPickerOnChange;
26
+ withRecentColors?: boolean;
27
+ maxRecentColors?: number;
28
+ swatchSize?: number;
29
+ withTick?: boolean;
30
+ }
31
+ export interface ColorPickerInlineProps extends ColorPickerBaseProps, Omit<FlexProps, 'onChange'> {
32
+ swatchShape?: 'circle' | 'square';
33
+ fullWidth?: boolean;
34
+ allowCustomColor?: boolean;
35
+ }
36
+ export interface ColorPickerListProps extends ColorPickerBaseProps {
37
+ columns?: number;
38
+ }
39
+ export interface ColorPickerCompactProps extends Omit<ColorPickerBaseProps, 'sections' | 'withRecentColors'>, Omit<FlexProps, 'onChange'> {
40
+ swatchShape?: 'circle' | 'square';
41
+ }
42
+ export declare function normalizeColorItem(item: ColorItem): {
43
+ value: string;
44
+ label: string;
45
+ border?: string;
46
+ bg?: string;
47
+ };
48
+ export declare function isDefaultColor(value: string): boolean;
49
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjG,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,mBAAmB,GAAG,CAChC,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,MAAM,KAChB,IAAI,CAAC;AAEV,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,sBACf,SAAQ,oBAAoB,EAC1B,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC7B,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,uBACf,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,GAAG,kBAAkB,CAAC,EACjE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC7B,WAAW,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACnC;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,GAAG;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAKA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAErD"}
@@ -0,0 +1,10 @@
1
+ function n(r) {
2
+ return typeof r == "string" ? { value: r, label: r } : { label: r.value, ...r };
3
+ }
4
+ function l(r) {
5
+ return r === "inherit" || r === "" || r === "default";
6
+ }
7
+ export {
8
+ l as isDefaultColor,
9
+ n as normalizeColorItem
10
+ };
@@ -0,0 +1,13 @@
1
+ import type { RecentColorEntry } from './types';
2
+ interface UseRecentColorsOptions {
3
+ storageKey?: string;
4
+ maxItems?: number;
5
+ }
6
+ export declare function useRecentColors(options?: UseRecentColorsOptions): {
7
+ recentColors: RecentColorEntry[];
8
+ addRecent: (value: string, sectionKey?: string, border?: string) => void;
9
+ clearRecent: () => void;
10
+ reload: () => void;
11
+ };
12
+ export {};
13
+ //# sourceMappingURL=useRecentColors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRecentColors.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/useRecentColors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAKhD,UAAU,sBAAsB;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAmBD,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,sBAAsB;;uBAYpD,MAAM,eAAe,MAAM,WAAW,MAAM;;;EAsBvD"}
@@ -0,0 +1,39 @@
1
+ import { useState as I, useCallback as c } from "react";
2
+ const d = "color-picker-recent", p = 11;
3
+ function n(e) {
4
+ try {
5
+ const t = localStorage.getItem(e);
6
+ return t ? JSON.parse(t) : [];
7
+ } catch {
8
+ return [];
9
+ }
10
+ }
11
+ function E(e, t, o) {
12
+ try {
13
+ localStorage.setItem(e, JSON.stringify(t.slice(0, o)));
14
+ } catch {
15
+ }
16
+ }
17
+ function v(e) {
18
+ const t = e?.storageKey ?? d, o = e?.maxItems ?? p, [i, r] = I(() => n(t)), S = c(() => {
19
+ r(n(t));
20
+ }, [t]), g = c(
21
+ (s, a, f) => {
22
+ const y = n(t).filter(
23
+ (m) => !(m.value === s && m.sectionKey === a)
24
+ ), l = [{ value: s, sectionKey: a, border: f }, ...y].slice(0, o);
25
+ E(t, l, o), r(l);
26
+ },
27
+ [t, o]
28
+ ), u = c(() => {
29
+ try {
30
+ localStorage.removeItem(t);
31
+ } catch {
32
+ }
33
+ r([]);
34
+ }, [t]);
35
+ return { recentColors: i, addRecent: g, clearRecent: u, reload: S };
36
+ }
37
+ export {
38
+ v as useRecentColors
39
+ };
@@ -1,15 +1,15 @@
1
- const o = "_commentComposerWrapper_f5dl7_1", e = "_commentComposerFloat_f5dl7_135", r = "_composerContainer_f5dl7_193", t = "_editorWrapper_f5dl7_225", p = "_editMode_f5dl7_361", m = {
1
+ const o = "_commentComposerWrapper_1mv8w_1", e = "_commentComposerFloat_1mv8w_68", r = "_composerContainer_1mv8w_97", t = "_editorWrapper_1mv8w_113", m = "_editMode_1mv8w_181", p = {
2
2
  commentComposerWrapper: o,
3
3
  commentComposerFloat: e,
4
4
  composerContainer: r,
5
5
  editorWrapper: t,
6
- editMode: p
6
+ editMode: m
7
7
  };
8
8
  export {
9
9
  e as commentComposerFloat,
10
10
  o as commentComposerWrapper,
11
11
  r as composerContainer,
12
- m as default,
13
- p as editMode,
12
+ p as default,
13
+ m as editMode,
14
14
  t as editorWrapper
15
15
  };
@@ -1,4 +1,4 @@
1
- const s = "_section_6nzxb_1", t = {
1
+ const s = "_section_s7rqu_1", t = {
2
2
  section: s
3
3
  };
4
4
  export {
@@ -1,4 +1,4 @@
1
- const r = "_brandingWrapper_ag0no_1", a = {
1
+ const r = "_brandingWrapper_vvk0o_1", a = {
2
2
  brandingWrapper: r
3
3
  };
4
4
  export {
@@ -1,4 +1,4 @@
1
- const o = "_root_122b9_1", t = {
1
+ const o = "_root_195do_1", t = {
2
2
  root: o
3
3
  };
4
4
  export {
@@ -1,13 +1,13 @@
1
- const o = "_item_s1gb0_1", s = "_randomIcon_s1gb0_51", a = "_originalTab_s1gb0_59", n = "_customTab_s1gb0_71", t = {
1
+ const o = "_item_o1hlf_1", a = "_randomIcon_o1hlf_26", n = "_originalTab_o1hlf_30", t = "_customTab_o1hlf_36", _ = {
2
2
  item: o,
3
- randomIcon: s,
4
- originalTab: a,
5
- customTab: n
3
+ randomIcon: a,
4
+ originalTab: n,
5
+ customTab: t
6
6
  };
7
7
  export {
8
- n as customTab,
9
- t as default,
8
+ t as customTab,
9
+ _ as default,
10
10
  o as item,
11
- a as originalTab,
12
- s as randomIcon
11
+ n as originalTab,
12
+ a as randomIcon
13
13
  };
@@ -1,4 +1,4 @@
1
- const t = "_textareaRoot_1bpsw_53", e = "_textareaInput_1bpsw_61", a = {
1
+ const t = "_textareaRoot_1ubu6_27", e = "_textareaInput_1ubu6_31", a = {
2
2
  textareaRoot: t,
3
3
  textareaInput: e
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Error404.d.ts","sourceRoot":"","sources":["../../../../src/components/ErrorPage/components/Error404.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ;eAC+X,CAAC;6CADrX,CAAC"}
1
+ {"version":3,"file":"Error404.d.ts","sourceRoot":"","sources":["../../../../src/components/ErrorPage/components/Error404.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ;eACkX,CAAC;6CADxW,CAAC"}