@dosgato/templating 0.0.44 → 0.0.47
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 +5 -7
- package/dist/component.js +1 -1
- package/dist/render.d.ts +1 -1
- package/package.json +1 -1
package/dist/component.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export declare abstract class Component<DataType extends ComponentData = any, Fe
|
|
|
69
69
|
* The inherited components will be added to the appropriate area's array in the renderedAreas
|
|
70
70
|
* parameter of your render function.
|
|
71
71
|
*/
|
|
72
|
-
registerInherited: (area: string, components: ComponentData[], top?: true) => void;
|
|
72
|
+
registerInherited: (area: string, components: ComponentData[], fromPageId: string, top?: true) => void;
|
|
73
73
|
/**
|
|
74
74
|
* The second phase of rendering a component is the context phase. This step is TOP-DOWN and
|
|
75
75
|
* NON-MUTATING. Each component will receive the parent component's context and then pass a
|
|
@@ -131,12 +131,12 @@ export declare abstract class Component<DataType extends ComponentData = any, Fe
|
|
|
131
131
|
*
|
|
132
132
|
* For instance, you could return this.data.title
|
|
133
133
|
*/
|
|
134
|
-
editLabel(): undefined;
|
|
134
|
+
editLabel(): string | undefined;
|
|
135
135
|
/**
|
|
136
136
|
* Components may override this function to give their edit bars a custom
|
|
137
137
|
* CSS class
|
|
138
138
|
*/
|
|
139
|
-
editClass(): undefined;
|
|
139
|
+
editClass(): string | undefined;
|
|
140
140
|
/**
|
|
141
141
|
* Components may override this function to give their new bars a custom
|
|
142
142
|
* label
|
|
@@ -144,12 +144,12 @@ export declare abstract class Component<DataType extends ComponentData = any, Fe
|
|
|
144
144
|
* For instance, an area that only accepts 'layout' components could
|
|
145
145
|
* return "Add Layout"
|
|
146
146
|
*/
|
|
147
|
-
newLabel(areaName: string): undefined;
|
|
147
|
+
newLabel(areaName: string): string | undefined;
|
|
148
148
|
/**
|
|
149
149
|
* Components may override this function to give their new bars a custom
|
|
150
150
|
* CSS class
|
|
151
151
|
*/
|
|
152
|
-
newClass(areaName: string): undefined;
|
|
152
|
+
newClass(areaName: string): string | undefined;
|
|
153
153
|
/**
|
|
154
154
|
* Components may override this function to provide a custom edit bar
|
|
155
155
|
*
|
|
@@ -168,7 +168,6 @@ export declare abstract class Component<DataType extends ComponentData = any, Fe
|
|
|
168
168
|
*/
|
|
169
169
|
static editBar: (path: string, opts: EditBarOpts) => string;
|
|
170
170
|
static newBar: (path: string, opts: EditBarOpts) => string;
|
|
171
|
-
static repairHTML: (html: string) => string;
|
|
172
171
|
constructor(data: DataType, path: string, parent: Component | undefined, editMode: boolean);
|
|
173
172
|
areas: Map<string, Component<any, any, any>[]>;
|
|
174
173
|
data: Omit<DataType, 'areas'>;
|
|
@@ -180,7 +179,6 @@ export declare abstract class Component<DataType extends ComponentData = any, Fe
|
|
|
180
179
|
renderedAreas: Map<string, RenderedComponent[]>;
|
|
181
180
|
hadError: boolean;
|
|
182
181
|
autoLabel: string;
|
|
183
|
-
autoNewLabel: string;
|
|
184
182
|
/**
|
|
185
183
|
* For logging errors during rendering without crashing the render. If your fetch, setContext,
|
|
186
184
|
* render, or renderVariation functions throw, the error will be logged but the page render will
|
package/dist/component.js
CHANGED
|
@@ -152,7 +152,7 @@ export class Component extends ResourceProvider {
|
|
|
152
152
|
* Generally should not be overridden - override newLabel and newClass instead
|
|
153
153
|
*/
|
|
154
154
|
newBar(areaName, opts = {}) {
|
|
155
|
-
opts.label ?? (opts.label = this.newLabel(areaName) ?? this.
|
|
155
|
+
opts.label ?? (opts.label = this.newLabel(areaName) ?? (this.areas.size > 1 ? `Add ${areaName} Content` : `Add ${this.autoLabel} Content`));
|
|
156
156
|
opts.extraClass ?? (opts.extraClass = this.newClass(areaName));
|
|
157
157
|
opts.editMode ?? (opts.editMode = this.editMode);
|
|
158
158
|
opts.inheritedFrom ?? (opts.inheritedFrom = this.inheritedFrom);
|
package/dist/render.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ export interface APIClient {
|
|
|
73
73
|
id?: string;
|
|
74
74
|
path?: string;
|
|
75
75
|
link?: string | PageLink;
|
|
76
|
-
}) => Promise<PageRecord<PageData
|
|
76
|
+
}) => Promise<PageRecord<PageData> | undefined>;
|
|
77
77
|
/** Get all ancestor pages of a specific page. First array element will be the pagetree root page. */
|
|
78
78
|
getAncestors: ({ id, path }: {
|
|
79
79
|
id?: string;
|