@dosgato/templating 1.1.13 → 1.1.15
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 +5 -0
- package/dist/apitemplate.js +3 -3
- package/dist/links.d.ts +1 -0
- package/dist/stopwords.d.ts +1 -0
- package/dist/stopwords.js +3 -0
- package/package.json +1 -1
package/dist/apitemplate.d.ts
CHANGED
|
@@ -228,6 +228,11 @@ export interface APIPageTemplate<DataType extends PageData = any> extends APITem
|
|
|
228
228
|
* nested containers are in between.
|
|
229
229
|
*/
|
|
230
230
|
disallowComponents?: string[];
|
|
231
|
+
/**
|
|
232
|
+
* A page template can specify that it belongs to a certain theme. This is just informational and can be used
|
|
233
|
+
* by the front end to group templates by theme. It has no bearing on the actual rendering of the page.
|
|
234
|
+
*/
|
|
235
|
+
templateTheme?: string;
|
|
231
236
|
}
|
|
232
237
|
export interface APIDataTemplate<DataType extends DataData = any> extends APITemplate<DataType> {
|
|
233
238
|
type: 'data';
|
package/dist/apitemplate.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { stopwordSet } from './stopwords.js';
|
|
2
2
|
export var ValidationMessageType;
|
|
3
3
|
(function (ValidationMessageType) {
|
|
4
4
|
ValidationMessageType["ERROR"] = "error";
|
|
@@ -13,9 +13,9 @@ export function getKeywords(text, options) {
|
|
|
13
13
|
if (!text)
|
|
14
14
|
return [];
|
|
15
15
|
return Array.from(new Set(text
|
|
16
|
-
.toLocaleLowerCase()
|
|
17
16
|
.normalize('NFD').replace(/\p{Diacritic}/gu, '')
|
|
17
|
+
.toLocaleLowerCase()
|
|
18
18
|
.split(/[^\w-]+/)
|
|
19
19
|
.flatMap(word => word.includes('-') ? word.split('-').concat(word.replace('-', '')) : [word])
|
|
20
|
-
.filter(word => word.length > 2 && (options?.stopwords === false || !
|
|
20
|
+
.filter(word => word.length > 2 && (options?.stopwords === false || !stopwordSet.has(word)) && isNaN(Number(word)))));
|
|
21
21
|
}
|
package/dist/links.d.ts
CHANGED
package/dist/stopwords.d.ts
CHANGED
package/dist/stopwords.js
CHANGED
|
@@ -141,6 +141,8 @@ export const stopwords = {
|
|
|
141
141
|
textarea: true,
|
|
142
142
|
title: true,
|
|
143
143
|
onclick: true,
|
|
144
|
+
www: true,
|
|
145
|
+
com: true,
|
|
144
146
|
// LinkDefinition
|
|
145
147
|
siteId: true,
|
|
146
148
|
path: true,
|
|
@@ -149,3 +151,4 @@ export const stopwords = {
|
|
|
149
151
|
linkId: true,
|
|
150
152
|
url: true
|
|
151
153
|
};
|
|
154
|
+
export const stopwordSet = new Set(Object.keys(stopwords));
|