@firecms/core 3.0.0-canary.127 → 3.0.0-canary.128

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/index.umd.js CHANGED
@@ -13037,7 +13037,7 @@
13037
13037
  }
13038
13038
  ) });
13039
13039
  }
13040
- function DeleteConfirmationDialog({
13040
+ function ConfirmationDialog({
13041
13041
  open,
13042
13042
  onAccept,
13043
13043
  onCancel,
@@ -13572,7 +13572,7 @@
13572
13572
  return /* @__PURE__ */ jsxRuntime.jsx(
13573
13573
  "div",
13574
13574
  {
13575
- className: `pl-2 pt-1 pb-4 flex ${direction === "row" ? "flex-row-reverse" : "flex-col"} items-center`,
13575
+ className: `pl-2 pt-1 pb-1 flex ${direction === "row" ? "flex-row-reverse" : "flex-col"} items-center`,
13576
13576
  ref: iconRef,
13577
13577
  ...provided.dragHandleProps,
13578
13578
  children: /* @__PURE__ */ jsxRuntime.jsxs(
@@ -19060,7 +19060,7 @@
19060
19060
  };
19061
19061
  }
19062
19062
  const DEFAULT_SERVER = "https://api-drplyi3b6q-ey.a.run.app";
19063
- async function makeRequest(authController, dataSourceKey, pluginKeys) {
19063
+ async function makeRequest(authController, dataSourceKey, pluginKeys, apiKey) {
19064
19064
  let idToken;
19065
19065
  try {
19066
19066
  idToken = await authController.getAuthToken();
@@ -19077,6 +19077,7 @@
19077
19077
  Authorization: `Basic ${idToken}`
19078
19078
  },
19079
19079
  body: JSON.stringify({
19080
+ apiKey,
19080
19081
  email: authController.user?.email ?? null,
19081
19082
  datasource: dataSourceKey,
19082
19083
  plugins: pluginKeys
@@ -19086,14 +19087,19 @@
19086
19087
  return res.json();
19087
19088
  });
19088
19089
  }
19089
- function useProjectLog(authController, dataSourceDelegate, plugins) {
19090
+ function useProjectLog({
19091
+ authController,
19092
+ dataSourceDelegate,
19093
+ plugins,
19094
+ apiKey
19095
+ }) {
19090
19096
  const [accessResponse, setAccessResponse] = React.useState(null);
19091
19097
  const accessedUserRef = React.useRef(null);
19092
19098
  const dataSourceKey = dataSourceDelegate.key;
19093
19099
  const pluginKeys = plugins?.map((plugin) => plugin.key);
19094
19100
  React.useEffect(() => {
19095
19101
  if (authController.user && authController.user.uid !== accessedUserRef.current && !authController.initialLoading) {
19096
- makeRequest(authController, dataSourceKey, pluginKeys).then(setAccessResponse);
19102
+ makeRequest(authController, dataSourceKey, pluginKeys, apiKey).then(setAccessResponse);
19097
19103
  accessedUserRef.current = authController.user.uid;
19098
19104
  }
19099
19105
  }, [authController, dataSourceKey, pluginKeys]);
@@ -19114,7 +19120,8 @@
19114
19120
  propertyConfigs,
19115
19121
  entityViews,
19116
19122
  components,
19117
- navigationController
19123
+ navigationController,
19124
+ apiKey
19118
19125
  } = props;
19119
19126
  ui.useLocaleConfig(locale);
19120
19127
  const dataSource = useBuildDataSource({
@@ -19138,7 +19145,15 @@
19138
19145
  const analyticsController = React.useMemo(() => ({
19139
19146
  onAnalyticsEvent
19140
19147
  }), []);
19141
- const accessResponse = useProjectLog(authController, dataSourceDelegate, plugins);
19148
+ const accessResponse = useProjectLog({
19149
+ apiKey,
19150
+ authController,
19151
+ dataSourceDelegate,
19152
+ plugins
19153
+ });
19154
+ if (accessResponse?.message) {
19155
+ console.warn(accessResponse.message);
19156
+ }
19142
19157
  if (navigationController.navigationLoadingError) {
19143
19158
  return /* @__PURE__ */ jsxRuntime.jsx(ui.CenteredView, { maxWidth: "md", children: /* @__PURE__ */ jsxRuntime.jsx(
19144
19159
  ErrorView,
@@ -19158,10 +19173,10 @@
19158
19173
  ) });
19159
19174
  }
19160
19175
  if (accessResponse?.blocked) {
19161
- return /* @__PURE__ */ jsxRuntime.jsxs(ui.CenteredView, { maxWidth: "md", fullScreen: true, children: [
19162
- /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "h4", children: "Access blocked" }),
19176
+ return /* @__PURE__ */ jsxRuntime.jsxs(ui.CenteredView, { maxWidth: "md", fullScreen: true, className: "flex flex-col gap-2", children: [
19177
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "h4", gutterBottom: true, children: "License needed" }),
19163
19178
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { children: [
19164
- "This app has been blocked. Please reach out at ",
19179
+ "You need a valid license to use FireCMS PRO. Please reach out at ",
19165
19180
  /* @__PURE__ */ jsxRuntime.jsx(
19166
19181
  "a",
19167
19182
  {
@@ -19171,10 +19186,7 @@
19171
19186
  ),
19172
19187
  " for more information."
19173
19188
  ] }),
19174
- accessResponse?.message && /* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { children: [
19175
- "Response from the server: ",
19176
- accessResponse?.message
19177
- ] })
19189
+ accessResponse?.message && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { children: accessResponse?.message })
19178
19190
  ] });
19179
19191
  }
19180
19192
  return /* @__PURE__ */ jsxRuntime.jsx(AnalyticsContext.Provider, { value: analyticsController, children: /* @__PURE__ */ jsxRuntime.jsx(CustomizationControllerContext.Provider, { value: customizationController, children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -19806,6 +19818,7 @@
19806
19818
  exports2.BooleanPreview = BooleanPreview;
19807
19819
  exports2.COLLECTION_PATH_SEPARATOR = COLLECTION_PATH_SEPARATOR;
19808
19820
  exports2.CircularProgressCenter = CircularProgressCenter;
19821
+ exports2.ConfirmationDialog = ConfirmationDialog;
19809
19822
  exports2.DEFAULT_FIELD_CONFIGS = DEFAULT_FIELD_CONFIGS;
19810
19823
  exports2.DRAWER_WIDTH = DRAWER_WIDTH;
19811
19824
  exports2.DatePreview = DatePreview;
@@ -19813,7 +19826,6 @@
19813
19826
  exports2.DefaultAppBar = DefaultAppBar;
19814
19827
  exports2.DefaultDrawer = DefaultDrawer;
19815
19828
  exports2.DefaultHomePage = DefaultHomePage;
19816
- exports2.DeleteConfirmationDialog = DeleteConfirmationDialog;
19817
19829
  exports2.Drawer = Drawer;
19818
19830
  exports2.DrawerLogo = DrawerLogo;
19819
19831
  exports2.DrawerNavigationItem = DrawerNavigationItem;