@dosgato/templating 0.0.59 → 0.0.60
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 +12 -3
- package/dist/component.js +2 -2
- package/dist/render.d.ts +4 -1
- package/package.json +1 -1
package/dist/component.d.ts
CHANGED
|
@@ -193,11 +193,21 @@ export declare abstract class Component<DataType extends ComponentData = any, Fe
|
|
|
193
193
|
logError(e: Error): void;
|
|
194
194
|
protected passError(e: Error, path: string): void;
|
|
195
195
|
}
|
|
196
|
+
export interface SiteInfo {
|
|
197
|
+
id: string;
|
|
198
|
+
name: string;
|
|
199
|
+
launched: boolean;
|
|
200
|
+
url?: {
|
|
201
|
+
prefix: string;
|
|
202
|
+
path: string;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
196
205
|
export interface PageRecord<DataType extends PageData = PageData> {
|
|
197
206
|
id: string;
|
|
198
207
|
linkId: string;
|
|
199
208
|
path: string;
|
|
200
209
|
data: DataType;
|
|
210
|
+
site: SiteInfo;
|
|
201
211
|
}
|
|
202
212
|
export interface ComponentData {
|
|
203
213
|
templateKey: string;
|
|
@@ -239,10 +249,9 @@ export declare abstract class Page<DataType extends PageData = any, FetchedType
|
|
|
239
249
|
*/
|
|
240
250
|
id: string;
|
|
241
251
|
/**
|
|
242
|
-
*
|
|
243
|
-
* using the page id in API queries
|
|
252
|
+
* Other data we've already collected about the page being rendered, in case it's needed.
|
|
244
253
|
*/
|
|
245
|
-
|
|
254
|
+
pageInfo: PageRecord<DataType>;
|
|
246
255
|
/**
|
|
247
256
|
* This will be filled by the rendering server. The template properties are described
|
|
248
257
|
* over in apitemplate.ts in the comment for APIPageTemplate.templateProperties.
|
package/dist/component.js
CHANGED
|
@@ -175,10 +175,10 @@ export class Component extends ResourceProvider {
|
|
|
175
175
|
export class Page extends Component {
|
|
176
176
|
constructor(page, editMode) {
|
|
177
177
|
super(page.data, '', undefined, editMode);
|
|
178
|
-
this.pagePath = page.path;
|
|
179
178
|
this.id = page.id;
|
|
179
|
+
this.pageInfo = page;
|
|
180
180
|
}
|
|
181
181
|
passError(e, path) {
|
|
182
|
-
console.warn(`Recoverable issue occured during render of ${this.
|
|
182
|
+
console.warn(`Recoverable issue occured during render of ${this.pageInfo.path}. Component at ${path} threw the following error:`, e);
|
|
183
183
|
}
|
|
184
184
|
}
|
package/dist/render.d.ts
CHANGED
|
@@ -57,7 +57,10 @@ export interface APIClient {
|
|
|
57
57
|
* absolute: true to generate a full URL suitable for a backend http request or non-HTML document
|
|
58
58
|
* like an RSS feed.
|
|
59
59
|
*/
|
|
60
|
-
getHref: (page: PageRecord,
|
|
60
|
+
getHref: (page: PageRecord, opts?: {
|
|
61
|
+
absolute?: boolean;
|
|
62
|
+
extension?: string;
|
|
63
|
+
}) => string;
|
|
61
64
|
/**
|
|
62
65
|
* This function will be provided by the rendering server and should be used inside your fetch
|
|
63
66
|
* method to prepare editor-provided HTML for rendering. It will do things like find and resolve
|