From 0d1292f8c745b0252f8ccc8beb76a257e72299e6 Mon Sep 17 00:00:00 2001 From: Sanjana Date: Sat, 4 Jan 2025 14:31:02 +0530 Subject: [PATCH 1/3] fixing issue #601 --- .../reactflow.dev/src/pages/learn/advanced-use/_meta.tsx | 5 ++--- sites/reactflow.dev/src/pages/learn/concepts/_meta.tsx | 5 ++--- .../src/pages/learn/customization/_meta.tsx | 9 +++------ .../src/pages/learn/getting-started/_meta.tsx | 7 +------ sites/reactflow.dev/src/pages/learn/layouting/_meta.tsx | 5 ++--- .../src/pages/learn/troubleshooting/_meta.tsx | 8 ++------ 6 files changed, 12 insertions(+), 27 deletions(-) diff --git a/sites/reactflow.dev/src/pages/learn/advanced-use/_meta.tsx b/sites/reactflow.dev/src/pages/learn/advanced-use/_meta.tsx index 2b26d2649..69405f081 100644 --- a/sites/reactflow.dev/src/pages/learn/advanced-use/_meta.tsx +++ b/sites/reactflow.dev/src/pages/learn/advanced-use/_meta.tsx @@ -1,6 +1,5 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; -const titleLookup = { +export default { accessibility: 'Accessibility', testing: 'Testing', typescript: 'TypeScript', @@ -11,4 +10,4 @@ const titleLookup = { 'devtools-and-debugging': 'Devtools', }; -export default getMetaConfigFromTitleLookup(titleLookup, '/learn/advanced-use'); + diff --git a/sites/reactflow.dev/src/pages/learn/concepts/_meta.tsx b/sites/reactflow.dev/src/pages/learn/concepts/_meta.tsx index a59d88ffc..0277d6c6b 100644 --- a/sites/reactflow.dev/src/pages/learn/concepts/_meta.tsx +++ b/sites/reactflow.dev/src/pages/learn/concepts/_meta.tsx @@ -1,6 +1,5 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; -const titleLookup = { +export default { introduction: 'Introduction', 'terms-and-definitions': 'Terms and Definitions', 'core-concepts': 'Core Concepts', @@ -8,4 +7,4 @@ const titleLookup = { 'built-in-components': 'Built-In Components', }; -export default getMetaConfigFromTitleLookup(titleLookup, '/learn/concepts'); + diff --git a/sites/reactflow.dev/src/pages/learn/customization/_meta.tsx b/sites/reactflow.dev/src/pages/learn/customization/_meta.tsx index fc2be5982..093df89b8 100644 --- a/sites/reactflow.dev/src/pages/learn/customization/_meta.tsx +++ b/sites/reactflow.dev/src/pages/learn/customization/_meta.tsx @@ -1,6 +1,6 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; -const titleLookup = { + +export default { 'custom-nodes': { title: 'Custom Nodes', theme: { @@ -29,7 +29,4 @@ const titleLookup = { }, }; -export default getMetaConfigFromTitleLookup( - titleLookup, - '/learn/customization', -); + diff --git a/sites/reactflow.dev/src/pages/learn/getting-started/_meta.tsx b/sites/reactflow.dev/src/pages/learn/getting-started/_meta.tsx index f36a2f4ef..48dde9630 100644 --- a/sites/reactflow.dev/src/pages/learn/getting-started/_meta.tsx +++ b/sites/reactflow.dev/src/pages/learn/getting-started/_meta.tsx @@ -1,12 +1,7 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; -const titleLookup = { +export default { 'installation-and-requirements': 'Installation', 'building-a-flow': 'Building a Flow', 'adding-interactivity': 'Adding Interactivity', }; -export default getMetaConfigFromTitleLookup( - titleLookup, - '/learn/getting-started', -); diff --git a/sites/reactflow.dev/src/pages/learn/layouting/_meta.tsx b/sites/reactflow.dev/src/pages/learn/layouting/_meta.tsx index 9d4c3129c..d10730dc9 100644 --- a/sites/reactflow.dev/src/pages/learn/layouting/_meta.tsx +++ b/sites/reactflow.dev/src/pages/learn/layouting/_meta.tsx @@ -1,8 +1,7 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; -const titleLookup = { +export default { layouting: 'Layouting Libraries', 'sub-flows': 'Sub-Flows', }; -export default getMetaConfigFromTitleLookup(titleLookup, '/learn/layouting'); + diff --git a/sites/reactflow.dev/src/pages/learn/troubleshooting/_meta.tsx b/sites/reactflow.dev/src/pages/learn/troubleshooting/_meta.tsx index 8d8214cb2..9d5fa28e6 100644 --- a/sites/reactflow.dev/src/pages/learn/troubleshooting/_meta.tsx +++ b/sites/reactflow.dev/src/pages/learn/troubleshooting/_meta.tsx @@ -1,6 +1,6 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; -const titleLookup = { + +export default { index: 'Common Errors', 'remove-attribution': 'Remove Attribution', 'migrate-to-v12': 'Migrate to v12', @@ -13,7 +13,3 @@ const titleLookup = { }, }; -export default getMetaConfigFromTitleLookup( - titleLookup, - '/learn/troubleshooting', -); From d91c1cdad741b4cb6ace497d3813a428a26133c0 Mon Sep 17 00:00:00 2001 From: Abbey Yacoe Date: Mon, 13 Jan 2025 11:33:27 +0100 Subject: [PATCH 2/3] refactor: remove getMetaConfigFromTitle lookup from _meta.tsx files --- packages/xy-shared/lib/index.tsx | 20 ------------------ .../pages/api-reference/components/_meta.tsx | 9 +------- .../src/pages/api-reference/hooks/_meta.tsx | 9 +------- .../src/pages/api-reference/types/_meta.tsx | 9 +------- .../src/pages/api-reference/utils/_meta.tsx | 9 +------- .../src/pages/examples/edges/_meta.tsx | 6 +----- .../src/pages/examples/interaction/_meta.tsx | 9 +------- .../src/pages/examples/layout/_meta.tsx | 6 +----- .../src/pages/examples/misc/_meta.tsx | 6 +----- .../src/pages/examples/nodes/_meta.tsx | 6 +----- .../src/pages/examples/styling/_meta.tsx | 6 +----- sites/reactflow.dev/src/pages/learn/_meta.ts | 3 +++ .../src/pages/learn/customization/_meta.tsx | 21 ------------------- .../learn/customization/custom-edges.mdx | 4 ++++ .../pages/api-reference/components/_meta.tsx | 9 +------- .../src/pages/api-reference/hooks/_meta.tsx | 9 +------- .../src/pages/api-reference/types/_meta.tsx | 9 +------- .../src/pages/api-reference/utils/_meta.tsx | 9 +------- .../src/pages/examples/edges/_meta.tsx | 6 +----- .../src/pages/examples/interaction/_meta.tsx | 9 +------- .../src/pages/examples/layout/_meta.tsx | 6 +----- .../src/pages/examples/misc/_meta.tsx | 6 +----- .../src/pages/examples/nodes/_meta.tsx | 6 +----- .../src/pages/examples/styling/_meta.tsx | 6 +----- sites/svelteflow.dev/src/pages/learn/_meta.ts | 5 ++++- 25 files changed, 31 insertions(+), 172 deletions(-) diff --git a/packages/xy-shared/lib/index.tsx b/packages/xy-shared/lib/index.tsx index 26dfaee20..0ec6aa03f 100644 --- a/packages/xy-shared/lib/index.tsx +++ b/packages/xy-shared/lib/index.tsx @@ -88,26 +88,6 @@ export function getFrontmatterTag(route: string, tag: string) { return frontMatter[tag]; } -// this helper function is used to generate the _meta.tsx config structure -// for the sidebar -export function getMetaConfigFromTitleLookup( - titleLookup: Record, - reroutePrefix: string = '', -) { - return Object.entries(titleLookup).reduce< - Record - >((acc, [key, entry]) => { - const title = typeof entry === 'string' ? entry : entry.title; - const href = typeof entry === 'string' ? undefined : entry.href; - const route = href ?? `${reroutePrefix}/${key}`; - acc[key] = { - title: , - href, - }; - return acc; - }, {}); -} - export function getMdxPagesUnderRoute( route: InternalRoute, ) { diff --git a/sites/reactflow.dev/src/pages/api-reference/components/_meta.tsx b/sites/reactflow.dev/src/pages/api-reference/components/_meta.tsx index db881c376..7ddcaf127 100644 --- a/sites/reactflow.dev/src/pages/api-reference/components/_meta.tsx +++ b/sites/reactflow.dev/src/pages/api-reference/components/_meta.tsx @@ -1,6 +1,4 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { background: '', 'base-edge': '', 'control-button': '', @@ -15,8 +13,3 @@ const titleLookup = { panel: '', 'viewport-portal': '', }; - -export default getMetaConfigFromTitleLookup( - titleLookup, - '/api-reference/components', -); diff --git a/sites/reactflow.dev/src/pages/api-reference/hooks/_meta.tsx b/sites/reactflow.dev/src/pages/api-reference/hooks/_meta.tsx index ef5b17021..c0dfdd389 100644 --- a/sites/reactflow.dev/src/pages/api-reference/hooks/_meta.tsx +++ b/sites/reactflow.dev/src/pages/api-reference/hooks/_meta.tsx @@ -1,6 +1,4 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { 'use-connection': 'useConnection()', 'use-edges': 'useEdges()', 'use-edges-state': 'useEdgesState()', @@ -20,8 +18,3 @@ const titleLookup = { 'use-update-node-internals': 'useUpdateNodeInternals()', 'use-viewport': 'useViewport()', }; - -export default getMetaConfigFromTitleLookup( - titleLookup, - '/api-reference/hooks', -); diff --git a/sites/reactflow.dev/src/pages/api-reference/types/_meta.tsx b/sites/reactflow.dev/src/pages/api-reference/types/_meta.tsx index 113960db4..7204c19a3 100644 --- a/sites/reactflow.dev/src/pages/api-reference/types/_meta.tsx +++ b/sites/reactflow.dev/src/pages/api-reference/types/_meta.tsx @@ -1,6 +1,4 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { 'background-variant': 'BackgroundVariant', connection: 'Connection', 'connection-line-component-props': 'ConnectionLineComponentProps', @@ -36,8 +34,3 @@ const titleLookup = { viewport: 'Viewport', 'xy-position': 'XYPosition', }; - -export default getMetaConfigFromTitleLookup( - titleLookup, - '/api-reference/types', -); diff --git a/sites/reactflow.dev/src/pages/api-reference/utils/_meta.tsx b/sites/reactflow.dev/src/pages/api-reference/utils/_meta.tsx index dab04693b..8f66518d9 100644 --- a/sites/reactflow.dev/src/pages/api-reference/utils/_meta.tsx +++ b/sites/reactflow.dev/src/pages/api-reference/utils/_meta.tsx @@ -1,6 +1,4 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { 'add-edge': 'addEdge()', 'apply-edge-changes': 'applyEdgeChanges()', 'apply-node-changes': 'applyNodeChanges()', @@ -17,8 +15,3 @@ const titleLookup = { 'is-node': 'isNode()', 'reconnect-edge': 'reconnectEdge()', }; - -export default getMetaConfigFromTitleLookup( - titleLookup, - '/api-reference/utils', -); diff --git a/sites/reactflow.dev/src/pages/examples/edges/_meta.tsx b/sites/reactflow.dev/src/pages/examples/edges/_meta.tsx index 79c3a8832..475738ad6 100644 --- a/sites/reactflow.dev/src/pages/examples/edges/_meta.tsx +++ b/sites/reactflow.dev/src/pages/examples/edges/_meta.tsx @@ -1,6 +1,4 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { 'custom-edges': 'Custom Edges', 'animating-edges': 'Animating Edges', 'edge-types': 'Edge Types', @@ -15,5 +13,3 @@ const titleLookup = { 'edge-label-renderer': 'Edge Label Renderer', 'temporary-edges': 'Temporary Edges', }; - -export default getMetaConfigFromTitleLookup(titleLookup, '/examples/edges'); diff --git a/sites/reactflow.dev/src/pages/examples/interaction/_meta.tsx b/sites/reactflow.dev/src/pages/examples/interaction/_meta.tsx index bbb7fe28b..b8bc477f8 100644 --- a/sites/reactflow.dev/src/pages/examples/interaction/_meta.tsx +++ b/sites/reactflow.dev/src/pages/examples/interaction/_meta.tsx @@ -1,6 +1,4 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { 'interaction-props': 'Interaction Props', 'drag-and-drop': 'Drag and Drop', 'computing-flows': 'Computing Flows', @@ -16,8 +14,3 @@ const titleLookup = { collaborative: 'Collaborative', 'contextual-zoom': 'Contextual Zoom', }; - -export default getMetaConfigFromTitleLookup( - titleLookup, - '/examples/interaction', -); diff --git a/sites/reactflow.dev/src/pages/examples/layout/_meta.tsx b/sites/reactflow.dev/src/pages/examples/layout/_meta.tsx index e2579322b..8cc8143be 100644 --- a/sites/reactflow.dev/src/pages/examples/layout/_meta.tsx +++ b/sites/reactflow.dev/src/pages/examples/layout/_meta.tsx @@ -1,6 +1,4 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { 'sub-flows': 'Sub Flow', horizontal: 'Horizontal Flow', dagre: 'Dagre Tree', @@ -12,5 +10,3 @@ const titleLookup = { 'expand-collapse': 'Expand and Collapse', 'workflow-builder': 'Workflow Builder', }; - -export default getMetaConfigFromTitleLookup(titleLookup, '/examples/layout'); diff --git a/sites/reactflow.dev/src/pages/examples/misc/_meta.tsx b/sites/reactflow.dev/src/pages/examples/misc/_meta.tsx index 35a102062..dc61cd610 100644 --- a/sites/reactflow.dev/src/pages/examples/misc/_meta.tsx +++ b/sites/reactflow.dev/src/pages/examples/misc/_meta.tsx @@ -1,10 +1,6 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { 'static-server-side-generation': 'Static Server Side Generation', 'download-image': 'Download Image', provider: 'ReactFlowProvider', 'use-react-flow-hook': 'useReactFlow', }; - -export default getMetaConfigFromTitleLookup(titleLookup, '/examples/misc'); diff --git a/sites/reactflow.dev/src/pages/examples/nodes/_meta.tsx b/sites/reactflow.dev/src/pages/examples/nodes/_meta.tsx index 56d29d9fd..2b26538e8 100644 --- a/sites/reactflow.dev/src/pages/examples/nodes/_meta.tsx +++ b/sites/reactflow.dev/src/pages/examples/nodes/_meta.tsx @@ -1,6 +1,4 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { 'custom-node': 'Custom Nodes', 'update-node': 'Updating Nodes', stress: 'Stress Test', @@ -18,5 +16,3 @@ const titleLookup = { 'connection-limit': 'Connection Limit', 'delete-middle-node': 'Delete Middle Node', }; - -export default getMetaConfigFromTitleLookup(titleLookup, '/examples/nodes'); diff --git a/sites/reactflow.dev/src/pages/examples/styling/_meta.tsx b/sites/reactflow.dev/src/pages/examples/styling/_meta.tsx index 779b3c42c..67f245b39 100644 --- a/sites/reactflow.dev/src/pages/examples/styling/_meta.tsx +++ b/sites/reactflow.dev/src/pages/examples/styling/_meta.tsx @@ -1,10 +1,6 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { 'styled-components': 'Styled Components', tailwind: 'Tailwind', 'turbo-flow': 'Turbo Flow', 'base-style': 'Base Style', }; - -export default getMetaConfigFromTitleLookup(titleLookup, '/examples/styling'); diff --git a/sites/reactflow.dev/src/pages/learn/_meta.ts b/sites/reactflow.dev/src/pages/learn/_meta.ts index 1df762a6e..c0ba2243a 100644 --- a/sites/reactflow.dev/src/pages/learn/_meta.ts +++ b/sites/reactflow.dev/src/pages/learn/_meta.ts @@ -12,6 +12,9 @@ export default { }, }, troubleshooting: 'Troubleshooting', + '---': { + type: 'separator', + }, 'api-link': { title: 'API Reference', href: '/api-reference', diff --git a/sites/reactflow.dev/src/pages/learn/customization/_meta.tsx b/sites/reactflow.dev/src/pages/learn/customization/_meta.tsx index 093df89b8..73edb7aca 100644 --- a/sites/reactflow.dev/src/pages/learn/customization/_meta.tsx +++ b/sites/reactflow.dev/src/pages/learn/customization/_meta.tsx @@ -1,32 +1,11 @@ - - export default { 'custom-nodes': { title: 'Custom Nodes', - theme: { - pagination: false, - }, - }, - 'node-props': { - title: 'Custom Node Props', - href: '/api-reference/types/node-props', }, 'custom-edges': { title: 'Custom Edges', - theme: { - pagination: false, - }, - }, - 'edge-props': { - title: 'Custom Edge Props', - href: '/api-reference/types/edge-props', }, theming: { title: 'Theming', - theme: { - pagination: false, - }, }, }; - - diff --git a/sites/reactflow.dev/src/pages/learn/customization/custom-edges.mdx b/sites/reactflow.dev/src/pages/learn/customization/custom-edges.mdx index 7832b4ce6..4e06e29cc 100644 --- a/sites/reactflow.dev/src/pages/learn/customization/custom-edges.mdx +++ b/sites/reactflow.dev/src/pages/learn/customization/custom-edges.mdx @@ -187,3 +187,7 @@ button will remove that edge from the flow. Creating a new edge will use the custom node. + +You can find a list of the passed props +and more information in the [custom edge API +section](/api-reference/types/edge-props). diff --git a/sites/svelteflow.dev/src/pages/api-reference/components/_meta.tsx b/sites/svelteflow.dev/src/pages/api-reference/components/_meta.tsx index c88303628..a6217e4d7 100644 --- a/sites/svelteflow.dev/src/pages/api-reference/components/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/api-reference/components/_meta.tsx @@ -1,6 +1,4 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { background: '', 'base-edge': '', 'control-button': '', @@ -14,8 +12,3 @@ const titleLookup = { 'node-toolbar': '', panel: '', }; - -export default getMetaConfigFromTitleLookup( - titleLookup, - '/api-reference/components', -); diff --git a/sites/svelteflow.dev/src/pages/api-reference/hooks/_meta.tsx b/sites/svelteflow.dev/src/pages/api-reference/hooks/_meta.tsx index 01dc4806f..53b83872b 100644 --- a/sites/svelteflow.dev/src/pages/api-reference/hooks/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/api-reference/hooks/_meta.tsx @@ -1,6 +1,4 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { 'use-connection': 'useConnection()', 'use-edges': 'useEdges()', 'use-handle-connections': 'useHandleConnections()', @@ -12,8 +10,3 @@ const titleLookup = { 'use-store': 'useStore()', 'use-update-node-internals': 'useUpdateNodeInternals()', }; - -export default getMetaConfigFromTitleLookup( - titleLookup, - '/api-reference/hooks', -); diff --git a/sites/svelteflow.dev/src/pages/api-reference/types/_meta.tsx b/sites/svelteflow.dev/src/pages/api-reference/types/_meta.tsx index d99d2b09a..2cb3d9b22 100644 --- a/sites/svelteflow.dev/src/pages/api-reference/types/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/api-reference/types/_meta.tsx @@ -1,6 +1,4 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { 'background-variant': 'BackgroundVariant', 'color-mode': 'ColorMode', connection: 'Connection', @@ -23,8 +21,3 @@ const titleLookup = { viewport: 'Viewport', 'xy-position': 'XYPosition', }; - -export default getMetaConfigFromTitleLookup( - titleLookup, - '/api-reference/types', -); diff --git a/sites/svelteflow.dev/src/pages/api-reference/utils/_meta.tsx b/sites/svelteflow.dev/src/pages/api-reference/utils/_meta.tsx index 818428c24..bedd627d9 100644 --- a/sites/svelteflow.dev/src/pages/api-reference/utils/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/api-reference/utils/_meta.tsx @@ -1,6 +1,4 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { 'add-edge': 'addEdge()', 'get-bezier-path': 'getBezierPath()', 'get-connected-edges': 'getConnectedEdges()', @@ -14,8 +12,3 @@ const titleLookup = { 'is-edge': 'isEdge()', 'is-node': 'isNode()', }; - -export default getMetaConfigFromTitleLookup( - titleLookup, - '/api-reference/utils', -); diff --git a/sites/svelteflow.dev/src/pages/examples/edges/_meta.tsx b/sites/svelteflow.dev/src/pages/examples/edges/_meta.tsx index 0f7c6bdc1..6ece1f474 100644 --- a/sites/svelteflow.dev/src/pages/examples/edges/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/examples/edges/_meta.tsx @@ -1,6 +1,4 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { 'custom-connectionline': 'Connection Line', 'custom-edges': 'Custom Edges', 'edge-label-renderer': 'Edge Label Renderer', @@ -8,5 +6,3 @@ const titleLookup = { 'edge-types': 'Edge Types', 'simple-floating-edges': 'Simple Floating Edges', }; - -export default getMetaConfigFromTitleLookup(titleLookup, '/examples/edges'); diff --git a/sites/svelteflow.dev/src/pages/examples/interaction/_meta.tsx b/sites/svelteflow.dev/src/pages/examples/interaction/_meta.tsx index 98cad808a..7fd600105 100644 --- a/sites/svelteflow.dev/src/pages/examples/interaction/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/examples/interaction/_meta.tsx @@ -1,14 +1,7 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { 'computing-flows': 'Computing Flows', 'context-menu': 'Context Menu', 'contextual-zoom': 'Contextual Zoom', 'drag-and-drop': 'Drag and Drop', validation: 'Validation', }; - -export default getMetaConfigFromTitleLookup( - titleLookup, - '/examples/interaction', -); diff --git a/sites/svelteflow.dev/src/pages/examples/layout/_meta.tsx b/sites/svelteflow.dev/src/pages/examples/layout/_meta.tsx index 875a4b6fa..74491b984 100644 --- a/sites/svelteflow.dev/src/pages/examples/layout/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/examples/layout/_meta.tsx @@ -1,10 +1,6 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { dagre: 'Dagre', elkjs: 'Elkjs', 'horizontal-flow': 'Horizontal Flow', subflows: 'Subflows', }; - -export default getMetaConfigFromTitleLookup(titleLookup, '/examples/layout'); diff --git a/sites/svelteflow.dev/src/pages/examples/misc/_meta.tsx b/sites/svelteflow.dev/src/pages/examples/misc/_meta.tsx index 583a1a110..bc2808a3f 100644 --- a/sites/svelteflow.dev/src/pages/examples/misc/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/examples/misc/_meta.tsx @@ -1,9 +1,5 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { 'download-image': 'Download Image', 'threlte-flow': 'Threlte Flow', 'use-svelte-flow': 'useSvelteFlow', }; - -export default getMetaConfigFromTitleLookup(titleLookup, '/examples/misc'); diff --git a/sites/svelteflow.dev/src/pages/examples/nodes/_meta.tsx b/sites/svelteflow.dev/src/pages/examples/nodes/_meta.tsx index 210d64ff8..d5e0b0bfb 100644 --- a/sites/svelteflow.dev/src/pages/examples/nodes/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/examples/nodes/_meta.tsx @@ -1,6 +1,4 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { 'custom-node': 'Custom Nodes', 'update-node': 'Updating Nodes', stress: 'Stress Test', @@ -12,5 +10,3 @@ const titleLookup = { 'connection-limit': 'Connection Limit', intersections: 'Intersections', }; - -export default getMetaConfigFromTitleLookup(titleLookup, '/examples/nodes'); diff --git a/sites/svelteflow.dev/src/pages/examples/styling/_meta.tsx b/sites/svelteflow.dev/src/pages/examples/styling/_meta.tsx index 65b272456..e40cdaf78 100644 --- a/sites/svelteflow.dev/src/pages/examples/styling/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/examples/styling/_meta.tsx @@ -1,10 +1,6 @@ -import { getMetaConfigFromTitleLookup } from 'xy-shared'; - -const titleLookup = { +export default { 'base-style': 'Base Style', 'dark-mode': 'Dark Mode', tailwind: 'Tailwind', 'turbo-flow': 'Turbo Flow', }; - -export default getMetaConfigFromTitleLookup(titleLookup, '/examples/styling'); diff --git a/sites/svelteflow.dev/src/pages/learn/_meta.ts b/sites/svelteflow.dev/src/pages/learn/_meta.ts index 3efb0c0d4..ac7a15519 100644 --- a/sites/svelteflow.dev/src/pages/learn/_meta.ts +++ b/sites/svelteflow.dev/src/pages/learn/_meta.ts @@ -2,7 +2,10 @@ export default { index: 'Quickstart', 'getting-started': 'Getting Started', guides: 'Guides', - 'api-link': { + '---': { + type: 'separator', + }, + api: { title: 'API Reference', href: '/api-reference', }, From dee3f99e776f9db6974075a723e1073fb29f1507 Mon Sep 17 00:00:00 2001 From: Abbey Yacoe Date: Mon, 13 Jan 2025 13:03:30 +0100 Subject: [PATCH 3/3] Revert "refactor: remove getMetaConfigFromTitle lookup from _meta.tsx files" This reverts commit d91c1cdad741b4cb6ace497d3813a428a26133c0. --- packages/xy-shared/lib/index.tsx | 20 ++++++++++++++++++ .../pages/api-reference/components/_meta.tsx | 9 +++++++- .../src/pages/api-reference/hooks/_meta.tsx | 9 +++++++- .../src/pages/api-reference/types/_meta.tsx | 9 +++++++- .../src/pages/api-reference/utils/_meta.tsx | 9 +++++++- .../src/pages/examples/edges/_meta.tsx | 6 +++++- .../src/pages/examples/interaction/_meta.tsx | 9 +++++++- .../src/pages/examples/layout/_meta.tsx | 6 +++++- .../src/pages/examples/misc/_meta.tsx | 6 +++++- .../src/pages/examples/nodes/_meta.tsx | 6 +++++- .../src/pages/examples/styling/_meta.tsx | 6 +++++- sites/reactflow.dev/src/pages/learn/_meta.ts | 3 --- .../src/pages/learn/customization/_meta.tsx | 21 +++++++++++++++++++ .../learn/customization/custom-edges.mdx | 4 ---- .../pages/api-reference/components/_meta.tsx | 9 +++++++- .../src/pages/api-reference/hooks/_meta.tsx | 9 +++++++- .../src/pages/api-reference/types/_meta.tsx | 9 +++++++- .../src/pages/api-reference/utils/_meta.tsx | 9 +++++++- .../src/pages/examples/edges/_meta.tsx | 6 +++++- .../src/pages/examples/interaction/_meta.tsx | 9 +++++++- .../src/pages/examples/layout/_meta.tsx | 6 +++++- .../src/pages/examples/misc/_meta.tsx | 6 +++++- .../src/pages/examples/nodes/_meta.tsx | 6 +++++- .../src/pages/examples/styling/_meta.tsx | 6 +++++- sites/svelteflow.dev/src/pages/learn/_meta.ts | 5 +---- 25 files changed, 172 insertions(+), 31 deletions(-) diff --git a/packages/xy-shared/lib/index.tsx b/packages/xy-shared/lib/index.tsx index 0ec6aa03f..26dfaee20 100644 --- a/packages/xy-shared/lib/index.tsx +++ b/packages/xy-shared/lib/index.tsx @@ -88,6 +88,26 @@ export function getFrontmatterTag(route: string, tag: string) { return frontMatter[tag]; } +// this helper function is used to generate the _meta.tsx config structure +// for the sidebar +export function getMetaConfigFromTitleLookup( + titleLookup: Record, + reroutePrefix: string = '', +) { + return Object.entries(titleLookup).reduce< + Record + >((acc, [key, entry]) => { + const title = typeof entry === 'string' ? entry : entry.title; + const href = typeof entry === 'string' ? undefined : entry.href; + const route = href ?? `${reroutePrefix}/${key}`; + acc[key] = { + title: , + href, + }; + return acc; + }, {}); +} + export function getMdxPagesUnderRoute( route: InternalRoute, ) { diff --git a/sites/reactflow.dev/src/pages/api-reference/components/_meta.tsx b/sites/reactflow.dev/src/pages/api-reference/components/_meta.tsx index 7ddcaf127..db881c376 100644 --- a/sites/reactflow.dev/src/pages/api-reference/components/_meta.tsx +++ b/sites/reactflow.dev/src/pages/api-reference/components/_meta.tsx @@ -1,4 +1,6 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { background: '', 'base-edge': '', 'control-button': '', @@ -13,3 +15,8 @@ export default { panel: '', 'viewport-portal': '', }; + +export default getMetaConfigFromTitleLookup( + titleLookup, + '/api-reference/components', +); diff --git a/sites/reactflow.dev/src/pages/api-reference/hooks/_meta.tsx b/sites/reactflow.dev/src/pages/api-reference/hooks/_meta.tsx index c0dfdd389..ef5b17021 100644 --- a/sites/reactflow.dev/src/pages/api-reference/hooks/_meta.tsx +++ b/sites/reactflow.dev/src/pages/api-reference/hooks/_meta.tsx @@ -1,4 +1,6 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { 'use-connection': 'useConnection()', 'use-edges': 'useEdges()', 'use-edges-state': 'useEdgesState()', @@ -18,3 +20,8 @@ export default { 'use-update-node-internals': 'useUpdateNodeInternals()', 'use-viewport': 'useViewport()', }; + +export default getMetaConfigFromTitleLookup( + titleLookup, + '/api-reference/hooks', +); diff --git a/sites/reactflow.dev/src/pages/api-reference/types/_meta.tsx b/sites/reactflow.dev/src/pages/api-reference/types/_meta.tsx index 7204c19a3..113960db4 100644 --- a/sites/reactflow.dev/src/pages/api-reference/types/_meta.tsx +++ b/sites/reactflow.dev/src/pages/api-reference/types/_meta.tsx @@ -1,4 +1,6 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { 'background-variant': 'BackgroundVariant', connection: 'Connection', 'connection-line-component-props': 'ConnectionLineComponentProps', @@ -34,3 +36,8 @@ export default { viewport: 'Viewport', 'xy-position': 'XYPosition', }; + +export default getMetaConfigFromTitleLookup( + titleLookup, + '/api-reference/types', +); diff --git a/sites/reactflow.dev/src/pages/api-reference/utils/_meta.tsx b/sites/reactflow.dev/src/pages/api-reference/utils/_meta.tsx index 8f66518d9..dab04693b 100644 --- a/sites/reactflow.dev/src/pages/api-reference/utils/_meta.tsx +++ b/sites/reactflow.dev/src/pages/api-reference/utils/_meta.tsx @@ -1,4 +1,6 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { 'add-edge': 'addEdge()', 'apply-edge-changes': 'applyEdgeChanges()', 'apply-node-changes': 'applyNodeChanges()', @@ -15,3 +17,8 @@ export default { 'is-node': 'isNode()', 'reconnect-edge': 'reconnectEdge()', }; + +export default getMetaConfigFromTitleLookup( + titleLookup, + '/api-reference/utils', +); diff --git a/sites/reactflow.dev/src/pages/examples/edges/_meta.tsx b/sites/reactflow.dev/src/pages/examples/edges/_meta.tsx index 475738ad6..79c3a8832 100644 --- a/sites/reactflow.dev/src/pages/examples/edges/_meta.tsx +++ b/sites/reactflow.dev/src/pages/examples/edges/_meta.tsx @@ -1,4 +1,6 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { 'custom-edges': 'Custom Edges', 'animating-edges': 'Animating Edges', 'edge-types': 'Edge Types', @@ -13,3 +15,5 @@ export default { 'edge-label-renderer': 'Edge Label Renderer', 'temporary-edges': 'Temporary Edges', }; + +export default getMetaConfigFromTitleLookup(titleLookup, '/examples/edges'); diff --git a/sites/reactflow.dev/src/pages/examples/interaction/_meta.tsx b/sites/reactflow.dev/src/pages/examples/interaction/_meta.tsx index b8bc477f8..bbb7fe28b 100644 --- a/sites/reactflow.dev/src/pages/examples/interaction/_meta.tsx +++ b/sites/reactflow.dev/src/pages/examples/interaction/_meta.tsx @@ -1,4 +1,6 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { 'interaction-props': 'Interaction Props', 'drag-and-drop': 'Drag and Drop', 'computing-flows': 'Computing Flows', @@ -14,3 +16,8 @@ export default { collaborative: 'Collaborative', 'contextual-zoom': 'Contextual Zoom', }; + +export default getMetaConfigFromTitleLookup( + titleLookup, + '/examples/interaction', +); diff --git a/sites/reactflow.dev/src/pages/examples/layout/_meta.tsx b/sites/reactflow.dev/src/pages/examples/layout/_meta.tsx index 8cc8143be..e2579322b 100644 --- a/sites/reactflow.dev/src/pages/examples/layout/_meta.tsx +++ b/sites/reactflow.dev/src/pages/examples/layout/_meta.tsx @@ -1,4 +1,6 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { 'sub-flows': 'Sub Flow', horizontal: 'Horizontal Flow', dagre: 'Dagre Tree', @@ -10,3 +12,5 @@ export default { 'expand-collapse': 'Expand and Collapse', 'workflow-builder': 'Workflow Builder', }; + +export default getMetaConfigFromTitleLookup(titleLookup, '/examples/layout'); diff --git a/sites/reactflow.dev/src/pages/examples/misc/_meta.tsx b/sites/reactflow.dev/src/pages/examples/misc/_meta.tsx index dc61cd610..35a102062 100644 --- a/sites/reactflow.dev/src/pages/examples/misc/_meta.tsx +++ b/sites/reactflow.dev/src/pages/examples/misc/_meta.tsx @@ -1,6 +1,10 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { 'static-server-side-generation': 'Static Server Side Generation', 'download-image': 'Download Image', provider: 'ReactFlowProvider', 'use-react-flow-hook': 'useReactFlow', }; + +export default getMetaConfigFromTitleLookup(titleLookup, '/examples/misc'); diff --git a/sites/reactflow.dev/src/pages/examples/nodes/_meta.tsx b/sites/reactflow.dev/src/pages/examples/nodes/_meta.tsx index 2b26538e8..56d29d9fd 100644 --- a/sites/reactflow.dev/src/pages/examples/nodes/_meta.tsx +++ b/sites/reactflow.dev/src/pages/examples/nodes/_meta.tsx @@ -1,4 +1,6 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { 'custom-node': 'Custom Nodes', 'update-node': 'Updating Nodes', stress: 'Stress Test', @@ -16,3 +18,5 @@ export default { 'connection-limit': 'Connection Limit', 'delete-middle-node': 'Delete Middle Node', }; + +export default getMetaConfigFromTitleLookup(titleLookup, '/examples/nodes'); diff --git a/sites/reactflow.dev/src/pages/examples/styling/_meta.tsx b/sites/reactflow.dev/src/pages/examples/styling/_meta.tsx index 67f245b39..779b3c42c 100644 --- a/sites/reactflow.dev/src/pages/examples/styling/_meta.tsx +++ b/sites/reactflow.dev/src/pages/examples/styling/_meta.tsx @@ -1,6 +1,10 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { 'styled-components': 'Styled Components', tailwind: 'Tailwind', 'turbo-flow': 'Turbo Flow', 'base-style': 'Base Style', }; + +export default getMetaConfigFromTitleLookup(titleLookup, '/examples/styling'); diff --git a/sites/reactflow.dev/src/pages/learn/_meta.ts b/sites/reactflow.dev/src/pages/learn/_meta.ts index c0ba2243a..1df762a6e 100644 --- a/sites/reactflow.dev/src/pages/learn/_meta.ts +++ b/sites/reactflow.dev/src/pages/learn/_meta.ts @@ -12,9 +12,6 @@ export default { }, }, troubleshooting: 'Troubleshooting', - '---': { - type: 'separator', - }, 'api-link': { title: 'API Reference', href: '/api-reference', diff --git a/sites/reactflow.dev/src/pages/learn/customization/_meta.tsx b/sites/reactflow.dev/src/pages/learn/customization/_meta.tsx index 73edb7aca..093df89b8 100644 --- a/sites/reactflow.dev/src/pages/learn/customization/_meta.tsx +++ b/sites/reactflow.dev/src/pages/learn/customization/_meta.tsx @@ -1,11 +1,32 @@ + + export default { 'custom-nodes': { title: 'Custom Nodes', + theme: { + pagination: false, + }, + }, + 'node-props': { + title: 'Custom Node Props', + href: '/api-reference/types/node-props', }, 'custom-edges': { title: 'Custom Edges', + theme: { + pagination: false, + }, + }, + 'edge-props': { + title: 'Custom Edge Props', + href: '/api-reference/types/edge-props', }, theming: { title: 'Theming', + theme: { + pagination: false, + }, }, }; + + diff --git a/sites/reactflow.dev/src/pages/learn/customization/custom-edges.mdx b/sites/reactflow.dev/src/pages/learn/customization/custom-edges.mdx index 4e06e29cc..7832b4ce6 100644 --- a/sites/reactflow.dev/src/pages/learn/customization/custom-edges.mdx +++ b/sites/reactflow.dev/src/pages/learn/customization/custom-edges.mdx @@ -187,7 +187,3 @@ button will remove that edge from the flow. Creating a new edge will use the custom node. - -You can find a list of the passed props -and more information in the [custom edge API -section](/api-reference/types/edge-props). diff --git a/sites/svelteflow.dev/src/pages/api-reference/components/_meta.tsx b/sites/svelteflow.dev/src/pages/api-reference/components/_meta.tsx index a6217e4d7..c88303628 100644 --- a/sites/svelteflow.dev/src/pages/api-reference/components/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/api-reference/components/_meta.tsx @@ -1,4 +1,6 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { background: '', 'base-edge': '', 'control-button': '', @@ -12,3 +14,8 @@ export default { 'node-toolbar': '', panel: '', }; + +export default getMetaConfigFromTitleLookup( + titleLookup, + '/api-reference/components', +); diff --git a/sites/svelteflow.dev/src/pages/api-reference/hooks/_meta.tsx b/sites/svelteflow.dev/src/pages/api-reference/hooks/_meta.tsx index 53b83872b..01dc4806f 100644 --- a/sites/svelteflow.dev/src/pages/api-reference/hooks/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/api-reference/hooks/_meta.tsx @@ -1,4 +1,6 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { 'use-connection': 'useConnection()', 'use-edges': 'useEdges()', 'use-handle-connections': 'useHandleConnections()', @@ -10,3 +12,8 @@ export default { 'use-store': 'useStore()', 'use-update-node-internals': 'useUpdateNodeInternals()', }; + +export default getMetaConfigFromTitleLookup( + titleLookup, + '/api-reference/hooks', +); diff --git a/sites/svelteflow.dev/src/pages/api-reference/types/_meta.tsx b/sites/svelteflow.dev/src/pages/api-reference/types/_meta.tsx index 2cb3d9b22..d99d2b09a 100644 --- a/sites/svelteflow.dev/src/pages/api-reference/types/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/api-reference/types/_meta.tsx @@ -1,4 +1,6 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { 'background-variant': 'BackgroundVariant', 'color-mode': 'ColorMode', connection: 'Connection', @@ -21,3 +23,8 @@ export default { viewport: 'Viewport', 'xy-position': 'XYPosition', }; + +export default getMetaConfigFromTitleLookup( + titleLookup, + '/api-reference/types', +); diff --git a/sites/svelteflow.dev/src/pages/api-reference/utils/_meta.tsx b/sites/svelteflow.dev/src/pages/api-reference/utils/_meta.tsx index bedd627d9..818428c24 100644 --- a/sites/svelteflow.dev/src/pages/api-reference/utils/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/api-reference/utils/_meta.tsx @@ -1,4 +1,6 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { 'add-edge': 'addEdge()', 'get-bezier-path': 'getBezierPath()', 'get-connected-edges': 'getConnectedEdges()', @@ -12,3 +14,8 @@ export default { 'is-edge': 'isEdge()', 'is-node': 'isNode()', }; + +export default getMetaConfigFromTitleLookup( + titleLookup, + '/api-reference/utils', +); diff --git a/sites/svelteflow.dev/src/pages/examples/edges/_meta.tsx b/sites/svelteflow.dev/src/pages/examples/edges/_meta.tsx index 6ece1f474..0f7c6bdc1 100644 --- a/sites/svelteflow.dev/src/pages/examples/edges/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/examples/edges/_meta.tsx @@ -1,4 +1,6 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { 'custom-connectionline': 'Connection Line', 'custom-edges': 'Custom Edges', 'edge-label-renderer': 'Edge Label Renderer', @@ -6,3 +8,5 @@ export default { 'edge-types': 'Edge Types', 'simple-floating-edges': 'Simple Floating Edges', }; + +export default getMetaConfigFromTitleLookup(titleLookup, '/examples/edges'); diff --git a/sites/svelteflow.dev/src/pages/examples/interaction/_meta.tsx b/sites/svelteflow.dev/src/pages/examples/interaction/_meta.tsx index 7fd600105..98cad808a 100644 --- a/sites/svelteflow.dev/src/pages/examples/interaction/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/examples/interaction/_meta.tsx @@ -1,7 +1,14 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { 'computing-flows': 'Computing Flows', 'context-menu': 'Context Menu', 'contextual-zoom': 'Contextual Zoom', 'drag-and-drop': 'Drag and Drop', validation: 'Validation', }; + +export default getMetaConfigFromTitleLookup( + titleLookup, + '/examples/interaction', +); diff --git a/sites/svelteflow.dev/src/pages/examples/layout/_meta.tsx b/sites/svelteflow.dev/src/pages/examples/layout/_meta.tsx index 74491b984..875a4b6fa 100644 --- a/sites/svelteflow.dev/src/pages/examples/layout/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/examples/layout/_meta.tsx @@ -1,6 +1,10 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { dagre: 'Dagre', elkjs: 'Elkjs', 'horizontal-flow': 'Horizontal Flow', subflows: 'Subflows', }; + +export default getMetaConfigFromTitleLookup(titleLookup, '/examples/layout'); diff --git a/sites/svelteflow.dev/src/pages/examples/misc/_meta.tsx b/sites/svelteflow.dev/src/pages/examples/misc/_meta.tsx index bc2808a3f..583a1a110 100644 --- a/sites/svelteflow.dev/src/pages/examples/misc/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/examples/misc/_meta.tsx @@ -1,5 +1,9 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { 'download-image': 'Download Image', 'threlte-flow': 'Threlte Flow', 'use-svelte-flow': 'useSvelteFlow', }; + +export default getMetaConfigFromTitleLookup(titleLookup, '/examples/misc'); diff --git a/sites/svelteflow.dev/src/pages/examples/nodes/_meta.tsx b/sites/svelteflow.dev/src/pages/examples/nodes/_meta.tsx index d5e0b0bfb..210d64ff8 100644 --- a/sites/svelteflow.dev/src/pages/examples/nodes/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/examples/nodes/_meta.tsx @@ -1,4 +1,6 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { 'custom-node': 'Custom Nodes', 'update-node': 'Updating Nodes', stress: 'Stress Test', @@ -10,3 +12,5 @@ export default { 'connection-limit': 'Connection Limit', intersections: 'Intersections', }; + +export default getMetaConfigFromTitleLookup(titleLookup, '/examples/nodes'); diff --git a/sites/svelteflow.dev/src/pages/examples/styling/_meta.tsx b/sites/svelteflow.dev/src/pages/examples/styling/_meta.tsx index e40cdaf78..65b272456 100644 --- a/sites/svelteflow.dev/src/pages/examples/styling/_meta.tsx +++ b/sites/svelteflow.dev/src/pages/examples/styling/_meta.tsx @@ -1,6 +1,10 @@ -export default { +import { getMetaConfigFromTitleLookup } from 'xy-shared'; + +const titleLookup = { 'base-style': 'Base Style', 'dark-mode': 'Dark Mode', tailwind: 'Tailwind', 'turbo-flow': 'Turbo Flow', }; + +export default getMetaConfigFromTitleLookup(titleLookup, '/examples/styling'); diff --git a/sites/svelteflow.dev/src/pages/learn/_meta.ts b/sites/svelteflow.dev/src/pages/learn/_meta.ts index ac7a15519..3efb0c0d4 100644 --- a/sites/svelteflow.dev/src/pages/learn/_meta.ts +++ b/sites/svelteflow.dev/src/pages/learn/_meta.ts @@ -2,10 +2,7 @@ export default { index: 'Quickstart', 'getting-started': 'Getting Started', guides: 'Guides', - '---': { - type: 'separator', - }, - api: { + 'api-link': { title: 'API Reference', href: '/api-reference', },