@paroicms/internal-anywhere-lib 1.21.0 → 1.22.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.
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/package.json +9 -14
- package/dist-cjs/constants.js +0 -5
- package/dist-cjs/constants.js.map +0 -1
- package/dist-cjs/index.d.ts +0 -5
- package/dist-cjs/index.js +0 -22
- package/dist-cjs/index.js.map +0 -1
- package/dist-cjs/number-localization.js +0 -29
- package/dist-cjs/number-localization.js.map +0 -1
- package/dist-cjs/parts.helper.js +0 -47
- package/dist-cjs/parts.helper.js.map +0 -1
- package/dist-cjs/site-schema-helpers.js +0 -68
- package/dist-cjs/site-schema-helpers.js.map +0 -1
- package/dist-cjs/time-with-unit.helpers.js +0 -18
- package/dist-cjs/time-with-unit.helpers.js.map +0 -1
- package/dist-mjs/constants.d.ts +0 -1
- package/dist-mjs/index.d.ts +0 -5
- package/dist-mjs/index.js +0 -6
- package/dist-mjs/index.js.map +0 -1
- package/dist-mjs/number-localization.d.ts +0 -6
- package/dist-mjs/parts.helper.d.ts +0 -11
- package/dist-mjs/site-schema-helpers.d.ts +0 -12
- package/dist-mjs/time-with-unit.helpers.d.ts +0 -6
- /package/{dist-cjs → dist}/constants.d.ts +0 -0
- /package/{dist-mjs → dist}/constants.js +0 -0
- /package/{dist-mjs → dist}/constants.js.map +0 -0
- /package/{dist-cjs → dist}/number-localization.d.ts +0 -0
- /package/{dist-mjs → dist}/number-localization.js +0 -0
- /package/{dist-mjs → dist}/number-localization.js.map +0 -0
- /package/{dist-cjs → dist}/parts.helper.d.ts +0 -0
- /package/{dist-mjs → dist}/parts.helper.js +0 -0
- /package/{dist-mjs → dist}/parts.helper.js.map +0 -0
- /package/{dist-cjs → dist}/site-schema-helpers.d.ts +0 -0
- /package/{dist-mjs → dist}/site-schema-helpers.js +0 -0
- /package/{dist-mjs → dist}/site-schema-helpers.js.map +0 -0
- /package/{dist-cjs → dist}/time-with-unit.helpers.d.ts +0 -0
- /package/{dist-mjs → dist}/time-with-unit.helpers.js +0 -0
- /package/{dist-mjs → dist}/time-with-unit.helpers.js.map +0 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paroicms/internal-anywhere-lib",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0",
|
|
4
4
|
"description": "Front lib for Paroi CMS.",
|
|
5
5
|
"author": "Paroi Team",
|
|
6
6
|
"keywords": [
|
|
@@ -12,23 +12,19 @@
|
|
|
12
12
|
"directory": "packages/internal-anywhere-lib"
|
|
13
13
|
},
|
|
14
14
|
"license": "MIT",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"types": "dist
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "dist/index.js",
|
|
17
|
+
"types": "dist/index.d.ts",
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "
|
|
20
|
-
"clear": "rimraf dist
|
|
21
|
-
"
|
|
22
|
-
"tsc:mjs": "tsc --project ./tsconfig.mjs.json",
|
|
23
|
-
"tsc:dev-cjs": "tsc --watch --preserveWatchOutput --project ./tsconfig.cjs.json",
|
|
24
|
-
"tsc:dev-mjs": "tsc --watch --preserveWatchOutput --project ./tsconfig.mjs.json",
|
|
25
|
-
"dev": "turbo dev",
|
|
19
|
+
"build": "tsc",
|
|
20
|
+
"clear": "rimraf dist/*",
|
|
21
|
+
"dev": "tsc --watch --preserveWatchOutput",
|
|
26
22
|
"test": "vitest",
|
|
27
23
|
"test:run": "vitest run"
|
|
28
24
|
},
|
|
29
25
|
"dependencies": {
|
|
30
26
|
"@paroi/data-formatters-lib": "~0.4.0",
|
|
31
|
-
"@paroicms/public-anywhere-lib": "0.
|
|
27
|
+
"@paroicms/public-anywhere-lib": "0.15.0"
|
|
32
28
|
},
|
|
33
29
|
"devDependencies": {
|
|
34
30
|
"rimraf": "~6.0.1",
|
|
@@ -36,8 +32,7 @@
|
|
|
36
32
|
"vitest": "~3.0.2"
|
|
37
33
|
},
|
|
38
34
|
"files": [
|
|
39
|
-
"dist
|
|
40
|
-
"dist-mjs",
|
|
35
|
+
"dist",
|
|
41
36
|
"types"
|
|
42
37
|
]
|
|
43
38
|
}
|
package/dist-cjs/constants.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG,WAAW,CAAC"}
|
package/dist-cjs/index.d.ts
DELETED
package/dist-cjs/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./constants"), exports);
|
|
18
|
-
__exportStar(require("./number-localization"), exports);
|
|
19
|
-
__exportStar(require("./parts.helper"), exports);
|
|
20
|
-
__exportStar(require("./site-schema-helpers"), exports);
|
|
21
|
-
__exportStar(require("./time-with-unit.helpers"), exports);
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
package/dist-cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,wDAAsC;AACtC,iDAA+B;AAC/B,wDAAsC;AACtC,2DAAyC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NumberLocalization = void 0;
|
|
4
|
-
class NumberLocalization {
|
|
5
|
-
#numberFormat;
|
|
6
|
-
constructor(locale) {
|
|
7
|
-
this.#numberFormat = new Intl.NumberFormat(locale, {
|
|
8
|
-
minimumFractionDigits: 0,
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
parse(val) {
|
|
12
|
-
const parts = this.#numberFormat.formatToParts(1234.5);
|
|
13
|
-
const group = parts.find((d) => d.type === "group")?.value;
|
|
14
|
-
const decimal = parts.find((d) => d.type === "decimal")?.value;
|
|
15
|
-
if (!group)
|
|
16
|
-
throw new Error("group not found");
|
|
17
|
-
if (!decimal)
|
|
18
|
-
throw new Error("group not found");
|
|
19
|
-
return val
|
|
20
|
-
.trim()
|
|
21
|
-
.replace(new RegExp(group, "g"), "")
|
|
22
|
-
.replace(decimal === "." ? /\./ : new RegExp(decimal), ".");
|
|
23
|
-
}
|
|
24
|
-
format(val) {
|
|
25
|
-
return this.#numberFormat.format(val);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.NumberLocalization = NumberLocalization;
|
|
29
|
-
//# sourceMappingURL=number-localization.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number-localization.js","sourceRoot":"","sources":["../src/number-localization.ts"],"names":[],"mappings":";;;AAAA,MAAa,kBAAkB;IAC7B,aAAa,CAAoB;IAEjC,YAAY,MAAc;QACxB,IAAI,CAAC,aAAa,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;YACjD,qBAAqB,EAAE,CAAC;SACzB,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,GAAW;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACvD,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,EAAE,KAAK,CAAC;QAC3D,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,EAAE,KAAK,CAAC;QAE/D,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAEjD,OAAO,GAAG;aACP,IAAI,EAAE;aACN,OAAO,CAAC,IAAI,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;aACnC,OAAO,CAAC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,CAAC,GAAW;QAChB,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;CACF;AA1BD,gDA0BC"}
|
package/dist-cjs/parts.helper.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sortParts = sortParts;
|
|
4
|
-
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
5
|
-
function sortParts(listType, parts) {
|
|
6
|
-
if (listType.orderBy === "manual") {
|
|
7
|
-
parts.sort((a, b) => {
|
|
8
|
-
if (a.orderNum === b.orderNum)
|
|
9
|
-
return 0;
|
|
10
|
-
if (a.orderNum === null || a.orderNum === undefined)
|
|
11
|
-
return -1;
|
|
12
|
-
if (b.orderNum === null || b.orderNum === undefined)
|
|
13
|
-
return 1;
|
|
14
|
-
return a.orderNum - b.orderNum;
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
else if (includesOrderBy(listType.orderBy, ["publishDate", "desc"])) {
|
|
18
|
-
parts.sort((a, b) => {
|
|
19
|
-
if (a.publishDate && b.publishDate) {
|
|
20
|
-
if (a.publishDate === b.publishDate) {
|
|
21
|
-
if ((0, data_formatters_lib_1.nbVal)(a.nodeId) > (0, data_formatters_lib_1.nbVal)(b.nodeId))
|
|
22
|
-
return -1;
|
|
23
|
-
return 1;
|
|
24
|
-
}
|
|
25
|
-
return new Date(b.publishDate).getTime() - new Date(a.publishDate).getTime();
|
|
26
|
-
}
|
|
27
|
-
return 0;
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
else if (includesOrderBy(listType.orderBy, ["publishDate", "asc"])) {
|
|
31
|
-
parts.sort((a, b) => {
|
|
32
|
-
if (a.publishDate && b.publishDate) {
|
|
33
|
-
if (a.publishDate === b.publishDate) {
|
|
34
|
-
if ((0, data_formatters_lib_1.nbVal)(a.nodeId) > (0, data_formatters_lib_1.nbVal)(b.nodeId))
|
|
35
|
-
return -1;
|
|
36
|
-
return 1;
|
|
37
|
-
}
|
|
38
|
-
return new Date(a.publishDate).getTime() - new Date(b.publishDate).getTime();
|
|
39
|
-
}
|
|
40
|
-
return 0;
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function includesOrderBy(orderBy, valueToCheck) {
|
|
45
|
-
return orderBy.some((item) => item[0] === valueToCheck[0] && item[1] === valueToCheck[1]);
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=parts.helper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parts.helper.js","sourceRoot":"","sources":["../src/parts.helper.ts"],"names":[],"mappings":";;AAWA,8BAkCC;AA7CD,oEAAmD;AAWnD,SAAgB,SAAS,CACvB,QAAoB,EACpB,KAAkF;IAElF,IAAI,QAAQ,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YAClB,IAAI,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ;gBAAE,OAAO,CAAC,CAAC;YACxC,IAAI,CAAC,CAAC,QAAQ,KAAK,IAAI,IAAI,CAAC,CAAC,QAAQ,KAAK,SAAS;gBAAE,OAAO,CAAC,CAAC,CAAC;YAC/D,IAAI,CAAC,CAAC,QAAQ,KAAK,IAAI,IAAI,CAAC,CAAC,QAAQ,KAAK,SAAS;gBAAE,OAAO,CAAC,CAAC;YAC9D,OAAO,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC;SAAM,IAAI,eAAe,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;QACtE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YAClB,IAAI,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;gBACnC,IAAI,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAA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C,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNodeTypeByName = getNodeTypeByName;
|
|
4
|
-
exports.getDocumentTypeByName = getDocumentTypeByName;
|
|
5
|
-
exports.getPartTypeByName = getPartTypeByName;
|
|
6
|
-
exports.getRoutingPointDocumentTypes = getRoutingPointDocumentTypes;
|
|
7
|
-
exports.regularChildDocumentTypesOf = regularChildDocumentTypesOf;
|
|
8
|
-
exports.getNodeTypeByDashedName = getNodeTypeByDashedName;
|
|
9
|
-
exports.getMediaLimitPerDocument = getMediaLimitPerDocument;
|
|
10
|
-
exports.getMediaLimitPerPart = getMediaLimitPerPart;
|
|
11
|
-
exports.isFTextFieldType = isFTextFieldType;
|
|
12
|
-
exports.documentTypeHasData = documentTypeHasData;
|
|
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
|
-
}
|
|
19
|
-
function getDocumentTypeByName(siteSchema, typeName) {
|
|
20
|
-
const nodeType = siteSchema.nodeTypes[typeName];
|
|
21
|
-
if (!nodeType || nodeType.kind !== "document") {
|
|
22
|
-
throw new Error(`Unknown document type '${typeName}'`);
|
|
23
|
-
}
|
|
24
|
-
return nodeType;
|
|
25
|
-
}
|
|
26
|
-
function getPartTypeByName(siteSchema, typeName) {
|
|
27
|
-
const nodeType = siteSchema.nodeTypes[typeName];
|
|
28
|
-
if (!nodeType || nodeType.kind !== "part") {
|
|
29
|
-
throw new Error(`Unknown part type '${typeName}'`);
|
|
30
|
-
}
|
|
31
|
-
return nodeType;
|
|
32
|
-
}
|
|
33
|
-
function getRoutingPointDocumentTypes(siteSchema) {
|
|
34
|
-
return Object.values(siteSchema.nodeTypes).filter((item) => item.kind === "document" && item.isRoutingPoint);
|
|
35
|
-
}
|
|
36
|
-
function regularChildDocumentTypesOf(siteSchema, parentTypeName) {
|
|
37
|
-
return (getDocumentTypeByName(siteSchema, parentTypeName)
|
|
38
|
-
.children?.map((typeName) => getDocumentTypeByName(siteSchema, typeName))
|
|
39
|
-
.filter((nodeType) => !nodeType.isRoutingPoint) ?? []);
|
|
40
|
-
}
|
|
41
|
-
function getNodeTypeByDashedName(siteSchema, dashedName, kind) {
|
|
42
|
-
return Object.values(siteSchema.nodeTypes).find((item) => item.kind === kind && item.dashedName === dashedName);
|
|
43
|
-
}
|
|
44
|
-
function getMediaLimitPerDocument(siteSchema, documentType) {
|
|
45
|
-
const policyName = documentType.mediaPolicy;
|
|
46
|
-
if (policyName) {
|
|
47
|
-
const val = siteSchema.mediaPolicies[policyName].mediaLimitPerDocument;
|
|
48
|
-
if (val !== undefined)
|
|
49
|
-
return val;
|
|
50
|
-
}
|
|
51
|
-
return siteSchema.mediaPolicies.default.mediaLimitPerDocument;
|
|
52
|
-
}
|
|
53
|
-
function getMediaLimitPerPart(siteSchema, partType) {
|
|
54
|
-
const policyName = partType.mediaPolicy;
|
|
55
|
-
if (policyName) {
|
|
56
|
-
const val = siteSchema.mediaPolicies[policyName].mediaLimitPerPart;
|
|
57
|
-
if (val !== undefined)
|
|
58
|
-
return val;
|
|
59
|
-
}
|
|
60
|
-
return siteSchema.mediaPolicies.default.mediaLimitPerPart;
|
|
61
|
-
}
|
|
62
|
-
function isFTextFieldType(fieldType) {
|
|
63
|
-
return fieldType.dataType === "quillDelta" || fieldType.dataType === "html";
|
|
64
|
-
}
|
|
65
|
-
function documentTypeHasData(documentType) {
|
|
66
|
-
return !documentType.isRoutingPoint || !documentType.redirectTo;
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=site-schema-helpers.js.map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E,IAAI,GAAG,KAAK,SAAS;YAAE,OAAO,GAAG,CAAC;IACpC,CAAC;IACD,OAAO,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,iBAAiB,CAAC;AAC5D,CAAC;AAED,SAAgB,gBAAgB,CAAC,SAAsB;IACrD,OAAO,SAAS,CAAC,QAAQ,KAAK,YAAY,IAAI,SAAS,CAAC,QAAQ,KAAK,MAAM,CAAC;AAC9E,CAAC;AAED,SAAgB,mBAAmB,CAAC,YAA4B;IAC9D,OAAO,CAAC,YAAY,CAAC,cAAc,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;AAClE,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSameTimeUnit = isSameTimeUnit;
|
|
4
|
-
exports.parseTimeWithUnit = parseTimeWithUnit;
|
|
5
|
-
function isSameTimeUnit(dt, timeUnit) {
|
|
6
|
-
const nowDay = new Date().toISOString().substring(0, 10);
|
|
7
|
-
const dtDay = dt.toISOString().substring(0, 10);
|
|
8
|
-
return nowDay === dtDay;
|
|
9
|
-
}
|
|
10
|
-
function parseTimeWithUnit(timeToIdle) {
|
|
11
|
-
if (!timeToIdle.endsWith("d"))
|
|
12
|
-
throw new Error(`invalid timeToIdle: '${timeToIdle}'`);
|
|
13
|
-
return {
|
|
14
|
-
timeUnit: "day",
|
|
15
|
-
delay: Number(timeToIdle.slice(0, -1)),
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=time-with-unit.helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"time-with-unit.helpers.js","sourceRoot":"","sources":["../src/time-with-unit.helpers.ts"],"names":[],"mappings":";;AAAA,wCAIC;AAOD,8CAMC;AAjBD,SAAgB,cAAc,CAAC,EAAQ,EAAE,QAAe;IACtD,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACzD,MAAM,KAAK,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChD,OAAO,MAAM,KAAK,KAAK,CAAC;AAC1B,CAAC;AAOD,SAAgB,iBAAiB,CAAC,UAAkB;IAClD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,UAAU,GAAG,CAAC,CAAC;IACtF,OAAO;QACL,QAAQ,EAAE,KAAK;QACf,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KACvC,CAAC;AACJ,CAAC"}
|
package/dist-mjs/constants.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const PART_DEFAULT_LIST_NAME = "_subParts";
|
package/dist-mjs/index.d.ts
DELETED
package/dist-mjs/index.js
DELETED
package/dist-mjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ScListType } from "@paroicms/public-anywhere-lib";
|
|
2
|
-
export declare function sortParts(listType: ScListType, parts: {
|
|
3
|
-
nodeId: string;
|
|
4
|
-
publishDate: string | null;
|
|
5
|
-
orderNum: number | null;
|
|
6
|
-
}[]): void;
|
|
7
|
-
export declare function sortParts(listType: ScListType, parts: {
|
|
8
|
-
nodeId: string;
|
|
9
|
-
publishDate?: string;
|
|
10
|
-
orderNum?: number;
|
|
11
|
-
}[]): void;
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
export declare function getDocumentTypeByName(siteSchema: ScSiteSchema, typeName: string): ScDocumentType;
|
|
4
|
-
export declare function getPartTypeByName(siteSchema: ScSiteSchema, typeName: string): ScPartType;
|
|
5
|
-
export declare function getRoutingPointDocumentTypes(siteSchema: ScSiteSchema): ScRoutingPointDocumentType[];
|
|
6
|
-
export declare function regularChildDocumentTypesOf(siteSchema: ScSiteSchema, parentTypeName: string): ScRegularDocumentType[];
|
|
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
|
-
export declare function getMediaLimitPerDocument(siteSchema: ScSiteSchema, documentType: ScDocumentType): number | undefined;
|
|
10
|
-
export declare function getMediaLimitPerPart(siteSchema: ScSiteSchema, partType: ScPartType): number | undefined;
|
|
11
|
-
export declare function isFTextFieldType(fieldType: ScFieldType): fieldType is ScFTextFieldType;
|
|
12
|
-
export declare function documentTypeHasData(documentType: ScDocumentType): boolean;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|