@khanacademy/wonder-blocks-grid 1.0.26 → 1.0.27
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 +3 -1
- package/dist/index.js +3 -1
- package/package.json +7 -7
- package/src/components/row.js +28 -26
package/dist/es/index.js
CHANGED
|
@@ -247,7 +247,9 @@ class Row extends Component {
|
|
|
247
247
|
mediaSize,
|
|
248
248
|
totalColumns
|
|
249
249
|
}) : children;
|
|
250
|
-
const filteredContents = Children.toArray(contents)
|
|
250
|
+
const filteredContents = Children.toArray(contents) // Go through all of the contents and pre-emptively remove anything
|
|
251
|
+
// that shouldn't be rendered.
|
|
252
|
+
.filter( // Flow doesn't let us check .type on a non-null React.Node so
|
|
251
253
|
// we have to cast it to any.
|
|
252
254
|
item => Cell.isClassOf(item) ? Cell.shouldDisplay(item.props, mediaSize) : true) // Intersperse Gutter elements between the cells.
|
|
253
255
|
.reduce((acc, elem, index) => [].concat(acc, [elem, /*#__PURE__*/createElement(Gutter, {
|
package/dist/index.js
CHANGED
|
@@ -700,7 +700,9 @@ class Row extends react__WEBPACK_IMPORTED_MODULE_0__["Component"] {
|
|
|
700
700
|
mediaSize,
|
|
701
701
|
totalColumns
|
|
702
702
|
}) : children;
|
|
703
|
-
const filteredContents = react__WEBPACK_IMPORTED_MODULE_0__["Children"].toArray(contents)
|
|
703
|
+
const filteredContents = react__WEBPACK_IMPORTED_MODULE_0__["Children"].toArray(contents) // Go through all of the contents and pre-emptively remove anything
|
|
704
|
+
// that shouldn't be rendered.
|
|
705
|
+
.filter( // Flow doesn't let us check .type on a non-null React.Node so
|
|
704
706
|
// we have to cast it to any.
|
|
705
707
|
item => _cell_js__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"].isClassOf(item) ? _cell_js__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"].shouldDisplay(item.props, mediaSize) : true) // Intersperse Gutter elements between the cells.
|
|
706
708
|
.reduce((acc, elem, index) => [].concat(acc, [elem, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_gutter_js__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"], {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-grid",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
"author": "",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@babel/runtime": "^7.
|
|
19
|
-
"@khanacademy/wonder-blocks-color": "^1.1.
|
|
20
|
-
"@khanacademy/wonder-blocks-core": "^
|
|
21
|
-
"@khanacademy/wonder-blocks-spacing": "^3.0.
|
|
18
|
+
"@babel/runtime": "^7.16.3",
|
|
19
|
+
"@khanacademy/wonder-blocks-color": "^1.1.20",
|
|
20
|
+
"@khanacademy/wonder-blocks-core": "^4.0.0",
|
|
21
|
+
"@khanacademy/wonder-blocks-spacing": "^3.0.5"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"aphrodite": "^1.2.5",
|
|
25
25
|
"react": "16.14.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"wb-dev-build-settings": "^0.
|
|
28
|
+
"wb-dev-build-settings": "^0.2.0"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "9ebea88533e702011165072f090a377e02fa3f0f"
|
|
31
31
|
}
|
package/src/components/row.js
CHANGED
|
@@ -93,32 +93,34 @@ export default class Row extends React.Component<Props> {
|
|
|
93
93
|
? children({mediaSize, totalColumns})
|
|
94
94
|
: children;
|
|
95
95
|
|
|
96
|
-
const filteredContents: Array<React.Node> =
|
|
97
|
-
contents
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
elem,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
96
|
+
const filteredContents: Array<React.Node> =
|
|
97
|
+
(React.Children.toArray(contents): Array<React.Node>)
|
|
98
|
+
// Go through all of the contents and pre-emptively remove anything
|
|
99
|
+
// that shouldn't be rendered.
|
|
100
|
+
.filter(
|
|
101
|
+
// Flow doesn't let us check .type on a non-null React.Node so
|
|
102
|
+
// we have to cast it to any.
|
|
103
|
+
(item: any) =>
|
|
104
|
+
Cell.isClassOf(item)
|
|
105
|
+
? Cell.shouldDisplay(
|
|
106
|
+
item.props,
|
|
107
|
+
mediaSize,
|
|
108
|
+
)
|
|
109
|
+
: true,
|
|
110
|
+
)
|
|
111
|
+
// Intersperse Gutter elements between the cells.
|
|
112
|
+
.reduce(
|
|
113
|
+
(acc, elem, index) => [
|
|
114
|
+
...acc,
|
|
115
|
+
elem,
|
|
116
|
+
<Gutter key={`gutter-${index}`} />,
|
|
117
|
+
],
|
|
118
|
+
[],
|
|
119
|
+
)
|
|
120
|
+
// We only want gutters between each cell in the row. The reduce
|
|
121
|
+
// adds a gutter after every cell so we need to remove the last
|
|
122
|
+
// element which is an unnecessary gutteer.
|
|
123
|
+
.slice(0, -1);
|
|
122
124
|
|
|
123
125
|
return (
|
|
124
126
|
<View
|