@artsy/palette 19.1.3 β 19.1.4
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 +13 -0
- package/dist/elements/Join/Join.js +10 -8
- package/dist/elements/Join/Join.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
# v19.1.4 (Tue Mar 22 2022)
|
|
2
|
+
|
|
3
|
+
#### π Bug Fix
|
|
4
|
+
|
|
5
|
+
- Revert "fix(join): prefers the provided child key; fallsback to index⦠[#1145](https://github.com/artsy/palette/pull/1145) ([@dzucconi](https://github.com/dzucconi))
|
|
6
|
+
- Revert "fix(join): prefers the provided child key; fallsback to index if missing" ([@dzucconi](https://github.com/dzucconi))
|
|
7
|
+
|
|
8
|
+
#### Authors: 1
|
|
9
|
+
|
|
10
|
+
- Damon ([@dzucconi](https://github.com/dzucconi))
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
1
14
|
# v19.1.3 (Mon Mar 21 2022)
|
|
2
15
|
|
|
3
16
|
#### π Bug Fix
|
|
@@ -35,16 +35,18 @@ var Join = function Join(_ref) {
|
|
|
35
35
|
var separator = _ref.separator,
|
|
36
36
|
children = _ref.children;
|
|
37
37
|
var elements = (0, _flattenChildren.flattenChildren)(children);
|
|
38
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, elements.reduce(function (acc, element,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, elements.reduce(function (acc, element, currentIndex) {
|
|
39
|
+
acc.push(
|
|
40
|
+
/*#__PURE__*/
|
|
41
|
+
// @ts-expect-error MIGRATE_STRICT_MODE
|
|
42
|
+
_react.default.cloneElement(element, {
|
|
43
|
+
key: "join-".concat(currentIndex)
|
|
43
44
|
}));
|
|
44
45
|
|
|
45
|
-
if (
|
|
46
|
-
acc.push(
|
|
47
|
-
|
|
46
|
+
if (currentIndex !== elements.length - 1) {
|
|
47
|
+
acc.push( // @ts-expect-error MIGRATE_STRICT_MODE
|
|
48
|
+
separator && /*#__PURE__*/_react.default.cloneElement(separator, {
|
|
49
|
+
key: "join-sep-".concat(currentIndex)
|
|
48
50
|
}));
|
|
49
51
|
}
|
|
50
52
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/elements/Join/Join.tsx"],"names":["Join","separator","children","elements","reduce","acc","element","
|
|
1
|
+
{"version":3,"sources":["../../../src/elements/Join/Join.tsx"],"names":["Join","separator","children","elements","reduce","acc","element","currentIndex","push","React","cloneElement","key","length"],"mappings":";;;;;;;AAAA;;AACA;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,IAAyB,GAAG,SAA5BA,IAA4B,OAA6B;AAAA,MAA1BC,SAA0B,QAA1BA,SAA0B;AAAA,MAAfC,QAAe,QAAfA,QAAe;AACpE,MAAMC,QAAQ,GAAG,sCAAgBD,QAAhB,CAAjB;AAEA,sBACE,4DACGC,QAAQ,CAACC,MAAT,CAAgB,UAACC,GAAD,EAAMC,OAAN,EAAeC,YAAf,EAAgC;AAC/CF,IAAAA,GAAG,CAACG,IAAJ;AAAA;AACE;AACAC,mBAAMC,YAAN,CAAmBJ,OAAnB,EAA4B;AAC1BK,MAAAA,GAAG,iBAAUJ,YAAV;AADuB,KAA5B,CAFF;;AAOA,QAAIA,YAAY,KAAKJ,QAAQ,CAACS,MAAT,GAAkB,CAAvC,EAA0C;AACxCP,MAAAA,GAAG,CAACG,IAAJ,EACE;AACAP,MAAAA,SAAS,iBACPQ,eAAMC,YAAN,CAAmBT,SAAnB,EAA8B;AAC5BU,QAAAA,GAAG,qBAAcJ,YAAd;AADyB,OAA9B,CAHJ;AAOD;;AAED,WAAOF,GAAP;AACD,GAnBA,EAmBE,EAnBF,CADH,CADF;AAwBD,CA3BM","sourcesContent":["import React from \"react\"\nimport { flattenChildren } from \"../../helpers/flattenChildren\"\n\ninterface JoinProps {\n separator: React.ReactElement<any>\n}\n\n/**\n * `Join` is a higher order component that renders a separator component\n * between each of `Join`'s direct children.\n *\n * @example\n *\n * <Join separator={<SomeComponent/>}>\n * <child1/>\n * <child2/>\n * <child3/>\n * </Join>\n *\n * which renders\n *\n * <child1/>\n * <SomeComponent/>\n * <child2/>\n * <SomeComponent/>\n * <child3/>\n */\nexport const Join: React.FC<JoinProps> = ({ separator, children }) => {\n const elements = flattenChildren(children)\n\n return (\n <>\n {elements.reduce((acc, element, currentIndex) => {\n acc.push(\n // @ts-expect-error MIGRATE_STRICT_MODE\n React.cloneElement(element, {\n key: `join-${currentIndex}`,\n })\n )\n\n if (currentIndex !== elements.length - 1) {\n acc.push(\n // @ts-expect-error MIGRATE_STRICT_MODE\n separator &&\n React.cloneElement(separator, {\n key: `join-sep-${currentIndex}`,\n })\n )\n }\n\n return acc\n }, [])}\n </>\n )\n}\n"],"file":"Join.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artsy/palette",
|
|
3
|
-
"version": "19.1.
|
|
3
|
+
"version": "19.1.4",
|
|
4
4
|
"description": "Design system library for react components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -178,5 +178,5 @@
|
|
|
178
178
|
"<rootDir>/www/"
|
|
179
179
|
]
|
|
180
180
|
},
|
|
181
|
-
"gitHead": "
|
|
181
|
+
"gitHead": "7bd28912474e2837eb08811b773dca9971d9abdc"
|
|
182
182
|
}
|