@firecms/core 3.0.0-canary.104 → 3.0.0-canary.105

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@firecms/core",
3
3
  "type": "module",
4
- "version": "3.0.0-canary.104",
4
+ "version": "3.0.0-canary.105",
5
5
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/firecmsco"
@@ -46,9 +46,9 @@
46
46
  "./package.json": "./package.json"
47
47
  },
48
48
  "dependencies": {
49
- "@firecms/editor": "^3.0.0-canary.104",
50
- "@firecms/formex": "^3.0.0-canary.104",
51
- "@firecms/ui": "^3.0.0-canary.104",
49
+ "@firecms/editor": "^3.0.0-canary.105",
50
+ "@firecms/formex": "^3.0.0-canary.105",
51
+ "@firecms/ui": "^3.0.0-canary.105",
52
52
  "@hello-pangea/dnd": "^16.6.0",
53
53
  "@radix-ui/react-portal": "^1.1.1",
54
54
  "clsx": "^2.1.1",
@@ -100,7 +100,7 @@
100
100
  "dist",
101
101
  "src"
102
102
  ],
103
- "gitHead": "df5ac9be9439d01c0acf3666fad83bc87d236eb6",
103
+ "gitHead": "e5b79b1a4af2fd750b9e8c8f73052322aa3e86ab",
104
104
  "publishConfig": {
105
105
  "access": "public"
106
106
  },
@@ -1,14 +1,14 @@
1
- import React, { useCallback, useState } from "react";
1
+ import React, { useCallback } from "react";
2
2
  import equal from "react-fast-compare"
3
3
 
4
- import { ReferencePreview } from "../../../preview";
4
+ import { EmptyValue, ReferencePreview } from "../../../preview";
5
5
  import { CollectionSize, Entity, EntityCollection, EntityReference, FilterValues } from "../../../types";
6
6
 
7
7
  import { getPreviewSizeFrom } from "../../../preview/util";
8
8
  import { getReferenceFrom } from "../../../util";
9
9
  import { useCustomizationController, useNavigationController, useReferenceDialog } from "../../../hooks";
10
10
  import { ErrorView } from "../../ErrorView";
11
- import { Button } from "@firecms/ui";
11
+ import { cls } from "@firecms/ui";
12
12
  import { EntityPreviewContainer } from "../../EntityPreview";
13
13
 
14
14
  type TableReferenceFieldProps = {
@@ -151,13 +151,14 @@ export const TableReferenceFieldSuccess = React.memo(
151
151
  {internalValue && multiselect && buildMultipleReferenceField()}
152
152
 
153
153
  {valueNotSet &&
154
- <Button
155
- onClick={handleOpen}
156
- size={"small"}
157
- variant="outlined"
158
- color="primary">
154
+ <EntityPreviewContainer className={cls("p-4 text-sm font-medium flex items-center gap-4 uppercase",
155
+ disabled
156
+ ? "text-slate-500"
157
+ : "cursor-pointer text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-gray-800 group-hover:bg-slate-50 dark:group-hover:bg-gray-800")}
158
+ onClick={handleOpen}
159
+ size={"medium"}>
159
160
  Edit {title}
160
- </Button>}
161
+ </EntityPreviewContainer>}
161
162
 
162
163
  </div>
163
164
  );
@@ -16,7 +16,7 @@ import {
16
16
  } from "../../hooks";
17
17
  import { ErrorView } from "../ErrorView";
18
18
  import { AddIcon, Button, DialogActions, Typography } from "@firecms/ui";
19
- import { canCreateEntity, fullPathToCollectionSegments, resolveCollection } from "../../util";
19
+ import { canCreateEntity, resolveCollection } from "../../util";
20
20
  import { useSelectionController } from "../EntityCollectionView/useSelectionController";
21
21
  import { useColumnIds, useTableSearchHelper } from "../common";
22
22
  import { useSideDialogContext } from "../../core";
@@ -247,7 +247,6 @@ export function ReferenceSelectionTable<M extends Record<string, any>>(
247
247
  error={"Could not find collection with id " + collection}/>
248
248
  }
249
249
 
250
- // eslint-disable-next-line react-hooks/rules-of-hooks
251
250
  const resolvedCollection = useMemo(() => resolveCollection({
252
251
  collection: collection,
253
252
  path: fullPath,
@@ -255,10 +254,8 @@ export function ReferenceSelectionTable<M extends Record<string, any>>(
255
254
  fields: customizationController.propertyConfigs
256
255
  }), [collection, customizationController.propertyConfigs, fullPath]);
257
256
 
258
- // eslint-disable-next-line react-hooks/rules-of-hooks
259
257
  const displayedColumnIds = useColumnIds(resolvedCollection, false);
260
258
 
261
- // eslint-disable-next-line react-hooks/rules-of-hooks
262
259
  const tableController = useDataSourceEntityCollectionTableController<M>({
263
260
  fullPath,
264
261
  collection,
@@ -272,7 +269,6 @@ export function ReferenceSelectionTable<M extends Record<string, any>>(
272
269
  onTextSearchClick,
273
270
  textSearchEnabled
274
271
  } =
275
- // eslint-disable-next-line react-hooks/rules-of-hooks
276
272
  useTableSearchHelper({
277
273
  collection,
278
274
  fullPath,
@@ -5,10 +5,11 @@ import { useNavigationController, useReferenceDialog } from "../../hooks";
5
5
  import { ReadOnlyFieldBinding } from "./ReadOnlyFieldBinding";
6
6
  import { FieldHelperText, LabelWithIcon } from "../components";
7
7
  import { ErrorView } from "../../components";
8
- import { ReferencePreview } from "../../preview";
8
+ import { EmptyValue, ReferencePreview } from "../../preview";
9
9
  import { getIconForProperty, getReferenceFrom } from "../../util";
10
- import { Button } from "@firecms/ui";
11
10
  import { useClearRestoreValue } from "../useClearRestoreValue";
11
+ import { EntityPreviewContainer } from "../../components/EntityPreview";
12
+ import { cls } from "@firecms/ui";
12
13
 
13
14
  /**
14
15
  * Field that opens a reference selection dialog.
@@ -84,9 +85,9 @@ function ReferenceFieldBindingInternal({
84
85
  return (
85
86
  <>
86
87
  {!minimalistView && <LabelWithIcon icon={getIconForProperty(property, "small")}
87
- required={property.validation?.required}
88
- title={property.name}
89
- className={"text-text-secondary dark:text-text-secondary-dark ml-3.5"}/>}
88
+ required={property.validation?.required}
89
+ title={property.name}
90
+ className={"text-text-secondary dark:text-text-secondary-dark ml-3.5"}/>}
90
91
 
91
92
  {!collection && <ErrorView
92
93
  error={"The specified collection does not exist. Check console"}/>}
@@ -105,12 +106,15 @@ function ReferenceFieldBindingInternal({
105
106
  />}
106
107
 
107
108
  {!value && <div className="justify-center text-left">
108
- <Button variant="outlined"
109
- color="primary"
110
- disabled={disabled || isSubmitting}
111
- onClick={onEntryClick}>
112
- Edit {property.name}
113
- </Button>
109
+ <EntityPreviewContainer className={cls("p-6 text-sm font-medium flex items-center gap-6",
110
+ disabled || isSubmitting
111
+ ? "text-slate-500"
112
+ : "cursor-pointer text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-gray-800 group-hover:bg-slate-50 dark:group-hover:bg-gray-800")}
113
+ onClick={onEntryClick}
114
+ size={"medium"}>
115
+ <EmptyValue/>
116
+ {`Edit ${property.name}`.toUpperCase()}
117
+ </EntityPreviewContainer>
114
118
  </div>}
115
119
  </>}
116
120