@micromag/core 0.3.117 → 0.3.122
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/components.js +22 -3
- package/es/utils.js +4 -2
- package/lib/components.js +22 -3
- package/lib/utils.js +4 -2
- package/package.json +2 -2
package/es/components.js
CHANGED
|
@@ -38,6 +38,7 @@ import { getSizeWithinBounds } from '@folklore/size';
|
|
|
38
38
|
import { faCommentDots } from '@fortawesome/free-solid-svg-icons/faCommentDots';
|
|
39
39
|
import { faCheck } from '@fortawesome/free-solid-svg-icons/faCheck';
|
|
40
40
|
import { faTimes } from '@fortawesome/free-solid-svg-icons/faTimes';
|
|
41
|
+
import { faCircle } from '@fortawesome/free-solid-svg-icons/faCircle';
|
|
41
42
|
import { faPercent } from '@fortawesome/free-solid-svg-icons/faPercent';
|
|
42
43
|
import { useSpring } from '@react-spring/core';
|
|
43
44
|
import { animated } from '@react-spring/web';
|
|
@@ -3435,7 +3436,7 @@ var Timeline = function Timeline(props) {
|
|
|
3435
3436
|
};
|
|
3436
3437
|
|
|
3437
3438
|
/* eslint-disable react/jsx-props-no-spreading, react/destructuring-assignment, react/prop-types */
|
|
3438
|
-
var Title = function Title(props) {
|
|
3439
|
+
var Title$1 = function Title(props) {
|
|
3439
3440
|
return /*#__PURE__*/React.createElement(PlaceholderText, Object.assign({}, props, {
|
|
3440
3441
|
className: classNames([props.className, styles$c.title]),
|
|
3441
3442
|
height: 0.5,
|
|
@@ -3865,6 +3866,23 @@ var Answer$1 = function Answer(_ref) {
|
|
|
3865
3866
|
})));
|
|
3866
3867
|
};
|
|
3867
3868
|
|
|
3869
|
+
var Title = function Title(props) {
|
|
3870
|
+
return /*#__PURE__*/React.createElement(PlaceholderBlock, Object.assign({}, props, {
|
|
3871
|
+
width: "100%",
|
|
3872
|
+
height: "100%",
|
|
3873
|
+
className: classNames([styles$c.container, _defineProperty({}, props.className, props.className !== null)])
|
|
3874
|
+
}), /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
3875
|
+
icon: faCircle,
|
|
3876
|
+
className: styles$c.icon
|
|
3877
|
+
}), /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
3878
|
+
icon: faCircle,
|
|
3879
|
+
className: styles$c.icon
|
|
3880
|
+
}), /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
3881
|
+
icon: faCircle,
|
|
3882
|
+
className: styles$c.icon
|
|
3883
|
+
}));
|
|
3884
|
+
};
|
|
3885
|
+
|
|
3868
3886
|
var styles$2 = {"container":"micromag-core-placeholders-survey-answer-container","block":"micromag-core-placeholders-survey-answer-block","percent":"micromag-core-placeholders-survey-answer-percent","percentIcon":"micromag-core-placeholders-survey-answer-percentIcon"};
|
|
3869
3887
|
|
|
3870
3888
|
var Answer = function Answer(_ref) {
|
|
@@ -3905,12 +3923,13 @@ var Placeholders = /*#__PURE__*/Object.freeze({
|
|
|
3905
3923
|
MapPath: MapPath,
|
|
3906
3924
|
QuizAnswer: Answer$1,
|
|
3907
3925
|
Quote: Quote,
|
|
3926
|
+
ShareOptions: Title,
|
|
3908
3927
|
ShortText: ShortText,
|
|
3909
3928
|
Subtitle: Subtitle,
|
|
3910
3929
|
SurveyAnswer: Answer,
|
|
3911
3930
|
Text: TextPlaceholder,
|
|
3912
3931
|
Timeline: Timeline,
|
|
3913
|
-
Title: Title,
|
|
3932
|
+
Title: Title$1,
|
|
3914
3933
|
Video: Video,
|
|
3915
3934
|
Video360: Video360,
|
|
3916
3935
|
VideoLoop: VideoLoop
|
|
@@ -4343,4 +4362,4 @@ var LinkStyle = function LinkStyle(_ref) {
|
|
|
4343
4362
|
LinkStyle.propTypes = propTypes;
|
|
4344
4363
|
LinkStyle.defaultProps = defaultProps;
|
|
4345
4364
|
|
|
4346
|
-
export { BackButton, Breadcrumb, Button$1 as Button, Buttons, Card, Close, CollapsablePanel, Date$1 as Date, Detector, Dropdown as DropdownMenu, ElementComponent as Element, Empty, FieldForm, FontFaces, Form, FormPanel, HighlightStyle, Label, Link, LinkStyle, Media, Menu, Meta, Modal, ModalDialog, ModalPortal, Modals, Navbar, PaginationMenu as Pagination, Panel, PanelPortal, Panels, 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 as PlaceholderTitle, Video as PlaceholderVideo, Video360 as PlaceholderVideo360, VideoLoop as PlaceholderVideoLoop, Screen$1 as Screen, ScreenElement, Placeholder as ScreenPlaceholder, Preview as ScreenPreview, ScreenSizer, Screens, Slideshow, Spinner, TabsMenu as Tabs, Transitions, TransitionsStagger, UploadModal };
|
|
4365
|
+
export { BackButton, Breadcrumb, Button$1 as Button, Buttons, Card, Close, CollapsablePanel, Date$1 as Date, Detector, Dropdown as DropdownMenu, ElementComponent as Element, Empty, FieldForm, FontFaces, Form, FormPanel, HighlightStyle, Label, Link, LinkStyle, Media, Menu, Meta, Modal, ModalDialog, ModalPortal, Modals, Navbar, PaginationMenu as Pagination, Panel, PanelPortal, Panels, 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, Screen$1 as Screen, ScreenElement, Placeholder as ScreenPlaceholder, Preview as ScreenPreview, ScreenSizer, Screens, Slideshow, Spinner, TabsMenu as Tabs, Transitions, TransitionsStagger, UploadModal };
|
package/es/utils.js
CHANGED
|
@@ -926,7 +926,9 @@ var setValue = function setValue(value, keyParts, fieldValue) {
|
|
|
926
926
|
|
|
927
927
|
if (value !== null || fieldValue !== null) {
|
|
928
928
|
if (isArray) {
|
|
929
|
-
var index = parseInt(key, 10);
|
|
929
|
+
var index = parseInt(key, 10); // TODO: fix this with an explicit delete
|
|
930
|
+
// instead on splicing out the element on null fieldValue
|
|
931
|
+
|
|
930
932
|
var newArrayValue = fieldValue !== null ? [].concat(_toConsumableArray(value.slice(0, index)), [keyParts.length > 0 ? setValue(value !== null ? value[index] || null : null, keyParts, fieldValue) : fieldValue], _toConsumableArray(value.slice(index + 1))) : [].concat(_toConsumableArray(value.slice(0, index)), _toConsumableArray(value.slice(index + 1)));
|
|
931
933
|
return newArrayValue.length > 0 ? newArrayValue : null;
|
|
932
934
|
}
|
|
@@ -979,7 +981,7 @@ var getContrastingColor = function getContrastingColor(backgroundColor) {
|
|
|
979
981
|
color = _ref$color === void 0 ? 'white' : _ref$color;
|
|
980
982
|
|
|
981
983
|
if (tinycolor.equals(color, tinycolor('white'))) {
|
|
982
|
-
return '
|
|
984
|
+
return '#A13DFF';
|
|
983
985
|
}
|
|
984
986
|
|
|
985
987
|
if (tinycolor.equals(color, tinycolor('black'))) {
|
package/lib/components.js
CHANGED
|
@@ -42,6 +42,7 @@ var size = require('@folklore/size');
|
|
|
42
42
|
var faCommentDots = require('@fortawesome/free-solid-svg-icons/faCommentDots');
|
|
43
43
|
var faCheck = require('@fortawesome/free-solid-svg-icons/faCheck');
|
|
44
44
|
var faTimes = require('@fortawesome/free-solid-svg-icons/faTimes');
|
|
45
|
+
var faCircle = require('@fortawesome/free-solid-svg-icons/faCircle');
|
|
45
46
|
var faPercent = require('@fortawesome/free-solid-svg-icons/faPercent');
|
|
46
47
|
var core$1 = require('@react-spring/core');
|
|
47
48
|
var web = require('@react-spring/web');
|
|
@@ -3476,7 +3477,7 @@ var Timeline = function Timeline(props) {
|
|
|
3476
3477
|
};
|
|
3477
3478
|
|
|
3478
3479
|
/* eslint-disable react/jsx-props-no-spreading, react/destructuring-assignment, react/prop-types */
|
|
3479
|
-
var Title = function Title(props) {
|
|
3480
|
+
var Title$1 = function Title(props) {
|
|
3480
3481
|
return /*#__PURE__*/React__default["default"].createElement(PlaceholderText, Object.assign({}, props, {
|
|
3481
3482
|
className: classNames__default["default"]([props.className, styles$c.title]),
|
|
3482
3483
|
height: 0.5,
|
|
@@ -3906,6 +3907,23 @@ var Answer$1 = function Answer(_ref) {
|
|
|
3906
3907
|
})));
|
|
3907
3908
|
};
|
|
3908
3909
|
|
|
3910
|
+
var Title = function Title(props) {
|
|
3911
|
+
return /*#__PURE__*/React__default["default"].createElement(PlaceholderBlock, Object.assign({}, props, {
|
|
3912
|
+
width: "100%",
|
|
3913
|
+
height: "100%",
|
|
3914
|
+
className: classNames__default["default"]([styles$c.container, _defineProperty__default["default"]({}, props.className, props.className !== null)])
|
|
3915
|
+
}), /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3916
|
+
icon: faCircle.faCircle,
|
|
3917
|
+
className: styles$c.icon
|
|
3918
|
+
}), /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3919
|
+
icon: faCircle.faCircle,
|
|
3920
|
+
className: styles$c.icon
|
|
3921
|
+
}), /*#__PURE__*/React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, {
|
|
3922
|
+
icon: faCircle.faCircle,
|
|
3923
|
+
className: styles$c.icon
|
|
3924
|
+
}));
|
|
3925
|
+
};
|
|
3926
|
+
|
|
3909
3927
|
var styles$2 = {"container":"micromag-core-placeholders-survey-answer-container","block":"micromag-core-placeholders-survey-answer-block","percent":"micromag-core-placeholders-survey-answer-percent","percentIcon":"micromag-core-placeholders-survey-answer-percentIcon"};
|
|
3910
3928
|
|
|
3911
3929
|
var Answer = function Answer(_ref) {
|
|
@@ -3946,12 +3964,13 @@ var Placeholders = /*#__PURE__*/Object.freeze({
|
|
|
3946
3964
|
MapPath: MapPath,
|
|
3947
3965
|
QuizAnswer: Answer$1,
|
|
3948
3966
|
Quote: Quote,
|
|
3967
|
+
ShareOptions: Title,
|
|
3949
3968
|
ShortText: ShortText,
|
|
3950
3969
|
Subtitle: Subtitle,
|
|
3951
3970
|
SurveyAnswer: Answer,
|
|
3952
3971
|
Text: TextPlaceholder,
|
|
3953
3972
|
Timeline: Timeline,
|
|
3954
|
-
Title: Title,
|
|
3973
|
+
Title: Title$1,
|
|
3955
3974
|
Video: Video,
|
|
3956
3975
|
Video360: Video360,
|
|
3957
3976
|
VideoLoop: VideoLoop
|
|
@@ -4429,7 +4448,7 @@ exports.PlaceholderShortText = ShortText;
|
|
|
4429
4448
|
exports.PlaceholderSubtitle = Subtitle;
|
|
4430
4449
|
exports.PlaceholderText = TextPlaceholder;
|
|
4431
4450
|
exports.PlaceholderTimeline = Timeline;
|
|
4432
|
-
exports.PlaceholderTitle = Title;
|
|
4451
|
+
exports.PlaceholderTitle = Title$1;
|
|
4433
4452
|
exports.PlaceholderVideo = Video;
|
|
4434
4453
|
exports.PlaceholderVideo360 = Video360;
|
|
4435
4454
|
exports.PlaceholderVideoLoop = VideoLoop;
|
package/lib/utils.js
CHANGED
|
@@ -945,7 +945,9 @@ var setValue = function setValue(value, keyParts, fieldValue) {
|
|
|
945
945
|
|
|
946
946
|
if (value !== null || fieldValue !== null) {
|
|
947
947
|
if (isArray) {
|
|
948
|
-
var index = parseInt(key, 10);
|
|
948
|
+
var index = parseInt(key, 10); // TODO: fix this with an explicit delete
|
|
949
|
+
// instead on splicing out the element on null fieldValue
|
|
950
|
+
|
|
949
951
|
var newArrayValue = fieldValue !== null ? [].concat(_toConsumableArray__default["default"](value.slice(0, index)), [keyParts.length > 0 ? setValue(value !== null ? value[index] || null : null, keyParts, fieldValue) : fieldValue], _toConsumableArray__default["default"](value.slice(index + 1))) : [].concat(_toConsumableArray__default["default"](value.slice(0, index)), _toConsumableArray__default["default"](value.slice(index + 1)));
|
|
950
952
|
return newArrayValue.length > 0 ? newArrayValue : null;
|
|
951
953
|
}
|
|
@@ -998,7 +1000,7 @@ var getContrastingColor = function getContrastingColor(backgroundColor) {
|
|
|
998
1000
|
color = _ref$color === void 0 ? 'white' : _ref$color;
|
|
999
1001
|
|
|
1000
1002
|
if (tinycolor__default["default"].equals(color, tinycolor__default["default"]('white'))) {
|
|
1001
|
-
return '
|
|
1003
|
+
return '#A13DFF';
|
|
1002
1004
|
}
|
|
1003
1005
|
|
|
1004
1006
|
if (tinycolor__default["default"].equals(color, tinycolor__default["default"]('black'))) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.122",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -132,5 +132,5 @@
|
|
|
132
132
|
"publishConfig": {
|
|
133
133
|
"access": "public"
|
|
134
134
|
},
|
|
135
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "4fbee9b4305d9a4ae0e4532a1d8e143155499878"
|
|
136
136
|
}
|