diff --git a/package-lock.json b/package-lock.json index ec330b54..005a3252 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "@diplodoc/openapi-extension": "^2.6.0", "@diplodoc/prettier-config": "^2.0.0", "@diplodoc/search-extension": "^1.1.5", - "@diplodoc/transform": "^4.38.2", + "@diplodoc/transform": "^0.0.0-rc-ways-to-interface-with-collect-202412111442", "@diplodoc/tsconfig": "^1.0.2", "@gravity-ui/page-constructor": "^5.29.1", "@octokit/core": "4.2.4", @@ -1636,6 +1636,42 @@ "npm": ">=9.*" } }, + "node_modules/@diplodoc/client/node_modules/@diplodoc/transform": { + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@diplodoc/transform/-/transform-4.40.0.tgz", + "integrity": "sha512-fJ6Fo/kCv4r3T7ZxEEPBy0l60tU7ArOg1q9zVJcFClMowUtiavT8Pbrn6/wj/nM02OQ2ZeVc+IW3OXkPH2yRmA==", + "dependencies": { + "@diplodoc/cut-extension": "^0.5.0", + "@diplodoc/file-extension": "^0.2.0", + "@diplodoc/tabs-extension": "^3.5.0", + "chalk": "^4.1.2", + "cheerio": "^1.0.0", + "css": "^3.0.0", + "cssfilter": "0.0.10", + "get-root-node-polyfill": "1.0.0", + "github-slugger": "^1.5.0", + "js-yaml": "^4.1.0", + "lodash": "4.17.21", + "markdown-it": "^13.0.2", + "markdown-it-attrs": "^4.2.0", + "markdown-it-deflist": "2.1.0", + "markdown-it-meta": "0.0.1", + "markdown-it-sup": "1.0.0", + "markdownlint": "^0.32.1", + "markdownlint-rule-helpers": "0.17.2", + "sanitize-html": "^2.11.0", + "slugify": "1.6.6", + "svgo": "^3.2.0" + }, + "peerDependencies": { + "highlight.js": "^10.0.3 || ^11" + }, + "peerDependenciesMeta": { + "highlight.js": { + "optional": true + } + } + }, "node_modules/@diplodoc/components": { "version": "4.18.1", "resolved": "https://registry.npmjs.org/@diplodoc/components/-/components-4.18.1.tgz", @@ -1673,15 +1709,25 @@ } }, "node_modules/@diplodoc/cut-extension": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@diplodoc/cut-extension/-/cut-extension-0.3.2.tgz", - "integrity": "sha512-55AgVEIiy3GHorZRht3dm1AcFWdgCMAn8yGV/8qp8sPQ4LssPPuCrVzCVFMn7o8d3KZbEDt5dDj6kI1KtVaWQg==", - "license": "MIT", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@diplodoc/cut-extension/-/cut-extension-0.5.0.tgz", + "integrity": "sha512-UvSZmjTVL9DSvKLYzde3Y9RJGjM44s1iTP1iSytuInXDqLIeyd4wenNsr9LHqmAl6EB3V5/OMR+B3X8FgXNypg==", + "dependencies": { + "@diplodoc/directive": "^0.3.0" + }, "peerDependencies": { "@diplodoc/utils": "1.0.0", "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, + "node_modules/@diplodoc/directive": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@diplodoc/directive/-/directive-0.3.0.tgz", + "integrity": "sha512-1UD7UHthRqO0rju/XNAaKQIxSy/pa1giEMlARBZ7U4ZPi1QeTw+QNyXy1TwvnBb5hc6jAChTjfOxDwpct1AEdg==", + "dependencies": { + "markdown-it-directive": "2.0.4" + } + }, "node_modules/@diplodoc/eslint-config": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@diplodoc/eslint-config/-/eslint-config-2.0.0.tgz", @@ -1700,6 +1746,17 @@ "eslint-plugin-security": "1.7.1" } }, + "node_modules/@diplodoc/file-extension": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@diplodoc/file-extension/-/file-extension-0.2.1.tgz", + "integrity": "sha512-4m9ZcQwmeHw0t2t5vv5GGxKfUifOdpf4Idb9a/Rfkxl6pqGnk0rnZ0xwXrruQEwinkQIBL4TCl2YN3SKGaBrjQ==", + "dependencies": { + "@diplodoc/directive": "^0.3.0" + }, + "peerDependencies": { + "markdown-it": "^13.0.0" + } + }, "node_modules/@diplodoc/latex-extension": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@diplodoc/latex-extension/-/latex-extension-1.3.2.tgz", @@ -2261,6 +2318,43 @@ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, + "node_modules/@diplodoc/openapi-extension/node_modules/@diplodoc/transform": { + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@diplodoc/transform/-/transform-4.40.0.tgz", + "integrity": "sha512-fJ6Fo/kCv4r3T7ZxEEPBy0l60tU7ArOg1q9zVJcFClMowUtiavT8Pbrn6/wj/nM02OQ2ZeVc+IW3OXkPH2yRmA==", + "dev": true, + "dependencies": { + "@diplodoc/cut-extension": "^0.5.0", + "@diplodoc/file-extension": "^0.2.0", + "@diplodoc/tabs-extension": "^3.5.0", + "chalk": "^4.1.2", + "cheerio": "^1.0.0", + "css": "^3.0.0", + "cssfilter": "0.0.10", + "get-root-node-polyfill": "1.0.0", + "github-slugger": "^1.5.0", + "js-yaml": "^4.1.0", + "lodash": "4.17.21", + "markdown-it": "^13.0.2", + "markdown-it-attrs": "^4.2.0", + "markdown-it-deflist": "2.1.0", + "markdown-it-meta": "0.0.1", + "markdown-it-sup": "1.0.0", + "markdownlint": "^0.32.1", + "markdownlint-rule-helpers": "0.17.2", + "sanitize-html": "^2.11.0", + "slugify": "1.6.6", + "svgo": "^3.2.0" + }, + "peerDependencies": { + "highlight.js": "^10.0.3 || ^11" + }, + "peerDependenciesMeta": { + "highlight.js": { + "optional": true + } + } + }, "node_modules/@diplodoc/prettier-config": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@diplodoc/prettier-config/-/prettier-config-2.0.0.tgz", @@ -2313,12 +2407,13 @@ } }, "node_modules/@diplodoc/transform": { - "version": "4.38.2", - "resolved": "https://registry.npmjs.org/@diplodoc/transform/-/transform-4.38.2.tgz", - "integrity": "sha512-CsKh9JWx37ldmsiqZmj+5pujHV3RFt9sViRutZ4rBRDODjpmLmLKruTj0uCdFg9gOZa8BiD22rU+4iayvd0k4w==", - "license": "MIT", + "version": "0.0.0-rc-ways-to-interface-with-collect-202412111442", + "resolved": "https://registry.npmjs.org/@diplodoc/transform/-/transform-0.0.0-rc-ways-to-interface-with-collect-202412111442.tgz", + "integrity": "sha512-ONjD9FKG/fHtTAcWFvu9QF6JoulJEy/sh679VRfIklaXoR1r4XWkn8QeQr489jI1FgMqbsUS6JANv//J5oQrlw==", + "dev": true, "dependencies": { - "@diplodoc/cut-extension": "^0.3.0", + "@diplodoc/cut-extension": "^0.5.0", + "@diplodoc/file-extension": "^0.2.0", "@diplodoc/tabs-extension": "^3.5.0", "chalk": "^4.1.2", "cheerio": "^1.0.0", @@ -2385,6 +2480,47 @@ "markdown-it": "^13.0.2" } }, + "node_modules/@diplodoc/translation/node_modules/@diplodoc/transform": { + "version": "4.40.0", + "resolved": "https://registry.npmjs.org/@diplodoc/transform/-/transform-4.40.0.tgz", + "integrity": "sha512-fJ6Fo/kCv4r3T7ZxEEPBy0l60tU7ArOg1q9zVJcFClMowUtiavT8Pbrn6/wj/nM02OQ2ZeVc+IW3OXkPH2yRmA==", + "dependencies": { + "@diplodoc/cut-extension": "^0.5.0", + "@diplodoc/file-extension": "^0.2.0", + "@diplodoc/tabs-extension": "^3.5.0", + "chalk": "^4.1.2", + "cheerio": "^1.0.0", + "css": "^3.0.0", + "cssfilter": "0.0.10", + "get-root-node-polyfill": "1.0.0", + "github-slugger": "^1.5.0", + "js-yaml": "^4.1.0", + "lodash": "4.17.21", + "markdown-it": "^13.0.2", + "markdown-it-attrs": "^4.2.0", + "markdown-it-deflist": "2.1.0", + "markdown-it-meta": "0.0.1", + "markdown-it-sup": "1.0.0", + "markdownlint": "^0.32.1", + "markdownlint-rule-helpers": "0.17.2", + "sanitize-html": "^2.11.0", + "slugify": "1.6.6", + "svgo": "^3.2.0" + }, + "peerDependencies": { + "highlight.js": "^10.0.3 || ^11" + }, + "peerDependenciesMeta": { + "highlight.js": { + "optional": true + } + } + }, + "node_modules/@diplodoc/translation/node_modules/@diplodoc/transform/node_modules/markdown-it-deflist": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/markdown-it-deflist/-/markdown-it-deflist-2.1.0.tgz", + "integrity": "sha512-3OuqoRUlSxJiuQYu0cWTLHNhhq2xtoSFqsZK8plANg91+RJQU1ziQ6lA2LzmFAEes18uPBsHZpcX6We5l76Nzg==" + }, "node_modules/@diplodoc/translation/node_modules/markdown-it-deflist": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/markdown-it-deflist/-/markdown-it-deflist-3.0.0.tgz", @@ -2402,7 +2538,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/@diplodoc/utils/-/utils-1.0.0.tgz", "integrity": "sha512-rGDVyqZyJ4GUjuUIYeMG7w6w5mb1dLF/nkloWEyxqZWy/POO4GiHAG83d4wK6U3gTFGTe+BXabQzdIKZwNVCTw==", - "license": "MIT", "peer": true }, "node_modules/@esbuild/aix-ppc64": { @@ -2981,7 +3116,6 @@ "resolved": "https://registry.npmjs.org/@gravity-ui/date-components/-/date-components-2.11.0.tgz", "integrity": "sha512-raaoXQ5Uk256difnuQ6Ga4T2/IleZoF2+vE6Sl/HkmYYSNo74YoBhoY1Lo9VxcdZsqTw7uawKaRMqEBzCb3MVQ==", "dev": true, - "license": "MIT", "dependencies": { "@bem-react/classname": "^1.6.0", "@gravity-ui/date-utils": "^2.5.3", @@ -3006,11 +3140,10 @@ } }, "node_modules/@gravity-ui/dynamic-forms": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@gravity-ui/dynamic-forms/-/dynamic-forms-4.14.2.tgz", - "integrity": "sha512-luBKdYZ2tzthnWMPJ7oGOzEMiFN9pNvkRJZntpj6uRkogXBUWhp7X3Embp7ScNr/behqLpn0utkCrcwKigFxmQ==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@gravity-ui/dynamic-forms/-/dynamic-forms-4.14.3.tgz", + "integrity": "sha512-twJbOLRRY1aQR+2RvBfgaHenMoKiGKapYUKtyo17oONVOenFjTASj1dzS2GYUtkVy/Nz3TwLjkF9jo4GXH6s0A==", "dev": true, - "license": "MIT", "dependencies": { "@bem-react/classname": "^1.6.0", "@gravity-ui/components": "^3.0.0", @@ -3081,11 +3214,10 @@ } }, "node_modules/@gravity-ui/page-constructor": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@gravity-ui/page-constructor/-/page-constructor-5.30.0.tgz", - "integrity": "sha512-C6XMZYgADerNTZ3oxOEwvvdg5rPX+stEx79Yi1IdlZZlvV6CCSfo+oFhyJ+hyxeQXLxQtJyLrLb2oO3DAbABlw==", + "version": "5.31.1", + "resolved": "https://registry.npmjs.org/@gravity-ui/page-constructor/-/page-constructor-5.31.1.tgz", + "integrity": "sha512-ZOS8u0BxhTRk1R3BDsObFDrvHUVt4GF4DWQvxXeoTL+mZAety14xhwBU3NRMY/eBd4eYYv4PNN8N7Uj7wXitcw==", "dev": true, - "license": "MIT", "dependencies": { "@bem-react/classname": "^1.6.0", "@gravity-ui/components": "^3.8.0", @@ -3130,7 +3262,6 @@ "url": "https://github.com/sponsors/fb55" } ], - "license": "MIT", "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.3", @@ -3143,7 +3274,6 @@ "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-2.12.1.tgz", "integrity": "sha512-Plh+JAn0UVDpBRP/xEjsk+xDCoOvMBwQUf/K+/cBAVuTbtX8bj2VB7S1sL1dssVpykqp0/KPSesHrqXtokVBpA==", "dev": true, - "license": "MIT", "dependencies": { "deepmerge": "^4.2.2", "escape-string-regexp": "^4.0.0", @@ -3646,7 +3776,6 @@ "resolved": "https://registry.npmjs.org/@react-spring/animated/-/animated-9.7.5.tgz", "integrity": "sha512-Tqrwz7pIlsSDITzxoLS3n/v/YCUHQdOIKtOJf4yL6kYVSDTSmVK1LI1Q3M/uu2Sx4X3pIWF3xLUhlsA6SPNTNg==", "dev": true, - "license": "MIT", "dependencies": { "@react-spring/shared": "~9.7.5", "@react-spring/types": "~9.7.5" @@ -3660,7 +3789,6 @@ "resolved": "https://registry.npmjs.org/@react-spring/core/-/core-9.7.5.tgz", "integrity": "sha512-rmEqcxRcu7dWh7MnCcMXLvrf6/SDlSokLaLTxiPlAYi11nN3B5oiCUAblO72o+9z/87j2uzxa2Inm8UbLjXA+w==", "dev": true, - "license": "MIT", "dependencies": { "@react-spring/animated": "~9.7.5", "@react-spring/shared": "~9.7.5", @@ -3678,15 +3806,13 @@ "version": "9.7.5", "resolved": "https://registry.npmjs.org/@react-spring/rafz/-/rafz-9.7.5.tgz", "integrity": "sha512-5ZenDQMC48wjUzPAm1EtwQ5Ot3bLIAwwqP2w2owG5KoNdNHpEJV263nGhCeKKmuA3vG2zLLOdu3or6kuDjA6Aw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@react-spring/shared": { "version": "9.7.5", "resolved": "https://registry.npmjs.org/@react-spring/shared/-/shared-9.7.5.tgz", "integrity": "sha512-wdtoJrhUeeyD/PP/zo+np2s1Z820Ohr/BbuVYv+3dVLW7WctoiN7std8rISoYoHpUXtbkpesSKuPIw/6U1w1Pw==", "dev": true, - "license": "MIT", "dependencies": { "@react-spring/rafz": "~9.7.5", "@react-spring/types": "~9.7.5" @@ -3699,15 +3825,13 @@ "version": "9.7.5", "resolved": "https://registry.npmjs.org/@react-spring/types/-/types-9.7.5.tgz", "integrity": "sha512-HVj7LrZ4ReHWBimBvu2SKND3cDVUPWKLqRTmWe/fNY6o1owGOX0cAHbdPDTMelgBlVbrTKrre6lFkhqGZErK/g==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@react-spring/web": { "version": "9.7.5", "resolved": "https://registry.npmjs.org/@react-spring/web/-/web-9.7.5.tgz", "integrity": "sha512-lmvqGwpe+CSttsWNZVr+Dg62adtKhauGwLyGE/RRyZ8AAMLgb9x3NDMA5RMElXo+IMyTkPp7nxTB8ZQlmhb6JQ==", "dev": true, - "license": "MIT", "dependencies": { "@react-spring/animated": "~9.7.5", "@react-spring/core": "~9.7.5", @@ -4852,6 +4976,12 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "license": "MIT" }, + "node_modules/@types/linkify-it": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.5.tgz", + "integrity": "sha512-yg6E+u0/+Zjva+buc3EIb+29XEg4wltq7cSmd4Uc2EE/1nUVmxyzpX6gUXD0V8jIrG0r7YeOGVIbYRkxeooCtw==", + "peer": true + }, "node_modules/@types/lodash": { "version": "4.14.195", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.195.tgz", @@ -4859,6 +4989,16 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/markdown-it": { + "version": "13.0.9", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-13.0.9.tgz", + "integrity": "sha512-1XPwR0+MgXLWfTn9gCsZ55AHOKW1WN+P9vr0PaQh5aerR9LLQXUbjfEAFhjmEmyoYFWAyuN2Mqkn40MZ4ukjBw==", + "peer": true, + "dependencies": { + "@types/linkify-it": "^3", + "@types/mdurl": "^1" + } + }, "node_modules/@types/mdast": { "version": "3.0.15", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", @@ -4868,6 +5008,12 @@ "@types/unist": "^2" } }, + "node_modules/@types/mdurl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.5.tgz", + "integrity": "sha512-6L6VymKTzYSrEf4Nev4Xa1LCHKrlTlYCBMTlQKFuddo1CvQcE52I0mwfOJayueUC7MJuXOeHTcIU683lzd0cUA==", + "peer": true + }, "node_modules/@types/mime-types": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/@types/mime-types/-/mime-types-2.1.4.tgz", @@ -6264,8 +6410,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/consolidated-events/-/consolidated-events-2.0.2.tgz", "integrity": "sha512-2/uRVMdRypf5z/TW/ncD/66l75P5hH2vM/GR8Jf8HLc2xnfJtmina6F6du8+v4Z2vTrMo7jC+W1tmEEuuELgkQ==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/convert-source-map": { "version": "2.0.0", @@ -7288,7 +7433,6 @@ "resolved": "https://registry.npmjs.org/dom7/-/dom7-3.0.0.tgz", "integrity": "sha512-oNlcUdHsC4zb7Msx7JN3K0Nro1dzJ48knvBOnDPKJ2GV9wl1i5vydJZUSyOfrkKFDZEud/jBsTk92S/VGSAe/g==", "dev": true, - "license": "MIT", "dependencies": { "ssr-window": "^3.0.0-alpha.1" } @@ -7345,7 +7489,6 @@ "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", "dev": true, - "license": "MIT", "dependencies": { "no-case": "^3.0.4", "tslib": "^2.0.3" @@ -7406,8 +7549,7 @@ "version": "2.1.6", "resolved": "https://registry.npmjs.org/enquire.js/-/enquire.js-2.1.6.tgz", "integrity": "sha512-/KujNpO+PT63F7Hlpu4h3pE3TokKRHN26JYmQpPyjkRD/N57R7bPDNojMXdi7uveAKjYB7yQnartCxZnFWr0Xw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/ensure-posix-path": { "version": "1.1.1", @@ -8477,7 +8619,6 @@ "resolved": "https://registry.npmjs.org/final-form/-/final-form-4.20.10.tgz", "integrity": "sha512-TL48Pi1oNHeMOHrKv1bCJUrWZDcD3DIG6AGYVNOnyZPr7Bd/pStN0pL+lfzF5BNoj/FclaoiaLenk4XUIFVYng==", "dev": true, - "license": "MIT", "dependencies": { "@babel/runtime": "^7.10.0" }, @@ -8770,8 +8911,7 @@ "version": "2.23.0", "resolved": "https://registry.npmjs.org/github-buttons/-/github-buttons-2.23.0.tgz", "integrity": "sha512-2REUOV3ue6NmT0QThhfzfYmeSoYpCG73+tL7Ir2C7P+gshRerI05WuIQuhDkE2Zlg5Wc39hc2DHj+pE23mGJvw==", - "dev": true, - "license": "BSD-2-Clause" + "dev": true }, "node_modules/github-slugger": { "version": "1.5.0", @@ -9869,7 +10009,6 @@ "resolved": "https://registry.npmjs.org/js-yaml-source-map/-/js-yaml-source-map-0.2.2.tgz", "integrity": "sha512-z45Aww8oXJh9GuWUnwmvHsAkB7I/oWrkoHU554UQ8Ik4dyhVrk/nwClTI435feU7QIy7E0XaW8jHvZ4QxaAjog==", "dev": true, - "license": "MIT", "peerDependencies": { "js-yaml": "^4.0.0" } @@ -9928,7 +10067,6 @@ "resolved": "https://registry.npmjs.org/json2mq/-/json2mq-0.2.0.tgz", "integrity": "sha512-SzoRg7ux5DWTII9J2qkrZrqV1gt+rTaoufMxEzXbS26Uid0NwaJd123HcoB80TgubEppxxIGdNxCx50fEoEWQA==", "dev": true, - "license": "MIT", "dependencies": { "string-convert": "^0.2.0" } @@ -10244,8 +10382,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/load-script/-/load-script-1.0.0.tgz", "integrity": "sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/local-pkg": { "version": "0.5.1", @@ -10295,8 +10432,7 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/lodash.merge": { "version": "4.6.2", @@ -10421,7 +10557,6 @@ "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", "dev": true, - "license": "MIT", "dependencies": { "tslib": "^2.0.3" } @@ -10554,6 +10689,15 @@ "integrity": "sha512-3OuqoRUlSxJiuQYu0cWTLHNhhq2xtoSFqsZK8plANg91+RJQU1ziQ6lA2LzmFAEes18uPBsHZpcX6We5l76Nzg==", "license": "MIT" }, + "node_modules/markdown-it-directive": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/markdown-it-directive/-/markdown-it-directive-2.0.4.tgz", + "integrity": "sha512-XtGbBcP0aoRgKiDIIsxvgSXZz3ptI5AOydLAfF+n/LRmdy4ROdHntboJMEg8Fd0B+SMtOynCpiDFDKboatPbMw==", + "peerDependencies": { + "@types/markdown-it": "^12.0.0 || ^13.0.0", + "markdown-it": "^12.0.0 || ^13.0.0" + } + }, "node_modules/markdown-it-meta": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/markdown-it-meta/-/markdown-it-meta-0.0.1.tgz", @@ -11404,8 +11548,7 @@ "version": "0.38.0", "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.38.0.tgz", "integrity": "sha512-11Fkh6yzEmwx7O0YoLxeae0qEGFwmyPRlVxpg7oF9czOOCB/iCjdJrG5I67da5WiXK3YJCxoz9TJFE8Tfq/v9A==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/mri": { "version": "1.2.0", @@ -11451,7 +11594,6 @@ "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", "dev": true, - "license": "MIT", "dependencies": { "lower-case": "^2.0.2", "tslib": "^2.0.3" @@ -12379,7 +12521,6 @@ "resolved": "https://registry.npmjs.org/react-final-form/-/react-final-form-6.5.9.tgz", "integrity": "sha512-x3XYvozolECp3nIjly+4QqxdjSSWfcnpGEL5K8OBT6xmGrq5kBqbA6+/tOqoom9NwqIPPbxPNsOViFlbKgowbA==", "dev": true, - "license": "MIT", "dependencies": { "@babel/runtime": "^7.15.4" }, @@ -12460,7 +12601,6 @@ "resolved": "https://registry.npmjs.org/react-monaco-editor/-/react-monaco-editor-0.53.0.tgz", "integrity": "sha512-ZITzsauH4CsicCGddtpgjRACaKNTVEL2hnjYFx8QMuc8zmsgfgq7D2GcF8OQsa2URIdGm/Zl7YwY2fmWpvqs/g==", "dev": true, - "license": "MIT", "dependencies": { "prop-types": "^15.8.1" }, @@ -12475,7 +12615,6 @@ "resolved": "https://registry.npmjs.org/react-player/-/react-player-2.16.0.tgz", "integrity": "sha512-mAIPHfioD7yxO0GNYVFD1303QFtI3lyyQZLY229UEAp/a10cSW+hPcakg0Keq8uWJxT2OiT/4Gt+Lc9bD6bJmQ==", "dev": true, - "license": "MIT", "dependencies": { "deepmerge": "^4.0.0", "load-script": "^1.0.0", @@ -12544,7 +12683,6 @@ "resolved": "https://registry.npmjs.org/react-slick/-/react-slick-0.29.0.tgz", "integrity": "sha512-TGdOKE+ZkJHHeC4aaoH85m8RnFyWqdqRfAGkhd6dirmATXMZWAxOpTLmw2Ll/jPTQ3eEG7ercFr/sbzdeYCJXA==", "dev": true, - "license": "MIT", "dependencies": { "classnames": "^2.2.5", "enquire.js": "^2.1.6", @@ -12591,7 +12729,6 @@ "resolved": "https://registry.npmjs.org/react-waypoint/-/react-waypoint-10.3.0.tgz", "integrity": "sha512-iF1y2c1BsoXuEGz08NoahaLFIGI9gTUAAOKip96HUmylRT6DUtpgoBPjk/Y8dfcFVmfVDvUzWjNXpZyKTOV0SQ==", "dev": true, - "license": "MIT", "dependencies": { "@babel/runtime": "^7.12.5", "consolidated-events": "^1.1.0 || ^2.0.0", @@ -13346,7 +13483,6 @@ "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", "dev": true, - "license": "MIT", "dependencies": { "dot-case": "^3.0.4", "tslib": "^2.0.3" @@ -13357,7 +13493,6 @@ "resolved": "https://registry.npmjs.org/snakecase-keys/-/snakecase-keys-5.5.0.tgz", "integrity": "sha512-r3kRtnoPu3FxGJ3fny6PKNnU3pteb29o6qAa0ugzhSseKNWRkw1dw8nIjXMyyKaU9vQxxVIE62Mb3bKbdrgpiw==", "dev": true, - "license": "MIT", "dependencies": { "map-obj": "^4.1.0", "snake-case": "^3.0.4", @@ -13372,7 +13507,6 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=14.16" }, @@ -13451,8 +13585,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-3.0.0.tgz", "integrity": "sha512-q+8UfWDg9Itrg0yWK7oe5p/XRCJpJF9OBtXfOPgSJl+u3Xd5KI328RUEvUqSMVM9CiQUEf1QdBzJMkYGErj9QA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/stackback": { "version": "0.0.2", @@ -13496,8 +13629,7 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/string-convert/-/string-convert-0.2.1.tgz", "integrity": "sha512-u/1tdPl4yQnPBjnVrmdLo9gtuLvELKsAoRapekWggdiQNvvvum+jYF329d84NAa660KQw7pB2n36KrIKVoXa3A==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/string-width": { "version": "5.1.2", @@ -14042,7 +14174,6 @@ } ], "hasInstallScript": true, - "license": "MIT", "dependencies": { "dom7": "^3.0.0", "ssr-window": "^3.0.0" @@ -14545,7 +14676,6 @@ "resolved": "https://registry.npmjs.org/typograf/-/typograf-6.15.1.tgz", "integrity": "sha512-G1IIJlh4ycW+rvTspdgZKQoj/fKpmwif6MUhrmn3LY50W8njRnBqdFIJcfDqbmDg+RmmP51R9jdjjMwBYA5P0Q==", "dev": true, - "license": "MIT", "engines": { "node": ">= 4" } @@ -14705,7 +14835,6 @@ "resolved": "https://registry.npmjs.org/utility-types/-/utility-types-3.11.0.tgz", "integrity": "sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw==", "dev": true, - "license": "MIT", "engines": { "node": ">= 4" } diff --git a/package.json b/package.json index 092bb027..60a3ef0e 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "@diplodoc/openapi-extension": "^2.6.0", "@diplodoc/prettier-config": "^2.0.0", "@diplodoc/search-extension": "^1.1.5", - "@diplodoc/transform": "^4.38.2", + "@diplodoc/transform": "^0.0.0-rc-ways-to-interface-with-collect-202412111442", "@diplodoc/tsconfig": "^1.0.2", "@gravity-ui/page-constructor": "^5.29.1", "@octokit/core": "4.2.4", diff --git a/src/constants.ts b/src/constants.ts index 9091ac78..5416e5bb 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -124,6 +124,28 @@ export const YFM_PLUGINS = [ blockAnchor, ]; +export const MD2MD_PARSER_PLUGINS = [ + meta, + deflist, + cut, + images, + notes, + anchors, + tabs, + code, + imsize, + sup, + video, + monospace, + table, + term, + openapi.transform(), + mermaid.transform({bundle: false}), + latex.transform({bundle: false}), + changelog, + blockAnchor, +]; + export const CARRIAGE_RETURN = platform === Platforms.WINDOWS ? '\r\n' : '\n'; export const PROCESSING_FINISHED = 'Processing finished:'; diff --git a/src/models.ts b/src/models.ts index 16680fd5..1f580c64 100644 --- a/src/models.ts +++ b/src/models.ts @@ -26,7 +26,6 @@ export type NestedContributorsForPathFunction = ( nestedContributors: Contributors, ) => void; export type UserByLoginFunction = (login: string) => Promise; -export type CollectionOfPluginsFunction = (output: string, options: PluginOptions) => string; export type GetModifiedTimeByPathFunction = (filepath: string) => number | undefined; /** @@ -241,7 +240,6 @@ export interface PluginOptions { root?: string; destPath?: string; destRoot?: string; - collectOfPlugins?: (input: string, options: PluginOptions) => string; changelogs?: ChangelogItem[]; extractChangelogs?: boolean; included?: boolean; diff --git a/src/resolvers/md2md.ts b/src/resolvers/md2md.ts index 300913f3..1dc74ee6 100644 --- a/src/resolvers/md2md.ts +++ b/src/resolvers/md2md.ts @@ -5,11 +5,14 @@ import log from '@diplodoc/transform/lib/log'; import liquid from '@diplodoc/transform/lib/liquid'; import {ArgvService, PluginService} from '../services'; -import {getVarsPerFile, logger} from '../utils'; +import {getVarsPerFile, getVarsPerRelativeFile, logger} from '../utils'; import {PluginOptions, ResolveMd2MdOptions} from '../models'; -import {PROCESSING_FINISHED} from '../constants'; +import {MD2MD_PARSER_PLUGINS, PROCESSING_FINISHED} from '../constants'; import {ChangelogItem} from '@diplodoc/transform/lib/plugins/changelog/types'; import {enrichWithFrontMatter} from '../services/metadata'; +import transform from '@diplodoc/transform'; +import {MarkdownItPluginCb} from '@diplodoc/transform/lib/plugins/typings'; +import {getPublicPath} from '@diplodoc/transform/lib/utilsFS'; export async function resolveMd2Md(options: ResolveMd2MdOptions): Promise { const {inputPath, outputPath, metadata: metadataOptions} = options; @@ -32,7 +35,6 @@ export async function resolveMd2Md(options: ResolveMd2MdOptions): Promise destPath: outputPath, root: resolve(input), destRoot: resolve(output), - collectOfPlugins: PluginService.getCollectOfPlugins(), vars: vars, log, copyFile, @@ -105,28 +107,36 @@ export function liquidMd2Md(input: string, vars: Record, path: } function transformMd2Md(input: string, options: PluginOptions) { - const {disableLiquid, changelogs: changelogsSetting} = ArgvService.getConfig(); - const {vars = {}, path, collectOfPlugins, log: pluginLog} = options; + const {input: inputDir, changelogs: changelogsSetting, ...mdOptions} = ArgvService.getConfig(); + const plugins = PluginService.getPlugins(); + const {vars = {}, path, log: pluginLog} = options; - let output = input; - const changelogs: ChangelogItem[] = []; - - if (!disableLiquid) { - const liquidResult = liquidMd2Md(input, vars, path); + const root = resolve(inputDir); - output = liquidResult.output; - } + const changelogs: ChangelogItem[] = []; - if (collectOfPlugins) { - output = collectOfPlugins(output, { + const output = transform.collect(input, { + mdItInitOptions: { + mdOptions, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + plugins: plugins as MarkdownItPluginCb[], + vars, + root, + path, + assetsPublicPath: './', + getVarsPerFile: getVarsPerRelativeFile, + getPublicPath, + extractTitle: true, + }, + pluginCollectOptions: { ...options, vars, path, - collectOfPlugins, changelogs, extractChangelogs: Boolean(changelogsSetting), - }); - } + }, + parserPluginsOverride: MD2MD_PARSER_PLUGINS, + }); return { result: output, diff --git a/src/services/plugins.ts b/src/services/plugins.ts index b941a0ab..46ee6cae 100644 --- a/src/services/plugins.ts +++ b/src/services/plugins.ts @@ -1,42 +1,18 @@ import {LintConfig, LintRule} from '@diplodoc/transform/lib/yfmlint'; -import {CollectionOfPluginsFunction, Plugin, PluginOptions} from '../models'; +import {Plugin} from '../models'; import {YFM_PLUGINS} from '../constants'; let plugins: Function[] | Plugin[]; -let collectionOfPlugins: CollectionOfPluginsFunction; export function setPlugins(): void { plugins = getAllPlugins(); - collectionOfPlugins = makeCollectOfPlugins(); } export function getPlugins() { return plugins; } -export function getCollectOfPlugins(): CollectionOfPluginsFunction { - return collectionOfPlugins; -} - -function makeCollectOfPlugins(): CollectionOfPluginsFunction { - const pluginsWithCollect = (plugins as Plugin[]).filter((plugin: Plugin) => { - return typeof plugin.collect === 'function'; - }); - - return (output: string, options: PluginOptions) => { - let collectsOutput = output; - - pluginsWithCollect.forEach((plugin: Plugin) => { - const collectOutput = plugin.collect(collectsOutput, options); - - collectsOutput = typeof collectOutput === 'string' ? collectOutput : collectsOutput; - }); - - return collectsOutput; - }; -} - function getAllPlugins(): Function[] { const customPlugins = getCustomPlugins(); return [...YFM_PLUGINS, ...customPlugins];