@micromag/screen-share 0.3.311 → 0.3.322
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 +46 -61
- package/lib/index.js +46 -61
- package/package.json +12 -12
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.micromag-screen-share-container .micromag-screen-share-background{position:absolute;top:0;
|
|
1
|
+
.micromag-screen-share-container .micromag-screen-share-background{height:100%;left:0;position:absolute;top:0;width:100%}.micromag-screen-share-container{height:100%;overflow:hidden;position:relative;width:100%}.micromag-screen-share-disabled.micromag-screen-share-container{overflow:hidden;pointer-events:none}.micromag-screen-share-hidden.micromag-screen-share-container{display:none;visibility:hidden}.micromag-screen-share-placeholder.micromag-screen-share-container .micromag-screen-share-content{padding:6px;position:relative}.micromag-screen-share-emptyHeading,.micromag-screen-share-emptyOptions{border:2px dashed #343434;color:#343434;margin:5px auto}.micromag-screen-share-container .micromag-screen-share-background{z-index:0}.micromag-screen-share-container .micromag-screen-share-content{z-index:1}.micromag-screen-share-layout{overflow-x:hidden;overflow-y:auto;padding:10px}.micromag-screen-share-shareOptions{margin-top:10px}.micromag-screen-share-shareOptions.micromag-screen-share-isCentered{-ms-flex-pack:center;justify-content:center}.micromag-screen-share-shareButton{display:-ms-flexbox;display:flex;width:100%}.micromag-screen-share-emptyHeading,.micromag-screen-share-emptyOptions{margin:10px auto;padding:10px;width:100%}.micromag-screen-share-emptyOptions{padding:40px}
|
package/es/index.js
CHANGED
|
@@ -57,52 +57,44 @@ var defaultProps = {
|
|
|
57
57
|
transitionStagger: 100,
|
|
58
58
|
className: null
|
|
59
59
|
};
|
|
60
|
-
|
|
61
60
|
var ShareScreen = function ShareScreen(_ref) {
|
|
62
61
|
var _ref4;
|
|
63
|
-
|
|
64
62
|
var layout = _ref.layout,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
63
|
+
heading = _ref.heading,
|
|
64
|
+
shareUrl = _ref.shareUrl,
|
|
65
|
+
options = _ref.options,
|
|
66
|
+
buttonsStyle = _ref.buttonsStyle,
|
|
67
|
+
buttonsTextStyle = _ref.buttonsTextStyle,
|
|
68
|
+
centered = _ref.centered,
|
|
69
|
+
spacing = _ref.spacing,
|
|
70
|
+
background = _ref.background,
|
|
71
|
+
callToAction = _ref.callToAction,
|
|
72
|
+
id = _ref.id,
|
|
73
|
+
index = _ref.index,
|
|
74
|
+
current = _ref.current,
|
|
75
|
+
active = _ref.active,
|
|
76
|
+
transitions = _ref.transitions,
|
|
77
|
+
transitionStagger = _ref.transitionStagger,
|
|
78
|
+
className = _ref.className;
|
|
82
79
|
var _useScreenSize = useScreenSize(),
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
width = _useScreenSize.width,
|
|
81
|
+
height = _useScreenSize.height,
|
|
82
|
+
resolution = _useScreenSize.resolution;
|
|
87
83
|
var _useScreenRenderConte = useScreenRenderContext(),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
84
|
+
isView = _useScreenRenderConte.isView,
|
|
85
|
+
isPreview = _useScreenRenderConte.isPreview,
|
|
86
|
+
isPlaceholder = _useScreenRenderConte.isPlaceholder,
|
|
87
|
+
isEdit = _useScreenRenderConte.isEdit,
|
|
88
|
+
isStatic = _useScreenRenderConte.isStatic,
|
|
89
|
+
isCapture = _useScreenRenderConte.isCapture;
|
|
95
90
|
var _useViewerContext = useViewerContext(),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
91
|
+
viewerTopHeight = _useViewerContext.topHeight,
|
|
92
|
+
viewerBottomHeight = _useViewerContext.bottomHeight,
|
|
93
|
+
viewerBottomSidesWidth = _useViewerContext.bottomSidesWidth;
|
|
100
94
|
var _useViewerWebView = useViewerWebView(),
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
openWebView = _useViewerWebView.open;
|
|
103
96
|
var _usePlaybackContext = usePlaybackContext(),
|
|
104
|
-
|
|
105
|
-
|
|
97
|
+
muted = _usePlaybackContext.muted;
|
|
106
98
|
var mediaRef = usePlaybackMediaRef(current);
|
|
107
99
|
var transitionPlaying = current;
|
|
108
100
|
var transitionDisabled = isStatic || isCapture || isPlaceholder || isPreview || isEdit;
|
|
@@ -111,13 +103,11 @@ var ShareScreen = function ShareScreen(_ref) {
|
|
|
111
103
|
var hasCallToAction = callToAction !== null && callToAction.active === true;
|
|
112
104
|
var currentUrl = useMemo(function () {
|
|
113
105
|
if (typeof window === 'undefined') return '';
|
|
114
|
-
|
|
115
106
|
var _ref2 = window.location || {},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
107
|
+
_ref2$hostname = _ref2.hostname,
|
|
108
|
+
hostname = _ref2$hostname === void 0 ? null : _ref2$hostname,
|
|
109
|
+
_ref2$pathname = _ref2.pathname,
|
|
110
|
+
pathname = _ref2$pathname === void 0 ? null : _ref2$pathname;
|
|
121
111
|
var parts = pathname.split('/');
|
|
122
112
|
/**
|
|
123
113
|
* for the last portion of the path, if it's equal to the screen index,
|
|
@@ -128,17 +118,17 @@ var ShareScreen = function ShareScreen(_ref) {
|
|
|
128
118
|
* is on screen 10, then a string replace would remove the `/10` from the
|
|
129
119
|
* URL)
|
|
130
120
|
*/
|
|
131
|
-
|
|
132
121
|
return parts.reduce(function (acc, part, i) {
|
|
133
|
-
return (
|
|
122
|
+
return (
|
|
123
|
+
// it's equal to the screen index, or equal to the screen ID, or it's empty
|
|
134
124
|
i === parts.length - 1 && parseInt(part, 10) === index || part === id || part === '' ? acc : "".concat(acc, "/").concat(part)
|
|
135
125
|
);
|
|
136
126
|
}, hostname);
|
|
137
|
-
}, [index, id]);
|
|
127
|
+
}, [index, id]);
|
|
138
128
|
|
|
129
|
+
// if not share URl was specified, default to the currentURL (without the screen index/id part)
|
|
139
130
|
var finalShareURL = shareUrl || currentUrl;
|
|
140
|
-
var defaultOptions = options !== null ? ['email', 'facebook', 'twitter', 'linkedin', 'whatsapp']
|
|
141
|
-
: [];
|
|
131
|
+
var defaultOptions = options !== null ? ['email', 'facebook', 'twitter', 'linkedin', 'whatsapp'] : [];
|
|
142
132
|
var selectedOptions = options !== null ? Object.keys(options).reduce(function (acc, key) {
|
|
143
133
|
if (!options[key]) return acc;
|
|
144
134
|
return [].concat(_toConsumableArray(acc), [key]);
|
|
@@ -237,27 +227,22 @@ var ShareScreen = function ShareScreen(_ref) {
|
|
|
237
227
|
className: styles.background
|
|
238
228
|
}) : null);
|
|
239
229
|
};
|
|
240
|
-
|
|
241
230
|
ShareScreen.propTypes = propTypes;
|
|
242
231
|
ShareScreen.defaultProps = defaultProps;
|
|
243
232
|
var ShareScreen$1 = /*#__PURE__*/React.memo(ShareScreen);
|
|
244
233
|
|
|
245
234
|
var transform = function transform(newStory, _ref) {
|
|
246
235
|
var text = _ref.text,
|
|
247
|
-
|
|
248
|
-
|
|
236
|
+
title = _ref.title;
|
|
249
237
|
var _Heading = Heading1(newStory, title),
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
238
|
+
titleStory = _Heading.story,
|
|
239
|
+
titleComponent = _Heading.component;
|
|
253
240
|
var _Text = Text(titleStory, text),
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
241
|
+
textStory = _Text.story,
|
|
242
|
+
textComponent = _Text.component;
|
|
257
243
|
var _Container = Container$1(textStory, [].concat(_toConsumableArray(titleComponent ? [titleComponent] : []), _toConsumableArray(textComponent ? [textComponent] : []))),
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
244
|
+
containerStory = _Container.story,
|
|
245
|
+
containerComponent = _Container.component;
|
|
261
246
|
return _objectSpread(_objectSpread({}, containerStory), {}, {
|
|
262
247
|
components: [].concat(_toConsumableArray(newStory.components || []), _toConsumableArray(containerComponent ? [containerComponent] : []))
|
|
263
248
|
});
|
package/lib/index.js
CHANGED
|
@@ -76,52 +76,44 @@ var defaultProps = {
|
|
|
76
76
|
transitionStagger: 100,
|
|
77
77
|
className: null
|
|
78
78
|
};
|
|
79
|
-
|
|
80
79
|
var ShareScreen = function ShareScreen(_ref) {
|
|
81
80
|
var _ref4;
|
|
82
|
-
|
|
83
81
|
var layout = _ref.layout,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
82
|
+
heading = _ref.heading,
|
|
83
|
+
shareUrl = _ref.shareUrl,
|
|
84
|
+
options = _ref.options,
|
|
85
|
+
buttonsStyle = _ref.buttonsStyle,
|
|
86
|
+
buttonsTextStyle = _ref.buttonsTextStyle,
|
|
87
|
+
centered = _ref.centered,
|
|
88
|
+
spacing = _ref.spacing,
|
|
89
|
+
background = _ref.background,
|
|
90
|
+
callToAction = _ref.callToAction,
|
|
91
|
+
id = _ref.id,
|
|
92
|
+
index = _ref.index,
|
|
93
|
+
current = _ref.current,
|
|
94
|
+
active = _ref.active,
|
|
95
|
+
transitions = _ref.transitions,
|
|
96
|
+
transitionStagger = _ref.transitionStagger,
|
|
97
|
+
className = _ref.className;
|
|
101
98
|
var _useScreenSize = contexts.useScreenSize(),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
99
|
+
width = _useScreenSize.width,
|
|
100
|
+
height = _useScreenSize.height,
|
|
101
|
+
resolution = _useScreenSize.resolution;
|
|
106
102
|
var _useScreenRenderConte = contexts.useScreenRenderContext(),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
103
|
+
isView = _useScreenRenderConte.isView,
|
|
104
|
+
isPreview = _useScreenRenderConte.isPreview,
|
|
105
|
+
isPlaceholder = _useScreenRenderConte.isPlaceholder,
|
|
106
|
+
isEdit = _useScreenRenderConte.isEdit,
|
|
107
|
+
isStatic = _useScreenRenderConte.isStatic,
|
|
108
|
+
isCapture = _useScreenRenderConte.isCapture;
|
|
114
109
|
var _useViewerContext = contexts.useViewerContext(),
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
110
|
+
viewerTopHeight = _useViewerContext.topHeight,
|
|
111
|
+
viewerBottomHeight = _useViewerContext.bottomHeight,
|
|
112
|
+
viewerBottomSidesWidth = _useViewerContext.bottomSidesWidth;
|
|
119
113
|
var _useViewerWebView = contexts.useViewerWebView(),
|
|
120
|
-
|
|
121
|
-
|
|
114
|
+
openWebView = _useViewerWebView.open;
|
|
122
115
|
var _usePlaybackContext = contexts.usePlaybackContext(),
|
|
123
|
-
|
|
124
|
-
|
|
116
|
+
muted = _usePlaybackContext.muted;
|
|
125
117
|
var mediaRef = contexts.usePlaybackMediaRef(current);
|
|
126
118
|
var transitionPlaying = current;
|
|
127
119
|
var transitionDisabled = isStatic || isCapture || isPlaceholder || isPreview || isEdit;
|
|
@@ -130,13 +122,11 @@ var ShareScreen = function ShareScreen(_ref) {
|
|
|
130
122
|
var hasCallToAction = callToAction !== null && callToAction.active === true;
|
|
131
123
|
var currentUrl = React.useMemo(function () {
|
|
132
124
|
if (typeof window === 'undefined') return '';
|
|
133
|
-
|
|
134
125
|
var _ref2 = window.location || {},
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
126
|
+
_ref2$hostname = _ref2.hostname,
|
|
127
|
+
hostname = _ref2$hostname === void 0 ? null : _ref2$hostname,
|
|
128
|
+
_ref2$pathname = _ref2.pathname,
|
|
129
|
+
pathname = _ref2$pathname === void 0 ? null : _ref2$pathname;
|
|
140
130
|
var parts = pathname.split('/');
|
|
141
131
|
/**
|
|
142
132
|
* for the last portion of the path, if it's equal to the screen index,
|
|
@@ -147,17 +137,17 @@ var ShareScreen = function ShareScreen(_ref) {
|
|
|
147
137
|
* is on screen 10, then a string replace would remove the `/10` from the
|
|
148
138
|
* URL)
|
|
149
139
|
*/
|
|
150
|
-
|
|
151
140
|
return parts.reduce(function (acc, part, i) {
|
|
152
|
-
return (
|
|
141
|
+
return (
|
|
142
|
+
// it's equal to the screen index, or equal to the screen ID, or it's empty
|
|
153
143
|
i === parts.length - 1 && parseInt(part, 10) === index || part === id || part === '' ? acc : "".concat(acc, "/").concat(part)
|
|
154
144
|
);
|
|
155
145
|
}, hostname);
|
|
156
|
-
}, [index, id]);
|
|
146
|
+
}, [index, id]);
|
|
157
147
|
|
|
148
|
+
// if not share URl was specified, default to the currentURL (without the screen index/id part)
|
|
158
149
|
var finalShareURL = shareUrl || currentUrl;
|
|
159
|
-
var defaultOptions = options !== null ? ['email', 'facebook', 'twitter', 'linkedin', 'whatsapp']
|
|
160
|
-
: [];
|
|
150
|
+
var defaultOptions = options !== null ? ['email', 'facebook', 'twitter', 'linkedin', 'whatsapp'] : [];
|
|
161
151
|
var selectedOptions = options !== null ? Object.keys(options).reduce(function (acc, key) {
|
|
162
152
|
if (!options[key]) return acc;
|
|
163
153
|
return [].concat(_toConsumableArray__default["default"](acc), [key]);
|
|
@@ -256,27 +246,22 @@ var ShareScreen = function ShareScreen(_ref) {
|
|
|
256
246
|
className: styles.background
|
|
257
247
|
}) : null);
|
|
258
248
|
};
|
|
259
|
-
|
|
260
249
|
ShareScreen.propTypes = propTypes;
|
|
261
250
|
ShareScreen.defaultProps = defaultProps;
|
|
262
251
|
var ShareScreen$1 = /*#__PURE__*/React__default["default"].memo(ShareScreen);
|
|
263
252
|
|
|
264
253
|
var transform = function transform(newStory, _ref) {
|
|
265
254
|
var text = _ref.text,
|
|
266
|
-
|
|
267
|
-
|
|
255
|
+
title = _ref.title;
|
|
268
256
|
var _Heading = appleNews.Heading1(newStory, title),
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
257
|
+
titleStory = _Heading.story,
|
|
258
|
+
titleComponent = _Heading.component;
|
|
272
259
|
var _Text = appleNews.Text(titleStory, text),
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
260
|
+
textStory = _Text.story,
|
|
261
|
+
textComponent = _Text.component;
|
|
276
262
|
var _Container = appleNews.Container(textStory, [].concat(_toConsumableArray__default["default"](titleComponent ? [titleComponent] : []), _toConsumableArray__default["default"](textComponent ? [textComponent] : []))),
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
263
|
+
containerStory = _Container.story,
|
|
264
|
+
containerComponent = _Container.component;
|
|
280
265
|
return _objectSpread__default["default"](_objectSpread__default["default"]({}, containerStory), {}, {
|
|
281
266
|
components: [].concat(_toConsumableArray__default["default"](newStory.components || []), _toConsumableArray__default["default"](containerComponent ? [containerComponent] : []))
|
|
282
267
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-share",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.322",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -53,23 +53,23 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@babel/runtime": "^7.13.10",
|
|
56
|
-
"@micromag/core": "^0.3.
|
|
57
|
-
"@micromag/element-background": "^0.3.
|
|
58
|
-
"@micromag/element-call-to-action": "^0.3.
|
|
59
|
-
"@micromag/element-container": "^0.3.
|
|
60
|
-
"@micromag/element-heading": "^0.3.
|
|
61
|
-
"@micromag/element-layout": "^0.3.
|
|
62
|
-
"@micromag/element-share-options": "^0.3.
|
|
63
|
-
"@micromag/element-text": "^0.3.
|
|
64
|
-
"@micromag/transforms": "^0.3.
|
|
56
|
+
"@micromag/core": "^0.3.322",
|
|
57
|
+
"@micromag/element-background": "^0.3.322",
|
|
58
|
+
"@micromag/element-call-to-action": "^0.3.322",
|
|
59
|
+
"@micromag/element-container": "^0.3.322",
|
|
60
|
+
"@micromag/element-heading": "^0.3.322",
|
|
61
|
+
"@micromag/element-layout": "^0.3.322",
|
|
62
|
+
"@micromag/element-share-options": "^0.3.322",
|
|
63
|
+
"@micromag/element-text": "^0.3.322",
|
|
64
|
+
"@micromag/transforms": "^0.3.322",
|
|
65
65
|
"classnames": "^2.2.6",
|
|
66
66
|
"lodash": "^4.17.21",
|
|
67
67
|
"prop-types": "^15.7.2",
|
|
68
68
|
"react-intl": "^5.12.1",
|
|
69
|
-
"uuid": "^
|
|
69
|
+
"uuid": "^9.0.0"
|
|
70
70
|
},
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "2dfe09ad5a9ac720e4bfbffcb6371fc31c24fa9f"
|
|
75
75
|
}
|