@micromag/element-share-options 0.3.423 → 0.3.430
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/assets/css/styles.css +1 -1
- package/es/index.js +1 -2
- package/lib/index.js +78 -88
- package/package.json +9 -3
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.micromag-element-share-options-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:inherit;cursor:pointer;display:inline-block;font-family:inherit;padding:0;position:relative}.micromag-element-share-options-item+.micromag-element-share-options-item{margin-top:.5rem}.micromag-element-share-options-button{-ms-flex-align:center;-ms-flex-pack:center;align-items:center;background-color:transparent;color:#fff;display:-ms-inline-flexbox;display:inline-flex;font-size:1rem;font-weight:400;justify-content:center;text-decoration:none;-webkit-transform-origin:0 50%;-ms-transform-origin:0 50%;transform-origin:0 50%;-webkit-transition:-webkit-transform .3s cubic-bezier(0,.6,.5,1);transition:-webkit-transform .3s cubic-bezier(0,.6,.5,1)
|
|
1
|
+
.micromag-element-share-options-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:inherit;cursor:pointer;display:inline-block;font-family:inherit;padding:0;position:relative}.micromag-element-share-options-item+.micromag-element-share-options-item{margin-top:.5rem}.micromag-element-share-options-button{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background-color:transparent;color:#fff;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-size:1rem;font-weight:400;justify-content:center;text-decoration:none;-webkit-transform-origin:0 50%;-ms-transform-origin:0 50%;transform-origin:0 50%;-webkit-transition:-webkit-transform .3s cubic-bezier(0,.6,.5,1);transition:-webkit-transform .3s cubic-bezier(0,.6,.5,1);transition:transform .3s cubic-bezier(0,.6,.5,1);transition:transform .3s cubic-bezier(0,.6,.5,1),-webkit-transform .3s cubic-bezier(0,.6,.5,1)}@media (hover:hover){.micromag-element-share-options-button:hover .micromag-element-share-options-icon,.micromag-element-share-options-button:hover .micromag-element-share-options-label{color:#fff;-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05);-webkit-transition:-webkit-transform .3s cubic-bezier(.21,2.59,0,.9);transition:-webkit-transform .3s cubic-bezier(.21,2.59,0,.9);transition:transform .3s cubic-bezier(.21,2.59,0,.9);transition:transform .3s cubic-bezier(.21,2.59,0,.9),-webkit-transform .3s cubic-bezier(.21,2.59,0,.9)}}.micromag-element-share-options-button:active .micromag-element-share-options-icon,.micromag-element-share-options-button:active .micromag-element-share-options-label,.micromag-element-share-options-button:focus .micromag-element-share-options-icon,.micromag-element-share-options-button:focus .micromag-element-share-options-label{color:#fff;-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05);-webkit-transition:-webkit-transform .3s cubic-bezier(.41,1.69,.04,.67);transition:-webkit-transform .3s cubic-bezier(.41,1.69,.04,.67);transition:transform .3s cubic-bezier(.41,1.69,.04,.67);transition:transform .3s cubic-bezier(.41,1.69,.04,.67),-webkit-transform .3s cubic-bezier(.41,1.69,.04,.67)}.micromag-element-share-options-icon{-ms-flex-negative:0;display:block;flex-shrink:0;position:relative}.micromag-element-share-options-icon,.micromag-element-share-options-spacer{height:100%;width:45px}.micromag-element-share-options-icon,.micromag-element-share-options-label{-webkit-transition:-webkit-transform .3s cubic-bezier(0,.6,.5,1);transition:-webkit-transform .3s cubic-bezier(0,.6,.5,1);transition:transform .3s cubic-bezier(0,.6,.5,1);transition:transform .3s cubic-bezier(0,.6,.5,1),-webkit-transform .3s cubic-bezier(0,.6,.5,1)}.micromag-element-share-options-label{-webkit-box-flex:1;-ms-flex-positive:1;-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;flex-grow:1;font-size:inherit;justify-content:center;line-height:1;margin-left:.25em;margin-right:.25em;padding:.25rem;-webkit-transform-origin:center;-ms-transform-origin:center;transform-origin:center}.micromag-element-share-options-labelText{-ms-flex-negative:0;flex-shrink:0;margin-left:.25em;margin-right:.25em}
|
package/es/index.js
CHANGED
|
@@ -145,7 +145,6 @@ var defaultProps = {
|
|
|
145
145
|
focusable: true
|
|
146
146
|
};
|
|
147
147
|
var ShareOptions = function ShareOptions(_ref) {
|
|
148
|
-
var _ref14;
|
|
149
148
|
var className = _ref.className,
|
|
150
149
|
itemClassName = _ref.itemClassName,
|
|
151
150
|
labelClassName = _ref.labelClassName,
|
|
@@ -373,7 +372,7 @@ var ShareOptions = function ShareOptions(_ref) {
|
|
|
373
372
|
}, /*#__PURE__*/React.createElement("div", {
|
|
374
373
|
className: styles.options
|
|
375
374
|
}, hasShareLink ? /*#__PURE__*/React.createElement("div", {
|
|
376
|
-
className: classNames([styles.item, (
|
|
375
|
+
className: classNames([styles.item, _defineProperty(_defineProperty({}, itemClassName, itemClassName !== null), styles.isLinkCopied, linkCopied)])
|
|
377
376
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
378
377
|
className: classNames([styles.button, _defineProperty({}, buttonClassName, buttonClassName !== null)]),
|
|
379
378
|
onClick: onClickCopy,
|
package/lib/index.js
CHANGED
|
@@ -12,18 +12,9 @@ var core = require('@micromag/core');
|
|
|
12
12
|
var components = require('@micromag/core/components');
|
|
13
13
|
var utils = require('@micromag/core/utils');
|
|
14
14
|
|
|
15
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
-
|
|
17
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
18
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
19
|
-
var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
|
|
20
|
-
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
21
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
22
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
-
|
|
24
15
|
var propTypes$3 = {
|
|
25
|
-
className:
|
|
26
|
-
size:
|
|
16
|
+
className: PropTypes.string,
|
|
17
|
+
size: PropTypes.number
|
|
27
18
|
};
|
|
28
19
|
var defaultProps$3 = {
|
|
29
20
|
className: null,
|
|
@@ -32,24 +23,24 @@ var defaultProps$3 = {
|
|
|
32
23
|
var EmailIcon = function EmailIcon(_ref) {
|
|
33
24
|
var className = _ref.className,
|
|
34
25
|
size = _ref.size;
|
|
35
|
-
return /*#__PURE__*/
|
|
26
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
36
27
|
width: size,
|
|
37
28
|
height: size,
|
|
38
29
|
viewBox: "0 0 45 45",
|
|
39
30
|
fill: "none",
|
|
40
31
|
xmlns: "http://www.w3.org/2000/svg",
|
|
41
|
-
className:
|
|
42
|
-
}, /*#__PURE__*/
|
|
32
|
+
className: classNames([_defineProperty({}, className, className !== null)])
|
|
33
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
43
34
|
clipPath: "url(#clip0_837_18233)"
|
|
44
|
-
}, /*#__PURE__*/
|
|
35
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
45
36
|
d: "M32.8293 17.0498L27.3973 22.5436C27.3582 22.5825 27.3582 22.6453 27.3973 22.6842L31.1987 26.7044C31.4557 26.9576 31.4568 27.3694 31.2007 27.6247L31.1987 27.6267C30.9417 27.8809 30.526 27.8809 30.2699 27.6267L26.4836 23.6214C26.4435 23.5816 26.3782 23.5816 26.337 23.6214L25.4143 24.5557C24.6512 25.3304 23.607 25.7671 22.5156 25.7691C21.4011 25.7631 20.3367 25.3135 19.5606 24.5198L18.672 23.6224C18.6318 23.5826 18.5666 23.5826 18.5254 23.6224L14.7371 27.6286C14.48 27.8829 14.0644 27.8829 13.8083 27.6286C13.5513 27.3754 13.5503 26.9636 13.8063 26.7084L13.8083 26.7064L17.6097 22.6862C17.6448 22.6463 17.6448 22.5855 17.6097 22.5456L12.1717 17.0498C12.1335 17.0109 12.0703 17.0099 12.0301 17.0478C12.011 17.0667 12 17.0927 12 17.1196V28.1132C12.003 28.9976 12.7239 29.7145 13.6155 29.7175H31.3855C32.2761 29.7145 32.998 28.9986 33.001 28.1132V17.1196C33.001 17.0647 32.9568 17.0199 32.9016 17.0199C32.8745 17.0199 32.8484 17.0308 32.8293 17.0498Z",
|
|
46
37
|
fill: "currentColor"
|
|
47
|
-
}), /*#__PURE__*/
|
|
38
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
48
39
|
d: "M22.4995 24.459C23.2425 24.461 23.9544 24.1648 24.4735 23.6364L32.3946 15.631C32.1114 15.4036 31.759 15.28 31.3955 15.28H13.6105C13.246 15.279 12.8936 15.4026 12.6105 15.631L20.5305 23.6364C21.0476 24.1628 21.7585 24.46 22.4995 24.459Z",
|
|
49
40
|
fill: "currentColor"
|
|
50
|
-
})), /*#__PURE__*/
|
|
41
|
+
})), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
|
|
51
42
|
id: "clip0_837_18233"
|
|
52
|
-
}, /*#__PURE__*/
|
|
43
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
53
44
|
width: "21",
|
|
54
45
|
height: "14.4375",
|
|
55
46
|
fill: "currentColor",
|
|
@@ -60,8 +51,8 @@ EmailIcon.propTypes = propTypes$3;
|
|
|
60
51
|
EmailIcon.defaultProps = defaultProps$3;
|
|
61
52
|
|
|
62
53
|
var propTypes$2 = {
|
|
63
|
-
className:
|
|
64
|
-
size:
|
|
54
|
+
className: PropTypes.string,
|
|
55
|
+
size: PropTypes.number
|
|
65
56
|
};
|
|
66
57
|
var defaultProps$2 = {
|
|
67
58
|
className: null,
|
|
@@ -70,20 +61,20 @@ var defaultProps$2 = {
|
|
|
70
61
|
var ShareLinkIcon = function ShareLinkIcon(_ref) {
|
|
71
62
|
var className = _ref.className,
|
|
72
63
|
size = _ref.size;
|
|
73
|
-
return /*#__PURE__*/
|
|
64
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
74
65
|
xmlns: "http://www.w3.org/2000/svg",
|
|
75
66
|
width: size,
|
|
76
67
|
height: size,
|
|
77
68
|
viewBox: "0 0 64 64",
|
|
78
|
-
className:
|
|
79
|
-
}, /*#__PURE__*/
|
|
69
|
+
className: classNames([_defineProperty({}, className, className !== null)])
|
|
70
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
80
71
|
d: "M29.1,33.4a7.19,7.19,0,0,0,10.1,1.4,5,5,0,0,0,.8-.7l4.3-4.3a7.24,7.24,0,0,0,.1-10.2,7.34,7.34,0,0,0-10.2.1l-.1.1-2.5,2.5",
|
|
81
72
|
fill: "none",
|
|
82
73
|
stroke: "currentColor",
|
|
83
74
|
strokeLinecap: "round",
|
|
84
75
|
strokeLinejoin: "round",
|
|
85
76
|
strokeWidth: "3"
|
|
86
|
-
}), /*#__PURE__*/
|
|
77
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
87
78
|
d: "M34.9,30.6a7.19,7.19,0,0,0-10.1-1.4,5,5,0,0,0-.8.7l-4.3,4.3a7.24,7.24,0,0,0-.1,10.2,7.15,7.15,0,0,0,10.2.1l.1-.1,2.5-2.5",
|
|
88
79
|
fill: "none",
|
|
89
80
|
stroke: "currentColor",
|
|
@@ -96,8 +87,8 @@ ShareLinkIcon.propTypes = propTypes$2;
|
|
|
96
87
|
ShareLinkIcon.defaultProps = defaultProps$2;
|
|
97
88
|
|
|
98
89
|
var propTypes$1 = {
|
|
99
|
-
className:
|
|
100
|
-
size:
|
|
90
|
+
className: PropTypes.string,
|
|
91
|
+
size: PropTypes.number
|
|
101
92
|
};
|
|
102
93
|
var defaultProps$1 = {
|
|
103
94
|
className: null,
|
|
@@ -106,14 +97,14 @@ var defaultProps$1 = {
|
|
|
106
97
|
var SmsIcon = function SmsIcon(_ref) {
|
|
107
98
|
var className = _ref.className,
|
|
108
99
|
size = _ref.size;
|
|
109
|
-
return /*#__PURE__*/
|
|
100
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
110
101
|
width: size,
|
|
111
102
|
height: size,
|
|
112
103
|
viewBox: "0 0 45 45",
|
|
113
104
|
fill: "none",
|
|
114
105
|
xmlns: "http://www.w3.org/2000/svg",
|
|
115
|
-
className:
|
|
116
|
-
}, /*#__PURE__*/
|
|
106
|
+
className: classNames([_defineProperty({}, className, className !== null)])
|
|
107
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
117
108
|
d: "M30.8988 12H14.1001C12.9444 12.0053 12.0106 12.9444 12.0106 14.1001L12 32.9989L16.2002 28.7987H30.8999C32.0578 28.7955 32.9968 27.8576 33 26.6986V14.1001C32.9968 12.9422 32.0588 12.0032 30.8999 12H30.8988ZM19.3498 20.3999C19.3498 20.9798 18.8797 21.4499 18.2998 21.4499V21.4499C17.7199 21.4499 17.2497 20.9798 17.2497 20.3999V20.3999C17.2497 19.82 17.7199 19.3498 18.2998 19.3498V19.3498C18.8797 19.3498 19.3498 19.82 19.3498 20.3999V20.3999ZM23.5501 20.3999C23.5501 20.9798 23.0799 21.4499 22.5 21.4499V21.4499C21.9201 21.4499 21.4499 20.9798 21.4499 20.3999V20.3999C21.4499 19.82 21.9201 19.3498 22.5 19.3498V19.3498C23.0799 19.3498 23.5501 19.82 23.5501 20.3999V20.3999ZM27.7503 20.3999C27.7503 20.9798 27.2801 21.4499 26.7002 21.4499V21.4499C26.1203 21.4499 25.6502 20.9798 25.6502 20.3999V20.3999C25.6502 19.82 26.1203 19.3498 26.7002 19.3498V19.3498C27.2801 19.3498 27.7503 19.82 27.7503 20.3999V20.3999Z",
|
|
118
109
|
fill: "currentColor"
|
|
119
110
|
}));
|
|
@@ -124,20 +115,20 @@ SmsIcon.defaultProps = defaultProps$1;
|
|
|
124
115
|
var styles = {"button":"micromag-element-share-options-button","item":"micromag-element-share-options-item","icon":"micromag-element-share-options-icon","label":"micromag-element-share-options-label","spacer":"micromag-element-share-options-spacer","labelText":"micromag-element-share-options-labelText"};
|
|
125
116
|
|
|
126
117
|
var propTypes = {
|
|
127
|
-
className:
|
|
128
|
-
itemClassName:
|
|
129
|
-
labelClassName:
|
|
130
|
-
buttonClassName:
|
|
131
|
-
title:
|
|
132
|
-
url:
|
|
133
|
-
options:
|
|
118
|
+
className: PropTypes.string,
|
|
119
|
+
itemClassName: PropTypes.string,
|
|
120
|
+
labelClassName: PropTypes.string,
|
|
121
|
+
buttonClassName: PropTypes.string,
|
|
122
|
+
title: PropTypes.string,
|
|
123
|
+
url: PropTypes.string,
|
|
124
|
+
options: PropTypes.arrayOf(PropTypes.string),
|
|
134
125
|
buttonsStyle: core.PropTypes.boxStyle,
|
|
135
126
|
buttonsTextStyle: core.PropTypes.textStyle,
|
|
136
|
-
iconSize:
|
|
127
|
+
iconSize: PropTypes.number,
|
|
137
128
|
theme: core.PropTypes.viewerTheme,
|
|
138
|
-
onShare:
|
|
139
|
-
onClose:
|
|
140
|
-
focusable:
|
|
129
|
+
onShare: PropTypes.func,
|
|
130
|
+
onClose: PropTypes.func,
|
|
131
|
+
focusable: PropTypes.bool
|
|
141
132
|
};
|
|
142
133
|
var defaultProps = {
|
|
143
134
|
className: null,
|
|
@@ -156,7 +147,6 @@ var defaultProps = {
|
|
|
156
147
|
focusable: true
|
|
157
148
|
};
|
|
158
149
|
var ShareOptions = function ShareOptions(_ref) {
|
|
159
|
-
var _ref14;
|
|
160
150
|
var className = _ref.className,
|
|
161
151
|
itemClassName = _ref.itemClassName,
|
|
162
152
|
labelClassName = _ref.labelClassName,
|
|
@@ -183,13 +173,13 @@ var ShareOptions = function ShareOptions(_ref) {
|
|
|
183
173
|
var colorStyles = utils.getStyleFromColor(brandPrimaryColor, 'color');
|
|
184
174
|
var finalStyles = colorStyles;
|
|
185
175
|
if (buttonsTextStyle !== null) {
|
|
186
|
-
finalStyles =
|
|
176
|
+
finalStyles = _objectSpread(_objectSpread({}, finalStyles), utils.getStyleFromText(buttonsTextStyle));
|
|
187
177
|
}
|
|
188
178
|
if (buttonsStyle !== null) {
|
|
189
|
-
finalStyles =
|
|
179
|
+
finalStyles = _objectSpread(_objectSpread({}, finalStyles), utils.getStyleFromBox(buttonsStyle));
|
|
190
180
|
}
|
|
191
181
|
var _useState = React.useState(false),
|
|
192
|
-
_useState2 =
|
|
182
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
193
183
|
linkCopied = _useState2[0],
|
|
194
184
|
setLinkCopied = _useState2[1];
|
|
195
185
|
var onClickCopy = React.useCallback(function () {
|
|
@@ -207,7 +197,7 @@ var ShareOptions = function ShareOptions(_ref) {
|
|
|
207
197
|
}, [onShare]);
|
|
208
198
|
var shareButtonProps = React.useMemo(function () {
|
|
209
199
|
return {
|
|
210
|
-
className:
|
|
200
|
+
className: classNames([styles.button, _defineProperty({}, buttonClassName, buttonClassName !== null)]),
|
|
211
201
|
url: url,
|
|
212
202
|
onShareWindowClose: function onShareWindowClose() {
|
|
213
203
|
if (onClose !== null) {
|
|
@@ -228,7 +218,7 @@ var ShareOptions = function ShareOptions(_ref) {
|
|
|
228
218
|
}, [iconSize]);
|
|
229
219
|
var shareOptions = [{
|
|
230
220
|
id: 'facebook',
|
|
231
|
-
button: /*#__PURE__*/
|
|
221
|
+
button: /*#__PURE__*/React.createElement(reactShare.FacebookShareButton, Object.assign({}, shareButtonProps, {
|
|
232
222
|
quote: title,
|
|
233
223
|
beforeOnClick: function beforeOnClick() {
|
|
234
224
|
onShareButtonClick('Facebook');
|
|
@@ -236,9 +226,9 @@ var ShareOptions = function ShareOptions(_ref) {
|
|
|
236
226
|
},
|
|
237
227
|
tabIndex: focusable ? null : '-1',
|
|
238
228
|
style: finalStyles
|
|
239
|
-
}), /*#__PURE__*/
|
|
240
|
-
className:
|
|
241
|
-
}, "Facebook"), /*#__PURE__*/
|
|
229
|
+
}), /*#__PURE__*/React.createElement(reactShare.FacebookIcon, shareIconProps), /*#__PURE__*/React.createElement("div", {
|
|
230
|
+
className: classNames([styles.label, _defineProperty({}, labelClassName, labelClassName !== null)])
|
|
231
|
+
}, "Facebook"), /*#__PURE__*/React.createElement("div", {
|
|
242
232
|
className: styles.spacer,
|
|
243
233
|
style: {
|
|
244
234
|
width: "".concat(iconSize, "px")
|
|
@@ -246,7 +236,7 @@ var ShareOptions = function ShareOptions(_ref) {
|
|
|
246
236
|
}))
|
|
247
237
|
}, {
|
|
248
238
|
id: 'twitter',
|
|
249
|
-
button: /*#__PURE__*/
|
|
239
|
+
button: /*#__PURE__*/React.createElement(reactShare.TwitterShareButton, Object.assign({}, shareButtonProps, {
|
|
250
240
|
title: title,
|
|
251
241
|
beforeOnClick: function beforeOnClick() {
|
|
252
242
|
onShareButtonClick('Twitter');
|
|
@@ -254,9 +244,9 @@ var ShareOptions = function ShareOptions(_ref) {
|
|
|
254
244
|
},
|
|
255
245
|
tabIndex: focusable ? null : '-1',
|
|
256
246
|
style: finalStyles
|
|
257
|
-
}), /*#__PURE__*/
|
|
258
|
-
className:
|
|
259
|
-
}, "Twitter"), /*#__PURE__*/
|
|
247
|
+
}), /*#__PURE__*/React.createElement(reactShare.TwitterIcon, shareIconProps), /*#__PURE__*/React.createElement("div", {
|
|
248
|
+
className: classNames([styles.label, _defineProperty({}, labelClassName, labelClassName !== null)])
|
|
249
|
+
}, "Twitter"), /*#__PURE__*/React.createElement("div", {
|
|
260
250
|
className: styles.spacer,
|
|
261
251
|
style: {
|
|
262
252
|
width: "".concat(iconSize, "px")
|
|
@@ -264,7 +254,7 @@ var ShareOptions = function ShareOptions(_ref) {
|
|
|
264
254
|
}))
|
|
265
255
|
}, {
|
|
266
256
|
id: 'linkedin',
|
|
267
|
-
button: /*#__PURE__*/
|
|
257
|
+
button: /*#__PURE__*/React.createElement(reactShare.LinkedinShareButton, Object.assign({}, shareButtonProps, {
|
|
268
258
|
title: title,
|
|
269
259
|
beforeOnClick: function beforeOnClick() {
|
|
270
260
|
onShareButtonClick('LinkedIn');
|
|
@@ -272,9 +262,9 @@ var ShareOptions = function ShareOptions(_ref) {
|
|
|
272
262
|
},
|
|
273
263
|
tabIndex: focusable ? null : '-1',
|
|
274
264
|
style: finalStyles
|
|
275
|
-
}), /*#__PURE__*/
|
|
276
|
-
className:
|
|
277
|
-
}, "LinkedIn"), /*#__PURE__*/
|
|
265
|
+
}), /*#__PURE__*/React.createElement(reactShare.LinkedinIcon, shareIconProps), /*#__PURE__*/React.createElement("div", {
|
|
266
|
+
className: classNames([styles.label, _defineProperty({}, labelClassName, labelClassName !== null)])
|
|
267
|
+
}, "LinkedIn"), /*#__PURE__*/React.createElement("div", {
|
|
278
268
|
className: styles.spacer,
|
|
279
269
|
style: {
|
|
280
270
|
width: "".concat(iconSize, "px")
|
|
@@ -282,7 +272,7 @@ var ShareOptions = function ShareOptions(_ref) {
|
|
|
282
272
|
}))
|
|
283
273
|
}, {
|
|
284
274
|
id: 'whatsapp',
|
|
285
|
-
button: /*#__PURE__*/
|
|
275
|
+
button: /*#__PURE__*/React.createElement(reactShare.WhatsappShareButton, Object.assign({}, shareButtonProps, {
|
|
286
276
|
title: title,
|
|
287
277
|
beforeOnClick: function beforeOnClick() {
|
|
288
278
|
onShareButtonClick('Whatsapp');
|
|
@@ -290,9 +280,9 @@ var ShareOptions = function ShareOptions(_ref) {
|
|
|
290
280
|
},
|
|
291
281
|
tabIndex: focusable ? null : '-1',
|
|
292
282
|
style: finalStyles
|
|
293
|
-
}), /*#__PURE__*/
|
|
294
|
-
className:
|
|
295
|
-
}, "Whatsapp"), /*#__PURE__*/
|
|
283
|
+
}), /*#__PURE__*/React.createElement(reactShare.WhatsappIcon, shareIconProps), /*#__PURE__*/React.createElement("div", {
|
|
284
|
+
className: classNames([styles.label, _defineProperty({}, labelClassName, labelClassName !== null)])
|
|
285
|
+
}, "Whatsapp"), /*#__PURE__*/React.createElement("div", {
|
|
296
286
|
className: styles.spacer,
|
|
297
287
|
style: {
|
|
298
288
|
width: "".concat(iconSize, "px")
|
|
@@ -327,7 +317,7 @@ var ShareOptions = function ShareOptions(_ref) {
|
|
|
327
317
|
// },
|
|
328
318
|
{
|
|
329
319
|
id: 'email',
|
|
330
|
-
button: /*#__PURE__*/
|
|
320
|
+
button: /*#__PURE__*/React.createElement(reactShare.EmailShareButton, Object.assign({}, shareButtonProps, {
|
|
331
321
|
subject: title,
|
|
332
322
|
beforeOnClick: function beforeOnClick() {
|
|
333
323
|
onShareButtonClick('Email');
|
|
@@ -335,15 +325,15 @@ var ShareOptions = function ShareOptions(_ref) {
|
|
|
335
325
|
},
|
|
336
326
|
tabIndex: focusable ? null : '-1',
|
|
337
327
|
style: finalStyles
|
|
338
|
-
}), /*#__PURE__*/
|
|
339
|
-
className:
|
|
340
|
-
}, /*#__PURE__*/
|
|
328
|
+
}), /*#__PURE__*/React.createElement(EmailIcon, shareIconProps), /*#__PURE__*/React.createElement("div", {
|
|
329
|
+
className: classNames([styles.label, _defineProperty({}, labelClassName, labelClassName !== null)])
|
|
330
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
341
331
|
id: "Lrwi2G",
|
|
342
332
|
defaultMessage: [{
|
|
343
333
|
"type": 0,
|
|
344
334
|
"value": "Email"
|
|
345
335
|
}]
|
|
346
|
-
})), /*#__PURE__*/
|
|
336
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
347
337
|
className: styles.spacer,
|
|
348
338
|
style: {
|
|
349
339
|
width: "".concat(iconSize, "px")
|
|
@@ -351,24 +341,24 @@ var ShareOptions = function ShareOptions(_ref) {
|
|
|
351
341
|
}))
|
|
352
342
|
}, {
|
|
353
343
|
id: 'sms',
|
|
354
|
-
button: /*#__PURE__*/
|
|
355
|
-
className:
|
|
344
|
+
button: /*#__PURE__*/React.createElement(components.Button, {
|
|
345
|
+
className: classNames([styles.button, _defineProperty({}, buttonClassName, buttonClassName !== null)]),
|
|
356
346
|
href: "sms:?&body=".concat(url),
|
|
357
347
|
focusable: focusable,
|
|
358
348
|
style: finalStyles,
|
|
359
349
|
external: true,
|
|
360
350
|
withoutBootstrapStyles: true
|
|
361
|
-
}, /*#__PURE__*/
|
|
362
|
-
className:
|
|
363
|
-
}, /*#__PURE__*/
|
|
351
|
+
}, /*#__PURE__*/React.createElement(SmsIcon, shareIconProps), /*#__PURE__*/React.createElement("div", {
|
|
352
|
+
className: classNames([styles.label, _defineProperty({}, labelClassName, labelClassName !== null)])
|
|
353
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
364
354
|
className: styles.labelText
|
|
365
|
-
}, /*#__PURE__*/
|
|
355
|
+
}, /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
366
356
|
id: "dSfmnf",
|
|
367
357
|
defaultMessage: [{
|
|
368
358
|
"type": 0,
|
|
369
359
|
"value": "SMS"
|
|
370
360
|
}]
|
|
371
|
-
}))), /*#__PURE__*/
|
|
361
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
372
362
|
className: styles.spacer,
|
|
373
363
|
style: {
|
|
374
364
|
width: "".concat(iconSize, "px")
|
|
@@ -379,35 +369,35 @@ var ShareOptions = function ShareOptions(_ref) {
|
|
|
379
369
|
var selectedOptions = options !== null ? shareOptions.filter(function (opt) {
|
|
380
370
|
return options.includes(opt.id);
|
|
381
371
|
}) : shareOptions;
|
|
382
|
-
return /*#__PURE__*/
|
|
383
|
-
className:
|
|
384
|
-
}, /*#__PURE__*/
|
|
372
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
373
|
+
className: classNames([styles.container, _defineProperty({}, className, className !== null)])
|
|
374
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
385
375
|
className: styles.options
|
|
386
|
-
}, hasShareLink ? /*#__PURE__*/
|
|
387
|
-
className:
|
|
388
|
-
}, /*#__PURE__*/
|
|
389
|
-
className:
|
|
376
|
+
}, hasShareLink ? /*#__PURE__*/React.createElement("div", {
|
|
377
|
+
className: classNames([styles.item, _defineProperty(_defineProperty({}, itemClassName, itemClassName !== null), styles.isLinkCopied, linkCopied)])
|
|
378
|
+
}, /*#__PURE__*/React.createElement(components.Button, {
|
|
379
|
+
className: classNames([styles.button, _defineProperty({}, buttonClassName, buttonClassName !== null)]),
|
|
390
380
|
onClick: onClickCopy,
|
|
391
381
|
focusable: focusable,
|
|
392
382
|
style: finalStyles,
|
|
393
383
|
withoutBootstrapStyles: true
|
|
394
|
-
}, /*#__PURE__*/
|
|
395
|
-
className:
|
|
396
|
-
}, /*#__PURE__*/
|
|
384
|
+
}, /*#__PURE__*/React.createElement(ShareLinkIcon, shareIconProps), /*#__PURE__*/React.createElement("div", {
|
|
385
|
+
className: classNames([styles.label, _defineProperty({}, labelClassName, labelClassName !== null)])
|
|
386
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
397
387
|
className: styles.labelText
|
|
398
|
-
}, !linkCopied ? /*#__PURE__*/
|
|
388
|
+
}, !linkCopied ? /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
399
389
|
id: "D21uVQ",
|
|
400
390
|
defaultMessage: [{
|
|
401
391
|
"type": 0,
|
|
402
392
|
"value": "Copy link"
|
|
403
393
|
}]
|
|
404
|
-
}) : null, linkCopied ? /*#__PURE__*/
|
|
394
|
+
}) : null, linkCopied ? /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
405
395
|
id: "xFlbR7",
|
|
406
396
|
defaultMessage: [{
|
|
407
397
|
"type": 0,
|
|
408
398
|
"value": "Link copied!"
|
|
409
399
|
}]
|
|
410
|
-
}) : null)), /*#__PURE__*/
|
|
400
|
+
}) : null)), /*#__PURE__*/React.createElement("div", {
|
|
411
401
|
className: styles.spacer,
|
|
412
402
|
style: {
|
|
413
403
|
width: "".concat(iconSize, "px")
|
|
@@ -415,9 +405,9 @@ var ShareOptions = function ShareOptions(_ref) {
|
|
|
415
405
|
}))) : null, selectedOptions.map(function (_ref17) {
|
|
416
406
|
var id = _ref17.id,
|
|
417
407
|
button = _ref17.button;
|
|
418
|
-
return /*#__PURE__*/
|
|
408
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
419
409
|
key: id,
|
|
420
|
-
className:
|
|
410
|
+
className: classNames([styles.item, _defineProperty({}, itemClassName, itemClassName !== null)])
|
|
421
411
|
}, button);
|
|
422
412
|
})));
|
|
423
413
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-share-options",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.430",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -36,6 +36,12 @@
|
|
|
36
36
|
"license": "ISC",
|
|
37
37
|
"main": "lib/index.js",
|
|
38
38
|
"module": "es/index.js",
|
|
39
|
+
"exports": {
|
|
40
|
+
".": {
|
|
41
|
+
"require": "./lib/index.js",
|
|
42
|
+
"import": "./es/index.js"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
39
45
|
"files": [
|
|
40
46
|
"lib",
|
|
41
47
|
"es",
|
|
@@ -54,7 +60,7 @@
|
|
|
54
60
|
},
|
|
55
61
|
"dependencies": {
|
|
56
62
|
"@babel/runtime": "^7.13.10",
|
|
57
|
-
"@micromag/core": "^0.3.
|
|
63
|
+
"@micromag/core": "^0.3.430",
|
|
58
64
|
"classnames": "^2.2.6",
|
|
59
65
|
"prop-types": "^15.7.2",
|
|
60
66
|
"react-intl": "^5.12.1",
|
|
@@ -65,5 +71,5 @@
|
|
|
65
71
|
"access": "public",
|
|
66
72
|
"registry": "https://registry.npmjs.org/"
|
|
67
73
|
},
|
|
68
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "da790d76dba9d8e308d9f9c4e51d93a4a0e012a9"
|
|
69
75
|
}
|