@payloadcms/ui 3.77.0-internal.0b6b4e4 → 3.77.0-internal.16f474b

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.
Files changed (31) hide show
  1. package/dist/elements/FolderView/Drawers/MoveToFolder/index.js +8 -4
  2. package/dist/elements/FolderView/Drawers/MoveToFolder/index.js.map +1 -1
  3. package/dist/elements/ListControls/index.scss +0 -1
  4. package/dist/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.d.ts +3 -1
  5. package/dist/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.d.ts.map +1 -1
  6. package/dist/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.js +46 -40
  7. package/dist/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.js.map +1 -1
  8. package/dist/elements/NoListResults/index.scss +14 -4
  9. package/dist/elements/RelationshipTable/cells/DrawerLink/index.js +1 -1
  10. package/dist/elements/RelationshipTable/cells/DrawerLink/index.js.map +1 -1
  11. package/dist/elements/RelationshipTable/index.d.ts +1 -1
  12. package/dist/elements/RelationshipTable/index.d.ts.map +1 -1
  13. package/dist/elements/RelationshipTable/index.js +6 -1
  14. package/dist/elements/RelationshipTable/index.js.map +1 -1
  15. package/dist/elements/withMergedProps/index.d.ts +1 -1
  16. package/dist/elements/withMergedProps/index.js +1 -1
  17. package/dist/elements/withMergedProps/index.js.map +1 -1
  18. package/dist/exports/client/index.js +12 -12
  19. package/dist/exports/client/index.js.map +3 -3
  20. package/dist/exports/shared/index.js.map +1 -1
  21. package/dist/styles.css +1 -1
  22. package/dist/views/BrowseByFolder/index.d.ts.map +1 -1
  23. package/dist/views/BrowseByFolder/index.js +35 -56
  24. package/dist/views/BrowseByFolder/index.js.map +1 -1
  25. package/dist/views/CollectionFolder/index.js +11 -5
  26. package/dist/views/CollectionFolder/index.js.map +1 -1
  27. package/dist/views/List/index.d.ts.map +1 -1
  28. package/dist/views/List/index.js +25 -20
  29. package/dist/views/List/index.js.map +1 -1
  30. package/dist/views/List/index.scss +0 -11
  31. package/package.json +5 -5
@@ -349,15 +349,19 @@ function Content(t0) {
349
349
  children: subfolders.length > 0 ? FolderResultsComponent : _jsx(NoListResults, {
350
350
  Actions: [_jsx(ListCreateNewDocInFolderButton, {
351
351
  buttonLabel: `${t("general:create")} ${getTranslation(folderCollectionConfig.labels?.singular, i18n).toLowerCase()}`,
352
+ buttonSize: "medium",
353
+ buttonStyle: "primary",
352
354
  collectionSlugs: [folderCollectionSlug],
353
355
  folderAssignedCollections: props.folderAssignedCollections,
354
356
  onCreateSuccess,
355
357
  slugPrefix: "create-new-folder-from-drawer--no-results"
356
358
  }, "create-folder")],
357
- Message: _jsx("p", {
358
- children: i18n.t("general:noResults", {
359
- label: `${getTranslation(folderCollectionConfig.labels?.plural, i18n)}`
360
- })
359
+ Message: _jsxs(_Fragment, {
360
+ children: [_jsx("h3", {
361
+ children: i18n.t("general:noResultsFound")
362
+ }), _jsx("p", {
363
+ children: i18n.t("general:noResultsDescription")
364
+ })]
361
365
  })
362
366
  })
363
367
  }), !skipConfirmModal && _jsx(ConfirmationModal, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","useModal","getTranslation","extractID","React","useAuth","FolderProvider","useFolder","useRouteCache","useServerFunctions","useTranslation","Button","ConfirmationModal","useDocumentDrawer","Drawer","DrawerActionHeader","DrawerContentContainer","ListCreateNewDocInFolderButton","LoadingOverlay","NoListResults","Translation","FolderBreadcrumbs","ColoredFolderIcon","baseClass","baseModalSlug","confirmModalSlug","MoveItemsToFolderDrawer","props","_jsx","gutter","Header","slug","drawerSlug","LoadFolderData","permissions","subfolders","setSubfolders","useState","documents","setDocuments","breadcrumbs","setBreadcrumbs","FolderResultsComponent","setFolderResultsComponent","hasLoaded","setHasLoaded","folderID","setFolderID","fromFolderID","hasLoadedRef","useRef","getFolderResultsComponentAndData","populateMoveToFolderDrawer","useCallback","folderIDToPopulate","result","browseByFolder","collectionsToDisplay","folderCollectionSlug","displayAs","folderAssignedCollections","sort","e","current","useEffect","allCollectionFolderSlugs","allowCreateCollectionSlugs","collections","create","allowMultiSelection","folderFieldName","onItemClick","item","value","id","Content","t0","$","fromFolderName","itemsToMove","onConfirm","skipConfirmModal","clearRouteCache","closeModal","isModalOpen","openModal","t1","length","count","folderAddedToUnderlyingFolder","setFolderAddedToUnderlyingFolder","i18n","t","folderCollectionConfig","folderType","getSelectedItems","t2","collectionSlug","FolderDocumentDrawer","t3","closeDrawer","closeFolderDrawer","openDrawer","openFolderDrawer","t4","selected","lastCrumb","name","_folderOrDocumentTitle","getSelectedFolder","t5","t6","doc","folder","onCreateSuccess","onConfirmMove","t7","t8","t9","t10","t11","undefined","t12","crumb","index","onClick","_jsxs","className","children","onCancel","onSave","saveLabel","title","DrawerHeading","action","map","_Fragment","buttonStyle","margin","label","labels","singular","initialData","redirectAfterCreate","Actions","buttonLabel","toLowerCase","collectionSlugs","slugPrefix","Message","plural","body","ConfirmationMessage","toFolderName","confirmLabel","heading","modalSlug","fromFolder","elements","1","_temp","2","_temp2","i18nKey","variables","toFolder","_temp3","_temp4","_temp5","_temp6","children_1","children_0","children_4","children_3","children_2"],"sources":["../../../../../src/elements/FolderView/Drawers/MoveToFolder/index.tsx"],"sourcesContent":["'use client'\n\nimport type { CollectionSlug, Document } from 'payload'\nimport type { FolderBreadcrumb, FolderOrDocument } from 'payload/shared'\n\nimport { useModal } from '@faceless-ui/modal'\nimport { getTranslation } from '@payloadcms/translations'\nimport { extractID } from 'payload/shared'\nimport React from 'react'\n\nimport { useAuth } from '../../../../providers/Auth/index.js'\nimport { FolderProvider, useFolder } from '../../../../providers/Folders/index.js'\nimport { useRouteCache } from '../../../../providers/RouteCache/index.js'\nimport { useServerFunctions } from '../../../../providers/ServerFunctions/index.js'\nimport { useTranslation } from '../../../../providers/Translation/index.js'\nimport { Button } from '../../../Button/index.js'\nimport { ConfirmationModal } from '../../../ConfirmationModal/index.js'\nimport { useDocumentDrawer } from '../../../DocumentDrawer/index.js'\nimport { Drawer } from '../../../Drawer/index.js'\nimport { DrawerActionHeader } from '../../../DrawerActionHeader/index.js'\nimport { DrawerContentContainer } from '../../../DrawerContentContainer/index.js'\nimport { ListCreateNewDocInFolderButton } from '../../../ListHeader/TitleActions/ListCreateNewDocInFolderButton.js'\nimport { LoadingOverlay } from '../../../Loading/index.js'\nimport { NoListResults } from '../../../NoListResults/index.js'\nimport { Translation } from '../../../Translation/index.js'\nimport { FolderBreadcrumbs } from '../../Breadcrumbs/index.js'\nimport { ColoredFolderIcon } from '../../ColoredFolderIcon/index.js'\nimport './index.scss'\n\nconst baseClass = 'move-folder-drawer'\nconst baseModalSlug = 'move-folder-drawer'\nconst confirmModalSlug = `${baseModalSlug}-confirm-move`\n\ntype ActionProps =\n | {\n readonly action: 'moveItemsToFolder'\n }\n | {\n readonly action: 'moveItemToFolder'\n readonly title: string\n }\nexport type MoveToFolderDrawerProps = {\n readonly drawerSlug: string\n readonly folderAssignedCollections: CollectionSlug[]\n readonly folderCollectionSlug: string\n readonly folderFieldName: string\n readonly fromFolderID?: number | string\n readonly fromFolderName?: string\n readonly itemsToMove: FolderOrDocument[]\n /**\n * Callback function to be called when the user confirms the move\n *\n * @param folderID - The ID of the folder to move the items to\n */\n readonly onConfirm: (args: {\n id: null | number | string\n name: null | string\n }) => Promise<void> | void\n readonly populateMoveToFolderDrawer?: (folderID: null | number | string) => Promise<void> | void\n /**\n * Set to `true` to skip the confirmation modal\n * @default false\n */\n readonly skipConfirmModal?: boolean\n} & ActionProps\n\nexport function MoveItemsToFolderDrawer(props: MoveToFolderDrawerProps) {\n return (\n <Drawer gutter={false} Header={null} slug={props.drawerSlug}>\n <LoadFolderData {...props} />\n </Drawer>\n )\n}\n\nfunction LoadFolderData(props: MoveToFolderDrawerProps) {\n const { permissions } = useAuth()\n const [subfolders, setSubfolders] = React.useState<FolderOrDocument[]>([])\n const [documents, setDocuments] = React.useState<FolderOrDocument[]>([])\n const [breadcrumbs, setBreadcrumbs] = React.useState<FolderBreadcrumb[]>([])\n const [FolderResultsComponent, setFolderResultsComponent] = React.useState<React.ReactNode>(null)\n const [hasLoaded, setHasLoaded] = React.useState(false)\n const [folderID, setFolderID] = React.useState<null | number | string>(props.fromFolderID || null)\n const hasLoadedRef = React.useRef(false)\n const { getFolderResultsComponentAndData } = useServerFunctions()\n\n const populateMoveToFolderDrawer = React.useCallback(\n async (folderIDToPopulate: null | number | string) => {\n try {\n const result = await getFolderResultsComponentAndData({\n browseByFolder: false,\n collectionsToDisplay: [props.folderCollectionSlug],\n displayAs: 'grid',\n // todo: should be able to pass undefined, empty array or null and get all folders. Need to look at API for this in the server function\n folderAssignedCollections: props.folderAssignedCollections,\n folderID: folderIDToPopulate,\n sort: 'name',\n })\n\n setBreadcrumbs(result.breadcrumbs || [])\n setSubfolders(result?.subfolders || [])\n setDocuments(result?.documents || [])\n setFolderResultsComponent(result.FolderResultsComponent || null)\n setFolderID(folderIDToPopulate)\n setHasLoaded(true)\n } catch (e) {\n setBreadcrumbs([])\n setSubfolders([])\n setDocuments([])\n }\n\n hasLoadedRef.current = true\n },\n [getFolderResultsComponentAndData, props.folderAssignedCollections, props.folderCollectionSlug],\n )\n\n React.useEffect(() => {\n if (!hasLoadedRef.current) {\n void populateMoveToFolderDrawer(props.fromFolderID)\n }\n }, [populateMoveToFolderDrawer, props.fromFolderID])\n\n if (!hasLoaded) {\n return <LoadingOverlay />\n }\n\n return (\n <FolderProvider\n allCollectionFolderSlugs={[props.folderCollectionSlug]}\n allowCreateCollectionSlugs={\n permissions.collections[props.folderCollectionSlug]?.create\n ? [props.folderCollectionSlug]\n : []\n }\n allowMultiSelection={false}\n breadcrumbs={breadcrumbs}\n documents={documents}\n folderFieldName={props.folderFieldName}\n folderID={folderID}\n FolderResultsComponent={FolderResultsComponent}\n key={folderID}\n onItemClick={async (item) => {\n await populateMoveToFolderDrawer(item.value.id)\n }}\n subfolders={subfolders}\n >\n <Content {...props} populateMoveToFolderDrawer={populateMoveToFolderDrawer} />\n </FolderProvider>\n )\n}\n\nfunction Content({\n drawerSlug,\n fromFolderID,\n fromFolderName,\n itemsToMove,\n onConfirm,\n populateMoveToFolderDrawer,\n skipConfirmModal,\n ...props\n}: MoveToFolderDrawerProps) {\n const { clearRouteCache } = useRouteCache()\n const { closeModal, isModalOpen, openModal } = useModal()\n const [count] = React.useState(() => itemsToMove.length)\n const [folderAddedToUnderlyingFolder, setFolderAddedToUnderlyingFolder] = React.useState(false)\n const { i18n, t } = useTranslation()\n const {\n breadcrumbs,\n folderCollectionConfig,\n folderCollectionSlug,\n folderFieldName,\n folderID,\n FolderResultsComponent,\n folderType,\n getSelectedItems,\n subfolders,\n } = useFolder()\n const [FolderDocumentDrawer, , { closeDrawer: closeFolderDrawer, openDrawer: openFolderDrawer }] =\n useDocumentDrawer({\n collectionSlug: folderCollectionSlug,\n })\n\n const getSelectedFolder = React.useCallback((): {\n id: null | number | string\n name: null | string\n } => {\n const selected = getSelectedItems()\n\n if (selected.length === 0) {\n const lastCrumb = breadcrumbs?.[breadcrumbs.length - 1]\n // use the breadcrumb\n return {\n id: lastCrumb?.id || null,\n name: lastCrumb?.name || null,\n }\n } else {\n // use the selected item\n return {\n id: selected[0].value.id,\n name: selected[0].value._folderOrDocumentTitle,\n }\n }\n }, [breadcrumbs, getSelectedItems])\n\n const onCreateSuccess = React.useCallback(\n async ({ collectionSlug, doc }: { collectionSlug: CollectionSlug; doc: Document }) => {\n await populateMoveToFolderDrawer(folderID)\n if (\n collectionSlug === folderCollectionSlug &&\n ((doc?.folder && fromFolderID === extractID(doc?.folder)) ||\n (!fromFolderID && !doc?.folder))\n ) {\n // if the folder we created is in the same folder as the one we are moving from\n // set variable so we can clear the route cache when we close the drawer\n setFolderAddedToUnderlyingFolder(true)\n }\n },\n [populateMoveToFolderDrawer, folderID, fromFolderID, folderCollectionSlug],\n )\n\n const onConfirmMove = React.useCallback(() => {\n if (typeof onConfirm === 'function') {\n void onConfirm(getSelectedFolder())\n }\n }, [getSelectedFolder, onConfirm])\n\n React.useEffect(() => {\n if (!isModalOpen(drawerSlug) && folderAddedToUnderlyingFolder) {\n // if we added a folder to the underlying folder, clear the route cache\n // so that the folder view will be reloaded with the new folder\n setFolderAddedToUnderlyingFolder(false)\n clearRouteCache()\n }\n }, [drawerSlug, isModalOpen, clearRouteCache, folderAddedToUnderlyingFolder])\n\n return (\n <div className={baseClass}>\n <DrawerActionHeader\n onCancel={() => {\n closeModal(drawerSlug)\n }}\n onSave={() => {\n if (skipConfirmModal) {\n onConfirmMove()\n } else {\n openModal(confirmModalSlug)\n }\n }}\n saveLabel={t('general:select')}\n title={\n <DrawerHeading\n action={props.action}\n count={count}\n fromFolderName={fromFolderID ? fromFolderName : undefined}\n title={props.action === 'moveItemToFolder' ? props.title : undefined}\n />\n }\n />\n\n <div className={`${baseClass}__breadcrumbs-section`}>\n <FolderBreadcrumbs\n breadcrumbs={[\n {\n id: null,\n name: (\n <span className={`${baseClass}__folder-breadcrumbs-root`}>\n <ColoredFolderIcon />\n {t('folder:folders')}\n </span>\n ),\n onClick: breadcrumbs.length\n ? () => {\n void populateMoveToFolderDrawer(null)\n }\n : undefined,\n },\n ...breadcrumbs.map((crumb, index) => ({\n id: crumb.id,\n name: crumb.name,\n onClick:\n index !== breadcrumbs.length - 1\n ? () => {\n void populateMoveToFolderDrawer(crumb.id)\n }\n : undefined,\n })),\n ]}\n />\n {subfolders.length > 0 && (\n <>\n <Button\n buttonStyle=\"pill\"\n className={`${baseClass}__add-folder-button`}\n margin={false}\n onClick={() => {\n openFolderDrawer()\n }}\n >\n {t('fields:addLabel', {\n label: getTranslation(folderCollectionConfig.labels?.singular, i18n),\n })}\n </Button>\n <FolderDocumentDrawer\n initialData={{\n [folderFieldName]: folderID,\n folderType,\n }}\n onSave={(result) => {\n void onCreateSuccess({\n collectionSlug: folderCollectionConfig.slug,\n doc: result.doc,\n })\n closeFolderDrawer()\n }}\n redirectAfterCreate={false}\n />\n </>\n )}\n </div>\n\n <DrawerContentContainer className={`${baseClass}__body-section`}>\n {subfolders.length > 0 ? (\n FolderResultsComponent\n ) : (\n <NoListResults\n Actions={[\n <ListCreateNewDocInFolderButton\n buttonLabel={`${t('general:create')} ${getTranslation(folderCollectionConfig.labels?.singular, i18n).toLowerCase()}`}\n collectionSlugs={[folderCollectionSlug]}\n folderAssignedCollections={props.folderAssignedCollections}\n key=\"create-folder\"\n onCreateSuccess={onCreateSuccess}\n slugPrefix=\"create-new-folder-from-drawer--no-results\"\n />,\n ]}\n Message={\n <p>\n {i18n.t('general:noResults', {\n label: `${getTranslation(folderCollectionConfig.labels?.plural, i18n)}`,\n })}\n </p>\n }\n />\n )}\n </DrawerContentContainer>\n\n {!skipConfirmModal && (\n <ConfirmationModal\n body={\n <ConfirmationMessage\n action={props.action}\n count={count}\n fromFolderName={fromFolderName}\n title={props.action === 'moveItemToFolder' ? props.title : undefined}\n toFolderName={getSelectedFolder().name}\n />\n }\n confirmingLabel={t('general:moving')}\n confirmLabel={t('general:move')}\n heading={t('general:confirmMove')}\n modalSlug={confirmModalSlug}\n onConfirm={onConfirmMove}\n />\n )}\n </div>\n )\n}\n\nfunction DrawerHeading(\n props: { count?: number } & ActionProps & Pick<MoveToFolderDrawerProps, 'fromFolderName'>,\n): string {\n const { t } = useTranslation()\n\n switch (props.action) {\n case 'moveItemToFolder':\n // moving current folder from list view actions menu\n // or moving item from edit view\n if (props.fromFolderName) {\n // move from folder\n return t('folder:movingFromFolder', {\n fromFolder: props.fromFolderName,\n title: props.title,\n })\n } else {\n // move from root\n return t('folder:selectFolderForItem', {\n title: props.title,\n })\n }\n\n case 'moveItemsToFolder':\n if (props.fromFolderName) {\n // move from folder\n return t('folder:movingFromFolder', {\n fromFolder: props.fromFolderName,\n title: `${props.count} ${props.count > 1 ? t('general:items') : t('general:item')}`,\n })\n } else {\n // move from root\n return t('folder:selectFolderForItem', {\n title: `${props.count} ${props.count > 1 ? t('general:items') : t('general:item')}`,\n })\n }\n }\n}\n\nfunction ConfirmationMessage(\n props: { count?: number; toFolderName?: string } & ActionProps &\n Pick<MoveToFolderDrawerProps, 'fromFolderName'>,\n) {\n const { t } = useTranslation()\n\n switch (props.action) {\n case 'moveItemToFolder':\n // moving current folder from list view actions menu\n // or moving item from edit view\n if (props.toFolderName) {\n // move to destination\n // You are about to move {{title}} to {{toFolder}}. Are you sure?\n return (\n <Translation\n elements={{\n 1: ({ children }) => <strong>{children}</strong>,\n 2: ({ children }) => <strong>{children}</strong>,\n }}\n i18nKey=\"folder:moveItemToFolderConfirmation\"\n t={t}\n variables={{\n title: props.title,\n toFolder: props.toFolderName,\n }}\n />\n )\n } else {\n // move to root\n // You are about to move {{title}} to the root folder. Are you sure?\n return (\n <Translation\n elements={{\n 1: ({ children }) => <strong>{children}</strong>,\n }}\n i18nKey=\"folder:moveItemToRootConfirmation\"\n t={t}\n variables={{\n title: props.title,\n }}\n />\n )\n }\n\n case 'moveItemsToFolder':\n // moving many (documents/folders) from list view\n if (props.toFolderName) {\n // move to destination\n // You are about to move {{count}} {{label}} to {{toFolder}}. Are you sure?\n return (\n <Translation\n elements={{\n 1: ({ children }) => <strong>{children}</strong>,\n 2: ({ children }) => <strong>{children}</strong>,\n }}\n i18nKey=\"folder:moveItemsToFolderConfirmation\"\n t={t}\n variables={{\n count: props.count,\n label: props.count > 1 ? t('general:items') : t('general:item'),\n toFolder: props.toFolderName,\n }}\n />\n )\n } else {\n // move to root\n // You are about to move {{count}} {{label}} to the root folder. Are you sure?\n return (\n <Translation\n elements={{\n 1: ({ children }) => <strong>{children}</strong>,\n }}\n i18nKey=\"folder:moveItemsToRootConfirmation\"\n t={t}\n variables={{\n count: props.count,\n label: props.count > 1 ? t('general:items') : t('general:item'),\n }}\n />\n )\n }\n }\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAKA,SAASC,QAAQ,QAAQ;AACzB,SAASC,cAAc,QAAQ;AAC/B,SAASC,SAAS,QAAQ;AAC1B,OAAOC,KAA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;;AArD5C,SAAAuC,OAAA3F,EAAA;EAoDkB;IAAAoD;EAAA,IAAApD,EAAY;EAAA,OAAKhD,IAAA,CAAC;IAAAoG;EAAA,C;;AApDpC,SAAAsC,OAAA1F,EAAA;EAiCkB;IAAAoD,QAAA,EAAA4C;EAAA,IAAAhG,EAAY;EAAA,OAAKhD,IAAA,CAAC;IAAAoG,QAAA,EAAQA;EAAA,C;;AAjC5C,SAAAkC,OAAAtF,EAAA;EAiBkB;IAAAoD,QAAA,EAAA6C;EAAA,IAAAjG,EAAY;EAAA,OAAKhD,IAAA,CAAC;IAAAoG,QAAA,EAAQA;EAAA,C;;AAjB5C,SAAAgC,MAAApF,EAAA;EAgBkB;IAAAoD,QAAA,EAAA8C;EAAA,IAAAlG,EAAY;EAAA,OAAKhD,IAAA,CAAC;IAAAoG,QAAA,EAAQA;EAAA,C","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["c","_c","useModal","getTranslation","extractID","React","useAuth","FolderProvider","useFolder","useRouteCache","useServerFunctions","useTranslation","Button","ConfirmationModal","useDocumentDrawer","Drawer","DrawerActionHeader","DrawerContentContainer","ListCreateNewDocInFolderButton","LoadingOverlay","NoListResults","Translation","FolderBreadcrumbs","ColoredFolderIcon","baseClass","baseModalSlug","confirmModalSlug","MoveItemsToFolderDrawer","props","_jsx","gutter","Header","slug","drawerSlug","LoadFolderData","permissions","subfolders","setSubfolders","useState","documents","setDocuments","breadcrumbs","setBreadcrumbs","FolderResultsComponent","setFolderResultsComponent","hasLoaded","setHasLoaded","folderID","setFolderID","fromFolderID","hasLoadedRef","useRef","getFolderResultsComponentAndData","populateMoveToFolderDrawer","useCallback","folderIDToPopulate","result","browseByFolder","collectionsToDisplay","folderCollectionSlug","displayAs","folderAssignedCollections","sort","e","current","useEffect","allCollectionFolderSlugs","allowCreateCollectionSlugs","collections","create","allowMultiSelection","folderFieldName","onItemClick","item","value","id","Content","t0","$","fromFolderName","itemsToMove","onConfirm","skipConfirmModal","clearRouteCache","closeModal","isModalOpen","openModal","t1","length","count","folderAddedToUnderlyingFolder","setFolderAddedToUnderlyingFolder","i18n","t","folderCollectionConfig","folderType","getSelectedItems","t2","collectionSlug","FolderDocumentDrawer","t3","closeDrawer","closeFolderDrawer","openDrawer","openFolderDrawer","t4","selected","lastCrumb","name","_folderOrDocumentTitle","getSelectedFolder","t5","t6","doc","folder","onCreateSuccess","onConfirmMove","t7","t8","t9","t10","t11","undefined","t12","crumb","index","onClick","_jsxs","className","children","onCancel","onSave","saveLabel","title","DrawerHeading","action","map","_Fragment","buttonStyle","margin","label","labels","singular","initialData","redirectAfterCreate","Actions","buttonLabel","toLowerCase","buttonSize","collectionSlugs","slugPrefix","Message","body","ConfirmationMessage","toFolderName","confirmLabel","heading","modalSlug","fromFolder","elements","1","_temp","2","_temp2","i18nKey","variables","toFolder","_temp3","_temp4","_temp5","_temp6","children_1","children_0","children_4","children_3","children_2"],"sources":["../../../../../src/elements/FolderView/Drawers/MoveToFolder/index.tsx"],"sourcesContent":["'use client'\n\nimport type { CollectionSlug, Document } from 'payload'\nimport type { FolderBreadcrumb, FolderOrDocument } from 'payload/shared'\n\nimport { useModal } from '@faceless-ui/modal'\nimport { getTranslation } from '@payloadcms/translations'\nimport { extractID } from 'payload/shared'\nimport React from 'react'\n\nimport { useAuth } from '../../../../providers/Auth/index.js'\nimport { FolderProvider, useFolder } from '../../../../providers/Folders/index.js'\nimport { useRouteCache } from '../../../../providers/RouteCache/index.js'\nimport { useServerFunctions } from '../../../../providers/ServerFunctions/index.js'\nimport { useTranslation } from '../../../../providers/Translation/index.js'\nimport { Button } from '../../../Button/index.js'\nimport { ConfirmationModal } from '../../../ConfirmationModal/index.js'\nimport { useDocumentDrawer } from '../../../DocumentDrawer/index.js'\nimport { Drawer } from '../../../Drawer/index.js'\nimport { DrawerActionHeader } from '../../../DrawerActionHeader/index.js'\nimport { DrawerContentContainer } from '../../../DrawerContentContainer/index.js'\nimport { ListCreateNewDocInFolderButton } from '../../../ListHeader/TitleActions/ListCreateNewDocInFolderButton.js'\nimport { LoadingOverlay } from '../../../Loading/index.js'\nimport { NoListResults } from '../../../NoListResults/index.js'\nimport { Translation } from '../../../Translation/index.js'\nimport { FolderBreadcrumbs } from '../../Breadcrumbs/index.js'\nimport { ColoredFolderIcon } from '../../ColoredFolderIcon/index.js'\nimport './index.scss'\n\nconst baseClass = 'move-folder-drawer'\nconst baseModalSlug = 'move-folder-drawer'\nconst confirmModalSlug = `${baseModalSlug}-confirm-move`\n\ntype ActionProps =\n | {\n readonly action: 'moveItemsToFolder'\n }\n | {\n readonly action: 'moveItemToFolder'\n readonly title: string\n }\nexport type MoveToFolderDrawerProps = {\n readonly drawerSlug: string\n readonly folderAssignedCollections: CollectionSlug[]\n readonly folderCollectionSlug: string\n readonly folderFieldName: string\n readonly fromFolderID?: number | string\n readonly fromFolderName?: string\n readonly itemsToMove: FolderOrDocument[]\n /**\n * Callback function to be called when the user confirms the move\n *\n * @param folderID - The ID of the folder to move the items to\n */\n readonly onConfirm: (args: {\n id: null | number | string\n name: null | string\n }) => Promise<void> | void\n readonly populateMoveToFolderDrawer?: (folderID: null | number | string) => Promise<void> | void\n /**\n * Set to `true` to skip the confirmation modal\n * @default false\n */\n readonly skipConfirmModal?: boolean\n} & ActionProps\n\nexport function MoveItemsToFolderDrawer(props: MoveToFolderDrawerProps) {\n return (\n <Drawer gutter={false} Header={null} slug={props.drawerSlug}>\n <LoadFolderData {...props} />\n </Drawer>\n )\n}\n\nfunction LoadFolderData(props: MoveToFolderDrawerProps) {\n const { permissions } = useAuth()\n const [subfolders, setSubfolders] = React.useState<FolderOrDocument[]>([])\n const [documents, setDocuments] = React.useState<FolderOrDocument[]>([])\n const [breadcrumbs, setBreadcrumbs] = React.useState<FolderBreadcrumb[]>([])\n const [FolderResultsComponent, setFolderResultsComponent] = React.useState<React.ReactNode>(null)\n const [hasLoaded, setHasLoaded] = React.useState(false)\n const [folderID, setFolderID] = React.useState<null | number | string>(props.fromFolderID || null)\n const hasLoadedRef = React.useRef(false)\n const { getFolderResultsComponentAndData } = useServerFunctions()\n\n const populateMoveToFolderDrawer = React.useCallback(\n async (folderIDToPopulate: null | number | string) => {\n try {\n const result = await getFolderResultsComponentAndData({\n browseByFolder: false,\n collectionsToDisplay: [props.folderCollectionSlug],\n displayAs: 'grid',\n // todo: should be able to pass undefined, empty array or null and get all folders. Need to look at API for this in the server function\n folderAssignedCollections: props.folderAssignedCollections,\n folderID: folderIDToPopulate,\n sort: 'name',\n })\n\n setBreadcrumbs(result.breadcrumbs || [])\n setSubfolders(result?.subfolders || [])\n setDocuments(result?.documents || [])\n setFolderResultsComponent(result.FolderResultsComponent || null)\n setFolderID(folderIDToPopulate)\n setHasLoaded(true)\n } catch (e) {\n setBreadcrumbs([])\n setSubfolders([])\n setDocuments([])\n }\n\n hasLoadedRef.current = true\n },\n [getFolderResultsComponentAndData, props.folderAssignedCollections, props.folderCollectionSlug],\n )\n\n React.useEffect(() => {\n if (!hasLoadedRef.current) {\n void populateMoveToFolderDrawer(props.fromFolderID)\n }\n }, [populateMoveToFolderDrawer, props.fromFolderID])\n\n if (!hasLoaded) {\n return <LoadingOverlay />\n }\n\n return (\n <FolderProvider\n allCollectionFolderSlugs={[props.folderCollectionSlug]}\n allowCreateCollectionSlugs={\n permissions.collections[props.folderCollectionSlug]?.create\n ? [props.folderCollectionSlug]\n : []\n }\n allowMultiSelection={false}\n breadcrumbs={breadcrumbs}\n documents={documents}\n folderFieldName={props.folderFieldName}\n folderID={folderID}\n FolderResultsComponent={FolderResultsComponent}\n key={folderID}\n onItemClick={async (item) => {\n await populateMoveToFolderDrawer(item.value.id)\n }}\n subfolders={subfolders}\n >\n <Content {...props} populateMoveToFolderDrawer={populateMoveToFolderDrawer} />\n </FolderProvider>\n )\n}\n\nfunction Content({\n drawerSlug,\n fromFolderID,\n fromFolderName,\n itemsToMove,\n onConfirm,\n populateMoveToFolderDrawer,\n skipConfirmModal,\n ...props\n}: MoveToFolderDrawerProps) {\n const { clearRouteCache } = useRouteCache()\n const { closeModal, isModalOpen, openModal } = useModal()\n const [count] = React.useState(() => itemsToMove.length)\n const [folderAddedToUnderlyingFolder, setFolderAddedToUnderlyingFolder] = React.useState(false)\n const { i18n, t } = useTranslation()\n const {\n breadcrumbs,\n folderCollectionConfig,\n folderCollectionSlug,\n folderFieldName,\n folderID,\n FolderResultsComponent,\n folderType,\n getSelectedItems,\n subfolders,\n } = useFolder()\n const [FolderDocumentDrawer, , { closeDrawer: closeFolderDrawer, openDrawer: openFolderDrawer }] =\n useDocumentDrawer({\n collectionSlug: folderCollectionSlug,\n })\n\n const getSelectedFolder = React.useCallback((): {\n id: null | number | string\n name: null | string\n } => {\n const selected = getSelectedItems()\n\n if (selected.length === 0) {\n const lastCrumb = breadcrumbs?.[breadcrumbs.length - 1]\n // use the breadcrumb\n return {\n id: lastCrumb?.id || null,\n name: lastCrumb?.name || null,\n }\n } else {\n // use the selected item\n return {\n id: selected[0].value.id,\n name: selected[0].value._folderOrDocumentTitle,\n }\n }\n }, [breadcrumbs, getSelectedItems])\n\n const onCreateSuccess = React.useCallback(\n async ({ collectionSlug, doc }: { collectionSlug: CollectionSlug; doc: Document }) => {\n await populateMoveToFolderDrawer(folderID)\n if (\n collectionSlug === folderCollectionSlug &&\n ((doc?.folder && fromFolderID === extractID(doc?.folder)) ||\n (!fromFolderID && !doc?.folder))\n ) {\n // if the folder we created is in the same folder as the one we are moving from\n // set variable so we can clear the route cache when we close the drawer\n setFolderAddedToUnderlyingFolder(true)\n }\n },\n [populateMoveToFolderDrawer, folderID, fromFolderID, folderCollectionSlug],\n )\n\n const onConfirmMove = React.useCallback(() => {\n if (typeof onConfirm === 'function') {\n void onConfirm(getSelectedFolder())\n }\n }, [getSelectedFolder, onConfirm])\n\n React.useEffect(() => {\n if (!isModalOpen(drawerSlug) && folderAddedToUnderlyingFolder) {\n // if we added a folder to the underlying folder, clear the route cache\n // so that the folder view will be reloaded with the new folder\n setFolderAddedToUnderlyingFolder(false)\n clearRouteCache()\n }\n }, [drawerSlug, isModalOpen, clearRouteCache, folderAddedToUnderlyingFolder])\n\n return (\n <div className={baseClass}>\n <DrawerActionHeader\n onCancel={() => {\n closeModal(drawerSlug)\n }}\n onSave={() => {\n if (skipConfirmModal) {\n onConfirmMove()\n } else {\n openModal(confirmModalSlug)\n }\n }}\n saveLabel={t('general:select')}\n title={\n <DrawerHeading\n action={props.action}\n count={count}\n fromFolderName={fromFolderID ? fromFolderName : undefined}\n title={props.action === 'moveItemToFolder' ? props.title : undefined}\n />\n }\n />\n\n <div className={`${baseClass}__breadcrumbs-section`}>\n <FolderBreadcrumbs\n breadcrumbs={[\n {\n id: null,\n name: (\n <span className={`${baseClass}__folder-breadcrumbs-root`}>\n <ColoredFolderIcon />\n {t('folder:folders')}\n </span>\n ),\n onClick: breadcrumbs.length\n ? () => {\n void populateMoveToFolderDrawer(null)\n }\n : undefined,\n },\n ...breadcrumbs.map((crumb, index) => ({\n id: crumb.id,\n name: crumb.name,\n onClick:\n index !== breadcrumbs.length - 1\n ? () => {\n void populateMoveToFolderDrawer(crumb.id)\n }\n : undefined,\n })),\n ]}\n />\n {subfolders.length > 0 && (\n <>\n <Button\n buttonStyle=\"pill\"\n className={`${baseClass}__add-folder-button`}\n margin={false}\n onClick={() => {\n openFolderDrawer()\n }}\n >\n {t('fields:addLabel', {\n label: getTranslation(folderCollectionConfig.labels?.singular, i18n),\n })}\n </Button>\n <FolderDocumentDrawer\n initialData={{\n [folderFieldName]: folderID,\n folderType,\n }}\n onSave={(result) => {\n void onCreateSuccess({\n collectionSlug: folderCollectionConfig.slug,\n doc: result.doc,\n })\n closeFolderDrawer()\n }}\n redirectAfterCreate={false}\n />\n </>\n )}\n </div>\n\n <DrawerContentContainer className={`${baseClass}__body-section`}>\n {subfolders.length > 0 ? (\n FolderResultsComponent\n ) : (\n <NoListResults\n Actions={[\n <ListCreateNewDocInFolderButton\n buttonLabel={`${t('general:create')} ${getTranslation(folderCollectionConfig.labels?.singular, i18n).toLowerCase()}`}\n buttonSize=\"medium\"\n buttonStyle=\"primary\"\n collectionSlugs={[folderCollectionSlug]}\n folderAssignedCollections={props.folderAssignedCollections}\n key=\"create-folder\"\n onCreateSuccess={onCreateSuccess}\n slugPrefix=\"create-new-folder-from-drawer--no-results\"\n />,\n ]}\n Message={\n <>\n <h3>{i18n.t('general:noResultsFound')}</h3>\n <p>{i18n.t('general:noResultsDescription')}</p>\n </>\n }\n />\n )}\n </DrawerContentContainer>\n\n {!skipConfirmModal && (\n <ConfirmationModal\n body={\n <ConfirmationMessage\n action={props.action}\n count={count}\n fromFolderName={fromFolderName}\n title={props.action === 'moveItemToFolder' ? props.title : undefined}\n toFolderName={getSelectedFolder().name}\n />\n }\n confirmingLabel={t('general:moving')}\n confirmLabel={t('general:move')}\n heading={t('general:confirmMove')}\n modalSlug={confirmModalSlug}\n onConfirm={onConfirmMove}\n />\n )}\n </div>\n )\n}\n\nfunction DrawerHeading(\n props: { count?: number } & ActionProps & Pick<MoveToFolderDrawerProps, 'fromFolderName'>,\n): string {\n const { t } = useTranslation()\n\n switch (props.action) {\n case 'moveItemToFolder':\n // moving current folder from list view actions menu\n // or moving item from edit view\n if (props.fromFolderName) {\n // move from folder\n return t('folder:movingFromFolder', {\n fromFolder: props.fromFolderName,\n title: props.title,\n })\n } else {\n // move from root\n return t('folder:selectFolderForItem', {\n title: props.title,\n })\n }\n\n case 'moveItemsToFolder':\n if (props.fromFolderName) {\n // move from folder\n return t('folder:movingFromFolder', {\n fromFolder: props.fromFolderName,\n title: `${props.count} ${props.count > 1 ? t('general:items') : t('general:item')}`,\n })\n } else {\n // move from root\n return t('folder:selectFolderForItem', {\n title: `${props.count} ${props.count > 1 ? t('general:items') : t('general:item')}`,\n })\n }\n }\n}\n\nfunction ConfirmationMessage(\n props: { count?: number; toFolderName?: string } & ActionProps &\n Pick<MoveToFolderDrawerProps, 'fromFolderName'>,\n) {\n const { t } = useTranslation()\n\n switch (props.action) {\n case 'moveItemToFolder':\n // moving current folder from list view actions menu\n // or moving item from edit view\n if (props.toFolderName) {\n // move to destination\n // You are about to move {{title}} to {{toFolder}}. Are you sure?\n return (\n <Translation\n elements={{\n 1: ({ children }) => <strong>{children}</strong>,\n 2: ({ children }) => <strong>{children}</strong>,\n }}\n i18nKey=\"folder:moveItemToFolderConfirmation\"\n t={t}\n variables={{\n title: props.title,\n toFolder: props.toFolderName,\n }}\n />\n )\n } else {\n // move to root\n // You are about to move {{title}} to the root folder. Are you sure?\n return (\n <Translation\n elements={{\n 1: ({ children }) => <strong>{children}</strong>,\n }}\n i18nKey=\"folder:moveItemToRootConfirmation\"\n t={t}\n variables={{\n title: props.title,\n }}\n />\n )\n }\n\n case 'moveItemsToFolder':\n // moving many (documents/folders) from list view\n if (props.toFolderName) {\n // move to destination\n // You are about to move {{count}} {{label}} to {{toFolder}}. Are you sure?\n return (\n <Translation\n elements={{\n 1: ({ children }) => <strong>{children}</strong>,\n 2: ({ children }) => <strong>{children}</strong>,\n }}\n i18nKey=\"folder:moveItemsToFolderConfirmation\"\n t={t}\n variables={{\n count: props.count,\n label: props.count > 1 ? t('general:items') : t('general:item'),\n toFolder: props.toFolderName,\n }}\n />\n )\n } else {\n // move to root\n // You are about to move {{count}} {{label}} to the root folder. Are you sure?\n return (\n <Translation\n elements={{\n 1: ({ children }) => <strong>{children}</strong>,\n }}\n i18nKey=\"folder:moveItemsToRootConfirmation\"\n t={t}\n variables={{\n count: props.count,\n label: props.count > 1 ? t('general:items') : t('general:item'),\n }}\n />\n )\n }\n }\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAKA,SAASC,QAAQ,QAAQ;AACzB,SAASC,cAAc,QAAQ;AAC/B,SAASC,SAAS,QAAQ;AAC1B,OAAOC,KAAA,MAAW;AAElB,SAASC,OAAO,QAAQ;AACxB,SAASC,cAAc,EAAEC,SAAS,QAAQ;AAC1C,SAASC,aAAa,QAAQ;AAC9B,SAASC,kBAAkB,QAAQ;AACnC,SAASC,cA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AAC;IAAAoG;EAAA,C;;AApDpC,SAAAsC,OAAA1F,EAAA;EAiCkB;IAAAoD,QAAA,EAAA4C;EAAA,IAAAhG,EAAY;EAAA,OAAKhD,IAAA,CAAC;IAAAoG,QAAA,EAAQA;EAAA,C;;AAjC5C,SAAAkC,OAAAtF,EAAA;EAiBkB;IAAAoD,QAAA,EAAA6C;EAAA,IAAAjG,EAAY;EAAA,OAAKhD,IAAA,CAAC;IAAAoG,QAAA,EAAQA;EAAA,C;;AAjB5C,SAAAgC,MAAApF,EAAA;EAgBkB;IAAAoD,QAAA,EAAA8C;EAAA,IAAAlG,EAAY;EAAA,OAAKhD,IAAA,CAAC;IAAAoG,QAAA,EAAQA;EAAA,C","ignoreList":[]}
@@ -4,7 +4,6 @@
4
4
  .list-controls {
5
5
  display: flex;
6
6
  flex-direction: column;
7
- gap: 2px;
8
7
 
9
8
  .pill-selector,
10
9
  .where-builder,
@@ -1,7 +1,9 @@
1
1
  import type { CollectionSlug } from 'payload';
2
2
  import React from 'react';
3
- export declare function ListCreateNewDocInFolderButton({ buttonLabel, collectionSlugs, folderAssignedCollections, onCreateSuccess, slugPrefix, }: {
3
+ export declare function ListCreateNewDocInFolderButton({ buttonLabel, buttonSize, buttonStyle, collectionSlugs, folderAssignedCollections, onCreateSuccess, slugPrefix, }: {
4
4
  buttonLabel: string;
5
+ buttonSize?: 'large' | 'medium' | 'small' | 'xsmall';
6
+ buttonStyle?: 'error' | 'icon-label' | 'none' | 'pill' | 'primary' | 'secondary' | 'subtle' | 'tab' | 'transparent';
5
7
  collectionSlugs: CollectionSlug[];
6
8
  folderAssignedCollections: CollectionSlug[];
7
9
  onCreateSuccess: (args: {
@@ -1 +1 @@
1
- {"version":3,"file":"ListCreateNewDocInFolderButton.d.ts","sourceRoot":"","sources":["../../../../src/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA0B,cAAc,EAAE,MAAM,SAAS,CAAA;AAIrE,OAAO,KAAK,MAAM,OAAO,CAAA;AAWzB,wBAAgB,8BAA8B,CAAC,EAC7C,WAAW,EACX,eAAe,EACf,yBAAyB,EACzB,eAAe,EACf,UAAU,GACX,EAAE;IACD,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,cAAc,EAAE,CAAA;IACjC,yBAAyB,EAAE,cAAc,EAAE,CAAA;IAC3C,eAAe,EAAE,CAAC,IAAI,EAAE;QACtB,cAAc,EAAE,cAAc,CAAA;QAC9B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAC7B,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAC1B,UAAU,EAAE,MAAM,CAAA;CACnB,qBAyHA"}
1
+ {"version":3,"file":"ListCreateNewDocInFolderButton.d.ts","sourceRoot":"","sources":["../../../../src/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA0B,cAAc,EAAE,MAAM,SAAS,CAAA;AAIrE,OAAO,KAAK,MAAM,OAAO,CAAA;AAWzB,wBAAgB,8BAA8B,CAAC,EAC7C,WAAW,EACX,UAAoB,EACpB,WAAoB,EACpB,eAAe,EACf,yBAAyB,EACzB,eAAe,EACf,UAAU,GACX,EAAE;IACD,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAA;IACpD,WAAW,CAAC,EACR,OAAO,GACP,YAAY,GACZ,MAAM,GACN,MAAM,GACN,SAAS,GACT,WAAW,GACX,QAAQ,GACR,KAAK,GACL,aAAa,CAAA;IACjB,eAAe,EAAE,cAAc,EAAE,CAAA;IACjC,yBAAyB,EAAE,cAAc,EAAE,CAAA;IAC3C,eAAe,EAAE,CAAC,IAAI,EAAE;QACtB,cAAc,EAAE,cAAc,CAAA;QAC9B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAC7B,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAC1B,UAAU,EAAE,MAAM,CAAA;CACnB,qBAyHA"}
@@ -13,14 +13,18 @@ import { DocumentDrawer, useDocumentDrawer } from '../../DocumentDrawer/index.js
13
13
  import { Popup, PopupList } from '../../Popup/index.js';
14
14
  const baseClass = 'create-new-doc-in-folder';
15
15
  export function ListCreateNewDocInFolderButton(t0) {
16
- const $ = _c(22);
16
+ const $ = _c(24);
17
17
  const {
18
18
  buttonLabel,
19
+ buttonSize: t1,
20
+ buttonStyle: t2,
19
21
  collectionSlugs,
20
22
  folderAssignedCollections,
21
23
  onCreateSuccess,
22
24
  slugPrefix
23
25
  } = t0;
26
+ const buttonSize = t1 === undefined ? "small" : t1;
27
+ const buttonStyle = t2 === undefined ? "pill" : t2;
24
28
  const newDocInFolderDrawerSlug = `${slugPrefix}-new-doc-in-folder-drawer`;
25
29
  const {
26
30
  i18n
@@ -38,29 +42,29 @@ export function ListCreateNewDocInFolderButton(t0) {
38
42
  folderFieldName,
39
43
  folderID
40
44
  } = useFolder();
41
- let t1;
45
+ let t3;
42
46
  if ($[0] !== folderCollectionSlug) {
43
- t1 = {
47
+ t3 = {
44
48
  collectionSlug: folderCollectionSlug
45
49
  };
46
50
  $[0] = folderCollectionSlug;
47
- $[1] = t1;
51
+ $[1] = t3;
48
52
  } else {
49
- t1 = $[1];
53
+ t3 = $[1];
50
54
  }
51
- const [FolderDocumentDrawer,, t2] = useDocumentDrawer(t1);
55
+ const [FolderDocumentDrawer,, t4] = useDocumentDrawer(t3);
52
56
  const {
53
57
  closeDrawer: closeFolderDrawer,
54
58
  openDrawer: openFolderDrawer
55
- } = t2;
59
+ } = t4;
56
60
  const [createCollectionSlug, setCreateCollectionSlug] = React.useState();
57
- let t3;
61
+ let t5;
58
62
  if ($[2] !== collectionSlugs || $[3] !== config) {
59
- t3 = () => collectionSlugs.reduce((acc, collectionSlug) => {
60
- const collectionConfig = config.collections.find(t4 => {
63
+ t5 = () => collectionSlugs.reduce((acc, collectionSlug) => {
64
+ const collectionConfig = config.collections.find(t6 => {
61
65
  const {
62
66
  slug
63
- } = t4;
67
+ } = t6;
64
68
  return slug === collectionSlug;
65
69
  });
66
70
  if (collectionConfig) {
@@ -70,19 +74,19 @@ export function ListCreateNewDocInFolderButton(t0) {
70
74
  }, []);
71
75
  $[2] = collectionSlugs;
72
76
  $[3] = config;
73
- $[4] = t3;
77
+ $[4] = t5;
74
78
  } else {
75
- t3 = $[4];
79
+ t5 = $[4];
76
80
  }
77
- const [enabledCollections] = React.useState(t3);
81
+ const [enabledCollections] = React.useState(t5);
78
82
  if (enabledCollections.length === 0) {
79
83
  return null;
80
84
  }
81
- let t4;
82
- if ($[5] !== FolderDocumentDrawer || $[6] !== buttonLabel || $[7] !== closeFolderDrawer || $[8] !== closeModal || $[9] !== collectionSlugs || $[10] !== createCollectionSlug || $[11] !== enabledCollections || $[12] !== folderAssignedCollections || $[13] !== folderCollectionConfig.slug || $[14] !== folderFieldName || $[15] !== folderID || $[16] !== i18n || $[17] !== newDocInFolderDrawerSlug || $[18] !== onCreateSuccess || $[19] !== openFolderDrawer || $[20] !== openModal) {
83
- t4 = _jsxs(React.Fragment, {
85
+ let t6;
86
+ if ($[5] !== FolderDocumentDrawer || $[6] !== buttonLabel || $[7] !== buttonSize || $[8] !== buttonStyle || $[9] !== closeFolderDrawer || $[10] !== closeModal || $[11] !== collectionSlugs || $[12] !== createCollectionSlug || $[13] !== enabledCollections || $[14] !== folderAssignedCollections || $[15] !== folderCollectionConfig.slug || $[16] !== folderFieldName || $[17] !== folderID || $[18] !== i18n || $[19] !== newDocInFolderDrawerSlug || $[20] !== onCreateSuccess || $[21] !== openFolderDrawer || $[22] !== openModal) {
87
+ t6 = _jsxs(React.Fragment, {
84
88
  children: [enabledCollections.length === 1 ? _jsx(Button, {
85
- buttonStyle: "pill",
89
+ buttonStyle,
86
90
  className: `${baseClass}__button`,
87
91
  el: "div",
88
92
  onClick: () => {
@@ -93,15 +97,15 @@ export function ListCreateNewDocInFolderButton(t0) {
93
97
  openModal(newDocInFolderDrawerSlug);
94
98
  }
95
99
  },
96
- size: "small",
100
+ size: buttonSize,
97
101
  children: buttonLabel
98
102
  }) : _jsx(Popup, {
99
103
  button: _jsx(Button, {
100
- buttonStyle: "pill",
104
+ buttonStyle,
101
105
  className: `${baseClass}__popup-button`,
102
106
  el: "div",
103
107
  icon: "chevron",
104
- size: "small",
108
+ size: buttonSize,
105
109
  children: buttonLabel
106
110
  }),
107
111
  buttonType: "default",
@@ -125,10 +129,10 @@ export function ListCreateNewDocInFolderButton(t0) {
125
129
  initialData: {
126
130
  [folderFieldName]: folderID
127
131
  },
128
- onSave: async t5 => {
132
+ onSave: async t7 => {
129
133
  const {
130
134
  doc
131
- } = t5;
135
+ } = t7;
132
136
  await onCreateSuccess({
133
137
  collectionSlug: createCollectionSlug,
134
138
  doc
@@ -153,24 +157,26 @@ export function ListCreateNewDocInFolderButton(t0) {
153
157
  });
154
158
  $[5] = FolderDocumentDrawer;
155
159
  $[6] = buttonLabel;
156
- $[7] = closeFolderDrawer;
157
- $[8] = closeModal;
158
- $[9] = collectionSlugs;
159
- $[10] = createCollectionSlug;
160
- $[11] = enabledCollections;
161
- $[12] = folderAssignedCollections;
162
- $[13] = folderCollectionConfig.slug;
163
- $[14] = folderFieldName;
164
- $[15] = folderID;
165
- $[16] = i18n;
166
- $[17] = newDocInFolderDrawerSlug;
167
- $[18] = onCreateSuccess;
168
- $[19] = openFolderDrawer;
169
- $[20] = openModal;
170
- $[21] = t4;
160
+ $[7] = buttonSize;
161
+ $[8] = buttonStyle;
162
+ $[9] = closeFolderDrawer;
163
+ $[10] = closeModal;
164
+ $[11] = collectionSlugs;
165
+ $[12] = createCollectionSlug;
166
+ $[13] = enabledCollections;
167
+ $[14] = folderAssignedCollections;
168
+ $[15] = folderCollectionConfig.slug;
169
+ $[16] = folderFieldName;
170
+ $[17] = folderID;
171
+ $[18] = i18n;
172
+ $[19] = newDocInFolderDrawerSlug;
173
+ $[20] = onCreateSuccess;
174
+ $[21] = openFolderDrawer;
175
+ $[22] = openModal;
176
+ $[23] = t6;
171
177
  } else {
172
- t4 = $[21];
178
+ t6 = $[23];
173
179
  }
174
- return t4;
180
+ return t6;
175
181
  }
176
182
  //# sourceMappingURL=ListCreateNewDocInFolderButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ListCreateNewDocInFolderButton.js","names":["c","_c","useModal","getTranslation","React","useConfig","useFolder","useTranslation","Button","DocumentDrawer","useDocumentDrawer","Popup","PopupList","baseClass","ListCreateNewDocInFolderButton","t0","$","buttonLabel","collectionSlugs","folderAssignedCollections","onCreateSuccess","slugPrefix","newDocInFolderDrawerSlug","i18n","closeModal","openModal","config","folderCollectionConfig","folderCollectionSlug","folderFieldName","folderID","t1","collectionSlug","FolderDocumentDrawer","t2","closeDrawer","closeFolderDrawer","openDrawer","openFolderDrawer","createCollectionSlug","setCreateCollectionSlug","useState","t3","reduce","acc","collectionConfig","collections","find","t4","slug","push","enabledCollections","length","_jsxs","Fragment","children","_jsx","buttonStyle","className","el","onClick","size","button","icon","ButtonGroup","map","collection","index","labels","singular","drawerSlug","initialData","onSave","t5","doc","redirectAfterCreate","includes","folderType","result"],"sources":["../../../../src/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.tsx"],"sourcesContent":["'use client'\n\nimport type { ClientCollectionConfig, CollectionSlug } from 'payload'\n\nimport { useModal } from '@faceless-ui/modal'\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\n\nimport { useConfig } from '../../../providers/Config/index.js'\nimport { useFolder } from '../../../providers/Folders/index.js'\nimport { useTranslation } from '../../../providers/Translation/index.js'\nimport { Button } from '../../Button/index.js'\nimport { DocumentDrawer, useDocumentDrawer } from '../../DocumentDrawer/index.js'\nimport { Popup, PopupList } from '../../Popup/index.js'\n\nconst baseClass = 'create-new-doc-in-folder'\n\nexport function ListCreateNewDocInFolderButton({\n buttonLabel,\n collectionSlugs,\n folderAssignedCollections,\n onCreateSuccess,\n slugPrefix,\n}: {\n buttonLabel: string\n collectionSlugs: CollectionSlug[]\n folderAssignedCollections: CollectionSlug[]\n onCreateSuccess: (args: {\n collectionSlug: CollectionSlug\n doc: Record<string, unknown>\n }) => Promise<void> | void\n slugPrefix: string\n}) {\n const newDocInFolderDrawerSlug = `${slugPrefix}-new-doc-in-folder-drawer`\n const { i18n } = useTranslation()\n const { closeModal, openModal } = useModal()\n const { config } = useConfig()\n const { folderCollectionConfig, folderCollectionSlug, folderFieldName, folderID } = useFolder()\n const [FolderDocumentDrawer, , { closeDrawer: closeFolderDrawer, openDrawer: openFolderDrawer }] =\n useDocumentDrawer({\n collectionSlug: folderCollectionSlug,\n })\n const [createCollectionSlug, setCreateCollectionSlug] = React.useState<string | undefined>()\n const [enabledCollections] = React.useState<ClientCollectionConfig[]>(() =>\n collectionSlugs.reduce((acc, collectionSlug) => {\n const collectionConfig = config.collections.find(({ slug }) => slug === collectionSlug)\n if (collectionConfig) {\n acc.push(collectionConfig)\n }\n return acc\n }, []),\n )\n\n if (enabledCollections.length === 0) {\n return null\n }\n\n return (\n <React.Fragment>\n {enabledCollections.length === 1 ? (\n // If there is only 1 option, do not render a popup\n <Button\n buttonStyle=\"pill\"\n className={`${baseClass}__button`}\n el=\"div\"\n onClick={() => {\n if (enabledCollections[0].slug === folderCollectionConfig.slug) {\n openFolderDrawer()\n } else {\n setCreateCollectionSlug(enabledCollections[0].slug)\n openModal(newDocInFolderDrawerSlug)\n }\n }}\n size=\"small\"\n >\n {buttonLabel}\n </Button>\n ) : (\n <Popup\n button={\n <Button\n buttonStyle=\"pill\"\n className={`${baseClass}__popup-button`}\n el=\"div\"\n icon=\"chevron\"\n size=\"small\"\n >\n {buttonLabel}\n </Button>\n }\n buttonType=\"default\"\n className={`${baseClass}__action-popup`}\n >\n <PopupList.ButtonGroup>\n {enabledCollections.map((collection, index) => {\n return (\n <PopupList.Button\n key={index}\n onClick={() => {\n if (collection.slug === folderCollectionConfig.slug) {\n openFolderDrawer()\n } else {\n setCreateCollectionSlug(collection.slug)\n openModal(newDocInFolderDrawerSlug)\n }\n }}\n >\n {getTranslation(collection.labels.singular, i18n)}\n </PopupList.Button>\n )\n })}\n </PopupList.ButtonGroup>\n </Popup>\n )}\n\n {createCollectionSlug && (\n <DocumentDrawer\n collectionSlug={createCollectionSlug}\n drawerSlug={newDocInFolderDrawerSlug}\n initialData={{\n [folderFieldName]: folderID,\n }}\n onSave={async ({ doc }) => {\n await onCreateSuccess({\n collectionSlug: createCollectionSlug,\n doc,\n })\n closeModal(newDocInFolderDrawerSlug)\n }}\n redirectAfterCreate={false}\n />\n )}\n\n {collectionSlugs.includes(folderCollectionConfig.slug) && (\n <FolderDocumentDrawer\n initialData={{\n [folderFieldName]: folderID,\n folderType: createCollectionSlug\n ? folderAssignedCollections || [createCollectionSlug]\n : folderAssignedCollections,\n }}\n onSave={async (result) => {\n await onCreateSuccess({\n collectionSlug: folderCollectionConfig.slug,\n doc: result.doc,\n })\n closeFolderDrawer()\n }}\n redirectAfterCreate={false}\n />\n )}\n </React.Fragment>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAIA,SAASC,QAAQ,QAAQ;AACzB,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAElB,SAASC,SAAS,QAAQ;AAC1B,SAASC,SAAS,QAAQ;AAC1B,SAASC,cAAc,QAAQ;AAC/B,SAASC,MAAM,QAAQ;AACvB,SAASC,cAAc,EAAEC,iBAAiB,QAAQ;AAClD,SAASC,KAAK,EAAEC,SAAS,QAAQ;AAEjC,MAAMC,SAAA,GAAY;AAElB,OAAO,SAAAC,+BAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAf,EAAA;EAAwC;IAAAgB,WAAA;IAAAC,eAAA;IAAAC,yBAAA;IAAAC,eAAA;IAAAC;EAAA,IAAAN,EAe9C;EACC,MAAAO,wBAAA,GAAiC,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QAAAuC,mBAAA;MAAA,C;;;;;;;;;;;;;;;;;;;;;;SAxFR3B,E","ignoreList":[]}
1
+ {"version":3,"file":"ListCreateNewDocInFolderButton.js","names":["c","_c","useModal","getTranslation","React","useConfig","useFolder","useTranslation","Button","DocumentDrawer","useDocumentDrawer","Popup","PopupList","baseClass","ListCreateNewDocInFolderButton","t0","$","buttonLabel","buttonSize","t1","buttonStyle","t2","collectionSlugs","folderAssignedCollections","onCreateSuccess","slugPrefix","undefined","newDocInFolderDrawerSlug","i18n","closeModal","openModal","config","folderCollectionConfig","folderCollectionSlug","folderFieldName","folderID","t3","collectionSlug","FolderDocumentDrawer","t4","closeDrawer","closeFolderDrawer","openDrawer","openFolderDrawer","createCollectionSlug","setCreateCollectionSlug","useState","t5","reduce","acc","collectionConfig","collections","find","t6","slug","push","enabledCollections","length","_jsxs","Fragment","children","_jsx","className","el","onClick","size","button","icon","ButtonGroup","map","collection","index","labels","singular","drawerSlug","initialData","onSave","t7","doc","redirectAfterCreate","includes","folderType","result"],"sources":["../../../../src/elements/ListHeader/TitleActions/ListCreateNewDocInFolderButton.tsx"],"sourcesContent":["'use client'\n\nimport type { ClientCollectionConfig, CollectionSlug } from 'payload'\n\nimport { useModal } from '@faceless-ui/modal'\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\n\nimport { useConfig } from '../../../providers/Config/index.js'\nimport { useFolder } from '../../../providers/Folders/index.js'\nimport { useTranslation } from '../../../providers/Translation/index.js'\nimport { Button } from '../../Button/index.js'\nimport { DocumentDrawer, useDocumentDrawer } from '../../DocumentDrawer/index.js'\nimport { Popup, PopupList } from '../../Popup/index.js'\n\nconst baseClass = 'create-new-doc-in-folder'\n\nexport function ListCreateNewDocInFolderButton({\n buttonLabel,\n buttonSize = 'small',\n buttonStyle = 'pill',\n collectionSlugs,\n folderAssignedCollections,\n onCreateSuccess,\n slugPrefix,\n}: {\n buttonLabel: string\n buttonSize?: 'large' | 'medium' | 'small' | 'xsmall'\n buttonStyle?:\n | 'error'\n | 'icon-label'\n | 'none'\n | 'pill'\n | 'primary'\n | 'secondary'\n | 'subtle'\n | 'tab'\n | 'transparent'\n collectionSlugs: CollectionSlug[]\n folderAssignedCollections: CollectionSlug[]\n onCreateSuccess: (args: {\n collectionSlug: CollectionSlug\n doc: Record<string, unknown>\n }) => Promise<void> | void\n slugPrefix: string\n}) {\n const newDocInFolderDrawerSlug = `${slugPrefix}-new-doc-in-folder-drawer`\n const { i18n } = useTranslation()\n const { closeModal, openModal } = useModal()\n const { config } = useConfig()\n const { folderCollectionConfig, folderCollectionSlug, folderFieldName, folderID } = useFolder()\n const [FolderDocumentDrawer, , { closeDrawer: closeFolderDrawer, openDrawer: openFolderDrawer }] =\n useDocumentDrawer({\n collectionSlug: folderCollectionSlug,\n })\n const [createCollectionSlug, setCreateCollectionSlug] = React.useState<string | undefined>()\n const [enabledCollections] = React.useState<ClientCollectionConfig[]>(() =>\n collectionSlugs.reduce((acc, collectionSlug) => {\n const collectionConfig = config.collections.find(({ slug }) => slug === collectionSlug)\n if (collectionConfig) {\n acc.push(collectionConfig)\n }\n return acc\n }, []),\n )\n\n if (enabledCollections.length === 0) {\n return null\n }\n\n return (\n <React.Fragment>\n {enabledCollections.length === 1 ? (\n // If there is only 1 option, do not render a popup\n <Button\n buttonStyle={buttonStyle}\n className={`${baseClass}__button`}\n el=\"div\"\n onClick={() => {\n if (enabledCollections[0].slug === folderCollectionConfig.slug) {\n openFolderDrawer()\n } else {\n setCreateCollectionSlug(enabledCollections[0].slug)\n openModal(newDocInFolderDrawerSlug)\n }\n }}\n size={buttonSize}\n >\n {buttonLabel}\n </Button>\n ) : (\n <Popup\n button={\n <Button\n buttonStyle={buttonStyle}\n className={`${baseClass}__popup-button`}\n el=\"div\"\n icon=\"chevron\"\n size={buttonSize}\n >\n {buttonLabel}\n </Button>\n }\n buttonType=\"default\"\n className={`${baseClass}__action-popup`}\n >\n <PopupList.ButtonGroup>\n {enabledCollections.map((collection, index) => {\n return (\n <PopupList.Button\n key={index}\n onClick={() => {\n if (collection.slug === folderCollectionConfig.slug) {\n openFolderDrawer()\n } else {\n setCreateCollectionSlug(collection.slug)\n openModal(newDocInFolderDrawerSlug)\n }\n }}\n >\n {getTranslation(collection.labels.singular, i18n)}\n </PopupList.Button>\n )\n })}\n </PopupList.ButtonGroup>\n </Popup>\n )}\n\n {createCollectionSlug && (\n <DocumentDrawer\n collectionSlug={createCollectionSlug}\n drawerSlug={newDocInFolderDrawerSlug}\n initialData={{\n [folderFieldName]: folderID,\n }}\n onSave={async ({ doc }) => {\n await onCreateSuccess({\n collectionSlug: createCollectionSlug,\n doc,\n })\n closeModal(newDocInFolderDrawerSlug)\n }}\n redirectAfterCreate={false}\n />\n )}\n\n {collectionSlugs.includes(folderCollectionConfig.slug) && (\n <FolderDocumentDrawer\n initialData={{\n [folderFieldName]: folderID,\n folderType: createCollectionSlug\n ? folderAssignedCollections || [createCollectionSlug]\n : folderAssignedCollections,\n }}\n onSave={async (result) => {\n await onCreateSuccess({\n collectionSlug: folderCollectionConfig.slug,\n doc: result.doc,\n })\n closeFolderDrawer()\n }}\n redirectAfterCreate={false}\n />\n )}\n </React.Fragment>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAIA,SAASC,QAAQ,QAAQ;AACzB,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAElB,SAASC,SAAS,QAAQ;AAC1B,SAASC,SAAS,QAAQ;AAC1B,SAASC,cAAc,QAAQ;AAC/B,SAASC,MAAM,QAAQ;AACvB,SAASC,cAAc,EAAEC,iBAAiB,QAAQ;AAClD,SAASC,KAAK,EAAEC,SAAS,QAAQ;AAEjC,MAAMC,SAAA,GAAY;AAElB,OAAO,SAAAC,+BAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAf,EAAA;EAAwC;IAAAgB,WAAA;IAAAC,UAAA,EAAAC,EAAA;IAAAC,WAAA,EAAAC,EAAA;IAAAC,eAAA;IAAAC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,CAACvB,oBAAA;QAAAqC,WAAA;UAAA,CAEIzC,eAAA,GAAkBC,QAAA;UAAA8C,UAAA,EACPrC,oBAAA,GACRrB,yBAAA,KAA8BqB,oBAAA,CAAqB,GACnDrB;QAAA;QAAAqD,MAAA,QAAAM,MAAA;UAAA,MAGE1D,eAAA;YAAAa,cAAA,EACYL,sBAAA,CAAAsB,IAAA;YAAAwB,GAAA,EACXI,MAAA,CAAAJ;UAAA,CACP;UACArC,iBAAA;QAAA;QAAAsC,mBAAA;MAAA,C;;;;;;;;;;;;;;;;;;;;;;;;SAxFR1B,E","ignoreList":[]}
@@ -1,12 +1,22 @@
1
1
  .no-results {
2
- padding: calc(var(--base) * 2) var(--base);
2
+ padding-top: calc(var(--base) / 2);
3
3
  display: flex;
4
4
  flex-direction: column;
5
- align-items: center;
5
+ align-items: flex-start;
6
6
  justify-content: center;
7
- border: 1px dashed var(--theme-border-color);
8
7
  border-radius: var(--style-radius-m);
9
- text-align: center;
8
+
9
+ h3 {
10
+ margin: 0;
11
+ }
12
+
13
+ p {
14
+ margin: calc(var(--base) / 2) 0 0 0;
15
+
16
+ &:first-child {
17
+ margin-top: 0;
18
+ }
19
+ }
10
20
 
11
21
  &__actions {
12
22
  display: flex;
@@ -25,7 +25,7 @@ export const DrawerLink = t0 => {
25
25
  }), _jsx("button", {
26
26
  className: "drawer-link__doc-drawer-toggler",
27
27
  onClick: () => {
28
- onDrawerOpen(cellProps.rowData.id);
28
+ onDrawerOpen(cellProps.rowData.id, cellProps.collectionSlug);
29
29
  },
30
30
  type: "button",
31
31
  children: _jsx(EditIcon, {})
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","React","EditIcon","useCellProps","DefaultCell","DrawerLink","t0","$","onDrawerOpen","cellProps","t1","_jsxs","className","children","_jsx","link","onClick","rowData","id","type"],"sources":["../../../../../src/elements/RelationshipTable/cells/DrawerLink/index.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\n\nimport type { OnDrawerOpen } from '../../index.js'\n\nimport { EditIcon } from '../../../../icons/Edit/index.js'\nimport { useCellProps } from '../../../../providers/TableColumns/RenderDefaultCell/index.js'\nimport { DefaultCell } from '../../../Table/DefaultCell/index.js'\nimport './index.scss'\n\nexport const DrawerLink: React.FC<{\n currentDrawerID?: string\n onDrawerOpen: OnDrawerOpen\n}> = ({ onDrawerOpen }) => {\n const cellProps = useCellProps()\n\n return (\n <div className=\"drawer-link\">\n <DefaultCell {...cellProps} className=\"drawer-link__cell\" link={false} onClick={null} />\n <button\n className=\"drawer-link__doc-drawer-toggler\"\n onClick={() => {\n onDrawerOpen(cellProps.rowData.id)\n }}\n type=\"button\"\n >\n <EditIcon />\n </button>\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAEA,OAAOC,KAAA,MAAW;AAIlB,SAASC,QAAQ,QAAQ;AACzB,SAASC,YAAY,QAAQ;AAC7B,SAASC,WAAW,QAAQ;AAC5B,OAAO;AAEP,OAAO,MAAMC,UAAA,GAGRC,EAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EAAC;IAAAQ;EAAA,IAAAF,EAAgB;EACpB,MAAAG,SAAA,GAAkBN,YAAA;EAAA,IAAAO,EAAA;EAAA,IAAAH,CAAA,QAAAE,SAAA,IAAAF,CAAA,QAAAC,YAAA;IAGhBE,EAAA,GAAAC,KAAA,CAAC;MAAAC,SAAA,EAAc;MAAAC,QAAA,GACbC,IAAA,CAAAV,WAAA;QAAA,GAAiBK,SAAS;QAAAG,SAAA,EAAY;QAAAG,IAAA;QAAAC,OAAA;MAAA,C,GACtCF,IAAA,CAAC;QAAAF,SAAA,EACW;QAAAI,OAAA,EAAAA,CAAA;UAERR,YAAA,CAAaC,SAAA,CAAAQ,OAAA,CAAAC,EAAoB;QAAA;QAAAC,IAAA,EAE9B;QAAAN,QAAA,EAELC,IAAA,CAAAZ,QAAA,IAAC;MAAA,C;;;;;;;;SATLQ,E;CAaJ","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["c","_c","React","EditIcon","useCellProps","DefaultCell","DrawerLink","t0","$","onDrawerOpen","cellProps","t1","_jsxs","className","children","_jsx","link","onClick","rowData","id","collectionSlug","type"],"sources":["../../../../../src/elements/RelationshipTable/cells/DrawerLink/index.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\n\nimport type { OnDrawerOpen } from '../../index.js'\n\nimport { EditIcon } from '../../../../icons/Edit/index.js'\nimport { useCellProps } from '../../../../providers/TableColumns/RenderDefaultCell/index.js'\nimport { DefaultCell } from '../../../Table/DefaultCell/index.js'\nimport './index.scss'\n\nexport const DrawerLink: React.FC<{\n currentDrawerID?: string\n onDrawerOpen: OnDrawerOpen\n}> = ({ onDrawerOpen }) => {\n const cellProps = useCellProps()\n\n return (\n <div className=\"drawer-link\">\n <DefaultCell {...cellProps} className=\"drawer-link__cell\" link={false} onClick={null} />\n <button\n className=\"drawer-link__doc-drawer-toggler\"\n onClick={() => {\n onDrawerOpen(cellProps.rowData.id, cellProps.collectionSlug)\n }}\n type=\"button\"\n >\n <EditIcon />\n </button>\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAEA,OAAOC,KAAA,MAAW;AAIlB,SAASC,QAAQ,QAAQ;AACzB,SAASC,YAAY,QAAQ;AAC7B,SAASC,WAAW,QAAQ;AAC5B,OAAO;AAEP,OAAO,MAAMC,UAAA,GAGRC,EAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EAAC;IAAAQ;EAAA,IAAAF,EAAgB;EACpB,MAAAG,SAAA,GAAkBN,YAAA;EAAA,IAAAO,EAAA;EAAA,IAAAH,CAAA,QAAAE,SAAA,IAAAF,CAAA,QAAAC,YAAA;IAGhBE,EAAA,GAAAC,KAAA,CAAC;MAAAC,SAAA,EAAc;MAAAC,QAAA,GACbC,IAAA,CAAAV,WAAA;QAAA,GAAiBK,SAAS;QAAAG,SAAA,EAAY;QAAAG,IAAA;QAAAC,OAAA;MAAA,C,GACtCF,IAAA,CAAC;QAAAF,SAAA,EACW;QAAAI,OAAA,EAAAA,CAAA;UAERR,YAAA,CAAaC,SAAA,CAAAQ,OAAA,CAAAC,EAAA,EAAsBT,SAAA,CAAAU,cAAwB;QAAA;QAAAC,IAAA,EAExD;QAAAP,QAAA,EAELC,IAAA,CAAAZ,QAAA,IAAC;MAAA,C;;;;;;;;SATLQ,E;CAaJ","ignoreList":[]}
@@ -20,7 +20,7 @@ type RelationshipTableComponentProps = {
20
20
  };
21
21
  readonly relationTo: string | string[];
22
22
  };
23
- export type OnDrawerOpen = (id?: string) => void;
23
+ export type OnDrawerOpen = (id?: string, collectionSlug?: string) => void;
24
24
  export declare const RelationshipTable: React.FC<RelationshipTableComponentProps>;
25
25
  export {};
26
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/RelationshipTable/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,eAAe,EAEpB,KAAK,aAAa,EAClB,KAAK,KAAK,EACX,MAAM,SAAS,CAAA;AAEhB,OAAO,KAA6D,MAAM,OAAO,CAAA;AAEjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAkBrE,OAAO,cAAc,CAAA;AAIrB,KAAK,+BAA+B,GAAG;IACrC,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtC,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAA;IAC/B,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAA;IAC/B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,aAAa,CAAC,EAAE,KAAK,C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AAA;IAC3B,QAAQ,CAAC,aAAa,CAAC,EAAE,KAAK,CAAA;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,aAAa,CAAA;IACpC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAA;IAC/D,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE;QAChB,cAAc,EAAE,cAAc,CAAA;QAC9B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;QACnB,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CACvC,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;AAEzE,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,+BAA+B,CA6VvE,CAAA"}
@@ -156,13 +156,18 @@ export const RelationshipTable = props => {
156
156
  });
157
157
  setCurrentDrawerID(undefined);
158
158
  }, [data, renderTable]);
159
- const onDrawerOpen = useCallback(id => {
159
+ const onDrawerOpen = useCallback((id, collectionSlug) => {
160
160
  openDrawerWhenRelationChanges.current = true;
161
161
  if (id) {
162
162
  setCurrentDrawerID(id);
163
163
  } else {
164
164
  setCurrentDrawerID(undefined);
165
165
  }
166
+ if (collectionSlug) {
167
+ setSelectedCollection(collectionSlug);
168
+ } else {
169
+ setSelectedCollection(undefined);
170
+ }
166
171
  }, []);
167
172
  useEffect(() => {
168
173
  if (openDrawerWhenRelationChanges.current) {