nextpress-core 3.1.4 → 3.2.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.
- package/cli/index.js +1 -0
- package/cli/np-down.js +2 -0
- package/cli/np-gen-component.js +62 -0
- package/cli/np-gen.js +8 -0
- package/cli/np-log.js +2 -0
- package/lib/nextjs-lib/acf-functions/core/acf-builder.ts +39 -12
- package/lib/nextjs-lib/acf-functions/services/map-fields/map-fields.ts +3 -3
- package/lib/nextjs-lib/acf-functions/types/acf-field.ts +44 -36
- package/package.json +1 -1
package/cli/index.js
CHANGED
package/cli/np-down.js
CHANGED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import fs from 'fs';
|
|
5
|
+
|
|
6
|
+
function main() {
|
|
7
|
+
const componentName = process.argv.slice(2).join(' ');;
|
|
8
|
+
if (!componentName) {
|
|
9
|
+
console.error('Please provide a component name.');
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const underscored = componentName.replace(/[- ]/g, '_').toLowerCase();
|
|
14
|
+
|
|
15
|
+
const hyphenated = underscored.replaceAll('_', '-');
|
|
16
|
+
|
|
17
|
+
const capitalized = underscored.replace(/(^|_)([a-z])/g, (match, p1, p2) => p2.toUpperCase());
|
|
18
|
+
|
|
19
|
+
const dir = path.join(process.cwd(), 'next-js/src/app/_templates/components', hyphenated);
|
|
20
|
+
|
|
21
|
+
const template =
|
|
22
|
+
`import { defineLayout } from '@nextpress/acf-functions/services/define-layout';
|
|
23
|
+
import { FieldProps } from '@nextpress/acf-functions/types/components/field-props';
|
|
24
|
+
|
|
25
|
+
export const layout = defineLayout({
|
|
26
|
+
name: '${underscored}',
|
|
27
|
+
label: '${componentName}',
|
|
28
|
+
display: 'block',
|
|
29
|
+
sub_fields: [
|
|
30
|
+
{
|
|
31
|
+
name: 'heading',
|
|
32
|
+
label: 'Heading',
|
|
33
|
+
type: 'text',
|
|
34
|
+
},
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export default async function ${capitalized}({ heading }: FieldProps<typeof layout>) {
|
|
39
|
+
return (
|
|
40
|
+
<div className='container mx-auto'>
|
|
41
|
+
</div>
|
|
42
|
+
)
|
|
43
|
+
}`;
|
|
44
|
+
|
|
45
|
+
try {
|
|
46
|
+
const filename = `${hyphenated}.tsx`;
|
|
47
|
+
|
|
48
|
+
if (fs.existsSync(path.join(dir, filename))) {
|
|
49
|
+
throw new Error('Component already exists');
|
|
50
|
+
} else {
|
|
51
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
fs.writeFileSync(path.join(dir, filename), template);
|
|
55
|
+
|
|
56
|
+
console.log(`Successfully generated component ${componentName} at ${dir}`);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
console.error('Failed to generate component:', error.message);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
main();
|
package/cli/np-gen.js
ADDED
package/cli/np-log.js
CHANGED
|
@@ -5,12 +5,15 @@ import { NextpressLayout, ACFLayout } from "../types/acf-layout";
|
|
|
5
5
|
/**
|
|
6
6
|
* Class representing ACF builder.
|
|
7
7
|
*/
|
|
8
|
-
export class ACFBuilder
|
|
9
|
-
{
|
|
8
|
+
export class ACFBuilder {
|
|
10
9
|
/** Array of ACF field groups. */
|
|
11
10
|
private fieldGroups: ACFFieldGroup[] = [];
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
private fieldKeyMap: Map<string, string>;
|
|
13
|
+
|
|
14
|
+
public constructor() {
|
|
15
|
+
this.fieldKeyMap = new Map();
|
|
16
|
+
};
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
19
|
* Gets built field groups.
|
|
@@ -37,11 +40,16 @@ export class ACFBuilder
|
|
|
37
40
|
* @returns {this} Current instance.
|
|
38
41
|
*/
|
|
39
42
|
public registerFieldGroups(fieldGroups: NextpressFieldGroup[]): this {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
let keyedFieldGroups: ACFFieldGroup[] = [];
|
|
44
|
+
|
|
45
|
+
// Run twice to double check conditionals
|
|
46
|
+
for (let i = 0; i < 2; i++) {
|
|
47
|
+
keyedFieldGroups = fieldGroups.map(fieldGroup => ({
|
|
48
|
+
...fieldGroup,
|
|
49
|
+
key: `group_${this.formatKeySuffix(fieldGroup.title)}`,
|
|
50
|
+
fields: this.setFieldKeys(fieldGroup.fields, fieldGroup.title),
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
45
53
|
|
|
46
54
|
this.fieldGroups = [...this.fieldGroups, ...keyedFieldGroups];
|
|
47
55
|
|
|
@@ -67,12 +75,30 @@ export class ACFBuilder
|
|
|
67
75
|
? this.setLayoutKeys(field.layouts, keySuffix)
|
|
68
76
|
: undefined;
|
|
69
77
|
|
|
78
|
+
const key = `field_${keySuffix}`;
|
|
79
|
+
|
|
80
|
+
this.fieldKeyMap.set(field.name, key);
|
|
81
|
+
|
|
82
|
+
if (field.conditional_logic) {
|
|
83
|
+
field.conditional_logic = field.conditional_logic.map((group) => {
|
|
84
|
+
return group.map((cl) => {
|
|
85
|
+
const resolvedKey = this.fieldKeyMap.get(cl.field);
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
...cl,
|
|
89
|
+
field: resolvedKey !== undefined ? resolvedKey : cl.field
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
70
95
|
return {
|
|
71
96
|
...field,
|
|
72
|
-
key
|
|
97
|
+
key,
|
|
73
98
|
sub_fields: childFields,
|
|
74
|
-
layouts: childLayouts
|
|
75
|
-
}
|
|
99
|
+
layouts: childLayouts,
|
|
100
|
+
}
|
|
101
|
+
});
|
|
76
102
|
}
|
|
77
103
|
|
|
78
104
|
/**
|
|
@@ -94,7 +120,8 @@ export class ACFBuilder
|
|
|
94
120
|
...layout,
|
|
95
121
|
key: `layout_${keySuffix}`,
|
|
96
122
|
sub_fields: childFields || [],
|
|
97
|
-
|
|
123
|
+
}
|
|
124
|
+
})
|
|
98
125
|
}
|
|
99
126
|
|
|
100
127
|
/**
|
|
@@ -61,13 +61,13 @@ export async function mapField(field: NextpressField, rawValues: ACFRawValues):
|
|
|
61
61
|
case 'oembed':
|
|
62
62
|
case 'wysiwyg':
|
|
63
63
|
case 'file':
|
|
64
|
-
case 'image':
|
|
65
64
|
return rawValues.get(field.name);
|
|
66
65
|
|
|
67
66
|
/**
|
|
68
67
|
* Numeric fields.
|
|
69
68
|
* Casts the raw string from the database into a strict JavaScript Number.
|
|
70
69
|
*/
|
|
70
|
+
case 'image':
|
|
71
71
|
case 'number':
|
|
72
72
|
case 'range':
|
|
73
73
|
return Number(rawValues.get(field.name));
|
|
@@ -146,13 +146,13 @@ export async function mapField(field: NextpressField, rawValues: ACFRawValues):
|
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
* Gallery field.
|
|
149
|
-
* Deserializes the PHP array of image IDs
|
|
149
|
+
* Deserializes the PHP array of image IDs.
|
|
150
150
|
*/
|
|
151
151
|
case 'gallery':
|
|
152
152
|
const galleryValues = parsePhp(rawValues.get(field.name));
|
|
153
153
|
if (!Array.isArray(galleryValues)) return;
|
|
154
154
|
|
|
155
|
-
return galleryValues;
|
|
155
|
+
return galleryValues.map(image => Number(image)).filter(Boolean);
|
|
156
156
|
|
|
157
157
|
/**
|
|
158
158
|
* Flexible Content field.
|
|
@@ -47,7 +47,7 @@ export type ACFField =
|
|
|
47
47
|
/**
|
|
48
48
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
49
49
|
*/
|
|
50
|
-
conditional_logic?:
|
|
50
|
+
conditional_logic?: ConditionalLogic
|
|
51
51
|
/**
|
|
52
52
|
* Wrapper element settings
|
|
53
53
|
*/
|
|
@@ -131,7 +131,7 @@ export type ACFField =
|
|
|
131
131
|
/**
|
|
132
132
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
133
133
|
*/
|
|
134
|
-
conditional_logic?:
|
|
134
|
+
conditional_logic?: ConditionalLogic
|
|
135
135
|
/**
|
|
136
136
|
* Wrapper element settings
|
|
137
137
|
*/
|
|
@@ -204,7 +204,7 @@ export type ACFField =
|
|
|
204
204
|
/**
|
|
205
205
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
206
206
|
*/
|
|
207
|
-
conditional_logic?:
|
|
207
|
+
conditional_logic?: ConditionalLogic
|
|
208
208
|
/**
|
|
209
209
|
* Wrapper element settings
|
|
210
210
|
*/
|
|
@@ -277,7 +277,7 @@ export type ACFField =
|
|
|
277
277
|
/**
|
|
278
278
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
279
279
|
*/
|
|
280
|
-
conditional_logic?:
|
|
280
|
+
conditional_logic?: ConditionalLogic
|
|
281
281
|
/**
|
|
282
282
|
* Wrapper element settings
|
|
283
283
|
*/
|
|
@@ -356,7 +356,7 @@ export type ACFField =
|
|
|
356
356
|
/**
|
|
357
357
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
358
358
|
*/
|
|
359
|
-
conditional_logic?:
|
|
359
|
+
conditional_logic?: ConditionalLogic
|
|
360
360
|
/**
|
|
361
361
|
* Wrapper element settings
|
|
362
362
|
*/
|
|
@@ -445,7 +445,7 @@ export type ACFField =
|
|
|
445
445
|
/**
|
|
446
446
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
447
447
|
*/
|
|
448
|
-
conditional_logic?:
|
|
448
|
+
conditional_logic?: ConditionalLogic
|
|
449
449
|
/**
|
|
450
450
|
* Wrapper element settings
|
|
451
451
|
*/
|
|
@@ -516,7 +516,7 @@ export type ACFField =
|
|
|
516
516
|
/**
|
|
517
517
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
518
518
|
*/
|
|
519
|
-
conditional_logic?:
|
|
519
|
+
conditional_logic?: ConditionalLogic
|
|
520
520
|
/**
|
|
521
521
|
* Wrapper element settings
|
|
522
522
|
*/
|
|
@@ -583,7 +583,7 @@ export type ACFField =
|
|
|
583
583
|
/**
|
|
584
584
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
585
585
|
*/
|
|
586
|
-
conditional_logic?:
|
|
586
|
+
conditional_logic?: ConditionalLogic
|
|
587
587
|
/**
|
|
588
588
|
* Wrapper element settings
|
|
589
589
|
*/
|
|
@@ -662,7 +662,7 @@ export type ACFField =
|
|
|
662
662
|
/**
|
|
663
663
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
664
664
|
*/
|
|
665
|
-
conditional_logic?:
|
|
665
|
+
conditional_logic?: ConditionalLogic
|
|
666
666
|
/**
|
|
667
667
|
* Wrapper element settings
|
|
668
668
|
*/
|
|
@@ -728,7 +728,7 @@ export type ACFField =
|
|
|
728
728
|
/**
|
|
729
729
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
730
730
|
*/
|
|
731
|
-
conditional_logic?:
|
|
731
|
+
conditional_logic?: ConditionalLogic
|
|
732
732
|
/**
|
|
733
733
|
* Wrapper element settings
|
|
734
734
|
*/
|
|
@@ -807,7 +807,7 @@ export type ACFField =
|
|
|
807
807
|
/**
|
|
808
808
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
809
809
|
*/
|
|
810
|
-
conditional_logic?:
|
|
810
|
+
conditional_logic?: ConditionalLogic
|
|
811
811
|
/**
|
|
812
812
|
* Wrapper element settings
|
|
813
813
|
*/
|
|
@@ -875,7 +875,7 @@ export type ACFField =
|
|
|
875
875
|
/**
|
|
876
876
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
877
877
|
*/
|
|
878
|
-
conditional_logic?:
|
|
878
|
+
conditional_logic?: ConditionalLogic
|
|
879
879
|
/**
|
|
880
880
|
* Wrapper element settings
|
|
881
881
|
*/
|
|
@@ -943,7 +943,7 @@ export type ACFField =
|
|
|
943
943
|
/**
|
|
944
944
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
945
945
|
*/
|
|
946
|
-
conditional_logic?:
|
|
946
|
+
conditional_logic?: ConditionalLogic
|
|
947
947
|
/**
|
|
948
948
|
* Wrapper element settings
|
|
949
949
|
*/
|
|
@@ -1008,7 +1008,7 @@ export type ACFField =
|
|
|
1008
1008
|
/**
|
|
1009
1009
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
1010
1010
|
*/
|
|
1011
|
-
conditional_logic?:
|
|
1011
|
+
conditional_logic?: ConditionalLogic
|
|
1012
1012
|
/**
|
|
1013
1013
|
* Wrapper element settings
|
|
1014
1014
|
*/
|
|
@@ -1079,7 +1079,7 @@ export type ACFField =
|
|
|
1079
1079
|
/**
|
|
1080
1080
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
1081
1081
|
*/
|
|
1082
|
-
conditional_logic?:
|
|
1082
|
+
conditional_logic?: ConditionalLogic
|
|
1083
1083
|
/**
|
|
1084
1084
|
* Wrapper element settings
|
|
1085
1085
|
*/
|
|
@@ -1161,7 +1161,7 @@ export type ACFField =
|
|
|
1161
1161
|
/**
|
|
1162
1162
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
1163
1163
|
*/
|
|
1164
|
-
conditional_logic?:
|
|
1164
|
+
conditional_logic?: ConditionalLogic
|
|
1165
1165
|
/**
|
|
1166
1166
|
* Wrapper element settings
|
|
1167
1167
|
*/
|
|
@@ -1237,7 +1237,7 @@ export type ACFField =
|
|
|
1237
1237
|
/**
|
|
1238
1238
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
1239
1239
|
*/
|
|
1240
|
-
conditional_logic?:
|
|
1240
|
+
conditional_logic?: ConditionalLogic
|
|
1241
1241
|
/**
|
|
1242
1242
|
* Wrapper element settings
|
|
1243
1243
|
*/
|
|
@@ -1322,7 +1322,7 @@ export type ACFField =
|
|
|
1322
1322
|
/**
|
|
1323
1323
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
1324
1324
|
*/
|
|
1325
|
-
conditional_logic?:
|
|
1325
|
+
conditional_logic?: ConditionalLogic
|
|
1326
1326
|
/**
|
|
1327
1327
|
* Wrapper element settings
|
|
1328
1328
|
*/
|
|
@@ -1405,7 +1405,7 @@ export type ACFField =
|
|
|
1405
1405
|
/**
|
|
1406
1406
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
1407
1407
|
*/
|
|
1408
|
-
conditional_logic?:
|
|
1408
|
+
conditional_logic?: ConditionalLogic
|
|
1409
1409
|
/**
|
|
1410
1410
|
* Wrapper element settings
|
|
1411
1411
|
*/
|
|
@@ -1473,7 +1473,7 @@ export type ACFField =
|
|
|
1473
1473
|
/**
|
|
1474
1474
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
1475
1475
|
*/
|
|
1476
|
-
conditional_logic?:
|
|
1476
|
+
conditional_logic?: ConditionalLogic
|
|
1477
1477
|
/**
|
|
1478
1478
|
* Wrapper element settings
|
|
1479
1479
|
*/
|
|
@@ -1552,7 +1552,7 @@ export type ACFField =
|
|
|
1552
1552
|
/**
|
|
1553
1553
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
1554
1554
|
*/
|
|
1555
|
-
conditional_logic?:
|
|
1555
|
+
conditional_logic?: ConditionalLogic
|
|
1556
1556
|
/**
|
|
1557
1557
|
* Wrapper element settings
|
|
1558
1558
|
*/
|
|
@@ -1625,7 +1625,7 @@ export type ACFField =
|
|
|
1625
1625
|
/**
|
|
1626
1626
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
1627
1627
|
*/
|
|
1628
|
-
conditional_logic?:
|
|
1628
|
+
conditional_logic?: ConditionalLogic
|
|
1629
1629
|
/**
|
|
1630
1630
|
* Wrapper element settings
|
|
1631
1631
|
*/
|
|
@@ -1696,7 +1696,7 @@ export type ACFField =
|
|
|
1696
1696
|
/**
|
|
1697
1697
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
1698
1698
|
*/
|
|
1699
|
-
conditional_logic?:
|
|
1699
|
+
conditional_logic?: ConditionalLogic
|
|
1700
1700
|
/**
|
|
1701
1701
|
* Wrapper element settings
|
|
1702
1702
|
*/
|
|
@@ -1776,7 +1776,7 @@ export type ACFField =
|
|
|
1776
1776
|
/**
|
|
1777
1777
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
1778
1778
|
*/
|
|
1779
|
-
conditional_logic?:
|
|
1779
|
+
conditional_logic?: ConditionalLogic
|
|
1780
1780
|
/**
|
|
1781
1781
|
* Wrapper element settings
|
|
1782
1782
|
*/
|
|
@@ -1847,7 +1847,7 @@ export type ACFField =
|
|
|
1847
1847
|
/**
|
|
1848
1848
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
1849
1849
|
*/
|
|
1850
|
-
conditional_logic?:
|
|
1850
|
+
conditional_logic?: ConditionalLogic
|
|
1851
1851
|
/**
|
|
1852
1852
|
* Wrapper element settings
|
|
1853
1853
|
*/
|
|
@@ -1926,7 +1926,7 @@ export type ACFField =
|
|
|
1926
1926
|
/**
|
|
1927
1927
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
1928
1928
|
*/
|
|
1929
|
-
conditional_logic?:
|
|
1929
|
+
conditional_logic?: ConditionalLogic
|
|
1930
1930
|
/**
|
|
1931
1931
|
* Wrapper element settings
|
|
1932
1932
|
*/
|
|
@@ -1994,7 +1994,7 @@ export type ACFField =
|
|
|
1994
1994
|
/**
|
|
1995
1995
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
1996
1996
|
*/
|
|
1997
|
-
conditional_logic?:
|
|
1997
|
+
conditional_logic?: ConditionalLogic
|
|
1998
1998
|
/**
|
|
1999
1999
|
* Wrapper element settings
|
|
2000
2000
|
*/
|
|
@@ -2069,7 +2069,7 @@ export type ACFField =
|
|
|
2069
2069
|
/**
|
|
2070
2070
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
2071
2071
|
*/
|
|
2072
|
-
conditional_logic?:
|
|
2072
|
+
conditional_logic?: ConditionalLogic
|
|
2073
2073
|
/**
|
|
2074
2074
|
* Wrapper element settings
|
|
2075
2075
|
*/
|
|
@@ -2152,7 +2152,7 @@ export type ACFField =
|
|
|
2152
2152
|
/**
|
|
2153
2153
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
2154
2154
|
*/
|
|
2155
|
-
conditional_logic?:
|
|
2155
|
+
conditional_logic?: ConditionalLogic
|
|
2156
2156
|
/**
|
|
2157
2157
|
* Wrapper element settings
|
|
2158
2158
|
*/
|
|
@@ -2215,7 +2215,7 @@ export type ACFField =
|
|
|
2215
2215
|
/**
|
|
2216
2216
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
2217
2217
|
*/
|
|
2218
|
-
conditional_logic?:
|
|
2218
|
+
conditional_logic?: ConditionalLogic
|
|
2219
2219
|
/**
|
|
2220
2220
|
* Wrapper element settings
|
|
2221
2221
|
*/
|
|
@@ -2287,7 +2287,7 @@ export type ACFField =
|
|
|
2287
2287
|
/**
|
|
2288
2288
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
2289
2289
|
*/
|
|
2290
|
-
conditional_logic?:
|
|
2290
|
+
conditional_logic?: ConditionalLogic
|
|
2291
2291
|
/**
|
|
2292
2292
|
* Wrapper element settings
|
|
2293
2293
|
*/
|
|
@@ -2354,7 +2354,7 @@ export type ACFField =
|
|
|
2354
2354
|
/**
|
|
2355
2355
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
2356
2356
|
*/
|
|
2357
|
-
conditional_logic?:
|
|
2357
|
+
conditional_logic?: ConditionalLogic
|
|
2358
2358
|
/**
|
|
2359
2359
|
* Wrapper element settings
|
|
2360
2360
|
*/
|
|
@@ -2425,7 +2425,7 @@ export type ACFField =
|
|
|
2425
2425
|
/**
|
|
2426
2426
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
2427
2427
|
*/
|
|
2428
|
-
conditional_logic?:
|
|
2428
|
+
conditional_logic?: ConditionalLogic
|
|
2429
2429
|
/**
|
|
2430
2430
|
* Wrapper element settings
|
|
2431
2431
|
*/
|
|
@@ -2501,7 +2501,7 @@ export type ACFField =
|
|
|
2501
2501
|
/**
|
|
2502
2502
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
2503
2503
|
*/
|
|
2504
|
-
conditional_logic?:
|
|
2504
|
+
conditional_logic?: ConditionalLogic
|
|
2505
2505
|
/**
|
|
2506
2506
|
* Wrapper element settings
|
|
2507
2507
|
*/
|
|
@@ -2581,7 +2581,7 @@ export type ACFField =
|
|
|
2581
2581
|
/**
|
|
2582
2582
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
2583
2583
|
*/
|
|
2584
|
-
conditional_logic?:
|
|
2584
|
+
conditional_logic?: ConditionalLogic
|
|
2585
2585
|
/**
|
|
2586
2586
|
* Wrapper element settings
|
|
2587
2587
|
*/
|
|
@@ -2671,7 +2671,7 @@ export type ACFField =
|
|
|
2671
2671
|
/**
|
|
2672
2672
|
* Conditional logic rules for field visibility. False/0/empty string to disable, or array of rule groups.
|
|
2673
2673
|
*/
|
|
2674
|
-
conditional_logic?:
|
|
2674
|
+
conditional_logic?: ConditionalLogic
|
|
2675
2675
|
/**
|
|
2676
2676
|
* Wrapper element settings
|
|
2677
2677
|
*/
|
|
@@ -2851,3 +2851,11 @@ type TaxonomyFilter = unknown[]
|
|
|
2851
2851
|
* Target fields for bidirectional relationships
|
|
2852
2852
|
*/
|
|
2853
2853
|
type BidirectionalTarget = unknown[]
|
|
2854
|
+
/**
|
|
2855
|
+
* Target fields for bidirectional relationships
|
|
2856
|
+
*/
|
|
2857
|
+
type ConditionalLogic = {
|
|
2858
|
+
field: string,
|
|
2859
|
+
operator: '==' | '!=' | '>' |'<' | '>=' | '<='
|
|
2860
|
+
value: string
|
|
2861
|
+
}[][];
|