-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
032b927
commit a5de2bc
Showing
7 changed files
with
5,863 additions
and
4,124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,10 +33,10 @@ | |
"@graphql-codegen/typescript-operations": "4.0.0", | ||
"@graphql-codegen/typescript-react-apollo": "3.3.7", | ||
"@loomhq/loom-embed": "1.5.0", | ||
"@markdoc/markdoc": "0.3.0", | ||
"@markdoc/markdoc": "0.4.0", | ||
"@markdoc/next.js": "0.2.2", | ||
"@open-draft/until": "2.1.0", | ||
"@pluralsh/design-system": "1.343.1", | ||
"@pluralsh/design-system": "3.70.1", | ||
"@react-aria/ssr": "3.6.0", | ||
"@react-stately/list": "3.8.1", | ||
"@react-stately/select": "3.5.1", | ||
|
@@ -49,7 +49,7 @@ | |
"honorable": "0.194.0", | ||
"honorable-theme-default": "0.77.0", | ||
"htmlparser2": "9.1.0", | ||
"immer": "10.0.2", | ||
"immer": "10.0.3", | ||
"js-yaml": "4.1.0", | ||
"lodash": "4.17.21", | ||
"memoize-one": "6.0.0", | ||
|
@@ -58,9 +58,9 @@ | |
"next-transpile-modules": "10.0.0", | ||
"posthog-js": "1.68.1", | ||
"raw-loader": "4.0.2", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0", | ||
"react-embed": "3.6.0", | ||
"react": "18.3.1", | ||
"react-dom": "18.3.1", | ||
"react-embed": "3.7.0", | ||
"react-github-btn": "1.4.0", | ||
"react-is": "18.2.0", | ||
"react-spring": "9.7.1", | ||
|
@@ -78,8 +78,8 @@ | |
"@pluralsh/eslint-config-typescript": "2.5.41", | ||
"@pluralsh/stylelint-config": "1.1.3", | ||
"@types/node": "20.3.1", | ||
"@types/react": "18.2.12", | ||
"@types/react-dom": "18.2.5", | ||
"@types/react": "18.3.3", | ||
"@types/react-dom": "18.3.0", | ||
"@types/styled-components": "5.1.26", | ||
"@typescript-eslint/eslint-plugin": "5.59.11", | ||
"concurrently": "8.2.0", | ||
|
@@ -99,7 +99,7 @@ | |
"react-hooks": "1.0.1", | ||
"stylelint": "15.7.0", | ||
"stylelint-config-prettier": "9.0.5", | ||
"typescript": "4.9.5" | ||
"typescript": "5.4.5" | ||
}, | ||
"packageManager": "[email protected]", | ||
"lint-staged": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,7 @@ | ||
/* Markdoc nodes must be exported from this file to work with markdoc/nextjs plugin */ | ||
|
||
import { Tag } from '@markdoc/markdoc' | ||
import { Table } from '@pluralsh/design-system/dist/markdoc/components' | ||
import * as designSystemNodes from '@pluralsh/design-system/dist/markdoc/nodes' | ||
import { isTag } from '@pluralsh/design-system/dist/markdoc/types' | ||
|
||
export const nodes = { | ||
...designSystemNodes, | ||
// slight fork of old DS version | ||
table: { | ||
render: Table, | ||
description: 'Display horizontal tabs in a box', | ||
children: ['tab'], | ||
attributes: {}, | ||
transform(node, config) { | ||
const children = node.transformChildren(config) | ||
|
||
const thead = children | ||
.find( | ||
(child): child is Tag => | ||
isTag(child) && child?.name.toLowerCase() === 'thead' | ||
) | ||
?.children.find( | ||
(tr): tr is Tag => isTag(tr) && tr?.name.toLowerCase() === 'tr' | ||
) | ||
?.children.filter( | ||
(th): th is Tag => isTag(th) && th?.name.toLowerCase() === 'th' | ||
) | ||
.map((th) => th.children) | ||
|
||
const tbody = children | ||
.find( | ||
(child): child is Tag => | ||
isTag(child) && child?.name.toLowerCase() === 'tbody' | ||
) | ||
?.children.filter( | ||
(tr): tr is Tag => isTag(tr) && tr?.name.toLowerCase() === 'tr' | ||
) | ||
?.map((tr) => | ||
tr.children | ||
.filter( | ||
(trChild): trChild is Tag => | ||
isTag(trChild) && trChild?.name.toLowerCase() === 'td' | ||
) | ||
.map((td) => td.children) | ||
) | ||
|
||
return new Tag( | ||
this.render as any, | ||
{ thead, tbody, children }, | ||
node.transformChildren(config) | ||
) | ||
}, | ||
}, | ||
} |
Oops, something went wrong.