@paroicms/internal-anywhere-lib 1.19.0 → 1.20.1

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 +1 @@
1
- export declare const PART_DEFAULT_LIST_NAME = "subParts";
1
+ export declare const PART_DEFAULT_LIST_NAME = "_subParts";
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PART_DEFAULT_LIST_NAME = void 0;
4
- exports.PART_DEFAULT_LIST_NAME = "subParts";
4
+ exports.PART_DEFAULT_LIST_NAME = "_subParts";
5
5
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG,UAAU,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG,WAAW,CAAC"}
@@ -1,11 +1,11 @@
1
1
  import type { ScListType } from "@paroicms/public-anywhere-lib";
2
2
  export declare function sortParts(listType: ScListType, parts: {
3
- leafId: string;
3
+ nodeId: string;
4
4
  publishDate: string | null;
5
5
  orderNum: number | null;
6
6
  }[]): void;
7
7
  export declare function sortParts(listType: ScListType, parts: {
8
- leafId: string;
8
+ nodeId: string;
9
9
  publishDate?: string;
10
10
  orderNum?: number;
11
11
  }[]): void;
@@ -18,7 +18,7 @@ function sortParts(listType, parts) {
18
18
  parts.sort((a, b) => {
19
19
  if (a.publishDate && b.publishDate) {
20
20
  if (a.publishDate === b.publishDate) {
21
- if ((0, data_formatters_lib_1.nbVal)(a.leafId) > (0, data_formatters_lib_1.nbVal)(b.leafId))
21
+ if ((0, data_formatters_lib_1.nbVal)(a.nodeId) > (0, data_formatters_lib_1.nbVal)(b.nodeId))
22
22
  return -1;
23
23
  return 1;
24
24
  }
@@ -31,7 +31,7 @@ function sortParts(listType, parts) {
31
31
  parts.sort((a, b) => {
32
32
  if (a.publishDate && b.publishDate) {
33
33
  if (a.publishDate === b.publishDate) {
34
- if ((0, data_formatters_lib_1.nbVal)(a.leafId) > (0, data_formatters_lib_1.nbVal)(b.leafId))
34
+ if ((0, data_formatters_lib_1.nbVal)(a.nodeId) > (0, data_formatters_lib_1.nbVal)(b.nodeId))
35
35
  return -1;
36
36
  return 1;
37
37
  }
@@ -1,11 +1,11 @@
1
- import type { ScDocumentType, ScFTextFieldType, ScFieldType, ScLeafType, ScPartType, ScRegularDocumentType, ScRoutingPointDocumentType, ScSiteSchema } from "@paroicms/public-anywhere-lib";
2
- export declare function getLeafTypeByName(siteSchema: ScSiteSchema, typeName: string): ScLeafType;
1
+ import type { ScDocumentType, ScFTextFieldType, ScFieldType, ScNodeType, ScPartType, ScRegularDocumentType, ScRoutingPointDocumentType, ScSiteSchema } from "@paroicms/public-anywhere-lib";
2
+ export declare function getNodeTypeByName(siteSchema: ScSiteSchema, typeName: string): ScNodeType;
3
3
  export declare function getDocumentTypeByName(siteSchema: ScSiteSchema, typeName: string): ScDocumentType;
4
4
  export declare function getPartTypeByName(siteSchema: ScSiteSchema, typeName: string): ScPartType;
5
5
  export declare function getRoutingPointDocumentTypes(siteSchema: ScSiteSchema): ScRoutingPointDocumentType[];
6
6
  export declare function regularChildDocumentTypesOf(siteSchema: ScSiteSchema, parentTypeName: string): ScRegularDocumentType[];
7
- export declare function getLeafTypeByDashedName(siteSchema: ScSiteSchema, dashedName: string, kind: "document"): ScDocumentType | undefined;
8
- export declare function getLeafTypeByDashedName(siteSchema: ScSiteSchema, dashedName: string, kind: "part"): ScPartType | undefined;
7
+ export declare function getNodeTypeByDashedName(siteSchema: ScSiteSchema, dashedName: string, kind: "document"): ScDocumentType | undefined;
8
+ export declare function getNodeTypeByDashedName(siteSchema: ScSiteSchema, dashedName: string, kind: "part"): ScPartType | undefined;
9
9
  export declare function getMediaLimitPerDocument(siteSchema: ScSiteSchema, documentType: ScDocumentType): number | undefined;
10
10
  export declare function getMediaLimitPerPart(siteSchema: ScSiteSchema, partType: ScPartType): number | undefined;
11
11
  export declare function isFTextFieldType(fieldType: ScFieldType): fieldType is ScFTextFieldType;
@@ -1,45 +1,45 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getLeafTypeByName = getLeafTypeByName;
3
+ exports.getNodeTypeByName = getNodeTypeByName;
4
4
  exports.getDocumentTypeByName = getDocumentTypeByName;
5
5
  exports.getPartTypeByName = getPartTypeByName;
6
6
  exports.getRoutingPointDocumentTypes = getRoutingPointDocumentTypes;
7
7
  exports.regularChildDocumentTypesOf = regularChildDocumentTypesOf;
8
- exports.getLeafTypeByDashedName = getLeafTypeByDashedName;
8
+ exports.getNodeTypeByDashedName = getNodeTypeByDashedName;
9
9
  exports.getMediaLimitPerDocument = getMediaLimitPerDocument;
10
10
  exports.getMediaLimitPerPart = getMediaLimitPerPart;
11
11
  exports.isFTextFieldType = isFTextFieldType;
12
12
  exports.documentTypeHasData = documentTypeHasData;
13
- function getLeafTypeByName(siteSchema, typeName) {
14
- const leafType = siteSchema.leafTypes[typeName];
15
- if (!leafType)
16
- throw new Error(`unknown leaf type '${typeName}'`);
17
- return leafType;
13
+ function getNodeTypeByName(siteSchema, typeName) {
14
+ const nodeType = siteSchema.nodeTypes[typeName];
15
+ if (!nodeType)
16
+ throw new Error(`unknown node type '${typeName}'`);
17
+ return nodeType;
18
18
  }
19
19
  function getDocumentTypeByName(siteSchema, typeName) {
20
- const leafType = siteSchema.leafTypes[typeName];
21
- if (!leafType || leafType.kind !== "document") {
20
+ const nodeType = siteSchema.nodeTypes[typeName];
21
+ if (!nodeType || nodeType.kind !== "document") {
22
22
  throw new Error(`Unknown document type '${typeName}'`);
23
23
  }
24
- return leafType;
24
+ return nodeType;
25
25
  }
26
26
  function getPartTypeByName(siteSchema, typeName) {
27
- const leafType = siteSchema.leafTypes[typeName];
28
- if (!leafType || leafType.kind !== "part") {
27
+ const nodeType = siteSchema.nodeTypes[typeName];
28
+ if (!nodeType || nodeType.kind !== "part") {
29
29
  throw new Error(`Unknown part type '${typeName}'`);
30
30
  }
31
- return leafType;
31
+ return nodeType;
32
32
  }
33
33
  function getRoutingPointDocumentTypes(siteSchema) {
34
- return Object.values(siteSchema.leafTypes).filter((item) => item.kind === "document" && item.isRoutingPoint);
34
+ return Object.values(siteSchema.nodeTypes).filter((item) => item.kind === "document" && item.isRoutingPoint);
35
35
  }
36
36
  function regularChildDocumentTypesOf(siteSchema, parentTypeName) {
37
37
  return (getDocumentTypeByName(siteSchema, parentTypeName)
38
38
  .children?.map((typeName) => getDocumentTypeByName(siteSchema, typeName))
39
- .filter((leafType) => !leafType.isRoutingPoint) ?? []);
39
+ .filter((nodeType) => !nodeType.isRoutingPoint) ?? []);
40
40
  }
41
- function getLeafTypeByDashedName(siteSchema, dashedName, kind) {
42
- return Object.values(siteSchema.leafTypes).find((item) => item.kind === kind && item.dashedName === dashedName);
41
+ function getNodeTypeByDashedName(siteSchema, dashedName, kind) {
42
+ return Object.values(siteSchema.nodeTypes).find((item) => item.kind === kind && item.dashedName === dashedName);
43
43
  }
44
44
  function getMediaLimitPerDocument(siteSchema, documentType) {
45
45
  const policyName = documentType.mediaPolicy;
@@ -1 +1 @@
1
- export declare const PART_DEFAULT_LIST_NAME = "subParts";
1
+ export declare const PART_DEFAULT_LIST_NAME = "_subParts";
@@ -1,2 +1,2 @@
1
- export const PART_DEFAULT_LIST_NAME = "subParts";
1
+ export const PART_DEFAULT_LIST_NAME = "_subParts";
2
2
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,UAAU,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC"}
@@ -1,11 +1,11 @@
1
1
  import type { ScListType } from "@paroicms/public-anywhere-lib";
2
2
  export declare function sortParts(listType: ScListType, parts: {
3
- leafId: string;
3
+ nodeId: string;
4
4
  publishDate: string | null;
5
5
  orderNum: number | null;
6
6
  }[]): void;
7
7
  export declare function sortParts(listType: ScListType, parts: {
8
- leafId: string;
8
+ nodeId: string;
9
9
  publishDate?: string;
10
10
  orderNum?: number;
11
11
  }[]): void;
@@ -15,7 +15,7 @@ export function sortParts(listType, parts) {
15
15
  parts.sort((a, b) => {
16
16
  if (a.publishDate && b.publishDate) {
17
17
  if (a.publishDate === b.publishDate) {
18
- if (nbVal(a.leafId) > nbVal(b.leafId))
18
+ if (nbVal(a.nodeId) > nbVal(b.nodeId))
19
19
  return -1;
20
20
  return 1;
21
21
  }
@@ -28,7 +28,7 @@ export function sortParts(listType, parts) {
28
28
  parts.sort((a, b) => {
29
29
  if (a.publishDate && b.publishDate) {
30
30
  if (a.publishDate === b.publishDate) {
31
- if (nbVal(a.leafId) > nbVal(b.leafId))
31
+ if (nbVal(a.nodeId) > nbVal(b.nodeId))
32
32
  return -1;
33
33
  return 1;
34
34
  }
@@ -1,11 +1,11 @@
1
- import type { ScDocumentType, ScFTextFieldType, ScFieldType, ScLeafType, ScPartType, ScRegularDocumentType, ScRoutingPointDocumentType, ScSiteSchema } from "@paroicms/public-anywhere-lib";
2
- export declare function getLeafTypeByName(siteSchema: ScSiteSchema, typeName: string): ScLeafType;
1
+ import type { ScDocumentType, ScFTextFieldType, ScFieldType, ScNodeType, ScPartType, ScRegularDocumentType, ScRoutingPointDocumentType, ScSiteSchema } from "@paroicms/public-anywhere-lib";
2
+ export declare function getNodeTypeByName(siteSchema: ScSiteSchema, typeName: string): ScNodeType;
3
3
  export declare function getDocumentTypeByName(siteSchema: ScSiteSchema, typeName: string): ScDocumentType;
4
4
  export declare function getPartTypeByName(siteSchema: ScSiteSchema, typeName: string): ScPartType;
5
5
  export declare function getRoutingPointDocumentTypes(siteSchema: ScSiteSchema): ScRoutingPointDocumentType[];
6
6
  export declare function regularChildDocumentTypesOf(siteSchema: ScSiteSchema, parentTypeName: string): ScRegularDocumentType[];
7
- export declare function getLeafTypeByDashedName(siteSchema: ScSiteSchema, dashedName: string, kind: "document"): ScDocumentType | undefined;
8
- export declare function getLeafTypeByDashedName(siteSchema: ScSiteSchema, dashedName: string, kind: "part"): ScPartType | undefined;
7
+ export declare function getNodeTypeByDashedName(siteSchema: ScSiteSchema, dashedName: string, kind: "document"): ScDocumentType | undefined;
8
+ export declare function getNodeTypeByDashedName(siteSchema: ScSiteSchema, dashedName: string, kind: "part"): ScPartType | undefined;
9
9
  export declare function getMediaLimitPerDocument(siteSchema: ScSiteSchema, documentType: ScDocumentType): number | undefined;
10
10
  export declare function getMediaLimitPerPart(siteSchema: ScSiteSchema, partType: ScPartType): number | undefined;
11
11
  export declare function isFTextFieldType(fieldType: ScFieldType): fieldType is ScFTextFieldType;
@@ -1,33 +1,33 @@
1
- export function getLeafTypeByName(siteSchema, typeName) {
2
- const leafType = siteSchema.leafTypes[typeName];
3
- if (!leafType)
4
- throw new Error(`unknown leaf type '${typeName}'`);
5
- return leafType;
1
+ export function getNodeTypeByName(siteSchema, typeName) {
2
+ const nodeType = siteSchema.nodeTypes[typeName];
3
+ if (!nodeType)
4
+ throw new Error(`unknown node type '${typeName}'`);
5
+ return nodeType;
6
6
  }
7
7
  export function getDocumentTypeByName(siteSchema, typeName) {
8
- const leafType = siteSchema.leafTypes[typeName];
9
- if (!leafType || leafType.kind !== "document") {
8
+ const nodeType = siteSchema.nodeTypes[typeName];
9
+ if (!nodeType || nodeType.kind !== "document") {
10
10
  throw new Error(`Unknown document type '${typeName}'`);
11
11
  }
12
- return leafType;
12
+ return nodeType;
13
13
  }
14
14
  export function getPartTypeByName(siteSchema, typeName) {
15
- const leafType = siteSchema.leafTypes[typeName];
16
- if (!leafType || leafType.kind !== "part") {
15
+ const nodeType = siteSchema.nodeTypes[typeName];
16
+ if (!nodeType || nodeType.kind !== "part") {
17
17
  throw new Error(`Unknown part type '${typeName}'`);
18
18
  }
19
- return leafType;
19
+ return nodeType;
20
20
  }
21
21
  export function getRoutingPointDocumentTypes(siteSchema) {
22
- return Object.values(siteSchema.leafTypes).filter((item) => item.kind === "document" && item.isRoutingPoint);
22
+ return Object.values(siteSchema.nodeTypes).filter((item) => item.kind === "document" && item.isRoutingPoint);
23
23
  }
24
24
  export function regularChildDocumentTypesOf(siteSchema, parentTypeName) {
25
25
  return (getDocumentTypeByName(siteSchema, parentTypeName)
26
26
  .children?.map((typeName) => getDocumentTypeByName(siteSchema, typeName))
27
- .filter((leafType) => !leafType.isRoutingPoint) ?? []);
27
+ .filter((nodeType) => !nodeType.isRoutingPoint) ?? []);
28
28
  }
29
- export function getLeafTypeByDashedName(siteSchema, dashedName, kind) {
30
- return Object.values(siteSchema.leafTypes).find((item) => item.kind === kind && item.dashedName === dashedName);
29
+ export function getNodeTypeByDashedName(siteSchema, dashedName, kind) {
30
+ return Object.values(siteSchema.nodeTypes).find((item) => item.kind === kind && item.dashedName === dashedName);
31
31
  }
32
32
  export function getMediaLimitPerDocument(siteSchema, documentType) {
33
33
  const policyName = documentType.mediaPolicy;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paroicms/internal-anywhere-lib",
3
- "version": "1.19.0",
3
+ "version": "1.20.1",
4
4
  "description": "Front lib for Paroi CMS.",
5
5
  "author": "Paroi Team",
6
6
  "keywords": [
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@paroi/data-formatters-lib": "~0.4.0",
31
- "@paroicms/public-anywhere-lib": "0.11.0"
31
+ "@paroicms/public-anywhere-lib": "0.13.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "rimraf": "~6.0.1",