@paroicms/content-loading-plugin 0.22.0 → 0.24.0

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.
@@ -1,4 +1,4 @@
1
- import { parseNodelId } from "@paroicms/public-anywhere-lib";
1
+ import { parseLNodeId } from "@paroicms/public-anywhere-lib";
2
2
  export async function makeSearch(service, httpContext, query) {
3
3
  const { q, language, limit, start, tpl } = query;
4
4
  const words = q.split(/\s+/).filter((word) => word.length >= 2);
@@ -14,7 +14,7 @@ export async function makeSearch(service, httpContext, query) {
14
14
  }
15
15
  export async function getPartials(service, httpContext, params, labeledBy) {
16
16
  const documentId = params.childrenOf;
17
- const parentId = parseNodelId(documentId);
17
+ const parentId = parseLNodeId(documentId);
18
18
  const payload = {
19
19
  templateName: params.template,
20
20
  documentId,
@@ -1,8 +1,8 @@
1
- import { readFileSync } from "node:fs";
2
- import { dirname, join } from "node:path";
3
- import { isDef, parseNodelId } from "@paroicms/public-anywhere-lib";
1
+ import { isDef, parseLNodeId } from "@paroicms/public-anywhere-lib";
4
2
  import { escapeHtml, makeStylesheetLinkAsyncTag, resolveModuleDirectory, } from "@paroicms/public-server-lib";
5
3
  import { type } from "arktype";
4
+ import { readFileSync } from "node:fs";
5
+ import { dirname, join } from "node:path";
6
6
  import { getPartials, makeSearch } from "./controller.js";
7
7
  import { PartialsQueryAT, SearchTextOptionsUrlQueryAT } from "./formatters.js";
8
8
  const projectDir = resolveModuleDirectory(import.meta.url, { parent: true });
@@ -39,7 +39,7 @@ const plugin = {
39
39
  const input = PartialsQueryAT.assert(req.query);
40
40
  const { labeledById, fieldName } = input;
41
41
  const termNodeId = isDef(labeledById) ? toNodeId(labeledById) : undefined;
42
- const { language } = parseNodelId(input.childrenOf);
42
+ const { language } = parseLNodeId(input.childrenOf);
43
43
  const renderService = await service.openRenderingService({
44
44
  language,
45
45
  urlLike: relativePath,
@@ -59,7 +59,7 @@ const plugin = {
59
59
  });
60
60
  },
61
61
  };
62
- function toNodeId(nodeOrNodelId) {
63
- return nodeOrNodelId.indexOf(":") !== -1 ? parseNodelId(nodeOrNodelId).nodeId : nodeOrNodelId;
62
+ function toNodeId(nodeOrLNodeId) {
63
+ return nodeOrLNodeId.indexOf(":") !== -1 ? parseLNodeId(nodeOrLNodeId).nodeId : nodeOrLNodeId;
64
64
  }
65
65
  export default plugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paroicms/content-loading-plugin",
3
- "version": "0.22.0",
3
+ "version": "0.24.0",
4
4
  "description": "Content loading plugin for ParoiCMS",
5
5
  "keywords": [
6
6
  "paroicms",
@@ -33,8 +33,8 @@
33
33
  "@paroicms/public-server-lib": "0"
34
34
  },
35
35
  "devDependencies": {
36
- "@paroicms/public-anywhere-lib": "0.29.0",
37
- "@paroicms/public-server-lib": "0.38.3",
36
+ "@paroicms/public-anywhere-lib": "0.32.0",
37
+ "@paroicms/public-server-lib": "0.41.0",
38
38
  "@paroicms/tiny-modal": "0.6.0",
39
39
  "@solid-primitives/i18n": "~2.2.1",
40
40
  "@solidjs/router": "~0.15.3",