@payloadcms/next 3.44.0-canary.9 → 3.44.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.
- package/dist/auth/logout.d.ts +4 -2
- package/dist/auth/logout.d.ts.map +1 -1
- package/dist/auth/logout.js +26 -7
- package/dist/auth/logout.js.map +1 -1
- package/dist/auth/refresh.d.ts +1 -3
- package/dist/auth/refresh.d.ts.map +1 -1
- package/dist/auth/refresh.js +24 -12
- package/dist/auth/refresh.js.map +1 -1
- package/dist/dummy.css +0 -0
- package/dist/prod/styles.css +1 -1
- package/dist/views/List/handleServerFunction.d.ts +2 -2
- package/dist/views/List/handleServerFunction.d.ts.map +1 -1
- package/dist/views/List/handleServerFunction.js +1 -1
- package/dist/views/List/handleServerFunction.js.map +1 -1
- package/dist/views/List/index.js +10 -10
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.js +1 -0
- package/dist/views/LivePreview/Toolbar/Controls/index.js.map +1 -1
- package/dist/views/Root/getCustomViewByRoute.d.ts.map +1 -1
- package/dist/views/Root/getCustomViewByRoute.js +1 -1
- package/dist/views/Root/getCustomViewByRoute.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CollectionPreferences, ListQuery, ServerFunction } from 'payload';
|
|
2
2
|
type RenderListResult = {
|
|
3
3
|
List: React.ReactNode;
|
|
4
|
-
preferences:
|
|
4
|
+
preferences: CollectionPreferences;
|
|
5
5
|
};
|
|
6
6
|
export declare const renderListHandler: ServerFunction<{
|
|
7
7
|
collectionSlug: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleServerFunction.d.ts","sourceRoot":"","sources":["../../../src/views/List/handleServerFunction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"handleServerFunction.d.ts","sourceRoot":"","sources":["../../../src/views/List/handleServerFunction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,cAAc,EAAmB,MAAM,SAAS,CAAA;AAQhG,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,WAAW,EAAE,qBAAqB,CAAA;CACnC,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAC5C;IACE,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC,KAAK,EAAE,SAAS,CAAA;IAChB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,sBAAsB,EAAE,OAAO,CAAA;CAChC,EACD,OAAO,CAAC,gBAAgB,CAAC,CAgJ1B,CAAA"}
|
|
@@ -61,7 +61,7 @@ export const renderListHandler = async args => {
|
|
|
61
61
|
i18n,
|
|
62
62
|
importMap: payload.importMap
|
|
63
63
|
});
|
|
64
|
-
const preferencesKey =
|
|
64
|
+
const preferencesKey = `collection-${collectionSlug}`;
|
|
65
65
|
const preferences = await payload.find({
|
|
66
66
|
collection: 'payload-preferences',
|
|
67
67
|
depth: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleServerFunction.js","names":["getClientConfig","headers","getHeaders","getAccessResults","isEntityHidden","parseCookies","renderListView","renderListHandler","args","collectionSlug","disableActions","disableBulkDelete","disableBulkEdit","disableQueryPresets","drawerSlug","enableRowSelections","overrideEntityVisibility","query","redirectAfterDelete","redirectAfterDuplicate","req","i18n","payload","config","user","cookies","incomingUserSlug","collection","adminUserSlug","admin","adminAccessFunction","collections","access","canAccessAdmin","Error","hasUsers","find","depth","limit","pagination","docs","length","clientConfig","importMap","preferencesKey","preferences","where","and","key","equals","id","then","res","value","visibleEntities","map","slug","hidden","filter","Boolean","globals","permissions","List","initPageResult","collectionConfig","globalConfig","global","languageOptions","undefined","translations","params","segments","searchParams","viewType"],"sources":["../../../src/views/List/handleServerFunction.tsx"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"handleServerFunction.js","names":["getClientConfig","headers","getHeaders","getAccessResults","isEntityHidden","parseCookies","renderListView","renderListHandler","args","collectionSlug","disableActions","disableBulkDelete","disableBulkEdit","disableQueryPresets","drawerSlug","enableRowSelections","overrideEntityVisibility","query","redirectAfterDelete","redirectAfterDuplicate","req","i18n","payload","config","user","cookies","incomingUserSlug","collection","adminUserSlug","admin","adminAccessFunction","collections","access","canAccessAdmin","Error","hasUsers","find","depth","limit","pagination","docs","length","clientConfig","importMap","preferencesKey","preferences","where","and","key","equals","id","then","res","value","visibleEntities","map","slug","hidden","filter","Boolean","globals","permissions","List","initPageResult","collectionConfig","globalConfig","global","languageOptions","undefined","translations","params","segments","searchParams","viewType"],"sources":["../../../src/views/List/handleServerFunction.tsx"],"sourcesContent":["import type { CollectionPreferences, ListQuery, ServerFunction, VisibleEntities } from 'payload'\n\nimport { getClientConfig } from '@payloadcms/ui/utilities/getClientConfig'\nimport { headers as getHeaders } from 'next/headers.js'\nimport { getAccessResults, isEntityHidden, parseCookies } from 'payload'\n\nimport { renderListView } from './index.js'\n\ntype RenderListResult = {\n List: React.ReactNode\n preferences: CollectionPreferences\n}\n\nexport const renderListHandler: ServerFunction<\n {\n collectionSlug: string\n disableActions?: boolean\n disableBulkDelete?: boolean\n disableBulkEdit?: boolean\n disableQueryPresets?: boolean\n documentDrawerSlug: string\n drawerSlug?: string\n enableRowSelections: boolean\n overrideEntityVisibility?: boolean\n query: ListQuery\n redirectAfterDelete: boolean\n redirectAfterDuplicate: boolean\n },\n Promise<RenderListResult>\n> = async (args) => {\n const {\n collectionSlug,\n disableActions,\n disableBulkDelete,\n disableBulkEdit,\n disableQueryPresets,\n drawerSlug,\n enableRowSelections,\n overrideEntityVisibility,\n query,\n redirectAfterDelete,\n redirectAfterDuplicate,\n req,\n req: {\n i18n,\n payload,\n payload: { config },\n user,\n },\n } = args\n\n const headers = await getHeaders()\n\n const cookies = parseCookies(headers)\n\n const incomingUserSlug = user?.collection\n\n const adminUserSlug = config.admin.user\n\n // If we have a user slug, test it against the functions\n if (incomingUserSlug) {\n const adminAccessFunction = payload.collections[incomingUserSlug].config.access?.admin\n\n // Run the admin access function from the config if it exists\n if (adminAccessFunction) {\n const canAccessAdmin = await adminAccessFunction({ req })\n\n if (!canAccessAdmin) {\n throw new Error('Unauthorized')\n }\n // Match the user collection to the global admin config\n } else if (adminUserSlug !== incomingUserSlug) {\n throw new Error('Unauthorized')\n }\n } else {\n const hasUsers = await payload.find({\n collection: adminUserSlug,\n depth: 0,\n limit: 1,\n pagination: false,\n })\n\n // If there are users, we should not allow access because of /create-first-user\n if (hasUsers.docs.length) {\n throw new Error('Unauthorized')\n }\n }\n\n const clientConfig = getClientConfig({\n config,\n i18n,\n importMap: payload.importMap,\n })\n\n const preferencesKey = `collection-${collectionSlug}`\n\n const preferences = await payload\n .find({\n collection: 'payload-preferences',\n depth: 0,\n limit: 1,\n where: {\n and: [\n {\n key: {\n equals: preferencesKey,\n },\n },\n {\n 'user.relationTo': {\n equals: user.collection,\n },\n },\n {\n 'user.value': {\n equals: user.id,\n },\n },\n ],\n },\n })\n .then((res) => res.docs[0]?.value as CollectionPreferences)\n\n const visibleEntities: VisibleEntities = {\n collections: payload.config.collections\n .map(({ slug, admin: { hidden } }) => (!isEntityHidden({ hidden, user }) ? slug : null))\n .filter(Boolean),\n globals: payload.config.globals\n .map(({ slug, admin: { hidden } }) => (!isEntityHidden({ hidden, user }) ? slug : null))\n .filter(Boolean),\n }\n\n const permissions = await getAccessResults({\n req,\n })\n\n const { List } = await renderListView({\n clientConfig,\n disableActions,\n disableBulkDelete,\n disableBulkEdit,\n disableQueryPresets,\n drawerSlug,\n enableRowSelections,\n i18n,\n importMap: payload.importMap,\n initPageResult: {\n collectionConfig: payload?.collections?.[collectionSlug]?.config,\n cookies,\n globalConfig: payload.config.globals.find((global) => global.slug === collectionSlug),\n languageOptions: undefined, // TODO\n permissions,\n req,\n translations: undefined, // TODO\n visibleEntities,\n },\n overrideEntityVisibility,\n params: {\n segments: ['collections', collectionSlug],\n },\n payload,\n query,\n redirectAfterDelete,\n redirectAfterDuplicate,\n searchParams: {},\n viewType: 'list',\n })\n\n return {\n List,\n preferences,\n }\n}\n"],"mappings":"AAEA,SAASA,eAAe,QAAQ;AAChC,SAASC,OAAA,IAAWC,UAAU,QAAQ;AACtC,SAASC,gBAAgB,EAAEC,cAAc,EAAEC,YAAY,QAAQ;AAE/D,SAASC,cAAc,QAAQ;AAO/B,OAAO,MAAMC,iBAAA,GAgBT,MAAOC,IAAA;EACT,MAAM;IACJC,cAAc;IACdC,cAAc;IACdC,iBAAiB;IACjBC,eAAe;IACfC,mBAAmB;IACnBC,UAAU;IACVC,mBAAmB;IACnBC,wBAAwB;IACxBC,KAAK;IACLC,mBAAmB;IACnBC,sBAAsB;IACtBC,GAAG;IACHA,GAAA,EAAK;MACHC,IAAI;MACJC,OAAO;MACPA,OAAA,EAAS;QAAEC;MAAM,CAAE;MACnBC;IAAI;EACL,CACF,GAAGhB,IAAA;EAEJ,MAAMP,OAAA,GAAU,MAAMC,UAAA;EAEtB,MAAMuB,OAAA,GAAUpB,YAAA,CAAaJ,OAAA;EAE7B,MAAMyB,gBAAA,GAAmBF,IAAA,EAAMG,UAAA;EAE/B,MAAMC,aAAA,GAAgBL,MAAA,CAAOM,KAAK,CAACL,IAAI;EAEvC;EACA,IAAIE,gBAAA,EAAkB;IACpB,MAAMI,mBAAA,GAAsBR,OAA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ACAjB;EACF;AACF","ignoreList":[]}
|
package/dist/views/List/index.js
CHANGED
|
@@ -59,8 +59,8 @@ export const renderListView = async args => {
|
|
|
59
59
|
* This will ensure that prefs are only updated when explicitly set by the user
|
|
60
60
|
* This could potentially be done by injecting a `sessionID` into the params and comparing it against a session cookie
|
|
61
61
|
*/
|
|
62
|
-
const
|
|
63
|
-
key:
|
|
62
|
+
const collectionPreferences = await upsertPreferences({
|
|
63
|
+
key: `collection-${collectionSlug}`,
|
|
64
64
|
req,
|
|
65
65
|
value: {
|
|
66
66
|
columns,
|
|
@@ -79,8 +79,8 @@ export const renderListView = async args => {
|
|
|
79
79
|
throw new Error('not-found');
|
|
80
80
|
}
|
|
81
81
|
const page = isNumber(query?.page) ? Number(query.page) : 0;
|
|
82
|
-
const limit =
|
|
83
|
-
const sort =
|
|
82
|
+
const limit = collectionPreferences?.limit || collectionConfig.admin.pagination.defaultLimit;
|
|
83
|
+
const sort = collectionPreferences?.sort || (typeof collectionConfig.defaultSort === 'string' ? collectionConfig.defaultSort : undefined);
|
|
84
84
|
let where = mergeListSearchAndWhere({
|
|
85
85
|
collectionConfig,
|
|
86
86
|
search: typeof query?.search === 'string' ? query.search : undefined,
|
|
@@ -101,10 +101,10 @@ export const renderListView = async args => {
|
|
|
101
101
|
}
|
|
102
102
|
let queryPreset;
|
|
103
103
|
let queryPresetPermissions;
|
|
104
|
-
if (
|
|
104
|
+
if (collectionPreferences?.preset) {
|
|
105
105
|
try {
|
|
106
106
|
queryPreset = await payload.findByID({
|
|
107
|
-
id:
|
|
107
|
+
id: collectionPreferences?.preset,
|
|
108
108
|
collection: 'payload-query-presets',
|
|
109
109
|
depth: 0,
|
|
110
110
|
overrideAccess: false,
|
|
@@ -146,7 +146,7 @@ export const renderListView = async args => {
|
|
|
146
146
|
} = renderTable({
|
|
147
147
|
clientCollectionConfig,
|
|
148
148
|
collectionConfig,
|
|
149
|
-
columnPreferences:
|
|
149
|
+
columnPreferences: collectionPreferences?.columns,
|
|
150
150
|
columns,
|
|
151
151
|
customCellProps,
|
|
152
152
|
docs: data.docs,
|
|
@@ -175,7 +175,7 @@ export const renderListView = async args => {
|
|
|
175
175
|
data,
|
|
176
176
|
i18n,
|
|
177
177
|
limit,
|
|
178
|
-
listPreferences,
|
|
178
|
+
listPreferences: collectionPreferences,
|
|
179
179
|
listSearchableFields: collectionConfig.admin.listSearchableFields,
|
|
180
180
|
locale: fullLocale,
|
|
181
181
|
params,
|
|
@@ -206,7 +206,7 @@ export const renderListView = async args => {
|
|
|
206
206
|
data: data,
|
|
207
207
|
defaultLimit: limit,
|
|
208
208
|
defaultSort: sort,
|
|
209
|
-
listPreferences:
|
|
209
|
+
listPreferences: collectionPreferences,
|
|
210
210
|
modifySearchParams: !isInDrawer,
|
|
211
211
|
orderableFieldName: collectionConfig.orderable === true ? '_order' : undefined,
|
|
212
212
|
children: RenderServerComponent({
|
|
@@ -219,7 +219,7 @@ export const renderListView = async args => {
|
|
|
219
219
|
disableQueryPresets,
|
|
220
220
|
enableRowSelections,
|
|
221
221
|
hasCreatePermission,
|
|
222
|
-
listPreferences,
|
|
222
|
+
listPreferences: collectionPreferences,
|
|
223
223
|
newDocumentURL,
|
|
224
224
|
queryPreset,
|
|
225
225
|
queryPresetPermissions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DefaultListView","HydrateAuthProvider","ListQueryProvider","RenderServerComponent","renderFilters","renderTable","upsertPreferences","notFound","formatAdminURL","isNumber","mergeListSearchAndWhere","transformColumnsToPreferences","React","Fragment","getDocumentPermissions","renderListViewSlots","resolveAllFilterOptions","renderListView","args","clientConfig","customCellProps","disableBulkDelete","disableBulkEdit","disableQueryPresets","drawerSlug","enableRowSelections","initPageResult","overrideEntityVisibility","params","query","queryFromArgs","searchParams","collectionConfig","slug","collectionSlug","locale","fullLocale","permissions","req","i18n","payload","config","queryFromReq","user","visibleEntities","collections","read","Error","columns","listPreferences","key","value","limit","Number","undefined","preset","sort","routes","admin","adminRoute","includes","page","pagination","defaultLimit","defaultSort","where","search","baseListFilter","and","filter","Boolean","queryPreset","queryPresetPermissions","findByID","id","collection","depth","overrideAccess","find","c","data","then","docPermissions","err","logger","error","draft","fallbackLocale","includeLockStatus","clientCollectionConfig","columnState","Table","columnPreferences","docs","orderableFieldName","orderable","useAsTitle","renderedFilters","fields","importMap","resolvedFilterOptions","staticDescription","description","t","newDocumentURL","path","hasCreatePermission","create","serverProps","listSearchableFields","listViewSlots","clientProps","isInDrawer","List","_jsxs","_jsx","modifySearchParams","Component","components","views","list","Fallback","ListView","RenderedList","message","console"],"sources":["../../../src/views/List/index.tsx"],"sourcesContent":["import type {\n AdminViewServerProps,\n ColumnPreference,\n DefaultDocumentIDType,\n ListPreferences,\n ListQuery,\n ListViewClientProps,\n ListViewServerPropsOnly,\n QueryPreset,\n SanitizedCollectionPermission,\n Where,\n} from 'payload'\n\nimport { DefaultListView, HydrateAuthProvider, ListQueryProvider } from '@payloadcms/ui'\nimport { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent'\nimport { renderFilters, renderTable, upsertPreferences } from '@payloadcms/ui/rsc'\nimport { notFound } from 'next/navigation.js'\nimport {\n formatAdminURL,\n isNumber,\n mergeListSearchAndWhere,\n transformColumnsToPreferences,\n} from 'payload/shared'\nimport React, { Fragment } from 'react'\n\nimport { getDocumentPermissions } from '../Document/getDocumentPermissions.js'\nimport { renderListViewSlots } from './renderListViewSlots.js'\nimport { resolveAllFilterOptions } from './resolveAllFilterOptions.js'\n\ntype RenderListViewArgs = {\n customCellProps?: Record<string, any>\n disableBulkDelete?: boolean\n disableBulkEdit?: boolean\n disableQueryPresets?: boolean\n drawerSlug?: string\n enableRowSelections: boolean\n overrideEntityVisibility?: boolean\n query: ListQuery\n redirectAfterDelete?: boolean\n redirectAfterDuplicate?: boolean\n} & AdminViewServerProps\n\n/**\n * This function is responsible for rendering\n * the list view on the server for both:\n * - default list view\n * - list view within drawers\n */\nexport const renderListView = async (\n args: RenderListViewArgs,\n): Promise<{\n List: React.ReactNode\n}> => {\n const {\n clientConfig,\n customCellProps,\n disableBulkDelete,\n disableBulkEdit,\n disableQueryPresets,\n drawerSlug,\n enableRowSelections,\n initPageResult,\n overrideEntityVisibility,\n params,\n query: queryFromArgs,\n searchParams,\n } = args\n\n const {\n collectionConfig,\n collectionConfig: { slug: collectionSlug },\n locale: fullLocale,\n permissions,\n req,\n req: {\n i18n,\n locale,\n payload,\n payload: { config },\n query: queryFromReq,\n user,\n },\n visibleEntities,\n } = initPageResult\n\n if (!permissions?.collections?.[collectionSlug]?.read) {\n throw new Error('not-found')\n }\n\n const query = queryFromArgs || queryFromReq\n\n const columns: ColumnPreference[] = transformColumnsToPreferences(\n query?.columns as ColumnPreference[] | string,\n )\n\n /**\n * @todo: find a pattern to avoid setting preferences on hard navigation, i.e. direct links, page refresh, etc.\n * This will ensure that prefs are only updated when explicitly set by the user\n * This could potentially be done by injecting a `sessionID` into the params and comparing it against a session cookie\n */\n const listPreferences = await upsertPreferences<ListPreferences>({\n key: `${collectionSlug}-list`,\n req,\n value: {\n columns,\n limit: isNumber(query?.limit) ? Number(query.limit) : undefined,\n preset: (query?.preset as DefaultDocumentIDType) || null,\n sort: query?.sort as string,\n },\n })\n\n const {\n routes: { admin: adminRoute },\n } = config\n\n if (collectionConfig) {\n if (!visibleEntities.collections.includes(collectionSlug) && !overrideEntityVisibility) {\n throw new Error('not-found')\n }\n\n const page = isNumber(query?.page) ? Number(query.page) : 0\n\n const limit = listPreferences?.limit || collectionConfig.admin.pagination.defaultLimit\n\n const sort =\n listPreferences?.sort ||\n (typeof collectionConfig.defaultSort === 'string' ? collectionConfig.defaultSort : undefined)\n\n let where = mergeListSearchAndWhere({\n collectionConfig,\n search: typeof query?.search === 'string' ? query.search : undefined,\n where: (query?.where as Where) || undefined,\n })\n\n if (typeof collectionConfig.admin?.baseListFilter === 'function') {\n const baseListFilter = await collectionConfig.admin.baseListFilter({\n limit,\n page,\n req,\n sort,\n })\n\n if (baseListFilter) {\n where = {\n and: [where, baseListFilter].filter(Boolean),\n }\n }\n }\n\n let queryPreset: QueryPreset | undefined\n let queryPresetPermissions: SanitizedCollectionPermission | undefined\n\n if (listPreferences?.preset) {\n try {\n queryPreset = (await payload.findByID({\n id: listPreferences?.preset,\n collection: 'payload-query-presets',\n depth: 0,\n overrideAccess: false,\n user,\n })) as QueryPreset\n\n if (queryPreset) {\n queryPresetPermissions = await getDocumentPermissions({\n id: queryPreset.id,\n collectionConfig: config.collections.find((c) => c.slug === 'payload-query-presets'),\n data: queryPreset,\n req,\n })?.then(({ docPermissions }) => docPermissions)\n }\n } catch (err) {\n req.payload.logger.error(`Error fetching query preset or preset permissions: ${err}`)\n }\n }\n\n const data = await payload.find({\n collection: collectionSlug,\n depth: 0,\n draft: true,\n fallbackLocale: false,\n includeLockStatus: true,\n limit,\n locale,\n overrideAccess: false,\n page,\n req,\n sort,\n user,\n where: where || {},\n })\n\n const clientCollectionConfig = clientConfig.collections.find((c) => c.slug === collectionSlug)\n\n const { columnState, Table } = renderTable({\n clientCollectionConfig,\n collectionConfig,\n columnPreferences: listPreferences?.columns,\n columns,\n customCellProps,\n docs: data.docs,\n drawerSlug,\n enableRowSelections,\n i18n: req.i18n,\n orderableFieldName: collectionConfig.orderable === true ? '_order' : undefined,\n payload,\n useAsTitle: collectionConfig.admin.useAsTitle,\n })\n\n const renderedFilters = renderFilters(collectionConfig.fields, req.payload.importMap)\n\n const resolvedFilterOptions = await resolveAllFilterOptions({\n fields: collectionConfig.fields,\n req,\n })\n\n const staticDescription =\n typeof collectionConfig.admin.description === 'function'\n ? collectionConfig.admin.description({ t: i18n.t })\n : collectionConfig.admin.description\n\n const newDocumentURL = formatAdminURL({\n adminRoute,\n path: `/collections/${collectionSlug}/create`,\n })\n\n const hasCreatePermission = permissions?.collections?.[collectionSlug]?.create\n\n const serverProps: ListViewServerPropsOnly = {\n collectionConfig,\n data,\n i18n,\n limit,\n listPreferences,\n listSearchableFields: collectionConfig.admin.listSearchableFields,\n locale: fullLocale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n }\n\n const listViewSlots = renderListViewSlots({\n clientProps: {\n collectionSlug,\n hasCreatePermission,\n newDocumentURL,\n },\n collectionConfig,\n description: staticDescription,\n payload,\n serverProps,\n })\n\n const isInDrawer = Boolean(drawerSlug)\n\n return {\n List: (\n <Fragment>\n <HydrateAuthProvider permissions={permissions} />\n <ListQueryProvider\n collectionSlug={collectionSlug}\n columns={transformColumnsToPreferences(columnState)}\n data={data}\n defaultLimit={limit}\n defaultSort={sort}\n listPreferences={listPreferences}\n modifySearchParams={!isInDrawer}\n orderableFieldName={collectionConfig.orderable === true ? '_order' : undefined}\n >\n {RenderServerComponent({\n clientProps: {\n ...listViewSlots,\n collectionSlug,\n columnState,\n disableBulkDelete,\n disableBulkEdit: collectionConfig.disableBulkEdit ?? disableBulkEdit,\n disableQueryPresets,\n enableRowSelections,\n hasCreatePermission,\n listPreferences,\n newDocumentURL,\n queryPreset,\n queryPresetPermissions,\n renderedFilters,\n resolvedFilterOptions,\n Table,\n } satisfies ListViewClientProps,\n Component: collectionConfig?.admin?.components?.views?.list?.Component,\n Fallback: DefaultListView,\n importMap: payload.importMap,\n serverProps,\n })}\n </ListQueryProvider>\n </Fragment>\n ),\n }\n }\n\n throw new Error('not-found')\n}\n\nexport const ListView: React.FC<RenderListViewArgs> = async (args) => {\n try {\n const { List: RenderedList } = await renderListView({ ...args, enableRowSelections: true })\n return RenderedList\n } catch (error) {\n if (error.message === 'not-found') {\n notFound()\n } else {\n console.error(error) // eslint-disable-line no-console\n }\n }\n}\n"],"mappings":";AAaA,SAASA,eAAe,EAAEC,mBAAmB,EAAEC,iBAAiB,QAAQ;AACxE,SAASC,qBAAqB,QAAQ;AACtC,SAASC,aAAa,EAAEC,WAAW,EAAEC,iBAAiB,QAAQ;AAC9D,SAASC,QAAQ,QAAQ;AACzB,SACEC,cAAc,EACdC,QAAQ,EACRC,uBAAuB,EACvBC,6BAA6B,QACxB;AAC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O,mBAAA,EAAqB;IAAK;IACzF,OAAOkG,YAAA;EACT,EAAE,OAAOtC,KAAA,EAAO;IACd,IAAIA,KAAA,CAAMuC,OAAO,KAAK,aAAa;MACjCrH,QAAA;IACF,OAAO;MACLsH,OAAA,CAAQxC,KAAK,CAACA,KAAA,EAAO;MAAA;IACvB;EACF;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["DefaultListView","HydrateAuthProvider","ListQueryProvider","RenderServerComponent","renderFilters","renderTable","upsertPreferences","notFound","formatAdminURL","isNumber","mergeListSearchAndWhere","transformColumnsToPreferences","React","Fragment","getDocumentPermissions","renderListViewSlots","resolveAllFilterOptions","renderListView","args","clientConfig","customCellProps","disableBulkDelete","disableBulkEdit","disableQueryPresets","drawerSlug","enableRowSelections","initPageResult","overrideEntityVisibility","params","query","queryFromArgs","searchParams","collectionConfig","slug","collectionSlug","locale","fullLocale","permissions","req","i18n","payload","config","queryFromReq","user","visibleEntities","collections","read","Error","columns","collectionPreferences","key","value","limit","Number","undefined","preset","sort","routes","admin","adminRoute","includes","page","pagination","defaultLimit","defaultSort","where","search","baseListFilter","and","filter","Boolean","queryPreset","queryPresetPermissions","findByID","id","collection","depth","overrideAccess","find","c","data","then","docPermissions","err","logger","error","draft","fallbackLocale","includeLockStatus","clientCollectionConfig","columnState","Table","columnPreferences","docs","orderableFieldName","orderable","useAsTitle","renderedFilters","fields","importMap","resolvedFilterOptions","staticDescription","description","t","newDocumentURL","path","hasCreatePermission","create","serverProps","listPreferences","listSearchableFields","listViewSlots","clientProps","isInDrawer","List","_jsxs","_jsx","modifySearchParams","Component","components","views","list","Fallback","ListView","RenderedList","message","console"],"sources":["../../../src/views/List/index.tsx"],"sourcesContent":["import type {\n AdminViewServerProps,\n CollectionPreferences,\n ColumnPreference,\n DefaultDocumentIDType,\n ListQuery,\n ListViewClientProps,\n ListViewServerPropsOnly,\n QueryPreset,\n SanitizedCollectionPermission,\n Where,\n} from 'payload'\n\nimport { DefaultListView, HydrateAuthProvider, ListQueryProvider } from '@payloadcms/ui'\nimport { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent'\nimport { renderFilters, renderTable, upsertPreferences } from '@payloadcms/ui/rsc'\nimport { notFound } from 'next/navigation.js'\nimport {\n formatAdminURL,\n isNumber,\n mergeListSearchAndWhere,\n transformColumnsToPreferences,\n} from 'payload/shared'\nimport React, { Fragment } from 'react'\n\nimport { getDocumentPermissions } from '../Document/getDocumentPermissions.js'\nimport { renderListViewSlots } from './renderListViewSlots.js'\nimport { resolveAllFilterOptions } from './resolveAllFilterOptions.js'\n\ntype RenderListViewArgs = {\n customCellProps?: Record<string, any>\n disableBulkDelete?: boolean\n disableBulkEdit?: boolean\n disableQueryPresets?: boolean\n drawerSlug?: string\n enableRowSelections: boolean\n overrideEntityVisibility?: boolean\n query: ListQuery\n redirectAfterDelete?: boolean\n redirectAfterDuplicate?: boolean\n} & AdminViewServerProps\n\n/**\n * This function is responsible for rendering\n * the list view on the server for both:\n * - default list view\n * - list view within drawers\n */\nexport const renderListView = async (\n args: RenderListViewArgs,\n): Promise<{\n List: React.ReactNode\n}> => {\n const {\n clientConfig,\n customCellProps,\n disableBulkDelete,\n disableBulkEdit,\n disableQueryPresets,\n drawerSlug,\n enableRowSelections,\n initPageResult,\n overrideEntityVisibility,\n params,\n query: queryFromArgs,\n searchParams,\n } = args\n\n const {\n collectionConfig,\n collectionConfig: { slug: collectionSlug },\n locale: fullLocale,\n permissions,\n req,\n req: {\n i18n,\n locale,\n payload,\n payload: { config },\n query: queryFromReq,\n user,\n },\n visibleEntities,\n } = initPageResult\n\n if (!permissions?.collections?.[collectionSlug]?.read) {\n throw new Error('not-found')\n }\n\n const query = queryFromArgs || queryFromReq\n\n const columns: ColumnPreference[] = transformColumnsToPreferences(\n query?.columns as ColumnPreference[] | string,\n )\n\n /**\n * @todo: find a pattern to avoid setting preferences on hard navigation, i.e. direct links, page refresh, etc.\n * This will ensure that prefs are only updated when explicitly set by the user\n * This could potentially be done by injecting a `sessionID` into the params and comparing it against a session cookie\n */\n const collectionPreferences = await upsertPreferences<CollectionPreferences>({\n key: `collection-${collectionSlug}`,\n req,\n value: {\n columns,\n limit: isNumber(query?.limit) ? Number(query.limit) : undefined,\n preset: (query?.preset as DefaultDocumentIDType) || null,\n sort: query?.sort as string,\n },\n })\n\n const {\n routes: { admin: adminRoute },\n } = config\n\n if (collectionConfig) {\n if (!visibleEntities.collections.includes(collectionSlug) && !overrideEntityVisibility) {\n throw new Error('not-found')\n }\n\n const page = isNumber(query?.page) ? Number(query.page) : 0\n\n const limit = collectionPreferences?.limit || collectionConfig.admin.pagination.defaultLimit\n\n const sort =\n collectionPreferences?.sort ||\n (typeof collectionConfig.defaultSort === 'string' ? collectionConfig.defaultSort : undefined)\n\n let where = mergeListSearchAndWhere({\n collectionConfig,\n search: typeof query?.search === 'string' ? query.search : undefined,\n where: (query?.where as Where) || undefined,\n })\n\n if (typeof collectionConfig.admin?.baseListFilter === 'function') {\n const baseListFilter = await collectionConfig.admin.baseListFilter({\n limit,\n page,\n req,\n sort,\n })\n\n if (baseListFilter) {\n where = {\n and: [where, baseListFilter].filter(Boolean),\n }\n }\n }\n\n let queryPreset: QueryPreset | undefined\n let queryPresetPermissions: SanitizedCollectionPermission | undefined\n\n if (collectionPreferences?.preset) {\n try {\n queryPreset = (await payload.findByID({\n id: collectionPreferences?.preset,\n collection: 'payload-query-presets',\n depth: 0,\n overrideAccess: false,\n user,\n })) as QueryPreset\n\n if (queryPreset) {\n queryPresetPermissions = await getDocumentPermissions({\n id: queryPreset.id,\n collectionConfig: config.collections.find((c) => c.slug === 'payload-query-presets'),\n data: queryPreset,\n req,\n })?.then(({ docPermissions }) => docPermissions)\n }\n } catch (err) {\n req.payload.logger.error(`Error fetching query preset or preset permissions: ${err}`)\n }\n }\n\n const data = await payload.find({\n collection: collectionSlug,\n depth: 0,\n draft: true,\n fallbackLocale: false,\n includeLockStatus: true,\n limit,\n locale,\n overrideAccess: false,\n page,\n req,\n sort,\n user,\n where: where || {},\n })\n\n const clientCollectionConfig = clientConfig.collections.find((c) => c.slug === collectionSlug)\n\n const { columnState, Table } = renderTable({\n clientCollectionConfig,\n collectionConfig,\n columnPreferences: collectionPreferences?.columns,\n columns,\n customCellProps,\n docs: data.docs,\n drawerSlug,\n enableRowSelections,\n i18n: req.i18n,\n orderableFieldName: collectionConfig.orderable === true ? '_order' : undefined,\n payload,\n useAsTitle: collectionConfig.admin.useAsTitle,\n })\n\n const renderedFilters = renderFilters(collectionConfig.fields, req.payload.importMap)\n\n const resolvedFilterOptions = await resolveAllFilterOptions({\n fields: collectionConfig.fields,\n req,\n })\n\n const staticDescription =\n typeof collectionConfig.admin.description === 'function'\n ? collectionConfig.admin.description({ t: i18n.t })\n : collectionConfig.admin.description\n\n const newDocumentURL = formatAdminURL({\n adminRoute,\n path: `/collections/${collectionSlug}/create`,\n })\n\n const hasCreatePermission = permissions?.collections?.[collectionSlug]?.create\n\n const serverProps: ListViewServerPropsOnly = {\n collectionConfig,\n data,\n i18n,\n limit,\n listPreferences: collectionPreferences,\n listSearchableFields: collectionConfig.admin.listSearchableFields,\n locale: fullLocale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n }\n\n const listViewSlots = renderListViewSlots({\n clientProps: {\n collectionSlug,\n hasCreatePermission,\n newDocumentURL,\n },\n collectionConfig,\n description: staticDescription,\n payload,\n serverProps,\n })\n\n const isInDrawer = Boolean(drawerSlug)\n\n return {\n List: (\n <Fragment>\n <HydrateAuthProvider permissions={permissions} />\n <ListQueryProvider\n collectionSlug={collectionSlug}\n columns={transformColumnsToPreferences(columnState)}\n data={data}\n defaultLimit={limit}\n defaultSort={sort}\n listPreferences={collectionPreferences}\n modifySearchParams={!isInDrawer}\n orderableFieldName={collectionConfig.orderable === true ? '_order' : undefined}\n >\n {RenderServerComponent({\n clientProps: {\n ...listViewSlots,\n collectionSlug,\n columnState,\n disableBulkDelete,\n disableBulkEdit: collectionConfig.disableBulkEdit ?? disableBulkEdit,\n disableQueryPresets,\n enableRowSelections,\n hasCreatePermission,\n listPreferences: collectionPreferences,\n newDocumentURL,\n queryPreset,\n queryPresetPermissions,\n renderedFilters,\n resolvedFilterOptions,\n Table,\n } satisfies ListViewClientProps,\n Component: collectionConfig?.admin?.components?.views?.list?.Component,\n Fallback: DefaultListView,\n importMap: payload.importMap,\n serverProps,\n })}\n </ListQueryProvider>\n </Fragment>\n ),\n }\n }\n\n throw new Error('not-found')\n}\n\nexport const ListView: React.FC<RenderListViewArgs> = async (args) => {\n try {\n const { List: RenderedList } = await renderListView({ ...args, enableRowSelections: true })\n return RenderedList\n } catch (error) {\n if (error.message === 'not-found') {\n notFound()\n } else {\n console.error(error) // eslint-disable-line no-console\n }\n }\n}\n"],"mappings":";AAaA,SAASA,eAAe,EAAEC,mBAAmB,EAAEC,iBAAiB,QAAQ;AACxE,SAASC,qBAAqB,QAAQ;AACtC,SAASC,aAAa,EAAEC,WAAW,EAAEC,iBAAiB,QAAQ;AAC9D,SAASC,QAAQ,QAAQ;AACzB,SACEC,cAAc,EACdC,QAAQ,EACRC,uBAAuB,EACvBC,6BAA6B,QACxB;AACP,OAAOC,KAAA,IAASC,QAAQ,QAAQ;AAEhC,SAASC,sBAAsB,QAAQ;AACvC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,uBAAuB,QAAQ;AAexC;;;;;;AAMA,OAAO,MAAMC,cAAA,GAAiB,MAC5BC,IAAA;EAIA,MAAM;IACJC,YAAY;IACZC,eAAe;IACfC,iBAAiB;IACjBC,eAAe;IACfC,mBAAmB;IACnBC,UAAU;IACVC,mBAAmB;IACnBC,cAAc;IACdC,wBAAwB;IACxBC,MAAM;IACNC,KAAA,EAAOC,aAAa;IACpBC;EAAY,CACb,GAAGb,IAAA;EAEJ,MAAM;IACJc,gBAAgB;IAChBA,gBAAA,EAAkB;MAAEC,IAAA,EAAMC;IAAc,CAAE;IAC1CC,MAAA,EAAQC,UAAU;IAClBC,WAAW;IACXC,GAAG;IACHA,GA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,gBAAA,CAAiB+D,SAAS,KAAK,OAAO,WAAWzC,SAAA;oBAEpEnD,qBAAA,CAAsB;YACrB6G,WAAA,EAAa;cACX,GAAGD,aAAa;cAChB7E,cAAA;cACAwD,WAAA;cACArE,iBAAA;cACAC,eAAA,EAAiBU,gBAAA,CAAiBV,eAAe,IAAIA,eAAA;cACrDC,mBAAA;cACAE,mBAAA;cACAiF,mBAAA;cACAG,eAAA,EAAiB5D,qBAAA;cACjBuD,cAAA;cACAjC,WAAA;cACAC,sBAAA;cACAyB,eAAA;cACAG,qBAAA;cACAT;YACF;YACA2B,SAAA,EAAWtF,gBAAA,EAAkB0B,KAAA,EAAO6D,UAAA,EAAYC,KAAA,EAAOC,IAAA,EAAMH,SAAA;YAC7DI,QAAA,EAAU1H,eAAA;YACVmG,SAAA,EAAW3D,OAAA,CAAQ2D,SAAS;YAC5BS;UACF;;;IAIR;EACF;EAEA,MAAM,IAAI7D,KAAA,CAAM;AAClB;AAEA,OAAO,MAAM4E,QAAA,GAAyC,MAAOzG,IAAA;EAC3D,IAAI;IACF,MAAM;MAAEgG,IAAA,EAAMU;IAAY,CAAE,GAAG,MAAM3G,cAAA,CAAe;MAAE,GAAGC,IAAI;MAAEO,mBAAA,EAAqB;IAAK;IACzF,OAAOmG,YAAA;EACT,EAAE,OAAOvC,KAAA,EAAO;IACd,IAAIA,KAAA,CAAMwC,OAAO,KAAK,aAAa;MACjCtH,QAAA;IACF,OAAO;MACLuH,OAAA,CAAQzC,KAAK,CAACA,KAAA,EAAO;MAAA;IACvB;EACF;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/views/LivePreview/Toolbar/Controls/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAG5C,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,cAAc,CAAA;AAKrB,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/views/LivePreview/Toolbar/Controls/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAG5C,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,cAAc,CAAA;AAKrB,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA6GnD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","ChevronIcon","LinkIcon","Popup","PopupList","useTranslation","XIcon","React","useLivePreviewContext","PreviewFrameSizeInput","baseClass","zoomOptions","ToolbarControls","$","breakpoint","breakpoints","setBreakpoint","setPreviewWindowType","setZoom","url","zoom","t","t0","customOption","label","value","t2","t3","close","close_0","_jsx","ButtonGroup","children","Fragment","map","zoomValue","_jsxs","Button","active","onClick","e","preventDefault","className","length","button","find","bp","name","horizontalAlign","render","t1","bp_0","axis","href","type"],"sources":["../../../../../src/views/LivePreview/Toolbar/Controls/index.tsx"],"sourcesContent":["'use client'\n\nimport type { EditViewProps } from 'payload'\n\nimport { ChevronIcon, LinkIcon, Popup, PopupList, useTranslation, XIcon } from '@payloadcms/ui'\nimport React from 'react'\n\nimport { useLivePreviewContext } from '../../Context/context.js'\nimport { PreviewFrameSizeInput } from '../SizeInput/index.js'\nimport './index.scss'\n\nconst baseClass = 'live-preview-toolbar-controls'\nconst zoomOptions = [50, 75, 100, 125, 150, 200]\n\nexport const ToolbarControls: React.FC<EditViewProps> = () => {\n const { breakpoint, breakpoints, setBreakpoint, setPreviewWindowType, setZoom, url, zoom } =\n useLivePreviewContext()\n const { t } = useTranslation()\n\n const customOption = {\n label: t('general:custom'),\n value: 'custom',\n }\n\n return (\n <div className={baseClass}>\n {breakpoints?.length > 0 && (\n <Popup\n button={\n <React.Fragment>\n <span>\n {breakpoints.find((bp) => bp.name == breakpoint)?.label ?? customOption.label}\n </span>\n <ChevronIcon className={`${baseClass}__chevron`} />\n </React.Fragment>\n }\n className={`${baseClass}__breakpoint`}\n horizontalAlign=\"right\"\n render={({ close }) => (\n <PopupList.ButtonGroup>\n <React.Fragment>\n {breakpoints.map((bp) => (\n <PopupList.Button\n active={bp.name == breakpoint}\n key={bp.name}\n onClick={() => {\n setBreakpoint(bp.name)\n close()\n }}\n >\n {bp.label}\n </PopupList.Button>\n ))}\n {/* Dynamically add this option so that it only appears when the width and height inputs are explicitly changed */}\n {breakpoint === 'custom' && (\n <PopupList.Button\n active={breakpoint == customOption.value}\n onClick={() => {\n setBreakpoint(customOption.value)\n close()\n }}\n >\n {customOption.label}\n </PopupList.Button>\n )}\n </React.Fragment>\n </PopupList.ButtonGroup>\n )}\n showScrollbar\n verticalAlign=\"bottom\"\n />\n )}\n <div className={`${baseClass}__device-size`}>\n <PreviewFrameSizeInput axis=\"x\" />\n <span className={`${baseClass}__size-divider`}>\n <XIcon />\n </span>\n <PreviewFrameSizeInput axis=\"y\" />\n </div>\n <Popup\n button={\n <React.Fragment>\n <span>{zoom * 100}%</span>\n <ChevronIcon className={`${baseClass}__chevron`} />\n </React.Fragment>\n }\n className={`${baseClass}__zoom`}\n horizontalAlign=\"right\"\n render={({ close }) => (\n <PopupList.ButtonGroup>\n <React.Fragment>\n {zoomOptions.map((zoomValue) => (\n <PopupList.Button\n active={zoom * 100 == zoomValue}\n key={zoomValue}\n onClick={() => {\n setZoom(zoomValue / 100)\n close()\n }}\n >\n {zoomValue}%\n </PopupList.Button>\n ))}\n </React.Fragment>\n </PopupList.ButtonGroup>\n )}\n showScrollbar\n verticalAlign=\"bottom\"\n />\n <a\n className={`${baseClass}__external`}\n href={url}\n onClick={(e) => {\n e.preventDefault()\n setPreviewWindowType('popup')\n }}\n type=\"button\"\n >\n <LinkIcon />\n </a>\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAA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I,QAAA,EAGDc,IAAA,CAAAtB;cAAA,GANIsB,IAAA,CAAAC,IAAO,IAUfjC,UAAA,KAAe,YACdgB,IAAA,CAAA1B,SAAA,CAAAiC,MAAA;gBAAAC,MAAA,EACUxB,UAAA,IAAcS,YAAA,CAAAE,KAAkB;gBAAAc,OAAA,EAAAA,CAAA;kBAEtCvB,aAAA,CAAcO,YAAA,CAAAE,KAAkB;kBAChCG,KAAA;gBAAA;gBAAAI,QAAA,EAGDT,YAAA,CAAAC;cAAA,C;;;;;uBAOG;MAAA,C,GAGlBY,KAAA,CAAC;QAAAM,SAAA,EAAe,GAAAhC,SAAA,eAA2B;QAAAsB,QAAA,GACzCF,IAAA,CAAArB,qBAAA;UAAA2C,IAAA,EAA4B;QAAA,C,GAC5BtB,IAAA,CAAC;UAAAY,SAAA,EAAgB,GAAAhC,SAAA,gBAA4B;UAAAsB,QAAA,EAC3CF,IAAA,CAAAxB,KAAA,IAAC;QAAA,C,GAEHwB,IAAA,CAAArB,qBAAA;UAAA2C,IAAA,EAA4B;QAAA,C;UAE9BtB,IAAA,CAAA3B,KAAA;QAAAyC,MAAA,EAEIR,KAAA,CAAA7B,KAAA,CAAA0B,QAAA;UAAAD,QAAA,GACEI,KAAA,CAAC;YAAAJ,QAAA,GAAMZ,IAAA,MAAO,EAAI;UAAA,C,GAClBU,IAAA,CAAA7B,WAAA;YAAAyC,SAAA,EAAwB,GAAAhC,SAAA;UAAuB,C;;mBAGxC,GAAAA,SAAA,QAAoB;QAAAsC,eAAA,EACf;QAAAC,MAAA,EACRvB,E;;uBAmBM;MAAA,C,GAEhBI,IAAA,CAAC;QAAAY,SAAA,EACY,GAAAhC,SAAA,YAAwB;QAAA2C,IAAA,EAC7BlC,GAAA;QAAAoB,OAAA,EACGZ,EAGT;QAAA2B,IAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","ChevronIcon","LinkIcon","Popup","PopupList","useTranslation","XIcon","React","useLivePreviewContext","PreviewFrameSizeInput","baseClass","zoomOptions","ToolbarControls","$","breakpoint","breakpoints","setBreakpoint","setPreviewWindowType","setZoom","url","zoom","t","t0","customOption","label","value","t2","t3","close","close_0","_jsx","ButtonGroup","children","Fragment","map","zoomValue","_jsxs","Button","active","onClick","e","preventDefault","className","length","button","find","bp","name","horizontalAlign","render","t1","bp_0","axis","href","target","type"],"sources":["../../../../../src/views/LivePreview/Toolbar/Controls/index.tsx"],"sourcesContent":["'use client'\n\nimport type { EditViewProps } from 'payload'\n\nimport { ChevronIcon, LinkIcon, Popup, PopupList, useTranslation, XIcon } from '@payloadcms/ui'\nimport React from 'react'\n\nimport { useLivePreviewContext } from '../../Context/context.js'\nimport { PreviewFrameSizeInput } from '../SizeInput/index.js'\nimport './index.scss'\n\nconst baseClass = 'live-preview-toolbar-controls'\nconst zoomOptions = [50, 75, 100, 125, 150, 200]\n\nexport const ToolbarControls: React.FC<EditViewProps> = () => {\n const { breakpoint, breakpoints, setBreakpoint, setPreviewWindowType, setZoom, url, zoom } =\n useLivePreviewContext()\n const { t } = useTranslation()\n\n const customOption = {\n label: t('general:custom'),\n value: 'custom',\n }\n\n return (\n <div className={baseClass}>\n {breakpoints?.length > 0 && (\n <Popup\n button={\n <React.Fragment>\n <span>\n {breakpoints.find((bp) => bp.name == breakpoint)?.label ?? customOption.label}\n </span>\n <ChevronIcon className={`${baseClass}__chevron`} />\n </React.Fragment>\n }\n className={`${baseClass}__breakpoint`}\n horizontalAlign=\"right\"\n render={({ close }) => (\n <PopupList.ButtonGroup>\n <React.Fragment>\n {breakpoints.map((bp) => (\n <PopupList.Button\n active={bp.name == breakpoint}\n key={bp.name}\n onClick={() => {\n setBreakpoint(bp.name)\n close()\n }}\n >\n {bp.label}\n </PopupList.Button>\n ))}\n {/* Dynamically add this option so that it only appears when the width and height inputs are explicitly changed */}\n {breakpoint === 'custom' && (\n <PopupList.Button\n active={breakpoint == customOption.value}\n onClick={() => {\n setBreakpoint(customOption.value)\n close()\n }}\n >\n {customOption.label}\n </PopupList.Button>\n )}\n </React.Fragment>\n </PopupList.ButtonGroup>\n )}\n showScrollbar\n verticalAlign=\"bottom\"\n />\n )}\n <div className={`${baseClass}__device-size`}>\n <PreviewFrameSizeInput axis=\"x\" />\n <span className={`${baseClass}__size-divider`}>\n <XIcon />\n </span>\n <PreviewFrameSizeInput axis=\"y\" />\n </div>\n <Popup\n button={\n <React.Fragment>\n <span>{zoom * 100}%</span>\n <ChevronIcon className={`${baseClass}__chevron`} />\n </React.Fragment>\n }\n className={`${baseClass}__zoom`}\n horizontalAlign=\"right\"\n render={({ close }) => (\n <PopupList.ButtonGroup>\n <React.Fragment>\n {zoomOptions.map((zoomValue) => (\n <PopupList.Button\n active={zoom * 100 == zoomValue}\n key={zoomValue}\n onClick={() => {\n setZoom(zoomValue / 100)\n close()\n }}\n >\n {zoomValue}%\n </PopupList.Button>\n ))}\n </React.Fragment>\n </PopupList.ButtonGroup>\n )}\n showScrollbar\n verticalAlign=\"bottom\"\n />\n <a\n className={`${baseClass}__external`}\n href={url}\n onClick={(e) => {\n e.preventDefault()\n setPreviewWindowType('popup')\n }}\n target=\"_blank\"\n type=\"button\"\n >\n <LinkIcon />\n </a>\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAIA,SAASC,WAAW,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,SAAS,EAAEC,cAAc,EAAEC,KAAK,QAAQ;AAC/E,OAAOC,KAAA,MAAW;AAElB,SAASC,qBAAqB,QAAQ;AACtC,SAASC,qBAAqB,QAAQ;AAGtC,MAAMC,SAAA,GAAY;AAClB,MAAMC,WAAA,GAAc,CAAC,IAAI,IAAI,KAAK,KAAK,KAAK,IAAI;AAEhD,OAAO,MAAMC,eAAA,GAA2CA,CAAA;EAAA,MAAAC,CAAA,GAAAb,EAAA;EACtD;IAAAc,UAAA;IAAAC,WAAA;IAAAC,aAAA;IAAAC,oBAAA;IAAAC,OAAA;IAAAC,GAAA;IAAAC;EAAA,I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|
1
|
+
{"version":3,"file":"getCustomViewByRoute.d.ts","sourceRoot":"","sources":["../../../src/views/Root/getCustomViewByRoute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAIvD,eAAO,MAAM,oBAAoB,qDAG9B;IACD,MAAM,EAAE,eAAe,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;CACrB,KAAG;IACF,IAAI,EAAE,cAAc,CAAA;IACpB,UAAU,EAAE,eAAe,CAAA;IAC3B,OAAO,EAAE,MAAM,CAAA;CAmDhB,CAAA"}
|
|
@@ -13,8 +13,8 @@ export const getCustomViewByRoute = ({
|
|
|
13
13
|
admin: adminRoute
|
|
14
14
|
}
|
|
15
15
|
} = config;
|
|
16
|
-
const currentRoute = currentRouteWithAdmin.replace(adminRoute, '');
|
|
17
16
|
let viewKey;
|
|
17
|
+
const currentRoute = adminRoute === '/' ? currentRouteWithAdmin : currentRouteWithAdmin.replace(adminRoute, '');
|
|
18
18
|
const foundViewConfig = views && typeof views === 'object' && Object.entries(views).find(([key, view]) => {
|
|
19
19
|
const isMatching = isPathMatchingRoute({
|
|
20
20
|
currentRoute,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCustomViewByRoute.js","names":["isPathMatchingRoute","getCustomViewByRoute","config","currentRoute","currentRouteWithAdmin","admin","components","views","routes","adminRoute","
|
|
1
|
+
{"version":3,"file":"getCustomViewByRoute.js","names":["isPathMatchingRoute","getCustomViewByRoute","config","currentRoute","currentRouteWithAdmin","admin","components","views","routes","adminRoute","viewKey","replace","foundViewConfig","Object","entries","find","key","view","isMatching","exact","path","sensitive","strict","undefined","Component","viewConfig","payloadComponent"],"sources":["../../../src/views/Root/getCustomViewByRoute.ts"],"sourcesContent":["import type { AdminViewConfig, SanitizedConfig } from 'payload'\n\nimport type { ViewFromConfig } from './getRouteData.js'\n\nimport { isPathMatchingRoute } from './isPathMatchingRoute.js'\n\nexport const getCustomViewByRoute = ({\n config,\n currentRoute: currentRouteWithAdmin,\n}: {\n config: SanitizedConfig\n currentRoute: string\n}): {\n view: ViewFromConfig\n viewConfig: AdminViewConfig\n viewKey: string\n} => {\n const {\n admin: {\n components: { views },\n },\n routes: { admin: adminRoute },\n } = config\n\n let viewKey: string\n\n const currentRoute =\n adminRoute === '/' ? currentRouteWithAdmin : currentRouteWithAdmin.replace(adminRoute, '')\n\n const foundViewConfig =\n (views &&\n typeof views === 'object' &&\n Object.entries(views).find(([key, view]) => {\n const isMatching = isPathMatchingRoute({\n currentRoute,\n exact: view.exact,\n path: view.path,\n sensitive: view.sensitive,\n strict: view.strict,\n })\n\n if (isMatching) {\n viewKey = key\n }\n\n return isMatching\n })?.[1]) ||\n undefined\n\n if (!foundViewConfig) {\n return {\n view: {\n Component: null,\n },\n viewConfig: null,\n viewKey: null,\n }\n }\n\n return {\n view: {\n payloadComponent: foundViewConfig.Component,\n },\n viewConfig: foundViewConfig,\n viewKey,\n }\n}\n"],"mappings":"AAIA,SAASA,mBAAmB,QAAQ;AAEpC,OAAO,MAAMC,oBAAA,GAAuBA,CAAC;EACnCC,MAAM;EACNC,YAAA,EAAcC;AAAqB,CAIpC;EAKC,MAAM;IACJC,KAAA,EAAO;MACLC,UAAA,EAAY;QAAEC;MAAK;IAAE,CACtB;IACDC,MAAA,EAAQ;MAAEH,KAAA,EAAOI;IAAU;EAAE,CAC9B,GAAGP,MAAA;EAEJ,IAAIQ,OAAA;EAEJ,MAAMP,YAAA,GACJM,UAAA,KAAe,MAAML,qBAAA,GAAwBA,qBAAA,CAAsBO,OAAO,CAACF,UAAA,EAAY;EAEzF,MAAMG,eAAA,GACJL,KAAC,IACC,OAAOA,KAAA,KAAU,YACjBM,MAAA,CAAOC,OAAO,CAACP,KAAA,EAAOQ,IAAI,CAAC,CAAC,CAACC,GAAA,EAAKC,IAAA,CAAK;IACrC,MAAMC,UAAA,GAAalB,mBAAA,CAAoB;MACrCG,YAAA;MACAgB,KAAA,EAAOF,IAAA,CAAKE,KAAK;MACjBC,IAAA,EAAMH,IAAA,CAAKG,IAAI;MACfC,SAAA,EAAWJ,IAAA,CAAKI,SAAS;MACzBC,MAAA,EAAQL,IAAA,CAAKK;IACf;IAEA,IAAIJ,UAAA,EAAY;MACdR,OAAA,GAAUM,GAAA;IACZ;IAEA,OAAOE,UAAA;EACT,KAAK,EAAE,IACTK,SAAA;EAEF,IAAI,CAACX,eAAA,EAAiB;IACpB,OAAO;MACLK,IAAA,EAAM;QACJO,SAAA,EAAW;MACb;MACAC,UAAA,EAAY;MACZf,OAAA,EAAS;IACX;EACF;EAEA,OAAO;IACLO,IAAA,EAAM;MACJS,gBAAA,EAAkBd,eAAA,CAAgBY;IACpC;IACAC,UAAA,EAAYb,eAAA;IACZF;EACF;AACF","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/next",
|
|
3
|
-
"version": "3.44.0
|
|
3
|
+
"version": "3.44.0",
|
|
4
4
|
"homepage": "https://payloadcms.com",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -87,9 +87,9 @@
|
|
|
87
87
|
"qs-esm": "7.0.2",
|
|
88
88
|
"sass": "1.77.4",
|
|
89
89
|
"uuid": "10.0.0",
|
|
90
|
-
"@payloadcms/graphql": "3.44.0
|
|
91
|
-
"@payloadcms/translations": "3.44.0
|
|
92
|
-
"@payloadcms/ui": "3.44.0
|
|
90
|
+
"@payloadcms/graphql": "3.44.0",
|
|
91
|
+
"@payloadcms/translations": "3.44.0",
|
|
92
|
+
"@payloadcms/ui": "3.44.0"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@babel/cli": "7.27.2",
|
|
@@ -107,12 +107,12 @@
|
|
|
107
107
|
"esbuild-sass-plugin": "3.3.1",
|
|
108
108
|
"swc-plugin-transform-remove-imports": "4.0.4",
|
|
109
109
|
"@payloadcms/eslint-config": "3.28.0",
|
|
110
|
-
"payload": "3.44.0
|
|
110
|
+
"payload": "3.44.0"
|
|
111
111
|
},
|
|
112
112
|
"peerDependencies": {
|
|
113
113
|
"graphql": "^16.8.1",
|
|
114
114
|
"next": "^15.2.3",
|
|
115
|
-
"payload": "3.44.0
|
|
115
|
+
"payload": "3.44.0"
|
|
116
116
|
},
|
|
117
117
|
"engines": {
|
|
118
118
|
"node": "^18.20.2 || >=20.9.0"
|