@payloadcms/ui 3.6.1-canary.5e04db9 → 3.6.1-canary.9067b37
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/elements/Button/index.d.ts +1 -1
- package/dist/elements/Button/index.d.ts.map +1 -1
- package/dist/elements/Button/index.js +4 -3
- package/dist/elements/Button/index.js.map +1 -1
- package/dist/elements/Button/types.d.ts +1 -0
- package/dist/elements/Button/types.d.ts.map +1 -1
- package/dist/elements/Button/types.js.map +1 -1
- package/dist/elements/DocumentDrawer/DrawerHeader/index.d.ts.map +1 -1
- package/dist/elements/DocumentDrawer/DrawerHeader/index.js +5 -5
- package/dist/elements/DocumentDrawer/DrawerHeader/index.js.map +1 -1
- package/dist/elements/DocumentDrawer/index.d.ts +1 -1
- package/dist/elements/DocumentDrawer/index.d.ts.map +1 -1
- package/dist/elements/DocumentDrawer/index.js +3 -3
- package/dist/elements/DocumentDrawer/index.js.map +1 -1
- package/dist/elements/EditUpload/index.d.ts.map +1 -1
- package/dist/elements/EditUpload/index.js +4 -3
- package/dist/elements/EditUpload/index.js.map +1 -1
- package/dist/elements/Gutter/index.d.ts +2 -1
- package/dist/elements/Gutter/index.d.ts.map +1 -1
- package/dist/elements/Gutter/index.js +4 -3
- package/dist/elements/Gutter/index.js.map +1 -1
- package/dist/elements/RelationshipTable/index.scss +16 -0
- package/dist/exports/client/index.d.ts +8 -2
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +10 -10
- package/dist/exports/client/index.js.map +4 -4
- package/dist/exports/shared/index.js +2 -2
- package/dist/exports/shared/index.js.map +2 -2
- package/dist/fields/Tabs/index.d.ts +0 -15
- package/dist/fields/Tabs/index.d.ts.map +1 -1
- package/dist/fields/Tabs/index.js +2 -2
- package/dist/fields/Tabs/index.js.map +1 -1
- package/dist/forms/Submit/index.d.ts +1 -1
- package/dist/forms/Submit/index.d.ts.map +1 -1
- package/dist/forms/Submit/index.js +5 -4
- package/dist/forms/Submit/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/utilities/getClientConfig.d.ts.map +1 -1
- package/dist/utilities/getClientConfig.js.map +1 -1
- package/dist/utilities/groupNavItems.d.ts.map +1 -1
- package/dist/utilities/groupNavItems.js +4 -0
- package/dist/utilities/groupNavItems.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getClientConfig.d.ts","sourceRoot":"","sources":["../../src/utilities/getClientConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAWvE,eAAO,MAAM,eAAe,SACnB;IAAE,MAAM,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,SAAS,CAAA;CAAE,KAAG,
|
|
1
|
+
{"version":3,"file":"getClientConfig.d.ts","sourceRoot":"","sources":["../../src/utilities/getClientConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAWvE,eAAO,MAAM,eAAe,SACnB;IAAE,MAAM,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,SAAS,CAAA;CAAE,KAAG,YAmB9E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getClientConfig.js","names":["createClientConfig","cache","cachedClientConfig","global","_payload_clientConfig","getClientConfig","args","_payload_doNotCacheClientConfig","config","i18n","importMap"],"sources":["../../src/utilities/getClientConfig.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { ClientConfig, ImportMap, SanitizedConfig } from 'payload'\n\nimport { createClientConfig } from 'payload'\nimport { cache } from 'react'\n\nlet cachedClientConfig = global._payload_clientConfig\n\nif (!cachedClientConfig) {\n cachedClientConfig = global._payload_clientConfig = null\n}\n\nexport const getClientConfig = cache(\n (args: { config: SanitizedConfig; i18n: I18nClient; importMap: ImportMap }): ClientConfig => {\n if (cachedClientConfig && !global._payload_doNotCacheClientConfig) {\n return cachedClientConfig\n }\n const { config, i18n, importMap } = args\n\n cachedClientConfig = createClientConfig({\n config,\n i18n,\n importMap,\n })\n global._payload_clientConfig = cachedClientConfig\n\n global._payload_doNotCacheClientConfig = false\n\n return cachedClientConfig\n },\n)\n"],"mappings":"AAGA,SAASA,kBAAkB,QAAQ;AACnC,SAASC,KAAK,QAAQ;AAEtB,IAAIC,kBAAA,GAAqBC,MAAA,CAAOC,qBAAqB;AAErD,IAAI,CAACF,kBAAA,EAAoB;EACvBA,kBAAA,GAAqBC,MAAA,CAAOC,qBAAqB,GAAG;AACtD;AAEA,OAAO,MAAMC,eAAA,GAAkBJ,KAAA,CAC5BK,IAAA;EACC,IAAIJ,kBAAA,IAAsB,CAACC,MAAA,CAAOI,+BAA+B,EAAE;IACjE,OAAOL,kBAAA;EACT;
|
|
1
|
+
{"version":3,"file":"getClientConfig.js","names":["createClientConfig","cache","cachedClientConfig","global","_payload_clientConfig","getClientConfig","args","_payload_doNotCacheClientConfig","config","i18n","importMap"],"sources":["../../src/utilities/getClientConfig.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { ClientConfig, ImportMap, SanitizedConfig } from 'payload'\n\nimport { createClientConfig } from 'payload'\nimport { cache } from 'react'\n\nlet cachedClientConfig = global._payload_clientConfig\n\nif (!cachedClientConfig) {\n cachedClientConfig = global._payload_clientConfig = null\n}\n\nexport const getClientConfig = cache(\n (args: { config: SanitizedConfig; i18n: I18nClient; importMap: ImportMap }): ClientConfig => {\n if (cachedClientConfig && !global._payload_doNotCacheClientConfig) {\n return cachedClientConfig\n }\n\n const { config, i18n, importMap } = args\n\n cachedClientConfig = createClientConfig({\n config,\n i18n,\n importMap,\n })\n\n global._payload_clientConfig = cachedClientConfig\n\n global._payload_doNotCacheClientConfig = false\n\n return cachedClientConfig\n },\n)\n"],"mappings":"AAGA,SAASA,kBAAkB,QAAQ;AACnC,SAASC,KAAK,QAAQ;AAEtB,IAAIC,kBAAA,GAAqBC,MAAA,CAAOC,qBAAqB;AAErD,IAAI,CAACF,kBAAA,EAAoB;EACvBA,kBAAA,GAAqBC,MAAA,CAAOC,qBAAqB,GAAG;AACtD;AAEA,OAAO,MAAMC,eAAA,GAAkBJ,KAAA,CAC5BK,IAAA;EACC,IAAIJ,kBAAA,IAAsB,CAACC,MAAA,CAAOI,+BAA+B,EAAE;IACjE,OAAOL,kBAAA;EACT;EAEA,MAAM;IAAEM,MAAM;IAAEC,IAAI;IAAEC;EAAS,CAAE,GAAGJ,IAAA;EAEpCJ,kBAAA,GAAqBF,kBAAA,CAAmB;IACtCQ,MAAA;IACAC,IAAA;IACAC;EACF;EAEAP,MAAA,CAAOC,qBAAqB,GAAGF,kBAAA;EAE/BC,MAAA,CAAOI,+BAA+B,GAAG;EAEzC,OAAOL,kBAAA;AACT","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groupNavItems.d.ts","sourceRoot":"","sources":["../../src/utilities/groupNavItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,WAAW,EACZ,MAAM,SAAS,CAAA;AAIhB,oBAAY,UAAU;IACpB,UAAU,gBAAgB;IAC1B,MAAM,YAAY;CACnB;AAED,MAAM,MAAM,aAAa,GACrB;IACE,MAAM,EAAE,yBAAyB,CAAA;IACjC,IAAI,EAAE,UAAU,CAAC,UAAU,CAAA;CAC5B,GACD;IACE,MAAM,EAAE,qBAAqB,CAAA;IAC7B,IAAI,EAAE,UAAU,CAAC,MAAM,CAAA;CACxB,CAAA;AAEL,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE;QACR,KAAK,EAAE,WAAW,CAAA;QAClB,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,UAAU,CAAA;KACjB,EAAE,CAAA;IACH,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,aAAa,EAAE,EACzB,WAAW,EAAE,oBAAoB,EACjC,IAAI,EAAE,UAAU,GACf,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"groupNavItems.d.ts","sourceRoot":"","sources":["../../src/utilities/groupNavItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,WAAW,EACZ,MAAM,SAAS,CAAA;AAIhB,oBAAY,UAAU;IACpB,UAAU,gBAAgB;IAC1B,MAAM,YAAY;CACnB;AAED,MAAM,MAAM,aAAa,GACrB;IACE,MAAM,EAAE,yBAAyB,CAAA;IACjC,IAAI,EAAE,UAAU,CAAC,UAAU,CAAA;CAC5B,GACD;IACE,MAAM,EAAE,qBAAqB,CAAA;IAC7B,IAAI,EAAE,UAAU,CAAC,MAAM,CAAA;CACxB,CAAA;AAEL,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE;QACR,KAAK,EAAE,WAAW,CAAA;QAClB,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,UAAU,CAAA;KACjB,EAAE,CAAA;IACH,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,aAAa,EAAE,EACzB,WAAW,EAAE,oBAAoB,EACjC,IAAI,EAAE,UAAU,GACf,YAAY,EAAE,CA+DhB"}
|
|
@@ -6,6 +6,10 @@ export var EntityType = /*#__PURE__*/function (EntityType) {
|
|
|
6
6
|
}({});
|
|
7
7
|
export function groupNavItems(entities, permissions, i18n) {
|
|
8
8
|
const result = entities.reduce((groups, entityToGroup) => {
|
|
9
|
+
// Skip entities where admin.group is explicitly false
|
|
10
|
+
if (entityToGroup.entity?.admin?.group === false) {
|
|
11
|
+
return groups;
|
|
12
|
+
}
|
|
9
13
|
if (permissions?.[entityToGroup.type.toLowerCase()]?.[entityToGroup.entity.slug]?.read) {
|
|
10
14
|
const translatedGroup = getTranslation(entityToGroup.entity.admin.group, i18n);
|
|
11
15
|
const labelOrFunction = 'labels' in entityToGroup.entity ? entityToGroup.entity.labels.plural : entityToGroup.entity.label;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groupNavItems.js","names":["getTranslation","EntityType","groupNavItems","entities","permissions","i18n","result","reduce","groups","entityToGroup","
|
|
1
|
+
{"version":3,"file":"groupNavItems.js","names":["getTranslation","EntityType","groupNavItems","entities","permissions","i18n","result","reduce","groups","entityToGroup","entity","admin","group","type","toLowerCase","slug","read","translatedGroup","labelOrFunction","labels","plural","label","t","existingGroup","find","matchedGroup","push","defaultGroup","filter","length"],"sources":["../../src/utilities/groupNavItems.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type {\n SanitizedCollectionConfig,\n SanitizedGlobalConfig,\n SanitizedPermissions,\n StaticLabel,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nexport enum EntityType {\n collection = 'collections',\n global = 'globals',\n}\n\nexport type EntityToGroup =\n | {\n entity: SanitizedCollectionConfig\n type: EntityType.collection\n }\n | {\n entity: SanitizedGlobalConfig\n type: EntityType.global\n }\n\nexport type NavGroupType = {\n entities: {\n label: StaticLabel\n slug: string\n type: EntityType\n }[]\n label: string\n}\n\nexport function groupNavItems(\n entities: EntityToGroup[],\n permissions: SanitizedPermissions,\n i18n: I18nClient,\n): NavGroupType[] {\n const result = entities.reduce(\n (groups, entityToGroup) => {\n // Skip entities where admin.group is explicitly false\n if (entityToGroup.entity?.admin?.group === false) {\n return groups\n }\n\n if (permissions?.[entityToGroup.type.toLowerCase()]?.[entityToGroup.entity.slug]?.read) {\n const translatedGroup = getTranslation(entityToGroup.entity.admin.group, i18n)\n\n const labelOrFunction =\n 'labels' in entityToGroup.entity\n ? entityToGroup.entity.labels.plural\n : entityToGroup.entity.label\n\n const label =\n typeof labelOrFunction === 'function' ? labelOrFunction({ t: i18n.t }) : labelOrFunction\n\n if (entityToGroup.entity.admin.group) {\n const existingGroup = groups.find(\n (group) => getTranslation(group.label, i18n) === translatedGroup,\n ) as NavGroupType\n\n let matchedGroup: NavGroupType = existingGroup\n\n if (!existingGroup) {\n matchedGroup = { entities: [], label: translatedGroup }\n groups.push(matchedGroup)\n }\n\n matchedGroup.entities.push({\n slug: entityToGroup.entity.slug,\n type: entityToGroup.type,\n label,\n })\n } else {\n const defaultGroup = groups.find((group) => {\n return getTranslation(group.label, i18n) === i18n.t(`general:${entityToGroup.type}`)\n }) as NavGroupType\n defaultGroup.entities.push({\n slug: entityToGroup.entity.slug,\n type: entityToGroup.type,\n label,\n })\n }\n }\n\n return groups\n },\n [\n {\n entities: [],\n label: i18n.t('general:collections'),\n },\n {\n entities: [],\n label: i18n.t('general:globals'),\n },\n ],\n )\n\n return result.filter((group) => group.entities.length > 0)\n}\n"],"mappings":"AAQA,SAASA,cAAc,QAAQ;AAE/B,OAAO,IAAAC,UAAK,0BAAAA,UAAA;;;SAAAA,UAAA;;AAwBZ,OAAO,SAASC,cACdC,QAAyB,EACzBC,WAAiC,EACjCC,IAAgB;EAEhB,MAAMC,MAAA,GAASH,QAAA,CAASI,MAAM,CAC5B,CAACC,MAAA,EAAQC,aAAA;IACP;IACA,IAAIA,aAAA,CAAcC,MAAM,EAAEC,KAAA,EAAOC,KAAA,KAAU,OAAO;MAChD,OAAOJ,MAAA;IACT;IAEA,IAAIJ,WAAA,GAAcK,aAAA,CAAcI,IAAI,CAACC,WAAW,GAAG,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EAAMN,aAAA,CAAcC,MAAM,CAACK,IAAI;UAC/BF,IAAA,EAAMJ,aAAA,CAAcI,IAAI;UACxBQ;QACF;MACF;IACF;IAEA,OAAOb,MAAA;EACT,GACA,CACE;IACEL,QAAA,EAAU,EAAE;IACZkB,KAAA,EAAOhB,IAAA,CAAKiB,CAAC,CAAC;EAChB,GACA;IACEnB,QAAA,EAAU,EAAE;IACZkB,KAAA,EAAOhB,IAAA,CAAKiB,CAAC,CAAC;EAChB,EACD;EAGH,OAAOhB,MAAA,CAAOsB,MAAM,CAAEhB,KAAA,IAAUA,KAAA,CAAMT,QAAQ,CAAC0B,MAAM,GAAG;AAC1D","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/ui",
|
|
3
|
-
"version": "3.6.1-canary.
|
|
3
|
+
"version": "3.6.1-canary.9067b37",
|
|
4
4
|
"homepage": "https://payloadcms.com",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"ts-essentials": "10.0.3",
|
|
133
133
|
"use-context-selector": "2.0.0",
|
|
134
134
|
"uuid": "10.0.0",
|
|
135
|
-
"@payloadcms/translations": "3.6.1-canary.
|
|
135
|
+
"@payloadcms/translations": "3.6.1-canary.9067b37"
|
|
136
136
|
},
|
|
137
137
|
"devDependencies": {
|
|
138
138
|
"@babel/cli": "7.25.9",
|
|
@@ -149,14 +149,14 @@
|
|
|
149
149
|
"esbuild": "0.24.0",
|
|
150
150
|
"esbuild-sass-plugin": "3.3.1",
|
|
151
151
|
"eslint-plugin-react-compiler": "19.0.0-beta-df7b47d-20241124",
|
|
152
|
-
"payload": "3.6.1-canary.
|
|
152
|
+
"payload": "3.6.1-canary.9067b37",
|
|
153
153
|
"@payloadcms/eslint-config": "3.0.0"
|
|
154
154
|
},
|
|
155
155
|
"peerDependencies": {
|
|
156
156
|
"next": "^15.0.0",
|
|
157
157
|
"react": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
|
|
158
158
|
"react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
|
|
159
|
-
"payload": "3.6.1-canary.
|
|
159
|
+
"payload": "3.6.1-canary.9067b37"
|
|
160
160
|
},
|
|
161
161
|
"engines": {
|
|
162
162
|
"node": "^18.20.2 || >=20.9.0"
|