@rebasepro/cms 0.23.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.
Files changed (62) hide show
  1. package/dist/{CollectionEditorDialog-DLHCka00.js → CollectionEditorDialog-p5-I-Apu.js} +81 -42
  2. package/dist/CollectionEditorDialog-p5-I-Apu.js.map +1 -0
  3. package/dist/{PropertyEditView-_pu5hzZn.js → PropertyEditView-DDB_X-00.js} +4 -4
  4. package/dist/PropertyEditView-DDB_X-00.js.map +1 -0
  5. package/dist/{RouterCollectionsStudioView-ChPNl_uU.js → RouterCollectionsStudioView-SGBV4CMg.js} +4 -4
  6. package/dist/{RouterCollectionsStudioView-ChPNl_uU.js.map → RouterCollectionsStudioView-SGBV4CMg.js.map} +1 -1
  7. package/dist/{SchemaChangeDialog-BeP0A4MJ.js → SchemaChangeDialog-CcFSXvkK.js} +33 -12
  8. package/dist/SchemaChangeDialog-CcFSXvkK.js.map +1 -0
  9. package/dist/collection_editor/_cms_internals.d.ts +2 -1
  10. package/dist/collection_editor/liveSchemaClient.d.ts +38 -18
  11. package/dist/collection_editor/serializable_types.d.ts +2 -0
  12. package/dist/collection_editor/types/config_controller.d.ts +11 -0
  13. package/dist/collection_editor/useLiveSchemaEditing.d.ts +5 -5
  14. package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +7 -0
  15. package/dist/collection_editor_ui.js +5 -5
  16. package/dist/components/ClearFilterSortButton.d.ts +7 -1
  17. package/dist/components/CollectionViewBinding/CollectionViewActions.d.ts +6 -1
  18. package/dist/components/CollectionViewBinding/CollectionViewBinding.d.ts +5 -2
  19. package/dist/components/CollectionViewBinding/FiltersDialog.d.ts +5 -0
  20. package/dist/components/EditViewBinding.d.ts +7 -1
  21. package/dist/components/EntityIdentityBar.d.ts +29 -4
  22. package/dist/components/NavigationLoadingErrorView.d.ts +16 -0
  23. package/dist/components/common/ActionMenuLabel.d.ts +15 -0
  24. package/dist/components/common/default_entity_actions.d.ts +37 -0
  25. package/dist/data_import/components/ImportConversionProblems.d.ts +11 -0
  26. package/dist/data_import/components/index.d.ts +1 -0
  27. package/dist/data_import/utils/data.d.ts +81 -4
  28. package/dist/data_import/utils/import_columns.d.ts +48 -0
  29. package/dist/editor/editor.d.ts +7 -1
  30. package/dist/editor/extensions/Image.d.ts +22 -1
  31. package/dist/editor/hooks/useProseMirror.d.ts +4 -1
  32. package/dist/editor.js +69 -7
  33. package/dist/editor.js.map +1 -1
  34. package/dist/{export-4bJWdlDK.js → export-DCHuPD1a.js} +4 -4
  35. package/dist/export-DCHuPD1a.js.map +1 -0
  36. package/dist/form/form_utils.d.ts +24 -0
  37. package/dist/form/resolve_form_properties.d.ts +26 -0
  38. package/dist/{history-BElrZ5Rw.js → history-CBd6SBRs.js} +3 -2
  39. package/dist/{history-BElrZ5Rw.js.map → history-CBd6SBRs.js.map} +1 -1
  40. package/dist/hooks/useRecordActions.d.ts +28 -6
  41. package/dist/hooks/useReferencePaths.d.ts +21 -0
  42. package/dist/hooks/useStorageReferenceResolver.d.ts +23 -0
  43. package/dist/{import-TCgkTVlS.js → import-DjQoRrIU.js} +34 -52
  44. package/dist/import-DjQoRrIU.js.map +1 -0
  45. package/dist/index.js +189 -115
  46. package/dist/index.js.map +1 -1
  47. package/dist/preview/components/StorageMarkdown.d.ts +10 -0
  48. package/dist/preview/util.d.ts +4 -0
  49. package/dist/util/caller_scopes.d.ts +15 -0
  50. package/dist/util/entity_actions.d.ts +37 -1
  51. package/dist/util/fit_inline_actions.d.ts +20 -0
  52. package/dist/{util-DybQBkug.js → util-BRvKFMLa.js} +4546 -3163
  53. package/dist/util-BRvKFMLa.js.map +1 -0
  54. package/dist/{util-CC0ozHoD.js → util-D7ebttKT.js} +6 -2
  55. package/dist/{util-CC0ozHoD.js.map → util-D7ebttKT.js.map} +1 -1
  56. package/package.json +9 -9
  57. package/dist/CollectionEditorDialog-DLHCka00.js.map +0 -1
  58. package/dist/PropertyEditView-_pu5hzZn.js.map +0 -1
  59. package/dist/SchemaChangeDialog-BeP0A4MJ.js.map +0 -1
  60. package/dist/export-4bJWdlDK.js.map +0 -1
  61. package/dist/import-TCgkTVlS.js.map +0 -1
  62. package/dist/util-DybQBkug.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;
@@ -16,6 +16,10 @@ export declare function getPreviewSizeFrom(size: CollectionSize): PreviewSize;
16
16
  * stored 15th showed as the 14th west of Greenwich, and a 15th picked east of
17
17
  * it was stored as the 14th.
18
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
+ *
19
23
  * Any other date is shown in the property's declared `timezone`, or the
20
24
  * browser's when it declares none.
21
25
  */
@@ -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;