datocms-plugin-sdk 2.1.1 → 2.2.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/connect.js +12 -0
- package/dist/cjs/connect.js.map +1 -1
- package/dist/cjs/manifest.js +69 -28
- package/dist/cjs/manifest.js.map +1 -1
- package/dist/esm/connect.js +12 -0
- package/dist/esm/connect.js.map +1 -1
- package/dist/esm/ctx/base.d.ts +61 -2
- package/dist/esm/manifest.js +69 -28
- package/dist/esm/manifest.js.map +1 -1
- package/dist/types/ctx/base.d.ts +61 -2
- package/manifest.json +70 -29
- package/package.json +3 -3
- package/src/connect.ts +11 -0
- package/src/ctx/base.ts +66 -2
- package/src/manifest.ts +74 -28
package/dist/esm/connect.js
CHANGED
|
@@ -70,6 +70,16 @@ import { renderPageBootstrapper } from './hooks/renderPage';
|
|
|
70
70
|
import { renderUploadSidebarBootstrapper, } from './hooks/renderUploadSidebar';
|
|
71
71
|
import { renderUploadSidebarPanelBootstrapper, } from './hooks/renderUploadSidebarPanel';
|
|
72
72
|
import { fromOneFieldIntoMultipleAndResultsById, omit, } from './utils';
|
|
73
|
+
function applyColorScheme(properties) {
|
|
74
|
+
if (typeof document === 'undefined')
|
|
75
|
+
return;
|
|
76
|
+
var next = properties === null || properties === void 0 ? void 0 : properties.colorScheme;
|
|
77
|
+
if (next !== 'light' && next !== 'dark')
|
|
78
|
+
return;
|
|
79
|
+
if (document.documentElement.dataset.theme === next)
|
|
80
|
+
return;
|
|
81
|
+
document.documentElement.dataset.theme = next;
|
|
82
|
+
}
|
|
73
83
|
export function connect() {
|
|
74
84
|
return __awaiter(this, arguments, void 0, function (rawConfiguration) {
|
|
75
85
|
var onChangeListener, callMethodMergingBootCtxExecutor, configuration, penpalConnection, methods, initialProperties, currentProperties_1, availableBootstrappers, _i, _a, bootstrapper, result;
|
|
@@ -89,6 +99,7 @@ export function connect() {
|
|
|
89
99
|
var key = _a[0];
|
|
90
100
|
return !key.startsWith('render');
|
|
91
101
|
}))), { onChange: function (newSettings) {
|
|
102
|
+
applyColorScheme(newSettings);
|
|
92
103
|
if (onChangeListener) {
|
|
93
104
|
onChangeListener(newSettings);
|
|
94
105
|
}
|
|
@@ -105,6 +116,7 @@ export function connect() {
|
|
|
105
116
|
return [4 /*yield*/, methods.getSettings()];
|
|
106
117
|
case 2:
|
|
107
118
|
initialProperties = _b.sent();
|
|
119
|
+
applyColorScheme(initialProperties);
|
|
108
120
|
if (initialProperties.mode === 'onBoot') {
|
|
109
121
|
currentProperties_1 = initialProperties;
|
|
110
122
|
onChangeListener = function (newProperties) {
|
package/dist/esm/connect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../src/connect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,eAAe,MAAM,4BAA4B,CAAC;AA2BzD,OAAO,EAEL,6BAA6B,GAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,8BAA8B,GAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,gCAAgC,GACjC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,gCAAgC,GACjC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,sCAAsC,GACvC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAEL,gCAAgC,GACjC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,iCAAiC,GAClC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,sCAAsC,GACvC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAEL,kDAAkD,GACnD,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAmB,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAkB,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AqC,EAAE,CAAC;wBAAxD,YAAY;wBACf,MAAM,GAAG,YAAY,CAAC,aAAa,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;wBAEvE,IAAI,MAAM,EAAE,CAAC;4BACX,gBAAgB,GAAG,MAAM,CAAC;4BAC1B,MAAM;wBACR,CAAC;oBACH,CAAC;;;;;CACF"}
|
package/dist/esm/ctx/base.d.ts
CHANGED
|
@@ -45,6 +45,23 @@ type ProjectProperties = {
|
|
|
45
45
|
environment: string;
|
|
46
46
|
/** Whether the current environment is the primary one */
|
|
47
47
|
isEnvironmentPrimary: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The URL of the Content Delivery API (GraphQL) endpoint for the current
|
|
50
|
+
* project and environment.
|
|
51
|
+
*
|
|
52
|
+
* In the vast majority of cases you don't need this: the CDA endpoint is at a
|
|
53
|
+
* well-known, stable URL. It's exposed here only to support DatoCMS internal
|
|
54
|
+
* testing against non-production environments (e.g. staging).
|
|
55
|
+
*/
|
|
56
|
+
cdaEndpointUrl: string;
|
|
57
|
+
/**
|
|
58
|
+
* The base URL of the Content Management API.
|
|
59
|
+
*
|
|
60
|
+
* In the vast majority of cases you don't need this: the CMA lives at a
|
|
61
|
+
* well-known, stable URL. It's exposed here only to support DatoCMS internal
|
|
62
|
+
* testing against non-production environments (e.g. staging).
|
|
63
|
+
*/
|
|
64
|
+
cmaBaseUrl: string;
|
|
48
65
|
/** The account/organization that is the project owner */
|
|
49
66
|
owner: Account | Organization;
|
|
50
67
|
/**
|
|
@@ -62,8 +79,31 @@ type ProjectProperties = {
|
|
|
62
79
|
/** Preferred locale */
|
|
63
80
|
locale: string;
|
|
64
81
|
};
|
|
65
|
-
/**
|
|
82
|
+
/**
|
|
83
|
+
* An object containing the theme colors for the current DatoCMS project
|
|
84
|
+
*
|
|
85
|
+
* @deprecated Use `semanticColorTokensTheme` instead. This property is kept
|
|
86
|
+
* for backward compatibility with third-party plugins.
|
|
87
|
+
*/
|
|
66
88
|
theme: Theme;
|
|
89
|
+
/**
|
|
90
|
+
* Semantic color tokens for the current DatoCMS project, pre-computed by
|
|
91
|
+
* the host. A map of CSS custom property names (e.g.
|
|
92
|
+
* `--color--raised--surface`) to their resolved values for the current
|
|
93
|
+
* color scheme.
|
|
94
|
+
*/
|
|
95
|
+
semanticColorTokensTheme: SemanticColorTokensTheme;
|
|
96
|
+
/**
|
|
97
|
+
* The appearance color scheme the host CMS is currently using. Resolved —
|
|
98
|
+
* `'system'` is already expanded to `'light'` or `'dark'` by the host.
|
|
99
|
+
*
|
|
100
|
+
* The SDK runtime reflects this onto `document.documentElement` as
|
|
101
|
+
* `data-theme="light"` / `data-theme="dark"` so plugin CSS can branch
|
|
102
|
+
* with `[data-theme="dark"] { … }` selectors. For non-CSS decisions
|
|
103
|
+
* (choosing a logo asset, a syntax-highlighting preset, …) branch on
|
|
104
|
+
* `ctx.colorScheme` directly.
|
|
105
|
+
*/
|
|
106
|
+
colorScheme: 'light' | 'dark';
|
|
67
107
|
};
|
|
68
108
|
/**
|
|
69
109
|
* These properties provide access to "entity repos", that is, the collection of
|
|
@@ -98,7 +138,12 @@ type EntityReposProperties = {
|
|
|
98
138
|
*/
|
|
99
139
|
ssoUsers: Partial<Record<string, SsoUser>>;
|
|
100
140
|
};
|
|
101
|
-
/**
|
|
141
|
+
/**
|
|
142
|
+
* An object containing the theme colors for the current DatoCMS project
|
|
143
|
+
*
|
|
144
|
+
* @deprecated Use `SemanticColorTokensTheme` instead. This type is kept for
|
|
145
|
+
* backward compatibility with third-party plugins.
|
|
146
|
+
*/
|
|
102
147
|
export type Theme = {
|
|
103
148
|
primaryColor: string;
|
|
104
149
|
accentColor: string;
|
|
@@ -106,6 +151,20 @@ export type Theme = {
|
|
|
106
151
|
lightColor: string;
|
|
107
152
|
darkColor: string;
|
|
108
153
|
};
|
|
154
|
+
/**
|
|
155
|
+
* Semantic color tokens for the current DatoCMS project, pre-computed by the
|
|
156
|
+
* host. Only available on DatoCMS hosts that support the new token system.
|
|
157
|
+
*
|
|
158
|
+
* Each key is a ready-to-use CSS custom property name (including the leading
|
|
159
|
+
* `--`), and each value is the resolved color for the host's current color
|
|
160
|
+
* scheme — e.g. `{ '--color--raised--surface': 'oklch(…)' }`. The SDK applies
|
|
161
|
+
* these verbatim onto the plugin canvas, so plugin CSS can reference them
|
|
162
|
+
* directly with `var(--color--raised--surface)`.
|
|
163
|
+
*
|
|
164
|
+
* The token set is whatever the host sends; it is intentionally untyped so it
|
|
165
|
+
* can evolve on the host without an SDK release.
|
|
166
|
+
*/
|
|
167
|
+
export type SemanticColorTokensTheme = Record<string, string>;
|
|
109
168
|
export type BaseMethods = LoadDataMethods & UpdatePluginParametersMethods & ToastMethods & ItemDialogMethods & UploadDialogMethods & CustomDialogMethods & NavigateMethods;
|
|
110
169
|
/**
|
|
111
170
|
* These methods can be used to asyncronously load additional information your
|
package/dist/esm/manifest.js
CHANGED
|
@@ -3076,13 +3076,33 @@ export var manifest = {
|
|
|
3076
3076
|
},
|
|
3077
3077
|
type: 'boolean',
|
|
3078
3078
|
},
|
|
3079
|
+
cdaEndpointUrl: {
|
|
3080
|
+
comment: {
|
|
3081
|
+
markdownText: "The URL of the Content Delivery API (GraphQL) endpoint for the current\nproject and environment.\n\nIn the vast majority of cases you don't need this: the CDA endpoint is at a\nwell-known, stable URL. It's exposed here only to support DatoCMS internal\ntesting against non-production environments (e.g. staging).",
|
|
3082
|
+
},
|
|
3083
|
+
location: {
|
|
3084
|
+
filePath: 'src/ctx/base.ts',
|
|
3085
|
+
lineNumber: 74,
|
|
3086
|
+
},
|
|
3087
|
+
type: 'string',
|
|
3088
|
+
},
|
|
3089
|
+
cmaBaseUrl: {
|
|
3090
|
+
comment: {
|
|
3091
|
+
markdownText: "The base URL of the Content Management API.\n\nIn the vast majority of cases you don't need this: the CMA lives at a\nwell-known, stable URL. It's exposed here only to support DatoCMS internal\ntesting against non-production environments (e.g. staging).",
|
|
3092
|
+
},
|
|
3093
|
+
location: {
|
|
3094
|
+
filePath: 'src/ctx/base.ts',
|
|
3095
|
+
lineNumber: 83,
|
|
3096
|
+
},
|
|
3097
|
+
type: 'string',
|
|
3098
|
+
},
|
|
3079
3099
|
owner: {
|
|
3080
3100
|
comment: {
|
|
3081
3101
|
markdownText: 'The account/organization that is the project owner.',
|
|
3082
3102
|
},
|
|
3083
3103
|
location: {
|
|
3084
3104
|
filePath: 'src/ctx/base.ts',
|
|
3085
|
-
lineNumber:
|
|
3105
|
+
lineNumber: 86,
|
|
3086
3106
|
},
|
|
3087
3107
|
type: 'Account | Organization',
|
|
3088
3108
|
},
|
|
@@ -3093,7 +3113,7 @@ export var manifest = {
|
|
|
3093
3113
|
},
|
|
3094
3114
|
location: {
|
|
3095
3115
|
filePath: 'src/ctx/base.ts',
|
|
3096
|
-
lineNumber:
|
|
3116
|
+
lineNumber: 94,
|
|
3097
3117
|
},
|
|
3098
3118
|
type: 'Account | undefined',
|
|
3099
3119
|
},
|
|
@@ -3103,20 +3123,41 @@ export var manifest = {
|
|
|
3103
3123
|
},
|
|
3104
3124
|
location: {
|
|
3105
3125
|
filePath: 'src/ctx/base.ts',
|
|
3106
|
-
lineNumber:
|
|
3126
|
+
lineNumber: 100,
|
|
3107
3127
|
},
|
|
3108
3128
|
type: '{\n /** Preferred locale */\n locale: string;\n }',
|
|
3109
3129
|
},
|
|
3110
3130
|
theme: {
|
|
3111
3131
|
comment: {
|
|
3112
3132
|
markdownText: 'An object containing the theme colors for the current DatoCMS project.',
|
|
3133
|
+
deprecatedMarkdownText: 'Use `semanticColorTokensTheme` instead. This property is kept\nfor backward compatibility with third-party plugins.',
|
|
3113
3134
|
},
|
|
3114
3135
|
location: {
|
|
3115
3136
|
filePath: 'src/ctx/base.ts',
|
|
3116
|
-
lineNumber:
|
|
3137
|
+
lineNumber: 111,
|
|
3117
3138
|
},
|
|
3118
3139
|
type: 'Theme',
|
|
3119
3140
|
},
|
|
3141
|
+
semanticColorTokensTheme: {
|
|
3142
|
+
comment: {
|
|
3143
|
+
markdownText: 'Semantic color tokens for the current DatoCMS project, pre-computed by\nthe host. A map of CSS custom property names (e.g.\n`--color--raised--surface`) to their resolved values for the current\ncolor scheme.',
|
|
3144
|
+
},
|
|
3145
|
+
location: {
|
|
3146
|
+
filePath: 'src/ctx/base.ts',
|
|
3147
|
+
lineNumber: 119,
|
|
3148
|
+
},
|
|
3149
|
+
type: 'SemanticColorTokensTheme',
|
|
3150
|
+
},
|
|
3151
|
+
colorScheme: {
|
|
3152
|
+
comment: {
|
|
3153
|
+
markdownText: 'The appearance color scheme the host CMS is currently using. Resolved —\n`\'system\'` is already expanded to `\'light\'` or `\'dark\'` by the host.\n\nThe SDK runtime reflects this onto `document.documentElement` as\n`data-theme="light"` / `data-theme="dark"` so plugin CSS can branch\nwith `[data-theme="dark"] { … }` selectors. For non-CSS decisions\n(choosing a logo asset, a syntax-highlighting preset, …) branch on\n`ctx.colorScheme` directly.',
|
|
3154
|
+
},
|
|
3155
|
+
location: {
|
|
3156
|
+
filePath: 'src/ctx/base.ts',
|
|
3157
|
+
lineNumber: 131,
|
|
3158
|
+
},
|
|
3159
|
+
type: "'light' | 'dark'",
|
|
3160
|
+
},
|
|
3120
3161
|
},
|
|
3121
3162
|
},
|
|
3122
3163
|
{
|
|
@@ -3131,7 +3172,7 @@ export var manifest = {
|
|
|
3131
3172
|
},
|
|
3132
3173
|
location: {
|
|
3133
3174
|
filePath: 'src/ctx/base.ts',
|
|
3134
|
-
lineNumber:
|
|
3175
|
+
lineNumber: 141,
|
|
3135
3176
|
},
|
|
3136
3177
|
type: 'Partial<Record<string, ItemType>>',
|
|
3137
3178
|
},
|
|
@@ -3141,7 +3182,7 @@ export var manifest = {
|
|
|
3141
3182
|
},
|
|
3142
3183
|
location: {
|
|
3143
3184
|
filePath: 'src/ctx/base.ts',
|
|
3144
|
-
lineNumber:
|
|
3185
|
+
lineNumber: 148,
|
|
3145
3186
|
},
|
|
3146
3187
|
type: 'Partial<Record<string, Field>>',
|
|
3147
3188
|
},
|
|
@@ -3151,7 +3192,7 @@ export var manifest = {
|
|
|
3151
3192
|
},
|
|
3152
3193
|
location: {
|
|
3153
3194
|
filePath: 'src/ctx/base.ts',
|
|
3154
|
-
lineNumber:
|
|
3195
|
+
lineNumber: 155,
|
|
3155
3196
|
},
|
|
3156
3197
|
type: 'Partial<Record<string, Fieldset>>',
|
|
3157
3198
|
},
|
|
@@ -3161,7 +3202,7 @@ export var manifest = {
|
|
|
3161
3202
|
},
|
|
3162
3203
|
location: {
|
|
3163
3204
|
filePath: 'src/ctx/base.ts',
|
|
3164
|
-
lineNumber:
|
|
3205
|
+
lineNumber: 162,
|
|
3165
3206
|
},
|
|
3166
3207
|
type: 'Partial<Record<string, User>>',
|
|
3167
3208
|
},
|
|
@@ -3171,7 +3212,7 @@ export var manifest = {
|
|
|
3171
3212
|
},
|
|
3172
3213
|
location: {
|
|
3173
3214
|
filePath: 'src/ctx/base.ts',
|
|
3174
|
-
lineNumber:
|
|
3215
|
+
lineNumber: 169,
|
|
3175
3216
|
},
|
|
3176
3217
|
type: 'Partial<Record<string, SsoUser>>',
|
|
3177
3218
|
},
|
|
@@ -3192,7 +3233,7 @@ export var manifest = {
|
|
|
3192
3233
|
},
|
|
3193
3234
|
location: {
|
|
3194
3235
|
filePath: 'src/ctx/base.ts',
|
|
3195
|
-
lineNumber:
|
|
3236
|
+
lineNumber: 232,
|
|
3196
3237
|
},
|
|
3197
3238
|
type: '(itemTypeId: string) => Promise<Field[]>',
|
|
3198
3239
|
},
|
|
@@ -3203,7 +3244,7 @@ export var manifest = {
|
|
|
3203
3244
|
},
|
|
3204
3245
|
location: {
|
|
3205
3246
|
filePath: 'src/ctx/base.ts',
|
|
3206
|
-
lineNumber:
|
|
3247
|
+
lineNumber: 251,
|
|
3207
3248
|
},
|
|
3208
3249
|
type: '(itemTypeId: string) => Promise<Fieldset[]>',
|
|
3209
3250
|
},
|
|
@@ -3214,7 +3255,7 @@ export var manifest = {
|
|
|
3214
3255
|
},
|
|
3215
3256
|
location: {
|
|
3216
3257
|
filePath: 'src/ctx/base.ts',
|
|
3217
|
-
lineNumber:
|
|
3258
|
+
lineNumber: 268,
|
|
3218
3259
|
},
|
|
3219
3260
|
type: '() => Promise<Field[]>',
|
|
3220
3261
|
},
|
|
@@ -3225,7 +3266,7 @@ export var manifest = {
|
|
|
3225
3266
|
},
|
|
3226
3267
|
location: {
|
|
3227
3268
|
filePath: 'src/ctx/base.ts',
|
|
3228
|
-
lineNumber:
|
|
3269
|
+
lineNumber: 281,
|
|
3229
3270
|
},
|
|
3230
3271
|
type: '() => Promise<User[]>',
|
|
3231
3272
|
},
|
|
@@ -3236,7 +3277,7 @@ export var manifest = {
|
|
|
3236
3277
|
},
|
|
3237
3278
|
location: {
|
|
3238
3279
|
filePath: 'src/ctx/base.ts',
|
|
3239
|
-
lineNumber:
|
|
3280
|
+
lineNumber: 294,
|
|
3240
3281
|
},
|
|
3241
3282
|
type: '() => Promise<SsoUser[]>',
|
|
3242
3283
|
},
|
|
@@ -3255,7 +3296,7 @@ export var manifest = {
|
|
|
3255
3296
|
},
|
|
3256
3297
|
location: {
|
|
3257
3298
|
filePath: 'src/ctx/base.ts',
|
|
3258
|
-
lineNumber:
|
|
3299
|
+
lineNumber: 316,
|
|
3259
3300
|
},
|
|
3260
3301
|
type: '(params: Record<string, unknown>) => Promise<void>',
|
|
3261
3302
|
},
|
|
@@ -3266,7 +3307,7 @@ export var manifest = {
|
|
|
3266
3307
|
},
|
|
3267
3308
|
location: {
|
|
3268
3309
|
filePath: 'src/ctx/base.ts',
|
|
3269
|
-
lineNumber:
|
|
3310
|
+
lineNumber: 367,
|
|
3270
3311
|
},
|
|
3271
3312
|
type: '(\n fieldId: string,\n changes: FieldAppearanceChange[],\n ) => Promise<void>',
|
|
3272
3313
|
},
|
|
@@ -3285,7 +3326,7 @@ export var manifest = {
|
|
|
3285
3326
|
},
|
|
3286
3327
|
location: {
|
|
3287
3328
|
filePath: 'src/ctx/base.ts',
|
|
3288
|
-
lineNumber:
|
|
3329
|
+
lineNumber: 472,
|
|
3289
3330
|
},
|
|
3290
3331
|
type: '(message: string) => Promise<void>',
|
|
3291
3332
|
},
|
|
@@ -3296,7 +3337,7 @@ export var manifest = {
|
|
|
3296
3337
|
},
|
|
3297
3338
|
location: {
|
|
3298
3339
|
filePath: 'src/ctx/base.ts',
|
|
3299
|
-
lineNumber:
|
|
3340
|
+
lineNumber: 487,
|
|
3300
3341
|
},
|
|
3301
3342
|
type: '(message: string) => Promise<void>',
|
|
3302
3343
|
},
|
|
@@ -3307,7 +3348,7 @@ export var manifest = {
|
|
|
3307
3348
|
},
|
|
3308
3349
|
location: {
|
|
3309
3350
|
filePath: 'src/ctx/base.ts',
|
|
3310
|
-
lineNumber:
|
|
3351
|
+
lineNumber: 511,
|
|
3311
3352
|
},
|
|
3312
3353
|
type: '<CtaValue = unknown>(\n toast: Toast<CtaValue>,\n ) => Promise<CtaValue | null>',
|
|
3313
3354
|
},
|
|
@@ -3326,7 +3367,7 @@ export var manifest = {
|
|
|
3326
3367
|
},
|
|
3327
3368
|
location: {
|
|
3328
3369
|
filePath: 'src/ctx/base.ts',
|
|
3329
|
-
lineNumber:
|
|
3370
|
+
lineNumber: 397,
|
|
3330
3371
|
},
|
|
3331
3372
|
type: '(itemTypeId: string) => Promise<Item | null>',
|
|
3332
3373
|
},
|
|
@@ -3337,7 +3378,7 @@ export var manifest = {
|
|
|
3337
3378
|
},
|
|
3338
3379
|
location: {
|
|
3339
3380
|
filePath: 'src/ctx/base.ts',
|
|
3340
|
-
lineNumber:
|
|
3381
|
+
lineNumber: 418,
|
|
3341
3382
|
},
|
|
3342
3383
|
type: '{\n (\n itemTypeId: string,\n options: { multiple: true; initialLocationQuery?: ItemListLocationQuery },\n ): Promise<Item[] | null>;\n (\n itemTypeId: string,\n options?: {\n multiple: false;\n initialLocationQuery?: ItemListLocationQuery;\n },\n ): Promise<Item | null>;\n }',
|
|
3343
3384
|
},
|
|
@@ -3348,7 +3389,7 @@ export var manifest = {
|
|
|
3348
3389
|
},
|
|
3349
3390
|
location: {
|
|
3350
3391
|
filePath: 'src/ctx/base.ts',
|
|
3351
|
-
lineNumber:
|
|
3392
|
+
lineNumber: 450,
|
|
3352
3393
|
},
|
|
3353
3394
|
type: '(itemId: string) => Promise<Item | null>',
|
|
3354
3395
|
},
|
|
@@ -3367,7 +3408,7 @@ export var manifest = {
|
|
|
3367
3408
|
},
|
|
3368
3409
|
location: {
|
|
3369
3410
|
filePath: 'src/ctx/base.ts',
|
|
3370
|
-
lineNumber:
|
|
3411
|
+
lineNumber: 538,
|
|
3371
3412
|
},
|
|
3372
3413
|
type: '{\n (options: { multiple: true }): Promise<Upload[] | null>;\n (options?: { multiple: false }): Promise<Upload | null>;\n }',
|
|
3373
3414
|
},
|
|
@@ -3378,7 +3419,7 @@ export var manifest = {
|
|
|
3378
3419
|
},
|
|
3379
3420
|
location: {
|
|
3380
3421
|
filePath: 'src/ctx/base.ts',
|
|
3381
|
-
lineNumber:
|
|
3422
|
+
lineNumber: 566,
|
|
3382
3423
|
},
|
|
3383
3424
|
type: '(\n uploadId: string,\n ) => Promise<(Upload & { deleted?: true }) | null>',
|
|
3384
3425
|
},
|
|
@@ -3389,7 +3430,7 @@ export var manifest = {
|
|
|
3389
3430
|
},
|
|
3390
3431
|
location: {
|
|
3391
3432
|
filePath: 'src/ctx/base.ts',
|
|
3392
|
-
lineNumber:
|
|
3433
|
+
lineNumber: 594,
|
|
3393
3434
|
},
|
|
3394
3435
|
type: '(\n /** The "single asset" field structure */\n fileFieldValue: FileFieldValue,\n /** Shows metadata information for a specific locale */\n locale?: string,\n ) => Promise<FileFieldValue | null>',
|
|
3395
3436
|
},
|
|
@@ -3408,7 +3449,7 @@ export var manifest = {
|
|
|
3408
3449
|
},
|
|
3409
3450
|
location: {
|
|
3410
3451
|
filePath: 'src/ctx/base.ts',
|
|
3411
|
-
lineNumber:
|
|
3452
|
+
lineNumber: 625,
|
|
3412
3453
|
},
|
|
3413
3454
|
type: '(modal: Modal) => Promise<unknown>',
|
|
3414
3455
|
},
|
|
@@ -3419,7 +3460,7 @@ export var manifest = {
|
|
|
3419
3460
|
},
|
|
3420
3461
|
location: {
|
|
3421
3462
|
filePath: 'src/ctx/base.ts',
|
|
3422
|
-
lineNumber:
|
|
3463
|
+
lineNumber: 662,
|
|
3423
3464
|
},
|
|
3424
3465
|
type: '(options: ConfirmOptions) => Promise<unknown>',
|
|
3425
3466
|
},
|
|
@@ -3438,7 +3479,7 @@ export var manifest = {
|
|
|
3438
3479
|
},
|
|
3439
3480
|
location: {
|
|
3440
3481
|
filePath: 'src/ctx/base.ts',
|
|
3441
|
-
lineNumber:
|
|
3482
|
+
lineNumber: 676,
|
|
3442
3483
|
},
|
|
3443
3484
|
type: '(path: string) => Promise<void>',
|
|
3444
3485
|
},
|