@dosgato/templating 1.1.14 → 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.
@@ -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';
@@ -1,4 +1,4 @@
1
- import { stopwords } from './stopwords.js';
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 || !stopwords[word]) && isNaN(Number(word)))));
20
+ .filter(word => word.length > 2 && (options?.stopwords === false || !stopwordSet.has(word)) && isNaN(Number(word)))));
21
21
  }
@@ -1 +1,2 @@
1
1
  export declare const stopwords: Record<string, boolean>;
2
+ export declare const stopwordSet: Set<string>;
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));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosgato/templating",
3
- "version": "1.1.14",
3
+ "version": "1.1.15",
4
4
  "description": "A library to support building templates for dosgato CMS.",
5
5
  "type": "module",
6
6
  "exports": {