@brillout/docpress 0.16.41 → 0.16.42
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.
|
@@ -41,7 +41,7 @@ function ChoiceGroup({ children, choiceGroup }: { children: React.ReactNode; cho
|
|
|
41
41
|
{children}
|
|
42
42
|
{lvl === 0 && !choiceGroup.hidden && (
|
|
43
43
|
<div className={`choice-group__selects`}>
|
|
44
|
-
{choiceGroupAll.map((choiceGroup) => (
|
|
44
|
+
{(choiceGroupAll ?? []).map((choiceGroup) => (
|
|
45
45
|
<CustomSelect key={choiceGroup.name} choiceGroup={choiceGroup} />
|
|
46
46
|
))}
|
|
47
47
|
</div>
|
|
@@ -83,7 +83,10 @@ const remarkChoiceGroup: Plugin<[], Root> = (): Transformer<Root> => {
|
|
|
83
83
|
remarkPkgManager.call(this)(tree, file)
|
|
84
84
|
|
|
85
85
|
visit(tree, 'mdxJsxFlowElement', (node) => {
|
|
86
|
-
|
|
86
|
+
// Descend into non-container nodes so that a `CustomSelectsContainer` nested inside another JSX
|
|
87
|
+
// element (e.g. react-tabs `<Tabs>`/`<TabPanel>`, or a `<div>`) still gets visited and its
|
|
88
|
+
// `choiceGroupAll` attribute injected. (Returning 'skip' here would stop the descent.)
|
|
89
|
+
if (node.name !== 'CustomSelectsContainer') return
|
|
87
90
|
|
|
88
91
|
const choiceGroupAll: ChoiceGroupWithParent[] = []
|
|
89
92
|
|
|
@@ -67,8 +67,11 @@ const remarkChoiceGroup = () => {
|
|
|
67
67
|
await remarkDetype.call(this)(tree, file);
|
|
68
68
|
remarkPkgManager.call(this)(tree, file);
|
|
69
69
|
visit(tree, 'mdxJsxFlowElement', (node) => {
|
|
70
|
+
// Descend into non-container nodes so that a `CustomSelectsContainer` nested inside another JSX
|
|
71
|
+
// element (e.g. react-tabs `<Tabs>`/`<TabPanel>`, or a `<div>`) still gets visited and its
|
|
72
|
+
// `choiceGroupAll` attribute injected. (Returning 'skip' here would stop the descent.)
|
|
70
73
|
if (node.name !== 'CustomSelectsContainer')
|
|
71
|
-
return
|
|
74
|
+
return;
|
|
72
75
|
const choiceGroupAll = [];
|
|
73
76
|
visit(node, 'mdxJsxFlowElement', (child) => {
|
|
74
77
|
if (child.name !== 'ChoiceGroup')
|