diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000..b03f40867 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +lts/krypton diff --git a/.storybook/main.js b/.storybook/main.js index cbf56f51e..649d43b53 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -1,5 +1,5 @@ -const sass = require("sass"); const path = require("path"); +const sass = require("sass"); const sassRenderSyncConfig = require("./../scripts/sassConfig"); const { silenceDeprecations } = require("../scripts/sassDeprecationConfig"); @@ -9,15 +9,6 @@ module.exports = { "@storybook/addon-links", "@storybook/addon-docs", "@storybook/addon-a11y", - { - name: "@storybook/preset-scss", - options: { - sassLoaderOptions: { - implementation: sass, - sassOptions: {...sassRenderSyncConfig, silenceDeprecations}, - }, - }, - }, "@storybook/addon-webpack5-compiler-babel", ], framework: { @@ -64,6 +55,16 @@ module.exports = { }, }, webpackFinal: async (config, { configType }) => { + // never let the compiled package output take part in the Storybook build, + // stories always have to use the sources + // a directory import like `"./../../../../"` is resolved by the `exports` field of our + // own package.json and would silently pull `dist/esm/` into the preview bundle, + // this restriction removes it from the candidates so that the root `index.ts` is used + const distPath = path.resolve(__dirname, "..", "dist"); + config.resolve.restrictions = [ + ...(config.resolve.restrictions ?? []), + new RegExp(`^(?!${distPath.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}[/\\\\])`), + ]; // `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION' if (configType === "PRODUCTION") { // remove source maps from production storybook @@ -72,13 +73,29 @@ module.exports = { config.devtool = false; } config.module.rules = [ + { + test: /\.s[ac]ss$/i, + use: [ + require.resolve("style-loader"), + { + loader: require.resolve("css-loader"), + options: { + importLoaders: 1, + }, + }, + { + loader: require.resolve("sass-loader"), + options: { + implementation: sass, + sassOptions: { ...sassRenderSyncConfig, silenceDeprecations }, + }, + }, + ], + }, { test: /\.(png|jpg|gif|svg)(\\?.*)?$/, include: /\.tobase64\./, - loader: "url-loader", - options: { - limit: true, - }, + type: "asset/inline", }, ...config.module.rules.map((rule) => { if ( @@ -92,11 +109,6 @@ module.exports = { return rule; }), ]; - config.resolve.alias = { - ...config.resolve.alias, - // Fix nasty bug with importing from this package, Storybook webpack cannot resolve it otherwise - "@codemirror/legacy-modes": path.resolve(__dirname, "../node_modules/@codemirror/legacy-modes"), - }; return config; }, }; diff --git a/.storybook/preview.js b/.storybook/preview.js index be7d5ee23..dfd916d44 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -17,7 +17,7 @@ export const parameters = { const preview = { // Enables auto-generated documentation for all stories // @see https://storybook.js.org/docs/writing-docs/autodocs - tags: ['autodocs'], + tags: ["autodocs"], parameters, }; diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bd639bee..392f4abbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,103 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ### Added +- `` + - documents the built-in Escape then Tab sequence for moving focus out of the editor when Tab is configured to indent + - shows a compact keyboard navigation hint in a bottom CodeMirror panel when Tab is configured to indent + - `keyboardHint` accepts a custom string or element for localized instructions, the default instruction is marked as English +- `` + - `noDrag` parameter: Add the `nodrag` class to the Switch element. Default: `true` +- `` + - Added `cutOff` property to set maximum number of raw Markdown characters to render +- `