@micromag/core 0.3.605 → 0.3.607
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 +2 -1
- package/es/components.js +62 -34
- package/es/index.js +77 -39
- package/package.json +2 -2
package/assets/css/styles.css
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.micromag-core-buttons-button-container.micromag-core-buttons-button-asLink,.micromag-core-buttons-button-container.micromag-core-buttons-button-withoutStyle{-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-core-buttons-button-container .micromag-core-buttons-button-icon{display:block;position:relative}.micromag-core-buttons-button-container .micromag-core-buttons-button-icon,.micromag-core-buttons-button-container .micromag-core-buttons-button-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-core-buttons-button-container.micromag-core-buttons-button-asLink{color:#a13dff;font-weight:700}.micromag-core-buttons-button-container.micromag-core-buttons-button-withIcon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}.micromag-core-buttons-button-container.micromag-core-buttons-button-withIcon .micromag-core-buttons-button-label{margin-left:.5em;-webkit-transform-origin:0 50%;-ms-transform-origin:0 50%;transform-origin:0 50%}.micromag-core-buttons-button-container.micromag-core-buttons-button-withIcon .micromag-core-buttons-button-right{margin-left:.5em}.micromag-core-buttons-button-container.micromag-core-buttons-button-withIcon.micromag-core-buttons-button-withAnimations.micromag-core-buttons-button-icon-right .micromag-core-buttons-button-label{-webkit-transform-origin:100% 50%;-ms-transform-origin:100% 50%;transform-origin:100% 50%}.micromag-core-buttons-button-container.micromag-core-buttons-button-withIconColumns{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}.micromag-core-buttons-button-container.micromag-core-buttons-button-linkDisabled{opacity:.4;pointer-events:none;-webkit-text-decoration:none;text-decoration:none}.micromag-core-buttons-button-container:focus-visible{-webkit-box-shadow:0 0 2px 0 #fff;box-shadow:0 0 2px 0 #fff;-webkit-box-shadow:0 0 2px 0 var(--micromag-focus-color,#fff);box-shadow:0 0 2px 0 var(--micromag-focus-color,#fff);outline:2px solid #000}
|
|
2
2
|
|
|
3
|
+
.micromag-core-buttons-clear-container{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:inherit;cursor:pointer;display:inline-block;display:-ms-flexbox!important;display:flex!important;font-family:inherit;padding:0;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;background-color:#494949!important;border-radius:4px;height:18px;justify-content:center;margin:0 8px 0 10px;padding:0 10px;width:18px}.micromag-core-buttons-clear-container .micromag-core-buttons-clear-icon{display:block}
|
|
3
4
|
.micromag-core-forms-form-actions{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;margin-top:2rem}.micromag-core-forms-form-actions.micromag-core-forms-form-left{-ms-flex-pack:start;justify-content:flex-start}.micromag-core-forms-form-actions.micromag-core-forms-form-right{-ms-flex-pack:end;justify-content:flex-end}
|
|
4
5
|
.micromag-core-partials-link-withoutStyle{color:inherit;-webkit-text-decoration:none;text-decoration:none}.micromag-core-partials-link-withoutStyle:hover{color:inherit;-webkit-text-decoration:none;text-decoration:none}
|
|
5
6
|
@-webkit-keyframes micromag-core-partials-spinner-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes micromag-core-partials-spinner-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes micromag-core-partials-spinner-dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}@keyframes micromag-core-partials-spinner-dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}.micromag-core-partials-spinner-container{display:block;height:40px;width:40px}.micromag-core-partials-spinner-container .micromag-core-partials-spinner-path{stroke-linecap:round;color:currentColor}.micromag-core-partials-spinner-container.micromag-core-partials-spinner-animated{-webkit-animation:micromag-core-partials-spinner-rotate 2s linear infinite;animation:micromag-core-partials-spinner-rotate 2s linear infinite}.micromag-core-partials-spinner-container.micromag-core-partials-spinner-animated .micromag-core-partials-spinner-path{-webkit-animation:micromag-core-partials-spinner-dash 1.5s ease-in-out infinite;animation:micromag-core-partials-spinner-dash 1.5s ease-in-out infinite}
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
.micromag-core-screens-screen-sizer-container,.micromag-core-screens-screen-sizer-frame{position:relative}.micromag-core-screens-screen-sizer-screen{left:0;position:absolute;top:0;-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}
|
|
26
27
|
.micromag-core-screens-screen-container{font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.1}.micromag-core-screens-screen-container address,.micromag-core-screens-screen-container blockquote,.micromag-core-screens-screen-container caption,.micromag-core-screens-screen-container dl,.micromag-core-screens-screen-container figure,.micromag-core-screens-screen-container h1,.micromag-core-screens-screen-container h2,.micromag-core-screens-screen-container h3,.micromag-core-screens-screen-container h4,.micromag-core-screens-screen-container h5,.micromag-core-screens-screen-container h6,.micromag-core-screens-screen-container label,.micromag-core-screens-screen-container legend,.micromag-core-screens-screen-container li,.micromag-core-screens-screen-container ol,.micromag-core-screens-screen-container p,.micromag-core-screens-screen-container pre,.micromag-core-screens-screen-container ul{margin:0;padding:0}.micromag-core-screens-screen-container *,.micromag-core-screens-screen-container :after,.micromag-core-screens-screen-container :before{-webkit-box-sizing:border-box;box-sizing:border-box}.micromag-core-screens-screen-container h1,.micromag-core-screens-screen-container h2,.micromag-core-screens-screen-container h3,.micromag-core-screens-screen-container h4,.micromag-core-screens-screen-container h5,.micromag-core-screens-screen-container h6,.micromag-core-screens-screen-container li,.micromag-core-screens-screen-container p{font-weight:inherit}.micromag-core-screens-screen-container{background-color:#1c1c1c;color:#fff}
|
|
27
28
|
.micromag-core-screens-screen-placeholder-screen{background-color:transparent;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
|
|
28
|
-
.micromag-core-screens-preview-stack{overflow:hidden;position:relative}.micromag-core-screens-preview-stack .micromag-core-screens-preview-stackScreen{position:relative;z-index:10}.micromag-core-screens-preview-stack .micromag-core-screens-preview-stackItem{background-color:#494949;border:1px solid #adadad;left:0;position:absolute;top:0}.micromag-core-screens-preview-stack .micromag-core-screens-preview-stackItem:first-child{z-index:3}.micromag-core-screens-preview-stack .micromag-core-screens-preview-stackItem:nth-child(2){z-index:2}.micromag-core-screens-preview-stack .micromag-core-screens-preview-stackItem:nth-child(3){z-index:1}.micromag-core-screens-preview-screen{overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
|
|
29
|
+
.micromag-core-screens-preview-stack{overflow:hidden;position:relative}.micromag-core-screens-preview-stack .micromag-core-screens-preview-stackScreen{position:relative;z-index:10}.micromag-core-screens-preview-stack .micromag-core-screens-preview-stackItem{background-color:#494949;border:1px solid #adadad;left:0;position:absolute;top:0}.micromag-core-screens-preview-stack .micromag-core-screens-preview-stackItem:first-child{z-index:3}.micromag-core-screens-preview-stack .micromag-core-screens-preview-stackItem:nth-child(2){z-index:2}.micromag-core-screens-preview-stack .micromag-core-screens-preview-stackItem:nth-child(3){z-index:1}.micromag-core-screens-preview-screen{overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
|
|
29
30
|
.micromag-core-placeholders-conversation-container{mix-blend-mode:difference;padding:10px;text-align:center}.micromag-core-placeholders-conversation-container .micromag-core-placeholders-conversation-icon{color:hsla(0,0%,100%,.6);height:auto;margin:3px auto auto;width:25px}.micromag-core-placeholders-conversation-container .micromag-core-placeholders-conversation-message{background-color:hsla(0,0%,100%,.6);height:23px;margin:3px 1px 0;width:80%}.micromag-core-placeholders-conversation-container .micromag-core-placeholders-conversation-placeholderMessage0{width:65%}.micromag-core-placeholders-conversation-container .micromag-core-placeholders-conversation-placeholderMessage1{margin-left:auto}.micromag-core-placeholders-conversation-container .micromag-core-placeholders-conversation-placeholderMessage2{width:65%}.micromag-core-placeholders-conversation-container .micromag-core-placeholders-conversation-placeholderMessage3{margin-left:auto;width:50%}
|
|
30
31
|
.micromag-core-placeholders-quiz-answer-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;mix-blend-mode:difference}.micromag-core-placeholders-quiz-answer-container .micromag-core-placeholders-quiz-answer-block{-ms-flex-positive:1;flex-grow:1}.micromag-core-placeholders-quiz-answer-container .micromag-core-placeholders-quiz-answer-answer{color:hsla(0,0%,100%,.6);margin-right:6px;padding:0 1px;width:12px}.micromag-core-placeholders-quiz-answer-container .micromag-core-placeholders-quiz-answer-answerIcon{color:hsla(0,0%,100%,.6);display:block;height:100%;width:100%}.micromag-core-placeholders-quiz-answer-container.micromag-core-placeholders-quiz-answer-good .micromag-core-placeholders-quiz-answer-answer{padding:0}
|
|
31
32
|
.micromag-core-placeholders-share-options-container .micromag-core-placeholders-share-options-box{background-color:transparent;display:block}.micromag-core-placeholders-share-options-container .micromag-core-placeholders-share-options-icon{color:#1c1c1c;height:auto;width:10px}.micromag-core-placeholders-share-options-item{background-color:#dedede;display:-ms-flexbox;display:flex;padding:3px;width:100%}.micromag-core-placeholders-share-options-item+.micromag-core-placeholders-share-options-item{margin-top:5px}.micromag-core-placeholders-share-options-button{font-size:1rem}
|
package/es/components.js
CHANGED
|
@@ -9,6 +9,7 @@ import { FormattedMessage, defineMessages, FormattedDate, FormattedTime } from '
|
|
|
9
9
|
import { isMessage, getFieldFromPath, getComponentFromName, setFieldValue, validateFields, getDisplayName, pascalCase, convertStyleToString } from '@micromag/core/utils';
|
|
10
10
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
11
11
|
import { faAngleLeft } from '@fortawesome/free-solid-svg-icons/faAngleLeft';
|
|
12
|
+
import { faClose } from '@fortawesome/free-solid-svg-icons/faClose';
|
|
12
13
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
13
14
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
14
15
|
import { useForm, useDocumentEvent, useIntersectionObserver, useDimensionObserver } from '@micromag/core/hooks';
|
|
@@ -44,12 +45,12 @@ import { useSpring } from '@react-spring/core';
|
|
|
44
45
|
import { config, animated } from '@react-spring/web';
|
|
45
46
|
|
|
46
47
|
/* eslint-disable react/jsx-props-no-spreading */
|
|
47
|
-
var propTypes$
|
|
48
|
+
var propTypes$T = {
|
|
48
49
|
children: PropTypes.label.isRequired,
|
|
49
50
|
isHtml: PropTypes$1.bool,
|
|
50
51
|
values: PropTypes$1.object // eslint-disable-line react/forbid-prop-types
|
|
51
52
|
};
|
|
52
|
-
var defaultProps$
|
|
53
|
+
var defaultProps$T = {
|
|
53
54
|
isHtml: false,
|
|
54
55
|
values: {}
|
|
55
56
|
};
|
|
@@ -62,13 +63,13 @@ var Label = function Label(_ref) {
|
|
|
62
63
|
values: values
|
|
63
64
|
}, children)) : children;
|
|
64
65
|
};
|
|
65
|
-
Label.propTypes = propTypes$
|
|
66
|
-
Label.defaultProps = defaultProps$
|
|
66
|
+
Label.propTypes = propTypes$T;
|
|
67
|
+
Label.defaultProps = defaultProps$T;
|
|
67
68
|
|
|
68
|
-
var styles$
|
|
69
|
+
var styles$y = {"container":"micromag-core-buttons-button-container","asLink":"micromag-core-buttons-button-asLink","withoutStyle":"micromag-core-buttons-button-withoutStyle","icon":"micromag-core-buttons-button-icon","label":"micromag-core-buttons-button-label","withIcon":"micromag-core-buttons-button-withIcon","right":"micromag-core-buttons-button-right","withAnimations":"micromag-core-buttons-button-withAnimations","icon-right":"micromag-core-buttons-button-icon-right","withIconColumns":"micromag-core-buttons-button-withIconColumns","linkDisabled":"micromag-core-buttons-button-linkDisabled"};
|
|
69
70
|
|
|
70
|
-
var _excluded$
|
|
71
|
-
var propTypes$
|
|
71
|
+
var _excluded$c = ["type", "theme", "size", "href", "external", "direct", "target", "label", "children", "focusable", "active", "icon", "iconPosition", "disabled", "loading", "disableOnLoading", "small", "big", "withShadow", "withoutStyle", "withoutBootstrapStyles", "withoutTheme", "asLink", "outline", "onClick", "className", "iconClassName", "labelClassName", "refButton"];
|
|
72
|
+
var propTypes$S = {
|
|
72
73
|
type: PropTypes$1.string,
|
|
73
74
|
theme: PropTypes.buttonTheme,
|
|
74
75
|
size: PropTypes.buttonSize,
|
|
@@ -101,7 +102,7 @@ var propTypes$R = {
|
|
|
101
102
|
current: PropTypes$1.any // eslint-disable-line
|
|
102
103
|
})])
|
|
103
104
|
};
|
|
104
|
-
var defaultProps$
|
|
105
|
+
var defaultProps$S = {
|
|
105
106
|
type: 'button',
|
|
106
107
|
theme: null,
|
|
107
108
|
size: null,
|
|
@@ -163,7 +164,7 @@ var Button$1 = function Button(_ref) {
|
|
|
163
164
|
iconClassName = _ref.iconClassName,
|
|
164
165
|
labelClassName = _ref.labelClassName,
|
|
165
166
|
refButton = _ref.refButton,
|
|
166
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
167
|
+
props = _objectWithoutProperties(_ref, _excluded$c);
|
|
167
168
|
var finalLabel = label || children;
|
|
168
169
|
var text = finalLabel !== null ? /*#__PURE__*/React.createElement(Label, null, finalLabel) : null;
|
|
169
170
|
var hasChildren = label !== null && children !== null;
|
|
@@ -171,24 +172,24 @@ var Button$1 = function Button(_ref) {
|
|
|
171
172
|
var hasInlineIcon = hasIcon && (iconPosition === 'inline' || text === null);
|
|
172
173
|
var hasIconColumns = hasIcon && !hasInlineIcon;
|
|
173
174
|
var content = /*#__PURE__*/React.createElement(React.Fragment, null, hasInlineIcon ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
174
|
-
className: classNames([styles$
|
|
175
|
+
className: classNames([styles$y.icon, _defineProperty({}, iconClassName, iconClassName !== null)])
|
|
175
176
|
}, icon), text !== null ? /*#__PURE__*/React.createElement("span", {
|
|
176
|
-
className: classNames([styles$
|
|
177
|
+
className: classNames([styles$y.label, _defineProperty({}, labelClassName, labelClassName !== null)])
|
|
177
178
|
}, text) : null) : null, hasIconColumns ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
178
|
-
className: classNames([styles$
|
|
179
|
+
className: classNames([styles$y.left, _defineProperty({}, iconClassName, iconClassName !== null && iconPosition === 'left')])
|
|
179
180
|
}, iconPosition === 'left' ? icon : null), /*#__PURE__*/React.createElement("span", {
|
|
180
|
-
className: classNames([styles$
|
|
181
|
+
className: classNames([styles$y.center, _defineProperty({}, labelClassName, labelClassName !== null)])
|
|
181
182
|
}, text), /*#__PURE__*/React.createElement("span", {
|
|
182
|
-
className: classNames([styles$
|
|
183
|
+
className: classNames([styles$y.right, _defineProperty({}, iconClassName, iconClassName !== null && iconPosition === 'right')])
|
|
183
184
|
}, iconPosition === 'right' ? icon : null), hasChildren ? children : null) : null, !hasIcon ? text : null, hasChildren ? children : null);
|
|
184
185
|
var withStyle = !withoutTheme && !withoutStyle && !asLink;
|
|
185
186
|
var buttonClassNames = classNames([!withoutBootstrapStyles ? _defineProperty(_defineProperty(_defineProperty({
|
|
186
187
|
btn: withStyle
|
|
187
|
-
}, "btn-".concat(outline ? 'outline-' : '').concat(theme), withStyle && theme !== null), "btn-".concat(size), withStyle && size !== null), "active", !withoutStyle && active) : null, styles$
|
|
188
|
+
}, "btn-".concat(outline ? 'outline-' : '').concat(theme), withStyle && theme !== null), "btn-".concat(size), withStyle && size !== null), "active", !withoutStyle && active) : null, styles$y.container, (_ref8 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref8, styles$y.withoutStyle, withoutStyle), styles$y.withIcon, hasIcon), styles$y.withIconColumns, hasIconColumns), styles$y.withText, text !== null), styles$y.withShadow, withShadow), styles$y.isSmall, small), styles$y.isBig, big), styles$y.isLink, href !== null), styles$y.asLink, asLink), styles$y.isDisabled, disabled), _defineProperty(_defineProperty(_ref8, styles$y.isLoading, loading), className, className !== null))]);
|
|
188
189
|
if (href !== null) {
|
|
189
190
|
var linkClassNames = classNames([buttonClassNames, _defineProperty({
|
|
190
191
|
disabled: disabled
|
|
191
|
-
}, styles$
|
|
192
|
+
}, styles$y.linkDisabled, disabled)]);
|
|
192
193
|
return external || direct ? /*#__PURE__*/React.createElement("a", Object.assign({}, props, {
|
|
193
194
|
href: disabled ? null : href,
|
|
194
195
|
className: linkClassNames,
|
|
@@ -213,13 +214,13 @@ var Button$1 = function Button(_ref) {
|
|
|
213
214
|
tabIndex: focusable ? '0' : '-1'
|
|
214
215
|
}), content);
|
|
215
216
|
};
|
|
216
|
-
Button$1.propTypes = propTypes$
|
|
217
|
-
Button$1.defaultProps = defaultProps$
|
|
217
|
+
Button$1.propTypes = propTypes$S;
|
|
218
|
+
Button$1.defaultProps = defaultProps$S;
|
|
218
219
|
|
|
219
|
-
var styles$
|
|
220
|
+
var styles$x = {};
|
|
220
221
|
|
|
221
|
-
var _excluded$
|
|
222
|
-
var propTypes$
|
|
222
|
+
var _excluded$b = ["className", "onClick", "theme"];
|
|
223
|
+
var propTypes$R = {
|
|
223
224
|
buttons: PropTypes.buttons,
|
|
224
225
|
size: PropTypes.buttonSize,
|
|
225
226
|
theme: PropTypes.buttonTheme,
|
|
@@ -228,7 +229,7 @@ var propTypes$Q = {
|
|
|
228
229
|
className: PropTypes$1.string,
|
|
229
230
|
buttonClassName: PropTypes$1.string
|
|
230
231
|
};
|
|
231
|
-
var defaultProps$
|
|
232
|
+
var defaultProps$R = {
|
|
232
233
|
buttons: [],
|
|
233
234
|
size: null,
|
|
234
235
|
theme: undefined,
|
|
@@ -246,7 +247,7 @@ var Buttons = function Buttons(_ref) {
|
|
|
246
247
|
buttonClassName = _ref.buttonClassName,
|
|
247
248
|
className = _ref.className;
|
|
248
249
|
return /*#__PURE__*/React.createElement("div", {
|
|
249
|
-
className: classNames(['btn-group', _defineProperty({}, "btn-group-".concat(size), size !== null), styles$
|
|
250
|
+
className: classNames(['btn-group', _defineProperty({}, "btn-group-".concat(size), size !== null), styles$x.container, _defineProperty({}, className, className !== null)]),
|
|
250
251
|
role: "group"
|
|
251
252
|
}, buttons.map(function (button, index) {
|
|
252
253
|
var _button$className = button.className,
|
|
@@ -255,10 +256,10 @@ var Buttons = function Buttons(_ref) {
|
|
|
255
256
|
_onClick = _button$onClick === void 0 ? null : _button$onClick,
|
|
256
257
|
_button$theme = button.theme,
|
|
257
258
|
buttonTheme = _button$theme === void 0 ? null : _button$theme,
|
|
258
|
-
buttonProps = _objectWithoutProperties(button, _excluded$
|
|
259
|
+
buttonProps = _objectWithoutProperties(button, _excluded$b);
|
|
259
260
|
var fixedProps = {
|
|
260
261
|
key: "button-".concat(index),
|
|
261
|
-
className: classNames([styles$
|
|
262
|
+
className: classNames([styles$x.button, _defineProperty(_defineProperty({}, buttonClassName, buttonClassName !== null), customClassName, customClassName !== null)]),
|
|
262
263
|
onClick: function onClick(e) {
|
|
263
264
|
if (_onClick !== null) {
|
|
264
265
|
_onClick(e, button, index);
|
|
@@ -272,19 +273,19 @@ var Buttons = function Buttons(_ref) {
|
|
|
272
273
|
return renderButton !== null ? renderButton(button, index, fixedProps) : /*#__PURE__*/React.createElement(Button$1, Object.assign({}, fixedProps, buttonProps));
|
|
273
274
|
}));
|
|
274
275
|
};
|
|
275
|
-
Buttons.propTypes = propTypes$
|
|
276
|
-
Buttons.defaultProps = defaultProps$
|
|
276
|
+
Buttons.propTypes = propTypes$R;
|
|
277
|
+
Buttons.defaultProps = defaultProps$R;
|
|
277
278
|
|
|
278
|
-
var _excluded$
|
|
279
|
-
var propTypes$
|
|
279
|
+
var _excluded$a = ["className"];
|
|
280
|
+
var propTypes$Q = {
|
|
280
281
|
className: PropTypes$1.string
|
|
281
282
|
};
|
|
282
|
-
var defaultProps$
|
|
283
|
+
var defaultProps$Q = {
|
|
283
284
|
className: null
|
|
284
285
|
};
|
|
285
286
|
var BackButton = function BackButton(_ref) {
|
|
286
287
|
var className = _ref.className,
|
|
287
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
288
|
+
props = _objectWithoutProperties(_ref, _excluded$a);
|
|
288
289
|
return /*#__PURE__*/React.createElement(Button$1, Object.assign({
|
|
289
290
|
className: classNames(['px-2', _defineProperty({}, className, className)]),
|
|
290
291
|
size: "sm",
|
|
@@ -294,8 +295,35 @@ var BackButton = function BackButton(_ref) {
|
|
|
294
295
|
})
|
|
295
296
|
}, props));
|
|
296
297
|
};
|
|
297
|
-
BackButton.propTypes = propTypes$
|
|
298
|
-
BackButton.defaultProps = defaultProps$
|
|
298
|
+
BackButton.propTypes = propTypes$Q;
|
|
299
|
+
BackButton.defaultProps = defaultProps$Q;
|
|
300
|
+
|
|
301
|
+
var styles$w = {"container":"micromag-core-buttons-clear-container","icon":"micromag-core-buttons-clear-icon"};
|
|
302
|
+
|
|
303
|
+
var _excluded$9 = ["onClick", "className"];
|
|
304
|
+
var propTypes$P = {
|
|
305
|
+
onClick: PropTypes$1.func,
|
|
306
|
+
className: PropTypes$1.string
|
|
307
|
+
};
|
|
308
|
+
var defaultProps$P = {
|
|
309
|
+
onClick: null,
|
|
310
|
+
className: null
|
|
311
|
+
};
|
|
312
|
+
var ClearButton = function ClearButton(_ref) {
|
|
313
|
+
var onClick = _ref.onClick,
|
|
314
|
+
className = _ref.className,
|
|
315
|
+
props = _objectWithoutProperties(_ref, _excluded$9);
|
|
316
|
+
return /*#__PURE__*/React.createElement("button", Object.assign({
|
|
317
|
+
className: classNames([styles$w.container, _defineProperty({}, className, className)]),
|
|
318
|
+
onClick: onClick
|
|
319
|
+
}, props), /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
320
|
+
className: styles$w.icon,
|
|
321
|
+
icon: faClose,
|
|
322
|
+
size: "md"
|
|
323
|
+
}));
|
|
324
|
+
};
|
|
325
|
+
ClearButton.propTypes = propTypes$P;
|
|
326
|
+
ClearButton.defaultProps = defaultProps$P;
|
|
299
327
|
|
|
300
328
|
var _excluded$8 = ["type"],
|
|
301
329
|
_excluded2 = ["component", "id", "settings"];
|
|
@@ -4381,4 +4409,4 @@ var LinkStyle = function LinkStyle(_ref) {
|
|
|
4381
4409
|
LinkStyle.propTypes = propTypes;
|
|
4382
4410
|
LinkStyle.defaultProps = defaultProps;
|
|
4383
4411
|
|
|
4384
|
-
export { ArrowIcon, BackButton, Breadcrumb, Button$1 as Button, Buttons, Card, Close, CloseIcon, CollapsablePanel, Date$1 as Date, Detector, Dropdown as DropdownMenu, ElementComponent as Element, Empty, FieldForm, FontFaces, Form, FormPanel, FullscreenIcon, HighlightStyle, Label, Link, LinkIcon, LinkStyle, Media, _Menu as Menu, Meta, Modal, ModalDialog, ModalPortal, Modals, MuteIcon, Navbar, PaginationMenu as Pagination, Panel, PanelPortal, Panels, PauseIcon, AdFrame as PlaceholderAdFrame, AdImage as PlaceholderAdImage, Audio as PlaceholderAudio, Button as PlaceholderButton, Image as PlaceholderImage, Line as PlaceholderLine, Map as PlaceholderMap, MapPath as PlaceholderMapPath, Quote as PlaceholderQuote, ShortText as PlaceholderShortText, Subtitle as PlaceholderSubtitle, TextPlaceholder as PlaceholderText, Timeline as PlaceholderTimeline, Title$1 as PlaceholderTitle, Video as PlaceholderVideo, Video360 as PlaceholderVideo360, VideoLoop as PlaceholderVideoLoop, PlayIcon, Screen$1 as Screen, ScreenElement, Placeholder as ScreenPlaceholder, Preview as ScreenPreview, ScreenSizer, Screens, Slideshow, Spinner, TabsMenu as Tabs, Transitions, TransitionsStagger, UnmuteIcon };
|
|
4412
|
+
export { ArrowIcon, BackButton, Breadcrumb, Button$1 as Button, Buttons, Card, ClearButton, Close, CloseIcon, CollapsablePanel, Date$1 as Date, Detector, Dropdown as DropdownMenu, ElementComponent as Element, Empty, FieldForm, FontFaces, Form, FormPanel, FullscreenIcon, HighlightStyle, Label, Link, LinkIcon, LinkStyle, Media, _Menu as Menu, Meta, Modal, ModalDialog, ModalPortal, Modals, MuteIcon, Navbar, PaginationMenu as Pagination, Panel, PanelPortal, Panels, PauseIcon, AdFrame as PlaceholderAdFrame, AdImage as PlaceholderAdImage, Audio as PlaceholderAudio, Button as PlaceholderButton, Image as PlaceholderImage, Line as PlaceholderLine, Map as PlaceholderMap, MapPath as PlaceholderMapPath, Quote as PlaceholderQuote, ShortText as PlaceholderShortText, Subtitle as PlaceholderSubtitle, TextPlaceholder as PlaceholderText, Timeline as PlaceholderTimeline, Title$1 as PlaceholderTitle, Video as PlaceholderVideo, Video360 as PlaceholderVideo360, VideoLoop as PlaceholderVideoLoop, PlayIcon, Screen$1 as Screen, ScreenElement, Placeholder as ScreenPlaceholder, Preview as ScreenPreview, ScreenSizer, Screens, Slideshow, Spinner, TabsMenu as Tabs, Transitions, TransitionsStagger, UnmuteIcon };
|
package/es/index.js
CHANGED
|
@@ -1198,8 +1198,8 @@ var FieldsManager = /*#__PURE__*/function (_DefinitionsManager) {
|
|
|
1198
1198
|
}]);
|
|
1199
1199
|
}(DefinitionsManager);
|
|
1200
1200
|
|
|
1201
|
-
var _excluded$
|
|
1202
|
-
_excluded2$
|
|
1201
|
+
var _excluded$5 = ["medias"],
|
|
1202
|
+
_excluded2$1 = ["medias"];
|
|
1203
1203
|
var MediasParser = /*#__PURE__*/function () {
|
|
1204
1204
|
function MediasParser(_ref) {
|
|
1205
1205
|
var fieldsManager = _ref.fieldsManager,
|
|
@@ -1218,7 +1218,7 @@ var MediasParser = /*#__PURE__*/function () {
|
|
|
1218
1218
|
if (typeof this.parsedThemesCache[storyId] === 'undefined') {
|
|
1219
1219
|
var _this$toPath = this.toPath(theme),
|
|
1220
1220
|
themeMedias = _this$toPath.medias,
|
|
1221
|
-
newTheme = _objectWithoutProperties(_this$toPath, _excluded$
|
|
1221
|
+
newTheme = _objectWithoutProperties(_this$toPath, _excluded$5);
|
|
1222
1222
|
this.parsedThemesCache[storyId] = {
|
|
1223
1223
|
themeMedias: themeMedias,
|
|
1224
1224
|
newTheme: newTheme
|
|
@@ -1272,7 +1272,7 @@ var MediasParser = /*#__PURE__*/function () {
|
|
|
1272
1272
|
if (theme !== null) {
|
|
1273
1273
|
var _this$getParsedStoryT = this.getParsedStoryTheme(storyId, theme),
|
|
1274
1274
|
themeMedias = _this$getParsedStoryT.medias,
|
|
1275
|
-
newTheme = _objectWithoutProperties(_this$getParsedStoryT, _excluded2$
|
|
1275
|
+
newTheme = _objectWithoutProperties(_this$getParsedStoryT, _excluded2$1);
|
|
1276
1276
|
return medias !== null || themeMedias !== null ? _objectSpread(_objectSpread({}, story), {}, {
|
|
1277
1277
|
theme: newTheme,
|
|
1278
1278
|
components: newComponents,
|
|
@@ -1524,7 +1524,7 @@ var ScreensManager = /*#__PURE__*/function (_DefinitionsManager) {
|
|
|
1524
1524
|
}]);
|
|
1525
1525
|
}(DefinitionsManager);
|
|
1526
1526
|
|
|
1527
|
-
var _excluded$
|
|
1527
|
+
var _excluded$4 = ["fonts"];
|
|
1528
1528
|
var FontsParser = /*#__PURE__*/function () {
|
|
1529
1529
|
function FontsParser(_ref) {
|
|
1530
1530
|
var fieldsManager = _ref.fieldsManager,
|
|
@@ -1573,7 +1573,7 @@ var FontsParser = /*#__PURE__*/function () {
|
|
|
1573
1573
|
var _this$parse = this.parse(theme),
|
|
1574
1574
|
_this$parse$fonts = _this$parse.fonts,
|
|
1575
1575
|
themeFonts = _this$parse$fonts === void 0 ? [] : _this$parse$fonts,
|
|
1576
|
-
newTheme = _objectWithoutProperties(_this$parse, _excluded$
|
|
1576
|
+
newTheme = _objectWithoutProperties(_this$parse, _excluded$4);
|
|
1577
1577
|
return fonts.length > 0 || themeFonts.length > 0 ? _objectSpread(_objectSpread({}, story), {}, {
|
|
1578
1578
|
theme: newTheme,
|
|
1579
1579
|
fonts: uniq([].concat(_toConsumableArray(themeFonts), _toConsumableArray(fonts)), 'name')
|
|
@@ -1649,19 +1649,82 @@ var FontsParser = /*#__PURE__*/function () {
|
|
|
1649
1649
|
}]);
|
|
1650
1650
|
}();
|
|
1651
1651
|
|
|
1652
|
-
var _excluded$
|
|
1653
|
-
|
|
1652
|
+
var _excluded$3 = ["shareIncentive", "callToAction"];
|
|
1653
|
+
/* eslint-disable class-methods-use-this */
|
|
1654
|
+
var ShareCall = /*#__PURE__*/function () {
|
|
1655
|
+
function ShareCall() {
|
|
1656
|
+
_classCallCheck(this, ShareCall);
|
|
1657
|
+
}
|
|
1658
|
+
return _createClass(ShareCall, [{
|
|
1659
|
+
key: "test",
|
|
1660
|
+
value: function test(screen) {
|
|
1661
|
+
var _ref = screen || {},
|
|
1662
|
+
_ref$shareIncentive = _ref.shareIncentive,
|
|
1663
|
+
shareIncentive = _ref$shareIncentive === void 0 ? null : _ref$shareIncentive,
|
|
1664
|
+
_ref$callToAction = _ref.callToAction,
|
|
1665
|
+
callToAction = _ref$callToAction === void 0 ? null : _ref$callToAction;
|
|
1666
|
+
if (shareIncentive === null && callToAction === null) {
|
|
1667
|
+
return false;
|
|
1668
|
+
}
|
|
1669
|
+
return true;
|
|
1670
|
+
}
|
|
1671
|
+
}, {
|
|
1672
|
+
key: "parse",
|
|
1673
|
+
value: function parse(screen) {
|
|
1674
|
+
var _ref2 = screen || {},
|
|
1675
|
+
_ref2$shareIncentive = _ref2.shareIncentive,
|
|
1676
|
+
shareIncentive = _ref2$shareIncentive === void 0 ? null : _ref2$shareIncentive,
|
|
1677
|
+
_ref2$callToAction = _ref2.callToAction,
|
|
1678
|
+
callToAction = _ref2$callToAction === void 0 ? null : _ref2$callToAction,
|
|
1679
|
+
restScreen = _objectWithoutProperties(_ref2, _excluded$3);
|
|
1680
|
+
var _ref3 = screen || {},
|
|
1681
|
+
_ref3$header = _ref3.header,
|
|
1682
|
+
header = _ref3$header === void 0 ? null : _ref3$header,
|
|
1683
|
+
_ref3$footer = _ref3.footer,
|
|
1684
|
+
footer = _ref3$footer === void 0 ? null : _ref3$footer;
|
|
1685
|
+
|
|
1686
|
+
// Carful for recursivity here cause same key name
|
|
1687
|
+
var newHeader = shareIncentive !== null ? _objectSpread(_objectSpread({}, shareIncentive !== null ? {
|
|
1688
|
+
shareIncentive: shareIncentive
|
|
1689
|
+
} : null), header !== null ? {
|
|
1690
|
+
header: header
|
|
1691
|
+
} : null) : header;
|
|
1692
|
+
var newFooter = callToAction !== null ? _objectSpread(_objectSpread({}, callToAction !== null ? {
|
|
1693
|
+
callToAction: callToAction
|
|
1694
|
+
} : null), footer !== null ? {
|
|
1695
|
+
footer: footer
|
|
1696
|
+
} : null) : footer;
|
|
1697
|
+
var newScreen = _objectSpread(_objectSpread(_objectSpread({}, restScreen), newHeader !== null ? {
|
|
1698
|
+
header: newHeader
|
|
1699
|
+
} : null), newFooter !== null ? {
|
|
1700
|
+
footer: newFooter
|
|
1701
|
+
} : null);
|
|
1702
|
+
return newScreen;
|
|
1703
|
+
}
|
|
1704
|
+
}]);
|
|
1705
|
+
}();
|
|
1706
|
+
|
|
1707
|
+
var migrations = /*#__PURE__*/Object.freeze({
|
|
1708
|
+
__proto__: null,
|
|
1709
|
+
ShareCall: ShareCall
|
|
1710
|
+
});
|
|
1711
|
+
|
|
1712
|
+
var _excluded$2 = ["components"];
|
|
1654
1713
|
var MigrationsParser = /*#__PURE__*/function () {
|
|
1655
1714
|
function MigrationsParser(_ref) {
|
|
1656
1715
|
var screensManager = _ref.screensManager;
|
|
1657
1716
|
_classCallCheck(this, MigrationsParser);
|
|
1658
1717
|
this.screensManager = screensManager;
|
|
1718
|
+
this.parsers = Object.keys(migrations).map(function (migration) {
|
|
1719
|
+
return new migrations[migration]();
|
|
1720
|
+
});
|
|
1659
1721
|
}
|
|
1660
1722
|
|
|
1661
1723
|
// eslint-disable-next-line class-methods-use-this
|
|
1662
1724
|
return _createClass(MigrationsParser, [{
|
|
1663
1725
|
key: "parse",
|
|
1664
1726
|
value: function parse(story) {
|
|
1727
|
+
var _this = this;
|
|
1665
1728
|
if (story === null) {
|
|
1666
1729
|
return story;
|
|
1667
1730
|
}
|
|
@@ -1670,37 +1733,12 @@ var MigrationsParser = /*#__PURE__*/function () {
|
|
|
1670
1733
|
components = _ref2$components === void 0 ? [] : _ref2$components,
|
|
1671
1734
|
restStory = _objectWithoutProperties(_ref2, _excluded$2);
|
|
1672
1735
|
var finalComponents = components.reduce(function (currentComponents, screen) {
|
|
1673
|
-
var
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
if (shareIncentive === null && callToAction === null) {
|
|
1680
|
-
return [].concat(_toConsumableArray(currentComponents), [restScreen]);
|
|
1681
|
-
}
|
|
1682
|
-
var _ref4 = screen || {},
|
|
1683
|
-
_ref4$header = _ref4.header,
|
|
1684
|
-
header = _ref4$header === void 0 ? null : _ref4$header,
|
|
1685
|
-
_ref4$footer = _ref4.footer,
|
|
1686
|
-
footer = _ref4$footer === void 0 ? null : _ref4$footer;
|
|
1687
|
-
|
|
1688
|
-
// Carful for recursivity here cause same key name
|
|
1689
|
-
var newHeader = shareIncentive !== null ? _objectSpread(_objectSpread({}, shareIncentive !== null ? {
|
|
1690
|
-
shareIncentive: shareIncentive
|
|
1691
|
-
} : null), header !== null ? {
|
|
1692
|
-
header: header
|
|
1693
|
-
} : null) : header;
|
|
1694
|
-
var newFooter = callToAction !== null ? _objectSpread(_objectSpread({}, callToAction !== null ? {
|
|
1695
|
-
callToAction: callToAction
|
|
1696
|
-
} : null), footer !== null ? {
|
|
1697
|
-
footer: footer
|
|
1698
|
-
} : null) : footer;
|
|
1699
|
-
var newScreen = _objectSpread(_objectSpread(_objectSpread({}, restScreen), newHeader !== null ? {
|
|
1700
|
-
header: newHeader
|
|
1701
|
-
} : null), newFooter !== null ? {
|
|
1702
|
-
footer: newFooter
|
|
1703
|
-
} : null);
|
|
1736
|
+
var newScreen = _this.parsers.reduce(function (currentScreen, parser) {
|
|
1737
|
+
if (parser.test(currentScreen)) {
|
|
1738
|
+
return parser.parse(currentScreen);
|
|
1739
|
+
}
|
|
1740
|
+
return currentScreen;
|
|
1741
|
+
}, screen);
|
|
1704
1742
|
return [].concat(_toConsumableArray(currentComponents), [newScreen]);
|
|
1705
1743
|
}, []);
|
|
1706
1744
|
return _objectSpread(_objectSpread({}, restStory), {}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.607",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -144,5 +144,5 @@
|
|
|
144
144
|
"access": "public",
|
|
145
145
|
"registry": "https://registry.npmjs.org/"
|
|
146
146
|
},
|
|
147
|
-
"gitHead": "
|
|
147
|
+
"gitHead": "635ee4c6bf057273a9c90bde7c80134ad92ebb9c"
|
|
148
148
|
}
|