@firecms/core 3.0.0-canary.223 → 3.0.0-canary.225

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
@@ -21077,7 +21077,7 @@
21077
21077
  ] });
21078
21078
  }
21079
21079
  function EntityJsonPreview(t0) {
21080
- const $ = reactCompilerRuntime.c(9);
21080
+ const $ = reactCompilerRuntime.c(6);
21081
21081
  const {
21082
21082
  values
21083
21083
  } = t0;
@@ -21094,55 +21094,16 @@
21094
21094
  mode
21095
21095
  } = useModeController();
21096
21096
  const preRef = React.useRef(null);
21097
- let t2;
21098
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
21099
- t2 = (e) => {
21100
- if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "a") {
21101
- if (preRef.current) {
21102
- e.preventDefault();
21103
- e.stopPropagation();
21104
- const selection = window.getSelection();
21105
- const range = document.createRange();
21106
- range.selectNodeContents(preRef.current);
21107
- if (selection) {
21108
- selection.removeAllRanges();
21109
- selection.addRange(range);
21110
- }
21111
- }
21112
- }
21113
- };
21114
- $[2] = t2;
21115
- } else {
21116
- t2 = $[2];
21117
- }
21118
- const handleGlobalKeyDown = t2;
21097
+ const t2 = mode === "dark" ? prismReactRenderer.themes.vsDark : prismReactRenderer.themes.github;
21119
21098
  let t3;
21120
- let t4;
21121
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
21122
- t3 = () => {
21123
- document.addEventListener("keydown", handleGlobalKeyDown);
21124
- return () => {
21125
- document.removeEventListener("keydown", handleGlobalKeyDown);
21126
- };
21127
- };
21128
- t4 = [handleGlobalKeyDown];
21129
- $[3] = t3;
21130
- $[4] = t4;
21131
- } else {
21132
- t3 = $[3];
21133
- t4 = $[4];
21134
- }
21135
- React.useEffect(t3, t4);
21136
- const t5 = mode === "dark" ? prismReactRenderer.themes.vsDark : prismReactRenderer.themes.github;
21137
- let t6;
21138
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
21139
- t6 = (t72) => {
21099
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
21100
+ t3 = (t42) => {
21140
21101
  const {
21141
21102
  style,
21142
21103
  tokens,
21143
21104
  getLineProps,
21144
21105
  getTokenProps
21145
- } = t72;
21106
+ } = t42;
21146
21107
  return /* @__PURE__ */ jsxRuntime.jsx("pre", { ref: preRef, style: {
21147
21108
  ...style,
21148
21109
  backgroundColor: "inherit"
@@ -21152,20 +21113,20 @@
21152
21113
  token
21153
21114
  }), className: "word-break" }, key)) }, i)) });
21154
21115
  };
21155
- $[5] = t6;
21116
+ $[2] = t3;
21156
21117
  } else {
21157
- t6 = $[5];
21118
+ t3 = $[2];
21158
21119
  }
21159
- let t7;
21160
- if ($[6] !== code || $[7] !== t5) {
21161
- t7 = /* @__PURE__ */ jsxRuntime.jsx(prismReactRenderer.Highlight, { theme: t5, code, language: "json", children: t6 });
21162
- $[6] = code;
21163
- $[7] = t5;
21164
- $[8] = t7;
21120
+ let t4;
21121
+ if ($[3] !== code || $[4] !== t2) {
21122
+ t4 = /* @__PURE__ */ jsxRuntime.jsx(prismReactRenderer.Highlight, { theme: t2, code, language: "json", children: t3 });
21123
+ $[3] = code;
21124
+ $[4] = t2;
21125
+ $[5] = t4;
21165
21126
  } else {
21166
- t7 = $[8];
21127
+ t4 = $[5];
21167
21128
  }
21168
- return t7;
21129
+ return t4;
21169
21130
  }
21170
21131
  function createFormexStub(values) {
21171
21132
  const errorMessage = "You are in a read-only context. You cannot modify the formex controller.";
@@ -21379,10 +21340,10 @@
21379
21340
  });
21380
21341
  }
21381
21342
  };
21382
- const entityReadOnlyView = /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cls("flex-1 flex flex-row w-full overflow-y-auto justify-center", canEdit || !mainViewVisible || selectedSecondaryForm ? "hidden" : ""), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("relative flex flex-col max-w-4xl lg:max-w-3xl xl:max-w-4xl 2xl:max-w-6xl w-full h-fit"), children: [
21343
+ const entityReadOnlyView = !canEdit && entity ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cls("flex-1 flex flex-row w-full overflow-y-auto justify-center", canEdit || !mainViewVisible || selectedSecondaryForm ? "hidden" : ""), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("relative flex flex-col max-w-4xl lg:max-w-3xl xl:max-w-4xl 2xl:max-w-6xl w-full h-fit"), children: [
21383
21344
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { className: "mt-16 mb-8 mx-8", variant: "h4", children: collection.singularName ?? collection.name }),
21384
21345
  /* @__PURE__ */ jsxRuntime.jsx(EntityView, { className: "px-8 h-full overflow-auto", entity, path, collection })
21385
- ] }) });
21346
+ ] }) }) : null;
21386
21347
  const entityView = /* @__PURE__ */ jsxRuntime.jsx(EntityForm, { collection, path, entityId: entityId ?? usedEntity?.id, onValuesModified, entity, initialDirtyValues: cachedDirtyValues, openEntityMode: layout, forceActionsAtTheBottom: actionsAtTheBottom, initialStatus: status, className: ui.cls((!mainViewVisible || !canEdit) && !selectedSecondaryForm ? "hidden" : "", formProps?.className), EntityFormActionsComponent: EntityEditViewFormActions, disabled: !canEdit, ...formProps, onEntityChange: (entity_0) => {
21387
21348
  setUsedEntity(entity_0);
21388
21349
  formProps?.onEntityChange?.(entity_0);