@firecms/core 3.0.0-rc.3 → 3.0.0-tw4.1

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.
@@ -67,6 +67,10 @@ export interface FieldProps<T extends CMSType = any, CustomProps = any, M extend
67
67
  * Is this field part of an array
68
68
  */
69
69
  partOfArray?: boolean;
70
+ /**
71
+ * Is this field part of a block
72
+ */
73
+ partOfBlock?: boolean;
70
74
  /**
71
75
  * Display the child properties directly, without being wrapped in an
72
76
  * extendable panel. Note that this will also hide the title of this property.
@@ -178,6 +182,10 @@ export interface PropertyFieldBindingProps<T extends CMSType, M extends Record<s
178
182
  * Is this field part of an array
179
183
  */
180
184
  partOfArray?: boolean;
185
+ /**
186
+ * Is this field part of a block
187
+ */
188
+ partOfBlock?: boolean;
181
189
  /**
182
190
  * Display the child properties directly, without being wrapped in an
183
191
  * extendable panel. Note that this will also hide the title of this property.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@firecms/core",
3
3
  "type": "module",
4
- "version": "3.0.0-rc.3",
4
+ "version": "3.0.0-tw4.1",
5
5
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/firecmsco"
@@ -53,10 +53,10 @@
53
53
  "@dnd-kit/core": "^6.3.1",
54
54
  "@dnd-kit/modifiers": "^9.0.0",
55
55
  "@dnd-kit/sortable": "^10.0.0",
56
- "@firecms/editor": "^3.0.0-rc.3",
57
- "@firecms/formex": "^3.0.0-rc.3",
58
- "@firecms/ui": "^3.0.0-rc.3",
59
- "@radix-ui/react-portal": "^1.1.9",
56
+ "@firecms/editor": "^3.0.0-tw4.1",
57
+ "@firecms/formex": "^3.0.0-tw4.1",
58
+ "@firecms/ui": "^3.0.0-tw4.1",
59
+ "@radix-ui/react-portal": "^1.1.10",
60
60
  "clsx": "^2.1.1",
61
61
  "compressorjs": "^1.2.1",
62
62
  "date-fns": "^3.6.0",
@@ -71,7 +71,7 @@
71
71
  "react-transition-group": "^4.4.5",
72
72
  "react-use-measure": "^2.1.7",
73
73
  "react-window": "^1.8.11",
74
- "vite-plugin-static-copy": "3.1.2",
74
+ "vite-plugin-static-copy": "3.1.4",
75
75
  "yup": "^0.32.11"
76
76
  },
77
77
  "peerDependencies": {
@@ -81,7 +81,7 @@
81
81
  "react-router-dom": "^6.28.0"
82
82
  },
83
83
  "devDependencies": {
84
- "@jest/globals": "^30.1.2",
84
+ "@jest/globals": "^30.2.0",
85
85
  "@testing-library/react": "^16.3.0",
86
86
  "@testing-library/user-event": "^14.6.1",
87
87
  "@types/jest": "^29.5.14",
@@ -93,22 +93,22 @@
93
93
  "@vitejs/plugin-react": "^4.7.0",
94
94
  "babel-plugin-react-compiler": "^19.0.0-beta-af1b7da-20250417",
95
95
  "cross-env": "^7.0.3",
96
- "eslint-plugin-react-compiler": "^19.0.0-beta-af1b7da-20250417",
96
+ "eslint-plugin-react-compiler": "^19.1.0-rc.2",
97
97
  "jest": "^29.7.0",
98
98
  "npm-run-all": "^4.1.5",
99
- "react-router": "^6.30.1",
100
- "react-router-dom": "^6.30.1",
101
- "ts-jest": "^29.4.3",
99
+ "react-router": "^6.30.2",
100
+ "react-router-dom": "^6.30.2",
101
+ "ts-jest": "^29.4.5",
102
102
  "ts-node": "^10.9.2",
103
103
  "tsd": "^0.31.2",
104
- "typescript": "^5.9.2",
105
- "vite": "^7.1.6"
104
+ "typescript": "^5.9.3",
105
+ "vite": "^7.2.4"
106
106
  },
107
107
  "files": [
108
108
  "dist",
109
109
  "src"
110
110
  ],
111
- "gitHead": "213f4c106eb3e6639eb1ad23c7d94282ef54d444",
111
+ "gitHead": "a054392bdc44c6eae1b0265aee488d5995610f96",
112
112
  "publishConfig": {
113
113
  "access": "public"
114
114
  },
@@ -228,7 +228,7 @@ function DrawerWrapper(props: {
228
228
  open={props.open}
229
229
  onOpenChange={props.setDrawerOpen}
230
230
  title={"Navigation drawer"}
231
- overlayClassName={"bg-white bg-opacity-80"}
231
+ overlayClassName={"bg-white bg-opacity-80 bg-white/80"}
232
232
  >
233
233
  {innerDrawer}
234
234
  </Sheet>
@@ -186,7 +186,7 @@ export function ArrayContainerItem({
186
186
  <div
187
187
  ref={nodeRef}
188
188
  style={style}
189
- className={`relative ${!isDragging ? "hover\\:bg-surface-accent-50 dark\\:hover\\:bg-surface-800 dark\\:hover\\:bg-opacity-20" : ""} rounded-md opacity-100`}
189
+ className={`relative ${!isDragging ? "hover\\:bg-surface-accent-50 dark\\:hover\\:bg-surface-800 dark\\:hover\\:bg-opacity-20 dark\\:hover\\:bg-surface-800/20" : ""} rounded-md opacity-100`}
190
190
  >
191
191
  <div className="flex items-start">
192
192
  <div className="flex-grow w-[calc(100%-48px)] text-text-primary dark:text-text-primary-dark">
@@ -75,7 +75,7 @@ export const EntityCollectionRowActions = function EntityCollectionRowActions({
75
75
  return (
76
76
  <div
77
77
  className={cls(
78
- "h-full flex items-center justify-center flex-col bg-surface-50 dark:bg-surface-900 bg-opacity-90 dark:bg-opacity-90 z-10",
78
+ "h-full flex items-center justify-center flex-col bg-surface-50 dark:bg-surface-900 bg-opacity-90 bg-surface-50/90 dark:bg-opacity-90 dark:bg-surface-900/90 z-10",
79
79
  frozen ? "sticky left-0" : ""
80
80
  )}
81
81
  onClick={useCallback((event: any) => {
@@ -188,9 +188,9 @@ export const EntityTableCell = React.memo<EntityTableCellProps>(
188
188
  <div
189
189
  className={cls(
190
190
  "transition-colors duration-100 ease-in-out",
191
- `flex relative h-full rounded-md p-${p} border border-4 border-opacity-75`,
191
+ `flex relative h-full rounded-md p-${p} border border-4 border-opacity-75`,
192
192
  onHover && !disabled ? "bg-surface-50 dark:bg-surface-900" : "",
193
- saved ? "bg-surface-100 bg-opacity-75 dark:bg-surface-800 dark:bg-opacity-75" : "",
193
+ saved ? "bg-surface-100/75 dark:bg-surface-800/75" : "",
194
194
  hideOverflow ? "overflow-hidden" : "",
195
195
  isSelected ? "bg-surface-50 dark:bg-surface-900" : "",
196
196
  borderClass
@@ -237,7 +237,7 @@ export const EntityTableCell = React.memo<EntityTableCellProps>(
237
237
  {disabled && onHover && disabledTooltip &&
238
238
  <div className="absolute top-1 right-1 text-xs">
239
239
  <Tooltip title={disabledTooltip}>
240
- <DoNotDisturbOnIcon size={"smallest"} color={"disabled"} className={"text-surface-500"}/>
240
+ <DoNotDisturbOnIcon size={"smallest"} color={"disabled"} className={"text-text-disabled"}/>
241
241
  </Tooltip>
242
242
  </div>}
243
243
 
@@ -136,7 +136,7 @@ export function ReferenceWidget<M extends Record<string, any>>({
136
136
  "min-w-80 flex flex-col gap-4",
137
137
  "relative transition-colors duration-200 ease-in rounded font-medium",
138
138
  disabled ? "bg-opacity-50" : "hover:bg-opacity-75",
139
- "text-opacity-50 dark:text-white dark:text-opacity-50",
139
+ "text-opacity-50 text-text-primary/50 dark:text-white dark:text-opacity-50 dark:text-white/50",
140
140
  className
141
141
  )}
142
142
  >
@@ -247,7 +247,7 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
247
247
  checkFilterCombination={checkFilterCombination}
248
248
  createFilterField={filterable ? createFilterField : undefined}
249
249
  rowClassName={useCallback((entity: Entity<M>) => {
250
- return highlightedRow?.(entity) ? "bg-surface-100 bg-opacity-75 dark:bg-surface-800 dark:bg-opacity-75" : "";
250
+ return highlightedRow?.(entity) ? "bg-surface-100 bg-opacity-75 bg-surface-100/75 dark:bg-surface-800 dark:bg-opacity-75 dark:bg-surface-800/75" : "";
251
251
  }, [highlightedRow])}
252
252
  className="flex-grow"
253
253
  emptyComponent={emptyComponent}
@@ -327,15 +327,3 @@ function createFilterField({
327
327
  );
328
328
  }
329
329
 
330
- function filterableProperty(property: ResolvedProperty, partOfArray = false): boolean {
331
- if (partOfArray) {
332
- return ["string", "number", "date", "reference"].includes(property.dataType);
333
- }
334
- if (property.dataType === "array") {
335
- if (property.of)
336
- return filterableProperty(property.of, true);
337
- else
338
- return false;
339
- }
340
- return ["string", "number", "boolean", "date", "reference", "array"].includes(property.dataType);
341
- }
@@ -87,7 +87,7 @@ export const VirtualTableHeader = React.memo<VirtualTableHeaderProps<any>>(
87
87
  <div
88
88
  className={cls("flex py-0 px-3 h-full text-xs uppercase font-semibold relative select-none items-center bg-surface-50 dark:bg-surface-900",
89
89
  "text-text-secondary hover:text-text-primary dark:text-text-secondary-dark dark:hover:text-text-primary-dark",
90
- "hover:bg-surface-100 dark:hover:bg-surface-800 hover:bg-opacity-50 dark:hover:bg-opacity-50",
90
+ "hover:bg-surface-100 dark:hover:bg-surface-800 hover:bg-opacity-50 hover:bg-surface-100/50 dark:hover:bg-opacity-50 dark:hover:bg-surface-800/50",
91
91
  column.frozen ? "sticky left-0 z-10" : "relative z-0"
92
92
  )}
93
93
  style={{
@@ -29,7 +29,7 @@ export const VirtualTableRow = React.memo<VirtualTableRowProps<any>>(
29
29
  return (
30
30
  <div
31
31
  className={cls(
32
- "flex min-w-full text-sm border-b border-surface-200 dark:border-surface-800 border-opacity-40 dark:border-opacity-40",
32
+ "flex min-w-full text-sm border-b border-surface-200 dark:border-surface-800 border-opacity-40 border-surface-200/40 dark:border-opacity-40 dark:border-surface-800/40",
33
33
  rowClassName ? rowClassName(rowData) : "",
34
34
  {
35
35
  "hover:bg-opacity-95": hoverRow,
@@ -85,7 +85,7 @@ export function DefaultDrawer({
85
85
 
86
86
  {groupsWithoutAdmin.map((group) => (
87
87
  <div
88
- className={"bg-surface-50 dark:bg-surface-800 dark:bg-opacity-30 my-4 rounded-lg ml-3 mr-1"}
88
+ className={"bg-surface-50 dark:bg-surface-800 dark:bg-opacity-30 dark:bg-surface-800/30 bg-surface-50 dark:bg-surface-800/30 my-4 rounded-lg ml-3 mr-1"}
89
89
  key={`drawer_group_${group}`}>
90
90
  {buildGroupHeader(group)}
91
91
  {Object.values(navigationEntries)
@@ -34,13 +34,13 @@ export function DrawerNavigationItem({
34
34
  transition: drawerOpen ? "width 150ms ease-in" : undefined
35
35
  }}
36
36
  className={({ isActive }: any) => cls("rounded-lg truncate",
37
- "hover:bg-surface-accent-300 hover:bg-opacity-75 dark:hover:bg-surface-accent-800 dark:hover:bg-opacity-75 text-text-primary dark:text-surface-200 hover:text-surface-900 hover:dark:text-white",
37
+ "hover:bg-surface-accent-300 hover:bg-opacity-75 hover:bg-surface-accent-300/75 dark:hover:bg-surface-accent-800 dark:hover:bg-opacity-75 dark:hover:bg-surface-accent-800/75 text-text-primary dark:text-surface-200 hover:text-surface-900 hover:dark:text-white hover:bg-surface-accent-300/75 dark:hover:bg-surface-accent-800/75",
38
38
  "flex flex-row items-center mr-8",
39
39
  // "transition-all ease-in-out delay-100 duration-300",
40
40
  // drawerOpen ? "w-full" : "w-18",
41
41
  drawerOpen ? "pl-4 h-10" : "pl-4 h-9",
42
42
  "font-semibold text-xs",
43
- isActive ? "bg-surface-accent-200 bg-opacity-60 dark:bg-surface-800 dark:bg-opacity-50" : ""
43
+ isActive ? "bg-surface-accent-200 bg-opacity-60 dark:bg-surface-800 dark:bg-opacity-50 bg-surface-accent-200/60 dark:bg-surface-800/50" : ""
44
44
  )}
45
45
  to={url}
46
46
  >
@@ -49,8 +49,9 @@ export function DrawerNavigationItem({
49
49
 
50
50
  <div
51
51
  className={cls(
52
+ "text-text-primary dark:text-surface-200",
52
53
  drawerOpen ? "opacity-100" : "opacity-0 hidden",
53
- "ml-4 font-inherit text-inherit"
54
+ "ml-4 font-inherit"
54
55
  )}>
55
56
  {name.toUpperCase()}
56
57
  </div>
@@ -857,7 +857,7 @@ export function EntityForm<M extends Record<string, any>>({
857
857
  />}
858
858
 
859
859
  {formex.dirty
860
- ? <Tooltip title={"There are local unsaved changes"}>
860
+ ? <Tooltip title={"This form has been modified"}>
861
861
  <Chip size={"small"} className={"py-1"} colorScheme={"orangeDarker"}>
862
862
  <EditIcon size={"smallest"}/>
863
863
  </Chip>
@@ -83,6 +83,7 @@ function PropertyFieldBindingInternal<T extends CMSType = CMSType, M extends Rec
83
83
  underlyingValueHasChanged,
84
84
  disabled: disabledProp,
85
85
  partOfArray,
86
+ partOfBlock,
86
87
  minimalistView,
87
88
  autoFocus,
88
89
  index,
@@ -93,10 +94,6 @@ function PropertyFieldBindingInternal<T extends CMSType = CMSType, M extends Rec
93
94
  const authController = useAuthController();
94
95
  const customizationController = useCustomizationController();
95
96
 
96
- if(propertyKey === "created_by"){
97
- console.log("Rendering field for created_by", {propertyKey, property, context});
98
- }
99
-
100
97
  return (
101
98
  <Field
102
99
  key={propertyKey}
@@ -168,6 +165,7 @@ function PropertyFieldBindingInternal<T extends CMSType = CMSType, M extends Rec
168
165
  context,
169
166
  disabled,
170
167
  partOfArray,
168
+ partOfBlock,
171
169
  minimalistView,
172
170
  autoFocus,
173
171
  size,
@@ -199,6 +197,7 @@ function FieldInternal<T extends CMSType, CustomProps, M extends Record<string,
199
197
  includeDescription,
200
198
  underlyingValueHasChanged,
201
199
  partOfArray,
200
+ partOfBlock,
202
201
  minimalistView,
203
202
  autoFocus,
204
203
  context,
@@ -261,6 +260,7 @@ function FieldInternal<T extends CMSType, CustomProps, M extends Record<string,
261
260
  disabled: disabled ?? false,
262
261
  underlyingValueHasChanged: underlyingValueHasChanged ?? false,
263
262
  partOfArray: partOfArray ?? false,
263
+ partOfBlock: partOfBlock ?? false,
264
264
  minimalistView: minimalistView ?? false,
265
265
  autoFocus: autoFocus ?? false,
266
266
  customProps: customFieldProps,
@@ -200,6 +200,7 @@ function BlockEntry({
200
200
  context,
201
201
  autoFocus,
202
202
  partOfArray: false,
203
+ partOfBlock: true,
203
204
  minimalistView: true,
204
205
  onPropertyChange: storeProps,
205
206
  }
@@ -6,5 +6,5 @@ import React from "react";
6
6
  export function EmptyValue() {
7
7
 
8
8
  return <div
9
- className="rounded-full bg-surface-200 bg-opacity-30 dark:bg-opacity-20 w-5 h-2 inline-block"/>;
9
+ className="rounded-full bg-surface-200 bg-opacity-30 bg-surface-200/30 dark:bg-opacity-20 dark:bg-surface-200/20 w-5 h-2 inline-block"/>;
10
10
  }
@@ -81,6 +81,11 @@ export interface FieldProps<T extends CMSType = any, CustomProps = any, M extend
81
81
  */
82
82
  partOfArray?: boolean;
83
83
 
84
+ /**
85
+ * Is this field part of a block
86
+ */
87
+ partOfBlock?: boolean;
88
+
84
89
  /**
85
90
  * Display the child properties directly, without being wrapped in an
86
91
  * extendable panel. Note that this will also hide the title of this property.
@@ -220,6 +225,11 @@ export interface PropertyFieldBindingProps<T extends CMSType, M extends Record<s
220
225
  */
221
226
  partOfArray?: boolean;
222
227
 
228
+ /**
229
+ * Is this field part of a block
230
+ */
231
+ partOfBlock?: boolean;
232
+
223
233
  /**
224
234
  * Display the child properties directly, without being wrapped in an
225
235
  * extendable panel. Note that this will also hide the title of this property.