@dosgato/templating 0.0.134 → 0.0.135
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/component.d.ts +6 -0
- package/dist/uitemplate.d.ts +24 -1
- package/package.json +1 -1
package/dist/component.d.ts
CHANGED
|
@@ -373,6 +373,12 @@ export interface DataData {
|
|
|
373
373
|
savedAtVersion: string;
|
|
374
374
|
[keys: string]: any;
|
|
375
375
|
}
|
|
376
|
+
export interface AssetData<T = any> {
|
|
377
|
+
shasum: string;
|
|
378
|
+
uploadedFilename: string;
|
|
379
|
+
meta: T;
|
|
380
|
+
[keys: string]: any;
|
|
381
|
+
}
|
|
376
382
|
export interface ContextBase {
|
|
377
383
|
/**
|
|
378
384
|
* For accessibility, every component should consider whether it is creating headers
|
package/dist/uitemplate.d.ts
CHANGED
|
@@ -162,6 +162,10 @@ export interface UserEvent extends BaseEvent {
|
|
|
162
162
|
* @example '/site3-sandbox/about' */
|
|
163
163
|
target: string;
|
|
164
164
|
}
|
|
165
|
+
interface AssetMetaDisplay {
|
|
166
|
+
component: UITemplate['dialog'];
|
|
167
|
+
title: string;
|
|
168
|
+
}
|
|
165
169
|
/**
|
|
166
170
|
* A type for the config object that should be exported from a CMS instance's admin/local/index.js
|
|
167
171
|
* to configure how that instance should work.
|
|
@@ -224,7 +228,26 @@ export interface UIConfig {
|
|
|
224
228
|
* If you would like to collect more information about assets from editors, you may provide a dialog
|
|
225
229
|
* here. The data collected will be available when you retrieve assets.
|
|
226
230
|
*/
|
|
227
|
-
|
|
231
|
+
assetMeta?: {
|
|
232
|
+
dialog: UITemplate['dialog'];
|
|
233
|
+
/**
|
|
234
|
+
* If you provide an assetMeta.dialog to collect extra details about each asset, you'll probably want to
|
|
235
|
+
* display those details on the asset detail screen. Provide this function to return a map of detail
|
|
236
|
+
* keys and values to be displayed alongside the other vitals like asset name, size, type, etc. Insertion
|
|
237
|
+
* order will be maintained.
|
|
238
|
+
*/
|
|
239
|
+
details?: (data: any) => Record<string, string>;
|
|
240
|
+
/**
|
|
241
|
+
* If you provide an assetMeta.dialog to collect extra details about each asset, you may want to use
|
|
242
|
+
* assetMeta.details to show some of it, and/or you may want your own box on the detail page to do something
|
|
243
|
+
* cool and custom. Provide a svelte component here and it will be passed the asset object with all of
|
|
244
|
+
* its metadata so that you can draw whatever you like. Your content will be placed inside a box titled
|
|
245
|
+
* with the title property.
|
|
246
|
+
*
|
|
247
|
+
* Provide an array to be given multiple boxes.
|
|
248
|
+
*/
|
|
249
|
+
display?: AssetMetaDisplay | AssetMetaDisplay[];
|
|
250
|
+
};
|
|
228
251
|
tracing?: TracingInterface;
|
|
229
252
|
/** Non-Awaited async call for logging interface interactions if defined.
|
|
230
253
|
* Useful for defining how to log form submissions, interaction clicks, page edits, or state
|