@firecms/core 3.0.0-canary.288 → 3.0.0-canary.289

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
@@ -6670,7 +6670,7 @@
6670
6670
  const isArrayOrMap = childProperty.dataType === "map" || childProperty === "array";
6671
6671
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls(ui.defaultBorderMixin, "last:border-b-0 border-b"), children: [
6672
6672
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row pt-0.5 pb-0.5 gap-2", children: [
6673
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-[140px] w-[25%] py-1", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "font-mono break-words", color: "secondary", children: childProperty.name }) }),
6673
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-[140px] w-[25%] py-1", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "break-words font-semibold", color: "secondary", children: childProperty.name }) }),
6674
6674
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-grow max-w-[75%]", children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: !isArrayOrMap && /* @__PURE__ */ jsxRuntime.jsx(PropertyPreview, { propertyKey: key_0, value: value[key_0], property: childProperty, size }) }) })
6675
6675
  ] }),
6676
6676
  isArrayOrMap && /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cls(ui.defaultBorderMixin, "border-l pl-4 ml-2 my-2"), children: /* @__PURE__ */ jsxRuntime.jsx(PropertyPreview, { propertyKey: key_0, value: value[key_0], property: childProperty, size }) })
@@ -6726,7 +6726,7 @@
6726
6726
  const [key, childValue] = t0;
6727
6727
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls(ui.defaultBorderMixin, "last:border-b-0 border-b"), children: [
6728
6728
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row pt-0.5 pb-0.5 gap-2", children: [
6729
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-[140px] w-[25%] py-1", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "font-mono break-words", color: "secondary", children: key }) }, `table-cell-title-${key}-${key}`),
6729
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-[140px] w-[25%] py-1", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", className: "font-semibold break-words", color: "secondary", children: key }) }, `table-cell-title-${key}-${key}`),
6730
6730
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-grow max-w-[75%]", children: childValue && typeof childValue !== "object" && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: childValue.toString() }) }) })
6731
6731
  ] }),
6732
6732
  typeof childValue === "object" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cls(ui.defaultBorderMixin, "border-l pl-4"), children: /* @__PURE__ */ jsxRuntime.jsx(KeyValuePreview, { value: childValue }) })
@@ -10263,6 +10263,7 @@
10263
10263
  const uncollapsedActions = actions.filter((a_1) => a_1.collapsed === false);
10264
10264
  const enableLocalChangesBackup = collection ? getLocalChangesBackup(collection) : false;
10265
10265
  const hasDraft = enableLocalChangesBackup ? getEntityFromCache(fullPath + "/" + entity.id) : false;
10266
+ const iconSize = largeLayout && (size === "m" || size === "l" || size == "xl") ? "medium" : "small";
10266
10267
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("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", frozen ? "sticky left-0" : ""), onClick: React.useCallback((event) => {
10267
10268
  event.stopPropagation();
10268
10269
  }, []), style: {
@@ -10272,23 +10273,31 @@
10272
10273
  contain: "strict"
10273
10274
  }, children: [
10274
10275
  (hasActions || selectionEnabled) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-34 flex justify-center", children: [
10275
- uncollapsedActions.map((action, index) => /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: action.name, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { onClick: (event_0) => {
10276
- event_0.stopPropagation();
10277
- action.onClick({
10278
- view: "collection",
10279
- entity,
10280
- fullPath,
10281
- fullIdPath,
10282
- collection,
10283
- context,
10284
- selectionController,
10285
- highlightEntity,
10286
- unhighlightEntity,
10287
- onCollectionChange,
10288
- openEntityMode: openEntityMode ?? collection?.openEntityMode
10289
- });
10290
- }, size: largeLayout ? "medium" : "small", children: action.icon }) }, index)),
10291
- hasCollapsedActions && /* @__PURE__ */ jsxRuntime.jsx(ui.Menu, { trigger: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: largeLayout ? "medium" : "small", children: /* @__PURE__ */ jsxRuntime.jsx(ui.MoreVertIcon, {}) }), children: collapsedActions.map((action_0, index_0) => /* @__PURE__ */ jsxRuntime.jsxs(ui.MenuItem, { onClick: (e) => {
10276
+ uncollapsedActions.map((action, index) => {
10277
+ const isEditAction = action.key === "edit";
10278
+ const tooltip = isEditAction && hasDraft ? "Local unsaved changes" : action.name;
10279
+ let iconButton = /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { onClick: (event_0) => {
10280
+ event_0.stopPropagation();
10281
+ action.onClick({
10282
+ view: "collection",
10283
+ entity,
10284
+ fullPath,
10285
+ fullIdPath,
10286
+ collection,
10287
+ context,
10288
+ selectionController,
10289
+ highlightEntity,
10290
+ unhighlightEntity,
10291
+ onCollectionChange,
10292
+ openEntityMode: openEntityMode ?? collection?.openEntityMode
10293
+ });
10294
+ }, size: iconSize, children: action.icon });
10295
+ if (isEditAction && hasDraft) {
10296
+ iconButton = /* @__PURE__ */ jsxRuntime.jsx(ui.Badge, { color: "warning", children: iconButton });
10297
+ }
10298
+ return /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: tooltip, asChild: true, children: iconButton }, index);
10299
+ }),
10300
+ hasCollapsedActions && /* @__PURE__ */ jsxRuntime.jsx(ui.Menu, { trigger: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: iconSize, children: /* @__PURE__ */ jsxRuntime.jsx(ui.MoreVertIcon, {}) }), children: collapsedActions.map((action_0, index_0) => /* @__PURE__ */ jsxRuntime.jsxs(ui.MenuItem, { onClick: (e) => {
10292
10301
  e.stopPropagation();
10293
10302
  action_0.onClick({
10294
10303
  view: "collection",
@@ -10307,14 +10316,11 @@
10307
10316
  action_0.icon,
10308
10317
  action_0.name
10309
10318
  ] }, index_0)) }),
10310
- selectionEnabled && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: `Select ${entity.id}`, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Checkbox, { size: largeLayout ? "medium" : "small", checked: Boolean(isSelected), onCheckedChange }) })
10319
+ selectionEnabled && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: `Select ${entity.id}`, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Checkbox, { size: iconSize, checked: Boolean(isSelected), onCheckedChange }) })
10311
10320
  ] }),
10312
- !hideId && size !== "xs" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-[138px] overflow-hidden truncate font-mono text-xs text-text-secondary dark:text-text-secondary-dark max-w-full text-ellipsis px-2 align-center justify-center flex items-center gap-1", onClick: (event_1) => {
10321
+ !hideId && size !== "xs" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[138px] overflow-hidden truncate font-mono text-xs text-text-secondary dark:text-text-secondary-dark max-w-full text-ellipsis px-2 align-center justify-center flex items-center gap-1", onClick: (event_1) => {
10313
10322
  event_1.stopPropagation();
10314
- }, children: [
10315
- hasDraft && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Local unsaved changes", className: "inline", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Chip, { colorScheme: "orangeDarker", className: "p-0.5", children: /* @__PURE__ */ jsxRuntime.jsx(ui.EditIcon, { size: 12 }) }) }),
10316
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate text-center", children: entity ? entity.id : /* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, {}) })
10317
- ] })
10323
+ }, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate text-center", children: entity ? entity.id : /* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, {}) }) })
10318
10324
  ] });
10319
10325
  };
10320
10326
  function CollectionTableToolbar(t0) {