@micromag/screen-share 0.4.48 → 0.4.50
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/es/index.js +90 -84
- package/package.json +12 -12
package/es/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { FormattedMessage, defineMessage } from 'react-intl';
|
|
2
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
4
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
4
5
|
import classNames from 'classnames';
|
|
5
|
-
import
|
|
6
|
+
import { useMemo, useCallback } from 'react';
|
|
6
7
|
import { ScreenElement } from '@micromag/core/components';
|
|
7
8
|
import { useScreenSize, useScreenRenderContext, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef } from '@micromag/core/contexts';
|
|
8
9
|
import { useDimensionObserver, useTrackScreenEvent } from '@micromag/core/hooks';
|
|
@@ -14,6 +15,7 @@ import Header from '@micromag/element-header';
|
|
|
14
15
|
import Heading from '@micromag/element-heading';
|
|
15
16
|
import Layout, { Spacer } from '@micromag/element-layout';
|
|
16
17
|
import ShareOptions from '@micromag/element-share-options';
|
|
18
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
17
19
|
|
|
18
20
|
var styles = {"container":"micromag-screen-share-container","background":"micromag-screen-share-background","content":"micromag-screen-share-content","heading":"micromag-screen-share-heading","layout":"micromag-screen-share-layout","shareOptions":"micromag-screen-share-shareOptions","isCentered":"micromag-screen-share-isCentered","shareButton":"micromag-screen-share-shareButton","emptyHeading":"micromag-screen-share-emptyHeading","emptyOptions":"micromag-screen-share-emptyOptions","header":"micromag-screen-share-header","footer":"micromag-screen-share-footer"};
|
|
19
21
|
|
|
@@ -130,90 +132,94 @@ function ShareScreen(_ref) {
|
|
|
130
132
|
});
|
|
131
133
|
}
|
|
132
134
|
}, [trackEvent]);
|
|
133
|
-
return /*#__PURE__*/
|
|
135
|
+
return /*#__PURE__*/jsxs("div", {
|
|
134
136
|
className: classNames([styles.container, className, _defineProperty({}, styles.isPlaceholder, isPlaceholder)]),
|
|
135
|
-
"data-screen-ready": true
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
137
|
+
"data-screen-ready": true,
|
|
138
|
+
children: [/*#__PURE__*/jsx(Container, {
|
|
139
|
+
width: width,
|
|
140
|
+
height: height,
|
|
141
|
+
className: styles.content,
|
|
142
|
+
children: /*#__PURE__*/jsxs(Layout, {
|
|
143
|
+
className: styles.layout,
|
|
144
|
+
verticalAlign: layout,
|
|
145
|
+
fullscreen: true,
|
|
146
|
+
style: !isPlaceholder ? {
|
|
147
|
+
padding: spacing,
|
|
148
|
+
paddingTop: (!isPreview ? viewerTopHeight : 0) + (headerHeight || spacing),
|
|
149
|
+
paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + (footerHeight || spacing)
|
|
150
|
+
} : null,
|
|
151
|
+
children: [!isPlaceholder && hasHeader ? /*#__PURE__*/jsx("div", {
|
|
152
|
+
className: styles.header,
|
|
153
|
+
ref: headerRef,
|
|
154
|
+
style: {
|
|
155
|
+
paddingTop: spacing / 2,
|
|
156
|
+
paddingBottom: spacing,
|
|
157
|
+
paddingLeft: spacing,
|
|
158
|
+
paddingRight: spacing,
|
|
159
|
+
transform: "translate(0px, ".concat(viewerTopHeight, "px)")
|
|
160
|
+
},
|
|
161
|
+
children: /*#__PURE__*/jsx(Header, _objectSpread({}, header))
|
|
162
|
+
}) : null, /*#__PURE__*/jsx(ScreenElement, {
|
|
163
|
+
placeholder: "title",
|
|
164
|
+
emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
|
|
165
|
+
id: "X7kRRa",
|
|
166
|
+
defaultMessage: [{
|
|
167
|
+
"type": 0,
|
|
168
|
+
"value": "Heading"
|
|
169
|
+
}]
|
|
170
|
+
}),
|
|
171
|
+
emptyClassName: styles.emptyHeading,
|
|
172
|
+
isEmpty: !heading || (heading === null || heading === void 0 ? void 0 : heading.body) === '',
|
|
173
|
+
children: heading ? /*#__PURE__*/jsx(Heading, _objectSpread({
|
|
174
|
+
className: classNames([styles.heading])
|
|
175
|
+
}, heading)) : null
|
|
176
|
+
}, "title"), /*#__PURE__*/jsx(Spacer, {
|
|
177
|
+
size: 5
|
|
178
|
+
}, "spacer"), /*#__PURE__*/jsx(ScreenElement, {
|
|
179
|
+
placeholder: "share-options",
|
|
180
|
+
emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
|
|
181
|
+
id: "RucIeL",
|
|
182
|
+
defaultMessage: [{
|
|
183
|
+
"type": 0,
|
|
184
|
+
"value": "Share options"
|
|
185
|
+
}]
|
|
186
|
+
}),
|
|
187
|
+
emptyClassName: styles.emptyOptions,
|
|
188
|
+
isEmpty: !options,
|
|
189
|
+
children: /*#__PURE__*/jsx(ShareOptions, {
|
|
190
|
+
className: classNames([styles.shareOptions, _defineProperty({}, styles.isCentered, centered)]),
|
|
191
|
+
buttonClassName: styles.shareButton,
|
|
192
|
+
url: finalShareURL,
|
|
193
|
+
options: selectedOptions,
|
|
194
|
+
onShare: onClickShare,
|
|
195
|
+
buttonsStyle: buttonsStyle,
|
|
196
|
+
buttonsTextStyle: buttonsTextStyle
|
|
197
|
+
})
|
|
198
|
+
}, "share-options"), !isPlaceholder && hasFooter ? /*#__PURE__*/jsx("div", {
|
|
199
|
+
className: styles.footer,
|
|
200
|
+
ref: footerRef,
|
|
201
|
+
style: {
|
|
202
|
+
paddingTop: spacing,
|
|
203
|
+
paddingBottom: spacing / 2,
|
|
204
|
+
paddingLeft: Math.max(viewerBottomSidesWidth - spacing, 0),
|
|
205
|
+
paddingRight: Math.max(viewerBottomSidesWidth - spacing, 0)
|
|
206
|
+
},
|
|
207
|
+
children: /*#__PURE__*/jsx(Footer, _objectSpread({}, footerProps))
|
|
208
|
+
}) : null]
|
|
209
|
+
})
|
|
210
|
+
}), !isPlaceholder ? /*#__PURE__*/jsx(Background, {
|
|
211
|
+
background: background,
|
|
212
|
+
width: width,
|
|
213
|
+
height: height,
|
|
214
|
+
resolution: resolution,
|
|
215
|
+
playing: backgroundPlaying,
|
|
216
|
+
muted: muted,
|
|
217
|
+
shouldLoad: backgroundShouldLoad,
|
|
218
|
+
mediaRef: mediaRef,
|
|
219
|
+
withoutVideo: isPreview,
|
|
220
|
+
className: styles.background
|
|
221
|
+
}) : null]
|
|
222
|
+
});
|
|
217
223
|
}
|
|
218
224
|
|
|
219
225
|
// import * as transforms from './transforms/index';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-share",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.50",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -65,16 +65,16 @@
|
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@babel/runtime": "^7.28.6",
|
|
68
|
-
"@micromag/core": "^0.4.
|
|
69
|
-
"@micromag/element-background": "^0.4.
|
|
70
|
-
"@micromag/element-container": "^0.4.
|
|
71
|
-
"@micromag/element-footer": "^0.4.
|
|
72
|
-
"@micromag/element-header": "^0.4.
|
|
73
|
-
"@micromag/element-heading": "^0.4.
|
|
74
|
-
"@micromag/element-layout": "^0.4.
|
|
75
|
-
"@micromag/element-share-options": "^0.4.
|
|
76
|
-
"@micromag/element-text": "^0.4.
|
|
77
|
-
"@micromag/transforms": "^0.4.
|
|
68
|
+
"@micromag/core": "^0.4.50",
|
|
69
|
+
"@micromag/element-background": "^0.4.50",
|
|
70
|
+
"@micromag/element-container": "^0.4.50",
|
|
71
|
+
"@micromag/element-footer": "^0.4.50",
|
|
72
|
+
"@micromag/element-header": "^0.4.50",
|
|
73
|
+
"@micromag/element-heading": "^0.4.50",
|
|
74
|
+
"@micromag/element-layout": "^0.4.50",
|
|
75
|
+
"@micromag/element-share-options": "^0.4.50",
|
|
76
|
+
"@micromag/element-text": "^0.4.50",
|
|
77
|
+
"@micromag/transforms": "^0.4.50",
|
|
78
78
|
"classnames": "^2.2.6",
|
|
79
79
|
"lodash": "^4.17.23",
|
|
80
80
|
"react-intl": "^8.1.3 || ^10.0.0",
|
|
@@ -84,6 +84,6 @@
|
|
|
84
84
|
"access": "public",
|
|
85
85
|
"registry": "https://registry.npmjs.org/"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "940d5ca98f8f448b79eaa3e2fa685c3ee95185b8",
|
|
88
88
|
"types": "es/index.d.ts"
|
|
89
89
|
}
|