@easy-cms/core 0.48.0 → 0.60.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/chunk-CGVNZUW4.js +534 -0
- package/dist/chunk-K6GTTRN3.js +6 -0
- package/dist/chunk-S2AJVHR4.js +11067 -0
- package/dist/{chunk-C4KJ5TFK.js → chunk-U266LV4M.js} +4 -1
- package/dist/conditions.d.ts +4 -2
- package/dist/conditions.js +1 -1
- package/dist/config-jzFGsNL6.d.ts +3209 -0
- package/dist/handler-CMA1LIq7.d.ts +188 -0
- package/dist/index.d.ts +8 -3831
- package/dist/index.js +54 -11307
- package/dist/internal.d.ts +136 -0
- package/dist/internal.js +310 -0
- package/dist/plugin-EX9OHwR3.d.ts +326 -0
- package/dist/plugin.d.ts +3 -0
- package/dist/plugin.js +34 -0
- package/package.json +9 -1
|
@@ -22,8 +22,9 @@ function matchesCondition(condition, data) {
|
|
|
22
22
|
const value = read(data, condition.field);
|
|
23
23
|
if (condition.exists !== void 0 && empty(value) === condition.exists) return false;
|
|
24
24
|
if ("equals" in condition && !same(value, condition.equals)) return false;
|
|
25
|
-
if ("
|
|
25
|
+
if ("not_equals" in condition && same(value, condition.not_equals)) return false;
|
|
26
26
|
if (condition.in && !condition.in.some((v) => same(value, v))) return false;
|
|
27
|
+
if (condition.not_in?.some((v) => same(value, v))) return false;
|
|
27
28
|
return true;
|
|
28
29
|
}
|
|
29
30
|
function conditionIssues(condition, siblings) {
|
|
@@ -36,7 +37,9 @@ function conditionIssues(condition, siblings) {
|
|
|
36
37
|
if (typeof c.field !== "string" || c.field === "") return ["needs `field`, a sibling field"];
|
|
37
38
|
const first = c.field.split(".")[0];
|
|
38
39
|
if (!siblings.includes(first)) return [`"${c.field}" is not a field beside it`];
|
|
40
|
+
if ("notEquals" in c) return ["`notEquals` is now `not_equals`, as in `where`"];
|
|
39
41
|
if (c.in !== void 0 && !Array.isArray(c.in)) return ["`in` must be a list"];
|
|
42
|
+
if (c.not_in !== void 0 && !Array.isArray(c.not_in)) return ["`not_in` must be a list"];
|
|
40
43
|
if (c.exists !== void 0 && typeof c.exists !== "boolean")
|
|
41
44
|
return ["`exists` must be true or false"];
|
|
42
45
|
return [];
|
package/dist/conditions.d.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* When a field is shown, from its sibling fields' values (the fields beside it, in its group,
|
|
3
3
|
* array row or block):
|
|
4
4
|
*
|
|
5
|
-
* - `{ field: 'linkType', equals: 'external' }`, also `
|
|
5
|
+
* - `{ field: 'linkType', equals: 'external' }`, also `not_equals`, `in: [...]`, `not_in: [...]`,
|
|
6
|
+
* `exists: true` (named as in `where`)
|
|
6
7
|
* - `{ and: [...] }`, `{ or: [...] }`, `{ not: … }`
|
|
7
8
|
*
|
|
8
9
|
* A hidden field isn't required, and keeps its value.
|
|
@@ -11,8 +12,9 @@ type FieldCondition = {
|
|
|
11
12
|
/** A sibling field's name; a path with `.` reads inside a group, e.g. `link.type`. */
|
|
12
13
|
readonly field: string;
|
|
13
14
|
readonly equals?: unknown;
|
|
14
|
-
readonly
|
|
15
|
+
readonly not_equals?: unknown;
|
|
15
16
|
readonly in?: readonly unknown[];
|
|
17
|
+
readonly not_in?: readonly unknown[];
|
|
16
18
|
/** `true`: has a value (not empty); `false`: empty. */
|
|
17
19
|
readonly exists?: boolean;
|
|
18
20
|
} | {
|