@payloadcms/figma 0.1.0-alpha.1 → 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.
Files changed (297) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/{utils → adapters}/asset-collection.d.ts +17 -3
  3. package/dist/adapters/asset-collection.js +242 -0
  4. package/dist/{utils → adapters}/build-lambda-zip.d.ts +8 -7
  5. package/dist/adapters/build-lambda-zip.js +111 -0
  6. package/dist/adapters/configureNextjsCache.d.ts +8 -0
  7. package/dist/adapters/configureNextjsCache.js +55 -0
  8. package/dist/adapters/deploy-output/inspectNextjsOutput/getNextRelativeAppDir.d.ts +1 -0
  9. package/dist/adapters/deploy-output/inspectNextjsOutput/getNextRelativeAppDir.js +15 -0
  10. package/dist/adapters/deploy-output/inspectNextjsOutput.d.ts +12 -0
  11. package/dist/adapters/deploy-output/inspectNextjsOutput.js +28 -0
  12. package/dist/adapters/deploy-output/inspectNitroOutput.d.ts +9 -0
  13. package/dist/adapters/deploy-output/inspectNitroOutput.js +13 -0
  14. package/dist/adapters/deploy-output/isFile.d.ts +1 -0
  15. package/dist/adapters/deploy-output/isFile.js +4 -0
  16. package/dist/adapters/deploy-output/readJson.d.ts +1 -0
  17. package/dist/adapters/deploy-output/readJson.js +9 -0
  18. package/dist/adapters/deploy-output/resolveNitroOutputLayout.d.ts +8 -0
  19. package/dist/adapters/deploy-output/resolveNitroOutputLayout.js +16 -0
  20. package/dist/adapters/deploy-output/resolveOutputPath.d.ts +2 -0
  21. package/dist/adapters/deploy-output/resolveOutputPath.js +9 -0
  22. package/dist/adapters/deploy-output/resolveWithin.d.ts +1 -0
  23. package/dist/adapters/deploy-output/resolveWithin.js +12 -0
  24. package/dist/adapters/fs-utils.d.ts +39 -0
  25. package/dist/adapters/fs-utils.js +135 -0
  26. package/dist/adapters/index.d.ts +4 -0
  27. package/dist/adapters/index.js +3 -0
  28. package/dist/adapters/lambda-runtime/nextjs-cache.d.ts +40 -0
  29. package/dist/adapters/lambda-runtime/nextjs-cache.js +174 -0
  30. package/dist/adapters/nextjs.d.ts +12 -0
  31. package/dist/adapters/nextjs.js +67 -0
  32. package/dist/adapters/nitro.d.ts +8 -0
  33. package/dist/adapters/nitro.js +193 -0
  34. package/dist/adapters/secret-files.d.ts +25 -0
  35. package/dist/adapters/secret-files.js +50 -0
  36. package/dist/adapters/types.d.ts +42 -0
  37. package/dist/adapters/types.js +1 -0
  38. package/dist/{utils/adapters → adapters}/vite.d.ts +2 -2
  39. package/dist/adapters/vite.js +33 -0
  40. package/dist/api/check-project-subdomain-availability.d.ts +12 -0
  41. package/dist/api/check-project-subdomain-availability.js +32 -0
  42. package/dist/api/control-plane-error.d.ts +6 -0
  43. package/dist/api/control-plane-error.js +8 -0
  44. package/dist/api/control-plane-fetch.d.ts +7 -0
  45. package/dist/api/control-plane-fetch.js +37 -0
  46. package/dist/api/control-plane.d.ts +1 -9
  47. package/dist/api/control-plane.js +2 -48
  48. package/dist/api/create-project.d.ts +18 -0
  49. package/dist/api/create-project.js +37 -0
  50. package/dist/api/list-project-workspaces.d.ts +8 -0
  51. package/dist/api/list-project-workspaces.js +28 -0
  52. package/dist/api/project-resource-type.d.ts +1 -0
  53. package/dist/api/project-resource-type.js +1 -0
  54. package/dist/auth/headless-oauth-flow.d.ts +23 -0
  55. package/dist/auth/headless-oauth-flow.js +69 -0
  56. package/dist/auth/oauth-flow.d.ts +2 -0
  57. package/dist/auth/oauth-flow.js +13 -8
  58. package/dist/auth/token-store.d.ts +4 -1
  59. package/dist/auth/token-store.js +14 -0
  60. package/dist/auth/types.d.ts +12 -0
  61. package/dist/cli.d.ts +39 -0
  62. package/dist/cli.js +71 -36
  63. package/dist/commands/bootstrap.js +2 -1
  64. package/dist/commands/build-lambda-zip.js +1 -1
  65. package/dist/commands/deploy.d.ts +12 -0
  66. package/dist/commands/deploy.js +63 -25
  67. package/dist/commands/detect-project-resource-type.d.ts +3 -0
  68. package/dist/commands/detect-project-resource-type.js +28 -0
  69. package/dist/commands/init.d.ts +2 -2
  70. package/dist/commands/init.js +164 -79
  71. package/dist/commands/login.d.ts +11 -1
  72. package/dist/commands/login.js +66 -4
  73. package/dist/commands/prompt-to-create-project/format-project-subdomain.d.ts +1 -0
  74. package/dist/commands/prompt-to-create-project/format-project-subdomain.js +3 -0
  75. package/dist/commands/prompt-to-create-project/format-unavailable-subdomain-reason.d.ts +1 -0
  76. package/dist/commands/prompt-to-create-project/format-unavailable-subdomain-reason.js +7 -0
  77. package/dist/commands/prompt-to-create-project/get-default-project-name.d.ts +1 -0
  78. package/dist/commands/prompt-to-create-project/get-default-project-name.js +13 -0
  79. package/dist/commands/prompt-to-create-project/prompt-for-available-subdomain.d.ts +7 -0
  80. package/dist/commands/prompt-to-create-project/prompt-for-available-subdomain.js +32 -0
  81. package/dist/commands/prompt-to-create-project/resolve-project-region.d.ts +8 -0
  82. package/dist/commands/prompt-to-create-project/resolve-project-region.js +27 -0
  83. package/dist/commands/prompt-to-create-project/resolve-project-subdomain.d.ts +9 -0
  84. package/dist/commands/prompt-to-create-project/resolve-project-subdomain.js +54 -0
  85. package/dist/commands/prompt-to-create-project/resolve-text-input.d.ts +9 -0
  86. package/dist/commands/prompt-to-create-project/resolve-text-input.js +23 -0
  87. package/dist/commands/prompt-to-create-project/resolve-workspace-plan-key.d.ts +12 -0
  88. package/dist/commands/prompt-to-create-project/resolve-workspace-plan-key.js +36 -0
  89. package/dist/commands/prompt-to-create-project/validate-subdomain.d.ts +1 -0
  90. package/dist/commands/prompt-to-create-project/validate-subdomain.js +9 -0
  91. package/dist/commands/prompt-to-create-project.d.ts +24 -0
  92. package/dist/commands/prompt-to-create-project.js +69 -0
  93. package/dist/commands/setup-agent.d.ts +12 -0
  94. package/dist/commands/setup-agent.js +123 -0
  95. package/dist/commands/write-project-configuration.d.ts +12 -0
  96. package/dist/commands/write-project-configuration.js +16 -0
  97. package/dist/db-content-api/generated/content-api-types.d.ts +6 -2
  98. package/dist/db-content-api/index.d.ts +1 -1
  99. package/dist/db-content-api/index.js +121 -72
  100. package/dist/db-content-api/utilities/data/index.js +2 -2
  101. package/dist/db-content-api/utilities/data/injectGlobalType.d.ts +6 -0
  102. package/dist/db-content-api/utilities/data/injectGlobalType.js +11 -0
  103. package/dist/db-content-api/utilities/data/removeVirtualFields.d.ts +3 -11
  104. package/dist/db-content-api/utilities/data/removeVirtualFields.js +12 -50
  105. package/dist/db-content-api/utilities/isRecord.d.ts +9 -0
  106. package/dist/db-content-api/utilities/isRecord.js +19 -0
  107. package/dist/db-content-api/utilities/joins.js +5 -1
  108. package/dist/db-content-api/utilities/meta/resolvesToRelationshipValue.d.ts +10 -0
  109. package/dist/db-content-api/utilities/meta/resolvesToRelationshipValue.js +95 -0
  110. package/dist/db-content-api/utilities/meta/stringifyIdsInWhere.d.ts +9 -0
  111. package/dist/db-content-api/utilities/meta/stringifyIdsInWhere.js +112 -0
  112. package/dist/db-content-api/utilities/schema/getDocumentSchema.d.ts +3 -0
  113. package/dist/db-content-api/utilities/schema/getDocumentSchema.js +24 -0
  114. package/dist/db-content-api/utilities/where.d.ts +2 -6
  115. package/dist/db-content-api/utilities/where.js +20 -9
  116. package/dist/exports/client.d.ts +2 -0
  117. package/dist/exports/client.js +2 -0
  118. package/dist/exports/views.d.ts +1 -0
  119. package/dist/exports/views.js +1 -0
  120. package/dist/imageSizeOptions.d.ts +23 -0
  121. package/dist/imageSizeOptions.js +26 -0
  122. package/dist/index.d.ts +2 -0
  123. package/dist/index.js +2 -0
  124. package/dist/lib/write-agent-config.d.ts +12 -0
  125. package/dist/lib/write-agent-config.js +52 -0
  126. package/dist/next/image-loader.d.ts +6 -0
  127. package/dist/next/image-loader.js +14 -0
  128. package/dist/oauth/components/LoginButton/index.js +66 -19
  129. package/dist/oauth/components/LoginButton/index.scss +121 -15
  130. package/dist/oauth/defaults.js +4 -1
  131. package/dist/oauth/endpoints/getLoginEndpoint.js +5 -2
  132. package/dist/oauth/index.js +8 -7
  133. package/dist/oauth/utilities/getAdminCollectionSlug.d.ts +1 -1
  134. package/dist/oauth/utilities/getAuthorizeURL.d.ts +1 -0
  135. package/dist/oauth/utilities/getAuthorizeURL.js +5 -1
  136. package/dist/plugin/build-config.d.ts +4 -2
  137. package/dist/plugin/build-config.js +95 -31
  138. package/dist/plugin/cache-revalidation-hooks.d.ts +6 -0
  139. package/dist/plugin/cache-revalidation-hooks.js +69 -0
  140. package/dist/plugin/cloud-limits/CloudLimitModal/index.d.ts +8 -0
  141. package/dist/plugin/cloud-limits/CloudLimitModal/index.js +66 -0
  142. package/dist/plugin/cloud-limits/CloudLimitModal/index.scss +56 -0
  143. package/dist/plugin/cloud-limits/CloudLimitProvider/index.d.ts +4 -0
  144. package/dist/plugin/cloud-limits/CloudLimitProvider/index.js +110 -0
  145. package/dist/plugin/cloud-limits/LimitReachedView/index.css +14 -0
  146. package/dist/plugin/cloud-limits/LimitReachedView/index.d.ts +4 -0
  147. package/dist/plugin/cloud-limits/LimitReachedView/index.js +52 -0
  148. package/dist/plugin/cloud-limits/SlugRegistryContext/index.d.ts +7 -0
  149. package/dist/plugin/cloud-limits/SlugRegistryContext/index.js +3 -0
  150. package/dist/plugin/cloud-limits/SlugTracker/index.d.ts +1 -0
  151. package/dist/plugin/cloud-limits/SlugTracker/index.js +27 -0
  152. package/dist/plugin/cloud-limits/icons/ExternalLinkIcon.d.ts +2 -0
  153. package/dist/plugin/cloud-limits/icons/ExternalLinkIcon.js +30 -0
  154. package/dist/plugin/cloud-limits/routes.d.ts +2 -0
  155. package/dist/plugin/cloud-limits/routes.js +4 -0
  156. package/dist/plugin/cloud-limits/server/redirectInitialAutosaveCreate.d.ts +9 -0
  157. package/dist/plugin/cloud-limits/server/redirectInitialAutosaveCreate.js +28 -0
  158. package/dist/plugin/cloud-limits/shared.d.ts +10 -0
  159. package/dist/plugin/cloud-limits/shared.js +52 -0
  160. package/dist/plugin/cloud-limits/utilities/cloudLimitInterceptor.d.ts +2 -0
  161. package/dist/plugin/cloud-limits/utilities/cloudLimitInterceptor.js +134 -0
  162. package/dist/plugin/cloud-limits/utilities/toasts.d.ts +4 -0
  163. package/dist/plugin/cloud-limits/utilities/toasts.js +19 -0
  164. package/dist/plugin/make-permission-access/make-permission-access.d.ts +8 -0
  165. package/dist/plugin/make-permission-access/make-permission-access.js +24 -0
  166. package/dist/plugin/sandbox-upload-fetch.d.ts +32 -0
  167. package/dist/plugin/sandbox-upload-fetch.js +53 -0
  168. package/dist/skills/deploy-to-figma/SKILL.md +234 -0
  169. package/dist/skills/deploy-to-figma/references/cli-reference.md +146 -0
  170. package/dist/storage-content-api/client-uploads/generate.js +2 -1
  171. package/dist/storage-content-api/getDownloadResponseHeaderPolicy.d.ts +11 -0
  172. package/dist/storage-content-api/getDownloadResponseHeaderPolicy.js +27 -0
  173. package/dist/storage-content-api/index.js +1 -0
  174. package/dist/storage-content-api/resolveDownloadResponseHeaders.d.ts +5 -0
  175. package/dist/storage-content-api/resolveDownloadResponseHeaders.js +13 -0
  176. package/dist/storage-content-api/staticHandler.js +2 -1
  177. package/dist/storage-content-api/types.d.ts +4 -1
  178. package/dist/translations/ar.d.ts +12 -0
  179. package/dist/translations/ar.js +12 -0
  180. package/dist/translations/az.d.ts +12 -0
  181. package/dist/translations/az.js +12 -0
  182. package/dist/translations/bg.d.ts +12 -0
  183. package/dist/translations/bg.js +12 -0
  184. package/dist/translations/bnBd.d.ts +12 -0
  185. package/dist/translations/bnBd.js +12 -0
  186. package/dist/translations/bnIn.d.ts +12 -0
  187. package/dist/translations/bnIn.js +12 -0
  188. package/dist/translations/ca.d.ts +12 -0
  189. package/dist/translations/ca.js +12 -0
  190. package/dist/translations/cs.d.ts +12 -0
  191. package/dist/translations/cs.js +12 -0
  192. package/dist/translations/da.d.ts +12 -0
  193. package/dist/translations/da.js +12 -0
  194. package/dist/translations/de.d.ts +12 -0
  195. package/dist/translations/de.js +12 -0
  196. package/dist/translations/en.d.ts +12 -0
  197. package/dist/translations/en.js +12 -0
  198. package/dist/translations/es.d.ts +12 -0
  199. package/dist/translations/es.js +12 -0
  200. package/dist/translations/et.d.ts +12 -0
  201. package/dist/translations/et.js +12 -0
  202. package/dist/translations/fa.d.ts +12 -0
  203. package/dist/translations/fa.js +12 -0
  204. package/dist/translations/fr.d.ts +12 -0
  205. package/dist/translations/fr.js +12 -0
  206. package/dist/translations/he.d.ts +12 -0
  207. package/dist/translations/he.js +12 -0
  208. package/dist/translations/hr.d.ts +12 -0
  209. package/dist/translations/hr.js +12 -0
  210. package/dist/translations/hu.d.ts +12 -0
  211. package/dist/translations/hu.js +12 -0
  212. package/dist/translations/hy.d.ts +12 -0
  213. package/dist/translations/hy.js +12 -0
  214. package/dist/translations/id.d.ts +12 -0
  215. package/dist/translations/id.js +12 -0
  216. package/dist/translations/index.d.ts +533 -0
  217. package/dist/translations/index.js +90 -0
  218. package/dist/translations/is.d.ts +12 -0
  219. package/dist/translations/is.js +12 -0
  220. package/dist/translations/it.d.ts +12 -0
  221. package/dist/translations/it.js +12 -0
  222. package/dist/translations/ja.d.ts +12 -0
  223. package/dist/translations/ja.js +12 -0
  224. package/dist/translations/ko.d.ts +12 -0
  225. package/dist/translations/ko.js +12 -0
  226. package/dist/translations/lt.d.ts +12 -0
  227. package/dist/translations/lt.js +12 -0
  228. package/dist/translations/lv.d.ts +12 -0
  229. package/dist/translations/lv.js +12 -0
  230. package/dist/translations/my.d.ts +12 -0
  231. package/dist/translations/my.js +12 -0
  232. package/dist/translations/nb.d.ts +12 -0
  233. package/dist/translations/nb.js +12 -0
  234. package/dist/translations/nl.d.ts +12 -0
  235. package/dist/translations/nl.js +12 -0
  236. package/dist/translations/pl.d.ts +12 -0
  237. package/dist/translations/pl.js +12 -0
  238. package/dist/translations/pt.d.ts +12 -0
  239. package/dist/translations/pt.js +12 -0
  240. package/dist/translations/ro.d.ts +12 -0
  241. package/dist/translations/ro.js +12 -0
  242. package/dist/translations/rs.d.ts +12 -0
  243. package/dist/translations/rs.js +12 -0
  244. package/dist/translations/rsLatin.d.ts +12 -0
  245. package/dist/translations/rsLatin.js +12 -0
  246. package/dist/translations/ru.d.ts +12 -0
  247. package/dist/translations/ru.js +12 -0
  248. package/dist/translations/sk.d.ts +12 -0
  249. package/dist/translations/sk.js +12 -0
  250. package/dist/translations/sl.d.ts +12 -0
  251. package/dist/translations/sl.js +12 -0
  252. package/dist/translations/sv.d.ts +12 -0
  253. package/dist/translations/sv.js +12 -0
  254. package/dist/translations/ta.d.ts +12 -0
  255. package/dist/translations/ta.js +12 -0
  256. package/dist/translations/th.d.ts +12 -0
  257. package/dist/translations/th.js +12 -0
  258. package/dist/translations/tr.d.ts +12 -0
  259. package/dist/translations/tr.js +12 -0
  260. package/dist/translations/uk.d.ts +12 -0
  261. package/dist/translations/uk.js +12 -0
  262. package/dist/translations/vi.d.ts +12 -0
  263. package/dist/translations/vi.js +12 -0
  264. package/dist/translations/zh.d.ts +12 -0
  265. package/dist/translations/zh.js +12 -0
  266. package/dist/translations/zhTw.d.ts +12 -0
  267. package/dist/translations/zhTw.js +12 -0
  268. package/dist/types.d.ts +11 -0
  269. package/dist/utils/assert-never.d.ts +1 -0
  270. package/dist/utils/assert-never.js +3 -0
  271. package/dist/utils/build-detection.d.ts +6 -1
  272. package/dist/utils/build-detection.js +68 -89
  273. package/dist/utils/deploy-adapter.d.ts +3 -35
  274. package/dist/utils/deploy-adapter.js +25 -14
  275. package/dist/utils/lambda-config.js +18 -23
  276. package/dist/utils/messages.js +24 -3
  277. package/dist/utils/next-image-loader-config.d.ts +2 -0
  278. package/dist/utils/next-image-loader-config.js +63 -0
  279. package/dist/utils/next-image-loader-file.d.ts +2 -0
  280. package/dist/utils/next-image-loader-file.js +11 -0
  281. package/dist/utils/payload-generate.d.ts +10 -0
  282. package/dist/utils/payload-generate.js +59 -0
  283. package/dist/utils/pnpm-builds.d.ts +14 -0
  284. package/dist/utils/pnpm-builds.js +125 -0
  285. package/dist/utils/s3-upload.js +4 -1
  286. package/package.json +31 -7
  287. package/dist/lib/download-skill.d.ts +0 -12
  288. package/dist/lib/download-skill.js +0 -77
  289. package/dist/utils/adapters/nextjs.d.ts +0 -8
  290. package/dist/utils/adapters/nextjs.js +0 -61
  291. package/dist/utils/adapters/nitro.d.ts +0 -8
  292. package/dist/utils/adapters/nitro.js +0 -172
  293. package/dist/utils/adapters/vite.js +0 -31
  294. package/dist/utils/asset-collection.js +0 -144
  295. package/dist/utils/build-lambda-zip.js +0 -90
  296. package/dist/utils/fs-utils.d.ts +0 -12
  297. 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
- &__signing-in {
59
- display: flex;
60
- flex-direction: column;
61
- align-items: center;
62
- gap: 0.75rem;
63
- font-size: 1rem;
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
- &__spinner {
69
- width: 24px;
70
- height: 24px;
71
- border: 2px solid var(--theme-elevation-200, #e5e5e5);
72
- border-top-color: currentColor;
73
- border-radius: 50%;
74
- animation: oauth-login-spin 0.8s linear infinite;
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
- @keyframes oauth-login-spin {
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: rotate(360deg);
186
+ transform: translateX(100%);
81
187
  }
82
188
  }
@@ -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: `/${collection.slug}/${endpointSlug}/login`,
154
+ path: getOAuthCallbackPath({
155
+ collection,
156
+ endpointSlug
157
+ }),
155
158
  serverURL: redirectServerURL
156
159
  });
157
160
  debugLogger.info({
@@ -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
- getLoginEndpoint({
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'}/${collection.slug}/${endpointSlug}/login`);
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?: boolean;
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 users collection for Figma profile info
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 = process.env.FIGMA_CONTENT_API_ACCESS_KEY ? {
170
- baseUrl: url,
171
- contentApiKey: process.env.FIGMA_CONTENT_API_ACCESS_KEY
172
- } : process.env.FIGMA_DEV_JWT === 'true' ? {
173
- auth: {
174
- mode: 'devJwt'
175
- },
176
- baseUrl: url,
177
- contentSystemId
178
- } : {
179
- auth: {
180
- mode: 'tokenStore',
181
- tokenStore: getTokenStore()
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
- baseUrl: url,
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
- if (config.figma.useContentSystem === false) {
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 fall back to Payload's
344
- // "logged-in user" default so the admin "Run jobs" UI keeps working.
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
- return !!args.req.user;
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: 'users',
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 figma fields into users collection
437
+ // Inject Figma-managed identity fields only into the Payload Admin collection.
399
438
  const collections = configWithFigmaDefaults.collections?.map((col)=>{
400
- if (col.slug === 'users') {
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
- ...col,
466
+ ...withLimitView,
403
467
  fields: [
404
468
  ...col.fields || [],
405
469
  ...figmaUserFields
406
470
  ]
407
471
  };
408
472
  }
409
- return col;
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 {};