@rebasepro/admin 0.12.1-canary.gf5f1d39 → 0.13.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/README.md +1 -1
- package/dist/{CollectionEditorDialog-Dpc75wIZ.js → CollectionEditorDialog-CjXkWZ64.js} +75 -62
- package/dist/{CollectionEditorDialog-Dpc75wIZ.js.map → CollectionEditorDialog-CjXkWZ64.js.map} +1 -1
- package/dist/{PropertyEditView-DH3XZC2x.js → PropertyEditView-W8I3YV89.js} +36 -16
- package/dist/{PropertyEditView-DH3XZC2x.js.map → PropertyEditView-W8I3YV89.js.map} +1 -1
- package/dist/{RouterCollectionsStudioView-BZLq4MGp.js → RouterCollectionsStudioView-BsLTNoqX.js} +5 -5
- package/dist/{RouterCollectionsStudioView-BZLq4MGp.js.map → RouterCollectionsStudioView-BsLTNoqX.js.map} +1 -1
- package/dist/collection_editor/serializable_types.d.ts +4 -1
- package/dist/collection_editor/ui/collection_editor/CollectionRelationsTab.d.ts +1 -0
- package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +8 -0
- package/dist/collection_editor_ui.js +5 -5
- package/dist/collection_editor_ui.js.map +1 -1
- package/dist/components/CollectionTableBinding/column_utils.d.ts +17 -0
- package/dist/components/CollectionViewBinding/CollectionViewStartActions.d.ts +7 -2
- package/dist/components/CollectionViewBinding/SortButton.d.ts +24 -0
- package/dist/components/CollectionViewBinding/SplitListCloseButton.d.ts +10 -0
- package/dist/components/CollectionViewBinding/SplitViewContext.d.ts +23 -0
- package/dist/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.d.ts +26 -0
- package/dist/components/DetailViewBinding.d.ts +5 -0
- package/dist/components/EditFormActions.d.ts +12 -1
- package/dist/components/EditViewBinding.d.ts +6 -1
- package/dist/components/EntityIdentityBar.d.ts +53 -0
- package/dist/components/EntityInspector.d.ts +35 -0
- package/dist/components/EntityPreviewNesting.d.ts +25 -0
- package/dist/components/EntityViewBinding.d.ts +9 -0
- package/dist/components/InlineEntityPreview.d.ts +47 -0
- package/dist/components/history/EntityHistoryView.d.ts +4 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/editor.js +18 -10
- package/dist/editor.js.map +1 -1
- package/dist/{export-BzIpUdSK.js → export-J79rMoNj.js} +2 -2
- package/dist/{export-BzIpUdSK.js.map → export-J79rMoNj.js.map} +1 -1
- package/dist/form/EntityForm.d.ts +1 -1
- package/dist/form/EntityFormActions.d.ts +11 -1
- package/dist/form/PropertyFieldBinding.d.ts +1 -1
- package/dist/form/components/FieldBlock.d.ts +30 -0
- package/dist/form/components/FormRail.d.ts +18 -0
- package/dist/form/components/FormSections.d.ts +16 -0
- package/dist/form/components/index.d.ts +3 -2
- package/dist/form/components/useRailVisible.d.ts +24 -0
- package/dist/form/field_bindings/BinaryFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/DateTimeFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/GeopointFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/SelectFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/SwitchFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/TextFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/VectorFieldBinding.d.ts +1 -1
- package/dist/{history-g9688IaK.js → history-D7L_JlLO.js} +35 -33
- package/dist/history-D7L_JlLO.js.map +1 -0
- package/dist/hooks/navigation/utils.d.ts +16 -0
- package/dist/hooks/useBuildSidePanel.d.ts +14 -0
- package/dist/hooks/useEntityDisplayTitle.d.ts +18 -0
- package/dist/hooks/useHistory.d.ts +7 -0
- package/dist/hooks/useRecordActions.d.ts +17 -0
- package/dist/{import-BjUG-cIY.js → import-BvYl--U4.js} +2 -2
- package/dist/{import-BjUG-cIY.js.map → import-BvYl--U4.js.map} +1 -1
- package/dist/index.js +106 -35
- package/dist/index.js.map +1 -1
- package/dist/markdown-CklalUUk.js.map +1 -1
- package/dist/preview/components/InlineEntityListPreview.d.ts +15 -0
- package/dist/preview/index.d.ts +1 -0
- package/dist/preview/property_previews/ArrayOfReferencesPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayOfRelationsPreview.d.ts +1 -1
- package/dist/types/components/EntityFormActionsProps.d.ts +0 -1
- package/dist/types/components/EntityFormProps.d.ts +0 -5
- package/dist/types/fields.d.ts +24 -0
- package/dist/{util-B5fJm1FA.js → util-GiwPgxnL.js} +2106 -1117
- package/dist/util-GiwPgxnL.js.map +1 -0
- package/package.json +32 -34
- package/src/collection_editor/ConfigControllerProvider.tsx +1 -1
- package/src/collection_editor/serializable_types.ts +4 -3
- package/src/collection_editor/serializable_utils.ts +51 -17
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +65 -22
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +38 -30
- package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +3 -1
- package/src/collection_editor/ui/collection_editor/RouterCollectionStudioView.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/RouterCollectionsStudioView.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +16 -0
- package/src/collection_editor/useLocalCollectionsConfigController.tsx +127 -15
- package/src/collection_editor/validateCollectionJson.ts +3 -3
- package/src/components/AdminModeSyncer.tsx +1 -1
- package/src/components/CollectionTableBinding/PropertyTableCell.tsx +10 -2
- package/src/components/CollectionTableBinding/column_utils.tsx +59 -2
- package/src/components/CollectionTableBinding/table_bindings.tsx +2 -1
- package/src/components/CollectionViewBinding/CollectionBoardViewBinding.tsx +23 -16
- package/src/components/CollectionViewBinding/CollectionViewActions.tsx +7 -1
- package/src/components/CollectionViewBinding/CollectionViewBinding.tsx +9 -2
- package/src/components/CollectionViewBinding/CollectionViewStartActions.tsx +47 -12
- package/src/components/CollectionViewBinding/SortButton.tsx +189 -0
- package/src/components/CollectionViewBinding/SplitListCloseButton.tsx +33 -0
- package/src/components/CollectionViewBinding/SplitListView.tsx +18 -3
- package/src/components/CollectionViewBinding/SplitViewContext.tsx +34 -0
- package/src/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.ts +48 -9
- package/src/components/CollectionViewBinding/useBoardDataController.tsx +80 -25
- package/src/components/CollectionViewBinding/usePreviewSlots.ts +18 -6
- package/src/components/DefaultAppBar.tsx +1 -1
- package/src/components/DefaultDrawer.tsx +1 -1
- package/src/components/DetailViewBinding.tsx +112 -148
- package/src/components/DrawerNavigationItem.tsx +1 -1
- package/src/components/EditFormActions.tsx +54 -129
- package/src/components/EditViewBinding.tsx +202 -99
- package/src/components/EntityIdentityBar.tsx +288 -0
- package/src/components/EntityInspector.tsx +137 -0
- package/src/components/EntityPreviewBinding.tsx +6 -2
- package/src/components/EntityPreviewNesting.tsx +50 -0
- package/src/components/EntityViewBinding.tsx +35 -32
- package/src/components/HomePage/FavouritesView.tsx +1 -1
- package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
- package/src/components/HomePage/SmallNavigationCard.tsx +1 -1
- package/src/components/InlineEntityPreview.tsx +149 -0
- package/src/components/RebaseLayout.tsx +1 -1
- package/src/components/RebaseNavigation.tsx +45 -5
- package/src/components/RebaseRouteDefs.tsx +1 -1
- package/src/components/SelectableTable/SelectableTable.tsx +2 -2
- package/src/components/SidePanelBinding.tsx +19 -13
- package/src/components/UserSelector.tsx +12 -6
- package/src/components/common/default_entity_actions.tsx +4 -3
- package/src/components/history/EntityHistoryEntry.tsx +28 -7
- package/src/components/history/EntityHistoryView.tsx +29 -24
- package/src/components/history/LastEditedByIndicator.tsx +4 -3
- package/src/components/index.ts +2 -0
- package/src/data_import/utils/get_import_inference_type.ts +6 -0
- package/src/form/EntityForm.tsx +267 -179
- package/src/form/EntityFormActions.tsx +50 -99
- package/src/form/EntityFormBinding.tsx +4 -2
- package/src/form/PropertyFieldBinding.tsx +4 -0
- package/src/form/components/FieldBlock.tsx +119 -0
- package/src/form/components/FormRail.tsx +125 -0
- package/src/form/components/FormSections.tsx +118 -0
- package/src/form/components/index.tsx +3 -2
- package/src/form/components/useRailVisible.tsx +46 -0
- package/src/form/field_bindings/BinaryFieldBinding.tsx +3 -2
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +3 -2
- package/src/form/field_bindings/GeopointFieldBinding.tsx +3 -2
- package/src/form/field_bindings/MapFieldBinding.tsx +1 -2
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +3 -2
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +2 -1
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +2 -1
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +2 -1
- package/src/form/field_bindings/RelationFieldBinding.tsx +6 -4
- package/src/form/field_bindings/RepeatFieldBinding.tsx +4 -1
- package/src/form/field_bindings/SelectFieldBinding.tsx +3 -2
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +31 -8
- package/src/form/field_bindings/SwitchFieldBinding.tsx +7 -3
- package/src/form/field_bindings/TextFieldBinding.tsx +18 -16
- package/src/form/field_bindings/UserSelectFieldBinding.tsx +3 -2
- package/src/form/field_bindings/VectorFieldBinding.tsx +2 -1
- package/src/hooks/navigation/useBuildUrlController.tsx +1 -1
- package/src/hooks/navigation/useTopLevelNavigation.ts +18 -7
- package/src/hooks/navigation/utils.ts +20 -0
- package/src/hooks/useBuildSideDialogsController.tsx +2 -2
- package/src/hooks/useBuildSidePanel.tsx +22 -61
- package/src/hooks/useEntityDisplayTitle.tsx +60 -0
- package/src/hooks/useHistory.ts +20 -10
- package/src/hooks/useRecordActions.tsx +69 -0
- package/src/hooks/useResolvedUsers.ts +10 -5
- package/src/preview/PropertyPreview.tsx +48 -22
- package/src/preview/components/InlineEntityListPreview.tsx +42 -0
- package/src/preview/components/ReferencePreview.tsx +34 -14
- package/src/preview/components/RelationPreview.tsx +34 -14
- package/src/preview/index.ts +1 -0
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +24 -1
- package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +25 -1
- package/src/routes/RebaseRoute.tsx +2 -2
- package/src/types/components/EntityFormActionsProps.tsx +0 -1
- package/src/types/components/EntityFormProps.tsx +0 -6
- package/src/types/fields.tsx +27 -0
- package/dist/form/components/FormEntry.d.ts +0 -6
- package/dist/form/components/FormLayout.d.ts +0 -5
- package/dist/history-g9688IaK.js.map +0 -1
- package/dist/util-B5fJm1FA.js.map +0 -1
- package/src/form/components/FormEntry.tsx +0 -22
- package/src/form/components/FormLayout.tsx +0 -16
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { $ as useBuildCollectionRegistryController, $n as
|
|
2
|
-
import { i as PropertySelectEntry, n as ImportCollectionAction, r as ImportDataPreview } from "./import-
|
|
3
|
-
import { a as downloadDataAsCsv, c as getEntityJsonExportableData, i as downloadBlob, n as ExportCollectionAction, o as downloadEntitiesExport, r as BasicExportAction, s as getEntityCSVExportableData } from "./export-
|
|
1
|
+
import { $ as useBuildCollectionRegistryController, $n as sanitizeUrl, $t as CollectionTableBinding, A as getFieldId, An as ArrayOfReferencesPreview, At as convertFileToJson, B as MapFieldBinding, Bn as getEntityTitlePropertyKeyForEntity, Bt as mergeEntityActions, C as removeEmptyContainers, Cn as MapPropertyPreview, Ct as convertDataToEntity, D as getDefaultFieldConfig, Dn as ArrayEnumPreview, Dt as useImportConfig, E as DEFAULT_FIELD_CONFIGS, En as ArrayPropertyEnumPreview, Et as getInferenceType, F as SelectFieldBinding, Fn as useSidePanel, Ft as FieldCaption, G as useSelectionDialog, Gn as StorageThumbnailInternal, Gt as removeInitialAndTrailingSlashes, H as DateTimeFieldBinding, Hn as StringPropertyPreview, Ht as getCollectionBySlugWithin, I as RepeatFieldBinding, In as CollectionRegistryContext, It as useBreadcrumbsController, J as useBuildUrlController, Jn as renderSkeletonIcon, Jt as resolveCollectionPathIds, K as SelectionTableBinding, Kn as SkeletonPropertyComponent, Kt as removeInitialSlash, L as ReferenceFieldBinding, Ln as useCollectionRegistryController, Lt as BreadcrumbsProvider, M as TextFieldBinding, Mn as ReferencePreview, Mt as ArrayContainer, N as SwitchFieldBinding, Nn as EntityPreviewBinding, Nt as PropertyConfigBadge, O as getDefaultFieldId, On as ArrayOfStorageComponentsPreview, Ot as ImportSaveInProgress, P as StorageUploadFieldBinding, Pn as SidePanelControllerContext, Pt as SearchIconsView, Q as useResolvedCollections, Qn as ImagePreview, Qt as VirtualTableInput, R as MultiSelectFieldBinding, Rn as getEntityPreviewKeys, Rt as resolveEntityAction, S as getInitialEntityValues, Sn as KeyValuePreview, St as DataNewPropertiesMapping, T as PropertyFieldBinding, Tn as ArrayOfStringsPreview, Tt as processValueMapping, U as BlockFieldBinding, Un as EnumValuesChip, Ut as getCollectionPathsCombinations, V as KeyValueFieldBinding, Vn as ArrayPropertyPreview, Vt as addInitialSlash, W as ArrayOfReferencesFieldBinding, Wn as StorageThumbnail, Wt as getLastSegment, X as useTopLevelNavigation, Xn as renderSkeletonText, Xt as resolveViewMode, Y as useBuildNavigationStateController, Yn as renderSkeletonImageThumbnail, Yt as resolveOpenEntityMode, Z as useResolvedViews, Zn as UrlComponentPreview, Zt as useSelectionController, _ as useCollectionsConfigController, _n as getUserLabel, _t as CollectionViewActions, a as namespaceToPropertiesPath, an as NavigationStateContext, ar as FieldBlock, at as useBuildSidePanel, b as extractTouchedValues, bn as BooleanPreview, bt as useCollectionEditorDialogsState, c as buildCollectionGenerationCallback, cn as SideDialogsControllerContext, cr as getBracketNotation, ct as copyEntityAction, d as fromSerializableCollectionConfigs, dn as useClearRestoreValue, dr as getIconForWidget, dt as resetPasswordAction, en as SelectableTable, er as EmptyValue, et as useHistory, f as fromSerializableProperties, fn as ReadOnlyFieldBinding, fr as getPropertiesWithPropertiesOrder, ft as CreationResultDialog, g as toSerializableProperty, gn as UserPreview, gr as isRelationProperty, gt as EntityCardBinding, h as toSerializableProperties, hn as PropertyPreview, hr as isReferenceProperty, ht as CollectionCardViewBinding, i as namespaceToPropertiesOrderPath, in as useUrlController, ir as FormRail, it as getEntityViewWidth, j as VectorFieldBinding, jn as InlineEntityListPreview, jt as unflattenObject, k as getFieldConfig, kn as RelationPreview, kt as ImportFileUpload, l as validateCollectionJson, ln as SelectableTableContext, lr as getDefaultPropertiesOrder, lt as deleteEntityAction, m as toSerializableCollectionConfig, mn as ArrayOfMapsPreview, mr as getResolvedPropertyInPath, mt as EntityViewBinding, n as getFullIdPath, nn as useAdminContext, nr as LabelWithIcon, nt as useResolvedNavigationFrom, o as CollectionGenerationApiError, on as useNavigationStateController, or as isSelfLabellingProperty, ot as EditViewBinding, p as fromSerializableProperty, pn as FieldHelperText, pr as getPropertyInPath, pt as DetailViewBinding, q as SideDialogs, qn as renderSkeletonCaptionText, qt as removeTrailingSlash, r as idToPropertiesPath, rn as UrlContext, rr as FormSections, rt as buildSidePanelsFromUrl, s as DEFAULT_COLLECTION_GENERATION_ENDPOINT, sn as useSideDialogsController, sr as PropertyIdCopyTooltip, st as CollectionViewBinding, t as getFullId, tn as CollectionRowActions, tr as LabelWithIconAndTooltip, tt as resolveNavigationFrom, u as fromSerializableCollectionConfig, un as ArrayCustomShapedFieldBinding, ur as getIconForProperty, ut as editEntityAction, v as EntityFormBinding, vn as useResolvedUser, vt as useCollectionEditorController, w as zodToFormErrors, wn as ArrayOneOfPreview, wt as flattenEntry, x as getChanges, xn as DatePreview, xt as ImportNewPropertyFieldPreview, y as EntityForm, yn as NumberPropertyPreview, yt as ConfigControllerProvider, z as MarkdownEditorFieldBinding, zn as getEntityTitlePropertyKey, zt as resolveEntityView } from "./util-GiwPgxnL.js";
|
|
2
|
+
import { i as PropertySelectEntry, n as ImportCollectionAction, r as ImportDataPreview } from "./import-BvYl--U4.js";
|
|
3
|
+
import { a as downloadDataAsCsv, c as getEntityJsonExportableData, i as downloadBlob, n as ExportCollectionAction, o as downloadEntitiesExport, r as BasicExportAction, s as getEntityCSVExportableData } from "./export-J79rMoNj.js";
|
|
4
4
|
import React, { Suspense, lazy, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { deepEqual } from "fast-equals";
|
|
6
6
|
import { Avatar, Button, Card, ChevronDownIcon, ChevronsLeftIcon, ChevronsRightIcon, Chip, CircularProgressCenter, Collapse, Container, Dialog, DialogActions, DialogContent, DialogTitle, ErrorBoundary, ExpandablePanel, IconButton, LogOutIcon, Markdown, Menu, MenuIcon, MenuItem, MoonIcon, PencilIcon, SearchBar, SettingsIcon, Sheet, Skeleton, StarIcon, SunIcon, SunMoonIcon, TextField, Tooltip, Typography, cls, defaultBorderMixin, iconSize } from "@rebasepro/ui";
|
|
7
7
|
import { buildRoutedRebaseData, getReferenceFrom, resolveDataSource } from "@rebasepro/common";
|
|
8
|
-
import { CollectionResolverRegistrationContext, CollectionScopeProvider, CustomizationControllerContext, ErrorView, IconForView, LanguageToggle, LoginView, NavigationBlockerProvider, NotFoundPage, RebaseDataContext, RebaseLogo, RebaseRoutes, SchemaDriftBanner, StudioBridgeRegistryProvider, UIReferenceView, UnsavedChangesDialog, UserSettingsView, buildCollapsedDefaults, getIcon, getLastSegment as getLastSegment$1, getNavigationEntriesFromPath, useAdminModeController, useAnalyticsController, useAuthController, useBridgeRegistration, useBuildLocalConfigurationPersistence, useCollapsedGroups, useComponentOverride, useCustomizationController, useData, useDataSources, useLargeLayout, useModeController, useNavigationBlocker, useRebaseClient, useRebaseContext, useRebaseRegistry, useRebaseRegistryDispatch, useRestoreScroll, useSlot, useTranslation, useUserConfigurationPersistence } from "@rebasepro/app";
|
|
8
|
+
import { CollectionResolverRegistrationContext, CollectionScopeProvider, CustomizationControllerContext, DEFAULT_API_PATH, ErrorView, IconForView, LanguageToggle, LoginView, NavigationBlockerProvider, NotFoundPage, RebaseDataContext, RebaseLogo, RebaseRoutes, SchemaDriftBanner, StudioBridgeRegistryProvider, UIReferenceView, UnsavedChangesDialog, UserSettingsView, buildCollapsedDefaults, getIcon, getLastSegment as getLastSegment$1, getNavigationEntriesFromPath, useAdminModeController, useAnalyticsController, useAuthController, useBridgeRegistration, useBuildLocalConfigurationPersistence, useCollapsedGroups, useComponentOverride, useCustomizationController, useData, useDataSources, useLargeLayout, useModeController, useNavigationBlocker, useRebaseClient, useRebaseContext, useRebaseRegistry, useRebaseRegistryDispatch, useRestoreScroll, useSlot, useTranslation, useUserConfigurationPersistence } from "@rebasepro/app";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { prettifyIdentifier, toArray } from "@rebasepro/utils";
|
|
11
|
-
import { Link, NavLink, Outlet, Route, useLocation, useNavigate } from "react-router
|
|
11
|
+
import { Link, NavLink, Outlet, Route, useLocation, useNavigate } from "react-router";
|
|
12
12
|
import { DndContext, DragOverlay, KeyboardSensor, MeasuringStrategy, MouseSensor, TouchSensor, closestCenter, closestCorners, getFirstCollision, pointerWithin, rectIntersection, useDndMonitor, useDroppable, useSensor, useSensors } from "@dnd-kit/core";
|
|
13
13
|
import { restrictToVerticalAxis, restrictToWindowEdges } from "@dnd-kit/modifiers";
|
|
14
14
|
import { SortableContext, arrayMove, defaultAnimateLayoutChanges, rectSortingStrategy, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
@@ -232,7 +232,8 @@ function EntityFullScreenRoute({ pathname, navigationEntries, isNew, isCopy }) {
|
|
|
232
232
|
path: collectionPath,
|
|
233
233
|
selectedTab: selectedTab ?? void 0,
|
|
234
234
|
onEditClick: () => {
|
|
235
|
-
|
|
235
|
+
const editUrl = urlController.buildUrlCollectionPath(`${collectionPath}/${entityId}`) + "/edit";
|
|
236
|
+
navigate(editUrl + hash);
|
|
236
237
|
},
|
|
237
238
|
onTabChange: (params) => {
|
|
238
239
|
setSelectedTab(params.selectedTab);
|
|
@@ -253,7 +254,8 @@ function EntityFullScreenRoute({ pathname, navigationEntries, isNew, isCopy }) {
|
|
|
253
254
|
defaultValues: isNew ? defaultValues : void 0,
|
|
254
255
|
onValuesModified: (modified) => blocked.current = modified,
|
|
255
256
|
navigateBack: () => {
|
|
256
|
-
|
|
257
|
+
const detailUrl = urlController.buildUrlCollectionPath(`${collectionPath}/${entityId}`);
|
|
258
|
+
navigate(detailUrl + hash);
|
|
257
259
|
},
|
|
258
260
|
onSaved: (params) => {
|
|
259
261
|
const newSelectedTab = params.selectedTab;
|
|
@@ -932,9 +934,10 @@ function AdminNavigationContent() {
|
|
|
932
934
|
}),
|
|
933
935
|
headerSlot,
|
|
934
936
|
groupsToRender.map((group) => {
|
|
937
|
+
const entriesInGroup = filteredEntries.filter((e) => e.group === group);
|
|
935
938
|
return /* @__PURE__ */ jsx(ResolvedDrawerNavigationGroup, {
|
|
936
939
|
group,
|
|
937
|
-
entries:
|
|
940
|
+
entries: entriesInGroup,
|
|
938
941
|
collapsed: isGroupCollapsed(group),
|
|
939
942
|
onToggleCollapsed: () => toggleGroupCollapsed(group),
|
|
940
943
|
drawerOpen: drawerVisuallyOpen,
|
|
@@ -1397,21 +1400,37 @@ function RebaseAuthGate({ children }) {
|
|
|
1397
1400
|
}
|
|
1398
1401
|
//#endregion
|
|
1399
1402
|
//#region src/collection_editor/useLocalCollectionsConfigController.tsx
|
|
1403
|
+
/**
|
|
1404
|
+
* The guess this hook used to make on its own.
|
|
1405
|
+
*
|
|
1406
|
+
* `process.env.NODE_ENV` here is the *frontend bundle's* build mode. Whether
|
|
1407
|
+
* the schema editor exists is decided by a different process entirely — the
|
|
1408
|
+
* server's own `NODE_ENV`, its `collectionsDir`, whether its collections were
|
|
1409
|
+
* introspected, whether `ts-morph` is installed. The two disagree in every
|
|
1410
|
+
* ordinary setup: a dev frontend against a deployed API, a `baas` project, a
|
|
1411
|
+
* hosted console. When they did, the editor offered itself and every save came
|
|
1412
|
+
* back `404 Not Found`. It is kept only as the answer for a backend too old to
|
|
1413
|
+
* be asked.
|
|
1414
|
+
*/
|
|
1415
|
+
var buildModeGuess = () => process.env.NODE_ENV === "production";
|
|
1400
1416
|
function useLocalCollectionsConfigController(clientOrUrl, baseCollections = [], options) {
|
|
1401
1417
|
const parsedCollections = baseCollections;
|
|
1402
1418
|
const optionsRef = useRef(options);
|
|
1403
1419
|
optionsRef.current = options;
|
|
1420
|
+
const clientBaseUrl = typeof clientOrUrl === "string" ? clientOrUrl : clientOrUrl?.baseUrl ?? "";
|
|
1421
|
+
const clientApiPath = typeof clientOrUrl === "object" && clientOrUrl !== null && clientOrUrl.apiPath || DEFAULT_API_PATH;
|
|
1422
|
+
const editorUrl = `${String(clientBaseUrl).replace(/\/$/, "")}${clientApiPath}/schema-editor`;
|
|
1423
|
+
const resolveToken = async () => {
|
|
1424
|
+
let token = optionsRef.current?.getAuthToken ? await optionsRef.current.getAuthToken() : null;
|
|
1425
|
+
if (!token && typeof clientOrUrl === "object" && clientOrUrl !== null && clientOrUrl.resolveToken) token = await clientOrUrl.resolveToken();
|
|
1426
|
+
return token ?? null;
|
|
1427
|
+
};
|
|
1404
1428
|
const request = async (endpoint, payload) => {
|
|
1405
1429
|
try {
|
|
1406
|
-
|
|
1407
|
-
let baseUrl = typeof clientOrUrl === "string" ? clientOrUrl : "";
|
|
1408
|
-
if (typeof clientOrUrl === "object" && clientOrUrl !== null) {
|
|
1409
|
-
baseUrl = clientOrUrl.baseUrl || baseUrl;
|
|
1410
|
-
if (!token && clientOrUrl.resolveToken) token = await clientOrUrl.resolveToken();
|
|
1411
|
-
}
|
|
1430
|
+
const token = await resolveToken();
|
|
1412
1431
|
const headers = { "Content-Type": "application/json" };
|
|
1413
1432
|
if (token) headers["Authorization"] = `Bearer ${token}`;
|
|
1414
|
-
const response = await fetch(`${
|
|
1433
|
+
const response = await fetch(`${editorUrl}${endpoint}`, {
|
|
1415
1434
|
method: "POST",
|
|
1416
1435
|
headers,
|
|
1417
1436
|
body: JSON.stringify(payload)
|
|
@@ -1433,10 +1452,51 @@ function useLocalCollectionsConfigController(clientOrUrl, baseCollections = [],
|
|
|
1433
1452
|
throw e;
|
|
1434
1453
|
}
|
|
1435
1454
|
};
|
|
1455
|
+
const forcedReadOnly = options?.readOnly;
|
|
1456
|
+
const authKey = options?.authKey ?? null;
|
|
1457
|
+
const [availability, setAvailability] = useState({ state: "unknown" });
|
|
1458
|
+
useEffect(() => {
|
|
1459
|
+
if (forcedReadOnly === true) return;
|
|
1460
|
+
let cancelled = false;
|
|
1461
|
+
(async () => {
|
|
1462
|
+
try {
|
|
1463
|
+
const token = await resolveToken();
|
|
1464
|
+
const response = await fetch(`${editorUrl}/status`, { headers: token ? { Authorization: `Bearer ${token}` } : {} });
|
|
1465
|
+
if (cancelled) return;
|
|
1466
|
+
if (response.status === 404) {
|
|
1467
|
+
setAvailability({ state: "unknown" });
|
|
1468
|
+
return;
|
|
1469
|
+
}
|
|
1470
|
+
const body = await response.json().catch(() => ({}));
|
|
1471
|
+
if (cancelled) return;
|
|
1472
|
+
if (response.ok) setAvailability({
|
|
1473
|
+
state: "known",
|
|
1474
|
+
enabled: body.enabled === true,
|
|
1475
|
+
reason: body.reason
|
|
1476
|
+
});
|
|
1477
|
+
else setAvailability({
|
|
1478
|
+
state: "known",
|
|
1479
|
+
enabled: false,
|
|
1480
|
+
reason: body.error?.message ?? `The backend refused to say whether collections are editable (HTTP ${response.status}).`
|
|
1481
|
+
});
|
|
1482
|
+
} catch {
|
|
1483
|
+
if (!cancelled) setAvailability({ state: "unknown" });
|
|
1484
|
+
}
|
|
1485
|
+
})();
|
|
1486
|
+
return () => {
|
|
1487
|
+
cancelled = true;
|
|
1488
|
+
};
|
|
1489
|
+
}, [
|
|
1490
|
+
editorUrl,
|
|
1491
|
+
forcedReadOnly,
|
|
1492
|
+
authKey
|
|
1493
|
+
]);
|
|
1494
|
+
const readOnly = forcedReadOnly ?? (availability.state === "known" ? !availability.enabled : buildModeGuess());
|
|
1495
|
+
const readOnlyReason = availability.state === "known" && availability.reason ? availability.reason : "Collections can only be edited against a backend running the schema editor, which is off in production.";
|
|
1436
1496
|
return useMemo(() => ({
|
|
1437
1497
|
loading: false,
|
|
1438
|
-
readOnly
|
|
1439
|
-
readOnlyReason
|
|
1498
|
+
readOnly,
|
|
1499
|
+
readOnlyReason,
|
|
1440
1500
|
collections: parsedCollections,
|
|
1441
1501
|
getCollection: (id) => {
|
|
1442
1502
|
const found = parsedCollections.find((c) => c.id === id || c.slug === id);
|
|
@@ -1480,8 +1540,9 @@ function useLocalCollectionsConfigController(clientOrUrl, baseCollections = [],
|
|
|
1480
1540
|
});
|
|
1481
1541
|
},
|
|
1482
1542
|
updatePropertiesOrder: async ({ collection, fullPath, newPropertiesOrder }) => {
|
|
1543
|
+
const collectionId = collection.id || fullPath.split("/").pop();
|
|
1483
1544
|
await request("/collection/save", {
|
|
1484
|
-
collectionId
|
|
1545
|
+
collectionId,
|
|
1485
1546
|
collectionData: { propertiesOrder: newPropertiesOrder }
|
|
1486
1547
|
});
|
|
1487
1548
|
},
|
|
@@ -1491,7 +1552,8 @@ function useLocalCollectionsConfigController(clientOrUrl, baseCollections = [],
|
|
|
1491
1552
|
}), [
|
|
1492
1553
|
clientOrUrl,
|
|
1493
1554
|
parsedCollections,
|
|
1494
|
-
|
|
1555
|
+
readOnly,
|
|
1556
|
+
readOnlyReason,
|
|
1495
1557
|
options?.getAuthToken
|
|
1496
1558
|
]);
|
|
1497
1559
|
}
|
|
@@ -1499,7 +1561,7 @@ function useLocalCollectionsConfigController(clientOrUrl, baseCollections = [],
|
|
|
1499
1561
|
//#region src/components/RebaseNavigation.tsx
|
|
1500
1562
|
var EMPTY_PLUGINS = [];
|
|
1501
1563
|
var EMPTY_COLLECTIONS = [];
|
|
1502
|
-
var CollectionsStudioView = lazy(() => import("./RouterCollectionsStudioView-
|
|
1564
|
+
var CollectionsStudioView = lazy(() => import("./RouterCollectionsStudioView-BsLTNoqX.js").then((n) => n.n).then((m) => ({ default: m.RouterCollectionsStudioView })));
|
|
1503
1565
|
/**
|
|
1504
1566
|
* Navigation layer — builds and provides all admin navigation controllers:
|
|
1505
1567
|
* collection registry, URL controller, navigation state, side entity,
|
|
@@ -1566,8 +1628,9 @@ function RebaseNavigation({ children }) {
|
|
|
1566
1628
|
if (missing.length > 0) console.warn(`[Rebase] These data source(s) declare a direct/custom transport but have no client-side driver and will fall back to the default data source: ${missing.map((k) => `"${k}"`).join(", ")}. Provide a \`driver\` for them in \`dataSources\` on <Rebase>.`);
|
|
1567
1629
|
}, [dataSources]);
|
|
1568
1630
|
const internalConfigController = useLocalCollectionsConfigController(rebaseClient, resolvedCollections, collectionEditorEnabled ? {
|
|
1569
|
-
readOnly: collectionEditorOptions?.readOnly
|
|
1570
|
-
getAuthToken: collectionEditorOptions?.getAuthToken ?? authController?.getAuthToken
|
|
1631
|
+
readOnly: collectionEditorOptions?.readOnly,
|
|
1632
|
+
getAuthToken: collectionEditorOptions?.getAuthToken ?? authController?.getAuthToken,
|
|
1633
|
+
authKey: authController?.user?.uid ?? null
|
|
1571
1634
|
} : { readOnly: true });
|
|
1572
1635
|
const schemaView = useMemo(() => {
|
|
1573
1636
|
if (!collectionEditorEnabled) return void 0;
|
|
@@ -1587,14 +1650,10 @@ function RebaseNavigation({ children }) {
|
|
|
1587
1650
|
nestedRoutes: true,
|
|
1588
1651
|
view: /* @__PURE__ */ jsx(Suspense, {
|
|
1589
1652
|
fallback: /* @__PURE__ */ jsx(CircularProgressCenter, {}),
|
|
1590
|
-
children: /* @__PURE__ */ jsx(
|
|
1653
|
+
children: /* @__PURE__ */ jsx(CollectionsStudioViewFromContext, {})
|
|
1591
1654
|
})
|
|
1592
1655
|
};
|
|
1593
|
-
}, [
|
|
1594
|
-
collectionEditorEnabled,
|
|
1595
|
-
registry.studioConfig,
|
|
1596
|
-
internalConfigController
|
|
1597
|
-
]);
|
|
1656
|
+
}, [collectionEditorEnabled, registry.studioConfig]);
|
|
1598
1657
|
const devViews = useMemo(() => {
|
|
1599
1658
|
const base = registry.studioConfig?.devViews ?? [];
|
|
1600
1659
|
if (schemaView) return [...base, schemaView];
|
|
@@ -1648,7 +1707,8 @@ function RebaseNavigation({ children }) {
|
|
|
1648
1707
|
children: /* @__PURE__ */ jsxs(SidePanelProvider, { children: [/* @__PURE__ */ jsx(BridgeAutoRegistrar, {
|
|
1649
1708
|
collectionRegistryController,
|
|
1650
1709
|
urlController,
|
|
1651
|
-
navigationStateController
|
|
1710
|
+
navigationStateController,
|
|
1711
|
+
canWriteToCodebase: !internalConfigController.readOnly
|
|
1652
1712
|
}), children] })
|
|
1653
1713
|
})
|
|
1654
1714
|
})
|
|
@@ -1663,14 +1723,24 @@ function RebaseNavigation({ children }) {
|
|
|
1663
1723
|
return navigationContent;
|
|
1664
1724
|
}
|
|
1665
1725
|
/**
|
|
1726
|
+
* The injected "Edit collections" view, bound to the live config controller.
|
|
1727
|
+
*
|
|
1728
|
+
* Exists so the element stored in the navigation state does not close over a
|
|
1729
|
+
* controller instance — see the comment at its construction site.
|
|
1730
|
+
*/
|
|
1731
|
+
function CollectionsStudioViewFromContext() {
|
|
1732
|
+
return /* @__PURE__ */ jsx(CollectionsStudioView, { configController: useCollectionsConfigController() });
|
|
1733
|
+
}
|
|
1734
|
+
/**
|
|
1666
1735
|
* Internal component that auto-registers admin controllers into the
|
|
1667
1736
|
* self-assembling Studio bridge. Must be rendered inside both the
|
|
1668
1737
|
* navigation contexts and the StudioBridgeRegistryProvider.
|
|
1669
1738
|
*/
|
|
1670
|
-
function BridgeAutoRegistrar({ collectionRegistryController, urlController, navigationStateController }) {
|
|
1739
|
+
function BridgeAutoRegistrar({ collectionRegistryController, urlController, navigationStateController, canWriteToCodebase }) {
|
|
1671
1740
|
useBridgeRegistration("collectionRegistry", collectionRegistryController);
|
|
1672
1741
|
useBridgeRegistration("urlController", urlController);
|
|
1673
1742
|
useBridgeRegistration("navigationState", navigationStateController);
|
|
1743
|
+
useBridgeRegistration("capabilities", useMemo(() => ({ codebase: canWriteToCodebase }), [canWriteToCodebase]));
|
|
1674
1744
|
return null;
|
|
1675
1745
|
}
|
|
1676
1746
|
//#endregion
|
|
@@ -2538,10 +2608,11 @@ function ContentHomePage({ additionalActions, additionalChildrenStart, additiona
|
|
|
2538
2608
|
name: g.name,
|
|
2539
2609
|
entries: g.entries.map((e) => e.slug)
|
|
2540
2610
|
}));
|
|
2541
|
-
|
|
2611
|
+
const all = adminGroupData ? [...draggable, {
|
|
2542
2612
|
name: adminGroupData.name,
|
|
2543
2613
|
entries: adminGroupData.entries.map((e) => e.slug)
|
|
2544
|
-
}] : draggable
|
|
2614
|
+
}] : draggable;
|
|
2615
|
+
onNavigationEntriesUpdate(all);
|
|
2545
2616
|
};
|
|
2546
2617
|
const { isGroupCollapsed, toggleGroupCollapsed } = useCollapsedGroups(useMemo(() => [...items.map((item) => item.name), ...adminGroupData ? [adminGroupData.name] : []], [items, adminGroupData]), "home", useMemo(() => buildCollapsedDefaults(registry.cmsConfig?.navigationGroupMappings, "home"), [registry.cmsConfig?.navigationGroupMappings]));
|
|
2547
2618
|
const { sensors, collisionDetection, onDragStart, onDragOver, onDragEnd, dropAnimation, activeItemForOverlay, activeGroupData, draggingGroupId, containers, dndKitActiveNode, onDragCancel, isDraggingCardOnly, dialogOpenForGroup, setDialogOpenForGroup, handleRenameGroup, handleDialogClose, isHoveringNewGroupDropZone, setIsHoveringNewGroupDropZone } = useHomePageDnd({
|
|
@@ -2719,8 +2790,8 @@ function ContentHomePage({ additionalActions, additionalChildrenStart, additiona
|
|
|
2719
2790
|
}
|
|
2720
2791
|
//#endregion
|
|
2721
2792
|
//#region src/components/CollectionEditorDialogs.tsx
|
|
2722
|
-
var CollectionEditorDialog = lazy(() => import("./CollectionEditorDialog-
|
|
2723
|
-
var PropertyFormDialog = lazy(() => import("./PropertyEditView-
|
|
2793
|
+
var CollectionEditorDialog = lazy(() => import("./CollectionEditorDialog-CjXkWZ64.js").then((n) => n.r).then((m) => ({ default: m.CollectionEditorDialog })));
|
|
2794
|
+
var PropertyFormDialog = lazy(() => import("./PropertyEditView-W8I3YV89.js").then((n) => n.t).then((m) => ({ default: m.PropertyFormDialog })));
|
|
2724
2795
|
/**
|
|
2725
2796
|
* Renders the CollectionEditorDialog and PropertyFormDialog inside
|
|
2726
2797
|
* the RebaseShell tree where admin-internal contexts
|
|
@@ -3318,6 +3389,6 @@ function MissingReferenceWidget({ path: pathProp }) {
|
|
|
3318
3389
|
});
|
|
3319
3390
|
}
|
|
3320
3391
|
//#endregion
|
|
3321
|
-
export { AdminModeSyncer, AppBar, ArrayContainer, ArrayCustomShapedFieldBinding, ArrayEnumPreview, ArrayOfMapsPreview, ArrayOfReferencesFieldBinding, ArrayOfReferencesPreview, ArrayOfStorageComponentsPreview, ArrayOfStringsPreview, ArrayOneOfPreview, ArrayPropertyEnumPreview, ArrayPropertyPreview, BasicExportAction, BlockFieldBinding, BooleanPreview, CollectionCardViewBinding, CollectionGenerationApiError, CollectionPanel, CollectionRegistryContext, CollectionRowActions, CollectionTableBinding, CollectionViewActions, CollectionViewBinding, CreationResultDialog, CustomViewRoute, DEFAULT_COLLECTION_GENERATION_ENDPOINT, DEFAULT_FIELD_CONFIGS, DataNewPropertiesMapping, DatePreview, DateTimeFieldBinding, DefaultDrawer, Drawer, DrawerFooterActions, EmptyValue, EntityCardBinding, EntityForm, EntityFormBinding, EntityPreviewBinding, EntityViewBinding, EnumValuesChip, ExportCollectionAction, FieldCaption, FieldHelperText,
|
|
3392
|
+
export { AdminModeSyncer, AppBar, ArrayContainer, ArrayCustomShapedFieldBinding, ArrayEnumPreview, ArrayOfMapsPreview, ArrayOfReferencesFieldBinding, ArrayOfReferencesPreview, ArrayOfStorageComponentsPreview, ArrayOfStringsPreview, ArrayOneOfPreview, ArrayPropertyEnumPreview, ArrayPropertyPreview, BasicExportAction, BlockFieldBinding, BooleanPreview, CollectionCardViewBinding, CollectionGenerationApiError, CollectionPanel, CollectionRegistryContext, CollectionRowActions, CollectionTableBinding, CollectionViewActions, CollectionViewBinding, CreationResultDialog, CustomViewRoute, DEFAULT_COLLECTION_GENERATION_ENDPOINT, DEFAULT_FIELD_CONFIGS, DataNewPropertiesMapping, DatePreview, DateTimeFieldBinding, DefaultDrawer, Drawer, DrawerFooterActions, EmptyValue, EntityCardBinding, EntityForm, EntityFormBinding, EntityPreviewBinding, EntityViewBinding, EnumValuesChip, ExportCollectionAction, FieldBlock, FieldCaption, FieldHelperText, FormRail, FormSections, ImagePreview, ImportCollectionAction, ImportDataPreview, ImportFileUpload, ImportNewPropertyFieldPreview, ImportSaveInProgress, InlineEntityListPreview, KeyValueFieldBinding, KeyValuePreview, LabelWithIcon, LabelWithIconAndTooltip, MapFieldBinding, MapPropertyPreview, MarkdownEditorFieldBinding, MissingReferenceWidget, MultiSelectFieldBinding, NavigationStateContext, NumberPropertyPreview, PropertyConfigBadge, PropertyFieldBinding, PropertyIdCopyTooltip, PropertyPreview, PropertySelectEntry, ReadOnlyFieldBinding, RebaseAdmin, RebaseAuthGate, RebaseLayout, RebaseNavigation, RebaseRoute, RebaseRouteDefs, RebaseShell, ReferenceFieldBinding, ReferencePreview, ReferenceWidget, RelationPreview, RepeatFieldBinding, Scaffold, SearchIconsView, SelectFieldBinding, SelectableTable, SelectableTableContext, SelectionTableBinding, SideDialogs, SidePanelControllerContext, SidePanelProvider, SkeletonPropertyComponent, StorageThumbnail, StorageThumbnailInternal, StorageUploadFieldBinding, StringPropertyPreview, SwitchFieldBinding, TextFieldBinding, UrlComponentPreview, UrlContext, UserPreview, VectorFieldBinding, VirtualTableInput, addInitialSlash, buildCollectionGenerationCallback, buildSidePanelsFromUrl, convertDataToEntity, convertFileToJson, copyEntityAction, createStaticDataController, deleteEntityAction, downloadBlob, downloadDataAsCsv, downloadEntitiesExport, editEntityAction, extractTouchedValues, flattenEntry, fromSerializableCollectionConfig, fromSerializableCollectionConfigs, fromSerializableProperties, fromSerializableProperty, getBracketNotation, getChanges, getCollectionBySlugWithin, getCollectionPathsCombinations, getDefaultFieldConfig, getDefaultFieldId, getDefaultPropertiesOrder, getEntityCSVExportableData, getEntityJsonExportableData, getEntityPreviewKeys, getEntityTitlePropertyKey, getEntityTitlePropertyKeyForEntity, getEntityViewWidth, getFieldConfig, getFieldId, getFullId, getFullIdPath, getIconForProperty, getIconForWidget, getInferenceType, getInitialEntityValues, getLastSegment, getPropertiesWithPropertiesOrder, getPropertyInPath, getResolvedPropertyInPath, getUserLabel, idToPropertiesPath, isReferenceProperty, isRelationProperty, isSelfLabellingProperty, mapPropertiesToConfigs, mapPropertyToConfig, mergeEntityActions, namespaceToPropertiesOrderPath, namespaceToPropertiesPath, processValueMapping, removeEmptyContainers, removeInitialAndTrailingSlashes, removeInitialSlash, removeTrailingSlash, renderSkeletonCaptionText, renderSkeletonIcon, renderSkeletonImageThumbnail, renderSkeletonText, resetPasswordAction, resolveCollectionPathIds, resolveEntityAction, resolveEntityView, resolveNavigationFrom, sanitizeUrl, toSerializableCollectionConfig, toSerializableProperties, toSerializableProperty, unflattenObject, useAdminContext, useApp, useBreadcrumbsController, useBuildCollectionRegistryController, useBuildNavigationStateController, useBuildSidePanel, useBuildUrlController, useClearRestoreValue, useCollectionDataController, useCollectionEditorController, useCollectionRegistryController, useCollectionsConfigController, useHistory, useImportConfig, useJsonCollectionsConfigController, useLocalCollectionsConfigController, useNavigationStateController, useResolvedCollections, useResolvedNavigationFrom, useResolvedUser, useResolvedViews, useSelectionController, useSelectionDialog, useSideDialogsController, useSidePanel, useTopLevelNavigation, useUrlController, validateCollectionJson, zodToFormErrors };
|
|
3322
3393
|
|
|
3323
3394
|
//# sourceMappingURL=index.js.map
|