@brillout/docpress 0.16.31 → 0.16.33
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.
|
@@ -51,7 +51,7 @@ function CustomSelectsContainer({ children }: { children: React.ReactNode }) {
|
|
|
51
51
|
...(parentChoiceGroup && {
|
|
52
52
|
parentChoiceGroup: {
|
|
53
53
|
...parentChoiceGroup,
|
|
54
|
-
choices: [parentChoiceGroup.choice],
|
|
54
|
+
choices: !choiceGroup.hidden ? [parentChoiceGroup.choice] : [],
|
|
55
55
|
},
|
|
56
56
|
}),
|
|
57
57
|
},
|
|
@@ -61,7 +61,9 @@ function CustomSelectsContainer({ children }: { children: React.ReactNode }) {
|
|
|
61
61
|
if (!parentChoiceGroup || !existing.parentChoiceGroup) return prev
|
|
62
62
|
|
|
63
63
|
const existingChoices = existing.parentChoiceGroup.choices
|
|
64
|
-
|
|
64
|
+
if (!choiceGroup.hidden) existing.parentChoiceGroup.choices.push(parentChoiceGroup.choice)
|
|
65
|
+
|
|
66
|
+
const mergedChoices = new Set([...existing.parentChoiceGroup.choices])
|
|
65
67
|
if (mergedChoices.size === existingChoices.length) return prev
|
|
66
68
|
|
|
67
69
|
const next = [...prev]
|
|
@@ -152,7 +154,7 @@ function CustomSelect({ choiceGroup }: { choiceGroup: ChoiceGroupWithParent }) {
|
|
|
152
154
|
function isHidden() {
|
|
153
155
|
if (parentChoiceGroup) {
|
|
154
156
|
const [parentSelectedChoice] = useSelectedChoice(parentChoiceGroup.name, parentChoiceGroup.default)
|
|
155
|
-
return !parentChoiceGroup.choices.includes(parentSelectedChoice)
|
|
157
|
+
return !parentChoiceGroup.choices.includes(parentSelectedChoice)
|
|
156
158
|
}
|
|
157
159
|
return hidden
|
|
158
160
|
}
|
|
@@ -25,7 +25,7 @@ const CHOICES_BUILT_IN: Record<string, { choices: string[]; default: string }> =
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
function generateChoiceGroupCode(choiceNodes: ChoiceNode[], parent: Parent, hide: boolean = false): MdxJsxFlowElement {
|
|
28
|
-
let lvl: number =
|
|
28
|
+
let lvl: number = 0
|
|
29
29
|
|
|
30
30
|
const vikeConfig = getVikeConfig()
|
|
31
31
|
const choices = choiceNodes.map((choiceNode) => choiceNode.choiceValue)
|
|
@@ -96,7 +96,7 @@ function generateChoiceGroupCode(choiceNodes: ChoiceNode[], parent: Parent, hide
|
|
|
96
96
|
},
|
|
97
97
|
})
|
|
98
98
|
|
|
99
|
-
lvl
|
|
99
|
+
lvl = parentLvl + 1
|
|
100
100
|
parent.data.customDataParentChoiceGroup = undefined
|
|
101
101
|
}
|
|
102
102
|
|
|
@@ -13,7 +13,7 @@ const CHOICES_BUILT_IN = {
|
|
|
13
13
|
},
|
|
14
14
|
};
|
|
15
15
|
function generateChoiceGroupCode(choiceNodes, parent, hide = false) {
|
|
16
|
-
let lvl =
|
|
16
|
+
let lvl = 0;
|
|
17
17
|
const vikeConfig = getVikeConfig();
|
|
18
18
|
const choices = choiceNodes.map((choiceNode) => choiceNode.choiceValue);
|
|
19
19
|
const choiceGroup = findChoiceGroup(vikeConfig, choices);
|
|
@@ -76,7 +76,7 @@ function generateChoiceGroupCode(choiceNodes, parent, hide = false) {
|
|
|
76
76
|
},
|
|
77
77
|
},
|
|
78
78
|
});
|
|
79
|
-
lvl
|
|
79
|
+
lvl = parentLvl + 1;
|
|
80
80
|
parent.data.customDataParentChoiceGroup = undefined;
|
|
81
81
|
}
|
|
82
82
|
attributes.push({
|