@layers-app/shared 0.4.0 → 0.4.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 (156) hide show
  1. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +13 -13
  2. package/dist/components/AnimatedFigurePage/useParallax.d.ts +2 -2
  3. package/dist/components/AppContainer/AppContainer.d.ts +6 -1
  4. package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
  5. package/dist/components/AppContainer/components/AppSidebarButton.d.ts +4 -1
  6. package/dist/components/AppContainer/components/AppSidebarButton.d.ts.map +1 -1
  7. package/dist/components/AppContainer/components/AppSidebarButton.js +22 -15
  8. package/dist/components/AppContainer/components/AppsSidebar/AppsSection.d.ts.map +1 -1
  9. package/dist/components/AppContainer/components/AppsSidebar/AppsSection.js +22 -21
  10. package/dist/components/AppContainer/components/AppsSidebar/UserSection.d.ts.map +1 -1
  11. package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +48 -91
  12. package/dist/components/AppContainer/components/ToolbarNewButton.d.ts +7 -2
  13. package/dist/components/AppContainer/components/ToolbarNewButton.d.ts.map +1 -1
  14. package/dist/components/AppContainer/components/ToolbarNewButton.js +14 -14
  15. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts +3 -1
  16. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.d.ts.map +1 -1
  17. package/dist/components/AttachmentsGalleryModal/components/GallerySlide.js +96 -64
  18. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
  19. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +76 -67
  20. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts +1 -1
  21. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.d.ts.map +1 -1
  22. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.js +35 -26
  23. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts +1 -1
  24. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.d.ts.map +1 -1
  25. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/useShakePlayer.js +43 -36
  26. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts +7 -0
  27. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.d.ts.map +1 -0
  28. package/dist/components/AttachmentsGalleryModal/components/UnsupportedSection.js +17 -0
  29. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts +4 -0
  30. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.d.ts.map +1 -1
  31. package/dist/components/AttachmentsGalleryModal/hooks/useGetPreviewUrl.js +59 -20
  32. package/dist/components/AttachmentsGalleryModal/styles.module.css.js +34 -22
  33. package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
  34. package/dist/components/AttachmentsPreview/AttachmentsPreview.js +22 -18
  35. package/dist/components/ColorPicker/ColorPicker.d.ts +12 -11
  36. package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  37. package/dist/components/ColorPicker/ColorPicker.js +109 -83
  38. package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
  39. package/dist/components/ColorPicker/ColorPickerList.js +62 -63
  40. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
  41. package/dist/components/ColorPicker/ColorPickerToolbar.js +128 -120
  42. package/dist/components/ColorPicker/icons.js +3 -3
  43. package/dist/components/ColorPicker/types.d.ts +3 -1
  44. package/dist/components/ColorPicker/types.d.ts.map +1 -1
  45. package/dist/components/ColorPicker/types.js +11 -5
  46. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
  47. package/dist/components/CommentComposer/CommentEditorHotkeys.js +55 -45
  48. package/dist/components/CommentComposer/useVirtualAnchor.d.ts +1 -1
  49. package/dist/components/CommentComposer/useVirtualAnchor.d.ts.map +1 -1
  50. package/dist/components/EmojiPicker/EmojiPicker.d.ts +1 -1
  51. package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  52. package/dist/components/EntityIcon.d.ts.map +1 -1
  53. package/dist/components/EntityIcon.js +43 -33
  54. package/dist/components/FilePicker/FilePicker.d.ts +3 -1
  55. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  56. package/dist/components/FilePicker/FilePicker.js +44 -42
  57. package/dist/components/FilePicker/FilePickerUpload.d.ts +3 -1
  58. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  59. package/dist/components/FilePicker/FilePickerUpload.js +28 -28
  60. package/dist/components/FormViewer/helpers/conditions.d.ts +38 -38
  61. package/dist/components/FormViewer/helpers/helpers.d.ts +38 -38
  62. package/dist/components/FormViewer/helpers/steps.d.ts +38 -38
  63. package/dist/components/FormViewer/hooks/useActiveControl.d.ts +19 -19
  64. package/dist/components/FormViewer/hooks/useActiveStep.d.ts +38 -38
  65. package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +6 -0
  66. package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts.map +1 -1
  67. package/dist/components/FormViewer/hooks/useFormGlobalTheme.js +4 -3
  68. package/dist/components/FormViewer/hooks/useFormMobile.d.ts +1 -1
  69. package/dist/components/FormViewer/hooks/useFormMobile.d.ts.map +1 -1
  70. package/dist/components/FormViewer/store/formStore.d.ts +248 -248
  71. package/dist/components/FormViewer/store/formStoreApi.d.ts +124 -124
  72. package/dist/components/FormViewer/store/selectors.d.ts +11655 -11655
  73. package/dist/components/FormViewer/types/form.d.ts +1 -1
  74. package/dist/components/FormViewer/types/form.d.ts.map +1 -1
  75. package/dist/components/FormViewer/types/schemes.d.ts +381 -6358
  76. package/dist/components/FormViewer/types/schemes.d.ts.map +1 -1
  77. package/dist/components/FormViewer/types/schemes.js +1 -1
  78. package/dist/components/GroupAvatar/index.d.ts +3 -1
  79. package/dist/components/GroupAvatar/index.d.ts.map +1 -1
  80. package/dist/components/GroupAvatar/index.js +24 -21
  81. package/dist/components/LanguagePicker/LanguagePicker.d.ts +13 -3
  82. package/dist/components/LanguagePicker/LanguagePicker.d.ts.map +1 -1
  83. package/dist/components/LanguagePicker/LanguagePicker.js +65 -43
  84. package/dist/components/MediaLibrary/MediaLibraryRow.js +7 -7
  85. package/dist/components/NavMenu/NavMenu.d.ts +3 -1
  86. package/dist/components/NavMenu/NavMenu.d.ts.map +1 -1
  87. package/dist/components/NavMenu/components/DnDProvider.d.ts +1 -1
  88. package/dist/components/NavMenu/components/DnDProvider.d.ts.map +1 -1
  89. package/dist/components/NavMenu/components/NavMenuActionIcon.d.ts +7 -1
  90. package/dist/components/NavMenu/components/NavMenuActionIcon.d.ts.map +1 -1
  91. package/dist/components/NavMenu/components/NavMenuActionIcon.js +21 -23
  92. package/dist/components/NewColorPicker/components/Target.d.ts +3 -1
  93. package/dist/components/NewColorPicker/components/Target.d.ts.map +1 -1
  94. package/dist/components/NewColorPicker/components/Target.js +48 -43
  95. package/dist/components/Notification/Notification.js +3 -1
  96. package/dist/components/Notification/NotificationCard.d.ts +3 -1
  97. package/dist/components/Notification/NotificationCard.d.ts.map +1 -1
  98. package/dist/components/Notification/NotificationCard.js +87 -86
  99. package/dist/components/OnboardingTour/OnboardingTourFooter.d.ts +6 -1
  100. package/dist/components/OnboardingTour/OnboardingTourFooter.d.ts.map +1 -1
  101. package/dist/components/OnboardingTour/OnboardingTourFooter.js +39 -21
  102. package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts +4 -5
  103. package/dist/components/OnboardingTour/OnboardingTourWrapper.d.ts.map +1 -1
  104. package/dist/components/OnboardingTour/OnboardingTourWrapper.js +83 -119
  105. package/dist/components/OnboardingTour/index.d.ts +1 -1
  106. package/dist/components/OnboardingTour/index.d.ts.map +1 -1
  107. package/dist/components/OnboardingTour/useOnboardingTour.d.ts +4 -0
  108. package/dist/components/OnboardingTour/useOnboardingTour.d.ts.map +1 -1
  109. package/dist/components/OnboardingTour/useOnboardingTour.js +65 -36
  110. package/dist/components/ProjectIcon/ProjectIcon.d.ts +7 -12
  111. package/dist/components/ProjectIcon/ProjectIcon.d.ts.map +1 -1
  112. package/dist/components/ProjectIcon/ProjectIcon.js +58 -60
  113. package/dist/components/UserAvatar/index.d.ts +2 -1
  114. package/dist/components/UserAvatar/index.d.ts.map +1 -1
  115. package/dist/components/UserAvatar/index.js +42 -32
  116. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts +3 -3
  117. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.d.ts.map +1 -1
  118. package/dist/components/WorkspaceAvatar/WorkspaceAvatar.js +19 -18
  119. package/dist/components/WorkspaceMenu/WorkspaceItem.js +17 -17
  120. package/dist/components/WorkspaceMenu/WorkspaceMenu.js +7 -7
  121. package/dist/config/brand.d.ts +2 -0
  122. package/dist/config/brand.d.ts.map +1 -1
  123. package/dist/config/brand.js +28 -22
  124. package/dist/config/envConfig.d.ts +12 -0
  125. package/dist/config/envConfig.d.ts.map +1 -1
  126. package/dist/config/envConfig.js +21 -13
  127. package/dist/helpers/getFileIcons.d.ts.map +1 -1
  128. package/dist/helpers/getFileIcons.js +63 -45
  129. package/dist/helpers/getFileType.d.ts +1 -1
  130. package/dist/helpers/getFileType.d.ts.map +1 -1
  131. package/dist/helpers/getFileType.js +29 -8
  132. package/dist/helpers/getPartOfTheDay.d.ts +1 -1
  133. package/dist/helpers/offlineSuppression.d.ts +3 -0
  134. package/dist/helpers/offlineSuppression.d.ts.map +1 -0
  135. package/dist/helpers/offlineSuppression.js +8 -0
  136. package/dist/helpers/platform.d.ts +1 -1
  137. package/dist/helpers/platform.d.ts.map +1 -1
  138. package/dist/helpers/platform.js +5 -4
  139. package/dist/helpers/showNotifications.d.ts.map +1 -1
  140. package/dist/helpers/showNotifications.js +30 -29
  141. package/dist/hooks/useOutsideClick.d.ts +1 -1
  142. package/dist/hooks/useOutsideClick.d.ts.map +1 -1
  143. package/dist/index.css +1 -1
  144. package/dist/index.d.ts +1 -0
  145. package/dist/index.d.ts.map +1 -1
  146. package/dist/index.js +462 -451
  147. package/dist/lang/locales/ui_en.json.js +1 -1
  148. package/dist/lang/locales/ui_es.json.js +1 -1
  149. package/dist/lang/locales/ui_ru.json.js +1 -1
  150. package/dist/node_modules/countries-and-timezones/esm/index.js +281 -4011
  151. package/dist/store/featureProgress.d.ts +3 -6
  152. package/dist/store/featureProgress.d.ts.map +1 -1
  153. package/dist/store/featureProgress.js +56 -22
  154. package/dist/store/plansModal.d.ts.map +1 -1
  155. package/dist/store/plansModal.js +10 -10
  156. package/package.json +13 -13
@@ -1,38 +1,32 @@
1
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({
2
+ import { useTranslation as g } from "react-i18next";
3
+ import { Tick02Icon as k } from "@hugeicons/core-free-icons";
4
+ import { HugeiconsIcon as x } from "@hugeicons/react";
5
+ import { useMantineColorScheme as L, Box as F, useMantineTheme as N, getThemeColor as S, ColorSwatch as T } from "@mantine/core";
6
+ import { TextColorIcon as z } from "./icons.js";
7
+ import { resolveColorLabel as D, isDefaultColor as b, normalizeColorItem as $ } from "./types.js";
8
+ import { useRecentColors as w } from "./useRecentColors.js";
9
+ import a from "./ColorPicker.module.css.js";
10
+ function j({
10
11
  type: e,
11
12
  colorValue: l,
12
- resolvedColor: a,
13
- border: s,
13
+ resolvedColor: n,
14
+ border: i,
14
15
  bg: c
15
16
  }) {
16
17
  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);
18
+ return /* @__PURE__ */ t(z, { size: 16, color: n, showBorder: !0 });
19
+ const s = b(l);
26
20
  return /* @__PURE__ */ t(
27
- N,
21
+ T,
28
22
  {
29
- color: n ? "var(--mantine-color-body)" : c || s || l,
23
+ color: s ? "var(--mantine-color-body)" : c || i || l,
30
24
  size: 16,
31
25
  radius: "xl",
32
- className: i.listItemSwatch,
26
+ className: a.listItemSwatch,
33
27
  styles: {
34
28
  root: {
35
- border: `1.5px solid ${n ? "var(--mantine-color-default-border)" : s || a}`
29
+ border: `1.5px solid ${s ? "var(--mantine-color-default-border)" : i || n}`
36
30
  },
37
31
  alphaOverlay: { display: "none" },
38
32
  shadowOverlay: { display: "none" }
@@ -43,92 +37,97 @@ function z({
43
37
  function v({
44
38
  section: e,
45
39
  columns: l,
46
- onChange: a,
47
- isDark: s
40
+ onChange: n,
41
+ isDark: i
48
42
  }) {
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 }),
43
+ const c = N(), { t: s } = g("ui"), d = l > 1;
44
+ return /* @__PURE__ */ y("div", { className: a.section, children: [
45
+ e.label && /* @__PURE__ */ t("div", { className: a.sectionLabel, children: e.label }),
52
46
  /* @__PURE__ */ t(
53
47
  "div",
54
48
  {
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);
49
+ className: d ? a.grid : void 0,
50
+ style: d ? { gridTemplateColumns: `repeat(${l}, minmax(0, 1fr))` } : void 0,
51
+ children: e.colors.map((u) => {
52
+ const {
53
+ value: o,
54
+ label: f,
55
+ border: p,
56
+ bg: h
57
+ } = $(u), r = b(o), m = o === e.value, C = r ? i ? "#FFFFFF" : "#000000" : S(o, c), I = D(s, o, f);
59
58
  return /* @__PURE__ */ y(
60
59
  "button",
61
60
  {
62
61
  type: "button",
63
- className: `${i.listItem} ${o ? i.listItemActive : ""}`,
64
- onClick: () => a(r, e.key),
62
+ className: `${a.listItem} ${m ? a.listItemActive : ""}`,
63
+ onClick: () => n(o, e.key),
65
64
  children: [
66
65
  /* @__PURE__ */ t(
67
- z,
66
+ j,
68
67
  {
69
68
  type: e.type,
70
- colorValue: r,
71
- resolvedColor: u,
72
- border: f,
73
- bg: d
69
+ colorValue: o,
70
+ resolvedColor: C,
71
+ border: p,
72
+ bg: h
74
73
  }
75
74
  ),
76
- /* @__PURE__ */ t("span", { className: i.listItemLabel, children: m }),
77
- o && /* @__PURE__ */ t(
78
- I,
75
+ /* @__PURE__ */ t("span", { className: a.listItemLabel, children: I }),
76
+ m && /* @__PURE__ */ t(
77
+ x,
79
78
  {
80
79
  size: 16,
81
- icon: C,
80
+ icon: k,
82
81
  color: "var(--mantine-primary-color-filled)"
83
82
  }
84
83
  )
85
84
  ]
86
85
  },
87
- r
86
+ o
88
87
  );
89
88
  })
90
89
  }
91
90
  )
92
91
  ] });
93
92
  }
94
- function R({
93
+ function q({
95
94
  sections: e,
96
95
  colors: l,
97
- value: a,
98
- onChange: s,
96
+ value: n,
97
+ onChange: i,
99
98
  columns: c = 1,
100
- withRecentColors: n
99
+ withRecentColors: s
101
100
  }) {
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(
101
+ const { colorScheme: d } = L(), u = d === "dark", { recentColors: o, addRecent: f } = w(), p = (r, m) => {
102
+ s && f(r, m), i?.(r, m);
103
+ }, h = e || (l ? [{ key: "default", label: "", colors: l, value: n }] : []);
104
+ return /* @__PURE__ */ y(F, { children: [
105
+ s && o.length > 0 && /* @__PURE__ */ t(
107
106
  v,
108
107
  {
109
108
  section: {
110
109
  key: "__recent",
111
110
  label: "Recently used",
112
- colors: m.map((o) => o.value),
113
- value: a
111
+ colors: o.map((r) => r.value),
112
+ value: n
114
113
  },
115
114
  columns: 1,
116
- onChange: d,
117
- isDark: r
115
+ onChange: p,
116
+ isDark: u
118
117
  }
119
118
  ),
120
- h.map((o) => /* @__PURE__ */ t(
119
+ h.map((r) => /* @__PURE__ */ t(
121
120
  v,
122
121
  {
123
- section: o,
122
+ section: r,
124
123
  columns: c,
125
- onChange: d,
126
- isDark: r
124
+ onChange: p,
125
+ isDark: u
127
126
  },
128
- o.key
127
+ r.key
129
128
  ))
130
129
  ] });
131
130
  }
132
131
  export {
133
- R as ColorPickerList
132
+ q as ColorPickerList
134
133
  };
@@ -1 +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;AAsCD,eAAO,MAAM,kBAAkB,oHA2K7B,CAAC"}
1
+ {"version":3,"file":"ColorPickerToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerToolbar.tsx"],"names":[],"mappings":"AAOA,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;AAsCD,eAAO,MAAM,kBAAkB,oHA+L9B,CAAC"}
@@ -1,149 +1,157 @@
1
- import { jsxs as S, jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as z, useState as H, useCallback as w, useMemo as I } from "react";
3
- import { useMantineColorScheme as j, Box as h, Flex as B, Tooltip as P, UnstyledButton as U } from "@mantine/core";
4
- import { TextColorIcon as K, HighlightSwatch as D } from "./icons.js";
5
- import { normalizeColorItem as $, isDefaultColor as q } from "./types.js";
6
- import { useRecentColors as E } from "./useRecentColors.js";
7
- import c from "./ColorPicker.module.css.js";
8
- function k({
9
- isActive: s,
10
- round: m,
1
+ import { jsxs as g, jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as H, useState as j, useCallback as S, useMemo as P } from "react";
3
+ import { useTranslation as U } from "react-i18next";
4
+ import { useMantineColorScheme as q, Box as h, Flex as B, Tooltip as E, UnstyledButton as G } from "@mantine/core";
5
+ import { TextColorIcon as K, HighlightSwatch as T } from "./icons.js";
6
+ import { normalizeColorItem as w, resolveColorLabel as z, isDefaultColor as J } from "./types.js";
7
+ import { useRecentColors as O } from "./useRecentColors.js";
8
+ import n from "./ColorPicker.module.css.js";
9
+ function v({
10
+ isActive: a,
11
+ round: d,
11
12
  disabled: u,
12
- onClick: d,
13
+ onClick: f,
13
14
  children: i,
14
- tooltipLabel: f
15
+ tooltipLabel: p
15
16
  }) {
16
- const v = /* @__PURE__ */ r(
17
- U,
17
+ const b = /* @__PURE__ */ r(
18
+ G,
18
19
  {
19
20
  type: "button",
20
- className: `${c.inlineSwatch}${m ? ` ${c.inlineSwatchRound}` : ""}${s ? ` ${c.inlineSwatchActive}` : ""}`,
21
- onMouseDown: (C) => C.preventDefault(),
22
- onClick: d,
21
+ className: `${n.inlineSwatch}${d ? ` ${n.inlineSwatchRound}` : ""}${a ? ` ${n.inlineSwatchActive}` : ""}`,
22
+ onMouseDown: (m) => m.preventDefault(),
23
+ onClick: f,
23
24
  disabled: u,
24
25
  children: i
25
26
  }
26
27
  );
27
- return f ? /* @__PURE__ */ r(P, { label: f, withArrow: !0, children: v }) : v;
28
+ return p ? /* @__PURE__ */ r(E, { label: p, withArrow: !0, zIndex: 300, children: b }) : b;
28
29
  }
29
- const Y = z(({ sections: s, onChange: m, withRecentColors: u, maxRecentColors: d = 9, disabled: i, recentColorsLabel: f = "Recently used" }, v) => {
30
- const { colorScheme: C } = j(), x = C === "dark", { recentColors: M, addRecent: F } = E({ maxItems: d }), [L, T] = H(M), p = w(
31
- (e, o, t) => {
32
- u && (F(e, o, t), T((l) => {
33
- const n = l.filter(
34
- (a) => !(a.value === e && a.sectionKey === o)
35
- );
36
- return [{ value: e, sectionKey: o, border: t }, ...n].slice(0, d);
37
- })), m(e, o);
38
- },
39
- [m, u, F]
40
- ), g = I(() => {
41
- const e = {};
42
- for (const o of s) e[o.key] = o;
43
- return e;
44
- }, [s]), y = w(
45
- (e, o) => {
46
- if (!o) return;
47
- const t = g[o];
48
- if (!t) return;
49
- const l = t.colors.find((b) => $(b).value === e);
50
- if (!l) return;
51
- const { label: n, value: a } = $(l);
52
- return n || a;
53
- },
54
- [g]
55
- ), N = w(
56
- (e) => q(e) ? x ? "#FFFFFF" : "#000000" : e,
57
- [x]
58
- );
59
- return /* @__PURE__ */ S(h, { ref: v, children: [
60
- u && L.length > 0 && /* @__PURE__ */ S(h, { className: c.inlineSection, children: [
61
- /* @__PURE__ */ r(h, { className: c.inlineSectionLabel, children: f }),
62
- /* @__PURE__ */ r(B, { className: c.inlineRow, gap: 2, children: L.map((e, o) => {
63
- const t = e.sectionKey ? g[e.sectionKey] : void 0, l = t?.key === "textColor" || t?.key === "color" || e.sectionKey === "color", n = y(e.value, e.sectionKey);
64
- return l ? /* @__PURE__ */ r(
65
- k,
66
- {
67
- isActive: !1,
68
- disabled: i,
69
- tooltipLabel: n,
70
- onClick: () => p(e.value, e.sectionKey ?? ""),
71
- children: /* @__PURE__ */ r(
72
- K,
73
- {
74
- size: 20,
75
- color: N(e.value),
76
- showBorder: !0
77
- }
78
- )
79
- },
80
- `${e.sectionKey}-${e.value}-${o}`
81
- ) : /* @__PURE__ */ r(
82
- k,
83
- {
84
- isActive: !1,
85
- round: !0,
86
- disabled: i,
87
- tooltipLabel: n,
88
- onClick: () => p(e.value, e.sectionKey ?? ""),
89
- children: /* @__PURE__ */ r(
90
- D,
91
- {
92
- bgColor: e.value,
93
- borderColor: e.border || "var(--mantine-color-default-border)"
94
- }
95
- )
96
- },
97
- `${e.sectionKey}-${e.value}-${o}`
98
- );
99
- }) })
100
- ] }),
101
- s.map((e) => {
102
- const o = e.key === "highlight" || e.key === "background" || e.key === "textHighlight";
103
- return /* @__PURE__ */ S(h, { className: c.inlineSection, children: [
104
- e.label && /* @__PURE__ */ r(h, { className: c.inlineSectionLabel, children: e.label }),
105
- /* @__PURE__ */ r(B, { className: c.inlineRow, gap: 2, children: e.colors.map((t) => {
106
- const { value: l, border: n, label: a } = $(t), b = l === e.value, R = N(l), A = a || l;
107
- return o ? /* @__PURE__ */ r(
108
- k,
30
+ const oe = H(
31
+ ({
32
+ sections: a,
33
+ onChange: d,
34
+ withRecentColors: u,
35
+ maxRecentColors: f = 9,
36
+ disabled: i,
37
+ recentColorsLabel: p = "Recently used"
38
+ }, b) => {
39
+ const { t: m } = U("ui"), { colorScheme: D } = q(), x = D === "dark", { recentColors: I, addRecent: $ } = O({
40
+ maxItems: f
41
+ }), [L, M] = j(I), k = S(
42
+ (e, o, c) => {
43
+ u && ($(e, o, c), M((l) => {
44
+ const t = l.filter(
45
+ (s) => !(s.value === e && s.sectionKey === o)
46
+ );
47
+ return [{ value: e, sectionKey: o, border: c }, ...t].slice(
48
+ 0,
49
+ f
50
+ );
51
+ })), d(e, o);
52
+ },
53
+ [d, u, $]
54
+ ), C = P(() => {
55
+ const e = {};
56
+ for (const o of a) e[o.key] = o;
57
+ return e;
58
+ }, [a]), y = S(
59
+ (e, o) => {
60
+ const l = (o ? C[o] : void 0)?.colors.find(
61
+ (s) => w(s).value === e
62
+ ), t = l ? w(l).label : void 0;
63
+ return z(m, e, t);
64
+ },
65
+ [C, m]
66
+ ), F = S(
67
+ (e) => J(e) ? x ? "#FFFFFF" : "#000000" : e,
68
+ [x]
69
+ );
70
+ return /* @__PURE__ */ g(h, { ref: b, children: [
71
+ u && L.length > 0 && /* @__PURE__ */ g(h, { className: n.inlineSection, children: [
72
+ /* @__PURE__ */ r(h, { className: n.inlineSectionLabel, children: p }),
73
+ /* @__PURE__ */ r(B, { className: n.inlineRow, gap: 2, children: L.map((e, o) => {
74
+ const c = e.sectionKey ? C[e.sectionKey] : void 0, l = c?.key === "textColor" || c?.key === "color" || e.sectionKey === "color", t = y(
75
+ e.value,
76
+ e.sectionKey
77
+ );
78
+ return l ? /* @__PURE__ */ r(
79
+ v,
109
80
  {
110
- isActive: b,
111
- round: !0,
81
+ isActive: !1,
112
82
  disabled: i,
113
- tooltipLabel: A,
114
- onClick: () => p(l, e.key, n),
83
+ tooltipLabel: t,
84
+ onClick: () => k(e.value, e.sectionKey ?? ""),
115
85
  children: /* @__PURE__ */ r(
116
- D,
86
+ K,
117
87
  {
118
- bgColor: l,
119
- borderColor: n || R
88
+ size: 20,
89
+ color: F(e.value),
90
+ showBorder: !0
120
91
  }
121
92
  )
122
93
  },
123
- l
94
+ `${e.sectionKey}-${e.value}-${o}`
124
95
  ) : /* @__PURE__ */ r(
125
- k,
96
+ v,
126
97
  {
127
- isActive: b,
98
+ isActive: !1,
99
+ round: !0,
128
100
  disabled: i,
129
- tooltipLabel: A,
130
- onClick: () => p(l, e.key),
101
+ tooltipLabel: t,
102
+ onClick: () => k(e.value, e.sectionKey ?? ""),
131
103
  children: /* @__PURE__ */ r(
132
- K,
104
+ T,
133
105
  {
134
- size: 20,
135
- color: R,
136
- showBorder: !0
106
+ bgColor: e.value,
107
+ borderColor: e.border || "var(--mantine-color-default-border)"
137
108
  }
138
109
  )
139
110
  },
140
- l
111
+ `${e.sectionKey}-${e.value}-${o}`
141
112
  );
142
113
  }) })
143
- ] }, e.key);
144
- })
145
- ] });
146
- });
114
+ ] }),
115
+ a.map((e) => {
116
+ const o = e.key === "highlight" || e.key === "background" || e.key === "textHighlight";
117
+ return /* @__PURE__ */ g(h, { className: n.inlineSection, children: [
118
+ e.label && /* @__PURE__ */ r(h, { className: n.inlineSectionLabel, children: e.label }),
119
+ /* @__PURE__ */ r(B, { className: n.inlineRow, gap: 2, children: e.colors.map((c) => {
120
+ const { value: l, border: t, label: s } = w(c), N = l === e.value, R = F(l), A = z(m, l, s);
121
+ return o ? /* @__PURE__ */ r(
122
+ v,
123
+ {
124
+ isActive: N,
125
+ round: !0,
126
+ disabled: i,
127
+ tooltipLabel: A,
128
+ onClick: () => k(l, e.key, t),
129
+ children: /* @__PURE__ */ r(
130
+ T,
131
+ {
132
+ bgColor: l,
133
+ borderColor: t || R
134
+ }
135
+ )
136
+ },
137
+ l
138
+ ) : /* @__PURE__ */ r(
139
+ v,
140
+ {
141
+ isActive: N,
142
+ disabled: i,
143
+ tooltipLabel: A,
144
+ onClick: () => k(l, e.key),
145
+ children: /* @__PURE__ */ r(K, { size: 20, color: R, showBorder: !0 })
146
+ },
147
+ l
148
+ );
149
+ }) })
150
+ ] }, e.key);
151
+ })
152
+ ] });
153
+ }
154
+ );
147
155
  export {
148
- Y as ColorPickerToolbar
156
+ oe as ColorPickerToolbar
149
157
  };
@@ -21,7 +21,7 @@ function s({
21
21
  width: "19",
22
22
  height: "19",
23
23
  rx: "5.5",
24
- stroke: "var(--mantine-color-default-border)",
24
+ stroke: "var(--mantine-color-gray-4)",
25
25
  strokeWidth: "1",
26
26
  fill: "none"
27
27
  }
@@ -37,7 +37,7 @@ function s({
37
37
  }
38
38
  );
39
39
  }
40
- function d({
40
+ function w({
41
41
  size: t = 24,
42
42
  bgColor: r,
43
43
  borderColor: e
@@ -66,6 +66,6 @@ function d({
66
66
  );
67
67
  }
68
68
  export {
69
- d as HighlightSwatch,
69
+ w as HighlightSwatch,
70
70
  s as TextColorIcon
71
71
  };
@@ -1,4 +1,5 @@
1
1
  import type { FlexProps } from '@mantine/core';
2
+ import type { TFunction } from 'i18next';
2
3
  export type ColorItem = string | {
3
4
  value: string;
4
5
  label?: string;
@@ -41,9 +42,10 @@ export interface ColorPickerCompactProps extends Omit<ColorPickerBaseProps, 'sec
41
42
  }
42
43
  export declare function normalizeColorItem(item: ColorItem): {
43
44
  value: string;
44
- label: string;
45
+ label?: string;
45
46
  border?: string;
46
47
  bg?: string;
47
48
  };
48
49
  export declare function isDefaultColor(value: string): boolean;
50
+ export declare const resolveColorLabel: (t: TFunction, value: string | null | undefined, explicitLabel?: string) => string;
49
51
  //# sourceMappingURL=types.d.ts.map
@@ -1 +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,gBA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;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,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAEA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,eAAO,MAAM,iBAAiB,GAC5B,GAAG,SAAS,EACZ,OAAO,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,gBAAgB,MAAM,KACrB,MAIF,CAAC"}
@@ -1,10 +1,16 @@
1
- function n(r) {
2
- return typeof r == "string" ? { value: r, label: r } : { label: r.value, ...r };
1
+ function f(r) {
2
+ return typeof r == "string" ? { value: r } : r;
3
3
  }
4
- function l(r) {
4
+ function e(r) {
5
5
  return r === "inherit" || r === "" || r === "default";
6
6
  }
7
+ const s = (r, o, n) => {
8
+ if (n) return n;
9
+ const t = !o || e(o) ? "standard" : o;
10
+ return r(`colorPicker.colors.${t}`, { defaultValue: o || "" });
11
+ };
7
12
  export {
8
- l as isDefaultColor,
9
- n as normalizeColorItem
13
+ e as isDefaultColor,
14
+ f as normalizeColorItem,
15
+ s as resolveColorLabel
10
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CommentEditorHotkeys.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/CommentEditorHotkeys.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAI/C,eAAO,MAAM,oBAAoB,GAAI,8GAWlC;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvC,iBAAiB,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC/C,YAAY,EAAE;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,oBAAoB,CAAC,iBAAiB,EAAE,CAAC;KACjD,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;CACZ,4CAwJA,CAAC"}
1
+ {"version":3,"file":"CommentEditorHotkeys.d.ts","sourceRoot":"","sources":["../../../src/components/CommentComposer/CommentEditorHotkeys.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAI/C,eAAO,MAAM,oBAAoB,GAAI,8GAWlC;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACvC,iBAAiB,EAAE,KAAK,CAAC,gBAAgB,CAAC,G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