@rebasepro/admin 0.0.1-canary.892f711 → 0.0.1-canary.a6becfb
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-DodTdF9r.js → CollectionEditorDialog-D58wO4_0.js} +18 -18
- package/dist/CollectionEditorDialog-D58wO4_0.js.map +1 -0
- package/dist/{CollectionsStudioView-BXEC8GLR.js → CollectionsStudioView-BcJwJemK.js} +4 -4
- package/dist/{CollectionsStudioView-BXEC8GLR.js.map → CollectionsStudioView-BcJwJemK.js.map} +1 -1
- package/dist/{ContentHomePage-B1Wo-PmP.js → ContentHomePage-Babxyn6J.js} +26 -26
- package/dist/ContentHomePage-Babxyn6J.js.map +1 -0
- package/dist/{ExportCollectionAction-AymZEnpg.js → ExportCollectionAction-BoY8d7kJ.js} +2 -2
- package/dist/{ExportCollectionAction-AymZEnpg.js.map → ExportCollectionAction-BoY8d7kJ.js.map} +1 -1
- package/dist/{ImportCollectionAction-B_jbXZFM.js → ImportCollectionAction-HDsynIQQ.js} +2 -2
- package/dist/{ImportCollectionAction-B_jbXZFM.js.map → ImportCollectionAction-HDsynIQQ.js.map} +1 -1
- package/dist/{PropertyEditView-AJrMd1MY.js → PropertyEditView-DtCVqSqJ.js} +79 -101
- package/dist/PropertyEditView-DtCVqSqJ.js.map +1 -0
- package/dist/{RolesView--I0lYfUY.js → RolesView-Bn_zd5qj.js} +2 -2
- package/dist/{RolesView--I0lYfUY.js.map → RolesView-Bn_zd5qj.js.map} +1 -1
- package/dist/{UsersView-DQTKDhnL.js → UsersView-9GsKDhDu.js} +6 -28
- package/dist/UsersView-9GsKDhDu.js.map +1 -0
- package/dist/collection_editor/ConfigControllerProvider.d.ts +0 -4
- package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +1 -3
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +0 -2
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +1 -2
- package/dist/collection_editor_ui.js +3 -3
- package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +5 -1
- package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +2 -1
- package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +2 -1
- package/dist/components/EntityCollectionView/FilterPresetsButton.d.ts +21 -0
- package/dist/components/EntityEditView.d.ts +6 -0
- package/dist/components/RebaseCMS.d.ts +1 -1
- package/dist/{index-d0l2-VUX.js → index-5oj7Lzkh.js} +2 -2
- package/dist/{index-d0l2-VUX.js.map → index-5oj7Lzkh.js.map} +1 -1
- package/dist/{index-ECDdw5Du.js → index-BNdetcv_.js} +3 -3
- package/dist/index-BNdetcv_.js.map +1 -0
- package/dist/{index-CgjhvyrD.js → index-uEXdixRg.js} +3 -3
- package/dist/index-uEXdixRg.js.map +1 -0
- package/dist/index.js +18 -14
- package/dist/index.js.map +1 -1
- package/dist/util/navigation_utils.d.ts +10 -1
- package/dist/{util-AbXCxVMd.js → util-BxKchZpz.js} +1035 -588
- package/dist/util-BxKchZpz.js.map +1 -0
- package/package.json +8 -8
- package/src/collection_editor/ConfigControllerProvider.tsx +1 -10
- package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +3 -47
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +2 -10
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +1 -3
- package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +0 -1
- package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +6 -6
- package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/ReferencePropertyField.tsx +15 -49
- package/src/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +2 -3
- package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +1 -1
- package/src/collection_editor/ui/collection_editor/templates/products_template.ts +2 -2
- package/src/components/DefaultAppBar.tsx +2 -2
- package/src/components/DefaultDrawer.tsx +24 -16
- package/src/components/DrawerNavigationGroup.tsx +3 -3
- package/src/components/DrawerNavigationItem.tsx +6 -6
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +5 -3
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +9 -3
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +2 -2
- package/src/components/EntityCollectionTable/table_bindings.tsx +37 -27
- package/src/components/EntityCollectionView/EntityCard.tsx +2 -2
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +4 -3
- package/src/components/EntityCollectionView/EntityCollectionListView.tsx +7 -6
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +50 -7
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +17 -8
- package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +20 -5
- package/src/components/EntityCollectionView/FilterPresetsButton.tsx +292 -0
- package/src/components/EntityCollectionView/useEntityPreviewSlots.ts +33 -5
- package/src/components/EntityEditView.tsx +80 -81
- package/src/components/EntitySidePanel.tsx +11 -7
- package/src/components/HomePage/ContentHomePage.tsx +24 -15
- package/src/components/HomePage/NavigationCard.tsx +4 -4
- package/src/components/HomePage/NavigationGroup.tsx +2 -2
- package/src/components/RebaseAuthGate.tsx +2 -0
- package/src/components/RebaseCMS.tsx +4 -3
- package/src/components/RebaseNavigation.tsx +7 -4
- package/src/components/RelationSelector.tsx +30 -2
- package/src/components/SelectableTable/SelectableTable.tsx +2 -2
- package/src/components/UserSelector.tsx +1 -1
- package/src/components/admin/UsersView.tsx +2 -17
- package/src/components/app/Scaffold.tsx +3 -3
- package/src/components/field_configs.tsx +3 -3
- package/src/form/PropertyFieldBinding.tsx +10 -6
- package/src/hooks/navigation/useResolvedViews.tsx +1 -3
- package/src/hooks/navigation/useTopLevelNavigation.ts +1 -1
- package/src/hooks/navigation/utils.ts +1 -1
- package/src/preview/PropertyPreview.tsx +17 -13
- package/src/routes/RebaseRoute.tsx +27 -2
- package/src/util/navigation_utils.ts +16 -2
- package/src/util/previews.ts +14 -5
- package/dist/CollectionEditorDialog-DodTdF9r.js.map +0 -1
- package/dist/ContentHomePage-B1Wo-PmP.js.map +0 -1
- package/dist/PropertyEditView-AJrMd1MY.js.map +0 -1
- package/dist/UsersView-DQTKDhnL.js.map +0 -1
- package/dist/index-CgjhvyrD.js.map +0 -1
- package/dist/index-ECDdw5Du.js.map +0 -1
- package/dist/util-AbXCxVMd.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { useAuthController, useCustomizationController, IconForView, useSnackbarController, useLargeLayout, AIIcon, useRebaseContext, ErrorView, ConfirmationDialog, useUnsavedChangesDialog, UnsavedChangesDialog } from "@rebasepro/core";
|
|
4
|
-
import { bk as useCollectionsConfigController, a3 as FieldCaption, ar as SearchIconsView, d as getFieldConfig, P as PropertyConfigBadge, aX as getFullId, b0 as idToPropertiesPath, b4 as namespaceToPropertiesOrderPath, br as validateCollectionJson, e as useCollectionRegistryController, K as CollectionGenerationApiError, s as useCollectionEditorController, I as ImportFileUpload, a as getInferenceType, a8 as ImportNewPropertyFieldPreview, D as DataNewPropertiesMapping, aW as getFieldId, f as useSelectionController, h as convertDataToEntity, E as EntityCollectionTable, m as useNavigationStateController, u as useImportConfig, j as useUrlController, b as ImportSaveInProgress, aY as getFullIdPath } from "./util-
|
|
4
|
+
import { bk as useCollectionsConfigController, a3 as FieldCaption, ar as SearchIconsView, d as getFieldConfig, P as PropertyConfigBadge, aX as getFullId, b0 as idToPropertiesPath, b4 as namespaceToPropertiesOrderPath, br as validateCollectionJson, e as useCollectionRegistryController, K as CollectionGenerationApiError, s as useCollectionEditorController, I as ImportFileUpload, a as getInferenceType, a8 as ImportNewPropertyFieldPreview, D as DataNewPropertiesMapping, aW as getFieldId, f as useSelectionController, h as convertDataToEntity, E as EntityCollectionTable, m as useNavigationStateController, u as useImportConfig, j as useUrlController, b as ImportSaveInProgress, aY as getFullIdPath } from "./util-BxKchZpz.js";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import React__default, { useState, useRef, useMemo, useEffect } from "react";
|
|
7
7
|
import { Chip, Typography, cls, Tooltip, IconButton, TextField, DebouncedTextField, Dialog, Container, ToggleButtonGroup, Select, SelectItem, iconSize, Button, BooleanSwitchWithLabel, DialogTitle, DialogContent, DialogActions, CircularProgress, ErrorBoundary, defaultBorderMixin, Table, TableHeader, TableCell, TableBody, TableRow, Menu, Card, CircularProgressCenter, Paper, MultiSelect, MultiSelectItem, coolIconKeys, Tabs, Tab, LoadingButton } from "@rebasepro/ui";
|
|
@@ -23,7 +23,7 @@ import "xlsx";
|
|
|
23
23
|
import { buildPropertyFromData, buildEntityPropertiesFromData } from "@rebasepro/schema-inference";
|
|
24
24
|
import "date-fns";
|
|
25
25
|
import "date-fns/locale";
|
|
26
|
-
import { a as PropertyFormDialog, u as useAIModifiedPaths, b as PropertyTree, P as PropertyForm, s as supportedFields, c as updatePropertyFromWidget, A as AIModifiedPathsProvider } from "./PropertyEditView-
|
|
26
|
+
import { a as PropertyFormDialog, u as useAIModifiedPaths, b as PropertyTree, P as PropertyForm, s as supportedFields, c as updatePropertyFromWidget, A as AIModifiedPathsProvider } from "./PropertyEditView-DtCVqSqJ.js";
|
|
27
27
|
import JSON5 from "json5";
|
|
28
28
|
import { Highlight, themes } from "prism-react-renderer";
|
|
29
29
|
const CollectionEditorSchema = z.object({
|
|
@@ -1110,7 +1110,6 @@ function collectionToCode(collection) {
|
|
|
1110
1110
|
path: collection.slug,
|
|
1111
1111
|
description: collection.description,
|
|
1112
1112
|
icon: collection.icon,
|
|
1113
|
-
group: collection.group,
|
|
1114
1113
|
defaultFilter: collection.defaultFilter,
|
|
1115
1114
|
sort: collection.sort,
|
|
1116
1115
|
properties: Object.entries({
|
|
@@ -1130,7 +1129,6 @@ function CollectionPropertiesEditorForm({
|
|
|
1130
1129
|
propertyErrorsRef,
|
|
1131
1130
|
onPropertyError,
|
|
1132
1131
|
setDirty,
|
|
1133
|
-
reservedGroups,
|
|
1134
1132
|
extraIcon,
|
|
1135
1133
|
getUser,
|
|
1136
1134
|
getData,
|
|
@@ -1346,7 +1344,7 @@ function CollectionPropertiesEditorForm({
|
|
|
1346
1344
|
setSelectedPropertyKey(propertyKey_1);
|
|
1347
1345
|
setSelectedPropertyNamespace(namespace_6);
|
|
1348
1346
|
};
|
|
1349
|
-
const body = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-2 h-full bg-
|
|
1347
|
+
const body = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-12 gap-2 h-full bg-white dark:bg-surface-950", children: [
|
|
1350
1348
|
/* @__PURE__ */ jsxs("div", { className: cls("bg-surface-50 dark:bg-surface-900", "p-4 md:p-8", "col-span-12 lg:col-span-5 h-full overflow-auto", !asDialog && "border-r " + defaultBorderMixin), children: [
|
|
1351
1349
|
/* @__PURE__ */ jsxs("div", { className: "flex my-2", children: [
|
|
1352
1350
|
/* @__PURE__ */ jsxs("div", { className: "grow mb-4", children: [
|
|
@@ -1482,7 +1480,7 @@ function CollectionRelationsTab() {
|
|
|
1482
1480
|
] }),
|
|
1483
1481
|
/* @__PURE__ */ jsx(Dialog, { open: !!editingRelationState, onOpenChange: (open) => !open && handleCancel(), maxWidth: "2xl", children: editingRelationState && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1484
1482
|
/* @__PURE__ */ jsx(DialogTitle, { className: "flex justify-between items-center w-full", variant: "h6", children: editingRelationIndex === -1 ? "New Relation" : "Edit Relation" }),
|
|
1485
|
-
/* @__PURE__ */ jsx(DialogContent, { includeMargin: false, className: "p-4 md:p-6 border-t
|
|
1483
|
+
/* @__PURE__ */ jsx(DialogContent, { includeMargin: false, className: cls("p-4 md:p-6 border-t bg-white dark:bg-surface-900", defaultBorderMixin), children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 max-w-2xl mx-auto", children: [
|
|
1486
1484
|
/* @__PURE__ */ jsx(TextField, { label: "Relation Name", name: "relationName", placeholder: "e.g. posts", value: editingRelationState.relationName || "", onChange: (e_1) => setEditingRelationState((prev) => prev ? {
|
|
1487
1485
|
...prev,
|
|
1488
1486
|
relationName: e_1.target.value
|
|
@@ -1514,7 +1512,7 @@ function CollectionRelationsTab() {
|
|
|
1514
1512
|
/* @__PURE__ */ jsx(SelectItem, { value: "owning", children: "Owning" }),
|
|
1515
1513
|
/* @__PURE__ */ jsx(SelectItem, { value: "inverse", children: "Inverse" })
|
|
1516
1514
|
] }),
|
|
1517
|
-
editingRelationState.cardinality === "many" && editingRelationState.direction === "owning" && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 mt-4 pt-4 border-t
|
|
1515
|
+
editingRelationState.cardinality === "many" && editingRelationState.direction === "owning" && /* @__PURE__ */ jsxs("div", { className: cls("flex flex-col gap-4 mt-4 pt-4 border-t", defaultBorderMixin), children: [
|
|
1518
1516
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", className: "text-text-primary", children: "Intermediate Table" }),
|
|
1519
1517
|
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-text-secondary -mt-3", children: "Required for many-to-many relationships. This defines the junction table linking both collections." }),
|
|
1520
1518
|
/* @__PURE__ */ jsx(TextField, { label: "Table Name", name: "throughTable", placeholder: "e.g. user_roles", value: editingRelationState.through?.table || "", onChange: (e_2) => setEditingRelationState((prev_3) => prev_3 ? {
|
|
@@ -1863,7 +1861,9 @@ const productsCollectionTemplate = {
|
|
|
1863
1861
|
available: {
|
|
1864
1862
|
type: "boolean",
|
|
1865
1863
|
name: "Available",
|
|
1866
|
-
|
|
1864
|
+
ui: {
|
|
1865
|
+
columnWidth: 100
|
|
1866
|
+
},
|
|
1867
1867
|
description: "Is this product available in the website"
|
|
1868
1868
|
},
|
|
1869
1869
|
price: {
|
|
@@ -1877,7 +1877,9 @@ const productsCollectionTemplate = {
|
|
|
1877
1877
|
images: {
|
|
1878
1878
|
type: "array",
|
|
1879
1879
|
name: "Images",
|
|
1880
|
-
|
|
1880
|
+
ui: {
|
|
1881
|
+
hideFromCollection: true
|
|
1882
|
+
},
|
|
1881
1883
|
of: {
|
|
1882
1884
|
type: "string",
|
|
1883
1885
|
storage: {
|
|
@@ -2252,7 +2254,9 @@ const pagesCollectionTemplate = {
|
|
|
2252
2254
|
is_published: {
|
|
2253
2255
|
type: "boolean",
|
|
2254
2256
|
name: "Is Published",
|
|
2255
|
-
|
|
2257
|
+
ui: {
|
|
2258
|
+
columnWidth: 100
|
|
2259
|
+
},
|
|
2256
2260
|
description: "Should this page be live on the site?"
|
|
2257
2261
|
}
|
|
2258
2262
|
}
|
|
@@ -4216,7 +4220,6 @@ function CollectionEditor(props) {
|
|
|
4216
4220
|
console.error(e);
|
|
4217
4221
|
}
|
|
4218
4222
|
}, [props.editedCollectionId, props.parentCollectionSlugs, props.parentEntityIds, collectionRegistry.initialised, collectionRegistry.getRawCollection]);
|
|
4219
|
-
const groups = topLevelNavigation?.groups ?? [];
|
|
4220
4223
|
const initialCollection = collection ? {
|
|
4221
4224
|
...collection,
|
|
4222
4225
|
slug: collection.slug ?? randomString(16)
|
|
@@ -4235,7 +4238,6 @@ function CollectionEditor(props) {
|
|
|
4235
4238
|
slug: initialValuesProp?.slug ?? randomString(16),
|
|
4236
4239
|
table: initialValuesProp?.slug ?? "",
|
|
4237
4240
|
name: initialValuesProp?.name ?? "",
|
|
4238
|
-
group: initialValuesProp?.group ?? "",
|
|
4239
4241
|
properties: {},
|
|
4240
4242
|
propertiesOrder: [],
|
|
4241
4243
|
icon: coolIconKeys[Math.floor(Math.random() * coolIconKeys.length)],
|
|
@@ -4247,7 +4249,7 @@ function CollectionEditor(props) {
|
|
|
4247
4249
|
if (!props.isNewCollection && (!collectionRegistry.initialised || !initialLoadingCompleted)) {
|
|
4248
4250
|
return /* @__PURE__ */ jsx(CircularProgressCenter, {});
|
|
4249
4251
|
}
|
|
4250
|
-
return /* @__PURE__ */ jsx(CollectionEditorInternal, { ...props, initialValues, existingPaths, existingIds, includeTemplates, collection, setCollection,
|
|
4252
|
+
return /* @__PURE__ */ jsx(CollectionEditorInternal, { ...props, initialValues, existingPaths, existingIds, includeTemplates, collection, setCollection, propertyConfigs });
|
|
4251
4253
|
}
|
|
4252
4254
|
function CollectionEditorInternal({
|
|
4253
4255
|
isNewCollection,
|
|
@@ -4258,7 +4260,6 @@ function CollectionEditorInternal({
|
|
|
4258
4260
|
path,
|
|
4259
4261
|
collectionInference,
|
|
4260
4262
|
handleClose,
|
|
4261
|
-
reservedGroups,
|
|
4262
4263
|
extraView,
|
|
4263
4264
|
handleCancel,
|
|
4264
4265
|
setFormDirty,
|
|
@@ -4272,7 +4273,6 @@ function CollectionEditorInternal({
|
|
|
4272
4273
|
setCollection,
|
|
4273
4274
|
initialValues,
|
|
4274
4275
|
propertyConfigs,
|
|
4275
|
-
groups,
|
|
4276
4276
|
existingEntities,
|
|
4277
4277
|
initialView: initialViewProp,
|
|
4278
4278
|
expandKanban,
|
|
@@ -4568,7 +4568,7 @@ function CollectionEditorInternal({
|
|
|
4568
4568
|
};
|
|
4569
4569
|
return /* @__PURE__ */ jsxs("div", { className: "h-full w-full flex flex-col bg-white dark:bg-surface-950", children: [
|
|
4570
4570
|
/* @__PURE__ */ jsx(Formex, { value: formController, children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4571
|
-
!isNewCollection && /* @__PURE__ */ jsxs("div", { className: cls("px-4 py-2 w-full flex shrink-0 items-center justify-between gap-4 bg-
|
|
4571
|
+
!isNewCollection && /* @__PURE__ */ jsxs("div", { className: cls("px-4 py-2 w-full flex shrink-0 items-center justify-between gap-4 bg-surface-50 dark:bg-surface-950 border-b", defaultBorderMixin), children: [
|
|
4572
4572
|
/* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center justify-end gap-4 min-w-0", children: /* @__PURE__ */ jsxs(Tabs, { value: currentView, className: "bg-transparent !w-fit max-w-full", onValueChange: (v) => setCurrentView(v), children: [
|
|
4573
4573
|
/* @__PURE__ */ jsx(Tab, { value: "general", children: "General" }),
|
|
4574
4574
|
/* @__PURE__ */ jsx(Tab, { value: "display", children: "Display" }),
|
|
@@ -4617,7 +4617,7 @@ function CollectionEditorInternal({
|
|
|
4617
4617
|
currentView === "display" && /* @__PURE__ */ jsx(DisplaySettingsForm, { expandKanban }),
|
|
4618
4618
|
currentView === "relations" && getDataSourceCapabilities(values_1.driver).supportsRelations && /* @__PURE__ */ jsx(CollectionRelationsTab, {}),
|
|
4619
4619
|
currentView === "rls" && getDataSourceCapabilities(values_1.driver).supportsRLS && /* @__PURE__ */ jsx(CollectionRLSTab, {}),
|
|
4620
|
-
currentView === "properties" && /* @__PURE__ */ jsx(CollectionPropertiesEditorForm, { showErrors: submitCount > 0, isNewCollection,
|
|
4620
|
+
currentView === "properties" && /* @__PURE__ */ jsx(CollectionPropertiesEditorForm, { showErrors: submitCount > 0, isNewCollection, onPropertyError: (propertyKey, namespace, error_0) => {
|
|
4621
4621
|
const current = removeUndefined({
|
|
4622
4622
|
...propertyErrorsRef.current,
|
|
4623
4623
|
[getFullIdPath(propertyKey, namespace)]: removeUndefined(error_0, true)
|
|
@@ -4728,4 +4728,4 @@ export {
|
|
|
4728
4728
|
CollectionEditor,
|
|
4729
4729
|
CollectionEditorDialog
|
|
4730
4730
|
};
|
|
4731
|
-
//# sourceMappingURL=CollectionEditorDialog-
|
|
4731
|
+
//# sourceMappingURL=CollectionEditorDialog-D58wO4_0.js.map
|