@openpkg-ts/ui 0.1.5 → 0.1.6

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.
@@ -1075,7 +1075,7 @@ function NestedProperty({
1075
1075
  const [copied, setCopied] = useState5(false);
1076
1076
  const type = schema.typeString ?? schema.type ?? "unknown";
1077
1077
  const hasNested = schema.properties && Object.keys(schema.properties).length > 0;
1078
- const _nestedCount = hasNested ? Object.keys(schema.properties).length : 0;
1078
+ const _nestedCount = hasNested && schema.properties ? Object.keys(schema.properties).length : 0;
1079
1079
  const handleCopy = () => {
1080
1080
  navigator.clipboard.writeText(name);
1081
1081
  setCopied(true);
@@ -1173,7 +1173,7 @@ function APIParameterItem({
1173
1173
  const [expanded, setExpanded] = useState5(false);
1174
1174
  const [copied, setCopied] = useState5(false);
1175
1175
  const hasNested = children?.properties && Object.keys(children.properties).length > 0;
1176
- const _nestedCount = hasNested ? Object.keys(children.properties).length : 0;
1176
+ const _nestedCount = hasNested && children?.properties ? Object.keys(children.properties).length : 0;
1177
1177
  const handleCopy = () => {
1178
1178
  navigator.clipboard.writeText(name);
1179
1179
  setCopied(true);
@@ -2004,6 +2004,8 @@ function ClientCode(props) {
2004
2004
  }
2005
2005
  if (codeblocks.length === 1) {
2006
2006
  const tab = highlighted.get(0);
2007
+ if (!tab)
2008
+ return null;
2007
2009
  const handlers = getHandlers(tab.options);
2008
2010
  const { background: _background, ...highlightedStyle } = tab.highlighted.style;
2009
2011
  return /* @__PURE__ */ jsxs19("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpkg-ts/ui",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "UI primitives and components for OpenPkg documentation",
5
5
  "homepage": "https://github.com/ryanwaits/openpkg-ts#readme",
6
6
  "repository": {