@dosgato/templating 0.0.111 → 0.0.113
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/apitemplate.d.ts +11 -0
- package/dist/links.d.ts +1 -0
- package/dist/render.d.ts +9 -1
- package/dist/render.js +7 -0
- package/package.json +1 -1
package/dist/apitemplate.d.ts
CHANGED
|
@@ -80,6 +80,17 @@ export interface APITemplate<DataType> {
|
|
|
80
80
|
* by this function will also be scanned for links.
|
|
81
81
|
*/
|
|
82
82
|
getFulltext?: FulltextGatheringFn<DataType>;
|
|
83
|
+
/**
|
|
84
|
+
* The available component list in the main content area can get very long, among others. Therefore, each
|
|
85
|
+
* template may set a displayCategory and any templates that share a displayCategory will be grouped together
|
|
86
|
+
* underneath one tab when a user is presented with a choice of template.
|
|
87
|
+
*
|
|
88
|
+
* If a displayCategory is not set, there will be a default category like 'Standard'. If only one category
|
|
89
|
+
* exists for a group of available components, the tabs will not be shown at all. This means you do not have
|
|
90
|
+
* to bother setting displayCategory for minor cases like different kinds of slides in a slider (until there
|
|
91
|
+
* are so many that it becomes a good idea!).
|
|
92
|
+
*/
|
|
93
|
+
displayCategory?: string;
|
|
83
94
|
}
|
|
84
95
|
export interface APIComponentTemplate<DataType extends ComponentData = any> extends APITemplate<DataType> {
|
|
85
96
|
type: 'component';
|
package/dist/links.d.ts
CHANGED
package/dist/render.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { ContextBase, DataData, PageData, PageRecord, PageRecordOptionalData } from './component.js';
|
|
2
2
|
import { AssetFolderLink, AssetLink, DataFolderLink, DataLink, LinkDefinition, PageLink } from './links.js';
|
|
3
|
+
/**
|
|
4
|
+
* Safely encapsulates `content` in header tags based on the `ctx` context passed and adds any passed `attributes` to the header tagging.
|
|
5
|
+
* If the headerLevel passed through `ctx` is outside the range of 1..6 the header tag generated is normalized to the nearest value of 1 or 6.
|
|
6
|
+
* @returns An empty string if content is blank, undefined, or null - else an h<1..6> encapsulated content with attributes added to the encapsulating tag.
|
|
7
|
+
* @example ```
|
|
8
|
+
* printHeader(this.renderCtx, htmlEncode(this.data.title), {class: 'some-extra-cssclass'})
|
|
9
|
+
* ``` */
|
|
3
10
|
export declare function printHeader(ctx: ContextBase, content: string | undefined | null, attributes?: Record<string, string>): string;
|
|
4
11
|
export declare function advanceHeader<T extends ContextBase>(ctx: T, content: string | undefined | null): T;
|
|
5
12
|
export interface PictureResize {
|
|
@@ -160,7 +167,8 @@ export interface APIClient {
|
|
|
160
167
|
* Return pages beneath this path
|
|
161
168
|
*
|
|
162
169
|
* For instance, if you set this to '/site1' you will get back ['/site1/about',
|
|
163
|
-
* '/site1/history', '/site1/history/traditions', ...etc]
|
|
170
|
+
* '/site1/history', '/site1/history/traditions', ...etc] but you will NOT get
|
|
171
|
+
* back the '/site1' page.
|
|
164
172
|
*
|
|
165
173
|
* If you do not set `beneath`, you will get back an array that contains only
|
|
166
174
|
* the root page of the pagetree you are in.
|
package/dist/render.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { htmlEncode, isBlank, isNotEmpty } from 'txstate-utils';
|
|
2
|
+
/**
|
|
3
|
+
* Safely encapsulates `content` in header tags based on the `ctx` context passed and adds any passed `attributes` to the header tagging.
|
|
4
|
+
* If the headerLevel passed through `ctx` is outside the range of 1..6 the header tag generated is normalized to the nearest value of 1 or 6.
|
|
5
|
+
* @returns An empty string if content is blank, undefined, or null - else an h<1..6> encapsulated content with attributes added to the encapsulating tag.
|
|
6
|
+
* @example ```
|
|
7
|
+
* printHeader(this.renderCtx, htmlEncode(this.data.title), {class: 'some-extra-cssclass'})
|
|
8
|
+
* ``` */
|
|
2
9
|
export function printHeader(ctx, content, attributes) {
|
|
3
10
|
if (isBlank(content))
|
|
4
11
|
return '';
|