@rebasepro/cms 0.21.2-canary.g1ea48be → 0.22.0

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.
@@ -6285,10 +6285,24 @@ var CollectionRowActions = function CollectionRowActions({ entity, collection, p
6285
6285
  const context = useAdminContext();
6286
6286
  const sidePanelCtrl = context.sidePanelController;
6287
6287
  const { t } = useTranslation();
6288
+ const slotActions = useSlot("entity.row.actions", React.useMemo(() => ({
6289
+ entity,
6290
+ entityId: entity.id,
6291
+ path,
6292
+ collection,
6293
+ selectionController,
6294
+ context
6295
+ }), [
6296
+ entity,
6297
+ path,
6298
+ collection,
6299
+ selectionController,
6300
+ context
6301
+ ]));
6288
6302
  const onCheckedChange = useCallback((checked) => {
6289
6303
  selectionController?.toggleEntitySelection(entity, checked);
6290
6304
  }, [entity, selectionController?.toggleEntitySelection]);
6291
- const hasActions = actions.length > 0;
6305
+ const hasActions = actions.length > 0 || slotActions.length > 0;
6292
6306
  const hasCollapsedActions = actions.some((a) => a.collapsed || a.collapsed === void 0);
6293
6307
  const collapsedActions = actions.filter((a) => a.collapsed || a.collapsed === void 0);
6294
6308
  const uncollapsedActions = actions.filter((a) => a.collapsed === false);
@@ -6341,6 +6355,7 @@ var CollectionRowActions = function CollectionRowActions({ entity, collection, p
6341
6355
  children: iconButton
6342
6356
  }, index);
6343
6357
  }),
6358
+ slotActions,
6344
6359
  hasCollapsedActions && /* @__PURE__ */ jsx(Menu, {
6345
6360
  trigger: /* @__PURE__ */ jsx(IconButton, {
6346
6361
  size: iconSize,
@@ -9911,8 +9926,8 @@ function EditorCollectionAction({ path, parentCollectionSlugs, parentEntityIds,
9911
9926
  }
9912
9927
  //#endregion
9913
9928
  //#region src/components/CollectionViewBinding/CollectionViewActions.tsx
9914
- var ImportCollectionAction = lazyChunk(() => import("./import-ByaJMZuT.js").then((n) => n.t).then((m) => ({ default: m.ImportCollectionAction })));
9915
- var ExportCollectionAction = lazyChunk(() => import("./export-DIyk1720.js").then((n) => n.t).then((m) => ({ default: m.ExportCollectionAction })));
9929
+ var ImportCollectionAction = lazyChunk(() => import("./import-Cxnmpyjl.js").then((n) => n.t).then((m) => ({ default: m.ImportCollectionAction })));
9930
+ var ExportCollectionAction = lazyChunk(() => import("./export-LvIpE7sE.js").then((n) => n.t).then((m) => ({ default: m.ExportCollectionAction })));
9916
9931
  function CollectionViewActions({ collection, relativePath, parentCollectionSlugs, parentEntityIds, onNewClick, onAddExistingClick, onMultipleDeleteClick, selectionEnabled, path, selectionController, tableController, collectionEntitiesCount, compact, children, openNewDocument }) {
9917
9932
  const context = useAdminContext();
9918
9933
  const { canCreate, canDelete } = usePermissions();
@@ -12273,7 +12288,7 @@ function SplitListShowButton({ onClick }) {
12273
12288
  }
12274
12289
  //#endregion
12275
12290
  //#region src/components/EntityInspector.tsx
12276
- var EntityHistoryView = lazyChunk(() => import("./history-CrZEzQ5b.js").then((m) => ({ default: m.EntityHistoryView })));
12291
+ var EntityHistoryView = lazyChunk(() => import("./history-DG6Ln7CV.js").then((m) => ({ default: m.EntityHistoryView })));
12277
12292
  /**
12278
12293
  * The JSON tab pulls `prism-react-renderer` — 85 kB, and it was EAGER.
12279
12294
  *
@@ -23387,6 +23402,24 @@ function PropertyFieldBindingInternal({ propertyKey, property, context, includeD
23387
23402
  }
23388
23403
  function FieldInternal({ Component, componentProps: { propertyKey, property, includeDescription, hideLabel, underlyingValueHasChanged, partOfArray, partOfBlock, minimalistView, autoFocus, context, disabled, size, onPropertyChange }, formexFieldProps }) {
23389
23404
  const { plugins } = useCustomizationController();
23405
+ const rebaseContext = useRebaseContext();
23406
+ const fieldSlotProps = React.useMemo(() => ({
23407
+ propertyKey,
23408
+ property,
23409
+ path: context.path ?? "",
23410
+ entityId: context.entityId,
23411
+ collection: context.collection,
23412
+ context: rebaseContext
23413
+ }), [
23414
+ propertyKey,
23415
+ property,
23416
+ context.path,
23417
+ context.entityId,
23418
+ context.collection,
23419
+ rebaseContext
23420
+ ]);
23421
+ const beforeField = useSlot("entity.field.before", fieldSlotProps);
23422
+ const afterField = useSlot("entity.field.after", fieldSlotProps);
23390
23423
  const customFieldProps = property.admin?.customProps;
23391
23424
  const value = formexFieldProps.field.value;
23392
23425
  const error = getIn(formexFieldProps.form.errors, propertyKey);
@@ -23401,42 +23434,47 @@ function FieldInternal({ Component, componentProps: { propertyKey, property, inc
23401
23434
  plugins
23402
23435
  }) ?? Component;
23403
23436
  const isSubmitting = formexFieldProps.form.isSubmitting;
23404
- return /* @__PURE__ */ jsxs(ErrorBoundary, { children: [/* @__PURE__ */ jsx(Suspense, {
23405
- fallback: null,
23406
- children: /* @__PURE__ */ jsx(UsedComponent, {
23407
- propertyKey,
23408
- value,
23409
- setValue: useCallback((value, shouldValidate) => {
23410
- formexFieldProps.form.setFieldTouched(propertyKey, true, false);
23411
- formexFieldProps.form.setFieldValue(propertyKey, value, shouldValidate);
23412
- }, []),
23413
- setFieldValue: useCallback((otherPropertyKey, value, shouldValidate) => {
23414
- formexFieldProps.form.setFieldTouched(propertyKey, true, false);
23415
- formexFieldProps.form.setFieldValue(otherPropertyKey, value, shouldValidate);
23416
- }, []),
23417
- error,
23418
- touched,
23419
- showError,
23420
- isSubmitting,
23421
- includeDescription: includeDescription ?? true,
23422
- hideLabel: hideLabel ?? false,
23423
- property,
23424
- disabled: disabled ?? false,
23425
- underlyingValueHasChanged: underlyingValueHasChanged ?? false,
23426
- partOfArray: partOfArray ?? false,
23427
- partOfBlock: partOfBlock ?? false,
23428
- minimalistView: minimalistView ?? false,
23429
- autoFocus: autoFocus ?? false,
23430
- customProps: customFieldProps,
23431
- context,
23432
- size,
23433
- onPropertyChange
23437
+ return /* @__PURE__ */ jsxs(ErrorBoundary, { children: [
23438
+ beforeField,
23439
+ /* @__PURE__ */ jsx(Suspense, {
23440
+ fallback: null,
23441
+ children: /* @__PURE__ */ jsx(UsedComponent, {
23442
+ propertyKey,
23443
+ value,
23444
+ setValue: useCallback((value, shouldValidate) => {
23445
+ formexFieldProps.form.setFieldTouched(propertyKey, true, false);
23446
+ formexFieldProps.form.setFieldValue(propertyKey, value, shouldValidate);
23447
+ }, []),
23448
+ setFieldValue: useCallback((otherPropertyKey, value, shouldValidate) => {
23449
+ formexFieldProps.form.setFieldTouched(propertyKey, true, false);
23450
+ formexFieldProps.form.setFieldValue(otherPropertyKey, value, shouldValidate);
23451
+ }, []),
23452
+ error,
23453
+ touched,
23454
+ showError,
23455
+ isSubmitting,
23456
+ includeDescription: includeDescription ?? true,
23457
+ hideLabel: hideLabel ?? false,
23458
+ property,
23459
+ disabled: disabled ?? false,
23460
+ underlyingValueHasChanged: underlyingValueHasChanged ?? false,
23461
+ partOfArray: partOfArray ?? false,
23462
+ partOfBlock: partOfBlock ?? false,
23463
+ minimalistView: minimalistView ?? false,
23464
+ autoFocus: autoFocus ?? false,
23465
+ customProps: customFieldProps,
23466
+ context,
23467
+ size,
23468
+ onPropertyChange
23469
+ })
23470
+ }),
23471
+ afterField,
23472
+ underlyingValueHasChanged && !isSubmitting && /* @__PURE__ */ jsx(Typography, {
23473
+ variant: "caption",
23474
+ className: "ml-3.5",
23475
+ children: "This value has been updated elsewhere"
23434
23476
  })
23435
- }), underlyingValueHasChanged && !isSubmitting && /* @__PURE__ */ jsx(Typography, {
23436
- variant: "caption",
23437
- className: "ml-3.5",
23438
- children: "This value has been updated elsewhere"
23439
- })] });
23477
+ ] });
23440
23478
  }
23441
23479
  var shouldPropertyReRender = (property, plugins) => {
23442
23480
  if (plugins?.some((plugin) => plugin.fieldBuilder)) return true;
@@ -25622,4 +25660,4 @@ function getFullIdPath(propertyKey, propertyNamespace) {
25622
25660
  //#endregion
25623
25661
  export { NAVIGATION_DEFAULT_GROUP_NAME as $, CollectionRegistryContext as $n, getCollectionBySlugWithin as $t, getFieldId as A, ReadOnlyFieldBinding as An, getIconForWidget as Ar, convertDataToEntity as At, MapFieldBinding as B, MapPropertyPreview as Bn, detectCsvDelimiter as Bt, EntityFormBinding as C, NavigationStateContext as Cn, LABEL_ICON_SIZE as Cr, EntityCardBinding as Ct, getDefaultFieldConfig as D, SelectableTableContext as Dn, getBracketNotation as Dr, useCollectionEditorDialogsState as Dt, DEFAULT_FIELD_CONFIGS as E, SideDialogsControllerContext as En, PropertyKeyHint as Er, ConfigControllerProvider as Et, SelectFieldBinding as F, UserPreview as Fn, isRelationProperty as Fr, ImportSaveInProgress as Ft, useSelectionDialog as G, ArrayOfStorageComponentsPreview as Gn, SearchIconsView as Gt, DateTimeFieldBinding as H, ArrayOfStringsPreview as Hn, parseCsvToObjects as Ht, RepeatFieldBinding as I, NumberPropertyPreview as In, IMPORT_BATCH_SIZE as It, useBuildUrlController as J, InlineEntityListPreview as Jn, BreadcrumbsProvider as Jt, SelectionTableBinding as K, RelationPreview as Kn, FieldCaption as Kt, ReferenceFieldBinding as L, BooleanPreview as Ln, saveImportedEntities as Lt, TextFieldBinding as M, FieldHelperText as Mn, getPropertyInPath$1 as Mr, processValueMapping as Mt, SwitchFieldBinding as N, ArrayOfMapsPreview as Nn, getResolvedPropertyInPath as Nr, getInferenceType as Nt, getDefaultFieldId as O, ArrayCustomShapedFieldBinding as On, getDefaultPropertiesOrder as Or, ImportNewPropertyFieldPreview as Ot, StorageUploadFieldBinding as P, PropertyPreview as Pn, isReferenceProperty as Pr, useImportConfig as Pt, useResolvedCollections as Q, useSidePanel as Qn, addInitialSlash as Qt, MultiSelectFieldBinding as R, DatePreview as Rn, ImportFileUpload as Rt, isSchemaChangeCancelled as S, useUrlController as Sn, FieldBlock as Sr, CollectionCardViewBinding as St, PropertyFieldBinding as T, useSideDialogsController as Tn, spanClass as Tr, useCollectionEditorController as Tt, BlockFieldBinding as U, ArrayPropertyEnumPreview as Un, ArrayContainer as Ut, KeyValueFieldBinding as V, ArrayOneOfPreview as Vn, parseCsvRows as Vt, ArrayOfReferencesFieldBinding as W, ArrayEnumPreview as Wn, PropertyConfigBadge as Wt, useTopLevelNavigation as X, EntityPreviewBinding as Xn, resolveEntityView as Xt, useBuildNavigationStateController as Y, ReferencePreview as Yn, resolveEntityAction as Yt, useResolvedViews as Z, SidePanelControllerContext as Zn, mergeEntityActions as Zt, useCollectionsConfigController as _, CollectionTableBinding as _n, ImagePreview as _r, editEntityAction as _t, namespaceToPropertiesPath as a, resolveCollectionPathIds$1 as an, getEntityTitlePropertyKeyForEntity as ar, getEntityViewWidth as at, asUnavailable as b, useAdminContext as bn, FormRail as br, DetailViewBinding as bt, buildCollectionGenerationCallback as c, SelectionMenu as cn, EnumValuesChip as cr, useSafeSnackbarController as ct, fromSerializableCollectionConfigs as d, resolveSelection as dn, SkeletonPropertyComponent as dr, getInitialEntityValues as dt, getCollectionPathsCombinations as en, useCollectionRegistryController as er, useBuildCollectionRegistryController as et, fromSerializableProperties as f, selectionQueryToFindParams as fn, renderSkeletonCaptionText as fr, removeEmptyContainers as ft, toSerializableProperty as g, VirtualTableInput$1 as gn, UrlComponentPreview as gr, deleteEntityAction as gt, toSerializableProperties as h, useSelectionController as hn, renderSkeletonText as hr, copyEntityAction as ht, namespaceToPropertiesOrderPath as i, removeTrailingSlash$1 as in, getEntityTitlePropertyKey as ir, buildSidePanelsFromUrl as it, VectorFieldBinding as j, LabelWithIcon as jn, getPropertiesWithPropertiesOrder as jr, flattenEntry as jt, getFieldConfig as k, useClearRestoreValue as kn, getIconForProperty as kr, DataNewPropertiesMapping as kt, validateCollectionJson as l, MAX_SELECTION_ROWS as ln, StorageThumbnail as lr, extractTouchedValues as lt, toSerializableCollectionConfig as m, walkEntityPages as mn, renderSkeletonImageThumbnail as mr, CollectionViewBinding as mt, getFullIdPath as n, removeInitialAndTrailingSlashes$1 as nn, useResolvedUser as nr, resolveNavigationFrom as nt, CollectionGenerationApiError as o, resolveOpenEntityMode as on, ArrayPropertyPreview as or, useBuildSidePanel as ot, fromSerializableProperty as p, serializeSelectionQuery as pn, renderSkeletonIcon as pr, zodToFormErrors as pt, SideDialogs as q, ArrayOfReferencesPreview as qn, useBreadcrumbsController as qt, idToPropertiesPath as r, removeInitialSlash as rn, getEntityPreviewKeys as rr, useResolvedNavigationFrom as rt, DEFAULT_COLLECTION_GENERATION_ENDPOINT as s, resolveViewMode as sn, StringPropertyPreview as sr, EditViewBinding as st, getFullId as t, getLastSegment$1 as tn, getUserLabel as tr, useHistory as tt, fromSerializableCollectionConfig as u, SELECTION_PAGE_SIZE as un, StorageThumbnailInternal as ur, getChanges as ut, LiveSchemaError as v, SelectableTable as vn, EmptyValue as vr, resetPasswordAction as vt, EntityForm as w, useNavigationStateController as wn, isSelfLabellingProperty as wr, CollectionViewActions as wt, createLiveSchemaClient as x, UrlContext as xn, RecordMeta as xr, EntityViewBinding as xt, SchemaChangeCancelled as y, CollectionRowActions as yn, FormSections as yr, CreationResultDialog as yt, MarkdownEditorFieldBinding as z, KeyValuePreview as zn, convertFileToJson as zt };
25624
25662
 
25625
- //# sourceMappingURL=util-qfCPxJzB.js.map
25663
+ //# sourceMappingURL=util-CyIcgnv2.js.map