@contentful/experiences-visual-editor-react 1.17.0 → 1.17.1-beta.0
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/README.md +4 -0
- package/dist/index.js +75 -53
- package/dist/index.js.map +1 -1
- package/dist/renderApp.js +1891 -210
- package/dist/renderApp.js.map +1 -1
- package/package.json +4 -4
package/dist/renderApp.js
CHANGED
|
@@ -40413,7 +40413,7 @@ var FUNC_ERROR_TEXT = 'Expected a function';
|
|
|
40413
40413
|
* // Replace `_.memoize.Cache`.
|
|
40414
40414
|
* _.memoize.Cache = WeakMap;
|
|
40415
40415
|
*/
|
|
40416
|
-
function memoize(func, resolver) {
|
|
40416
|
+
function memoize$1(func, resolver) {
|
|
40417
40417
|
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
40418
40418
|
throw new TypeError(FUNC_ERROR_TEXT);
|
|
40419
40419
|
}
|
|
@@ -40429,12 +40429,12 @@ function memoize(func, resolver) {
|
|
|
40429
40429
|
memoized.cache = cache.set(key, result) || cache;
|
|
40430
40430
|
return result;
|
|
40431
40431
|
};
|
|
40432
|
-
memoized.cache = new (memoize.Cache || MapCache);
|
|
40432
|
+
memoized.cache = new (memoize$1.Cache || MapCache);
|
|
40433
40433
|
return memoized;
|
|
40434
40434
|
}
|
|
40435
40435
|
|
|
40436
40436
|
// Expose `MapCache`.
|
|
40437
|
-
memoize.Cache = MapCache;
|
|
40437
|
+
memoize$1.Cache = MapCache;
|
|
40438
40438
|
|
|
40439
40439
|
/** Used as the maximum memoize cache size. */
|
|
40440
40440
|
var MAX_MEMOIZE_SIZE = 500;
|
|
@@ -40448,7 +40448,7 @@ var MAX_MEMOIZE_SIZE = 500;
|
|
|
40448
40448
|
* @returns {Function} Returns the new memoized function.
|
|
40449
40449
|
*/
|
|
40450
40450
|
function memoizeCapped(func) {
|
|
40451
|
-
var result = memoize(func, function(key) {
|
|
40451
|
+
var result = memoize$1(func, function(key) {
|
|
40452
40452
|
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
40453
40453
|
cache.clear();
|
|
40454
40454
|
}
|
|
@@ -42243,6 +42243,44 @@ const CONTENTFUL_COMPONENTS$1 = {
|
|
|
42243
42243
|
const ASSEMBLY_NODE_TYPE$1 = 'assembly';
|
|
42244
42244
|
const ASSEMBLY_DEFAULT_CATEGORY$1 = 'Assemblies';
|
|
42245
42245
|
const ASSEMBLY_BLOCK_NODE_TYPE$1 = 'assemblyBlock';
|
|
42246
|
+
const CF_STYLE_ATTRIBUTES = [
|
|
42247
|
+
'cfVisibility',
|
|
42248
|
+
'cfHorizontalAlignment',
|
|
42249
|
+
'cfVerticalAlignment',
|
|
42250
|
+
'cfMargin',
|
|
42251
|
+
'cfPadding',
|
|
42252
|
+
'cfBackgroundColor',
|
|
42253
|
+
'cfWidth',
|
|
42254
|
+
'cfMaxWidth',
|
|
42255
|
+
'cfHeight',
|
|
42256
|
+
'cfImageAsset',
|
|
42257
|
+
'cfImageOptions',
|
|
42258
|
+
'cfBackgroundImageUrl',
|
|
42259
|
+
'cfBackgroundImageOptions',
|
|
42260
|
+
'cfFlexDirection',
|
|
42261
|
+
'cfFlexWrap',
|
|
42262
|
+
'cfBorder',
|
|
42263
|
+
'cfBorderRadius',
|
|
42264
|
+
'cfGap',
|
|
42265
|
+
'cfFontSize',
|
|
42266
|
+
'cfFontWeight',
|
|
42267
|
+
'cfLineHeight',
|
|
42268
|
+
'cfLetterSpacing',
|
|
42269
|
+
'cfTextColor',
|
|
42270
|
+
'cfTextAlign',
|
|
42271
|
+
'cfTextTransform',
|
|
42272
|
+
'cfTextBold',
|
|
42273
|
+
'cfTextItalic',
|
|
42274
|
+
'cfTextUnderline',
|
|
42275
|
+
// For backwards compatibility
|
|
42276
|
+
// we need to keep those in this constant array
|
|
42277
|
+
// so that omit() in <VisualEditorBlock> and <CompositionBlock>
|
|
42278
|
+
// can filter them out and not pass as props
|
|
42279
|
+
'cfBackgroundImageScaling',
|
|
42280
|
+
'cfBackgroundImageAlignment',
|
|
42281
|
+
'cfBackgroundImageAlignmentVertical',
|
|
42282
|
+
'cfBackgroundImageAlignmentHorizontal',
|
|
42283
|
+
];
|
|
42246
42284
|
const EMPTY_CONTAINER_HEIGHT$1 = '80px';
|
|
42247
42285
|
const DEFAULT_IMAGE_WIDTH = '500px';
|
|
42248
42286
|
var PostMessageMethods$2;
|
|
@@ -43436,7 +43474,7 @@ const transformMedia = (asset, variables, resolveDesignValue, variableName, path
|
|
|
43436
43474
|
return;
|
|
43437
43475
|
}
|
|
43438
43476
|
if (variableName === 'cfBackgroundImageUrl') {
|
|
43439
|
-
const width = resolveDesignValue(variables['cfWidth']?.type === 'DesignValue' ? variables['cfWidth'].valuesByBreakpoint : {}, 'cfWidth');
|
|
43477
|
+
const width = resolveDesignValue(variables['cfWidth']?.type === 'DesignValue' ? variables['cfWidth'].valuesByBreakpoint : {}, 'cfWidth') || '100%';
|
|
43440
43478
|
const optionsVariableName = 'cfBackgroundImageOptions';
|
|
43441
43479
|
const options = resolveDesignValue(variables[optionsVariableName]?.type === 'DesignValue'
|
|
43442
43480
|
? variables[optionsVariableName].valuesByBreakpoint
|
|
@@ -43885,6 +43923,13 @@ const deserializePatternVariables = ({ nodeVariables, componentInstanceProps, co
|
|
|
43885
43923
|
return { childNodeVariable, dataSource, unboundValues };
|
|
43886
43924
|
};
|
|
43887
43925
|
|
|
43926
|
+
const stylesToKeep = ['cfImageAsset'];
|
|
43927
|
+
const stylesToRemove = CF_STYLE_ATTRIBUTES.filter((style) => !stylesToKeep.includes(style));
|
|
43928
|
+
const propsToRemove = ['cfHyperlink', 'cfOpenInNewTab', 'cfSsrClassName'];
|
|
43929
|
+
const sanitizeNodeProps = (nodeProps) => {
|
|
43930
|
+
return omit(nodeProps, stylesToRemove, propsToRemove);
|
|
43931
|
+
};
|
|
43932
|
+
|
|
43888
43933
|
const sendMessage = (eventType, data) => {
|
|
43889
43934
|
if (typeof window === 'undefined') {
|
|
43890
43935
|
return;
|
|
@@ -45016,44 +45061,6 @@ const ASSEMBLY_NODE_TYPE = 'assembly';
|
|
|
45016
45061
|
const ASSEMBLY_DEFAULT_CATEGORY = 'Assemblies';
|
|
45017
45062
|
const ASSEMBLY_BLOCK_NODE_TYPE = 'assemblyBlock';
|
|
45018
45063
|
const ASSEMBLY_NODE_TYPES = [ASSEMBLY_NODE_TYPE, ASSEMBLY_BLOCK_NODE_TYPE];
|
|
45019
|
-
const CF_STYLE_ATTRIBUTES = [
|
|
45020
|
-
'cfVisibility',
|
|
45021
|
-
'cfHorizontalAlignment',
|
|
45022
|
-
'cfVerticalAlignment',
|
|
45023
|
-
'cfMargin',
|
|
45024
|
-
'cfPadding',
|
|
45025
|
-
'cfBackgroundColor',
|
|
45026
|
-
'cfWidth',
|
|
45027
|
-
'cfMaxWidth',
|
|
45028
|
-
'cfHeight',
|
|
45029
|
-
'cfImageAsset',
|
|
45030
|
-
'cfImageOptions',
|
|
45031
|
-
'cfBackgroundImageUrl',
|
|
45032
|
-
'cfBackgroundImageOptions',
|
|
45033
|
-
'cfFlexDirection',
|
|
45034
|
-
'cfFlexWrap',
|
|
45035
|
-
'cfBorder',
|
|
45036
|
-
'cfBorderRadius',
|
|
45037
|
-
'cfGap',
|
|
45038
|
-
'cfFontSize',
|
|
45039
|
-
'cfFontWeight',
|
|
45040
|
-
'cfLineHeight',
|
|
45041
|
-
'cfLetterSpacing',
|
|
45042
|
-
'cfTextColor',
|
|
45043
|
-
'cfTextAlign',
|
|
45044
|
-
'cfTextTransform',
|
|
45045
|
-
'cfTextBold',
|
|
45046
|
-
'cfTextItalic',
|
|
45047
|
-
'cfTextUnderline',
|
|
45048
|
-
// For backwards compatibility
|
|
45049
|
-
// we need to keep those in this constant array
|
|
45050
|
-
// so that omit() in <VisualEditorBlock> and <CompositionBlock>
|
|
45051
|
-
// can filter them out and not pass as props
|
|
45052
|
-
'cfBackgroundImageScaling',
|
|
45053
|
-
'cfBackgroundImageAlignment',
|
|
45054
|
-
'cfBackgroundImageAlignmentVertical',
|
|
45055
|
-
'cfBackgroundImageAlignmentHorizontal',
|
|
45056
|
-
];
|
|
45057
45064
|
const EMPTY_CONTAINER_HEIGHT = '80px';
|
|
45058
45065
|
const HYPERLINK_DEFAULT_PATTERN = `/{locale}/{entry.fields.slug}/`;
|
|
45059
45066
|
var PostMessageMethods$1;
|
|
@@ -56752,180 +56759,1846 @@ var richTextReactRenderer_es5 = {};
|
|
|
56752
56759
|
|
|
56753
56760
|
} (richTextReactRenderer_es5));
|
|
56754
56761
|
|
|
56755
|
-
|
|
56756
|
-
* These modes are ONLY intended to be internally used within the context of
|
|
56757
|
-
* editing an experience inside of Contentful Studio. i.e. these modes
|
|
56758
|
-
* intentionally do not include preview/delivery modes.
|
|
56759
|
-
*/
|
|
56760
|
-
var StudioCanvasMode;
|
|
56761
|
-
(function (StudioCanvasMode) {
|
|
56762
|
-
StudioCanvasMode["READ_ONLY"] = "readOnlyMode";
|
|
56763
|
-
StudioCanvasMode["EDITOR"] = "editorMode";
|
|
56764
|
-
StudioCanvasMode["NONE"] = "none";
|
|
56765
|
-
})(StudioCanvasMode || (StudioCanvasMode = {}));
|
|
56766
|
-
var PostMessageMethods;
|
|
56767
|
-
(function (PostMessageMethods) {
|
|
56768
|
-
PostMessageMethods["REQUEST_ENTITIES"] = "REQUEST_ENTITIES";
|
|
56769
|
-
PostMessageMethods["REQUESTED_ENTITIES"] = "REQUESTED_ENTITIES";
|
|
56770
|
-
})(PostMessageMethods || (PostMessageMethods = {}));
|
|
56762
|
+
/*
|
|
56771
56763
|
|
|
56772
|
-
|
|
56773
|
-
styleInject(css_248z$6);
|
|
56764
|
+
Based off glamor's StyleSheet, thanks Sunil ❤️
|
|
56774
56765
|
|
|
56775
|
-
|
|
56776
|
-
styleInject(css_248z$5);
|
|
56766
|
+
high performance StyleSheet for css-in-js systems
|
|
56777
56767
|
|
|
56778
|
-
|
|
56779
|
-
|
|
56768
|
+
- uses multiple style tags behind the scenes for millions of rules
|
|
56769
|
+
- uses `insertRule` for appending in production for *much* faster performance
|
|
56780
56770
|
|
|
56781
|
-
|
|
56782
|
-
styleInject(css_248z$3);
|
|
56771
|
+
// usage
|
|
56783
56772
|
|
|
56784
|
-
|
|
56785
|
-
styleInject(css_248z$2$1);
|
|
56773
|
+
import { StyleSheet } from '@emotion/sheet'
|
|
56786
56774
|
|
|
56787
|
-
|
|
56788
|
-
return (React.createElement("div", { id: id, ref: ref, style: {
|
|
56789
|
-
display: 'flex',
|
|
56790
|
-
flex,
|
|
56791
|
-
flexBasis,
|
|
56792
|
-
flexShrink,
|
|
56793
|
-
flexDirection,
|
|
56794
|
-
gap,
|
|
56795
|
-
justifyContent,
|
|
56796
|
-
justifyItems,
|
|
56797
|
-
justifySelf,
|
|
56798
|
-
alignItems,
|
|
56799
|
-
alignSelf,
|
|
56800
|
-
alignContent,
|
|
56801
|
-
order,
|
|
56802
|
-
flexWrap,
|
|
56803
|
-
flexGrow,
|
|
56804
|
-
...cssStyles,
|
|
56805
|
-
}, className: className, onMouseEnter: onMouseEnter, onMouseUp: onMouseUp, onMouseDown: onMouseDown, onMouseLeave: onMouseLeave, onClick: onClick, ...props }, children));
|
|
56806
|
-
});
|
|
56807
|
-
Flex.displayName = 'Flex';
|
|
56775
|
+
let styleSheet = new StyleSheet({ key: '', container: document.head })
|
|
56808
56776
|
|
|
56809
|
-
|
|
56810
|
-
|
|
56777
|
+
styleSheet.insert('#box { border: 1px solid red; }')
|
|
56778
|
+
- appends a css rule into the stylesheet
|
|
56811
56779
|
|
|
56812
|
-
|
|
56813
|
-
|
|
56780
|
+
styleSheet.flush()
|
|
56781
|
+
- empties the stylesheet of all its contents
|
|
56814
56782
|
|
|
56815
|
-
|
|
56816
|
-
|
|
56817
|
-
|
|
56818
|
-
|
|
56819
|
-
|
|
56820
|
-
|
|
56821
|
-
}
|
|
56822
|
-
ColumnWrapper.displayName = 'ColumnWrapper';
|
|
56783
|
+
*/
|
|
56784
|
+
// $FlowFixMe
|
|
56785
|
+
function sheetForTag(tag) {
|
|
56786
|
+
if (tag.sheet) {
|
|
56787
|
+
// $FlowFixMe
|
|
56788
|
+
return tag.sheet;
|
|
56789
|
+
} // this weirdness brought to you by firefox
|
|
56823
56790
|
|
|
56824
|
-
|
|
56825
|
-
// Feel free to do any magic as regards variable definitions for assemblies
|
|
56826
|
-
// Or if this isn't necessary by the time we figure that part out, we can bid this part farewell
|
|
56827
|
-
const Assembly = (props) => {
|
|
56828
|
-
if (props.editorMode) {
|
|
56829
|
-
const { node, dragProps, ...editorModeProps } = props;
|
|
56830
|
-
return props.renderDropzone(node, {
|
|
56831
|
-
...editorModeProps,
|
|
56832
|
-
['data-test-id']: 'contentful-assembly',
|
|
56833
|
-
className: props.className,
|
|
56834
|
-
dragProps,
|
|
56835
|
-
});
|
|
56836
|
-
}
|
|
56837
|
-
// Using a display contents so assembly content/children
|
|
56838
|
-
// can appear as if they are direct children of the div wrapper's parent
|
|
56839
|
-
return React.createElement("div", { "data-test-id": "assembly", ...props, style: assemblyStyle });
|
|
56840
|
-
};
|
|
56791
|
+
/* istanbul ignore next */
|
|
56841
56792
|
|
|
56842
|
-
const useEntityStore = create$1((set) => ({
|
|
56843
|
-
entityStore: new EditorModeEntityStore({ locale: 'en-US', entities: [] }),
|
|
56844
|
-
areEntitiesFetched: false,
|
|
56845
|
-
setEntitiesFetched(fetched) {
|
|
56846
|
-
set({ areEntitiesFetched: fetched });
|
|
56847
|
-
},
|
|
56848
|
-
resetEntityStore(locale, entities = []) {
|
|
56849
|
-
console.debug(`[experiences-sdk-react] Resetting entity store because the locale changed to '${locale}'.`);
|
|
56850
|
-
const newEntityStore = new EditorModeEntityStore({ locale, entities });
|
|
56851
|
-
set({
|
|
56852
|
-
entityStore: newEntityStore,
|
|
56853
|
-
areEntitiesFetched: false,
|
|
56854
|
-
});
|
|
56855
|
-
return newEntityStore;
|
|
56856
|
-
},
|
|
56857
|
-
}));
|
|
56858
56793
|
|
|
56859
|
-
|
|
56860
|
-
|
|
56861
|
-
|
|
56862
|
-
|
|
56863
|
-
}
|
|
56864
|
-
get isDragging() {
|
|
56865
|
-
return this.isDraggingItem;
|
|
56866
|
-
}
|
|
56867
|
-
get isDraggingOnParent() {
|
|
56868
|
-
return this.isDragStartedOnParent;
|
|
56869
|
-
}
|
|
56870
|
-
updateIsDragging(isDraggingItem) {
|
|
56871
|
-
this.isDraggingItem = isDraggingItem;
|
|
56872
|
-
}
|
|
56873
|
-
updateIsDragStartedOnParent(isDragStartedOnParent) {
|
|
56874
|
-
this.isDragStartedOnParent = isDragStartedOnParent;
|
|
56875
|
-
}
|
|
56876
|
-
resetState() {
|
|
56877
|
-
this.isDraggingItem = false;
|
|
56878
|
-
this.isDragStartedOnParent = false;
|
|
56794
|
+
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
56795
|
+
if (document.styleSheets[i].ownerNode === tag) {
|
|
56796
|
+
// $FlowFixMe
|
|
56797
|
+
return document.styleSheets[i];
|
|
56879
56798
|
}
|
|
56799
|
+
}
|
|
56880
56800
|
}
|
|
56881
56801
|
|
|
56882
|
-
|
|
56883
|
-
|
|
56884
|
-
|
|
56885
|
-
|
|
56886
|
-
|
|
56887
|
-
|
|
56888
|
-
|
|
56889
|
-
|
|
56890
|
-
|
|
56891
|
-
|
|
56892
|
-
|
|
56893
|
-
|
|
56894
|
-
|
|
56895
|
-
|
|
56896
|
-
|
|
56897
|
-
|
|
56898
|
-
|
|
56899
|
-
|
|
56900
|
-
|
|
56901
|
-
|
|
56902
|
-
|
|
56903
|
-
|
|
56904
|
-
|
|
56905
|
-
|
|
56906
|
-
|
|
56907
|
-
|
|
56802
|
+
function createStyleElement(options) {
|
|
56803
|
+
var tag = document.createElement('style');
|
|
56804
|
+
tag.setAttribute('data-emotion', options.key);
|
|
56805
|
+
|
|
56806
|
+
if (options.nonce !== undefined) {
|
|
56807
|
+
tag.setAttribute('nonce', options.nonce);
|
|
56808
|
+
}
|
|
56809
|
+
|
|
56810
|
+
tag.appendChild(document.createTextNode(''));
|
|
56811
|
+
return tag;
|
|
56812
|
+
}
|
|
56813
|
+
|
|
56814
|
+
var StyleSheet =
|
|
56815
|
+
/*#__PURE__*/
|
|
56816
|
+
function () {
|
|
56817
|
+
function StyleSheet(options) {
|
|
56818
|
+
this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;
|
|
56819
|
+
this.tags = [];
|
|
56820
|
+
this.ctr = 0;
|
|
56821
|
+
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
|
|
56822
|
+
|
|
56823
|
+
this.key = options.key;
|
|
56824
|
+
this.container = options.container;
|
|
56825
|
+
this.before = null;
|
|
56826
|
+
}
|
|
56827
|
+
|
|
56828
|
+
var _proto = StyleSheet.prototype;
|
|
56829
|
+
|
|
56830
|
+
_proto.insert = function insert(rule) {
|
|
56831
|
+
// the max length is how many rules we have per style tag, it's 65000 in speedy mode
|
|
56832
|
+
// it's 1 in dev because we insert source maps that map a single rule to a location
|
|
56833
|
+
// and you can only have one source map per style tag
|
|
56834
|
+
if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
|
|
56835
|
+
var _tag = createStyleElement(this);
|
|
56836
|
+
|
|
56837
|
+
var before;
|
|
56838
|
+
|
|
56839
|
+
if (this.tags.length === 0) {
|
|
56840
|
+
before = this.before;
|
|
56841
|
+
} else {
|
|
56842
|
+
before = this.tags[this.tags.length - 1].nextSibling;
|
|
56843
|
+
}
|
|
56844
|
+
|
|
56845
|
+
this.container.insertBefore(_tag, before);
|
|
56846
|
+
this.tags.push(_tag);
|
|
56908
56847
|
}
|
|
56909
|
-
|
|
56910
|
-
|
|
56911
|
-
|
|
56848
|
+
|
|
56849
|
+
var tag = this.tags[this.tags.length - 1];
|
|
56850
|
+
|
|
56851
|
+
if (this.isSpeedy) {
|
|
56852
|
+
var sheet = sheetForTag(tag);
|
|
56853
|
+
|
|
56854
|
+
try {
|
|
56855
|
+
// this is a really hot path
|
|
56856
|
+
// we check the second character first because having "i"
|
|
56857
|
+
// as the second character will happen less often than
|
|
56858
|
+
// having "@" as the first character
|
|
56859
|
+
var isImportRule = rule.charCodeAt(1) === 105 && rule.charCodeAt(0) === 64; // this is the ultrafast version, works across browsers
|
|
56860
|
+
// the big drawback is that the css won't be editable in devtools
|
|
56861
|
+
|
|
56862
|
+
sheet.insertRule(rule, // we need to insert @import rules before anything else
|
|
56863
|
+
// otherwise there will be an error
|
|
56864
|
+
// technically this means that the @import rules will
|
|
56865
|
+
// _usually_(not always since there could be multiple style tags)
|
|
56866
|
+
// be the first ones in prod and generally later in dev
|
|
56867
|
+
// this shouldn't really matter in the real world though
|
|
56868
|
+
// @import is generally only used for font faces from google fonts and etc.
|
|
56869
|
+
// so while this could be technically correct then it would be slower and larger
|
|
56870
|
+
// for a tiny bit of correctness that won't matter in the real world
|
|
56871
|
+
isImportRule ? 0 : sheet.cssRules.length);
|
|
56872
|
+
} catch (e) {
|
|
56873
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
56874
|
+
console.warn("There was a problem inserting the following rule: \"" + rule + "\"", e);
|
|
56912
56875
|
}
|
|
56913
|
-
|
|
56914
|
-
|
|
56915
|
-
|
|
56916
|
-
view: window,
|
|
56917
|
-
pageX: 0,
|
|
56918
|
-
pageY: 0,
|
|
56919
|
-
clientX: coordX,
|
|
56920
|
-
clientY: coordY,
|
|
56921
|
-
};
|
|
56922
|
-
const event = new MouseEvent(eventName, options);
|
|
56923
|
-
this.draggingElement.dispatchEvent(event);
|
|
56876
|
+
}
|
|
56877
|
+
} else {
|
|
56878
|
+
tag.appendChild(document.createTextNode(rule));
|
|
56924
56879
|
}
|
|
56925
|
-
}
|
|
56926
|
-
var SimulateDnD$1 = new SimulateDnD();
|
|
56927
56880
|
|
|
56928
|
-
|
|
56881
|
+
this.ctr++;
|
|
56882
|
+
};
|
|
56883
|
+
|
|
56884
|
+
_proto.flush = function flush() {
|
|
56885
|
+
// $FlowFixMe
|
|
56886
|
+
this.tags.forEach(function (tag) {
|
|
56887
|
+
return tag.parentNode.removeChild(tag);
|
|
56888
|
+
});
|
|
56889
|
+
this.tags = [];
|
|
56890
|
+
this.ctr = 0;
|
|
56891
|
+
};
|
|
56892
|
+
|
|
56893
|
+
return StyleSheet;
|
|
56894
|
+
}();
|
|
56895
|
+
|
|
56896
|
+
function stylis_min (W) {
|
|
56897
|
+
function M(d, c, e, h, a) {
|
|
56898
|
+
for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = '', p = '', F = '', G = '', C; l < B;) {
|
|
56899
|
+
g = e.charCodeAt(l);
|
|
56900
|
+
l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++);
|
|
56901
|
+
|
|
56902
|
+
if (0 === b + n + v + m) {
|
|
56903
|
+
if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) {
|
|
56904
|
+
switch (g) {
|
|
56905
|
+
case 32:
|
|
56906
|
+
case 9:
|
|
56907
|
+
case 59:
|
|
56908
|
+
case 13:
|
|
56909
|
+
case 10:
|
|
56910
|
+
break;
|
|
56911
|
+
|
|
56912
|
+
default:
|
|
56913
|
+
f += e.charAt(l);
|
|
56914
|
+
}
|
|
56915
|
+
|
|
56916
|
+
g = 59;
|
|
56917
|
+
}
|
|
56918
|
+
|
|
56919
|
+
switch (g) {
|
|
56920
|
+
case 123:
|
|
56921
|
+
f = f.trim();
|
|
56922
|
+
q = f.charCodeAt(0);
|
|
56923
|
+
k = 1;
|
|
56924
|
+
|
|
56925
|
+
for (t = ++l; l < B;) {
|
|
56926
|
+
switch (g = e.charCodeAt(l)) {
|
|
56927
|
+
case 123:
|
|
56928
|
+
k++;
|
|
56929
|
+
break;
|
|
56930
|
+
|
|
56931
|
+
case 125:
|
|
56932
|
+
k--;
|
|
56933
|
+
break;
|
|
56934
|
+
|
|
56935
|
+
case 47:
|
|
56936
|
+
switch (g = e.charCodeAt(l + 1)) {
|
|
56937
|
+
case 42:
|
|
56938
|
+
case 47:
|
|
56939
|
+
a: {
|
|
56940
|
+
for (u = l + 1; u < J; ++u) {
|
|
56941
|
+
switch (e.charCodeAt(u)) {
|
|
56942
|
+
case 47:
|
|
56943
|
+
if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) {
|
|
56944
|
+
l = u + 1;
|
|
56945
|
+
break a;
|
|
56946
|
+
}
|
|
56947
|
+
|
|
56948
|
+
break;
|
|
56949
|
+
|
|
56950
|
+
case 10:
|
|
56951
|
+
if (47 === g) {
|
|
56952
|
+
l = u + 1;
|
|
56953
|
+
break a;
|
|
56954
|
+
}
|
|
56955
|
+
|
|
56956
|
+
}
|
|
56957
|
+
}
|
|
56958
|
+
|
|
56959
|
+
l = u;
|
|
56960
|
+
}
|
|
56961
|
+
|
|
56962
|
+
}
|
|
56963
|
+
|
|
56964
|
+
break;
|
|
56965
|
+
|
|
56966
|
+
case 91:
|
|
56967
|
+
g++;
|
|
56968
|
+
|
|
56969
|
+
case 40:
|
|
56970
|
+
g++;
|
|
56971
|
+
|
|
56972
|
+
case 34:
|
|
56973
|
+
case 39:
|
|
56974
|
+
for (; l++ < J && e.charCodeAt(l) !== g;) {
|
|
56975
|
+
}
|
|
56976
|
+
|
|
56977
|
+
}
|
|
56978
|
+
|
|
56979
|
+
if (0 === k) break;
|
|
56980
|
+
l++;
|
|
56981
|
+
}
|
|
56982
|
+
|
|
56983
|
+
k = e.substring(t, l);
|
|
56984
|
+
0 === q && (q = (f = f.replace(ca, '').trim()).charCodeAt(0));
|
|
56985
|
+
|
|
56986
|
+
switch (q) {
|
|
56987
|
+
case 64:
|
|
56988
|
+
0 < r && (f = f.replace(N, ''));
|
|
56989
|
+
g = f.charCodeAt(1);
|
|
56990
|
+
|
|
56991
|
+
switch (g) {
|
|
56992
|
+
case 100:
|
|
56993
|
+
case 109:
|
|
56994
|
+
case 115:
|
|
56995
|
+
case 45:
|
|
56996
|
+
r = c;
|
|
56997
|
+
break;
|
|
56998
|
+
|
|
56999
|
+
default:
|
|
57000
|
+
r = O;
|
|
57001
|
+
}
|
|
57002
|
+
|
|
57003
|
+
k = M(c, r, k, g, a + 1);
|
|
57004
|
+
t = k.length;
|
|
57005
|
+
0 < A && (r = X(O, f, I), C = H(3, k, r, c, D, z, t, g, a, h), f = r.join(''), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, k = ''));
|
|
57006
|
+
if (0 < t) switch (g) {
|
|
57007
|
+
case 115:
|
|
57008
|
+
f = f.replace(da, ea);
|
|
57009
|
+
|
|
57010
|
+
case 100:
|
|
57011
|
+
case 109:
|
|
57012
|
+
case 45:
|
|
57013
|
+
k = f + '{' + k + '}';
|
|
57014
|
+
break;
|
|
57015
|
+
|
|
57016
|
+
case 107:
|
|
57017
|
+
f = f.replace(fa, '$1 $2');
|
|
57018
|
+
k = f + '{' + k + '}';
|
|
57019
|
+
k = 1 === w || 2 === w && L('@' + k, 3) ? '@-webkit-' + k + '@' + k : '@' + k;
|
|
57020
|
+
break;
|
|
57021
|
+
|
|
57022
|
+
default:
|
|
57023
|
+
k = f + k, 112 === h && (k = (p += k, ''));
|
|
57024
|
+
} else k = '';
|
|
57025
|
+
break;
|
|
57026
|
+
|
|
57027
|
+
default:
|
|
57028
|
+
k = M(c, X(c, f, I), k, h, a + 1);
|
|
57029
|
+
}
|
|
57030
|
+
|
|
57031
|
+
F += k;
|
|
57032
|
+
k = I = r = u = q = 0;
|
|
57033
|
+
f = '';
|
|
57034
|
+
g = e.charCodeAt(++l);
|
|
57035
|
+
break;
|
|
57036
|
+
|
|
57037
|
+
case 125:
|
|
57038
|
+
case 59:
|
|
57039
|
+
f = (0 < r ? f.replace(N, '') : f).trim();
|
|
57040
|
+
if (1 < (t = f.length)) switch (0 === u && (q = f.charCodeAt(0), 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(' ', ':')).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = '\x00\x00'), q = f.charCodeAt(0), g = f.charCodeAt(1), q) {
|
|
57041
|
+
case 0:
|
|
57042
|
+
break;
|
|
57043
|
+
|
|
57044
|
+
case 64:
|
|
57045
|
+
if (105 === g || 99 === g) {
|
|
57046
|
+
G += f + e.charAt(l);
|
|
57047
|
+
break;
|
|
57048
|
+
}
|
|
57049
|
+
|
|
57050
|
+
default:
|
|
57051
|
+
58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2)));
|
|
57052
|
+
}
|
|
57053
|
+
I = r = u = q = 0;
|
|
57054
|
+
f = '';
|
|
57055
|
+
g = e.charCodeAt(++l);
|
|
57056
|
+
}
|
|
57057
|
+
}
|
|
57058
|
+
|
|
57059
|
+
switch (g) {
|
|
57060
|
+
case 13:
|
|
57061
|
+
case 10:
|
|
57062
|
+
47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\x00');
|
|
57063
|
+
0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h);
|
|
57064
|
+
z = 1;
|
|
57065
|
+
D++;
|
|
57066
|
+
break;
|
|
57067
|
+
|
|
57068
|
+
case 59:
|
|
57069
|
+
case 125:
|
|
57070
|
+
if (0 === b + n + v + m) {
|
|
57071
|
+
z++;
|
|
57072
|
+
break;
|
|
57073
|
+
}
|
|
57074
|
+
|
|
57075
|
+
default:
|
|
57076
|
+
z++;
|
|
57077
|
+
y = e.charAt(l);
|
|
57078
|
+
|
|
57079
|
+
switch (g) {
|
|
57080
|
+
case 9:
|
|
57081
|
+
case 32:
|
|
57082
|
+
if (0 === n + m + b) switch (x) {
|
|
57083
|
+
case 44:
|
|
57084
|
+
case 58:
|
|
57085
|
+
case 9:
|
|
57086
|
+
case 32:
|
|
57087
|
+
y = '';
|
|
57088
|
+
break;
|
|
57089
|
+
|
|
57090
|
+
default:
|
|
57091
|
+
32 !== g && (y = ' ');
|
|
57092
|
+
}
|
|
57093
|
+
break;
|
|
57094
|
+
|
|
57095
|
+
case 0:
|
|
57096
|
+
y = '\\0';
|
|
57097
|
+
break;
|
|
57098
|
+
|
|
57099
|
+
case 12:
|
|
57100
|
+
y = '\\f';
|
|
57101
|
+
break;
|
|
57102
|
+
|
|
57103
|
+
case 11:
|
|
57104
|
+
y = '\\v';
|
|
57105
|
+
break;
|
|
57106
|
+
|
|
57107
|
+
case 38:
|
|
57108
|
+
0 === n + b + m && (r = I = 1, y = '\f' + y);
|
|
57109
|
+
break;
|
|
57110
|
+
|
|
57111
|
+
case 108:
|
|
57112
|
+
if (0 === n + b + m + E && 0 < u) switch (l - u) {
|
|
57113
|
+
case 2:
|
|
57114
|
+
112 === x && 58 === e.charCodeAt(l - 3) && (E = x);
|
|
57115
|
+
|
|
57116
|
+
case 8:
|
|
57117
|
+
111 === K && (E = K);
|
|
57118
|
+
}
|
|
57119
|
+
break;
|
|
57120
|
+
|
|
57121
|
+
case 58:
|
|
57122
|
+
0 === n + b + m && (u = l);
|
|
57123
|
+
break;
|
|
57124
|
+
|
|
57125
|
+
case 44:
|
|
57126
|
+
0 === b + v + n + m && (r = 1, y += '\r');
|
|
57127
|
+
break;
|
|
57128
|
+
|
|
57129
|
+
case 34:
|
|
57130
|
+
case 39:
|
|
57131
|
+
0 === b && (n = n === g ? 0 : 0 === n ? g : n);
|
|
57132
|
+
break;
|
|
57133
|
+
|
|
57134
|
+
case 91:
|
|
57135
|
+
0 === n + b + v && m++;
|
|
57136
|
+
break;
|
|
57137
|
+
|
|
57138
|
+
case 93:
|
|
57139
|
+
0 === n + b + v && m--;
|
|
57140
|
+
break;
|
|
57141
|
+
|
|
57142
|
+
case 41:
|
|
57143
|
+
0 === n + b + m && v--;
|
|
57144
|
+
break;
|
|
57145
|
+
|
|
57146
|
+
case 40:
|
|
57147
|
+
if (0 === n + b + m) {
|
|
57148
|
+
if (0 === q) switch (2 * x + 3 * K) {
|
|
57149
|
+
case 533:
|
|
57150
|
+
break;
|
|
57151
|
+
|
|
57152
|
+
default:
|
|
57153
|
+
q = 1;
|
|
57154
|
+
}
|
|
57155
|
+
v++;
|
|
57156
|
+
}
|
|
57157
|
+
|
|
57158
|
+
break;
|
|
57159
|
+
|
|
57160
|
+
case 64:
|
|
57161
|
+
0 === b + v + n + m + u + k && (k = 1);
|
|
57162
|
+
break;
|
|
57163
|
+
|
|
57164
|
+
case 42:
|
|
57165
|
+
case 47:
|
|
57166
|
+
if (!(0 < n + m + v)) switch (b) {
|
|
57167
|
+
case 0:
|
|
57168
|
+
switch (2 * g + 3 * e.charCodeAt(l + 1)) {
|
|
57169
|
+
case 235:
|
|
57170
|
+
b = 47;
|
|
57171
|
+
break;
|
|
57172
|
+
|
|
57173
|
+
case 220:
|
|
57174
|
+
t = l, b = 42;
|
|
57175
|
+
}
|
|
57176
|
+
|
|
57177
|
+
break;
|
|
57178
|
+
|
|
57179
|
+
case 42:
|
|
57180
|
+
47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0);
|
|
57181
|
+
}
|
|
57182
|
+
}
|
|
57183
|
+
|
|
57184
|
+
0 === b && (f += y);
|
|
57185
|
+
}
|
|
57186
|
+
|
|
57187
|
+
K = x;
|
|
57188
|
+
x = g;
|
|
57189
|
+
l++;
|
|
57190
|
+
}
|
|
57191
|
+
|
|
57192
|
+
t = p.length;
|
|
57193
|
+
|
|
57194
|
+
if (0 < t) {
|
|
57195
|
+
r = c;
|
|
57196
|
+
if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F;
|
|
57197
|
+
p = r.join(',') + '{' + p + '}';
|
|
57198
|
+
|
|
57199
|
+
if (0 !== w * E) {
|
|
57200
|
+
2 !== w || L(p, 2) || (E = 0);
|
|
57201
|
+
|
|
57202
|
+
switch (E) {
|
|
57203
|
+
case 111:
|
|
57204
|
+
p = p.replace(ha, ':-moz-$1') + p;
|
|
57205
|
+
break;
|
|
57206
|
+
|
|
57207
|
+
case 112:
|
|
57208
|
+
p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p;
|
|
57209
|
+
}
|
|
57210
|
+
|
|
57211
|
+
E = 0;
|
|
57212
|
+
}
|
|
57213
|
+
}
|
|
57214
|
+
|
|
57215
|
+
return G + p + F;
|
|
57216
|
+
}
|
|
57217
|
+
|
|
57218
|
+
function X(d, c, e) {
|
|
57219
|
+
var h = c.trim().split(ia);
|
|
57220
|
+
c = h;
|
|
57221
|
+
var a = h.length,
|
|
57222
|
+
m = d.length;
|
|
57223
|
+
|
|
57224
|
+
switch (m) {
|
|
57225
|
+
case 0:
|
|
57226
|
+
case 1:
|
|
57227
|
+
var b = 0;
|
|
57228
|
+
|
|
57229
|
+
for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) {
|
|
57230
|
+
c[b] = Z(d, c[b], e).trim();
|
|
57231
|
+
}
|
|
57232
|
+
|
|
57233
|
+
break;
|
|
57234
|
+
|
|
57235
|
+
default:
|
|
57236
|
+
var v = b = 0;
|
|
57237
|
+
|
|
57238
|
+
for (c = []; b < a; ++b) {
|
|
57239
|
+
for (var n = 0; n < m; ++n) {
|
|
57240
|
+
c[v++] = Z(d[n] + ' ', h[b], e).trim();
|
|
57241
|
+
}
|
|
57242
|
+
}
|
|
57243
|
+
|
|
57244
|
+
}
|
|
57245
|
+
|
|
57246
|
+
return c;
|
|
57247
|
+
}
|
|
57248
|
+
|
|
57249
|
+
function Z(d, c, e) {
|
|
57250
|
+
var h = c.charCodeAt(0);
|
|
57251
|
+
33 > h && (h = (c = c.trim()).charCodeAt(0));
|
|
57252
|
+
|
|
57253
|
+
switch (h) {
|
|
57254
|
+
case 38:
|
|
57255
|
+
return c.replace(F, '$1' + d.trim());
|
|
57256
|
+
|
|
57257
|
+
case 58:
|
|
57258
|
+
return d.trim() + c.replace(F, '$1' + d.trim());
|
|
57259
|
+
|
|
57260
|
+
default:
|
|
57261
|
+
if (0 < 1 * e && 0 < c.indexOf('\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim());
|
|
57262
|
+
}
|
|
57263
|
+
|
|
57264
|
+
return d + c;
|
|
57265
|
+
}
|
|
57266
|
+
|
|
57267
|
+
function P(d, c, e, h) {
|
|
57268
|
+
var a = d + ';',
|
|
57269
|
+
m = 2 * c + 3 * e + 4 * h;
|
|
57270
|
+
|
|
57271
|
+
if (944 === m) {
|
|
57272
|
+
d = a.indexOf(':', 9) + 1;
|
|
57273
|
+
var b = a.substring(d, a.length - 1).trim();
|
|
57274
|
+
b = a.substring(0, d).trim() + b + ';';
|
|
57275
|
+
return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b;
|
|
57276
|
+
}
|
|
57277
|
+
|
|
57278
|
+
if (0 === w || 2 === w && !L(a, 1)) return a;
|
|
57279
|
+
|
|
57280
|
+
switch (m) {
|
|
57281
|
+
case 1015:
|
|
57282
|
+
return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a;
|
|
57283
|
+
|
|
57284
|
+
case 951:
|
|
57285
|
+
return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a;
|
|
57286
|
+
|
|
57287
|
+
case 963:
|
|
57288
|
+
return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a;
|
|
57289
|
+
|
|
57290
|
+
case 1009:
|
|
57291
|
+
if (100 !== a.charCodeAt(4)) break;
|
|
57292
|
+
|
|
57293
|
+
case 969:
|
|
57294
|
+
case 942:
|
|
57295
|
+
return '-webkit-' + a + a;
|
|
57296
|
+
|
|
57297
|
+
case 978:
|
|
57298
|
+
return '-webkit-' + a + '-moz-' + a + a;
|
|
57299
|
+
|
|
57300
|
+
case 1019:
|
|
57301
|
+
case 983:
|
|
57302
|
+
return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a;
|
|
57303
|
+
|
|
57304
|
+
case 883:
|
|
57305
|
+
if (45 === a.charCodeAt(8)) return '-webkit-' + a + a;
|
|
57306
|
+
if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a;
|
|
57307
|
+
break;
|
|
57308
|
+
|
|
57309
|
+
case 932:
|
|
57310
|
+
if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {
|
|
57311
|
+
case 103:
|
|
57312
|
+
return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a;
|
|
57313
|
+
|
|
57314
|
+
case 115:
|
|
57315
|
+
return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a;
|
|
57316
|
+
|
|
57317
|
+
case 98:
|
|
57318
|
+
return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a;
|
|
57319
|
+
}
|
|
57320
|
+
return '-webkit-' + a + '-ms-' + a + a;
|
|
57321
|
+
|
|
57322
|
+
case 964:
|
|
57323
|
+
return '-webkit-' + a + '-ms-flex-' + a + a;
|
|
57324
|
+
|
|
57325
|
+
case 1023:
|
|
57326
|
+
if (99 !== a.charCodeAt(8)) break;
|
|
57327
|
+
b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify');
|
|
57328
|
+
return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a;
|
|
57329
|
+
|
|
57330
|
+
case 1005:
|
|
57331
|
+
return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a;
|
|
57332
|
+
|
|
57333
|
+
case 1e3:
|
|
57334
|
+
b = a.substring(13).trim();
|
|
57335
|
+
c = b.indexOf('-') + 1;
|
|
57336
|
+
|
|
57337
|
+
switch (b.charCodeAt(0) + b.charCodeAt(c)) {
|
|
57338
|
+
case 226:
|
|
57339
|
+
b = a.replace(G, 'tb');
|
|
57340
|
+
break;
|
|
57341
|
+
|
|
57342
|
+
case 232:
|
|
57343
|
+
b = a.replace(G, 'tb-rl');
|
|
57344
|
+
break;
|
|
57345
|
+
|
|
57346
|
+
case 220:
|
|
57347
|
+
b = a.replace(G, 'lr');
|
|
57348
|
+
break;
|
|
57349
|
+
|
|
57350
|
+
default:
|
|
57351
|
+
return a;
|
|
57352
|
+
}
|
|
57353
|
+
|
|
57354
|
+
return '-webkit-' + a + '-ms-' + b + a;
|
|
57355
|
+
|
|
57356
|
+
case 1017:
|
|
57357
|
+
if (-1 === a.indexOf('sticky', 9)) break;
|
|
57358
|
+
|
|
57359
|
+
case 975:
|
|
57360
|
+
c = (a = d).length - 10;
|
|
57361
|
+
b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim();
|
|
57362
|
+
|
|
57363
|
+
switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) {
|
|
57364
|
+
case 203:
|
|
57365
|
+
if (111 > b.charCodeAt(8)) break;
|
|
57366
|
+
|
|
57367
|
+
case 115:
|
|
57368
|
+
a = a.replace(b, '-webkit-' + b) + ';' + a;
|
|
57369
|
+
break;
|
|
57370
|
+
|
|
57371
|
+
case 207:
|
|
57372
|
+
case 102:
|
|
57373
|
+
a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a;
|
|
57374
|
+
}
|
|
57375
|
+
|
|
57376
|
+
return a + ';';
|
|
57377
|
+
|
|
57378
|
+
case 938:
|
|
57379
|
+
if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {
|
|
57380
|
+
case 105:
|
|
57381
|
+
return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a;
|
|
57382
|
+
|
|
57383
|
+
case 115:
|
|
57384
|
+
return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a;
|
|
57385
|
+
|
|
57386
|
+
default:
|
|
57387
|
+
return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a;
|
|
57388
|
+
}
|
|
57389
|
+
break;
|
|
57390
|
+
|
|
57391
|
+
case 973:
|
|
57392
|
+
case 989:
|
|
57393
|
+
if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;
|
|
57394
|
+
|
|
57395
|
+
case 931:
|
|
57396
|
+
case 953:
|
|
57397
|
+
if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(':') + 1)).charCodeAt(0) ? P(d.replace('stretch', 'fill-available'), c, e, h).replace(':fill-available', ':stretch') : a.replace(b, '-webkit-' + b) + a.replace(b, '-moz-' + b.replace('fill-', '')) + a;
|
|
57398
|
+
break;
|
|
57399
|
+
|
|
57400
|
+
case 962:
|
|
57401
|
+
if (a = '-webkit-' + a + (102 === a.charCodeAt(5) ? '-ms-' + a : '') + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf('transform', 10)) return a.substring(0, a.indexOf(';', 27) + 1).replace(ma, '$1-webkit-$2') + a;
|
|
57402
|
+
}
|
|
57403
|
+
|
|
57404
|
+
return a;
|
|
57405
|
+
}
|
|
57406
|
+
|
|
57407
|
+
function L(d, c) {
|
|
57408
|
+
var e = d.indexOf(1 === c ? ':' : '{'),
|
|
57409
|
+
h = d.substring(0, 3 !== c ? e : 10);
|
|
57410
|
+
e = d.substring(e + 1, d.length - 1);
|
|
57411
|
+
return R(2 !== c ? h : h.replace(na, '$1'), e, c);
|
|
57412
|
+
}
|
|
57413
|
+
|
|
57414
|
+
function ea(d, c) {
|
|
57415
|
+
var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));
|
|
57416
|
+
return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')';
|
|
57417
|
+
}
|
|
57418
|
+
|
|
57419
|
+
function H(d, c, e, h, a, m, b, v, n, q) {
|
|
57420
|
+
for (var g = 0, x = c, w; g < A; ++g) {
|
|
57421
|
+
switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) {
|
|
57422
|
+
case void 0:
|
|
57423
|
+
case !1:
|
|
57424
|
+
case !0:
|
|
57425
|
+
case null:
|
|
57426
|
+
break;
|
|
57427
|
+
|
|
57428
|
+
default:
|
|
57429
|
+
x = w;
|
|
57430
|
+
}
|
|
57431
|
+
}
|
|
57432
|
+
|
|
57433
|
+
if (x !== c) return x;
|
|
57434
|
+
}
|
|
57435
|
+
|
|
57436
|
+
function T(d) {
|
|
57437
|
+
switch (d) {
|
|
57438
|
+
case void 0:
|
|
57439
|
+
case null:
|
|
57440
|
+
A = S.length = 0;
|
|
57441
|
+
break;
|
|
57442
|
+
|
|
57443
|
+
default:
|
|
57444
|
+
if ('function' === typeof d) S[A++] = d;else if ('object' === typeof d) for (var c = 0, e = d.length; c < e; ++c) {
|
|
57445
|
+
T(d[c]);
|
|
57446
|
+
} else Y = !!d | 0;
|
|
57447
|
+
}
|
|
57448
|
+
|
|
57449
|
+
return T;
|
|
57450
|
+
}
|
|
57451
|
+
|
|
57452
|
+
function U(d) {
|
|
57453
|
+
d = d.prefix;
|
|
57454
|
+
void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0);
|
|
57455
|
+
return U;
|
|
57456
|
+
}
|
|
57457
|
+
|
|
57458
|
+
function B(d, c) {
|
|
57459
|
+
var e = d;
|
|
57460
|
+
33 > e.charCodeAt(0) && (e = e.trim());
|
|
57461
|
+
V = e;
|
|
57462
|
+
e = [V];
|
|
57463
|
+
|
|
57464
|
+
if (0 < A) {
|
|
57465
|
+
var h = H(-1, c, e, e, D, z, 0, 0, 0, 0);
|
|
57466
|
+
void 0 !== h && 'string' === typeof h && (c = h);
|
|
57467
|
+
}
|
|
57468
|
+
|
|
57469
|
+
var a = M(O, e, c, 0, 0);
|
|
57470
|
+
0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h));
|
|
57471
|
+
V = '';
|
|
57472
|
+
E = 0;
|
|
57473
|
+
z = D = 1;
|
|
57474
|
+
return a;
|
|
57475
|
+
}
|
|
57476
|
+
|
|
57477
|
+
var ca = /^\0+/g,
|
|
57478
|
+
N = /[\0\r\f]/g,
|
|
57479
|
+
aa = /: */g,
|
|
57480
|
+
ka = /zoo|gra/,
|
|
57481
|
+
ma = /([,: ])(transform)/g,
|
|
57482
|
+
ia = /,\r+?/g,
|
|
57483
|
+
F = /([\t\r\n ])*\f?&/g,
|
|
57484
|
+
fa = /@(k\w+)\s*(\S*)\s*/,
|
|
57485
|
+
Q = /::(place)/g,
|
|
57486
|
+
ha = /:(read-only)/g,
|
|
57487
|
+
G = /[svh]\w+-[tblr]{2}/,
|
|
57488
|
+
da = /\(\s*(.*)\s*\)/g,
|
|
57489
|
+
oa = /([\s\S]*?);/g,
|
|
57490
|
+
ba = /-self|flex-/g,
|
|
57491
|
+
na = /[^]*?(:[rp][el]a[\w-]+)[^]*/,
|
|
57492
|
+
la = /stretch|:\s*\w+\-(?:conte|avail)/,
|
|
57493
|
+
ja = /([^-])(image-set\()/,
|
|
57494
|
+
z = 1,
|
|
57495
|
+
D = 1,
|
|
57496
|
+
E = 0,
|
|
57497
|
+
w = 1,
|
|
57498
|
+
O = [],
|
|
57499
|
+
S = [],
|
|
57500
|
+
A = 0,
|
|
57501
|
+
R = null,
|
|
57502
|
+
Y = 0,
|
|
57503
|
+
V = '';
|
|
57504
|
+
B.use = T;
|
|
57505
|
+
B.set = U;
|
|
57506
|
+
void 0 !== W && U(W);
|
|
57507
|
+
return B;
|
|
57508
|
+
}
|
|
57509
|
+
|
|
57510
|
+
var weakMemoize = function weakMemoize(func) {
|
|
57511
|
+
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
|
|
57512
|
+
var cache = new WeakMap();
|
|
57513
|
+
return function (arg) {
|
|
57514
|
+
if (cache.has(arg)) {
|
|
57515
|
+
// $FlowFixMe
|
|
57516
|
+
return cache.get(arg);
|
|
57517
|
+
}
|
|
57518
|
+
|
|
57519
|
+
var ret = func(arg);
|
|
57520
|
+
cache.set(arg, ret);
|
|
57521
|
+
return ret;
|
|
57522
|
+
};
|
|
57523
|
+
};
|
|
57524
|
+
|
|
57525
|
+
// https://github.com/thysultan/stylis.js/tree/master/plugins/rule-sheet
|
|
57526
|
+
// inlined to avoid umd wrapper and peerDep warnings/installing stylis
|
|
57527
|
+
// since we use stylis after closure compiler
|
|
57528
|
+
var delimiter = '/*|*/';
|
|
57529
|
+
var needle = delimiter + '}';
|
|
57530
|
+
|
|
57531
|
+
function toSheet(block) {
|
|
57532
|
+
if (block) {
|
|
57533
|
+
Sheet.current.insert(block + '}');
|
|
57534
|
+
}
|
|
57535
|
+
}
|
|
57536
|
+
|
|
57537
|
+
var Sheet = {
|
|
57538
|
+
current: null
|
|
57539
|
+
};
|
|
57540
|
+
var ruleSheet = function ruleSheet(context, content, selectors, parents, line, column, length, ns, depth, at) {
|
|
57541
|
+
switch (context) {
|
|
57542
|
+
// property
|
|
57543
|
+
case 1:
|
|
57544
|
+
{
|
|
57545
|
+
switch (content.charCodeAt(0)) {
|
|
57546
|
+
case 64:
|
|
57547
|
+
{
|
|
57548
|
+
// @import
|
|
57549
|
+
Sheet.current.insert(content + ';');
|
|
57550
|
+
return '';
|
|
57551
|
+
}
|
|
57552
|
+
// charcode for l
|
|
57553
|
+
|
|
57554
|
+
case 108:
|
|
57555
|
+
{
|
|
57556
|
+
// charcode for b
|
|
57557
|
+
// this ignores label
|
|
57558
|
+
if (content.charCodeAt(2) === 98) {
|
|
57559
|
+
return '';
|
|
57560
|
+
}
|
|
57561
|
+
}
|
|
57562
|
+
}
|
|
57563
|
+
|
|
57564
|
+
break;
|
|
57565
|
+
}
|
|
57566
|
+
// selector
|
|
57567
|
+
|
|
57568
|
+
case 2:
|
|
57569
|
+
{
|
|
57570
|
+
if (ns === 0) return content + delimiter;
|
|
57571
|
+
break;
|
|
57572
|
+
}
|
|
57573
|
+
// at-rule
|
|
57574
|
+
|
|
57575
|
+
case 3:
|
|
57576
|
+
{
|
|
57577
|
+
switch (ns) {
|
|
57578
|
+
// @font-face, @page
|
|
57579
|
+
case 102:
|
|
57580
|
+
case 112:
|
|
57581
|
+
{
|
|
57582
|
+
Sheet.current.insert(selectors[0] + content);
|
|
57583
|
+
return '';
|
|
57584
|
+
}
|
|
57585
|
+
|
|
57586
|
+
default:
|
|
57587
|
+
{
|
|
57588
|
+
return content + (at === 0 ? delimiter : '');
|
|
57589
|
+
}
|
|
57590
|
+
}
|
|
57591
|
+
}
|
|
57592
|
+
|
|
57593
|
+
case -2:
|
|
57594
|
+
{
|
|
57595
|
+
content.split(needle).forEach(toSheet);
|
|
57596
|
+
}
|
|
57597
|
+
}
|
|
57598
|
+
};
|
|
57599
|
+
var removeLabel = function removeLabel(context, content) {
|
|
57600
|
+
if (context === 1 && // charcode for l
|
|
57601
|
+
content.charCodeAt(0) === 108 && // charcode for b
|
|
57602
|
+
content.charCodeAt(2) === 98 // this ignores label
|
|
57603
|
+
) {
|
|
57604
|
+
return '';
|
|
57605
|
+
}
|
|
57606
|
+
};
|
|
57607
|
+
|
|
57608
|
+
var isBrowser$1 = typeof document !== 'undefined';
|
|
57609
|
+
var rootServerStylisCache = {};
|
|
57610
|
+
var getServerStylisCache = isBrowser$1 ? undefined : weakMemoize(function () {
|
|
57611
|
+
var getCache = weakMemoize(function () {
|
|
57612
|
+
return {};
|
|
57613
|
+
});
|
|
57614
|
+
var prefixTrueCache = {};
|
|
57615
|
+
var prefixFalseCache = {};
|
|
57616
|
+
return function (prefix) {
|
|
57617
|
+
if (prefix === undefined || prefix === true) {
|
|
57618
|
+
return prefixTrueCache;
|
|
57619
|
+
}
|
|
57620
|
+
|
|
57621
|
+
if (prefix === false) {
|
|
57622
|
+
return prefixFalseCache;
|
|
57623
|
+
}
|
|
57624
|
+
|
|
57625
|
+
return getCache(prefix);
|
|
57626
|
+
};
|
|
57627
|
+
});
|
|
57628
|
+
|
|
57629
|
+
var createCache = function createCache(options) {
|
|
57630
|
+
if (options === undefined) options = {};
|
|
57631
|
+
var key = options.key || 'css';
|
|
57632
|
+
var stylisOptions;
|
|
57633
|
+
|
|
57634
|
+
if (options.prefix !== undefined) {
|
|
57635
|
+
stylisOptions = {
|
|
57636
|
+
prefix: options.prefix
|
|
57637
|
+
};
|
|
57638
|
+
}
|
|
57639
|
+
|
|
57640
|
+
var stylis = new stylis_min(stylisOptions);
|
|
57641
|
+
|
|
57642
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
57643
|
+
// $FlowFixMe
|
|
57644
|
+
if (/[^a-z-]/.test(key)) {
|
|
57645
|
+
throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed");
|
|
57646
|
+
}
|
|
57647
|
+
}
|
|
57648
|
+
|
|
57649
|
+
var inserted = {}; // $FlowFixMe
|
|
57650
|
+
|
|
57651
|
+
var container;
|
|
57652
|
+
|
|
57653
|
+
if (isBrowser$1) {
|
|
57654
|
+
container = options.container || document.head;
|
|
57655
|
+
var nodes = document.querySelectorAll("style[data-emotion-" + key + "]");
|
|
57656
|
+
Array.prototype.forEach.call(nodes, function (node) {
|
|
57657
|
+
var attrib = node.getAttribute("data-emotion-" + key); // $FlowFixMe
|
|
57658
|
+
|
|
57659
|
+
attrib.split(' ').forEach(function (id) {
|
|
57660
|
+
inserted[id] = true;
|
|
57661
|
+
});
|
|
57662
|
+
|
|
57663
|
+
if (node.parentNode !== container) {
|
|
57664
|
+
container.appendChild(node);
|
|
57665
|
+
}
|
|
57666
|
+
});
|
|
57667
|
+
}
|
|
57668
|
+
|
|
57669
|
+
var _insert;
|
|
57670
|
+
|
|
57671
|
+
if (isBrowser$1) {
|
|
57672
|
+
stylis.use(options.stylisPlugins)(ruleSheet);
|
|
57673
|
+
|
|
57674
|
+
_insert = function insert(selector, serialized, sheet, shouldCache) {
|
|
57675
|
+
var name = serialized.name;
|
|
57676
|
+
Sheet.current = sheet;
|
|
57677
|
+
|
|
57678
|
+
if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {
|
|
57679
|
+
var map = serialized.map;
|
|
57680
|
+
Sheet.current = {
|
|
57681
|
+
insert: function insert(rule) {
|
|
57682
|
+
sheet.insert(rule + map);
|
|
57683
|
+
}
|
|
57684
|
+
};
|
|
57685
|
+
}
|
|
57686
|
+
|
|
57687
|
+
stylis(selector, serialized.styles);
|
|
57688
|
+
|
|
57689
|
+
if (shouldCache) {
|
|
57690
|
+
cache.inserted[name] = true;
|
|
57691
|
+
}
|
|
57692
|
+
};
|
|
57693
|
+
} else {
|
|
57694
|
+
stylis.use(removeLabel);
|
|
57695
|
+
var serverStylisCache = rootServerStylisCache;
|
|
57696
|
+
|
|
57697
|
+
if (options.stylisPlugins || options.prefix !== undefined) {
|
|
57698
|
+
stylis.use(options.stylisPlugins); // $FlowFixMe
|
|
57699
|
+
|
|
57700
|
+
serverStylisCache = getServerStylisCache(options.stylisPlugins || rootServerStylisCache)(options.prefix);
|
|
57701
|
+
}
|
|
57702
|
+
|
|
57703
|
+
var getRules = function getRules(selector, serialized) {
|
|
57704
|
+
var name = serialized.name;
|
|
57705
|
+
|
|
57706
|
+
if (serverStylisCache[name] === undefined) {
|
|
57707
|
+
serverStylisCache[name] = stylis(selector, serialized.styles);
|
|
57708
|
+
}
|
|
57709
|
+
|
|
57710
|
+
return serverStylisCache[name];
|
|
57711
|
+
};
|
|
57712
|
+
|
|
57713
|
+
_insert = function _insert(selector, serialized, sheet, shouldCache) {
|
|
57714
|
+
var name = serialized.name;
|
|
57715
|
+
var rules = getRules(selector, serialized);
|
|
57716
|
+
|
|
57717
|
+
if (cache.compat === undefined) {
|
|
57718
|
+
// in regular mode, we don't set the styles on the inserted cache
|
|
57719
|
+
// since we don't need to and that would be wasting memory
|
|
57720
|
+
// we return them so that they are rendered in a style tag
|
|
57721
|
+
if (shouldCache) {
|
|
57722
|
+
cache.inserted[name] = true;
|
|
57723
|
+
}
|
|
57724
|
+
|
|
57725
|
+
if ( // using === development instead of !== production
|
|
57726
|
+
// because if people do ssr in tests, the source maps showing up would be annoying
|
|
57727
|
+
process.env.NODE_ENV === 'development' && serialized.map !== undefined) {
|
|
57728
|
+
return rules + serialized.map;
|
|
57729
|
+
}
|
|
57730
|
+
|
|
57731
|
+
return rules;
|
|
57732
|
+
} else {
|
|
57733
|
+
// in compat mode, we put the styles on the inserted cache so
|
|
57734
|
+
// that emotion-server can pull out the styles
|
|
57735
|
+
// except when we don't want to cache it which was in Global but now
|
|
57736
|
+
// is nowhere but we don't want to do a major right now
|
|
57737
|
+
// and just in case we're going to leave the case here
|
|
57738
|
+
// it's also not affecting client side bundle size
|
|
57739
|
+
// so it's really not a big deal
|
|
57740
|
+
if (shouldCache) {
|
|
57741
|
+
cache.inserted[name] = rules;
|
|
57742
|
+
} else {
|
|
57743
|
+
return rules;
|
|
57744
|
+
}
|
|
57745
|
+
}
|
|
57746
|
+
};
|
|
57747
|
+
}
|
|
57748
|
+
|
|
57749
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
57750
|
+
// https://esbench.com/bench/5bf7371a4cd7e6009ef61d0a
|
|
57751
|
+
var commentStart = /\/\*/g;
|
|
57752
|
+
var commentEnd = /\*\//g;
|
|
57753
|
+
stylis.use(function (context, content) {
|
|
57754
|
+
switch (context) {
|
|
57755
|
+
case -1:
|
|
57756
|
+
{
|
|
57757
|
+
while (commentStart.test(content)) {
|
|
57758
|
+
commentEnd.lastIndex = commentStart.lastIndex;
|
|
57759
|
+
|
|
57760
|
+
if (commentEnd.test(content)) {
|
|
57761
|
+
commentStart.lastIndex = commentEnd.lastIndex;
|
|
57762
|
+
continue;
|
|
57763
|
+
}
|
|
57764
|
+
|
|
57765
|
+
throw new Error('Your styles have an unterminated comment ("/*" without corresponding "*/").');
|
|
57766
|
+
}
|
|
57767
|
+
|
|
57768
|
+
commentStart.lastIndex = 0;
|
|
57769
|
+
break;
|
|
57770
|
+
}
|
|
57771
|
+
}
|
|
57772
|
+
});
|
|
57773
|
+
stylis.use(function (context, content, selectors) {
|
|
57774
|
+
switch (context) {
|
|
57775
|
+
case -1:
|
|
57776
|
+
{
|
|
57777
|
+
var flag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
|
|
57778
|
+
var unsafePseudoClasses = content.match(/(:first|:nth|:nth-last)-child/g);
|
|
57779
|
+
|
|
57780
|
+
if (unsafePseudoClasses && cache.compat !== true) {
|
|
57781
|
+
unsafePseudoClasses.forEach(function (unsafePseudoClass) {
|
|
57782
|
+
var ignoreRegExp = new RegExp(unsafePseudoClass + ".*\\/\\* " + flag + " \\*\\/");
|
|
57783
|
+
var ignore = ignoreRegExp.test(content);
|
|
57784
|
+
|
|
57785
|
+
if (unsafePseudoClass && !ignore) {
|
|
57786
|
+
console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
|
|
57787
|
+
}
|
|
57788
|
+
});
|
|
57789
|
+
}
|
|
57790
|
+
|
|
57791
|
+
break;
|
|
57792
|
+
}
|
|
57793
|
+
}
|
|
57794
|
+
});
|
|
57795
|
+
}
|
|
57796
|
+
|
|
57797
|
+
var cache = {
|
|
57798
|
+
key: key,
|
|
57799
|
+
sheet: new StyleSheet({
|
|
57800
|
+
key: key,
|
|
57801
|
+
container: container,
|
|
57802
|
+
nonce: options.nonce,
|
|
57803
|
+
speedy: options.speedy
|
|
57804
|
+
}),
|
|
57805
|
+
nonce: options.nonce,
|
|
57806
|
+
inserted: inserted,
|
|
57807
|
+
registered: {},
|
|
57808
|
+
insert: _insert
|
|
57809
|
+
};
|
|
57810
|
+
return cache;
|
|
57811
|
+
};
|
|
57812
|
+
|
|
57813
|
+
/* eslint-disable */
|
|
57814
|
+
// Inspired by https://github.com/garycourt/murmurhash-js
|
|
57815
|
+
// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
|
|
57816
|
+
function murmur2(str) {
|
|
57817
|
+
// 'm' and 'r' are mixing constants generated offline.
|
|
57818
|
+
// They're not really 'magic', they just happen to work well.
|
|
57819
|
+
// const m = 0x5bd1e995;
|
|
57820
|
+
// const r = 24;
|
|
57821
|
+
// Initialize the hash
|
|
57822
|
+
var h = 0; // Mix 4 bytes at a time into the hash
|
|
57823
|
+
|
|
57824
|
+
var k,
|
|
57825
|
+
i = 0,
|
|
57826
|
+
len = str.length;
|
|
57827
|
+
|
|
57828
|
+
for (; len >= 4; ++i, len -= 4) {
|
|
57829
|
+
k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
|
|
57830
|
+
k =
|
|
57831
|
+
/* Math.imul(k, m): */
|
|
57832
|
+
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
|
|
57833
|
+
k ^=
|
|
57834
|
+
/* k >>> r: */
|
|
57835
|
+
k >>> 24;
|
|
57836
|
+
h =
|
|
57837
|
+
/* Math.imul(k, m): */
|
|
57838
|
+
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
|
|
57839
|
+
/* Math.imul(h, m): */
|
|
57840
|
+
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
|
57841
|
+
} // Handle the last few bytes of the input array
|
|
57842
|
+
|
|
57843
|
+
|
|
57844
|
+
switch (len) {
|
|
57845
|
+
case 3:
|
|
57846
|
+
h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
|
|
57847
|
+
|
|
57848
|
+
case 2:
|
|
57849
|
+
h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
|
|
57850
|
+
|
|
57851
|
+
case 1:
|
|
57852
|
+
h ^= str.charCodeAt(i) & 0xff;
|
|
57853
|
+
h =
|
|
57854
|
+
/* Math.imul(h, m): */
|
|
57855
|
+
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
|
57856
|
+
} // Do a few final mixes of the hash to ensure the last few
|
|
57857
|
+
// bytes are well-incorporated.
|
|
57858
|
+
|
|
57859
|
+
|
|
57860
|
+
h ^= h >>> 13;
|
|
57861
|
+
h =
|
|
57862
|
+
/* Math.imul(h, m): */
|
|
57863
|
+
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
|
57864
|
+
return ((h ^ h >>> 15) >>> 0).toString(36);
|
|
57865
|
+
}
|
|
57866
|
+
|
|
57867
|
+
var unitlessKeys = {
|
|
57868
|
+
animationIterationCount: 1,
|
|
57869
|
+
borderImageOutset: 1,
|
|
57870
|
+
borderImageSlice: 1,
|
|
57871
|
+
borderImageWidth: 1,
|
|
57872
|
+
boxFlex: 1,
|
|
57873
|
+
boxFlexGroup: 1,
|
|
57874
|
+
boxOrdinalGroup: 1,
|
|
57875
|
+
columnCount: 1,
|
|
57876
|
+
columns: 1,
|
|
57877
|
+
flex: 1,
|
|
57878
|
+
flexGrow: 1,
|
|
57879
|
+
flexPositive: 1,
|
|
57880
|
+
flexShrink: 1,
|
|
57881
|
+
flexNegative: 1,
|
|
57882
|
+
flexOrder: 1,
|
|
57883
|
+
gridRow: 1,
|
|
57884
|
+
gridRowEnd: 1,
|
|
57885
|
+
gridRowSpan: 1,
|
|
57886
|
+
gridRowStart: 1,
|
|
57887
|
+
gridColumn: 1,
|
|
57888
|
+
gridColumnEnd: 1,
|
|
57889
|
+
gridColumnSpan: 1,
|
|
57890
|
+
gridColumnStart: 1,
|
|
57891
|
+
msGridRow: 1,
|
|
57892
|
+
msGridRowSpan: 1,
|
|
57893
|
+
msGridColumn: 1,
|
|
57894
|
+
msGridColumnSpan: 1,
|
|
57895
|
+
fontWeight: 1,
|
|
57896
|
+
lineHeight: 1,
|
|
57897
|
+
opacity: 1,
|
|
57898
|
+
order: 1,
|
|
57899
|
+
orphans: 1,
|
|
57900
|
+
tabSize: 1,
|
|
57901
|
+
widows: 1,
|
|
57902
|
+
zIndex: 1,
|
|
57903
|
+
zoom: 1,
|
|
57904
|
+
WebkitLineClamp: 1,
|
|
57905
|
+
// SVG-related properties
|
|
57906
|
+
fillOpacity: 1,
|
|
57907
|
+
floodOpacity: 1,
|
|
57908
|
+
stopOpacity: 1,
|
|
57909
|
+
strokeDasharray: 1,
|
|
57910
|
+
strokeDashoffset: 1,
|
|
57911
|
+
strokeMiterlimit: 1,
|
|
57912
|
+
strokeOpacity: 1,
|
|
57913
|
+
strokeWidth: 1
|
|
57914
|
+
};
|
|
57915
|
+
|
|
57916
|
+
function memoize(fn) {
|
|
57917
|
+
var cache = {};
|
|
57918
|
+
return function (arg) {
|
|
57919
|
+
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
57920
|
+
return cache[arg];
|
|
57921
|
+
};
|
|
57922
|
+
}
|
|
57923
|
+
|
|
57924
|
+
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
|
|
57925
|
+
var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
|
|
57926
|
+
var hyphenateRegex = /[A-Z]|^ms/g;
|
|
57927
|
+
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
|
57928
|
+
|
|
57929
|
+
var isCustomProperty = function isCustomProperty(property) {
|
|
57930
|
+
return property.charCodeAt(1) === 45;
|
|
57931
|
+
};
|
|
57932
|
+
|
|
57933
|
+
var isProcessableValue = function isProcessableValue(value) {
|
|
57934
|
+
return value != null && typeof value !== 'boolean';
|
|
57935
|
+
};
|
|
57936
|
+
|
|
57937
|
+
var processStyleName = memoize(function (styleName) {
|
|
57938
|
+
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
|
|
57939
|
+
});
|
|
57940
|
+
|
|
57941
|
+
var processStyleValue = function processStyleValue(key, value) {
|
|
57942
|
+
switch (key) {
|
|
57943
|
+
case 'animation':
|
|
57944
|
+
case 'animationName':
|
|
57945
|
+
{
|
|
57946
|
+
if (typeof value === 'string') {
|
|
57947
|
+
return value.replace(animationRegex, function (match, p1, p2) {
|
|
57948
|
+
cursor = {
|
|
57949
|
+
name: p1,
|
|
57950
|
+
styles: p2,
|
|
57951
|
+
next: cursor
|
|
57952
|
+
};
|
|
57953
|
+
return p1;
|
|
57954
|
+
});
|
|
57955
|
+
}
|
|
57956
|
+
}
|
|
57957
|
+
}
|
|
57958
|
+
|
|
57959
|
+
if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
|
|
57960
|
+
return value + 'px';
|
|
57961
|
+
}
|
|
57962
|
+
|
|
57963
|
+
return value;
|
|
57964
|
+
};
|
|
57965
|
+
|
|
57966
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
57967
|
+
var contentValuePattern = /(attr|calc|counters?|url)\(/;
|
|
57968
|
+
var contentValues = ['normal', 'none', 'counter', 'open-quote', 'close-quote', 'no-open-quote', 'no-close-quote', 'initial', 'inherit', 'unset'];
|
|
57969
|
+
var oldProcessStyleValue = processStyleValue;
|
|
57970
|
+
var msPattern = /^-ms-/;
|
|
57971
|
+
var hyphenPattern = /-(.)/g;
|
|
57972
|
+
var hyphenatedCache = {};
|
|
57973
|
+
|
|
57974
|
+
processStyleValue = function processStyleValue(key, value) {
|
|
57975
|
+
if (key === 'content') {
|
|
57976
|
+
if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) {
|
|
57977
|
+
console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
|
|
57978
|
+
}
|
|
57979
|
+
}
|
|
57980
|
+
|
|
57981
|
+
var processed = oldProcessStyleValue(key, value);
|
|
57982
|
+
|
|
57983
|
+
if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {
|
|
57984
|
+
hyphenatedCache[key] = true;
|
|
57985
|
+
console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {
|
|
57986
|
+
return _char.toUpperCase();
|
|
57987
|
+
}) + "?");
|
|
57988
|
+
}
|
|
57989
|
+
|
|
57990
|
+
return processed;
|
|
57991
|
+
};
|
|
57992
|
+
}
|
|
57993
|
+
|
|
57994
|
+
var shouldWarnAboutInterpolatingClassNameFromCss = true;
|
|
57995
|
+
|
|
57996
|
+
function handleInterpolation(mergedProps, registered, interpolation, couldBeSelectorInterpolation) {
|
|
57997
|
+
if (interpolation == null) {
|
|
57998
|
+
return '';
|
|
57999
|
+
}
|
|
58000
|
+
|
|
58001
|
+
if (interpolation.__emotion_styles !== undefined) {
|
|
58002
|
+
if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {
|
|
58003
|
+
throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.');
|
|
58004
|
+
}
|
|
58005
|
+
|
|
58006
|
+
return interpolation;
|
|
58007
|
+
}
|
|
58008
|
+
|
|
58009
|
+
switch (typeof interpolation) {
|
|
58010
|
+
case 'boolean':
|
|
58011
|
+
{
|
|
58012
|
+
return '';
|
|
58013
|
+
}
|
|
58014
|
+
|
|
58015
|
+
case 'object':
|
|
58016
|
+
{
|
|
58017
|
+
if (interpolation.anim === 1) {
|
|
58018
|
+
cursor = {
|
|
58019
|
+
name: interpolation.name,
|
|
58020
|
+
styles: interpolation.styles,
|
|
58021
|
+
next: cursor
|
|
58022
|
+
};
|
|
58023
|
+
return interpolation.name;
|
|
58024
|
+
}
|
|
58025
|
+
|
|
58026
|
+
if (interpolation.styles !== undefined) {
|
|
58027
|
+
var next = interpolation.next;
|
|
58028
|
+
|
|
58029
|
+
if (next !== undefined) {
|
|
58030
|
+
// not the most efficient thing ever but this is a pretty rare case
|
|
58031
|
+
// and there will be very few iterations of this generally
|
|
58032
|
+
while (next !== undefined) {
|
|
58033
|
+
cursor = {
|
|
58034
|
+
name: next.name,
|
|
58035
|
+
styles: next.styles,
|
|
58036
|
+
next: cursor
|
|
58037
|
+
};
|
|
58038
|
+
next = next.next;
|
|
58039
|
+
}
|
|
58040
|
+
}
|
|
58041
|
+
|
|
58042
|
+
var styles = interpolation.styles + ";";
|
|
58043
|
+
|
|
58044
|
+
if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {
|
|
58045
|
+
styles += interpolation.map;
|
|
58046
|
+
}
|
|
58047
|
+
|
|
58048
|
+
return styles;
|
|
58049
|
+
}
|
|
58050
|
+
|
|
58051
|
+
return createStringFromObject(mergedProps, registered, interpolation);
|
|
58052
|
+
}
|
|
58053
|
+
|
|
58054
|
+
case 'function':
|
|
58055
|
+
{
|
|
58056
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
58057
|
+
console.error('Functions that are interpolated in css calls will be stringified.\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\n' + 'It can be called directly with props or interpolated in a styled call like this\n' + "let SomeComponent = styled('div')`${dynamicStyle}`");
|
|
58058
|
+
}
|
|
58059
|
+
|
|
58060
|
+
break;
|
|
58061
|
+
}
|
|
58062
|
+
|
|
58063
|
+
case 'string':
|
|
58064
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
58065
|
+
var matched = [];
|
|
58066
|
+
var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {
|
|
58067
|
+
var fakeVarName = "animation" + matched.length;
|
|
58068
|
+
matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, '') + "`");
|
|
58069
|
+
return "${" + fakeVarName + "}";
|
|
58070
|
+
});
|
|
58071
|
+
|
|
58072
|
+
if (matched.length) {
|
|
58073
|
+
console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\n' + 'Instead of doing this:\n\n' + [].concat(matched, ["`" + replaced + "`"]).join('\n') + '\n\nYou should wrap it with `css` like this:\n\n' + ("css`" + replaced + "`"));
|
|
58074
|
+
}
|
|
58075
|
+
}
|
|
58076
|
+
|
|
58077
|
+
break;
|
|
58078
|
+
} // finalize string values (regular strings and functions interpolated into css calls)
|
|
58079
|
+
|
|
58080
|
+
|
|
58081
|
+
if (registered == null) {
|
|
58082
|
+
return interpolation;
|
|
58083
|
+
}
|
|
58084
|
+
|
|
58085
|
+
var cached = registered[interpolation];
|
|
58086
|
+
|
|
58087
|
+
if (process.env.NODE_ENV !== 'production' && couldBeSelectorInterpolation && shouldWarnAboutInterpolatingClassNameFromCss && cached !== undefined) {
|
|
58088
|
+
console.error('Interpolating a className from css`` is not recommended and will cause problems with composition.\n' + 'Interpolating a className from css`` will be completely unsupported in a future major version of Emotion');
|
|
58089
|
+
shouldWarnAboutInterpolatingClassNameFromCss = false;
|
|
58090
|
+
}
|
|
58091
|
+
|
|
58092
|
+
return cached !== undefined && !couldBeSelectorInterpolation ? cached : interpolation;
|
|
58093
|
+
}
|
|
58094
|
+
|
|
58095
|
+
function createStringFromObject(mergedProps, registered, obj) {
|
|
58096
|
+
var string = '';
|
|
58097
|
+
|
|
58098
|
+
if (Array.isArray(obj)) {
|
|
58099
|
+
for (var i = 0; i < obj.length; i++) {
|
|
58100
|
+
string += handleInterpolation(mergedProps, registered, obj[i], false);
|
|
58101
|
+
}
|
|
58102
|
+
} else {
|
|
58103
|
+
for (var _key in obj) {
|
|
58104
|
+
var value = obj[_key];
|
|
58105
|
+
|
|
58106
|
+
if (typeof value !== 'object') {
|
|
58107
|
+
if (registered != null && registered[value] !== undefined) {
|
|
58108
|
+
string += _key + "{" + registered[value] + "}";
|
|
58109
|
+
} else if (isProcessableValue(value)) {
|
|
58110
|
+
string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
|
|
58111
|
+
}
|
|
58112
|
+
} else {
|
|
58113
|
+
if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {
|
|
58114
|
+
throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.');
|
|
58115
|
+
}
|
|
58116
|
+
|
|
58117
|
+
if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
|
|
58118
|
+
for (var _i = 0; _i < value.length; _i++) {
|
|
58119
|
+
if (isProcessableValue(value[_i])) {
|
|
58120
|
+
string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
|
|
58121
|
+
}
|
|
58122
|
+
}
|
|
58123
|
+
} else {
|
|
58124
|
+
var interpolated = handleInterpolation(mergedProps, registered, value, false);
|
|
58125
|
+
|
|
58126
|
+
switch (_key) {
|
|
58127
|
+
case 'animation':
|
|
58128
|
+
case 'animationName':
|
|
58129
|
+
{
|
|
58130
|
+
string += processStyleName(_key) + ":" + interpolated + ";";
|
|
58131
|
+
break;
|
|
58132
|
+
}
|
|
58133
|
+
|
|
58134
|
+
default:
|
|
58135
|
+
{
|
|
58136
|
+
if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {
|
|
58137
|
+
console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
|
|
58138
|
+
}
|
|
58139
|
+
|
|
58140
|
+
string += _key + "{" + interpolated + "}";
|
|
58141
|
+
}
|
|
58142
|
+
}
|
|
58143
|
+
}
|
|
58144
|
+
}
|
|
58145
|
+
}
|
|
58146
|
+
}
|
|
58147
|
+
|
|
58148
|
+
return string;
|
|
58149
|
+
}
|
|
58150
|
+
|
|
58151
|
+
var labelPattern = /label:\s*([^\s;\n{]+)\s*;/g;
|
|
58152
|
+
var sourceMapPattern;
|
|
58153
|
+
|
|
58154
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
58155
|
+
sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//;
|
|
58156
|
+
} // this is the cursor for keyframes
|
|
58157
|
+
// keyframes are stored on the SerializedStyles object as a linked list
|
|
58158
|
+
|
|
58159
|
+
|
|
58160
|
+
var cursor;
|
|
58161
|
+
var serializeStyles = function serializeStyles(args, registered, mergedProps) {
|
|
58162
|
+
if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
|
|
58163
|
+
return args[0];
|
|
58164
|
+
}
|
|
58165
|
+
|
|
58166
|
+
var stringMode = true;
|
|
58167
|
+
var styles = '';
|
|
58168
|
+
cursor = undefined;
|
|
58169
|
+
var strings = args[0];
|
|
58170
|
+
|
|
58171
|
+
if (strings == null || strings.raw === undefined) {
|
|
58172
|
+
stringMode = false;
|
|
58173
|
+
styles += handleInterpolation(mergedProps, registered, strings, false);
|
|
58174
|
+
} else {
|
|
58175
|
+
if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {
|
|
58176
|
+
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
58177
|
+
}
|
|
58178
|
+
|
|
58179
|
+
styles += strings[0];
|
|
58180
|
+
} // we start at 1 since we've already handled the first arg
|
|
58181
|
+
|
|
58182
|
+
|
|
58183
|
+
for (var i = 1; i < args.length; i++) {
|
|
58184
|
+
styles += handleInterpolation(mergedProps, registered, args[i], styles.charCodeAt(styles.length - 1) === 46);
|
|
58185
|
+
|
|
58186
|
+
if (stringMode) {
|
|
58187
|
+
if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {
|
|
58188
|
+
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
58189
|
+
}
|
|
58190
|
+
|
|
58191
|
+
styles += strings[i];
|
|
58192
|
+
}
|
|
58193
|
+
}
|
|
58194
|
+
|
|
58195
|
+
var sourceMap;
|
|
58196
|
+
|
|
58197
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
58198
|
+
styles = styles.replace(sourceMapPattern, function (match) {
|
|
58199
|
+
sourceMap = match;
|
|
58200
|
+
return '';
|
|
58201
|
+
});
|
|
58202
|
+
} // using a global regex with .exec is stateful so lastIndex has to be reset each time
|
|
58203
|
+
|
|
58204
|
+
|
|
58205
|
+
labelPattern.lastIndex = 0;
|
|
58206
|
+
var identifierName = '';
|
|
58207
|
+
var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
|
|
58208
|
+
|
|
58209
|
+
while ((match = labelPattern.exec(styles)) !== null) {
|
|
58210
|
+
identifierName += '-' + // $FlowFixMe we know it's not null
|
|
58211
|
+
match[1];
|
|
58212
|
+
}
|
|
58213
|
+
|
|
58214
|
+
var name = murmur2(styles) + identifierName;
|
|
58215
|
+
|
|
58216
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
58217
|
+
// $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)
|
|
58218
|
+
return {
|
|
58219
|
+
name: name,
|
|
58220
|
+
styles: styles,
|
|
58221
|
+
map: sourceMap,
|
|
58222
|
+
next: cursor,
|
|
58223
|
+
toString: function toString() {
|
|
58224
|
+
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
|
|
58225
|
+
}
|
|
58226
|
+
};
|
|
58227
|
+
}
|
|
58228
|
+
|
|
58229
|
+
return {
|
|
58230
|
+
name: name,
|
|
58231
|
+
styles: styles,
|
|
58232
|
+
next: cursor
|
|
58233
|
+
};
|
|
58234
|
+
};
|
|
58235
|
+
|
|
58236
|
+
var isBrowser = typeof document !== 'undefined';
|
|
58237
|
+
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
|
58238
|
+
var rawClassName = '';
|
|
58239
|
+
classNames.split(' ').forEach(function (className) {
|
|
58240
|
+
if (registered[className] !== undefined) {
|
|
58241
|
+
registeredStyles.push(registered[className]);
|
|
58242
|
+
} else {
|
|
58243
|
+
rawClassName += className + " ";
|
|
58244
|
+
}
|
|
58245
|
+
});
|
|
58246
|
+
return rawClassName;
|
|
58247
|
+
}
|
|
58248
|
+
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
|
58249
|
+
var className = cache.key + "-" + serialized.name;
|
|
58250
|
+
|
|
58251
|
+
if ( // we only need to add the styles to the registered cache if the
|
|
58252
|
+
// class name could be used further down
|
|
58253
|
+
// the tree but if it's a string tag, we know it won't
|
|
58254
|
+
// so we don't have to add it to registered cache.
|
|
58255
|
+
// this improves memory usage since we can avoid storing the whole style string
|
|
58256
|
+
cache.registered[className] === undefined) {
|
|
58257
|
+
cache.registered[className] = serialized.styles;
|
|
58258
|
+
}
|
|
58259
|
+
|
|
58260
|
+
if (cache.inserted[serialized.name] === undefined) {
|
|
58261
|
+
var stylesForSSR = '';
|
|
58262
|
+
var current = serialized;
|
|
58263
|
+
|
|
58264
|
+
do {
|
|
58265
|
+
var maybeStyles = cache.insert("." + className, current, cache.sheet, true);
|
|
58266
|
+
|
|
58267
|
+
if (!isBrowser && maybeStyles !== undefined) {
|
|
58268
|
+
stylesForSSR += maybeStyles;
|
|
58269
|
+
}
|
|
58270
|
+
|
|
58271
|
+
current = current.next;
|
|
58272
|
+
} while (current !== undefined);
|
|
58273
|
+
|
|
58274
|
+
if (!isBrowser && stylesForSSR.length !== 0) {
|
|
58275
|
+
return stylesForSSR;
|
|
58276
|
+
}
|
|
58277
|
+
}
|
|
58278
|
+
};
|
|
58279
|
+
|
|
58280
|
+
function insertWithoutScoping(cache, serialized) {
|
|
58281
|
+
if (cache.inserted[serialized.name] === undefined) {
|
|
58282
|
+
return cache.insert('', serialized, cache.sheet, true);
|
|
58283
|
+
}
|
|
58284
|
+
}
|
|
58285
|
+
|
|
58286
|
+
function merge(registered, css, className) {
|
|
58287
|
+
var registeredStyles = [];
|
|
58288
|
+
var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
|
|
58289
|
+
|
|
58290
|
+
if (registeredStyles.length < 2) {
|
|
58291
|
+
return className;
|
|
58292
|
+
}
|
|
58293
|
+
|
|
58294
|
+
return rawClassName + css(registeredStyles);
|
|
58295
|
+
}
|
|
58296
|
+
|
|
58297
|
+
var createEmotion = function createEmotion(options) {
|
|
58298
|
+
var cache = createCache(options); // $FlowFixMe
|
|
58299
|
+
|
|
58300
|
+
cache.sheet.speedy = function (value) {
|
|
58301
|
+
if (process.env.NODE_ENV !== 'production' && this.ctr !== 0) {
|
|
58302
|
+
throw new Error('speedy must be changed before any rules are inserted');
|
|
58303
|
+
}
|
|
58304
|
+
|
|
58305
|
+
this.isSpeedy = value;
|
|
58306
|
+
};
|
|
58307
|
+
|
|
58308
|
+
cache.compat = true;
|
|
58309
|
+
|
|
58310
|
+
var css = function css() {
|
|
58311
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
58312
|
+
args[_key] = arguments[_key];
|
|
58313
|
+
}
|
|
58314
|
+
|
|
58315
|
+
var serialized = serializeStyles(args, cache.registered, undefined);
|
|
58316
|
+
insertStyles(cache, serialized);
|
|
58317
|
+
return cache.key + "-" + serialized.name;
|
|
58318
|
+
};
|
|
58319
|
+
|
|
58320
|
+
var keyframes = function keyframes() {
|
|
58321
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
58322
|
+
args[_key2] = arguments[_key2];
|
|
58323
|
+
}
|
|
58324
|
+
|
|
58325
|
+
var serialized = serializeStyles(args, cache.registered);
|
|
58326
|
+
var animation = "animation-" + serialized.name;
|
|
58327
|
+
insertWithoutScoping(cache, {
|
|
58328
|
+
name: serialized.name,
|
|
58329
|
+
styles: "@keyframes " + animation + "{" + serialized.styles + "}"
|
|
58330
|
+
});
|
|
58331
|
+
return animation;
|
|
58332
|
+
};
|
|
58333
|
+
|
|
58334
|
+
var injectGlobal = function injectGlobal() {
|
|
58335
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
58336
|
+
args[_key3] = arguments[_key3];
|
|
58337
|
+
}
|
|
58338
|
+
|
|
58339
|
+
var serialized = serializeStyles(args, cache.registered);
|
|
58340
|
+
insertWithoutScoping(cache, serialized);
|
|
58341
|
+
};
|
|
58342
|
+
|
|
58343
|
+
var cx = function cx() {
|
|
58344
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
58345
|
+
args[_key4] = arguments[_key4];
|
|
58346
|
+
}
|
|
58347
|
+
|
|
58348
|
+
return merge(cache.registered, css, classnames$1(args));
|
|
58349
|
+
};
|
|
58350
|
+
|
|
58351
|
+
return {
|
|
58352
|
+
css: css,
|
|
58353
|
+
cx: cx,
|
|
58354
|
+
injectGlobal: injectGlobal,
|
|
58355
|
+
keyframes: keyframes,
|
|
58356
|
+
hydrate: function hydrate(ids) {
|
|
58357
|
+
ids.forEach(function (key) {
|
|
58358
|
+
cache.inserted[key] = true;
|
|
58359
|
+
});
|
|
58360
|
+
},
|
|
58361
|
+
flush: function flush() {
|
|
58362
|
+
cache.registered = {};
|
|
58363
|
+
cache.inserted = {};
|
|
58364
|
+
cache.sheet.flush();
|
|
58365
|
+
},
|
|
58366
|
+
// $FlowFixMe
|
|
58367
|
+
sheet: cache.sheet,
|
|
58368
|
+
cache: cache,
|
|
58369
|
+
getRegisteredStyles: getRegisteredStyles.bind(null, cache.registered),
|
|
58370
|
+
merge: merge.bind(null, cache.registered, css)
|
|
58371
|
+
};
|
|
58372
|
+
};
|
|
58373
|
+
|
|
58374
|
+
var classnames$1 = function classnames(args) {
|
|
58375
|
+
var cls = '';
|
|
58376
|
+
|
|
58377
|
+
for (var i = 0; i < args.length; i++) {
|
|
58378
|
+
var arg = args[i];
|
|
58379
|
+
if (arg == null) continue;
|
|
58380
|
+
var toAdd = void 0;
|
|
58381
|
+
|
|
58382
|
+
switch (typeof arg) {
|
|
58383
|
+
case 'boolean':
|
|
58384
|
+
break;
|
|
58385
|
+
|
|
58386
|
+
case 'object':
|
|
58387
|
+
{
|
|
58388
|
+
if (Array.isArray(arg)) {
|
|
58389
|
+
toAdd = classnames(arg);
|
|
58390
|
+
} else {
|
|
58391
|
+
toAdd = '';
|
|
58392
|
+
|
|
58393
|
+
for (var k in arg) {
|
|
58394
|
+
if (arg[k] && k) {
|
|
58395
|
+
toAdd && (toAdd += ' ');
|
|
58396
|
+
toAdd += k;
|
|
58397
|
+
}
|
|
58398
|
+
}
|
|
58399
|
+
}
|
|
58400
|
+
|
|
58401
|
+
break;
|
|
58402
|
+
}
|
|
58403
|
+
|
|
58404
|
+
default:
|
|
58405
|
+
{
|
|
58406
|
+
toAdd = arg;
|
|
58407
|
+
}
|
|
58408
|
+
}
|
|
58409
|
+
|
|
58410
|
+
if (toAdd) {
|
|
58411
|
+
cls && (cls += ' ');
|
|
58412
|
+
cls += toAdd;
|
|
58413
|
+
}
|
|
58414
|
+
}
|
|
58415
|
+
|
|
58416
|
+
return cls;
|
|
58417
|
+
};
|
|
58418
|
+
|
|
58419
|
+
var _createEmotion = createEmotion(),
|
|
58420
|
+
css = _createEmotion.css;
|
|
58421
|
+
|
|
58422
|
+
/**
|
|
58423
|
+
* These modes are ONLY intended to be internally used within the context of
|
|
58424
|
+
* editing an experience inside of Contentful Studio. i.e. these modes
|
|
58425
|
+
* intentionally do not include preview/delivery modes.
|
|
58426
|
+
*/
|
|
58427
|
+
var StudioCanvasMode;
|
|
58428
|
+
(function (StudioCanvasMode) {
|
|
58429
|
+
StudioCanvasMode["READ_ONLY"] = "readOnlyMode";
|
|
58430
|
+
StudioCanvasMode["EDITOR"] = "editorMode";
|
|
58431
|
+
StudioCanvasMode["NONE"] = "none";
|
|
58432
|
+
})(StudioCanvasMode || (StudioCanvasMode = {}));
|
|
58433
|
+
var PostMessageMethods;
|
|
58434
|
+
(function (PostMessageMethods) {
|
|
58435
|
+
PostMessageMethods["REQUEST_ENTITIES"] = "REQUEST_ENTITIES";
|
|
58436
|
+
PostMessageMethods["REQUESTED_ENTITIES"] = "REQUESTED_ENTITIES";
|
|
58437
|
+
})(PostMessageMethods || (PostMessageMethods = {}));
|
|
58438
|
+
|
|
58439
|
+
var css_248z$6 = ".cf-heading {\n white-space: pre-line;\n}\n";
|
|
58440
|
+
styleInject(css_248z$6);
|
|
58441
|
+
|
|
58442
|
+
var css_248z$5 = ".cf-richtext {\n white-space: pre-line;\n}\n\n.cf-richtext > *:first-child {\n margin-top: 0;\n}\n\n.cf-richtext > *:last-child {\n margin-bottom: 0;\n}\n";
|
|
58443
|
+
styleInject(css_248z$5);
|
|
58444
|
+
|
|
58445
|
+
var css_248z$4 = ".cf-text {\n white-space: pre-line;\n}\n";
|
|
58446
|
+
styleInject(css_248z$4);
|
|
58447
|
+
|
|
58448
|
+
var css_248z$3 = "@import url(https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,400;0,500;0,600;1,400;1,600&display=swap);\n\n:root {\n /* All sizing comments based of 16px base body font size */\n\n /* color */\n --cf-color-white: #fff;\n --cf-color-black: #000;\n --cf-color-gray100: #f7f9fa;\n --cf-color-gray400: #aec1cc;\n --cf-color-gray400-rgb: 174, 193, 204;\n\n /* spacing */\n --cf-spacing-0: 0rem; /* 0px */\n --cf-spacing-1: 0.125rem; /* 2px */\n --cf-spacing-2: 0.25rem; /* 4px */\n --cf-spacing-3: 0.375rem; /* 6px */\n --cf-spacing-4: 0.5rem; /* 8px */\n --cf-spacing-5: 0.625rem; /* 10px */\n --cf-spacing-6: 0.75rem; /* 12px */\n --cf-spacing-7: 0.875rem; /* 14px */\n --cf-spacing-8: 1rem; /* 16px */\n --cf-spacing-9: 1.25rem; /* 20px */\n --cf-spacing-10: 1.5rem; /* 24px */\n --cf-spacing-11: 1.75rem; /* 28px */\n --cf-spacing-12: 2rem; /* 32px */\n --cf-spacing-13: 2.25rem; /* 36px */\n\n /* font-size */\n --cf-text-xs: 0.75rem; /* 12px */\n --cf-text-sm: 0.875rem; /* 14px */\n --cf-text-base: 1rem; /* 16px */\n --cf-text-lg: 1.125rem; /* 18px */\n --cf-text-xl: 1.25rem; /* 20px */\n --cf-text-2xl: 1.5rem; /* 24px */\n --cf-text-3xl: 2rem; /* 32px */\n --cf-text-4xl: 2.75rem; /* 44px */\n\n /* font-weight */\n --cf-font-light: 300;\n --cf-font-normal: 400;\n --cf-font-medium: 500;\n --cf-font-semibold: 600;\n --cf-font-bold: 700;\n --cf-font-extra-bold: 800;\n --cf-font-black: 900;\n\n /* border-radius */\n --cf-border-radius-none: 0px; /* none */\n --cf-border-radius-sm: 0.125rem; /* 2px */\n --cf-border-radius: 0.25rem; /* 4px */\n --cf-border-radius-md: 0.375rem; /* 6px */\n --cf-border-radius-lg: 0.5rem; /* 8px */\n --cf-border-radius-xl: 0.75rem; /* 12px */\n --cf-border-radius-2xl: 1rem; /* 16px */\n --cf-border-radius-3xl: 1.5rem; /* 24px */\n --cf-border-radius-full: 9999px; /* full */\n\n /* font-family */\n --cf-font-family-sans: Archivo, Helvetica, Arial, sans-serif;\n --cf-font-family-serif: Georgia, Cambria, Times New Roman, Times, serif;\n\n /* max widths */\n --cf-max-width-full: 100%;\n\n /* component specific colors */\n --cf-button-bg: var(--cf-color-black);\n --cf-button-color: var(--cf-color-white);\n --cf-text-color: var(--cf-color-black);\n}\n\nimg.cf-placeholder-image {\n background-color: var(--cf-color-gray100);\n outline-offset: -2px;\n outline: 2px solid rgba(var(--cf-color-gray400-rgb), 0.5);\n}\n\nsvg.cf-placeholder-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n height: var(--cf-text-3xl);\n width: var(--cf-text-3xl);\n max-height: 100%;\n max-width: 100%;\n}\n\nsvg.cf-placeholder-icon path {\n fill: var(--cf-color-gray400);\n}\n";
|
|
58449
|
+
styleInject(css_248z$3);
|
|
58450
|
+
|
|
58451
|
+
var css_248z$2$1 = ".contentful-container {\n position: relative;\n display: flex;\n box-sizing: border-box;\n pointer-events: all;\n}\n\n.contentful-container::-webkit-scrollbar {\n display: none; /* Safari and Chrome */\n}\n\n.cf-single-column-wrapper {\n position: relative;\n}\n\n.cf-container-wrapper {\n position: relative;\n width: 100%;\n}\n\n.contentful-container:after {\n content: '';\n display: block;\n position: absolute;\n pointer-events: none;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n overflow-x: clip;\n font-family: var(--exp-builder-font-stack-primary);\n font-size: 12px;\n color: var(--exp-builder-gray400);\n z-index: 1;\n}\n\n.contentful-section-label:after {\n content: 'Section';\n}\n\n.contentful-container-label:after {\n content: 'Container';\n}\n\n/* used by ContentfulSectionAsHyperlink.tsx */\n\n.contentful-container-link,\n.contentful-container-link:active,\n.contentful-container-link:visited,\n.contentful-container-link:hover,\n.contentful-container-link:read-write,\n.contentful-container-link:focus-visible {\n color: inherit;\n text-decoration: unset;\n outline: unset;\n}\n";
|
|
58452
|
+
styleInject(css_248z$2$1);
|
|
58453
|
+
|
|
58454
|
+
const Flex = reactExports.forwardRef(({ id, children, onMouseEnter, onMouseUp, onMouseLeave, onMouseDown, onClick, flex, flexBasis, flexShrink, flexDirection, gap, justifyContent, justifyItems, justifySelf, alignItems, alignSelf, alignContent, order, flexWrap, flexGrow, className, cssStyles, ...props }, ref) => {
|
|
58455
|
+
return (React.createElement("div", { id: id, ref: ref, style: {
|
|
58456
|
+
display: 'flex',
|
|
58457
|
+
flex,
|
|
58458
|
+
flexBasis,
|
|
58459
|
+
flexShrink,
|
|
58460
|
+
flexDirection,
|
|
58461
|
+
gap,
|
|
58462
|
+
justifyContent,
|
|
58463
|
+
justifyItems,
|
|
58464
|
+
justifySelf,
|
|
58465
|
+
alignItems,
|
|
58466
|
+
alignSelf,
|
|
58467
|
+
alignContent,
|
|
58468
|
+
order,
|
|
58469
|
+
flexWrap,
|
|
58470
|
+
flexGrow,
|
|
58471
|
+
...cssStyles,
|
|
58472
|
+
}, className: className, onMouseEnter: onMouseEnter, onMouseUp: onMouseUp, onMouseDown: onMouseDown, onMouseLeave: onMouseLeave, onClick: onClick, ...props }, children));
|
|
58473
|
+
});
|
|
58474
|
+
Flex.displayName = 'Flex';
|
|
58475
|
+
|
|
58476
|
+
var css_248z$1$1 = ".cf-divider {\n position: relative;\n width: 100%;\n height: 100%;\n border: none;\n}\n\n.cf-divider::before {\n content: \"\";\n position: absolute;\n top: -5px;\n left: -5px;\n bottom: -5px;\n right: -5px;\n pointer-events: all;\n}\n";
|
|
58477
|
+
styleInject(css_248z$1$1);
|
|
58478
|
+
|
|
58479
|
+
({
|
|
58480
|
+
hr: css({
|
|
58481
|
+
border: 'none',
|
|
58482
|
+
}),
|
|
58483
|
+
});
|
|
58484
|
+
|
|
58485
|
+
var css_248z$7 = ".cf-columns {\n display: flex;\n gap: 24px;\n grid-template-columns: repeat(12, 1fr);\n flex-direction: column;\n min-height: 0; /* NEW */\n min-width: 0; /* NEW; needed for Firefox */\n}\n\n@media (min-width: 768px) {\n .cf-columns {\n display: grid;\n }\n}\n\n.cf-single-column-wrapper {\n position: relative;\n display: flex;\n}\n\n.cf-single-column {\n pointer-events: all;\n}\n\n.cf-single-column-wrapper:after {\n content: '';\n display: block;\n position: absolute;\n pointer-events: none;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n overflow-x: clip;\n font-family: var(--exp-builder-font-stack-primary);\n font-size: 12px;\n color: var(--exp-builder-gray400);\n z-index: 1;\n}\n\n.cf-single-column-label:after {\n content: 'Column';\n}\n";
|
|
58486
|
+
styleInject(css_248z$7);
|
|
58487
|
+
|
|
58488
|
+
const ColumnWrapper = reactExports.forwardRef((props, ref) => {
|
|
58489
|
+
return (React.createElement("div", { ref: ref, ...props, style: {
|
|
58490
|
+
...(props.style || {}),
|
|
58491
|
+
display: 'grid',
|
|
58492
|
+
gridTemplateColumns: 'repeat(12, [col-start] 1fr)',
|
|
58493
|
+
} }, props.children));
|
|
58494
|
+
});
|
|
58495
|
+
ColumnWrapper.displayName = 'ColumnWrapper';
|
|
58496
|
+
|
|
58497
|
+
const assemblyStyle = { display: 'contents' };
|
|
58498
|
+
// Feel free to do any magic as regards variable definitions for assemblies
|
|
58499
|
+
// Or if this isn't necessary by the time we figure that part out, we can bid this part farewell
|
|
58500
|
+
const Assembly = (props) => {
|
|
58501
|
+
if (props.editorMode) {
|
|
58502
|
+
const { node, dragProps, ...editorModeProps } = props;
|
|
58503
|
+
return props.renderDropzone(node, {
|
|
58504
|
+
...editorModeProps,
|
|
58505
|
+
['data-test-id']: 'contentful-assembly',
|
|
58506
|
+
className: props.className,
|
|
58507
|
+
dragProps,
|
|
58508
|
+
});
|
|
58509
|
+
}
|
|
58510
|
+
// Using a display contents so assembly content/children
|
|
58511
|
+
// can appear as if they are direct children of the div wrapper's parent
|
|
58512
|
+
return React.createElement("div", { "data-test-id": "assembly", ...props, style: assemblyStyle });
|
|
58513
|
+
};
|
|
58514
|
+
|
|
58515
|
+
const useEntityStore = create$1((set) => ({
|
|
58516
|
+
entityStore: new EditorModeEntityStore({ locale: 'en-US', entities: [] }),
|
|
58517
|
+
areEntitiesFetched: false,
|
|
58518
|
+
setEntitiesFetched(fetched) {
|
|
58519
|
+
set({ areEntitiesFetched: fetched });
|
|
58520
|
+
},
|
|
58521
|
+
resetEntityStore(locale, entities = []) {
|
|
58522
|
+
console.debug(`[experiences-sdk-react] Resetting entity store because the locale changed to '${locale}'.`);
|
|
58523
|
+
const newEntityStore = new EditorModeEntityStore({ locale, entities });
|
|
58524
|
+
set({
|
|
58525
|
+
entityStore: newEntityStore,
|
|
58526
|
+
areEntitiesFetched: false,
|
|
58527
|
+
});
|
|
58528
|
+
return newEntityStore;
|
|
58529
|
+
},
|
|
58530
|
+
}));
|
|
58531
|
+
|
|
58532
|
+
class DragState {
|
|
58533
|
+
constructor() {
|
|
58534
|
+
this.isDragStartedOnParent = false;
|
|
58535
|
+
this.isDraggingItem = false;
|
|
58536
|
+
}
|
|
58537
|
+
get isDragging() {
|
|
58538
|
+
return this.isDraggingItem;
|
|
58539
|
+
}
|
|
58540
|
+
get isDraggingOnParent() {
|
|
58541
|
+
return this.isDragStartedOnParent;
|
|
58542
|
+
}
|
|
58543
|
+
updateIsDragging(isDraggingItem) {
|
|
58544
|
+
this.isDraggingItem = isDraggingItem;
|
|
58545
|
+
}
|
|
58546
|
+
updateIsDragStartedOnParent(isDragStartedOnParent) {
|
|
58547
|
+
this.isDragStartedOnParent = isDragStartedOnParent;
|
|
58548
|
+
}
|
|
58549
|
+
resetState() {
|
|
58550
|
+
this.isDraggingItem = false;
|
|
58551
|
+
this.isDragStartedOnParent = false;
|
|
58552
|
+
}
|
|
58553
|
+
}
|
|
58554
|
+
|
|
58555
|
+
class SimulateDnD extends DragState {
|
|
58556
|
+
constructor() {
|
|
58557
|
+
super();
|
|
58558
|
+
this.draggingElement = null;
|
|
58559
|
+
}
|
|
58560
|
+
setupDrag() {
|
|
58561
|
+
this.updateIsDragStartedOnParent(true);
|
|
58562
|
+
}
|
|
58563
|
+
startDrag(coordX, coordY) {
|
|
58564
|
+
this.draggingElement = document.getElementById(NEW_COMPONENT_ID);
|
|
58565
|
+
this.updateIsDragging(true);
|
|
58566
|
+
this.simulateMouseEvent(coordX, coordY, 'mousedown');
|
|
58567
|
+
}
|
|
58568
|
+
updateDrag(coordX, coordY) {
|
|
58569
|
+
if (!this.draggingElement) {
|
|
58570
|
+
this.draggingElement = document.querySelector(`[${CTFL_DRAGGING_ELEMENT}]`);
|
|
58571
|
+
}
|
|
58572
|
+
this.simulateMouseEvent(coordX, coordY);
|
|
58573
|
+
}
|
|
58574
|
+
endDrag(coordX, coordY) {
|
|
58575
|
+
this.simulateMouseEvent(coordX, coordY, 'mouseup');
|
|
58576
|
+
this.reset();
|
|
58577
|
+
}
|
|
58578
|
+
reset() {
|
|
58579
|
+
this.draggingElement = null;
|
|
58580
|
+
this.resetState();
|
|
58581
|
+
}
|
|
58582
|
+
simulateMouseEvent(coordX, coordY, eventName = 'mousemove') {
|
|
58583
|
+
if (!this.draggingElement) {
|
|
58584
|
+
return;
|
|
58585
|
+
}
|
|
58586
|
+
const options = {
|
|
58587
|
+
bubbles: true,
|
|
58588
|
+
cancelable: true,
|
|
58589
|
+
view: window,
|
|
58590
|
+
pageX: 0,
|
|
58591
|
+
pageY: 0,
|
|
58592
|
+
clientX: coordX,
|
|
58593
|
+
clientY: coordY,
|
|
58594
|
+
};
|
|
58595
|
+
const event = new MouseEvent(eventName, options);
|
|
58596
|
+
this.draggingElement.dispatchEvent(event);
|
|
58597
|
+
}
|
|
58598
|
+
}
|
|
58599
|
+
var SimulateDnD$1 = new SimulateDnD();
|
|
58600
|
+
|
|
58601
|
+
function useEditorSubscriber() {
|
|
56929
58602
|
const entityStore = useEntityStore((state) => state.entityStore);
|
|
56930
58603
|
const areEntitiesFetched = useEntityStore((state) => state.areEntitiesFetched);
|
|
56931
58604
|
const setEntitiesFetched = useEntityStore((state) => state.setEntitiesFetched);
|
|
@@ -57760,18 +59433,29 @@ const useComponentProps = ({ node, areEntitiesFetched, resolveDesignValue, rende
|
|
|
57760
59433
|
renderDropzone,
|
|
57761
59434
|
]);
|
|
57762
59435
|
const cfStyles = reactExports.useMemo(() => buildCfStyles(props), [props]);
|
|
57763
|
-
const sizeStyles = {
|
|
57764
|
-
width: cfStyles.width,
|
|
57765
|
-
maxWidth: cfStyles.maxWidth,
|
|
57766
|
-
maxHeight: cfStyles.maxHeight,
|
|
57767
|
-
};
|
|
57768
59436
|
const isAssemblyBlock = node.type === 'assemblyBlock';
|
|
57769
59437
|
const isSingleColumn = node?.data.blockId === CONTENTFUL_COMPONENTS.columns.id;
|
|
57770
59438
|
const isStructureComponent = isContentfulStructureComponent(node?.data.blockId);
|
|
59439
|
+
// Move size styles to the wrapping div and override the component styles
|
|
59440
|
+
const overrideStyles = {};
|
|
59441
|
+
const wrapperStyles = {
|
|
59442
|
+
width: cfStyles.width,
|
|
59443
|
+
maxWidth: cfStyles.maxWidth,
|
|
59444
|
+
};
|
|
59445
|
+
if (!isStructureComponent) {
|
|
59446
|
+
if (cfStyles.height) {
|
|
59447
|
+
wrapperStyles.height = cfStyles.height;
|
|
59448
|
+
overrideStyles.height = '100%';
|
|
59449
|
+
}
|
|
59450
|
+
if (cfStyles.width) {
|
|
59451
|
+
overrideStyles.width = '100%';
|
|
59452
|
+
}
|
|
59453
|
+
}
|
|
57771
59454
|
// Styles that will be applied to the component element
|
|
57772
59455
|
const componentClass = useEditorModeClassName({
|
|
57773
59456
|
styles: {
|
|
57774
59457
|
...cfStyles,
|
|
59458
|
+
...overrideStyles,
|
|
57775
59459
|
...(isEmptyZone &&
|
|
57776
59460
|
isStructureWithRelativeHeight(node?.data.blockId, cfStyles.height) && {
|
|
57777
59461
|
minHeight: EMPTY_CONTAINER_HEIGHT,
|
|
@@ -57785,9 +59469,6 @@ const useComponentProps = ({ node, areEntitiesFetched, resolveDesignValue, rende
|
|
|
57785
59469
|
},
|
|
57786
59470
|
nodeId: node.data.id,
|
|
57787
59471
|
});
|
|
57788
|
-
//List explicit style props that will end up being passed to the component
|
|
57789
|
-
const stylesToKeep = ['cfImageAsset'];
|
|
57790
|
-
const stylesToRemove = CF_STYLE_ATTRIBUTES.filter((style) => !stylesToKeep.includes(style));
|
|
57791
59472
|
const componentProps = {
|
|
57792
59473
|
'data-cf-node-id': node.data.id,
|
|
57793
59474
|
'data-cf-node-block-id': node.data.blockId,
|
|
@@ -57796,10 +59477,10 @@ const useComponentProps = ({ node, areEntitiesFetched, resolveDesignValue, rende
|
|
|
57796
59477
|
editorMode: true,
|
|
57797
59478
|
node,
|
|
57798
59479
|
renderDropzone,
|
|
57799
|
-
...
|
|
59480
|
+
...sanitizeNodeProps(props),
|
|
57800
59481
|
...(definition?.children ? { children: renderDropzone(node) } : {}),
|
|
57801
59482
|
};
|
|
57802
|
-
return { componentProps,
|
|
59483
|
+
return { componentProps, wrapperStyles };
|
|
57803
59484
|
};
|
|
57804
59485
|
const addExtraDropzonePadding = (padding) => padding
|
|
57805
59486
|
.split(' ')
|
|
@@ -57979,7 +59660,7 @@ const useComponent = ({ node: rawNode, resolveDesignValue, renderDropzone, userI
|
|
|
57979
59660
|
return registration;
|
|
57980
59661
|
}, [node]);
|
|
57981
59662
|
const componentId = node.data.id;
|
|
57982
|
-
const { componentProps,
|
|
59663
|
+
const { componentProps, wrapperStyles } = useComponentProps({
|
|
57983
59664
|
node,
|
|
57984
59665
|
areEntitiesFetched,
|
|
57985
59666
|
resolveDesignValue,
|
|
@@ -58005,7 +59686,7 @@ const useComponent = ({ node: rawNode, resolveDesignValue, renderDropzone, userI
|
|
|
58005
59686
|
return element;
|
|
58006
59687
|
}
|
|
58007
59688
|
const { children, innerRef, Tag = 'div', ToolTipAndPlaceholder, style, ...rest } = dragProps;
|
|
58008
|
-
return (React.createElement(Tag, { ...rest, style: { ...style, ...
|
|
59689
|
+
return (React.createElement(Tag, { ...rest, style: { ...style, ...wrapperStyles }, ref: (refNode) => {
|
|
58009
59690
|
if (innerRef && refNode)
|
|
58010
59691
|
innerRef(refNode);
|
|
58011
59692
|
} },
|