@dosgato/templating 0.0.44 → 0.0.45
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 +4 -5
- package/dist/component.js +1 -1
- package/package.json +1 -1
package/dist/component.d.ts
CHANGED
|
@@ -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
|
*
|
|
@@ -180,7 +180,6 @@ export declare abstract class Component<DataType extends ComponentData = any, Fe
|
|
|
180
180
|
renderedAreas: Map<string, RenderedComponent[]>;
|
|
181
181
|
hadError: boolean;
|
|
182
182
|
autoLabel: string;
|
|
183
|
-
autoNewLabel: string;
|
|
184
183
|
/**
|
|
185
184
|
* For logging errors during rendering without crashing the render. If your fetch, setContext,
|
|
186
185
|
* 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);
|