@payloadcms/figma 0.1.0-alpha.0 → 0.1.0-alpha.10
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/LICENSE.md +1 -1
- package/dist/{utils → adapters}/asset-collection.d.ts +17 -3
- package/dist/adapters/asset-collection.js +242 -0
- package/dist/{utils → adapters}/build-lambda-zip.d.ts +8 -7
- package/dist/adapters/build-lambda-zip.js +111 -0
- package/dist/adapters/configureNextjsCache.d.ts +8 -0
- package/dist/adapters/configureNextjsCache.js +55 -0
- package/dist/adapters/deploy-output/inspectNextjsOutput/getNextRelativeAppDir.d.ts +1 -0
- package/dist/adapters/deploy-output/inspectNextjsOutput/getNextRelativeAppDir.js +15 -0
- package/dist/adapters/deploy-output/inspectNextjsOutput.d.ts +12 -0
- package/dist/adapters/deploy-output/inspectNextjsOutput.js +28 -0
- package/dist/adapters/deploy-output/inspectNitroOutput.d.ts +9 -0
- package/dist/adapters/deploy-output/inspectNitroOutput.js +13 -0
- package/dist/adapters/deploy-output/isFile.d.ts +1 -0
- package/dist/adapters/deploy-output/isFile.js +4 -0
- package/dist/adapters/deploy-output/readJson.d.ts +1 -0
- package/dist/adapters/deploy-output/readJson.js +9 -0
- package/dist/adapters/deploy-output/resolveNitroOutputLayout.d.ts +8 -0
- package/dist/adapters/deploy-output/resolveNitroOutputLayout.js +16 -0
- package/dist/adapters/deploy-output/resolveOutputPath.d.ts +2 -0
- package/dist/adapters/deploy-output/resolveOutputPath.js +9 -0
- package/dist/adapters/deploy-output/resolveWithin.d.ts +1 -0
- package/dist/adapters/deploy-output/resolveWithin.js +12 -0
- package/dist/adapters/fs-utils.d.ts +39 -0
- package/dist/adapters/fs-utils.js +135 -0
- package/dist/adapters/index.d.ts +4 -0
- package/dist/adapters/index.js +3 -0
- package/dist/adapters/lambda-runtime/nextjs-cache.d.ts +40 -0
- package/dist/adapters/lambda-runtime/nextjs-cache.js +174 -0
- package/dist/adapters/nextjs.d.ts +12 -0
- package/dist/adapters/nextjs.js +67 -0
- package/dist/adapters/nitro.d.ts +8 -0
- package/dist/adapters/nitro.js +193 -0
- package/dist/adapters/secret-files.d.ts +25 -0
- package/dist/adapters/secret-files.js +50 -0
- package/dist/adapters/types.d.ts +42 -0
- package/dist/adapters/types.js +1 -0
- package/dist/{utils/adapters → adapters}/vite.d.ts +2 -2
- package/dist/adapters/vite.js +33 -0
- package/dist/api/check-project-subdomain-availability.d.ts +12 -0
- package/dist/api/check-project-subdomain-availability.js +32 -0
- package/dist/api/control-plane-error.d.ts +6 -0
- package/dist/api/control-plane-error.js +8 -0
- package/dist/api/control-plane-fetch.d.ts +7 -0
- package/dist/api/control-plane-fetch.js +37 -0
- package/dist/api/control-plane.d.ts +1 -9
- package/dist/api/control-plane.js +2 -48
- package/dist/api/create-project.d.ts +18 -0
- package/dist/api/create-project.js +37 -0
- package/dist/api/list-project-workspaces.d.ts +8 -0
- package/dist/api/list-project-workspaces.js +28 -0
- package/dist/api/project-resource-type.d.ts +1 -0
- package/dist/api/project-resource-type.js +1 -0
- package/dist/auth/headless-oauth-flow.d.ts +23 -0
- package/dist/auth/headless-oauth-flow.js +69 -0
- package/dist/auth/oauth-flow.d.ts +2 -0
- package/dist/auth/oauth-flow.js +13 -8
- package/dist/auth/token-store.d.ts +4 -1
- package/dist/auth/token-store.js +14 -0
- package/dist/auth/types.d.ts +12 -0
- package/dist/cli.d.ts +39 -0
- package/dist/cli.js +71 -36
- package/dist/commands/bootstrap.js +2 -1
- package/dist/commands/build-lambda-zip.js +1 -1
- package/dist/commands/deploy.d.ts +12 -0
- package/dist/commands/deploy.js +63 -25
- package/dist/commands/detect-project-resource-type.d.ts +3 -0
- package/dist/commands/detect-project-resource-type.js +28 -0
- package/dist/commands/init.d.ts +2 -2
- package/dist/commands/init.js +164 -79
- package/dist/commands/login.d.ts +11 -1
- package/dist/commands/login.js +66 -4
- package/dist/commands/prompt-to-create-project/format-project-subdomain.d.ts +1 -0
- package/dist/commands/prompt-to-create-project/format-project-subdomain.js +3 -0
- package/dist/commands/prompt-to-create-project/format-unavailable-subdomain-reason.d.ts +1 -0
- package/dist/commands/prompt-to-create-project/format-unavailable-subdomain-reason.js +7 -0
- package/dist/commands/prompt-to-create-project/get-default-project-name.d.ts +1 -0
- package/dist/commands/prompt-to-create-project/get-default-project-name.js +13 -0
- package/dist/commands/prompt-to-create-project/prompt-for-available-subdomain.d.ts +7 -0
- package/dist/commands/prompt-to-create-project/prompt-for-available-subdomain.js +32 -0
- package/dist/commands/prompt-to-create-project/resolve-project-region.d.ts +8 -0
- package/dist/commands/prompt-to-create-project/resolve-project-region.js +27 -0
- package/dist/commands/prompt-to-create-project/resolve-project-subdomain.d.ts +9 -0
- package/dist/commands/prompt-to-create-project/resolve-project-subdomain.js +54 -0
- package/dist/commands/prompt-to-create-project/resolve-text-input.d.ts +9 -0
- package/dist/commands/prompt-to-create-project/resolve-text-input.js +23 -0
- package/dist/commands/prompt-to-create-project/resolve-workspace-plan-key.d.ts +12 -0
- package/dist/commands/prompt-to-create-project/resolve-workspace-plan-key.js +36 -0
- package/dist/commands/prompt-to-create-project/validate-subdomain.d.ts +1 -0
- package/dist/commands/prompt-to-create-project/validate-subdomain.js +9 -0
- package/dist/commands/prompt-to-create-project.d.ts +24 -0
- package/dist/commands/prompt-to-create-project.js +69 -0
- package/dist/commands/setup-agent.d.ts +12 -0
- package/dist/commands/setup-agent.js +123 -0
- package/dist/commands/write-project-configuration.d.ts +12 -0
- package/dist/commands/write-project-configuration.js +16 -0
- package/dist/db-content-api/generated/content-api-types.d.ts +661 -16
- package/dist/db-content-api/index.d.ts +3 -0
- package/dist/db-content-api/index.js +155 -161
- package/dist/db-content-api/utilities/clientVersionHeaders.d.ts +7 -0
- package/dist/db-content-api/utilities/clientVersionHeaders.js +15 -0
- package/dist/db-content-api/utilities/data/atomicOperations.d.ts +16 -0
- package/dist/db-content-api/utilities/data/atomicOperations.js +48 -0
- package/dist/db-content-api/utilities/data/convertRelationshipIds.d.ts +25 -0
- package/dist/db-content-api/utilities/data/convertRelationshipIds.js +109 -0
- package/dist/db-content-api/utilities/data/index.js +73 -57
- package/dist/db-content-api/utilities/data/injectGlobalType.d.ts +6 -0
- package/dist/db-content-api/utilities/data/injectGlobalType.js +11 -0
- package/dist/db-content-api/utilities/data/isLocaleMap.d.ts +10 -0
- package/dist/db-content-api/utilities/data/isLocaleMap.js +13 -0
- package/dist/db-content-api/utilities/data/removeVirtualFields.d.ts +3 -11
- package/dist/db-content-api/utilities/data/removeVirtualFields.js +12 -50
- package/dist/db-content-api/utilities/data/resolveFieldLocalization.d.ts +18 -0
- package/dist/db-content-api/utilities/data/resolveFieldLocalization.js +21 -0
- package/dist/db-content-api/utilities/data/validateRelationships.js +19 -12
- package/dist/db-content-api/utilities/isRecord.d.ts +9 -0
- package/dist/db-content-api/utilities/isRecord.js +19 -0
- package/dist/db-content-api/utilities/joins.d.ts +6 -8
- package/dist/db-content-api/utilities/joins.js +13 -22
- package/dist/db-content-api/utilities/meta/resolvesToRelationshipValue.d.ts +10 -0
- package/dist/db-content-api/utilities/meta/resolvesToRelationshipValue.js +95 -0
- package/dist/db-content-api/utilities/meta/stringifyIdsInWhere.d.ts +9 -0
- package/dist/db-content-api/utilities/meta/stringifyIdsInWhere.js +112 -0
- package/dist/db-content-api/utilities/schema/buildDocumentSchema.d.ts +21 -4
- package/dist/db-content-api/utilities/schema/buildDocumentSchema.js +118 -36
- package/dist/db-content-api/utilities/schema/getDocumentSchema.d.ts +3 -0
- package/dist/db-content-api/utilities/schema/getDocumentSchema.js +24 -0
- package/dist/db-content-api/utilities/where.d.ts +3 -17
- package/dist/db-content-api/utilities/where.js +21 -21
- package/dist/exports/client.d.ts +2 -0
- package/dist/exports/client.js +2 -0
- package/dist/exports/views.d.ts +1 -0
- package/dist/exports/views.js +1 -0
- package/dist/imageSizeOptions.d.ts +23 -0
- package/dist/imageSizeOptions.js +26 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/lib/write-agent-config.d.ts +12 -0
- package/dist/lib/write-agent-config.js +52 -0
- package/dist/next/image-loader.d.ts +6 -0
- package/dist/next/image-loader.js +14 -0
- package/dist/oauth/components/LoginButton/index.js +66 -19
- package/dist/oauth/components/LoginButton/index.scss +121 -15
- package/dist/oauth/defaults.js +4 -1
- package/dist/oauth/endpoints/getLoginEndpoint.js +5 -2
- package/dist/oauth/index.js +8 -7
- package/dist/oauth/utilities/getAdminCollectionSlug.d.ts +1 -1
- package/dist/oauth/utilities/getAuthorizeURL.d.ts +1 -0
- package/dist/oauth/utilities/getAuthorizeURL.js +5 -1
- package/dist/plugin/build-config.d.ts +4 -2
- package/dist/plugin/build-config.js +95 -31
- package/dist/plugin/cache-revalidation-hooks.d.ts +6 -0
- package/dist/plugin/cache-revalidation-hooks.js +69 -0
- package/dist/plugin/cloud-limits/CloudLimitModal/index.d.ts +8 -0
- package/dist/plugin/cloud-limits/CloudLimitModal/index.js +66 -0
- package/dist/plugin/cloud-limits/CloudLimitModal/index.scss +56 -0
- package/dist/plugin/cloud-limits/CloudLimitProvider/index.d.ts +4 -0
- package/dist/plugin/cloud-limits/CloudLimitProvider/index.js +110 -0
- package/dist/plugin/cloud-limits/LimitReachedView/index.css +14 -0
- package/dist/plugin/cloud-limits/LimitReachedView/index.d.ts +4 -0
- package/dist/plugin/cloud-limits/LimitReachedView/index.js +52 -0
- package/dist/plugin/cloud-limits/SlugRegistryContext/index.d.ts +7 -0
- package/dist/plugin/cloud-limits/SlugRegistryContext/index.js +3 -0
- package/dist/plugin/cloud-limits/SlugTracker/index.d.ts +1 -0
- package/dist/plugin/cloud-limits/SlugTracker/index.js +27 -0
- package/dist/plugin/cloud-limits/icons/ExternalLinkIcon.d.ts +2 -0
- package/dist/plugin/cloud-limits/icons/ExternalLinkIcon.js +30 -0
- package/dist/plugin/cloud-limits/routes.d.ts +2 -0
- package/dist/plugin/cloud-limits/routes.js +4 -0
- package/dist/plugin/cloud-limits/server/redirectInitialAutosaveCreate.d.ts +9 -0
- package/dist/plugin/cloud-limits/server/redirectInitialAutosaveCreate.js +28 -0
- package/dist/plugin/cloud-limits/shared.d.ts +10 -0
- package/dist/plugin/cloud-limits/shared.js +52 -0
- package/dist/plugin/cloud-limits/utilities/cloudLimitInterceptor.d.ts +2 -0
- package/dist/plugin/cloud-limits/utilities/cloudLimitInterceptor.js +134 -0
- package/dist/plugin/cloud-limits/utilities/toasts.d.ts +4 -0
- package/dist/plugin/cloud-limits/utilities/toasts.js +19 -0
- package/dist/plugin/make-permission-access/make-permission-access.d.ts +8 -0
- package/dist/plugin/make-permission-access/make-permission-access.js +24 -0
- package/dist/plugin/sandbox-upload-fetch.d.ts +32 -0
- package/dist/plugin/sandbox-upload-fetch.js +53 -0
- package/dist/skills/deploy-to-figma/SKILL.md +234 -0
- package/dist/skills/deploy-to-figma/references/cli-reference.md +146 -0
- package/dist/storage-content-api/client-uploads/generate.js +2 -1
- package/dist/storage-content-api/getDownloadResponseHeaderPolicy.d.ts +11 -0
- package/dist/storage-content-api/getDownloadResponseHeaderPolicy.js +27 -0
- package/dist/storage-content-api/index.js +1 -0
- package/dist/storage-content-api/resolveDownloadResponseHeaders.d.ts +5 -0
- package/dist/storage-content-api/resolveDownloadResponseHeaders.js +13 -0
- package/dist/storage-content-api/staticHandler.js +2 -1
- package/dist/storage-content-api/types.d.ts +4 -1
- package/dist/translations/ar.d.ts +12 -0
- package/dist/translations/ar.js +12 -0
- package/dist/translations/az.d.ts +12 -0
- package/dist/translations/az.js +12 -0
- package/dist/translations/bg.d.ts +12 -0
- package/dist/translations/bg.js +12 -0
- package/dist/translations/bnBd.d.ts +12 -0
- package/dist/translations/bnBd.js +12 -0
- package/dist/translations/bnIn.d.ts +12 -0
- package/dist/translations/bnIn.js +12 -0
- package/dist/translations/ca.d.ts +12 -0
- package/dist/translations/ca.js +12 -0
- package/dist/translations/cs.d.ts +12 -0
- package/dist/translations/cs.js +12 -0
- package/dist/translations/da.d.ts +12 -0
- package/dist/translations/da.js +12 -0
- package/dist/translations/de.d.ts +12 -0
- package/dist/translations/de.js +12 -0
- package/dist/translations/en.d.ts +12 -0
- package/dist/translations/en.js +12 -0
- package/dist/translations/es.d.ts +12 -0
- package/dist/translations/es.js +12 -0
- package/dist/translations/et.d.ts +12 -0
- package/dist/translations/et.js +12 -0
- package/dist/translations/fa.d.ts +12 -0
- package/dist/translations/fa.js +12 -0
- package/dist/translations/fr.d.ts +12 -0
- package/dist/translations/fr.js +12 -0
- package/dist/translations/he.d.ts +12 -0
- package/dist/translations/he.js +12 -0
- package/dist/translations/hr.d.ts +12 -0
- package/dist/translations/hr.js +12 -0
- package/dist/translations/hu.d.ts +12 -0
- package/dist/translations/hu.js +12 -0
- package/dist/translations/hy.d.ts +12 -0
- package/dist/translations/hy.js +12 -0
- package/dist/translations/id.d.ts +12 -0
- package/dist/translations/id.js +12 -0
- package/dist/translations/index.d.ts +533 -0
- package/dist/translations/index.js +90 -0
- package/dist/translations/is.d.ts +12 -0
- package/dist/translations/is.js +12 -0
- package/dist/translations/it.d.ts +12 -0
- package/dist/translations/it.js +12 -0
- package/dist/translations/ja.d.ts +12 -0
- package/dist/translations/ja.js +12 -0
- package/dist/translations/ko.d.ts +12 -0
- package/dist/translations/ko.js +12 -0
- package/dist/translations/lt.d.ts +12 -0
- package/dist/translations/lt.js +12 -0
- package/dist/translations/lv.d.ts +12 -0
- package/dist/translations/lv.js +12 -0
- package/dist/translations/my.d.ts +12 -0
- package/dist/translations/my.js +12 -0
- package/dist/translations/nb.d.ts +12 -0
- package/dist/translations/nb.js +12 -0
- package/dist/translations/nl.d.ts +12 -0
- package/dist/translations/nl.js +12 -0
- package/dist/translations/pl.d.ts +12 -0
- package/dist/translations/pl.js +12 -0
- package/dist/translations/pt.d.ts +12 -0
- package/dist/translations/pt.js +12 -0
- package/dist/translations/ro.d.ts +12 -0
- package/dist/translations/ro.js +12 -0
- package/dist/translations/rs.d.ts +12 -0
- package/dist/translations/rs.js +12 -0
- package/dist/translations/rsLatin.d.ts +12 -0
- package/dist/translations/rsLatin.js +12 -0
- package/dist/translations/ru.d.ts +12 -0
- package/dist/translations/ru.js +12 -0
- package/dist/translations/sk.d.ts +12 -0
- package/dist/translations/sk.js +12 -0
- package/dist/translations/sl.d.ts +12 -0
- package/dist/translations/sl.js +12 -0
- package/dist/translations/sv.d.ts +12 -0
- package/dist/translations/sv.js +12 -0
- package/dist/translations/ta.d.ts +12 -0
- package/dist/translations/ta.js +12 -0
- package/dist/translations/th.d.ts +12 -0
- package/dist/translations/th.js +12 -0
- package/dist/translations/tr.d.ts +12 -0
- package/dist/translations/tr.js +12 -0
- package/dist/translations/uk.d.ts +12 -0
- package/dist/translations/uk.js +12 -0
- package/dist/translations/vi.d.ts +12 -0
- package/dist/translations/vi.js +12 -0
- package/dist/translations/zh.d.ts +12 -0
- package/dist/translations/zh.js +12 -0
- package/dist/translations/zhTw.d.ts +12 -0
- package/dist/translations/zhTw.js +12 -0
- package/dist/types.d.ts +11 -0
- package/dist/utils/assert-never.d.ts +1 -0
- package/dist/utils/assert-never.js +3 -0
- package/dist/utils/build-detection.d.ts +6 -1
- package/dist/utils/build-detection.js +68 -89
- package/dist/utils/deploy-adapter.d.ts +3 -35
- package/dist/utils/deploy-adapter.js +25 -14
- package/dist/utils/lambda-config.js +18 -23
- package/dist/utils/load-payload-config.d.ts +2 -2
- package/dist/utils/messages.js +24 -3
- package/dist/utils/next-image-loader-config.d.ts +2 -0
- package/dist/utils/next-image-loader-config.js +63 -0
- package/dist/utils/next-image-loader-file.d.ts +2 -0
- package/dist/utils/next-image-loader-file.js +11 -0
- package/dist/utils/payload-generate.d.ts +10 -0
- package/dist/utils/payload-generate.js +59 -0
- package/dist/utils/pnpm-builds.d.ts +14 -0
- package/dist/utils/pnpm-builds.js +125 -0
- package/dist/utils/s3-upload.js +4 -1
- package/package.json +31 -7
- package/dist/db-content-api/utilities/meta/buildLocalizedPaths.d.ts +0 -10
- package/dist/db-content-api/utilities/meta/buildLocalizedPaths.js +0 -71
- package/dist/db-content-api/utilities/meta/buildMeta.d.ts +0 -41
- package/dist/db-content-api/utilities/meta/buildMeta.js +0 -39
- package/dist/db-content-api/utilities/meta/buildPathTypes.d.ts +0 -16
- package/dist/db-content-api/utilities/meta/buildPathTypes.js +0 -243
- package/dist/db-content-api/utilities/meta/buildUniquePaths.d.ts +0 -12
- package/dist/db-content-api/utilities/meta/buildUniquePaths.js +0 -60
- package/dist/lib/download-skill.d.ts +0 -12
- package/dist/lib/download-skill.js +0 -77
- package/dist/utils/adapters/nextjs.d.ts +0 -8
- package/dist/utils/adapters/nextjs.js +0 -61
- package/dist/utils/adapters/nitro.d.ts +0 -8
- package/dist/utils/adapters/nitro.js +0 -172
- package/dist/utils/adapters/vite.js +0 -31
- package/dist/utils/asset-collection.js +0 -144
- package/dist/utils/build-lambda-zip.js +0 -90
- package/dist/utils/fs-utils.d.ts +0 -12
- package/dist/utils/fs-utils.js +0 -55
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
.oauth-login,
|
|
2
|
+
.oauth-login__admin-shimmer {
|
|
3
|
+
--oauth-login-shimmer-bg: var(--theme-bg, var(--theme-elevation-0, #ffffff));
|
|
4
|
+
--oauth-login-shimmer-block: var(--theme-elevation-100, #efefef);
|
|
5
|
+
--oauth-login-shimmer-highlight: var(--theme-elevation-200, #f7f7f7);
|
|
6
|
+
}
|
|
7
|
+
|
|
1
8
|
.oauth-login {
|
|
2
9
|
display: flex;
|
|
3
10
|
justify-content: center;
|
|
@@ -55,28 +62,127 @@
|
|
|
55
62
|
Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
56
63
|
}
|
|
57
64
|
|
|
58
|
-
&
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
&__admin-shimmer {
|
|
66
|
+
position: fixed;
|
|
67
|
+
inset: 0;
|
|
68
|
+
z-index: 1000;
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
background: var(--oauth-login-shimmer-bg);
|
|
64
71
|
font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
65
72
|
Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
66
73
|
}
|
|
67
74
|
|
|
68
|
-
&
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
&__admin-shimmer-main {
|
|
76
|
+
padding: 2rem 2.5rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&__shimmer-block {
|
|
80
|
+
position: relative;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
border-radius: 0.25rem;
|
|
83
|
+
background-color: var(--oauth-login-shimmer-block);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&__shimmer-block::after {
|
|
87
|
+
content: '';
|
|
88
|
+
position: absolute;
|
|
89
|
+
inset: 0;
|
|
90
|
+
border-radius: inherit;
|
|
91
|
+
background-image: linear-gradient(
|
|
92
|
+
100deg,
|
|
93
|
+
transparent 0%,
|
|
94
|
+
transparent 35%,
|
|
95
|
+
var(--oauth-login-shimmer-highlight) 50%,
|
|
96
|
+
transparent 65%,
|
|
97
|
+
transparent 100%
|
|
98
|
+
);
|
|
99
|
+
pointer-events: none;
|
|
100
|
+
transform: translateX(-100%);
|
|
101
|
+
animation: oauth-login-shimmer 1.45s linear infinite;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&__shimmer-heading-row {
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
gap: 0.5rem;
|
|
108
|
+
height: 1.75rem;
|
|
109
|
+
margin-bottom: 1rem;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&__shimmer-heading-icon {
|
|
113
|
+
width: 1.5rem;
|
|
114
|
+
height: 1.5rem;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&__shimmer-heading-label {
|
|
118
|
+
width: 7.5rem;
|
|
119
|
+
height: 1.25rem;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&__shimmer-section {
|
|
123
|
+
margin-bottom: 1.5rem;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&__shimmer-section-label {
|
|
127
|
+
width: 7.5rem;
|
|
128
|
+
height: 1.25rem;
|
|
129
|
+
margin-bottom: 0.5rem;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&__shimmer-card-grid {
|
|
133
|
+
display: grid;
|
|
134
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
135
|
+
gap: 1rem;
|
|
136
|
+
max-width: 51.625rem;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&__shimmer-card {
|
|
140
|
+
height: 4rem;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@media (prefers-color-scheme: dark) {
|
|
145
|
+
.oauth-login,
|
|
146
|
+
.oauth-login__admin-shimmer {
|
|
147
|
+
--oauth-login-shimmer-bg: var(--theme-bg, var(--theme-elevation-0, #2b2b2b));
|
|
148
|
+
--oauth-login-shimmer-block: var(--theme-elevation-100, #383838);
|
|
149
|
+
--oauth-login-shimmer-highlight: var(--theme-elevation-200, #444444);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@media (max-width: 48rem) {
|
|
154
|
+
.oauth-login {
|
|
155
|
+
&__shimmer-card-grid {
|
|
156
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
157
|
+
}
|
|
75
158
|
}
|
|
76
159
|
}
|
|
77
160
|
|
|
78
|
-
@
|
|
161
|
+
@media (max-width: 30rem) {
|
|
162
|
+
.oauth-login {
|
|
163
|
+
&__admin-shimmer-main {
|
|
164
|
+
padding-right: 0.75rem;
|
|
165
|
+
padding-left: 0.75rem;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&__shimmer-card-grid {
|
|
169
|
+
grid-template-columns: 1fr;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@media (prefers-reduced-motion: reduce) {
|
|
175
|
+
.oauth-login__shimmer-block::after {
|
|
176
|
+
animation: none;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
@keyframes oauth-login-shimmer {
|
|
181
|
+
from {
|
|
182
|
+
transform: translateX(-100%);
|
|
183
|
+
}
|
|
184
|
+
|
|
79
185
|
to {
|
|
80
|
-
transform:
|
|
186
|
+
transform: translateX(100%);
|
|
81
187
|
}
|
|
82
188
|
}
|
package/dist/oauth/defaults.js
CHANGED
|
@@ -56,6 +56,7 @@ export const defaultVerify = ({ collection, strategyName, userInfoCookieName = D
|
|
|
56
56
|
collection: collection.slug,
|
|
57
57
|
depth,
|
|
58
58
|
limit: 1,
|
|
59
|
+
overrideAccess: true,
|
|
59
60
|
pagination: false,
|
|
60
61
|
where: {
|
|
61
62
|
[usernameField.name]: {
|
|
@@ -79,7 +80,8 @@ export const defaultVerify = ({ collection, strategyName, userInfoCookieName = D
|
|
|
79
80
|
figmaImageUrl: figmaUserInfo.img_url
|
|
80
81
|
}
|
|
81
82
|
},
|
|
82
|
-
depth
|
|
83
|
+
depth,
|
|
84
|
+
overrideAccess: true
|
|
83
85
|
});
|
|
84
86
|
}
|
|
85
87
|
} else {
|
|
@@ -109,6 +111,7 @@ export const defaultVerify = ({ collection, strategyName, userInfoCookieName = D
|
|
|
109
111
|
collection: collection.slug,
|
|
110
112
|
depth,
|
|
111
113
|
limit: 1,
|
|
114
|
+
overrideAccess: true,
|
|
112
115
|
pagination: false,
|
|
113
116
|
where: {
|
|
114
117
|
[usernameField.name]: {
|
|
@@ -6,7 +6,7 @@ import { createDebugLogger } from '../utilities/createDebugLogger.js';
|
|
|
6
6
|
import { establishSession } from '../utilities/establishSession.js';
|
|
7
7
|
import { exchangeCodeForAccessToken } from '../utilities/exchangeCodeForAccessToken.js';
|
|
8
8
|
import { extractOrigin } from '../utilities/extractOrigin.js';
|
|
9
|
-
import { buildCsrfCookieClearHeader, OAUTH_STATE_CSRF_COOKIE_NAME } from '../utilities/getAuthorizeURL.js';
|
|
9
|
+
import { buildCsrfCookieClearHeader, getOAuthCallbackPath, OAUTH_STATE_CSRF_COOKIE_NAME } from '../utilities/getAuthorizeURL.js';
|
|
10
10
|
import { isAbsoluteURL } from '../utilities/isAbsoluteURL.js';
|
|
11
11
|
export const getLoginEndpoint = ({ collection, collectionOptions, endpointSlug, pluginOptions, strategy })=>({
|
|
12
12
|
handler: async (req)=>{
|
|
@@ -151,7 +151,10 @@ export const getLoginEndpoint = ({ collection, collectionOptions, endpointSlug,
|
|
|
151
151
|
}
|
|
152
152
|
const redirectUri = formatAdminURL({
|
|
153
153
|
apiRoute: config.routes?.api || '/api',
|
|
154
|
-
path:
|
|
154
|
+
path: getOAuthCallbackPath({
|
|
155
|
+
collection,
|
|
156
|
+
endpointSlug
|
|
157
|
+
}),
|
|
155
158
|
serverURL: redirectServerURL
|
|
156
159
|
});
|
|
157
160
|
debugLogger.info({
|
package/dist/oauth/index.js
CHANGED
|
@@ -148,6 +148,13 @@ export const oAuth2Plugin = (pluginOptions)=>(config)=>{
|
|
|
148
148
|
usernameField
|
|
149
149
|
})
|
|
150
150
|
});
|
|
151
|
+
const loginEndpoint = getLoginEndpoint({
|
|
152
|
+
collection: existingCollection,
|
|
153
|
+
collectionOptions,
|
|
154
|
+
endpointSlug,
|
|
155
|
+
pluginOptions,
|
|
156
|
+
strategy
|
|
157
|
+
});
|
|
151
158
|
const authStrategy = {
|
|
152
159
|
name: `${existingCollection.slug}-${strategyName}`,
|
|
153
160
|
// Bind 'this' to ensure the authenticate function has the correct context
|
|
@@ -180,13 +187,7 @@ export const oAuth2Plugin = (pluginOptions)=>(config)=>{
|
|
|
180
187
|
},
|
|
181
188
|
endpoints: [
|
|
182
189
|
...existingCollection.endpoints || [],
|
|
183
|
-
|
|
184
|
-
collection: existingCollection,
|
|
185
|
-
collectionOptions,
|
|
186
|
-
endpointSlug,
|
|
187
|
-
pluginOptions,
|
|
188
|
-
strategy
|
|
189
|
-
}),
|
|
190
|
+
loginEndpoint,
|
|
190
191
|
getMetaEndpoint({
|
|
191
192
|
collection: existingCollection,
|
|
192
193
|
collectionOptions,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Config } from 'payload';
|
|
2
|
-
export declare const getAdminCollectionSlug: (config: Config) => string;
|
|
2
|
+
export declare const getAdminCollectionSlug: (config: Pick<Config, "admin" | "collections">) => string;
|
|
@@ -45,6 +45,7 @@ export interface AuthorizeURLResult {
|
|
|
45
45
|
csrfNonce: string;
|
|
46
46
|
params: AuthorizeURLParams;
|
|
47
47
|
}
|
|
48
|
+
export declare const getOAuthCallbackPath: ({ collection, endpointSlug, }: Pick<Args, "collection" | "endpointSlug">) => `/${string}`;
|
|
48
49
|
export declare const getAuthorizeURL: ({ collection, collectionOptions, endpointSlug, existingCsrfNonce, failedRedirect, payload, pluginOptions, redirect, serverURLOverride, strategy, }: Args) => Promise<AuthorizeURLResult>;
|
|
49
50
|
/**
|
|
50
51
|
* Name of the HttpOnly cookie that carries the browser-bound CSRF nonce
|
|
@@ -2,6 +2,7 @@ import crypto from 'crypto';
|
|
|
2
2
|
import * as QueryString from 'qs-esm';
|
|
3
3
|
import { v4 as uuid } from 'uuid';
|
|
4
4
|
import { defaultScope } from '../defaults.js';
|
|
5
|
+
export const getOAuthCallbackPath = ({ collection, endpointSlug })=>`/${collection.slug}/${endpointSlug}/login`;
|
|
5
6
|
export const getAuthorizeURL = async ({ collection, collectionOptions, endpointSlug, existingCsrfNonce, failedRedirect, payload, pluginOptions, redirect, serverURLOverride, strategy })=>{
|
|
6
7
|
const { redirectServerURL } = pluginOptions;
|
|
7
8
|
await strategy.ensureMeta();
|
|
@@ -30,7 +31,10 @@ export const getAuthorizeURL = async ({ collection, collectionOptions, endpointS
|
|
|
30
31
|
state.failedRedirect = failedRedirect;
|
|
31
32
|
}
|
|
32
33
|
const baseRedirectURL = redirectServerURL || payload.config.serverURL || state.serverURL;
|
|
33
|
-
const loginRedirectURL = encodeURI(`${baseRedirectURL}${payload.config.routes?.api || '/api'}
|
|
34
|
+
const loginRedirectURL = encodeURI(`${baseRedirectURL}${payload.config.routes?.api || '/api'}${getOAuthCallbackPath({
|
|
35
|
+
collection,
|
|
36
|
+
endpointSlug
|
|
37
|
+
})}`);
|
|
34
38
|
const params = {
|
|
35
39
|
client_id: collectionOptions.clientID,
|
|
36
40
|
code_challenge,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Config, SanitizedConfig } from 'payload';
|
|
1
|
+
import type { Config, SanitizedConfig, UploadInstructionsAccess } from 'payload';
|
|
2
2
|
/**
|
|
3
3
|
* Worker-trusted marker injected by Figma's sites-worker after it validates the
|
|
4
4
|
* X-Figma-Job-Queues-Auth-Bypass secret on a Payload jobs endpoint. The default
|
|
@@ -48,7 +48,9 @@ export type FigmaConfig = {
|
|
|
48
48
|
figma: {
|
|
49
49
|
contentSystemId?: string;
|
|
50
50
|
environmentId?: string;
|
|
51
|
-
storage?:
|
|
51
|
+
storage?: {
|
|
52
|
+
uploadInstructionsAccess?: UploadInstructionsAccess;
|
|
53
|
+
} | boolean;
|
|
52
54
|
useContentSystem?: boolean;
|
|
53
55
|
};
|
|
54
56
|
} & Omit<Config, 'db' | 'editor' | 'secret'> & Partial<Pick<Config, 'db'>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { cloudStoragePlugin } from '@payloadcms/plugin-cloud-storage';
|
|
2
2
|
import { lexicalEditor } from '@payloadcms/richtext-lexical';
|
|
3
3
|
import { buildConfig as payloadBuildConfig } from 'payload';
|
|
4
|
+
import { deepMergeSimple } from 'payload/shared';
|
|
4
5
|
import { getBootstrapInfo } from '../api/control-plane.js';
|
|
5
6
|
import { getValidCredential } from '../auth/oauth-flow.js';
|
|
6
7
|
import { getTokenStore } from '../auth/token-store.js';
|
|
@@ -10,14 +11,20 @@ import { scheduleExtractPlugin } from '../deploy/schedule-extract-plugin.js';
|
|
|
10
11
|
import { health } from '../endpoints/health.js';
|
|
11
12
|
import { schema } from '../endpoints/schema.js';
|
|
12
13
|
import { oAuth2Plugin } from '../oauth/index.js';
|
|
14
|
+
import { getAdminCollectionSlug } from '../oauth/utilities/getAdminCollectionSlug.js';
|
|
13
15
|
import { createStorageClient } from '../storage-content-api/client.js';
|
|
14
16
|
import { contentApiStorageAdapter } from '../storage-content-api/index.js';
|
|
17
|
+
import { translations as figmaTranslations } from '../translations/index.js';
|
|
15
18
|
import { cacheAllEnvironments } from '../utils/cache-bootstrap.js';
|
|
16
19
|
import { getEnvVarSync } from '../utils/env-management.js';
|
|
17
20
|
import * as log from '../utils/log.js';
|
|
18
21
|
import { logMissingCliAuth } from './auth-preflight.js';
|
|
19
22
|
import { logMissingContentSystemId } from './bootstrap-preflight.js';
|
|
23
|
+
import { createCacheRevalidationHooksPlugin } from './cache-revalidation-hooks.js';
|
|
24
|
+
import { LIMIT_REACHED_VIEW_KEY, LIMIT_REACHED_VIEW_PATH } from './cloud-limits/routes.js';
|
|
20
25
|
import { getDevCookieNames } from './dev-cookie-names.js';
|
|
26
|
+
import { passesMakeViewerWriteGate, withMakeViewerWriteBaseAccessDefaults } from './make-permission-access/make-permission-access.js';
|
|
27
|
+
import { createSandboxUploadFetchPlugin } from './sandbox-upload-fetch.js';
|
|
21
28
|
/**
|
|
22
29
|
* Worker-trusted marker injected by Figma's sites-worker after it validates the
|
|
23
30
|
* X-Figma-Job-Queues-Auth-Bypass secret on a Payload jobs endpoint. The default
|
|
@@ -27,7 +34,7 @@ import { getDevCookieNames } from './dev-cookie-names.js';
|
|
|
27
34
|
* KEEP_IN_SYNC(cloudflare/wrangler/sites-worker/src/auth.ts): FIGMA_INTERNAL_FORWARDED_HAS_AUTH_BYPASS_HEADER
|
|
28
35
|
*/ export const FIGMA_INTERNAL_FORWARDED_HAS_AUTH_BYPASS_HEADER = 'figma-internal-forwarded-has-auth-bypass';
|
|
29
36
|
/**
|
|
30
|
-
* Fields added to
|
|
37
|
+
* Fields added to the configured Payload Admin collection for Figma profile info
|
|
31
38
|
*/ const figmaUserFields = [
|
|
32
39
|
{
|
|
33
40
|
name: 'figmaHandle',
|
|
@@ -165,23 +172,26 @@ function messageOf(error) {
|
|
|
165
172
|
}
|
|
166
173
|
/**
|
|
167
174
|
* Creates storage configuration for upload collections
|
|
168
|
-
*/ function createStorageConfig(url, contentSystemId) {
|
|
169
|
-
const storageConfig =
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
175
|
+
*/ function createStorageConfig(url, contentSystemId, uploadInstructionsAccess) {
|
|
176
|
+
const storageConfig = {
|
|
177
|
+
...process.env.FIGMA_CONTENT_API_ACCESS_KEY ? {
|
|
178
|
+
baseUrl: url,
|
|
179
|
+
contentApiKey: process.env.FIGMA_CONTENT_API_ACCESS_KEY
|
|
180
|
+
} : process.env.FIGMA_DEV_JWT === 'true' ? {
|
|
181
|
+
auth: {
|
|
182
|
+
mode: 'devJwt'
|
|
183
|
+
},
|
|
184
|
+
baseUrl: url,
|
|
185
|
+
contentSystemId
|
|
186
|
+
} : {
|
|
187
|
+
auth: {
|
|
188
|
+
mode: 'tokenStore',
|
|
189
|
+
tokenStore: getTokenStore()
|
|
190
|
+
},
|
|
191
|
+
baseUrl: url,
|
|
192
|
+
contentSystemId
|
|
182
193
|
},
|
|
183
|
-
|
|
184
|
-
contentSystemId
|
|
194
|
+
uploadInstructionsAccess
|
|
185
195
|
};
|
|
186
196
|
const adapter = contentApiStorageAdapter(storageConfig);
|
|
187
197
|
const storageClient = createStorageClient(storageConfig);
|
|
@@ -193,13 +203,13 @@ function messageOf(error) {
|
|
|
193
203
|
/**
|
|
194
204
|
* Plugin that applies cloud storage configuration to all upload-enabled collections.
|
|
195
205
|
* Runs at the end of the plugin chain so it sees collections added by user plugins too.
|
|
196
|
-
*/ function createStoragePlugin(url, contentSystemId) {
|
|
206
|
+
*/ function createStoragePlugin(url, contentSystemId, uploadInstructionsAccess) {
|
|
197
207
|
return (incomingConfig)=>{
|
|
198
208
|
const uploadCollections = (incomingConfig.collections || []).filter((c)=>c.upload);
|
|
199
209
|
if (uploadCollections.length === 0) {
|
|
200
210
|
return incomingConfig;
|
|
201
211
|
}
|
|
202
|
-
const { adapter } = createStorageConfig(url, contentSystemId);
|
|
212
|
+
const { adapter } = createStorageConfig(url, contentSystemId, uploadInstructionsAccess);
|
|
203
213
|
const collectionsMap = uploadCollections.reduce((acc, c)=>{
|
|
204
214
|
acc[c.slug] = {
|
|
205
215
|
adapter,
|
|
@@ -277,7 +287,8 @@ export async function buildFigmaConfig(config) {
|
|
|
277
287
|
}
|
|
278
288
|
// Determine database adapter based on environment
|
|
279
289
|
let db;
|
|
280
|
-
|
|
290
|
+
const usesContentSystem = config.figma.useContentSystem !== false;
|
|
291
|
+
if (!usesContentSystem) {
|
|
281
292
|
db = config.db;
|
|
282
293
|
} else if (process.env.FIGMA_CONTENT_API_ACCESS_KEY) {
|
|
283
294
|
db = contentAPIAdapter({
|
|
@@ -313,6 +324,7 @@ export async function buildFigmaConfig(config) {
|
|
|
313
324
|
});
|
|
314
325
|
}
|
|
315
326
|
const userJobsAccessRun = config.jobs?.access?.run;
|
|
327
|
+
const adminCollectionSlug = getAdminCollectionSlug(config);
|
|
316
328
|
// Build complete config with Figma platform defaults
|
|
317
329
|
const configWithFigmaDefaults = {
|
|
318
330
|
...config,
|
|
@@ -322,11 +334,24 @@ export async function buildFigmaConfig(config) {
|
|
|
322
334
|
avatar: {
|
|
323
335
|
Component: '@payloadcms/figma/client#FigmaAvatar'
|
|
324
336
|
},
|
|
325
|
-
...config.admin
|
|
337
|
+
...config.admin,
|
|
338
|
+
components: {
|
|
339
|
+
...config.admin?.components,
|
|
340
|
+
providers: [
|
|
341
|
+
...config.admin?.components?.providers ?? [],
|
|
342
|
+
'@payloadcms/figma/client#FigmaCloudLimitProvider'
|
|
343
|
+
]
|
|
344
|
+
}
|
|
326
345
|
},
|
|
346
|
+
// Payload applies this policy during sanitization, after user plugins and
|
|
347
|
+
// generated resources have registered their collections and globals.
|
|
348
|
+
baseAccess: withMakeViewerWriteBaseAccessDefaults(config.baseAccess),
|
|
327
349
|
custom: {
|
|
328
350
|
figma: {
|
|
329
351
|
...config.figma,
|
|
352
|
+
...typeof config.figma.storage === 'object' ? {
|
|
353
|
+
storage: true
|
|
354
|
+
} : {},
|
|
330
355
|
contentSystemId,
|
|
331
356
|
environmentId
|
|
332
357
|
}
|
|
@@ -338,10 +363,14 @@ export async function buildFigmaConfig(config) {
|
|
|
338
363
|
health,
|
|
339
364
|
schema
|
|
340
365
|
],
|
|
366
|
+
i18n: {
|
|
367
|
+
...config.i18n,
|
|
368
|
+
translations: deepMergeSimple(figmaTranslations, config.i18n?.translations ?? {})
|
|
369
|
+
},
|
|
341
370
|
// Gate /api/payload-jobs/run and /api/payload-jobs/handle-schedules. Honor the
|
|
342
371
|
// sites-worker trust marker so Figma infra job runs never break, defer to the
|
|
343
|
-
// tenant's jobs.access.run if they set one, otherwise
|
|
344
|
-
//
|
|
372
|
+
// tenant's jobs.access.run if they set one, otherwise require an authenticated
|
|
373
|
+
// user who is not a known Make viewer.
|
|
345
374
|
jobs: {
|
|
346
375
|
...config.jobs ?? {},
|
|
347
376
|
access: {
|
|
@@ -353,7 +382,9 @@ export async function buildFigmaConfig(config) {
|
|
|
353
382
|
if (userJobsAccessRun) {
|
|
354
383
|
return userJobsAccessRun(args);
|
|
355
384
|
}
|
|
356
|
-
|
|
385
|
+
// Allow undefined Make permissions during rollout, but fail closed for empty,
|
|
386
|
+
// explicit view, and other unrecognized values.
|
|
387
|
+
return Boolean(args.req.user) && passesMakeViewerWriteGate(args.req.user);
|
|
357
388
|
}
|
|
358
389
|
}
|
|
359
390
|
},
|
|
@@ -367,12 +398,12 @@ export async function buildFigmaConfig(config) {
|
|
|
367
398
|
plugins: [
|
|
368
399
|
...config.plugins ?? [],
|
|
369
400
|
...config.figma.storage !== false ? [
|
|
370
|
-
createStoragePlugin(url, contentSystemId)
|
|
401
|
+
createStoragePlugin(url, contentSystemId, typeof config.figma.storage === 'object' ? config.figma.storage.uploadInstructionsAccess : undefined)
|
|
371
402
|
] : [],
|
|
372
403
|
oAuth2Plugin({
|
|
373
404
|
collections: [
|
|
374
405
|
{
|
|
375
|
-
slug:
|
|
406
|
+
slug: adminCollectionSlug,
|
|
376
407
|
// Use adapter because Figma app doesn't support OIDC scopes
|
|
377
408
|
authorizationURLParams: {
|
|
378
409
|
response_mode: 'query',
|
|
@@ -392,21 +423,54 @@ export async function buildFigmaConfig(config) {
|
|
|
392
423
|
debug: !!process.env.DEBUG,
|
|
393
424
|
disabled: false
|
|
394
425
|
}),
|
|
395
|
-
scheduleExtractPlugin()
|
|
426
|
+
scheduleExtractPlugin(),
|
|
427
|
+
// Not folded into createStoragePlugin, which is skipped when
|
|
428
|
+
// figma.storage is false and would break remote uploads for those apps.
|
|
429
|
+
createSandboxUploadFetchPlugin({
|
|
430
|
+
userCollections: config.collections
|
|
431
|
+
}),
|
|
432
|
+
// Keep last so hooks added by app plugins also get the missing Next cache
|
|
433
|
+
// context guard used by Payload CLI operations in the Make sandbox.
|
|
434
|
+
createCacheRevalidationHooksPlugin()
|
|
396
435
|
]
|
|
397
436
|
};
|
|
398
|
-
// Inject
|
|
437
|
+
// Inject Figma-managed identity fields only into the Payload Admin collection.
|
|
399
438
|
const collections = configWithFigmaDefaults.collections?.map((col)=>{
|
|
400
|
-
|
|
439
|
+
const views = col.admin?.components?.views;
|
|
440
|
+
const withLimitView = usesContentSystem ? {
|
|
441
|
+
...col,
|
|
442
|
+
admin: {
|
|
443
|
+
...col.admin,
|
|
444
|
+
components: {
|
|
445
|
+
...col.admin?.components,
|
|
446
|
+
edit: {
|
|
447
|
+
...col.admin?.components?.edit,
|
|
448
|
+
beforeDocumentControls: [
|
|
449
|
+
'@payloadcms/figma/client#FigmaCloudLimitSlugTracker',
|
|
450
|
+
...col.admin?.components?.edit?.beforeDocumentControls ?? []
|
|
451
|
+
]
|
|
452
|
+
},
|
|
453
|
+
views: {
|
|
454
|
+
...views,
|
|
455
|
+
[LIMIT_REACHED_VIEW_KEY]: {
|
|
456
|
+
Component: '@payloadcms/figma/views#LimitReachedView',
|
|
457
|
+
exact: true,
|
|
458
|
+
path: LIMIT_REACHED_VIEW_PATH
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
} : col;
|
|
464
|
+
if (col.slug === adminCollectionSlug) {
|
|
401
465
|
return {
|
|
402
|
-
...
|
|
466
|
+
...withLimitView,
|
|
403
467
|
fields: [
|
|
404
468
|
...col.fields || [],
|
|
405
469
|
...figmaUserFields
|
|
406
470
|
]
|
|
407
471
|
};
|
|
408
472
|
}
|
|
409
|
-
return
|
|
473
|
+
return withLimitView;
|
|
410
474
|
});
|
|
411
475
|
if (collections) {
|
|
412
476
|
configWithFigmaDefaults.collections = collections;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Plugin } from 'payload';
|
|
2
|
+
/**
|
|
3
|
+
* Prevent Next cache invalidation from turning a successful Payload mutation
|
|
4
|
+
* into an apparent failure when the mutation runs outside a Next request.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createCacheRevalidationHooksPlugin(): Plugin;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const missingNextCacheContext = /^Invariant: static generation store missing in (?:revalidateTag|revalidatePath|updateTag)\b/;
|
|
2
|
+
const unsupportedUpdateTagContext = /^updateTag can only be called from within a Server Action\./;
|
|
3
|
+
/**
|
|
4
|
+
* Next cache invalidation requires request-scoped state. Payload's Local API has
|
|
5
|
+
* no Next request when it runs from the CLI in a Make sandbox, so Next throws
|
|
6
|
+
* after the database write has already committed. Treat only that missing-
|
|
7
|
+
* context error as a no-op; cache invalidation still runs normally in a Next
|
|
8
|
+
* request, and all other hook failures retain their existing behavior.
|
|
9
|
+
*/ function isUnsupportedNextCacheContextError(error) {
|
|
10
|
+
if (!(error instanceof Error)) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
const errorCode = error.__NEXT_ERROR_CODE;
|
|
14
|
+
if (missingNextCacheContext.test(error.message)) {
|
|
15
|
+
return errorCode === undefined || errorCode === 'E263';
|
|
16
|
+
}
|
|
17
|
+
if (unsupportedUpdateTagContext.test(error.message)) {
|
|
18
|
+
return errorCode === undefined || errorCode === 'E872';
|
|
19
|
+
}
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
function reportIgnoredRevalidation(args, hookName) {
|
|
23
|
+
const hookArgs = args[0];
|
|
24
|
+
hookArgs?.req?.payload?.logger?.warn({
|
|
25
|
+
hook: hookName,
|
|
26
|
+
msg: 'Ignored Next cache invalidation outside a supported request context'
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function wrapHook(hook, hookName) {
|
|
30
|
+
return async (...args)=>{
|
|
31
|
+
try {
|
|
32
|
+
return await hook(...args);
|
|
33
|
+
} catch (error) {
|
|
34
|
+
if (isUnsupportedNextCacheContextError(error)) {
|
|
35
|
+
reportIgnoredRevalidation(args, hookName);
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function wrapHooks(hooks) {
|
|
43
|
+
if (!hooks) {
|
|
44
|
+
return hooks;
|
|
45
|
+
}
|
|
46
|
+
return Object.fromEntries(Object.entries(hooks).map(([name, value])=>[
|
|
47
|
+
name,
|
|
48
|
+
Array.isArray(value) ? value.map((hook)=>typeof hook === 'function' ? wrapHook(hook, name) : hook) : value
|
|
49
|
+
]));
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Prevent Next cache invalidation from turning a successful Payload mutation
|
|
53
|
+
* into an apparent failure when the mutation runs outside a Next request.
|
|
54
|
+
*/ export function createCacheRevalidationHooksPlugin() {
|
|
55
|
+
const plugin = (config)=>({
|
|
56
|
+
...config,
|
|
57
|
+
collections: config.collections?.map((collection)=>({
|
|
58
|
+
...collection,
|
|
59
|
+
hooks: wrapHooks(collection.hooks)
|
|
60
|
+
})),
|
|
61
|
+
globals: config.globals?.map((global)=>({
|
|
62
|
+
...global,
|
|
63
|
+
hooks: wrapHooks(global.hooks)
|
|
64
|
+
}))
|
|
65
|
+
});
|
|
66
|
+
// Run after tenant plugins so hooks they add receive the same guard.
|
|
67
|
+
plugin.order = Number.POSITIVE_INFINITY;
|
|
68
|
+
return plugin;
|
|
69
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import './index.scss';
|
|
2
|
+
type Props = {
|
|
3
|
+
collectionLabel?: string;
|
|
4
|
+
collectionListURL?: string;
|
|
5
|
+
onRetry: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function FigmaCloudLimitDocumentCountModal({ collectionLabel, collectionListURL, onRetry, }: Props): import("react").JSX.Element;
|
|
8
|
+
export {};
|