@dosgato/templating 0.0.97 → 0.0.98
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 -2
- package/dist/component.js +3 -2
- package/package.json +1 -1
package/dist/component.d.ts
CHANGED
|
@@ -82,14 +82,16 @@ export declare abstract class Component<DataType extends ComponentData = any, Fe
|
|
|
82
82
|
* going to render anything. For instance, if we are rendering an '.ics' variation and this component
|
|
83
83
|
* is not an event, it will not be participating and we'd like to avoid doing the work in the fetch().
|
|
84
84
|
*
|
|
85
|
-
* This method returns
|
|
85
|
+
* This method returns a map of extensions where we SHOULD run fetch(). The default is only run fetch
|
|
86
86
|
* on 'html'. Components that support other variations should override this method and opt in to more
|
|
87
87
|
* extensions.
|
|
88
88
|
*
|
|
89
89
|
* The extensions listed should NOT include the preceding dot. In the case of an extended extension like
|
|
90
90
|
* '.js.map', you should provide 'js.map'.
|
|
91
91
|
*/
|
|
92
|
-
variationsToFetch():
|
|
92
|
+
variationsToFetch(): {
|
|
93
|
+
html: boolean;
|
|
94
|
+
};
|
|
93
95
|
/**
|
|
94
96
|
* Some components may be inheritable to subpages within the same site. For instance, a site's
|
|
95
97
|
* social media links may appear on every page's footer. To accomplish this in your template,
|
package/dist/component.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { get, isNotBlank, titleCase } from 'txstate-utils';
|
|
2
2
|
import { ResourceProvider } from './provider.js';
|
|
3
3
|
function defaultWrap(info) { return info.output; }
|
|
4
|
+
const acceptHtmlVariation = { html: true };
|
|
4
5
|
/**
|
|
5
6
|
* This is the primary templating class to build your templates. Subclass it and provide
|
|
6
7
|
* at least a render function.
|
|
@@ -70,14 +71,14 @@ export class Component extends ResourceProvider {
|
|
|
70
71
|
* going to render anything. For instance, if we are rendering an '.ics' variation and this component
|
|
71
72
|
* is not an event, it will not be participating and we'd like to avoid doing the work in the fetch().
|
|
72
73
|
*
|
|
73
|
-
* This method returns
|
|
74
|
+
* This method returns a map of extensions where we SHOULD run fetch(). The default is only run fetch
|
|
74
75
|
* on 'html'. Components that support other variations should override this method and opt in to more
|
|
75
76
|
* extensions.
|
|
76
77
|
*
|
|
77
78
|
* The extensions listed should NOT include the preceding dot. In the case of an extended extension like
|
|
78
79
|
* '.js.map', you should provide 'js.map'.
|
|
79
80
|
*/
|
|
80
|
-
variationsToFetch() { return
|
|
81
|
+
variationsToFetch() { return acceptHtmlVariation; }
|
|
81
82
|
/**
|
|
82
83
|
* Inherit components from another page with matching area
|
|
83
84
|
*
|