@manifest-editor/shell 1.4.1 → 1.4.2

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.cjs CHANGED
@@ -3009,11 +3009,18 @@ function BaseEditor({ currentTab = void 0 }) {
3009
3009
  const resource = useEditingResource();
3010
3010
  const currentResourceContext = (0, import_react21.useContext)(import_react_iiif_vault9.ResourceReactContext);
3011
3011
  const app = useApp();
3012
+ const rootResource = useAppResource();
3012
3013
  const vault = (0, import_react_iiif_vault9.useVault)();
3013
3014
  const { change } = useLayoutActions();
3014
3015
  const set = useSetCustomTitle();
3015
3016
  const { editorConfig } = useConfig();
3016
- const resourceConfig = (resource?.resource.source?.type ? editorConfig[resource?.resource.source?.type] : editorConfig.All) || {};
3017
+ const resourceId = resource?.resource.source?.id;
3018
+ let resourceType = resource?.resource.source?.type;
3019
+ const isNested = resourceId !== rootResource.id;
3020
+ if (resourceId && isNested && rootResource.type === "Collection" && resourceType === "Collection") {
3021
+ resourceType = "EmbeddedCollection";
3022
+ }
3023
+ const resourceConfig = (resourceType ? editorConfig[resourceType] : editorConfig.All) || {};
3017
3024
  const newResourceContext = (0, import_react21.useMemo)(() => {
3018
3025
  const newCtx = { ...currentResourceContext };
3019
3026
  const id = resource?.resource.source.id;
@@ -3059,7 +3066,7 @@ function BaseEditor({ currentTab = void 0 }) {
3059
3066
  }, [resource, app]);
3060
3067
  (0, import_react21.useEffect)(() => {
3061
3068
  set(match?.label || "");
3062
- });
3069
+ }, [match]);
3063
3070
  (0, import_react21.useEffect)(() => {
3064
3071
  const availableKeys = match?.editors.map((editor, key) => editor.id + key) || [];
3065
3072
  const currentKey = availableKeys.find((key) => key === currentTab);
@@ -3082,6 +3089,8 @@ function BaseEditor({ currentTab = void 0 }) {
3082
3089
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3083
3090
  import_components5.SidebarTabs,
3084
3091
  {
3092
+ isNested,
3093
+ rootResource,
3085
3094
  menuId: resource.resource.source.id,
3086
3095
  menu: (match?.editors || []).map((editor, key) => {
3087
3096
  return {