@firecms/core 3.0.0-canary.240 → 3.0.0-canary.242

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.
@@ -113,7 +113,8 @@ export type FireCMSProps<USER extends User> = {
113
113
  userConfigPersistence?: UserConfigurationPersistence;
114
114
  /**
115
115
  * Use plugins to modify the behaviour of the CMS.
116
- * Currently, in ALPHA, and likely subject to change.
116
+ * DEPRECATED: use the `plugins` prop in the `useBuildNavigationController` instead.
117
+ * This prop will work as a fallback for the `plugins` prop in the `useBuildNavigationController`.
117
118
  */
118
119
  plugins?: FireCMSPlugin<any, any, any>[];
119
120
  /**
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { EntityCollection } from "./collections";
3
3
  import { EntityReference } from "./entities";
4
+ import { FireCMSPlugin } from "./plugins";
4
5
  /**
5
6
  * Controller that includes the resolved navigation and utility methods and
6
7
  * attributes.
@@ -127,6 +128,10 @@ export type NavigationController<EC extends EntityCollection = EntityCollection<
127
128
  * @param {NavigateOptions} [options] - Optional configuration settings for navigation, such as replace behavior or state data.
128
129
  */
129
130
  navigate: (to: string, options?: NavigateOptions) => void;
131
+ /**
132
+ * Plugin system allowing to extend the CMS functionality.
133
+ */
134
+ plugins?: FireCMSPlugin<any, any, any>[];
130
135
  };
131
136
  export interface NavigateOptions {
132
137
  replace?: boolean;
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.240",
4
+ "version": "3.0.0-canary.242",
5
5
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/firecmsco"
@@ -50,9 +50,9 @@
50
50
  "./package.json": "./package.json"
51
51
  },
52
52
  "dependencies": {
53
- "@firecms/editor": "^3.0.0-canary.240",
54
- "@firecms/formex": "^3.0.0-canary.240",
55
- "@firecms/ui": "^3.0.0-canary.240",
53
+ "@firecms/editor": "^3.0.0-canary.242",
54
+ "@firecms/formex": "^3.0.0-canary.242",
55
+ "@firecms/ui": "^3.0.0-canary.242",
56
56
  "@hello-pangea/dnd": "^17.0.0",
57
57
  "@radix-ui/react-portal": "^1.1.3",
58
58
  "clsx": "^2.1.1",
@@ -105,7 +105,7 @@
105
105
  "dist",
106
106
  "src"
107
107
  ],
108
- "gitHead": "b5b46f7dfb9547324c71d839fff7d52bb3ef54ae",
108
+ "gitHead": "61c5737585c7126aadfb189c4f0c113943d001b0",
109
109
  "publishConfig": {
110
110
  "access": "public"
111
111
  },
@@ -749,6 +749,7 @@ export const EntityCollectionView = React.memo(
749
749
  equal(a.defaultSize, b.defaultSize) &&
750
750
  equal(a.initialFilter, b.initialFilter) &&
751
751
  equal(a.initialSort, b.initialSort) &&
752
+ equal(a.includeJsonView, b.includeJsonView) &&
752
753
  equal(a.textSearchEnabled, b.textSearchEnabled) &&
753
754
  equal(a.additionalFields, b.additionalFields) &&
754
755
  equal(a.sideDialogWidth, b.sideDialogWidth) &&
@@ -131,7 +131,8 @@ export const VirtualTable = React.memo<VirtualTableProps<any>>(
131
131
  // Set initial scroll position
132
132
  useEffect(() => {
133
133
  if (tableRef.current && initialScroll) {
134
- tableRef.current.scrollTo(0, initialScroll);
134
+ const { scrollLeft } = tableRef.current;
135
+ tableRef.current.scrollTo(scrollLeft, initialScroll);
135
136
  }
136
137
  }, [tableRef, initialScroll]);
137
138
 
@@ -66,7 +66,6 @@ export function VirtualTableInput(props: {
66
66
  width: "100%",
67
67
  color: "unset",
68
68
  fontWeight: "unset",
69
- lineHeight: 1.7142857,
70
69
  fontSize: "unset",
71
70
  fontFamily: "unset",
72
71
  background: "unset",
@@ -44,7 +44,7 @@ export function FireCMS<USER extends User>(props: FireCMSProps<USER>) {
44
44
  authController,
45
45
  storageSource,
46
46
  dataSourceDelegate,
47
- plugins,
47
+ plugins: pluginsProp,
48
48
  onAnalyticsEvent,
49
49
  propertyConfigs,
50
50
  entityViews,
@@ -53,6 +53,12 @@ export function FireCMS<USER extends User>(props: FireCMSProps<USER>) {
53
53
  apiKey
54
54
  } = props;
55
55
 
56
+ if (pluginsProp) {
57
+ console.warn("The `plugins` prop is deprecated in the FireCMS component. You should pass your plugins to `useBuildNavigationController` instead.");
58
+ }
59
+
60
+ const plugins = navigationController.plugins ?? pluginsProp;
61
+
56
62
  const sideDialogsController = useBuildSideDialogsController();
57
63
  const sideEntityController = useBuildSideEntityController(navigationController, sideDialogsController, authController);
58
64
 
@@ -141,7 +141,7 @@ export function MarkdownEditorFieldBinding({
141
141
  icon={getIconForProperty(property, "small")}
142
142
  required={property.validation?.required}
143
143
  title={property.name}
144
- className={"h-6 text-text-secondary dark:text-text-secondary-dark ml-3.5"}/>
144
+ className={"h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5"}/>
145
145
  <div
146
146
  className={cls("rounded-md", fieldBackgroundMixin, disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin)}>
147
147
  {editor}
@@ -84,7 +84,7 @@ export function MultiSelectFieldBinding({
84
84
  <MultiSelect
85
85
  className={"w-full mt-2"}
86
86
  size={size}
87
- value={validValue ? value.map((v) => v.toString()) : []}
87
+ value={validValue ? value.map((v) => v?.toString()) : []}
88
88
  disabled={disabled}
89
89
  modalPopover={true}
90
90
  label={<LabelWithIconAndTooltip
@@ -92,7 +92,7 @@ export function MultiSelectFieldBinding({
92
92
  icon={getIconForProperty(property, "small")}
93
93
  required={property.validation?.required}
94
94
  title={property.name}
95
- className={"h-6 text-text-secondary dark:text-text-secondary-dark ml-3.5"}/>}
95
+ className={"h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5"}/>}
96
96
  onValueChange={(updatedValue: string[]) => {
97
97
  let newValue: EnumType[] | null;
98
98
  if (of && (of as ResolvedProperty)?.dataType === "number") {
@@ -39,7 +39,7 @@ export function ReadOnlyFieldBinding({
39
39
  icon={getIconForProperty(property, "small")}
40
40
  required={property.validation?.required}
41
41
  title={property.name}
42
- className={"h-6 text-text-secondary dark:text-text-secondary-dark ml-3.5"}/>
42
+ className={"h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5"}/>
43
43
  }
44
44
 
45
45
  <div
@@ -90,7 +90,7 @@ function ReferenceFieldBindingInternal({
90
90
  icon={getIconForProperty(property, "small")}
91
91
  required={property.validation?.required}
92
92
  title={property.name}
93
- className={"h-6 text-text-secondary dark:text-text-secondary-dark ml-3.5"}/>}
93
+ className={"h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5"}/>}
94
94
 
95
95
  {!collection && <ErrorView
96
96
  error={"The specified collection does not exist. Check console"}/>}
@@ -62,13 +62,14 @@ export function SelectFieldBinding<T extends EnumType>({
62
62
  icon={getIconForProperty(property, "small")}
63
63
  required={property.validation?.required}
64
64
  title={property.name}
65
- className={"h-6 text-text-secondary dark:text-text-secondary-dark ml-3.5 my-0"}
65
+ className={"h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5 my-0"}
66
66
  />
67
67
  </PropertyIdCopyTooltip>}
68
68
  endAdornment={
69
69
  property.clearable && !disabled && <IconButton
70
+ size="small"
70
71
  onClick={handleClearClick}>
71
- <CloseIcon/>
72
+ <CloseIcon size={"small"}/>
72
73
  </IconButton>
73
74
  }
74
75
  onValueChange={(updatedValue: string) => {
@@ -413,6 +413,7 @@ export function useBuildNavigationController<EC extends EntityCollection, USER e
413
413
  getParentCollectionIds,
414
414
  convertIdsToPaths,
415
415
  navigate,
416
+ plugins
416
417
  };
417
418
  }
418
419
 
@@ -62,7 +62,7 @@ export function ImagePreview({
62
62
  title="Copy url to clipboard" side={"bottom"}>
63
63
  <IconButton
64
64
  variant={"filled"}
65
- size={"small"}
65
+ size={"smallest"}
66
66
  onClick={(e) => {
67
67
  e.stopPropagation();
68
68
  e.preventDefault();
@@ -81,7 +81,7 @@ export function ImagePreview({
81
81
  href={url}
82
82
  rel="noopener noreferrer"
83
83
  target="_blank"
84
- size={"small"}
84
+ size={"smallest"}
85
85
  onClick={(e: any) => e.stopPropagation()}
86
86
  >
87
87
  <OpenInNewIcon className={"text-surface-700 dark:text-surface-300"}
@@ -45,7 +45,7 @@ export function StringPropertyPreview({
45
45
  if (!value) return <></>;
46
46
  const lines = value.split("\n");
47
47
  return value && value.includes("\n")
48
- ? <div className={cls("overflow-x-scroll", size === "small" ? "text-sm" : "")}>
48
+ ? <div className={cls("overflow-x-scroll overflow-hidden", size === "small" ? "text-sm" : "")}>
49
49
  {lines.map((str, index) =>
50
50
  <React.Fragment key={`string_preview_${index}`}>
51
51
  <span>{str}</span>
@@ -128,7 +128,8 @@ export type FireCMSProps<USER extends User> = {
128
128
 
129
129
  /**
130
130
  * Use plugins to modify the behaviour of the CMS.
131
- * Currently, in ALPHA, and likely subject to change.
131
+ * DEPRECATED: use the `plugins` prop in the `useBuildNavigationController` instead.
132
+ * This prop will work as a fallback for the `plugins` prop in the `useBuildNavigationController`.
132
133
  */
133
134
  plugins?: FireCMSPlugin<any, any, any>[];
134
135
 
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { EntityCollection } from "./collections";
3
3
  import { EntityReference } from "./entities";
4
+ import { FireCMSPlugin } from "./plugins";
4
5
 
5
6
  /**
6
7
  * Controller that includes the resolved navigation and utility methods and
@@ -152,6 +153,11 @@ export type NavigationController<EC extends EntityCollection = EntityCollection<
152
153
  */
153
154
  navigate: (to: string, options?: NavigateOptions) => void;
154
155
 
156
+ /**
157
+ * Plugin system allowing to extend the CMS functionality.
158
+ */
159
+ plugins?: FireCMSPlugin<any, any, any>[];
160
+
155
161
  }
156
162
 
157
163
  export interface NavigateOptions {