diff --git a/apps/docs/components/Navigation/NavigationMenu/GlobalMobileMenu.tsx b/apps/docs/components/Navigation/NavigationMenu/GlobalMobileMenu.tsx index 5f57d3c6d74a3..69682dfcad19f 100644 --- a/apps/docs/components/Navigation/NavigationMenu/GlobalMobileMenu.tsx +++ b/apps/docs/components/Navigation/NavigationMenu/GlobalMobileMenu.tsx @@ -52,20 +52,22 @@ const AccordionMenuItem = ({ section }: { section: DropdownMenuItem[] }) => { > {section[0].menuItems?.map((menuItem, menuItemIndex) => ( - {menuItem.map((item) => - !item.href ? ( -
- {item.label} -
- ) : ( - - ) - )} + {menuItem + .filter((item) => item.enabled !== false) + .map((item) => + !item.href ? ( +
+ {item.label} +
+ ) : ( + + ) + )}
))} @@ -90,7 +92,7 @@ const Menu = () => ( justified chevronAlign="right" > - {GLOBAL_MENU_ITEMS.map((section) => ( + {GLOBAL_MENU_ITEMS.filter((section) => section[0].enabled !== false).map((section) => ( ))} diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index 74a142f1bd7a7..f07e11812c6db 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -41,13 +41,13 @@ const { 'docs:compliance', 'docs:contribution', 'docs:fdw', - 'docs:self-hosting', 'docs:framework_quickstarts', 'docs:full_platform', 'docs:local_development', 'docs:mobile_tutorials', 'docs:pgtap', 'docs:production_checklist', + 'docs:self-hosting', 'docs:web_apps', 'integrations:partners', 'sdk:csharp', diff --git a/apps/docs/features/docs/Reference.typeSpec.ts b/apps/docs/features/docs/Reference.typeSpec.ts index c076ff43ca227..98298bcf2b93a 100644 --- a/apps/docs/features/docs/Reference.typeSpec.ts +++ b/apps/docs/features/docs/Reference.typeSpec.ts @@ -156,6 +156,15 @@ export interface CustomTypePropertyType { type: TypeDetails | undefined } +// The meaning of kind flags from `typedoc`: +// https://github.com/TypeStrong/typedoc/blob/2953b0148253589448176881a7acb46090f941bd/src/lib/output/themes/default/assets/typedoc/Application.ts#L36 +const KIND_MODULE = 2 +const KIND_CLASS = 128 +const KIND_INTERFACE = 256 +const KIND_CONSTRUCTOR = 512 +const KIND_METHOD = 2048 +const KIND_TYPE_LITERAL = 65536 + /** * * New versions of `typedoc` added the variant property, so this is a quick and @@ -205,7 +214,7 @@ function normalizeComment(original: TypedocComment | Comment | undefined): Comme return original } - let comment: Comment = {} + const comment: Comment = {} if ('summary' in original) { comment.shortText = original.summary.map((part) => part.text).join('') @@ -218,13 +227,6 @@ function normalizeComment(original: TypedocComment | Comment | undefined): Comme return comment } -// The meaning of kind flags from `typedoc`: -// https://github.com/TypeStrong/typedoc/blob/2953b0148253589448176881a7acb46090f941bd/src/lib/output/themes/default/assets/typedoc/Application.ts#L36 -const KIND_CLASS = 128 -const KIND_CONSTRUCTOR = 512 -const KIND_METHOD = 2048 -const KIND_TYPE_LITERAL = 65536 - export function parseTypeSpec() { const modules = (typeSpec.children ?? []).map(parseMod) return modules as Array @@ -294,7 +296,7 @@ function parseModInternal( node.children?.forEach((child: any) => parseModInternal(child, map, updatedPath, res)) return case 'declaration': - if (node.kind === KIND_CLASS) { + if (node.kind === KIND_CLASS || node.kind === KIND_MODULE) { updatedPath = [...currentPath, node.name] node.children?.forEach((child: any) => parseModInternal(child, map, updatedPath, res)) } else if (node.kind === KIND_CONSTRUCTOR) { @@ -540,6 +542,8 @@ function parseReferenceType(type: any, map: Map) { if (maybeType) { return maybeType + } else if (isNewTypedoc(referenced) && referenced.kind === KIND_INTERFACE) { + return parseInterface(referenced, map) } else if (isNewTypedoc(referenced) && referenced.kind === KIND_CLASS) { // Class is too complicated to display here, just return its name return { @@ -673,7 +677,9 @@ function parseTypeLiteral(type: any, map: Map): TypeDetails | undef const name = nameOrAnonymous(type) if ('children' in type.declaration) { - const properties = type.declaration.children.map((child: any) => parseTypeInternals(child, map)) + const properties = type.declaration.children + .map((child: any) => parseTypeInternals(child, map)) + .filter(Boolean) return { name, type: 'object', @@ -725,7 +731,9 @@ function parseTypeOperatorType(type: any, map: Map) { } function parseInterface(type: any, map: Map): CustomObjectType { - const properties = (type.children ?? []).map((child) => parseTypeInternals(child, map)) + const properties = (type.children ?? []) + .map((child) => parseTypeInternals(child, map)) + .filter(Boolean) return { type: 'object', @@ -766,6 +774,10 @@ function parseTypeInternals(elem: any, map: Map) { function parseInternalProperty(elem: any, map: Map) { const name = nameOrAnonymous(elem) + if (!elem.type) { + return undefined + } + const type = parseType(elem.type, map) const res = { diff --git a/apps/docs/features/docs/__snapshots__/Reference.typeSpec.test.ts.snap b/apps/docs/features/docs/__snapshots__/Reference.typeSpec.test.ts.snap index 534f8f547c727..0eeee322f79b3 100644 --- a/apps/docs/features/docs/__snapshots__/Reference.typeSpec.test.ts.snap +++ b/apps/docs/features/docs/__snapshots__/Reference.typeSpec.test.ts.snap @@ -29616,8 +29616,9 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "transport", "type": { - "type": "nameOnly", - "name": "WebSocketLikeConstructor" + "type": "object", + "name": "WebSocketLikeConstructor", + "properties": [] }, "isOptional": true }, @@ -30241,8 +30242,253 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ], "ret": { "type": { - "type": "nameOnly", - "name": "WebSocketLike" + "type": "object", + "name": "WebSocketLike", + "properties": [ + { + "name": "binaryType", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "bufferedAmount", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "CLOSED", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "CLOSING", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "CONNECTING", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "dispatchEvent", + "type": { + "type": "function", + "params": [ + { + "name": "event", + "type": { + "type": "nameOnly", + "name": "Event" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "boolean" + } + } + }, + "isOptional": true + }, + { + "name": "extensions", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "onclose", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "this", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "ev", + "type": { + "type": "nameOnly", + "name": "CloseEvent" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "any" + } + } + } + ] + } + }, + { + "name": "onerror", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "this", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "ev", + "type": { + "type": "nameOnly", + "name": "Event" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "any" + } + } + } + ] + } + }, + { + "name": "onmessage", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "this", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "ev", + "type": { + "type": "nameOnly", + "name": "MessageEvent" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "any" + } + } + } + ] + } + }, + { + "name": "onopen", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "this", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "ev", + "type": { + "type": "nameOnly", + "name": "Event" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "any" + } + } + } + ] + } + }, + { + "name": "OPEN", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "protocol", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "readyState", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] } } }, diff --git a/apps/studio/components/grid/components/menu/RowContextMenu.tsx b/apps/studio/components/grid/components/menu/RowContextMenu.tsx index d336e2002d9d2..1e90055e4e2ac 100644 --- a/apps/studio/components/grid/components/menu/RowContextMenu.tsx +++ b/apps/studio/components/grid/components/menu/RowContextMenu.tsx @@ -1,12 +1,12 @@ -import { ChevronRight, Clipboard, Edit, Trash } from 'lucide-react' +import { Clipboard, Edit, Trash } from 'lucide-react' import { useCallback } from 'react' -import { Item, ItemParams, Menu, Separator, Submenu } from 'react-contexify' +import { Item, ItemParams, Menu } from 'react-contexify' import { toast } from 'sonner' import type { SupaRow } from 'components/grid/types' import { useTableEditorStateSnapshot } from 'state/table-editor' import { useTableEditorTableStateSnapshot } from 'state/table-editor-table' -import { copyToClipboard } from 'ui' +import { copyToClipboard, DialogSectionSeparator } from 'ui' import { ROW_CONTEXT_MENU_ID } from '.' import { formatClipboardValue } from '../../utils/common' @@ -67,27 +67,20 @@ const RowContextMenu = ({ rows }: RowContextMenuProps) => { return ( - - - Copy - - } - arrow={} - > - - Copy cell - - - Copy row - - + + + Copy cell + + + + Copy row + + - +