@makeswift/runtime 0.8.5 → 0.8.7

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 (239) hide show
  1. package/dist/Box.cjs.js +11 -11
  2. package/dist/Box.cjs.js.map +1 -1
  3. package/dist/Box.es.js +9 -9
  4. package/dist/Box.es.js.map +1 -1
  5. package/dist/Button.cjs.js +36 -37
  6. package/dist/Button.cjs.js.map +1 -1
  7. package/dist/Button.es.js +13 -14
  8. package/dist/Button.es.js.map +1 -1
  9. package/dist/Carousel.cjs.js +38 -37
  10. package/dist/Carousel.cjs.js.map +1 -1
  11. package/dist/Carousel.es.js +19 -18
  12. package/dist/Carousel.es.js.map +1 -1
  13. package/dist/Countdown.cjs.js +55 -29
  14. package/dist/Countdown.cjs.js.map +1 -1
  15. package/dist/Countdown.es.js +35 -9
  16. package/dist/Countdown.es.js.map +1 -1
  17. package/dist/Divider.cjs.js +36 -10
  18. package/dist/Divider.cjs.js.map +1 -1
  19. package/dist/Divider.es.js +31 -5
  20. package/dist/Divider.es.js.map +1 -1
  21. package/dist/Embed.cjs.js +31 -5
  22. package/dist/Embed.cjs.js.map +1 -1
  23. package/dist/Embed.es.js +30 -4
  24. package/dist/Embed.es.js.map +1 -1
  25. package/dist/Form.cjs.js +72 -73
  26. package/dist/Form.cjs.js.map +1 -1
  27. package/dist/Form.es.js +32 -33
  28. package/dist/Form.es.js.map +1 -1
  29. package/dist/Image.cjs.js +22 -21
  30. package/dist/Image.cjs.js.map +1 -1
  31. package/dist/Image.es.js +20 -19
  32. package/dist/Image.es.js.map +1 -1
  33. package/dist/LiveProvider.cjs.js +12 -12
  34. package/dist/LiveProvider.cjs.js.map +1 -1
  35. package/dist/LiveProvider.es.js +12 -12
  36. package/dist/LiveProvider.es.js.map +1 -1
  37. package/dist/Navigation.cjs.js +33 -34
  38. package/dist/Navigation.cjs.js.map +1 -1
  39. package/dist/Navigation.es.js +14 -15
  40. package/dist/Navigation.es.js.map +1 -1
  41. package/dist/PreviewProvider.cjs.js +16 -13
  42. package/dist/PreviewProvider.cjs.js.map +1 -1
  43. package/dist/PreviewProvider.es.js +16 -13
  44. package/dist/PreviewProvider.es.js.map +1 -1
  45. package/dist/ReadOnlyText.cjs.js +15 -16
  46. package/dist/ReadOnlyText.cjs.js.map +1 -1
  47. package/dist/ReadOnlyText.es.js +11 -12
  48. package/dist/ReadOnlyText.es.js.map +1 -1
  49. package/dist/Root.cjs.js +10 -10
  50. package/dist/Root.cjs.js.map +1 -1
  51. package/dist/Root.es.js +8 -8
  52. package/dist/SocialLinks.cjs.js +12 -13
  53. package/dist/SocialLinks.cjs.js.map +1 -1
  54. package/dist/SocialLinks.es.js +7 -8
  55. package/dist/SocialLinks.es.js.map +1 -1
  56. package/dist/Text.cjs.js +3 -4
  57. package/dist/Text.cjs.js.map +1 -1
  58. package/dist/Text.es.js +4 -5
  59. package/dist/Text.es.js.map +1 -1
  60. package/dist/Video.cjs.js +31 -5
  61. package/dist/Video.cjs.js.map +1 -1
  62. package/dist/Video.es.js +30 -4
  63. package/dist/Video.es.js.map +1 -1
  64. package/dist/actions.cjs.js +6 -1
  65. package/dist/actions.cjs.js.map +1 -1
  66. package/dist/actions.es.js +6 -2
  67. package/dist/actions.es.js.map +1 -1
  68. package/dist/components.cjs.js +10 -10
  69. package/dist/components.es.js +10 -10
  70. package/dist/constants.cjs.js +13 -3
  71. package/dist/constants.cjs.js.map +1 -1
  72. package/dist/constants.es.js +13 -4
  73. package/dist/constants.es.js.map +1 -1
  74. package/dist/descriptors.cjs.js.map +1 -1
  75. package/dist/descriptors.es.js.map +1 -1
  76. package/dist/index.cjs.js +1010 -163
  77. package/dist/index.cjs.js.map +1 -1
  78. package/dist/index.cjs2.js +29 -29
  79. package/dist/index.cjs2.js.map +1 -1
  80. package/dist/index.cjs3.js +1 -2
  81. package/dist/index.cjs3.js.map +1 -1
  82. package/dist/index.cjs4.js +2 -2
  83. package/dist/index.cjs4.js.map +1 -1
  84. package/dist/index.cjs5.js +262 -109
  85. package/dist/index.cjs5.js.map +1 -1
  86. package/dist/index.cjs6.js +3 -4
  87. package/dist/index.cjs6.js.map +1 -1
  88. package/dist/index.cjs7.js +16 -17
  89. package/dist/index.cjs7.js.map +1 -1
  90. package/dist/index.es.js +965 -133
  91. package/dist/index.es.js.map +1 -1
  92. package/dist/index.es2.js +6 -6
  93. package/dist/index.es2.js.map +1 -1
  94. package/dist/index.es3.js +1 -2
  95. package/dist/index.es3.js.map +1 -1
  96. package/dist/index.es4.js +2 -2
  97. package/dist/index.es4.js.map +1 -1
  98. package/dist/index.es5.js +262 -109
  99. package/dist/index.es5.js.map +1 -1
  100. package/dist/index.es6.js +3 -4
  101. package/dist/index.es6.js.map +1 -1
  102. package/dist/index.es7.js +12 -13
  103. package/dist/index.es7.js.map +1 -1
  104. package/dist/introspection.cjs.js +5 -2
  105. package/dist/introspection.cjs.js.map +1 -1
  106. package/dist/introspection.es.js +4 -2
  107. package/dist/introspection.es.js.map +1 -1
  108. package/dist/leaf.cjs.js +15 -17
  109. package/dist/leaf.cjs.js.map +1 -1
  110. package/dist/leaf.es.js +10 -11
  111. package/dist/leaf.es.js.map +1 -1
  112. package/dist/main.cjs.js +2 -1
  113. package/dist/main.cjs.js.map +1 -1
  114. package/dist/main.es.js +2 -2
  115. package/dist/next.cjs.js +5 -6
  116. package/dist/next.cjs.js.map +1 -1
  117. package/dist/next.es.js +6 -7
  118. package/dist/next.es.js.map +1 -1
  119. package/dist/prop-controllers.cjs.js +0 -1
  120. package/dist/prop-controllers.cjs.js.map +1 -1
  121. package/dist/prop-controllers.es.js +0 -1
  122. package/dist/prop-controllers.es.js.map +1 -1
  123. package/dist/react.cjs.js +3 -4
  124. package/dist/react.cjs.js.map +1 -1
  125. package/dist/react.es.js +3 -4
  126. package/dist/react.es.js.map +1 -1
  127. package/dist/slate.cjs.js +1 -12
  128. package/dist/slate.cjs.js.map +1 -1
  129. package/dist/slate.es.js +1 -12
  130. package/dist/slate.es.js.map +1 -1
  131. package/dist/state/breakpoints.cjs.js +175 -0
  132. package/dist/state/breakpoints.cjs.js.map +1 -0
  133. package/dist/state/breakpoints.es.js +160 -0
  134. package/dist/state/breakpoints.es.js.map +1 -0
  135. package/dist/types/src/components/builtin/Box/Box.d.ts.map +1 -1
  136. package/dist/types/src/components/builtin/Box/register.d.ts.map +1 -1
  137. package/dist/types/src/components/builtin/Button/Button.d.ts.map +1 -1
  138. package/dist/types/src/components/builtin/Button/register.d.ts.map +1 -1
  139. package/dist/types/src/components/builtin/Carousel/Carousel.d.ts.map +1 -1
  140. package/dist/types/src/components/builtin/Carousel/register.d.ts.map +1 -1
  141. package/dist/types/src/components/builtin/Countdown/register.d.ts.map +1 -1
  142. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
  143. package/dist/types/src/components/builtin/Form/components/Field/components/Label/index.d.ts.map +1 -1
  144. package/dist/types/src/components/builtin/Form/register.d.ts.map +1 -1
  145. package/dist/types/src/components/builtin/Image/Image.d.ts.map +1 -1
  146. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts.map +1 -1
  147. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -1
  148. package/dist/types/src/components/builtin/Navigation/register.d.ts.map +1 -1
  149. package/dist/types/src/components/builtin/SocialLinks/register.d.ts.map +1 -1
  150. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +0 -4
  151. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
  152. package/dist/types/src/components/builtin/Text/register.d.ts.map +1 -1
  153. package/dist/types/src/components/hooks/useMediaQuery.d.ts.map +1 -1
  154. package/dist/types/src/components/utils/drop-first.d.ts +2 -0
  155. package/dist/types/src/components/utils/drop-first.d.ts.map +1 -0
  156. package/dist/types/src/components/utils/responsive-style.d.ts +21 -10
  157. package/dist/types/src/components/utils/responsive-style.d.ts.map +1 -1
  158. package/dist/types/src/controls/types.d.ts +1 -1
  159. package/dist/types/src/controls/types.d.ts.map +1 -1
  160. package/dist/types/src/index.d.ts +2 -2
  161. package/dist/types/src/index.d.ts.map +1 -1
  162. package/dist/types/src/next/api-handler/handlers/manifest.d.ts +1 -0
  163. package/dist/types/src/next/api-handler/handlers/manifest.d.ts.map +1 -1
  164. package/dist/types/src/next/client.d.ts +4 -1
  165. package/dist/types/src/next/client.d.ts.map +1 -1
  166. package/dist/types/src/next/index.d.ts +3 -1
  167. package/dist/types/src/next/index.d.ts.map +1 -1
  168. package/dist/types/src/prop-controllers/descriptors.d.ts +1 -1
  169. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  170. package/dist/types/src/runtimes/react/components/LiveProvider.d.ts +3 -1
  171. package/dist/types/src/runtimes/react/components/LiveProvider.d.ts.map +1 -1
  172. package/dist/types/src/runtimes/react/components/PreviewProvider.d.ts +3 -1
  173. package/dist/types/src/runtimes/react/components/PreviewProvider.d.ts.map +1 -1
  174. package/dist/types/src/runtimes/react/index.d.ts +22 -4
  175. package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
  176. package/dist/types/src/slate/BlockPlugin/clearBlockKeyForDevice.d.ts +2 -2
  177. package/dist/types/src/slate/BlockPlugin/clearBlockKeyForDevice.d.ts.map +1 -1
  178. package/dist/types/src/slate/BlockPlugin/index.d.ts +4 -0
  179. package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
  180. package/dist/types/src/slate/BlockPlugin/setBlockKeyForDevice.d.ts +7 -3
  181. package/dist/types/src/slate/BlockPlugin/setBlockKeyForDevice.d.ts.map +1 -1
  182. package/dist/types/src/slate/BlockPlugin/types.d.ts +2 -2
  183. package/dist/types/src/slate/BlockPlugin/types.d.ts.map +1 -1
  184. package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts +4 -0
  185. package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts.map +1 -0
  186. package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts +4 -0
  187. package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts.map +1 -0
  188. package/dist/types/src/slate/ListPlugin/toggleList.d.ts +2 -1
  189. package/dist/types/src/slate/ListPlugin/toggleList.d.ts.map +1 -1
  190. package/dist/types/src/slate/ListPlugin/unwrapList.d.ts +6 -2
  191. package/dist/types/src/slate/ListPlugin/unwrapList.d.ts.map +1 -1
  192. package/dist/types/src/slate/ListPlugin/utils/getSelectedListItems.d.ts +0 -1
  193. package/dist/types/src/slate/ListPlugin/utils/getSelectedListItems.d.ts.map +1 -1
  194. package/dist/types/src/slate/ListPlugin/wrapList.d.ts +2 -1
  195. package/dist/types/src/slate/ListPlugin/wrapList.d.ts.map +1 -1
  196. package/dist/types/src/slate/TypographyPlugin/clearActiveTypographyStyle.d.ts +6 -2
  197. package/dist/types/src/slate/TypographyPlugin/clearActiveTypographyStyle.d.ts.map +1 -1
  198. package/dist/types/src/slate/TypographyPlugin/clearDeviceActiveTypography.d.ts +6 -2
  199. package/dist/types/src/slate/TypographyPlugin/clearDeviceActiveTypography.d.ts.map +1 -1
  200. package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts +6 -2
  201. package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts.map +1 -1
  202. package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
  203. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyId.d.ts +6 -2
  204. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyId.d.ts.map +1 -1
  205. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts +7 -2
  206. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts.map +1 -1
  207. package/dist/types/src/slate/selectors.d.ts +19 -0
  208. package/dist/types/src/slate/selectors.d.ts.map +1 -0
  209. package/dist/types/src/slate/utils/editor.d.ts.map +1 -1
  210. package/dist/types/src/slate/utils/element.d.ts +2 -1
  211. package/dist/types/src/slate/utils/element.d.ts.map +1 -1
  212. package/dist/types/src/slate/utils/unhangRange.d.ts +10 -0
  213. package/dist/types/src/slate/utils/unhangRange.d.ts.map +1 -0
  214. package/dist/types/src/state/actions.d.ts +10 -1
  215. package/dist/types/src/state/actions.d.ts.map +1 -1
  216. package/dist/types/src/state/modules/breakpoints.d.ts +44 -0
  217. package/dist/types/src/state/modules/breakpoints.d.ts.map +1 -0
  218. package/dist/types/src/state/react-builder-preview.d.ts +2 -0
  219. package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
  220. package/dist/types/src/state/react-page.d.ts +5 -1
  221. package/dist/types/src/state/react-page.d.ts.map +1 -1
  222. package/dist/types/src/utils/isNonNullable.d.ts +2 -0
  223. package/dist/types/src/utils/isNonNullable.d.ts.map +1 -0
  224. package/dist/useMediaQuery.cjs.js +38 -0
  225. package/dist/useMediaQuery.cjs.js.map +1 -0
  226. package/dist/useMediaQuery.es.js +37 -0
  227. package/dist/useMediaQuery.es.js.map +1 -0
  228. package/package.json +10 -2
  229. package/state/breakpoints.js +1 -0
  230. package/dist/isNonNullable.cjs.js +0 -6
  231. package/dist/isNonNullable.cjs.js.map +0 -1
  232. package/dist/isNonNullable.es.js +0 -5
  233. package/dist/isNonNullable.es.js.map +0 -1
  234. package/dist/responsive-style.cjs.js +0 -917
  235. package/dist/responsive-style.cjs.js.map +0 -1
  236. package/dist/responsive-style.es.js +0 -853
  237. package/dist/responsive-style.es.js.map +0 -1
  238. package/dist/types/src/components/utils/devices.d.ts +0 -17
  239. package/dist/types/src/components/utils/devices.d.ts.map +0 -1
@@ -1,16 +1,42 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  var React = require("react");
4
- var responsiveStyle = require("./responsive-style.cjs.js");
4
+ var next = require("./index.cjs.js");
5
5
  var css = require("@emotion/css");
6
6
  var jsxRuntime = require("react/jsx-runtime");
7
+ require("use-sync-external-store/shim/with-selector");
8
+ require("next/dynamic");
9
+ require("./constants.cjs.js");
10
+ require("redux");
11
+ require("redux-thunk");
12
+ require("./actions.cjs.js");
13
+ require("./descriptors.cjs.js");
14
+ require("slate");
15
+ require("slate-react");
16
+ require("./state/breakpoints.cjs.js");
17
+ require("./introspection.cjs.js");
7
18
  require("@emotion/serialize");
8
19
  require("@emotion/utils");
20
+ require("./text-input.cjs.js");
21
+ require("./combobox.cjs.js");
9
22
  require("use-sync-external-store/shim");
10
- require("redux");
11
- require("redux-thunk");
12
23
  require("./types.cjs.js");
13
- require("./actions.cjs.js");
24
+ require("./box-models.cjs.js");
25
+ require("css-box-model");
26
+ require("color");
27
+ require("scroll-into-view-if-needed");
28
+ require("react-dom");
29
+ require("html-react-parser");
30
+ require("next/head");
31
+ require("@emotion/server/create-instance");
32
+ require("next/document");
33
+ require("cors");
34
+ require("path-to-regexp");
35
+ require("cookie");
36
+ require("http-proxy");
37
+ require("set-cookie-parser");
38
+ require("uuid");
39
+ require("corporate-ipsum");
14
40
  const Divider = React.forwardRef(function Divider2({
15
41
  id,
16
42
  variant,
@@ -22,12 +48,12 @@ const Divider = React.forwardRef(function Divider2({
22
48
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
23
49
  ref,
24
50
  id,
25
- className: css.cx(responsiveStyle.useStyle({
51
+ className: css.cx(next.useStyle({
26
52
  display: "flex",
27
53
  width: "100%"
28
54
  }), width, margin),
29
55
  children: /* @__PURE__ */ jsxRuntime.jsx("div", {
30
- className: responsiveStyle.useStyle({
56
+ className: next.useStyle({
31
57
  display: "flex",
32
58
  flexDirection: "column",
33
59
  justifyContent: "center",
@@ -35,7 +61,7 @@ const Divider = React.forwardRef(function Divider2({
35
61
  width: "100%"
36
62
  }),
37
63
  children: /* @__PURE__ */ jsxRuntime.jsx("div", {
38
- className: responsiveStyle.useStyle(responsiveStyle.responsiveStyle([variant, thickness, color], ([variant2 = "solid", thickness2 = {
64
+ className: next.useStyle(next.useResponsiveStyle([variant, thickness, color], ([variant2 = "solid", thickness2 = {
39
65
  value: 1,
40
66
  unit: "px"
41
67
  }, color2 = {
@@ -53,15 +79,15 @@ const Divider = React.forwardRef(function Divider2({
53
79
  return {
54
80
  borderBottomWidth: thickness2 == null ? 1 : `${thickness2.value}${thickness2.unit}`,
55
81
  borderBottomStyle: variant2,
56
- borderBottomColor: responsiveStyle.colorToString(color2)
82
+ borderBottomColor: next.colorToString(color2)
57
83
  };
58
84
  case "blended":
59
85
  return {
60
86
  height: `${thickness2.value}${thickness2.unit}`,
61
- background: `linear-gradient(${["90deg", responsiveStyle.colorToString({
87
+ background: `linear-gradient(${["90deg", next.colorToString({
62
88
  swatch: color2.swatch,
63
89
  alpha: 0
64
- }), responsiveStyle.colorToString(color2), responsiveStyle.colorToString({
90
+ }), next.colorToString(color2), next.colorToString({
65
91
  swatch: color2.swatch,
66
92
  alpha: 0
67
93
  })].join(", ")})`
@@ -1 +1 @@
1
- {"version":3,"file":"Divider.cjs.js","sources":["../src/components/builtin/Divider/Divider.tsx"],"sourcesContent":["import { forwardRef, Ref } from 'react'\n\nimport {\n ElementIDValue,\n ResponsiveLengthValue,\n ResponsiveSelectValue,\n} from '../../../prop-controllers/descriptors'\nimport { colorToString } from '../../utils/colorToString'\nimport { ResponsiveColor } from '../../../runtimes/react/controls'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { cx } from '@emotion/css'\nimport { responsiveStyle } from '../../utils/responsive-style'\n\ntype DividerVariant = 'solid' | 'dashed' | 'dotted' | 'blended'\n\ntype Props = {\n id?: ElementIDValue\n variant?: ResponsiveSelectValue<DividerVariant>\n thickness?: ResponsiveLengthValue\n color?: ResponsiveColor | null\n width?: string\n margin?: string\n}\n\nconst Divider = forwardRef(function Divider(\n { id, variant, thickness, color, width, margin }: Props,\n ref: Ref<HTMLDivElement>,\n) {\n return (\n // IE11 has a bug with Flexbox vertical centering with min height if height is not set.\n // Wrapping it in another flex container fixes it for some reason, read more here:\n // https://stackoverflow.com/questions/19371626/flexbox-not-centering-vertically-in-ie\n <div\n ref={ref}\n id={id}\n className={cx(useStyle({ display: 'flex', width: '100%' }), width, margin)}\n >\n <div\n className={useStyle({\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n minHeight: 40,\n width: '100%',\n })}\n >\n <div\n className={useStyle(\n responsiveStyle(\n [variant, thickness, color] as const,\n ([\n variant = 'solid',\n thickness = { value: 1, unit: 'px' },\n color = { swatch: { hue: 0, saturation: 0, lightness: 0 }, alpha: 1 },\n ]) => {\n switch (variant) {\n case 'solid':\n case 'dashed':\n case 'dotted':\n return {\n borderBottomWidth:\n thickness == null ? 1 : `${thickness.value}${thickness.unit}`,\n borderBottomStyle: variant,\n borderBottomColor: colorToString(color),\n }\n\n case 'blended':\n return {\n height: `${thickness.value}${thickness.unit}`,\n background: `linear-gradient(${[\n '90deg',\n colorToString({ swatch: color.swatch, alpha: 0 }),\n colorToString(color),\n colorToString({ swatch: color.swatch, alpha: 0 }),\n ].join(', ')})`,\n }\n\n default:\n variant as never\n throw new Error(`Invalid variant ${variant}.`)\n }\n },\n ),\n )}\n />\n </div>\n </div>\n )\n})\n\nexport default Divider\n"],"names":["Divider","forwardRef","id","variant","thickness","color","width","margin","ref","cx","useStyle","display","flexDirection","justifyContent","minHeight","responsiveStyle","value","unit","swatch","hue","saturation","lightness","alpha","borderBottomWidth","borderBottomStyle","borderBottomColor","colorToString","height","background","join","Error"],"mappings":";;;;;;;;;;;;;AAwBMA,MAAAA,UAAUC,MAAAA,WAAW,kBACzB;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAASC;AAAAA,EAAWC;AAAAA,EAAOC;AAAAA,EAAOC;AAAAA,GACxCC,KACA;AACA,wCAIE,OAAA;AAAA,IACE;AAAA,IACA;AAAA,IACA,WAAWC,OAAGC,yBAAS;AAAA,MAAEC,SAAS;AAAA,MAAQL,OAAO;AAAA,IAAA,CAA3B,GAAsCA,OAAOC,MAAtD;AAAA,IAEb,yCAAA,OAAA;AAAA,MACE,WAAWG,gBAAAA,SAAS;AAAA,QAClBC,SAAS;AAAA,QACTC,eAAe;AAAA,QACfC,gBAAgB;AAAA,QAChBC,WAAW;AAAA,QACXR,OAAO;AAAA,MAAA,CALU;AAAA,MAQnB,yCAAA,OAAA;AAAA,QACE,WAAWI,gBAAAA,SACTK,gCACE,CAACZ,SAASC,WAAWC,KAArB,GACA,CAAC,CACCF,WAAU,SACVC,aAAY;AAAA,UAAEY,OAAO;AAAA,UAAGC,MAAM;AAAA,WAC9BZ,SAAQ;AAAA,UAAEa,QAAQ;AAAA,YAAEC,KAAK;AAAA,YAAGC,YAAY;AAAA,YAAGC,WAAW;AAAA,UAA9C;AAAA,UAAmDC,OAAO;AAAA,QAAA,OAC9D;AACInB,kBAAAA;AAAAA,iBACD;AAAA,iBACA;AAAA,iBACA;AACI,qBAAA;AAAA,gBACLoB,mBACEnB,cAAa,OAAO,IAAK,GAAEA,WAAUY,QAAQZ,WAAUa;AAAAA,gBACzDO,mBAAmBrB;AAAAA,gBACnBsB,mBAAmBC,8BAAcrB,MAAD;AAAA,cAAA;AAAA,iBAG/B;AACI,qBAAA;AAAA,gBACLsB,QAAS,GAAEvB,WAAUY,QAAQZ,WAAUa;AAAAA,gBACvCW,YAAa,mBAAkB,CAC7B,SACAF,gBAAAA,cAAc;AAAA,kBAAER,QAAQb,OAAMa;AAAAA,kBAAQI,OAAO;AAAA,gBAAhC,CAAA,GACbI,gBAAcrB,cAAAA,MAAD,GACbqB,8BAAc;AAAA,kBAAER,QAAQb,OAAMa;AAAAA,kBAAQI,OAAO;AAAA,gBAAhC,CAAA,CAJgB,EAK7BO,KAAK,IALwB;AAAA,cAAA;AAAA;AAU3B,oBAAA,IAAIC,MAAO,mBAAkB3B,WAA7B;AAAA;AAAA,QAAA,CA/BC,CADE;AAAA,MAAA,CADrB;AAAA,IAAA,CATF;AAAA,EAAA,CALF;AAwDH,CAhEyB;;"}
1
+ {"version":3,"file":"Divider.cjs.js","sources":["../src/components/builtin/Divider/Divider.tsx"],"sourcesContent":["import { forwardRef, Ref } from 'react'\n\nimport {\n ElementIDValue,\n ResponsiveLengthValue,\n ResponsiveSelectValue,\n} from '../../../prop-controllers/descriptors'\nimport { colorToString } from '../../utils/colorToString'\nimport { ResponsiveColor } from '../../../runtimes/react/controls'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { cx } from '@emotion/css'\nimport { useResponsiveStyle } from '../../utils/responsive-style'\n\ntype DividerVariant = 'solid' | 'dashed' | 'dotted' | 'blended'\n\ntype Props = {\n id?: ElementIDValue\n variant?: ResponsiveSelectValue<DividerVariant>\n thickness?: ResponsiveLengthValue\n color?: ResponsiveColor | null\n width?: string\n margin?: string\n}\n\nconst Divider = forwardRef(function Divider(\n { id, variant, thickness, color, width, margin }: Props,\n ref: Ref<HTMLDivElement>,\n) {\n return (\n // IE11 has a bug with Flexbox vertical centering with min height if height is not set.\n // Wrapping it in another flex container fixes it for some reason, read more here:\n // https://stackoverflow.com/questions/19371626/flexbox-not-centering-vertically-in-ie\n <div\n ref={ref}\n id={id}\n className={cx(useStyle({ display: 'flex', width: '100%' }), width, margin)}\n >\n <div\n className={useStyle({\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n minHeight: 40,\n width: '100%',\n })}\n >\n <div\n className={useStyle(\n useResponsiveStyle(\n [variant, thickness, color] as const,\n ([\n variant = 'solid',\n thickness = { value: 1, unit: 'px' },\n color = { swatch: { hue: 0, saturation: 0, lightness: 0 }, alpha: 1 },\n ]) => {\n switch (variant) {\n case 'solid':\n case 'dashed':\n case 'dotted':\n return {\n borderBottomWidth:\n thickness == null ? 1 : `${thickness.value}${thickness.unit}`,\n borderBottomStyle: variant,\n borderBottomColor: colorToString(color),\n }\n\n case 'blended':\n return {\n height: `${thickness.value}${thickness.unit}`,\n background: `linear-gradient(${[\n '90deg',\n colorToString({ swatch: color.swatch, alpha: 0 }),\n colorToString(color),\n colorToString({ swatch: color.swatch, alpha: 0 }),\n ].join(', ')})`,\n }\n\n default:\n variant as never\n throw new Error(`Invalid variant ${variant}.`)\n }\n },\n ),\n )}\n />\n </div>\n </div>\n )\n})\n\nexport default Divider\n"],"names":["Divider","forwardRef","id","variant","thickness","color","width","margin","ref","cx","useStyle","display","flexDirection","justifyContent","minHeight","useResponsiveStyle","value","unit","swatch","hue","saturation","lightness","alpha","borderBottomWidth","borderBottomStyle","borderBottomColor","colorToString","height","background","join","Error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBMA,MAAAA,UAAUC,MAAAA,WAAW,kBACzB;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAASC;AAAAA,EAAWC;AAAAA,EAAOC;AAAAA,EAAOC;AAAAA,GACxCC,KACA;AACA,wCAIE,OAAA;AAAA,IACE;AAAA,IACA;AAAA,IACA,WAAWC,OAAGC,cAAS;AAAA,MAAEC,SAAS;AAAA,MAAQL,OAAO;AAAA,IAAA,CAA3B,GAAsCA,OAAOC,MAAtD;AAAA,IAEb,yCAAA,OAAA;AAAA,MACE,WAAWG,KAAAA,SAAS;AAAA,QAClBC,SAAS;AAAA,QACTC,eAAe;AAAA,QACfC,gBAAgB;AAAA,QAChBC,WAAW;AAAA,QACXR,OAAO;AAAA,MAAA,CALU;AAAA,MAQnB,yCAAA,OAAA;AAAA,QACE,WAAWI,KAAAA,SACTK,wBACE,CAACZ,SAASC,WAAWC,KAArB,GACA,CAAC,CACCF,WAAU,SACVC,aAAY;AAAA,UAAEY,OAAO;AAAA,UAAGC,MAAM;AAAA,WAC9BZ,SAAQ;AAAA,UAAEa,QAAQ;AAAA,YAAEC,KAAK;AAAA,YAAGC,YAAY;AAAA,YAAGC,WAAW;AAAA,UAA9C;AAAA,UAAmDC,OAAO;AAAA,QAAA,OAC9D;AACInB,kBAAAA;AAAAA,iBACD;AAAA,iBACA;AAAA,iBACA;AACI,qBAAA;AAAA,gBACLoB,mBACEnB,cAAa,OAAO,IAAK,GAAEA,WAAUY,QAAQZ,WAAUa;AAAAA,gBACzDO,mBAAmBrB;AAAAA,gBACnBsB,mBAAmBC,mBAAcrB,MAAD;AAAA,cAAA;AAAA,iBAG/B;AACI,qBAAA;AAAA,gBACLsB,QAAS,GAAEvB,WAAUY,QAAQZ,WAAUa;AAAAA,gBACvCW,YAAa,mBAAkB,CAC7B,SACAF,KAAAA,cAAc;AAAA,kBAAER,QAAQb,OAAMa;AAAAA,kBAAQI,OAAO;AAAA,gBAAhC,CAAA,GACbI,KAAcrB,cAAAA,MAAD,GACbqB,mBAAc;AAAA,kBAAER,QAAQb,OAAMa;AAAAA,kBAAQI,OAAO;AAAA,gBAAhC,CAAA,CAJgB,EAK7BO,KAAK,IALwB;AAAA,cAAA;AAAA;AAU3B,oBAAA,IAAIC,MAAO,mBAAkB3B,WAA7B;AAAA;AAAA,QAAA,CA/BI,CADD;AAAA,MAAA,CADrB;AAAA,IAAA,CATF;AAAA,EAAA,CALF;AAwDH,CAhEyB;;"}
@@ -1,14 +1,40 @@
1
1
  import { forwardRef } from "react";
2
- import { e as useStyle, r as responsiveStyle, i as colorToString } from "./responsive-style.es.js";
2
+ import { n as useStyle, o as useResponsiveStyle, r as colorToString } from "./index.es.js";
3
3
  import { cx } from "@emotion/css";
4
4
  import { jsx } from "react/jsx-runtime";
5
+ import "use-sync-external-store/shim/with-selector";
6
+ import "next/dynamic";
7
+ import "./constants.es.js";
8
+ import "redux";
9
+ import "redux-thunk";
10
+ import "./actions.es.js";
11
+ import "./descriptors.es.js";
12
+ import "slate";
13
+ import "slate-react";
14
+ import "./state/breakpoints.es.js";
15
+ import "./introspection.es.js";
5
16
  import "@emotion/serialize";
6
17
  import "@emotion/utils";
18
+ import "./text-input.es.js";
19
+ import "./combobox.es.js";
7
20
  import "use-sync-external-store/shim";
8
- import "redux";
9
- import "redux-thunk";
10
21
  import "./types.es.js";
11
- import "./actions.es.js";
22
+ import "./box-models.es.js";
23
+ import "css-box-model";
24
+ import "color";
25
+ import "scroll-into-view-if-needed";
26
+ import "react-dom";
27
+ import "html-react-parser";
28
+ import "next/head";
29
+ import "@emotion/server/create-instance";
30
+ import "next/document";
31
+ import "cors";
32
+ import "path-to-regexp";
33
+ import "cookie";
34
+ import "http-proxy";
35
+ import "set-cookie-parser";
36
+ import "uuid";
37
+ import "corporate-ipsum";
12
38
  const Divider = forwardRef(function Divider2({
13
39
  id,
14
40
  variant,
@@ -33,7 +59,7 @@ const Divider = forwardRef(function Divider2({
33
59
  width: "100%"
34
60
  }),
35
61
  children: /* @__PURE__ */ jsx("div", {
36
- className: useStyle(responsiveStyle([variant, thickness, color], ([variant2 = "solid", thickness2 = {
62
+ className: useStyle(useResponsiveStyle([variant, thickness, color], ([variant2 = "solid", thickness2 = {
37
63
  value: 1,
38
64
  unit: "px"
39
65
  }, color2 = {
@@ -1 +1 @@
1
- {"version":3,"file":"Divider.es.js","sources":["../src/components/builtin/Divider/Divider.tsx"],"sourcesContent":["import { forwardRef, Ref } from 'react'\n\nimport {\n ElementIDValue,\n ResponsiveLengthValue,\n ResponsiveSelectValue,\n} from '../../../prop-controllers/descriptors'\nimport { colorToString } from '../../utils/colorToString'\nimport { ResponsiveColor } from '../../../runtimes/react/controls'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { cx } from '@emotion/css'\nimport { responsiveStyle } from '../../utils/responsive-style'\n\ntype DividerVariant = 'solid' | 'dashed' | 'dotted' | 'blended'\n\ntype Props = {\n id?: ElementIDValue\n variant?: ResponsiveSelectValue<DividerVariant>\n thickness?: ResponsiveLengthValue\n color?: ResponsiveColor | null\n width?: string\n margin?: string\n}\n\nconst Divider = forwardRef(function Divider(\n { id, variant, thickness, color, width, margin }: Props,\n ref: Ref<HTMLDivElement>,\n) {\n return (\n // IE11 has a bug with Flexbox vertical centering with min height if height is not set.\n // Wrapping it in another flex container fixes it for some reason, read more here:\n // https://stackoverflow.com/questions/19371626/flexbox-not-centering-vertically-in-ie\n <div\n ref={ref}\n id={id}\n className={cx(useStyle({ display: 'flex', width: '100%' }), width, margin)}\n >\n <div\n className={useStyle({\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n minHeight: 40,\n width: '100%',\n })}\n >\n <div\n className={useStyle(\n responsiveStyle(\n [variant, thickness, color] as const,\n ([\n variant = 'solid',\n thickness = { value: 1, unit: 'px' },\n color = { swatch: { hue: 0, saturation: 0, lightness: 0 }, alpha: 1 },\n ]) => {\n switch (variant) {\n case 'solid':\n case 'dashed':\n case 'dotted':\n return {\n borderBottomWidth:\n thickness == null ? 1 : `${thickness.value}${thickness.unit}`,\n borderBottomStyle: variant,\n borderBottomColor: colorToString(color),\n }\n\n case 'blended':\n return {\n height: `${thickness.value}${thickness.unit}`,\n background: `linear-gradient(${[\n '90deg',\n colorToString({ swatch: color.swatch, alpha: 0 }),\n colorToString(color),\n colorToString({ swatch: color.swatch, alpha: 0 }),\n ].join(', ')})`,\n }\n\n default:\n variant as never\n throw new Error(`Invalid variant ${variant}.`)\n }\n },\n ),\n )}\n />\n </div>\n </div>\n )\n})\n\nexport default Divider\n"],"names":["Divider","forwardRef","id","variant","thickness","color","width","margin","ref","cx","useStyle","display","flexDirection","justifyContent","minHeight","responsiveStyle","value","unit","swatch","hue","saturation","lightness","alpha","borderBottomWidth","borderBottomStyle","borderBottomColor","colorToString","height","background","join","Error"],"mappings":";;;;;;;;;;;AAwBMA,MAAAA,UAAUC,WAAW,kBACzB;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAASC;AAAAA,EAAWC;AAAAA,EAAOC;AAAAA,EAAOC;AAAAA,GACxCC,KACA;AACA,6BAIE,OAAA;AAAA,IACE;AAAA,IACA;AAAA,IACA,WAAWC,GAAGC,SAAS;AAAA,MAAEC,SAAS;AAAA,MAAQL,OAAO;AAAA,IAAA,CAA3B,GAAsCA,OAAOC,MAAtD;AAAA,IAEb,8BAAA,OAAA;AAAA,MACE,WAAWG,SAAS;AAAA,QAClBC,SAAS;AAAA,QACTC,eAAe;AAAA,QACfC,gBAAgB;AAAA,QAChBC,WAAW;AAAA,QACXR,OAAO;AAAA,MAAA,CALU;AAAA,MAQnB,8BAAA,OAAA;AAAA,QACE,WAAWI,SACTK,gBACE,CAACZ,SAASC,WAAWC,KAArB,GACA,CAAC,CACCF,WAAU,SACVC,aAAY;AAAA,UAAEY,OAAO;AAAA,UAAGC,MAAM;AAAA,WAC9BZ,SAAQ;AAAA,UAAEa,QAAQ;AAAA,YAAEC,KAAK;AAAA,YAAGC,YAAY;AAAA,YAAGC,WAAW;AAAA,UAA9C;AAAA,UAAmDC,OAAO;AAAA,QAAA,OAC9D;AACInB,kBAAAA;AAAAA,iBACD;AAAA,iBACA;AAAA,iBACA;AACI,qBAAA;AAAA,gBACLoB,mBACEnB,cAAa,OAAO,IAAK,GAAEA,WAAUY,QAAQZ,WAAUa;AAAAA,gBACzDO,mBAAmBrB;AAAAA,gBACnBsB,mBAAmBC,cAAcrB,MAAD;AAAA,cAAA;AAAA,iBAG/B;AACI,qBAAA;AAAA,gBACLsB,QAAS,GAAEvB,WAAUY,QAAQZ,WAAUa;AAAAA,gBACvCW,YAAa,mBAAkB,CAC7B,SACAF,cAAc;AAAA,kBAAER,QAAQb,OAAMa;AAAAA,kBAAQI,OAAO;AAAA,gBAAhC,CAAA,GACbI,cAAcrB,MAAD,GACbqB,cAAc;AAAA,kBAAER,QAAQb,OAAMa;AAAAA,kBAAQI,OAAO;AAAA,gBAAhC,CAAA,CAJgB,EAK7BO,KAAK,IALwB;AAAA,cAAA;AAAA;AAU3B,oBAAA,IAAIC,MAAO,mBAAkB3B,WAA7B;AAAA;AAAA,QAAA,CA/BC,CADE;AAAA,MAAA,CADrB;AAAA,IAAA,CATF;AAAA,EAAA,CALF;AAwDH,CAhEyB;;"}
1
+ {"version":3,"file":"Divider.es.js","sources":["../src/components/builtin/Divider/Divider.tsx"],"sourcesContent":["import { forwardRef, Ref } from 'react'\n\nimport {\n ElementIDValue,\n ResponsiveLengthValue,\n ResponsiveSelectValue,\n} from '../../../prop-controllers/descriptors'\nimport { colorToString } from '../../utils/colorToString'\nimport { ResponsiveColor } from '../../../runtimes/react/controls'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { cx } from '@emotion/css'\nimport { useResponsiveStyle } from '../../utils/responsive-style'\n\ntype DividerVariant = 'solid' | 'dashed' | 'dotted' | 'blended'\n\ntype Props = {\n id?: ElementIDValue\n variant?: ResponsiveSelectValue<DividerVariant>\n thickness?: ResponsiveLengthValue\n color?: ResponsiveColor | null\n width?: string\n margin?: string\n}\n\nconst Divider = forwardRef(function Divider(\n { id, variant, thickness, color, width, margin }: Props,\n ref: Ref<HTMLDivElement>,\n) {\n return (\n // IE11 has a bug with Flexbox vertical centering with min height if height is not set.\n // Wrapping it in another flex container fixes it for some reason, read more here:\n // https://stackoverflow.com/questions/19371626/flexbox-not-centering-vertically-in-ie\n <div\n ref={ref}\n id={id}\n className={cx(useStyle({ display: 'flex', width: '100%' }), width, margin)}\n >\n <div\n className={useStyle({\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n minHeight: 40,\n width: '100%',\n })}\n >\n <div\n className={useStyle(\n useResponsiveStyle(\n [variant, thickness, color] as const,\n ([\n variant = 'solid',\n thickness = { value: 1, unit: 'px' },\n color = { swatch: { hue: 0, saturation: 0, lightness: 0 }, alpha: 1 },\n ]) => {\n switch (variant) {\n case 'solid':\n case 'dashed':\n case 'dotted':\n return {\n borderBottomWidth:\n thickness == null ? 1 : `${thickness.value}${thickness.unit}`,\n borderBottomStyle: variant,\n borderBottomColor: colorToString(color),\n }\n\n case 'blended':\n return {\n height: `${thickness.value}${thickness.unit}`,\n background: `linear-gradient(${[\n '90deg',\n colorToString({ swatch: color.swatch, alpha: 0 }),\n colorToString(color),\n colorToString({ swatch: color.swatch, alpha: 0 }),\n ].join(', ')})`,\n }\n\n default:\n variant as never\n throw new Error(`Invalid variant ${variant}.`)\n }\n },\n ),\n )}\n />\n </div>\n </div>\n )\n})\n\nexport default Divider\n"],"names":["Divider","forwardRef","id","variant","thickness","color","width","margin","ref","cx","useStyle","display","flexDirection","justifyContent","minHeight","useResponsiveStyle","value","unit","swatch","hue","saturation","lightness","alpha","borderBottomWidth","borderBottomStyle","borderBottomColor","colorToString","height","background","join","Error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBMA,MAAAA,UAAUC,WAAW,kBACzB;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAASC;AAAAA,EAAWC;AAAAA,EAAOC;AAAAA,EAAOC;AAAAA,GACxCC,KACA;AACA,6BAIE,OAAA;AAAA,IACE;AAAA,IACA;AAAA,IACA,WAAWC,GAAGC,SAAS;AAAA,MAAEC,SAAS;AAAA,MAAQL,OAAO;AAAA,IAAA,CAA3B,GAAsCA,OAAOC,MAAtD;AAAA,IAEb,8BAAA,OAAA;AAAA,MACE,WAAWG,SAAS;AAAA,QAClBC,SAAS;AAAA,QACTC,eAAe;AAAA,QACfC,gBAAgB;AAAA,QAChBC,WAAW;AAAA,QACXR,OAAO;AAAA,MAAA,CALU;AAAA,MAQnB,8BAAA,OAAA;AAAA,QACE,WAAWI,SACTK,mBACE,CAACZ,SAASC,WAAWC,KAArB,GACA,CAAC,CACCF,WAAU,SACVC,aAAY;AAAA,UAAEY,OAAO;AAAA,UAAGC,MAAM;AAAA,WAC9BZ,SAAQ;AAAA,UAAEa,QAAQ;AAAA,YAAEC,KAAK;AAAA,YAAGC,YAAY;AAAA,YAAGC,WAAW;AAAA,UAA9C;AAAA,UAAmDC,OAAO;AAAA,QAAA,OAC9D;AACInB,kBAAAA;AAAAA,iBACD;AAAA,iBACA;AAAA,iBACA;AACI,qBAAA;AAAA,gBACLoB,mBACEnB,cAAa,OAAO,IAAK,GAAEA,WAAUY,QAAQZ,WAAUa;AAAAA,gBACzDO,mBAAmBrB;AAAAA,gBACnBsB,mBAAmBC,cAAcrB,MAAD;AAAA,cAAA;AAAA,iBAG/B;AACI,qBAAA;AAAA,gBACLsB,QAAS,GAAEvB,WAAUY,QAAQZ,WAAUa;AAAAA,gBACvCW,YAAa,mBAAkB,CAC7B,SACAF,cAAc;AAAA,kBAAER,QAAQb,OAAMa;AAAAA,kBAAQI,OAAO;AAAA,gBAAhC,CAAA,GACbI,cAAcrB,MAAD,GACbqB,cAAc;AAAA,kBAAER,QAAQb,OAAMa;AAAAA,kBAAQI,OAAO;AAAA,gBAAhC,CAAA,CAJgB,EAK7BO,KAAK,IALwB;AAAA,cAAA;AAAA;AAU3B,oBAAA,IAAIC,MAAO,mBAAkB3B,WAA7B;AAAA;AAAA,QAAA,CA/BI,CADD;AAAA,MAAA,CADrB;AAAA,IAAA,CATF;AAAA,EAAA,CALF;AAwDH,CAhEyB;;"}
package/dist/Embed.cjs.js CHANGED
@@ -2,16 +2,42 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  var React = require("react");
4
4
  var useIsomorphicLayoutEffect = require("./useIsomorphicLayoutEffect.cjs.js");
5
- var responsiveStyle = require("./responsive-style.cjs.js");
5
+ var next = require("./index.cjs.js");
6
6
  var css = require("@emotion/css");
7
7
  var jsxRuntime = require("react/jsx-runtime");
8
+ require("use-sync-external-store/shim/with-selector");
9
+ require("next/dynamic");
10
+ require("./constants.cjs.js");
11
+ require("redux");
12
+ require("redux-thunk");
13
+ require("./actions.cjs.js");
14
+ require("./descriptors.cjs.js");
15
+ require("slate");
16
+ require("slate-react");
17
+ require("./state/breakpoints.cjs.js");
18
+ require("./introspection.cjs.js");
8
19
  require("@emotion/serialize");
9
20
  require("@emotion/utils");
21
+ require("./text-input.cjs.js");
22
+ require("./combobox.cjs.js");
10
23
  require("use-sync-external-store/shim");
11
- require("redux");
12
- require("redux-thunk");
13
24
  require("./types.cjs.js");
14
- require("./actions.cjs.js");
25
+ require("./box-models.cjs.js");
26
+ require("css-box-model");
27
+ require("color");
28
+ require("scroll-into-view-if-needed");
29
+ require("react-dom");
30
+ require("html-react-parser");
31
+ require("next/head");
32
+ require("@emotion/server/create-instance");
33
+ require("next/document");
34
+ require("cors");
35
+ require("path-to-regexp");
36
+ require("cookie");
37
+ require("http-proxy");
38
+ require("set-cookie-parser");
39
+ require("uuid");
40
+ require("corporate-ipsum");
15
41
  const defaultHtml = `<div style="padding: 24px; background-color: rgba(161, 168, 194, 0.18); overflow: hidden;">
16
42
  <svg width="316" height="168" viewBox="0 0 316 168" fill="none" xmlns="http://www.w3.org/2000/svg">
17
43
  <rect width="70" height="8" rx="2" fill="#A1A8C2" fill-opacity="0.5"/>
@@ -85,7 +111,7 @@ const Embed = React.forwardRef(function Embed2({
85
111
  console.error(error);
86
112
  });
87
113
  }, [container, html]);
88
- const className = responsiveStyle.useStyle({
114
+ const className = next.useStyle({
89
115
  minHeight: 15
90
116
  });
91
117
  if (shouldRender === false)
@@ -1 +1 @@
1
- {"version":3,"file":"Embed.cjs.js","sources":["../src/components/builtin/Embed/Embed.tsx"],"sourcesContent":["/* eslint-env browser */\n\nimport { useState, useEffect, forwardRef, Ref, useImperativeHandle } from 'react'\n\nimport { ElementIDValue, TextAreaValue } from '../../../prop-controllers/descriptors'\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { cx } from '@emotion/css'\n\ntype Props = {\n id?: ElementIDValue\n html?: TextAreaValue\n width?: string\n margin?: string\n}\n\nconst defaultHtml = `<div style=\"padding: 24px; background-color: rgba(161, 168, 194, 0.18); overflow: hidden;\">\n<svg width=\"316\" height=\"168\" viewBox=\"0 0 316 168\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<rect width=\"70\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"78\" width=\"30\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"116\" width=\"78\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect y=\"20\" width=\"120\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"128\" y=\"20\" width=\"30\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"166\" y=\"20\" width=\"78\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect y=\"60\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"20\" y=\"80\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"40\" y=\"100\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"88\" y=\"100\" width=\"110\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"206\" y=\"100\" width=\"24\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"238\" y=\"100\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"40\" y=\"120\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"88\" y=\"120\" width=\"50\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"146\" y=\"120\" width=\"24\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"178\" y=\"120\" width=\"90\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"276\" y=\"120\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"20\" y=\"140\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect y=\"160\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n</svg>\n</div>`\nconst SCRIPT_TAG = 'script'\n\nconst Embed = forwardRef(function Embed(\n { id, width, margin, html = defaultHtml }: Props,\n ref: Ref<HTMLDivElement | null>,\n) {\n const [container, setContainer] = useState<HTMLDivElement | null>(null)\n const [shouldRender, setShouldRender] = useState(false)\n\n useIsomorphicLayoutEffect(() => {\n setShouldRender(true)\n }, [])\n\n useImperativeHandle(ref, () => container, [container])\n\n useEffect(() => {\n // TODO: When we SSR the editor, we can remove the editor check\n // and not run this effect on the first render.\n if (!container) return\n\n const walker = container.ownerDocument.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode(node: Element) {\n return node.tagName.toLowerCase() === SCRIPT_TAG\n ? NodeFilter.FILTER_ACCEPT\n : NodeFilter.FILTER_REJECT\n },\n })\n\n const nodes: Element[] = []\n\n while (walker.nextNode()) nodes.push(walker.currentNode as Element)\n\n // By default scripts appended dynamically will execute asyncrhonously. Here we ensure that\n // scripts are loaded synchronously since that's what a user usually expects with scripts in\n // embedded in HTML which usually comes from the server.\n //\n // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#notes\n async function executeScriptsInOrder() {\n for (let i = 0; i < nodes.length; i++) {\n await new Promise<void>(resolve => {\n const node = nodes[i]\n const script = node.ownerDocument.createElement(SCRIPT_TAG)\n\n script.textContent = node.textContent\n Array.from(node.attributes).forEach(({ name, value }) => {\n script.setAttribute(name, value)\n })\n\n script.onload = () => resolve()\n script.onerror = () => resolve()\n\n node.parentNode?.insertBefore(script, node)\n node.parentNode?.removeChild(node)\n\n if (!script.hasAttribute('src')) resolve()\n })\n }\n }\n\n executeScriptsInOrder().catch(error => {\n // Ignore errors from user-provided code\n console.error(error)\n })\n }, [container, html])\n\n const className = useStyle({ minHeight: 15 })\n\n if (shouldRender === false) return null\n\n return (\n <div\n ref={setContainer}\n id={id}\n className={cx(className, width, margin)}\n dangerouslySetInnerHTML={{ __html: html }}\n />\n )\n})\n\nexport default Embed\n"],"names":["defaultHtml","SCRIPT_TAG","Embed","forwardRef","id","width","margin","html","ref","container","setContainer","useState","shouldRender","setShouldRender","useIsomorphicLayoutEffect","useImperativeHandle","useEffect","walker","ownerDocument","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","node","tagName","toLowerCase","FILTER_ACCEPT","FILTER_REJECT","nodes","nextNode","push","currentNode","i","length","Promise","resolve","script","createElement","textContent","Array","from","attributes","forEach","name","value","setAttribute","onload","onerror","parentNode","insertBefore","removeChild","hasAttribute","catch","error","console","className","useStyle","minHeight","cx","__html"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAMA,cAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBrB,MAAMC,aAAa;AAEbC,MAAAA,QAAQC,MAAAA,WAAW,gBACvB;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAAOC;AAAAA,EAAQC,OAAOP;AAAAA,GAC5BQ,KACA;AACA,QAAM,CAACC,WAAWC,gBAAgBC,MAAAA,SAAgC,IAAxB;AACpC,QAAA,CAACC,cAAcC,mBAAmBF,MAAAA,SAAS,KAAD;AAEhDG,4BAAAA,0BAA0B,MAAM;AAC9BD,oBAAgB,IAAD;AAAA,EADQ,GAEtB,CAFsB,CAAA;AAIzBE,QAAAA,oBAAoBP,KAAK,MAAMC,WAAW,CAACA,SAAD,CAAvB;AAEnBO,QAAAA,UAAU,MAAM;AAGV,QAAA,CAACP;AAAW;AAEhB,UAAMQ,SAASR,UAAUS,cAAcC,iBAAiBV,WAAWW,WAAWC,cAAc;AAAA,MAC1FC,WAAWC,MAAe;AACxB,eAAOA,KAAKC,QAAQC,kBAAkBxB,aAClCmB,WAAWM,gBACXN,WAAWO;AAAAA,MAChB;AAAA,IAAA,CALY;AAQf,UAAMC,QAAmB,CAAA;AAEzB,WAAOX,OAAOY,SAAP;AAAyBC,YAAAA,KAAKb,OAAOc;AAOL,2CAAA;AACrC,eAASC,IAAI,GAAGA,IAAIJ,MAAMK,QAAQD,KAAK;AAC/B,cAAA,IAAIE,QAAcC,CAAW,YAAA;;AACjC,gBAAMZ,OAAOK,MAAMI;AACbI,gBAAAA,SAASb,KAAKL,cAAcmB,cAAcpC,UAAjC;AAEfmC,iBAAOE,cAAcf,KAAKe;AAC1BC,gBAAMC,KAAKjB,KAAKkB,UAAhB,EAA4BC,QAAQ,CAAC;AAAA,YAAEC;AAAAA,YAAMC;AAAAA,gBAAY;AAChDC,mBAAAA,aAAaF,MAAMC,KAA1B;AAAA,UAAA,CADF;AAIOE,iBAAAA,SAAS,MAAMX;AACfY,iBAAAA,UAAU,MAAMZ;AAElBa,qBAAAA,eAAAA,mBAAYC,aAAab,QAAQb;AACjCyB,qBAAAA,eAAAA,mBAAYE,YAAY3B;AAEzB,cAAA,CAACa,OAAOe,aAAa,KAApB;AAAmC;QAAA,CAfpC;AAAA,MAiBP;AAAA,IACF;AAEoB,0BAAA,EAAGC,MAAMC,CAAS,UAAA;AAErCC,cAAQD,MAAMA,KAAd;AAAA,IAAA,CAFF;AAAA,EAAA,GAIC,CAAC5C,WAAWF,IAAZ,CAhDM;AAkDHgD,QAAAA,YAAYC,gBAAAA,SAAS;AAAA,IAAEC,WAAW;AAAA,EAAA,CAAd;AAE1B,MAAI7C,iBAAiB;AAAc,WAAA;AAGjC,wCAAA,OAAA;AAAA,IACE,KAAKF;AAAAA,IACL;AAAA,IACA,WAAWgD,IAAAA,GAAGH,WAAWlD,OAAOC,MAAnB;AAAA,IACb,yBAAyB;AAAA,MAAEqD,QAAQpD;AAAAA,IAAV;AAAA,EAAA,CAL7B;AAQD,CA3EuB;;"}
1
+ {"version":3,"file":"Embed.cjs.js","sources":["../src/components/builtin/Embed/Embed.tsx"],"sourcesContent":["/* eslint-env browser */\n\nimport { useState, useEffect, forwardRef, Ref, useImperativeHandle } from 'react'\n\nimport { ElementIDValue, TextAreaValue } from '../../../prop-controllers/descriptors'\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { cx } from '@emotion/css'\n\ntype Props = {\n id?: ElementIDValue\n html?: TextAreaValue\n width?: string\n margin?: string\n}\n\nconst defaultHtml = `<div style=\"padding: 24px; background-color: rgba(161, 168, 194, 0.18); overflow: hidden;\">\n<svg width=\"316\" height=\"168\" viewBox=\"0 0 316 168\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<rect width=\"70\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"78\" width=\"30\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"116\" width=\"78\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect y=\"20\" width=\"120\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"128\" y=\"20\" width=\"30\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"166\" y=\"20\" width=\"78\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect y=\"60\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"20\" y=\"80\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"40\" y=\"100\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"88\" y=\"100\" width=\"110\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"206\" y=\"100\" width=\"24\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"238\" y=\"100\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"40\" y=\"120\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"88\" y=\"120\" width=\"50\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"146\" y=\"120\" width=\"24\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"178\" y=\"120\" width=\"90\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"276\" y=\"120\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"20\" y=\"140\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect y=\"160\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n</svg>\n</div>`\nconst SCRIPT_TAG = 'script'\n\nconst Embed = forwardRef(function Embed(\n { id, width, margin, html = defaultHtml }: Props,\n ref: Ref<HTMLDivElement | null>,\n) {\n const [container, setContainer] = useState<HTMLDivElement | null>(null)\n const [shouldRender, setShouldRender] = useState(false)\n\n useIsomorphicLayoutEffect(() => {\n setShouldRender(true)\n }, [])\n\n useImperativeHandle(ref, () => container, [container])\n\n useEffect(() => {\n // TODO: When we SSR the editor, we can remove the editor check\n // and not run this effect on the first render.\n if (!container) return\n\n const walker = container.ownerDocument.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode(node: Element) {\n return node.tagName.toLowerCase() === SCRIPT_TAG\n ? NodeFilter.FILTER_ACCEPT\n : NodeFilter.FILTER_REJECT\n },\n })\n\n const nodes: Element[] = []\n\n while (walker.nextNode()) nodes.push(walker.currentNode as Element)\n\n // By default scripts appended dynamically will execute asyncrhonously. Here we ensure that\n // scripts are loaded synchronously since that's what a user usually expects with scripts in\n // embedded in HTML which usually comes from the server.\n //\n // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#notes\n async function executeScriptsInOrder() {\n for (let i = 0; i < nodes.length; i++) {\n await new Promise<void>(resolve => {\n const node = nodes[i]\n const script = node.ownerDocument.createElement(SCRIPT_TAG)\n\n script.textContent = node.textContent\n Array.from(node.attributes).forEach(({ name, value }) => {\n script.setAttribute(name, value)\n })\n\n script.onload = () => resolve()\n script.onerror = () => resolve()\n\n node.parentNode?.insertBefore(script, node)\n node.parentNode?.removeChild(node)\n\n if (!script.hasAttribute('src')) resolve()\n })\n }\n }\n\n executeScriptsInOrder().catch(error => {\n // Ignore errors from user-provided code\n console.error(error)\n })\n }, [container, html])\n\n const className = useStyle({ minHeight: 15 })\n\n if (shouldRender === false) return null\n\n return (\n <div\n ref={setContainer}\n id={id}\n className={cx(className, width, margin)}\n dangerouslySetInnerHTML={{ __html: html }}\n />\n )\n})\n\nexport default Embed\n"],"names":["defaultHtml","SCRIPT_TAG","Embed","forwardRef","id","width","margin","html","ref","container","setContainer","useState","shouldRender","setShouldRender","useIsomorphicLayoutEffect","useImperativeHandle","useEffect","walker","ownerDocument","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","node","tagName","toLowerCase","FILTER_ACCEPT","FILTER_REJECT","nodes","nextNode","push","currentNode","i","length","Promise","resolve","script","createElement","textContent","Array","from","attributes","forEach","name","value","setAttribute","onload","onerror","parentNode","insertBefore","removeChild","hasAttribute","catch","error","console","className","useStyle","minHeight","cx","__html"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAMA,cAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBrB,MAAMC,aAAa;AAEbC,MAAAA,QAAQC,MAAAA,WAAW,gBACvB;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAAOC;AAAAA,EAAQC,OAAOP;AAAAA,GAC5BQ,KACA;AACA,QAAM,CAACC,WAAWC,gBAAgBC,MAAAA,SAAgC,IAAxB;AACpC,QAAA,CAACC,cAAcC,mBAAmBF,MAAAA,SAAS,KAAD;AAEhDG,4BAAAA,0BAA0B,MAAM;AAC9BD,oBAAgB,IAAD;AAAA,EADQ,GAEtB,CAFsB,CAAA;AAIzBE,QAAAA,oBAAoBP,KAAK,MAAMC,WAAW,CAACA,SAAD,CAAvB;AAEnBO,QAAAA,UAAU,MAAM;AAGV,QAAA,CAACP;AAAW;AAEhB,UAAMQ,SAASR,UAAUS,cAAcC,iBAAiBV,WAAWW,WAAWC,cAAc;AAAA,MAC1FC,WAAWC,MAAe;AACxB,eAAOA,KAAKC,QAAQC,kBAAkBxB,aAClCmB,WAAWM,gBACXN,WAAWO;AAAAA,MAChB;AAAA,IAAA,CALY;AAQf,UAAMC,QAAmB,CAAA;AAEzB,WAAOX,OAAOY,SAAP;AAAyBC,YAAAA,KAAKb,OAAOc;AAOL,2CAAA;AACrC,eAASC,IAAI,GAAGA,IAAIJ,MAAMK,QAAQD,KAAK;AAC/B,cAAA,IAAIE,QAAcC,CAAW,YAAA;;AACjC,gBAAMZ,OAAOK,MAAMI;AACbI,gBAAAA,SAASb,KAAKL,cAAcmB,cAAcpC,UAAjC;AAEfmC,iBAAOE,cAAcf,KAAKe;AAC1BC,gBAAMC,KAAKjB,KAAKkB,UAAhB,EAA4BC,QAAQ,CAAC;AAAA,YAAEC;AAAAA,YAAMC;AAAAA,gBAAY;AAChDC,mBAAAA,aAAaF,MAAMC,KAA1B;AAAA,UAAA,CADF;AAIOE,iBAAAA,SAAS,MAAMX;AACfY,iBAAAA,UAAU,MAAMZ;AAElBa,qBAAAA,eAAAA,mBAAYC,aAAab,QAAQb;AACjCyB,qBAAAA,eAAAA,mBAAYE,YAAY3B;AAEzB,cAAA,CAACa,OAAOe,aAAa,KAApB;AAAmC;QAAA,CAfpC;AAAA,MAiBP;AAAA,IACF;AAEoB,0BAAA,EAAGC,MAAMC,CAAS,UAAA;AAErCC,cAAQD,MAAMA,KAAd;AAAA,IAAA,CAFF;AAAA,EAAA,GAIC,CAAC5C,WAAWF,IAAZ,CAhDM;AAkDHgD,QAAAA,YAAYC,KAAAA,SAAS;AAAA,IAAEC,WAAW;AAAA,EAAA,CAAd;AAE1B,MAAI7C,iBAAiB;AAAc,WAAA;AAGjC,wCAAA,OAAA;AAAA,IACE,KAAKF;AAAAA,IACL;AAAA,IACA,WAAWgD,IAAAA,GAAGH,WAAWlD,OAAOC,MAAnB;AAAA,IACb,yBAAyB;AAAA,MAAEqD,QAAQpD;AAAAA,IAAV;AAAA,EAAA,CAL7B;AAQD,CA3EuB;;"}
package/dist/Embed.es.js CHANGED
@@ -1,15 +1,41 @@
1
1
  import { forwardRef, useState, useImperativeHandle, useEffect } from "react";
2
2
  import { u as useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect.es.js";
3
- import { e as useStyle } from "./responsive-style.es.js";
3
+ import { n as useStyle } from "./index.es.js";
4
4
  import { cx } from "@emotion/css";
5
5
  import { jsx } from "react/jsx-runtime";
6
+ import "use-sync-external-store/shim/with-selector";
7
+ import "next/dynamic";
8
+ import "./constants.es.js";
9
+ import "redux";
10
+ import "redux-thunk";
11
+ import "./actions.es.js";
12
+ import "./descriptors.es.js";
13
+ import "slate";
14
+ import "slate-react";
15
+ import "./state/breakpoints.es.js";
16
+ import "./introspection.es.js";
6
17
  import "@emotion/serialize";
7
18
  import "@emotion/utils";
19
+ import "./text-input.es.js";
20
+ import "./combobox.es.js";
8
21
  import "use-sync-external-store/shim";
9
- import "redux";
10
- import "redux-thunk";
11
22
  import "./types.es.js";
12
- import "./actions.es.js";
23
+ import "./box-models.es.js";
24
+ import "css-box-model";
25
+ import "color";
26
+ import "scroll-into-view-if-needed";
27
+ import "react-dom";
28
+ import "html-react-parser";
29
+ import "next/head";
30
+ import "@emotion/server/create-instance";
31
+ import "next/document";
32
+ import "cors";
33
+ import "path-to-regexp";
34
+ import "cookie";
35
+ import "http-proxy";
36
+ import "set-cookie-parser";
37
+ import "uuid";
38
+ import "corporate-ipsum";
13
39
  const defaultHtml = `<div style="padding: 24px; background-color: rgba(161, 168, 194, 0.18); overflow: hidden;">
14
40
  <svg width="316" height="168" viewBox="0 0 316 168" fill="none" xmlns="http://www.w3.org/2000/svg">
15
41
  <rect width="70" height="8" rx="2" fill="#A1A8C2" fill-opacity="0.5"/>
@@ -1 +1 @@
1
- {"version":3,"file":"Embed.es.js","sources":["../src/components/builtin/Embed/Embed.tsx"],"sourcesContent":["/* eslint-env browser */\n\nimport { useState, useEffect, forwardRef, Ref, useImperativeHandle } from 'react'\n\nimport { ElementIDValue, TextAreaValue } from '../../../prop-controllers/descriptors'\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { cx } from '@emotion/css'\n\ntype Props = {\n id?: ElementIDValue\n html?: TextAreaValue\n width?: string\n margin?: string\n}\n\nconst defaultHtml = `<div style=\"padding: 24px; background-color: rgba(161, 168, 194, 0.18); overflow: hidden;\">\n<svg width=\"316\" height=\"168\" viewBox=\"0 0 316 168\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<rect width=\"70\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"78\" width=\"30\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"116\" width=\"78\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect y=\"20\" width=\"120\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"128\" y=\"20\" width=\"30\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"166\" y=\"20\" width=\"78\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect y=\"60\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"20\" y=\"80\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"40\" y=\"100\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"88\" y=\"100\" width=\"110\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"206\" y=\"100\" width=\"24\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"238\" y=\"100\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"40\" y=\"120\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"88\" y=\"120\" width=\"50\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"146\" y=\"120\" width=\"24\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"178\" y=\"120\" width=\"90\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"276\" y=\"120\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"20\" y=\"140\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect y=\"160\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n</svg>\n</div>`\nconst SCRIPT_TAG = 'script'\n\nconst Embed = forwardRef(function Embed(\n { id, width, margin, html = defaultHtml }: Props,\n ref: Ref<HTMLDivElement | null>,\n) {\n const [container, setContainer] = useState<HTMLDivElement | null>(null)\n const [shouldRender, setShouldRender] = useState(false)\n\n useIsomorphicLayoutEffect(() => {\n setShouldRender(true)\n }, [])\n\n useImperativeHandle(ref, () => container, [container])\n\n useEffect(() => {\n // TODO: When we SSR the editor, we can remove the editor check\n // and not run this effect on the first render.\n if (!container) return\n\n const walker = container.ownerDocument.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode(node: Element) {\n return node.tagName.toLowerCase() === SCRIPT_TAG\n ? NodeFilter.FILTER_ACCEPT\n : NodeFilter.FILTER_REJECT\n },\n })\n\n const nodes: Element[] = []\n\n while (walker.nextNode()) nodes.push(walker.currentNode as Element)\n\n // By default scripts appended dynamically will execute asyncrhonously. Here we ensure that\n // scripts are loaded synchronously since that's what a user usually expects with scripts in\n // embedded in HTML which usually comes from the server.\n //\n // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#notes\n async function executeScriptsInOrder() {\n for (let i = 0; i < nodes.length; i++) {\n await new Promise<void>(resolve => {\n const node = nodes[i]\n const script = node.ownerDocument.createElement(SCRIPT_TAG)\n\n script.textContent = node.textContent\n Array.from(node.attributes).forEach(({ name, value }) => {\n script.setAttribute(name, value)\n })\n\n script.onload = () => resolve()\n script.onerror = () => resolve()\n\n node.parentNode?.insertBefore(script, node)\n node.parentNode?.removeChild(node)\n\n if (!script.hasAttribute('src')) resolve()\n })\n }\n }\n\n executeScriptsInOrder().catch(error => {\n // Ignore errors from user-provided code\n console.error(error)\n })\n }, [container, html])\n\n const className = useStyle({ minHeight: 15 })\n\n if (shouldRender === false) return null\n\n return (\n <div\n ref={setContainer}\n id={id}\n className={cx(className, width, margin)}\n dangerouslySetInnerHTML={{ __html: html }}\n />\n )\n})\n\nexport default Embed\n"],"names":["defaultHtml","SCRIPT_TAG","Embed","forwardRef","id","width","margin","html","ref","container","setContainer","useState","shouldRender","setShouldRender","useIsomorphicLayoutEffect","useImperativeHandle","useEffect","walker","ownerDocument","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","node","tagName","toLowerCase","FILTER_ACCEPT","FILTER_REJECT","nodes","nextNode","push","currentNode","i","length","Promise","resolve","script","createElement","textContent","Array","from","attributes","forEach","name","value","setAttribute","onload","onerror","parentNode","insertBefore","removeChild","hasAttribute","catch","error","console","className","useStyle","minHeight","cx","__html"],"mappings":";;;;;;;;;;;;AAgBA,MAAMA,cAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBrB,MAAMC,aAAa;AAEbC,MAAAA,QAAQC,WAAW,gBACvB;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAAOC;AAAAA,EAAQC,OAAOP;AAAAA,GAC5BQ,KACA;AACA,QAAM,CAACC,WAAWC,gBAAgBC,SAAgC,IAAxB;AACpC,QAAA,CAACC,cAAcC,mBAAmBF,SAAS,KAAD;AAEhDG,4BAA0B,MAAM;AAC9BD,oBAAgB,IAAD;AAAA,EADQ,GAEtB,CAFsB,CAAA;AAIzBE,sBAAoBP,KAAK,MAAMC,WAAW,CAACA,SAAD,CAAvB;AAEnBO,YAAU,MAAM;AAGV,QAAA,CAACP;AAAW;AAEhB,UAAMQ,SAASR,UAAUS,cAAcC,iBAAiBV,WAAWW,WAAWC,cAAc;AAAA,MAC1FC,WAAWC,MAAe;AACxB,eAAOA,KAAKC,QAAQC,kBAAkBxB,aAClCmB,WAAWM,gBACXN,WAAWO;AAAAA,MAChB;AAAA,IAAA,CALY;AAQf,UAAMC,QAAmB,CAAA;AAEzB,WAAOX,OAAOY,SAAP;AAAyBC,YAAAA,KAAKb,OAAOc;AAOL,2CAAA;AACrC,eAASC,IAAI,GAAGA,IAAIJ,MAAMK,QAAQD,KAAK;AAC/B,cAAA,IAAIE,QAAcC,CAAW,YAAA;;AACjC,gBAAMZ,OAAOK,MAAMI;AACbI,gBAAAA,SAASb,KAAKL,cAAcmB,cAAcpC,UAAjC;AAEfmC,iBAAOE,cAAcf,KAAKe;AAC1BC,gBAAMC,KAAKjB,KAAKkB,UAAhB,EAA4BC,QAAQ,CAAC;AAAA,YAAEC;AAAAA,YAAMC;AAAAA,gBAAY;AAChDC,mBAAAA,aAAaF,MAAMC,KAA1B;AAAA,UAAA,CADF;AAIOE,iBAAAA,SAAS,MAAMX;AACfY,iBAAAA,UAAU,MAAMZ;AAElBa,qBAAAA,eAAAA,mBAAYC,aAAab,QAAQb;AACjCyB,qBAAAA,eAAAA,mBAAYE,YAAY3B;AAEzB,cAAA,CAACa,OAAOe,aAAa,KAApB;AAAmC;QAAA,CAfpC;AAAA,MAiBP;AAAA,IACF;AAEoB,0BAAA,EAAGC,MAAMC,CAAS,UAAA;AAErCC,cAAQD,MAAMA,KAAd;AAAA,IAAA,CAFF;AAAA,EAAA,GAIC,CAAC5C,WAAWF,IAAZ,CAhDM;AAkDHgD,QAAAA,YAAYC,SAAS;AAAA,IAAEC,WAAW;AAAA,EAAA,CAAd;AAE1B,MAAI7C,iBAAiB;AAAc,WAAA;AAGjC,6BAAA,OAAA;AAAA,IACE,KAAKF;AAAAA,IACL;AAAA,IACA,WAAWgD,GAAGH,WAAWlD,OAAOC,MAAnB;AAAA,IACb,yBAAyB;AAAA,MAAEqD,QAAQpD;AAAAA,IAAV;AAAA,EAAA,CAL7B;AAQD,CA3EuB;;"}
1
+ {"version":3,"file":"Embed.es.js","sources":["../src/components/builtin/Embed/Embed.tsx"],"sourcesContent":["/* eslint-env browser */\n\nimport { useState, useEffect, forwardRef, Ref, useImperativeHandle } from 'react'\n\nimport { ElementIDValue, TextAreaValue } from '../../../prop-controllers/descriptors'\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { cx } from '@emotion/css'\n\ntype Props = {\n id?: ElementIDValue\n html?: TextAreaValue\n width?: string\n margin?: string\n}\n\nconst defaultHtml = `<div style=\"padding: 24px; background-color: rgba(161, 168, 194, 0.18); overflow: hidden;\">\n<svg width=\"316\" height=\"168\" viewBox=\"0 0 316 168\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<rect width=\"70\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"78\" width=\"30\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"116\" width=\"78\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect y=\"20\" width=\"120\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"128\" y=\"20\" width=\"30\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"166\" y=\"20\" width=\"78\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect y=\"60\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"20\" y=\"80\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"40\" y=\"100\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"88\" y=\"100\" width=\"110\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"206\" y=\"100\" width=\"24\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"238\" y=\"100\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"40\" y=\"120\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"88\" y=\"120\" width=\"50\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"146\" y=\"120\" width=\"24\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"178\" y=\"120\" width=\"90\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.25\"/>\n<rect x=\"276\" y=\"120\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect x=\"20\" y=\"140\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n<rect y=\"160\" width=\"40\" height=\"8\" rx=\"2\" fill=\"#A1A8C2\" fill-opacity=\"0.5\"/>\n</svg>\n</div>`\nconst SCRIPT_TAG = 'script'\n\nconst Embed = forwardRef(function Embed(\n { id, width, margin, html = defaultHtml }: Props,\n ref: Ref<HTMLDivElement | null>,\n) {\n const [container, setContainer] = useState<HTMLDivElement | null>(null)\n const [shouldRender, setShouldRender] = useState(false)\n\n useIsomorphicLayoutEffect(() => {\n setShouldRender(true)\n }, [])\n\n useImperativeHandle(ref, () => container, [container])\n\n useEffect(() => {\n // TODO: When we SSR the editor, we can remove the editor check\n // and not run this effect on the first render.\n if (!container) return\n\n const walker = container.ownerDocument.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode(node: Element) {\n return node.tagName.toLowerCase() === SCRIPT_TAG\n ? NodeFilter.FILTER_ACCEPT\n : NodeFilter.FILTER_REJECT\n },\n })\n\n const nodes: Element[] = []\n\n while (walker.nextNode()) nodes.push(walker.currentNode as Element)\n\n // By default scripts appended dynamically will execute asyncrhonously. Here we ensure that\n // scripts are loaded synchronously since that's what a user usually expects with scripts in\n // embedded in HTML which usually comes from the server.\n //\n // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#notes\n async function executeScriptsInOrder() {\n for (let i = 0; i < nodes.length; i++) {\n await new Promise<void>(resolve => {\n const node = nodes[i]\n const script = node.ownerDocument.createElement(SCRIPT_TAG)\n\n script.textContent = node.textContent\n Array.from(node.attributes).forEach(({ name, value }) => {\n script.setAttribute(name, value)\n })\n\n script.onload = () => resolve()\n script.onerror = () => resolve()\n\n node.parentNode?.insertBefore(script, node)\n node.parentNode?.removeChild(node)\n\n if (!script.hasAttribute('src')) resolve()\n })\n }\n }\n\n executeScriptsInOrder().catch(error => {\n // Ignore errors from user-provided code\n console.error(error)\n })\n }, [container, html])\n\n const className = useStyle({ minHeight: 15 })\n\n if (shouldRender === false) return null\n\n return (\n <div\n ref={setContainer}\n id={id}\n className={cx(className, width, margin)}\n dangerouslySetInnerHTML={{ __html: html }}\n />\n )\n})\n\nexport default Embed\n"],"names":["defaultHtml","SCRIPT_TAG","Embed","forwardRef","id","width","margin","html","ref","container","setContainer","useState","shouldRender","setShouldRender","useIsomorphicLayoutEffect","useImperativeHandle","useEffect","walker","ownerDocument","createTreeWalker","NodeFilter","SHOW_ELEMENT","acceptNode","node","tagName","toLowerCase","FILTER_ACCEPT","FILTER_REJECT","nodes","nextNode","push","currentNode","i","length","Promise","resolve","script","createElement","textContent","Array","from","attributes","forEach","name","value","setAttribute","onload","onerror","parentNode","insertBefore","removeChild","hasAttribute","catch","error","console","className","useStyle","minHeight","cx","__html"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAMA,cAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBrB,MAAMC,aAAa;AAEbC,MAAAA,QAAQC,WAAW,gBACvB;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAAOC;AAAAA,EAAQC,OAAOP;AAAAA,GAC5BQ,KACA;AACA,QAAM,CAACC,WAAWC,gBAAgBC,SAAgC,IAAxB;AACpC,QAAA,CAACC,cAAcC,mBAAmBF,SAAS,KAAD;AAEhDG,4BAA0B,MAAM;AAC9BD,oBAAgB,IAAD;AAAA,EADQ,GAEtB,CAFsB,CAAA;AAIzBE,sBAAoBP,KAAK,MAAMC,WAAW,CAACA,SAAD,CAAvB;AAEnBO,YAAU,MAAM;AAGV,QAAA,CAACP;AAAW;AAEhB,UAAMQ,SAASR,UAAUS,cAAcC,iBAAiBV,WAAWW,WAAWC,cAAc;AAAA,MAC1FC,WAAWC,MAAe;AACxB,eAAOA,KAAKC,QAAQC,kBAAkBxB,aAClCmB,WAAWM,gBACXN,WAAWO;AAAAA,MAChB;AAAA,IAAA,CALY;AAQf,UAAMC,QAAmB,CAAA;AAEzB,WAAOX,OAAOY,SAAP;AAAyBC,YAAAA,KAAKb,OAAOc;AAOL,2CAAA;AACrC,eAASC,IAAI,GAAGA,IAAIJ,MAAMK,QAAQD,KAAK;AAC/B,cAAA,IAAIE,QAAcC,CAAW,YAAA;;AACjC,gBAAMZ,OAAOK,MAAMI;AACbI,gBAAAA,SAASb,KAAKL,cAAcmB,cAAcpC,UAAjC;AAEfmC,iBAAOE,cAAcf,KAAKe;AAC1BC,gBAAMC,KAAKjB,KAAKkB,UAAhB,EAA4BC,QAAQ,CAAC;AAAA,YAAEC;AAAAA,YAAMC;AAAAA,gBAAY;AAChDC,mBAAAA,aAAaF,MAAMC,KAA1B;AAAA,UAAA,CADF;AAIOE,iBAAAA,SAAS,MAAMX;AACfY,iBAAAA,UAAU,MAAMZ;AAElBa,qBAAAA,eAAAA,mBAAYC,aAAab,QAAQb;AACjCyB,qBAAAA,eAAAA,mBAAYE,YAAY3B;AAEzB,cAAA,CAACa,OAAOe,aAAa,KAApB;AAAmC;QAAA,CAfpC;AAAA,MAiBP;AAAA,IACF;AAEoB,0BAAA,EAAGC,MAAMC,CAAS,UAAA;AAErCC,cAAQD,MAAMA,KAAd;AAAA,IAAA,CAFF;AAAA,EAAA,GAIC,CAAC5C,WAAWF,IAAZ,CAhDM;AAkDHgD,QAAAA,YAAYC,SAAS;AAAA,IAAEC,WAAW;AAAA,EAAA,CAAd;AAE1B,MAAI7C,iBAAiB;AAAc,WAAA;AAGjC,6BAAA,OAAA;AAAA,IACE,KAAKF;AAAAA,IACL;AAAA,IACA,WAAWgD,GAAGH,WAAWlD,OAAOC,MAAnB;AAAA,IACb,yBAAyB;AAAA,MAAEqD,QAAQpD;AAAAA,IAAV;AAAA,EAAA,CAL7B;AAQD,CA3EuB;;"}