@firecms/core 3.5.2-canary.16bf7bb → 3.5.2-canary.a36570e

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 (27) hide show
  1. package/dist/components/EntityCollectionView/CollectionCountBadge.d.ts +8 -0
  2. package/dist/components/EntityCollectionView/CollectionPathTitle.d.ts +24 -0
  3. package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +5 -0
  4. package/dist/components/EntityCollectionView/EntityIdHeaderWidget.d.ts +12 -0
  5. package/dist/components/EntityCollectionView/utils.d.ts +4 -3
  6. package/dist/index.es.js +592 -567
  7. package/dist/index.es.js.map +1 -1
  8. package/dist/index.umd.js +592 -567
  9. package/dist/index.umd.js.map +1 -1
  10. package/dist/internal/useLeavePageConfirmation.d.ts +11 -0
  11. package/dist/types/side_dialogs_controller.d.ts +4 -2
  12. package/package.json +3 -3
  13. package/src/components/EntityCollectionView/CollectionCountBadge.tsx +17 -0
  14. package/src/components/EntityCollectionView/CollectionPathTitle.tsx +68 -0
  15. package/src/components/EntityCollectionView/EntityCollectionView.tsx +12 -111
  16. package/src/components/EntityCollectionView/EntityIdHeaderWidget.tsx +166 -0
  17. package/src/components/EntityCollectionView/utils.ts +13 -7
  18. package/src/components/common/default_entity_actions.tsx +2 -1
  19. package/src/core/DefaultAppBar.tsx +12 -9
  20. package/src/core/EntityEditView.tsx +26 -1
  21. package/src/core/SideDialogs.tsx +6 -13
  22. package/src/hooks/useReferenceDialog.tsx +2 -2
  23. package/src/internal/useBuildSideDialogsController.tsx +44 -2
  24. package/src/internal/useLeavePageConfirmation.ts +25 -0
  25. package/src/types/side_dialogs_controller.tsx +4 -2
  26. package/dist/internal/useUnsavedChangesDialog.d.ts +0 -12
  27. package/src/internal/useUnsavedChangesDialog.tsx +0 -142
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ /**
3
+ * Number of entities in a collection, as shown next to its name.
4
+ * `undefined` renders nothing, `null` a loading placeholder.
5
+ */
6
+ export declare function CollectionCountBadge({ count }: {
7
+ count: number | null | undefined;
8
+ }): React.JSX.Element | null;
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ /**
3
+ * A name and its entity count, under what is above it: breadcrumbs folded on two lines
4
+ * for where a row of them would not fit.
5
+ */
6
+ export declare function PathTitle({ parents, name, count, className }: {
7
+ parents: string[];
8
+ name: string;
9
+ /** `undefined` shows no count, `null` a loading one. */
10
+ count: number | null | undefined;
11
+ className?: string;
12
+ }): React.JSX.Element;
13
+ /**
14
+ * A collection's name and entity count, under the collections and entities above it,
15
+ * the same things the app bar's breadcrumbs show. A side panel covers those, so it
16
+ * shows a subcollection's in its own top bar.
17
+ */
18
+ export declare function CollectionPathTitle({ path, name, count }: {
19
+ /** The escaped chain, as in `fullIdPath`. */
20
+ path: string;
21
+ name: string;
22
+ /** `undefined` shows no count, `null` a loading one. */
23
+ count: number | null | undefined;
24
+ }): React.JSX.Element;
@@ -34,6 +34,11 @@ export type EntityCollectionViewProps<M extends Record<string, any>> = {
34
34
  * If true, this view will store its filter and sorting status in the url params
35
35
  */
36
36
  updateUrl?: boolean;
37
+ /**
38
+ * Called with the number of entities in the collection, with the current filters
39
+ * applied, each time it is counted: the count the breadcrumbs show.
40
+ */
41
+ onCountChange?: (count: number) => void;
37
42
  } & EntityCollection<M>;
38
43
  /**
39
44
  * This component is in charge of binding a datasource path with an {@link EntityCollection}
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { EntityCollection } from "../../types";
3
+ /**
4
+ * "Find by id" in the header of a collection's id column, listing the ids opened in it lately.
5
+ */
6
+ export declare function EntityIdHeaderWidget({ collection, path, pathSegments, fullIdPath }: {
7
+ collection: EntityCollection;
8
+ path: string;
9
+ /** `path` split at its real segment boundaries, when the caller knows them. */
10
+ pathSegments?: string[];
11
+ fullIdPath: string;
12
+ }): React.JSX.Element;
@@ -1,3 +1,4 @@
1
- export declare function addRecentId(collectionId: string, id: string): string[];
2
- export declare function saveSearchedIdsLocally(collectionId: string, ids: string[]): void;
3
- export declare function getRecentIds(collectionId: string): string[];
1
+ export declare function addRecentId(key: string, id: string): string[];
2
+ export declare function saveSearchedIdsLocally(key: string, ids: string[]): void;
3
+ export declare function getRecentIds(key: string): string[];
4
+ export declare function removeRecentIds(key: string, ids: string[]): string[];