Skip to content

Commit 63e7b59

Browse files
authored
Merge pull request #88 from aeagle/hotfix/20210515-npm-audit-fix
Hotfix/20210515 npm audit fix
2 parents 93bf9dd + 7847cb8 commit 63e7b59

34 files changed

+10633
-6983
lines changed

.storybook/main.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
const path = require("path");
22

33
module.exports = {
4-
stories: ["./../**/*.stories.@(mdx|tsx)"],
5-
addons: ["@storybook/addon-actions", "@storybook/addon-links", "@storybook/addon-docs/preset"],
4+
stories: ["../src/**/*.stories.@(mdx|tsx)"],
5+
addons: [
6+
"@storybook/addon-actions",
7+
"@storybook/addon-links",
8+
{
9+
name: "@storybook/addon-docs/preset",
10+
options: {
11+
configureJSX: true,
12+
inlineStories: false,
13+
},
14+
},
15+
],
16+
typescript: {
17+
check: true,
18+
checkOptions: {},
19+
reactDocgen: "react-docgen-typescript",
20+
},
621
webpackFinal: async (config, { configType }) => {
722
if (process.env.NODE === "production") {
823
config.output.publicPath = "/react-spaces/docs";

.storybook/preview-head.html

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,21 @@
55
font-family: "Ubuntu", sans-serif;
66
font-size: 12px;
77
}
8-
.sbdocs-wrapper {
9-
padding: 15px !important;
10-
}
11-
.sbdocs-wrapper h2 {
12-
font-weight: 300 !important;
13-
border-bottom: none !important;
14-
margin-bottom: 20px !important;
15-
}
16-
.sbdocs-wrapper h4 {
17-
margin-top: 20px !important;
18-
font-weight: 500 !important;
19-
}
20-
.sbdocs-wrapper p,
21-
.sbdocs-wrapper li {
22-
font-size: 16px !important;
23-
}
24-
.sbdocs-preview > div > div > div {
25-
margin-bottom: 15px;
8+
9+
.docblock-source {
10+
margin: 25px 0 !important;
2611
}
27-
.sbdocs-preview > div > div > div > div > div {
12+
13+
.docs-story > div > div > div > div > div > div {
2814
position: relative;
29-
height: 600px;
15+
height: 600px !important;
3016
outline: 1px solid black;
3117
}
32-
.docblock-source {
33-
margin: 25px 0 !important;
18+
19+
.container-container {
20+
outline: solid black 1px;
3421
}
22+
3523
.spaces-resize-handle {
3624
background-color: red !important;
3725
}

.storybook/preview.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { addParameters } from "@storybook/react";
2+
3+
addParameters({
4+
docs: {
5+
inlineStories: false,
6+
},
7+
});

package-lock.json

Lines changed: 10403 additions & 6773 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-spaces",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"main": "dist/index.js",
55
"module": "dist/es/index.js",
66
"types": "dist/index.d.ts",
@@ -32,12 +32,12 @@
3232
},
3333
"devDependencies": {
3434
"@babel/core": "^7.5.5",
35-
"@storybook/addon-actions": "^6.1.11",
36-
"@storybook/addon-docs": "^6.1.11",
37-
"@storybook/addon-knobs": "^6.1.11",
38-
"@storybook/addon-links": "^6.1.11",
39-
"@storybook/addons": "^6.1.11",
40-
"@storybook/react": "^6.1.11",
35+
"@storybook/addon-actions": "^6.2.9",
36+
"@storybook/addon-docs": "^6.2.9",
37+
"@storybook/addon-knobs": "^6.2.9",
38+
"@storybook/addon-links": "^6.2.9",
39+
"@storybook/addons": "^6.2.9",
40+
"@storybook/react": "^6.2.9",
4141
"@testing-library/jest-dom": "^5.5.0",
4242
"@testing-library/react": "^10.0.3",
4343
"@types/jest": "^24.0.15",
@@ -61,6 +61,7 @@
6161
"rollup": "^1.19.4",
6262
"rollup-plugin-babel": "^4.3.3",
6363
"rollup-plugin-commonjs": "^10.0.2",
64+
"rollup-plugin-fork-ts-checker": "0.0.6",
6465
"rollup-plugin-node-resolve": "^5.2.0",
6566
"rollup-plugin-postcss": "^2.0.3",
6667
"rollup-plugin-replace": "^2.2.0",
@@ -72,7 +73,7 @@
7273
"ts-jest": "^25.4.0",
7374
"ts-loader": "^6.2.1",
7475
"tslib": "^1.10.0",
75-
"typescript": "^3.5.3"
76+
"typescript": "^3.9.9"
7677
},
7778
"resolutions": {
7879
"cssstyle": "2.3.0"

rollup.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@ import postcss from "rollup-plugin-postcss";
77
import { uglify } from "rollup-plugin-uglify";
88
import pkg from "./package.json";
99

10-
const commonPlugins = [typescript({ typescript: require("typescript"), sourceMap: true }), resolve(), commonjs(), sourcemaps()];
10+
const commonPlugins = [
11+
typescript({
12+
typescript: require("typescript"),
13+
sourceMap: true,
14+
}),
15+
resolve(),
16+
commonjs(),
17+
sourcemaps(),
18+
];
1119

1220
const targets = [
1321
{

src/components/stories/00-docs/00-Intro.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story, Preview, Props } from "@storybook/addon-docs/blocks";
1+
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs/blocks";
22
import { CommonHeader } from "../Utils";
33

44
<CommonHeader />

src/components/stories/00-docs/01-GettingStarted.stories.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story, Preview, Props } from "@storybook/addon-docs/blocks";
1+
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs/blocks";
22
import { CommonHeader, DemoUI } from "../Utils";
33
import { CenterType, ViewPort, Fixed, Top, Right, LeftResizable, BottomResizable, Fill, Options } from "../../";
44

@@ -48,7 +48,7 @@ have any visual element, padding or margins leaving it up to you to fill them or
4848
you want.*
4949

5050
<React.StrictMode>
51-
<Fixed style={{ outline: '1px solid black' }} height={400}>
51+
<Fixed style={{ outline: '1px solid black' }} className="container" height={400}>
5252
<LeftResizable style={{ borderRight: '1px dashed black' }} size="25%" centerContent={CenterType.HorizontalVertical}>
5353
Sidebar
5454
</LeftResizable>
@@ -88,7 +88,7 @@ const App = () => (
8888
Here we have added additional nested spaces inside the original `<Fill />` space to achieve this:
8989

9090
<React.StrictMode>
91-
<Fixed style={{ outline: '1px solid black' }} height={400}>
91+
<Fixed style={{ outline: '1px solid black' }} className="container" height={400}>
9292
<LeftResizable style={{ borderRight: '1px dashed black' }} size="25%" centerContent={CenterType.HorizontalVertical}>
9393
Sidebar
9494
</LeftResizable>
@@ -141,7 +141,7 @@ const App = () => (
141141
Now we have something like below:
142142

143143
<React.StrictMode>
144-
<Fixed style={{ outline: '1px solid black' }} height={400}>
144+
<Fixed style={{ outline: '1px solid black' }} className="container" height={400}>
145145
<Top style={{ borderBottom: '1px dashed black', padding: 5 }} order={1} size={25} centerContent={CenterType.Vertical}>
146146
Title
147147
</Top>

src/components/stories/00-docs/02-UsefulProperties.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story, Preview, Props } from "@storybook/addon-docs/blocks";
1+
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs/blocks";
22
import { CommonHeader, PropsTable, StandardProps } from "../Utils";
33

44
<CommonHeader />

src/components/stories/00-docs/03-UsefulEvents.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story, Preview, Props } from "@storybook/addon-docs/blocks";
1+
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs/blocks";
22
import { CommonHeader } from "../Utils";
33

44
<CommonHeader />

src/components/stories/00-docs/04-ChangeHistory.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story, Preview, Props } from "@storybook/addon-docs/blocks";
1+
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs/blocks";
22
import { CommonHeader } from "../Utils";
33

44
<CommonHeader />

src/components/stories/01-examples/00-Anchored.stories.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story, Preview, Props } from "@storybook/addon-docs/blocks";
1+
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs/blocks";
22
import { withKnobs } from "@storybook/addon-knobs";
33
import { ViewPort, Left, Top, Right, Bottom, LeftResizable, TopResizable, RightResizable, BottomResizable, Fill } from "../../";
44
import { red, green, blue, description } from "../Utils";
@@ -14,7 +14,7 @@ Examples of anchored spaces.
1414

1515
### Non-resizable
1616

17-
<Preview>
17+
<Canvas>
1818
<Story name="Non-resizable">
1919
<React.StrictMode>
2020
<ViewPort>
@@ -36,11 +36,11 @@ Examples of anchored spaces.
3636
</ViewPort>
3737
</React.StrictMode>
3838
</Story>
39-
</Preview>
39+
</Canvas>
4040

4141
### Resizable
4242

43-
<Preview>
43+
<Canvas>
4444
<Story name="Resizable">
4545
<React.StrictMode>
4646
<ViewPort>
@@ -64,4 +64,4 @@ Examples of anchored spaces.
6464
</ViewPort>
6565
</React.StrictMode>
6666
</Story>
67-
</Preview>
67+
</Canvas>

src/components/stories/01-examples/01-Nested.stories.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story, Preview, Props } from "@storybook/addon-docs/blocks";
1+
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs/blocks";
22
import { withKnobs } from "@storybook/addon-knobs";
33
import { ViewPort, Left, Top, Right, Bottom, LeftResizable, TopResizable, RightResizable, BottomResizable, Fill } from "../../";
44
import { red, green, blue, description } from "../Utils";
@@ -14,7 +14,7 @@ Examples of nested spaces.
1414

1515
### Non-resizable
1616

17-
<Preview>
17+
<Canvas>
1818
<Story name="Non-resizable">
1919
<React.StrictMode>
2020
<ViewPort>
@@ -52,11 +52,11 @@ Examples of nested spaces.
5252
</ViewPort>
5353
</React.StrictMode>
5454
</Story>
55-
</Preview>
55+
</Canvas>
5656

5757
### Resizable
5858

59-
<Preview>
59+
<Canvas>
6060
<Story name="Resizable">
6161
<React.StrictMode>
6262
<ViewPort>
@@ -96,4 +96,4 @@ Examples of nested spaces.
9696
</ViewPort>`
9797
</React.StrictMode>
9898
</Story>
99-
</Preview>
99+
</Canvas>

src/components/stories/01-examples/02-Stacked.stories.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story, Preview, Props } from "@storybook/addon-docs/blocks";
1+
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs/blocks";
22
import { withKnobs } from "@storybook/addon-knobs";
33
import { ViewPort, LeftResizable, RightResizable, Left, Right, TopResizable, BottomResizable, Top, Bottom, Fill } from "../../";
44
import { red, green, blue, description } from "../Utils";
@@ -14,7 +14,7 @@ Example of stacking spaces.
1414

1515
### Left and right stacked spaces
1616

17-
<Preview>
17+
<Canvas>
1818
<Story name="Fixed vertical">
1919
<React.StrictMode>
2020
<ViewPort>
@@ -34,11 +34,11 @@ Example of stacking spaces.
3434
</ViewPort>
3535
</React.StrictMode>
3636
</Story>
37-
</Preview>
37+
</Canvas>
3838

3939
### Top and bottom stacked spaces
4040

41-
<Preview>
41+
<Canvas>
4242
<Story name="Fixed horizontal">
4343
<React.StrictMode>
4444
<ViewPort>
@@ -58,11 +58,11 @@ Example of stacking spaces.
5858
</ViewPort>
5959
</React.StrictMode>
6060
</Story>
61-
</Preview>
61+
</Canvas>
6262

6363
### Left and right resizable stacked spaces
6464

65-
<Preview>
65+
<Canvas>
6666
<Story name="Resizable vertical">
6767
<React.StrictMode>
6868
<ViewPort>
@@ -84,11 +84,11 @@ Example of stacking spaces.
8484
</ViewPort>
8585
</React.StrictMode>
8686
</Story>
87-
</Preview>
87+
</Canvas>
8888

8989
### Top and bottom resizable stacked spaces
9090

91-
<Preview>
91+
<Canvas>
9292
<Story name="Resizable horizontal">
9393
<React.StrictMode>
9494
<ViewPort>
@@ -110,4 +110,4 @@ Example of stacking spaces.
110110
</ViewPort>
111111
</React.StrictMode>
112112
</Story>
113-
</Preview>
113+
</Canvas>

src/components/stories/01-examples/03-ControllerSize.stories.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story, Preview, Props } from "@storybook/addon-docs/blocks";
1+
import { Meta, Story, Canvas, Props } from "@storybook/addon-docs/blocks";
22
import { withKnobs } from "@storybook/addon-knobs";
33
import { ViewPort, LeftResizable, Fill } from "../../";
44
import { action } from '@storybook/addon-actions';
@@ -16,7 +16,7 @@ only the initial size of a space and React Spaces deals with any resizing. To ke
1616
space controlled in state you need to use the onResizeEnd event to set the new size of a space
1717
after a resize back to a state value.
1818

19-
<Preview>
19+
<Canvas>
2020
<Story name="Controlled size">
2121
{
2222
() => {
@@ -34,13 +34,13 @@ after a resize back to a state value.
3434
}
3535
}
3636
</Story>
37-
</Preview>
37+
</Canvas>
3838

3939
## Cancelling resize with onResizeStart
4040

4141
You can cancel a resize by returning `false` from a onResizeStart event handler.
4242

43-
<Preview>
43+
<Canvas>
4444
<Story name="Cancelled resize">
4545
{
4646
() => {
@@ -57,4 +57,4 @@ You can cancel a resize by returning `false` from a onResizeStart event handler.
5757
}
5858
}
5959
</Story>
60-
</Preview>
60+
</Canvas>

0 commit comments

Comments
 (0)