@makeswift/runtime 0.0.0-20230407200421 → 0.0.0-20230410231005
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/Box.cjs.js +14 -10
- package/dist/Box.cjs.js.map +1 -1
- package/dist/Box.es.js +9 -5
- package/dist/Box.es.js.map +1 -1
- package/dist/Button.cjs.js +40 -36
- package/dist/Button.cjs.js.map +1 -1
- package/dist/Button.es.js +15 -11
- package/dist/Button.es.js.map +1 -1
- package/dist/Carousel.cjs.js +38 -34
- package/dist/Carousel.cjs.js.map +1 -1
- package/dist/Carousel.es.js +13 -9
- package/dist/Carousel.es.js.map +1 -1
- package/dist/Countdown.cjs.js +30 -54
- package/dist/Countdown.cjs.js.map +1 -1
- package/dist/Countdown.es.js +5 -29
- package/dist/Countdown.es.js.map +1 -1
- package/dist/Divider.cjs.js +11 -35
- package/dist/Divider.cjs.js.map +1 -1
- package/dist/Divider.es.js +5 -29
- package/dist/Divider.es.js.map +1 -1
- package/dist/Embed.cjs.js +6 -30
- package/dist/Embed.cjs.js.map +1 -1
- package/dist/Embed.es.js +5 -29
- package/dist/Embed.es.js.map +1 -1
- package/dist/Form.cjs.js +76 -72
- package/dist/Form.cjs.js.map +1 -1
- package/dist/Form.es.js +14 -10
- package/dist/Form.es.js.map +1 -1
- package/dist/Image.cjs.js +22 -18
- package/dist/Image.cjs.js.map +1 -1
- package/dist/Image.es.js +15 -11
- package/dist/Image.es.js.map +1 -1
- package/dist/LiveProvider.cjs.js +14 -10
- package/dist/LiveProvider.cjs.js.map +1 -1
- package/dist/LiveProvider.es.js +14 -10
- package/dist/LiveProvider.es.js.map +1 -1
- package/dist/Navigation.cjs.js +41 -37
- package/dist/Navigation.cjs.js.map +1 -1
- package/dist/Navigation.es.js +15 -11
- package/dist/Navigation.es.js.map +1 -1
- package/dist/PreviewProvider.cjs.js +12 -8
- package/dist/PreviewProvider.cjs.js.map +1 -1
- package/dist/PreviewProvider.es.js +12 -8
- package/dist/PreviewProvider.es.js.map +1 -1
- package/dist/ReadOnlyText.cjs.js +71 -67
- package/dist/ReadOnlyText.cjs.js.map +1 -1
- package/dist/ReadOnlyText.es.js +15 -11
- package/dist/ReadOnlyText.es.js.map +1 -1
- package/dist/Root.cjs.js +13 -9
- package/dist/Root.cjs.js.map +1 -1
- package/dist/Root.es.js +11 -7
- package/dist/Root.es.js.map +1 -1
- package/dist/SocialLinks.cjs.js +16 -12
- package/dist/SocialLinks.cjs.js.map +1 -1
- package/dist/SocialLinks.es.js +9 -5
- package/dist/SocialLinks.es.js.map +1 -1
- package/dist/Text.cjs.js +7 -3
- package/dist/Text.cjs.js.map +1 -1
- package/dist/Text.es.js +8 -4
- package/dist/Text.es.js.map +1 -1
- package/dist/Video.cjs.js +6 -30
- package/dist/Video.cjs.js.map +1 -1
- package/dist/Video.es.js +5 -29
- package/dist/Video.es.js.map +1 -1
- package/dist/actions.cjs.js +0 -13
- package/dist/actions.cjs.js.map +1 -1
- package/dist/actions.es.js +1 -12
- package/dist/actions.es.js.map +1 -1
- package/dist/api.cjs.js +1 -1
- package/dist/api.es.js +1 -1
- package/dist/builder.cjs.js +1 -0
- package/dist/builder.cjs.js.map +1 -1
- package/dist/builder.es.js +1 -0
- package/dist/builder.es.js.map +1 -1
- package/dist/components.cjs.js +14 -10
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +14 -10
- package/dist/components.es.js.map +1 -1
- package/dist/control-serialization.cjs.js +37 -36
- package/dist/control-serialization.cjs.js.map +1 -1
- package/dist/control-serialization.es.js +2 -1
- package/dist/control-serialization.es.js.map +1 -1
- package/dist/controls.cjs.js +22 -22
- package/dist/controls.es.js +2 -1
- package/dist/controls.es.js.map +1 -1
- package/dist/index.cjs.js +548 -1689
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs2.js +23 -21
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs3.js +2 -1
- package/dist/index.cjs3.js.map +1 -1
- package/dist/index.cjs4.js +2 -2
- package/dist/index.cjs4.js.map +1 -1
- package/dist/index.cjs5.js +20 -20
- package/dist/index.cjs5.js.map +1 -1
- package/dist/index.cjs6.js +7 -3
- package/dist/index.cjs6.js.map +1 -1
- package/dist/index.cjs7.js +50 -46
- package/dist/index.cjs7.js.map +1 -1
- package/dist/index.es.js +329 -1450
- package/dist/index.es.js.map +1 -1
- package/dist/index.es2.js +5 -3
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es3.js +2 -1
- package/dist/index.es3.js.map +1 -1
- package/dist/index.es4.js +1 -1
- package/dist/index.es5.js +3 -3
- package/dist/index.es5.js.map +1 -1
- package/dist/index.es6.js +7 -3
- package/dist/index.es6.js.map +1 -1
- package/dist/index.es7.js +16 -12
- package/dist/index.es7.js.map +1 -1
- package/dist/introspection.cjs.js +21 -23
- package/dist/introspection.cjs.js.map +1 -1
- package/dist/introspection.es.js +4 -5
- package/dist/introspection.es.js.map +1 -1
- package/dist/isNonNullable.cjs.js +6 -0
- package/dist/isNonNullable.cjs.js.map +1 -0
- package/dist/isNonNullable.es.js +5 -0
- package/dist/isNonNullable.es.js.map +1 -0
- package/dist/leaf.cjs.js +11 -11
- package/dist/leaf.cjs.js.map +1 -1
- package/dist/leaf.es.js +2 -2
- package/dist/main.cjs.js +2 -0
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +2 -0
- package/dist/main.es.js.map +1 -1
- package/dist/next.cjs.js +9 -6
- package/dist/next.cjs.js.map +1 -1
- package/dist/next.es.js +10 -6
- package/dist/next.es.js.map +1 -1
- package/dist/prop-controllers.cjs.js +3 -1
- package/dist/prop-controllers.cjs.js.map +1 -1
- package/dist/prop-controllers.es.js +3 -1
- package/dist/prop-controllers.es.js.map +1 -1
- package/dist/react.cjs.js +7 -3
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.es.js +7 -3
- package/dist/react.es.js.map +1 -1
- package/dist/responsive-style.cjs.js +917 -0
- package/dist/responsive-style.cjs.js.map +1 -0
- package/dist/responsive-style.es.js +853 -0
- package/dist/responsive-style.es.js.map +1 -0
- package/dist/rich-text.cjs.js +61 -1319
- package/dist/rich-text.cjs.js.map +1 -1
- package/dist/rich-text.es.js +17 -1217
- package/dist/rich-text.es.js.map +1 -1
- package/dist/slate.cjs.js +8 -28
- package/dist/slate.cjs.js.map +1 -1
- package/dist/slate.es.js +8 -28
- package/dist/slate.es.js.map +1 -1
- package/dist/types/src/api/graphql/documents/queries.d.ts +0 -2
- package/dist/types/src/api/graphql/documents/queries.d.ts.map +1 -1
- package/dist/types/src/api/graphql/generated/types.d.ts +0 -70
- package/dist/types/src/api/graphql/generated/types.d.ts.map +1 -1
- package/dist/types/src/api/react.d.ts +0 -3
- package/dist/types/src/api/react.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/types.d.ts +1 -16
- package/dist/types/src/controls/rich-text/types.d.ts.map +1 -1
- package/dist/types/src/next/api-handler/handlers/element-tree.d.ts +12 -0
- package/dist/types/src/next/api-handler/handlers/element-tree.d.ts.map +1 -0
- package/dist/types/src/next/api-handler/handlers/fonts.d.ts +18 -0
- package/dist/types/src/next/api-handler/handlers/fonts.d.ts.map +1 -0
- package/dist/types/src/next/api-handler/handlers/manifest.d.ts +17 -0
- package/dist/types/src/next/api-handler/handlers/manifest.d.ts.map +1 -0
- package/dist/types/src/next/api-handler/handlers/proxy-preview-mode.d.ts +8 -0
- package/dist/types/src/next/api-handler/handlers/proxy-preview-mode.d.ts.map +1 -0
- package/dist/types/src/next/api-handler/handlers/revalidate.d.ts +13 -0
- package/dist/types/src/next/api-handler/handlers/revalidate.d.ts.map +1 -0
- package/dist/types/src/next/api-handler/index.d.ts +19 -0
- package/dist/types/src/next/api-handler/index.d.ts.map +1 -0
- package/dist/types/src/next/client.d.ts +11 -35
- package/dist/types/src/next/client.d.ts.map +1 -1
- package/dist/types/src/next/index.d.ts +1 -6
- package/dist/types/src/next/index.d.ts.map +1 -1
- package/dist/types/src/state/actions.d.ts +2 -22
- package/dist/types/src/state/actions.d.ts.map +1 -1
- package/dist/types/src/state/makeswift-api-client.d.ts +4 -9
- package/dist/types/src/state/makeswift-api-client.d.ts.map +1 -1
- package/dist/types/src/state/modules/api-resources.d.ts +4 -4
- package/dist/types/src/state/modules/api-resources.d.ts.map +1 -1
- package/dist/types.cjs.js +1272 -10
- package/dist/types.cjs.js.map +1 -1
- package/dist/types.cjs2.js +14 -0
- package/dist/types.cjs2.js.map +1 -0
- package/dist/types.es.js +1207 -10
- package/dist/types.es.js.map +1 -1
- package/dist/types.es2.js +13 -0
- package/dist/types.es2.js.map +1 -0
- package/package.json +3 -2
- package/dist/types/src/api/introspection.d.ts +0 -11
- package/dist/types/src/api/introspection.d.ts.map +0 -1
- package/dist/types/src/next/api-handler.d.ts +0 -48
- package/dist/types/src/next/api-handler.d.ts.map +0 -1
- package/dist/types/src/next/snapshots.d.ts +0 -152
- package/dist/types/src/next/snapshots.d.ts.map +0 -1
package/dist/Image.cjs.js
CHANGED
|
@@ -2,30 +2,34 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
var React = require("react");
|
|
4
4
|
var NextImage = require("next/image");
|
|
5
|
-
var
|
|
5
|
+
var responsiveStyle = require("./responsive-style.cjs.js");
|
|
6
6
|
var placeholders = require("./placeholders.cjs.js");
|
|
7
7
|
var index = require("./index.cjs3.js");
|
|
8
8
|
var css = require("@emotion/css");
|
|
9
9
|
var nextVersion = require("./next-version.cjs.js");
|
|
10
10
|
var jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
require("
|
|
12
|
-
require("
|
|
13
|
-
require("
|
|
11
|
+
require("@emotion/serialize");
|
|
12
|
+
require("@emotion/utils");
|
|
13
|
+
require("use-sync-external-store/shim");
|
|
14
14
|
require("redux");
|
|
15
15
|
require("redux-thunk");
|
|
16
|
+
require("./types.cjs2.js");
|
|
16
17
|
require("./actions.cjs.js");
|
|
18
|
+
require("scroll-into-view-if-needed");
|
|
19
|
+
require("next/link");
|
|
20
|
+
require("./index.cjs.js");
|
|
21
|
+
require("use-sync-external-store/shim/with-selector");
|
|
22
|
+
require("next/dynamic");
|
|
23
|
+
require("./constants.cjs.js");
|
|
17
24
|
require("./rich-text.cjs.js");
|
|
18
25
|
require("slate");
|
|
26
|
+
require("./types.cjs.js");
|
|
19
27
|
require("slate-react");
|
|
20
28
|
require("./introspection.cjs.js");
|
|
21
|
-
require("
|
|
22
|
-
require("@emotion/utils");
|
|
29
|
+
require("./isNonNullable.cjs.js");
|
|
23
30
|
require("./text-input.cjs.js");
|
|
24
31
|
require("./combobox.cjs.js");
|
|
25
|
-
require("use-sync-external-store/shim");
|
|
26
|
-
require("./types.cjs.js");
|
|
27
32
|
require("color");
|
|
28
|
-
require("scroll-into-view-if-needed");
|
|
29
33
|
require("./box-models.cjs.js");
|
|
30
34
|
require("css-box-model");
|
|
31
35
|
require("react-dom");
|
|
@@ -33,13 +37,13 @@ require("html-react-parser");
|
|
|
33
37
|
require("next/head");
|
|
34
38
|
require("@emotion/server/create-instance");
|
|
35
39
|
require("next/document");
|
|
36
|
-
require("cookie");
|
|
37
40
|
require("cors");
|
|
41
|
+
require("path-to-regexp");
|
|
42
|
+
require("cookie");
|
|
38
43
|
require("http-proxy");
|
|
39
44
|
require("set-cookie-parser");
|
|
40
45
|
require("uuid");
|
|
41
46
|
require("corporate-ipsum");
|
|
42
|
-
require("next/link");
|
|
43
47
|
require("next/package.json");
|
|
44
48
|
function _interopDefaultLegacy(e) {
|
|
45
49
|
return e && typeof e === "object" && "default" in e ? e : { "default": e };
|
|
@@ -55,11 +59,11 @@ function loadImage(src) {
|
|
|
55
59
|
});
|
|
56
60
|
}
|
|
57
61
|
function imageSizes(width) {
|
|
58
|
-
const baseDevice =
|
|
59
|
-
const baseWidth = baseDevice && width &&
|
|
62
|
+
const baseDevice = responsiveStyle.DEVICES.find((device) => device.maxWidth == null);
|
|
63
|
+
const baseWidth = baseDevice && width && responsiveStyle.findDeviceOverride(width, baseDevice.id);
|
|
60
64
|
const baseWidthSize = baseWidth == null || baseWidth.value.unit !== "px" ? "100vw" : `${baseWidth.value.value}px`;
|
|
61
|
-
return
|
|
62
|
-
const override =
|
|
65
|
+
return responsiveStyle.DEVICES.map((device) => {
|
|
66
|
+
const override = responsiveStyle.findDeviceOverride(width, device.id);
|
|
63
67
|
if (override == null || device.maxWidth == null || override.value.unit !== "px")
|
|
64
68
|
return null;
|
|
65
69
|
return `(max-width: ${device.maxWidth}px) ${Math.min(device.maxWidth, override.value.value)}px`;
|
|
@@ -80,7 +84,7 @@ const ImageComponent = React.forwardRef(function Image2({
|
|
|
80
84
|
placeholder = placeholders.placeholders.image,
|
|
81
85
|
className
|
|
82
86
|
}, ref) {
|
|
83
|
-
const fileData =
|
|
87
|
+
const fileData = responsiveStyle.useFile(file != null ? file : null);
|
|
84
88
|
const imageSrc = (fileData == null ? void 0 : fileData.publicUrl) ? fileData.publicUrl : placeholder.src;
|
|
85
89
|
const dataDimensions = (fileData == null ? void 0 : fileData.publicUrl) ? fileData == null ? void 0 : fileData.dimensions : placeholder.dimensions;
|
|
86
90
|
const [measuredDimensions, setMeasuredDimensions] = React.useState(null);
|
|
@@ -102,10 +106,10 @@ const ImageComponent = React.forwardRef(function Image2({
|
|
|
102
106
|
}, [dataDimensions, imageSrc]);
|
|
103
107
|
const dimensions = dataDimensions != null ? dataDimensions : measuredDimensions;
|
|
104
108
|
const Container = link ? index.Link : "div";
|
|
105
|
-
const containerClassName = css.cx(
|
|
109
|
+
const containerClassName = css.cx(responsiveStyle.useStyle({
|
|
106
110
|
lineHeight: 0,
|
|
107
111
|
overflow: "hidden"
|
|
108
|
-
}),
|
|
112
|
+
}), responsiveStyle.useStyle(responsiveStyle.responsiveWidth(width, dimensions == null ? void 0 : dimensions.width)), responsiveStyle.useStyle(responsiveStyle.responsiveStyle([opacity], ([opacity2 = 1]) => ({
|
|
109
113
|
opacity: opacity2
|
|
110
114
|
}))), margin, padding, border, borderRadius, boxShadow, className);
|
|
111
115
|
if (!dimensions)
|
package/dist/Image.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.cjs.js","sources":["../src/components/builtin/Image/Image.tsx"],"sourcesContent":["import { useState, useEffect, Ref, forwardRef } from 'react'\nimport NextImage from 'next/image'\nimport type NextLegacyImageType from 'next/legacy/image'\n\nimport {\n ElementIDValue,\n ImageValue,\n LinkValue,\n ResponsiveOpacityValue,\n TextInputValue,\n WidthValue,\n} from '../../../prop-controllers/descriptors'\nimport { DEVICES, findDeviceOverride } from '../../utils/devices'\nimport { placeholders } from '../../utils/placeholders'\nimport { Link } from '../../shared/Link'\nimport { cx } from '@emotion/css'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { responsiveStyle, responsiveWidth } from '../../utils/responsive-style'\nimport { useFile } from '../../../runtimes/react/hooks/makeswift-api'\nimport { major as nextMajorVersion } from '../../../next/next-version'\n\nconst NextLegacyImage = NextImage as typeof NextLegacyImageType\n\ntype Props = {\n id?: ElementIDValue\n file?: ImageValue\n altText?: TextInputValue\n link?: LinkValue\n width?: WidthValue\n margin?: string\n padding?: string\n border?: string\n borderRadius?: string\n boxShadow?: string\n opacity?: ResponsiveOpacityValue\n placeholder?: { src: string; dimensions: { width: number; height: number } }\n className?: string\n}\n\nfunction loadImage(src: string): Promise<HTMLImageElement> {\n return new Promise<HTMLImageElement>((resolve, reject) => {\n const image = new Image()\n\n image.onload = () => resolve(image)\n image.onerror = reject\n image.src = src\n })\n}\n\nfunction imageSizes(width?: Props['width']): string {\n const baseDevice = DEVICES.find(device => device.maxWidth == null)\n const baseWidth = baseDevice && width && findDeviceOverride(width, baseDevice.id)\n const baseWidthSize =\n baseWidth == null || baseWidth.value.unit !== 'px' ? '100vw' : `${baseWidth.value.value}px`\n\n return DEVICES.map(device => {\n const override = findDeviceOverride(width, device.id)\n\n if (override == null || device.maxWidth == null || override.value.unit !== 'px') return null\n\n return `(max-width: ${device.maxWidth}px) ${Math.min(device.maxWidth, override.value.value)}px`\n })\n .filter((size): size is NonNullable<typeof size> => size != null)\n .reduce((sourceSizes, sourceSize) => `${sourceSize}, ${sourceSizes}`, baseWidthSize)\n}\n\ntype Dimensions = {\n width: number\n height: number\n}\n\nconst ImageComponent = forwardRef(function Image(\n {\n id,\n width,\n margin,\n padding,\n file,\n border,\n borderRadius,\n altText,\n link,\n opacity,\n boxShadow,\n placeholder = placeholders.image,\n className,\n }: Props,\n ref: Ref<HTMLAnchorElement & HTMLDivElement>,\n) {\n const fileData = useFile(file ?? null)\n const imageSrc = fileData?.publicUrl ? fileData.publicUrl : placeholder.src\n const dataDimensions = fileData?.publicUrl ? fileData?.dimensions : placeholder.dimensions\n const [measuredDimensions, setMeasuredDimensions] = useState<Dimensions | null>(null)\n\n useEffect(() => {\n if (dataDimensions) return\n\n let cleanedUp = false\n\n loadImage(imageSrc)\n .then(image => {\n if (!cleanedUp) {\n setMeasuredDimensions({ width: image.naturalWidth, height: image.naturalHeight })\n }\n })\n .catch(console.error)\n\n return () => {\n cleanedUp = true\n }\n }, [dataDimensions, imageSrc])\n\n const dimensions = dataDimensions ?? measuredDimensions\n const Container = link ? Link : 'div'\n const containerClassName = cx(\n useStyle({ lineHeight: 0, overflow: 'hidden' }),\n useStyle(responsiveWidth(width, dimensions?.width)),\n useStyle(responsiveStyle([opacity] as const, ([opacity = 1]) => ({ opacity }))),\n margin,\n padding,\n border,\n borderRadius,\n boxShadow,\n className,\n )\n\n if (!dimensions) return null\n\n return (\n <Container link={link} ref={ref} id={id} className={containerClassName}>\n {nextMajorVersion < 13 ? (\n <NextLegacyImage\n layout=\"responsive\"\n src={imageSrc}\n sizes={imageSizes(width)}\n alt={altText}\n width={dimensions.width}\n height={dimensions.height}\n />\n ) : (\n <NextImage\n src={imageSrc}\n sizes={imageSizes(width)}\n alt={altText ?? ''}\n width={dimensions.width}\n height={dimensions.height}\n style={{\n width: '100%',\n height: 'auto',\n }}\n />\n )}\n </Container>\n )\n})\n\nexport default ImageComponent\n"],"names":["NextLegacyImage","NextImage","src","Promise","resolve","reject","image","Image","onload","onerror","width","baseDevice","DEVICES","find","device","maxWidth","baseWidth","findDeviceOverride","id","baseWidthSize","value","unit","map","override","Math","min","filter","size","reduce","sourceSizes","sourceSize","ImageComponent","forwardRef","margin","padding","file","border","borderRadius","altText","link","opacity","boxShadow","placeholder","placeholders","className","ref","fileData","useFile","imageSrc","publicUrl","dataDimensions","dimensions","measuredDimensions","setMeasuredDimensions","useState","useEffect","cleanedUp","then","naturalWidth","height","naturalHeight","catch","console","error","Container","Link","containerClassName","cx","useStyle","lineHeight","overflow","responsiveWidth","responsiveStyle","nextMajorVersion","_jsx","imageSizes"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Image.cjs.js","sources":["../src/components/builtin/Image/Image.tsx"],"sourcesContent":["import { useState, useEffect, Ref, forwardRef } from 'react'\nimport NextImage from 'next/image'\nimport type NextLegacyImageType from 'next/legacy/image'\n\nimport {\n ElementIDValue,\n ImageValue,\n LinkValue,\n ResponsiveOpacityValue,\n TextInputValue,\n WidthValue,\n} from '../../../prop-controllers/descriptors'\nimport { DEVICES, findDeviceOverride } from '../../utils/devices'\nimport { placeholders } from '../../utils/placeholders'\nimport { Link } from '../../shared/Link'\nimport { cx } from '@emotion/css'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { responsiveStyle, responsiveWidth } from '../../utils/responsive-style'\nimport { useFile } from '../../../runtimes/react/hooks/makeswift-api'\nimport { major as nextMajorVersion } from '../../../next/next-version'\n\nconst NextLegacyImage = NextImage as typeof NextLegacyImageType\n\ntype Props = {\n id?: ElementIDValue\n file?: ImageValue\n altText?: TextInputValue\n link?: LinkValue\n width?: WidthValue\n margin?: string\n padding?: string\n border?: string\n borderRadius?: string\n boxShadow?: string\n opacity?: ResponsiveOpacityValue\n placeholder?: { src: string; dimensions: { width: number; height: number } }\n className?: string\n}\n\nfunction loadImage(src: string): Promise<HTMLImageElement> {\n return new Promise<HTMLImageElement>((resolve, reject) => {\n const image = new Image()\n\n image.onload = () => resolve(image)\n image.onerror = reject\n image.src = src\n })\n}\n\nfunction imageSizes(width?: Props['width']): string {\n const baseDevice = DEVICES.find(device => device.maxWidth == null)\n const baseWidth = baseDevice && width && findDeviceOverride(width, baseDevice.id)\n const baseWidthSize =\n baseWidth == null || baseWidth.value.unit !== 'px' ? '100vw' : `${baseWidth.value.value}px`\n\n return DEVICES.map(device => {\n const override = findDeviceOverride(width, device.id)\n\n if (override == null || device.maxWidth == null || override.value.unit !== 'px') return null\n\n return `(max-width: ${device.maxWidth}px) ${Math.min(device.maxWidth, override.value.value)}px`\n })\n .filter((size): size is NonNullable<typeof size> => size != null)\n .reduce((sourceSizes, sourceSize) => `${sourceSize}, ${sourceSizes}`, baseWidthSize)\n}\n\ntype Dimensions = {\n width: number\n height: number\n}\n\nconst ImageComponent = forwardRef(function Image(\n {\n id,\n width,\n margin,\n padding,\n file,\n border,\n borderRadius,\n altText,\n link,\n opacity,\n boxShadow,\n placeholder = placeholders.image,\n className,\n }: Props,\n ref: Ref<HTMLAnchorElement & HTMLDivElement>,\n) {\n const fileData = useFile(file ?? null)\n const imageSrc = fileData?.publicUrl ? fileData.publicUrl : placeholder.src\n const dataDimensions = fileData?.publicUrl ? fileData?.dimensions : placeholder.dimensions\n const [measuredDimensions, setMeasuredDimensions] = useState<Dimensions | null>(null)\n\n useEffect(() => {\n if (dataDimensions) return\n\n let cleanedUp = false\n\n loadImage(imageSrc)\n .then(image => {\n if (!cleanedUp) {\n setMeasuredDimensions({ width: image.naturalWidth, height: image.naturalHeight })\n }\n })\n .catch(console.error)\n\n return () => {\n cleanedUp = true\n }\n }, [dataDimensions, imageSrc])\n\n const dimensions = dataDimensions ?? measuredDimensions\n const Container = link ? Link : 'div'\n const containerClassName = cx(\n useStyle({ lineHeight: 0, overflow: 'hidden' }),\n useStyle(responsiveWidth(width, dimensions?.width)),\n useStyle(responsiveStyle([opacity] as const, ([opacity = 1]) => ({ opacity }))),\n margin,\n padding,\n border,\n borderRadius,\n boxShadow,\n className,\n )\n\n if (!dimensions) return null\n\n return (\n <Container link={link} ref={ref} id={id} className={containerClassName}>\n {nextMajorVersion < 13 ? (\n <NextLegacyImage\n layout=\"responsive\"\n src={imageSrc}\n sizes={imageSizes(width)}\n alt={altText}\n width={dimensions.width}\n height={dimensions.height}\n />\n ) : (\n <NextImage\n src={imageSrc}\n sizes={imageSizes(width)}\n alt={altText ?? ''}\n width={dimensions.width}\n height={dimensions.height}\n style={{\n width: '100%',\n height: 'auto',\n }}\n />\n )}\n </Container>\n )\n})\n\nexport default ImageComponent\n"],"names":["NextLegacyImage","NextImage","src","Promise","resolve","reject","image","Image","onload","onerror","width","baseDevice","DEVICES","find","device","maxWidth","baseWidth","findDeviceOverride","id","baseWidthSize","value","unit","map","override","Math","min","filter","size","reduce","sourceSizes","sourceSize","ImageComponent","forwardRef","margin","padding","file","border","borderRadius","altText","link","opacity","boxShadow","placeholder","placeholders","className","ref","fileData","useFile","imageSrc","publicUrl","dataDimensions","dimensions","measuredDimensions","setMeasuredDimensions","useState","useEffect","cleanedUp","then","naturalWidth","height","naturalHeight","catch","console","error","Container","Link","containerClassName","cx","useStyle","lineHeight","overflow","responsiveWidth","responsiveStyle","nextMajorVersion","_jsx","imageSizes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAMA,kBAAkBC,mBAAAA;AAkBxB,mBAAmBC,KAAwC;AAClD,SAAA,IAAIC,QAA0B,CAACC,SAASC,WAAW;AAClDC,UAAAA,QAAQ,IAAIC;AAEZC,UAAAA,SAAS,MAAMJ,QAAQE,KAAD;AAC5BA,UAAMG,UAAUJ;AAChBC,UAAMJ,MAAMA;AAAAA,EAAAA,CALP;AAOR;AAED,oBAAoBQ,OAAgC;AAClD,QAAMC,aAAaC,gBAAQC,QAAAA,KAAKC,CAAUA,WAAAA,OAAOC,YAAY,IAA1C;AACnB,QAAMC,YAAYL,cAAcD,SAASO,gBAAmBP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CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
import { forwardRef, useState, useEffect } from "react";
|
|
2
2
|
import NextImage from "next/image";
|
|
3
|
-
import {
|
|
3
|
+
import { k as useFile, e as useStyle, q as responsiveWidth, r as responsiveStyle, D as DEVICES, f as findDeviceOverride } from "./responsive-style.es.js";
|
|
4
4
|
import { p as placeholders } from "./placeholders.es.js";
|
|
5
5
|
import { L as Link } from "./index.es3.js";
|
|
6
6
|
import { cx } from "@emotion/css";
|
|
7
7
|
import { m as major } from "./next-version.es.js";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
import "
|
|
10
|
-
import "
|
|
11
|
-
import "
|
|
9
|
+
import "@emotion/serialize";
|
|
10
|
+
import "@emotion/utils";
|
|
11
|
+
import "use-sync-external-store/shim";
|
|
12
12
|
import "redux";
|
|
13
13
|
import "redux-thunk";
|
|
14
|
+
import "./types.es2.js";
|
|
14
15
|
import "./actions.es.js";
|
|
16
|
+
import "scroll-into-view-if-needed";
|
|
17
|
+
import "next/link";
|
|
18
|
+
import "./index.es.js";
|
|
19
|
+
import "use-sync-external-store/shim/with-selector";
|
|
20
|
+
import "next/dynamic";
|
|
21
|
+
import "./constants.es.js";
|
|
15
22
|
import "./rich-text.es.js";
|
|
16
23
|
import "slate";
|
|
24
|
+
import "./types.es.js";
|
|
17
25
|
import "slate-react";
|
|
18
26
|
import "./introspection.es.js";
|
|
19
|
-
import "
|
|
20
|
-
import "@emotion/utils";
|
|
27
|
+
import "./isNonNullable.es.js";
|
|
21
28
|
import "./text-input.es.js";
|
|
22
29
|
import "./combobox.es.js";
|
|
23
|
-
import "use-sync-external-store/shim";
|
|
24
|
-
import "./types.es.js";
|
|
25
30
|
import "color";
|
|
26
|
-
import "scroll-into-view-if-needed";
|
|
27
31
|
import "./box-models.es.js";
|
|
28
32
|
import "css-box-model";
|
|
29
33
|
import "react-dom";
|
|
@@ -31,13 +35,13 @@ import "html-react-parser";
|
|
|
31
35
|
import "next/head";
|
|
32
36
|
import "@emotion/server/create-instance";
|
|
33
37
|
import "next/document";
|
|
34
|
-
import "cookie";
|
|
35
38
|
import "cors";
|
|
39
|
+
import "path-to-regexp";
|
|
40
|
+
import "cookie";
|
|
36
41
|
import "http-proxy";
|
|
37
42
|
import "set-cookie-parser";
|
|
38
43
|
import "uuid";
|
|
39
44
|
import "corporate-ipsum";
|
|
40
|
-
import "next/link";
|
|
41
45
|
import "next/package.json";
|
|
42
46
|
const NextLegacyImage = NextImage;
|
|
43
47
|
function loadImage(src) {
|
package/dist/Image.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.es.js","sources":["../src/components/builtin/Image/Image.tsx"],"sourcesContent":["import { useState, useEffect, Ref, forwardRef } from 'react'\nimport NextImage from 'next/image'\nimport type NextLegacyImageType from 'next/legacy/image'\n\nimport {\n ElementIDValue,\n ImageValue,\n LinkValue,\n ResponsiveOpacityValue,\n TextInputValue,\n WidthValue,\n} from '../../../prop-controllers/descriptors'\nimport { DEVICES, findDeviceOverride } from '../../utils/devices'\nimport { placeholders } from '../../utils/placeholders'\nimport { Link } from '../../shared/Link'\nimport { cx } from '@emotion/css'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { responsiveStyle, responsiveWidth } from '../../utils/responsive-style'\nimport { useFile } from '../../../runtimes/react/hooks/makeswift-api'\nimport { major as nextMajorVersion } from '../../../next/next-version'\n\nconst NextLegacyImage = NextImage as typeof NextLegacyImageType\n\ntype Props = {\n id?: ElementIDValue\n file?: ImageValue\n altText?: TextInputValue\n link?: LinkValue\n width?: WidthValue\n margin?: string\n padding?: string\n border?: string\n borderRadius?: string\n boxShadow?: string\n opacity?: ResponsiveOpacityValue\n placeholder?: { src: string; dimensions: { width: number; height: number } }\n className?: string\n}\n\nfunction loadImage(src: string): Promise<HTMLImageElement> {\n return new Promise<HTMLImageElement>((resolve, reject) => {\n const image = new Image()\n\n image.onload = () => resolve(image)\n image.onerror = reject\n image.src = src\n })\n}\n\nfunction imageSizes(width?: Props['width']): string {\n const baseDevice = DEVICES.find(device => device.maxWidth == null)\n const baseWidth = baseDevice && width && findDeviceOverride(width, baseDevice.id)\n const baseWidthSize =\n baseWidth == null || baseWidth.value.unit !== 'px' ? '100vw' : `${baseWidth.value.value}px`\n\n return DEVICES.map(device => {\n const override = findDeviceOverride(width, device.id)\n\n if (override == null || device.maxWidth == null || override.value.unit !== 'px') return null\n\n return `(max-width: ${device.maxWidth}px) ${Math.min(device.maxWidth, override.value.value)}px`\n })\n .filter((size): size is NonNullable<typeof size> => size != null)\n .reduce((sourceSizes, sourceSize) => `${sourceSize}, ${sourceSizes}`, baseWidthSize)\n}\n\ntype Dimensions = {\n width: number\n height: number\n}\n\nconst ImageComponent = forwardRef(function Image(\n {\n id,\n width,\n margin,\n padding,\n file,\n border,\n borderRadius,\n altText,\n link,\n opacity,\n boxShadow,\n placeholder = placeholders.image,\n className,\n }: Props,\n ref: Ref<HTMLAnchorElement & HTMLDivElement>,\n) {\n const fileData = useFile(file ?? null)\n const imageSrc = fileData?.publicUrl ? fileData.publicUrl : placeholder.src\n const dataDimensions = fileData?.publicUrl ? fileData?.dimensions : placeholder.dimensions\n const [measuredDimensions, setMeasuredDimensions] = useState<Dimensions | null>(null)\n\n useEffect(() => {\n if (dataDimensions) return\n\n let cleanedUp = false\n\n loadImage(imageSrc)\n .then(image => {\n if (!cleanedUp) {\n setMeasuredDimensions({ width: image.naturalWidth, height: image.naturalHeight })\n }\n })\n .catch(console.error)\n\n return () => {\n cleanedUp = true\n }\n }, [dataDimensions, imageSrc])\n\n const dimensions = dataDimensions ?? measuredDimensions\n const Container = link ? Link : 'div'\n const containerClassName = cx(\n useStyle({ lineHeight: 0, overflow: 'hidden' }),\n useStyle(responsiveWidth(width, dimensions?.width)),\n useStyle(responsiveStyle([opacity] as const, ([opacity = 1]) => ({ opacity }))),\n margin,\n padding,\n border,\n borderRadius,\n boxShadow,\n className,\n )\n\n if (!dimensions) return null\n\n return (\n <Container link={link} ref={ref} id={id} className={containerClassName}>\n {nextMajorVersion < 13 ? (\n <NextLegacyImage\n layout=\"responsive\"\n src={imageSrc}\n sizes={imageSizes(width)}\n alt={altText}\n width={dimensions.width}\n height={dimensions.height}\n />\n ) : (\n <NextImage\n src={imageSrc}\n sizes={imageSizes(width)}\n alt={altText ?? ''}\n width={dimensions.width}\n height={dimensions.height}\n style={{\n width: '100%',\n height: 'auto',\n }}\n />\n )}\n </Container>\n )\n})\n\nexport default ImageComponent\n"],"names":["NextLegacyImage","NextImage","src","Promise","resolve","reject","image","Image","onload","onerror","width","baseDevice","DEVICES","find","device","maxWidth","baseWidth","findDeviceOverride","id","baseWidthSize","value","unit","map","override","Math","min","filter","size","reduce","sourceSizes","sourceSize","ImageComponent","forwardRef","margin","padding","file","border","borderRadius","altText","link","opacity","boxShadow","placeholder","placeholders","className","ref","fileData","useFile","imageSrc","publicUrl","dataDimensions","dimensions","measuredDimensions","setMeasuredDimensions","useState","useEffect","cleanedUp","then","naturalWidth","height","naturalHeight","catch","console","error","Container","Link","containerClassName","cx","useStyle","lineHeight","overflow","responsiveWidth","responsiveStyle","nextMajorVersion","_jsx","imageSizes"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Image.es.js","sources":["../src/components/builtin/Image/Image.tsx"],"sourcesContent":["import { useState, useEffect, Ref, forwardRef } from 'react'\nimport NextImage from 'next/image'\nimport type NextLegacyImageType from 'next/legacy/image'\n\nimport {\n ElementIDValue,\n ImageValue,\n LinkValue,\n ResponsiveOpacityValue,\n TextInputValue,\n WidthValue,\n} from '../../../prop-controllers/descriptors'\nimport { DEVICES, findDeviceOverride } from '../../utils/devices'\nimport { placeholders } from '../../utils/placeholders'\nimport { Link } from '../../shared/Link'\nimport { cx } from '@emotion/css'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { responsiveStyle, responsiveWidth } from '../../utils/responsive-style'\nimport { useFile } from '../../../runtimes/react/hooks/makeswift-api'\nimport { major as nextMajorVersion } from '../../../next/next-version'\n\nconst NextLegacyImage = NextImage as typeof NextLegacyImageType\n\ntype Props = {\n id?: ElementIDValue\n file?: ImageValue\n altText?: TextInputValue\n link?: LinkValue\n width?: WidthValue\n margin?: string\n padding?: string\n border?: string\n borderRadius?: string\n boxShadow?: string\n opacity?: ResponsiveOpacityValue\n placeholder?: { src: string; dimensions: { width: number; height: number } }\n className?: string\n}\n\nfunction loadImage(src: string): Promise<HTMLImageElement> {\n return new Promise<HTMLImageElement>((resolve, reject) => {\n const image = new Image()\n\n image.onload = () => resolve(image)\n image.onerror = reject\n image.src = src\n })\n}\n\nfunction imageSizes(width?: Props['width']): string {\n const baseDevice = DEVICES.find(device => device.maxWidth == null)\n const baseWidth = baseDevice && width && findDeviceOverride(width, baseDevice.id)\n const baseWidthSize =\n baseWidth == null || baseWidth.value.unit !== 'px' ? '100vw' : `${baseWidth.value.value}px`\n\n return DEVICES.map(device => {\n const override = findDeviceOverride(width, device.id)\n\n if (override == null || device.maxWidth == null || override.value.unit !== 'px') return null\n\n return `(max-width: ${device.maxWidth}px) ${Math.min(device.maxWidth, override.value.value)}px`\n })\n .filter((size): size is NonNullable<typeof size> => size != null)\n .reduce((sourceSizes, sourceSize) => `${sourceSize}, ${sourceSizes}`, baseWidthSize)\n}\n\ntype Dimensions = {\n width: number\n height: number\n}\n\nconst ImageComponent = forwardRef(function Image(\n {\n id,\n width,\n margin,\n padding,\n file,\n border,\n borderRadius,\n altText,\n link,\n opacity,\n boxShadow,\n placeholder = placeholders.image,\n className,\n }: Props,\n ref: Ref<HTMLAnchorElement & HTMLDivElement>,\n) {\n const fileData = useFile(file ?? null)\n const imageSrc = fileData?.publicUrl ? fileData.publicUrl : placeholder.src\n const dataDimensions = fileData?.publicUrl ? fileData?.dimensions : placeholder.dimensions\n const [measuredDimensions, setMeasuredDimensions] = useState<Dimensions | null>(null)\n\n useEffect(() => {\n if (dataDimensions) return\n\n let cleanedUp = false\n\n loadImage(imageSrc)\n .then(image => {\n if (!cleanedUp) {\n setMeasuredDimensions({ width: image.naturalWidth, height: image.naturalHeight })\n }\n })\n .catch(console.error)\n\n return () => {\n cleanedUp = true\n }\n }, [dataDimensions, imageSrc])\n\n const dimensions = dataDimensions ?? measuredDimensions\n const Container = link ? Link : 'div'\n const containerClassName = cx(\n useStyle({ lineHeight: 0, overflow: 'hidden' }),\n useStyle(responsiveWidth(width, dimensions?.width)),\n useStyle(responsiveStyle([opacity] as const, ([opacity = 1]) => ({ opacity }))),\n margin,\n padding,\n border,\n borderRadius,\n boxShadow,\n className,\n )\n\n if (!dimensions) return null\n\n return (\n <Container link={link} ref={ref} id={id} className={containerClassName}>\n {nextMajorVersion < 13 ? (\n <NextLegacyImage\n layout=\"responsive\"\n src={imageSrc}\n sizes={imageSizes(width)}\n alt={altText}\n width={dimensions.width}\n height={dimensions.height}\n />\n ) : (\n <NextImage\n src={imageSrc}\n sizes={imageSizes(width)}\n alt={altText ?? ''}\n width={dimensions.width}\n height={dimensions.height}\n style={{\n width: '100%',\n height: 'auto',\n }}\n />\n )}\n </Container>\n )\n})\n\nexport default ImageComponent\n"],"names":["NextLegacyImage","NextImage","src","Promise","resolve","reject","image","Image","onload","onerror","width","baseDevice","DEVICES","find","device","maxWidth","baseWidth","findDeviceOverride","id","baseWidthSize","value","unit","map","override","Math","min","filter","size","reduce","sourceSizes","sourceSize","ImageComponent","forwardRef","margin","padding","file","border","borderRadius","altText","link","opacity","boxShadow","placeholder","placeholders","className","ref","fileData","useFile","imageSrc","publicUrl","dataDimensions","dimensions","measuredDimensions","setMeasuredDimensions","useState","useEffect","cleanedUp","then","naturalWidth","height","naturalHeight","catch","console","error","Container","Link","containerClassName","cx","useStyle","lineHeight","overflow","responsiveWidth","responsiveStyle","nextMajorVersion","_jsx","imageSizes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAMA,kBAAkBC;AAkBxB,mBAAmBC,KAAwC;AAClD,SAAA,IAAIC,QAA0B,CAACC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AAAAA,MAClB,QAAQyC,WAAWQ;AAAAA,MACnB,OAAO;AAAA,QACLjD,OAAO;AAAA,QACPiD,QAAQ;AAAA,MAFH;AAAA,IAAA,CANT;AAAA,EAAA,CAZN;AA0BD,CAnFgC;;"}
|
package/dist/LiveProvider.cjs.js
CHANGED
|
@@ -3,38 +3,42 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
var React = require("react");
|
|
4
4
|
var next = require("./index.cjs.js");
|
|
5
5
|
var constants = require("./constants.cjs.js");
|
|
6
|
+
var responsiveStyle = require("./responsive-style.cjs.js");
|
|
6
7
|
var jsxRuntime = require("react/jsx-runtime");
|
|
7
8
|
require("use-sync-external-store/shim/with-selector");
|
|
8
9
|
require("next/dynamic");
|
|
9
10
|
require("./actions.cjs.js");
|
|
10
|
-
require("
|
|
11
|
-
require("@emotion/serialize");
|
|
12
|
-
require("@emotion/utils");
|
|
13
|
-
require("./rich-text.cjs.js");
|
|
11
|
+
require("./types.cjs.js");
|
|
14
12
|
require("slate");
|
|
15
|
-
require("slate-react");
|
|
16
13
|
require("./text-input.cjs.js");
|
|
17
14
|
require("./combobox.cjs.js");
|
|
15
|
+
require("./rich-text.cjs.js");
|
|
16
|
+
require("slate-react");
|
|
18
17
|
require("use-sync-external-store/shim");
|
|
19
18
|
require("./introspection.cjs.js");
|
|
20
|
-
require("
|
|
21
|
-
require("redux-thunk");
|
|
22
|
-
require("./types.cjs.js");
|
|
19
|
+
require("./isNonNullable.cjs.js");
|
|
23
20
|
require("color");
|
|
24
21
|
require("scroll-into-view-if-needed");
|
|
22
|
+
require("@emotion/css");
|
|
25
23
|
require("./box-models.cjs.js");
|
|
26
24
|
require("css-box-model");
|
|
27
25
|
require("react-dom");
|
|
28
26
|
require("html-react-parser");
|
|
29
27
|
require("next/head");
|
|
28
|
+
require("./types.cjs2.js");
|
|
30
29
|
require("@emotion/server/create-instance");
|
|
31
30
|
require("next/document");
|
|
32
|
-
require("cookie");
|
|
33
31
|
require("cors");
|
|
32
|
+
require("path-to-regexp");
|
|
33
|
+
require("cookie");
|
|
34
34
|
require("http-proxy");
|
|
35
35
|
require("set-cookie-parser");
|
|
36
36
|
require("uuid");
|
|
37
37
|
require("corporate-ipsum");
|
|
38
|
+
require("redux");
|
|
39
|
+
require("redux-thunk");
|
|
40
|
+
require("@emotion/serialize");
|
|
41
|
+
require("@emotion/utils");
|
|
38
42
|
function LiveProvider({
|
|
39
43
|
client,
|
|
40
44
|
children,
|
|
@@ -46,7 +50,7 @@ function LiveProvider({
|
|
|
46
50
|
}), [rootElements]);
|
|
47
51
|
return /* @__PURE__ */ jsxRuntime.jsx(next.StoreContext.Provider, {
|
|
48
52
|
value: store,
|
|
49
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
53
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(responsiveStyle.MakeswiftProvider, {
|
|
50
54
|
client,
|
|
51
55
|
children
|
|
52
56
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveProvider.cjs.js","sources":["../src/runtimes/react/components/LiveProvider.tsx"],"sourcesContent":["import { ReactNode, useMemo } from 'react'\n\nimport { StoreContext, storeContextDefaultValue } from '..'\nimport * as ReactPage from '../../../state/react-page'\nimport { MakeswiftProvider, MakeswiftClient } from '../../../api/react'\n\ntype Props = {\n client: MakeswiftClient\n rootElements?: Map<string, ReactPage.Element>\n children?: ReactNode\n}\n\nexport default function LiveProvider({ client, children, rootElements }: Props): JSX.Element {\n const store = useMemo(\n () =>\n ReactPage.configureStore({\n preloadedState: storeContextDefaultValue.getState(),\n rootElements,\n }),\n [rootElements],\n )\n\n return (\n <StoreContext.Provider value={store}>\n <MakeswiftProvider client={client}>{children}</MakeswiftProvider>\n </StoreContext.Provider>\n )\n}\n"],"names":["client","children","rootElements","store","useMemo","ReactPage","preloadedState","storeContextDefaultValue","getState","_jsx","StoreContext","MakeswiftProvider"],"mappings":"
|
|
1
|
+
{"version":3,"file":"LiveProvider.cjs.js","sources":["../src/runtimes/react/components/LiveProvider.tsx"],"sourcesContent":["import { ReactNode, useMemo } from 'react'\n\nimport { StoreContext, storeContextDefaultValue } from '..'\nimport * as ReactPage from '../../../state/react-page'\nimport { MakeswiftProvider, MakeswiftClient } from '../../../api/react'\n\ntype Props = {\n client: MakeswiftClient\n rootElements?: Map<string, ReactPage.Element>\n children?: ReactNode\n}\n\nexport default function LiveProvider({ client, children, rootElements }: Props): JSX.Element {\n const store = useMemo(\n () =>\n ReactPage.configureStore({\n preloadedState: storeContextDefaultValue.getState(),\n rootElements,\n }),\n [rootElements],\n )\n\n return (\n <StoreContext.Provider value={store}>\n <MakeswiftProvider client={client}>{children}</MakeswiftProvider>\n </StoreContext.Provider>\n )\n}\n"],"names":["client","children","rootElements","store","useMemo","ReactPage","preloadedState","storeContextDefaultValue","getState","_jsx","StoreContext","MakeswiftProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYqC,sBAAA;AAAA,EAAEA;AAAAA,EAAQC;AAAAA,EAAUC;AAAAA,GAAoC;AACrFC,QAAAA,QAAQC,cACZ,MACEC,yBAAyB;AAAA,IACvBC,gBAAgBC,8BAAyBC,SADlB;AAAA,IAEvBN;AAAAA,EAAAA,CAFF,GAIF,CAACA,YAAD,CANmB;AAUnB,SAAAO,2BAAA,IAACC,kBAAa,UAAd;AAAA,IAAuB,OAAOP;AAAAA,IAA9B,yCACGQ,mCAAD;AAAA,MAAmB;AAAA,MAAiBV;AAAAA,IAAAA,CAApC;AAAA,EAAA,CAFJ;AAKD;;"}
|
package/dist/LiveProvider.es.js
CHANGED
|
@@ -1,38 +1,42 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { w as storeContextDefaultValue, x as StoreContext } from "./index.es.js";
|
|
3
3
|
import { f as configureStore } from "./constants.es.js";
|
|
4
|
+
import { J as MakeswiftProvider } from "./responsive-style.es.js";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
import "use-sync-external-store/shim/with-selector";
|
|
6
7
|
import "next/dynamic";
|
|
7
8
|
import "./actions.es.js";
|
|
8
|
-
import "
|
|
9
|
-
import "@emotion/serialize";
|
|
10
|
-
import "@emotion/utils";
|
|
11
|
-
import "./rich-text.es.js";
|
|
9
|
+
import "./types.es.js";
|
|
12
10
|
import "slate";
|
|
13
|
-
import "slate-react";
|
|
14
11
|
import "./text-input.es.js";
|
|
15
12
|
import "./combobox.es.js";
|
|
13
|
+
import "./rich-text.es.js";
|
|
14
|
+
import "slate-react";
|
|
16
15
|
import "use-sync-external-store/shim";
|
|
17
16
|
import "./introspection.es.js";
|
|
18
|
-
import "
|
|
19
|
-
import "redux-thunk";
|
|
20
|
-
import "./types.es.js";
|
|
17
|
+
import "./isNonNullable.es.js";
|
|
21
18
|
import "color";
|
|
22
19
|
import "scroll-into-view-if-needed";
|
|
20
|
+
import "@emotion/css";
|
|
23
21
|
import "./box-models.es.js";
|
|
24
22
|
import "css-box-model";
|
|
25
23
|
import "react-dom";
|
|
26
24
|
import "html-react-parser";
|
|
27
25
|
import "next/head";
|
|
26
|
+
import "./types.es2.js";
|
|
28
27
|
import "@emotion/server/create-instance";
|
|
29
28
|
import "next/document";
|
|
30
|
-
import "cookie";
|
|
31
29
|
import "cors";
|
|
30
|
+
import "path-to-regexp";
|
|
31
|
+
import "cookie";
|
|
32
32
|
import "http-proxy";
|
|
33
33
|
import "set-cookie-parser";
|
|
34
34
|
import "uuid";
|
|
35
35
|
import "corporate-ipsum";
|
|
36
|
+
import "redux";
|
|
37
|
+
import "redux-thunk";
|
|
38
|
+
import "@emotion/serialize";
|
|
39
|
+
import "@emotion/utils";
|
|
36
40
|
function LiveProvider({
|
|
37
41
|
client,
|
|
38
42
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveProvider.es.js","sources":["../src/runtimes/react/components/LiveProvider.tsx"],"sourcesContent":["import { ReactNode, useMemo } from 'react'\n\nimport { StoreContext, storeContextDefaultValue } from '..'\nimport * as ReactPage from '../../../state/react-page'\nimport { MakeswiftProvider, MakeswiftClient } from '../../../api/react'\n\ntype Props = {\n client: MakeswiftClient\n rootElements?: Map<string, ReactPage.Element>\n children?: ReactNode\n}\n\nexport default function LiveProvider({ client, children, rootElements }: Props): JSX.Element {\n const store = useMemo(\n () =>\n ReactPage.configureStore({\n preloadedState: storeContextDefaultValue.getState(),\n rootElements,\n }),\n [rootElements],\n )\n\n return (\n <StoreContext.Provider value={store}>\n <MakeswiftProvider client={client}>{children}</MakeswiftProvider>\n </StoreContext.Provider>\n )\n}\n"],"names":["client","children","rootElements","store","useMemo","ReactPage","preloadedState","storeContextDefaultValue","getState","_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"LiveProvider.es.js","sources":["../src/runtimes/react/components/LiveProvider.tsx"],"sourcesContent":["import { ReactNode, useMemo } from 'react'\n\nimport { StoreContext, storeContextDefaultValue } from '..'\nimport * as ReactPage from '../../../state/react-page'\nimport { MakeswiftProvider, MakeswiftClient } from '../../../api/react'\n\ntype Props = {\n client: MakeswiftClient\n rootElements?: Map<string, ReactPage.Element>\n children?: ReactNode\n}\n\nexport default function LiveProvider({ client, children, rootElements }: Props): JSX.Element {\n const store = useMemo(\n () =>\n ReactPage.configureStore({\n preloadedState: storeContextDefaultValue.getState(),\n rootElements,\n }),\n [rootElements],\n )\n\n return (\n <StoreContext.Provider value={store}>\n <MakeswiftProvider client={client}>{children}</MakeswiftProvider>\n </StoreContext.Provider>\n )\n}\n"],"names":["client","children","rootElements","store","useMemo","ReactPage","preloadedState","storeContextDefaultValue","getState","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYqC,sBAAA;AAAA,EAAEA;AAAAA,EAAQC;AAAAA,EAAUC;AAAAA,GAAoC;AACrFC,QAAAA,QAAQC,QACZ,MACEC,eAAyB;AAAA,IACvBC,gBAAgBC,yBAAyBC,SADlB;AAAA,IAEvBN;AAAAA,EAAAA,CAFF,GAIF,CAACA,YAAD,CANmB;AAUnB,SAAAO,oBAAC,aAAa,UAAd;AAAA,IAAuB,OAAON;AAAAA,IAA9B,8BACG,mBAAD;AAAA,MAAmB;AAAA,MAAiBF;AAAAA,IAAAA,CAApC;AAAA,EAAA,CAFJ;AAKD;;"}
|
package/dist/Navigation.cjs.js
CHANGED
|
@@ -35,12 +35,13 @@ var React = require("react");
|
|
|
35
35
|
var index = require("./index.cjs4.js");
|
|
36
36
|
var Image = require("./Image.cjs.js");
|
|
37
37
|
var Button = require("./Button.cjs.js");
|
|
38
|
-
var
|
|
38
|
+
var responsiveStyle = require("./responsive-style.cjs.js");
|
|
39
39
|
var jsxRuntime = require("react/jsx-runtime");
|
|
40
40
|
require("use-sync-external-store/shim");
|
|
41
|
-
require("./
|
|
41
|
+
require("./types.cjs.js");
|
|
42
42
|
require("slate");
|
|
43
43
|
require("slate-react");
|
|
44
|
+
var next = require("./index.cjs.js");
|
|
44
45
|
var index$1 = require("./index.cjs3.js");
|
|
45
46
|
var useIsomorphicLayoutEffect = require("./useIsomorphicLayoutEffect.cjs.js");
|
|
46
47
|
var css = require("@emotion/css");
|
|
@@ -48,20 +49,23 @@ require("next/image");
|
|
|
48
49
|
require("./placeholders.cjs.js");
|
|
49
50
|
require("./next-version.cjs.js");
|
|
50
51
|
require("next/package.json");
|
|
51
|
-
require("
|
|
52
|
-
require("
|
|
53
|
-
require("./constants.cjs.js");
|
|
52
|
+
require("@emotion/serialize");
|
|
53
|
+
require("@emotion/utils");
|
|
54
54
|
require("redux");
|
|
55
55
|
require("redux-thunk");
|
|
56
|
+
require("./types.cjs2.js");
|
|
56
57
|
require("./actions.cjs.js");
|
|
58
|
+
require("scroll-into-view-if-needed");
|
|
59
|
+
require("next/link");
|
|
60
|
+
require("use-sync-external-store/shim/with-selector");
|
|
61
|
+
require("next/dynamic");
|
|
62
|
+
require("./constants.cjs.js");
|
|
63
|
+
require("./rich-text.cjs.js");
|
|
57
64
|
require("./introspection.cjs.js");
|
|
58
|
-
require("
|
|
59
|
-
require("@emotion/utils");
|
|
65
|
+
require("./isNonNullable.cjs.js");
|
|
60
66
|
require("./text-input.cjs.js");
|
|
61
67
|
require("./combobox.cjs.js");
|
|
62
|
-
require("./types.cjs.js");
|
|
63
68
|
require("color");
|
|
64
|
-
require("scroll-into-view-if-needed");
|
|
65
69
|
require("./box-models.cjs.js");
|
|
66
70
|
require("css-box-model");
|
|
67
71
|
require("react-dom");
|
|
@@ -69,13 +73,13 @@ require("html-react-parser");
|
|
|
69
73
|
require("next/head");
|
|
70
74
|
require("@emotion/server/create-instance");
|
|
71
75
|
require("next/document");
|
|
72
|
-
require("cookie");
|
|
73
76
|
require("cors");
|
|
77
|
+
require("path-to-regexp");
|
|
78
|
+
require("cookie");
|
|
74
79
|
require("http-proxy");
|
|
75
80
|
require("set-cookie-parser");
|
|
76
81
|
require("uuid");
|
|
77
82
|
require("corporate-ipsum");
|
|
78
|
-
require("next/link");
|
|
79
83
|
function _interopNamespace(e) {
|
|
80
84
|
if (e && e.__esModule)
|
|
81
85
|
return e;
|
|
@@ -126,7 +130,7 @@ function PlaceholderLink({
|
|
|
126
130
|
button
|
|
127
131
|
}) {
|
|
128
132
|
return /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
129
|
-
className:
|
|
133
|
+
className: responsiveStyle.useStyle({
|
|
130
134
|
width,
|
|
131
135
|
height: button === true ? 32 : 8,
|
|
132
136
|
backgroundColor: "#a1a8c2",
|
|
@@ -266,7 +270,7 @@ function DropDownMenu$1(_a) {
|
|
|
266
270
|
"position"
|
|
267
271
|
]);
|
|
268
272
|
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
|
|
269
|
-
className: css.cx(DROP_DOWN_MENU_CLASS_NAME,
|
|
273
|
+
className: css.cx(DROP_DOWN_MENU_CLASS_NAME, responsiveStyle.useStyle({
|
|
270
274
|
position: "absolute",
|
|
271
275
|
top: "100%",
|
|
272
276
|
left: position === "left" ? 0 : "auto",
|
|
@@ -305,7 +309,7 @@ const DropDownContainer = React.forwardRef(function DropDownContainer2(_c, ref)
|
|
|
305
309
|
]);
|
|
306
310
|
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
|
|
307
311
|
ref,
|
|
308
|
-
className: css.cx(
|
|
312
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
309
313
|
position: "relative",
|
|
310
314
|
[`&:hover .${DROP_DOWN_MENU_CLASS_NAME}`]: {
|
|
311
315
|
display: "block",
|
|
@@ -326,7 +330,7 @@ function DropDownItem$1(_e) {
|
|
|
326
330
|
]);
|
|
327
331
|
const colorData = next.useResponsiveColor(color);
|
|
328
332
|
return /* @__PURE__ */ jsxRuntime.jsx(index$1.Link, __spreadProps(__spreadValues({}, restOfProps), {
|
|
329
|
-
className: css.cx(
|
|
333
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
330
334
|
display: "block",
|
|
331
335
|
textDecoration: "none",
|
|
332
336
|
lineHeight: 1.4,
|
|
@@ -334,7 +338,7 @@ function DropDownItem$1(_e) {
|
|
|
334
338
|
color: "black",
|
|
335
339
|
backgroundColor: "transparent",
|
|
336
340
|
transition: "background-color 0.2s"
|
|
337
|
-
}),
|
|
341
|
+
}), responsiveStyle.useStyle(responsiveStyle.responsiveTextStyle(textStyle)), responsiveStyle.useStyle(responsiveStyle.responsiveStyle([colorData, textStyle], ([color2, textStyle2 = {}]) => {
|
|
338
342
|
const fontSize = textStyle2.fontSize || {
|
|
339
343
|
value: 14,
|
|
340
344
|
unit: "px"
|
|
@@ -344,14 +348,14 @@ function DropDownItem$1(_e) {
|
|
|
344
348
|
const letterSpacing = textStyle2.letterSpacing == null ? null : textStyle2.letterSpacing;
|
|
345
349
|
const textTransform = textStyle2.textTransform || [];
|
|
346
350
|
return {
|
|
347
|
-
color: color2 == null ? "black" :
|
|
351
|
+
color: color2 == null ? "black" : responsiveStyle.colorToString(color2),
|
|
348
352
|
fontSize: `${fontSize.value}${fontSize.unit}`,
|
|
349
353
|
fontWeight,
|
|
350
354
|
fontStyle: fontStyle.includes("italic") ? "italic" : "normal",
|
|
351
355
|
letterSpacing: letterSpacing == null ? "normal" : `${letterSpacing}px`,
|
|
352
356
|
textTransform: textTransform.includes("uppercase") ? "uppercase" : "none"
|
|
353
357
|
};
|
|
354
|
-
})),
|
|
358
|
+
})), responsiveStyle.useStyle({
|
|
355
359
|
"&:hover": {
|
|
356
360
|
backgroundColor: "rgba(0, 0, 0, 0.04)"
|
|
357
361
|
}
|
|
@@ -450,7 +454,7 @@ function DropDownMenu(_i) {
|
|
|
450
454
|
"open"
|
|
451
455
|
]);
|
|
452
456
|
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
|
|
453
|
-
className: css.cx(
|
|
457
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
454
458
|
display: open ? "flex" : "none",
|
|
455
459
|
flexDirection: "column",
|
|
456
460
|
padding: 8
|
|
@@ -464,7 +468,7 @@ function ButtonLink$1(_k) {
|
|
|
464
468
|
"className"
|
|
465
469
|
]);
|
|
466
470
|
return /* @__PURE__ */ jsxRuntime.jsx(Button["default"], __spreadProps(__spreadValues({}, restOfProps), {
|
|
467
|
-
className: css.cx(
|
|
471
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
468
472
|
margin: "8px 0"
|
|
469
473
|
}), className)
|
|
470
474
|
}));
|
|
@@ -481,13 +485,13 @@ function DropDownItem(_m) {
|
|
|
481
485
|
]);
|
|
482
486
|
const colorData = next.useResponsiveColor(color);
|
|
483
487
|
return /* @__PURE__ */ jsxRuntime.jsx(index$1.Link, __spreadProps(__spreadValues({}, restOfProps), {
|
|
484
|
-
className: css.cx(
|
|
488
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
485
489
|
textDecoration: "none",
|
|
486
490
|
lineHeight: 1.4,
|
|
487
491
|
padding: "8px 16px",
|
|
488
492
|
color: "black"
|
|
489
|
-
}),
|
|
490
|
-
color: color2 == null ? "black" :
|
|
493
|
+
}), responsiveStyle.useStyle(responsiveStyle.responsiveTextStyle(textStyle)), responsiveStyle.useStyle(responsiveStyle.responsiveStyle([colorData], ([color2]) => ({
|
|
494
|
+
color: color2 == null ? "black" : responsiveStyle.colorToString(color2)
|
|
491
495
|
}))), className)
|
|
492
496
|
}));
|
|
493
497
|
}
|
|
@@ -557,7 +561,7 @@ function ButtonLink(_q) {
|
|
|
557
561
|
"color"
|
|
558
562
|
]);
|
|
559
563
|
return /* @__PURE__ */ jsxRuntime.jsx(Button["default"], __spreadProps(__spreadValues({}, restOfProps), {
|
|
560
|
-
className: css.cx(
|
|
564
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
561
565
|
margin: "8px 0"
|
|
562
566
|
}), className),
|
|
563
567
|
textColor: next.useResponsiveColor(textColor),
|
|
@@ -577,7 +581,7 @@ function Container$1(_s) {
|
|
|
577
581
|
"open"
|
|
578
582
|
]);
|
|
579
583
|
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
|
|
580
|
-
className: css.cx(
|
|
584
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
581
585
|
position: "fixed",
|
|
582
586
|
flexDirection: "column",
|
|
583
587
|
width: "100%",
|
|
@@ -586,14 +590,14 @@ function Container$1(_s) {
|
|
|
586
590
|
overflowY: "auto",
|
|
587
591
|
zIndex: 9999,
|
|
588
592
|
maxWidth: 575
|
|
589
|
-
}),
|
|
593
|
+
}), responsiveStyle.useStyle(responsiveStyle.responsiveStyle([animation, backgroundColor], ([animation2, backgroundColor2]) => {
|
|
590
594
|
if (animation2 == null)
|
|
591
595
|
return {
|
|
592
596
|
display: "none"
|
|
593
597
|
};
|
|
594
598
|
return __spreadValues({
|
|
595
599
|
display: "flex",
|
|
596
|
-
backgroundColor: backgroundColor2 == null ? "black" :
|
|
600
|
+
backgroundColor: backgroundColor2 == null ? "black" : responsiveStyle.colorToString(backgroundColor2),
|
|
597
601
|
transform: open ? `translate3d(0,0,0)` : `translate3d(${{
|
|
598
602
|
coverRight: "",
|
|
599
603
|
coverLeft: "-"
|
|
@@ -622,7 +626,7 @@ function CloseIconContainer(_u) {
|
|
|
622
626
|
"color"
|
|
623
627
|
]);
|
|
624
628
|
return /* @__PURE__ */ jsxRuntime.jsx("button", __spreadProps(__spreadValues({}, restOfProps), {
|
|
625
|
-
className: css.cx(
|
|
629
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
626
630
|
position: "absolute",
|
|
627
631
|
top: 15,
|
|
628
632
|
right: 15,
|
|
@@ -631,8 +635,8 @@ function CloseIconContainer(_u) {
|
|
|
631
635
|
outline: 0,
|
|
632
636
|
background: "none",
|
|
633
637
|
fill: "currentcolor"
|
|
634
|
-
}),
|
|
635
|
-
color: color2 == null ? "rgba(161, 168, 194, 0.5)" :
|
|
638
|
+
}), responsiveStyle.useStyle(responsiveStyle.responsiveStyle([color], ([color2]) => ({
|
|
639
|
+
color: color2 == null ? "rgba(161, 168, 194, 0.5)" : responsiveStyle.colorToString(color2)
|
|
636
640
|
}))), className)
|
|
637
641
|
}));
|
|
638
642
|
}
|
|
@@ -687,10 +691,10 @@ const Container = React.forwardRef(function Container2(_w, ref) {
|
|
|
687
691
|
]);
|
|
688
692
|
return /* @__PURE__ */ jsxRuntime.jsx("nav", __spreadProps(__spreadValues({}, restOfProps), {
|
|
689
693
|
ref,
|
|
690
|
-
className: css.cx(
|
|
694
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
691
695
|
display: "flex",
|
|
692
696
|
alignItems: "center"
|
|
693
|
-
}), width, margin,
|
|
697
|
+
}), width, margin, responsiveStyle.useStyle(responsiveStyle.responsiveTextStyle(textStyle)), responsiveStyle.useStyle(responsiveStyle.responsiveStyle([gutter], ([gutter2 = {
|
|
694
698
|
value: 0,
|
|
695
699
|
unit: "px"
|
|
696
700
|
}]) => ({
|
|
@@ -709,11 +713,11 @@ function LinksContainer(_y) {
|
|
|
709
713
|
"mobileMenuAnimation"
|
|
710
714
|
]);
|
|
711
715
|
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
|
|
712
|
-
className: css.cx(
|
|
716
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
713
717
|
display: "flex",
|
|
714
718
|
alignItems: "center",
|
|
715
719
|
flexGrow: 1
|
|
716
|
-
}),
|
|
720
|
+
}), responsiveStyle.useStyle(responsiveStyle.responsiveStyle([alignment, mobileMenuAnimation], ([alignment2 = "flex-end", mobileMenuAnimation2]) => ({
|
|
717
721
|
display: mobileMenuAnimation2 == null ? "flex" : "none",
|
|
718
722
|
justifyContent: alignment2
|
|
719
723
|
}))), className)
|
|
@@ -732,7 +736,7 @@ function OpenIconContainer(_A) {
|
|
|
732
736
|
"color"
|
|
733
737
|
]);
|
|
734
738
|
return /* @__PURE__ */ jsxRuntime.jsx("button", __spreadProps(__spreadValues({}, restOfProps), {
|
|
735
|
-
className: css.cx(
|
|
739
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
736
740
|
display: "none",
|
|
737
741
|
flexGrow: 1,
|
|
738
742
|
alignItems: "center",
|
|
@@ -741,10 +745,10 @@ function OpenIconContainer(_A) {
|
|
|
741
745
|
border: 0,
|
|
742
746
|
padding: 0,
|
|
743
747
|
fill: "currentcolor"
|
|
744
|
-
}),
|
|
748
|
+
}), responsiveStyle.useStyle(responsiveStyle.responsiveStyle([mobileMenuAnimation, alignment, color], ([mobileMenuAnimation2, alignment2 = "flex-end", color2]) => ({
|
|
745
749
|
display: mobileMenuAnimation2 == null ? "none" : "flex",
|
|
746
750
|
justifyContent: alignment2,
|
|
747
|
-
color: color2 == null ? "rgba(161, 168, 194, 0.5)" :
|
|
751
|
+
color: color2 == null ? "rgba(161, 168, 194, 0.5)" : responsiveStyle.colorToString(color2)
|
|
748
752
|
}))), className)
|
|
749
753
|
}));
|
|
750
754
|
}
|