@makeswift/runtime 0.9.0 → 0.9.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.
Files changed (183) hide show
  1. package/dist/Box.cjs.js +15 -14
  2. package/dist/Box.cjs.js.map +1 -1
  3. package/dist/Box.es.js +10 -9
  4. package/dist/Box.es.js.map +1 -1
  5. package/dist/Button.cjs.js +12 -11
  6. package/dist/Button.cjs.js.map +1 -1
  7. package/dist/Button.es.js +10 -9
  8. package/dist/Button.es.js.map +1 -1
  9. package/dist/Carousel.cjs.js +26 -25
  10. package/dist/Carousel.cjs.js.map +1 -1
  11. package/dist/Carousel.es.js +5 -4
  12. package/dist/Carousel.es.js.map +1 -1
  13. package/dist/Countdown.cjs.js +15 -14
  14. package/dist/Countdown.cjs.js.map +1 -1
  15. package/dist/Countdown.es.js +7 -6
  16. package/dist/Countdown.es.js.map +1 -1
  17. package/dist/Divider.cjs.js +12 -11
  18. package/dist/Divider.cjs.js.map +1 -1
  19. package/dist/Divider.es.js +10 -9
  20. package/dist/Divider.es.js.map +1 -1
  21. package/dist/Embed.cjs.js +4 -29
  22. package/dist/Embed.cjs.js.map +1 -1
  23. package/dist/Embed.es.js +3 -28
  24. package/dist/Embed.es.js.map +1 -1
  25. package/dist/Form.cjs.js +51 -50
  26. package/dist/Form.cjs.js.map +1 -1
  27. package/dist/Form.es.js +7 -6
  28. package/dist/Form.es.js.map +1 -1
  29. package/dist/Image.cjs.js +8 -7
  30. package/dist/Image.cjs.js.map +1 -1
  31. package/dist/Image.es.js +7 -6
  32. package/dist/Image.es.js.map +1 -1
  33. package/dist/LiveProvider.cjs.js +4 -3
  34. package/dist/LiveProvider.cjs.js.map +1 -1
  35. package/dist/LiveProvider.es.js +6 -5
  36. package/dist/LiveProvider.es.js.map +1 -1
  37. package/dist/Navigation.cjs.js +26 -25
  38. package/dist/Navigation.cjs.js.map +1 -1
  39. package/dist/Navigation.es.js +5 -4
  40. package/dist/Navigation.es.js.map +1 -1
  41. package/dist/PreviewProvider.cjs.js +6 -5
  42. package/dist/PreviewProvider.cjs.js.map +1 -1
  43. package/dist/PreviewProvider.es.js +6 -5
  44. package/dist/PreviewProvider.es.js.map +1 -1
  45. package/dist/ReadOnlyText.cjs.js +14 -13
  46. package/dist/ReadOnlyText.cjs.js.map +1 -1
  47. package/dist/ReadOnlyText.es.js +9 -8
  48. package/dist/ReadOnlyText.es.js.map +1 -1
  49. package/dist/ReadOnlyTextV2.cjs.js +11 -10
  50. package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
  51. package/dist/ReadOnlyTextV2.es.js +7 -6
  52. package/dist/ReadOnlyTextV2.es.js.map +1 -1
  53. package/dist/Root.cjs.js +7 -6
  54. package/dist/Root.cjs.js.map +1 -1
  55. package/dist/Root.es.js +5 -4
  56. package/dist/Root.es.js.map +1 -1
  57. package/dist/SocialLinks.cjs.js +14 -13
  58. package/dist/SocialLinks.cjs.js.map +1 -1
  59. package/dist/SocialLinks.es.js +10 -9
  60. package/dist/SocialLinks.es.js.map +1 -1
  61. package/dist/Text.cjs.js +4 -3
  62. package/dist/Text.cjs.js.map +1 -1
  63. package/dist/Text.es.js +5 -4
  64. package/dist/Text.es.js.map +1 -1
  65. package/dist/Video.cjs.js +4 -29
  66. package/dist/Video.cjs.js.map +1 -1
  67. package/dist/Video.es.js +3 -28
  68. package/dist/Video.es.js.map +1 -1
  69. package/dist/builder.cjs.js +5 -0
  70. package/dist/builder.cjs.js.map +1 -1
  71. package/dist/builder.es.js +5 -0
  72. package/dist/builder.es.js.map +1 -1
  73. package/dist/components.cjs.js +9 -8
  74. package/dist/components.cjs.js.map +1 -1
  75. package/dist/components.es.js +9 -8
  76. package/dist/components.es.js.map +1 -1
  77. package/dist/control-serialization.cjs.js +88 -9
  78. package/dist/control-serialization.cjs.js.map +1 -1
  79. package/dist/control-serialization.es.js +89 -10
  80. package/dist/control-serialization.es.js.map +1 -1
  81. package/dist/controls.cjs.js +10 -0
  82. package/dist/controls.cjs.js.map +1 -1
  83. package/dist/controls.es.js +6 -1
  84. package/dist/controls.es.js.map +1 -1
  85. package/dist/deepEqual.cjs.js +40 -0
  86. package/dist/deepEqual.cjs.js.map +1 -0
  87. package/dist/deepEqual.es.js +39 -0
  88. package/dist/deepEqual.es.js.map +1 -0
  89. package/dist/index.cjs.js +62 -91
  90. package/dist/index.cjs.js.map +1 -1
  91. package/dist/index.cjs10.js +8 -7
  92. package/dist/index.cjs10.js.map +1 -1
  93. package/dist/index.cjs2.js +13 -13
  94. package/dist/index.cjs2.js.map +1 -1
  95. package/dist/index.cjs4.js +2 -1
  96. package/dist/index.cjs4.js.map +1 -1
  97. package/dist/index.cjs8.js +4 -3
  98. package/dist/index.cjs8.js.map +1 -1
  99. package/dist/index.cjs9.js +69 -105
  100. package/dist/index.cjs9.js.map +1 -1
  101. package/dist/index.es.js +47 -75
  102. package/dist/index.es.js.map +1 -1
  103. package/dist/index.es10.js +5 -4
  104. package/dist/index.es10.js.map +1 -1
  105. package/dist/index.es2.js +2 -2
  106. package/dist/index.es3.js +1 -1
  107. package/dist/index.es4.js +2 -1
  108. package/dist/index.es4.js.map +1 -1
  109. package/dist/index.es6.js +1 -1
  110. package/dist/index.es8.js +4 -3
  111. package/dist/index.es8.js.map +1 -1
  112. package/dist/index.es9.js +71 -107
  113. package/dist/index.es9.js.map +1 -1
  114. package/dist/leaf.cjs.js +1 -1
  115. package/dist/leaf.cjs.js.map +1 -1
  116. package/dist/leaf.es.js +2 -2
  117. package/dist/main.cjs.js +5 -0
  118. package/dist/main.cjs.js.map +1 -1
  119. package/dist/main.es.js +5 -0
  120. package/dist/main.es.js.map +1 -1
  121. package/dist/next.cjs.js +4 -3
  122. package/dist/next.cjs.js.map +1 -1
  123. package/dist/next.es.js +5 -4
  124. package/dist/next.es.js.map +1 -1
  125. package/dist/prop-controllers.cjs.js +5 -0
  126. package/dist/prop-controllers.cjs.js.map +1 -1
  127. package/dist/prop-controllers.es.js +5 -0
  128. package/dist/prop-controllers.es.js.map +1 -1
  129. package/dist/react-page.cjs.js +376 -203
  130. package/dist/react-page.cjs.js.map +1 -1
  131. package/dist/react-page.es.js +349 -204
  132. package/dist/react-page.es.js.map +1 -1
  133. package/dist/react.cjs.js +4 -3
  134. package/dist/react.cjs.js.map +1 -1
  135. package/dist/react.es.js +4 -3
  136. package/dist/react.es.js.map +1 -1
  137. package/dist/slate.cjs.js +88 -4
  138. package/dist/slate.cjs.js.map +1 -1
  139. package/dist/slate.es.js +89 -5
  140. package/dist/slate.es.js.map +1 -1
  141. package/dist/types/src/builder/serialization/control-serialization.d.ts +3 -3
  142. package/dist/types/src/builder/serialization/control-serialization.d.ts.map +1 -1
  143. package/dist/types/src/builder/serialization/controls/rich-text-v2.d.ts +2 -2
  144. package/dist/types/src/builder/serialization/controls/rich-text-v2.d.ts.map +1 -1
  145. package/dist/types/src/builder/serialization/controls/style-v2.d.ts +5 -0
  146. package/dist/types/src/builder/serialization/controls/style-v2.d.ts.map +1 -0
  147. package/dist/types/src/components/builtin/Button/Button.d.ts +1 -1
  148. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
  149. package/dist/types/src/components/hooks/useIsomorphicLayoutEffect.d.ts +2 -2
  150. package/dist/types/src/components/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -1
  151. package/dist/types/src/controls/control.d.ts +3 -2
  152. package/dist/types/src/controls/control.d.ts.map +1 -1
  153. package/dist/types/src/controls/index.d.ts +1 -0
  154. package/dist/types/src/controls/index.d.ts.map +1 -1
  155. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +8 -3
  156. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  157. package/dist/types/src/controls/style-v2.d.ts +55 -0
  158. package/dist/types/src/controls/style-v2.d.ts.map +1 -0
  159. package/dist/types/src/prop-controllers/descriptors.d.ts +4 -3
  160. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  161. package/dist/types/src/prop-controllers/instances.d.ts +2 -2
  162. package/dist/types/src/prop-controllers/instances.d.ts.map +1 -1
  163. package/dist/types/src/runtimes/react/controls/control.d.ts +3 -2
  164. package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
  165. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts +2 -1
  166. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -1
  167. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts +1 -1
  168. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  169. package/dist/types/src/runtimes/react/controls/style-v2.d.ts +4 -0
  170. package/dist/types/src/runtimes/react/controls/style-v2.d.ts.map +1 -0
  171. package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
  172. package/dist/types/src/slate/BlockPlugin/index.d.ts +3 -0
  173. package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
  174. package/dist/types/src/slate/InlineModePlugin/index.d.ts +1 -0
  175. package/dist/types/src/slate/InlineModePlugin/index.d.ts.map +1 -1
  176. package/dist/types/src/slate/TextAlignPlugin/index.d.ts +9 -0
  177. package/dist/types/src/slate/TextAlignPlugin/index.d.ts.map +1 -0
  178. package/dist/types/src/slate/index.d.ts +1 -0
  179. package/dist/types/src/slate/index.d.ts.map +1 -1
  180. package/dist/types/src/slate/types.d.ts +18 -0
  181. package/dist/types/src/slate/types.d.ts.map +1 -1
  182. package/dist/useMediaQuery.es.js +1 -1
  183. package/package.json +1 -1
@@ -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 { Breakpoints, findBreakpointOverride } from '../../../state/modules/breakpoints'\nimport { placeholders } from '../../utils/placeholders'\nimport { Link } from '../../shared/Link'\nimport { cx } from '@emotion/css'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { useResponsiveStyle, useResponsiveWidth } from '../../utils/responsive-style'\nimport { useFile } from '../../../runtimes/react/hooks/makeswift-api'\nimport { major as nextMajorVersion } from '../../../next/next-version'\nimport { useBreakpoints } from '../../../runtimes/react'\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(breakpoints: Breakpoints, width?: Props['width']): string {\n const baseDevice = breakpoints.find(breakpoint => breakpoint.maxWidth == null)\n const baseWidth = baseDevice && width && findBreakpointOverride(breakpoints, width, baseDevice.id)\n const baseWidthSize =\n baseWidth == null || baseWidth.value.unit !== 'px' ? '100vw' : `${baseWidth.value.value}px`\n\n return breakpoints\n .map(breakpoint => {\n const override = findBreakpointOverride(breakpoints, width, breakpoint.id)\n\n if (override == null || breakpoint.maxWidth == null || override.value.unit !== 'px') {\n return null\n }\n\n return `(max-width: ${breakpoint.maxWidth}px) ${Math.min(\n breakpoint.maxWidth,\n override.value.value,\n )}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 const breakpoints = useBreakpoints()\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(useResponsiveWidth(width, dimensions?.width)),\n useStyle(useResponsiveStyle([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(breakpoints, width)}\n alt={altText}\n width={dimensions.width}\n height={dimensions.height}\n />\n ) : (\n <NextImage\n src={imageSrc}\n sizes={imageSizes(breakpoints, 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","breakpoints","width","baseDevice","find","breakpoint","maxWidth","baseWidth","findBreakpointOverride","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","useBreakpoints","useEffect","cleanedUp","then","naturalWidth","height","naturalHeight","catch","console","error","Container","Link","containerClassName","cx","useStyle","lineHeight","overflow","useResponsiveWidth","useResponsiveStyle","nextMajorVersion","_jsx","imageSizes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,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,aAA0BC,OAAgC;AAC5E,QAAMC,aAAaF,YAAYG,KAAKC,CAAcA,eAAAA,WAAWC,YAAY,IAAtD;AACnB,QAAMC,YAAYJ,cAAcD,SAASM,kBAAAA,uBAAuBP,aAAaC,OAAOC,WAAWM,EAAhC;AACzDC,QAAAA,gBACJH,aAAa,QAAQA,UAAUI,MAAMC,SAAS,OAAO,UAAW,GAAEL,UAAUI,MAAMA;AAE7EV,SAAAA,YACJY,IAAIR,CAAc,eAAA;AACXS,UAAAA,WAAWN,kBAAAA,uBAAuBP,aAAaC,OAAOG,WAAWI,EAAhC;AAEnCK,QAAAA,YAAY,QAAQT,WAAWC,YAAY,QAAQQ,SAASH,MAAMC,SAAS,MAAM;AAC5E,aAAA;AAAA,IACR;AAEO,WAAA,eAAcP,WAAWC,eAAeS,KAAKC,IACnDX,WAAWC,UACXQ,SAASH,MAAMA,KAF+B;AAAA,EAAA,CAR7C,EAaJM,OAAO,CAACC,SAA2CA,QAAQ,IAbvD,E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I,wBAAmB,CAACjC,OAAD,GAAoB,CAAC,CAACA,WAAU,OAAQ;AAAA,IAAEA,SAAAA;AAAAA,EAAAA,EAA3C,CAAnB,GACRP,QACAC,SACAE,QACAC,cACAI,WACAG,SAT2B;AAY7B,MAAI,CAACO;AAAmB,WAAA;AAExB,wCACG,WAAD;AAAA,IAAW;AAAA,IAAY;AAAA,IAAU;AAAA,IAAQ,WAAWgB;AAAAA,IAApD,UACGO,YAAAA,QAAmB,KAClBC,2BAAAA,IAAC,iBAAD;AAAA,MACE,QAAO;AAAA,MACP,KAAK3B;AAAAA,MACL,OAAO4B,WAAWlE,aAAaC,KAAd;AAAA,MACjB,KAAK2B;AAAAA,MACL,OAAOa,WAAWxC;AAAAA,MAClB,QAAQwC,WAAWS;AAAAA,IAAAA,CAPtB,IAUCe,2BAAA,IAAC1E,+BAAD;AAAA,MACE,KAAK+C;AAAAA,MACL,OAAO4B,WAAWlE,aAAaC,KAAd;AAAA,MACjB,KAAK2B,4BAAW;AAAA,MAChB,OAAOa,WAAWxC;AAAAA,MAClB,QAAQwC,WAAWS;AAAAA,MACnB,OAAO;AAAA,QACLjD,OAAO;AAAA,QACPiD,QAAQ;AAAA,MAFH;AAAA,IAAA,CANT;AAAA,EAAA,CAZN;AA0BD,CApFgC;;"}
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 { Breakpoints, findBreakpointOverride } from '../../../state/modules/breakpoints'\nimport { placeholders } from '../../utils/placeholders'\nimport { Link } from '../../shared/Link'\nimport { cx } from '@emotion/css'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { useResponsiveStyle, useResponsiveWidth } from '../../utils/responsive-style'\nimport { useFile } from '../../../runtimes/react/hooks/makeswift-api'\nimport { major as nextMajorVersion } from '../../../next/next-version'\nimport { useBreakpoints } from '../../../runtimes/react'\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(breakpoints: Breakpoints, width?: Props['width']): string {\n const baseDevice = breakpoints.find(breakpoint => breakpoint.maxWidth == null)\n const baseWidth = baseDevice && width && findBreakpointOverride(breakpoints, width, baseDevice.id)\n const baseWidthSize =\n baseWidth == null || baseWidth.value.unit !== 'px' ? '100vw' : `${baseWidth.value.value}px`\n\n return breakpoints\n .map(breakpoint => {\n const override = findBreakpointOverride(breakpoints, width, breakpoint.id)\n\n if (override == null || breakpoint.maxWidth == null || override.value.unit !== 'px') {\n return null\n }\n\n return `(max-width: ${breakpoint.maxWidth}px) ${Math.min(\n breakpoint.maxWidth,\n override.value.value,\n )}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 const breakpoints = useBreakpoints()\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(useResponsiveWidth(width, dimensions?.width)),\n useStyle(useResponsiveStyle([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(breakpoints, width)}\n alt={altText}\n width={dimensions.width}\n height={dimensions.height}\n />\n ) : (\n <NextImage\n src={imageSrc}\n sizes={imageSizes(breakpoints, 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","breakpoints","width","baseDevice","find","breakpoint","maxWidth","baseWidth","findBreakpointOverride","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","useBreakpoints","useEffect","cleanedUp","then","naturalWidth","height","naturalHeight","catch","console","error","Container","Link","containerClassName","cx","useStyle","lineHeight","overflow","useResponsiveWidth","useResponsiveStyle","nextMajorVersion","_jsx","imageSizes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,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,aAA0BC,OAAgC;AAC5E,QAAMC,aAAaF,YAAYG,KAAKC,CAAcA,eAAAA,WAAWC,YAAY,IAAtD;AACnB,QAAMC,YAAYJ,cAAcD,SAASM,kBAAAA,uBAAuBP,aAAaC,OAAOC,WAAWM,EAAhC;AACzDC,QAAAA,gBACJH,aAAa,QAAQA,UAAUI,MAAMC,SAAS,OAAO,UAAW,GAAEL,UAAUI,MAAMA;AAE7EV,SAAAA,YACJY,IAAIR,CAAc,eAAA;AACXS,UAAAA,WAAWN,kBAAAA,uBAAuBP,aAAaC,OAAOG,WAAWI,EAAhC;AAEnCK,QAAAA,YAAY,QAAQT,WAAWC,YAAY,QAAQQ,SAASH,MAAMC,SAAS,MAAM;AAC5E,aAAA;AAAA,IACR;AAEO,WAAA,eAAcP,WAAWC,eAAeS,KAAKC,IACnDX,WAAWC,UACXQ,SAASH,MAAMA,KAF+B;AAAA,EAAA,CAR7C,EAaJM,OAAO,CAACC,SAA2CA,QAAQ,IAbvD,EAcJC,OAAO,CAACC,aAAaC,eAAgB,GAAEA,eAAeD,eAAeV,aAdjE;AAeR;AAOKY,MAAAA,iBAAiBC,MAAAA,WAAW,gBAChC;AAAA,EACEd;AAAAA,EACAP;AAAAA,EACAsB;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;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ACG,WAAD;AAAA,IAAW;AAAA,IAAY;AAAA,IAAU;AAAA,IAAQ,WAAWgB;AAAAA,IAApD,UACGO,YAAAA,QAAmB,KAClBC,2BAAAA,IAAC,iBAAD;AAAA,MACE,QAAO;AAAA,MACP,KAAK3B;AAAAA,MACL,OAAO4B,WAAWlE,aAAaC,KAAd;AAAA,MACjB,KAAK2B;AAAAA,MACL,OAAOa,WAAWxC;AAAAA,MAClB,QAAQwC,WAAWS;AAAAA,IAAAA,CAPtB,IAUCe,2BAAA,IAAC1E,+BAAD;AAAA,MACE,KAAK+C;AAAAA,MACL,OAAO4B,WAAWlE,aAAaC,KAAd;AAAA,MACjB,KAAK2B,4BAAW;AAAA,MAChB,OAAOa,WAAWxC;AAAAA,MAClB,QAAQwC,WAAWS;AAAAA,MACnB,OAAO;AAAA,QACLjD,OAAO;AAAA,QACPiD,QAAQ;AAAA,MAFH;AAAA,IAAA,CANT;AAAA,EAAA,CAZN;AA0BD,CApFgC;;"}
package/dist/Image.es.js CHANGED
@@ -4,26 +4,27 @@ import { findBreakpointOverride } from "./state/breakpoints.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
- import { B as useFile, s as useBreakpoints, n as useStyle, p as useResponsiveWidth, o as useResponsiveStyle } from "./index.es.js";
7
+ import { Z as useStyle } from "./react-page.es.js";
8
+ import { z as useFile, r as useBreakpoints, o as useResponsiveWidth, n as useResponsiveStyle } from "./index.es.js";
8
9
  import { m as major } from "./next-version.es.js";
9
10
  import { jsx } from "react/jsx-runtime";
10
11
  import "./actions.es.js";
11
12
  import "scroll-into-view-if-needed";
12
13
  import "next/link";
13
- import "use-sync-external-store/shim/with-selector";
14
- import "next/dynamic";
15
- import "./react-page.es.js";
16
14
  import "redux";
17
15
  import "redux-thunk";
16
+ import "@emotion/serialize";
17
+ import "@emotion/utils";
18
18
  import "slate";
19
19
  import "is-hotkey";
20
20
  import "slate-react";
21
- import "@emotion/serialize";
22
- import "@emotion/utils";
21
+ import "use-sync-external-store/shim/with-selector";
22
+ import "next/dynamic";
23
23
  import "./text-input.es.js";
24
24
  import "./combobox.es.js";
25
25
  import "use-sync-external-store/shim";
26
26
  import "./types.es.js";
27
+ import "./deepEqual.es.js";
27
28
  import "./box-models.es.js";
28
29
  import "css-box-model";
29
30
  import "color";
@@ -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 { Breakpoints, findBreakpointOverride } from '../../../state/modules/breakpoints'\nimport { placeholders } from '../../utils/placeholders'\nimport { Link } from '../../shared/Link'\nimport { cx } from '@emotion/css'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { useResponsiveStyle, useResponsiveWidth } from '../../utils/responsive-style'\nimport { useFile } from '../../../runtimes/react/hooks/makeswift-api'\nimport { major as nextMajorVersion } from '../../../next/next-version'\nimport { useBreakpoints } from '../../../runtimes/react'\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(breakpoints: Breakpoints, width?: Props['width']): string {\n const baseDevice = breakpoints.find(breakpoint => breakpoint.maxWidth == null)\n const baseWidth = baseDevice && width && findBreakpointOverride(breakpoints, width, baseDevice.id)\n const baseWidthSize =\n baseWidth == null || baseWidth.value.unit !== 'px' ? '100vw' : `${baseWidth.value.value}px`\n\n return breakpoints\n .map(breakpoint => {\n const override = findBreakpointOverride(breakpoints, width, breakpoint.id)\n\n if (override == null || breakpoint.maxWidth == null || override.value.unit !== 'px') {\n return null\n }\n\n return `(max-width: ${breakpoint.maxWidth}px) ${Math.min(\n breakpoint.maxWidth,\n override.value.value,\n )}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 const breakpoints = useBreakpoints()\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(useResponsiveWidth(width, dimensions?.width)),\n useStyle(useResponsiveStyle([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(breakpoints, width)}\n alt={altText}\n width={dimensions.width}\n height={dimensions.height}\n />\n ) : (\n <NextImage\n src={imageSrc}\n sizes={imageSizes(breakpoints, 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","breakpoints","width","baseDevice","find","breakpoint","maxWidth","baseWidth","findBreakpointOverride","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","useBreakpoints","useEffect","cleanedUp","then","naturalWidth","height","naturalHeight","catch","console","error","Container","Link","containerClassName","cx","useStyle","lineHeight","overflow","useResponsiveWidth","useResponsiveStyle","nextMajorVersion","_jsx","imageSizes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,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,aAA0BC,OAAgC;AAC5E,QAAMC,aAAaF,YAAYG,KAAKC,CAAcA,eAAAA,WAAWC,YAAY,IAAtD;AACnB,QAAMC,YAAYJ,cAAcD,SAASM,uBAAuBP,aAAaC,OA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5C;AAAA,MACtB;AAAA,IAJL,CAAA,EAMGC,MAAMC,QAAQC,KANjB;AAQA,WAAO,MAAM;AACC,kBAAA;AAAA,IAAA;AAAA,EADd,GAGC,CAACd,gBAAgBF,QAAjB,CAhBM;AAkBT,QAAMG,aAAaD,0CAAkBE;AAC/Ba,QAAAA,YAAY1B,OAAO2B,OAAO;AAC1BC,QAAAA,qBAAqBC,GACzBC,SAAS;AAAA,IAAEC,YAAY;AAAA,IAAGC,UAAU;AAAA,EAAA,CAA5B,GACRF,SAASG,mBAAmB7D,OAAOwC,yCAAYxC,KAApB,CAAnB,GACR0D,SAASI,mBAAmB,CAACjC,OAAD,GAAoB,CAAC,CAACA,WAAU,OAAQ;AAAA,IAAEA,SAAAA;AAAAA,EAAAA,EAA3C,CAAnB,GACRP,QACAC,SACAE,QACAC,cACAI,WACAG,SAT2B;AAY7B,MAAI,CAACO;AAAmB,WAAA;AAExB,6BACG,WAAD;AAAA,IAAW;AAAA,IAAY;AAAA,IAAU;AAAA,IAAQ,WAAWgB;AAAAA,IAApD,UACGO,QAAmB,KAClBC,oBAAC,iBAAD;AAAA,MACE,QAAO;AAAA,MACP,KAAK3B;AAAAA,MACL,OAAO4B,WAAWlE,aAAaC,KAAd;AAAA,MACjB,KAAK2B;AAAAA,MACL,OAAOa,WAAWxC;AAAAA,MAClB,QAAQwC,WAAWS;AAAAA,IAAAA,CAPtB,IAUCe,oBAAC,WAAD;AAAA,MACE,KAAK3B;AAAAA,MACL,OAAO4B,WAAWlE,aAAaC,KAAd;AAAA,MACjB,KAAK2B,4BAAW;AAAA,MAChB,OAAOa,WAAWxC;AAAAA,MAClB,QAAQwC,WAAWS;AAAAA,MACnB,OAAO;AAAA,QACLjD,OAAO;AAAA,QACPiD,QAAQ;AAAA,MAFH;AAAA,IAAA,CANT;AAAA,EAAA,CAZN;AA0BD,CApFgC;;"}
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 { Breakpoints, findBreakpointOverride } from '../../../state/modules/breakpoints'\nimport { placeholders } from '../../utils/placeholders'\nimport { Link } from '../../shared/Link'\nimport { cx } from '@emotion/css'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { useResponsiveStyle, useResponsiveWidth } from '../../utils/responsive-style'\nimport { useFile } from '../../../runtimes/react/hooks/makeswift-api'\nimport { major as nextMajorVersion } from '../../../next/next-version'\nimport { useBreakpoints } from '../../../runtimes/react'\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(breakpoints: Breakpoints, width?: Props['width']): string {\n const baseDevice = breakpoints.find(breakpoint => breakpoint.maxWidth == null)\n const baseWidth = baseDevice && width && findBreakpointOverride(breakpoints, width, baseDevice.id)\n const baseWidthSize =\n baseWidth == null || baseWidth.value.unit !== 'px' ? '100vw' : `${baseWidth.value.value}px`\n\n return breakpoints\n .map(breakpoint => {\n const override = findBreakpointOverride(breakpoints, width, breakpoint.id)\n\n if (override == null || breakpoint.maxWidth == null || override.value.unit !== 'px') {\n return null\n }\n\n return `(max-width: ${breakpoint.maxWidth}px) ${Math.min(\n breakpoint.maxWidth,\n override.value.value,\n )}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 const breakpoints = useBreakpoints()\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(useResponsiveWidth(width, dimensions?.width)),\n useStyle(useResponsiveStyle([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(breakpoints, width)}\n alt={altText}\n width={dimensions.width}\n height={dimensions.height}\n />\n ) : (\n <NextImage\n src={imageSrc}\n sizes={imageSizes(breakpoints, 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","breakpoints","width","baseDevice","find","breakpoint","maxWidth","baseWidth","findBreakpointOverride","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","useBreakpoints","useEffect","cleanedUp","then","naturalWidth","height","naturalHeight","catch","console","error","Container","Link","containerClassName","cx","useStyle","lineHeight","overflow","useResponsiveWidth","useResponsiveStyle","nextMajorVersion","_jsx","imageSizes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,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,aAA0BC,OAAgC;AAC5E,QAAMC,aAAaF,YAAYG,KAAKC,CAAcA,eAAAA,WAAWC,YAAY,IAAtD;AACnB,QAAMC,YAAYJ,cAAcD,SAASM,uBAAuBP,aAAaC,OAAOC,WAAWM,EAAhC;AACzDC,QAAAA,gBACJH,aAAa,QAAQA,UAAUI,MAAMC,SAAS,OAAO,UAAW,GAAEL,UAAUI,MAAMA;AAE7EV,SAAAA,YACJY,IAAIR,CAAc,eAAA;AACXS,UAAAA,WAAWN,uBAAuBP,aAAaC,OAAOG,WAAWI,EAAhC;AAEnCK,QAAAA,YAAY,QAAQT,WAAWC,YAAY,QAAQQ,SAASH,MAAMC,SAAS,MAAM;AAC5E,aAAA;AAAA,IACR;AAEO,WAAA,e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F,SAASG,mBAAmB7D,OAAOwC,yCAAYxC,KAApB,CAAnB,GACR0D,SAASI,mBAAmB,CAACjC,OAAD,GAAoB,CAAC,CAACA,WAAU,OAAQ;AAAA,IAAEA,SAAAA;AAAAA,EAAAA,EAA3C,CAAnB,GACRP,QACAC,SACAE,QACAC,cACAI,WACAG,SAT2B;AAY7B,MAAI,CAACO;AAAmB,WAAA;AAExB,6BACG,WAAD;AAAA,IAAW;AAAA,IAAY;AAAA,IAAU;AAAA,IAAQ,WAAWgB;AAAAA,IAApD,UACGO,QAAmB,KAClBC,oBAAC,iBAAD;AAAA,MACE,QAAO;AAAA,MACP,KAAK3B;AAAAA,MACL,OAAO4B,WAAWlE,aAAaC,KAAd;AAAA,MACjB,KAAK2B;AAAAA,MACL,OAAOa,WAAWxC;AAAAA,MAClB,QAAQwC,WAAWS;AAAAA,IAAAA,CAPtB,IAUCe,oBAAC,WAAD;AAAA,MACE,KAAK3B;AAAAA,MACL,OAAO4B,WAAWlE,aAAaC,KAAd;AAAA,MACjB,KAAK2B,4BAAW;AAAA,MAChB,OAAOa,WAAWxC;AAAAA,MAClB,QAAQwC,WAAWS;AAAAA,MACnB,OAAO;AAAA,QACLjD,OAAO;AAAA,QACPiD,QAAQ;AAAA,MAFH;AAAA,IAAA,CANT;AAAA,EAAA,CAZN;AA0BD,CApFgC;;"}
@@ -7,9 +7,6 @@ var jsxRuntime = require("react/jsx-runtime");
7
7
  require("use-sync-external-store/shim/with-selector");
8
8
  require("next/dynamic");
9
9
  require("./actions.cjs.js");
10
- require("@emotion/css");
11
- require("@emotion/serialize");
12
- require("@emotion/utils");
13
10
  require("./text-input.cjs.js");
14
11
  require("./combobox.cjs.js");
15
12
  require("slate");
@@ -20,9 +17,13 @@ require("use-sync-external-store/shim");
20
17
  require("redux");
21
18
  require("redux-thunk");
22
19
  require("./types.cjs.js");
20
+ require("./deepEqual.cjs.js");
23
21
  require("./box-models.cjs.js");
24
22
  require("css-box-model");
25
23
  require("color");
24
+ require("@emotion/css");
25
+ require("@emotion/serialize");
26
+ require("@emotion/utils");
26
27
  require("scroll-into-view-if-needed");
27
28
  require("react-dom");
28
29
  require("html-react-parser");
@@ -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, ReactRuntime } 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 runtime?: ReactRuntime\n}\n\nexport default function LiveProvider({\n client,\n children,\n rootElements,\n runtime,\n}: Props): JSX.Element {\n const store = useMemo(\n () =>\n ReactPage.configureStore({\n preloadedState: runtime ? runtime.store.getState() : ReactRuntime.store.getState(),\n rootElements,\n }),\n [rootElements, runtime],\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","runtime","store","useMemo","ReactPage","preloadedState","getState","ReactRuntime","_jsx","StoreContext","MakeswiftProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaqC,sBAAA;AAAA,EACnCA;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,GACqB;AACfC,QAAAA,QAAQC,cACZ,MACEC,yBAAyB;AAAA,IACvBC,gBAAgBJ,UAAUA,QAAQC,MAAMI,aAAaC,KAAAA,aAAaL,MAAMI,SADjD;AAAA,IAEvBN;AAAAA,EAFF,CAAA,GAIF,CAACA,cAAcC,OAAf,CANmB;AAUnB,SAAAO,2BAAA,IAACC,kBAAa,UAAd;AAAA,IAAuB,OAAOP;AAAAA,IAA9B,yCACGQ,wBAAD;AAAA,MAAmB;AAAA,MAAiBX;AAAAA,IAAAA,CAApC;AAAA,EAAA,CAFJ;AAKD;;"}
1
+ {"version":3,"file":"LiveProvider.cjs.js","sources":["../src/runtimes/react/components/LiveProvider.tsx"],"sourcesContent":["import { ReactNode, useMemo } from 'react'\n\nimport { StoreContext, ReactRuntime } 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 runtime?: ReactRuntime\n}\n\nexport default function LiveProvider({\n client,\n children,\n rootElements,\n runtime,\n}: Props): JSX.Element {\n const store = useMemo(\n () =>\n ReactPage.configureStore({\n preloadedState: runtime ? runtime.store.getState() : ReactRuntime.store.getState(),\n rootElements,\n }),\n [rootElements, runtime],\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","runtime","store","useMemo","ReactPage","preloadedState","getState","ReactRuntime","_jsx","StoreContext","MakeswiftProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaqC,sBAAA;AAAA,EACnCA;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,GACqB;AACfC,QAAAA,QAAQC,cACZ,MACEC,yBAAyB;AAAA,IACvBC,gBAAgBJ,UAAUA,QAAQC,MAAMI,aAAaC,KAAAA,aAAaL,MAAMI,SADjD;AAAA,IAEvBN;AAAAA,EAFF,CAAA,GAIF,CAACA,cAAcC,OAAf,CANmB;AAUnB,SAAAO,2BAAA,IAACC,kBAAa,UAAd;AAAA,IAAuB,OAAOP;AAAAA,IAA9B,yCACGQ,wBAAD;AAAA,MAAmB;AAAA,MAAiBX;AAAAA,IAAAA,CAApC;AAAA,EAAA,CAFJ;AAKD;;"}
@@ -1,13 +1,10 @@
1
1
  import { useMemo } from "react";
2
- import { a as ReactRuntime, N as StoreContext, O as MakeswiftProvider } from "./index.es.js";
3
- import { ak as configureStore } from "./react-page.es.js";
2
+ import { a as ReactRuntime, L as StoreContext, M as MakeswiftProvider } from "./index.es.js";
3
+ import { am as configureStore } from "./react-page.es.js";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  import "use-sync-external-store/shim/with-selector";
6
6
  import "next/dynamic";
7
7
  import "./actions.es.js";
8
- import "@emotion/css";
9
- import "@emotion/serialize";
10
- import "@emotion/utils";
11
8
  import "./text-input.es.js";
12
9
  import "./combobox.es.js";
13
10
  import "slate";
@@ -18,9 +15,13 @@ import "use-sync-external-store/shim";
18
15
  import "redux";
19
16
  import "redux-thunk";
20
17
  import "./types.es.js";
18
+ import "./deepEqual.es.js";
21
19
  import "./box-models.es.js";
22
20
  import "css-box-model";
23
21
  import "color";
22
+ import "@emotion/css";
23
+ import "@emotion/serialize";
24
+ import "@emotion/utils";
24
25
  import "scroll-into-view-if-needed";
25
26
  import "react-dom";
26
27
  import "html-react-parser";
@@ -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, ReactRuntime } 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 runtime?: ReactRuntime\n}\n\nexport default function LiveProvider({\n client,\n children,\n rootElements,\n runtime,\n}: Props): JSX.Element {\n const store = useMemo(\n () =>\n ReactPage.configureStore({\n preloadedState: runtime ? runtime.store.getState() : ReactRuntime.store.getState(),\n rootElements,\n }),\n [rootElements, runtime],\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","runtime","store","useMemo","ReactPage","preloadedState","getState","ReactRuntime","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaqC,sBAAA;AAAA,EACnCA;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,GACqB;AACfC,QAAAA,QAAQC,QACZ,MACEC,eAAyB;AAAA,IACvBC,gBAAgBJ,UAAUA,QAAQC,MAAMI,aAAaC,aAAaL,MAAMI,SADjD;AAAA,IAEvBN;AAAAA,EAFF,CAAA,GAIF,CAACA,cAAcC,OAAf,CANmB;AAUnB,SAAAO,oBAAC,aAAa,UAAd;AAAA,IAAuB,OAAON;AAAAA,IAA9B,8BACG,mBAAD;AAAA,MAAmB;AAAA,MAAiBH;AAAAA,IAAAA,CAApC;AAAA,EAAA,CAFJ;AAKD;;"}
1
+ {"version":3,"file":"LiveProvider.es.js","sources":["../src/runtimes/react/components/LiveProvider.tsx"],"sourcesContent":["import { ReactNode, useMemo } from 'react'\n\nimport { StoreContext, ReactRuntime } 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 runtime?: ReactRuntime\n}\n\nexport default function LiveProvider({\n client,\n children,\n rootElements,\n runtime,\n}: Props): JSX.Element {\n const store = useMemo(\n () =>\n ReactPage.configureStore({\n preloadedState: runtime ? runtime.store.getState() : ReactRuntime.store.getState(),\n rootElements,\n }),\n [rootElements, runtime],\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","runtime","store","useMemo","ReactPage","preloadedState","getState","ReactRuntime","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaqC,sBAAA;AAAA,EACnCA;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,GACqB;AACfC,QAAAA,QAAQC,QACZ,MACEC,eAAyB;AAAA,IACvBC,gBAAgBJ,UAAUA,QAAQC,MAAMI,aAAaC,aAAaL,MAAMI,SADjD;AAAA,IAEvBN;AAAAA,EAFF,CAAA,GAIF,CAACA,cAAcC,OAAf,CANmB;AAUnB,SAAAO,oBAAC,aAAa,UAAd;AAAA,IAAuB,OAAON;AAAAA,IAA9B,8BACG,mBAAD;AAAA,MAAmB;AAAA,MAAiBH;AAAAA,IAAAA,CAApC;AAAA,EAAA,CAFJ;AAKD;;"}
@@ -35,10 +35,10 @@ 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 next = require("./index.cjs.js");
38
+ var reactPage = require("./react-page.cjs.js");
39
39
  var jsxRuntime = require("react/jsx-runtime");
40
+ var next = require("./index.cjs.js");
40
41
  require("use-sync-external-store/shim");
41
- require("./react-page.cjs.js");
42
42
  require("slate");
43
43
  require("./state/breakpoints.cjs.js");
44
44
  require("is-hotkey");
@@ -53,15 +53,16 @@ require("next/package.json");
53
53
  require("./actions.cjs.js");
54
54
  require("scroll-into-view-if-needed");
55
55
  require("next/link");
56
- require("use-sync-external-store/shim/with-selector");
57
- require("next/dynamic");
58
56
  require("redux");
59
57
  require("redux-thunk");
60
58
  require("@emotion/serialize");
61
59
  require("@emotion/utils");
60
+ require("use-sync-external-store/shim/with-selector");
61
+ require("next/dynamic");
62
62
  require("./text-input.cjs.js");
63
63
  require("./combobox.cjs.js");
64
64
  require("./types.cjs.js");
65
+ require("./deepEqual.cjs.js");
65
66
  require("./box-models.cjs.js");
66
67
  require("css-box-model");
67
68
  require("color");
@@ -129,7 +130,7 @@ function PlaceholderLink({
129
130
  button
130
131
  }) {
131
132
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
132
- className: next.useStyle({
133
+ className: reactPage.useStyle({
133
134
  width,
134
135
  height: button === true ? 32 : 8,
135
136
  backgroundColor: "#a1a8c2",
@@ -269,7 +270,7 @@ function DropDownMenu$1(_a) {
269
270
  "position"
270
271
  ]);
271
272
  return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
272
- className: css.cx(DROP_DOWN_MENU_CLASS_NAME, next.useStyle({
273
+ className: css.cx(DROP_DOWN_MENU_CLASS_NAME, reactPage.useStyle({
273
274
  position: "absolute",
274
275
  top: "100%",
275
276
  left: position === "left" ? 0 : "auto",
@@ -308,7 +309,7 @@ const DropDownContainer = React.forwardRef(function DropDownContainer2(_c, ref)
308
309
  ]);
309
310
  return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
310
311
  ref,
311
- className: css.cx(next.useStyle({
312
+ className: css.cx(reactPage.useStyle({
312
313
  position: "relative",
313
314
  [`&:hover .${DROP_DOWN_MENU_CLASS_NAME}`]: {
314
315
  display: "block",
@@ -329,7 +330,7 @@ function DropDownItem$1(_e) {
329
330
  ]);
330
331
  const colorData = next.useResponsiveColor(color);
331
332
  return /* @__PURE__ */ jsxRuntime.jsx(index$1.Link, __spreadProps(__spreadValues({}, restOfProps), {
332
- className: css.cx(next.useStyle({
333
+ className: css.cx(reactPage.useStyle({
333
334
  display: "block",
334
335
  textDecoration: "none",
335
336
  lineHeight: 1.4,
@@ -337,7 +338,7 @@ function DropDownItem$1(_e) {
337
338
  color: "black",
338
339
  backgroundColor: "transparent",
339
340
  transition: "background-color 0.2s"
340
- }), next.useStyle(next.useResponsiveTextStyle(textStyle)), next.useStyle(next.useResponsiveStyle([colorData, textStyle], ([color2, textStyle2 = {}]) => {
341
+ }), reactPage.useStyle(next.useResponsiveTextStyle(textStyle)), reactPage.useStyle(next.useResponsiveStyle([colorData, textStyle], ([color2, textStyle2 = {}]) => {
341
342
  const fontSize = textStyle2.fontSize || {
342
343
  value: 14,
343
344
  unit: "px"
@@ -354,7 +355,7 @@ function DropDownItem$1(_e) {
354
355
  letterSpacing: letterSpacing == null ? "normal" : `${letterSpacing}px`,
355
356
  textTransform: textTransform.includes("uppercase") ? "uppercase" : "none"
356
357
  };
357
- })), next.useStyle({
358
+ })), reactPage.useStyle({
358
359
  "&:hover": {
359
360
  backgroundColor: "rgba(0, 0, 0, 0.04)"
360
361
  }
@@ -453,7 +454,7 @@ function DropDownMenu(_i) {
453
454
  "open"
454
455
  ]);
455
456
  return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
456
- className: css.cx(next.useStyle({
457
+ className: css.cx(reactPage.useStyle({
457
458
  display: open ? "flex" : "none",
458
459
  flexDirection: "column",
459
460
  padding: 8
@@ -467,7 +468,7 @@ function ButtonLink$1(_k) {
467
468
  "className"
468
469
  ]);
469
470
  return /* @__PURE__ */ jsxRuntime.jsx(Button["default"], __spreadProps(__spreadValues({}, restOfProps), {
470
- className: css.cx(next.useStyle({
471
+ className: css.cx(reactPage.useStyle({
471
472
  margin: "8px 0"
472
473
  }), className)
473
474
  }));
@@ -484,12 +485,12 @@ function DropDownItem(_m) {
484
485
  ]);
485
486
  const colorData = next.useResponsiveColor(color);
486
487
  return /* @__PURE__ */ jsxRuntime.jsx(index$1.Link, __spreadProps(__spreadValues({}, restOfProps), {
487
- className: css.cx(next.useStyle({
488
+ className: css.cx(reactPage.useStyle({
488
489
  textDecoration: "none",
489
490
  lineHeight: 1.4,
490
491
  padding: "8px 16px",
491
492
  color: "black"
492
- }), next.useStyle(next.useResponsiveTextStyle(textStyle)), next.useStyle(next.useResponsiveStyle([colorData], ([color2]) => ({
493
+ }), reactPage.useStyle(next.useResponsiveTextStyle(textStyle)), reactPage.useStyle(next.useResponsiveStyle([colorData], ([color2]) => ({
493
494
  color: color2 == null ? "black" : next.colorToString(color2)
494
495
  }))), className)
495
496
  }));
@@ -560,7 +561,7 @@ function ButtonLink(_q) {
560
561
  "color"
561
562
  ]);
562
563
  return /* @__PURE__ */ jsxRuntime.jsx(Button["default"], __spreadProps(__spreadValues({}, restOfProps), {
563
- className: css.cx(next.useStyle({
564
+ className: css.cx(reactPage.useStyle({
564
565
  margin: "8px 0"
565
566
  }), className),
566
567
  textColor: next.useResponsiveColor(textColor),
@@ -580,7 +581,7 @@ function Container$1(_s) {
580
581
  "open"
581
582
  ]);
582
583
  return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
583
- className: css.cx(next.useStyle({
584
+ className: css.cx(reactPage.useStyle({
584
585
  position: "fixed",
585
586
  flexDirection: "column",
586
587
  width: "100%",
@@ -589,7 +590,7 @@ function Container$1(_s) {
589
590
  overflowY: "auto",
590
591
  zIndex: 9999,
591
592
  maxWidth: 575
592
- }), next.useStyle(next.useResponsiveStyle([animation, backgroundColor], ([animation2, backgroundColor2]) => {
593
+ }), reactPage.useStyle(next.useResponsiveStyle([animation, backgroundColor], ([animation2, backgroundColor2]) => {
593
594
  if (animation2 == null)
594
595
  return {
595
596
  display: "none"
@@ -625,7 +626,7 @@ function CloseIconContainer(_u) {
625
626
  "color"
626
627
  ]);
627
628
  return /* @__PURE__ */ jsxRuntime.jsx("button", __spreadProps(__spreadValues({}, restOfProps), {
628
- className: css.cx(next.useStyle({
629
+ className: css.cx(reactPage.useStyle({
629
630
  position: "absolute",
630
631
  top: 15,
631
632
  right: 15,
@@ -634,7 +635,7 @@ function CloseIconContainer(_u) {
634
635
  outline: 0,
635
636
  background: "none",
636
637
  fill: "currentcolor"
637
- }), next.useStyle(next.useResponsiveStyle([color], ([color2]) => ({
638
+ }), reactPage.useStyle(next.useResponsiveStyle([color], ([color2]) => ({
638
639
  color: color2 == null ? "rgba(161, 168, 194, 0.5)" : next.colorToString(color2)
639
640
  }))), className)
640
641
  }));
@@ -690,10 +691,10 @@ const Container = React.forwardRef(function Container2(_w, ref) {
690
691
  ]);
691
692
  return /* @__PURE__ */ jsxRuntime.jsx("nav", __spreadProps(__spreadValues({}, restOfProps), {
692
693
  ref,
693
- className: css.cx(next.useStyle({
694
+ className: css.cx(reactPage.useStyle({
694
695
  display: "flex",
695
696
  alignItems: "center"
696
- }), width, margin, next.useStyle(next.useResponsiveTextStyle(textStyle)), next.useStyle(next.useResponsiveStyle([gutter], ([gutter2 = {
697
+ }), width, margin, reactPage.useStyle(next.useResponsiveTextStyle(textStyle)), reactPage.useStyle(next.useResponsiveStyle([gutter], ([gutter2 = {
697
698
  value: 0,
698
699
  unit: "px"
699
700
  }]) => ({
@@ -712,11 +713,11 @@ function LinksContainer(_y) {
712
713
  "mobileMenuAnimation"
713
714
  ]);
714
715
  return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
715
- className: css.cx(next.useStyle({
716
+ className: css.cx(reactPage.useStyle({
716
717
  display: "flex",
717
718
  alignItems: "center",
718
719
  flexGrow: 1
719
- }), next.useStyle(next.useResponsiveStyle([alignment, mobileMenuAnimation], ([alignment2 = "flex-end", mobileMenuAnimation2]) => ({
720
+ }), reactPage.useStyle(next.useResponsiveStyle([alignment, mobileMenuAnimation], ([alignment2 = "flex-end", mobileMenuAnimation2]) => ({
720
721
  display: mobileMenuAnimation2 == null ? "flex" : "none",
721
722
  justifyContent: alignment2
722
723
  }))), className)
@@ -735,7 +736,7 @@ function OpenIconContainer(_A) {
735
736
  "color"
736
737
  ]);
737
738
  return /* @__PURE__ */ jsxRuntime.jsx("button", __spreadProps(__spreadValues({}, restOfProps), {
738
- className: css.cx(next.useStyle({
739
+ className: css.cx(reactPage.useStyle({
739
740
  display: "none",
740
741
  flexGrow: 1,
741
742
  alignItems: "center",
@@ -744,7 +745,7 @@ function OpenIconContainer(_A) {
744
745
  border: 0,
745
746
  padding: 0,
746
747
  fill: "currentcolor"
747
- }), next.useStyle(next.useResponsiveStyle([mobileMenuAnimation, alignment, color], ([mobileMenuAnimation2, alignment2 = "flex-end", color2]) => ({
748
+ }), reactPage.useStyle(next.useResponsiveStyle([mobileMenuAnimation, alignment, color], ([mobileMenuAnimation2, alignment2 = "flex-end", color2]) => ({
748
749
  display: mobileMenuAnimation2 == null ? "none" : "flex",
749
750
  justifyContent: alignment2,
750
751
  color: color2 == null ? "rgba(161, 168, 194, 0.5)" : next.colorToString(color2)