@firecms/collection_editor 3.0.0-canary.167 → 3.0.0-canary.169

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.
@@ -0,0 +1,5 @@
1
+ export declare function LayoutModeSwitch({ value, onChange, className }: {
2
+ value: "side_panel" | "full_screen";
3
+ onChange: (value: "side_panel" | "full_screen") => void;
4
+ className?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@firecms/collection_editor",
3
3
  "type": "module",
4
- "version": "3.0.0-canary.167",
4
+ "version": "3.0.0-canary.169",
5
5
  "main": "./dist/index.umd.js",
6
6
  "module": "./dist/index.es.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "source": "src/index.ts",
9
9
  "dependencies": {
10
- "@firecms/data_export": "^3.0.0-canary.167",
11
- "@firecms/data_import": "^3.0.0-canary.167",
12
- "@firecms/data_import_export": "^3.0.0-canary.167",
13
- "@firecms/formex": "^3.0.0-canary.167",
14
- "@firecms/schema_inference": "^3.0.0-canary.167",
15
- "@firecms/ui": "^3.0.0-canary.167",
10
+ "@firecms/data_export": "^3.0.0-canary.169",
11
+ "@firecms/data_import": "^3.0.0-canary.169",
12
+ "@firecms/data_import_export": "^3.0.0-canary.169",
13
+ "@firecms/formex": "^3.0.0-canary.169",
14
+ "@firecms/schema_inference": "^3.0.0-canary.169",
15
+ "@firecms/ui": "^3.0.0-canary.169",
16
16
  "@hello-pangea/dnd": "^17.0.0",
17
17
  "json5": "^2.2.3",
18
18
  "prism-react-renderer": "^2.4.0"
@@ -70,5 +70,5 @@
70
70
  "publishConfig": {
71
71
  "access": "public"
72
72
  },
73
- "gitHead": "86c9b7ff34991bf0424764845936b002e1071560"
73
+ "gitHead": "8c086883fc1cb08a74d4bd66ef2f952affa9fdb9"
74
74
  }
@@ -277,7 +277,7 @@ export const ConfigControllerProvider = React.memo(
277
277
  getData={getData && currentPropertyDialog?.editedCollectionId
278
278
  ? () => {
279
279
  console.debug("get data for property", currentPropertyDialog?.editedCollectionId);
280
- const resolvedPath = navigation.resolveAliasesFrom(currentPropertyDialog.editedCollectionId!)
280
+ const resolvedPath = navigation.resolveIdsFrom(currentPropertyDialog.editedCollectionId!)
281
281
  return getData(resolvedPath, []);
282
282
  }
283
283
  : undefined}
@@ -23,6 +23,7 @@ import {
23
23
 
24
24
  import { Field, getIn, useFormex } from "@firecms/formex";
25
25
  import { useCollectionEditorController } from "../../useCollectionEditorController";
26
+ import { LayoutModeSwitch } from "./LayoutModeSwitch";
26
27
 
27
28
  export function CollectionDetailsForm({
28
29
  isNewCollection,
@@ -207,9 +208,16 @@ export function CollectionDetailsForm({
207
208
  <FieldCaption>
208
209
  {showErrors && Boolean(errors.group) ? errors.group : "Group in the home page"}
209
210
  </FieldCaption>
211
+
212
+
210
213
  </div>}
211
214
 
212
- <div className={"col-span-12"}>
215
+ <LayoutModeSwitch
216
+ className={"col-span-12"}
217
+ value={values.openEntityMode ?? "side_panel"}
218
+ onChange={(value) => setFieldValue("openEntityMode", value)}/>
219
+
220
+ <div className={"col-span-12 mt-8"}>
213
221
  <ExpandablePanel
214
222
  expanded={advancedPanelExpanded}
215
223
  onExpandedChange={setAdvancedPanelExpanded}
@@ -487,7 +487,7 @@ function CollectionEditorInternal<M extends Record<string, any>>({
487
487
  const pathError = validatePath(path, isNewCollection, existingPaths, values.id);
488
488
 
489
489
  const parentPaths = !pathError && parentCollectionIds ? navigation.convertIdsToPaths(parentCollectionIds) : undefined;
490
- const resolvedPath = !pathError ? navigation.resolveAliasesFrom(updatedFullPath) : undefined;
490
+ const resolvedPath = !pathError ? navigation.resolveIdsFrom(updatedFullPath) : undefined;
491
491
  const getDataWithPath = resolvedPath && getData ? async () => {
492
492
  const data = await getData(resolvedPath, parentPaths ?? []);
493
493
  if (existingEntities) {
@@ -540,7 +540,7 @@ function CollectionEditorInternal<M extends Record<string, any>>({
540
540
 
541
541
  <>
542
542
  {!isNewCollection && <Tabs value={currentView}
543
- innerClassName={cls(defaultBorderMixin, "justify-end bg-surface-50 dark:bg-surface-950 border-b")}
543
+ innerClassName={cls(defaultBorderMixin, "px-4 h-14 w-full justify-end bg-surface-50 dark:bg-surface-950 border-b")}
544
544
  onValueChange={(v) => setCurrentView(v as EditorView)}>
545
545
  <Tab value={"details"}>
546
546
  Details
@@ -183,7 +183,7 @@ function EnumFormFields({
183
183
  variant={"text"}
184
184
  size={"small"}
185
185
  onClick={inferValues}>
186
- {inferring ? <CircularProgress size={"small"}/> : <AutorenewIcon/>}
186
+ {inferring ? <CircularProgress size={"smallest"}/> : <AutorenewIcon/>}
187
187
  Infer values from data
188
188
  </Button>}
189
189
  </div>
@@ -0,0 +1,53 @@
1
+ import { Card, cls, SquareIcon, Tooltip, Typography, VerticalSplitIcon } from "@firecms/ui";
2
+
3
+ export function LayoutModeSwitch({
4
+ value,
5
+ onChange,
6
+ className
7
+ }: {
8
+ value: "side_panel" | "full_screen";
9
+ onChange: (value: "side_panel" | "full_screen") => void;
10
+ className?: string;
11
+ }) {
12
+
13
+ return <div className={cls(className)}>
14
+ <Typography variant={"label"} color={"secondary"} className={"ml-3.5"}>Document view</Typography>
15
+ <div className={cls("flex flex-row gap-4")}>
16
+
17
+ <Tooltip title={"Documents are open in a side panel"}>
18
+ <Card
19
+ onClick={() => onChange("side_panel")}
20
+ className={cls(
21
+ "my-2 rounded-md mx-0 p-4 focus:outline-none transition ease-in-out duration-150 flex flex-row gap-4 items-center",
22
+ "text-surface-700 dark:text-surface-accent-300",
23
+ "hover:text-primary-dark dark:hover:text-primary focus:ring-primary hover:ring-1 hover:ring-primary",
24
+ value === "side_panel" ? "border-primary dark:border-primary" : "border-surface-400 dark:border-surface-600",
25
+ )}
26
+ >
27
+ <VerticalSplitIcon/>
28
+ <Typography variant={"label"}>
29
+ Side panel
30
+ </Typography>
31
+ </Card>
32
+ </Tooltip>
33
+
34
+ <Tooltip title={"Documents are open full-screen"}>
35
+ <Card
36
+ onClick={() => onChange("full_screen")}
37
+ className={cls(
38
+ "my-2 rounded-md mx-0 p-4 focus:outline-none transition ease-in-out duration-150 flex flex-row gap-4 items-center",
39
+ "text-surface-700 dark:text-surface-accent-300",
40
+ "hover:text-primary-dark dark:hover:text-primary focus:ring-primary hover:ring-1 hover:ring-primary",
41
+ value === "full_screen" ? "border-primary dark:border-primary" : "border-surface-400 dark:border-surface-600",
42
+ )}
43
+ >
44
+ <SquareIcon/>
45
+ <Typography variant={"label"}>
46
+ Full screen
47
+ </Typography>
48
+ </Card>
49
+ </Tooltip>
50
+
51
+ </div>
52
+ </div>
53
+ }
@@ -47,6 +47,7 @@ export function CollectionEditorImportDataPreview({
47
47
  key: p,
48
48
  disabled: false
49
49
  }))}
50
+ openEntityMode={"side_panel"}
50
51
  properties={properties}
51
52
  enablePopupIcon={false}/>
52
53