From 10baf4db8aa6426e55613134fd1086a6eeb0274a Mon Sep 17 00:00:00 2001 From: Marcell Toth Date: Mon, 29 Mar 2021 14:04:30 +0200 Subject: [PATCH 1/8] feat: bump jsv --- packages/elements/package.json | 2 +- yarn.lock | 396 ++++++++++++++++++++++++++++++++- 2 files changed, 396 insertions(+), 2 deletions(-) diff --git a/packages/elements/package.json b/packages/elements/package.json index 067ccc6d8..204b5e020 100644 --- a/packages/elements/package.json +++ b/packages/elements/package.json @@ -49,7 +49,7 @@ "@stoplight/http-spec": "^3.1.1", "@stoplight/json": "^3.10.0", "@stoplight/json-schema-ref-parser": "^9.0.5", - "@stoplight/json-schema-viewer": "^3.0.0", + "@stoplight/json-schema-viewer": "^4.0.0-beta.7", "@stoplight/markdown": "^2.10.0", "@stoplight/markdown-viewer": "^4.3.3", "@stoplight/mosaic": "1.0.0-beta.33", diff --git a/yarn.lock b/yarn.lock index eb5d74240..3eaa5b059 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1838,6 +1838,21 @@ resolved "https://registry.yarnpkg.com/@icons/material/-/material-0.2.4.tgz#e90c9f71768b3736e76d7dd6783fc6c2afa88bc8" integrity sha512-QPcGmICAPbGLGb6F/yNf/KzKqvFx8z5qx3D1yFqVAjoFmXK35EgyW+cJ57Te3CNsmzblwtzakLGFqHPqrfb4Tw== +"@internationalized/message@3.0.0-alpha.0": + version "3.0.0-alpha.0" + resolved "https://registry.yarnpkg.com/@internationalized/message/-/message-3.0.0-alpha.0.tgz#83015e2057d2b6b5034a3e23983b1e051f9d9e36" + integrity sha512-NT2eiVq5f5z7Yi9Hmchb8GAGYjEpYbYcD4u/Oxo5XG9XFbrnz7zNvrJJlzuQ+2jPozabq6pFKurqaFmM49DYUg== + dependencies: + "@babel/runtime" "^7.6.2" + intl-messageformat "^2.2.0" + +"@internationalized/number@3.0.0-alpha.0": + version "3.0.0-alpha.0" + resolved "https://registry.yarnpkg.com/@internationalized/number/-/number-3.0.0-alpha.0.tgz#27190fbc1d73a24ac96dfafdfe7aa4e520090eed" + integrity sha512-8aOD2I3HmEscIZO/cm1jkcrYMSmRPhoW9G1OsuQb4Ge/Y9HsJVGB9otTylUEXJUmoXi/eD8Mr1gx3+0FLCM4eA== + dependencies: + "@babel/runtime" "^7.6.2" + "@istanbuljs/load-nyc-config@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz#10602de5570baea82f8afbfa2630b24e7a8cfe5b" @@ -3192,6 +3207,19 @@ "@react-stately/toggle" "^3.2.1" "@react-types/button" "^3.3.0" +"@react-aria/button@^3.3.1": + version "3.3.1" + resolved "https://registry.yarnpkg.com/@react-aria/button/-/button-3.3.1.tgz#f180ffa95e3e822b7da4937421cf8280dd17af17" + integrity sha512-LXNuo0L79AhYqnxV+Y3J3xt7hPcmCVCEpZaC/dBzovR1MLunrdpk3QAXsRt3tqza1XvoqdvNhNHQm1Z1kyBTUg== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/focus" "^3.2.2" + "@react-aria/i18n" "^3.3.0" + "@react-aria/interactions" "^3.3.3" + "@react-aria/utils" "^3.6.0" + "@react-stately/toggle" "^3.2.1" + "@react-types/button" "^3.3.1" + "@react-aria/dialog@^3.1.2": version "3.1.2" resolved "https://registry.yarnpkg.com/@react-aria/dialog/-/dialog-3.1.2.tgz#868970e7fdaa6ddb91a0d8d5b492778607d417fd" @@ -3214,6 +3242,17 @@ "@react-types/shared" "^3.3.0" clsx "^1.1.1" +"@react-aria/focus@^3.2.4": + version "3.2.4" + resolved "https://registry.yarnpkg.com/@react-aria/focus/-/focus-3.2.4.tgz#86c4fbde51a7cae414407b2d421fb5b311cd62f5" + integrity sha512-qoJoUDSriI7RCRq3L7yDOPtFZfquyjLA9d2pOJzvMx1F6dEqfNCaycyIg9lHykHXXhShgrXwfpyGTXoSUQpmtw== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/interactions" "^3.3.4" + "@react-aria/utils" "^3.7.0" + "@react-types/shared" "^3.5.0" + clsx "^1.1.1" + "@react-aria/i18n@^3.2.0": version "3.2.0" resolved "https://registry.yarnpkg.com/@react-aria/i18n/-/i18n-3.2.0.tgz#d49f4990fe3f125545686121edc129007bcd9233" @@ -3224,6 +3263,18 @@ "@react-types/shared" "^3.3.0" intl-messageformat "^2.2.0" +"@react-aria/i18n@^3.3.0": + version "3.3.0" + resolved "https://registry.yarnpkg.com/@react-aria/i18n/-/i18n-3.3.0.tgz#7f92ae81f6536b19b17b89c0991ddb6c10f2512a" + integrity sha512-8KYk0tQiEf9Kd9xdF4cKliP1169WSIryKFnZgnm9dvZl96TyfDK1xJpZQy58XjRdbS/H45CKydFmMcZEElu3BQ== + dependencies: + "@babel/runtime" "^7.6.2" + "@internationalized/message" "3.0.0-alpha.0" + "@internationalized/number" "3.0.0-alpha.0" + "@react-aria/ssr" "^3.0.1" + "@react-aria/utils" "^3.6.0" + "@react-types/shared" "^3.4.0" + "@react-aria/interactions@^3.2.1", "@react-aria/interactions@^3.3.0", "@react-aria/interactions@^3.3.2": version "3.3.2" resolved "https://registry.yarnpkg.com/@react-aria/interactions/-/interactions-3.3.2.tgz#2ac1950a73152563b298f1b88d0a946f7e42933f" @@ -3233,6 +3284,57 @@ "@react-aria/utils" "^3.4.1" "@react-types/shared" "^3.3.0" +"@react-aria/interactions@^3.3.3", "@react-aria/interactions@^3.3.4": + version "3.3.4" + resolved "https://registry.yarnpkg.com/@react-aria/interactions/-/interactions-3.3.4.tgz#a5b3a87f886cf0f4e28cbd13fbe02c7efb4f1e2e" + integrity sha512-WzT9aIRWvLZvZvuwNKKUkZzeomZgIrquAtwgRYGWbjSbrYPOT9B3w/GBEWZDYUG0c1K8NkIEAxTX0e+QI+tqAA== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/utils" "^3.7.0" + "@react-types/shared" "^3.5.0" + +"@react-aria/label@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@react-aria/label/-/label-3.1.1.tgz#03dc5c4813cd1f51760ba48783c186c2eeda1189" + integrity sha512-9kZKJonYSXeY6hZULZrsujAb6uXDGEy8qPq0tjTVoTA3+gx26LOmLCLgvHFtxUK1e4s99rHmaSPdOtq5qu3EVQ== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/utils" "^3.3.0" + "@react-types/label" "^3.2.1" + "@react-types/shared" "^3.2.1" + +"@react-aria/listbox@^3.2.4": + version "3.2.4" + resolved "https://registry.yarnpkg.com/@react-aria/listbox/-/listbox-3.2.4.tgz#3162e47d64e1f6cd8fdfe45766cb88c3852a525d" + integrity sha512-IYs4oS2wzWVcWEtKG57zZLZI507WlDy24wuzymwgFxxIRXDVaBsSMOs7+uE7N1P4fLOa1yAlv170AvKDDbIJ2g== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/interactions" "^3.3.3" + "@react-aria/label" "^3.1.1" + "@react-aria/selection" "^3.3.2" + "@react-aria/utils" "^3.6.0" + "@react-stately/collections" "^3.3.0" + "@react-stately/list" "^3.2.2" + "@react-types/listbox" "^3.1.1" + "@react-types/shared" "^3.4.0" + +"@react-aria/menu@^3.2.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@react-aria/menu/-/menu-3.2.0.tgz#cd9417105b3230f1c34ddddddb31a95f462393e2" + integrity sha512-CFgC82ZO/LjJtMhDUJFdE3+PV0jS88LK9CCr6w11ggp+U3Q2fPXPdkAVeEB3cJn4KI0TRCBgE+4EneIzdTEgcw== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/interactions" "^3.3.4" + "@react-aria/overlays" "^3.6.2" + "@react-aria/selection" "^3.4.0" + "@react-aria/utils" "^3.7.0" + "@react-stately/collections" "^3.3.1" + "@react-stately/menu" "^3.2.1" + "@react-stately/tree" "^3.1.3" + "@react-types/button" "^3.3.1" + "@react-types/menu" "^3.1.1" + "@react-types/shared" "^3.5.0" + "@react-aria/overlays@^3.6.0": version "3.6.0" resolved "https://registry.yarnpkg.com/@react-aria/overlays/-/overlays-3.6.0.tgz#f226f3ce2fcf6db614dde0719f47fd98da931fb8" @@ -3248,6 +3350,62 @@ "@react-types/overlays" "^3.4.0" dom-helpers "^3.3.1" +"@react-aria/overlays@^3.6.1", "@react-aria/overlays@^3.6.2": + version "3.6.2" + resolved "https://registry.yarnpkg.com/@react-aria/overlays/-/overlays-3.6.2.tgz#0a9fcb7426d4321dc80ee636282228eb7be83a84" + integrity sha512-6f9o1fypGcB/VcprvoDm5280glaiAp/9RZeNPP+HPXE5MxpQIzFDJCzTrSezAUYNkueh/KNMpUxOUUgytloScQ== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/i18n" "^3.3.0" + "@react-aria/interactions" "^3.3.4" + "@react-aria/utils" "^3.7.0" + "@react-aria/visually-hidden" "^3.2.1" + "@react-stately/overlays" "^3.1.1" + "@react-types/button" "^3.3.1" + "@react-types/overlays" "^3.4.0" + dom-helpers "^3.3.1" + +"@react-aria/select@^3.3.0": + version "3.3.1" + resolved "https://registry.yarnpkg.com/@react-aria/select/-/select-3.3.1.tgz#cfa694ff4b2020846e08b58f6f0a489f0d2b24ff" + integrity sha512-E/EZ4SKf8P5EMVznCmTjfa9y1cR6L+WIzXHTFAlwrmmIzNirHSipbFp6LpJzoByqd0p9IKxhBdxqFP92url0Qg== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/i18n" "^3.3.0" + "@react-aria/interactions" "^3.3.4" + "@react-aria/label" "^3.1.1" + "@react-aria/menu" "^3.2.0" + "@react-aria/selection" "^3.4.0" + "@react-aria/utils" "^3.7.0" + "@react-aria/visually-hidden" "^3.2.1" + "@react-stately/select" "^3.1.1" + "@react-types/button" "^3.3.1" + "@react-types/select" "^3.2.0" + "@react-types/shared" "^3.5.0" + +"@react-aria/selection@^3.3.2", "@react-aria/selection@^3.4.0": + version "3.4.0" + resolved "https://registry.yarnpkg.com/@react-aria/selection/-/selection-3.4.0.tgz#abd7aa5435f504e314a72122f2bcaef43b06fa78" + integrity sha512-ddxiB9zhy8JEkG4+DElSMNrSKxRI3RQKyOwQf4i3omqXj8bMH1XJesFwbdGNmR/zrbzXvr35ln9y3S0WS+4ClA== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/focus" "^3.2.4" + "@react-aria/i18n" "^3.3.0" + "@react-aria/interactions" "^3.3.4" + "@react-aria/utils" "^3.7.0" + "@react-stately/collections" "^3.3.1" + "@react-stately/selection" "^3.4.0" + "@react-types/shared" "^3.5.0" + +"@react-aria/separator@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@react-aria/separator/-/separator-3.1.1.tgz#bfcd71bb5ab50dc04a7f307b84bd77955f08002f" + integrity sha512-VbiqQsTtKKMjvMcPVWgTbDHzx7qMP3VFC+y9cEVajicMwRoO4bn7kJgcSzainXpWx70bhT5RW1mt84fzxMF+Lg== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/utils" "^3.3.0" + "@react-types/shared" "^3.2.1" + "@react-aria/ssr@^3.0.1": version "3.0.1" resolved "https://registry.yarnpkg.com/@react-aria/ssr/-/ssr-3.0.1.tgz#5f7c111f9ecd184b8f6140139703c1ee552dca30" @@ -3269,6 +3427,20 @@ "@react-types/shared" "^3.3.0" "@react-types/tooltip" "^3.1.0" +"@react-aria/tooltip@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@react-aria/tooltip/-/tooltip-3.1.1.tgz#e0dfdd9e51b581563f684927249d70e1bad761e3" + integrity sha512-wTszWN6lG3A9Ofdrhv1vG9aOmoqzuUZCbG9ZbXZ9+RtiOMwP/WnuSLWXcMH+KaWYpaImy7h1MDfOgHeaPxCbag== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/focus" "^3.2.3" + "@react-aria/interactions" "^3.3.3" + "@react-aria/overlays" "^3.6.1" + "@react-aria/utils" "^3.6.0" + "@react-stately/tooltip" "^3.0.2" + "@react-types/shared" "^3.4.0" + "@react-types/tooltip" "^3.1.1" + "@react-aria/utils@^3.3.0", "@react-aria/utils@^3.4.0", "@react-aria/utils@^3.4.1": version "3.5.0" resolved "https://registry.yarnpkg.com/@react-aria/utils/-/utils-3.5.0.tgz#b377461591f5c8e2157b1635e28ed03cd58e2a22" @@ -3279,6 +3451,17 @@ "@react-types/shared" "^3.3.0" clsx "^1.1.1" +"@react-aria/utils@^3.6.0", "@react-aria/utils@^3.7.0": + version "3.7.0" + resolved "https://registry.yarnpkg.com/@react-aria/utils/-/utils-3.7.0.tgz#0aab1f682e9f1781cfadd2dd1ef9494bfaca0cbf" + integrity sha512-sMCdX0eF+4B05I+SX9V/NzI1/fD45vabi0dNyJhbSu2xNI82VIYgPcMBDjGU83NJSnjY969R3/JbbLjBrtKUgA== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/ssr" "^3.0.1" + "@react-stately/utils" "^3.2.0" + "@react-types/shared" "^3.5.0" + clsx "^1.1.1" + "@react-aria/visually-hidden@^3.2.1": version "3.2.1" resolved "https://registry.yarnpkg.com/@react-aria/visually-hidden/-/visually-hidden-3.2.1.tgz#c022c562346140a473242448045add59269a74fd" @@ -3358,6 +3541,48 @@ "@react-types/shared" "^3.3.0" clsx "^1.1.1" +"@react-spectrum/utils@^3.5.1": + version "3.5.1" + resolved "https://registry.yarnpkg.com/@react-spectrum/utils/-/utils-3.5.1.tgz#dd733913e30e0ed59c6bdae430531283b4cdcc96" + integrity sha512-lSdxCtshkj9dsi9sGcem6s9lak2XT55uyZGZr2S3w6iwm3aS7OlJNoT/4xtUFGW3t1bF2oxNngHX6eLl+quFyw== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/i18n" "^3.3.0" + "@react-aria/ssr" "^3.0.1" + "@react-aria/utils" "^3.6.0" + "@react-types/shared" "^3.4.0" + clsx "^1.1.1" + +"@react-stately/collections@^3.2.1", "@react-stately/collections@^3.3.0", "@react-stately/collections@^3.3.1": + version "3.3.1" + resolved "https://registry.yarnpkg.com/@react-stately/collections/-/collections-3.3.1.tgz#683acf6e7a4e9ea174e1cf82a13bb8175ba0a1a0" + integrity sha512-bBiOj0hszFpCbk9KhSm04Jo87GAODm8kA52uFiGAO99yb2ypO+UTFYseBExFQ59cV7b++UMCfdJe/+Ymv9RALg== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-types/shared" "^3.5.0" + +"@react-stately/list@^3.2.1", "@react-stately/list@^3.2.2": + version "3.2.2" + resolved "https://registry.yarnpkg.com/@react-stately/list/-/list-3.2.2.tgz#fb368cc7678503179202d11aef0ef8d48d1cbf12" + integrity sha512-8sJvy0cUhllhUMadYjX1qKmTxAWMRGxkvZpU/6reOEChlvibjAwbn2paoR8yZ+ppieeQOBe+AAYTl53gK8fKDA== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-stately/collections" "^3.3.0" + "@react-stately/selection" "^3.2.1" + "@react-stately/utils" "^3.1.1" + "@react-types/shared" "^3.2.1" + +"@react-stately/menu@^3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@react-stately/menu/-/menu-3.2.1.tgz#314646217e5dd49fa1da6886d33f485d44d6f0dd" + integrity sha512-8cpCynynjjn3qWNzrZMJEpsdk4tkXK9q3Xaw0ADqVym/NC/wPU3P3cqL4HY+ETar01tS2x8K23qYHbOZz0cQtQ== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-stately/overlays" "^3.1.1" + "@react-stately/utils" "^3.1.1" + "@react-types/menu" "^3.1.1" + "@react-types/shared" "^3.2.1" + "@react-stately/overlays@^3.1.1": version "3.1.1" resolved "https://registry.yarnpkg.com/@react-stately/overlays/-/overlays-3.1.1.tgz#6c1a393b77148184f7b1df22ece832d694d5a8b4" @@ -3367,6 +3592,30 @@ "@react-stately/utils" "^3.1.1" "@react-types/overlays" "^3.2.1" +"@react-stately/select@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@react-stately/select/-/select-3.1.1.tgz#f49602ee7fc71f14550360bfa7c5becab58ac877" + integrity sha512-cl63nW66IJPsn9WQjKvghAIFKdFKuU1txx4zdEGY9tcwB/Yc+bgniLGOOTExJqN/RdPW9uBny5jjWcc4OQXyJA== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-stately/collections" "^3.2.1" + "@react-stately/list" "^3.2.1" + "@react-stately/menu" "^3.2.1" + "@react-stately/selection" "^3.2.1" + "@react-stately/utils" "^3.1.1" + "@react-types/select" "^3.1.1" + "@react-types/shared" "^3.2.1" + +"@react-stately/selection@^3.2.1", "@react-stately/selection@^3.4.0": + version "3.4.0" + resolved "https://registry.yarnpkg.com/@react-stately/selection/-/selection-3.4.0.tgz#795134e17b59f21cc4979b30179bccdfc2e3b9c1" + integrity sha512-5RV9f1Tm4WSTDguL1iizYcgzeWiK6Qe2EZ03zaaE9gm5UyyIrEPQD4WW9Semio2cUF8IFuWLaOvRCk+un7p53Q== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-stately/collections" "^3.3.1" + "@react-stately/utils" "^3.1.1" + "@react-types/shared" "^3.5.0" + "@react-stately/toggle@^3.2.1": version "3.2.1" resolved "https://registry.yarnpkg.com/@react-stately/toggle/-/toggle-3.2.1.tgz#8b10b5eb99c3c4df2c36d17a5f23b77773ed7722" @@ -3387,6 +3636,27 @@ "@react-stately/utils" "^3.1.1" "@react-types/tooltip" "^3.1.0" +"@react-stately/tooltip@^3.0.2": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@react-stately/tooltip/-/tooltip-3.0.3.tgz#577fbf3cca39db7047ec2d77ddc03a56c454a82a" + integrity sha512-N98S8ccHEpgbgM6wIMZwqz37s8IQTa+5nPr8eVnIs5wqwdnAARFjvckr2okOGwaksofp1wtpcYbnNrIBwexJOg== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-stately/overlays" "^3.1.1" + "@react-stately/utils" "^3.2.0" + "@react-types/tooltip" "^3.1.1" + +"@react-stately/tree@^3.1.3": + version "3.1.3" + resolved "https://registry.yarnpkg.com/@react-stately/tree/-/tree-3.1.3.tgz#5ceb1aa3793836a503253ddd47fc9227ac59c7b4" + integrity sha512-xwM2C3ppd8yJfduwgff7Gl2bNPMVeF4K65InFJZNVx5JLKFF6DJLAPTORAHLpCN+AoB8bY4sRK3V5fNBVpz0oQ== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-stately/collections" "^3.3.1" + "@react-stately/selection" "^3.4.0" + "@react-stately/utils" "^3.1.1" + "@react-types/shared" "^3.5.0" + "@react-stately/utils@^3.1.1": version "3.1.1" resolved "https://registry.yarnpkg.com/@react-stately/utils/-/utils-3.1.1.tgz#e2f2c3ef81cfc6850a3418cb0f050c33d123620a" @@ -3394,6 +3664,13 @@ dependencies: "@babel/runtime" "^7.6.2" +"@react-stately/utils@^3.2.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@react-stately/utils/-/utils-3.2.0.tgz#0b90a70fee3236025ad8bed1f0e3555d5fc10296" + integrity sha512-vVBJvHVLnQySgqZ7OfP3ngDdwfGscJDsSD3WcN5ntHiT3JlZ5bksQReDkJEs20SFu2ST4w/0K7O4m97SbuMl2Q== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-types/button@^3.3.0": version "3.3.0" resolved "https://registry.yarnpkg.com/@react-types/button/-/button-3.3.0.tgz#69b90b048948300342aba7546b6b5add7ee401f8" @@ -3401,6 +3678,13 @@ dependencies: "@react-types/shared" "^3.2.1" +"@react-types/button@^3.3.1": + version "3.3.1" + resolved "https://registry.yarnpkg.com/@react-types/button/-/button-3.3.1.tgz#4bdd325bc7df19c33911af256f63eae91e2a452e" + integrity sha512-xKLGSzGfsDBMe0SM7icOLNmzW38sdNSDSGMdrTLd3ygxb6pXY/LlcTdx7Sq28hdW8XL/ikFAnoQeS1VLXZHj7w== + dependencies: + "@react-types/shared" "^3.4.0" + "@react-types/checkbox@^3.2.1": version "3.2.1" resolved "https://registry.yarnpkg.com/@react-types/checkbox/-/checkbox-3.2.1.tgz#971dfd8428e43ce34b063388d1c742bbba0a8dc6" @@ -3416,6 +3700,28 @@ "@react-types/overlays" "^3.2.1" "@react-types/shared" "^3.2.1" +"@react-types/label@^3.2.1": + version "3.4.0" + resolved "https://registry.yarnpkg.com/@react-types/label/-/label-3.4.0.tgz#6023dc9dd0146324ead52e08540cd60e57a3e27f" + integrity sha512-l84ysm1dcjL/5qVk9iN74z+/Ul0999XqnwTu6aTbuwAXqMk2sTU45eK2Yp/FJ7YWeflcF1vsomTkjMkX0BHKMw== + dependencies: + "@react-types/shared" "^3.4.0" + +"@react-types/listbox@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@react-types/listbox/-/listbox-3.1.1.tgz#b896303ccb87123cf59ee2c089953d7928497c9b" + integrity sha512-HAljfdpbyLoJL9iwqz7Fw9MOmRwfzODeN+sr5ncE0eXJxnRBFhb5LjbjAN1dUBrKFBkv3etGlYu5HvX+PJjpew== + dependencies: + "@react-types/shared" "^3.2.1" + +"@react-types/menu@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@react-types/menu/-/menu-3.1.1.tgz#e5aa52ac07c083243540dd5da0790a85fd1628c6" + integrity sha512-/xZWp4/3P/8dKFAGuzxz8IccSXvJH0TmHIk2/xnj2Eyw9152IfutIpOda3iswhjrx1LEkzUgdJ8bCdiebgg6QQ== + dependencies: + "@react-types/overlays" "^3.2.1" + "@react-types/shared" "^3.2.1" + "@react-types/overlays@^3.2.1", "@react-types/overlays@^3.4.0": version "3.4.0" resolved "https://registry.yarnpkg.com/@react-types/overlays/-/overlays-3.4.0.tgz#3c4619906bb12e3697e770b59c2090bb18da25bd" @@ -3423,11 +3729,23 @@ dependencies: "@react-types/shared" "^3.3.0" +"@react-types/select@^3.1.1", "@react-types/select@^3.2.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@react-types/select/-/select-3.2.0.tgz#31b9e0f94fc24f053f4a1f073e174ffd59bac055" + integrity sha512-9vYhQWr1iB+3KWTZ1RxS2xZq0n0CJfsTRbEr0akLrtE/pRLC4O4l8RMFD49HyX0fShvz1FStmxTE2x7k8yVc4w== + dependencies: + "@react-types/shared" "^3.4.0" + "@react-types/shared@^3.2.1", "@react-types/shared@^3.3.0": version "3.3.0" resolved "https://registry.yarnpkg.com/@react-types/shared/-/shared-3.3.0.tgz#4f959df32f3ae94fcc910546088489144fc8d753" integrity sha512-i/OJplVPIHVok0Bu2Hn9pmz6eyULq2ao6pG/Is8YoDzp33SzumOtXxumgYcaXMJ7wBd2RgPd532m3+RnOY0ndg== +"@react-types/shared@^3.4.0", "@react-types/shared@^3.5.0": + version "3.5.0" + resolved "https://registry.yarnpkg.com/@react-types/shared/-/shared-3.5.0.tgz#dbc90e8fe711967e66d6f3ce0e17d34b24bd6283" + integrity sha512-997Me7AegwJOI10ye/Q5ds6fT+VBc6XcsXYzPqOD+HIbyL1kUQNDF/VoO37ib7KEH8jXH9aceoX9blz3Q1QcpA== + "@react-types/tooltip@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@react-types/tooltip/-/tooltip-3.1.0.tgz#2aad502ebf7c0fe864c72d7169d8f4f8338d9a3b" @@ -3436,6 +3754,14 @@ "@react-types/overlays" "^3.4.0" "@react-types/shared" "^3.2.1" +"@react-types/tooltip@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@react-types/tooltip/-/tooltip-3.1.1.tgz#7d45a4dd8c57c422a1a2dcb03b6c043e7481c3ca" + integrity sha512-18gM2Co9tzCDfN0tEdfboD18sXDtD6YiKctd8HQ8tBiRO4IF1ce9ubKe6++Lj+38GQPq7GWFFoUiS1WArTWIHA== + dependencies: + "@react-types/overlays" "^3.4.0" + "@react-types/shared" "^3.4.0" + "@rollup/plugin-typescript@^3.0.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@rollup/plugin-typescript/-/plugin-typescript-3.1.1.tgz#a39175a552ed82a3e424862e6bb403bf9da451ee" @@ -3729,7 +4055,17 @@ "@stoplight/yaml" "^4.0.2" call-me-maybe "^1.0.1" -"@stoplight/json-schema-viewer@^3.0.0", "@stoplight/json-schema-viewer@^3.0.0-beta.33": +"@stoplight/json-schema-tree@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@stoplight/json-schema-tree/-/json-schema-tree-1.1.0.tgz#574889869c17ed79ace933b2197869ee097b4d28" + integrity sha512-LOJAcljx1atU0F3KoF7C34I8e66hYi8v0Yr3uUXbWzsrTnuFzYWQgVgUWYJWKQnwoWKS2rBYn8u2up2w8cEF2Q== + dependencies: + "@stoplight/json" "^3.10.0" + "@stoplight/json-schema-merge-allof" "^0.7.2" + "@stoplight/lifecycle" "^2.3.2" + magic-error "^0.0.0" + +"@stoplight/json-schema-viewer@^3.0.0-beta.33": version "3.0.0" resolved "https://registry.yarnpkg.com/@stoplight/json-schema-viewer/-/json-schema-viewer-3.0.0.tgz#36037dd820f6c418ccdecbab20ac18119d59d9dd" integrity sha512-nI71j8NV96uw/AWhZmyc6tVfbtySJ1iV4ixktFTV2ektlbQSZggOVyOOfmaen4kALkcX6RdPUa4bPF8Ec6IQOw== @@ -3743,6 +4079,19 @@ mobx-react-lite "^1.4.1" pluralize "^8.0.0" +"@stoplight/json-schema-viewer@^4.0.0-beta.7": + version "4.0.0-beta.7" + resolved "https://registry.yarnpkg.com/@stoplight/json-schema-viewer/-/json-schema-viewer-4.0.0-beta.7.tgz#900e09459d322bb3e31a08bc713430bfdefb16c3" + integrity sha512-kmOXsU50yxLD10eumDc6ekhe1CzCq8s8xUKYSIszAYTdTQYyNKXo19tB9vPr5H+C+0Rm7jqGqv2Z6Os988nqEg== + dependencies: + "@fortawesome/free-solid-svg-icons" "^5.15.2" + "@stoplight/json" "^3.10.0" + "@stoplight/json-schema-tree" "^1.1.0" + "@stoplight/mosaic" "^1.0.0-beta.36" + "@stoplight/react-error-boundary" "^1.0.0" + classnames "^2.2.6" + lodash "^4.17.19" + "@stoplight/json@^3.10.0", "@stoplight/json@^3.5.1", "@stoplight/json@^3.6", "@stoplight/json@^3.8.1", "@stoplight/json@^3.9.0": version "3.10.0" resolved "https://registry.yarnpkg.com/@stoplight/json/-/json-3.10.0.tgz#bd1af55081e1a47e0d01552d2a7e756931f46a4b" @@ -3762,6 +4111,13 @@ strict-event-emitter-types "^2.0.0" wolfy87-eventemitter "~5.2.8" +"@stoplight/lifecycle@^2.3.2": + version "2.3.2" + resolved "https://registry.yarnpkg.com/@stoplight/lifecycle/-/lifecycle-2.3.2.tgz#d61dff9ba20648241432e2daaef547214dc8976e" + integrity sha512-v0u8p27FA/eg04b4z6QXw4s0NeeFcRzyvseBW0+k/q4jtpg7EhVCqy42EbbbU43NTNDpIeQ81OcvkFz+6CYshw== + dependencies: + wolfy87-eventemitter "~5.2.8" + "@stoplight/markdown-viewer@^4.3.2", "@stoplight/markdown-viewer@^4.3.3": version "4.3.3" resolved "https://registry.yarnpkg.com/@stoplight/markdown-viewer/-/markdown-viewer-4.3.3.tgz#57e65b6599057d37b21689a45f7cc107217c2189" @@ -3886,6 +4242,39 @@ ts-keycode-enum "^1.0.6" zustand "^3.3.1" +"@stoplight/mosaic@^1.0.0-beta.36": + version "1.0.0-beta.37" + resolved "https://registry.yarnpkg.com/@stoplight/mosaic/-/mosaic-1.0.0-beta.37.tgz#d869a25fa2d216f78f75deb7bd712f23a734715a" + integrity sha512-N1P5Z89YVFQrvBpHLYWT1y0XrWQcnFkoDhnLb8tozt6kkINYC9jjZGBBewLhMaGtgIoT70mEqX7pFa8s9mtOGQ== + dependencies: + "@fortawesome/fontawesome-svg-core" "^1.2.34" + "@fortawesome/free-solid-svg-icons" "^5.15.2" + "@fortawesome/react-fontawesome" "^0.1.14" + "@react-aria/button" "^3.3.1" + "@react-aria/dialog" "^3.1.2" + "@react-aria/focus" "^3.2.3" + "@react-aria/interactions" "^3.3.3" + "@react-aria/listbox" "^3.2.4" + "@react-aria/overlays" "^3.6.1" + "@react-aria/select" "^3.3.0" + "@react-aria/separator" "^3.1.1" + "@react-aria/ssr" "^3.0.1" + "@react-aria/tooltip" "^3.1.1" + "@react-aria/utils" "^3.6.0" + "@react-hook/size" "^2.1.1" + "@react-hook/window-size" "^3.0.7" + "@react-spectrum/utils" "^3.5.1" + "@react-stately/select" "^3.1.1" + "@react-stately/tooltip" "^3.0.2" + clsx "^1.1.1" + copy-to-clipboard "^3.3.1" + deepmerge "^4.2.2" + lodash.get "^4.4.2" + polished "^4.0.5" + reakit "npm:@stoplight/reakit@~1.3.5" + ts-keycode-enum "^1.0.6" + zustand "^3.3.1" + "@stoplight/ordered-object-literal@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@stoplight/ordered-object-literal/-/ordered-object-literal-1.0.1.tgz#01ece81ba5dda199ca3dc5ec7464691efa5d5b76" @@ -14074,6 +14463,11 @@ macos-release@^2.2.0: resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-2.3.0.tgz#eb1930b036c0800adebccd5f17bc4c12de8bb71f" integrity sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA== +magic-error@^0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/magic-error/-/magic-error-0.0.0.tgz#f8630c98c55764b4851601901fdcb63428758b7d" + integrity sha512-ZMU3ylGOb/YQEpJo0XtAXbPGmKJtwzc3cuOHPrKgosV8AAc6db8dlQYLe0cp64P3BxkYZGoUvkvdNR5JM78beA== + make-dir@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" From 7c0747b4387637fed5cccc8e80eb63b9bb4a9251 Mon Sep 17 00:00:00 2001 From: Marcell Toth Date: Mon, 29 Mar 2021 14:29:57 +0200 Subject: [PATCH 2/8] feat: eliminate examples panels sl--ml-9 wrapper is needed to avoid current padding issues with JSV. --- .../src/components/Docs/HttpOperation/Body.tsx | 13 ++++++++----- .../src/components/Docs/HttpOperation/Responses.tsx | 13 +++++++++---- .../src/components/Docs/HttpOperation/utils.ts | 12 ------------ .../elements/src/components/SchemaViewer/index.tsx | 6 ------ 4 files changed, 17 insertions(+), 27 deletions(-) diff --git a/packages/elements/src/components/Docs/HttpOperation/Body.tsx b/packages/elements/src/components/Docs/HttpOperation/Body.tsx index a1c53c063..9d550373a 100644 --- a/packages/elements/src/components/Docs/HttpOperation/Body.tsx +++ b/packages/elements/src/components/Docs/HttpOperation/Body.tsx @@ -1,12 +1,12 @@ -import { Select } from '@stoplight/mosaic'; +import { JsonSchemaViewer } from '@stoplight/json-schema-viewer'; +import { Box, Select } from '@stoplight/mosaic'; import { IHttpOperationRequestBody } from '@stoplight/types'; +import { JSONSchema4 } from 'json-schema'; import * as React from 'react'; import { isJSONSchema } from '../../../utils/guards'; import { MarkdownViewer } from '../../MarkdownViewer'; -import { SchemaViewer } from '../../SchemaViewer'; import { SubSectionPanel } from '../Sections'; -import { getExamplesObject } from './utils'; export interface BodyProps { body: IHttpOperationRequestBody; @@ -25,7 +25,6 @@ export const Body = ({ body: { contents = [], description }, onChange }: BodyPro if (contents.length === 0 && !description) return null; const schema = contents[chosenContent]?.schema; - const examples = getExamplesObject(contents[chosenContent]?.examples || []); return ( {description && } - {isJSONSchema(schema) && } + {isJSONSchema(schema) && ( + + + + )} ); }; diff --git a/packages/elements/src/components/Docs/HttpOperation/Responses.tsx b/packages/elements/src/components/Docs/HttpOperation/Responses.tsx index 9e464246a..12f57e478 100644 --- a/packages/elements/src/components/Docs/HttpOperation/Responses.tsx +++ b/packages/elements/src/components/Docs/HttpOperation/Responses.tsx @@ -1,13 +1,14 @@ +import { JsonSchemaViewer } from '@stoplight/json-schema-viewer'; import { Box, Select, Tab, TabList, TabPanel, Tabs, Text } from '@stoplight/mosaic'; import { IHttpOperationResponse } from '@stoplight/types'; +import { JSONSchema4 } from 'json-schema'; import { sortBy, uniqBy } from 'lodash'; import * as React from 'react'; +import { useInlineRefResolver } from '../../../context/InlineRefResolver'; import { MarkdownViewer } from '../../MarkdownViewer'; -import { SchemaViewer } from '../../SchemaViewer'; import { SectionTitle, SubSectionPanel } from '../Sections'; import { Parameters } from './Parameters'; -import { getExamplesObject } from './utils'; export const HttpCodeColor = { 1: 'gray', @@ -73,10 +74,10 @@ export const Response = ({ onMediaTypeChange, }: ResponseProps) => { const [chosenContent, setChosenContent] = React.useState(0); + const refResolver = useInlineRefResolver(); const responseContent = contents[chosenContent]; const schema = responseContent?.schema; - const examples = getExamplesObject(responseContent?.examples || []); React.useEffect(() => { responseContent && onMediaTypeChange(responseContent.mediaType); @@ -104,7 +105,11 @@ export const Response = ({ /> } > - {schema && } + {schema && ( + + + + )} )} diff --git a/packages/elements/src/components/Docs/HttpOperation/utils.ts b/packages/elements/src/components/Docs/HttpOperation/utils.ts index 2a99b7213..03f3ca294 100644 --- a/packages/elements/src/components/Docs/HttpOperation/utils.ts +++ b/packages/elements/src/components/Docs/HttpOperation/utils.ts @@ -1,17 +1,5 @@ -import { INodeExample, INodeExternalExample } from '@stoplight/types'; import { isObject } from 'lodash'; -export function getExamplesObject(examples: Array) { - return examples.reduce((collection, item) => { - const value = 'externalValue' in item ? item.externalValue : item.value; - if (value) { - collection[item.key] = value; - } - - return collection; - }, {}); -} - export function getExamplesFromSchema(data: unknown) { // `examples` are available in JSON Schema v6 and v7. For v4 we can use `x-examples`. // `example` is not supported by any version but we can use `x-example` extension. diff --git a/packages/elements/src/components/SchemaViewer/index.tsx b/packages/elements/src/components/SchemaViewer/index.tsx index 9c3621db4..ab977d9bb 100644 --- a/packages/elements/src/components/SchemaViewer/index.tsx +++ b/packages/elements/src/components/SchemaViewer/index.tsx @@ -21,14 +21,12 @@ export interface ISchemaViewerProps { title?: string; description?: string; errors?: string[]; - maxRows?: number; examples?: Dictionary; className?: string; forceShowTabs?: boolean; viewMode?: ViewMode; } -const JSV_MAX_ROWS = 20; export const SchemaViewer = ({ className, title, @@ -36,7 +34,6 @@ export const SchemaViewer = ({ schema, examples, errors, - maxRows = JSV_MAX_ROWS, viewMode, forceShowTabs, }: ISchemaViewerProps) => { @@ -52,13 +49,10 @@ export const SchemaViewer = ({ {description && } ); From b3686e92a105fe9ba74fc371bdc14aceae54cc66 Mon Sep 17 00:00:00 2001 From: Marcell Toth Date: Mon, 29 Mar 2021 15:01:08 +0200 Subject: [PATCH 3/8] fix: fix parameters crash --- .../src/components/Docs/HttpOperation/Parameters.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/elements/src/components/Docs/HttpOperation/Parameters.tsx b/packages/elements/src/components/Docs/HttpOperation/Parameters.tsx index 4f9c885c9..32b77ef49 100644 --- a/packages/elements/src/components/Docs/HttpOperation/Parameters.tsx +++ b/packages/elements/src/components/Docs/HttpOperation/Parameters.tsx @@ -1,4 +1,3 @@ -import { PropertyTypeColors } from '@stoplight/json-schema-viewer'; import { VStack } from '@stoplight/mosaic'; import { Dictionary, HttpParamStyles, IHttpParam, Primitive } from '@stoplight/types'; import { Tag } from '@stoplight/ui-kit'; @@ -50,7 +49,7 @@ export const Parameters: React.FunctionComponent = ({ parameter return ( - {sortBy(parameters, ['required', 'name']).map((parameter, index) => { + {sortBy(parameters, ['required', 'name']).map(parameter => { const resolvedSchema = parameter.schema?.$ref && resolveRef ? resolveRef({ pointer: parameter.schema.$ref, source: null }, null, {}) @@ -107,7 +106,7 @@ export const Parameter: React.FunctionComponent = ({ parameter,
{parameter.name}
-
{format ? `${type}<${format}>` : type}
+
{format ? `${type}<${format}>` : type}
{parameterType !== 'path' && (
Date: Mon, 29 Mar 2021 15:07:40 +0200 Subject: [PATCH 4/8] chore: fix types --- packages/elements/src/components/Docs/Model/Model.tsx | 2 +- packages/elements/src/context/InlineRefResolver.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/elements/src/components/Docs/Model/Model.tsx b/packages/elements/src/components/Docs/Model/Model.tsx index 559712044..2acc326d3 100644 --- a/packages/elements/src/components/Docs/Model/Model.tsx +++ b/packages/elements/src/components/Docs/Model/Model.tsx @@ -15,7 +15,7 @@ const ModelComponent: React.FC = ({ data, className, headless }) =>
{!headless && data.title !== void 0 &&

{data.title}

} - +
); }; diff --git a/packages/elements/src/context/InlineRefResolver.tsx b/packages/elements/src/context/InlineRefResolver.tsx index 833539433..e29ca52d8 100644 --- a/packages/elements/src/context/InlineRefResolver.tsx +++ b/packages/elements/src/context/InlineRefResolver.tsx @@ -1,5 +1,5 @@ import { resolveInlineRef } from '@stoplight/json'; -import { SchemaTreeRefDereferenceFn } from '@stoplight/json-schema-viewer'; +import type { SchemaTreeRefDereferenceFn } from '@stoplight/json-schema-tree'; import { isPlainObject } from 'lodash'; import * as React from 'react'; import { useContext } from 'react'; From 7a7a54740696b9eb4e6ca71a124628bdcfc6e8cd Mon Sep 17 00:00:00 2001 From: Marcell Toth Date: Mon, 29 Mar 2021 15:29:37 +0200 Subject: [PATCH 5/8] test: no need to mock JSV anymore --- .../Docs/HttpOperation/HttpOperation.spec.tsx | 43 ++++++++++++++----- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/packages/elements/src/components/Docs/HttpOperation/HttpOperation.spec.tsx b/packages/elements/src/components/Docs/HttpOperation/HttpOperation.spec.tsx index 12aef41fc..09298e8bd 100644 --- a/packages/elements/src/components/Docs/HttpOperation/HttpOperation.spec.tsx +++ b/packages/elements/src/components/Docs/HttpOperation/HttpOperation.spec.tsx @@ -12,12 +12,6 @@ import { HttpOperation as HttpOperationWithoutPersistence } from './index'; const HttpOperation = withPersistenceBoundary(HttpOperationWithoutPersistence); -jest.mock('@stoplight/json-schema-viewer', () => ({ - __esModule: true, - PropertyTypeColors: {}, - JsonSchemaViewer: () =>
This is JsonSchemaViewer
, -})); - describe('HttpOperation', () => { describe('Header', () => { it('should display "Deprecated" badge for deprecated http operation', () => { @@ -272,7 +266,18 @@ describe('HttpOperation', () => { method: 'get', request: { body: { - contents: [{ mediaType: 'application/json', schema: {} }, { mediaType: 'application/xml' }], + contents: [ + { + mediaType: 'application/json', + schema: { + type: 'object' as const, + properties: { + some_property: { type: 'string' as const }, + }, + }, + }, + { mediaType: 'application/xml' }, + ], }, }, responses: [ @@ -342,7 +347,7 @@ describe('HttpOperation', () => { const body = screen.getByRole('heading', { name: 'Body' }); userEvent.click(body); - expect(await screen.findByText('This is JsonSchemaViewer')).toBeInTheDocument(); + expect(await screen.findByText('some_property')).toBeInTheDocument(); }); it('request body selection in Docs should update TryIt', async () => { @@ -376,7 +381,18 @@ describe('HttpOperation', () => { { code: '200', description: 'Hello world!', - contents: [{ mediaType: 'application/json', schema: {} }, { mediaType: 'application/xml' }], + contents: [ + { + mediaType: 'application/json', + schema: { + type: 'object' as const, + properties: { + some_property: { type: 'string' as const }, + }, + }, + }, + { mediaType: 'application/xml' }, + ], }, ], }; @@ -431,7 +447,14 @@ describe('HttpOperation', () => { const body = screen.getByRole('heading', { name: 'Body' }); userEvent.click(body); - expect(await screen.findByText('This is JsonSchemaViewer')).toBeInTheDocument(); + const property = await screen.findByText('some_property'); + expect(property).toBeInTheDocument(); + + const select = screen.getByLabelText('Choose Response Body Content Type'); + + userEvent.selectOptions(select, 'application/xml'); + + expect(screen.queryByText('some_property')).not.toBeInTheDocument(); }); }); }); From 400b006e5c966646ad9eda83ca9b2e1cdbd5fb0e Mon Sep 17 00:00:00 2001 From: Marcell Toth Date: Mon, 29 Mar 2021 17:29:10 +0200 Subject: [PATCH 6/8] test: clean up inline fixtures --- .../Docs/HttpOperation/HttpOperation.spec.tsx | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/elements/src/components/Docs/HttpOperation/HttpOperation.spec.tsx b/packages/elements/src/components/Docs/HttpOperation/HttpOperation.spec.tsx index 09298e8bd..9a408aee3 100644 --- a/packages/elements/src/components/Docs/HttpOperation/HttpOperation.spec.tsx +++ b/packages/elements/src/components/Docs/HttpOperation/HttpOperation.spec.tsx @@ -1,4 +1,4 @@ -import { HttpParamStyles } from '@stoplight/types'; +import { HttpParamStyles, IHttpOperation } from '@stoplight/types'; import { screen } from '@testing-library/dom'; import { render } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; @@ -59,7 +59,7 @@ describe('HttpOperation', () => { describe('Query Parameters', () => { it('should render correct validations', async () => { - const data = { + const data: IHttpOperation = { id: 'get', method: 'get', path: '/path', @@ -70,14 +70,14 @@ describe('HttpOperation', () => { name: 'parameter name', description: 'a parameter description', schema: { - type: 'string' as const, + type: 'string', }, allowEmptyValue: true, allowReserved: true, deprecated: true, explode: true, required: true, - style: HttpParamStyles.Form as const, + style: HttpParamStyles.Form, examples: [ { value: 'example value', @@ -103,7 +103,7 @@ describe('HttpOperation', () => { }); it('should not render default styles', () => { - const operationData = { + const operationData: IHttpOperation = { id: 'get', method: 'get', path: '/path', @@ -113,16 +113,16 @@ describe('HttpOperation', () => { { name: 'default style param', schema: { - type: 'string' as const, + type: 'string', }, - style: HttpParamStyles.Form as const, + style: HttpParamStyles.Form, }, { name: 'different style param', schema: { - type: 'string' as const, + type: 'string', }, - style: HttpParamStyles.SpaceDelimited as const, + style: HttpParamStyles.SpaceDelimited, }, ], }, @@ -139,7 +139,7 @@ describe('HttpOperation', () => { describe('Header Parameters', () => { it('should render panel when there are header parameters', () => { - const data = { + const data: IHttpOperation = { id: 'get', method: 'get', path: '/path', @@ -150,12 +150,12 @@ describe('HttpOperation', () => { name: 'parameter name', description: 'a parameter description', schema: { - type: 'string' as const, + type: 'string', }, deprecated: true, explode: true, required: true, - style: HttpParamStyles.Simple as const, + style: HttpParamStyles.Simple, examples: [ { key: 'example', @@ -199,7 +199,7 @@ describe('HttpOperation', () => { describe('Path Parameters', () => { it('should render correct validations', async () => { - const data = { + const data: IHttpOperation = { id: 'get', method: 'get', path: '/path', @@ -211,12 +211,12 @@ describe('HttpOperation', () => { name: 'parameter name', description: 'a parameter description', schema: { - type: 'string' as const, + type: 'string', }, deprecated: true, explode: true, required: true, - style: HttpParamStyles.Simple as const, + style: HttpParamStyles.Simple, examples: [ { key: 'example', @@ -260,7 +260,7 @@ describe('HttpOperation', () => { }); describe('Request Body', () => { - const httpOperationWithRequestBodyContents = { + const httpOperationWithRequestBodyContents: IHttpOperation = { path: '/', id: 'some_id', method: 'get', @@ -270,9 +270,9 @@ describe('HttpOperation', () => { { mediaType: 'application/json', schema: { - type: 'object' as const, + type: 'object', properties: { - some_property: { type: 'string' as const }, + some_property: { type: 'string' }, }, }, }, @@ -373,7 +373,7 @@ describe('HttpOperation', () => { }); describe('Response', () => { - const httpOperationWithResponseBodyContents = { + const httpOperationWithResponseBodyContents: IHttpOperation = { path: '/', id: 'some_id', method: 'get', @@ -385,9 +385,9 @@ describe('HttpOperation', () => { { mediaType: 'application/json', schema: { - type: 'object' as const, + type: 'object', properties: { - some_property: { type: 'string' as const }, + some_property: { type: 'string' }, }, }, }, @@ -397,7 +397,7 @@ describe('HttpOperation', () => { ], }; - const httpOperationWithoutResponseBodyContents = { + const httpOperationWithoutResponseBodyContents: IHttpOperation = { path: '/', id: 'some_id', method: 'get', From afc1fec37ad06e2ae5ac8274b453c42c70327680 Mon Sep 17 00:00:00 2001 From: Marcell Toth Date: Tue, 30 Mar 2021 11:27:34 +0200 Subject: [PATCH 7/8] refactor: rename SchemaViewer -> SchemaAndExamples --- packages/elements/src/components/Docs/Model/Model.tsx | 4 ++-- .../{SchemaViewer/index.tsx => SchemaAndExamples.tsx} | 10 +++++----- packages/elements/src/context/Components.tsx | 8 ++++++-- 3 files changed, 13 insertions(+), 9 deletions(-) rename packages/elements/src/components/{SchemaViewer/index.tsx => SchemaAndExamples.tsx} (93%) diff --git a/packages/elements/src/components/Docs/Model/Model.tsx b/packages/elements/src/components/Docs/Model/Model.tsx index 2acc326d3..19692c156 100644 --- a/packages/elements/src/components/Docs/Model/Model.tsx +++ b/packages/elements/src/components/Docs/Model/Model.tsx @@ -5,7 +5,7 @@ import * as React from 'react'; import { IDocsComponentProps } from '..'; import { JSONSchema } from '../../../types'; -import { SchemaViewer } from '../../SchemaViewer'; +import { SchemaAndExamples } from '../../SchemaAndExamples'; import { getExamplesFromSchema } from '../HttpOperation/utils'; export type ModelProps = IDocsComponentProps; @@ -15,7 +15,7 @@ const ModelComponent: React.FC = ({ data, className, headless }) =>
{!headless && data.title !== void 0 &&

{data.title}

} - +
); }; diff --git a/packages/elements/src/components/SchemaViewer/index.tsx b/packages/elements/src/components/SchemaAndExamples.tsx similarity index 93% rename from packages/elements/src/components/SchemaViewer/index.tsx rename to packages/elements/src/components/SchemaAndExamples.tsx index ab977d9bb..f46829ac6 100644 --- a/packages/elements/src/components/SchemaViewer/index.tsx +++ b/packages/elements/src/components/SchemaAndExamples.tsx @@ -11,10 +11,10 @@ import { JSONSchema4 } from 'json-schema'; import { isEmpty, map } from 'lodash'; import * as React from 'react'; -import { NodeTypeColors, NodeTypeIconDefs } from '../../constants'; -import { useInlineRefResolver } from '../../context/InlineRefResolver'; -import { JSONSchema } from '../../types'; -import { MarkdownViewer } from '../MarkdownViewer'; +import { NodeTypeColors, NodeTypeIconDefs } from '../constants'; +import { useInlineRefResolver } from '../context/InlineRefResolver'; +import { JSONSchema } from '../types'; +import { MarkdownViewer } from './MarkdownViewer'; export interface ISchemaViewerProps { schema: JSONSchema; @@ -27,7 +27,7 @@ export interface ISchemaViewerProps { viewMode?: ViewMode; } -export const SchemaViewer = ({ +export const SchemaAndExamples = ({ className, title, description, diff --git a/packages/elements/src/context/Components.tsx b/packages/elements/src/context/Components.tsx index 99856e47b..9ec2a03e5 100644 --- a/packages/elements/src/context/Components.tsx +++ b/packages/elements/src/context/Components.tsx @@ -9,7 +9,7 @@ import { defaults, get } from 'lodash'; import * as React from 'react'; import { getExamplesFromSchema } from '../components/Docs/HttpOperation/utils'; -import { SchemaViewer } from '../components/SchemaViewer'; +import { SchemaAndExamples } from '../components/SchemaAndExamples'; import { useParsedValue } from '../hooks/useParsedValue'; import { isJSONSchema } from '../utils/guards'; @@ -36,7 +36,11 @@ const CodeComponent = (props: IComponentMappingProps>) = } return ( - + ); } From eaaf4c5603390c2aa2aa21b4377a3e5084d8cb45 Mon Sep 17 00:00:00 2001 From: Marcell Toth Date: Tue, 30 Mar 2021 11:48:29 +0200 Subject: [PATCH 8/8] style: lint --- examples/angular/src/app/app.module.ts | 2 +- packages/elements/src/components/Docs/Article/index.tsx | 2 +- .../src/components/Docs/HttpOperation/HttpOperation.tsx | 2 +- .../elements/src/components/Docs/HttpService/HttpService.tsx | 2 +- packages/elements/src/components/Docs/Model/Model.tsx | 2 +- .../MarkdownViewer/CustomComponents/CodeWithSchemaViewer.tsx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/angular/src/app/app.module.ts b/examples/angular/src/app/app.module.ts index fd1ee799d..ed131b19d 100755 --- a/examples/angular/src/app/app.module.ts +++ b/examples/angular/src/app/app.module.ts @@ -2,8 +2,8 @@ import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { ApiComponent } from './api/api.component'; -import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; +import { AppRoutingModule } from './app-routing.module'; import { HomeComponent } from './home/home.component'; import { StoplightProjectComponent } from './stoplight-project/stoplight-project.component'; diff --git a/packages/elements/src/components/Docs/Article/index.tsx b/packages/elements/src/components/Docs/Article/index.tsx index c4226b65c..86c2c2bc4 100644 --- a/packages/elements/src/components/Docs/Article/index.tsx +++ b/packages/elements/src/components/Docs/Article/index.tsx @@ -4,8 +4,8 @@ import { withErrorBoundary } from '@stoplight/react-error-boundary'; import cn from 'classnames'; import * as React from 'react'; -import { IDocsComponentProps } from '..'; import { MarkdownViewer } from '../../MarkdownViewer'; +import { IDocsComponentProps } from '..'; import { ArticleHeadings } from './Headings'; export type ArticleProps = IDocsComponentProps; diff --git a/packages/elements/src/components/Docs/HttpOperation/HttpOperation.tsx b/packages/elements/src/components/Docs/HttpOperation/HttpOperation.tsx index 4f6c8def8..a42de30a3 100644 --- a/packages/elements/src/components/Docs/HttpOperation/HttpOperation.tsx +++ b/packages/elements/src/components/Docs/HttpOperation/HttpOperation.tsx @@ -5,11 +5,11 @@ import cn from 'classnames'; import { flatten, sortBy } from 'lodash'; import * as React from 'react'; -import { IDocsComponentProps } from '..'; import { ActiveInfoContext, StoplightProjectContext } from '../../../containers/Provider'; import { getServiceUriFromOperation } from '../../../utils/oas/security'; import { MarkdownViewer } from '../../MarkdownViewer'; import { TryItWithRequestSamples } from '../../TryIt'; +import { IDocsComponentProps } from '..'; import { DeprecatedBadge, SecurityBadge } from './Badges'; import { Request } from './Request'; import { Responses } from './Responses'; diff --git a/packages/elements/src/components/Docs/HttpService/HttpService.tsx b/packages/elements/src/components/Docs/HttpService/HttpService.tsx index f45f41987..27701a404 100644 --- a/packages/elements/src/components/Docs/HttpService/HttpService.tsx +++ b/packages/elements/src/components/Docs/HttpService/HttpService.tsx @@ -4,9 +4,9 @@ import { IHttpService } from '@stoplight/types'; import * as React from 'react'; import { useLocation } from 'react-router-dom'; -import { IDocsComponentProps } from '..'; import { StoplightProjectContext } from '../../../containers/Provider'; import { MarkdownViewer } from '../../MarkdownViewer'; +import { IDocsComponentProps } from '..'; import { Badge } from '../HttpOperation/Badges'; import { SecuritySchemes } from './SecuritySchemes'; import { ServerInfo } from './ServerInfo'; diff --git a/packages/elements/src/components/Docs/Model/Model.tsx b/packages/elements/src/components/Docs/Model/Model.tsx index 19692c156..bbb3208eb 100644 --- a/packages/elements/src/components/Docs/Model/Model.tsx +++ b/packages/elements/src/components/Docs/Model/Model.tsx @@ -3,9 +3,9 @@ import { Classes } from '@stoplight/ui-kit'; import cn from 'classnames'; import * as React from 'react'; -import { IDocsComponentProps } from '..'; import { JSONSchema } from '../../../types'; import { SchemaAndExamples } from '../../SchemaAndExamples'; +import { IDocsComponentProps } from '..'; import { getExamplesFromSchema } from '../HttpOperation/utils'; export type ModelProps = IDocsComponentProps; diff --git a/packages/elements/src/components/MarkdownViewer/CustomComponents/CodeWithSchemaViewer.tsx b/packages/elements/src/components/MarkdownViewer/CustomComponents/CodeWithSchemaViewer.tsx index f5594b0bd..781f5174d 100644 --- a/packages/elements/src/components/MarkdownViewer/CustomComponents/CodeWithSchemaViewer.tsx +++ b/packages/elements/src/components/MarkdownViewer/CustomComponents/CodeWithSchemaViewer.tsx @@ -1,5 +1,5 @@ -import { defaultComponentMapping, ICodeAnnotations, IComponentMappingProps } from '@stoplight/markdown-viewer'; import { ICode } from '@stoplight/markdown/ast-types/smdast'; +import { defaultComponentMapping, ICodeAnnotations, IComponentMappingProps } from '@stoplight/markdown-viewer'; import { get } from 'lodash'; import React from 'react';