diff --git a/app-builder.config.ts b/app-builder.config.ts index 9f1f058092..02c07aac6d 100644 --- a/app-builder.config.ts +++ b/app-builder.config.ts @@ -61,6 +61,8 @@ const config: ServiceConfig = { fallback: { url: require.resolve('url'), 'react/jsx-runtime': require.resolve('react/jsx-runtime'), + path: false, + fs: false, }, }, server: { diff --git a/package-lock.json b/package-lock.json index f121ddb172..a77e1bd46e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,8 @@ "@aws-sdk/client-sts": "^3.168.0", "@braintree/sanitize-url": "^6.0.0", "@datalens-tech/xlsx": "^0.20.1", - "@doc-tools/transform": "^2.18.3", + "@diplodoc/transform": "^4.10.8", + "@doc-tools/transform": "^3.11.0", "@gravity-ui/app-layout": "^1.7.0", "@gravity-ui/browserslist-config": "^4.3.0", "@gravity-ui/chartkit": "^4.22.0", @@ -4141,6 +4142,83 @@ "node": ">=0.8" } }, + "node_modules/@diplodoc/tabs-extension": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/@diplodoc/tabs-extension/-/tabs-extension-2.0.18.tgz", + "integrity": "sha512-O3N9Xi2omiQqtdr6wdqrQISMHPx77X0sAJ1JHXhivPyc3KWi5BiE1KBypXYIishLUZKJD8dPcT1bbDm7mRVQ8w==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + } + } + }, + "node_modules/@diplodoc/transform": { + "version": "4.10.8", + "resolved": "https://registry.npmjs.org/@diplodoc/transform/-/transform-4.10.8.tgz", + "integrity": "sha512-Vr8wBIv/1qqsXLxkThrOJJ2KUNmTKGOwgLkRd9IzonlfyvJeIjPGcYMLVHvZ+M7WCYzloEdrfFAb1wEDtXtJbA==", + "dependencies": { + "@diplodoc/tabs-extension": "^2.0.18", + "chalk": "4.1.2", + "cheerio": "^1.0.0-rc.12", + "css": "^3.0.0", + "cssfilter": "0.0.10", + "get-root-node-polyfill": "1.0.0", + "github-slugger": "1.4.0", + "js-yaml": "^4.1.0", + "lodash": "4.17.21", + "markdown-it": "^13.0.2", + "markdown-it-attrs": "4.1.4", + "markdown-it-deflist": "2.1.0", + "markdown-it-meta": "0.0.1", + "markdown-it-sup": "1.0.0", + "markdownlint": "^0.25.1", + "markdownlint-rule-helpers": "0.17.2", + "sanitize-html": "^2.11.0", + "slugify": "1.6.5" + }, + "peerDependencies": { + "highlight.js": "^10.0.3 || ^11" + }, + "peerDependenciesMeta": { + "highlight.js": { + "optional": true + } + } + }, + "node_modules/@diplodoc/transform/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/@diplodoc/transform/node_modules/entities": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-3.0.1.tgz", + "integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/@diplodoc/transform/node_modules/markdown-it": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-13.0.2.tgz", + "integrity": "sha512-FtwnEuuK+2yVU7goGn/MJ0WBZMM9ZPgU9spqlFs7/A/pDIUNSOQZhUgOqYCficIuR2QaFnrt8LHqBWsbTAoI5w==", + "dependencies": { + "argparse": "^2.0.1", + "entities": "~3.0.1", + "linkify-it": "^4.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "bin": { + "markdown-it": "bin/markdown-it.js" + } + }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", @@ -4160,15 +4238,15 @@ } }, "node_modules/@doc-tools/transform": { - "version": "2.18.3", - "resolved": "https://registry.npmjs.org/@doc-tools%2ftransform/-/transform-2.18.3.tgz", - "integrity": "sha512-c4wf+cscVtP/TsCchOjh9954PgbO/xcrT9XShs5KLr3WBpjQgO6meHzfxSbDQ73R1bKR3mTpX+9wSiApFY/bEg==", - "license": "MIT", + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/@doc-tools/transform/-/transform-3.11.0.tgz", + "integrity": "sha512-n8n1IMV6bQE/9XLAhHhyozsmCYSsRm/88w8HyxCRGxEi8jOLEp2ooS5EW5xWRrbrp7kzr+wEMSZeMw8EdQP50A==", "dependencies": { - "@types/sanitize-html": "2.6.2", + "@diplodoc/tabs-extension": "^2.0.11", "chalk": "4.1.2", "get-root-node-polyfill": "1.0.0", "github-slugger": "1.4.0", + "js-yaml": "^4.1.0", "lodash": "4.17.21", "markdown-it": "13.0.1", "markdown-it-attrs": "4.1.4", @@ -4177,12 +4255,11 @@ "markdown-it-sup": "1.0.0", "markdownlint": "^0.25.1", "markdownlint-rule-helpers": "0.17.2", - "postcss": "8.4.16", "sanitize-html": "2.7.3", "slugify": "1.6.5" }, "peerDependencies": { - "highlight.js": "^10.0.3" + "highlight.js": "^10.0.3 || ^11" }, "peerDependenciesMeta": { "highlight.js": { @@ -4200,35 +4277,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@doc-tools/transform/node_modules/is-plain-object": { - "version": "5.0.0", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@doc-tools/transform/node_modules/postcss": { - "version": "8.4.16", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - } - ], - "license": "MIT", - "dependencies": { - "nanoid": "^3.3.4", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, "node_modules/@doc-tools/transform/node_modules/sanitize-html": { "version": "2.7.3", "license": "MIT", @@ -5410,15 +5458,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@gravity-ui/page-constructor/node_modules/is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@gravity-ui/page-constructor/node_modules/monaco-editor": { "version": "0.38.0", "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.38.0.tgz", @@ -11101,13 +11140,6 @@ "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==", "dev": true }, - "node_modules/@types/sanitize-html": { - "version": "2.6.2", - "license": "MIT", - "dependencies": { - "htmlparser2": "^6.0.0" - } - }, "node_modules/@types/scheduler": { "version": "0.16.1", "license": "MIT" @@ -12199,7 +12231,6 @@ }, "node_modules/atob": { "version": "2.1.2", - "dev": true, "license": "(MIT OR Apache-2.0)", "bin": { "atob": "bin/atob.js" @@ -13094,7 +13125,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", - "dev": true, "license": "ISC" }, "node_modules/brace-expansion": { @@ -13344,6 +13374,162 @@ "node": "*" } }, + "node_modules/cheerio": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", + "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", + "dependencies": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "htmlparser2": "^8.0.1", + "parse5": "^7.0.0", + "parse5-htmlparser2-tree-adapter": "^7.0.0" + }, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + } + }, + "node_modules/cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dependencies": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/cheerio-select/node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/cheerio-select/node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/cheerio-select/node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/cheerio-select/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/cheerio/node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/cheerio/node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/cheerio/node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/cheerio/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/cheerio/node_modules/htmlparser2": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", + "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "entities": "^4.4.0" + } + }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -13934,7 +14120,6 @@ }, "node_modules/css": { "version": "3.0.0", - "dev": true, "license": "MIT", "dependencies": { "inherits": "^2.0.4", @@ -14234,7 +14419,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0", @@ -14251,7 +14435,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "dev": true, "license": "MIT", "dependencies": { "domelementtype": "^2.3.0", @@ -14266,7 +14449,6 @@ "version": "5.0.3", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "domelementtype": "^2.3.0" @@ -14282,7 +14464,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "dom-serializer": "^2.0.0", @@ -14297,7 +14478,6 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=0.12" @@ -14324,7 +14504,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", - "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">= 6" @@ -14340,7 +14519,6 @@ }, "node_modules/css/node_modules/source-map": { "version": "0.6.1", - "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -14348,7 +14526,6 @@ }, "node_modules/css/node_modules/source-map-resolve": { "version": "0.6.0", - "dev": true, "license": "MIT", "dependencies": { "atob": "^2.1.2", @@ -14382,6 +14559,11 @@ "node": ">=4" } }, + "node_modules/cssfilter": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz", + "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==" + }, "node_modules/cssnano": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-6.0.1.tgz", @@ -15006,7 +15188,6 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", - "dev": true, "engines": { "node": ">=0.10" } @@ -18569,6 +18750,14 @@ "node": ">=0.10.0" } }, + "node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-potential-custom-element-name": { "version": "1.0.1", "dev": true, @@ -23818,7 +24007,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0" @@ -24172,7 +24360,6 @@ }, "node_modules/parse5": { "version": "7.1.2", - "dev": true, "license": "MIT", "dependencies": { "entities": "^4.4.0" @@ -24181,9 +24368,34 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", + "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", + "dependencies": { + "domhandler": "^5.0.2", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter/node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, "node_modules/parse5/node_modules/entities": { "version": "4.4.0", - "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=0.12" @@ -27248,6 +27460,99 @@ "version": "2.1.2", "license": "MIT" }, + "node_modules/sanitize-html": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-2.12.1.tgz", + "integrity": "sha512-Plh+JAn0UVDpBRP/xEjsk+xDCoOvMBwQUf/K+/cBAVuTbtX8bj2VB7S1sL1dssVpykqp0/KPSesHrqXtokVBpA==", + "dependencies": { + "deepmerge": "^4.2.2", + "escape-string-regexp": "^4.0.0", + "htmlparser2": "^8.0.0", + "is-plain-object": "^5.0.0", + "parse-srcset": "^1.0.2", + "postcss": "^8.3.11" + } + }, + "node_modules/sanitize-html/node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/sanitize-html/node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/sanitize-html/node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/sanitize-html/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/sanitize-html/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/sanitize-html/node_modules/htmlparser2": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", + "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "entities": "^4.4.0" + } + }, "node_modules/sass": { "version": "1.69.5", "resolved": "https://registry.npmjs.org/sass/-/sass-1.69.5.tgz", @@ -28441,14 +28746,6 @@ } } }, - "node_modules/stylelint/node_modules/is-plain-object": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/stylelint/node_modules/ms": { "version": "2.1.2", "dev": true, @@ -29687,15 +29984,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/webpack-bundle-analyzer/node_modules/is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/webpack-dev-middleware": { "version": "5.3.3", "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-5.3.3.tgz", diff --git a/package.json b/package.json index 1464700f18..c35f478a76 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,8 @@ "@aws-sdk/client-sts": "^3.168.0", "@braintree/sanitize-url": "^6.0.0", "@datalens-tech/xlsx": "^0.20.1", - "@doc-tools/transform": "^2.18.3", + "@diplodoc/transform": "^4.10.8", + "@doc-tools/transform": "^3.11.0", "@gravity-ui/app-layout": "^1.7.0", "@gravity-ui/browserslist-config": "^4.3.0", "@gravity-ui/chartkit": "^4.22.0", @@ -215,8 +216,7 @@ }, "overrides": { "react": "^17.0.2", - "react-dom": "^17.0.2", - "@doc-tools/transform": "^2.18.3" + "react-dom": "^17.0.2" }, "deploy": { "project": "stat", diff --git a/src/server/components/charts-engine/components/markdown.ts b/src/server/components/charts-engine/components/markdown.ts index 5082c8817f..69af3a3c13 100644 --- a/src/server/components/charts-engine/components/markdown.ts +++ b/src/server/components/charts-engine/components/markdown.ts @@ -1,9 +1,10 @@ -import yfmTransform from '@doc-tools/transform'; -import cut from '@doc-tools/transform/lib/plugins/cut'; -import deflist from '@doc-tools/transform/lib/plugins/deflist'; -import imsize from '@doc-tools/transform/lib/plugins/imsize'; -import notes from '@doc-tools/transform/lib/plugins/notes'; -import table from '@doc-tools/transform/lib/plugins/table'; +import yfmTransform from '@diplodoc/transform'; +import cut from '@diplodoc/transform/lib/plugins/cut'; +import deflist from '@diplodoc/transform/lib/plugins/deflist'; +import imsize from '@diplodoc/transform/lib/plugins/imsize'; +import notes from '@diplodoc/transform/lib/plugins/notes'; +import table from '@diplodoc/transform/lib/plugins/table'; +import {defaultOptions} from '@doc-tools/transform/lib/sanitize'; import MarkdownIt from 'markdown-it'; import katex from 'markdown-it-katex'; import mila from 'markdown-it-link-attributes'; @@ -43,6 +44,10 @@ export function renderHTML({text = '', lang}: {text: string; lang: string}): {re vars: {}, disableLiquid: true, needToSanitizeHtml: true, + sanitizeOptions: { + ...defaultOptions, + disableStyleSanitizer: true, + }, }); return {result: html}; } diff --git a/src/server/registry/index.ts b/src/server/registry/index.ts index b1c3db453a..632c6be19d 100644 --- a/src/server/registry/index.ts +++ b/src/server/registry/index.ts @@ -1,4 +1,4 @@ -import {MarkdownItPluginCb} from '@doc-tools/transform/lib/plugins/typings'; +import {MarkdownItPluginCb} from '@diplodoc/transform/lib/plugins/typings'; import {ExpressKit, Request, Response} from '@gravity-ui/expresskit'; import getGatewayControllers, { ApiWithRoot, diff --git a/src/ui/components/YfmWrapper/YfmWrapperContent.tsx b/src/ui/components/YfmWrapper/YfmWrapperContent.tsx index effe3b50b9..3e0b74b89d 100644 --- a/src/ui/components/YfmWrapper/YfmWrapperContent.tsx +++ b/src/ui/components/YfmWrapper/YfmWrapperContent.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import '@doc-tools/transform/dist/js/yfm'; +import '@diplodoc/transform/dist/js/yfm'; import {YFM_MARKDOWN_CLASSNAME} from '../../constants/yfm'; -import '@doc-tools/transform/dist/css/yfm.css'; +import '@diplodoc/transform/dist/css/yfm.css'; // eslint-disable-next-line import/order import './YfmWrapperContent.scss';