@khanacademy/wonder-blocks-layout 1.4.2 → 1.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/index.js +164 -528
- package/dist/index.js +264 -408
- package/package.json +7 -6
- package/src/components/media-layout.js +2 -3
- package/src/components/spring.stories.js +8 -12
- package/src/components/strut.stories.js +8 -12
- package/src/__tests__/index.test.js +0 -25
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-layout",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.6",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -13,17 +13,18 @@
|
|
|
13
13
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@
|
|
17
|
-
"@khanacademy/wonder-blocks-
|
|
16
|
+
"@babel/runtime": "^7.16.3",
|
|
17
|
+
"@khanacademy/wonder-blocks-core": "^4.0.0",
|
|
18
|
+
"@khanacademy/wonder-blocks-spacing": "^3.0.5"
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
|
-
"wb-dev-build-settings": "^0.0
|
|
21
|
+
"wb-dev-build-settings": "^0.2.0"
|
|
21
22
|
},
|
|
22
23
|
"peerDependencies": {
|
|
23
24
|
"aphrodite": "^1.2.5",
|
|
24
|
-
"react": "
|
|
25
|
+
"react": "16.14.0"
|
|
25
26
|
},
|
|
26
27
|
"author": "",
|
|
27
28
|
"license": "MIT",
|
|
28
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "9ebea88533e702011165072f090a377e02fa3f0f"
|
|
29
30
|
}
|
|
@@ -121,9 +121,8 @@ class MediaLayoutInternal extends React.Component<CombinedProps, State> {
|
|
|
121
121
|
if (this.state.size) {
|
|
122
122
|
return this.state.size;
|
|
123
123
|
} else {
|
|
124
|
-
const entries: Array<
|
|
125
|
-
|
|
126
|
-
> = (Object.entries(this.props.mediaSpec): any);
|
|
124
|
+
const entries: Array<[MediaSize, {|query: string|}]> =
|
|
125
|
+
(Object.entries(this.props.mediaSpec): any);
|
|
127
126
|
|
|
128
127
|
for (const [size, spec] of entries) {
|
|
129
128
|
const mql = mediaQueryLists[spec.query];
|
|
@@ -68,20 +68,16 @@ export const withStyle: StoryComponentType = () => (
|
|
|
68
68
|
</View>
|
|
69
69
|
);
|
|
70
70
|
|
|
71
|
-
simple.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
disable: true,
|
|
76
|
-
},
|
|
71
|
+
simple.parameters = {
|
|
72
|
+
chromatic: {
|
|
73
|
+
// we don't need screenshots because this story only tests behavior.
|
|
74
|
+
disableSnapshot: true,
|
|
77
75
|
},
|
|
78
76
|
};
|
|
79
77
|
|
|
80
|
-
withStyle.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
disable: true,
|
|
85
|
-
},
|
|
78
|
+
withStyle.parameters = {
|
|
79
|
+
chromatic: {
|
|
80
|
+
// we don't need screenshots because this story only tests behavior.
|
|
81
|
+
disableSnapshot: true,
|
|
86
82
|
},
|
|
87
83
|
};
|
|
@@ -83,20 +83,16 @@ export const withStyle: StoryComponentType = () => (
|
|
|
83
83
|
</View>
|
|
84
84
|
);
|
|
85
85
|
|
|
86
|
-
simple.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
disable: true,
|
|
91
|
-
},
|
|
86
|
+
simple.parameters = {
|
|
87
|
+
chromatic: {
|
|
88
|
+
// we don't need screenshots because this story only tests behavior.
|
|
89
|
+
disableSnapshot: true,
|
|
92
90
|
},
|
|
93
91
|
};
|
|
94
92
|
|
|
95
|
-
withStyle.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
disable: true,
|
|
100
|
-
},
|
|
93
|
+
withStyle.parameters = {
|
|
94
|
+
chromatic: {
|
|
95
|
+
// we don't need screenshots because this story only tests behavior.
|
|
96
|
+
disableSnapshot: true,
|
|
101
97
|
},
|
|
102
98
|
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
describe("@khanacademy/wonder-blocks-layout", () => {
|
|
3
|
-
test("package exports default", async () => {
|
|
4
|
-
// Arrange
|
|
5
|
-
const importedModule = import("../index.js");
|
|
6
|
-
|
|
7
|
-
// Act
|
|
8
|
-
const result = await importedModule;
|
|
9
|
-
|
|
10
|
-
// Assert
|
|
11
|
-
expect(Object.keys(result).sort()).toEqual(
|
|
12
|
-
[
|
|
13
|
-
"Strut",
|
|
14
|
-
"Spring",
|
|
15
|
-
"MediaLayout",
|
|
16
|
-
"MediaLayoutContext",
|
|
17
|
-
"VALID_MEDIA_SIZES",
|
|
18
|
-
"MEDIA_DEFAULT_SPEC",
|
|
19
|
-
"MEDIA_INTERNAL_SPEC",
|
|
20
|
-
"MEDIA_MODAL_SPEC",
|
|
21
|
-
"queryMatchesSize",
|
|
22
|
-
].sort(),
|
|
23
|
-
);
|
|
24
|
-
});
|
|
25
|
-
});
|