@micromag/screen-contribution 0.3.541 → 0.3.547
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 +2 -3
- package/package.json +16 -17
- package/lib/index.js +0 -628
package/es/index.js
CHANGED
|
@@ -454,7 +454,6 @@ var ContributionScreen = function ContributionScreen(_ref) {
|
|
|
454
454
|
};
|
|
455
455
|
ContributionScreen.propTypes = propTypes;
|
|
456
456
|
ContributionScreen.defaultProps = defaultProps;
|
|
457
|
-
var ContributionScreen$1 = ContributionScreen;
|
|
458
457
|
|
|
459
458
|
var definition = {
|
|
460
459
|
id: 'contribution',
|
|
@@ -476,7 +475,7 @@ var definition = {
|
|
|
476
475
|
"value": "Contribution"
|
|
477
476
|
}]
|
|
478
477
|
}),
|
|
479
|
-
component: ContributionScreen
|
|
478
|
+
component: ContributionScreen,
|
|
480
479
|
layouts: ['top', 'middle', 'bottom'],
|
|
481
480
|
fields: [{
|
|
482
481
|
name: 'layout',
|
|
@@ -620,4 +619,4 @@ var definition = {
|
|
|
620
619
|
}]
|
|
621
620
|
};
|
|
622
621
|
|
|
623
|
-
export { ContributionScreen
|
|
622
|
+
export { ContributionScreen, definition as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-contribution",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.547",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -30,12 +30,11 @@
|
|
|
30
30
|
}
|
|
31
31
|
],
|
|
32
32
|
"license": "ISC",
|
|
33
|
-
"
|
|
33
|
+
"type": "module",
|
|
34
34
|
"module": "es/index.js",
|
|
35
35
|
"style": "assets/css/styles.css",
|
|
36
36
|
"exports": {
|
|
37
37
|
".": {
|
|
38
|
-
"require": "./lib/index.js",
|
|
39
38
|
"import": "./es/index.js"
|
|
40
39
|
},
|
|
41
40
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
@@ -64,19 +63,19 @@
|
|
|
64
63
|
"@fortawesome/fontawesome-svg-core": "^6.5.2",
|
|
65
64
|
"@fortawesome/free-solid-svg-icons": "^6.5.2",
|
|
66
65
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
67
|
-
"@micromag/core": "^0.3.
|
|
68
|
-
"@micromag/data": "^0.3.
|
|
69
|
-
"@micromag/element-background": "^0.3.
|
|
70
|
-
"@micromag/element-button": "^0.3.
|
|
71
|
-
"@micromag/element-container": "^0.3.
|
|
72
|
-
"@micromag/element-footer": "^0.3.
|
|
73
|
-
"@micromag/element-header": "^0.3.
|
|
74
|
-
"@micromag/element-heading": "^0.3.
|
|
75
|
-
"@micromag/element-scroll": "^0.3.
|
|
76
|
-
"@micromag/element-share-incentive": "^0.3.
|
|
77
|
-
"@micromag/element-text": "^0.3.
|
|
78
|
-
"@micromag/element-text-input": "^0.3.
|
|
79
|
-
"@micromag/transforms": "^0.3.
|
|
66
|
+
"@micromag/core": "^0.3.547",
|
|
67
|
+
"@micromag/data": "^0.3.547",
|
|
68
|
+
"@micromag/element-background": "^0.3.547",
|
|
69
|
+
"@micromag/element-button": "^0.3.547",
|
|
70
|
+
"@micromag/element-container": "^0.3.547",
|
|
71
|
+
"@micromag/element-footer": "^0.3.547",
|
|
72
|
+
"@micromag/element-header": "^0.3.547",
|
|
73
|
+
"@micromag/element-heading": "^0.3.547",
|
|
74
|
+
"@micromag/element-scroll": "^0.3.547",
|
|
75
|
+
"@micromag/element-share-incentive": "^0.3.547",
|
|
76
|
+
"@micromag/element-text": "^0.3.547",
|
|
77
|
+
"@micromag/element-text-input": "^0.3.547",
|
|
78
|
+
"@micromag/transforms": "^0.3.547",
|
|
80
79
|
"classnames": "^2.2.6",
|
|
81
80
|
"lodash": "^4.17.21",
|
|
82
81
|
"prop-types": "^15.7.2",
|
|
@@ -87,5 +86,5 @@
|
|
|
87
86
|
"access": "public",
|
|
88
87
|
"registry": "https://registry.npmjs.org/"
|
|
89
88
|
},
|
|
90
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "3c2f5904ce61fcfa61f673c38c2a5ec56e9e2b07"
|
|
91
90
|
}
|
package/lib/index.js
DELETED
|
@@ -1,628 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var reactIntl = require('react-intl');
|
|
6
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
-
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
8
|
-
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
9
|
-
var faSpinner = require('@fortawesome/free-solid-svg-icons/faSpinner');
|
|
10
|
-
var reactFontawesome = require('@fortawesome/react-fontawesome');
|
|
11
|
-
var classNames = require('classnames');
|
|
12
|
-
var PropTypes = require('prop-types');
|
|
13
|
-
var React = require('react');
|
|
14
|
-
var core = require('@micromag/core');
|
|
15
|
-
var components = require('@micromag/core/components');
|
|
16
|
-
var contexts = require('@micromag/core/contexts');
|
|
17
|
-
var hooks = require('@micromag/core/hooks');
|
|
18
|
-
var utils = require('@micromag/core/utils');
|
|
19
|
-
var data = require('@micromag/data');
|
|
20
|
-
var Background = require('@micromag/element-background');
|
|
21
|
-
var Button = require('@micromag/element-button');
|
|
22
|
-
var Container = require('@micromag/element-container');
|
|
23
|
-
var Footer = require('@micromag/element-footer');
|
|
24
|
-
var Header = require('@micromag/element-header');
|
|
25
|
-
var Heading = require('@micromag/element-heading');
|
|
26
|
-
var Scroll = require('@micromag/element-scroll');
|
|
27
|
-
var Text = require('@micromag/element-text');
|
|
28
|
-
var TextInput = require('@micromag/element-text-input');
|
|
29
|
-
|
|
30
|
-
var styles = {"container":"micromag-screen-contribution-container","inner":"micromag-screen-contribution-inner","background":"micromag-screen-contribution-background","buttonSubmit":"micromag-screen-contribution-buttonSubmit","content":"micromag-screen-contribution-content","header":"micromag-screen-contribution-header","emptyTitle":"micromag-screen-contribution-emptyTitle","emptyInputName":"micromag-screen-contribution-emptyInputName","emptyInputMessage":"micromag-screen-contribution-emptyInputMessage","emptySubmit":"micromag-screen-contribution-emptySubmit","title":"micromag-screen-contribution-title","interactiveContainer":"micromag-screen-contribution-interactiveContainer","form":"micromag-screen-contribution-form","inputName":"micromag-screen-contribution-inputName","inputMessage":"micromag-screen-contribution-inputMessage","formContent":"micromag-screen-contribution-formContent","formLoading":"micromag-screen-contribution-formLoading","rotate":"micromag-screen-contribution-rotate","loadingIcon":"micromag-screen-contribution-loadingIcon","contributionsContainer":"micromag-screen-contribution-contributionsContainer","contributionsContent":"micromag-screen-contribution-contributionsContent","contributions":"micromag-screen-contribution-contributions","contribution":"micromag-screen-contribution-contribution","footer":"micromag-screen-contribution-footer","disabled":"micromag-screen-contribution-disabled","submitting":"micromag-screen-contribution-submitting","submitted":"micromag-screen-contribution-submitted","showContributions":"micromag-screen-contribution-showContributions","isPlaceholder":"micromag-screen-contribution-isPlaceholder"};
|
|
31
|
-
|
|
32
|
-
var propTypes = {
|
|
33
|
-
id: PropTypes.string,
|
|
34
|
-
layout: PropTypes.oneOf(['top', 'middle', 'bottom']),
|
|
35
|
-
title: core.PropTypes.headingElement,
|
|
36
|
-
name: core.PropTypes.inputElement,
|
|
37
|
-
message: core.PropTypes.inputElement,
|
|
38
|
-
submit: core.PropTypes.textElement,
|
|
39
|
-
nameStyle: core.PropTypes.textStyle,
|
|
40
|
-
messageStyle: core.PropTypes.textStyle,
|
|
41
|
-
spacing: PropTypes.number,
|
|
42
|
-
background: core.PropTypes.backgroundElement,
|
|
43
|
-
header: core.PropTypes.header,
|
|
44
|
-
footer: core.PropTypes.footer,
|
|
45
|
-
current: PropTypes.bool,
|
|
46
|
-
active: PropTypes.bool,
|
|
47
|
-
transitions: core.PropTypes.transitions,
|
|
48
|
-
transitionStagger: PropTypes.number,
|
|
49
|
-
resizeTransitionDuration: PropTypes.number,
|
|
50
|
-
type: PropTypes.string,
|
|
51
|
-
className: PropTypes.string
|
|
52
|
-
};
|
|
53
|
-
var defaultProps = {
|
|
54
|
-
id: null,
|
|
55
|
-
layout: 'middle',
|
|
56
|
-
title: null,
|
|
57
|
-
name: null,
|
|
58
|
-
message: null,
|
|
59
|
-
submit: null,
|
|
60
|
-
nameStyle: null,
|
|
61
|
-
messageStyle: null,
|
|
62
|
-
spacing: 20,
|
|
63
|
-
background: null,
|
|
64
|
-
header: null,
|
|
65
|
-
footer: null,
|
|
66
|
-
current: true,
|
|
67
|
-
active: true,
|
|
68
|
-
transitions: null,
|
|
69
|
-
transitionStagger: 100,
|
|
70
|
-
resizeTransitionDuration: 750,
|
|
71
|
-
type: null,
|
|
72
|
-
className: null
|
|
73
|
-
};
|
|
74
|
-
var ContributionScreen = function ContributionScreen(_ref) {
|
|
75
|
-
var id = _ref.id,
|
|
76
|
-
layout = _ref.layout,
|
|
77
|
-
title = _ref.title,
|
|
78
|
-
name = _ref.name,
|
|
79
|
-
message = _ref.message,
|
|
80
|
-
submit = _ref.submit,
|
|
81
|
-
nameStyle = _ref.nameStyle,
|
|
82
|
-
messageStyle = _ref.messageStyle,
|
|
83
|
-
spacing = _ref.spacing,
|
|
84
|
-
background = _ref.background,
|
|
85
|
-
header = _ref.header,
|
|
86
|
-
footer = _ref.footer,
|
|
87
|
-
current = _ref.current,
|
|
88
|
-
active = _ref.active,
|
|
89
|
-
transitions = _ref.transitions,
|
|
90
|
-
transitionStagger = _ref.transitionStagger,
|
|
91
|
-
resizeTransitionDuration = _ref.resizeTransitionDuration,
|
|
92
|
-
type = _ref.type,
|
|
93
|
-
className = _ref.className;
|
|
94
|
-
var screenId = id || 'screen-id';
|
|
95
|
-
var trackScreenEvent = hooks.useTrackScreenEvent(type);
|
|
96
|
-
var _useScreenSize = contexts.useScreenSize(),
|
|
97
|
-
width = _useScreenSize.width,
|
|
98
|
-
height = _useScreenSize.height,
|
|
99
|
-
resolution = _useScreenSize.resolution;
|
|
100
|
-
var _useViewerContext = contexts.useViewerContext(),
|
|
101
|
-
viewerTopHeight = _useViewerContext.topHeight,
|
|
102
|
-
viewerBottomHeight = _useViewerContext.bottomHeight,
|
|
103
|
-
viewerBottomSidesWidth = _useViewerContext.bottomSidesWidth;
|
|
104
|
-
var _useScreenRenderConte = contexts.useScreenRenderContext(),
|
|
105
|
-
isView = _useScreenRenderConte.isView,
|
|
106
|
-
isPreview = _useScreenRenderConte.isPreview,
|
|
107
|
-
isPlaceholder = _useScreenRenderConte.isPlaceholder,
|
|
108
|
-
isEdit = _useScreenRenderConte.isEdit,
|
|
109
|
-
isStatic = _useScreenRenderConte.isStatic,
|
|
110
|
-
isCapture = _useScreenRenderConte.isCapture;
|
|
111
|
-
var _useViewerWebView = contexts.useViewerWebView(),
|
|
112
|
-
openWebView = _useViewerWebView.open;
|
|
113
|
-
var _usePlaybackContext = contexts.usePlaybackContext(),
|
|
114
|
-
muted = _usePlaybackContext.muted;
|
|
115
|
-
var mediaRef = contexts.usePlaybackMediaRef(current);
|
|
116
|
-
var backgroundPlaying = current && (isView || isEdit);
|
|
117
|
-
var mediaShouldLoad = current || active;
|
|
118
|
-
var transitionPlaying = current;
|
|
119
|
-
var transitionDisabled = isStatic || isCapture || isPlaceholder || isPreview || isEdit;
|
|
120
|
-
var scrollingDisabled = !isEdit && transitionDisabled || !current;
|
|
121
|
-
var hasHeader = utils.isHeaderFilled(header);
|
|
122
|
-
var hasFooter = utils.isFooterFilled(footer);
|
|
123
|
-
var footerProps = utils.getFooterProps(footer, {
|
|
124
|
-
isView: isView,
|
|
125
|
-
current: current,
|
|
126
|
-
openWebView: openWebView,
|
|
127
|
-
isPreview: isPreview
|
|
128
|
-
});
|
|
129
|
-
var hasTitle = utils.isTextFilled(title);
|
|
130
|
-
var hasNameLabel = utils.isLabelFilled(name);
|
|
131
|
-
var hasMessageLabel = utils.isLabelFilled(message);
|
|
132
|
-
var hasSubmit = utils.isTextFilled(submit);
|
|
133
|
-
var contributionsRef = React.useRef(null);
|
|
134
|
-
var formRef = React.useRef(null);
|
|
135
|
-
var _useState = React.useState(null),
|
|
136
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
137
|
-
interactiveContainerHeight = _useState2[0],
|
|
138
|
-
setInteractiveContainerHeight = _useState2[1];
|
|
139
|
-
var _useState3 = React.useState(''),
|
|
140
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
141
|
-
userName = _useState4[0],
|
|
142
|
-
setUserName = _useState4[1];
|
|
143
|
-
var _useState5 = React.useState(''),
|
|
144
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
145
|
-
userMessage = _useState6[0],
|
|
146
|
-
setUserMessage = _useState6[1];
|
|
147
|
-
|
|
148
|
-
// 0 = default, 1 = submitting, 2 = submitted, 3 = resizing, 4 = done
|
|
149
|
-
var _useState7 = React.useState(isStatic || isCapture ? 4 : 0),
|
|
150
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
151
|
-
submitState = _useState8[0],
|
|
152
|
-
setSubmitState = _useState8[1];
|
|
153
|
-
var onContributionSubmitted = React.useCallback(function () {
|
|
154
|
-
setSubmitState(2);
|
|
155
|
-
trackScreenEvent('submit_success', "".concat(userName, ": ").concat(userMessage));
|
|
156
|
-
}, [setSubmitState, trackScreenEvent, userName, userMessage]);
|
|
157
|
-
var _useContributionCreat = data.useContributionCreate({
|
|
158
|
-
screenId: screenId
|
|
159
|
-
}),
|
|
160
|
-
submitContribution = _useContributionCreat.create;
|
|
161
|
-
var _useContributions = data.useContributions({
|
|
162
|
-
screenId: screenId,
|
|
163
|
-
opts: {
|
|
164
|
-
autoload: !isPlaceholder
|
|
165
|
-
}
|
|
166
|
-
}),
|
|
167
|
-
contributions = _useContributions.contributions;
|
|
168
|
-
var onNameChange = React.useCallback(function (e) {
|
|
169
|
-
setUserName(e.currentTarget.value);
|
|
170
|
-
}, [setUserName]);
|
|
171
|
-
var onMessageChange = React.useCallback(function (e) {
|
|
172
|
-
setUserMessage(e.currentTarget.value);
|
|
173
|
-
}, [setUserMessage]);
|
|
174
|
-
var nameFilled = React.useRef(false);
|
|
175
|
-
var onNameBlur = React.useCallback(function (e) {
|
|
176
|
-
if (!nameFilled.current && e.currentTarget.value.length > 0) {
|
|
177
|
-
nameFilled.current = true;
|
|
178
|
-
trackScreenEvent('input_filled', 'Name', {
|
|
179
|
-
userName: e.currentTarget.value,
|
|
180
|
-
userMessage: userMessage
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
}, [trackScreenEvent, userMessage]);
|
|
184
|
-
var messageFilled = React.useRef(false);
|
|
185
|
-
var onMessageBlur = React.useCallback(function (e) {
|
|
186
|
-
if (!messageFilled.current && e.currentTarget.value.length > 0) {
|
|
187
|
-
messageFilled.current = true;
|
|
188
|
-
trackScreenEvent('input_filled', 'Message', {
|
|
189
|
-
userName: userName,
|
|
190
|
-
userMessage: e.currentTarget.value
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
}, [trackScreenEvent, userName]);
|
|
194
|
-
|
|
195
|
-
// Call to Action
|
|
196
|
-
var _useState9 = React.useState(false),
|
|
197
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
198
|
-
scrolledBottom = _useState10[0],
|
|
199
|
-
setScrolledBottom = _useState10[1];
|
|
200
|
-
var swipeUpLinkActive = scrolledBottom && submitState === 4;
|
|
201
|
-
var _useDimensionObserver = hooks.useDimensionObserver(),
|
|
202
|
-
footerRef = _useDimensionObserver.ref,
|
|
203
|
-
_useDimensionObserver2 = _useDimensionObserver.height,
|
|
204
|
-
callToActionHeight = _useDimensionObserver2 === void 0 ? 0 : _useDimensionObserver2;
|
|
205
|
-
var onScrolledBottom = React.useCallback(function (_ref2) {
|
|
206
|
-
var initial = _ref2.initial;
|
|
207
|
-
if (initial) {
|
|
208
|
-
trackScreenEvent('scroll', 'Contributions list');
|
|
209
|
-
}
|
|
210
|
-
setScrolledBottom(true);
|
|
211
|
-
}, [trackScreenEvent, setScrolledBottom]);
|
|
212
|
-
var onScrolledNotBottom = React.useCallback(function () {
|
|
213
|
-
setScrolledBottom(false);
|
|
214
|
-
}, [setScrolledBottom]);
|
|
215
|
-
var onSubmit = React.useCallback(function (e) {
|
|
216
|
-
e.preventDefault();
|
|
217
|
-
if (submitState === 0) {
|
|
218
|
-
setInteractiveContainerHeight(formRef.current.offsetHeight);
|
|
219
|
-
setSubmitState(1);
|
|
220
|
-
submitContribution({
|
|
221
|
-
name: userName,
|
|
222
|
-
message: userMessage
|
|
223
|
-
});
|
|
224
|
-
onContributionSubmitted();
|
|
225
|
-
trackScreenEvent('click_submit', "".concat(userName, ": ").concat(userMessage), {
|
|
226
|
-
userName: userName,
|
|
227
|
-
userMessage: userMessage
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
}, [submitState, setSubmitState, userName, userMessage, trackScreenEvent, onContributionSubmitted]);
|
|
231
|
-
React.useEffect(function () {
|
|
232
|
-
var timeout = null;
|
|
233
|
-
if (submitState === 2) {
|
|
234
|
-
timeout = setTimeout(setSubmitState, resizeTransitionDuration, 4);
|
|
235
|
-
setInteractiveContainerHeight(contributionsRef.current.offsetHeight);
|
|
236
|
-
setSubmitState(3);
|
|
237
|
-
}
|
|
238
|
-
return function () {
|
|
239
|
-
if (submitState === 3 && timeout !== null) {
|
|
240
|
-
clearTimeout(timeout);
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
}, [submitState, setInteractiveContainerHeight, setSubmitState, resizeTransitionDuration]);
|
|
244
|
-
|
|
245
|
-
// Title
|
|
246
|
-
|
|
247
|
-
var items = [/*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
248
|
-
key: "title",
|
|
249
|
-
placeholder: "title",
|
|
250
|
-
placeholderProps: {
|
|
251
|
-
height: '0.75em'
|
|
252
|
-
},
|
|
253
|
-
emptyLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
254
|
-
id: "2ZOPe+",
|
|
255
|
-
defaultMessage: [{
|
|
256
|
-
"type": 0,
|
|
257
|
-
"value": "Title"
|
|
258
|
-
}]
|
|
259
|
-
}),
|
|
260
|
-
emptyClassName: styles.emptyTitle,
|
|
261
|
-
isEmpty: !hasTitle
|
|
262
|
-
}, hasTitle ? /*#__PURE__*/React.createElement(Heading, Object.assign({}, title, {
|
|
263
|
-
className: styles.title
|
|
264
|
-
})) : null)];
|
|
265
|
-
var allContributions = [].concat(_toConsumableArray(userName !== null && userMessage !== null ? [{
|
|
266
|
-
name: userName,
|
|
267
|
-
message: userMessage
|
|
268
|
-
}] : []), _toConsumableArray(contributions || []));
|
|
269
|
-
|
|
270
|
-
// Form
|
|
271
|
-
|
|
272
|
-
items.push( /*#__PURE__*/React.createElement("div", {
|
|
273
|
-
key: "form",
|
|
274
|
-
className: styles.interactiveContainer,
|
|
275
|
-
style: {
|
|
276
|
-
height: submitState < 4 ? interactiveContainerHeight : null,
|
|
277
|
-
transitionDuration: "".concat(resizeTransitionDuration, "ms")
|
|
278
|
-
}
|
|
279
|
-
}, /*#__PURE__*/React.createElement("form", {
|
|
280
|
-
className: styles.form,
|
|
281
|
-
onSubmit: onSubmit,
|
|
282
|
-
ref: formRef
|
|
283
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
284
|
-
className: styles.formContent
|
|
285
|
-
}, /*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
286
|
-
placeholder: "inputText",
|
|
287
|
-
placeholderProps: {
|
|
288
|
-
height: '0.25em'
|
|
289
|
-
},
|
|
290
|
-
emptyLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
291
|
-
id: "G/ITGY",
|
|
292
|
-
defaultMessage: [{
|
|
293
|
-
"type": 0,
|
|
294
|
-
"value": "Your name"
|
|
295
|
-
}]
|
|
296
|
-
}),
|
|
297
|
-
emptyClassName: styles.emptyInputName,
|
|
298
|
-
isEmpty: !hasNameLabel
|
|
299
|
-
}, /*#__PURE__*/React.createElement(components.Transitions, {
|
|
300
|
-
transitions: transitions,
|
|
301
|
-
playing: transitionPlaying,
|
|
302
|
-
delay: transitionStagger,
|
|
303
|
-
disabled: transitionDisabled
|
|
304
|
-
}, /*#__PURE__*/React.createElement(TextInput, Object.assign({
|
|
305
|
-
className: styles.inputName
|
|
306
|
-
}, name, {
|
|
307
|
-
value: userName,
|
|
308
|
-
onChange: function onChange(e) {
|
|
309
|
-
return onNameChange(e);
|
|
310
|
-
},
|
|
311
|
-
onBlur: function onBlur(e) {
|
|
312
|
-
return onNameBlur(e);
|
|
313
|
-
},
|
|
314
|
-
focusable: current && isView,
|
|
315
|
-
disabled: isPreview,
|
|
316
|
-
required: true
|
|
317
|
-
})))), /*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
318
|
-
placeholder: "inputText",
|
|
319
|
-
placeholderProps: {
|
|
320
|
-
height: '0.75em'
|
|
321
|
-
},
|
|
322
|
-
emptyLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
323
|
-
id: "JAguka",
|
|
324
|
-
defaultMessage: [{
|
|
325
|
-
"type": 0,
|
|
326
|
-
"value": "Your message"
|
|
327
|
-
}]
|
|
328
|
-
}),
|
|
329
|
-
emptyClassName: styles.emptyInputMessage,
|
|
330
|
-
isEmpty: !hasMessageLabel
|
|
331
|
-
}, /*#__PURE__*/React.createElement(components.Transitions, {
|
|
332
|
-
transitions: transitions,
|
|
333
|
-
playing: transitionPlaying,
|
|
334
|
-
delay: transitionStagger * 2,
|
|
335
|
-
disabled: transitionDisabled
|
|
336
|
-
}, /*#__PURE__*/React.createElement(TextInput, Object.assign({
|
|
337
|
-
className: styles.inputMessage
|
|
338
|
-
}, message, {
|
|
339
|
-
value: userMessage,
|
|
340
|
-
onChange: function onChange(e) {
|
|
341
|
-
return onMessageChange(e);
|
|
342
|
-
},
|
|
343
|
-
onBlur: function onBlur(e) {
|
|
344
|
-
return onMessageBlur(e);
|
|
345
|
-
},
|
|
346
|
-
disabled: isPreview,
|
|
347
|
-
focusable: current && isView,
|
|
348
|
-
multiline: true,
|
|
349
|
-
required: true
|
|
350
|
-
})))), /*#__PURE__*/React.createElement(components.ScreenElement, {
|
|
351
|
-
placeholder: "button",
|
|
352
|
-
emptyLabel: /*#__PURE__*/React.createElement(reactIntl.FormattedMessage, {
|
|
353
|
-
id: "5uH4x7",
|
|
354
|
-
defaultMessage: [{
|
|
355
|
-
"type": 0,
|
|
356
|
-
"value": "Submit"
|
|
357
|
-
}]
|
|
358
|
-
}),
|
|
359
|
-
emptyClassName: styles.emptySubmit,
|
|
360
|
-
isEmpty: !hasSubmit
|
|
361
|
-
}, /*#__PURE__*/React.createElement(components.Transitions, {
|
|
362
|
-
transitions: transitions,
|
|
363
|
-
playing: transitionPlaying,
|
|
364
|
-
delay: transitionStagger * 3,
|
|
365
|
-
disabled: transitionDisabled
|
|
366
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
367
|
-
type: "submit",
|
|
368
|
-
className: styles.buttonSubmit,
|
|
369
|
-
disabled: isPreview,
|
|
370
|
-
buttonStyle: submit !== null ? submit.buttonStyle : null,
|
|
371
|
-
focusable: current && isView
|
|
372
|
-
}, /*#__PURE__*/React.createElement(Text, Object.assign({}, submit, {
|
|
373
|
-
inline: true
|
|
374
|
-
})))))), /*#__PURE__*/React.createElement("div", {
|
|
375
|
-
className: styles.formLoading
|
|
376
|
-
}, /*#__PURE__*/React.createElement(reactFontawesome.FontAwesomeIcon, {
|
|
377
|
-
className: styles.loadingIcon,
|
|
378
|
-
icon: faSpinner.faSpinner
|
|
379
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
380
|
-
className: styles.contributionsContainer,
|
|
381
|
-
"aria-hidden": submitState === 4 ? null : 'true'
|
|
382
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
383
|
-
className: styles.contributionsContent
|
|
384
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
385
|
-
className: styles.contributions,
|
|
386
|
-
ref: contributionsRef
|
|
387
|
-
}, allContributions.map(function (contribution, contributionIndex) {
|
|
388
|
-
var nameInnerStyle = nameStyle !== null ? nameStyle.style || null : null;
|
|
389
|
-
var messageInnerStyle = messageStyle !== null ? messageStyle.style || null : null;
|
|
390
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
391
|
-
key: "contribution-".concat(contributionIndex),
|
|
392
|
-
className: styles.contribution,
|
|
393
|
-
style: nameInnerStyle !== null ? utils.getStyleFromColor(nameInnerStyle.color, 'borderColor') : null
|
|
394
|
-
}, /*#__PURE__*/React.createElement(Heading, {
|
|
395
|
-
className: styles.contributionName,
|
|
396
|
-
body: contribution.name,
|
|
397
|
-
size: 2,
|
|
398
|
-
textStyle: nameInnerStyle
|
|
399
|
-
}), /*#__PURE__*/React.createElement(Text, {
|
|
400
|
-
className: styles.contributionMessage,
|
|
401
|
-
body: contribution.message,
|
|
402
|
-
textStyle: messageInnerStyle
|
|
403
|
-
}));
|
|
404
|
-
})))), hasFooter ? /*#__PURE__*/React.createElement("div", {
|
|
405
|
-
style: {
|
|
406
|
-
height: callToActionHeight
|
|
407
|
-
}
|
|
408
|
-
}) : null));
|
|
409
|
-
var headerElement = !isPlaceholder && hasHeader ? /*#__PURE__*/React.createElement("div", {
|
|
410
|
-
className: styles.header,
|
|
411
|
-
style: {
|
|
412
|
-
paddingBottom: spacing
|
|
413
|
-
}
|
|
414
|
-
}, /*#__PURE__*/React.createElement(Header, header)) : null;
|
|
415
|
-
var headerInScroll = submitState >= 4;
|
|
416
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
417
|
-
className: classNames([styles.container, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, className, className !== null), styles.isPlaceholder, isPlaceholder), styles.submitting, submitState === 1), styles.submitted, submitState > 1), styles.showContributions, submitState === 4)]),
|
|
418
|
-
"data-screen-ready": true
|
|
419
|
-
}, /*#__PURE__*/React.createElement(Container, {
|
|
420
|
-
width: width,
|
|
421
|
-
height: height,
|
|
422
|
-
className: styles.content
|
|
423
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
424
|
-
className: styles.inner,
|
|
425
|
-
style: !isPlaceholder ? {
|
|
426
|
-
paddingLeft: spacing,
|
|
427
|
-
paddingRight: spacing,
|
|
428
|
-
paddingTop: (!isPreview ? viewerTopHeight : 0) + (hasHeader ? spacing / 2 : spacing),
|
|
429
|
-
paddingBottom: (current && !isPreview ? viewerBottomHeight : 0) + spacing
|
|
430
|
-
} : null
|
|
431
|
-
}, !headerInScroll ? headerElement : null, /*#__PURE__*/React.createElement(Scroll, {
|
|
432
|
-
verticalAlign: layout,
|
|
433
|
-
disabled: scrollingDisabled,
|
|
434
|
-
onScrolledBottom: onScrolledBottom,
|
|
435
|
-
onScrolledNotBottom: onScrolledNotBottom,
|
|
436
|
-
withShadow: true
|
|
437
|
-
}, headerInScroll ? headerElement : null, items), !isPlaceholder && hasFooter ? /*#__PURE__*/React.createElement("div", {
|
|
438
|
-
ref: footerRef,
|
|
439
|
-
className: classNames([styles.footer, _defineProperty({}, styles.disabled, !swipeUpLinkActive)]),
|
|
440
|
-
style: {
|
|
441
|
-
paddingLeft: Math.max(viewerBottomSidesWidth, spacing / 2),
|
|
442
|
-
paddingRight: Math.max(viewerBottomSidesWidth, spacing / 2),
|
|
443
|
-
paddingTop: 0,
|
|
444
|
-
paddingBottom: (!isPreview ? viewerBottomHeight : 0) + spacing / 2
|
|
445
|
-
}
|
|
446
|
-
}, /*#__PURE__*/React.createElement(Footer, footerProps)) : null)), !isPlaceholder ? /*#__PURE__*/React.createElement(Background, {
|
|
447
|
-
background: background,
|
|
448
|
-
width: width,
|
|
449
|
-
height: height,
|
|
450
|
-
resolution: resolution,
|
|
451
|
-
playing: backgroundPlaying,
|
|
452
|
-
muted: muted,
|
|
453
|
-
shouldLoad: mediaShouldLoad,
|
|
454
|
-
mediaRef: mediaRef,
|
|
455
|
-
withoutVideo: isPreview,
|
|
456
|
-
className: styles.background
|
|
457
|
-
}) : null);
|
|
458
|
-
};
|
|
459
|
-
ContributionScreen.propTypes = propTypes;
|
|
460
|
-
ContributionScreen.defaultProps = defaultProps;
|
|
461
|
-
var ContributionScreen$1 = ContributionScreen;
|
|
462
|
-
|
|
463
|
-
var definition = {
|
|
464
|
-
id: 'contribution',
|
|
465
|
-
type: 'screen',
|
|
466
|
-
group: {
|
|
467
|
-
label: reactIntl.defineMessage({
|
|
468
|
-
id: "ZiWlL6",
|
|
469
|
-
defaultMessage: [{
|
|
470
|
-
"type": 0,
|
|
471
|
-
"value": "Questions"
|
|
472
|
-
}]
|
|
473
|
-
}),
|
|
474
|
-
order: 7
|
|
475
|
-
},
|
|
476
|
-
title: reactIntl.defineMessage({
|
|
477
|
-
id: "g6b9Lg",
|
|
478
|
-
defaultMessage: [{
|
|
479
|
-
"type": 0,
|
|
480
|
-
"value": "Contribution"
|
|
481
|
-
}]
|
|
482
|
-
}),
|
|
483
|
-
component: ContributionScreen$1,
|
|
484
|
-
layouts: ['top', 'middle', 'bottom'],
|
|
485
|
-
fields: [{
|
|
486
|
-
name: 'layout',
|
|
487
|
-
type: 'screen-layout',
|
|
488
|
-
defaultValue: 'top',
|
|
489
|
-
label: reactIntl.defineMessage({
|
|
490
|
-
id: "4iBXj2",
|
|
491
|
-
defaultMessage: [{
|
|
492
|
-
"type": 0,
|
|
493
|
-
"value": "Layout"
|
|
494
|
-
}]
|
|
495
|
-
})
|
|
496
|
-
}, {
|
|
497
|
-
name: 'title',
|
|
498
|
-
type: 'heading-element',
|
|
499
|
-
theme: {
|
|
500
|
-
textStyle: 'heading2'
|
|
501
|
-
},
|
|
502
|
-
label: reactIntl.defineMessage({
|
|
503
|
-
id: "N25iDO",
|
|
504
|
-
defaultMessage: [{
|
|
505
|
-
"type": 0,
|
|
506
|
-
"value": "Title"
|
|
507
|
-
}]
|
|
508
|
-
})
|
|
509
|
-
}, {
|
|
510
|
-
name: 'name',
|
|
511
|
-
type: 'input-element',
|
|
512
|
-
theme: {
|
|
513
|
-
textStyle: 'text'
|
|
514
|
-
},
|
|
515
|
-
label: reactIntl.defineMessage({
|
|
516
|
-
id: "nXVNeg",
|
|
517
|
-
defaultMessage: [{
|
|
518
|
-
"type": 0,
|
|
519
|
-
"value": "Name"
|
|
520
|
-
}]
|
|
521
|
-
})
|
|
522
|
-
}, {
|
|
523
|
-
name: 'message',
|
|
524
|
-
type: 'input-element',
|
|
525
|
-
theme: {
|
|
526
|
-
textStyle: 'text'
|
|
527
|
-
},
|
|
528
|
-
label: reactIntl.defineMessage({
|
|
529
|
-
id: "RcLsua",
|
|
530
|
-
defaultMessage: [{
|
|
531
|
-
"type": 0,
|
|
532
|
-
"value": "Message"
|
|
533
|
-
}]
|
|
534
|
-
})
|
|
535
|
-
}, {
|
|
536
|
-
name: 'submit',
|
|
537
|
-
type: 'button-element',
|
|
538
|
-
theme: {
|
|
539
|
-
textStyle: 'button'
|
|
540
|
-
},
|
|
541
|
-
label: reactIntl.defineMessage({
|
|
542
|
-
id: "uAKPQ9",
|
|
543
|
-
defaultMessage: [{
|
|
544
|
-
"type": 0,
|
|
545
|
-
"value": "Submit"
|
|
546
|
-
}]
|
|
547
|
-
})
|
|
548
|
-
}, {
|
|
549
|
-
name: 'nameStyle',
|
|
550
|
-
type: 'item-text-style',
|
|
551
|
-
theme: {
|
|
552
|
-
style: {
|
|
553
|
-
textStyle: 'heading2'
|
|
554
|
-
}
|
|
555
|
-
},
|
|
556
|
-
label: reactIntl.defineMessage({
|
|
557
|
-
id: "SyMSDa",
|
|
558
|
-
defaultMessage: [{
|
|
559
|
-
"type": 0,
|
|
560
|
-
"value": "Published name style"
|
|
561
|
-
}]
|
|
562
|
-
})
|
|
563
|
-
}, {
|
|
564
|
-
name: 'messageStyle',
|
|
565
|
-
type: 'item-text-style',
|
|
566
|
-
theme: {
|
|
567
|
-
style: {
|
|
568
|
-
textStyle: 'text'
|
|
569
|
-
}
|
|
570
|
-
},
|
|
571
|
-
label: reactIntl.defineMessage({
|
|
572
|
-
id: "+SlKOi",
|
|
573
|
-
defaultMessage: [{
|
|
574
|
-
"type": 0,
|
|
575
|
-
"value": "Published message style"
|
|
576
|
-
}]
|
|
577
|
-
})
|
|
578
|
-
}, {
|
|
579
|
-
name: 'background',
|
|
580
|
-
type: 'background',
|
|
581
|
-
label: reactIntl.defineMessage({
|
|
582
|
-
id: "+MPZRu",
|
|
583
|
-
defaultMessage: [{
|
|
584
|
-
"type": 0,
|
|
585
|
-
"value": "Background"
|
|
586
|
-
}]
|
|
587
|
-
})
|
|
588
|
-
}, {
|
|
589
|
-
name: 'header',
|
|
590
|
-
type: 'header',
|
|
591
|
-
label: reactIntl.defineMessage({
|
|
592
|
-
id: "rhuDxI",
|
|
593
|
-
defaultMessage: [{
|
|
594
|
-
"type": 0,
|
|
595
|
-
"value": "Header"
|
|
596
|
-
}]
|
|
597
|
-
}),
|
|
598
|
-
theme: {
|
|
599
|
-
badge: {
|
|
600
|
-
label: {
|
|
601
|
-
textStyle: 'badge'
|
|
602
|
-
},
|
|
603
|
-
boxStyle: 'badge'
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
}, {
|
|
607
|
-
name: 'footer',
|
|
608
|
-
type: 'footer',
|
|
609
|
-
label: reactIntl.defineMessage({
|
|
610
|
-
id: "g4nybp",
|
|
611
|
-
defaultMessage: [{
|
|
612
|
-
"type": 0,
|
|
613
|
-
"value": "Footer"
|
|
614
|
-
}]
|
|
615
|
-
}),
|
|
616
|
-
theme: {
|
|
617
|
-
callToAction: {
|
|
618
|
-
label: {
|
|
619
|
-
textStyle: 'cta'
|
|
620
|
-
},
|
|
621
|
-
boxStyle: 'cta'
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
}]
|
|
625
|
-
};
|
|
626
|
-
|
|
627
|
-
exports.ContributionScreen = ContributionScreen$1;
|
|
628
|
-
exports.default = definition;
|