@dosgato/templating 0.0.128 → 0.0.130

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.
@@ -344,6 +344,7 @@ export interface PageRecord<DataType extends PageData = PageData> {
344
344
  id: string;
345
345
  name: string;
346
346
  linkId: string;
347
+ fallbackTitle: string;
347
348
  createdAt: Date;
348
349
  modifiedAt: Date;
349
350
  publishedAt?: Date;
package/dist/render.d.ts CHANGED
@@ -105,6 +105,18 @@ export interface APIClient {
105
105
  absolute?: boolean;
106
106
  extension?: string;
107
107
  }) => Promise<string | undefined>;
108
+ /**
109
+ * Exactly like resolveLink but also returns the title of the target page, if the target page
110
+ * is internal to the CMS. If the target is a random web page outside the CMS, title will be
111
+ * undefined. Perhaps in the future title could be scraped from the page HTML.
112
+ */
113
+ resolveLinkAndTitle: (lnk: string | LinkDefinition | undefined, opts?: {
114
+ absolute?: boolean;
115
+ extension?: string;
116
+ }) => Promise<{
117
+ href?: string;
118
+ title?: string;
119
+ }>;
108
120
  /**
109
121
  * Get a link href for a page
110
122
  *
@@ -66,7 +66,7 @@ export interface UITemplate {
66
66
  * anotherArea: [componentData3]
67
67
  * }
68
68
  */
69
- defaultContent?: Record<string, ComponentData[]>;
69
+ defaultContent?: Record<string, ComponentData[]> | ((data: ComponentData) => Record<string, ComponentData[]>);
70
70
  /**
71
71
  * if present this SVG will be used when presenting users with
72
72
  * an array of choices of templates to create. Ideally it should look
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosgato/templating",
3
- "version": "0.0.128",
3
+ "version": "0.0.130",
4
4
  "description": "A library to support building templates for dosgato CMS.",
5
5
  "type": "module",
6
6
  "exports": {