@layers-app/shared 0.4.7 → 0.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/dist/assets/default-workspace-avatar.jpg.js +1 -1
  2. package/dist/components/AliasTextInput/AliasTextInput.d.ts.map +1 -1
  3. package/dist/components/AliasTextInput/AliasTextInput.js +32 -32
  4. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +13 -13
  5. package/dist/components/AppContainer/AppContainer.d.ts +1 -1
  6. package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
  7. package/dist/components/AppContainer/AppContainer.js +76 -71
  8. package/dist/components/AppContainer/AppContainer.module.css.js +14 -14
  9. package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
  10. package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +77 -49
  11. package/dist/components/AppContainer/components/NavbarContent.d.ts.map +1 -1
  12. package/dist/components/AppContainer/components/NavbarContent.js +16 -2
  13. package/dist/components/AppContainer/components/ToolSidebar.d.ts +5 -0
  14. package/dist/components/AppContainer/components/ToolSidebar.d.ts.map +1 -1
  15. package/dist/components/AppContainer/components/ToolSidebar.js +42 -30
  16. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +90 -90
  17. package/dist/components/AppContainer/types.d.ts +12 -0
  18. package/dist/components/AppContainer/types.d.ts.map +1 -1
  19. package/dist/components/AppShell/AppShell.module.css.js +5 -5
  20. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
  21. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +59 -52
  22. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
  23. package/dist/components/AttachmentsGalleryModal/components/useAttachmentVideoStatus.d.ts +1 -0
  24. package/dist/components/AttachmentsGalleryModal/components/useAttachmentVideoStatus.d.ts.map +1 -1
  25. package/dist/components/AttachmentsGalleryModal/components/useAttachmentVideoStatus.js +16 -15
  26. package/dist/components/AttachmentsGalleryModal/styles.module.css.js +22 -22
  27. package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts +3 -1
  28. package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
  29. package/dist/components/AttachmentsPreview/AttachmentsPreview.js +237 -93
  30. package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +22 -20
  31. package/dist/components/BouncingLogo/BouncingLogo.module.css.js +4 -4
  32. package/dist/components/Chat/CallMessage/CallMessage.module.css.js +8 -8
  33. package/dist/components/Chat/ChatBubble/ChatBubble.module.css.js +1 -1
  34. package/dist/components/Chat/ChatHeader/ChatHeader.module.css.js +1 -1
  35. package/dist/components/Chat/ChatInput/ChatInput.module.css.js +44 -44
  36. package/dist/components/Chat/ChatInput/index.d.ts +13 -1
  37. package/dist/components/Chat/ChatInput/index.d.ts.map +1 -1
  38. package/dist/components/Chat/ChatInput/index.js +264 -164
  39. package/dist/components/Chat/ChatInput/useVoiceRecorder.d.ts +16 -0
  40. package/dist/components/Chat/ChatInput/useVoiceRecorder.d.ts.map +1 -0
  41. package/dist/components/Chat/ChatInput/useVoiceRecorder.js +83 -0
  42. package/dist/components/Chat/ChatLayout/ChatLayout.module.css.js +4 -4
  43. package/dist/components/Chat/ChatMessage/ChatMessage.module.css.js +20 -16
  44. package/dist/components/Chat/ChatMessage/index.d.ts +16 -0
  45. package/dist/components/Chat/ChatMessage/index.d.ts.map +1 -1
  46. package/dist/components/Chat/ChatMessage/index.js +153 -118
  47. package/dist/components/Chat/ChatPill/ChatPill.module.css.js +1 -1
  48. package/dist/components/Chat/DialogItem/DialogItem.module.css.js +4 -4
  49. package/dist/components/Chat/DialogList/DialogList.module.css.js +1 -1
  50. package/dist/components/Chat/MediaDocument/MediaDocument.module.css.js +4 -4
  51. package/dist/components/Chat/MessageActions/MessageActions.module.css.js +1 -1
  52. package/dist/components/Chat/MessageActions/index.d.ts +2 -0
  53. package/dist/components/Chat/MessageActions/index.d.ts.map +1 -1
  54. package/dist/components/Chat/MessageActions/index.js +188 -50
  55. package/dist/components/Chat/MessageAuthor/index.d.ts +7 -1
  56. package/dist/components/Chat/MessageAuthor/index.d.ts.map +1 -1
  57. package/dist/components/Chat/MessageAuthor/index.js +39 -25
  58. package/dist/components/Chat/MessageForward/MessageForward.module.css.js +1 -1
  59. package/dist/components/Chat/MessageList/MessageList.module.css.js +14 -12
  60. package/dist/components/Chat/MessageList/index.d.ts +17 -25
  61. package/dist/components/Chat/MessageList/index.d.ts.map +1 -1
  62. package/dist/components/Chat/MessageList/index.js +201 -149
  63. package/dist/components/Chat/MessageMeta/MessageMeta.module.css.js +3 -3
  64. package/dist/components/Chat/MessageReactions/MessageReactions.module.css.js +12 -12
  65. package/dist/components/Chat/MessageReply/MessageReply.module.css.js +7 -7
  66. package/dist/components/Chat/MessageStatus/MessageStatus.module.css.js +8 -8
  67. package/dist/components/Chat/ServiceMessage/ServiceMessage.module.css.js +1 -1
  68. package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
  69. package/dist/components/ColorPicker/ColorPicker.module.css.js +32 -26
  70. package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
  71. package/dist/components/ColorPicker/ColorPickerList.js +83 -72
  72. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts +1 -0
  73. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
  74. package/dist/components/ColorPicker/ColorPickerToolbar.js +94 -85
  75. package/dist/components/ColorPicker/icons.js +5 -5
  76. package/dist/components/ColorPicker/types.d.ts +6 -0
  77. package/dist/components/ColorPicker/types.d.ts.map +1 -1
  78. package/dist/components/ColorPicker/types.js +53 -11
  79. package/dist/components/ColorPicker/useRecentColors.d.ts +3 -1
  80. package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -1
  81. package/dist/components/ColorPicker/useRecentColors.js +43 -20
  82. package/dist/components/CommentComposer/CommentComposer.module.css.js +14 -10
  83. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts +2 -1
  84. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
  85. package/dist/components/CommentComposer/CommentEditorHotkeys.js +29 -26
  86. package/dist/components/CommentComposer/index.d.ts +2 -1
  87. package/dist/components/CommentComposer/index.d.ts.map +1 -1
  88. package/dist/components/CommentComposer/index.js +333 -313
  89. package/dist/components/CommentComposer/types.d.ts +10 -0
  90. package/dist/components/CommentComposer/types.d.ts.map +1 -1
  91. package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
  92. package/dist/components/Copyright/Copyright.module.css.js +1 -1
  93. package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
  94. package/dist/components/CustomKBD/index.js +21 -22
  95. package/dist/components/EmojiPicker/EmojiPicker.d.ts +1 -0
  96. package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  97. package/dist/components/EmojiPicker/EmojiPicker.js +129 -121
  98. package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
  99. package/dist/components/EntityTitle/EntityTitle.d.ts +3 -4
  100. package/dist/components/EntityTitle/EntityTitle.d.ts.map +1 -1
  101. package/dist/components/EntityTitle/EntityTitle.js +81 -80
  102. package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
  103. package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
  104. package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
  105. package/dist/components/FilePicker/FilePicker.module.css.js +7 -7
  106. package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
  107. package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
  108. package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
  109. package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
  110. package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
  111. package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
  112. package/dist/components/FormViewer/helpers/conditions.d.ts.map +1 -1
  113. package/dist/components/FormViewer/helpers/conditions.js +33 -17
  114. package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
  115. package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
  116. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
  117. package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
  118. package/dist/components/Loaders/styles.module.css.js +6 -6
  119. package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
  120. package/dist/components/MusicPlayerBar/MusicPlayerBar.module.css.js +23 -23
  121. package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
  122. package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
  123. package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
  124. package/dist/components/Notification/InfiniteScroll.d.ts +12 -0
  125. package/dist/components/Notification/InfiniteScroll.d.ts.map +1 -0
  126. package/dist/components/Notification/InfiniteScroll.js +42 -0
  127. package/dist/components/Notification/Notification.d.ts +4 -1
  128. package/dist/components/Notification/Notification.d.ts.map +1 -1
  129. package/dist/components/Notification/Notification.module.css.js +28 -4
  130. package/dist/components/Notification/atoms/ActionBadge.d.ts +11 -0
  131. package/dist/components/Notification/atoms/ActionBadge.d.ts.map +1 -0
  132. package/dist/components/Notification/atoms/ActionBadge.js +53 -0
  133. package/dist/components/Notification/atoms/ArchiveIcon.d.ts +7 -0
  134. package/dist/components/Notification/atoms/ArchiveIcon.d.ts.map +1 -0
  135. package/dist/components/Notification/atoms/ArchiveIcon.js +40 -0
  136. package/dist/components/Notification/atoms/InboxIcon.d.ts +7 -0
  137. package/dist/components/Notification/atoms/InboxIcon.d.ts.map +1 -0
  138. package/dist/components/Notification/atoms/InboxIcon.js +33 -0
  139. package/dist/components/Notification/atoms/MarkReadIcon.d.ts +7 -0
  140. package/dist/components/Notification/atoms/MarkReadIcon.d.ts.map +1 -0
  141. package/dist/components/Notification/atoms/MarkReadIcon.js +33 -0
  142. package/dist/components/Notification/atoms/ResourceIcon.d.ts +7 -0
  143. package/dist/components/Notification/atoms/ResourceIcon.d.ts.map +1 -0
  144. package/dist/components/Notification/atoms/TabBadge.d.ts +7 -0
  145. package/dist/components/Notification/atoms/TabBadge.d.ts.map +1 -0
  146. package/dist/components/Notification/atoms/TabBadge.js +32 -0
  147. package/dist/components/Notification/atoms/UnreadDot.d.ts +6 -0
  148. package/dist/components/Notification/atoms/UnreadDot.d.ts.map +1 -0
  149. package/dist/components/Notification/atoms/UnreadDot.js +23 -0
  150. package/dist/components/Notification/atoms/index.d.ts +5 -0
  151. package/dist/components/Notification/atoms/index.d.ts.map +1 -0
  152. package/dist/components/Notification/hooks/index.d.ts +8 -0
  153. package/dist/components/Notification/hooks/index.d.ts.map +1 -0
  154. package/dist/components/Notification/hooks/useInboxActions.d.ts +12 -0
  155. package/dist/components/Notification/hooks/useInboxActions.d.ts.map +1 -0
  156. package/dist/components/Notification/hooks/useInboxActions.js +58 -0
  157. package/dist/components/Notification/hooks/useInboxLoader.d.ts +8 -0
  158. package/dist/components/Notification/hooks/useInboxLoader.d.ts.map +1 -0
  159. package/dist/components/Notification/hooks/useInboxLoader.js +49 -0
  160. package/dist/components/Notification/hooks/useNotificationItem.d.ts +26 -0
  161. package/dist/components/Notification/hooks/useNotificationItem.d.ts.map +1 -0
  162. package/dist/components/Notification/hooks/useNotificationItem.js +51 -0
  163. package/dist/components/Notification/hooks/useNotificationStore.d.ts +49 -0
  164. package/dist/components/Notification/hooks/useNotificationStore.d.ts.map +1 -0
  165. package/dist/components/Notification/hooks/useNotificationStore.js +139 -0
  166. package/dist/components/Notification/hooks/useNotificationStream.d.ts +2 -0
  167. package/dist/components/Notification/hooks/useNotificationStream.d.ts.map +1 -0
  168. package/dist/components/Notification/hooks/useNotificationStream.js +86 -0
  169. package/dist/components/Notification/hooks/useNotificationTime.d.ts +2 -0
  170. package/dist/components/Notification/hooks/useNotificationTime.d.ts.map +1 -0
  171. package/dist/components/Notification/hooks/useNotificationTime.js +23 -0
  172. package/dist/components/Notification/hooks/useNotificationsApi.d.ts +25 -0
  173. package/dist/components/Notification/hooks/useNotificationsApi.d.ts.map +1 -0
  174. package/dist/components/Notification/hooks/useNotificationsApi.js +64 -0
  175. package/dist/components/Notification/lib/api.d.ts +4 -0
  176. package/dist/components/Notification/lib/api.d.ts.map +1 -0
  177. package/dist/components/Notification/lib/api.js +19 -0
  178. package/dist/components/Notification/lib/index.d.ts +5 -0
  179. package/dist/components/Notification/lib/index.d.ts.map +1 -0
  180. package/dist/components/Notification/lib/notificationText.d.ts +10 -0
  181. package/dist/components/Notification/lib/notificationText.d.ts.map +1 -0
  182. package/dist/components/Notification/lib/notificationText.js +131 -0
  183. package/dist/components/Notification/lib/stripHtml.d.ts +2 -0
  184. package/dist/components/Notification/lib/stripHtml.d.ts.map +1 -0
  185. package/dist/components/Notification/lib/stripHtml.js +6 -0
  186. package/dist/components/Notification/lib/types.d.ts +45 -0
  187. package/dist/components/Notification/lib/types.d.ts.map +1 -0
  188. package/dist/components/Notification/lib/types.js +9 -0
  189. package/dist/components/Notification/molecules/InboxEmpty.d.ts +8 -0
  190. package/dist/components/Notification/molecules/InboxEmpty.d.ts.map +1 -0
  191. package/dist/components/Notification/molecules/InboxEmpty.js +21 -0
  192. package/dist/components/Notification/molecules/InboxHeader.d.ts +17 -0
  193. package/dist/components/Notification/molecules/InboxHeader.d.ts.map +1 -0
  194. package/dist/components/Notification/molecules/InboxHeader.js +73 -0
  195. package/dist/components/Notification/molecules/InboxTabs.d.ts +15 -0
  196. package/dist/components/Notification/molecules/InboxTabs.d.ts.map +1 -0
  197. package/dist/components/Notification/molecules/InboxTabs.js +60 -0
  198. package/dist/components/Notification/molecules/NotificationActions.d.ts +9 -0
  199. package/dist/components/Notification/molecules/NotificationActions.d.ts.map +1 -0
  200. package/dist/components/Notification/molecules/NotificationActions.js +64 -0
  201. package/dist/components/Notification/molecules/NotificationAvatar.d.ts +17 -0
  202. package/dist/components/Notification/molecules/NotificationAvatar.d.ts.map +1 -0
  203. package/dist/components/Notification/molecules/NotificationAvatar.js +38 -0
  204. package/dist/components/Notification/molecules/NotificationContent.d.ts +22 -0
  205. package/dist/components/Notification/molecules/NotificationContent.d.ts.map +1 -0
  206. package/dist/components/Notification/molecules/NotificationContent.js +183 -0
  207. package/dist/components/Notification/molecules/index.d.ts +7 -0
  208. package/dist/components/Notification/molecules/index.d.ts.map +1 -0
  209. package/dist/components/Notification/organisms/InboxItem.d.ts +14 -0
  210. package/dist/components/Notification/organisms/InboxItem.d.ts.map +1 -0
  211. package/dist/components/Notification/organisms/InboxItem.js +100 -0
  212. package/dist/components/Notification/organisms/InboxPanel.d.ts +4 -0
  213. package/dist/components/Notification/organisms/InboxPanel.d.ts.map +1 -0
  214. package/dist/components/Notification/organisms/InboxPanel.js +99 -0
  215. package/dist/components/Notification/organisms/index.d.ts +3 -0
  216. package/dist/components/Notification/organisms/index.d.ts.map +1 -0
  217. package/dist/components/PillTabs/PillTabs.module.css.js +1 -1
  218. package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
  219. package/dist/components/SettingsSection/styles.module.css.js +1 -1
  220. package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
  221. package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
  222. package/dist/components/modals/RemoveConfirmModal.d.ts.map +1 -1
  223. package/dist/components/modals/RemoveConfirmModal.js +27 -26
  224. package/dist/components/table/FrontTable.d.ts.map +1 -1
  225. package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
  226. package/dist/config/envConfig.d.ts +2 -0
  227. package/dist/config/envConfig.d.ts.map +1 -1
  228. package/dist/config/envConfig.js +29 -28
  229. package/dist/helpers/getFileIcons.js +5 -5
  230. package/dist/helpers/getFileType.d.ts +1 -1
  231. package/dist/helpers/getFileType.d.ts.map +1 -1
  232. package/dist/helpers/getFileType.js +11 -1
  233. package/dist/helpers/platform.d.ts +1 -1
  234. package/dist/helpers/platform.d.ts.map +1 -1
  235. package/dist/helpers/platform.js +1 -0
  236. package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
  237. package/dist/helpers/showNotifications.module.css.js +1 -1
  238. package/dist/hooks/useDateUtils.d.ts +3 -1
  239. package/dist/hooks/useDateUtils.d.ts.map +1 -1
  240. package/dist/hooks/useDateUtils.js +23 -18
  241. package/dist/index.css +1 -1
  242. package/dist/index.js +595 -588
  243. package/dist/lang/locales/ui_en.json.js +9 -7
  244. package/dist/lang/locales/ui_es.json.js +6 -4
  245. package/dist/lang/locales/ui_ru.json.js +8 -6
  246. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/Audio.context.js +15 -0
  247. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/Audio.js +228 -0
  248. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/Audio.module.css.js +4 -0
  249. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioControls.js +19 -0
  250. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioMuteButton.js +30 -0
  251. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioPlayButton.js +40 -0
  252. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioSkipButton.js +28 -0
  253. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioSpectrum.js +137 -0
  254. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioSpeedControl.js +31 -0
  255. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioTimeDisplay.js +44 -0
  256. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioTimeline.js +71 -0
  257. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioVolumeSlider.js +43 -0
  258. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioWaveform.js +166 -0
  259. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/use-audio.js +201 -0
  260. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/Video.context.js +15 -0
  261. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/Video.js +272 -0
  262. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/Video.module.css.js +4 -0
  263. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoCaptionsButton.js +55 -0
  264. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoControls.js +30 -0
  265. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoFullscreenButton.js +31 -0
  266. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoMuteButton.js +29 -0
  267. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoPiPButton.js +29 -0
  268. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoPlayButton.js +28 -0
  269. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoSkipButton.js +27 -0
  270. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoTimeDisplay.js +44 -0
  271. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoTimeline.js +70 -0
  272. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/use-video.js +170 -0
  273. package/docs/README.md +499 -499
  274. package/package.json +81 -79
  275. package/dist/components/Notification/Notification.js +0 -119
  276. package/dist/components/Notification/NotificationCard.d.ts +0 -10
  277. package/dist/components/Notification/NotificationCard.d.ts.map +0 -1
  278. package/dist/components/Notification/NotificationCard.js +0 -93
@@ -1,32 +1,32 @@
1
- import { jsxs as y, jsx as r } from "react/jsx-runtime";
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 { useComputedColorScheme as L, Box as S, useMantineTheme as F, getThemeColor as N, 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 i from "./ColorPicker.module.css.js";
1
+ import { jsxs as C, jsx as r } from "react/jsx-runtime";
2
+ import { useTranslation as x } from "react-i18next";
3
+ import { Tick02Icon as L } from "@hugeicons/core-free-icons";
4
+ import { HugeiconsIcon as T } from "@hugeicons/react";
5
+ import { useComputedColorScheme as S, Box as F, useMantineTheme as E, getThemeColor as O, ColorSwatch as R } from "@mantine/core";
6
+ import { TextColorIcon as w } from "./icons.js";
7
+ import { normalizeColorItem as I, RECENT_COLOR_HOTKEY as z, resolveRecentKind as D, colorsEqual as K, resolveColorLabel as $, isDefaultColor as N } from "./types.js";
8
+ import { useRecentColors as M } from "./useRecentColors.js";
9
+ import s from "./ColorPicker.module.css.js";
10
10
  function j({
11
11
  type: e,
12
- colorValue: l,
13
- resolvedColor: n,
14
- border: s,
15
- bg: c
12
+ colorValue: n,
13
+ resolvedColor: i,
14
+ border: c,
15
+ bg: m
16
16
  }) {
17
17
  if (e === "text")
18
- return /* @__PURE__ */ r(z, { size: 16, color: n, showBorder: !0 });
19
- const a = b(l);
18
+ return /* @__PURE__ */ r(w, { size: 16, color: i, showBorder: !0 });
19
+ const a = N(n);
20
20
  return /* @__PURE__ */ r(
21
- T,
21
+ R,
22
22
  {
23
- color: a ? "var(--mantine-color-body)" : c || s || l,
23
+ color: a ? "var(--mantine-color-body)" : m || c || n,
24
24
  size: 16,
25
25
  radius: "xl",
26
- className: i.listItemSwatch,
26
+ className: s.listItemSwatch,
27
27
  styles: {
28
28
  root: {
29
- border: `1.5px solid ${a ? "var(--mantine-color-default-border)" : s || n}`
29
+ border: `1.5px solid ${a ? "var(--mantine-color-default-border)" : c || i}`
30
30
  },
31
31
  alphaOverlay: { display: "none" },
32
32
  shadowOverlay: { display: "none" }
@@ -34,102 +34,113 @@ function j({
34
34
  }
35
35
  );
36
36
  }
37
- function v({
37
+ function g({
38
38
  section: e,
39
- columns: l,
40
- onChange: n,
41
- isDark: s
39
+ columns: n,
40
+ onChange: i,
41
+ isDark: c,
42
+ itemCaption: m
42
43
  }) {
43
- const c = F(), { t: a } = g("ui"), p = l > 1;
44
- return /* @__PURE__ */ y("div", { className: i.section, children: [
45
- e.label && /* @__PURE__ */ r("div", { className: i.sectionLabel, children: e.label }),
44
+ const a = E(), { t: v } = x("ui"), y = n > 1;
45
+ return /* @__PURE__ */ C("div", { className: s.section, children: [
46
+ e.label && /* @__PURE__ */ r("div", { className: s.sectionLabel, children: e.label }),
46
47
  /* @__PURE__ */ r(
47
48
  "div",
48
49
  {
49
- className: p ? i.grid : void 0,
50
- style: p ? { gridTemplateColumns: `repeat(${l}, minmax(0, 1fr))` } : void 0,
51
- children: e.colors.map((d) => {
50
+ className: y ? s.grid : void 0,
51
+ style: y ? { gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` } : void 0,
52
+ children: e.colors.map((u) => {
52
53
  const {
53
- value: o,
54
- label: f,
55
- border: u,
56
- bg: h
57
- } = $(d), t = b(o), m = o === e.value, C = t ? s ? "#FFFFFF" : "#000000" : N(o, c), I = D(a, o, f);
58
- return /* @__PURE__ */ y(
54
+ value: l,
55
+ label: b,
56
+ border: p,
57
+ bg: f
58
+ } = I(u), t = N(l), d = K(l, e.value), h = t ? c ? "#FFFFFF" : "#000000" : O(l, a), o = $(v, l, b);
59
+ return /* @__PURE__ */ C(
59
60
  "button",
60
61
  {
61
62
  type: "button",
62
- className: `${i.listItem} ${m ? i.listItemActive : ""}`,
63
- onClick: () => n(o, e.key),
63
+ className: `${s.listItem} ${d ? s.listItemActive : ""}`,
64
+ onClick: () => i(l, e.key),
64
65
  children: [
65
66
  /* @__PURE__ */ r(
66
67
  j,
67
68
  {
68
69
  type: e.type,
69
- colorValue: o,
70
- resolvedColor: C,
71
- border: u,
72
- bg: h
70
+ colorValue: l,
71
+ resolvedColor: h,
72
+ border: p,
73
+ bg: f
73
74
  }
74
75
  ),
75
- /* @__PURE__ */ r("span", { className: i.listItemLabel, children: I }),
76
- m && /* @__PURE__ */ r(
77
- x,
76
+ /* @__PURE__ */ r("span", { className: s.listItemLabel, children: o }),
77
+ m && /* @__PURE__ */ r("span", { className: s.listItemCaption, children: m }),
78
+ d && /* @__PURE__ */ r(
79
+ T,
78
80
  {
79
81
  size: 16,
80
- icon: k,
82
+ icon: L,
81
83
  color: "var(--mantine-primary-color-filled)"
82
84
  }
83
85
  )
84
86
  ]
85
87
  },
86
- o
88
+ l
87
89
  );
88
90
  })
89
91
  }
90
92
  )
91
93
  ] });
92
94
  }
93
- function P({
95
+ function J({
94
96
  sections: e,
95
- colors: l,
96
- value: n,
97
- onChange: s,
98
- columns: c = 1,
97
+ colors: n,
98
+ value: i,
99
+ onChange: c,
100
+ columns: m = 1,
99
101
  withRecentColors: a
100
102
  }) {
101
- const d = L("light", {
103
+ const { t: v } = x("ui"), u = S("light", {
102
104
  getInitialValueInEffect: !0
103
- }) === "dark", { recentColors: o, addRecent: f } = w(), u = (t, m) => {
104
- a && f(t, m), s?.(t, m);
105
- }, h = e || (l ? [{ key: "default", label: "", colors: l, value: n }] : []);
106
- return /* @__PURE__ */ y(S, { children: [
107
- a && o.length > 0 && /* @__PURE__ */ r(
108
- v,
105
+ }) === "dark", { recentColors: l, addRecent: b } = M(), p = (o, k) => {
106
+ a && b(o, k), c?.(o, k);
107
+ }, f = e || (n ? [{ key: "default", label: "", colors: n, value: i }] : []), t = l[0], d = t ? f.find((o) => o.key === t.sectionKey)?.colors.find(
108
+ (o) => I(o).value === t.value
109
+ ) : void 0, h = d ? I(d) : void 0;
110
+ return /* @__PURE__ */ C(F, { w: "100%", children: [
111
+ a && t && /* @__PURE__ */ r(
112
+ g,
109
113
  {
110
114
  section: {
111
- key: "__recent",
112
- label: "Recently used",
113
- colors: o.map((t) => t.value),
114
- value: n
115
+ key: t.sectionKey ?? "",
116
+ label: v("colorPicker.recentlyUsed"),
117
+ type: D(t.sectionKey),
118
+ colors: [
119
+ {
120
+ value: t.value,
121
+ label: h?.label,
122
+ border: t.border ?? h?.border
123
+ }
124
+ ]
115
125
  },
116
126
  columns: 1,
117
- onChange: u,
118
- isDark: d
127
+ itemCaption: z,
128
+ onChange: p,
129
+ isDark: u
119
130
  }
120
131
  ),
121
- h.map((t) => /* @__PURE__ */ r(
122
- v,
132
+ f.map((o) => /* @__PURE__ */ r(
133
+ g,
123
134
  {
124
- section: t,
125
- columns: c,
126
- onChange: u,
127
- isDark: d
135
+ section: o,
136
+ columns: m,
137
+ onChange: p,
138
+ isDark: u
128
139
  },
129
- t.key
140
+ o.key
130
141
  ))
131
142
  ] });
132
143
  }
133
144
  export {
134
- P as ColorPickerList
145
+ J as ColorPickerList
135
146
  };
@@ -8,6 +8,7 @@ export interface ColorPickerToolbarProps {
8
8
  maxRecentColors?: number;
9
9
  disabled?: boolean;
10
10
  recentColorsLabel?: string;
11
+ tooltipZIndex?: number;
11
12
  }
12
13
  export declare const ColorPickerToolbar: import("react").ForwardRefExoticComponent<ColorPickerToolbarProps & import("react").RefAttributes<HTMLDivElement>>;
13
14
  //# sourceMappingURL=ColorPickerToolbar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPickerToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerToolbar.tsx"],"names":[],"mappings":"AAYA,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,oHAiM9B,CAAC"}
1
+ {"version":3,"file":"ColorPickerToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPickerToolbar.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAYjE;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;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAwCD,eAAO,MAAM,kBAAkB,oHA+M9B,CAAC"}
@@ -1,109 +1,116 @@
1
- import { jsxs as g, jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as H, useState as M, useCallback as S, useMemo as j } from "react";
3
- import { useTranslation as E } from "react-i18next";
4
- import { useComputedColorScheme as P, Box as h, Flex as A, Tooltip as U, UnstyledButton as V } from "@mantine/core";
5
- import { TextColorIcon as B, HighlightSwatch as K } from "./icons.js";
6
- import { normalizeColorItem as w, resolveColorLabel as T, isDefaultColor as q } from "./types.js";
7
- import { useRecentColors as G } from "./useRecentColors.js";
8
- import n from "./ColorPicker.module.css.js";
9
- function v({
10
- isActive: s,
11
- round: d,
12
- disabled: u,
13
- onClick: f,
1
+ import { jsxs as v, jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as M, useState as O, useCallback as w, useMemo as j } from "react";
3
+ import { useTranslation as P } from "react-i18next";
4
+ import { useComputedColorScheme as U, Box as m, Flex as A, Tooltip as _, UnstyledButton as q } from "@mantine/core";
5
+ import { TextColorIcon as B, HighlightSwatch as E } from "./icons.js";
6
+ import { normalizeColorItem as L, resolveColorLabel as z, isDefaultColor as V, RECENT_COLOR_HOTKEY as Y, colorsEqual as G } from "./types.js";
7
+ import { useRecentColors as J } from "./useRecentColors.js";
8
+ import t from "./ColorPicker.module.css.js";
9
+ function S({
10
+ isActive: h,
11
+ round: f,
12
+ disabled: d,
13
+ onClick: b,
14
14
  children: i,
15
- tooltipLabel: p
15
+ tooltipLabel: p,
16
+ tooltipZIndex: a
16
17
  }) {
17
- const b = /* @__PURE__ */ t(
18
- V,
18
+ const C = /* @__PURE__ */ r(
19
+ q,
19
20
  {
20
21
  type: "button",
21
- className: `${n.inlineSwatch}${d ? ` ${n.inlineSwatchRound}` : ""}${s ? ` ${n.inlineSwatchActive}` : ""}`,
22
- onMouseDown: (m) => m.preventDefault(),
23
- onClick: f,
24
- disabled: u,
22
+ className: `${t.inlineSwatch}${f ? ` ${t.inlineSwatchRound}` : ""}${h ? ` ${t.inlineSwatchActive}` : ""}`,
23
+ onMouseDown: (s) => s.preventDefault(),
24
+ onClick: b,
25
+ disabled: d,
25
26
  children: i
26
27
  }
27
28
  );
28
- return p ? /* @__PURE__ */ t(U, { label: p, withArrow: !0, zIndex: 400, children: b }) : b;
29
+ return p ? /* @__PURE__ */ r(_, { label: p, withArrow: !0, zIndex: a, children: C }) : C;
29
30
  }
30
- const oe = H(
31
+ const ce = M(
31
32
  ({
32
- sections: s,
33
- onChange: d,
34
- withRecentColors: u,
35
- maxRecentColors: f = 9,
33
+ sections: h,
34
+ onChange: f,
35
+ withRecentColors: d,
36
+ maxRecentColors: b = 10,
36
37
  disabled: i,
37
- recentColorsLabel: p = "Recently used"
38
- }, b) => {
39
- const { t: m } = E("ui"), x = P("light", {
38
+ recentColorsLabel: p,
39
+ tooltipZIndex: a = 400
40
+ }, C) => {
41
+ const { t: s } = P("ui"), D = p ?? s("colorPicker.recentlyUsed"), $ = U("light", {
40
42
  getInitialValueInEffect: !0
41
- }) === "dark", { recentColors: z, addRecent: $ } = G({
42
- maxItems: f
43
- }), [L, D] = M(z), k = S(
44
- (e, o, c) => {
45
- u && ($(e, o, c), D((l) => {
46
- const r = l.filter(
47
- (a) => !(a.value === e && a.sectionKey === o)
43
+ }) === "dark", { recentColors: H, addRecent: N } = J({
44
+ maxItems: b
45
+ }), [R, y] = O(H), k = w(
46
+ (e, o, n) => {
47
+ d && (N(e, o, n), y((l) => {
48
+ const c = l.filter(
49
+ (u) => !(u.value === e && u.sectionKey === o)
48
50
  );
49
- return [{ value: e, sectionKey: o, border: c }, ...r].slice(
51
+ return [{ value: e, sectionKey: o, border: n }, ...c].slice(
50
52
  0,
51
- f
53
+ b
52
54
  );
53
- })), d(e, o);
55
+ })), f(e, o);
54
56
  },
55
- [d, u, $]
56
- ), C = j(() => {
57
+ [f, d, N]
58
+ ), g = j(() => {
57
59
  const e = {};
58
- for (const o of s) e[o.key] = o;
60
+ for (const o of h) e[o.key] = o;
59
61
  return e;
60
- }, [s]), y = S(
62
+ }, [h]), I = w(
61
63
  (e, o) => {
62
- const l = (o ? C[o] : void 0)?.colors.find(
63
- (a) => w(a).value === e
64
- ), r = l ? w(l).label : void 0;
65
- return T(m, e, r);
64
+ const l = (o ? g[o] : void 0)?.colors.find(
65
+ (u) => L(u).value === e
66
+ ), c = l ? L(l).label : void 0;
67
+ return z(s, e, c);
66
68
  },
67
- [C, m]
68
- ), F = S(
69
- (e) => q(e) ? x ? "#FFFFFF" : "#000000" : e,
70
- [x]
69
+ [g, s]
70
+ ), x = w(
71
+ (e) => V(e) ? $ ? "#FFFFFF" : "#000000" : e,
72
+ [$]
71
73
  );
72
- return /* @__PURE__ */ g(h, { ref: b, children: [
73
- u && L.length > 0 && /* @__PURE__ */ g(h, { className: n.inlineSection, children: [
74
- /* @__PURE__ */ t(h, { className: n.inlineSectionLabel, children: p }),
75
- /* @__PURE__ */ t(A, { className: n.inlineRow, gap: 2, children: L.map((e, o) => {
76
- const c = e.sectionKey ? C[e.sectionKey] : void 0, l = c?.key === "textColor" || c?.key === "color" || e.sectionKey === "color", r = y(
74
+ return /* @__PURE__ */ v(m, { ref: C, children: [
75
+ d && R.length > 0 && /* @__PURE__ */ v(m, { className: t.inlineSection, children: [
76
+ /* @__PURE__ */ v(m, { className: t.inlineSectionLabelRow, children: [
77
+ /* @__PURE__ */ r(m, { className: t.inlineSectionLabel, children: D }),
78
+ /* @__PURE__ */ r("span", { className: t.inlineSectionCaption, children: Y })
79
+ ] }),
80
+ /* @__PURE__ */ r(A, { className: t.inlineRow, gap: 2, children: R.map((e, o) => {
81
+ const n = e.sectionKey ? g[e.sectionKey] : void 0, l = n?.key === "textColor" || n?.key === "color" || e.sectionKey === "color", c = I(
77
82
  e.value,
78
83
  e.sectionKey
79
84
  );
80
- return l ? /* @__PURE__ */ t(
81
- v,
85
+ return l ? /* @__PURE__ */ r(
86
+ S,
82
87
  {
83
88
  isActive: !1,
84
89
  disabled: i,
85
- tooltipLabel: r,
90
+ tooltipZIndex: a,
91
+ tooltipLabel: c,
86
92
  onClick: () => k(e.value, e.sectionKey ?? ""),
87
- children: /* @__PURE__ */ t(
93
+ children: /* @__PURE__ */ r(
88
94
  B,
89
95
  {
90
96
  size: 20,
91
- color: F(e.value),
97
+ color: x(e.value),
92
98
  showBorder: !0
93
99
  }
94
100
  )
95
101
  },
96
102
  `${e.sectionKey}-${e.value}-${o}`
97
- ) : /* @__PURE__ */ t(
98
- v,
103
+ ) : /* @__PURE__ */ r(
104
+ S,
99
105
  {
100
106
  isActive: !1,
101
107
  round: !0,
102
108
  disabled: i,
103
- tooltipLabel: r,
109
+ tooltipZIndex: a,
110
+ tooltipLabel: c,
104
111
  onClick: () => k(e.value, e.sectionKey ?? ""),
105
- children: /* @__PURE__ */ t(
106
- K,
112
+ children: /* @__PURE__ */ r(
113
+ E,
107
114
  {
108
115
  bgColor: e.value,
109
116
  borderColor: e.border || "var(--mantine-color-default-border)"
@@ -114,37 +121,39 @@ const oe = H(
114
121
  );
115
122
  }) })
116
123
  ] }),
117
- s.map((e) => {
124
+ h.map((e) => {
118
125
  const o = e.key === "highlight" || e.key === "background" || e.key === "textHighlight";
119
- return /* @__PURE__ */ g(h, { className: n.inlineSection, children: [
120
- e.label && /* @__PURE__ */ t(h, { className: n.inlineSectionLabel, children: e.label }),
121
- /* @__PURE__ */ t(A, { className: n.inlineRow, gap: 2, children: e.colors.map((c) => {
122
- const { value: l, border: r, label: a } = w(c), N = l === e.value, R = F(l), I = T(m, l, a);
123
- return o ? /* @__PURE__ */ t(
124
- v,
126
+ return /* @__PURE__ */ v(m, { className: t.inlineSection, children: [
127
+ e.label && /* @__PURE__ */ r(m, { className: t.inlineSectionLabel, children: e.label }),
128
+ /* @__PURE__ */ r(A, { className: t.inlineRow, gap: 2, children: e.colors.map((n) => {
129
+ const { value: l, border: c, label: u } = L(n), F = G(l, e.value), T = x(l), K = z(s, l, u);
130
+ return o ? /* @__PURE__ */ r(
131
+ S,
125
132
  {
126
- isActive: N,
133
+ isActive: F,
127
134
  round: !0,
128
135
  disabled: i,
129
- tooltipLabel: I,
130
- onClick: () => k(l, e.key, r),
131
- children: /* @__PURE__ */ t(
132
- K,
136
+ tooltipZIndex: a,
137
+ tooltipLabel: K,
138
+ onClick: () => k(l, e.key, c),
139
+ children: /* @__PURE__ */ r(
140
+ E,
133
141
  {
134
142
  bgColor: l,
135
- borderColor: r || R
143
+ borderColor: c || T
136
144
  }
137
145
  )
138
146
  },
139
147
  l
140
- ) : /* @__PURE__ */ t(
141
- v,
148
+ ) : /* @__PURE__ */ r(
149
+ S,
142
150
  {
143
- isActive: N,
151
+ isActive: F,
144
152
  disabled: i,
145
- tooltipLabel: I,
153
+ tooltipZIndex: a,
154
+ tooltipLabel: K,
146
155
  onClick: () => k(l, e.key),
147
- children: /* @__PURE__ */ t(B, { size: 20, color: R, showBorder: !0 })
156
+ children: /* @__PURE__ */ r(B, { size: 20, color: T, showBorder: !0 })
148
157
  },
149
158
  l
150
159
  );
@@ -155,5 +164,5 @@ const oe = H(
155
164
  }
156
165
  );
157
166
  export {
158
- oe as ColorPickerToolbar
167
+ ce as ColorPickerToolbar
159
168
  };
@@ -1,10 +1,10 @@
1
- import { jsx as n, jsxs as c } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as a } from "react/jsx-runtime";
2
2
  function s({
3
3
  size: t = 20,
4
4
  color: r = "var(--mantine-color-white)",
5
5
  showBorder: e
6
6
  }) {
7
- return /* @__PURE__ */ c(
7
+ return /* @__PURE__ */ a(
8
8
  "svg",
9
9
  {
10
10
  xmlns: "http://www.w3.org/2000/svg",
@@ -21,7 +21,7 @@ function s({
21
21
  width: "19",
22
22
  height: "19",
23
23
  rx: "5.5",
24
- stroke: "var(--mantine-color-gray-4)",
24
+ stroke: "light-dark(var(--mantine-color-gray-4), var(--mantine-color-dark-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 w({
40
+ function d({
41
41
  size: t = 24,
42
42
  bgColor: r,
43
43
  borderColor: e
@@ -66,6 +66,6 @@ function w({
66
66
  );
67
67
  }
68
68
  export {
69
- w as HighlightSwatch,
69
+ d as HighlightSwatch,
70
70
  s as TextColorIcon
71
71
  };
@@ -18,6 +18,11 @@ export interface RecentColorEntry {
18
18
  sectionKey?: string;
19
19
  border?: string;
20
20
  }
21
+ export type RecentColorKind = 'text' | 'highlight';
22
+ export declare function isTextSectionKey(sectionKey?: string): boolean;
23
+ export declare function resolveRecentKind(sectionKey?: string): RecentColorKind;
24
+ export declare const IS_APPLE: boolean;
25
+ export declare const RECENT_COLOR_HOTKEY: string;
21
26
  export type ColorPickerOnChange = (value: string, sectionKey?: string) => void;
22
27
  export interface ColorPickerBaseProps {
23
28
  colors?: ColorItem[];
@@ -47,5 +52,6 @@ export declare function normalizeColorItem(item: ColorItem): {
47
52
  bg?: string;
48
53
  };
49
54
  export declare function isDefaultColor(value: string): boolean;
55
+ export declare function colorsEqual(a?: string | null, b?: string | null): boolean;
50
56
  export declare const resolveColorLabel: (t: TFunction, value: string | null | undefined, explicitLabel?: string) => string;
51
57
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../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Q,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;AA0CD,wBAAgB,WAAW,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAIzE;AAED,eAAO,MAAM,iBAAiB,GAC5B,GAAG,SAAS,EACZ,OAAO,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,gBAAgB,MAAM,KACrB,MAIF,CAAC"}
@@ -1,16 +1,58 @@
1
- function f(r) {
2
- return typeof r == "string" ? { value: r } : r;
1
+ function f(t) {
2
+ return t === "textColor" || t === "color";
3
3
  }
4
- function e(r) {
5
- return r === "inherit" || r === "" || r === "default";
4
+ function g(t) {
5
+ return f(t) ? "text" : "highlight";
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 || "" });
7
+ const h = typeof navigator < "u" && /Mac|iPhone|iPod|iPad/i.test(navigator.platform || navigator.userAgent), d = h ? "⌘⇧H" : "Ctrl+Shift+H";
8
+ function $(t) {
9
+ return typeof t == "string" ? { value: t } : t;
10
+ }
11
+ function p(t) {
12
+ return t === "inherit" || t === "" || t === "default";
13
+ }
14
+ function c(t) {
15
+ if (!t) return null;
16
+ const r = t.trim().toLowerCase();
17
+ if (r === "" || r === "inherit" || r === "default" || r === "transparent")
18
+ return "default";
19
+ const o = r.match(/^#([0-9a-f]{3,8})$/);
20
+ if (o) {
21
+ let n = o[1];
22
+ if ((n.length === 3 || n.length === 4) && (n = n.split("").map((e) => e + e).join("")), n.length === 6 || n.length === 8) {
23
+ const e = parseInt(n.slice(0, 2), 16), a = parseInt(n.slice(2, 4), 16), i = parseInt(n.slice(4, 6), 16), l = n.length === 8 ? parseInt(n.slice(6, 8), 16) / 255 : 1;
24
+ return `${e},${a},${i},${Math.round(l * 1e3) / 1e3}`;
25
+ }
26
+ }
27
+ const s = r.match(/^rgba?\(([^)]+)\)$/);
28
+ if (s) {
29
+ const n = s[1].split(",").map((e) => e.trim());
30
+ if (n.length >= 3) {
31
+ const e = parseInt(n[0], 10), a = parseInt(n[1], 10), i = parseInt(n[2], 10), l = n[3] !== void 0 ? parseFloat(n[3]) : 1;
32
+ if (![e, a, i].some(Number.isNaN)) {
33
+ const u = Number.isNaN(l) ? 1 : l;
34
+ return `${e},${a},${i},${Math.round(u * 1e3) / 1e3}`;
35
+ }
36
+ }
37
+ }
38
+ return r;
39
+ }
40
+ function m(t, r) {
41
+ const o = c(t), s = c(r);
42
+ return o !== null && s !== null && o === s;
43
+ }
44
+ const C = (t, r, o) => {
45
+ if (o) return o;
46
+ const s = !r || p(r) ? "standard" : r;
47
+ return t(`colorPicker.colors.${s}`, { defaultValue: r || "" });
11
48
  };
12
49
  export {
13
- e as isDefaultColor,
14
- f as normalizeColorItem,
15
- s as resolveColorLabel
50
+ h as IS_APPLE,
51
+ d as RECENT_COLOR_HOTKEY,
52
+ m as colorsEqual,
53
+ p as isDefaultColor,
54
+ f as isTextSectionKey,
55
+ $ as normalizeColorItem,
56
+ C as resolveColorLabel,
57
+ g as resolveRecentKind
16
58
  };
@@ -1,7 +1,9 @@
1
- import type { RecentColorEntry } from './types';
1
+ import type { RecentColorEntry, RecentColorKind } from './types';
2
2
  interface UseRecentColorsOptions {
3
3
  storageKey?: string;
4
4
  maxItems?: number;
5
+ onApplyShortcut?: (color: string, kind: RecentColorKind) => void;
6
+ shortcutScoped?: boolean;
5
7
  }
6
8
  export declare function useRecentColors(options?: UseRecentColorsOptions): {
7
9
  recentColors: RecentColorEntry[];
@@ -1 +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"}
1
+ {"version":3,"file":"useRecentColors.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/useRecentColors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAQjE,UAAU,sBAAsB;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IACjE,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AA2BD,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,sBAAsB;;uBAepD,MAAM,eAAe,MAAM,WAAW,MAAM;;;EAkDvD"}