@makeswift/runtime 0.0.2 → 0.0.5
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/dist/components.cjs.js +1 -0
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +1 -0
- package/dist/components.es.js.map +1 -1
- package/dist/descriptors.cjs.js.map +1 -1
- package/dist/descriptors.es.js.map +1 -1
- package/dist/index.cjs.js +382 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +389 -22
- package/dist/index.es.js.map +1 -1
- package/dist/next.cjs.js +1 -0
- package/dist/next.cjs.js.map +1 -1
- package/dist/next.es.js +1 -0
- package/dist/next.es.js.map +1 -1
- package/dist/react.cjs.js +1 -0
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.es.js +1 -0
- package/dist/react.es.js.map +1 -1
- package/dist/types/components/builtin/Navigation/Navigation.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/components/DropDownButton/index.d.ts +1 -1
- package/dist/types/components/builtin/Navigation/components/DropDownButton/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts +1 -1
- package/dist/types/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Text/components/RichTextEditor/components/Block/index.d.ts +2 -13
- package/dist/types/components/builtin/Text/components/RichTextEditor/components/Block/index.d.ts.map +1 -1
- package/dist/types/prop-controllers/descriptors.d.ts +1 -1
- package/dist/types/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/runtimes/react/controls/style.d.ts.map +1 -1
- package/dist/types/runtimes/react/find-dom-node.d.ts +7 -0
- package/dist/types/runtimes/react/find-dom-node.d.ts.map +1 -0
- package/dist/types/runtimes/react/index.d.ts.map +1 -1
- package/package.json +7 -8
package/dist/index.es.js
CHANGED
|
@@ -33,15 +33,16 @@ var __publicField = (obj, key, value) => {
|
|
|
33
33
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
34
34
|
return value;
|
|
35
35
|
};
|
|
36
|
+
var _ea;
|
|
36
37
|
import * as React from "react";
|
|
37
|
-
import { forwardRef, createContext, useContext, useMemo, useState, useLayoutEffect, useCallback, useEffect, useRef, useImperativeHandle, Children, createElement, Fragment as Fragment$1, memo } from "react";
|
|
38
|
+
import { forwardRef, createContext, useContext, useMemo, useState, useLayoutEffect, useCallback, useEffect, useRef, useImperativeHandle, Children, createElement, Fragment as Fragment$1, Component, memo } from "react";
|
|
38
39
|
import { useSyncExternalStoreWithSelector } from "use-sync-external-store/shim/with-selector";
|
|
39
40
|
import { gql, useQuery as useQuery$1, useMutation as useMutation$1, ApolloClient, InMemoryCache } from "@apollo/client";
|
|
40
41
|
import { a as createDocumentReference, g as getComponentPropControllerDescriptors, b as getIsInBuilder, d as configureStore, e as getElementId, f as getReactComponent, h as getDocument, i as isElementReference, c as createDocument } from "./react-page.es.js";
|
|
41
42
|
import { f as registerComponentHandleEffect, g as mountComponentEffect, h as registerComponentEffect, j as registerReactComponentEffect, k as registerDocumentEffect } from "./actions.es.js";
|
|
42
43
|
import styled, { css, keyframes, createGlobalStyle } from "styled-components";
|
|
43
44
|
import { useReducedMotion, useAnimation, motion } from "framer-motion";
|
|
44
|
-
import { cx, css as css$1 } from "@emotion/css";
|
|
45
|
+
import { cx, css as css$1, cache } from "@emotion/css";
|
|
45
46
|
import { getDataFromTree } from "@apollo/client/react/ssr";
|
|
46
47
|
import { KeyUtils, Value } from "slate";
|
|
47
48
|
import uuid from "uuid/v4";
|
|
@@ -64,6 +65,7 @@ import ipsum from "corporate-ipsum";
|
|
|
64
65
|
import { Editor } from "slate-react";
|
|
65
66
|
import Lists from "@convertkit/slate-lists";
|
|
66
67
|
import { a as StyleControlProperty, S as StyleControlType } from "./style.es.js";
|
|
68
|
+
import { findDOMNode } from "react-dom";
|
|
67
69
|
const PlaceholderBase$1 = styled.div`
|
|
68
70
|
width: 100%;
|
|
69
71
|
background: rgba(161, 168, 194, 0.18);
|
|
@@ -291,14 +293,14 @@ function createApolloClient({
|
|
|
291
293
|
uri,
|
|
292
294
|
cacheData
|
|
293
295
|
}) {
|
|
294
|
-
const
|
|
296
|
+
const cache2 = new InMemoryCache({
|
|
295
297
|
typePolicies
|
|
296
298
|
});
|
|
297
299
|
if (cacheData)
|
|
298
|
-
|
|
300
|
+
cache2.restore(cacheData);
|
|
299
301
|
return new ApolloClient({
|
|
300
302
|
uri,
|
|
301
|
-
cache
|
|
303
|
+
cache: cache2
|
|
302
304
|
});
|
|
303
305
|
}
|
|
304
306
|
class MakeswiftClient {
|
|
@@ -1923,7 +1925,7 @@ function responsiveStyle(responsiveValues, join$1, strategy) {
|
|
|
1923
1925
|
}
|
|
1924
1926
|
function responsiveWidth(widthData, defaultValue = "100%") {
|
|
1925
1927
|
return __spreadValues({
|
|
1926
|
-
|
|
1928
|
+
maxWidth: "100%"
|
|
1927
1929
|
}, responsiveStyle([widthData], ([width = defaultValue]) => ({
|
|
1928
1930
|
width: typeof width === "object" ? `${width.value}${width.unit}` : width
|
|
1929
1931
|
})));
|
|
@@ -5628,11 +5630,15 @@ function DropDownButton(_U) {
|
|
|
5628
5630
|
var _V = _U, {
|
|
5629
5631
|
label,
|
|
5630
5632
|
caret = "caret",
|
|
5631
|
-
links: links2 = []
|
|
5633
|
+
links: links2 = [],
|
|
5634
|
+
textColor,
|
|
5635
|
+
color
|
|
5632
5636
|
} = _V, restOfProps = __objRest(_V, [
|
|
5633
5637
|
"label",
|
|
5634
5638
|
"caret",
|
|
5635
|
-
"links"
|
|
5639
|
+
"links",
|
|
5640
|
+
"textColor",
|
|
5641
|
+
"color"
|
|
5636
5642
|
]);
|
|
5637
5643
|
const container = useRef(null);
|
|
5638
5644
|
const [position, setPosition] = useState("left");
|
|
@@ -5646,6 +5652,8 @@ function DropDownButton(_U) {
|
|
|
5646
5652
|
return /* @__PURE__ */ jsxs(DropDownContainer, {
|
|
5647
5653
|
ref: container,
|
|
5648
5654
|
children: [/* @__PURE__ */ jsx(Button$1, __spreadProps(__spreadValues({}, restOfProps), {
|
|
5655
|
+
textColor: useColor(textColor),
|
|
5656
|
+
color: useColor(color),
|
|
5649
5657
|
children: /* @__PURE__ */ jsxs("div", {
|
|
5650
5658
|
style: {
|
|
5651
5659
|
display: "flex",
|
|
@@ -5735,16 +5743,22 @@ function MobileDropDownButton(_Y) {
|
|
|
5735
5743
|
caret,
|
|
5736
5744
|
links: links2 = [],
|
|
5737
5745
|
onClose = () => {
|
|
5738
|
-
}
|
|
5746
|
+
},
|
|
5747
|
+
color,
|
|
5748
|
+
textColor
|
|
5739
5749
|
} = _Z, restOfProps = __objRest(_Z, [
|
|
5740
5750
|
"label",
|
|
5741
5751
|
"caret",
|
|
5742
5752
|
"links",
|
|
5743
|
-
"onClose"
|
|
5753
|
+
"onClose",
|
|
5754
|
+
"color",
|
|
5755
|
+
"textColor"
|
|
5744
5756
|
]);
|
|
5745
5757
|
const [isOpen, setIsOpen] = useState(false);
|
|
5746
5758
|
return /* @__PURE__ */ jsxs(Fragment, {
|
|
5747
5759
|
children: [/* @__PURE__ */ jsx(ButtonLink$1, __spreadProps(__spreadValues({}, restOfProps), {
|
|
5760
|
+
textColor: useColor(textColor),
|
|
5761
|
+
color: useColor(color),
|
|
5748
5762
|
onPointerDown: () => setIsOpen((prev) => !prev),
|
|
5749
5763
|
children: /* @__PURE__ */ jsxs("div", {
|
|
5750
5764
|
style: {
|
|
@@ -5778,7 +5792,20 @@ function MobileDropDownButton(_Y) {
|
|
|
5778
5792
|
})]
|
|
5779
5793
|
});
|
|
5780
5794
|
}
|
|
5781
|
-
|
|
5795
|
+
function NavigationButton$1(props) {
|
|
5796
|
+
const _a = props, {
|
|
5797
|
+
textColor,
|
|
5798
|
+
color
|
|
5799
|
+
} = _a, restOfProps = __objRest(_a, [
|
|
5800
|
+
"textColor",
|
|
5801
|
+
"color"
|
|
5802
|
+
]);
|
|
5803
|
+
return /* @__PURE__ */ jsx(Button$1, __spreadProps(__spreadValues({}, restOfProps), {
|
|
5804
|
+
textColor: useColor(textColor),
|
|
5805
|
+
color: useColor(color)
|
|
5806
|
+
}));
|
|
5807
|
+
}
|
|
5808
|
+
const ButtonLink = styled(NavigationButton$1)`
|
|
5782
5809
|
margin: 8px 0;
|
|
5783
5810
|
`;
|
|
5784
5811
|
const Container$3 = styled.div`
|
|
@@ -5891,6 +5918,19 @@ const OpenIconContainer = styled.button`
|
|
|
5891
5918
|
color: ${color == null ? "rgba(161, 168, 194, 0.5)" : colorToString(color)};
|
|
5892
5919
|
`)}
|
|
5893
5920
|
`;
|
|
5921
|
+
function NavigationButton(props) {
|
|
5922
|
+
const _a = props, {
|
|
5923
|
+
textColor,
|
|
5924
|
+
color
|
|
5925
|
+
} = _a, restOfProps = __objRest(_a, [
|
|
5926
|
+
"textColor",
|
|
5927
|
+
"color"
|
|
5928
|
+
]);
|
|
5929
|
+
return /* @__PURE__ */ jsx(Button$1, __spreadProps(__spreadValues({}, restOfProps), {
|
|
5930
|
+
textColor: useColor(textColor),
|
|
5931
|
+
color: useColor(color)
|
|
5932
|
+
}));
|
|
5933
|
+
}
|
|
5894
5934
|
const placeholder = {
|
|
5895
5935
|
src: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='93.12' height='36' viewBox='0 0 93.12 36'%3E%3Cg id='Layer_2' data-name='Layer 2'%3E%3Cg id='Layer_1-2' data-name='Layer 1'%3E%3Cpath d='M18,0A18,18,0,1,1,0,18,18,18,0,0,1,18,0ZM49.36,21.94h6.36V24H46.8V10h2.56Zm9.06.72a4.88,4.88,0,0,1-1.64-3.72,5,5,0,0,1,1.64-3.74,5.57,5.57,0,0,1,7.7,0,5.09,5.09,0,0,1,.26,7.18l-.26.26a5.56,5.56,0,0,1-7.7,0Zm1.68-6a3.39,3.39,0,0,0,0,4.52,3,3,0,0,0,4.24.08l.08-.08a3.39,3.39,0,0,0,0-4.52,3,3,0,0,0-4.24-.08Zm10,10.68,1-1.92a5.28,5.28,0,0,0,3.3,1.22,3.6,3.6,0,0,0,2.32-.72,2.73,2.73,0,0,0,.9-2.26V22.5a3.61,3.61,0,0,1-1.45,1.26,4.35,4.35,0,0,1-2,.46,4.57,4.57,0,0,1-3.58-1.54A5.48,5.48,0,0,1,69.2,18.9a5.42,5.42,0,0,1,1.36-3.74,4.64,4.64,0,0,1,3.62-1.5,4,4,0,0,1,3.44,1.72v-1.5h2.46v9a6.13,6.13,0,0,1-1.43,4.46,5.27,5.27,0,0,1-4,1.44,7.09,7.09,0,0,1-4.53-1.42Zm1.54-8.44a3.4,3.4,0,0,0,.82,2.3,2.72,2.72,0,0,0,2.17.94,3.13,3.13,0,0,0,1.21-.22,2.89,2.89,0,0,0,1-.62,3.08,3.08,0,0,0,.63-1,3.62,3.62,0,0,0,.21-1.3,4,4,0,0,0-.23-1.33,3.3,3.3,0,0,0-.63-1.05,2.74,2.74,0,0,0-1-.68,3.35,3.35,0,0,0-1.25-.24,2.92,2.92,0,0,0-1.2.24,2.58,2.58,0,0,0-.93.67,3,3,0,0,0-.59,1,3.89,3.89,0,0,0-.19,1.31ZM83.8,22.66a4.88,4.88,0,0,1-1.64-3.72A5,5,0,0,1,83.8,15.2a5.57,5.57,0,0,1,7.7,0,5.09,5.09,0,0,1,.26,7.18,3.19,3.19,0,0,1-.26.26,5.56,5.56,0,0,1-7.7,0Zm1.68-6a3.39,3.39,0,0,0,0,4.52,3,3,0,0,0,4.24.08l.08-.08a3.39,3.39,0,0,0,0-4.52,3,3,0,0,0-4.24-.08Z' fill='%23a1a8c2' opacity='0.4' style='isolation: isolate'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A",
|
|
5896
5936
|
dimensions: {
|
|
@@ -5942,7 +5982,7 @@ const Navigation = forwardRef(function Navigation2({
|
|
|
5942
5982
|
gutter,
|
|
5943
5983
|
first: i === 0,
|
|
5944
5984
|
last: i === links2.length - 1,
|
|
5945
|
-
children: [link.type === "button" && /* @__PURE__ */ jsx(
|
|
5985
|
+
children: [link.type === "button" && /* @__PURE__ */ jsx(NavigationButton, __spreadProps(__spreadValues({}, link.payload), {
|
|
5946
5986
|
children: link.payload.label
|
|
5947
5987
|
})), link.type === "dropdown" && /* @__PURE__ */ jsx(DropDownButton, __spreadValues({}, link.payload))]
|
|
5948
5988
|
}, link.id)) : /* @__PURE__ */ jsx(LinksPlaceholder, {
|
|
@@ -7772,9 +7812,267 @@ const FallbackComponent = forwardRef(function FallbackComponent2({
|
|
|
7772
7812
|
})]
|
|
7773
7813
|
});
|
|
7774
7814
|
});
|
|
7775
|
-
function
|
|
7815
|
+
function murmur2(str) {
|
|
7816
|
+
var h = 0;
|
|
7817
|
+
var k, i = 0, len = str.length;
|
|
7818
|
+
for (; len >= 4; ++i, len -= 4) {
|
|
7819
|
+
k = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
|
|
7820
|
+
k = (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16);
|
|
7821
|
+
k ^= k >>> 24;
|
|
7822
|
+
h = (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16) ^ (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
|
|
7823
|
+
}
|
|
7824
|
+
switch (len) {
|
|
7825
|
+
case 3:
|
|
7826
|
+
h ^= (str.charCodeAt(i + 2) & 255) << 16;
|
|
7827
|
+
case 2:
|
|
7828
|
+
h ^= (str.charCodeAt(i + 1) & 255) << 8;
|
|
7829
|
+
case 1:
|
|
7830
|
+
h ^= str.charCodeAt(i) & 255;
|
|
7831
|
+
h = (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
|
|
7832
|
+
}
|
|
7833
|
+
h ^= h >>> 13;
|
|
7834
|
+
h = (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
|
|
7835
|
+
return ((h ^ h >>> 15) >>> 0).toString(36);
|
|
7836
|
+
}
|
|
7837
|
+
var unitlessKeys = {
|
|
7838
|
+
animationIterationCount: 1,
|
|
7839
|
+
borderImageOutset: 1,
|
|
7840
|
+
borderImageSlice: 1,
|
|
7841
|
+
borderImageWidth: 1,
|
|
7842
|
+
boxFlex: 1,
|
|
7843
|
+
boxFlexGroup: 1,
|
|
7844
|
+
boxOrdinalGroup: 1,
|
|
7845
|
+
columnCount: 1,
|
|
7846
|
+
columns: 1,
|
|
7847
|
+
flex: 1,
|
|
7848
|
+
flexGrow: 1,
|
|
7849
|
+
flexPositive: 1,
|
|
7850
|
+
flexShrink: 1,
|
|
7851
|
+
flexNegative: 1,
|
|
7852
|
+
flexOrder: 1,
|
|
7853
|
+
gridRow: 1,
|
|
7854
|
+
gridRowEnd: 1,
|
|
7855
|
+
gridRowSpan: 1,
|
|
7856
|
+
gridRowStart: 1,
|
|
7857
|
+
gridColumn: 1,
|
|
7858
|
+
gridColumnEnd: 1,
|
|
7859
|
+
gridColumnSpan: 1,
|
|
7860
|
+
gridColumnStart: 1,
|
|
7861
|
+
msGridRow: 1,
|
|
7862
|
+
msGridRowSpan: 1,
|
|
7863
|
+
msGridColumn: 1,
|
|
7864
|
+
msGridColumnSpan: 1,
|
|
7865
|
+
fontWeight: 1,
|
|
7866
|
+
lineHeight: 1,
|
|
7867
|
+
opacity: 1,
|
|
7868
|
+
order: 1,
|
|
7869
|
+
orphans: 1,
|
|
7870
|
+
tabSize: 1,
|
|
7871
|
+
widows: 1,
|
|
7872
|
+
zIndex: 1,
|
|
7873
|
+
zoom: 1,
|
|
7874
|
+
WebkitLineClamp: 1,
|
|
7875
|
+
fillOpacity: 1,
|
|
7876
|
+
floodOpacity: 1,
|
|
7877
|
+
stopOpacity: 1,
|
|
7878
|
+
strokeDasharray: 1,
|
|
7879
|
+
strokeDashoffset: 1,
|
|
7880
|
+
strokeMiterlimit: 1,
|
|
7881
|
+
strokeOpacity: 1,
|
|
7882
|
+
strokeWidth: 1
|
|
7883
|
+
};
|
|
7884
|
+
function memoize(fn) {
|
|
7885
|
+
var cache2 = /* @__PURE__ */ Object.create(null);
|
|
7886
|
+
return function(arg) {
|
|
7887
|
+
if (cache2[arg] === void 0)
|
|
7888
|
+
cache2[arg] = fn(arg);
|
|
7889
|
+
return cache2[arg];
|
|
7890
|
+
};
|
|
7891
|
+
}
|
|
7892
|
+
var hyphenateRegex = /[A-Z]|^ms/g;
|
|
7893
|
+
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
|
7894
|
+
var isCustomProperty = function isCustomProperty2(property) {
|
|
7895
|
+
return property.charCodeAt(1) === 45;
|
|
7896
|
+
};
|
|
7897
|
+
var isProcessableValue = function isProcessableValue2(value) {
|
|
7898
|
+
return value != null && typeof value !== "boolean";
|
|
7899
|
+
};
|
|
7900
|
+
var processStyleName = /* @__PURE__ */ memoize(function(styleName) {
|
|
7901
|
+
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
|
|
7902
|
+
});
|
|
7903
|
+
var processStyleValue = function processStyleValue2(key, value) {
|
|
7904
|
+
switch (key) {
|
|
7905
|
+
case "animation":
|
|
7906
|
+
case "animationName": {
|
|
7907
|
+
if (typeof value === "string") {
|
|
7908
|
+
return value.replace(animationRegex, function(match, p1, p2) {
|
|
7909
|
+
cursor = {
|
|
7910
|
+
name: p1,
|
|
7911
|
+
styles: p2,
|
|
7912
|
+
next: cursor
|
|
7913
|
+
};
|
|
7914
|
+
return p1;
|
|
7915
|
+
});
|
|
7916
|
+
}
|
|
7917
|
+
}
|
|
7918
|
+
}
|
|
7919
|
+
if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === "number" && value !== 0) {
|
|
7920
|
+
return value + "px";
|
|
7921
|
+
}
|
|
7922
|
+
return value;
|
|
7923
|
+
};
|
|
7924
|
+
function handleInterpolation(mergedProps, registered, interpolation) {
|
|
7925
|
+
if (interpolation == null) {
|
|
7926
|
+
return "";
|
|
7927
|
+
}
|
|
7928
|
+
if (interpolation.__emotion_styles !== void 0) {
|
|
7929
|
+
return interpolation;
|
|
7930
|
+
}
|
|
7931
|
+
switch (typeof interpolation) {
|
|
7932
|
+
case "boolean": {
|
|
7933
|
+
return "";
|
|
7934
|
+
}
|
|
7935
|
+
case "object": {
|
|
7936
|
+
if (interpolation.anim === 1) {
|
|
7937
|
+
cursor = {
|
|
7938
|
+
name: interpolation.name,
|
|
7939
|
+
styles: interpolation.styles,
|
|
7940
|
+
next: cursor
|
|
7941
|
+
};
|
|
7942
|
+
return interpolation.name;
|
|
7943
|
+
}
|
|
7944
|
+
if (interpolation.styles !== void 0) {
|
|
7945
|
+
var next = interpolation.next;
|
|
7946
|
+
if (next !== void 0) {
|
|
7947
|
+
while (next !== void 0) {
|
|
7948
|
+
cursor = {
|
|
7949
|
+
name: next.name,
|
|
7950
|
+
styles: next.styles,
|
|
7951
|
+
next: cursor
|
|
7952
|
+
};
|
|
7953
|
+
next = next.next;
|
|
7954
|
+
}
|
|
7955
|
+
}
|
|
7956
|
+
var styles = interpolation.styles + ";";
|
|
7957
|
+
return styles;
|
|
7958
|
+
}
|
|
7959
|
+
return createStringFromObject(mergedProps, registered, interpolation);
|
|
7960
|
+
}
|
|
7961
|
+
case "function": {
|
|
7962
|
+
if (mergedProps !== void 0) {
|
|
7963
|
+
var previousCursor = cursor;
|
|
7964
|
+
var result = interpolation(mergedProps);
|
|
7965
|
+
cursor = previousCursor;
|
|
7966
|
+
return handleInterpolation(mergedProps, registered, result);
|
|
7967
|
+
}
|
|
7968
|
+
break;
|
|
7969
|
+
}
|
|
7970
|
+
}
|
|
7971
|
+
if (registered == null) {
|
|
7972
|
+
return interpolation;
|
|
7973
|
+
}
|
|
7974
|
+
var cached = registered[interpolation];
|
|
7975
|
+
return cached !== void 0 ? cached : interpolation;
|
|
7976
|
+
}
|
|
7977
|
+
function createStringFromObject(mergedProps, registered, obj) {
|
|
7978
|
+
var string = "";
|
|
7979
|
+
if (Array.isArray(obj)) {
|
|
7980
|
+
for (var i = 0; i < obj.length; i++) {
|
|
7981
|
+
string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
|
|
7982
|
+
}
|
|
7983
|
+
} else {
|
|
7984
|
+
for (var _key in obj) {
|
|
7985
|
+
var value = obj[_key];
|
|
7986
|
+
if (typeof value !== "object") {
|
|
7987
|
+
if (registered != null && registered[value] !== void 0) {
|
|
7988
|
+
string += _key + "{" + registered[value] + "}";
|
|
7989
|
+
} else if (isProcessableValue(value)) {
|
|
7990
|
+
string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
|
|
7991
|
+
}
|
|
7992
|
+
} else {
|
|
7993
|
+
if (_key === "NO_COMPONENT_SELECTOR" && false) {
|
|
7994
|
+
throw new Error("Component selectors can only be used in conjunction with @emotion/babel-plugin.");
|
|
7995
|
+
}
|
|
7996
|
+
if (Array.isArray(value) && typeof value[0] === "string" && (registered == null || registered[value[0]] === void 0)) {
|
|
7997
|
+
for (var _i = 0; _i < value.length; _i++) {
|
|
7998
|
+
if (isProcessableValue(value[_i])) {
|
|
7999
|
+
string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
|
|
8000
|
+
}
|
|
8001
|
+
}
|
|
8002
|
+
} else {
|
|
8003
|
+
var interpolated = handleInterpolation(mergedProps, registered, value);
|
|
8004
|
+
switch (_key) {
|
|
8005
|
+
case "animation":
|
|
8006
|
+
case "animationName": {
|
|
8007
|
+
string += processStyleName(_key) + ":" + interpolated + ";";
|
|
8008
|
+
break;
|
|
8009
|
+
}
|
|
8010
|
+
default: {
|
|
8011
|
+
string += _key + "{" + interpolated + "}";
|
|
8012
|
+
}
|
|
8013
|
+
}
|
|
8014
|
+
}
|
|
8015
|
+
}
|
|
8016
|
+
}
|
|
8017
|
+
}
|
|
8018
|
+
return string;
|
|
8019
|
+
}
|
|
8020
|
+
var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
|
|
8021
|
+
var cursor;
|
|
8022
|
+
var serializeStyles = function serializeStyles2(args, registered, mergedProps) {
|
|
8023
|
+
if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && args[0].styles !== void 0) {
|
|
8024
|
+
return args[0];
|
|
8025
|
+
}
|
|
8026
|
+
var stringMode = true;
|
|
8027
|
+
var styles = "";
|
|
8028
|
+
cursor = void 0;
|
|
8029
|
+
var strings = args[0];
|
|
8030
|
+
if (strings == null || strings.raw === void 0) {
|
|
8031
|
+
stringMode = false;
|
|
8032
|
+
styles += handleInterpolation(mergedProps, registered, strings);
|
|
8033
|
+
} else {
|
|
8034
|
+
styles += strings[0];
|
|
8035
|
+
}
|
|
8036
|
+
for (var i = 1; i < args.length; i++) {
|
|
8037
|
+
styles += handleInterpolation(mergedProps, registered, args[i]);
|
|
8038
|
+
if (stringMode) {
|
|
8039
|
+
styles += strings[i];
|
|
8040
|
+
}
|
|
8041
|
+
}
|
|
8042
|
+
labelPattern.lastIndex = 0;
|
|
8043
|
+
var identifierName = "";
|
|
8044
|
+
var match;
|
|
8045
|
+
while ((match = labelPattern.exec(styles)) !== null) {
|
|
8046
|
+
identifierName += "-" + match[1];
|
|
8047
|
+
}
|
|
8048
|
+
var name = murmur2(styles) + identifierName;
|
|
8049
|
+
return {
|
|
8050
|
+
name,
|
|
8051
|
+
styles,
|
|
8052
|
+
next: cursor
|
|
8053
|
+
};
|
|
8054
|
+
};
|
|
8055
|
+
var isBrowser = true;
|
|
8056
|
+
var registerStyles = function registerStyles2(cache2, serialized, isStringTag) {
|
|
8057
|
+
var className = cache2.key + "-" + serialized.name;
|
|
8058
|
+
if ((isStringTag === false || isBrowser === false) && cache2.registered[className] === void 0) {
|
|
8059
|
+
cache2.registered[className] = serialized.styles;
|
|
8060
|
+
}
|
|
8061
|
+
};
|
|
8062
|
+
var insertStyles = function insertStyles2(cache2, serialized, isStringTag) {
|
|
8063
|
+
registerStyles(cache2, serialized, isStringTag);
|
|
8064
|
+
var className = cache2.key + "-" + serialized.name;
|
|
8065
|
+
if (cache2.inserted[serialized.name] === void 0) {
|
|
8066
|
+
var current = serialized;
|
|
8067
|
+
do {
|
|
8068
|
+
cache2.insert(serialized === current ? "." + className : "", current, cache2.sheet, true);
|
|
8069
|
+
current = current.next;
|
|
8070
|
+
} while (current !== void 0);
|
|
8071
|
+
}
|
|
8072
|
+
};
|
|
8073
|
+
function useStyleControlCssObject(style, controlDefinition) {
|
|
7776
8074
|
const { properties } = controlDefinition.config;
|
|
7777
|
-
return
|
|
8075
|
+
return __spreadValues(__spreadValues({}, properties.includes(StyleControlProperty.Width) && {
|
|
7778
8076
|
maxWidth: "100%"
|
|
7779
8077
|
}), responsiveStyle([
|
|
7780
8078
|
style == null ? void 0 : style.width,
|
|
@@ -7807,7 +8105,7 @@ function useStyleControlDataClass(style, controlDefinition) {
|
|
|
7807
8105
|
borderBottomRightRadius: (_p = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomRightRadius)) != null ? _p : 0,
|
|
7808
8106
|
borderBottomLeftRadius: (_q = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomLeftRadius)) != null ? _q : 0
|
|
7809
8107
|
});
|
|
7810
|
-
}))
|
|
8108
|
+
}));
|
|
7811
8109
|
function widthToString(widthProperty) {
|
|
7812
8110
|
if (widthProperty == null)
|
|
7813
8111
|
return null;
|
|
@@ -7837,8 +8135,14 @@ function useStyleControlDataClass(style, controlDefinition) {
|
|
|
7837
8135
|
return `${borderRadius.value}${borderRadius.unit}`;
|
|
7838
8136
|
}
|
|
7839
8137
|
}
|
|
8138
|
+
const useInsertionEffect = (_ea = React.useInsertionEffect) != null ? _ea : React.useLayoutEffect;
|
|
7840
8139
|
function useFormattedStyle(styleControlData, controlDefinition) {
|
|
7841
|
-
|
|
8140
|
+
const style = useStyleControlCssObject(styleControlData, controlDefinition);
|
|
8141
|
+
const serialized = serializeStyles([style], cache.registered);
|
|
8142
|
+
useInsertionEffect(() => {
|
|
8143
|
+
insertStyles(cache, serialized, false);
|
|
8144
|
+
});
|
|
8145
|
+
return `${cache.key}-${serialized.name}`;
|
|
7842
8146
|
}
|
|
7843
8147
|
function useDeviceMode() {
|
|
7844
8148
|
return "desktop";
|
|
@@ -7871,6 +8175,48 @@ function useProps(element) {
|
|
|
7871
8175
|
}
|
|
7872
8176
|
}));
|
|
7873
8177
|
}
|
|
8178
|
+
function suppressWarningAndFindDomNode(instance) {
|
|
8179
|
+
const error = console.error;
|
|
8180
|
+
console.error = (...args) => {
|
|
8181
|
+
const [msg, ...substitutions] = args;
|
|
8182
|
+
const text = substitutions.reduce((text2, substitution) => text2.replace("%s", substitution), msg);
|
|
8183
|
+
if (!text.includes("findDOMNode is deprecated in StrictMode.")) {
|
|
8184
|
+
error.apply(console, args);
|
|
8185
|
+
}
|
|
8186
|
+
};
|
|
8187
|
+
const foundDomNode = findDOMNode(instance);
|
|
8188
|
+
console.error = error;
|
|
8189
|
+
return foundDomNode;
|
|
8190
|
+
}
|
|
8191
|
+
class FindDomNodeClassComponent extends Component {
|
|
8192
|
+
componentDidMount() {
|
|
8193
|
+
this.setInnerRef(suppressWarningAndFindDomNode(this));
|
|
8194
|
+
}
|
|
8195
|
+
componentDidUpdate() {
|
|
8196
|
+
this.setInnerRef(suppressWarningAndFindDomNode(this));
|
|
8197
|
+
}
|
|
8198
|
+
setInnerRef(current) {
|
|
8199
|
+
const {
|
|
8200
|
+
innerRef
|
|
8201
|
+
} = this.props;
|
|
8202
|
+
if (innerRef == null)
|
|
8203
|
+
return;
|
|
8204
|
+
if (typeof innerRef === "function")
|
|
8205
|
+
innerRef(current);
|
|
8206
|
+
else
|
|
8207
|
+
innerRef.current = current;
|
|
8208
|
+
}
|
|
8209
|
+
render() {
|
|
8210
|
+
return /* @__PURE__ */ jsx(Fragment, {
|
|
8211
|
+
children: this.props.children
|
|
8212
|
+
});
|
|
8213
|
+
}
|
|
8214
|
+
}
|
|
8215
|
+
const FindDomNode = forwardRef(function FindDomNode2(props, ref) {
|
|
8216
|
+
return /* @__PURE__ */ jsx(FindDomNodeClassComponent, __spreadProps(__spreadValues({}, props), {
|
|
8217
|
+
innerRef: ref
|
|
8218
|
+
}));
|
|
8219
|
+
});
|
|
7874
8220
|
const contextDefaultValue = configureStore();
|
|
7875
8221
|
function createReactRuntime(store) {
|
|
7876
8222
|
return {
|
|
@@ -8010,21 +8356,42 @@ function useDispatch() {
|
|
|
8010
8356
|
const store = useContext(Context);
|
|
8011
8357
|
return store.dispatch;
|
|
8012
8358
|
}
|
|
8359
|
+
function useSuppressRefWarning(ownerName) {
|
|
8360
|
+
const originalErrorRef = useRef(console.error);
|
|
8361
|
+
const patchedRef = useRef(false);
|
|
8362
|
+
if (patchedRef.current === false) {
|
|
8363
|
+
console.error = (...args) => {
|
|
8364
|
+
const [msg, ...substitutions] = args;
|
|
8365
|
+
const text = substitutions.reduce((text2, substitution) => text2.replace("%s", substitution), msg);
|
|
8366
|
+
if (!text.includes("Function components cannot be given refs.") || !text.includes(`Check the render method of \`${ownerName}\`.`)) {
|
|
8367
|
+
originalErrorRef.current(...args);
|
|
8368
|
+
}
|
|
8369
|
+
};
|
|
8370
|
+
patchedRef.current = true;
|
|
8371
|
+
}
|
|
8372
|
+
}
|
|
8013
8373
|
const ElementData = memo(forwardRef(function ElementData2({
|
|
8014
8374
|
elementData
|
|
8015
8375
|
}, ref) {
|
|
8016
|
-
const
|
|
8376
|
+
const Component2 = useComponent(elementData.type);
|
|
8017
8377
|
const props = useProps(elementData);
|
|
8018
|
-
|
|
8378
|
+
const [handle, setHandle] = useState(null);
|
|
8379
|
+
const [foundDomNode, setFoundDomNode] = useState(null);
|
|
8380
|
+
useImperativeHandle(ref, () => handle != null ? handle : foundDomNode, [handle, foundDomNode]);
|
|
8381
|
+
useSuppressRefWarning(`\`ForwardRef(${ElementData2.name})\``);
|
|
8382
|
+
if (Component2 == null) {
|
|
8019
8383
|
return /* @__PURE__ */ jsx(FallbackComponent, {
|
|
8020
8384
|
ref,
|
|
8021
8385
|
text: "Component not found"
|
|
8022
8386
|
});
|
|
8023
8387
|
}
|
|
8024
|
-
return /* @__PURE__ */
|
|
8025
|
-
|
|
8026
|
-
|
|
8027
|
-
|
|
8388
|
+
return /* @__PURE__ */ jsx(FindDomNode, {
|
|
8389
|
+
ref: setFoundDomNode,
|
|
8390
|
+
children: /* @__PURE__ */ createElement(Component2, __spreadProps(__spreadValues({}, props), {
|
|
8391
|
+
key: elementData.key,
|
|
8392
|
+
ref: setHandle
|
|
8393
|
+
}))
|
|
8394
|
+
});
|
|
8028
8395
|
}));
|
|
8029
8396
|
const ElementReference = memo(forwardRef(function ElementReference2({
|
|
8030
8397
|
elementReference
|