@micromag/core 0.3.423 → 0.3.430
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 +13 -13
- package/assets/css/vendor.css +3 -2
- package/es/components.js +32 -48
- package/es/hooks.js +9 -8
- package/es/index.js +202 -120
- package/es/utils.js +109 -5
- package/lib/components.js +1101 -1157
- package/lib/contexts.js +199 -233
- package/lib/hooks.js +89 -124
- package/lib/index.js +660 -603
- package/lib/utils.js +155 -73
- package/package.json +22 -7
- package/scss/styles.scss +1 -1
- package/scss/upload.scss +1 -2
- package/scss/vendor.scss +2 -0
package/es/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
2
|
import PropTypes$1 from 'prop-types';
|
|
3
|
-
import {
|
|
3
|
+
import { __assign } from 'tslib';
|
|
4
4
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
5
5
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
6
6
|
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
@@ -13,13 +13,11 @@ import _inherits from '@babel/runtime/helpers/inherits';
|
|
|
13
13
|
import _createSuper from '@babel/runtime/helpers/createSuper';
|
|
14
14
|
import EventEmitter from 'wolfy87-eventemitter';
|
|
15
15
|
import 'lodash/isNumber';
|
|
16
|
-
import 'param-case';
|
|
17
16
|
import '@babel/runtime/helpers/regeneratorRuntime';
|
|
18
17
|
import '@babel/runtime/helpers/asyncToGenerator';
|
|
19
18
|
import 'react';
|
|
20
19
|
import isString from 'lodash/isString';
|
|
21
20
|
import 'tinycolor2';
|
|
22
|
-
import { pascalCase } from 'change-case';
|
|
23
21
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
24
22
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
25
23
|
import 'slugify';
|
|
@@ -29,6 +27,72 @@ import uniq from 'lodash/uniq';
|
|
|
29
27
|
import isEmpty from 'lodash/isEmpty';
|
|
30
28
|
import { Tracking as Tracking$1 } from '@folklore/tracking';
|
|
31
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* Lower case as a function.
|
|
35
|
+
*/
|
|
36
|
+
function lowerCase(str) {
|
|
37
|
+
return str.toLowerCase();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
|
|
41
|
+
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
|
|
42
|
+
// Remove all non-word characters.
|
|
43
|
+
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
|
|
44
|
+
/**
|
|
45
|
+
* Normalize the string into something other libraries can manipulate easier.
|
|
46
|
+
*/
|
|
47
|
+
function noCase(input, options) {
|
|
48
|
+
if (options === void 0) {
|
|
49
|
+
options = {};
|
|
50
|
+
}
|
|
51
|
+
var _a = options.splitRegexp,
|
|
52
|
+
splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a,
|
|
53
|
+
_b = options.stripRegexp,
|
|
54
|
+
stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b,
|
|
55
|
+
_c = options.transform,
|
|
56
|
+
transform = _c === void 0 ? lowerCase : _c,
|
|
57
|
+
_d = options.delimiter,
|
|
58
|
+
delimiter = _d === void 0 ? " " : _d;
|
|
59
|
+
var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
|
|
60
|
+
var start = 0;
|
|
61
|
+
var end = result.length;
|
|
62
|
+
// Trim the delimiter from around the output string.
|
|
63
|
+
while (result.charAt(start) === "\0") start++;
|
|
64
|
+
while (result.charAt(end - 1) === "\0") end--;
|
|
65
|
+
// Transform each token independently.
|
|
66
|
+
return result.slice(start, end).split("\0").map(transform).join(delimiter);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Replace `re` in the input string with the replacement value.
|
|
70
|
+
*/
|
|
71
|
+
function replace(input, re, value) {
|
|
72
|
+
if (re instanceof RegExp) return input.replace(re, value);
|
|
73
|
+
return re.reduce(function (input, re) {
|
|
74
|
+
return input.replace(re, value);
|
|
75
|
+
}, input);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function dotCase(input, options) {
|
|
79
|
+
if (options === void 0) {
|
|
80
|
+
options = {};
|
|
81
|
+
}
|
|
82
|
+
return noCase(input, __assign({
|
|
83
|
+
delimiter: "."
|
|
84
|
+
}, options));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function snakeCase(input, options) {
|
|
88
|
+
if (options === void 0) {
|
|
89
|
+
options = {};
|
|
90
|
+
}
|
|
91
|
+
return dotCase(input, __assign({
|
|
92
|
+
delimiter: "_"
|
|
93
|
+
}, options));
|
|
94
|
+
}
|
|
95
|
+
|
|
32
96
|
/**
|
|
33
97
|
* Core
|
|
34
98
|
*/
|
|
@@ -622,153 +686,153 @@ var reload = PropTypes$1.shape();
|
|
|
622
686
|
|
|
623
687
|
var PropTypes = /*#__PURE__*/Object.freeze({
|
|
624
688
|
__proto__: null,
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
menuItems: menuItems,
|
|
689
|
+
activeForm: activeForm,
|
|
690
|
+
adFormat: adFormat,
|
|
691
|
+
adFormats: adFormats,
|
|
692
|
+
answer: answer,
|
|
693
|
+
answerShape: answerShape,
|
|
694
|
+
answers: answers,
|
|
695
|
+
audioComponent: audioComponent,
|
|
696
|
+
audioElement: audioElement,
|
|
697
|
+
audioMedia: audioMedia,
|
|
698
|
+
audioMedias: audioMedias,
|
|
699
|
+
authorElement: authorElement,
|
|
700
|
+
backgroundElement: backgroundElement,
|
|
701
|
+
badge: badge,
|
|
702
|
+
bootstrapThemes: bootstrapThemes,
|
|
703
|
+
borderStyle: borderStyle,
|
|
704
|
+
borderTypes: borderTypes,
|
|
705
|
+
boxStyle: boxStyle,
|
|
643
706
|
breadcrumb: breadcrumb,
|
|
644
707
|
breadcrumbs: breadcrumbs,
|
|
645
|
-
device: device,
|
|
646
|
-
devices: devices,
|
|
647
|
-
modal: modal,
|
|
648
|
-
modals: modals,
|
|
649
|
-
panel: panel,
|
|
650
|
-
panels: panels,
|
|
651
708
|
button: button,
|
|
652
|
-
buttons: buttons,
|
|
653
|
-
bootstrapThemes: bootstrapThemes,
|
|
654
|
-
buttonTheme: buttonTheme,
|
|
655
709
|
buttonSize: buttonSize,
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
710
|
+
buttonTheme: buttonTheme,
|
|
711
|
+
buttons: buttons,
|
|
712
|
+
callToAction: callToAction,
|
|
713
|
+
callToActionTypes: callToActionTypes,
|
|
714
|
+
closedCaptionsElement: closedCaptionsElement,
|
|
715
|
+
closedCaptionsMedia: closedCaptionsMedia,
|
|
716
|
+
color: color,
|
|
659
717
|
component: component,
|
|
718
|
+
componentNames: componentNames,
|
|
660
719
|
components: components,
|
|
720
|
+
containerStyle: containerStyle,
|
|
721
|
+
conversation: conversation,
|
|
722
|
+
conversationMessage: conversationMessage,
|
|
723
|
+
conversationMessages: conversationMessages,
|
|
724
|
+
customFont: customFont,
|
|
725
|
+
defaultMessage: defaultMessage,
|
|
726
|
+
defaultMessageContent: defaultMessageContent,
|
|
727
|
+
device: device,
|
|
728
|
+
deviceScreen: deviceScreen,
|
|
729
|
+
deviceScreens: deviceScreens,
|
|
730
|
+
devices: devices,
|
|
731
|
+
dropdownAlign: dropdownAlign,
|
|
661
732
|
errors: errors,
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
mediaFile: mediaFile,
|
|
668
|
-
media: media,
|
|
669
|
-
medias: medias,
|
|
670
|
-
mediaTypes: mediaTypes,
|
|
671
|
-
imageMedia: imageMedia,
|
|
672
|
-
imageMedias: imageMedias,
|
|
733
|
+
field: field,
|
|
734
|
+
fieldDefinition: fieldDefinition,
|
|
735
|
+
fieldDefinitions: fieldDefinitions,
|
|
736
|
+
fields: fields,
|
|
737
|
+
font: font,
|
|
673
738
|
fontMedia: fontMedia,
|
|
674
739
|
fontMedias: fontMedias,
|
|
675
|
-
videoMedia: videoMedia,
|
|
676
|
-
videoMedias: videoMedias,
|
|
677
|
-
audioMedia: audioMedia,
|
|
678
|
-
audioMedias: audioMedias,
|
|
679
|
-
closedCaptionsMedia: closedCaptionsMedia,
|
|
680
|
-
customFont: customFont,
|
|
681
|
-
font: font,
|
|
682
740
|
fonts: fonts,
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
margin: margin,
|
|
741
|
+
footer: footer,
|
|
742
|
+
formControlSize: formControlSize,
|
|
743
|
+
formErrors: formErrors,
|
|
744
|
+
formField: formField,
|
|
745
|
+
formFields: formFields,
|
|
746
|
+
geoPosition: geoPosition,
|
|
747
|
+
gridElement: gridElement,
|
|
691
748
|
gridLayout: gridLayout,
|
|
692
|
-
|
|
693
|
-
objectFit: objectFit,
|
|
694
|
-
textElement: textElement,
|
|
749
|
+
header: header,
|
|
695
750
|
headingElement: headingElement,
|
|
696
|
-
|
|
751
|
+
history: history,
|
|
697
752
|
imageElement: imageElement,
|
|
698
|
-
imageElements: imageElements,
|
|
699
|
-
videoElement: videoElement,
|
|
700
|
-
visualElement: visualElement,
|
|
701
|
-
visualElements: visualElements,
|
|
702
|
-
audioElement: audioElement,
|
|
703
|
-
closedCaptionsElement: closedCaptionsElement,
|
|
704
|
-
backgroundElement: backgroundElement,
|
|
705
753
|
imageElementWithCaption: imageElementWithCaption,
|
|
754
|
+
imageElements: imageElements,
|
|
706
755
|
imageElementsWithCaption: imageElementsWithCaption,
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
756
|
+
imageMedia: imageMedia,
|
|
757
|
+
imageMedias: imageMedias,
|
|
758
|
+
inputElement: inputElement,
|
|
759
|
+
interaction: interaction,
|
|
760
|
+
interactions: interactions,
|
|
761
|
+
intl: intl,
|
|
762
|
+
label: label,
|
|
763
|
+
location: location,
|
|
764
|
+
margin: margin,
|
|
713
765
|
marker: marker,
|
|
714
|
-
markers: markers,
|
|
715
766
|
markerWithImage: markerWithImage,
|
|
767
|
+
markers: markers,
|
|
716
768
|
markersWithImage: markersWithImage,
|
|
717
|
-
|
|
718
|
-
|
|
769
|
+
media: media,
|
|
770
|
+
mediaFile: mediaFile,
|
|
771
|
+
mediaTypes: mediaTypes,
|
|
772
|
+
medias: medias,
|
|
773
|
+
menuItem: menuItem,
|
|
774
|
+
menuItems: menuItems,
|
|
775
|
+
message: message,
|
|
776
|
+
metadata: metadata,
|
|
777
|
+
modal: modal,
|
|
778
|
+
modals: modals,
|
|
779
|
+
objectFit: objectFit,
|
|
780
|
+
objectFitSize: objectFitSize,
|
|
781
|
+
pageMetadata: pageMetadata,
|
|
782
|
+
panel: panel,
|
|
783
|
+
panels: panels,
|
|
784
|
+
paymentItem: paymentItem,
|
|
785
|
+
paymentItems: paymentItems,
|
|
786
|
+
progress: progress,
|
|
719
787
|
quizAnswer: quizAnswer,
|
|
720
|
-
answers: answers,
|
|
721
788
|
quizAnswers: quizAnswers,
|
|
722
|
-
|
|
723
|
-
|
|
789
|
+
ref: ref,
|
|
790
|
+
reload: reload,
|
|
791
|
+
renderContext: renderContext,
|
|
792
|
+
screen: screen,
|
|
793
|
+
screenComponent: screenComponent,
|
|
794
|
+
screenComponents: screenComponents,
|
|
795
|
+
screenDefinition: screenDefinition,
|
|
796
|
+
screenDefinitions: screenDefinitions,
|
|
797
|
+
screenSize: screenSize,
|
|
798
|
+
searchFilter: searchFilter,
|
|
799
|
+
searchFilters: searchFilters,
|
|
800
|
+
selectOption: selectOption,
|
|
801
|
+
selectOptions: selectOptions,
|
|
802
|
+
shadowType: shadowType,
|
|
724
803
|
shareIncentive: shareIncentive,
|
|
725
|
-
|
|
804
|
+
slide: slide,
|
|
805
|
+
slides: slides,
|
|
726
806
|
speaker: speaker,
|
|
727
807
|
speakers: speakers,
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
screenDefinitions: screenDefinitions,
|
|
735
|
-
fieldDefinition: fieldDefinition,
|
|
736
|
-
fieldDefinitions: fieldDefinitions,
|
|
808
|
+
stackAlign: stackAlign,
|
|
809
|
+
stackDirection: stackDirection,
|
|
810
|
+
stackElement: stackElement,
|
|
811
|
+
stackSpacing: stackSpacing,
|
|
812
|
+
statusCode: statusCode,
|
|
813
|
+
story: story,
|
|
737
814
|
storyComponent: storyComponent,
|
|
738
815
|
storyComponents: storyComponents,
|
|
739
|
-
screenComponent: screenComponent,
|
|
740
|
-
screenComponents: screenComponents,
|
|
741
|
-
screen: screen,
|
|
742
|
-
theme: theme,
|
|
743
|
-
viewerTheme: viewerTheme,
|
|
744
|
-
metadata: metadata,
|
|
745
816
|
tag: tag,
|
|
746
817
|
tags: tags,
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
audioComponent: audioComponent,
|
|
755
|
-
slide: slide,
|
|
756
|
-
slides: slides,
|
|
757
|
-
containerStyle: containerStyle,
|
|
758
|
-
transitionName: transitionName,
|
|
818
|
+
target: target,
|
|
819
|
+
text: text,
|
|
820
|
+
textAlign: textAlign,
|
|
821
|
+
textElement: textElement,
|
|
822
|
+
textStyle: textStyle,
|
|
823
|
+
theme: theme,
|
|
824
|
+
trackingVariables: trackingVariables,
|
|
759
825
|
transition: transition,
|
|
826
|
+
transitionName: transitionName,
|
|
760
827
|
transitions: transitions,
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
authorElement: authorElement,
|
|
828
|
+
user: user,
|
|
829
|
+
videoElement: videoElement,
|
|
830
|
+
videoMedia: videoMedia,
|
|
831
|
+
videoMedias: videoMedias,
|
|
832
|
+
viewerTheme: viewerTheme,
|
|
767
833
|
visitor: visitor,
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
footer: footer,
|
|
771
|
-
reload: reload
|
|
834
|
+
visualElement: visualElement,
|
|
835
|
+
visualElements: visualElements
|
|
772
836
|
});
|
|
773
837
|
|
|
774
838
|
var sortedColors = function sortedColors(colors) {
|
|
@@ -911,6 +975,24 @@ var ColorsParser = /*#__PURE__*/function () {
|
|
|
911
975
|
return ColorsParser;
|
|
912
976
|
}();
|
|
913
977
|
|
|
978
|
+
function pascalCaseTransform(input, index) {
|
|
979
|
+
var firstChar = input.charAt(0);
|
|
980
|
+
var lowerChars = input.substr(1).toLowerCase();
|
|
981
|
+
if (index > 0 && firstChar >= "0" && firstChar <= "9") {
|
|
982
|
+
return "_" + firstChar + lowerChars;
|
|
983
|
+
}
|
|
984
|
+
return "" + firstChar.toUpperCase() + lowerChars;
|
|
985
|
+
}
|
|
986
|
+
function pascalCase(input, options) {
|
|
987
|
+
if (options === void 0) {
|
|
988
|
+
options = {};
|
|
989
|
+
}
|
|
990
|
+
return noCase(input, __assign({
|
|
991
|
+
delimiter: "",
|
|
992
|
+
transform: pascalCaseTransform
|
|
993
|
+
}, options));
|
|
994
|
+
}
|
|
995
|
+
|
|
914
996
|
var getComponentFromName = function getComponentFromName() {
|
|
915
997
|
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
916
998
|
var components = arguments.length > 1 ? arguments[1] : undefined;
|
package/es/utils.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import isNumber from 'lodash/isNumber';
|
|
2
|
-
import {
|
|
2
|
+
import { __assign } from 'tslib';
|
|
3
3
|
import _regeneratorRuntime from '@babel/runtime/helpers/regeneratorRuntime';
|
|
4
4
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
5
5
|
import isObject from 'lodash/isObject';
|
|
6
6
|
import { useEffect, useMemo } from 'react';
|
|
7
7
|
import isString from 'lodash/isString';
|
|
8
8
|
import tinycolor from 'tinycolor2';
|
|
9
|
-
import { pascalCase, paramCase as paramCase$1, snakeCase } from 'change-case';
|
|
10
|
-
export { pascalCase, snakeCase } from 'change-case';
|
|
11
9
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
12
10
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
13
11
|
import isArray from 'lodash/isArray';
|
|
@@ -16,6 +14,112 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
16
14
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
17
15
|
import slugify from 'slugify';
|
|
18
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Lower case as a function.
|
|
22
|
+
*/
|
|
23
|
+
function lowerCase(str) {
|
|
24
|
+
return str.toLowerCase();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
|
|
28
|
+
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
|
|
29
|
+
// Remove all non-word characters.
|
|
30
|
+
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
|
|
31
|
+
/**
|
|
32
|
+
* Normalize the string into something other libraries can manipulate easier.
|
|
33
|
+
*/
|
|
34
|
+
function noCase(input, options) {
|
|
35
|
+
if (options === void 0) {
|
|
36
|
+
options = {};
|
|
37
|
+
}
|
|
38
|
+
var _a = options.splitRegexp,
|
|
39
|
+
splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a,
|
|
40
|
+
_b = options.stripRegexp,
|
|
41
|
+
stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b,
|
|
42
|
+
_c = options.transform,
|
|
43
|
+
transform = _c === void 0 ? lowerCase : _c,
|
|
44
|
+
_d = options.delimiter,
|
|
45
|
+
delimiter = _d === void 0 ? " " : _d;
|
|
46
|
+
var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
|
|
47
|
+
var start = 0;
|
|
48
|
+
var end = result.length;
|
|
49
|
+
// Trim the delimiter from around the output string.
|
|
50
|
+
while (result.charAt(start) === "\0") start++;
|
|
51
|
+
while (result.charAt(end - 1) === "\0") end--;
|
|
52
|
+
// Transform each token independently.
|
|
53
|
+
return result.slice(start, end).split("\0").map(transform).join(delimiter);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Replace `re` in the input string with the replacement value.
|
|
57
|
+
*/
|
|
58
|
+
function replace(input, re, value) {
|
|
59
|
+
if (re instanceof RegExp) return input.replace(re, value);
|
|
60
|
+
return re.reduce(function (input, re) {
|
|
61
|
+
return input.replace(re, value);
|
|
62
|
+
}, input);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function pascalCaseTransform(input, index) {
|
|
66
|
+
var firstChar = input.charAt(0);
|
|
67
|
+
var lowerChars = input.substr(1).toLowerCase();
|
|
68
|
+
if (index > 0 && firstChar >= "0" && firstChar <= "9") {
|
|
69
|
+
return "_" + firstChar + lowerChars;
|
|
70
|
+
}
|
|
71
|
+
return "" + firstChar.toUpperCase() + lowerChars;
|
|
72
|
+
}
|
|
73
|
+
function pascalCase(input, options) {
|
|
74
|
+
if (options === void 0) {
|
|
75
|
+
options = {};
|
|
76
|
+
}
|
|
77
|
+
return noCase(input, __assign({
|
|
78
|
+
delimiter: "",
|
|
79
|
+
transform: pascalCaseTransform
|
|
80
|
+
}, options));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function camelCaseTransform(input, index) {
|
|
84
|
+
if (index === 0) return input.toLowerCase();
|
|
85
|
+
return pascalCaseTransform(input, index);
|
|
86
|
+
}
|
|
87
|
+
function camelCase(input, options) {
|
|
88
|
+
if (options === void 0) {
|
|
89
|
+
options = {};
|
|
90
|
+
}
|
|
91
|
+
return pascalCase(input, __assign({
|
|
92
|
+
transform: camelCaseTransform
|
|
93
|
+
}, options));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function dotCase(input, options) {
|
|
97
|
+
if (options === void 0) {
|
|
98
|
+
options = {};
|
|
99
|
+
}
|
|
100
|
+
return noCase(input, __assign({
|
|
101
|
+
delimiter: "."
|
|
102
|
+
}, options));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function paramCase(input, options) {
|
|
106
|
+
if (options === void 0) {
|
|
107
|
+
options = {};
|
|
108
|
+
}
|
|
109
|
+
return dotCase(input, __assign({
|
|
110
|
+
delimiter: "-"
|
|
111
|
+
}, options));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function snakeCase(input, options) {
|
|
115
|
+
if (options === void 0) {
|
|
116
|
+
options = {};
|
|
117
|
+
}
|
|
118
|
+
return dotCase(input, __assign({
|
|
119
|
+
delimiter: "_"
|
|
120
|
+
}, options));
|
|
121
|
+
}
|
|
122
|
+
|
|
19
123
|
var convertStyleToString = function convertStyleToString(style) {
|
|
20
124
|
return style !== null ? Object.keys(style).map(function (key) {
|
|
21
125
|
return "".concat(paramCase(key), ":").concat(isNumber(style[key]) ? "".concat(style[key], "px") : style[key], ";");
|
|
@@ -1070,7 +1174,7 @@ var slug = function slug(str) {
|
|
|
1070
1174
|
var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
1071
1175
|
var toSlug;
|
|
1072
1176
|
if (separator === '-') {
|
|
1073
|
-
toSlug = paramCase
|
|
1177
|
+
toSlug = paramCase(str);
|
|
1074
1178
|
} else {
|
|
1075
1179
|
toSlug = snakeCase(str);
|
|
1076
1180
|
}
|
|
@@ -1111,4 +1215,4 @@ var getContrastingColor = function getContrastingColor(backgroundColor) {
|
|
|
1111
1215
|
return tinycolor(color).spin(30).toString();
|
|
1112
1216
|
};
|
|
1113
1217
|
|
|
1114
|
-
export { convertStyleToString, copyToClipboard, createNullableOnChange, createUseEvent, easings, getColorAsString, getComponentFromName, getContrastingColor, getDeviceScreens, getDisplayName, getFieldByName, getFieldFromPath, getFileName, getFontFamily as getFontFamilyFromFont, getFooterProps, getGridLayoutName, largestRemainderRound as getLargestRemainderRound, getLayersFromBackground, getLayoutParts, getMediaFilesAsArray, getOptimalImageUrl, getScreenExtraField, getSecondsFromTime, getShadowCoords, getStyleFromAlignment, getStyleFromBorder, getStyleFromBox, getStyleFromColor, getStyleFromContainer, getStyleFromHighlight, getStyleFromImage, getStyleFromLink, getStyleFromMargin, getStyleFromText, getVideoSupportedMimes, isFooterFilled, isHeaderFilled, isImageFilled, isIos, isTextFilled$1 as isLabelFilled, isMessage, isTextFilled, isValidUrl, schemaId, setValue as setFieldValue, slug, unique, validateFields };
|
|
1218
|
+
export { camelCase, convertStyleToString, copyToClipboard, createNullableOnChange, createUseEvent, easings, getColorAsString, getComponentFromName, getContrastingColor, getDeviceScreens, getDisplayName, getFieldByName, getFieldFromPath, getFileName, getFontFamily as getFontFamilyFromFont, getFooterProps, getGridLayoutName, largestRemainderRound as getLargestRemainderRound, getLayersFromBackground, getLayoutParts, getMediaFilesAsArray, getOptimalImageUrl, getScreenExtraField, getSecondsFromTime, getShadowCoords, getStyleFromAlignment, getStyleFromBorder, getStyleFromBox, getStyleFromColor, getStyleFromContainer, getStyleFromHighlight, getStyleFromImage, getStyleFromLink, getStyleFromMargin, getStyleFromText, getVideoSupportedMimes, isFooterFilled, isHeaderFilled, isImageFilled, isIos, isTextFilled$1 as isLabelFilled, isMessage, isTextFilled, isValidUrl, pascalCase, schemaId, setValue as setFieldValue, slug, snakeCase, unique, validateFields };
|