@rebasepro/cms 0.22.0 → 0.24.0
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.
- package/dist/{CollectionEditorDialog-CUtfS_49.js → CollectionEditorDialog-p5-I-Apu.js} +181 -97
- package/dist/CollectionEditorDialog-p5-I-Apu.js.map +1 -0
- package/dist/{PropertyEditView-BpEbC0Q2.js → PropertyEditView-DDB_X-00.js} +55 -23
- package/dist/PropertyEditView-DDB_X-00.js.map +1 -0
- package/dist/{RouterCollectionsStudioView-EK8Knq5I.js → RouterCollectionsStudioView-SGBV4CMg.js} +34 -10
- package/dist/RouterCollectionsStudioView-SGBV4CMg.js.map +1 -0
- package/dist/{SchemaChangeDialog-BeP0A4MJ.js → SchemaChangeDialog-CcFSXvkK.js} +33 -12
- package/dist/SchemaChangeDialog-CcFSXvkK.js.map +1 -0
- package/dist/collection_editor/_cms_internals.d.ts +3 -1
- package/dist/collection_editor/liveSchemaClient.d.ts +38 -18
- package/dist/collection_editor/relation_kinds.d.ts +11 -0
- package/dist/collection_editor/serializable_types.d.ts +2 -0
- package/dist/collection_editor/types/config_controller.d.ts +11 -0
- package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +8 -1
- package/dist/collection_editor/useLiveSchemaEditing.d.ts +5 -5
- package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +7 -0
- package/dist/collection_editor_ui.js +5 -5
- package/dist/components/ClearFilterSortButton.d.ts +7 -1
- package/dist/components/CollectionTableBinding/fields/CompactEntityCellField.d.ts +12 -13
- package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.d.ts +6 -3
- package/dist/components/CollectionTableBinding/fields/TableReferenceField.d.ts +8 -1
- package/dist/components/CollectionTableBinding/fields/TableRelationField.d.ts +8 -1
- package/dist/components/CollectionTableBinding/fields/TableRelationSelectorField.d.ts +13 -3
- package/dist/components/CollectionTableBinding/fields/VirtualTableSelect.d.ts +10 -0
- package/dist/components/CollectionTableBinding/fields/VirtualTableUserSelect.d.ts +10 -0
- package/dist/components/CollectionTableBinding/internal/EntityTableCell.d.ts +21 -0
- package/dist/components/CollectionTableBinding/internal/TableCellOpener.d.ts +45 -0
- package/dist/components/CollectionTableBinding/table_bindings.d.ts +24 -0
- package/dist/components/CollectionViewBinding/CollectionViewActions.d.ts +6 -1
- package/dist/components/CollectionViewBinding/CollectionViewBinding.d.ts +12 -3
- package/dist/components/CollectionViewBinding/FiltersDialog.d.ts +5 -0
- package/dist/components/EditViewBinding.d.ts +7 -1
- package/dist/components/EntityIdentityBar.d.ts +29 -4
- package/dist/components/EntityPreviewBinding.d.ts +8 -1
- package/dist/components/EntityPreviewNesting.d.ts +15 -0
- package/dist/components/NavigationLoadingErrorView.d.ts +16 -0
- package/dist/components/PickerTrigger.d.ts +17 -0
- package/dist/components/ReferenceTable/SelectionTableBinding.d.ts +12 -0
- package/dist/components/RelationSelector.d.ts +24 -7
- package/dist/components/UserSelector.d.ts +8 -1
- package/dist/components/common/ActionMenuLabel.d.ts +15 -0
- package/dist/components/common/default_entity_actions.d.ts +37 -0
- package/dist/data_export/export/additional_fields.d.ts +13 -0
- package/dist/data_export/export/export.d.ts +6 -0
- package/dist/data_import/components/ImportConversionProblems.d.ts +11 -0
- package/dist/data_import/components/index.d.ts +1 -0
- package/dist/data_import/utils/csv.d.ts +3 -2
- package/dist/data_import/utils/data.d.ts +81 -4
- package/dist/data_import/utils/id_column.d.ts +16 -0
- package/dist/data_import/utils/import_columns.d.ts +48 -0
- package/dist/editor/editor.d.ts +7 -1
- package/dist/editor/extensions/Image.d.ts +22 -1
- package/dist/editor/hooks/useProseMirror.d.ts +4 -1
- package/dist/editor.js +69 -7
- package/dist/editor.js.map +1 -1
- package/dist/{export-LvIpE7sE.js → export-DCHuPD1a.js} +65 -211
- package/dist/export-DCHuPD1a.js.map +1 -0
- package/dist/form/form_utils.d.ts +37 -0
- package/dist/form/resolve_form_properties.d.ts +26 -0
- package/dist/form/validation.d.ts +13 -0
- package/dist/{history-DG6Ln7CV.js → history-CBd6SBRs.js} +3 -2
- package/dist/{history-DG6Ln7CV.js.map → history-CBd6SBRs.js.map} +1 -1
- package/dist/hooks/useEntityDisplay.d.ts +4 -5
- package/dist/hooks/useRecordActions.d.ts +28 -6
- package/dist/hooks/useReferencePaths.d.ts +21 -0
- package/dist/hooks/useStorageReferenceResolver.d.ts +23 -0
- package/dist/{import-Cxnmpyjl.js → import-DjQoRrIU.js} +35 -54
- package/dist/import-DjQoRrIU.js.map +1 -0
- package/dist/index.js +191 -117
- package/dist/index.js.map +1 -1
- package/dist/preview/components/StorageMarkdown.d.ts +10 -0
- package/dist/preview/util.d.ts +29 -0
- package/dist/util/caller_scopes.d.ts +15 -0
- package/dist/util/entity_actions.d.ts +37 -1
- package/dist/util/fit_inline_actions.d.ts +20 -0
- package/dist/util/navigation_utils.d.ts +14 -2
- package/dist/util/view_mode.d.ts +12 -18
- package/dist/{util-CyIcgnv2.js → util-BRvKFMLa.js} +5775 -3665
- package/dist/util-BRvKFMLa.js.map +1 -0
- package/dist/{util-DB31IoJE.js → util-D7ebttKT.js} +39 -2
- package/dist/util-D7ebttKT.js.map +1 -0
- package/package.json +9 -9
- package/dist/CollectionEditorDialog-CUtfS_49.js.map +0 -1
- package/dist/PropertyEditView-BpEbC0Q2.js.map +0 -1
- package/dist/RouterCollectionsStudioView-EK8Knq5I.js.map +0 -1
- package/dist/SchemaChangeDialog-BeP0A4MJ.js.map +0 -1
- package/dist/export-LvIpE7sE.js.map +0 -1
- package/dist/import-Cxnmpyjl.js.map +0 -1
- package/dist/util-CyIcgnv2.js.map +0 -1
- package/dist/util-DB31IoJE.js.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type MarkdownProps } from "@rebasepro/ui";
|
|
3
|
+
/**
|
|
4
|
+
* Markdown whose images may be stored as `rebase-storage:` references — what
|
|
5
|
+
* the markdown editor writes for an uploaded image — rendered with a freshly
|
|
6
|
+
* signed URL for each.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function StorageMarkdown({ source, ...props }: MarkdownProps): React.JSX.Element;
|
package/dist/preview/util.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CollectionSize } from "@rebasepro/cms-types";
|
|
2
|
+
import type { DateProperty } from "@rebasepro/types";
|
|
2
3
|
import type { PreviewSize } from "../types/components/PropertyPreviewProps.js";
|
|
3
4
|
export declare function sanitizeUrl(url: string | undefined): string;
|
|
4
5
|
export declare const SMALL_THUMBNAIL = 40;
|
|
@@ -6,3 +7,31 @@ export declare const MEDIUM_THUMBNAIL = 100;
|
|
|
6
7
|
export declare const LARGE_THUMBNAIL = 200;
|
|
7
8
|
export declare function getThumbnailMeasure(size: PreviewSize): number;
|
|
8
9
|
export declare function getPreviewSizeFrom(size: CollectionSize): PreviewSize;
|
|
10
|
+
/**
|
|
11
|
+
* The zone a date property is shown and entered in.
|
|
12
|
+
*
|
|
13
|
+
* A `columnType: "date"` column holds a calendar day with no zone. It travels
|
|
14
|
+
* as that day's UTC midnight, and Postgres keeps the date part of whatever it
|
|
15
|
+
* is given, so it is read and written in UTC. In the browser's own zone a
|
|
16
|
+
* stored 15th showed as the 14th west of Greenwich, and a 15th picked east of
|
|
17
|
+
* it was stored as the 14th.
|
|
18
|
+
*
|
|
19
|
+
* A `columnType: "time"` column holds a time of day with no zone, and travels
|
|
20
|
+
* as that time on 1970-01-01 UTC, so it is shown in UTC too: in the browser's
|
|
21
|
+
* zone a stored 09:30 read as 10:30 in Rome.
|
|
22
|
+
*
|
|
23
|
+
* Any other date is shown in the property's declared `timezone`, or the
|
|
24
|
+
* browser's when it declares none.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getDatePropertyTimezone(property: DateProperty): string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Whether a date property is picked and shown as a day or a day and a time. A
|
|
29
|
+
* `date` column holds no time, so it is a day whatever `mode` says.
|
|
30
|
+
*/
|
|
31
|
+
export declare function getDatePropertyMode(property: DateProperty): "date" | "date_time" | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Whether a value has nothing to show: absent, a blank string, an empty list.
|
|
34
|
+
* A preview of one draws the empty marker, which is the right thing for a
|
|
35
|
+
* column of values and the wrong thing for the one line under a record's name.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isEmptyPreviewValue(value: unknown): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Does the signed-in caller hold `scope`? Read off the controller's
|
|
3
|
+
* `heldScopes` — `GET /auth/scopes` — so an action is offered, or an admin
|
|
4
|
+
* route asked, by exactly those the route admits. Not known yet is no.
|
|
5
|
+
*/
|
|
6
|
+
export declare function callerHoldsScope(authController: unknown, scope: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Does the controller report the caller's scopes at all? `useRebaseAuthController`
|
|
9
|
+
* does (`undefined` until they are known). A controller without the field,
|
|
10
|
+
* such as `useAuthSubscription` or a hand-written one, cannot say, and a gate
|
|
11
|
+
* built on it has to fall back to asking the backend.
|
|
12
|
+
*/
|
|
13
|
+
export declare function reportsScopes(authController: unknown): authController is {
|
|
14
|
+
heldScopes?: unknown;
|
|
15
|
+
};
|
|
@@ -1,2 +1,38 @@
|
|
|
1
|
-
import type { EntityAction } from "@rebasepro/cms-types";
|
|
1
|
+
import type { EntityAction, EntityActionClickProps } from "@rebasepro/cms-types";
|
|
2
2
|
export declare function mergeEntityActions(currentActions: EntityAction[], newActions: EntityAction[]): EntityAction[];
|
|
3
|
+
export interface PlacedEntityActions<A = EntityAction> {
|
|
4
|
+
/** Declared `collapsed: false`: buttons of their own, in declaration order. */
|
|
5
|
+
inline: A[];
|
|
6
|
+
/** The collection's own actions that wait in the menu. */
|
|
7
|
+
own: A[];
|
|
8
|
+
/** The built-ins that work on any record: Edit, Copy. */
|
|
9
|
+
generic: A[];
|
|
10
|
+
/** Delete, or Remove on a linked tab. */
|
|
11
|
+
destructive: A[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Where each of a record's actions goes — the same answer on every surface
|
|
15
|
+
* that shows them, the record's bar and a table row alike.
|
|
16
|
+
*
|
|
17
|
+
* Built-ins used to come first, so the menu read Copy, Delete, then the
|
|
18
|
+
* collection's own: Delete sat second, between two harmless items, and the
|
|
19
|
+
* operations a collection adds — the reason someone opened this record — came
|
|
20
|
+
* after it. The menu leads with those now, Copy follows, and Delete is last
|
|
21
|
+
* and set apart, where it is not hit while reaching for a neighbour.
|
|
22
|
+
*
|
|
23
|
+
* Whether an action is a button is the developer's call, by `collapsed`, and
|
|
24
|
+
* that holds for the built-ins too: a Delete declared `collapsed: false` is a
|
|
25
|
+
* button.
|
|
26
|
+
*/
|
|
27
|
+
export declare function placeEntityActions<A extends Pick<EntityAction, "key" | "collapsed">>(actions: A[]): PlacedEntityActions<A>;
|
|
28
|
+
export interface EntityActionState {
|
|
29
|
+
enabled: boolean;
|
|
30
|
+
/** Only when disabled, and only if the action says why. */
|
|
31
|
+
disabledReason?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Whether an action can run for these props and, when it cannot, why — the
|
|
35
|
+
* one question every surface that draws an action asks, so a reason declared
|
|
36
|
+
* once shows on the record's bar, its menu and the collection's rows alike.
|
|
37
|
+
*/
|
|
38
|
+
export declare function resolveEntityActionState(action: Pick<EntityAction, "isEnabled" | "disabledReason">, props: EntityActionClickProps<Record<string, unknown>>): EntityActionState;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface InlineActionsFit {
|
|
2
|
+
/** How many of the actions, from the front, stay in the bar. */
|
|
3
|
+
count: number;
|
|
4
|
+
/** Icon-only, the name moving to a tooltip. */
|
|
5
|
+
compact: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* How many of a bar's inline actions fit in `available` pixels, and in which
|
|
9
|
+
* form.
|
|
10
|
+
*
|
|
11
|
+
* Labelled while they all fit. Then icon-only, all of them — an action with no
|
|
12
|
+
* icon keeps its label, so its compact width is its labelled one. Then as many
|
|
13
|
+
* icon-only buttons as fit, from the front: the developer declared the most
|
|
14
|
+
* important first, so the last ones fold into the menu.
|
|
15
|
+
*
|
|
16
|
+
* Widths that are all zero mean nothing was laid out — a hidden tab, a test
|
|
17
|
+
* DOM. Every action is shown, labelled, and the observer that called this
|
|
18
|
+
* measures again once there is layout.
|
|
19
|
+
*/
|
|
20
|
+
export declare function fitInlineActions(available: number, labelled: number[], compact: number[], gap: number): InlineActionsFit;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { UrlController, SidePanelController, AdminCollection } from "@rebasepro/cms-types";
|
|
1
|
+
import type { UrlController, SidePanelBindingProps, SidePanelController, AdminCollection } from "@rebasepro/cms-types";
|
|
2
2
|
export { removeInitialAndTrailingSlashes, removeInitialSlash, removeTrailingSlash, addInitialSlash, getLastSegment, resolveCollectionPathIds, getCollectionBySlugWithin, getCollectionPathsCombinations } from "@rebasepro/app";
|
|
3
3
|
/**
|
|
4
4
|
* Navigate to a entity using either a side panel or full-screen mode.
|
|
5
5
|
* This is an admin-specific UI concern and lives here (not in common).
|
|
6
6
|
*/
|
|
7
|
-
export declare function navigateToEntity({ openEntityMode, collection, entityId, copy, path, selectedTab, defaultValues, sidePanelController, onClose, navigation, replace }: {
|
|
7
|
+
export declare function navigateToEntity({ openEntityMode, collection, entityId, copy, path, selectedTab, defaultValues, sidePanelController, onClose, onUpdate, navigation, replace }: {
|
|
8
8
|
openEntityMode?: "side_panel" | "full_screen" | "split" | "dialog";
|
|
9
9
|
collection?: AdminCollection;
|
|
10
10
|
entityId?: string | number;
|
|
@@ -22,6 +22,18 @@ export declare function navigateToEntity({ openEntityMode, collection, entityId,
|
|
|
22
22
|
path: string;
|
|
23
23
|
sidePanelController: SidePanelController;
|
|
24
24
|
onClose?: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Called when the side panel or dialog saves the record. A full-screen
|
|
27
|
+
* record replaces the view that opened it, and that view reads
|
|
28
|
+
* everything again when it comes back, so nothing is called there.
|
|
29
|
+
*/
|
|
30
|
+
onUpdate?: SidePanelBindingProps["onUpdate"];
|
|
25
31
|
navigation: UrlController;
|
|
26
32
|
replace?: boolean;
|
|
27
33
|
}): void;
|
|
34
|
+
/**
|
|
35
|
+
* Whether `pathname` is the record at `entityPath` or somewhere below it — one
|
|
36
|
+
* of its tabs, its `/edit`. A path segment, not a string prefix:
|
|
37
|
+
* `/c/products/12` is another record, not a place inside `/c/products/1`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function isPathWithinRecord(pathname: string, entityPath: string): boolean;
|
package/dist/util/view_mode.d.ts
CHANGED
|
@@ -29,32 +29,26 @@ export declare function isViewMode(value: string | null | undefined, customKeys?
|
|
|
29
29
|
* @param customKeys keys of the collection's custom views, if any.
|
|
30
30
|
*/
|
|
31
31
|
export declare function getViewModeFromSearch(search?: string, customKeys?: readonly string[]): ViewMode | null;
|
|
32
|
-
/**
|
|
33
|
-
* Append the active view mode to a URL so the target route keeps rendering the
|
|
34
|
-
* view the user was last looking at.
|
|
35
|
-
*
|
|
36
|
-
* Every entity/collection navigation must go through this — a missed call site
|
|
37
|
-
* silently resets the user's view mode mid-session.
|
|
38
|
-
*
|
|
39
|
-
* @param url the URL to decorate. May already contain a query string and/or hash.
|
|
40
|
-
* @param search query string to read the view mode from. Defaults to the
|
|
41
|
-
* current browser location.
|
|
42
|
-
*/
|
|
43
|
-
export declare function withViewMode(url: string, search?: string): string;
|
|
44
32
|
/**
|
|
45
33
|
* Carry the whole of the collection list's URL state onto a navigation target.
|
|
46
34
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* unfiltered list with an empty search box,
|
|
52
|
-
* for every record
|
|
35
|
+
* Every navigation to the collection or one of its records goes through this —
|
|
36
|
+
* a missed call site silently resets the list mid-session. The list reads its
|
|
37
|
+
* state back from the URL on each navigation, so the view mode, the search
|
|
38
|
+
* string, the filters and the sort all have to travel: a URL without them
|
|
39
|
+
* returned an unfiltered list with an empty search box, and the search had to
|
|
40
|
+
* be retyped for every record the user wanted to look at.
|
|
53
41
|
*
|
|
54
42
|
* Copies every param the list currently has rather than an allowlist, because
|
|
55
43
|
* filters are encoded under the field's own name — there is no fixed set to
|
|
56
44
|
* list. Params already on the target win: the caller is more specific.
|
|
57
45
|
*
|
|
46
|
+
* Carries whatever `__view` holds rather than validating it. These call sites
|
|
47
|
+
* are navigations with no collection in hand, so they cannot know whether
|
|
48
|
+
* `map` is one of *this* collection's custom views; checking against the
|
|
49
|
+
* built-ins here would drop every custom view on the first record click. The
|
|
50
|
+
* binding validates on read, which is where the answer is knowable.
|
|
51
|
+
*
|
|
58
52
|
* @param url the URL to decorate. May carry a query string and/or a hash.
|
|
59
53
|
* @param search query string to read from. Defaults to the browser location.
|
|
60
54
|
*/
|