@dosgato/templating 0.0.81 → 0.0.82

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.
@@ -284,6 +284,7 @@ export interface PageRecordOptionalData<DataType extends PageData = PageData> ex
284
284
  export interface ComponentData {
285
285
  templateKey: string;
286
286
  areas?: Record<string, ComponentData[]>;
287
+ [keys: string]: any;
287
288
  }
288
289
  export interface PageData extends ComponentData {
289
290
  savedAtVersion: string;
@@ -291,6 +292,7 @@ export interface PageData extends ComponentData {
291
292
  export interface DataData {
292
293
  templateKey: string;
293
294
  savedAtVersion: string;
295
+ [keys: string]: any;
294
296
  }
295
297
  export interface ContextBase {
296
298
  /**
package/dist/component.js CHANGED
@@ -69,7 +69,7 @@ export class Component extends ResourceProvider {
69
69
  * to reduce the number of components that get inherited.
70
70
  */
71
71
  inheritArea(page, areaName, opts) {
72
- const components = get(page.data, areaName).filter(opts?.filter ?? (() => true));
72
+ const components = get(page.data, `areas.${areaName}`).filter(opts?.filter ?? (() => true));
73
73
  this.registerInherited(areaName, components, page.id, opts?.mode);
74
74
  }
75
75
  /**
@@ -37,6 +37,13 @@ export interface UITemplate {
37
37
  *
38
38
  * You can place that introductory content here and it will be automatically placed into
39
39
  * components with this template upon creation (and never again).
40
+ *
41
+ * Whatever you put here will be added beneath the component's `areas` property, so it would
42
+ * be structured like:
43
+ * {
44
+ * someArea: [componentData1, componentData2],
45
+ * anotherArea: [componentData3]
46
+ * }
40
47
  */
41
48
  defaultContent?: Record<string, ComponentData[]>;
42
49
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosgato/templating",
3
- "version": "0.0.81",
3
+ "version": "0.0.82",
4
4
  "description": "A library to support building templates for dosgato CMS.",
5
5
  "type": "module",
6
6
  "exports": {