@payloadcms/figma 0.1.0-internal.10c3b07 → 0.1.0-internal.fbdc0d3
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 +10 -4
- package/dist/{utils → adapters}/asset-collection.js +58 -17
- package/dist/{utils → adapters}/build-lambda-zip.d.ts +4 -2
- 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/{utils → adapters}/deploy-output/resolveOutputPath.d.ts +1 -1
- 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/{utils/adapters → adapters}/nitro.d.ts +2 -2
- package/dist/{utils/adapters → adapters}/nitro.js +54 -29
- 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 +1 -1
- package/dist/{utils/adapters → adapters}/vite.js +4 -3
- package/dist/api/control-plane.d.ts +11 -0
- package/dist/api/control-plane.js +26 -0
- package/dist/auth/headless-oauth-flow.js +4 -0
- package/dist/auth/oauth-flow.js +17 -0
- package/dist/auth/refresh.js +12 -12
- package/dist/auth/requested-scopes.d.ts +1 -0
- package/dist/auth/requested-scopes.js +3 -0
- package/dist/auth/token-store.d.ts +16 -0
- package/dist/auth/token-store.js +33 -0
- package/dist/auth/types.d.ts +5 -3
- package/dist/commands/bootstrap.js +3 -0
- package/dist/commands/build-lambda-zip.js +1 -1
- package/dist/commands/deploy.js +2 -2
- package/dist/commands/init.js +72 -2
- package/dist/commands/upgrade.js +65 -1
- package/dist/commands/upload-schema.js +3 -4
- package/dist/config/oauth.js +6 -1
- package/dist/constants.d.ts +0 -2
- package/dist/constants.js +0 -3
- package/dist/db-content-api/generated/content-api-types.d.ts +6 -2
- package/dist/db-content-api/utilities/auth.d.ts +1 -4
- package/dist/db-content-api/utilities/auth.js +1 -1
- package/dist/db-content-api/utilities/data/index.js +8 -2
- 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/schema/buildDocumentSchema.js +9 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -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/plugin/build-config.d.ts +13 -3
- package/dist/plugin/build-config.js +198 -59
- 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 +2 -1
- package/dist/plugin/cloud-limits/icons/ExternalLinkIcon.d.ts +2 -1
- 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/storage-content-api/api-types.d.ts +5 -2
- package/dist/storage-content-api/buildBaseMediaResponseHeaders.d.ts +1 -1
- package/dist/storage-content-api/buildBaseMediaResponseHeaders.js +3 -1
- package/dist/storage-content-api/buildClientUploadFetchBackHeaders.d.ts +8 -6
- package/dist/storage-content-api/buildClientUploadFetchBackHeaders.js +17 -12
- package/dist/storage-content-api/buildMediaRequestHeaders.d.ts +1 -0
- package/dist/storage-content-api/buildMediaRequestHeaders.js +14 -0
- package/dist/storage-content-api/buildMediaResponseHeaders.d.ts +3 -3
- package/dist/storage-content-api/buildMediaResponseHeaders.js +25 -18
- package/dist/storage-content-api/client-uploads/generate.d.ts +7 -3
- package/dist/storage-content-api/client-uploads/generate.js +22 -21
- package/dist/storage-content-api/client.d.ts +0 -2
- package/dist/storage-content-api/client.js +2 -2
- package/dist/storage-content-api/copyFile.d.ts +16 -0
- package/dist/storage-content-api/copyFile.js +90 -0
- package/dist/storage-content-api/deleteFile.d.ts +8 -0
- package/dist/storage-content-api/deleteFile.js +18 -0
- package/dist/storage-content-api/getDownloadResponseHeaderPolicy.d.ts +11 -0
- package/dist/storage-content-api/getDownloadResponseHeaderPolicy.js +33 -0
- package/dist/storage-content-api/getMediaType.d.ts +1 -0
- package/dist/storage-content-api/getMediaType.js +3 -0
- package/dist/storage-content-api/handleUpload.d.ts +1 -2
- package/dist/storage-content-api/handleUpload.js +13 -157
- package/dist/storage-content-api/hasSupportedContentEncoding.d.ts +1 -1
- package/dist/storage-content-api/hasSupportedContentEncoding.js +4 -2
- package/dist/storage-content-api/index.js +17 -8
- package/dist/storage-content-api/mediaErrorResponse.d.ts +1 -1
- package/dist/storage-content-api/mediaErrorResponse.js +2 -2
- package/dist/storage-content-api/resolveDownloadResponseHeaders.d.ts +5 -0
- package/dist/storage-content-api/resolveDownloadResponseHeaders.js +13 -0
- package/dist/storage-content-api/shouldAttachMedia.d.ts +1 -0
- package/dist/storage-content-api/{getInlineContentType.js → shouldAttachMedia.js} +8 -7
- package/dist/storage-content-api/staticHandler.d.ts +2 -1
- package/dist/storage-content-api/staticHandler.js +47 -53
- package/dist/storage-content-api/types.d.ts +4 -1
- package/dist/storage-content-api/uploadFileData.d.ts +10 -0
- package/dist/storage-content-api/uploadFileData.js +145 -0
- package/dist/utils/build-detection.js +3 -3
- package/dist/utils/cache-bootstrap.js +1 -0
- package/dist/utils/deploy-adapter.d.ts +2 -34
- package/dist/utils/deploy-adapter.js +16 -9
- package/dist/utils/env-management.d.ts +15 -0
- package/dist/utils/env-management.js +47 -0
- package/dist/utils/lambda-config.js +14 -9
- package/dist/utils/load-payload-config.js +1 -6
- 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-config-ast.d.ts +5 -0
- package/dist/utils/payload-config-ast.js +73 -4
- package/dist/utils/payload-config-modifier.js +3 -0
- package/dist/utils/payload-secret.d.ts +28 -0
- package/dist/utils/payload-secret.js +34 -0
- package/package.json +22 -10
- package/dist/storage-content-api/getInlineContentType.d.ts +0 -1
- package/dist/storage-content-api/handleDelete.d.ts +0 -7
- package/dist/storage-content-api/handleDelete.js +0 -15
- package/dist/storage-content-api/utilities/getSafeFilename.d.ts +0 -11
- package/dist/storage-content-api/utilities/getSafeFilename.js +0 -59
- package/dist/storage-content-api/utilities/index.d.ts +0 -2
- package/dist/storage-content-api/utilities/index.js +0 -2
- package/dist/storage-content-api/utilities/parseUploadReference.d.ts +0 -17
- package/dist/storage-content-api/utilities/parseUploadReference.js +0 -27
- package/dist/utils/adapters/nextjs.d.ts +0 -8
- package/dist/utils/adapters/nextjs.js +0 -64
- package/dist/utils/build-lambda-zip.js +0 -73
- package/dist/utils/fs-utils.d.ts +0 -12
- package/dist/utils/fs-utils.js +0 -55
- /package/dist/{utils → adapters}/deploy-output/inspectNextjsOutput/getNextRelativeAppDir.d.ts +0 -0
- /package/dist/{utils → adapters}/deploy-output/inspectNextjsOutput/getNextRelativeAppDir.js +0 -0
- /package/dist/{utils → adapters}/deploy-output/inspectNextjsOutput.d.ts +0 -0
- /package/dist/{utils → adapters}/deploy-output/inspectNextjsOutput.js +0 -0
- /package/dist/{utils → adapters}/deploy-output/inspectNitroOutput.d.ts +0 -0
- /package/dist/{utils → adapters}/deploy-output/inspectNitroOutput.js +0 -0
- /package/dist/{utils → adapters}/deploy-output/isFile.d.ts +0 -0
- /package/dist/{utils → adapters}/deploy-output/isFile.js +0 -0
- /package/dist/{utils → adapters}/deploy-output/readJson.d.ts +0 -0
- /package/dist/{utils → adapters}/deploy-output/readJson.js +0 -0
- /package/dist/{utils → adapters}/deploy-output/resolveNitroOutputLayout.d.ts +0 -0
- /package/dist/{utils → adapters}/deploy-output/resolveNitroOutputLayout.js +0 -0
- /package/dist/{utils → adapters}/deploy-output/resolveOutputPath.js +0 -0
- /package/dist/{utils → adapters}/deploy-output/resolveWithin.d.ts +0 -0
- /package/dist/{utils → adapters}/deploy-output/resolveWithin.js +0 -0
|
@@ -1,52 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* it now because `stripFields` was copied from db-mongo and I'd like to
|
|
8
|
-
* find a way to unify everything.
|
|
9
|
-
*/ export function removeVirtualFields(data, fieldConfigs) {
|
|
10
|
-
for (const field of fieldConfigs){
|
|
11
|
-
// Handle UI fields (row, collapsible, tabs) - they don't have names
|
|
12
|
-
// but contain other fields that might be virtual
|
|
13
|
-
if (field.type === 'row' || field.type === 'collapsible') {
|
|
14
|
-
if ('fields' in field) {
|
|
15
|
-
removeVirtualFields(data, field.fields);
|
|
1
|
+
import { traverseFields } from 'payload';
|
|
2
|
+
/** Remove pure virtual fields from document data at every schema depth. */ export function removeVirtualFields(data, fields, config) {
|
|
3
|
+
traverseFields({
|
|
4
|
+
callback: ({ field, ref })=>{
|
|
5
|
+
if ('name' in field && field.name && 'virtual' in field && field.virtual === true) {
|
|
6
|
+
delete ref[field.name];
|
|
16
7
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
continue;
|
|
26
|
-
}
|
|
27
|
-
// Skip fields without names
|
|
28
|
-
if (!('name' in field) || !field.name) {
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
// Remove field if it has virtual: true
|
|
32
|
-
if ('virtual' in field && field.virtual === true) {
|
|
33
|
-
delete data[field.name];
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
// Recursively handle nested structures (groups, arrays with items, etc.)
|
|
37
|
-
if ('fields' in field && field.name in data) {
|
|
38
|
-
const value = data[field.name];
|
|
39
|
-
if (field.type === 'array' && Array.isArray(value)) {
|
|
40
|
-
// Process each array item
|
|
41
|
-
for (const item of value){
|
|
42
|
-
if (item && typeof item === 'object') {
|
|
43
|
-
removeVirtualFields(item, field.fields);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
} else if (field.type === 'group' && value && typeof value === 'object') {
|
|
47
|
-
// Process group
|
|
48
|
-
removeVirtualFields(value, field.fields);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
8
|
+
},
|
|
9
|
+
config,
|
|
10
|
+
fields,
|
|
11
|
+
fillEmpty: false,
|
|
12
|
+
ref: data
|
|
13
|
+
});
|
|
52
14
|
}
|
|
@@ -29,11 +29,11 @@ export function buildDocumentSchema(config) {
|
|
|
29
29
|
};
|
|
30
30
|
const collections = {};
|
|
31
31
|
for (const collection of config.collections ?? []){
|
|
32
|
-
collections[collection.slug] = buildCollectionSchema(collection.slug, collection.fields, blockRegistry);
|
|
32
|
+
collections[collection.slug] = buildCollectionSchema(collection.slug, collection.fields, blockRegistry, collection.indexes ?? []);
|
|
33
33
|
}
|
|
34
34
|
for (const global of config.globals ?? []){
|
|
35
35
|
const slug = `_global-${global.slug}`;
|
|
36
|
-
collections[slug] = buildCollectionSchema(slug, global.fields, blockRegistry);
|
|
36
|
+
collections[slug] = buildCollectionSchema(slug, global.fields, blockRegistry, []);
|
|
37
37
|
}
|
|
38
38
|
return {
|
|
39
39
|
blocks: blockRegistry.blocksById,
|
|
@@ -41,7 +41,7 @@ export function buildDocumentSchema(config) {
|
|
|
41
41
|
version: 1
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
function buildCollectionSchema(name, fields, blockRegistry) {
|
|
44
|
+
function buildCollectionSchema(name, fields, blockRegistry, indexes) {
|
|
45
45
|
const paths = {};
|
|
46
46
|
collectPaths(fields, paths, {
|
|
47
47
|
blockRegistry,
|
|
@@ -59,9 +59,14 @@ function buildCollectionSchema(name, fields, blockRegistry) {
|
|
|
59
59
|
localized: false
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
+
// Field-level unique flags cannot express Payload's compound collection indexes.
|
|
63
|
+
const hints = indexes.filter((index)=>index.unique).map((index)=>({
|
|
64
|
+
type: 'unique',
|
|
65
|
+
paths: index.fields
|
|
66
|
+
}));
|
|
62
67
|
return {
|
|
63
68
|
name,
|
|
64
|
-
hints
|
|
69
|
+
hints,
|
|
65
70
|
paths
|
|
66
71
|
};
|
|
67
72
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export { figmaContentSystem } from './plugin/adapter.js';
|
|
|
4
4
|
export type { FigmaContentSystemOptions } from './plugin/adapter.js';
|
|
5
5
|
export { buildFigmaConfig } from './plugin/build-config.js';
|
|
6
6
|
export type { FigmaConfig } from './plugin/build-config.js';
|
|
7
|
+
export { passesMakeViewerWriteGate } from './plugin/make-permission-access/make-permission-access.js';
|
package/dist/index.js
CHANGED
|
@@ -4,3 +4,5 @@ export { contentAPIAdapter } from './db-content-api/index.js';
|
|
|
4
4
|
export { figmaContentSystem } from './plugin/adapter.js';
|
|
5
5
|
// Export buildConfig wrapper and its config type
|
|
6
6
|
export { buildFigmaConfig } from './plugin/build-config.js';
|
|
7
|
+
// Export the Make permission predicate for slug-specific baseAccess overrides.
|
|
8
|
+
export { passesMakeViewerWriteGate } from './plugin/make-permission-access/make-permission-access.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
const PAYLOAD_FILE_PATH_PATTERN = /^\/(?!\/)(?:.+\/)?api\/[^/]+\/file\/.+$/;
|
|
3
|
+
export function figmaNextImageLoader({ quality, src, width }) {
|
|
4
|
+
const [pathname, search = ''] = src.split('?');
|
|
5
|
+
if (!PAYLOAD_FILE_PATH_PATTERN.test(pathname)) {
|
|
6
|
+
return src;
|
|
7
|
+
}
|
|
8
|
+
const searchParams = new URLSearchParams(search);
|
|
9
|
+
searchParams.set('w', String(width));
|
|
10
|
+
if (quality !== undefined) {
|
|
11
|
+
searchParams.set('q', String(quality));
|
|
12
|
+
}
|
|
13
|
+
return `${pathname}?${searchParams}`;
|
|
14
|
+
}
|
|
@@ -6,6 +6,17 @@ import { getSearchParam } from '../../utils/getSearchParam.js';
|
|
|
6
6
|
import { resolveParentTargetOrigin, setupIframeAutoLogin } from './iframeAutoLogin.js';
|
|
7
7
|
import './index.scss';
|
|
8
8
|
const baseClass = 'oauth-login';
|
|
9
|
+
const COLLECTION_SKELETON_KEYS = [
|
|
10
|
+
'collection-1',
|
|
11
|
+
'collection-2',
|
|
12
|
+
'collection-3',
|
|
13
|
+
'collection-4'
|
|
14
|
+
];
|
|
15
|
+
const GLOBAL_SKELETON_KEYS = [
|
|
16
|
+
'global-1',
|
|
17
|
+
'global-2',
|
|
18
|
+
'global-3'
|
|
19
|
+
];
|
|
9
20
|
// Max time we wait for the parent (figma.com) to respond with a code after
|
|
10
21
|
// posting `mint-cms-oauth-code`. If we hit this without a reply, we assume
|
|
11
22
|
// the parent isn't going to respond and fall back to the manual login button.
|
|
@@ -49,6 +60,57 @@ const FigmaIcon = ()=>/*#__PURE__*/ _jsx("svg", {
|
|
|
49
60
|
fillRule: "evenodd"
|
|
50
61
|
})
|
|
51
62
|
});
|
|
63
|
+
const PayloadAdminLoadingShimmer = ()=>/*#__PURE__*/ _jsx("div", {
|
|
64
|
+
"aria-label": "Signing in",
|
|
65
|
+
"aria-live": "polite",
|
|
66
|
+
className: `${baseClass}__admin-shimmer`,
|
|
67
|
+
role: "status",
|
|
68
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
69
|
+
"aria-hidden": "true",
|
|
70
|
+
className: `${baseClass}__admin-shimmer-main`,
|
|
71
|
+
children: [
|
|
72
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
73
|
+
className: `${baseClass}__shimmer-heading-row`,
|
|
74
|
+
children: [
|
|
75
|
+
/*#__PURE__*/ _jsx("div", {
|
|
76
|
+
className: `${baseClass}__shimmer-block ${baseClass}__shimmer-heading-icon`
|
|
77
|
+
}),
|
|
78
|
+
/*#__PURE__*/ _jsx("div", {
|
|
79
|
+
className: `${baseClass}__shimmer-block ${baseClass}__shimmer-heading-label`
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
}),
|
|
83
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
84
|
+
className: `${baseClass}__shimmer-section`,
|
|
85
|
+
children: [
|
|
86
|
+
/*#__PURE__*/ _jsx("div", {
|
|
87
|
+
className: `${baseClass}__shimmer-block ${baseClass}__shimmer-section-label`
|
|
88
|
+
}),
|
|
89
|
+
/*#__PURE__*/ _jsx("div", {
|
|
90
|
+
className: `${baseClass}__shimmer-card-grid`,
|
|
91
|
+
children: COLLECTION_SKELETON_KEYS.map((key)=>/*#__PURE__*/ _jsx("div", {
|
|
92
|
+
className: `${baseClass}__shimmer-block ${baseClass}__shimmer-card`
|
|
93
|
+
}, key))
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
}),
|
|
97
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
98
|
+
className: `${baseClass}__shimmer-section`,
|
|
99
|
+
children: [
|
|
100
|
+
/*#__PURE__*/ _jsx("div", {
|
|
101
|
+
className: `${baseClass}__shimmer-block ${baseClass}__shimmer-section-label`
|
|
102
|
+
}),
|
|
103
|
+
/*#__PURE__*/ _jsx("div", {
|
|
104
|
+
className: `${baseClass}__shimmer-card-grid`,
|
|
105
|
+
children: GLOBAL_SKELETON_KEYS.map((key)=>/*#__PURE__*/ _jsx("div", {
|
|
106
|
+
className: `${baseClass}__shimmer-block ${baseClass}__shimmer-card`
|
|
107
|
+
}, key))
|
|
108
|
+
})
|
|
109
|
+
]
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
})
|
|
113
|
+
});
|
|
52
114
|
export const DefaultLoginButton = ({ disabled, endpointSlug })=>{
|
|
53
115
|
const { config: { admin: { user: userSlug }, routes: { api }, serverURL } } = useConfig();
|
|
54
116
|
const [authorizeURL, setAuthorizeURL] = useState('');
|
|
@@ -150,26 +212,11 @@ export const DefaultLoginButton = ({ disabled, endpointSlug })=>{
|
|
|
150
212
|
endpointSlug
|
|
151
213
|
]);
|
|
152
214
|
if (!shouldRenderButton) {
|
|
153
|
-
// In the iframe auto-login window, show a
|
|
154
|
-
//
|
|
155
|
-
//
|
|
215
|
+
// In the iframe auto-login window, show a Payload admin-shaped shimmer
|
|
216
|
+
// until the flow either navigates them away or times out into the manual
|
|
217
|
+
// button.
|
|
156
218
|
if (isInIframe === true && !disabled) {
|
|
157
|
-
return /*#__PURE__*/ _jsx(
|
|
158
|
-
className: baseClass,
|
|
159
|
-
children: /*#__PURE__*/ _jsxs("div", {
|
|
160
|
-
className: `${baseClass}__signing-in`,
|
|
161
|
-
role: "status",
|
|
162
|
-
children: [
|
|
163
|
-
/*#__PURE__*/ _jsx("span", {
|
|
164
|
-
children: "Signing in"
|
|
165
|
-
}),
|
|
166
|
-
/*#__PURE__*/ _jsx("div", {
|
|
167
|
-
"aria-hidden": "true",
|
|
168
|
-
className: `${baseClass}__spinner`
|
|
169
|
-
})
|
|
170
|
-
]
|
|
171
|
-
})
|
|
172
|
-
});
|
|
219
|
+
return /*#__PURE__*/ _jsx(PayloadAdminLoadingShimmer, {});
|
|
173
220
|
}
|
|
174
221
|
return null;
|
|
175
222
|
}
|
|
@@ -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]: {
|
|
@@ -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
|
|
@@ -13,7 +13,15 @@ export declare const FIGMA_INTERNAL_FORWARDED_HAS_AUTH_BYPASS_HEADER = "figma-in
|
|
|
13
13
|
*
|
|
14
14
|
* Differences from standard Payload Config:
|
|
15
15
|
* - `db`: Omitted (auto-injected by Figma platform)
|
|
16
|
-
* - `secret`: Omitted
|
|
16
|
+
* - `secret`: Omitted. The platform owns `PAYLOAD_SECRET`. `init`'s AST
|
|
17
|
+
* modifier strips this line from the tenant's config, and this type
|
|
18
|
+
* doesn't accept it back in. `buildFigmaConfig` injects the value at
|
|
19
|
+
* runtime from `process.env.PAYLOAD_SECRET` (Lambda) or the encrypted
|
|
20
|
+
* TokenStore cache (local dev) — never written to `.env`.
|
|
21
|
+
* - `previousSecrets`: The plugin appends its own compatibility entry so
|
|
22
|
+
* data written under the old shared hosted secret keeps decrypting after
|
|
23
|
+
* the platform switched to per-tenant secrets; any tenant-supplied entries
|
|
24
|
+
* are preserved in order.
|
|
17
25
|
* - `editor`: Optional (defaults to lexicalEditor() if not provided)
|
|
18
26
|
* - `contentSystemId`: Optional (resolved automatically from env vars or bootstrap cache)
|
|
19
27
|
*
|
|
@@ -48,7 +56,9 @@ export type FigmaConfig = {
|
|
|
48
56
|
figma: {
|
|
49
57
|
contentSystemId?: string;
|
|
50
58
|
environmentId?: string;
|
|
51
|
-
storage?:
|
|
59
|
+
storage?: {
|
|
60
|
+
uploadInstructionsAccess?: UploadInstructionsAccess;
|
|
61
|
+
} | boolean;
|
|
52
62
|
useContentSystem?: boolean;
|
|
53
63
|
};
|
|
54
64
|
} & Omit<Config, 'db' | 'editor' | 'secret'> & Partial<Pick<Config, 'db'>>;
|