@firecms/core 3.3.0 → 3.4.0-canary.2575a08

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 (155) hide show
  1. package/dist/app/useApp.d.ts +1 -0
  2. package/dist/components/EntityCollectionTable/column_utils.d.ts +4 -3
  3. package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +6 -1
  4. package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +3 -1
  5. package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +3 -1
  6. package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +8 -0
  7. package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +3 -1
  8. package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +3 -1
  9. package/dist/components/EntityCollectionView/FiltersDialog.d.ts +2 -1
  10. package/dist/components/EntityCollectionView/useBoardDataController.d.ts +3 -1
  11. package/dist/components/EntityPreview.d.ts +3 -1
  12. package/dist/components/ReferenceTable/ReferenceSelectionTable.d.ts +10 -1
  13. package/dist/components/SelectableTable/filters/filter_text_input.d.ts +30 -0
  14. package/dist/components/SelectableTable/filters/filter_text_input.test.d.ts +1 -0
  15. package/dist/components/common/table_url_params.d.ts +24 -0
  16. package/dist/components/common/useDataSourceTableController.d.ts +9 -1
  17. package/dist/components/common/useTableSearchHelper.d.ts +9 -1
  18. package/dist/core/DefaultDrawer.d.ts +10 -3
  19. package/dist/core/EntityEditView.d.ts +9 -1
  20. package/dist/core/EntityEditViewFormActions.d.ts +1 -1
  21. package/dist/core/field_configs.d.ts +1 -1
  22. package/dist/form/EntityForm.d.ts +8 -1
  23. package/dist/form/EntityFormActions.d.ts +2 -0
  24. package/dist/form/field_bindings/GeopointFieldBinding.d.ts +5 -0
  25. package/dist/form/index.d.ts +1 -0
  26. package/dist/hooks/data/delete.d.ts +1 -1
  27. package/dist/hooks/data/save.d.ts +1 -1
  28. package/dist/hooks/data/useCollectionFetch.d.ts +7 -1
  29. package/dist/hooks/data/useEntityFetch.d.ts +9 -1
  30. package/dist/i18n/__tests__/FireCMSi18nProvider.test.d.ts +1 -0
  31. package/dist/i18n/__tests__/nested_provider_lifecycle.test.d.ts +1 -0
  32. package/dist/index.es.js +3658 -1820
  33. package/dist/index.es.js.map +1 -1
  34. package/dist/index.umd.js +3655 -1817
  35. package/dist/index.umd.js.map +1 -1
  36. package/dist/locales/pl.d.ts +2 -0
  37. package/dist/preview/index.d.ts +1 -0
  38. package/dist/preview/property_previews/GeopointPropertyPreview.d.ts +4 -0
  39. package/dist/types/collections.d.ts +31 -0
  40. package/dist/types/datasource.d.ts +67 -4
  41. package/dist/types/entities.d.ts +21 -1
  42. package/dist/types/entity_actions.d.ts +6 -0
  43. package/dist/types/entity_callbacks.d.ts +21 -0
  44. package/dist/types/navigation.d.ts +34 -5
  45. package/dist/types/plugins.d.ts +13 -0
  46. package/dist/types/properties.d.ts +17 -1
  47. package/dist/types/side_entity_controller.d.ts +7 -0
  48. package/dist/types/translations.d.ts +6 -0
  49. package/dist/util/__tests__/collections.test.d.ts +1 -0
  50. package/dist/util/__tests__/urls.test.d.ts +1 -0
  51. package/dist/util/collections.d.ts +1 -1
  52. package/dist/util/entities.d.ts +1 -0
  53. package/dist/util/entity_cache.d.ts +11 -0
  54. package/dist/util/geopoint.d.ts +22 -0
  55. package/dist/util/index.d.ts +2 -0
  56. package/dist/util/navigation_blocking.d.ts +22 -0
  57. package/dist/util/navigation_from_path.d.ts +17 -0
  58. package/dist/util/navigation_utils.d.ts +107 -3
  59. package/dist/util/parent_references_from_path.d.ts +16 -0
  60. package/dist/util/paths.d.ts +28 -0
  61. package/dist/util/permissions.d.ts +10 -4
  62. package/dist/util/urls.d.ts +22 -0
  63. package/package.json +17 -10
  64. package/src/app/Scaffold.tsx +34 -44
  65. package/src/app/useApp.tsx +1 -0
  66. package/src/components/DeleteEntityDialog.tsx +2 -0
  67. package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +2 -2
  68. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +3 -1
  69. package/src/components/EntityCollectionTable/column_utils.tsx +11 -19
  70. package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +1 -1
  71. package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +7 -0
  72. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +5 -1
  73. package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +12 -0
  74. package/src/components/EntityCollectionView/EntityCollectionView.tsx +66 -15
  75. package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +6 -2
  76. package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +8 -1
  77. package/src/components/EntityCollectionView/FiltersDialog.tsx +39 -28
  78. package/src/components/EntityCollectionView/useBoardDataController.tsx +17 -1
  79. package/src/components/EntityPreview.tsx +45 -41
  80. package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +19 -2
  81. package/src/components/ReferenceWidget.tsx +1 -1
  82. package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +2 -2
  83. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +33 -7
  84. package/src/components/SelectableTable/filters/filter_text_input.test.ts +184 -0
  85. package/src/components/SelectableTable/filters/filter_text_input.ts +71 -0
  86. package/src/components/VirtualTable/VirtualTable.tsx +19 -8
  87. package/src/components/common/default_entity_actions.tsx +22 -2
  88. package/src/components/common/table_url_params.ts +172 -0
  89. package/src/components/common/useDataSourceTableController.tsx +126 -163
  90. package/src/components/common/useTableSearchHelper.ts +26 -2
  91. package/src/contexts/SnackbarProvider.tsx +14 -1
  92. package/src/core/DefaultDrawer.tsx +150 -64
  93. package/src/core/DrawerNavigationGroup.tsx +27 -29
  94. package/src/core/DrawerNavigationItem.tsx +10 -12
  95. package/src/core/EntityEditView.tsx +77 -35
  96. package/src/core/EntityEditViewFormActions.tsx +3 -2
  97. package/src/core/EntitySidePanel.tsx +8 -4
  98. package/src/core/field_configs.tsx +15 -0
  99. package/src/form/EntityForm.tsx +31 -10
  100. package/src/form/EntityFormActions.tsx +2 -0
  101. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +1 -1
  102. package/src/form/field_bindings/GeopointFieldBinding.tsx +139 -0
  103. package/src/form/index.tsx +1 -0
  104. package/src/hooks/data/delete.ts +8 -0
  105. package/src/hooks/data/save.ts +6 -1
  106. package/src/hooks/data/useCollectionFetch.tsx +21 -1
  107. package/src/hooks/data/useEntityFetch.tsx +35 -4
  108. package/src/hooks/useBuildNavigationController.tsx +23 -8
  109. package/src/hooks/useResolvedNavigationFrom.tsx +3 -1
  110. package/src/hooks/useValidateAuthenticator.tsx +4 -0
  111. package/src/i18n/FireCMSi18nProvider.tsx +50 -4
  112. package/src/i18n/__tests__/FireCMSi18nProvider.test.tsx +91 -0
  113. package/src/i18n/__tests__/nested_provider_lifecycle.test.tsx +67 -0
  114. package/src/internal/useBuildDataSource.ts +37 -15
  115. package/src/internal/useBuildSideEntityController.tsx +20 -5
  116. package/src/locales/de.ts +7 -2
  117. package/src/locales/en.ts +7 -2
  118. package/src/locales/es.ts +7 -2
  119. package/src/locales/fr.ts +7 -2
  120. package/src/locales/hi.ts +7 -2
  121. package/src/locales/it.ts +7 -2
  122. package/src/locales/pl.ts +735 -0
  123. package/src/locales/pt.ts +7 -2
  124. package/src/preview/PropertyPreview.tsx +12 -0
  125. package/src/preview/components/ReferencePreview.tsx +7 -3
  126. package/src/preview/components/StorageThumbnail.tsx +24 -2
  127. package/src/preview/index.ts +1 -0
  128. package/src/preview/property_previews/GeopointPropertyPreview.tsx +23 -0
  129. package/src/routes/FireCMSRoute.tsx +54 -27
  130. package/src/types/collections.ts +34 -0
  131. package/src/types/datasource.ts +67 -4
  132. package/src/types/entities.ts +24 -1
  133. package/src/types/entity_actions.tsx +6 -0
  134. package/src/types/entity_callbacks.ts +24 -0
  135. package/src/types/navigation.ts +35 -5
  136. package/src/types/plugins.tsx +13 -0
  137. package/src/types/properties.ts +17 -0
  138. package/src/types/side_entity_controller.tsx +7 -0
  139. package/src/types/translations.ts +6 -0
  140. package/src/util/__tests__/collections.test.ts +32 -0
  141. package/src/util/__tests__/urls.test.ts +131 -0
  142. package/src/util/collections.ts +1 -1
  143. package/src/util/entities.ts +16 -1
  144. package/src/util/entity_cache.ts +18 -0
  145. package/src/util/geopoint.ts +81 -0
  146. package/src/util/index.ts +2 -0
  147. package/src/util/navigation_blocking.ts +45 -0
  148. package/src/util/navigation_from_path.ts +47 -7
  149. package/src/util/navigation_utils.ts +244 -4
  150. package/src/util/parent_references_from_path.ts +45 -4
  151. package/src/util/paths.ts +40 -3
  152. package/src/util/permissions.ts +22 -10
  153. package/src/util/previews.ts +8 -1
  154. package/src/util/resolutions.ts +8 -0
  155. package/src/util/urls.ts +52 -0
@@ -9,6 +9,7 @@ export type AppState = {
9
9
  drawerOpen: boolean;
10
10
  openDrawer: () => void;
11
11
  closeDrawer: () => void;
12
+ closeHover?: () => void;
12
13
  autoOpenDrawer?: boolean;
13
14
  logo?: string;
14
15
  };
@@ -1,15 +1,16 @@
1
1
  import React from "react";
2
- import { FilterValues, ResolvedProperties, ResolvedProperty } from "../../types";
2
+ import { ResolvedProperties, ResolvedProperty } from "../../types";
3
3
  import { VirtualTableColumn } from "../VirtualTable";
4
4
  export declare function buildIdColumn(largeLayout?: boolean): VirtualTableColumn;
5
5
  export interface PropertiesToColumnsParams<M extends Record<string, any>> {
6
6
  properties: ResolvedProperties<M>;
7
7
  sortable?: boolean;
8
- forceFilter?: FilterValues<keyof M extends string ? keyof M : never>;
8
+ forcedFilters?: (keyof M)[];
9
+ allowedFilters?: (keyof M)[];
9
10
  AdditionalHeaderWidget?: React.ComponentType<{
10
11
  property: ResolvedProperty;
11
12
  propertyKey: string;
12
13
  onHover: boolean;
13
14
  }>;
14
15
  }
15
- export declare function propertiesToColumns<M extends Record<string, any>>({ properties, sortable, forceFilter, AdditionalHeaderWidget }: PropertiesToColumnsParams<M>): VirtualTableColumn[];
16
+ export declare function propertiesToColumns<M extends Record<string, any>>({ properties, sortable, forcedFilters, AdditionalHeaderWidget, allowedFilters }: PropertiesToColumnsParams<M>): VirtualTableColumn[];
@@ -11,6 +11,11 @@ interface CollectionTableToolbarProps {
11
11
  onTextSearchClick?: () => void;
12
12
  onTextSearch?: (searchString?: string) => void;
13
13
  textSearchLoading?: boolean;
14
+ /**
15
+ * Search term the search bar should start with, typically the one restored from the
16
+ * URL query params by the table controller.
17
+ */
18
+ initialSearchString?: string;
14
19
  }
15
- export declare function CollectionTableToolbar({ actions, actionsStart, loading, onTextSearch, onTextSearchClick, textSearchLoading, title, viewModeToggle }: CollectionTableToolbarProps): React.JSX.Element;
20
+ export declare function CollectionTableToolbar({ actions, actionsStart, loading, onTextSearch, onTextSearchClick, textSearchLoading, initialSearchString, title, viewModeToggle }: CollectionTableToolbarProps): React.JSX.Element;
16
21
  export {};
@@ -5,6 +5,8 @@ import { OnCellValueChangeParams } from "../../../common";
5
5
  interface PopupFormFieldProps<M extends Record<string, any>> {
6
6
  customFieldValidator?: CustomFieldValidator;
7
7
  path: string;
8
+ /** `path` split at its real segment boundaries; forwarded to the datasource. */
9
+ pathSegments?: string[];
8
10
  entityId: string;
9
11
  tableKey: string;
10
12
  propertyKey?: Extract<keyof M, string>;
@@ -20,7 +22,7 @@ interface PopupFormFieldProps<M extends Record<string, any>> {
20
22
  onCellValueChange?: (params: OnCellValueChangeParams<any, any>) => Promise<void> | void;
21
23
  }
22
24
  export declare function PopupFormField<M extends Record<string, any>>(props: PopupFormFieldProps<M>): React.JSX.Element | null;
23
- export declare function PopupFormFieldLoading<M extends Record<string, any>>({ tableKey, entityId, customFieldValidator, propertyKey, collection: inputCollection, path, cellRect, open, onClose, onCellValueChange, container }: PopupFormFieldProps<M>): React.JSX.Element | null;
25
+ export declare function PopupFormFieldLoading<M extends Record<string, any>>({ tableKey, entityId, customFieldValidator, propertyKey, collection: inputCollection, path, pathSegments, cellRect, open, onClose, onCellValueChange, container }: PopupFormFieldProps<M>): React.JSX.Element | null;
24
26
  export declare function PopupFormFieldInternal<M extends Record<string, any>>({ tableKey, entityId, customFieldValidator, propertyKey, collection: inputCollection, path, cellRect, open, onClose, onCellValueChange, container, entity }: PopupFormFieldProps<M> & {
25
27
  entity?: Entity<M>;
26
28
  }): React.JSX.Element;
@@ -4,6 +4,8 @@ export type EntityCollectionBoardViewProps<M extends Record<string, any> = any>
4
4
  collection: EntityCollection<M>;
5
5
  tableController: EntityTableController<M>;
6
6
  fullPath: string;
7
+ /** `fullPath` split at its real segment boundaries; forwarded to the datasource. */
8
+ pathSegments?: string[];
7
9
  parentCollectionIds?: string[];
8
10
  columnProperty: string;
9
11
  onEntityClick?: (entity: Entity<M>) => void;
@@ -17,4 +19,4 @@ export type EntityCollectionBoardViewProps<M extends Record<string, any> = any>
17
19
  /**
18
20
  * Kanban board view for displaying entities grouped by a string enum property.
19
21
  */
20
- export declare function EntityCollectionBoardView<M extends Record<string, any> = any>({ collection, tableController, fullPath, parentCollectionIds, columnProperty, onEntityClick, selectionController, selectionEnabled, highlightedEntities, emptyComponent, deletedEntities }: EntityCollectionBoardViewProps<M>): React.JSX.Element;
22
+ export declare function EntityCollectionBoardView<M extends Record<string, any> = any>({ collection, tableController, fullPath, pathSegments, parentCollectionIds, columnProperty, onEntityClick, selectionController, selectionEnabled, highlightedEntities, emptyComponent, deletedEntities }: EntityCollectionBoardViewProps<M>): React.JSX.Element;
@@ -13,6 +13,14 @@ export type EntityCollectionViewProps<M extends Record<string, any>> = {
13
13
  * Full path using navigation ids.
14
14
  */
15
15
  fullIdPath?: string;
16
+ /**
17
+ * `fullPath` split at its real segment boundaries, e.g. `["nodes", "node/42", "edges"]`.
18
+ * Forwarded to the datasource so a parent entity id containing "/" stays unambiguous.
19
+ *
20
+ * Optional, and never derived by splitting `fullPath` — a guess would be wrong in
21
+ * exactly the case the field exists for. Absent means "not known here", not "no slashes".
22
+ */
23
+ pathSegments?: string[];
16
24
  /**
17
25
  * If this is a subcollection, specify the parent collection ids.
18
26
  */
@@ -3,6 +3,8 @@ import { EntityCollection, EntityTableController, SelectionController } from "..
3
3
  export type EntityCollectionViewActionsProps<M extends Record<string, any>> = {
4
4
  collection: EntityCollection<M>;
5
5
  path: string;
6
+ /** `path` split at its real segment boundaries, when known. Never derived from `path`. */
7
+ pathSegments?: string[];
6
8
  relativePath: string;
7
9
  parentCollectionIds: string[];
8
10
  selectionEnabled: boolean;
@@ -12,4 +14,4 @@ export type EntityCollectionViewActionsProps<M extends Record<string, any>> = {
12
14
  tableController: EntityTableController<M>;
13
15
  collectionEntitiesCount?: number;
14
16
  };
15
- export declare function EntityCollectionViewActions<M extends Record<string, any>>({ collection, relativePath, parentCollectionIds, onNewClick, onMultipleDeleteClick, selectionEnabled, path, selectionController, tableController, collectionEntitiesCount, }: EntityCollectionViewActionsProps<M>): React.JSX.Element;
17
+ export declare function EntityCollectionViewActions<M extends Record<string, any>>({ collection, relativePath, parentCollectionIds, onNewClick, onMultipleDeleteClick, selectionEnabled, path, pathSegments, selectionController, tableController, collectionEntitiesCount, }: EntityCollectionViewActionsProps<M>): React.JSX.Element;
@@ -3,6 +3,8 @@ import { EntityCollection, EntityTableController, ResolvedProperty, SelectionCon
3
3
  export type EntityCollectionViewStartActionsProps<M extends Record<string, any>> = {
4
4
  collection: EntityCollection<M>;
5
5
  path: string;
6
+ /** `path` split at its real segment boundaries, when known. Never derived from `path`. */
7
+ pathSegments?: string[];
6
8
  relativePath: string;
7
9
  parentCollectionIds: string[];
8
10
  selectionController: SelectionController<M>;
@@ -13,4 +15,4 @@ export type EntityCollectionViewStartActionsProps<M extends Record<string, any>>
13
15
  */
14
16
  resolvedProperties?: Record<string, ResolvedProperty>;
15
17
  };
16
- export declare function EntityCollectionViewStartActions<M extends Record<string, any>>({ collection, relativePath, parentCollectionIds, path, selectionController, tableController, collectionEntitiesCount, resolvedProperties }: EntityCollectionViewStartActionsProps<M>): React.JSX.Element;
18
+ export declare function EntityCollectionViewStartActions<M extends Record<string, any>>({ collection, relativePath, parentCollectionIds, path, pathSegments, selectionController, tableController, collectionEntitiesCount, resolvedProperties }: EntityCollectionViewStartActionsProps<M>): React.JSX.Element;
@@ -7,9 +7,10 @@ export interface FiltersDialogProps {
7
7
  filterValues: FilterValues<any> | undefined;
8
8
  setFilterValues: (filterValues?: FilterValues<any>) => void;
9
9
  forceFilter?: FilterValues<any>;
10
+ allowedFilters?: string[];
10
11
  }
11
12
  /**
12
13
  * Dialog that displays all filterable properties from a collection
13
14
  * and allows setting filter values for each.
14
15
  */
15
- export declare function FiltersDialog({ open, onOpenChange, properties, filterValues, setFilterValues, forceFilter }: FiltersDialogProps): React.JSX.Element;
16
+ export declare function FiltersDialog({ open, onOpenChange, properties, filterValues, setFilterValues, forceFilter, allowedFilters }: FiltersDialogProps): React.JSX.Element;
@@ -38,6 +38,8 @@ export interface BoardDataController<M extends Record<string, any> = any, COLUMN
38
38
  export interface UseBoardDataControllerProps<M extends Record<string, any> = any> {
39
39
  /** Full path to the collection */
40
40
  fullPath: string;
41
+ /** `fullPath` split at its real segment boundaries; forwarded to the datasource. */
42
+ pathSegments?: string[];
41
43
  /** The entity collection configuration */
42
44
  collection: EntityCollection<M>;
43
45
  /** Property key used for column assignment */
@@ -57,4 +59,4 @@ export interface UseBoardDataControllerProps<M extends Record<string, any> = any
57
59
  * Hook that manages per-column data loading for the Kanban board.
58
60
  * Each column gets its own independent query to the data source.
59
61
  */
60
- export declare function useBoardDataController<M extends Record<string, any> = any, COLUMN extends string = string>({ fullPath, collection, columnProperty, columns, orderProperty, pageSize, searchString, filterValues }: UseBoardDataControllerProps<M>): BoardDataController<M, COLUMN>;
62
+ export declare function useBoardDataController<M extends Record<string, any> = any, COLUMN extends string = string>({ fullPath, pathSegments, collection, columnProperty, columns, orderProperty, pageSize, searchString, filterValues }: UseBoardDataControllerProps<M>): BoardDataController<M, COLUMN>;
@@ -29,4 +29,6 @@ export type EntityPreviewContainerProps = {
29
29
  style?: React.CSSProperties;
30
30
  onClick?: (e: React.SyntheticEvent) => void;
31
31
  };
32
- export declare const EntityPreviewContainer: React.ForwardRefExoticComponent<EntityPreviewContainerProps & React.RefAttributes<HTMLDivElement>>;
32
+ export declare function EntityPreviewContainer({ children, hover, onClick, size, style, className, fullwidth, ref }: EntityPreviewContainerProps & {
33
+ ref?: React.Ref<HTMLDivElement>;
34
+ }): React.JSX.Element;
@@ -18,6 +18,15 @@ export interface ReferenceSelectionInnerProps<M extends Record<string, any>> {
18
18
  * dynamic. If not set, the dialog won't open.
19
19
  */
20
20
  path: string;
21
+ /**
22
+ * `path` split at its real segment boundaries, when the caller knows them.
23
+ *
24
+ * Left undefined by default and deliberately NOT derived from `path`: a reference
25
+ * path comes from a property's configuration, so there is no entity chain to recover
26
+ * the boundaries from. Splitting it would silently produce the wrong segments for a
27
+ * subcollection under a slash-bearing parent id, which is worse than not answering.
28
+ */
29
+ pathSegments?: string[];
21
30
  /**
22
31
  * If you are opening the dialog for the first time, you can select some
23
32
  * entity ids to be displayed first.
@@ -55,4 +64,4 @@ export interface ReferenceSelectionInnerProps<M extends Record<string, any>> {
55
64
  * You probably want to open this dialog as a side view using {@link useReferenceDialog}
56
65
  * @group Components
57
66
  */
58
- export declare function ReferenceSelectionTable<M extends Record<string, any>>({ onSingleEntitySelected, onMultipleEntitiesSelected, multiselect, collection, path: pathInput, selectedEntityIds: selectedEntityIdsProp, description, forceFilter, maxSelection, }: ReferenceSelectionInnerProps<M>): React.JSX.Element;
67
+ export declare function ReferenceSelectionTable<M extends Record<string, any>>({ onSingleEntitySelected, onMultipleEntitiesSelected, multiselect, collection, path: pathInput, pathSegments, selectedEntityIds: selectedEntityIdsProp, description, forceFilter, maxSelection, }: ReferenceSelectionInnerProps<M>): React.JSX.Element;
@@ -0,0 +1,30 @@
1
+ export type FilterTextInputParseResult = {
2
+ /**
3
+ * Whether the filter value should be updated with `value`.
4
+ * It is `false` for intermediate inputs that are not a valid value yet,
5
+ * like "-" or "0.", so that the text typed by the user can be kept as it is
6
+ * while the current filter value is left untouched.
7
+ */
8
+ updateValue: boolean;
9
+ /**
10
+ * Parsed value, only relevant when `updateValue` is `true`.
11
+ * `undefined` means the filter should be cleared.
12
+ */
13
+ value?: string | number;
14
+ };
15
+ /**
16
+ * Turn the raw text of a filter input into the value used by the filter.
17
+ *
18
+ * The text shown to the user is never derived back from the parsed value, so
19
+ * intermediate states like "0.", ".0" or "-" survive while typing. Numbers are
20
+ * only committed to the filter once the text is a complete number, which makes
21
+ * values such as 0.01 reachable by typing them character by character.
22
+ *
23
+ * Note that `0` is a perfectly valid filter value, only an empty input clears
24
+ * the filter.
25
+ */
26
+ export declare function parseFilterTextInput(text: string, dataType: "string" | "number"): FilterTextInputParseResult;
27
+ /**
28
+ * Text a filter input should display for a given filter value.
29
+ */
30
+ export declare function filterValueToText(value: unknown): string;
@@ -0,0 +1,24 @@
1
+ import { FilterValues } from "../../types";
2
+ /**
3
+ * Internal helpers used by `useDataSourceTableController` to persist the state of a
4
+ * collection table (filters, sort and text search) in the URL query string.
5
+ *
6
+ * These functions are intentionally NOT re-exported by the package barrel files:
7
+ * they are pure and live in their own module only so that they can be unit tested.
8
+ * `encodeFilterAndSort` and `parseFilterAndSort` must stay exact inverses of each
9
+ * other, otherwise state written to the URL is silently dropped on reload.
10
+ */
11
+ /**
12
+ * Serialise the state of a collection table into a URL query string,
13
+ * without the leading `?`. Returns an empty string when there is no state to persist.
14
+ */
15
+ export declare function encodeFilterAndSort(filterValues?: FilterValues<string>, sortBy?: [string, "asc" | "desc"] | undefined, searchString?: string): string;
16
+ /**
17
+ * Restore the state of a collection table from a URL query string.
18
+ * The inverse of {@link encodeFilterAndSort}.
19
+ */
20
+ export declare function parseFilterAndSort<M>(search: string): {
21
+ filterValues: FilterValues<string> | undefined;
22
+ sortBy?: [Extract<keyof M, string>, "asc" | "desc"];
23
+ searchString?: string;
24
+ };
@@ -5,6 +5,14 @@ export type DataSourceTableControllerProps<M extends Record<string, any> = any>
5
5
  * Full path where the data of this table is located
6
6
  */
7
7
  fullPath: string;
8
+ /**
9
+ * `fullPath` split at its real segment boundaries. Passed through to the datasource so
10
+ * a parent entity id containing "/" stays unambiguous.
11
+ *
12
+ * Optional, and never derived by splitting `fullPath` — a guess would be wrong in
13
+ * exactly the case the field exists for. Absent means "not known here", not "no slashes".
14
+ */
15
+ pathSegments?: string[];
8
16
  /**
9
17
  * The collection that is represented by this config.
10
18
  */
@@ -40,4 +48,4 @@ export type DataSourceTableControllerProps<M extends Record<string, any> = any>
40
48
  * @param forceFilterFromProps
41
49
  * @param updateUrl
42
50
  */
43
- export declare function useDataSourceTableController<M extends Record<string, any> = any, USER extends User = User>({ fullPath, collection, scrollRestoration, entitiesDisplayedFirst, lastDeleteTimestamp, forceFilter: forceFilterFromProps, updateUrl }: DataSourceTableControllerProps<M>): EntityTableController<M>;
51
+ export declare function useDataSourceTableController<M extends Record<string, any> = any, USER extends User = User>({ fullPath, pathSegments, collection, scrollRestoration, entitiesDisplayedFirst, lastDeleteTimestamp, forceFilter: forceFilterFromProps, updateUrl }: DataSourceTableControllerProps<M>): EntityTableController<M>;
@@ -2,9 +2,17 @@ import { EntityCollection } from "../../types";
2
2
  export interface UseTableSearchHelperParams<M extends Record<string, any>> {
3
3
  collection: EntityCollection<M>;
4
4
  fullPath: string;
5
+ /** `fullPath` split at its real segment boundaries, when known. Never derived from it. */
6
+ pathSegments?: string[];
5
7
  parentCollectionIds?: string[];
8
+ /**
9
+ * Search term that is already being applied without the user having gone through the
10
+ * search bar, e.g. one restored from the URL query params. When set, text search is
11
+ * initialised automatically instead of waiting for a click on the search bar.
12
+ */
13
+ initialSearchString?: string;
6
14
  }
7
- export declare function useTableSearchHelper<M extends Record<string, any>>({ collection, fullPath, parentCollectionIds }: UseTableSearchHelperParams<M>): {
15
+ export declare function useTableSearchHelper<M extends Record<string, any>>({ collection, fullPath, pathSegments, parentCollectionIds, initialSearchString }: UseTableSearchHelperParams<M>): {
8
16
  textSearchLoading: boolean;
9
17
  textSearchInitialised: boolean;
10
18
  onTextSearchClick: (() => void) | undefined;
@@ -8,11 +8,18 @@ export declare function DefaultDrawer({ className, style, }: {
8
8
  style?: React.CSSProperties;
9
9
  }): React.JSX.Element;
10
10
  /**
11
- * This is the logo displayed in the drawer
12
- * It expands when the drawer is open.
11
+ * Collapse/expand toggle rendered at the bottom of the drawer.
12
+ * Uses double-chevron icons to indicate direction. Reads the drawer state
13
+ * from {@link useApp} so it can be dropped into any drawer.
14
+ *
15
+ * @group Core
16
+ */
17
+ export declare function DrawerToggle(): React.JSX.Element;
18
+ /**
19
+ * This is the logo displayed in the drawer.
20
+ * A compact logo aligned to the left of the drawer header.
13
21
  *
14
22
  * @param logo
15
-
16
23
  */
17
24
  export declare function DrawerLogo({ logo }: {
18
25
  logo?: string;
@@ -7,6 +7,8 @@ export type OnUpdateParams = {
7
7
  entity: Entity<any>;
8
8
  status: EntityStatus;
9
9
  path: string;
10
+ /** `path` split at its real segment boundaries, when known. Never derived from `path`. */
11
+ pathSegments?: string[];
10
12
  entityId?: string;
11
13
  selectedTab?: string;
12
14
  collection: EntityCollection<any>;
@@ -32,6 +34,12 @@ export interface EntityEditViewProps<M extends Record<string, any>> {
32
34
  * The navigation path to the entity.
33
35
  */
34
36
  fullIdPath?: string;
37
+ /**
38
+ * `path` split at its real segment boundaries, e.g. `["nodes", "node/42", "edges"]`.
39
+ * Forwarded to the datasource, and extended for any subcollection rendered inside this
40
+ * view, so a parent entity id containing "/" stays unambiguous.
41
+ */
42
+ pathSegments?: string[];
35
43
  collection: EntityCollection<M>;
36
44
  entityId?: string;
37
45
  databaseId?: string;
@@ -50,7 +58,7 @@ export interface EntityEditViewProps<M extends Record<string, any>> {
50
58
  * an entity is opened.
51
59
  */
52
60
  export declare function EntityEditView<M extends Record<string, any>, USER extends User>({ entityId, ...props }: EntityEditViewProps<M>): React.JSX.Element;
53
- export declare function EntityEditViewInner<M extends Record<string, any>>({ path, fullIdPath, entityId, selectedTab: selectedTabProp, collection, parentCollectionIds, onValuesModified, onSaved, onTabChange, entity, initialDirtyValues, dataLoading, layout, barActions, status, setStatus, formProps, canEdit }: EntityEditViewProps<M> & {
61
+ export declare function EntityEditViewInner<M extends Record<string, any>>({ path, fullIdPath, pathSegments, entityId, selectedTab: selectedTabProp, collection, parentCollectionIds, onValuesModified, onSaved, onTabChange, entity, initialDirtyValues, dataLoading, layout, barActions, status, setStatus, formProps, canEdit }: EntityEditViewProps<M> & {
54
62
  entity?: Entity<M>;
55
63
  initialDirtyValues?: Partial<M>;
56
64
  dataLoading: boolean;
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
2
  import { EntityFormActionsProps } from "../form/EntityFormActions";
3
- export declare function EntityEditViewFormActions({ collection, path, entity, layout, savingError, formex, disabled, status, pluginActions, openEntityMode, showDefaultActions, navigateBack, formContext }: EntityFormActionsProps): React.JSX.Element;
3
+ export declare function EntityEditViewFormActions({ collection, path, pathSegments, entity, layout, savingError, formex, disabled, status, pluginActions, openEntityMode, showDefaultActions, navigateBack, formContext }: EntityFormActionsProps): React.JSX.Element;
@@ -3,5 +3,5 @@ export declare function isDefaultFieldConfigId(id: string): boolean;
3
3
  export declare const DEFAULT_FIELD_CONFIGS: Record<string, PropertyConfig<any>>;
4
4
  export declare function getDefaultFieldConfig(property: Property | ResolvedProperty): PropertyConfig | undefined;
5
5
  export declare function getFieldConfig(property: Property | ResolvedProperty, propertyConfigs: Record<string, PropertyConfig<any>>): PropertyConfig | undefined;
6
- export declare function getDefaultFieldId(property: Property | ResolvedProperty): "reference" | "date_time" | "text_field" | "multiline" | "markdown" | "url" | "email" | "user_select" | "select" | "multi_select" | "number_input" | "number_select" | "multi_number_select" | "file_upload" | "multi_file_upload" | "group" | "key_value" | "reference_as_string" | "multi_references" | "switch" | "repeat" | "custom_array" | "block" | undefined;
6
+ export declare function getDefaultFieldId(property: Property | ResolvedProperty): "reference" | "date_time" | "geopoint" | "text_field" | "multiline" | "markdown" | "url" | "email" | "user_select" | "select" | "multi_select" | "number_input" | "number_select" | "multi_number_select" | "file_upload" | "multi_file_upload" | "group" | "key_value" | "reference_as_string" | "multi_references" | "switch" | "repeat" | "custom_array" | "block" | undefined;
7
7
  export declare function getFieldId(property: Property | ResolvedProperty): string | undefined;
@@ -7,12 +7,19 @@ export type OnUpdateParams = {
7
7
  entity: Entity<any>;
8
8
  status: EntityStatus;
9
9
  path: string;
10
+ /** `path` split at its real segment boundaries, when known. Never derived from `path`. */
11
+ pathSegments?: string[];
10
12
  entityId?: string;
11
13
  selectedTab?: string;
12
14
  collection: EntityCollection<any>;
13
15
  };
14
16
  export type EntityFormProps<M extends Record<string, any>> = {
15
17
  path: string;
18
+ /**
19
+ * `path` split at its real segment boundaries; forwarded to the datasource for
20
+ * generateEntityId and checkUniqueField. Never derived from `path`.
21
+ */
22
+ pathSegments?: string[];
16
23
  fullIdPath?: string;
17
24
  collection: EntityCollection<M>;
18
25
  entityId?: string;
@@ -48,6 +55,6 @@ export type EntityFormProps<M extends Record<string, any>> = {
48
55
  };
49
56
  export declare function extractTouchedValues(values: any, touched: Record<string, boolean>): Record<string, any>;
50
57
  export declare function getChanges<T extends object>(source: Partial<T>, comparison: Partial<T>): Partial<T>;
51
- export declare function EntityForm<M extends Record<string, any>>({ path, fullIdPath, entityId: entityIdProp, collection, onValuesModified, onIdChange, onSaved, entity, initialDirtyValues, onFormContextReady, forceActionsAtTheBottom, initialStatus, className, onStatusChange, onEntityChange, openEntityMode, formex: formexProp, disabled: disabledProp, Builder, EntityFormActionsComponent, showDefaultActions, showEntityPath, children }: EntityFormProps<M>): React.JSX.Element;
58
+ export declare function EntityForm<M extends Record<string, any>>({ path, pathSegments, fullIdPath, entityId: entityIdProp, collection, onValuesModified, onIdChange, onSaved, entity, initialDirtyValues, onFormContextReady, forceActionsAtTheBottom, initialStatus, className, onStatusChange, onEntityChange, openEntityMode, formex: formexProp, disabled: disabledProp, Builder, EntityFormActionsComponent, showDefaultActions, showEntityPath, children }: EntityFormProps<M>): React.JSX.Element;
52
59
  export declare function getInitialEntityValues<M extends object>(authController: AuthController, collection: EntityCollection, path: string, status: "new" | "existing" | "copy", entity: Entity<M> | undefined, propertyConfigs?: Record<string, PropertyConfig>): Partial<EntityValues<M>>;
53
60
  export declare function yupToFormErrors(yupError: ValidationError): Record<string, any>;
@@ -6,6 +6,8 @@ export interface EntityFormActionsProps {
6
6
  fullIdPath?: string;
7
7
  collection: ResolvedEntityCollection;
8
8
  path: string;
9
+ /** `path` split at its real segment boundaries, when known. Never derived from `path`. */
10
+ pathSegments?: string[];
9
11
  entity?: Entity;
10
12
  layout: "bottom" | "side";
11
13
  savingError?: Error;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { FieldProps, GeoPoint } from "../../types";
3
+ type GeopointFieldBindingProps = FieldProps<GeoPoint>;
4
+ export declare function GeopointFieldBinding({ propertyKey, value, setValue, error, showError, disabled, autoFocus, property, includeDescription, size }: GeopointFieldBindingProps): React.JSX.Element;
5
+ export {};
@@ -7,6 +7,7 @@ export { StorageUploadFieldBinding } from "./field_bindings/StorageUploadFieldBi
7
7
  export { TextFieldBinding } from "./field_bindings/TextFieldBinding";
8
8
  export { SwitchFieldBinding } from "./field_bindings/SwitchFieldBinding";
9
9
  export { DateTimeFieldBinding } from "./field_bindings/DateTimeFieldBinding";
10
+ export { GeopointFieldBinding } from "./field_bindings/GeopointFieldBinding";
10
11
  export { ReferenceFieldBinding } from "./field_bindings/ReferenceFieldBinding";
11
12
  export { ReferenceAsStringFieldBinding } from "./field_bindings/ReferenceAsStringFieldBinding";
12
13
  export { MapFieldBinding } from "./field_bindings/MapFieldBinding";
@@ -30,7 +30,7 @@ export type DeleteEntityWithCallbacksProps<M extends Record<string, any>, USER e
30
30
  * @param context
31
31
  * @group Hooks and utilities
32
32
  */
33
- export declare function deleteEntityWithCallbacks<M extends Record<string, any>, USER extends User>({ dataSource, entity, collection, callbacks, onDeleteSuccess, onDeleteFailure, onPreDeleteHookError, onDeleteSuccessHookError, context }: DeleteEntityWithCallbacksProps<M> & {
33
+ export declare function deleteEntityWithCallbacks<M extends Record<string, any>, USER extends User>({ dataSource, entity, pathSegments, collection, callbacks, onDeleteSuccess, onDeleteFailure, onPreDeleteHookError, onDeleteSuccessHookError, context }: DeleteEntityWithCallbacksProps<M> & {
34
34
  collection: ResolvedEntityCollection<M>;
35
35
  dataSource: DataSource;
36
36
  context: FireCMSContext<USER>;
@@ -34,7 +34,7 @@ export type SaveEntityWithCallbacksProps<M extends Record<string, any>> = SaveEn
34
34
  * @see useDataSource
35
35
  * @group Hooks and utilities
36
36
  */
37
- export declare function saveEntityWithCallbacks<M extends Record<string, any>, USER extends User>({ collection, path, entityId, values, previousValues, status, dataSource, context, onSaveSuccess, onSaveFailure, onPreSaveHookError, onSaveSuccessHookError }: SaveEntityWithCallbacksProps<M> & {
37
+ export declare function saveEntityWithCallbacks<M extends Record<string, any>, USER extends User>({ collection, path, pathSegments, entityId, values, previousValues, status, dataSource, context, onSaveSuccess, onSaveFailure, onPreSaveHookError, onSaveSuccessHookError }: SaveEntityWithCallbacksProps<M> & {
38
38
  collection: EntityCollection<M, USER>;
39
39
  dataSource: DataSource;
40
40
  context: FireCMSContext;
@@ -7,6 +7,12 @@ export interface CollectionFetchProps<M extends Record<string, any>> {
7
7
  * Absolute collection path
8
8
  */
9
9
  path: string;
10
+ /**
11
+ * `path` split at its real segment boundaries. Forwarded to the datasource so a parent
12
+ * entity id containing "/" stays unambiguous. Never derived from `path` — see
13
+ * `pathSegments` on the datasource props.
14
+ */
15
+ pathSegments?: string[];
10
16
  /**
11
17
  * collection of the entity displayed by this collection
12
18
  */
@@ -47,4 +53,4 @@ export interface CollectionFetchResult<M extends Record<string, any>> {
47
53
  * @param searchString
48
54
  * @group Hooks and utilities
49
55
  */
50
- export declare function useCollectionFetch<M extends Record<string, any>, USER extends User>({ path: inputPath, collection, filterValues, sortBy, itemCount, searchString }: CollectionFetchProps<M>): CollectionFetchResult<M>;
56
+ export declare function useCollectionFetch<M extends Record<string, any>, USER extends User>({ path: inputPath, pathSegments: inputPathSegments, collection, filterValues, sortBy, itemCount, searchString }: CollectionFetchProps<M>): CollectionFetchResult<M>;
@@ -4,6 +4,14 @@ import { Entity, EntityCollection, User } from "../../types";
4
4
  */
5
5
  export interface EntityFetchProps<M extends Record<string, any>, USER extends User = User> {
6
6
  path: string;
7
+ /**
8
+ * `path` split at its real segment boundaries. Forwarded to the datasource so a parent
9
+ * entity id containing "/" stays unambiguous.
10
+ *
11
+ * Optional, and never derived by splitting `path` — a guess would be wrong in exactly
12
+ * the case the field exists for. Absent means "not known here", not "no slashes".
13
+ */
14
+ pathSegments?: string[];
7
15
  entityId?: string;
8
16
  databaseId?: string;
9
17
  collection: EntityCollection<M, USER>;
@@ -26,4 +34,4 @@ export interface EntityFetchResult<M extends Record<string, any>> {
26
34
  * @param useCache
27
35
  * @group Hooks and utilities
28
36
  */
29
- export declare function useEntityFetch<M extends Record<string, any>, USER extends User>({ path: inputPath, entityId, collection, databaseId, useCache }: EntityFetchProps<M, USER>): EntityFetchResult<M>;
37
+ export declare function useEntityFetch<M extends Record<string, any>, USER extends User>({ path: inputPath, pathSegments: inputPathSegments, entityId, collection, databaseId, useCache }: EntityFetchProps<M, USER>): EntityFetchResult<M>;
@@ -0,0 +1 @@
1
+ export {};