@makeswift/runtime 0.7.19 → 0.8.1
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 +13 -10
- package/dist/Box.cjs.js.map +1 -1
- package/dist/Box.es.js +8 -5
- package/dist/Box.es.js.map +1 -1
- package/dist/Button.cjs.js +39 -36
- package/dist/Button.cjs.js.map +1 -1
- package/dist/Button.es.js +14 -11
- package/dist/Button.es.js.map +1 -1
- package/dist/Carousel.cjs.js +36 -33
- package/dist/Carousel.cjs.js.map +1 -1
- package/dist/Carousel.es.js +11 -8
- package/dist/Carousel.es.js.map +1 -1
- package/dist/Countdown.cjs.js +29 -53
- package/dist/Countdown.cjs.js.map +1 -1
- package/dist/Countdown.es.js +4 -28
- package/dist/Countdown.es.js.map +1 -1
- package/dist/Divider.cjs.js +10 -34
- package/dist/Divider.cjs.js.map +1 -1
- package/dist/Divider.es.js +4 -28
- package/dist/Divider.es.js.map +1 -1
- package/dist/Embed.cjs.js +5 -29
- package/dist/Embed.cjs.js.map +1 -1
- package/dist/Embed.es.js +4 -28
- package/dist/Embed.es.js.map +1 -1
- package/dist/Form.cjs.js +75 -72
- package/dist/Form.cjs.js.map +1 -1
- package/dist/Form.es.js +13 -10
- package/dist/Form.es.js.map +1 -1
- package/dist/Image.cjs.js +21 -18
- package/dist/Image.cjs.js.map +1 -1
- package/dist/Image.es.js +14 -11
- package/dist/Image.es.js.map +1 -1
- package/dist/LiveProvider.cjs.js +11 -8
- package/dist/LiveProvider.cjs.js.map +1 -1
- package/dist/LiveProvider.es.js +11 -8
- package/dist/LiveProvider.es.js.map +1 -1
- package/dist/Navigation.cjs.js +39 -36
- package/dist/Navigation.cjs.js.map +1 -1
- package/dist/Navigation.es.js +13 -10
- package/dist/Navigation.es.js.map +1 -1
- package/dist/PreviewProvider.cjs.js +11 -8
- package/dist/PreviewProvider.cjs.js.map +1 -1
- package/dist/PreviewProvider.es.js +11 -8
- package/dist/PreviewProvider.es.js.map +1 -1
- package/dist/ReadOnlyText.cjs.js +18 -15
- package/dist/ReadOnlyText.cjs.js.map +1 -1
- package/dist/ReadOnlyText.es.js +14 -11
- package/dist/ReadOnlyText.es.js.map +1 -1
- package/dist/Root.cjs.js +12 -9
- package/dist/Root.cjs.js.map +1 -1
- package/dist/Root.es.js +10 -7
- package/dist/Root.es.js.map +1 -1
- package/dist/SocialLinks.cjs.js +15 -12
- package/dist/SocialLinks.cjs.js.map +1 -1
- package/dist/SocialLinks.es.js +8 -5
- package/dist/SocialLinks.es.js.map +1 -1
- package/dist/Text.cjs.js +6 -3
- package/dist/Text.cjs.js.map +1 -1
- package/dist/Text.es.js +7 -4
- package/dist/Text.es.js.map +1 -1
- package/dist/Video.cjs.js +5 -29
- package/dist/Video.cjs.js.map +1 -1
- package/dist/Video.es.js +4 -28
- 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/components.cjs.js +11 -8
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +11 -8
- package/dist/components.es.js.map +1 -1
- package/dist/controls.cjs.js +1 -0
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +1 -1
- package/dist/descriptors.cjs.js +13 -0
- package/dist/descriptors.cjs.js.map +1 -1
- package/dist/descriptors.es.js +13 -1
- package/dist/descriptors.es.js.map +1 -1
- package/dist/index.cjs.js +368 -1508
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs2.js +22 -20
- 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 +4 -4
- package/dist/index.cjs5.js.map +1 -1
- package/dist/index.cjs6.js +6 -3
- package/dist/index.cjs6.js.map +1 -1
- package/dist/index.cjs7.js +19 -16
- package/dist/index.cjs7.js.map +1 -1
- package/dist/index.es.js +334 -1454
- package/dist/index.es.js.map +1 -1
- package/dist/index.es2.js +4 -2
- 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 +6 -3
- package/dist/index.es6.js.map +1 -1
- package/dist/index.es7.js +15 -12
- package/dist/index.es7.js.map +1 -1
- package/dist/introspection.cjs.js +2 -5
- package/dist/introspection.cjs.js.map +1 -1
- package/dist/introspection.es.js +2 -4
- 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 +1 -0
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +1 -0
- package/dist/main.es.js.map +1 -1
- package/dist/next.cjs.js +8 -6
- package/dist/next.cjs.js.map +1 -1
- package/dist/next.es.js +9 -6
- package/dist/next.es.js.map +1 -1
- package/dist/prop-controllers.cjs.js +1 -0
- package/dist/prop-controllers.cjs.js.map +1 -1
- package/dist/prop-controllers.es.js +1 -0
- package/dist/prop-controllers.es.js.map +1 -1
- package/dist/react.cjs.js +6 -3
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.es.js +6 -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/slate.cjs.js +5 -25
- package/dist/slate.cjs.js.map +1 -1
- package/dist/slate.es.js +5 -25
- 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/components/builtin/Button/Button.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/PlaceholderTableField/index.d.ts +1 -0
- package/dist/types/src/components/builtin/Form/components/Field/components/PlaceholderTableField/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/index.d.ts +1 -0
- package/dist/types/src/components/builtin/Form/components/Field/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Spinner/index.d.ts +1 -0
- package/dist/types/src/components/builtin/Form/components/Spinner/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts +1 -0
- package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts +1 -0
- package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts +1 -0
- package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/SocialLinks/options.d.ts +1 -0
- package/dist/types/src/components/builtin/SocialLinks/options.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Element/block.d.ts +1 -0
- package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Element/element.d.ts +1 -0
- package/dist/types/src/components/builtin/Text/components/Element/element.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts +1 -0
- package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +1 -0
- package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
- package/dist/types/src/components/page/Page.d.ts +1 -0
- package/dist/types/src/components/page/Page.d.ts.map +1 -1
- package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts +1 -0
- package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts.map +1 -1
- package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts +1 -0
- package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/types.d.ts +20 -6
- 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/document.d.ts +1 -0
- package/dist/types/src/next/document.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/next/preview-mode.d.ts +1 -0
- package/dist/types/src/next/preview-mode.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/components/render-hook.d.ts +1 -0
- package/dist/types/src/runtimes/react/components/render-hook.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/control.d.ts +1 -0
- package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/list.d.ts +1 -0
- package/dist/types/src/runtimes/react/controls/list.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/shape.d.ts +1 -0
- package/dist/types/src/runtimes/react/controls/shape.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls.d.ts +1 -0
- package/dist/types/src/runtimes/react/controls.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/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,44 +2,47 @@
|
|
|
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.cjs.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("./descriptors.cjs.js");
|
|
18
25
|
require("slate");
|
|
19
26
|
require("slate-react");
|
|
20
27
|
require("./introspection.cjs.js");
|
|
21
|
-
require("
|
|
22
|
-
require("@emotion/utils");
|
|
28
|
+
require("./isNonNullable.cjs.js");
|
|
23
29
|
require("./text-input.cjs.js");
|
|
24
30
|
require("./combobox.cjs.js");
|
|
25
|
-
require("use-sync-external-store/shim");
|
|
26
|
-
require("./types.cjs.js");
|
|
27
31
|
require("./box-models.cjs.js");
|
|
28
32
|
require("css-box-model");
|
|
29
33
|
require("color");
|
|
30
|
-
require("scroll-into-view-if-needed");
|
|
31
34
|
require("react-dom");
|
|
32
35
|
require("html-react-parser");
|
|
33
36
|
require("next/head");
|
|
34
37
|
require("@emotion/server/create-instance");
|
|
35
38
|
require("next/document");
|
|
36
|
-
require("cookie");
|
|
37
39
|
require("cors");
|
|
40
|
+
require("path-to-regexp");
|
|
41
|
+
require("cookie");
|
|
38
42
|
require("http-proxy");
|
|
39
43
|
require("set-cookie-parser");
|
|
40
44
|
require("uuid");
|
|
41
45
|
require("corporate-ipsum");
|
|
42
|
-
require("next/link");
|
|
43
46
|
require("next/package.json");
|
|
44
47
|
function _interopDefaultLegacy(e) {
|
|
45
48
|
return e && typeof e === "object" && "default" in e ? e : { "default": e };
|
|
@@ -55,11 +58,11 @@ function loadImage(src) {
|
|
|
55
58
|
});
|
|
56
59
|
}
|
|
57
60
|
function imageSizes(width) {
|
|
58
|
-
const baseDevice =
|
|
59
|
-
const baseWidth = baseDevice && width &&
|
|
61
|
+
const baseDevice = responsiveStyle.DEVICES.find((device) => device.maxWidth == null);
|
|
62
|
+
const baseWidth = baseDevice && width && responsiveStyle.findDeviceOverride(width, baseDevice.id);
|
|
60
63
|
const baseWidthSize = baseWidth == null || baseWidth.value.unit !== "px" ? "100vw" : `${baseWidth.value.value}px`;
|
|
61
|
-
return
|
|
62
|
-
const override =
|
|
64
|
+
return responsiveStyle.DEVICES.map((device) => {
|
|
65
|
+
const override = responsiveStyle.findDeviceOverride(width, device.id);
|
|
63
66
|
if (override == null || device.maxWidth == null || override.value.unit !== "px")
|
|
64
67
|
return null;
|
|
65
68
|
return `(max-width: ${device.maxWidth}px) ${Math.min(device.maxWidth, override.value.value)}px`;
|
|
@@ -80,7 +83,7 @@ const ImageComponent = React.forwardRef(function Image2({
|
|
|
80
83
|
placeholder = placeholders.placeholders.image,
|
|
81
84
|
className
|
|
82
85
|
}, ref) {
|
|
83
|
-
const fileData =
|
|
86
|
+
const fileData = responsiveStyle.useFile(file != null ? file : null);
|
|
84
87
|
const imageSrc = (fileData == null ? void 0 : fileData.publicUrl) ? fileData.publicUrl : placeholder.src;
|
|
85
88
|
const dataDimensions = (fileData == null ? void 0 : fileData.publicUrl) ? fileData == null ? void 0 : fileData.dimensions : placeholder.dimensions;
|
|
86
89
|
const [measuredDimensions, setMeasuredDimensions] = React.useState(null);
|
|
@@ -102,10 +105,10 @@ const ImageComponent = React.forwardRef(function Image2({
|
|
|
102
105
|
}, [dataDimensions, imageSrc]);
|
|
103
106
|
const dimensions = dataDimensions != null ? dataDimensions : measuredDimensions;
|
|
104
107
|
const Container = link ? index.Link : "div";
|
|
105
|
-
const containerClassName = css.cx(
|
|
108
|
+
const containerClassName = css.cx(responsiveStyle.useStyle({
|
|
106
109
|
lineHeight: 0,
|
|
107
110
|
overflow: "hidden"
|
|
108
|
-
}),
|
|
111
|
+
}), responsiveStyle.useStyle(responsiveStyle.responsiveWidth(width, dimensions == null ? void 0 : dimensions.width)), responsiveStyle.useStyle(responsiveStyle.responsiveStyle([opacity], ([opacity2 = 1]) => ({
|
|
109
112
|
opacity: opacity2
|
|
110
113
|
}))), margin, padding, border, borderRadius, boxShadow, className);
|
|
111
114
|
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":"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"}
|
package/dist/Image.es.js
CHANGED
|
@@ -1,43 +1,46 @@
|
|
|
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.es.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 "./descriptors.es.js";
|
|
16
23
|
import "slate";
|
|
17
24
|
import "slate-react";
|
|
18
25
|
import "./introspection.es.js";
|
|
19
|
-
import "
|
|
20
|
-
import "@emotion/utils";
|
|
26
|
+
import "./isNonNullable.es.js";
|
|
21
27
|
import "./text-input.es.js";
|
|
22
28
|
import "./combobox.es.js";
|
|
23
|
-
import "use-sync-external-store/shim";
|
|
24
|
-
import "./types.es.js";
|
|
25
29
|
import "./box-models.es.js";
|
|
26
30
|
import "css-box-model";
|
|
27
31
|
import "color";
|
|
28
|
-
import "scroll-into-view-if-needed";
|
|
29
32
|
import "react-dom";
|
|
30
33
|
import "html-react-parser";
|
|
31
34
|
import "next/head";
|
|
32
35
|
import "@emotion/server/create-instance";
|
|
33
36
|
import "next/document";
|
|
34
|
-
import "cookie";
|
|
35
37
|
import "cors";
|
|
38
|
+
import "path-to-regexp";
|
|
39
|
+
import "cookie";
|
|
36
40
|
import "http-proxy";
|
|
37
41
|
import "set-cookie-parser";
|
|
38
42
|
import "uuid";
|
|
39
43
|
import "corporate-ipsum";
|
|
40
|
-
import "next/link";
|
|
41
44
|
import "next/package.json";
|
|
42
45
|
const NextLegacyImage = NextImage;
|
|
43
46
|
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,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,QAAQC,KAAKC,CAAUA,WAAAA,OAAOC,YAAY,IAA1C;AACnB,QAAMC,YAAYL,cAAcD,SAASO,mBAAmBP,OAAOC,WAAWO,EAAnB;AACrDC,QAAAA,gBACJH,aAAa,QAAQA,UAAUI,MAAMC,SAAS,OAAO,UAAW,GAAEL,UAAUI,MAAMA;AAE7ER,SAAAA,QAAQU,IAAIR,CAAU,WAAA;AACrBS,UAAAA,WAAWN,mBAAmBP,OAAOI,OAAOI,EAAf;AAEnC,QAAIK,YAAY,QAAQT,OAAOC,YAAY,QAAQQ,SAASH,MAAMC,SAAS;AAAa,aAAA;AAEhF,WAAA,eAAcP,OAAOC,eAAeS,KAAKC,IAAIX,OAAOC,UAAUQ,SAASH,MAAMA,KAAzC;AAAA,EAAA,CALvC,EAOJM,OAAO,CAACC,SAA2CA,QAAQ,IAPvD,EAQJC,OAAO,CAACC,aAAaC,eAAgB,GAAEA,eAAeD,eAAeV,aARjE;AASR;AAOKY,MAAAA,iBAAiBC,WAAW,gBAChC;AAAA,EACEd;AAAAA,EACAR;AAAAA,EACAuB;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,cAAcC,aAAarC;AAAAA,EAC3BsC;AAAAA,GAEFC,KACA;AACMC,QAAAA,WAAWC,QAAQZ,sBAAQ,IAAT;AACxB,QAAMa,WAAWF,sCAAUG,aAAYH,SAASG,YAAYP,YAAYxC;AACxE,QAAMgD,iBAAiBJ,sCAAUG,aAAYH,qCAAUK,aAAaT,YAAYS;AAChF,QAAM,CAACC,oBAAoBC,yBAAyBC,SAA4B,IAApB;AAE5DC,YAAU,MAAM;AACVL,QAAAA;AAAgB;AAEhBM,QAAAA,YAAY;AAENR,cAAAA,QAAD,EACNS,KAAKnD,CAAS,UAAA;AACT,UAAA,CAACkD,WAAW;AACQ,8BAAA;AAAA,UAAE9C,OAAOJ,MAAMoD;AAAAA,UAAcC,QAAQrD,MAAMsD;AAAAA,QAAAA,CAA5C;AAAA,MACtB;AAAA,IAJL,CAAA,EAMGC,MAAMC,QAAQC,KANjB;AAQA,WAAO,MAAM;AACC,kBAAA;AAAA,IAAA;AAAA,EADd,GAGC,CAACb,gBAAgBF,QAAjB,CAhBM;AAkBT,QAAMG,aAAaD,0CAAkBE;AAC/BY,QAAAA,YAAYzB,OAAO0B,OAAO;AAC1BC,QAAAA,qBAAqBC,GACzBC,SAAS;AAAA,IAAEC,YAAY;AAAA,IAAGC,UAAU;AAAA,EAAA,CAA5B,GACRF,SAASG,gBAAgB7D,OAAOyC,yCAAYzC,KAApB,CAAhB,GACR0D,SAASI,gBAAgB,CAAChC,OAAD,GAAoB,CAAC,CAACA,WAAU,OAAQ;AAAA,IAAEA,SAAAA;AAAAA,EAAAA,EAA3C,CAAhB,GACRP,QACAC,SACAE,QACAC,cACAI,WACAG,SAT2B;AAY7B,MAAI,CAACO;AAAmB,WAAA;AAExB,6BACG,WAAD;AAAA,IAAW;AAAA,IAAY;AAAA,IAAU;AAAA,IAAQ,WAAWe;AAAAA,IAApD,UACGO,QAAmB,KAClBC,oBAAC,iBAAD;AAAA,MACE,QAAO;AAAA,MACP,KAAK1B;AAAAA,MACL,OAAO2B,WAAWjE,KAAD;AAAA,MACjB,KAAK4B;AAAAA,MACL,OAAOa,WAAWzC;AAAAA,MAClB,QAAQyC,WAAWQ;AAAAA,IAAAA,CAPtB,IAUCe,oBAAC,WAAD;AAAA,MACE,KAAK1B;AAAAA,MACL,OAAO2B,WAAWjE,KAAD;AAAA,MACjB,KAAK4B,4BAAW;AAAA,MAChB,OAAOa,WAAWzC;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,13 +3,11 @@ 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("@emotion/css");
|
|
11
|
-
require("@emotion/serialize");
|
|
12
|
-
require("@emotion/utils");
|
|
13
11
|
require("./descriptors.cjs.js");
|
|
14
12
|
require("slate");
|
|
15
13
|
require("slate-react");
|
|
@@ -17,24 +15,29 @@ require("./text-input.cjs.js");
|
|
|
17
15
|
require("./combobox.cjs.js");
|
|
18
16
|
require("use-sync-external-store/shim");
|
|
19
17
|
require("./introspection.cjs.js");
|
|
20
|
-
require("
|
|
21
|
-
require("redux-thunk");
|
|
22
|
-
require("./types.cjs.js");
|
|
18
|
+
require("./isNonNullable.cjs.js");
|
|
23
19
|
require("./box-models.cjs.js");
|
|
24
20
|
require("css-box-model");
|
|
25
21
|
require("color");
|
|
26
22
|
require("scroll-into-view-if-needed");
|
|
23
|
+
require("@emotion/css");
|
|
27
24
|
require("react-dom");
|
|
28
25
|
require("html-react-parser");
|
|
29
26
|
require("next/head");
|
|
27
|
+
require("./types.cjs.js");
|
|
30
28
|
require("@emotion/server/create-instance");
|
|
31
29
|
require("next/document");
|
|
32
|
-
require("cookie");
|
|
33
30
|
require("cors");
|
|
31
|
+
require("path-to-regexp");
|
|
32
|
+
require("cookie");
|
|
34
33
|
require("http-proxy");
|
|
35
34
|
require("set-cookie-parser");
|
|
36
35
|
require("uuid");
|
|
37
36
|
require("corporate-ipsum");
|
|
37
|
+
require("redux");
|
|
38
|
+
require("redux-thunk");
|
|
39
|
+
require("@emotion/serialize");
|
|
40
|
+
require("@emotion/utils");
|
|
38
41
|
function LiveProvider({
|
|
39
42
|
client,
|
|
40
43
|
children,
|
|
@@ -46,7 +49,7 @@ function LiveProvider({
|
|
|
46
49
|
}), [rootElements]);
|
|
47
50
|
return /* @__PURE__ */ jsxRuntime.jsx(next.StoreContext.Provider, {
|
|
48
51
|
value: store,
|
|
49
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
52
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(responsiveStyle.MakeswiftProvider, {
|
|
50
53
|
client,
|
|
51
54
|
children
|
|
52
55
|
})
|
|
@@ -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,13 +1,11 @@
|
|
|
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 "@emotion/css";
|
|
9
|
-
import "@emotion/serialize";
|
|
10
|
-
import "@emotion/utils";
|
|
11
9
|
import "./descriptors.es.js";
|
|
12
10
|
import "slate";
|
|
13
11
|
import "slate-react";
|
|
@@ -15,24 +13,29 @@ import "./text-input.es.js";
|
|
|
15
13
|
import "./combobox.es.js";
|
|
16
14
|
import "use-sync-external-store/shim";
|
|
17
15
|
import "./introspection.es.js";
|
|
18
|
-
import "
|
|
19
|
-
import "redux-thunk";
|
|
20
|
-
import "./types.es.js";
|
|
16
|
+
import "./isNonNullable.es.js";
|
|
21
17
|
import "./box-models.es.js";
|
|
22
18
|
import "css-box-model";
|
|
23
19
|
import "color";
|
|
24
20
|
import "scroll-into-view-if-needed";
|
|
21
|
+
import "@emotion/css";
|
|
25
22
|
import "react-dom";
|
|
26
23
|
import "html-react-parser";
|
|
27
24
|
import "next/head";
|
|
25
|
+
import "./types.es.js";
|
|
28
26
|
import "@emotion/server/create-instance";
|
|
29
27
|
import "next/document";
|
|
30
|
-
import "cookie";
|
|
31
28
|
import "cors";
|
|
29
|
+
import "path-to-regexp";
|
|
30
|
+
import "cookie";
|
|
32
31
|
import "http-proxy";
|
|
33
32
|
import "set-cookie-parser";
|
|
34
33
|
import "uuid";
|
|
35
34
|
import "corporate-ipsum";
|
|
35
|
+
import "redux";
|
|
36
|
+
import "redux-thunk";
|
|
37
|
+
import "@emotion/serialize";
|
|
38
|
+
import "@emotion/utils";
|
|
36
39
|
function LiveProvider({
|
|
37
40
|
client,
|
|
38
41
|
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
41
|
require("./descriptors.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,34 +49,36 @@ 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.cjs.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");
|
|
57
63
|
require("./introspection.cjs.js");
|
|
58
|
-
require("
|
|
59
|
-
require("@emotion/utils");
|
|
64
|
+
require("./isNonNullable.cjs.js");
|
|
60
65
|
require("./text-input.cjs.js");
|
|
61
66
|
require("./combobox.cjs.js");
|
|
62
|
-
require("./types.cjs.js");
|
|
63
67
|
require("./box-models.cjs.js");
|
|
64
68
|
require("css-box-model");
|
|
65
69
|
require("color");
|
|
66
|
-
require("scroll-into-view-if-needed");
|
|
67
70
|
require("react-dom");
|
|
68
71
|
require("html-react-parser");
|
|
69
72
|
require("next/head");
|
|
70
73
|
require("@emotion/server/create-instance");
|
|
71
74
|
require("next/document");
|
|
72
|
-
require("cookie");
|
|
73
75
|
require("cors");
|
|
76
|
+
require("path-to-regexp");
|
|
77
|
+
require("cookie");
|
|
74
78
|
require("http-proxy");
|
|
75
79
|
require("set-cookie-parser");
|
|
76
80
|
require("uuid");
|
|
77
81
|
require("corporate-ipsum");
|
|
78
|
-
require("next/link");
|
|
79
82
|
function _interopNamespace(e) {
|
|
80
83
|
if (e && e.__esModule)
|
|
81
84
|
return e;
|
|
@@ -126,7 +129,7 @@ function PlaceholderLink({
|
|
|
126
129
|
button
|
|
127
130
|
}) {
|
|
128
131
|
return /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
129
|
-
className:
|
|
132
|
+
className: responsiveStyle.useStyle({
|
|
130
133
|
width,
|
|
131
134
|
height: button === true ? 32 : 8,
|
|
132
135
|
backgroundColor: "#a1a8c2",
|
|
@@ -266,7 +269,7 @@ function DropDownMenu$1(_a) {
|
|
|
266
269
|
"position"
|
|
267
270
|
]);
|
|
268
271
|
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
|
|
269
|
-
className: css.cx(DROP_DOWN_MENU_CLASS_NAME,
|
|
272
|
+
className: css.cx(DROP_DOWN_MENU_CLASS_NAME, responsiveStyle.useStyle({
|
|
270
273
|
position: "absolute",
|
|
271
274
|
top: "100%",
|
|
272
275
|
left: position === "left" ? 0 : "auto",
|
|
@@ -305,7 +308,7 @@ const DropDownContainer = React.forwardRef(function DropDownContainer2(_c, ref)
|
|
|
305
308
|
]);
|
|
306
309
|
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
|
|
307
310
|
ref,
|
|
308
|
-
className: css.cx(
|
|
311
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
309
312
|
position: "relative",
|
|
310
313
|
[`&:hover .${DROP_DOWN_MENU_CLASS_NAME}`]: {
|
|
311
314
|
display: "block",
|
|
@@ -326,7 +329,7 @@ function DropDownItem$1(_e) {
|
|
|
326
329
|
]);
|
|
327
330
|
const colorData = next.useResponsiveColor(color);
|
|
328
331
|
return /* @__PURE__ */ jsxRuntime.jsx(index$1.Link, __spreadProps(__spreadValues({}, restOfProps), {
|
|
329
|
-
className: css.cx(
|
|
332
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
330
333
|
display: "block",
|
|
331
334
|
textDecoration: "none",
|
|
332
335
|
lineHeight: 1.4,
|
|
@@ -334,7 +337,7 @@ function DropDownItem$1(_e) {
|
|
|
334
337
|
color: "black",
|
|
335
338
|
backgroundColor: "transparent",
|
|
336
339
|
transition: "background-color 0.2s"
|
|
337
|
-
}),
|
|
340
|
+
}), responsiveStyle.useStyle(responsiveStyle.responsiveTextStyle(textStyle)), responsiveStyle.useStyle(responsiveStyle.responsiveStyle([colorData, textStyle], ([color2, textStyle2 = {}]) => {
|
|
338
341
|
const fontSize = textStyle2.fontSize || {
|
|
339
342
|
value: 14,
|
|
340
343
|
unit: "px"
|
|
@@ -344,14 +347,14 @@ function DropDownItem$1(_e) {
|
|
|
344
347
|
const letterSpacing = textStyle2.letterSpacing == null ? null : textStyle2.letterSpacing;
|
|
345
348
|
const textTransform = textStyle2.textTransform || [];
|
|
346
349
|
return {
|
|
347
|
-
color: color2 == null ? "black" :
|
|
350
|
+
color: color2 == null ? "black" : responsiveStyle.colorToString(color2),
|
|
348
351
|
fontSize: `${fontSize.value}${fontSize.unit}`,
|
|
349
352
|
fontWeight,
|
|
350
353
|
fontStyle: fontStyle.includes("italic") ? "italic" : "normal",
|
|
351
354
|
letterSpacing: letterSpacing == null ? "normal" : `${letterSpacing}px`,
|
|
352
355
|
textTransform: textTransform.includes("uppercase") ? "uppercase" : "none"
|
|
353
356
|
};
|
|
354
|
-
})),
|
|
357
|
+
})), responsiveStyle.useStyle({
|
|
355
358
|
"&:hover": {
|
|
356
359
|
backgroundColor: "rgba(0, 0, 0, 0.04)"
|
|
357
360
|
}
|
|
@@ -450,7 +453,7 @@ function DropDownMenu(_i) {
|
|
|
450
453
|
"open"
|
|
451
454
|
]);
|
|
452
455
|
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
|
|
453
|
-
className: css.cx(
|
|
456
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
454
457
|
display: open ? "flex" : "none",
|
|
455
458
|
flexDirection: "column",
|
|
456
459
|
padding: 8
|
|
@@ -464,7 +467,7 @@ function ButtonLink$1(_k) {
|
|
|
464
467
|
"className"
|
|
465
468
|
]);
|
|
466
469
|
return /* @__PURE__ */ jsxRuntime.jsx(Button["default"], __spreadProps(__spreadValues({}, restOfProps), {
|
|
467
|
-
className: css.cx(
|
|
470
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
468
471
|
margin: "8px 0"
|
|
469
472
|
}), className)
|
|
470
473
|
}));
|
|
@@ -481,13 +484,13 @@ function DropDownItem(_m) {
|
|
|
481
484
|
]);
|
|
482
485
|
const colorData = next.useResponsiveColor(color);
|
|
483
486
|
return /* @__PURE__ */ jsxRuntime.jsx(index$1.Link, __spreadProps(__spreadValues({}, restOfProps), {
|
|
484
|
-
className: css.cx(
|
|
487
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
485
488
|
textDecoration: "none",
|
|
486
489
|
lineHeight: 1.4,
|
|
487
490
|
padding: "8px 16px",
|
|
488
491
|
color: "black"
|
|
489
|
-
}),
|
|
490
|
-
color: color2 == null ? "black" :
|
|
492
|
+
}), responsiveStyle.useStyle(responsiveStyle.responsiveTextStyle(textStyle)), responsiveStyle.useStyle(responsiveStyle.responsiveStyle([colorData], ([color2]) => ({
|
|
493
|
+
color: color2 == null ? "black" : responsiveStyle.colorToString(color2)
|
|
491
494
|
}))), className)
|
|
492
495
|
}));
|
|
493
496
|
}
|
|
@@ -557,7 +560,7 @@ function ButtonLink(_q) {
|
|
|
557
560
|
"color"
|
|
558
561
|
]);
|
|
559
562
|
return /* @__PURE__ */ jsxRuntime.jsx(Button["default"], __spreadProps(__spreadValues({}, restOfProps), {
|
|
560
|
-
className: css.cx(
|
|
563
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
561
564
|
margin: "8px 0"
|
|
562
565
|
}), className),
|
|
563
566
|
textColor: next.useResponsiveColor(textColor),
|
|
@@ -577,7 +580,7 @@ function Container$1(_s) {
|
|
|
577
580
|
"open"
|
|
578
581
|
]);
|
|
579
582
|
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
|
|
580
|
-
className: css.cx(
|
|
583
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
581
584
|
position: "fixed",
|
|
582
585
|
flexDirection: "column",
|
|
583
586
|
width: "100%",
|
|
@@ -586,14 +589,14 @@ function Container$1(_s) {
|
|
|
586
589
|
overflowY: "auto",
|
|
587
590
|
zIndex: 9999,
|
|
588
591
|
maxWidth: 575
|
|
589
|
-
}),
|
|
592
|
+
}), responsiveStyle.useStyle(responsiveStyle.responsiveStyle([animation, backgroundColor], ([animation2, backgroundColor2]) => {
|
|
590
593
|
if (animation2 == null)
|
|
591
594
|
return {
|
|
592
595
|
display: "none"
|
|
593
596
|
};
|
|
594
597
|
return __spreadValues({
|
|
595
598
|
display: "flex",
|
|
596
|
-
backgroundColor: backgroundColor2 == null ? "black" :
|
|
599
|
+
backgroundColor: backgroundColor2 == null ? "black" : responsiveStyle.colorToString(backgroundColor2),
|
|
597
600
|
transform: open ? `translate3d(0,0,0)` : `translate3d(${{
|
|
598
601
|
coverRight: "",
|
|
599
602
|
coverLeft: "-"
|
|
@@ -622,7 +625,7 @@ function CloseIconContainer(_u) {
|
|
|
622
625
|
"color"
|
|
623
626
|
]);
|
|
624
627
|
return /* @__PURE__ */ jsxRuntime.jsx("button", __spreadProps(__spreadValues({}, restOfProps), {
|
|
625
|
-
className: css.cx(
|
|
628
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
626
629
|
position: "absolute",
|
|
627
630
|
top: 15,
|
|
628
631
|
right: 15,
|
|
@@ -631,8 +634,8 @@ function CloseIconContainer(_u) {
|
|
|
631
634
|
outline: 0,
|
|
632
635
|
background: "none",
|
|
633
636
|
fill: "currentcolor"
|
|
634
|
-
}),
|
|
635
|
-
color: color2 == null ? "rgba(161, 168, 194, 0.5)" :
|
|
637
|
+
}), responsiveStyle.useStyle(responsiveStyle.responsiveStyle([color], ([color2]) => ({
|
|
638
|
+
color: color2 == null ? "rgba(161, 168, 194, 0.5)" : responsiveStyle.colorToString(color2)
|
|
636
639
|
}))), className)
|
|
637
640
|
}));
|
|
638
641
|
}
|
|
@@ -687,10 +690,10 @@ const Container = React.forwardRef(function Container2(_w, ref) {
|
|
|
687
690
|
]);
|
|
688
691
|
return /* @__PURE__ */ jsxRuntime.jsx("nav", __spreadProps(__spreadValues({}, restOfProps), {
|
|
689
692
|
ref,
|
|
690
|
-
className: css.cx(
|
|
693
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
691
694
|
display: "flex",
|
|
692
695
|
alignItems: "center"
|
|
693
|
-
}), width, margin,
|
|
696
|
+
}), width, margin, responsiveStyle.useStyle(responsiveStyle.responsiveTextStyle(textStyle)), responsiveStyle.useStyle(responsiveStyle.responsiveStyle([gutter], ([gutter2 = {
|
|
694
697
|
value: 0,
|
|
695
698
|
unit: "px"
|
|
696
699
|
}]) => ({
|
|
@@ -709,11 +712,11 @@ function LinksContainer(_y) {
|
|
|
709
712
|
"mobileMenuAnimation"
|
|
710
713
|
]);
|
|
711
714
|
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
|
|
712
|
-
className: css.cx(
|
|
715
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
713
716
|
display: "flex",
|
|
714
717
|
alignItems: "center",
|
|
715
718
|
flexGrow: 1
|
|
716
|
-
}),
|
|
719
|
+
}), responsiveStyle.useStyle(responsiveStyle.responsiveStyle([alignment, mobileMenuAnimation], ([alignment2 = "flex-end", mobileMenuAnimation2]) => ({
|
|
717
720
|
display: mobileMenuAnimation2 == null ? "flex" : "none",
|
|
718
721
|
justifyContent: alignment2
|
|
719
722
|
}))), className)
|
|
@@ -732,7 +735,7 @@ function OpenIconContainer(_A) {
|
|
|
732
735
|
"color"
|
|
733
736
|
]);
|
|
734
737
|
return /* @__PURE__ */ jsxRuntime.jsx("button", __spreadProps(__spreadValues({}, restOfProps), {
|
|
735
|
-
className: css.cx(
|
|
738
|
+
className: css.cx(responsiveStyle.useStyle({
|
|
736
739
|
display: "none",
|
|
737
740
|
flexGrow: 1,
|
|
738
741
|
alignItems: "center",
|
|
@@ -741,10 +744,10 @@ function OpenIconContainer(_A) {
|
|
|
741
744
|
border: 0,
|
|
742
745
|
padding: 0,
|
|
743
746
|
fill: "currentcolor"
|
|
744
|
-
}),
|
|
747
|
+
}), responsiveStyle.useStyle(responsiveStyle.responsiveStyle([mobileMenuAnimation, alignment, color], ([mobileMenuAnimation2, alignment2 = "flex-end", color2]) => ({
|
|
745
748
|
display: mobileMenuAnimation2 == null ? "none" : "flex",
|
|
746
749
|
justifyContent: alignment2,
|
|
747
|
-
color: color2 == null ? "rgba(161, 168, 194, 0.5)" :
|
|
750
|
+
color: color2 == null ? "rgba(161, 168, 194, 0.5)" : responsiveStyle.colorToString(color2)
|
|
748
751
|
}))), className)
|
|
749
752
|
}));
|
|
750
753
|
}
|