mirror of
https://github.com/facebook/lexical.git
synced 2025-05-16 22:48:52 +08:00
[lexical-website] Chore: Update docusaurus-plugin-internaldocs-fb and reorg serialization docs (#7533)
This commit is contained in:
247
package-lock.json
generated
247
package-lock.json
generated
@ -11722,6 +11722,11 @@
|
||||
"resolved": "https://registry.npmjs.org/@types/webextension-polyfill/-/webextension-polyfill-0.10.7.tgz",
|
||||
"integrity": "sha512-10ql7A0qzBmFB+F+qAke/nP1PIonS0TXZAOMVOxEUsm+lGSW6uwVcISFNa0I4Oyj0884TZVWGGMIWeXOVSNFHw=="
|
||||
},
|
||||
"node_modules/@types/which": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/which/-/which-3.0.4.tgz",
|
||||
"integrity": "sha512-liyfuo/106JdlgSchJzXEQCVArk0CvevqPote8F8HgWgJ3dRCcTHgJIsLDuee0kxk/mhbInzIZk3QWSZJ8R+2w=="
|
||||
},
|
||||
"node_modules/@types/ws": {
|
||||
"version": "8.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.14.tgz",
|
||||
@ -17095,16 +17100,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb": {
|
||||
"version": "1.19.0",
|
||||
"resolved": "https://registry.npmjs.org/docusaurus-plugin-internaldocs-fb/-/docusaurus-plugin-internaldocs-fb-1.19.0.tgz",
|
||||
"integrity": "sha512-gNH8h1vSmpXi+HbvHQn+eG6g0kHfQ3ys94ppg2uOZf+q8NUnNpoemFrBf5sciLPOPOMF59j/ZMNu0L1GsLFlGg==",
|
||||
"license": "MIT",
|
||||
"version": "1.19.2",
|
||||
"resolved": "https://registry.npmjs.org/docusaurus-plugin-internaldocs-fb/-/docusaurus-plugin-internaldocs-fb-1.19.2.tgz",
|
||||
"integrity": "sha512-l+mrmdioWaqpSx4Dqw+8LRC/6ws/zrNjqpDB9+EmvCl4PuyKAwinA/v43nNbvQMFEPgAd0Ve3bdXvyiL44uxbQ==",
|
||||
"dependencies": {
|
||||
"@mdx-js/mdx": "^2.1.1",
|
||||
"@mdx-js/react": "^1.6.22",
|
||||
"@types/lodash.debounce": "4.0.7",
|
||||
"@types/lodash.escape": "4.0.0",
|
||||
"@types/react-modal": "3.13.1",
|
||||
"@types/which": "3.0.4",
|
||||
"assert": "^2.0.0",
|
||||
"buffer": "^6.0.3",
|
||||
"clsx": "^1.2.1",
|
||||
@ -17112,7 +17117,7 @@
|
||||
"fs-extra": "^10.1.0",
|
||||
"lodash.debounce": "^4.0.8",
|
||||
"lodash.escape": "^4.0.0",
|
||||
"mermaid": "^10.9.0",
|
||||
"mermaid": "^11.5.0",
|
||||
"node-fetch": "2.6.7",
|
||||
"path-browserify": "^1.0.1",
|
||||
"react-live": "^2.2.3",
|
||||
@ -17122,7 +17127,8 @@
|
||||
"unified": "^9.2.1",
|
||||
"unist-util-remove": "^3.1.0",
|
||||
"unist-util-visit": "^2.0.1",
|
||||
"validate-peer-dependencies": "^2.1.0"
|
||||
"validate-peer-dependencies": "^2.1.0",
|
||||
"which": "4.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"auth": "bin/auth.js",
|
||||
@ -17137,6 +17143,11 @@
|
||||
"react": "^17.0.1 || ^18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/@braintree/sanitize-url": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-7.1.1.tgz",
|
||||
"integrity": "sha512-i1L7noDNxtFyL5DmZafWy1wRVhGehQmzZaz1HiN5e7iylJMSZR7ekOV7NsIqa5qBldlLrsKv4HbgFUVlQrz8Mw=="
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/@mdx-js/mdx": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-2.3.0.tgz",
|
||||
@ -17252,6 +17263,23 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/dagre-d3-es": {
|
||||
"version": "7.0.11",
|
||||
"resolved": "https://registry.npmjs.org/dagre-d3-es/-/dagre-d3-es-7.0.11.tgz",
|
||||
"integrity": "sha512-tvlJLyQf834SylNKax8Wkzco/1ias1OPw8DcUMDE7oUIoSEW25riQVuiu/0OWEFqT0cxHT3Pa9/D82Jr47IONw==",
|
||||
"dependencies": {
|
||||
"d3": "^7.9.0",
|
||||
"lodash-es": "^4.17.21"
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/dompurify": {
|
||||
"version": "3.2.5",
|
||||
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.5.tgz",
|
||||
"integrity": "sha512-mLPd29uoRe9HpvwP2TxClGQBzGXeEC/we/q+bFlmPPmj2p2Ugl3r6ATu/UU1v77DXNcehiBg9zsr1dREyA/dJQ==",
|
||||
"optionalDependencies": {
|
||||
"@types/trusted-types": "^2.0.7"
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/escape-string-regexp": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
|
||||
@ -17368,6 +17396,14 @@
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/isexe": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz",
|
||||
"integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==",
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/markdown-extensions": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-1.1.1.tgz",
|
||||
@ -17377,6 +17413,17 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/marked": {
|
||||
"version": "15.0.11",
|
||||
"resolved": "https://registry.npmjs.org/marked/-/marked-15.0.11.tgz",
|
||||
"integrity": "sha512-1BEXAU2euRCG3xwgLVT1y0xbJEld1XOrmRJpUwRCcy7rxhSCwMrmEu9LXoPhHSCJG41V7YcQ2mjKRr5BA3ITIA==",
|
||||
"bin": {
|
||||
"marked": "bin/marked.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/mdast-util-find-and-replace": {
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.2.2.tgz",
|
||||
@ -17683,6 +17730,33 @@
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/mermaid": {
|
||||
"version": "11.6.0",
|
||||
"resolved": "https://registry.npmjs.org/mermaid/-/mermaid-11.6.0.tgz",
|
||||
"integrity": "sha512-PE8hGUy1LDlWIHWBP05SFdqUHGmRcCcK4IzpOKPE35eOw+G9zZgcnMpyunJVUEOgb//KBORPjysKndw8bFLuRg==",
|
||||
"dependencies": {
|
||||
"@braintree/sanitize-url": "^7.0.4",
|
||||
"@iconify/utils": "^2.1.33",
|
||||
"@mermaid-js/parser": "^0.4.0",
|
||||
"@types/d3": "^7.4.3",
|
||||
"cytoscape": "^3.29.3",
|
||||
"cytoscape-cose-bilkent": "^4.1.0",
|
||||
"cytoscape-fcose": "^2.2.0",
|
||||
"d3": "^7.9.0",
|
||||
"d3-sankey": "^0.12.3",
|
||||
"dagre-d3-es": "7.0.11",
|
||||
"dayjs": "^1.11.13",
|
||||
"dompurify": "^3.2.4",
|
||||
"katex": "^0.16.9",
|
||||
"khroma": "^2.1.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"marked": "^15.0.7",
|
||||
"roughjs": "^4.6.6",
|
||||
"stylis": "^4.3.6",
|
||||
"ts-dedent": "^2.2.0",
|
||||
"uuid": "^11.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/micromark": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/micromark/-/micromark-3.2.0.tgz",
|
||||
@ -18364,6 +18438,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/points-on-curve": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/points-on-curve/-/points-on-curve-0.2.0.tgz",
|
||||
"integrity": "sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A=="
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/remark-gfm": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-3.0.1.tgz",
|
||||
@ -18482,6 +18561,17 @@
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/roughjs": {
|
||||
"version": "4.6.6",
|
||||
"resolved": "https://registry.npmjs.org/roughjs/-/roughjs-4.6.6.tgz",
|
||||
"integrity": "sha512-ZUz/69+SYpFN/g/lUlo2FXcIjRkSu3nDarreVdGGndHEBJ6cXPdKguS8JGxwj5HA5xIbVKSmLgr5b3AWxtRfvQ==",
|
||||
"dependencies": {
|
||||
"hachure-fill": "^0.5.2",
|
||||
"path-data-parser": "^0.1.0",
|
||||
"points-on-curve": "^0.2.0",
|
||||
"points-on-path": "^0.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/source-map": {
|
||||
"version": "0.7.4",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz",
|
||||
@ -18491,6 +18581,11 @@
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/stylis": {
|
||||
"version": "4.3.6",
|
||||
"resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.6.tgz",
|
||||
"integrity": "sha512-yQ3rwFWRfwNUY7H5vpU0wfdkNSnvnJinhF9830Swlaxl03zsOjCfmX0ugac+3LtK0lYSgwL/KXc8oYL3mG4YFQ=="
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
@ -18665,6 +18760,18 @@
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/uuid": {
|
||||
"version": "11.1.0",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz",
|
||||
"integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==",
|
||||
"funding": [
|
||||
"https://github.com/sponsors/broofa",
|
||||
"https://github.com/sponsors/ctavan"
|
||||
],
|
||||
"bin": {
|
||||
"uuid": "dist/esm/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/vfile": {
|
||||
"version": "5.3.7",
|
||||
"resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz",
|
||||
@ -18711,6 +18818,20 @@
|
||||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-internaldocs-fb/node_modules/which": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz",
|
||||
"integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==",
|
||||
"dependencies": {
|
||||
"isexe": "^3.1.1"
|
||||
},
|
||||
"bin": {
|
||||
"node-which": "bin/which.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.13.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/docusaurus-plugin-typedoc": {
|
||||
"version": "0.22.0",
|
||||
"resolved": "https://registry.npmjs.org/docusaurus-plugin-typedoc/-/docusaurus-plugin-typedoc-0.22.0.tgz",
|
||||
@ -42294,7 +42415,7 @@
|
||||
"@mdx-js/react": "^3.0.1",
|
||||
"@radix-ui/react-tabs": "^1.0.4",
|
||||
"@vercel/analytics": "^1.0.1",
|
||||
"docusaurus-plugin-internaldocs-fb": "1.19.0",
|
||||
"docusaurus-plugin-internaldocs-fb": "1.19.2",
|
||||
"docusaurus-plugin-typedoc": "^0.22.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"mermaid": "^11.6.0",
|
||||
@ -47746,7 +47867,7 @@
|
||||
"@radix-ui/react-tabs": "^1.0.4",
|
||||
"@vercel/analytics": "^1.0.1",
|
||||
"buffer": "^6.0.3",
|
||||
"docusaurus-plugin-internaldocs-fb": "1.19.0",
|
||||
"docusaurus-plugin-internaldocs-fb": "1.19.2",
|
||||
"docusaurus-plugin-typedoc": "^0.22.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"mermaid": "^11.6.0",
|
||||
@ -50138,6 +50259,11 @@
|
||||
"resolved": "https://registry.npmjs.org/@types/webextension-polyfill/-/webextension-polyfill-0.10.7.tgz",
|
||||
"integrity": "sha512-10ql7A0qzBmFB+F+qAke/nP1PIonS0TXZAOMVOxEUsm+lGSW6uwVcISFNa0I4Oyj0884TZVWGGMIWeXOVSNFHw=="
|
||||
},
|
||||
"@types/which": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/which/-/which-3.0.4.tgz",
|
||||
"integrity": "sha512-liyfuo/106JdlgSchJzXEQCVArk0CvevqPote8F8HgWgJ3dRCcTHgJIsLDuee0kxk/mhbInzIZk3QWSZJ8R+2w=="
|
||||
},
|
||||
"@types/ws": {
|
||||
"version": "8.5.14",
|
||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.14.tgz",
|
||||
@ -53873,15 +53999,16 @@
|
||||
}
|
||||
},
|
||||
"docusaurus-plugin-internaldocs-fb": {
|
||||
"version": "1.19.0",
|
||||
"resolved": "https://registry.npmjs.org/docusaurus-plugin-internaldocs-fb/-/docusaurus-plugin-internaldocs-fb-1.19.0.tgz",
|
||||
"integrity": "sha512-gNH8h1vSmpXi+HbvHQn+eG6g0kHfQ3ys94ppg2uOZf+q8NUnNpoemFrBf5sciLPOPOMF59j/ZMNu0L1GsLFlGg==",
|
||||
"version": "1.19.2",
|
||||
"resolved": "https://registry.npmjs.org/docusaurus-plugin-internaldocs-fb/-/docusaurus-plugin-internaldocs-fb-1.19.2.tgz",
|
||||
"integrity": "sha512-l+mrmdioWaqpSx4Dqw+8LRC/6ws/zrNjqpDB9+EmvCl4PuyKAwinA/v43nNbvQMFEPgAd0Ve3bdXvyiL44uxbQ==",
|
||||
"requires": {
|
||||
"@mdx-js/mdx": "^2.1.1",
|
||||
"@mdx-js/react": "^1.6.22",
|
||||
"@types/lodash.debounce": "4.0.7",
|
||||
"@types/lodash.escape": "4.0.0",
|
||||
"@types/react-modal": "3.13.1",
|
||||
"@types/which": "3.0.4",
|
||||
"assert": "^2.0.0",
|
||||
"buffer": "^6.0.3",
|
||||
"clsx": "^1.2.1",
|
||||
@ -53889,7 +54016,7 @@
|
||||
"fs-extra": "^10.1.0",
|
||||
"lodash.debounce": "^4.0.8",
|
||||
"lodash.escape": "^4.0.0",
|
||||
"mermaid": "^10.9.0",
|
||||
"mermaid": "^11.5.0",
|
||||
"node-fetch": "2.6.7",
|
||||
"path-browserify": "^1.0.1",
|
||||
"react-live": "^2.2.3",
|
||||
@ -53899,9 +54026,15 @@
|
||||
"unified": "^9.2.1",
|
||||
"unist-util-remove": "^3.1.0",
|
||||
"unist-util-visit": "^2.0.1",
|
||||
"validate-peer-dependencies": "^2.1.0"
|
||||
"validate-peer-dependencies": "^2.1.0",
|
||||
"which": "4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@braintree/sanitize-url": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-7.1.1.tgz",
|
||||
"integrity": "sha512-i1L7noDNxtFyL5DmZafWy1wRVhGehQmzZaz1HiN5e7iylJMSZR7ekOV7NsIqa5qBldlLrsKv4HbgFUVlQrz8Mw=="
|
||||
},
|
||||
"@mdx-js/mdx": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-2.3.0.tgz",
|
||||
@ -53983,6 +54116,23 @@
|
||||
"resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz",
|
||||
"integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg=="
|
||||
},
|
||||
"dagre-d3-es": {
|
||||
"version": "7.0.11",
|
||||
"resolved": "https://registry.npmjs.org/dagre-d3-es/-/dagre-d3-es-7.0.11.tgz",
|
||||
"integrity": "sha512-tvlJLyQf834SylNKax8Wkzco/1ias1OPw8DcUMDE7oUIoSEW25riQVuiu/0OWEFqT0cxHT3Pa9/D82Jr47IONw==",
|
||||
"requires": {
|
||||
"d3": "^7.9.0",
|
||||
"lodash-es": "^4.17.21"
|
||||
}
|
||||
},
|
||||
"dompurify": {
|
||||
"version": "3.2.5",
|
||||
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.5.tgz",
|
||||
"integrity": "sha512-mLPd29uoRe9HpvwP2TxClGQBzGXeEC/we/q+bFlmPPmj2p2Ugl3r6ATu/UU1v77DXNcehiBg9zsr1dREyA/dJQ==",
|
||||
"requires": {
|
||||
"@types/trusted-types": "^2.0.7"
|
||||
}
|
||||
},
|
||||
"escape-string-regexp": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
|
||||
@ -54057,11 +54207,21 @@
|
||||
"resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz",
|
||||
"integrity": "sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng=="
|
||||
},
|
||||
"isexe": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz",
|
||||
"integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ=="
|
||||
},
|
||||
"markdown-extensions": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-1.1.1.tgz",
|
||||
"integrity": "sha512-WWC0ZuMzCyDHYCasEGs4IPvLyTGftYwh6wIEOULOF0HXcqZlhwRzrK0w2VUlxWA98xnvb/jszw4ZSkJ6ADpM6Q=="
|
||||
},
|
||||
"marked": {
|
||||
"version": "15.0.11",
|
||||
"resolved": "https://registry.npmjs.org/marked/-/marked-15.0.11.tgz",
|
||||
"integrity": "sha512-1BEXAU2euRCG3xwgLVT1y0xbJEld1XOrmRJpUwRCcy7rxhSCwMrmEu9LXoPhHSCJG41V7YcQ2mjKRr5BA3ITIA=="
|
||||
},
|
||||
"mdast-util-find-and-replace": {
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.2.2.tgz",
|
||||
@ -54282,6 +54442,33 @@
|
||||
"@types/mdast": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"mermaid": {
|
||||
"version": "11.6.0",
|
||||
"resolved": "https://registry.npmjs.org/mermaid/-/mermaid-11.6.0.tgz",
|
||||
"integrity": "sha512-PE8hGUy1LDlWIHWBP05SFdqUHGmRcCcK4IzpOKPE35eOw+G9zZgcnMpyunJVUEOgb//KBORPjysKndw8bFLuRg==",
|
||||
"requires": {
|
||||
"@braintree/sanitize-url": "^7.0.4",
|
||||
"@iconify/utils": "^2.1.33",
|
||||
"@mermaid-js/parser": "^0.4.0",
|
||||
"@types/d3": "^7.4.3",
|
||||
"cytoscape": "^3.29.3",
|
||||
"cytoscape-cose-bilkent": "^4.1.0",
|
||||
"cytoscape-fcose": "^2.2.0",
|
||||
"d3": "^7.9.0",
|
||||
"d3-sankey": "^0.12.3",
|
||||
"dagre-d3-es": "7.0.11",
|
||||
"dayjs": "^1.11.13",
|
||||
"dompurify": "^3.2.4",
|
||||
"katex": "^0.16.9",
|
||||
"khroma": "^2.1.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"marked": "^15.0.7",
|
||||
"roughjs": "^4.6.6",
|
||||
"stylis": "^4.3.6",
|
||||
"ts-dedent": "^2.2.0",
|
||||
"uuid": "^11.1.0"
|
||||
}
|
||||
},
|
||||
"micromark": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/micromark/-/micromark-3.2.0.tgz",
|
||||
@ -54665,6 +54852,11 @@
|
||||
"whatwg-url": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"points-on-curve": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/points-on-curve/-/points-on-curve-0.2.0.tgz",
|
||||
"integrity": "sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A=="
|
||||
},
|
||||
"remark-gfm": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-3.0.1.tgz",
|
||||
@ -54754,11 +54946,27 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"roughjs": {
|
||||
"version": "4.6.6",
|
||||
"resolved": "https://registry.npmjs.org/roughjs/-/roughjs-4.6.6.tgz",
|
||||
"integrity": "sha512-ZUz/69+SYpFN/g/lUlo2FXcIjRkSu3nDarreVdGGndHEBJ6cXPdKguS8JGxwj5HA5xIbVKSmLgr5b3AWxtRfvQ==",
|
||||
"requires": {
|
||||
"hachure-fill": "^0.5.2",
|
||||
"path-data-parser": "^0.1.0",
|
||||
"points-on-curve": "^0.2.0",
|
||||
"points-on-path": "^0.2.1"
|
||||
}
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.7.4",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz",
|
||||
"integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA=="
|
||||
},
|
||||
"stylis": {
|
||||
"version": "4.3.6",
|
||||
"resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.6.tgz",
|
||||
"integrity": "sha512-yQ3rwFWRfwNUY7H5vpU0wfdkNSnvnJinhF9830Swlaxl03zsOjCfmX0ugac+3LtK0lYSgwL/KXc8oYL3mG4YFQ=="
|
||||
},
|
||||
"tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
@ -54872,6 +55080,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"uuid": {
|
||||
"version": "11.1.0",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz",
|
||||
"integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A=="
|
||||
},
|
||||
"vfile": {
|
||||
"version": "5.3.7",
|
||||
"resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz",
|
||||
@ -54905,6 +55118,14 @@
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"which": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz",
|
||||
"integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==",
|
||||
"requires": {
|
||||
"isexe": "^3.1.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -151,6 +151,184 @@ If the imported ```<table>``` doesn't align with the expected GitHub code HTML,
|
||||
|
||||
Much like `exportDOM`, `importDOM` exposes APIs to allow for post-processing of converted Nodes. The conversion function returns a `DOMConversionOutput` which can specify a function to run for each converted child (forChild) or on all the child nodes after the conversion is complete (after). The key difference here is that ```forChild``` runs for every deeply nested child node of the current node, whereas ```after``` will run only once after the transformation of the node and all its children is complete.
|
||||
|
||||
### `html` Property for Import and Export Configuration
|
||||
|
||||
The `html` property in `CreateEditorArgs` provides an alternate way to configure HTML import and export behavior in Lexical without subclassing or node replacement. It includes two properties:
|
||||
|
||||
- `import` - Similar to `importDOM`, it controls how HTML elements are transformed into `LexicalNodes`. However, instead of defining conversions directly on each `LexicalNode`, `html.import` provides a configuration that can be overridden easily in the editor setup.
|
||||
|
||||
- `export` - Similar to `exportDOM`, this property customizes how `LexicalNodes` are serialized into HTML. With `html.export`, users can specify transformations for various nodes collectively, offering a flexible override mechanism that can adapt without needing to extend or replace specific `LexicalNodes`.
|
||||
|
||||
#### Key Differences from `importDOM` and `exportDOM`
|
||||
|
||||
While `importDOM` and `exportDOM` allow for highly customized, node-specific conversions by defining them directly within the `LexicalNode` class, the `html` property enables broader, editor-wide configurations. This setup benefits situations where:
|
||||
|
||||
- **Consistent Transformations**: You want uniform import/export behavior across different nodes without adjusting each node individually.
|
||||
- **No Subclassing Required**: Overrides to import and export logic are applied at the editor configuration level, simplifying customization and reducing the need for extensive subclassing.
|
||||
|
||||
#### Type Definitions
|
||||
|
||||
```typescript
|
||||
type HTMLConfig = {
|
||||
export?: DOMExportOutputMap; // Optional map defining how nodes are exported to HTML.
|
||||
import?: DOMConversionMap; // Optional record defining how HTML is converted into nodes.
|
||||
};
|
||||
```
|
||||
|
||||
#### Example of a use case for the `html` Property for Import and Export Configuration:
|
||||
|
||||
[Rich text sandbox](https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-rich?embed=1&file=src%2FApp.tsx&terminalHeight=0&ctl=1&showSidebar=0&devtoolsheight=0&view=preview)
|
||||
|
||||
### Handling extended HTML styling
|
||||
|
||||
Since the TextNode is foundational to all Lexical packages, including the plain text use case. Handling any rich text logic is undesirable. This creates the need to override the TextNode to handle serialization and deserialization of HTML/CSS styling properties to achieve full fidelity between JSON \<-\> HTML. Since this is a very popular use case, below we are proving a recipe to handle the most common use cases.
|
||||
|
||||
You need to override the base TextNode:
|
||||
|
||||
```js
|
||||
const initialConfig: InitialConfigType = {
|
||||
namespace: 'editor',
|
||||
theme: editorThemeClasses,
|
||||
onError: (error: any) => console.log(error),
|
||||
nodes: [
|
||||
ExtendedTextNode,
|
||||
{
|
||||
replace: TextNode,
|
||||
with: (node: TextNode) => new ExtendedTextNode(node.__text),
|
||||
withKlass: ExtendedTextNode,
|
||||
},
|
||||
ListNode,
|
||||
ListItemNode,
|
||||
]
|
||||
};
|
||||
```
|
||||
|
||||
and create a new Extended Text Node plugin
|
||||
|
||||
```js
|
||||
import {
|
||||
$applyNodeReplacement,
|
||||
$isTextNode,
|
||||
DOMConversion,
|
||||
DOMConversionMap,
|
||||
DOMConversionOutput,
|
||||
NodeKey,
|
||||
TextNode,
|
||||
SerializedTextNode,
|
||||
LexicalNode
|
||||
} from 'lexical';
|
||||
|
||||
export class ExtendedTextNode extends TextNode {
|
||||
constructor(text: string, key?: NodeKey) {
|
||||
super(text, key);
|
||||
}
|
||||
|
||||
static getType(): string {
|
||||
return 'extended-text';
|
||||
}
|
||||
|
||||
static clone(node: ExtendedTextNode): ExtendedTextNode {
|
||||
return new ExtendedTextNode(node.__text, node.__key);
|
||||
}
|
||||
|
||||
static importDOM(): DOMConversionMap | null {
|
||||
const importers = TextNode.importDOM();
|
||||
return {
|
||||
...importers,
|
||||
code: () => ({
|
||||
conversion: patchStyleConversion(importers?.code),
|
||||
priority: 1
|
||||
}),
|
||||
em: () => ({
|
||||
conversion: patchStyleConversion(importers?.em),
|
||||
priority: 1
|
||||
}),
|
||||
span: () => ({
|
||||
conversion: patchStyleConversion(importers?.span),
|
||||
priority: 1
|
||||
}),
|
||||
strong: () => ({
|
||||
conversion: patchStyleConversion(importers?.strong),
|
||||
priority: 1
|
||||
}),
|
||||
sub: () => ({
|
||||
conversion: patchStyleConversion(importers?.sub),
|
||||
priority: 1
|
||||
}),
|
||||
sup: () => ({
|
||||
conversion: patchStyleConversion(importers?.sup),
|
||||
priority: 1
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
static importJSON(serializedNode: SerializedTextNode): TextNode {
|
||||
return $createExtendedTextNode().updateFromJSON(serializedNode);
|
||||
}
|
||||
|
||||
isSimpleText() {
|
||||
return this.__type === 'extended-text' && this.__mode === 0;
|
||||
}
|
||||
|
||||
// no need to add exportJSON here, since we are not adding any new properties
|
||||
}
|
||||
|
||||
export function $createExtendedTextNode(text: string = ''): ExtendedTextNode {
|
||||
return $applyNodeReplacement(new ExtendedTextNode(text));
|
||||
}
|
||||
|
||||
export function $isExtendedTextNode(node: LexicalNode | null | undefined): node is ExtendedTextNode {
|
||||
return node instanceof ExtendedTextNode;
|
||||
}
|
||||
|
||||
function patchStyleConversion(
|
||||
originalDOMConverter?: (node: HTMLElement) => DOMConversion | null
|
||||
): (node: HTMLElement) => DOMConversionOutput | null {
|
||||
return (node) => {
|
||||
const original = originalDOMConverter?.(node);
|
||||
if (!original) {
|
||||
return null;
|
||||
}
|
||||
const originalOutput = original.conversion(node);
|
||||
|
||||
if (!originalOutput) {
|
||||
return originalOutput;
|
||||
}
|
||||
|
||||
const backgroundColor = node.style.backgroundColor;
|
||||
const color = node.style.color;
|
||||
const fontFamily = node.style.fontFamily;
|
||||
const fontWeight = node.style.fontWeight;
|
||||
const fontSize = node.style.fontSize;
|
||||
const textDecoration = node.style.textDecoration;
|
||||
|
||||
return {
|
||||
...originalOutput,
|
||||
forChild: (lexicalNode, parent) => {
|
||||
const originalForChild = originalOutput?.forChild ?? ((x) => x);
|
||||
const result = originalForChild(lexicalNode, parent);
|
||||
if ($isTextNode(result)) {
|
||||
const style = [
|
||||
backgroundColor ? `background-color: ${backgroundColor}` : null,
|
||||
color ? `color: ${color}` : null,
|
||||
fontFamily ? `font-family: ${fontFamily}` : null,
|
||||
fontWeight ? `font-weight: ${fontWeight}` : null,
|
||||
fontSize ? `font-size: ${fontSize}` : null,
|
||||
textDecoration ? `text-decoration: ${textDecoration}` : null,
|
||||
]
|
||||
.filter((value) => value != null)
|
||||
.join('; ');
|
||||
if (style.length) {
|
||||
return result.setStyle(style);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## JSON
|
||||
|
||||
### Lexical -> JSON
|
||||
@ -345,182 +523,3 @@ So then you have a situation where there are possibly two JSON layouts for `Exte
|
||||
If you do have incompatible representations, it's probably best to choose a new type. This is basically the only way that will force old configurations to fail, as `importJSON` implementations often don't do runtime validation and dangerously assume that the values are the correct type.
|
||||
|
||||
There are other schemes that would allow for composable versions, such as nesting the superclass data, or choosing a different name for a version property in each subclass. In practice, explicit versioning is generally redundant if the serialization is properly parsed, so it is recommended that you use the simpler approach with a flat representation with mostly optional properties.
|
||||
|
||||
### Handling extended HTML styling
|
||||
|
||||
Since the TextNode is foundational to all Lexical packages, including the plain text use case. Handling any rich text logic is undesirable. This creates the need to override the TextNode to handle serialization and deserialization of HTML/CSS styling properties to achieve full fidelity between JSON \<-\> HTML. Since this is a very popular use case, below we are proving a recipe to handle the most common use cases.
|
||||
|
||||
You need to override the base TextNode:
|
||||
|
||||
```js
|
||||
const initialConfig: InitialConfigType = {
|
||||
namespace: 'editor',
|
||||
theme: editorThemeClasses,
|
||||
onError: (error: any) => console.log(error),
|
||||
nodes: [
|
||||
ExtendedTextNode,
|
||||
{
|
||||
replace: TextNode,
|
||||
with: (node: TextNode) => new ExtendedTextNode(node.__text),
|
||||
withKlass: ExtendedTextNode,
|
||||
},
|
||||
ListNode,
|
||||
ListItemNode,
|
||||
]
|
||||
};
|
||||
```
|
||||
|
||||
and create a new Extended Text Node plugin
|
||||
|
||||
```js
|
||||
import {
|
||||
$applyNodeReplacement,
|
||||
$isTextNode,
|
||||
DOMConversion,
|
||||
DOMConversionMap,
|
||||
DOMConversionOutput,
|
||||
NodeKey,
|
||||
TextNode,
|
||||
SerializedTextNode,
|
||||
LexicalNode
|
||||
} from 'lexical';
|
||||
|
||||
export class ExtendedTextNode extends TextNode {
|
||||
constructor(text: string, key?: NodeKey) {
|
||||
super(text, key);
|
||||
}
|
||||
|
||||
static getType(): string {
|
||||
return 'extended-text';
|
||||
}
|
||||
|
||||
static clone(node: ExtendedTextNode): ExtendedTextNode {
|
||||
return new ExtendedTextNode(node.__text, node.__key);
|
||||
}
|
||||
|
||||
static importDOM(): DOMConversionMap | null {
|
||||
const importers = TextNode.importDOM();
|
||||
return {
|
||||
...importers,
|
||||
code: () => ({
|
||||
conversion: patchStyleConversion(importers?.code),
|
||||
priority: 1
|
||||
}),
|
||||
em: () => ({
|
||||
conversion: patchStyleConversion(importers?.em),
|
||||
priority: 1
|
||||
}),
|
||||
span: () => ({
|
||||
conversion: patchStyleConversion(importers?.span),
|
||||
priority: 1
|
||||
}),
|
||||
strong: () => ({
|
||||
conversion: patchStyleConversion(importers?.strong),
|
||||
priority: 1
|
||||
}),
|
||||
sub: () => ({
|
||||
conversion: patchStyleConversion(importers?.sub),
|
||||
priority: 1
|
||||
}),
|
||||
sup: () => ({
|
||||
conversion: patchStyleConversion(importers?.sup),
|
||||
priority: 1
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
static importJSON(serializedNode: SerializedTextNode): TextNode {
|
||||
return $createExtendedTextNode().updateFromJSON(serializedNode);
|
||||
}
|
||||
|
||||
isSimpleText() {
|
||||
return this.__type === 'extended-text' && this.__mode === 0;
|
||||
}
|
||||
|
||||
// no need to add exportJSON here, since we are not adding any new properties
|
||||
}
|
||||
|
||||
export function $createExtendedTextNode(text: string = ''): ExtendedTextNode {
|
||||
return $applyNodeReplacement(new ExtendedTextNode(text));
|
||||
}
|
||||
|
||||
export function $isExtendedTextNode(node: LexicalNode | null | undefined): node is ExtendedTextNode {
|
||||
return node instanceof ExtendedTextNode;
|
||||
}
|
||||
|
||||
function patchStyleConversion(
|
||||
originalDOMConverter?: (node: HTMLElement) => DOMConversion | null
|
||||
): (node: HTMLElement) => DOMConversionOutput | null {
|
||||
return (node) => {
|
||||
const original = originalDOMConverter?.(node);
|
||||
if (!original) {
|
||||
return null;
|
||||
}
|
||||
const originalOutput = original.conversion(node);
|
||||
|
||||
if (!originalOutput) {
|
||||
return originalOutput;
|
||||
}
|
||||
|
||||
const backgroundColor = node.style.backgroundColor;
|
||||
const color = node.style.color;
|
||||
const fontFamily = node.style.fontFamily;
|
||||
const fontWeight = node.style.fontWeight;
|
||||
const fontSize = node.style.fontSize;
|
||||
const textDecoration = node.style.textDecoration;
|
||||
|
||||
return {
|
||||
...originalOutput,
|
||||
forChild: (lexicalNode, parent) => {
|
||||
const originalForChild = originalOutput?.forChild ?? ((x) => x);
|
||||
const result = originalForChild(lexicalNode, parent);
|
||||
if ($isTextNode(result)) {
|
||||
const style = [
|
||||
backgroundColor ? `background-color: ${backgroundColor}` : null,
|
||||
color ? `color: ${color}` : null,
|
||||
fontFamily ? `font-family: ${fontFamily}` : null,
|
||||
fontWeight ? `font-weight: ${fontWeight}` : null,
|
||||
fontSize ? `font-size: ${fontSize}` : null,
|
||||
textDecoration ? `text-decoration: ${textDecoration}` : null,
|
||||
]
|
||||
.filter((value) => value != null)
|
||||
.join('; ');
|
||||
if (style.length) {
|
||||
return result.setStyle(style);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
### `html` Property for Import and Export Configuration
|
||||
|
||||
The `html` property in `CreateEditorArgs` provides an alternate way to configure HTML import and export behavior in Lexical without subclassing or node replacement. It includes two properties:
|
||||
|
||||
- `import` - Similar to `importDOM`, it controls how HTML elements are transformed into `LexicalNodes`. However, instead of defining conversions directly on each `LexicalNode`, `html.import` provides a configuration that can be overridden easily in the editor setup.
|
||||
|
||||
- `export` - Similar to `exportDOM`, this property customizes how `LexicalNodes` are serialized into HTML. With `html.export`, users can specify transformations for various nodes collectively, offering a flexible override mechanism that can adapt without needing to extend or replace specific `LexicalNodes`.
|
||||
|
||||
#### Key Differences from `importDOM` and `exportDOM`
|
||||
|
||||
While `importDOM` and `exportDOM` allow for highly customized, node-specific conversions by defining them directly within the `LexicalNode` class, the `html` property enables broader, editor-wide configurations. This setup benefits situations where:
|
||||
|
||||
- **Consistent Transformations**: You want uniform import/export behavior across different nodes without adjusting each node individually.
|
||||
- **No Subclassing Required**: Overrides to import and export logic are applied at the editor configuration level, simplifying customization and reducing the need for extensive subclassing.
|
||||
|
||||
#### Type Definitions
|
||||
|
||||
```typescript
|
||||
type HTMLConfig = {
|
||||
export?: DOMExportOutputMap; // Optional map defining how nodes are exported to HTML.
|
||||
import?: DOMConversionMap; // Optional record defining how HTML is converted into nodes.
|
||||
};
|
||||
```
|
||||
|
||||
#### Example of a use case for the `html` Property for Import and Export Configuration:
|
||||
|
||||
[Rich text sandbox](https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-rich?embed=1&file=src%2FApp.tsx&terminalHeight=0&ctl=1&showSidebar=0&devtoolsheight=0&view=preview)
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
"@mdx-js/react": "^3.0.1",
|
||||
"@radix-ui/react-tabs": "^1.0.4",
|
||||
"@vercel/analytics": "^1.0.1",
|
||||
"docusaurus-plugin-internaldocs-fb": "1.19.0",
|
||||
"docusaurus-plugin-internaldocs-fb": "1.19.2",
|
||||
"docusaurus-plugin-typedoc": "^0.22.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"mermaid": "^11.6.0",
|
||||
|
Reference in New Issue
Block a user