@firecms/core 3.0.0-alpha.71 → 3.0.0-alpha.72

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 (255) hide show
  1. package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +5 -5
  2. package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +1 -1
  3. package/dist/components/EntityCollectionTable/index.d.ts +1 -1
  4. package/dist/components/EntityCollectionTable/types.d.ts +15 -1
  5. package/dist/components/EntityCollectionTable/useDataSourceEntityCollectionTableController.d.ts +32 -0
  6. package/dist/components/SearchIconsView.d.ts +5 -0
  7. package/dist/components/index.d.ts +1 -0
  8. package/dist/hooks/useVerifyLicense.d.ts +0 -0
  9. package/dist/index.es.js +8902 -7487
  10. package/dist/index.es.js.map +1 -1
  11. package/dist/index.umd.js +4 -587
  12. package/dist/index.umd.js.map +1 -1
  13. package/dist/util/icon_list.d.ts +1 -0
  14. package/dist/util/icon_synonyms.d.ts +1950 -0
  15. package/dist/util/index.d.ts +2 -0
  16. package/package.json +3 -5
  17. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +5 -6
  18. package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +1 -1
  19. package/src/components/EntityCollectionTable/index.tsx +1 -1
  20. package/src/components/EntityCollectionTable/types.tsx +15 -1
  21. package/src/components/EntityCollectionTable/{useEntityCollectionTableController.tsx → useDataSourceEntityCollectionTableController.tsx} +16 -4
  22. package/src/components/EntityCollectionView/EntityCollectionView.tsx +2 -2
  23. package/src/components/ReferenceSelectionInner.tsx +2 -2
  24. package/src/components/SearchIconsView.tsx +75 -0
  25. package/src/components/index.tsx +1 -0
  26. package/src/form/field_bindings/MarkdownFieldBinding.tsx +585 -585
  27. package/src/hooks/useVerifyLicense.tsx +1 -0
  28. package/src/util/icon_list.ts +17 -0
  29. package/src/util/icon_synonyms.ts +1950 -0
  30. package/src/util/index.ts +2 -0
  31. package/dist/components/EntityCollectionTable/useEntityCollectionTableController.d.ts +0 -21
  32. package/src/components/ArrayContainer.d.ts +0 -42
  33. package/src/components/CircularProgressCenter.d.ts +0 -11
  34. package/src/components/DeleteConfirmationDialog.d.ts +0 -9
  35. package/src/components/EntityCollectionTable/EntityCollectionTable.d.ts +0 -30
  36. package/src/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +0 -106
  37. package/src/components/EntityCollectionTable/fields/TableReferenceField.d.ts +0 -15
  38. package/src/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +0 -33
  39. package/src/components/EntityCollectionTable/filters/BooleanFilterField.d.ts +0 -9
  40. package/src/components/EntityCollectionTable/filters/DateTimeFilterField.d.ts +0 -11
  41. package/src/components/EntityCollectionTable/filters/ReferenceFilterField.d.ts +0 -14
  42. package/src/components/EntityCollectionTable/filters/StringNumberFilterField.d.ts +0 -13
  43. package/src/components/EntityCollectionTable/index.d.ts +0 -4
  44. package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +0 -18
  45. package/src/components/EntityCollectionTable/internal/DeleteEntityDialog.d.ts +0 -12
  46. package/src/components/EntityCollectionTable/internal/EntityCollectionRowActions.d.ts +0 -35
  47. package/src/components/EntityCollectionTable/internal/EntityTableCell.d.ts +0 -26
  48. package/src/components/EntityCollectionTable/internal/EntityTableCellActions.d.ts +0 -9
  49. package/src/components/EntityCollectionTable/internal/PropertyTableCell.d.ts +0 -18
  50. package/src/components/EntityCollectionTable/internal/common.d.ts +0 -4
  51. package/src/components/EntityCollectionTable/internal/default_entity_actions.d.ts +0 -6
  52. package/src/components/EntityCollectionTable/internal/popup_field/ElementResizeListener.d.ts +0 -5
  53. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +0 -23
  54. package/src/components/EntityCollectionTable/internal/popup_field/useDraggable.d.ts +0 -13
  55. package/src/components/EntityCollectionTable/internal/popup_field/useWindowSize.d.ts +0 -6
  56. package/src/components/EntityCollectionTable/types.d.ts +0 -39
  57. package/src/components/EntityCollectionTable/useDebouncedData.d.ts +0 -9
  58. package/src/components/EntityCollectionTable/useEntityCollectionTableController.d.ts +0 -21
  59. package/src/components/EntityCollectionView/EntityCollectionView.d.ts +0 -37
  60. package/src/components/EntityCollectionView/EntityCollectionViewActions.d.ts +0 -14
  61. package/src/components/EntityCollectionView/useColumnsIds.d.ts +0 -4
  62. package/src/components/EntityPreview.d.ts +0 -11
  63. package/src/components/ErrorBoundary.d.ts +0 -11
  64. package/src/components/ErrorTooltip.d.ts +0 -2
  65. package/src/components/ErrorView.d.ts +0 -19
  66. package/src/components/FieldConfigBadge.d.ts +0 -4
  67. package/src/components/FireCMSAppBar.d.ts +0 -26
  68. package/src/components/FireCMSLogo.d.ts +0 -7
  69. package/src/components/HomePage/DefaultHomePage.d.ts +0 -21
  70. package/src/components/HomePage/FavouritesView.d.ts +0 -3
  71. package/src/components/HomePage/NavigationCollectionCard.d.ts +0 -17
  72. package/src/components/HomePage/NavigationGroup.d.ts +0 -4
  73. package/src/components/HomePage/index.d.ts +0 -3
  74. package/src/components/LabelWithIcon.d.ts +0 -14
  75. package/src/components/NotFoundPage.d.ts +0 -1
  76. package/src/components/ReferenceSelectionInner.d.ts +0 -58
  77. package/src/components/ReferenceWidget.d.ts +0 -28
  78. package/src/components/VirtualTable/VirtualTable.d.ts +0 -11
  79. package/src/components/VirtualTable/VirtualTableCell.d.ts +0 -14
  80. package/src/components/VirtualTable/VirtualTableHeader.d.ts +0 -27
  81. package/src/components/VirtualTable/VirtualTableHeaderRow.d.ts +0 -2
  82. package/src/components/VirtualTable/VirtualTableProps.d.ts +0 -215
  83. package/src/components/VirtualTable/VirtualTableRow.d.ts +0 -3
  84. package/src/components/VirtualTable/common.d.ts +0 -2
  85. package/src/components/VirtualTable/fields/VirtualTableDateField.d.ts +0 -11
  86. package/src/components/VirtualTable/fields/VirtualTableInput.d.ts +0 -8
  87. package/src/components/VirtualTable/fields/VirtualTableNumberInput.d.ts +0 -8
  88. package/src/components/VirtualTable/fields/VirtualTableSelect.d.ts +0 -15
  89. package/src/components/VirtualTable/fields/VirtualTableSwitch.d.ts +0 -7
  90. package/src/components/VirtualTable/index.d.ts +0 -2
  91. package/src/components/VirtualTable/types.d.ts +0 -34
  92. package/src/components/index.d.ts +0 -20
  93. package/src/contexts/AuthControllerContext.d.ts +0 -3
  94. package/src/contexts/DataSourceContext.d.ts +0 -3
  95. package/src/contexts/DialogsProvider.d.ts +0 -4
  96. package/src/contexts/ModeController.d.ts +0 -4
  97. package/src/contexts/NavigationContext.d.ts +0 -3
  98. package/src/contexts/SideDialogsControllerContext.d.ts +0 -3
  99. package/src/contexts/SideEntityControllerContext.d.ts +0 -3
  100. package/src/contexts/SnackbarProvider.d.ts +0 -2
  101. package/src/contexts/StorageSourceContext.d.ts +0 -3
  102. package/src/contexts/UserConfigurationPersistenceContext.d.ts +0 -3
  103. package/src/contexts/index.d.ts +0 -3
  104. package/src/core/Drawer.d.ts +0 -23
  105. package/src/core/EntitySidePanel.d.ts +0 -10
  106. package/src/core/FireCMS.d.ts +0 -14
  107. package/src/core/NavigationRoutes.d.ts +0 -21
  108. package/src/core/Scaffold.d.ts +0 -52
  109. package/src/core/SideDialogs.d.ts +0 -23
  110. package/src/core/field_configs.d.ts +0 -7
  111. package/src/core/index.d.ts +0 -10
  112. package/src/core/useBuildLocalConfigurationPersistence.d.ts +0 -2
  113. package/src/core/useBuildModeController.d.ts +0 -6
  114. package/src/form/EntityForm.d.ts +0 -75
  115. package/src/form/PropertyFieldBinding.d.ts +0 -30
  116. package/src/form/components/CustomIdField.d.ts +0 -9
  117. package/src/form/components/ErrorFocus.d.ts +0 -4
  118. package/src/form/components/FieldHelperText.d.ts +0 -12
  119. package/src/form/components/FormikArrayContainer.d.ts +0 -18
  120. package/src/form/components/StorageItemPreview.d.ts +0 -13
  121. package/src/form/components/StorageUploadProgress.d.ts +0 -10
  122. package/src/form/components/SwitchControl.d.ts +0 -8
  123. package/src/form/components/index.d.ts +0 -3
  124. package/src/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +0 -9
  125. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +0 -11
  126. package/src/form/field_bindings/BlockFieldBinding.d.ts +0 -10
  127. package/src/form/field_bindings/DateTimeFieldBinding.d.ts +0 -11
  128. package/src/form/field_bindings/KeyValueFieldBinding.d.ts +0 -7
  129. package/src/form/field_bindings/MapFieldBinding.d.ts +0 -9
  130. package/src/form/field_bindings/MarkdownFieldBinding.d.ts +0 -9
  131. package/src/form/field_bindings/MultiSelectBinding.d.ts +0 -9
  132. package/src/form/field_bindings/ReadOnlyFieldBinding.d.ts +0 -10
  133. package/src/form/field_bindings/ReferenceFieldBinding.d.ts +0 -9
  134. package/src/form/field_bindings/RepeatFieldBinding.d.ts +0 -10
  135. package/src/form/field_bindings/SelectFieldBinding.d.ts +0 -12
  136. package/src/form/field_bindings/StorageUploadFieldBinding.d.ts +0 -28
  137. package/src/form/field_bindings/SwitchFieldBinding.d.ts +0 -12
  138. package/src/form/field_bindings/TextFieldBinding.d.ts +0 -12
  139. package/src/form/index.d.ts +0 -20
  140. package/src/form/useClearRestoreValue.d.ts +0 -13
  141. package/src/form/validation.d.ts +0 -25
  142. package/src/hooks/data/delete.d.ts +0 -37
  143. package/src/hooks/data/save.d.ts +0 -42
  144. package/src/hooks/data/useCollectionFetch.d.ts +0 -50
  145. package/src/hooks/data/useDataOrder.d.ts +0 -12
  146. package/src/hooks/data/useDataSource.d.ts +0 -6
  147. package/src/hooks/data/useEntityFetch.d.ts +0 -28
  148. package/src/hooks/index.d.ts +0 -19
  149. package/src/hooks/useAuthController.d.ts +0 -11
  150. package/src/hooks/useBrowserTitleAndIcon.d.ts +0 -6
  151. package/src/hooks/useClipboard.d.ts +0 -57
  152. package/src/hooks/useDialogsController.d.ts +0 -11
  153. package/src/hooks/useFireCMSContext.d.ts +0 -12
  154. package/src/hooks/useLargeLayout.d.ts +0 -1
  155. package/src/hooks/useModeController.d.ts +0 -20
  156. package/src/hooks/useNavigationController.d.ts +0 -9
  157. package/src/hooks/useReferenceDialog.d.ts +0 -18
  158. package/src/hooks/useResolvedNavigationFrom.d.ts +0 -72
  159. package/src/hooks/useSideDialogsController.d.ts +0 -18
  160. package/src/hooks/useSideEntityController.d.ts +0 -12
  161. package/src/hooks/useSnackbarController.d.ts +0 -41
  162. package/src/hooks/useStorageSource.d.ts +0 -6
  163. package/src/hooks/useUserConfigurationPersistence.d.ts +0 -8
  164. package/src/index.d.ts +0 -8
  165. package/src/internal/EntityView.d.ts +0 -22
  166. package/src/internal/common.d.ts +0 -3
  167. package/src/internal/useBuildDataSource.d.ts +0 -22
  168. package/src/internal/useBuildNavigationController.d.ts +0 -14
  169. package/src/internal/useBuildSideDialogsController.d.ts +0 -2
  170. package/src/internal/useBuildSideEntityController.d.ts +0 -4
  171. package/src/internal/useLocaleConfig.d.ts +0 -1
  172. package/src/internal/useRestoreScroll.d.ts +0 -6
  173. package/src/internal/useUnsavedChangesDialog.d.ts +0 -14
  174. package/src/preview/PropertyPreview.d.ts +0 -7
  175. package/src/preview/PropertyPreviewProps.d.ts +0 -43
  176. package/src/preview/components/ArrayEnumPreview.d.ts +0 -11
  177. package/src/preview/components/AsyncPreviewComponent.d.ts +0 -11
  178. package/src/preview/components/BooleanPreview.d.ts +0 -7
  179. package/src/preview/components/DatePreview.d.ts +0 -7
  180. package/src/preview/components/EmptyValue.d.ts +0 -4
  181. package/src/preview/components/EnumValuesChip.d.ts +0 -13
  182. package/src/preview/components/ImagePreview.d.ts +0 -12
  183. package/src/preview/components/ReferencePreview.d.ts +0 -22
  184. package/src/preview/components/StorageThumbnail.d.ts +0 -13
  185. package/src/preview/components/UrlComponentPreview.d.ts +0 -12
  186. package/src/preview/index.d.ts +0 -23
  187. package/src/preview/property_previews/ArrayOfMapsPreview.d.ts +0 -5
  188. package/src/preview/property_previews/ArrayOfReferencesPreview.d.ts +0 -5
  189. package/src/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +0 -5
  190. package/src/preview/property_previews/ArrayOfStringsPreview.d.ts +0 -5
  191. package/src/preview/property_previews/ArrayOneOfPreview.d.ts +0 -5
  192. package/src/preview/property_previews/ArrayPropertyEnumPreview.d.ts +0 -5
  193. package/src/preview/property_previews/ArrayPropertyPreview.d.ts +0 -5
  194. package/src/preview/property_previews/MapPropertyPreview.d.ts +0 -8
  195. package/src/preview/property_previews/NumberPropertyPreview.d.ts +0 -6
  196. package/src/preview/property_previews/SkeletonPropertyComponent.d.ts +0 -14
  197. package/src/preview/property_previews/StringPropertyPreview.d.ts +0 -6
  198. package/src/preview/util.d.ts +0 -7
  199. package/src/types/analytics.d.ts +0 -1
  200. package/src/types/appcheck.d.ts +0 -26
  201. package/src/types/auth.d.ts +0 -40
  202. package/src/types/collections.d.ts +0 -451
  203. package/src/types/datasource.d.ts +0 -262
  204. package/src/types/dialogs_controller.d.ts +0 -32
  205. package/src/types/entities.d.ts +0 -57
  206. package/src/types/entity_actions.d.ts +0 -35
  207. package/src/types/entity_callbacks.d.ts +0 -171
  208. package/src/types/entity_link_builder.d.ts +0 -7
  209. package/src/types/export_import.d.ts +0 -21
  210. package/src/types/fields.d.ts +0 -181
  211. package/src/types/firecms.d.ts +0 -151
  212. package/src/types/firecms_context.d.ts +0 -110
  213. package/src/types/index.d.ts +0 -26
  214. package/src/types/local_config_persistence.d.ts +0 -21
  215. package/src/types/locales.d.ts +0 -4
  216. package/src/types/modify_collections.d.ts +0 -5
  217. package/src/types/navigation.d.ts +0 -178
  218. package/src/types/permissions.d.ts +0 -63
  219. package/src/types/plugins.d.ts +0 -179
  220. package/src/types/properties.d.ts +0 -681
  221. package/src/types/property_config.d.ts +0 -42
  222. package/src/types/resolved_entities.d.ts +0 -98
  223. package/src/types/side_dialogs_controller.d.ts +0 -57
  224. package/src/types/side_entity_controller.d.ts +0 -83
  225. package/src/types/storage.d.ts +0 -82
  226. package/src/types/user.d.ts +0 -36
  227. package/src/util/arrays.d.ts +0 -1
  228. package/src/util/builders.d.ts +0 -64
  229. package/src/util/chip_utils.d.ts +0 -3
  230. package/src/util/collections.d.ts +0 -3
  231. package/src/util/common.d.ts +0 -2
  232. package/src/util/dates.d.ts +0 -1
  233. package/src/util/entities.d.ts +0 -28
  234. package/src/util/enums.d.ts +0 -7
  235. package/src/util/flatten_object.d.ts +0 -3
  236. package/src/util/hash.d.ts +0 -1
  237. package/src/util/icons.d.ts +0 -4
  238. package/src/util/index.d.ts +0 -20
  239. package/src/util/join_collections.d.ts +0 -9
  240. package/src/util/make_properties_editable.d.ts +0 -3
  241. package/src/util/navigation_from_path.d.ts +0 -24
  242. package/src/util/navigation_utils.d.ts +0 -20
  243. package/src/util/objects.d.ts +0 -10
  244. package/src/util/parent_references_from_path.d.ts +0 -6
  245. package/src/util/paths.d.ts +0 -14
  246. package/src/util/permissions.d.ts +0 -5
  247. package/src/util/plurals.d.ts +0 -18
  248. package/src/util/property_utils.d.ts +0 -23
  249. package/src/util/references.d.ts +0 -2
  250. package/src/util/regexp.d.ts +0 -7
  251. package/src/util/resolutions.d.ts +0 -64
  252. package/src/util/storage.d.ts +0 -3
  253. package/src/util/strings.d.ts +0 -6
  254. package/src/util/useDebounce.d.ts +0 -1
  255. package/src/util/useStorageUploadController.d.ts +0 -36
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- import { FieldProps } from "../../types";
3
- type SwitchFieldProps = FieldProps<boolean>;
4
- /**
5
- * Simple boolean switch biding to a boolean property.
6
- *
7
- * This is one of the internal components that get mapped natively inside forms
8
- * and tables to the specified properties.
9
- * @group Form fields
10
- */
11
- export declare const SwitchFieldBinding: React.ForwardRefExoticComponent<SwitchFieldProps & React.RefAttributes<unknown>>;
12
- export {};
@@ -1,12 +0,0 @@
1
- import { FieldProps } from "../../types";
2
- interface TextFieldProps<T extends string | number> extends FieldProps<T> {
3
- allowInfinity?: boolean;
4
- }
5
- /**
6
- * Generic text field.
7
- * This is one of the internal components that get mapped natively inside forms
8
- * and tables to the specified properties.
9
- * @group Form fields
10
- */
11
- export declare function TextFieldBinding<T extends string | number>({ propertyKey, value, setValue, error, showError, disabled, autoFocus, property, includeDescription, }: TextFieldProps<T>): import("react/jsx-runtime").JSX.Element;
12
- export {};
@@ -1,20 +0,0 @@
1
- import { SelectFieldBinding } from "./field_bindings/SelectFieldBinding";
2
- import { MultiSelectBinding } from "./field_bindings/MultiSelectBinding";
3
- import { ArrayOfReferencesFieldBinding } from "./field_bindings/ArrayOfReferencesFieldBinding";
4
- import { StorageUploadFieldBinding } from "./field_bindings/StorageUploadFieldBinding";
5
- import { TextFieldBinding } from "./field_bindings/TextFieldBinding";
6
- import { SwitchFieldBinding } from "./field_bindings/SwitchFieldBinding";
7
- import { DateTimeFieldBinding } from "./field_bindings/DateTimeFieldBinding";
8
- import { ReferenceFieldBinding } from "./field_bindings/ReferenceFieldBinding";
9
- import { MapFieldBinding } from "./field_bindings/MapFieldBinding";
10
- import { KeyValueFieldBinding } from "./field_bindings/KeyValueFieldBinding";
11
- import { RepeatFieldBinding } from "./field_bindings/RepeatFieldBinding";
12
- import { BlockFieldBinding } from "./field_bindings/BlockFieldBinding";
13
- import { ReadOnlyFieldBinding } from "./field_bindings/ReadOnlyFieldBinding";
14
- import { MarkdownFieldBinding } from "./field_bindings/MarkdownFieldBinding";
15
- import { ArrayCustomShapedFieldBinding } from "./field_bindings/ArrayCustomShapedFieldBinding";
16
- export { ArrayCustomShapedFieldBinding, RepeatFieldBinding, MultiSelectBinding, ArrayOfReferencesFieldBinding, BlockFieldBinding, DateTimeFieldBinding, ReadOnlyFieldBinding, MapFieldBinding, KeyValueFieldBinding, ReferenceFieldBinding, SelectFieldBinding, StorageUploadFieldBinding, SwitchFieldBinding, MarkdownFieldBinding, TextFieldBinding };
17
- export * from "./components";
18
- export type { EntityFormProps } from "./EntityForm";
19
- export { EntityForm } from "./EntityForm";
20
- export { PropertyFieldBinding } from "./PropertyFieldBinding";
@@ -1,13 +0,0 @@
1
- import { CMSType, ResolvedProperty } from "../types";
2
- /**
3
- * Hook we use to restore a value after it has been cleared
4
- * @param property
5
- * @param value
6
- * @param setValue
7
- * @ignore
8
- */
9
- export declare function useClearRestoreValue<T extends CMSType>({ property, value, setValue }: {
10
- property: ResolvedProperty<T>;
11
- value: T;
12
- setValue: (value: T | null, shouldValidate?: boolean) => void;
13
- }): void;
@@ -1,25 +0,0 @@
1
- import { CMSType, ResolvedArrayProperty, ResolvedMapProperty, ResolvedProperties, ResolvedProperty } from "../types";
2
- import { AnySchema, ObjectSchema } from "yup";
3
- declare module "yup" {
4
- interface ArraySchema<T> {
5
- uniqueInArray(mapper: (a: T) => T, message: string): ArraySchema<T>;
6
- }
7
- }
8
- export type CustomFieldValidator = (props: {
9
- name: string;
10
- value: any;
11
- property: ResolvedProperty;
12
- entityId?: string;
13
- parentProperty?: ResolvedMapProperty | ResolvedArrayProperty;
14
- }) => Promise<boolean>;
15
- interface PropertyContext<T extends CMSType> {
16
- property: ResolvedProperty<T>;
17
- parentProperty?: ResolvedMapProperty | ResolvedArrayProperty;
18
- entityId: string;
19
- customFieldValidator?: CustomFieldValidator;
20
- name?: any;
21
- }
22
- export declare function getYupEntitySchema<M extends Record<string, any>>(entityId: string, properties: ResolvedProperties<M>, customFieldValidator?: CustomFieldValidator): ObjectSchema<any>;
23
- export declare function mapPropertyToYup<T extends CMSType>(propertyContext: PropertyContext<T>): AnySchema<unknown>;
24
- export declare function getYupMapObjectSchema<M extends Record<string, any>>({ property, entityId, customFieldValidator, name }: PropertyContext<M>): ObjectSchema<any>;
25
- export {};
@@ -1,37 +0,0 @@
1
- import { DataSource, DeleteEntityProps, Entity, EntityCallbacks, FireCMSContext, ResolvedEntityCollection, User } from "../../types";
2
- /**
3
- * @group Hooks and utilities
4
- */
5
- export type DeleteEntityWithCallbacksProps<M extends Record<string, any>> = DeleteEntityProps<M> & {
6
- callbacks?: EntityCallbacks<M>;
7
- onDeleteSuccess?: (entity: Entity<M>) => void;
8
- onDeleteFailure?: (entity: Entity<M>, e: Error) => void;
9
- onPreDeleteHookError?: (entity: Entity<M>, e: Error) => void;
10
- onDeleteSuccessHookError?: (entity: Entity<M>, e: Error) => void;
11
- };
12
- /**
13
- * This function is in charge of deleting an entity in the datasource.
14
- * It will run all the delete callbacks specified in the collection.
15
- * It is also possible to attach callbacks on save success or error, and callback
16
- * errors.
17
- *
18
- * If you just want to delete any data without running the `onPreDelete`,
19
- * and `onDelete` callbacks, you can use the `deleteEntity` method
20
- * in the datasource ({@link useDataSource}).
21
- *
22
- * @param dataSource
23
- * @param entity
24
- * @param collection
25
- * @param callbacks
26
- * @param onDeleteSuccess
27
- * @param onDeleteFailure
28
- * @param onPreDeleteHookError
29
- * @param onDeleteSuccessHookError
30
- * @param context
31
- * @group Hooks and utilities
32
- */
33
- export declare function deleteEntityWithCallbacks<M extends Record<string, any>, UserType extends User>({ dataSource, entity, collection, callbacks, onDeleteSuccess, onDeleteFailure, onPreDeleteHookError, onDeleteSuccessHookError, context }: DeleteEntityWithCallbacksProps<M> & {
34
- collection: ResolvedEntityCollection<M>;
35
- dataSource: DataSource;
36
- context: FireCMSContext<UserType>;
37
- }): Promise<boolean>;
@@ -1,42 +0,0 @@
1
- import { DataSource, Entity, EntityCallbacks, EntityCollection, FireCMSContext, SaveEntityProps, User } from "../../types";
2
- /**
3
- * @group Hooks and utilities
4
- */
5
- export type SaveEntityWithCallbacksProps<M extends Record<string, any>> = SaveEntityProps<M> & {
6
- callbacks?: EntityCallbacks<M>;
7
- onSaveSuccess?: (updatedEntity: Entity<M>) => void;
8
- onSaveFailure?: (e: Error) => void;
9
- onPreSaveHookError?: (e: Error) => void;
10
- onSaveSuccessHookError?: (e: Error) => void;
11
- };
12
- /**
13
- * This function is in charge of saving an entity to the datasource.
14
- * It will run all the save callbacks specified in the collection.
15
- * It is also possible to attach callbacks on save success or error, and callback
16
- * errors.
17
- *
18
- * If you just want to save the data without running the `onSaveSuccess`,
19
- * `onSaveFailure` and `onPreSave` callbacks, you can use the `saveEntity` method
20
- * in the datasource ({@link useDataSource}).
21
- *
22
- * @param collection
23
- * @param path
24
- * @param entityId
25
- * @param callbacks
26
- * @param values
27
- * @param previousValues
28
- * @param status
29
- * @param dataSource
30
- * @param context
31
- * @param onSaveSuccess
32
- * @param onSaveFailure
33
- * @param onPreSaveHookError
34
- * @param onSaveSuccessHookError
35
- * @see useDataSource
36
- * @group Hooks and utilities
37
- */
38
- export declare function saveEntityWithCallbacks<M extends Record<string, any>, UserType extends User>({ collection, path, entityId, values, previousValues, status, dataSource, context, onSaveSuccess, onSaveFailure, onPreSaveHookError, onSaveSuccessHookError }: SaveEntityWithCallbacksProps<M> & {
39
- collection: EntityCollection<M>;
40
- dataSource: DataSource;
41
- context: FireCMSContext<UserType>;
42
- }): Promise<void>;
@@ -1,50 +0,0 @@
1
- import { Entity, EntityCollection, FilterValues, User } from "../../types";
2
- /**
3
- * @group Hooks and utilities
4
- */
5
- export interface CollectionFetchProps<M extends Record<string, any>> {
6
- /**
7
- * Absolute collection path
8
- */
9
- path: string;
10
- /**
11
- * collection of the entity displayed by this collection
12
- */
13
- collection: EntityCollection<M>;
14
- /**
15
- * Number of entities to fetch
16
- */
17
- itemCount?: number;
18
- /**
19
- * Filter the fetched data by the property
20
- */
21
- filterValues?: FilterValues<Extract<keyof M, string>>;
22
- /**
23
- * Sort the results by
24
- */
25
- sortBy?: [Extract<keyof M, string>, "asc" | "desc"];
26
- /**
27
- * Search string
28
- */
29
- searchString?: string;
30
- }
31
- /**
32
- * @group Hooks and utilities
33
- */
34
- export interface CollectionFetchResult<M extends Record<string, any>> {
35
- data: Entity<M>[];
36
- dataLoading: boolean;
37
- noMoreToLoad: boolean;
38
- dataLoadingError?: Error;
39
- }
40
- /**
41
- * This hook is used to fetch collections using a given collection
42
- * @param path
43
- * @param collection
44
- * @param filterValues
45
- * @param sortBy
46
- * @param itemCount
47
- * @param searchString
48
- * @group Hooks and utilities
49
- */
50
- export declare function useCollectionFetch<M extends Record<string, any>, UserType extends User>({ path: inputPath, collection, filterValues, sortBy, itemCount, searchString }: CollectionFetchProps<M>): CollectionFetchResult<M>;
@@ -1,12 +0,0 @@
1
- import { Entity } from "../../types";
2
- export interface DataOrderProps<M extends Record<string, any>> {
3
- data: Entity<M>[];
4
- entitiesDisplayedFirst?: Entity<M>[];
5
- }
6
- /**
7
- * This hook is used to have some entities at the beginning of data.
8
- * @param path
9
- * @param entitiesDisplayedFirst
10
- * @group Hooks and utilities
11
- */
12
- export declare function useDataOrder<M extends Record<string, any>>({ data, entitiesDisplayedFirst }: DataOrderProps<M>): Entity<M>[];
@@ -1,6 +0,0 @@
1
- import { DataSource } from "../../types";
2
- /**
3
- * Use this hook to get the datasource being used
4
- * @group Hooks and utilities
5
- */
6
- export declare const useDataSource: () => DataSource;
@@ -1,28 +0,0 @@
1
- import { Entity, EntityCollection, User } from "../../types";
2
- /**
3
- * @group Hooks and utilities
4
- */
5
- export interface EntityFetchProps<M extends Record<string, any>> {
6
- path: string;
7
- entityId?: string;
8
- collection: EntityCollection<M>;
9
- useCache?: boolean;
10
- }
11
- /**
12
- * @group Hooks and utilities
13
- */
14
- export interface EntityFetchResult<M extends Record<string, any>> {
15
- entity?: Entity<M>;
16
- dataLoading: boolean;
17
- dataLoadingError?: Error;
18
- }
19
- /**
20
- * This hook is used to fetch an entity.
21
- * It gives real time updates if the datasource supports it.
22
- * @param path
23
- * @param collection
24
- * @param entityId
25
- * @param useCache
26
- * @group Hooks and utilities
27
- */
28
- export declare function useEntityFetch<M extends Record<string, any>, UserType extends User>({ path: inputPath, entityId, collection, useCache }: EntityFetchProps<M>): EntityFetchResult<M>;
@@ -1,19 +0,0 @@
1
- export * from "./data/useDataSource";
2
- export * from "./data/useCollectionFetch";
3
- export * from "./data/useEntityFetch";
4
- export * from "./data/save";
5
- export * from "./data/delete";
6
- export * from "../form/useClearRestoreValue";
7
- export * from "./useNavigationController";
8
- export * from "./useResolvedNavigationFrom";
9
- export * from "./useStorageSource";
10
- export * from "./useAuthController";
11
- export * from "./useSideDialogsController";
12
- export * from "./useSideEntityController";
13
- export * from "./useFireCMSContext";
14
- export * from "./useSnackbarController";
15
- export * from "./useModeController";
16
- export * from "./useClipboard";
17
- export * from "./useLargeLayout";
18
- export * from "./useReferenceDialog";
19
- export * from "./useBrowserTitleAndIcon";
@@ -1,11 +0,0 @@
1
- import { AuthController, User } from "../types";
2
- /**
3
- * Hook to retrieve the AuthContext.
4
- *
5
- * Consider that in order to use this hook you need to have a parent
6
- * `FireCMS`
7
- *
8
- * @see AuthController
9
- * @group Hooks and utilities
10
- */
11
- export declare const useAuthController: <UserType extends User = User, AuthControllerType extends AuthController<UserType> = AuthController<UserType>>() => AuthControllerType;
@@ -1,6 +0,0 @@
1
- /**
2
- * Internal hook to handle the browser title and icon
3
- * @param name
4
- * @param logo
5
- */
6
- export declare function useBrowserTitleAndIcon(name: string, logo?: string): void;
@@ -1,57 +0,0 @@
1
- import { MutableRefObject } from "react";
2
- export interface UseClipboardProps {
3
- /**
4
- * It's callback function that is called after the `copy` command
5
- * is executed.
6
- *
7
- * @param text: The selected clipboard text.
8
- */
9
- onSuccess?: (text: string) => void;
10
- /**
11
- * Triggers when the hook encounters an error.
12
- * If passed hook won't throw an error.
13
- *
14
- * @param error: cause of the error
15
- */
16
- onError?: (error: string) => void;
17
- /**
18
- * Disables the new clipboard API `navigator.clipboard` even if
19
- * it is supported.
20
- */
21
- disableClipboardAPI?: boolean;
22
- /**
23
- * revert back the isCopied flag to false again if a value is set.
24
- */
25
- copiedDuration?: number;
26
- }
27
- export interface useClipboardReturnType {
28
- /**
29
- * Use ref to pull the text content from.
30
- */
31
- ref: MutableRefObject<any>;
32
- /**
33
- * Use it to perform the copy operation
34
- */
35
- copy: (text?: string) => void;
36
- /**
37
- * Use it to perform the cut operation
38
- */
39
- cut: () => void;
40
- /**
41
- * Indicates wheater the content was successfully copied or not.
42
- */
43
- isCoppied: boolean;
44
- /**
45
- * Current selected clipboard content.
46
- */
47
- clipboard: string;
48
- /**
49
- * Clears the user clipboard.
50
- */
51
- clearClipboard: () => void;
52
- /**
53
- * Check to see if the browser supports the new `navigator.clipboard` API.
54
- */
55
- isSupported: () => boolean;
56
- }
57
- export declare const useClipboard: (options?: UseClipboardProps) => useClipboardReturnType;
@@ -1,11 +0,0 @@
1
- import { DialogsController } from "../types/dialogs_controller";
2
- /**
3
- * Use this hook to open a dialog imperatively.
4
- * Alternatively, you can use dialogs declaratively using the `Dialog` component.
5
- *
6
- * Consider that in order to use this hook you need to have a parent
7
- * `FireCMS`
8
- *
9
- * @group Hooks and utilities
10
- */
11
- export declare const useDialogsController: () => DialogsController;
@@ -1,12 +0,0 @@
1
- import { AuthController, FireCMSContext, User } from "../types";
2
- export declare const FireCMSContextInstance: import("react").Context<Partial<FireCMSContext>>;
3
- /**
4
- * Hook to retrieve the {@link FireCMSContext}.
5
- *
6
- * Consider that in order to use this hook you need to have a parent
7
- * `FireCMS` component.
8
- *
9
- * @see FireCMSContext
10
- * @group Hooks and utilities
11
- */
12
- export declare const useFireCMSContext: <UserType extends User = User, AuthControllerType extends AuthController<UserType> = AuthController<UserType>>() => FireCMSContext<UserType, AuthControllerType>;
@@ -1 +0,0 @@
1
- export declare const useLargeLayout: (breakpoint?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl") => boolean;
@@ -1,20 +0,0 @@
1
- /**
2
- * Use this controller to change color mode
3
- * @group Hooks and utilities
4
- */
5
- export interface ModeController {
6
- mode: "light" | "dark";
7
- setMode: (mode: "light" | "dark") => void;
8
- toggleMode: () => void;
9
- }
10
- /**
11
- * Hook to retrieve the current mode ("light" | "dark"), and `setMode`
12
- * or `toggle` functions to change it.
13
- *
14
- * Consider that in order to use this hook you need to have a parent
15
- * `FireCMS`
16
- *
17
- * @see ModeController
18
- * @group Hooks and utilities
19
- */
20
- export declare const useModeController: () => ModeController;
@@ -1,9 +0,0 @@
1
- import { NavigationController } from "../types";
2
- /**
3
- * Use this hook to get the navigation of the app.
4
- * This controller provides the resolved collections for the CMS as well
5
- * as utility methods.
6
- *
7
- * @group Hooks and utilities
8
- */
9
- export declare const useNavigationController: () => NavigationController;
@@ -1,18 +0,0 @@
1
- import { ReferenceSelectionInnerProps } from "../components";
2
- /**
3
- * This hook is used to open a side dialog that allows the selection
4
- * of entities under a given path.
5
- * You can use it in custom views for selecting entities.
6
- * You need to specify the path of the target collection at least.
7
- * If your collection is not defined in your top collection configuration
8
- * (in your `FireCMS` component), you need to specify explicitly.
9
- * This is the same hook used internally when a reference property is defined.
10
- * @group Hooks and utilities
11
- */
12
- export declare function useReferenceDialog<M extends Record<string, any>>(referenceDialogProps: Omit<ReferenceSelectionInnerProps<M>, "path"> & {
13
- path?: string | false;
14
- onClose?: () => void;
15
- }): {
16
- open: () => void;
17
- close: () => void;
18
- };
@@ -1,72 +0,0 @@
1
- import { Entity, EntityCollection, EntityCustomView, FireCMSContext, User } from "../types";
2
- /**
3
- * @see resolveNavigationFrom
4
- * @group Hooks and utilities
5
- */
6
- export type ResolvedNavigationEntry<M extends Record<string, any>> = ResolvedNavigationEntity<M> | ResolvedNavigationCollection<M> | ResolvedNavigationEntityCustom<M>;
7
- /**
8
- * @see resolveNavigationFrom
9
- * @group Hooks and utilities
10
- */
11
- export interface ResolvedNavigationEntity<M extends Record<string, any>> {
12
- type: "entity";
13
- entity: Entity<M>;
14
- entityId: string;
15
- path: string;
16
- parentCollection: EntityCollection<M>;
17
- }
18
- /**
19
- * @see resolveNavigationFrom
20
- * @group Hooks and utilities
21
- */
22
- export interface ResolvedNavigationCollection<M extends Record<string, any>> {
23
- type: "collection";
24
- path: string;
25
- collection: EntityCollection<M>;
26
- }
27
- /**
28
- * @see resolveNavigationFrom
29
- * @group Hooks and utilities
30
- */
31
- interface ResolvedNavigationEntityCustom<M extends Record<string, any>> {
32
- type: "custom_view";
33
- path: string;
34
- view: EntityCustomView<M>;
35
- }
36
- /**
37
- * Use this function to retrieve an array of navigation entries (resolved
38
- * collection, entity or entity custom_view) for the given path. You need to pass the app context
39
- * that you receive in different callbacks, such as the save hooks.
40
- *
41
- * It will take into account the `navigation` provided at the `FireCMS` level.
42
- *
43
- * @param path
44
- * @param context
45
- * @group Hooks and utilities
46
- */
47
- export declare function resolveNavigationFrom<M extends Record<string, any>, UserType extends User>({ path, context }: {
48
- path: string;
49
- context: FireCMSContext<UserType>;
50
- }): Promise<ResolvedNavigationEntry<M>[]>;
51
- /**
52
- * @group Hooks and utilities
53
- */
54
- export interface NavigationFromProps {
55
- path: string;
56
- }
57
- /**
58
- * @group Hooks and utilities
59
- */
60
- export interface NavigationFrom<M extends Record<string, any>> {
61
- data?: ResolvedNavigationEntry<M>[];
62
- dataLoading: boolean;
63
- dataLoadingError?: Error;
64
- }
65
- /**
66
- * Use this hook to retrieve an array of navigation entries (resolved
67
- * collection or entity) for the given path. You can use this hook
68
- * in any React component that lives under `FireCMS`
69
- * @group Hooks and utilities
70
- */
71
- export declare function useResolvedNavigationFrom<M extends Record<string, any>, UserType extends User>({ path }: NavigationFromProps): NavigationFrom<M>;
72
- export {};
@@ -1,18 +0,0 @@
1
- import { SideDialogsController } from "../types";
2
- /**
3
- * Hook to retrieve the side dialogs' controller.
4
- *
5
- * This hook allows you to open and close side dialogs. This is the mechanism
6
- * used when open a side entity dialog, or when selecting a reference.
7
- *
8
- * If you want to open a side entity dialog, you can use the {@link useSideEntityController}
9
- * hook.
10
- *
11
- * If you want to select a reference, you can use the {@link useReferenceDialog}
12
- *
13
- * Consider that in order to use this hook you need to have a parent
14
- * `FireCMS`
15
- *
16
- * @group Hooks and utilities
17
- */
18
- export declare const useSideDialogsController: () => SideDialogsController;
@@ -1,12 +0,0 @@
1
- import { SideEntityController } from "../types";
2
- /**
3
- * Use this hook to retrieve an entity controller that allows you to open
4
- * a side dialog to edit an entity.
5
- *
6
- * Consider that in order to use this hook you need to have a parent
7
- * `FireCMS`
8
- *
9
- * @see SideEntityController
10
- * @group Hooks and utilities
11
- */
12
- export declare const useSideEntityController: () => SideEntityController;
@@ -1,41 +0,0 @@
1
- /**
2
- * Possible snackbar types
3
- * @group Hooks and utilities
4
- */
5
- export type SnackbarMessageType = "success" | "info" | "warning" | "error";
6
- /**
7
- * Controller to display snackbars
8
- * @group Hooks and utilities
9
- */
10
- export interface SnackbarController {
11
- /**
12
- * Close the currently open snackbar
13
- */
14
- close: () => void;
15
- /**
16
- * Display a new snackbar. You need to specify the type and message.
17
- * You can optionally specify a title
18
- */
19
- open: (props: {
20
- type: SnackbarMessageType;
21
- message: React.ReactNode;
22
- autoHideDuration?: number;
23
- }) => void;
24
- }
25
- /**
26
- * Hook to retrieve the SnackbarContext.
27
- *
28
- * Consider that in order to use this hook you need to have a parent
29
- * `FireCMS`
30
- *
31
- * @see SnackbarController
32
- * @group Hooks and utilities
33
- */
34
- export declare const useSnackbarController: () => {
35
- open: (props: {
36
- type: SnackbarMessageType;
37
- message: React.ReactNode;
38
- autoHideDuration?: number;
39
- }) => void;
40
- close: () => void;
41
- };
@@ -1,6 +0,0 @@
1
- import { StorageSource } from "../types";
2
- /**
3
- * Use this hook to get the storage source being used
4
- * @group Hooks and utilities
5
- */
6
- export declare const useStorageSource: () => StorageSource;
@@ -1,8 +0,0 @@
1
- import { UserConfigurationPersistence } from "../types";
2
- /**
3
- * Use this controller to access the configuration that is stored externally,
4
- * and not defined in code
5
- *
6
- * @group Hooks and utilities
7
- */
8
- export declare const useUserConfigurationPersistence: () => UserConfigurationPersistence | undefined;
package/src/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export * from "./core";
2
- export * from "./types";
3
- export * from "./form";
4
- export * from "./preview";
5
- export * from "./hooks";
6
- export * from "./components";
7
- export * from "./util";
8
- export * from "./contexts";
@@ -1,22 +0,0 @@
1
- import { Entity, EntityCollection, User } from "../types";
2
- export interface EntityViewProps<M extends Record<string, any>> {
3
- path: string;
4
- collection: EntityCollection<M>;
5
- entityId?: string;
6
- copy?: boolean;
7
- selectedSubPath?: string;
8
- parentCollectionIds: string[];
9
- formWidth?: number | string;
10
- onValuesAreModified: (modified: boolean) => void;
11
- onUpdate?: (params: {
12
- entity: Entity<any>;
13
- }) => void;
14
- onClose?: () => void;
15
- }
16
- /**
17
- * This is the default view that is used as the content of a side panel when
18
- * an entity is opened.
19
- * You probably don't want to use this view directly since it is bound to the
20
- * side panel. Instead, you might want to use {@link EntityForm} or {@link EntityCollectionView}
21
- */
22
- export declare function EntityView<M extends Record<string, any>, UserType extends User>({ path, entityId, selectedSubPath, copy, collection, parentCollectionIds, onValuesAreModified, formWidth, onUpdate, onClose }: EntityViewProps<M>): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +0,0 @@
1
- export declare const CONTAINER_FULL_WIDTH = "100vw";
2
- export declare const ADDITIONAL_TAB_WIDTH = "55vw";
3
- export declare const FORM_CONTAINER_WIDTH = "768px";