@khanacademy/wonder-blocks-layout 1.4.14 → 1.4.16
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/CHANGELOG.md +16 -0
- package/dist/index.js +294 -0
- package/dist/index.js.flow +1 -1
- package/package.json +3 -3
- package/src/components/__docs__/media-layout.stories.js +1 -1
- package/src/components/__docs__/spring.stories.js +1 -1
- package/src/components/__docs__/strut.stories.js +1 -1
- package/src/components/__tests__/media-layout-context.test.js +4 -4
- package/src/components/__tests__/media-layout.test.js +2 -2
- package/src/components/media-layout-context.js +2 -2
- package/src/components/media-layout.js +4 -4
- package/src/index.js +9 -9
- package/src/util/specs.js +1 -1
- package/src/util/test-util.js +1 -1
- package/src/util/test-util.test.js +1 -1
- package/src/util/util.js +1 -1
- package/src/util/util.test.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-layout
|
|
2
2
|
|
|
3
|
+
## 1.4.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 91cb727c: Remove file extensions from imports
|
|
8
|
+
- Updated dependencies [91cb727c]
|
|
9
|
+
- Updated dependencies [91cb727c]
|
|
10
|
+
- @khanacademy/wonder-blocks-core@4.7.0
|
|
11
|
+
|
|
12
|
+
## 1.4.15
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [496119f2]
|
|
17
|
+
- @khanacademy/wonder-blocks-core@4.6.2
|
|
18
|
+
|
|
3
19
|
## 1.4.14
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _extends = require('@babel/runtime/helpers/extends');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var Spacing = require('@khanacademy/wonder-blocks-spacing');
|
|
8
|
+
var aphrodite = require('aphrodite');
|
|
9
|
+
var wonderBlocksCore = require('@khanacademy/wonder-blocks-core');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
+
|
|
13
|
+
function _interopNamespace(e) {
|
|
14
|
+
if (e && e.__esModule) return e;
|
|
15
|
+
var n = Object.create(null);
|
|
16
|
+
if (e) {
|
|
17
|
+
Object.keys(e).forEach(function (k) {
|
|
18
|
+
if (k !== 'default') {
|
|
19
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
20
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return e[k]; }
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
n["default"] = e;
|
|
28
|
+
return Object.freeze(n);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
32
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
33
|
+
var Spacing__default = /*#__PURE__*/_interopDefaultLegacy(Spacing);
|
|
34
|
+
|
|
35
|
+
const VALID_MEDIA_SIZES = ["small", "medium", "large"];
|
|
36
|
+
const mediaDefaultSpecLargeMarginWidth = Spacing__default["default"].large_24;
|
|
37
|
+
const MEDIA_DEFAULT_SPEC = {
|
|
38
|
+
small: {
|
|
39
|
+
query: "(max-width: 767px)",
|
|
40
|
+
totalColumns: 4,
|
|
41
|
+
gutterWidth: Spacing__default["default"].medium_16,
|
|
42
|
+
marginWidth: Spacing__default["default"].medium_16
|
|
43
|
+
},
|
|
44
|
+
medium: {
|
|
45
|
+
query: "(min-width: 768px) and (max-width: 1023px)",
|
|
46
|
+
totalColumns: 8,
|
|
47
|
+
gutterWidth: Spacing__default["default"].xLarge_32,
|
|
48
|
+
marginWidth: Spacing__default["default"].large_24
|
|
49
|
+
},
|
|
50
|
+
large: {
|
|
51
|
+
query: "(min-width: 1024px)",
|
|
52
|
+
totalColumns: 12,
|
|
53
|
+
gutterWidth: Spacing__default["default"].xLarge_32,
|
|
54
|
+
marginWidth: mediaDefaultSpecLargeMarginWidth,
|
|
55
|
+
maxWidth: 1120 + mediaDefaultSpecLargeMarginWidth * 2
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const MEDIA_INTERNAL_SPEC = {
|
|
59
|
+
large: {
|
|
60
|
+
query: "(min-width: 1px)",
|
|
61
|
+
totalColumns: 12,
|
|
62
|
+
gutterWidth: Spacing__default["default"].xLarge_32,
|
|
63
|
+
marginWidth: Spacing__default["default"].medium_16
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const MEDIA_MODAL_SPEC = {
|
|
67
|
+
small: {
|
|
68
|
+
query: "(max-width: 767px)",
|
|
69
|
+
totalColumns: 4,
|
|
70
|
+
gutterWidth: Spacing__default["default"].medium_16,
|
|
71
|
+
marginWidth: Spacing__default["default"].medium_16
|
|
72
|
+
},
|
|
73
|
+
large: {
|
|
74
|
+
query: "(min-width: 768px)",
|
|
75
|
+
totalColumns: 12,
|
|
76
|
+
gutterWidth: Spacing__default["default"].xLarge_32,
|
|
77
|
+
marginWidth: Spacing__default["default"].xxLarge_48
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const defaultContext = {
|
|
82
|
+
ssrSize: "large",
|
|
83
|
+
mediaSpec: MEDIA_DEFAULT_SPEC
|
|
84
|
+
};
|
|
85
|
+
var MediaLayoutContext = React__namespace.createContext(defaultContext);
|
|
86
|
+
|
|
87
|
+
const queries = [].concat(Object.values(MEDIA_DEFAULT_SPEC).map(spec => spec.query), Object.values(MEDIA_INTERNAL_SPEC).map(spec => spec.query), Object.values(MEDIA_MODAL_SPEC).map(spec => spec.query));
|
|
88
|
+
const mediaQueryLists = {};
|
|
89
|
+
const DEFAULT_SIZE = "large";
|
|
90
|
+
|
|
91
|
+
class MediaLayoutInternal extends React__namespace.Component {
|
|
92
|
+
constructor(props) {
|
|
93
|
+
super(props);
|
|
94
|
+
this.state = {
|
|
95
|
+
size: undefined
|
|
96
|
+
};
|
|
97
|
+
this.cleanupThunks = [];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
componentDidMount() {
|
|
101
|
+
const entries = Object.entries(this.props.mediaSpec);
|
|
102
|
+
|
|
103
|
+
for (const [size, spec] of entries) {
|
|
104
|
+
const mql = mediaQueryLists[spec.query];
|
|
105
|
+
|
|
106
|
+
if (!mql) {
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const listener = e => {
|
|
111
|
+
if (e.matches) {
|
|
112
|
+
this.setState({
|
|
113
|
+
size
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
mql.addListener(listener);
|
|
119
|
+
this.cleanupThunks.push(() => mql.removeListener(listener));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
componentWillUnmount() {
|
|
124
|
+
this.cleanupThunks.forEach(cleaup => cleaup());
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
getCurrentSize(spec) {
|
|
128
|
+
if (this.state.size) {
|
|
129
|
+
return this.state.size;
|
|
130
|
+
} else {
|
|
131
|
+
const entries = Object.entries(this.props.mediaSpec);
|
|
132
|
+
|
|
133
|
+
for (const [size, _spec] of entries) {
|
|
134
|
+
const mql = mediaQueryLists[_spec.query];
|
|
135
|
+
|
|
136
|
+
if (mql.matches) {
|
|
137
|
+
return size;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return DEFAULT_SIZE;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
isServerSide() {
|
|
146
|
+
return typeof window === "undefined" || !window.matchMedia;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
getMockStyleSheet(mediaSize) {
|
|
150
|
+
const {
|
|
151
|
+
styleSheets
|
|
152
|
+
} = this.props;
|
|
153
|
+
const mockStyleSheet = {};
|
|
154
|
+
|
|
155
|
+
if (!styleSheets) {
|
|
156
|
+
return mockStyleSheet;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
for (const styleSize of Object.keys(styleSheets)) {
|
|
160
|
+
const styleSheet = styleSheets[styleSize];
|
|
161
|
+
|
|
162
|
+
if (!styleSheet) {
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
for (const name of Object.keys(styleSheet)) {
|
|
167
|
+
if (Object.prototype.hasOwnProperty.call(mockStyleSheet, name)) {
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
mockStyleSheet[name] = [styleSheets.all && styleSheets.all[name], mediaSize === "small" && [styleSheets.mdOrSmaller && styleSheets.mdOrSmaller[name], styleSheets.small && styleSheets.small[name]], mediaSize === "medium" && [styleSheets.mdOrSmaller && styleSheets.mdOrSmaller[name], styleSheets.mdOrLarger && styleSheets.mdOrLarger[name], styleSheets.medium && styleSheets.medium[name]], mediaSize === "large" && [styleSheets.mdOrLarger && styleSheets.mdOrLarger[name], styleSheets.large && styleSheets.large[name]]];
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return mockStyleSheet;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
render() {
|
|
179
|
+
const {
|
|
180
|
+
children,
|
|
181
|
+
mediaSpec,
|
|
182
|
+
ssrSize,
|
|
183
|
+
overrideSize
|
|
184
|
+
} = this.props;
|
|
185
|
+
|
|
186
|
+
if (!this.isServerSide()) {
|
|
187
|
+
for (const query of queries.filter(query => !mediaQueryLists[query])) {
|
|
188
|
+
mediaQueryLists[query] = window.matchMedia(query);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const mediaSize = overrideSize || this.isServerSide() && ssrSize || this.getCurrentSize(mediaSpec);
|
|
193
|
+
const styles = this.getMockStyleSheet(mediaSize);
|
|
194
|
+
return children({
|
|
195
|
+
mediaSize,
|
|
196
|
+
mediaSpec,
|
|
197
|
+
styles
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
class MediaLayout extends React__namespace.Component {
|
|
204
|
+
render() {
|
|
205
|
+
return React__namespace.createElement(MediaLayoutContext.Consumer, null, ({
|
|
206
|
+
overrideSize,
|
|
207
|
+
ssrSize,
|
|
208
|
+
mediaSpec
|
|
209
|
+
}) => React__namespace.createElement(MediaLayoutInternal, _extends__default["default"]({}, this.props, {
|
|
210
|
+
overrideSize: overrideSize,
|
|
211
|
+
ssrSize: ssrSize,
|
|
212
|
+
mediaSpec: mediaSpec
|
|
213
|
+
})));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
class Spring extends React__namespace.Component {
|
|
219
|
+
render() {
|
|
220
|
+
const {
|
|
221
|
+
style
|
|
222
|
+
} = this.props;
|
|
223
|
+
return React__namespace.createElement(wonderBlocksCore.View, {
|
|
224
|
+
"aria-hidden": "true",
|
|
225
|
+
style: [styles.grow, style]
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
}
|
|
230
|
+
const styles = aphrodite.StyleSheet.create({
|
|
231
|
+
grow: {
|
|
232
|
+
flexGrow: 1
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
class Strut extends React__namespace.Component {
|
|
237
|
+
render() {
|
|
238
|
+
const {
|
|
239
|
+
size,
|
|
240
|
+
style
|
|
241
|
+
} = this.props;
|
|
242
|
+
return React__namespace.createElement(wonderBlocksCore.View, {
|
|
243
|
+
"aria-hidden": "true",
|
|
244
|
+
style: [strutStyle(size), style]
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
const strutStyle = size => {
|
|
251
|
+
return {
|
|
252
|
+
width: size,
|
|
253
|
+
MsFlexBasis: size,
|
|
254
|
+
MsFlexPreferredSize: size,
|
|
255
|
+
WebkitFlexBasis: size,
|
|
256
|
+
flexBasis: size,
|
|
257
|
+
flexShrink: 0
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
const queryMatchesSize = (mediaQuery, mediaSize) => {
|
|
262
|
+
switch (mediaQuery) {
|
|
263
|
+
case "all":
|
|
264
|
+
return true;
|
|
265
|
+
|
|
266
|
+
case "small":
|
|
267
|
+
return mediaSize === "small";
|
|
268
|
+
|
|
269
|
+
case "mdOrSmaller":
|
|
270
|
+
return mediaSize === "medium" || mediaSize === "small";
|
|
271
|
+
|
|
272
|
+
case "medium":
|
|
273
|
+
return mediaSize === "medium";
|
|
274
|
+
|
|
275
|
+
case "mdOrLarger":
|
|
276
|
+
return mediaSize === "medium" || mediaSize === "large";
|
|
277
|
+
|
|
278
|
+
case "large":
|
|
279
|
+
return mediaSize === "large";
|
|
280
|
+
|
|
281
|
+
default:
|
|
282
|
+
throw new Error(`Unsupported mediaSize: ${mediaSize}`);
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
exports.MEDIA_DEFAULT_SPEC = MEDIA_DEFAULT_SPEC;
|
|
287
|
+
exports.MEDIA_INTERNAL_SPEC = MEDIA_INTERNAL_SPEC;
|
|
288
|
+
exports.MEDIA_MODAL_SPEC = MEDIA_MODAL_SPEC;
|
|
289
|
+
exports.MediaLayout = MediaLayout;
|
|
290
|
+
exports.MediaLayoutContext = MediaLayoutContext;
|
|
291
|
+
exports.Spring = Spring;
|
|
292
|
+
exports.Strut = Strut;
|
|
293
|
+
exports.VALID_MEDIA_SIZES = VALID_MEDIA_SIZES;
|
|
294
|
+
exports.queryMatchesSize = queryMatchesSize;
|
package/dist/index.js.flow
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
export * from "../src/index
|
|
2
|
+
export * from "../src/index";
|
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.16",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@babel/runtime": "^7.18.6",
|
|
17
|
-
"@khanacademy/wonder-blocks-core": "^4.
|
|
17
|
+
"@khanacademy/wonder-blocks-core": "^4.7.0",
|
|
18
18
|
"@khanacademy/wonder-blocks-spacing": "^3.0.5"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"wb-dev-build-settings": "^0.
|
|
21
|
+
"wb-dev-build-settings": "^0.7.1"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"aphrodite": "^1.2.5",
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
|
|
22
22
|
import type {StoryComponentType} from "@storybook/react";
|
|
23
23
|
|
|
24
|
-
import ComponentInfo from "../../../../../.storybook/components/component-info
|
|
24
|
+
import ComponentInfo from "../../../../../.storybook/components/component-info";
|
|
25
25
|
import {name, version} from "../../../package.json";
|
|
26
26
|
|
|
27
27
|
export default {
|
|
@@ -9,7 +9,7 @@ import Button from "@khanacademy/wonder-blocks-button";
|
|
|
9
9
|
|
|
10
10
|
import type {StoryComponentType} from "@storybook/react";
|
|
11
11
|
|
|
12
|
-
import ComponentInfo from "../../../../../.storybook/components/component-info
|
|
12
|
+
import ComponentInfo from "../../../../../.storybook/components/component-info";
|
|
13
13
|
import {name, version} from "../../../package.json";
|
|
14
14
|
|
|
15
15
|
export default {
|
|
@@ -10,7 +10,7 @@ import Spacing from "@khanacademy/wonder-blocks-spacing";
|
|
|
10
10
|
|
|
11
11
|
import type {StoryComponentType} from "@storybook/react";
|
|
12
12
|
|
|
13
|
-
import ComponentInfo from "../../../../../.storybook/components/component-info
|
|
13
|
+
import ComponentInfo from "../../../../../.storybook/components/component-info";
|
|
14
14
|
import {name, version} from "../../../package.json";
|
|
15
15
|
|
|
16
16
|
export default {
|
|
@@ -3,15 +3,15 @@ import * as React from "react";
|
|
|
3
3
|
import {View} from "@khanacademy/wonder-blocks-core";
|
|
4
4
|
import {render} from "@testing-library/react";
|
|
5
5
|
|
|
6
|
-
import MediaLayout from "../media-layout
|
|
7
|
-
import MediaLayoutContext from "../media-layout-context
|
|
8
|
-
import {resizeWindow, matchMedia} from "../../util/test-util
|
|
6
|
+
import MediaLayout from "../media-layout";
|
|
7
|
+
import MediaLayoutContext from "../media-layout-context";
|
|
8
|
+
import {resizeWindow, matchMedia} from "../../util/test-util";
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
11
|
MEDIA_DEFAULT_SPEC,
|
|
12
12
|
MEDIA_INTERNAL_SPEC,
|
|
13
13
|
MEDIA_MODAL_SPEC,
|
|
14
|
-
} from "../../util/specs
|
|
14
|
+
} from "../../util/specs";
|
|
15
15
|
|
|
16
16
|
describe("MediaLayoutContext", () => {
|
|
17
17
|
beforeEach(() => {
|
|
@@ -4,8 +4,8 @@ import {StyleSheet} from "aphrodite";
|
|
|
4
4
|
import {View} from "@khanacademy/wonder-blocks-core";
|
|
5
5
|
import {render, screen} from "@testing-library/react";
|
|
6
6
|
|
|
7
|
-
import MediaLayout from "../media-layout
|
|
8
|
-
import {resizeWindow, matchMedia} from "../../util/test-util
|
|
7
|
+
import MediaLayout from "../media-layout";
|
|
8
|
+
import {resizeWindow, matchMedia} from "../../util/test-util";
|
|
9
9
|
|
|
10
10
|
describe("MediaLayout", () => {
|
|
11
11
|
beforeEach(() => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
|
|
4
|
-
import {MEDIA_DEFAULT_SPEC} from "../util/specs
|
|
5
|
-
import type {MediaSize, MediaSpec} from "../util/types
|
|
4
|
+
import {MEDIA_DEFAULT_SPEC} from "../util/specs";
|
|
5
|
+
import type {MediaSize, MediaSpec} from "../util/types";
|
|
6
6
|
|
|
7
7
|
export type Context = {|
|
|
8
8
|
/**
|
|
@@ -3,14 +3,14 @@ import * as React from "react";
|
|
|
3
3
|
import type {StyleDeclaration} from "aphrodite";
|
|
4
4
|
import type {StyleType} from "@khanacademy/wonder-blocks-core";
|
|
5
5
|
|
|
6
|
-
import MediaLayoutContext from "./media-layout-context
|
|
7
|
-
import type {MediaSize, MediaSpec} from "../util/types
|
|
8
|
-
import type {Context} from "./media-layout-context
|
|
6
|
+
import MediaLayoutContext from "./media-layout-context";
|
|
7
|
+
import type {MediaSize, MediaSpec} from "../util/types";
|
|
8
|
+
import type {Context} from "./media-layout-context";
|
|
9
9
|
import {
|
|
10
10
|
MEDIA_DEFAULT_SPEC,
|
|
11
11
|
MEDIA_INTERNAL_SPEC,
|
|
12
12
|
MEDIA_MODAL_SPEC,
|
|
13
|
-
} from "../util/specs
|
|
13
|
+
} from "../util/specs";
|
|
14
14
|
|
|
15
15
|
const queries = [
|
|
16
16
|
...Object.values(MEDIA_DEFAULT_SPEC).map((spec: any) => spec.query),
|
package/src/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import type {MediaQuery, MediaSize, MediaSpec} from "./util/types
|
|
3
|
-
import type {Context} from "./components/media-layout-context
|
|
4
|
-
import type {MockStyleSheet} from "./components/media-layout
|
|
2
|
+
import type {MediaQuery, MediaSize, MediaSpec} from "./util/types";
|
|
3
|
+
import type {Context} from "./components/media-layout-context";
|
|
4
|
+
import type {MockStyleSheet} from "./components/media-layout";
|
|
5
5
|
|
|
6
|
-
export {default as MediaLayout} from "./components/media-layout
|
|
7
|
-
export {default as MediaLayoutContext} from "./components/media-layout-context
|
|
8
|
-
export {default as Spring} from "./components/spring
|
|
9
|
-
export {default as Strut} from "./components/strut
|
|
10
|
-
export * from "./util/specs
|
|
11
|
-
export {queryMatchesSize} from "./util/util
|
|
6
|
+
export {default as MediaLayout} from "./components/media-layout";
|
|
7
|
+
export {default as MediaLayoutContext} from "./components/media-layout-context";
|
|
8
|
+
export {default as Spring} from "./components/spring";
|
|
9
|
+
export {default as Strut} from "./components/strut";
|
|
10
|
+
export * from "./util/specs";
|
|
11
|
+
export {queryMatchesSize} from "./util/util";
|
|
12
12
|
export type {
|
|
13
13
|
MediaQuery,
|
|
14
14
|
MediaSize,
|
package/src/util/specs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import Spacing from "@khanacademy/wonder-blocks-spacing";
|
|
4
4
|
|
|
5
|
-
import type {MediaSize, MediaSpec} from "./types
|
|
5
|
+
import type {MediaSize, MediaSpec} from "./types";
|
|
6
6
|
|
|
7
7
|
// All possible valid media sizes
|
|
8
8
|
export const VALID_MEDIA_SIZES: Array<MediaSize> = ["small", "medium", "large"];
|
package/src/util/test-util.js
CHANGED
package/src/util/util.js
CHANGED
package/src/util/util.test.js
CHANGED