@firecms/core 3.0.0 → 3.1.0-canary.02232f4

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 (340) hide show
  1. package/README.md +1 -1
  2. package/dist/components/AIIcon.d.ts +16 -0
  3. package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +7 -1
  4. package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +1 -1
  5. package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +14 -0
  6. package/dist/components/EntityCollectionTable/PropertyTableCell.d.ts +6 -0
  7. package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +5 -4
  8. package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +6 -0
  9. package/dist/components/EntityCollectionTable/internal/popup_field/useDraggable.d.ts +2 -2
  10. package/dist/components/EntityCollectionView/Board.d.ts +2 -0
  11. package/dist/components/EntityCollectionView/BoardColumn.d.ts +42 -0
  12. package/dist/components/EntityCollectionView/BoardColumnTitle.d.ts +9 -0
  13. package/dist/components/EntityCollectionView/BoardSortableList.d.ts +14 -0
  14. package/dist/components/EntityCollectionView/CollectionDataErrorBanner.d.ts +4 -0
  15. package/dist/components/EntityCollectionView/EntityBoardCard.d.ts +26 -0
  16. package/dist/components/EntityCollectionView/EntityCard.d.ts +19 -0
  17. package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +20 -0
  18. package/dist/components/EntityCollectionView/EntityCollectionCardView.d.ts +31 -0
  19. package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +2 -2
  20. package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +7 -3
  21. package/dist/components/EntityCollectionView/FiltersDialog.d.ts +14 -0
  22. package/dist/components/EntityCollectionView/ViewModeToggle.d.ts +44 -0
  23. package/dist/components/EntityCollectionView/board_types.d.ts +105 -0
  24. package/dist/components/EntityCollectionView/useBoardDataController.d.ts +60 -0
  25. package/dist/components/ErrorBoundary.d.ts +4 -2
  26. package/dist/components/HomePage/DefaultHomePage.d.ts +0 -1
  27. package/dist/components/LanguageToggle.d.ts +1 -0
  28. package/dist/components/SelectableTable/SelectableTable.d.ts +5 -1
  29. package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
  30. package/dist/components/UnsavedChangesDialog.d.ts +1 -0
  31. package/dist/components/VirtualTable/VirtualTable.performance.test.d.ts +1 -0
  32. package/dist/components/VirtualTable/VirtualTableCell.d.ts +6 -0
  33. package/dist/components/VirtualTable/VirtualTableHeader.d.ts +4 -1
  34. package/dist/components/VirtualTable/VirtualTableHeaderRow.d.ts +1 -1
  35. package/dist/components/VirtualTable/VirtualTableProps.d.ts +17 -1
  36. package/dist/components/VirtualTable/fields/VirtualTableDateField.d.ts +1 -0
  37. package/dist/components/VirtualTable/types.d.ts +3 -0
  38. package/dist/components/index.d.ts +4 -0
  39. package/dist/contexts/index.d.ts +10 -0
  40. package/dist/core/DrawerNavigationGroup.d.ts +45 -0
  41. package/dist/core/index.d.ts +1 -0
  42. package/dist/editor/components/SlashCommandMenu.d.ts +6 -0
  43. package/dist/editor/components/editor-bubble-item.d.ts +8 -0
  44. package/dist/editor/components/editor-bubble.d.ts +8 -0
  45. package/dist/editor/components/image-bubble.d.ts +5 -0
  46. package/dist/editor/components/index.d.ts +16 -0
  47. package/dist/editor/components/table-bubble.d.ts +5 -0
  48. package/dist/editor/editor.d.ts +30 -0
  49. package/dist/editor/extensions/HighlightDecorationExtension.d.ts +24 -0
  50. package/dist/editor/extensions/Image/index.d.ts +6 -0
  51. package/dist/editor/extensions/Image.d.ts +6 -0
  52. package/dist/editor/extensions/TextLoadingDecorationExtension.d.ts +16 -0
  53. package/dist/editor/extensions/clipboard.d.ts +7 -0
  54. package/dist/editor/extensions/custom-keymap.d.ts +1 -0
  55. package/dist/editor/extensions/drag-and-drop.d.ts +9 -0
  56. package/dist/editor/hooks/useProseMirror.d.ts +13 -0
  57. package/dist/editor/hooks/useProseMirrorContext.d.ts +9 -0
  58. package/dist/editor/index.d.ts +2 -0
  59. package/dist/editor/markdown.d.ts +5 -0
  60. package/dist/editor/nodeViews/ImageComponent.d.ts +3 -0
  61. package/dist/editor/nodeViews/ReactNodeView.d.ts +29 -0
  62. package/dist/editor/nodeViews/TaskItemComponent.d.ts +3 -0
  63. package/dist/editor/nodeViews/index.d.ts +6 -0
  64. package/dist/editor/plugins/index.d.ts +2 -0
  65. package/dist/editor/plugins/inputrules.d.ts +6 -0
  66. package/dist/editor/plugins/placeholderPlugin.d.ts +3 -0
  67. package/dist/editor/plugins/slashCommandPlugin.d.ts +12 -0
  68. package/dist/editor/schema.d.ts +2 -0
  69. package/dist/editor/selectors/ai-selector.d.ts +0 -0
  70. package/dist/editor/selectors/color-selector.d.ts +10 -0
  71. package/dist/editor/selectors/link-selector.d.ts +8 -0
  72. package/dist/editor/selectors/node-selector.d.ts +15 -0
  73. package/dist/editor/selectors/text-buttons.d.ts +1 -0
  74. package/dist/editor/types.d.ts +5 -0
  75. package/dist/editor/useProseMirror.d.ts +16 -0
  76. package/dist/editor/utils/prosemirror-utils.d.ts +6 -0
  77. package/dist/editor/utils/remove_classes.d.ts +1 -0
  78. package/dist/editor/utils/useDebouncedCallback.d.ts +1 -0
  79. package/dist/form/components/ErrorFocus.d.ts +1 -1
  80. package/dist/form/components/LocalChangesMenu.d.ts +2 -2
  81. package/dist/form/components/StorageUploadProgress.d.ts +1 -1
  82. package/dist/form/field_bindings/MapFieldBinding.d.ts +1 -1
  83. package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +1 -1
  84. package/dist/form/validation.d.ts +3 -2
  85. package/dist/hooks/index.d.ts +1 -0
  86. package/dist/hooks/useBreadcrumbsController.d.ts +16 -0
  87. package/dist/hooks/useBuildNavigationController.d.ts +0 -1
  88. package/dist/hooks/useCollapsedGroups.d.ts +6 -3
  89. package/dist/hooks/useTranslation.d.ts +17 -0
  90. package/dist/i18n/FireCMSi18nProvider.d.ts +33 -0
  91. package/dist/index.d.ts +5 -0
  92. package/dist/index.es.js +31028 -16080
  93. package/dist/index.es.js.map +1 -1
  94. package/dist/index.umd.js +29955 -15028
  95. package/dist/index.umd.js.map +1 -1
  96. package/dist/internal/useRestoreScroll.d.ts +1 -1
  97. package/dist/locales/de.d.ts +2 -0
  98. package/dist/locales/en.d.ts +10 -0
  99. package/dist/locales/es.d.ts +10 -0
  100. package/dist/locales/fr.d.ts +2 -0
  101. package/dist/locales/hi.d.ts +2 -0
  102. package/dist/locales/it.d.ts +2 -0
  103. package/dist/locales/pt.d.ts +7 -0
  104. package/dist/preview/PropertyPreviewProps.d.ts +5 -0
  105. package/dist/preview/components/DatePreview.d.ts +13 -3
  106. package/dist/preview/components/ImagePreview.d.ts +5 -1
  107. package/dist/preview/components/StorageThumbnail.d.ts +2 -1
  108. package/dist/preview/components/UrlComponentPreview.d.ts +2 -1
  109. package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +1 -1
  110. package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +1 -1
  111. package/dist/preview/property_previews/SkeletonPropertyComponent.d.ts +1 -1
  112. package/dist/types/analytics.d.ts +1 -1
  113. package/dist/types/collections.d.ts +88 -2
  114. package/dist/types/customization_controller.d.ts +2 -1
  115. package/dist/types/datasource.d.ts +0 -1
  116. package/dist/types/entities.d.ts +1 -0
  117. package/dist/types/firecms.d.ts +2 -1
  118. package/dist/types/index.d.ts +1 -0
  119. package/dist/types/navigation.d.ts +2 -2
  120. package/dist/types/plugins.d.ts +69 -1
  121. package/dist/types/properties.d.ts +277 -12
  122. package/dist/types/storage.d.ts +9 -0
  123. package/dist/types/translations.d.ts +669 -0
  124. package/dist/util/__tests__/conditions.test.d.ts +1 -0
  125. package/dist/util/__tests__/objects.test.d.ts +1 -0
  126. package/dist/util/conditions.d.ts +26 -0
  127. package/dist/util/entities.d.ts +2 -3
  128. package/dist/util/index.d.ts +3 -1
  129. package/dist/util/lazy_eager.d.ts +7 -0
  130. package/dist/util/objects.d.ts +1 -0
  131. package/dist/util/property_utils.d.ts +2 -1
  132. package/dist/util/resolutions.d.ts +3 -3
  133. package/dist/util/useStorageUploadController.d.ts +11 -2
  134. package/package.json +52 -12
  135. package/src/app/Scaffold.tsx +20 -19
  136. package/src/components/AIIcon.tsx +41 -0
  137. package/src/components/ArrayContainer.tsx +7 -8
  138. package/src/components/ClearFilterSortButton.tsx +25 -19
  139. package/src/components/ConfirmationDialog.tsx +4 -4
  140. package/src/components/DeleteEntityDialog.tsx +12 -11
  141. package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +82 -43
  142. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +130 -79
  143. package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +121 -104
  144. package/src/components/EntityCollectionTable/PropertyTableCell.tsx +132 -103
  145. package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +6 -3
  146. package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +24 -44
  147. package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +90 -49
  148. package/src/components/EntityCollectionTable/internal/EntityTableCellActions.tsx +1 -1
  149. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +3 -2
  150. package/src/components/EntityCollectionTable/internal/popup_field/useDraggable.tsx +11 -11
  151. package/src/components/EntityCollectionView/Board.tsx +324 -0
  152. package/src/components/EntityCollectionView/BoardColumn.tsx +158 -0
  153. package/src/components/EntityCollectionView/BoardColumnTitle.tsx +45 -0
  154. package/src/components/EntityCollectionView/BoardSortableList.tsx +174 -0
  155. package/src/components/EntityCollectionView/CollectionDataErrorBanner.tsx +43 -0
  156. package/src/components/EntityCollectionView/EntityBoardCard.tsx +212 -0
  157. package/src/components/EntityCollectionView/EntityCard.tsx +235 -0
  158. package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +706 -0
  159. package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +236 -0
  160. package/src/components/EntityCollectionView/EntityCollectionView.tsx +531 -209
  161. package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +35 -22
  162. package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +86 -15
  163. package/src/components/EntityCollectionView/FiltersDialog.tsx +252 -0
  164. package/src/components/EntityCollectionView/ViewModeToggle.tsx +202 -0
  165. package/src/components/EntityCollectionView/board_types.ts +113 -0
  166. package/src/components/EntityCollectionView/useBoardDataController.tsx +490 -0
  167. package/src/components/EntityJsonPreview.tsx +2 -1
  168. package/src/components/EntityPreview.tsx +1 -1
  169. package/src/components/EntityView.tsx +3 -2
  170. package/src/components/ErrorBoundary.tsx +27 -15
  171. package/src/components/ErrorTooltip.tsx +2 -1
  172. package/src/components/HomePage/DefaultHomePage.tsx +65 -22
  173. package/src/components/HomePage/HomePageDnD.tsx +59 -42
  174. package/src/components/HomePage/NavigationCard.tsx +20 -18
  175. package/src/components/HomePage/NavigationGroup.tsx +20 -17
  176. package/src/components/HomePage/RenameGroupDialog.tsx +15 -15
  177. package/src/components/HomePage/SmallNavigationCard.tsx +10 -9
  178. package/src/components/LanguageToggle.tsx +66 -0
  179. package/src/components/NotFoundPage.tsx +5 -3
  180. package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +12 -17
  181. package/src/components/ReferenceWidget.tsx +5 -6
  182. package/src/components/SearchIconsView.tsx +3 -1
  183. package/src/components/SelectableTable/SelectableTable.tsx +75 -67
  184. package/src/components/SelectableTable/filters/BooleanFilterField.tsx +7 -6
  185. package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +50 -40
  186. package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +53 -40
  187. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +60 -58
  188. package/src/components/UnsavedChangesDialog.tsx +6 -6
  189. package/src/components/UserDisplay.tsx +4 -4
  190. package/src/components/VirtualTable/VirtualTable.performance.test.tsx +387 -0
  191. package/src/components/VirtualTable/VirtualTable.tsx +277 -121
  192. package/src/components/VirtualTable/VirtualTableCell.tsx +18 -2
  193. package/src/components/VirtualTable/VirtualTableHeader.tsx +76 -64
  194. package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +163 -42
  195. package/src/components/VirtualTable/VirtualTableProps.tsx +21 -2
  196. package/src/components/VirtualTable/VirtualTableRow.tsx +1 -1
  197. package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +3 -0
  198. package/src/components/VirtualTable/fields/VirtualTableSelect.tsx +19 -6
  199. package/src/components/VirtualTable/types.tsx +3 -0
  200. package/src/components/common/default_entity_actions.tsx +4 -0
  201. package/src/components/common/useColumnsIds.tsx +95 -3
  202. package/src/components/common/useDataSourceTableController.tsx +12 -4
  203. package/src/components/index.tsx +5 -0
  204. package/src/contexts/BreacrumbsContext.tsx +15 -8
  205. package/src/contexts/index.ts +10 -0
  206. package/src/core/DefaultAppBar.tsx +49 -32
  207. package/src/core/DefaultDrawer.tsx +49 -57
  208. package/src/core/DrawerNavigationGroup.tsx +120 -0
  209. package/src/core/DrawerNavigationItem.tsx +4 -3
  210. package/src/core/EntityEditView.tsx +94 -50
  211. package/src/core/EntityEditViewFormActions.tsx +24 -17
  212. package/src/core/EntitySidePanel.tsx +34 -30
  213. package/src/core/FireCMS.tsx +33 -6
  214. package/src/core/SideDialogs.tsx +4 -2
  215. package/src/core/field_configs.tsx +18 -11
  216. package/src/core/index.tsx +1 -0
  217. package/src/editor/components/SlashCommandMenu.tsx +516 -0
  218. package/src/editor/components/editor-bubble-item.tsx +32 -0
  219. package/src/editor/components/editor-bubble.tsx +118 -0
  220. package/src/editor/components/image-bubble.tsx +156 -0
  221. package/src/editor/components/index.ts +14 -0
  222. package/src/editor/components/table-bubble.tsx +165 -0
  223. package/src/editor/editor.tsx +455 -0
  224. package/src/editor/extensions/HighlightDecorationExtension.ts +114 -0
  225. package/src/editor/extensions/Image/index.ts +133 -0
  226. package/src/editor/extensions/Image.ts +159 -0
  227. package/src/editor/extensions/TextLoadingDecorationExtension.tsx +107 -0
  228. package/src/editor/extensions/clipboard.ts +72 -0
  229. package/src/editor/extensions/custom-keymap.ts +24 -0
  230. package/src/editor/extensions/drag-and-drop.tsx +480 -0
  231. package/src/editor/hooks/useProseMirror.ts +124 -0
  232. package/src/editor/hooks/useProseMirrorContext.ts +15 -0
  233. package/src/editor/index.ts +2 -0
  234. package/src/editor/markdown.ts +172 -0
  235. package/src/editor/nodeViews/ImageComponent.tsx +20 -0
  236. package/src/editor/nodeViews/ReactNodeView.tsx +89 -0
  237. package/src/editor/nodeViews/TaskItemComponent.tsx +29 -0
  238. package/src/editor/nodeViews/index.ts +35 -0
  239. package/src/editor/plugins/index.ts +58 -0
  240. package/src/editor/plugins/inputrules.ts +82 -0
  241. package/src/editor/plugins/placeholderPlugin.ts +55 -0
  242. package/src/editor/plugins/slashCommandPlugin.ts +61 -0
  243. package/src/editor/schema.ts +240 -0
  244. package/src/editor/selectors/ai-selector.tsx +111 -0
  245. package/src/editor/selectors/color-selector.tsx +200 -0
  246. package/src/editor/selectors/link-selector.tsx +118 -0
  247. package/src/editor/selectors/node-selector.tsx +157 -0
  248. package/src/editor/selectors/text-buttons.tsx +86 -0
  249. package/src/editor/types.ts +6 -0
  250. package/src/editor/useProseMirror.ts +126 -0
  251. package/src/editor/utils/prosemirror-utils.ts +108 -0
  252. package/src/editor/utils/remove_classes.ts +17 -0
  253. package/src/editor/utils/useDebouncedCallback.ts +25 -0
  254. package/src/form/EntityForm.tsx +150 -75
  255. package/src/form/EntityFormActions.tsx +19 -12
  256. package/src/form/PropertyFieldBinding.tsx +68 -51
  257. package/src/form/components/ErrorFocus.tsx +3 -3
  258. package/src/form/components/LocalChangesMenu.tsx +19 -19
  259. package/src/form/components/StorageItemPreview.tsx +5 -3
  260. package/src/form/components/StorageUploadProgress.tsx +22 -6
  261. package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +18 -5
  262. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +22 -10
  263. package/src/form/field_bindings/BlockFieldBinding.tsx +26 -9
  264. package/src/form/field_bindings/DateTimeFieldBinding.tsx +18 -17
  265. package/src/form/field_bindings/KeyValueFieldBinding.tsx +46 -25
  266. package/src/form/field_bindings/MapFieldBinding.tsx +88 -70
  267. package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +93 -52
  268. package/src/form/field_bindings/MultiSelectFieldBinding.tsx +15 -1
  269. package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +25 -11
  270. package/src/form/field_bindings/ReferenceFieldBinding.tsx +25 -11
  271. package/src/form/field_bindings/RepeatFieldBinding.tsx +21 -6
  272. package/src/form/field_bindings/SelectFieldBinding.tsx +7 -5
  273. package/src/form/field_bindings/StorageUploadFieldBinding.tsx +110 -92
  274. package/src/form/field_bindings/SwitchFieldBinding.tsx +31 -14
  275. package/src/form/field_bindings/TextFieldBinding.tsx +77 -38
  276. package/src/form/field_bindings/UserSelectFieldBinding.tsx +7 -5
  277. package/src/form/validation.ts +245 -160
  278. package/src/hooks/index.tsx +1 -0
  279. package/src/hooks/useBreadcrumbsController.tsx +18 -0
  280. package/src/hooks/useBuildNavigationController.tsx +91 -41
  281. package/src/hooks/useCollapsedGroups.ts +18 -9
  282. package/src/hooks/useTranslation.ts +31 -0
  283. package/src/hooks/useValidateAuthenticator.tsx +1 -1
  284. package/src/i18n/FireCMSi18nProvider.tsx +160 -0
  285. package/src/index.ts +5 -0
  286. package/src/internal/useBuildDataSource.ts +68 -34
  287. package/src/internal/useBuildSideDialogsController.tsx +11 -8
  288. package/src/internal/useBuildSideEntityController.tsx +24 -24
  289. package/src/internal/useRestoreScroll.tsx +26 -14
  290. package/src/locales/de.ts +718 -0
  291. package/src/locales/en.ts +730 -0
  292. package/src/locales/es.ts +730 -0
  293. package/src/locales/fr.ts +718 -0
  294. package/src/locales/hi.ts +718 -0
  295. package/src/locales/it.ts +718 -0
  296. package/src/locales/pt.ts +727 -0
  297. package/src/preview/PropertyPreview.tsx +43 -33
  298. package/src/preview/PropertyPreviewProps.tsx +6 -0
  299. package/src/preview/components/DatePreview.tsx +72 -4
  300. package/src/preview/components/EmptyValue.tsx +1 -1
  301. package/src/preview/components/ImagePreview.tsx +37 -21
  302. package/src/preview/components/ReferencePreview.tsx +8 -2
  303. package/src/preview/components/StorageThumbnail.tsx +16 -12
  304. package/src/preview/components/UrlComponentPreview.tsx +32 -27
  305. package/src/preview/components/UserPreview.tsx +3 -1
  306. package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +9 -7
  307. package/src/preview/property_previews/ArrayOfStringsPreview.tsx +11 -9
  308. package/src/preview/property_previews/ArrayPropertyPreview.tsx +26 -24
  309. package/src/preview/property_previews/MapPropertyPreview.tsx +49 -27
  310. package/src/preview/property_previews/SkeletonPropertyComponent.tsx +61 -56
  311. package/src/routes/CustomCMSRoute.tsx +1 -0
  312. package/src/routes/FireCMSRoute.tsx +87 -65
  313. package/src/types/analytics.ts +10 -0
  314. package/src/types/collections.ts +97 -3
  315. package/src/types/customization_controller.tsx +2 -1
  316. package/src/types/datasource.ts +54 -56
  317. package/src/types/entities.ts +10 -0
  318. package/src/types/firecms.tsx +2 -1
  319. package/src/types/index.ts +1 -0
  320. package/src/types/navigation.ts +2 -2
  321. package/src/types/plugins.tsx +77 -1
  322. package/src/types/properties.ts +369 -37
  323. package/src/types/storage.ts +11 -1
  324. package/src/types/translations.ts +752 -0
  325. package/src/util/__tests__/conditions.test.ts +506 -0
  326. package/src/util/__tests__/objects.test.ts +196 -0
  327. package/src/util/callbacks.ts +6 -3
  328. package/src/util/collections.ts +51 -6
  329. package/src/util/conditions.ts +339 -0
  330. package/src/util/entities.ts +29 -30
  331. package/src/util/entity_cache.ts +2 -1
  332. package/src/util/index.ts +3 -1
  333. package/src/util/join_collections.ts +10 -8
  334. package/src/util/lazy_eager.tsx +33 -0
  335. package/src/util/objects.ts +46 -13
  336. package/src/util/{references.ts → previews.ts} +16 -2
  337. package/src/util/property_utils.tsx +37 -11
  338. package/src/util/resolutions.ts +62 -58
  339. package/src/util/useStorageUploadController.tsx +34 -30
  340. /package/dist/util/{references.d.ts → previews.d.ts} +0 -0
@@ -1,5 +1,6 @@
1
1
  import React, { useEffect, useRef, useState } from "react";
2
2
  import { Button, Dialog, DialogActions, DialogContent, DialogTitle, TextField } from "@firecms/ui";
3
+ import { useTranslation } from "../../hooks/useTranslation";
3
4
 
4
5
  interface RenameGroupDialogProps {
5
6
  open: boolean;
@@ -18,7 +19,8 @@ export function RenameGroupDialog({
18
19
  }: RenameGroupDialogProps) {
19
20
  const [name, setName] = useState(initialName);
20
21
  const [error, setError] = useState<string | null>(null);
21
- const inputRef = useRef<HTMLInputElement | HTMLTextAreaElement | null>(null); // Create a ref for the input
22
+ const inputRef = useRef<HTMLInputElement | HTMLTextAreaElement | null>(null);
23
+ const { t } = useTranslation();
22
24
 
23
25
  useEffect(() => {
24
26
  if (open) {
@@ -38,9 +40,9 @@ export function RenameGroupDialog({
38
40
  const newName = event.target.value;
39
41
  setName(newName);
40
42
  if (!newName.trim()) {
41
- setError("Group name cannot be empty.");
43
+ setError(t("group_name_empty_error"));
42
44
  } else if (existingGroupNames.includes(newName.trim())) {
43
- setError("This group name already exists.");
45
+ setError(t("group_name_exists_error"));
44
46
  } else {
45
47
  setError(null);
46
48
  }
@@ -49,11 +51,11 @@ export function RenameGroupDialog({
49
51
  const handleSave = () => {
50
52
  const trimmedName = name.trim();
51
53
  if (!trimmedName) {
52
- setError("Group name cannot be empty.");
54
+ setError(t("group_name_empty_error"));
53
55
  return;
54
56
  }
55
57
  if (existingGroupNames.includes(trimmedName)) {
56
- setError("This group name already exists.");
58
+ setError(t("group_name_exists_error"));
57
59
  return;
58
60
  }
59
61
  if (!error) {
@@ -70,9 +72,9 @@ export function RenameGroupDialog({
70
72
  // because the error state might not have updated if the user types and immediately hits enter.
71
73
  let currentError = null;
72
74
  if (!trimmedName) {
73
- currentError = "Group name cannot be empty.";
75
+ currentError = t("group_name_empty_error");
74
76
  } else if (existingGroupNames.includes(trimmedName)) {
75
- currentError = "This group name already exists.";
77
+ currentError = t("group_name_exists_error");
76
78
  }
77
79
 
78
80
  if (!currentError && trimmedName) {
@@ -93,14 +95,14 @@ export function RenameGroupDialog({
93
95
 
94
96
  return (
95
97
  <Dialog open={open}>
96
- <DialogTitle>Rename Group</DialogTitle>
98
+ <DialogTitle>{t("rename_group")}</DialogTitle>
97
99
  <DialogContent>
98
100
  <TextField
99
- inputRef={inputRef} // Pass the ref to the TextField
100
- label="Group Name"
101
+ inputRef={inputRef}
102
+ label={t("group_name_label")}
101
103
  value={name}
102
104
  onChange={handleNameChange}
103
- onKeyDown={handleKeyDown} // Added onKeyDown handler
105
+ onKeyDown={handleKeyDown}
104
106
  error={!!error}
105
107
  aria-describedby={error ? "group-name-error" : undefined}
106
108
  />
@@ -108,14 +110,12 @@ export function RenameGroupDialog({
108
110
  </DialogContent>
109
111
  <DialogActions>
110
112
  <Button onClick={onClose}
111
- color={"primary"}
112
113
  variant="text">
113
- Cancel
114
+ {t("cancel")}
114
115
  </Button>
115
116
  <Button onClick={handleSave}
116
- color={"primary"}
117
117
  disabled={!!error || !name.trim()}>
118
- Save
118
+ {t("save")}
119
119
  </Button>
120
120
  </DialogActions>
121
121
  </Dialog>
@@ -9,10 +9,10 @@ export type SmallNavigationCardProps = {
9
9
  };
10
10
 
11
11
  export function SmallNavigationCard({
12
- name,
13
- url,
14
- icon,
15
- }: SmallNavigationCardProps) {
12
+ name,
13
+ url,
14
+ icon,
15
+ }: SmallNavigationCardProps) {
16
16
 
17
17
  return (
18
18
  <>
@@ -28,17 +28,18 @@ export function SmallNavigationCard({
28
28
  <div className="flex flex-row items-center flex-grow gap-2 ">
29
29
  {icon}
30
30
 
31
- <Typography gutterBottom variant="h5"
32
- component="h2"
33
- className="mb-0 ml-4">
31
+ <Typography gutterBottom variant="subtitle1"
32
+ component="h2"
33
+ className="mb-0 ml-3 font-medium">
34
34
  {name}
35
35
  </Typography>
36
36
  </div>
37
37
 
38
- <div className={"p-4"}>
39
- <ArrowForwardIcon color="primary"/>
38
+ <div className={"p-2"}>
39
+ <ArrowForwardIcon color="primary" size={"small"} />
40
40
  </div>
41
41
  </Link>
42
42
 
43
43
  </>);
44
44
  }
45
+
@@ -0,0 +1,66 @@
1
+ import React from "react";
2
+ import { CheckIcon, IconButton, Menu, MenuItem, TranslateIcon, Typography } from "@firecms/ui";
3
+ import { useTranslation } from "../hooks";
4
+
5
+ export function LanguageToggle() {
6
+ const { i18n } = useTranslation();
7
+
8
+ return (
9
+ <Menu
10
+ trigger={<IconButton
11
+ color="inherit"
12
+ aria-label="Change language">
13
+ <TranslateIcon size="small" />
14
+ </IconButton>}>
15
+ <MenuItem onClick={() => i18n.changeLanguage("en")}>
16
+ <div className="flex w-full items-center justify-between gap-4">
17
+ {/* eslint-disable-next-line i18next/no-literal-string */}
18
+ <Typography variant="body2" className={i18n.language === "en" ? "font-bold" : ""}>English</Typography>
19
+ {i18n.language === "en" && <CheckIcon size="small" />}
20
+ </div>
21
+ </MenuItem>
22
+ <MenuItem onClick={() => i18n.changeLanguage("es")}>
23
+ <div className="flex w-full items-center justify-between gap-4">
24
+ {/* eslint-disable-next-line i18next/no-literal-string */}
25
+ <Typography variant="body2" className={i18n.language === "es" ? "font-bold" : ""}>Español</Typography>
26
+ {i18n.language === "es" && <CheckIcon size="small" />}
27
+ </div>
28
+ </MenuItem>
29
+ <MenuItem onClick={() => i18n.changeLanguage("de")}>
30
+ <div className="flex w-full items-center justify-between gap-4">
31
+ {/* eslint-disable-next-line i18next/no-literal-string */}
32
+ <Typography variant="body2" className={i18n.language === "de" ? "font-bold" : ""}>Deutsch</Typography>
33
+ {i18n.language === "de" && <CheckIcon size="small" />}
34
+ </div>
35
+ </MenuItem>
36
+ <MenuItem onClick={() => i18n.changeLanguage("fr")}>
37
+ <div className="flex w-full items-center justify-between gap-4">
38
+ {/* eslint-disable-next-line i18next/no-literal-string */}
39
+ <Typography variant="body2" className={i18n.language === "fr" ? "font-bold" : ""}>Français</Typography>
40
+ {i18n.language === "fr" && <CheckIcon size="small" />}
41
+ </div>
42
+ </MenuItem>
43
+ <MenuItem onClick={() => i18n.changeLanguage("it")}>
44
+ <div className="flex w-full items-center justify-between gap-4">
45
+ {/* eslint-disable-next-line i18next/no-literal-string */}
46
+ <Typography variant="body2" className={i18n.language === "it" ? "font-bold" : ""}>Italiano</Typography>
47
+ {i18n.language === "it" && <CheckIcon size="small" />}
48
+ </div>
49
+ </MenuItem>
50
+ <MenuItem onClick={() => i18n.changeLanguage("hi")}>
51
+ <div className="flex w-full items-center justify-between gap-4">
52
+ {/* eslint-disable-next-line i18next/no-literal-string */}
53
+ <Typography variant="body2" className={i18n.language === "hi" ? "font-bold" : ""}>हिन्दी</Typography>
54
+ {i18n.language === "hi" && <CheckIcon size="small" />}
55
+ </div>
56
+ </MenuItem>
57
+ <MenuItem onClick={() => i18n.changeLanguage("pt")}>
58
+ <div className="flex w-full items-center justify-between gap-4">
59
+ {/* eslint-disable-next-line i18next/no-literal-string */}
60
+ <Typography variant="body2" className={i18n.language === "pt" ? "font-bold" : ""}>Português</Typography>
61
+ {i18n.language === "pt" && <CheckIcon size="small" />}
62
+ </div>
63
+ </MenuItem>
64
+ </Menu>
65
+ );
66
+ }
@@ -1,8 +1,10 @@
1
1
  import React from "react";
2
2
  import { Link } from "react-router-dom";
3
3
  import { Button, Typography } from "@firecms/ui";
4
+ import { useTranslation } from "../hooks/useTranslation";
4
5
 
5
6
  export function NotFoundPage() {
7
+ const { t } = useTranslation();
6
8
 
7
9
  return (
8
10
  <div className="flex w-full h-full">
@@ -10,15 +12,15 @@ export function NotFoundPage() {
10
12
  >
11
13
  <Typography variant={"h4"} align={"center"}
12
14
  gutterBottom={true}>
13
- Page not found
15
+ {t("page_not_found")}
14
16
  </Typography>
15
17
  <Typography align={"center"} gutterBottom={true}>
16
- This page does not exist or you may not have access to it
18
+ {t("page_not_found_body")}
17
19
  </Typography>
18
20
  <Button
19
21
  variant={"text"}
20
22
  component={Link}
21
- to={"/"}>Back to home</Button>
23
+ to={"/"}>{t("back_to_home")}</Button>
22
24
  </div>
23
25
  </div>
24
26
  );
@@ -12,7 +12,8 @@ import {
12
12
  useDataSource,
13
13
  useLargeLayout,
14
14
  useNavigationController,
15
- useSideEntityController
15
+ useSideEntityController,
16
+ useTranslation
16
17
  } from "../../hooks";
17
18
  import { ErrorView } from "../ErrorView";
18
19
  import { AddIcon, Button, DialogActions, Typography } from "@firecms/ui";
@@ -101,6 +102,7 @@ export function ReferenceSelectionTable<M extends Record<string, any>>(
101
102
  maxSelection,
102
103
  }: ReferenceSelectionInnerProps<M>) {
103
104
 
105
+ const { t } = useTranslation();
104
106
  const authController = useAuthController();
105
107
  const sideDialogContext = useSideDialogContext();
106
108
  const sideEntityController = useSideEntityController();
@@ -302,8 +304,8 @@ export function ReferenceSelectionTable<M extends Record<string, any>>(
302
304
  collectionOrView={collection}
303
305
  className={"text-surface-300 dark:text-surface-600"}/>
304
306
  {collection.singularName
305
- ? `Select ${collection.singularName}`
306
- : `Select from ${collection.name}`}
307
+ ? t("select_specific", { name: collection.singularName })
308
+ : t("select_from", { name: collection.name })}
307
309
  </Typography>}
308
310
  defaultSize={collection.defaultSize}
309
311
  properties={resolvedCollection.properties}
@@ -326,9 +328,8 @@ export function ReferenceSelectionTable<M extends Record<string, any>>(
326
328
  </Typography>}
327
329
  <Button
328
330
  onClick={onDone}
329
- color="primary"
330
331
  variant="filled">
331
- Done
332
+ {t("done")}
332
333
  </Button>
333
334
  </DialogActions>
334
335
  </div>
@@ -348,7 +349,7 @@ function ReferenceDialogActions({
348
349
  onClear: () => void,
349
350
  onNewClick: () => void
350
351
  }) {
351
-
352
+ const { t } = useTranslation();
352
353
  const authController = useAuthController();
353
354
 
354
355
  const largeLayout = useLargeLayout();
@@ -363,25 +364,19 @@ function ReferenceDialogActions({
363
364
  onClick && (largeLayout
364
365
  ? <Button
365
366
  onClick={onClick}
366
- startIcon={<AddIcon/>}
367
- variant="outlined"
368
- color="primary">
369
- Add {collection.singularName ?? collection.name}
367
+ startIcon={<AddIcon/>}>
368
+ {t("add_specific", { name: collection.singularName ?? collection.name })}
370
369
  </Button>
371
370
  : <Button
372
- onClick={onClick}
373
- variant="outlined"
374
- color="primary"
375
- >
371
+ onClick={onClick}>
376
372
  <AddIcon/>
377
373
  </Button>);
378
374
 
379
375
  return (
380
376
  <>
381
377
  <Button onClick={onClear}
382
- variant={"text"}
383
- color="primary">
384
- Clear
378
+ variant={"text"}>
379
+ {t("clear")}
385
380
  </Button>
386
381
  {addButton}
387
382
  </>
@@ -3,7 +3,7 @@ import React, { useCallback, useMemo } from "react";
3
3
  import { Entity, EntityCollection, EntityReference, FilterValues } from "../types";
4
4
  import { getReferenceFrom } from "../util";
5
5
  import { PreviewSize, ReferencePreview } from "../preview";
6
- import { useNavigationController, useReferenceDialog } from "../hooks";
6
+ import { useNavigationController, useReferenceDialog, useTranslation } from "../hooks";
7
7
  import { Button, cls } from "@firecms/ui";
8
8
 
9
9
  export type ReferenceWidgetProps<M extends Record<string, any>> = {
@@ -50,6 +50,7 @@ export function ReferenceWidget<M extends Record<string, any>>({
50
50
  includeEntityLink
51
51
  }: ReferenceWidgetProps<M>) {
52
52
 
53
+ const { t } = useTranslation();
53
54
  const navigationController = useNavigationController();
54
55
 
55
56
  const collection: EntityCollection | undefined = useMemo(() => {
@@ -136,18 +137,16 @@ export function ReferenceWidget<M extends Record<string, any>>({
136
137
  "min-w-80 flex flex-col gap-4",
137
138
  "relative transition-colors duration-200 ease-in rounded font-medium",
138
139
  disabled ? "bg-opacity-50" : "hover:bg-opacity-75",
139
- "text-opacity-50 dark:text-white dark:text-opacity-50",
140
+ "text-opacity-50 text-text-primary/50 dark:text-white dark:text-opacity-50 dark:text-white/50",
140
141
  className
141
142
  )}
142
143
  >
143
144
 
144
145
  {child}
145
146
  {!value && <div className="justify-center text-left">
146
- <Button variant="outlined"
147
- color="primary"
148
- disabled={disabled}
147
+ <Button disabled={disabled}
149
148
  onClick={onEntryClick}>
150
- Edit {name}
149
+ {t("edit_name", { name: name ?? "" })}
151
150
  </Button>
152
151
  </div>}
153
152
 
@@ -2,6 +2,7 @@ import React from "react";
2
2
 
3
3
  import { coolIconKeys, debounce, Icon, IconButton, iconKeys, SearchBar, Tooltip } from "@firecms/ui";
4
4
  import { iconSynonyms, iconsSearch } from "../util";
5
+ import { useTranslation } from "../hooks/useTranslation";
5
6
 
6
7
  const UPDATE_SEARCH_INDEX_WAIT_MS = 220;
7
8
 
@@ -22,6 +23,7 @@ export function SearchIconsView({
22
23
  selectedIcon = "",
23
24
  onIconSelected
24
25
  }: SearchIconsProps) {
26
+ const { t } = useTranslation();
25
27
  const [keys, setKeys] = React.useState<string[] | null>(null);
26
28
  const [query, setQuery] = React.useState<string>("");
27
29
 
@@ -53,7 +55,7 @@ export function SearchIconsView({
53
55
  autoFocus={false}
54
56
  innerClassName={"w-full sticky top-0 z-10"}
55
57
  onTextSearch={(value?: string) => setQuery(value ?? "")}
56
- placeholder="Search for more icons…"
58
+ placeholder={t("search_for_more_icons")}
57
59
  />
58
60
 
59
61
  <div className={"flex max-w-full flex-wrap mt-4"}>
@@ -93,6 +93,11 @@ export type SelectableTableProps<M extends Record<string, any>> = {
93
93
  endAdornment?: React.ReactNode;
94
94
 
95
95
  AddColumnComponent?: React.ComponentType;
96
+
97
+ /**
98
+ * Callback when columns are reordered via drag-and-drop
99
+ */
100
+ onColumnsOrderChange?: (columns: VirtualTableColumn[]) => void;
96
101
  }
97
102
 
98
103
  /**
@@ -120,41 +125,42 @@ export type SelectableTableProps<M extends Record<string, any>> = {
120
125
  * @group Components
121
126
  */
122
127
  export const SelectableTable = function SelectableTable<M extends Record<string, any>>
123
- ({
124
- onValueChange,
125
- cellRenderer,
126
- onEntityClick,
127
- onColumnResize,
128
- hoverRow = true,
129
- size = "m",
130
- inlineEditing = false,
131
- tableController:
132
- {
133
- data,
134
- dataLoading,
135
- noMoreToLoad,
136
- dataLoadingError,
137
- filterValues,
138
- setFilterValues,
139
- sortBy,
140
- setSortBy,
141
- itemCount,
142
- setItemCount,
143
- pageSize = 50,
144
- paginationEnabled,
145
- checkFilterCombination,
146
- setPopupCell
147
- },
148
- filterable = true,
149
- onScroll,
150
- initialScroll,
151
- emptyComponent,
152
- columns,
153
- forceFilter,
154
- highlightedRow,
155
- endAdornment,
156
- AddColumnComponent
157
- }: SelectableTableProps<M>) {
128
+ ({
129
+ onValueChange,
130
+ cellRenderer,
131
+ onEntityClick,
132
+ onColumnResize,
133
+ hoverRow = true,
134
+ size = "m",
135
+ inlineEditing = false,
136
+ tableController:
137
+ {
138
+ data,
139
+ dataLoading,
140
+ noMoreToLoad,
141
+ dataLoadingError,
142
+ filterValues,
143
+ setFilterValues,
144
+ sortBy,
145
+ setSortBy,
146
+ itemCount,
147
+ setItemCount,
148
+ pageSize = 50,
149
+ paginationEnabled,
150
+ checkFilterCombination,
151
+ setPopupCell
152
+ },
153
+ filterable = true,
154
+ onScroll,
155
+ initialScroll,
156
+ emptyComponent,
157
+ columns,
158
+ forceFilter,
159
+ highlightedRow,
160
+ endAdornment,
161
+ AddColumnComponent,
162
+ onColumnsOrderChange
163
+ }: SelectableTableProps<M>) {
158
164
 
159
165
  const ref = useRef<HTMLDivElement>(null);
160
166
 
@@ -224,7 +230,7 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
224
230
  <SelectableTableContext.Provider
225
231
  value={contextValue}>
226
232
  <div className="h-full w-full flex flex-col bg-white dark:bg-surface-950"
227
- ref={ref}>
233
+ ref={ref}>
228
234
 
229
235
  <VirtualTable
230
236
  data={data}
@@ -247,12 +253,13 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
247
253
  checkFilterCombination={checkFilterCombination}
248
254
  createFilterField={filterable ? createFilterField : undefined}
249
255
  rowClassName={useCallback((entity: Entity<M>) => {
250
- return highlightedRow?.(entity) ? "bg-surface-100 bg-opacity-75 dark:bg-surface-800 dark:bg-opacity-75" : "";
256
+ return highlightedRow?.(entity) ? "bg-surface-100 bg-opacity-75 bg-surface-100/75 dark:bg-surface-800 dark:bg-opacity-75 dark:bg-surface-800/75" : "";
251
257
  }, [highlightedRow])}
252
258
  className="flex-grow"
253
259
  emptyComponent={emptyComponent}
254
260
  endAdornment={endAdornment}
255
261
  AddColumnComponent={AddColumnComponent}
262
+ onColumnsOrderChange={onColumnsOrderChange}
256
263
  />
257
264
 
258
265
  </div>
@@ -262,13 +269,13 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
262
269
  };
263
270
 
264
271
  function createFilterField({
265
- id,
266
- filterValue,
267
- setFilterValue,
268
- column,
269
- hidden,
270
- setHidden
271
- }: FilterFormFieldProps<{
272
+ id,
273
+ filterValue,
274
+ setFilterValue,
275
+ column,
276
+ hidden,
277
+ setHidden
278
+ }: FilterFormFieldProps<{
272
279
  resolvedProperty: ResolvedProperty,
273
280
  disabled: boolean,
274
281
  }>): React.ReactNode {
@@ -286,40 +293,41 @@ function createFilterField({
286
293
  }
287
294
  if (baseProperty.dataType === "reference") {
288
295
  return <ReferenceFilterField value={filterValue}
289
- setValue={setFilterValue}
290
- name={id as string}
291
- isArray={isArray}
292
- path={baseProperty.path}
293
- title={resolvedProperty?.name}
294
- includeId={baseProperty.includeId}
295
- previewProperties={baseProperty?.previewProperties}
296
- hidden={hidden}
297
- setHidden={setHidden}/>;
296
+ setValue={setFilterValue}
297
+ name={id as string}
298
+ isArray={isArray}
299
+ path={baseProperty.path}
300
+ title={resolvedProperty?.name}
301
+ includeId={baseProperty.includeId}
302
+ previewProperties={baseProperty?.previewProperties}
303
+ hidden={hidden}
304
+ setHidden={setHidden} />;
298
305
  } else if (baseProperty.dataType === "number" || baseProperty.dataType === "string") {
299
306
  const name = baseProperty.name;
300
307
  const enumValues = baseProperty.enumValues ? enumToObjectEntries(baseProperty.enumValues) : undefined;
301
308
  return <StringNumberFilterField value={filterValue}
302
- setValue={setFilterValue}
303
- name={id as string}
304
- dataType={baseProperty.dataType}
305
- isArray={isArray}
306
- enumValues={enumValues}
307
- title={name}/>;
309
+ setValue={setFilterValue}
310
+ name={id as string}
311
+ dataType={baseProperty.dataType}
312
+ isArray={isArray}
313
+ enumValues={enumValues}
314
+ title={name} />;
308
315
  } else if (baseProperty.dataType === "boolean") {
309
316
  const name = baseProperty.name;
310
317
  return <BooleanFilterField value={filterValue}
311
- setValue={setFilterValue}
312
- name={id as string}
313
- title={name}/>;
318
+ setValue={setFilterValue}
319
+ name={id as string}
320
+ title={name} />;
314
321
 
315
322
  } else if (baseProperty.dataType === "date") {
316
323
  const title = baseProperty.name;
317
324
  return <DateTimeFilterField value={filterValue}
318
- setValue={setFilterValue}
319
- name={id as string}
320
- mode={baseProperty.mode}
321
- isArray={isArray}
322
- title={title}/>;
325
+ setValue={setFilterValue}
326
+ name={id as string}
327
+ mode={baseProperty.mode}
328
+ isArray={isArray}
329
+ timezone={baseProperty.timezone}
330
+ title={title} />;
323
331
  }
324
332
 
325
333
  return (
@@ -10,11 +10,11 @@ interface BooleanFieldProps {
10
10
  }
11
11
 
12
12
  export function BooleanFilterField({
13
- name,
14
- title,
15
- value,
16
- setValue
17
- }: BooleanFieldProps) {
13
+ name,
14
+ title,
15
+ value,
16
+ setValue
17
+ }: BooleanFieldProps) {
18
18
 
19
19
  function updateFilter(val?: boolean) {
20
20
  if (val !== undefined) {
@@ -32,8 +32,9 @@ export function BooleanFilterField({
32
32
  const valueSet = !!value;
33
33
 
34
34
  return (
35
- <div className="w-[300px]">
35
+ <div className="w-full">
36
36
  <BooleanSwitchWithLabel
37
+ size={"medium"}
37
38
  value={valueSetToTrue}
38
39
  allowIndeterminate={true}
39
40
  onValueChange={(v: boolean | null) => updateFilter(v === null ? undefined : v)}