@brillout/docpress 0.16.32 → 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
- const mergedChoices = new Set([...existingChoices, parentChoiceGroup.choice])
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) || hidden
157
+ return !parentChoiceGroup.choices.includes(parentSelectedChoice)
156
158
  }
157
159
  return hidden
158
160
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/docpress",
3
- "version": "0.16.32",
3
+ "version": "0.16.33",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@brillout/picocolors": "^1.0.10",