@makeswift/runtime 0.9.0 → 0.9.2

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 (200) hide show
  1. package/dist/Box.cjs.js +15 -15
  2. package/dist/Box.cjs.js.map +1 -1
  3. package/dist/Box.es.js +10 -10
  4. package/dist/Button.cjs.js +12 -12
  5. package/dist/Button.cjs.js.map +1 -1
  6. package/dist/Button.es.js +10 -10
  7. package/dist/Carousel.cjs.js +28 -28
  8. package/dist/Carousel.cjs.js.map +1 -1
  9. package/dist/Carousel.es.js +7 -7
  10. package/dist/Countdown.cjs.js +15 -15
  11. package/dist/Countdown.cjs.js.map +1 -1
  12. package/dist/Countdown.es.js +7 -7
  13. package/dist/Divider.cjs.js +12 -12
  14. package/dist/Divider.cjs.js.map +1 -1
  15. package/dist/Divider.es.js +10 -10
  16. package/dist/Embed.cjs.js +3 -30
  17. package/dist/Embed.cjs.js.map +1 -1
  18. package/dist/Embed.es.js +2 -29
  19. package/dist/Embed.es.js.map +1 -1
  20. package/dist/Form.cjs.js +51 -51
  21. package/dist/Form.cjs.js.map +1 -1
  22. package/dist/Form.es.js +7 -7
  23. package/dist/Image.cjs.js +8 -8
  24. package/dist/Image.cjs.js.map +1 -1
  25. package/dist/Image.es.js +7 -7
  26. package/dist/LiveProvider.cjs.js +6 -6
  27. package/dist/LiveProvider.es.js +8 -8
  28. package/dist/Navigation.cjs.js +27 -27
  29. package/dist/Navigation.cjs.js.map +1 -1
  30. package/dist/Navigation.es.js +6 -6
  31. package/dist/PreviewProvider.cjs.js +7 -7
  32. package/dist/PreviewProvider.cjs.js.map +1 -1
  33. package/dist/PreviewProvider.es.js +7 -7
  34. package/dist/ReadOnlyText.cjs.js +16 -13
  35. package/dist/ReadOnlyText.cjs.js.map +1 -1
  36. package/dist/ReadOnlyText.es.js +11 -8
  37. package/dist/ReadOnlyText.es.js.map +1 -1
  38. package/dist/ReadOnlyTextV2.cjs.js +13 -10
  39. package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
  40. package/dist/ReadOnlyTextV2.es.js +9 -6
  41. package/dist/ReadOnlyTextV2.es.js.map +1 -1
  42. package/dist/Root.cjs.js +8 -8
  43. package/dist/Root.cjs.js.map +1 -1
  44. package/dist/Root.es.js +6 -6
  45. package/dist/SocialLinks.cjs.js +14 -14
  46. package/dist/SocialLinks.cjs.js.map +1 -1
  47. package/dist/SocialLinks.es.js +10 -10
  48. package/dist/Text.cjs.js +4 -4
  49. package/dist/Text.es.js +5 -5
  50. package/dist/Video.cjs.js +3 -30
  51. package/dist/Video.cjs.js.map +1 -1
  52. package/dist/Video.es.js +2 -29
  53. package/dist/Video.es.js.map +1 -1
  54. package/dist/builder.cjs.js +4 -2
  55. package/dist/builder.cjs.js.map +1 -1
  56. package/dist/builder.es.js +4 -2
  57. package/dist/builder.es.js.map +1 -1
  58. package/dist/components.cjs.js +9 -9
  59. package/dist/components.es.js +9 -9
  60. package/dist/control-serialization.cjs.js +88 -12
  61. package/dist/control-serialization.cjs.js.map +1 -1
  62. package/dist/control-serialization.es.js +89 -13
  63. package/dist/control-serialization.es.js.map +1 -1
  64. package/dist/controls.cjs.js +15 -4
  65. package/dist/controls.cjs.js.map +1 -1
  66. package/dist/controls.es.js +6 -3
  67. package/dist/controls.es.js.map +1 -1
  68. package/dist/deepEqual.cjs.js +40 -0
  69. package/dist/deepEqual.cjs.js.map +1 -0
  70. package/dist/deepEqual.es.js +39 -0
  71. package/dist/deepEqual.es.js.map +1 -0
  72. package/dist/index.cjs.js +102 -98
  73. package/dist/index.cjs.js.map +1 -1
  74. package/dist/index.cjs10.js +173 -249
  75. package/dist/index.cjs10.js.map +1 -1
  76. package/dist/index.cjs11.js +375 -0
  77. package/dist/index.cjs11.js.map +1 -0
  78. package/dist/index.cjs2.js +14 -16
  79. package/dist/index.cjs2.js.map +1 -1
  80. package/dist/index.cjs4.js +2 -1
  81. package/dist/index.cjs4.js.map +1 -1
  82. package/dist/index.cjs6.js +700 -22
  83. package/dist/index.cjs6.js.map +1 -1
  84. package/dist/index.cjs7.js +37 -13
  85. package/dist/index.cjs7.js.map +1 -1
  86. package/dist/index.cjs8.js +17 -41
  87. package/dist/index.cjs8.js.map +1 -1
  88. package/dist/index.cjs9.js +13 -266
  89. package/dist/index.cjs9.js.map +1 -1
  90. package/dist/index.es.js +85 -80
  91. package/dist/index.es.js.map +1 -1
  92. package/dist/index.es10.js +174 -250
  93. package/dist/index.es10.js.map +1 -1
  94. package/dist/index.es11.js +368 -0
  95. package/dist/index.es11.js.map +1 -0
  96. package/dist/index.es2.js +3 -5
  97. package/dist/index.es2.js.map +1 -1
  98. package/dist/index.es3.js +1 -1
  99. package/dist/index.es4.js +2 -1
  100. package/dist/index.es4.js.map +1 -1
  101. package/dist/index.es6.js +695 -22
  102. package/dist/index.es6.js.map +1 -1
  103. package/dist/index.es7.js +33 -14
  104. package/dist/index.es7.js.map +1 -1
  105. package/dist/index.es8.js +17 -39
  106. package/dist/index.es8.js.map +1 -1
  107. package/dist/index.es9.js +12 -261
  108. package/dist/index.es9.js.map +1 -1
  109. package/dist/leaf.cjs.js +1 -1
  110. package/dist/leaf.cjs.js.map +1 -1
  111. package/dist/leaf.es.js +2 -2
  112. package/dist/main.cjs.js +4 -2
  113. package/dist/main.cjs.js.map +1 -1
  114. package/dist/main.es.js +4 -2
  115. package/dist/main.es.js.map +1 -1
  116. package/dist/next.cjs.js +3 -3
  117. package/dist/next.es.js +4 -4
  118. package/dist/prop-controllers.cjs.js +4 -2
  119. package/dist/prop-controllers.cjs.js.map +1 -1
  120. package/dist/prop-controllers.es.js +4 -2
  121. package/dist/prop-controllers.es.js.map +1 -1
  122. package/dist/react-page.cjs.js +958 -1431
  123. package/dist/react-page.cjs.js.map +1 -1
  124. package/dist/react-page.es.js +852 -1343
  125. package/dist/react-page.es.js.map +1 -1
  126. package/dist/react.cjs.js +3 -3
  127. package/dist/react.es.js +3 -3
  128. package/dist/select.cjs.js +21 -0
  129. package/dist/select.cjs.js.map +1 -0
  130. package/dist/select.es.js +16 -0
  131. package/dist/select.es.js.map +1 -0
  132. package/dist/slate.cjs.js +213 -12
  133. package/dist/slate.cjs.js.map +1 -1
  134. package/dist/slate.es.js +207 -6
  135. package/dist/slate.es.js.map +1 -1
  136. package/dist/types/src/api/react.d.ts.map +1 -1
  137. package/dist/types/src/builder/serialization/control-serialization.d.ts +3 -3
  138. package/dist/types/src/builder/serialization/control-serialization.d.ts.map +1 -1
  139. package/dist/types/src/builder/serialization/controls/rich-text-v2.d.ts +2 -2
  140. package/dist/types/src/builder/serialization/controls/rich-text-v2.d.ts.map +1 -1
  141. package/dist/types/src/builder/serialization/controls/style-v2.d.ts +5 -0
  142. package/dist/types/src/builder/serialization/controls/style-v2.d.ts.map +1 -0
  143. package/dist/types/src/components/builtin/Button/Button.d.ts +1 -1
  144. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
  145. package/dist/types/src/components/hooks/useIsomorphicLayoutEffect.d.ts +2 -2
  146. package/dist/types/src/components/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -1
  147. package/dist/types/src/components/page/Page.d.ts.map +1 -1
  148. package/dist/types/src/controls/control.d.ts +4 -2
  149. package/dist/types/src/controls/control.d.ts.map +1 -1
  150. package/dist/types/src/controls/icon-radio-group.d.ts +29 -0
  151. package/dist/types/src/controls/icon-radio-group.d.ts.map +1 -0
  152. package/dist/types/src/controls/index.d.ts +2 -0
  153. package/dist/types/src/controls/index.d.ts.map +1 -1
  154. package/dist/types/src/controls/rich-text/translation.d.ts +1 -1
  155. package/dist/types/src/controls/rich-text/translation.d.ts.map +1 -1
  156. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +12 -3
  157. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  158. package/dist/types/src/controls/shape.d.ts +1 -2
  159. package/dist/types/src/controls/shape.d.ts.map +1 -1
  160. package/dist/types/src/controls/style-v2.d.ts +64 -0
  161. package/dist/types/src/controls/style-v2.d.ts.map +1 -0
  162. package/dist/types/src/next/client.d.ts.map +1 -1
  163. package/dist/types/src/next/document.d.ts.map +1 -1
  164. package/dist/types/src/prop-controllers/descriptors.d.ts +6 -3
  165. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  166. package/dist/types/src/prop-controllers/instances.d.ts +2 -2
  167. package/dist/types/src/prop-controllers/instances.d.ts.map +1 -1
  168. package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
  169. package/dist/types/src/runtimes/react/controls/control.d.ts +5 -2
  170. package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
  171. package/dist/types/src/runtimes/react/controls/icon-radio-group.d.ts +4 -0
  172. package/dist/types/src/runtimes/react/controls/icon-radio-group.d.ts.map +1 -0
  173. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts +2 -1
  174. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -1
  175. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts +10 -0
  176. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts.map +1 -0
  177. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts +10 -0
  178. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts.map +1 -0
  179. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts +1 -1
  180. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  181. package/dist/types/src/runtimes/react/controls/style-v2.d.ts +13 -0
  182. package/dist/types/src/runtimes/react/controls/style-v2.d.ts.map +1 -0
  183. package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
  184. package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
  185. package/dist/types/src/slate/BlockPlugin/index.d.ts +4 -0
  186. package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
  187. package/dist/types/src/slate/ColorPlugin/index.d.ts +10 -0
  188. package/dist/types/src/slate/ColorPlugin/index.d.ts.map +1 -0
  189. package/dist/types/src/slate/InlineModePlugin/index.d.ts +2 -0
  190. package/dist/types/src/slate/InlineModePlugin/index.d.ts.map +1 -1
  191. package/dist/types/src/slate/TextAlignPlugin/index.d.ts +9 -0
  192. package/dist/types/src/slate/TextAlignPlugin/index.d.ts.map +1 -0
  193. package/dist/types/src/slate/index.d.ts +2 -0
  194. package/dist/types/src/slate/index.d.ts.map +1 -1
  195. package/dist/types/src/slate/types.d.ts +39 -0
  196. package/dist/types/src/slate/types.d.ts.map +1 -1
  197. package/dist/types/src/slate/utils/responsive.d.ts +16 -0
  198. package/dist/types/src/slate/utils/responsive.d.ts.map +1 -0
  199. package/dist/useMediaQuery.es.js +1 -1
  200. package/package.json +1 -1
@@ -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,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;;"}
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,UAAAA,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,42 +1,15 @@
1
1
  import { forwardRef, useState, useImperativeHandle, useEffect } from "react";
2
2
  import { u as useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect.es.js";
3
- import { n as useStyle } from "./index.es.js";
3
+ import { Z as useStyle } from "./react-page.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 "./react-page.es.js";
9
6
  import "redux";
10
7
  import "redux-thunk";
11
8
  import "./actions.es.js";
12
9
  import "./state/breakpoints.es.js";
13
- import "slate";
14
- import "is-hotkey";
15
- import "slate-react";
16
10
  import "@emotion/serialize";
17
11
  import "@emotion/utils";
18
- import "./text-input.es.js";
19
- import "./combobox.es.js";
20
- import "use-sync-external-store/shim";
21
- import "./types.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 "zod";
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 "./constants.es.js";
38
- import "uuid";
39
- import "corporate-ipsum";
12
+ import "slate";
40
13
  const defaultHtml = `<div style="padding: 24px; background-color: rgba(161, 168, 194, 0.18); overflow: hidden;">
41
14
  <svg width="316" height="168" viewBox="0 0 316 168" fill="none" xmlns="http://www.w3.org/2000/svg">
42
15
  <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;;"}
package/dist/Form.cjs.js CHANGED
@@ -34,28 +34,28 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
34
34
  var React = require("react");
35
35
  var formik = require("formik");
36
36
  var css = require("@emotion/css");
37
+ var reactPage = require("./react-page.cjs.js");
37
38
  var next = require("./index.cjs.js");
38
39
  var jsxRuntime = require("react/jsx-runtime");
39
40
  var ColorHelper = require("color");
40
41
  var Button$1 = require("./Button.cjs.js");
41
42
  var index = require("./index.cjs3.js");
42
43
  var boxModels = require("./box-models.cjs.js");
43
- require("use-sync-external-store/shim/with-selector");
44
- require("next/dynamic");
45
- require("./react-page.cjs.js");
46
44
  require("redux");
47
45
  require("redux-thunk");
48
46
  require("./actions.cjs.js");
49
47
  require("./state/breakpoints.cjs.js");
50
- require("slate");
51
- require("is-hotkey");
52
- require("slate-react");
53
48
  require("@emotion/serialize");
54
49
  require("@emotion/utils");
50
+ require("slate");
51
+ require("use-sync-external-store/shim/with-selector");
52
+ require("next/dynamic");
55
53
  require("./text-input.cjs.js");
56
54
  require("./combobox.cjs.js");
55
+ require("./select.cjs.js");
57
56
  require("use-sync-external-store/shim");
58
57
  require("./types.cjs.js");
58
+ require("./deepEqual.cjs.js");
59
59
  require("scroll-into-view-if-needed");
60
60
  require("react-dom");
61
61
  require("html-react-parser");
@@ -270,13 +270,13 @@ var Input$2 = React.forwardRef(function Input2(_a, ref) {
270
270
  } = next.useFormContext();
271
271
  return /* @__PURE__ */ jsxRuntime.jsx("input", __spreadProps(__spreadValues({}, restOfProps), {
272
272
  ref,
273
- className: css.cx(next.useStyle(responsiveField({
273
+ className: css.cx(reactPage.useStyle(responsiveField({
274
274
  shape,
275
275
  size,
276
276
  contrast,
277
277
  brandColor,
278
278
  error
279
- })), next.useStyle(next.useResponsiveStyle([size], ([size2 = next.Sizes.MEDIUM]) => ({
279
+ })), reactPage.useStyle(next.useResponsiveStyle([size], ([size2 = next.Sizes.MEDIUM]) => ({
280
280
  minHeight: getSizeHeight$1(size2),
281
281
  maxHeight: getSizeHeight$1(size2)
282
282
  }))), className)
@@ -284,7 +284,7 @@ var Input$2 = React.forwardRef(function Input2(_a, ref) {
284
284
  });
285
285
  function Label$2() {
286
286
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
287
- className: next.useStyle({
287
+ className: reactPage.useStyle({
288
288
  maxWidth: 120,
289
289
  minWidth: 60,
290
290
  height: 8,
@@ -297,7 +297,7 @@ function Label$2() {
297
297
  }
298
298
  function Input$1() {
299
299
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
300
- className: next.useStyle({
300
+ className: reactPage.useStyle({
301
301
  minWidth: 80,
302
302
  height: 32,
303
303
  borderRadius: 4,
@@ -310,7 +310,7 @@ function Input$1() {
310
310
  }
311
311
  function Button() {
312
312
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
313
- className: next.useStyle({
313
+ className: reactPage.useStyle({
314
314
  minWidth: 140,
315
315
  height: 32,
316
316
  borderRadius: 4,
@@ -326,7 +326,7 @@ var Placeholder = React.forwardRef(function Placeholder2({
326
326
  }, ref) {
327
327
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
328
328
  ref,
329
- className: css.cx(next.useStyle({
329
+ className: css.cx(reactPage.useStyle({
330
330
  display: "flex",
331
331
  flexDirection: "column"
332
332
  }), width, margin, className),
@@ -392,10 +392,10 @@ function Label$1(_c) {
392
392
  labelTextColor
393
393
  } = next.useFormContext();
394
394
  return /* @__PURE__ */ jsxRuntime.jsx(Component, __spreadProps(__spreadValues({}, restOfProps), {
395
- className: css.cx(next.useStyle({
395
+ className: css.cx(reactPage.useStyle({
396
396
  display: "block",
397
397
  margin: "0 0 0.25em 0"
398
- }), next.useStyle(next.useResponsiveTextStyle(labelTextStyle)), next.useStyle(next.useResponsiveStyle([size, contrast, labelTextColor], ([size2 = next.Sizes.MEDIUM, contrast2 = next.Contrasts.LIGHT, textColor]) => ({
398
+ }), reactPage.useStyle(next.useResponsiveTextStyle(labelTextStyle)), reactPage.useStyle(next.useResponsiveStyle([size, contrast, labelTextColor], ([size2 = next.Sizes.MEDIUM, contrast2 = next.Contrasts.LIGHT, textColor]) => ({
399
399
  minHeight: getSizeHeight(size2),
400
400
  color: textColor == null ? getContrastColor(contrast2) : next.colorToString(textColor)
401
401
  }))), className)
@@ -447,9 +447,9 @@ var TextArea = React.forwardRef(function TextArea2(_g2, ref) {
447
447
  } = next.useFormContext();
448
448
  return /* @__PURE__ */ jsxRuntime.jsx("textarea", __spreadProps(__spreadValues({}, restOfProps), {
449
449
  ref,
450
- className: css.cx(next.useStyle({
450
+ className: css.cx(reactPage.useStyle({
451
451
  resize: "vertical"
452
- }), next.useStyle(responsiveField({
452
+ }), reactPage.useStyle(responsiveField({
453
453
  error,
454
454
  shape,
455
455
  size,
@@ -508,7 +508,7 @@ function FakeCheckbox({
508
508
  }) {
509
509
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
510
510
  style,
511
- className: css.cx(FAKE_CHECKBOX_CLASS_NAME, next.useStyle({
511
+ className: css.cx(FAKE_CHECKBOX_CLASS_NAME, reactPage.useStyle({
512
512
  position: "absolute",
513
513
  width: "100%",
514
514
  height: "100%",
@@ -516,7 +516,7 @@ function FakeCheckbox({
516
516
  borderRadius: 4,
517
517
  pointerEvents: "none",
518
518
  borderWidth: 1
519
- }), next.useStyle(next.useResponsiveStyle([contrast], ([contrast2 = next.Contrasts.LIGHT]) => ({
519
+ }), reactPage.useStyle(next.useResponsiveStyle([contrast], ([contrast2 = next.Contrasts.LIGHT]) => ({
520
520
  borderColor: getContrastBorderColor(contrast2, error),
521
521
  backgroundColor: getContrastBackgroundColor(contrast2)
522
522
  }))), className)
@@ -538,7 +538,7 @@ const HiddenCheckbox = React.forwardRef(function HiddenCheckbox2(_k, ref) {
538
538
  ]);
539
539
  return /* @__PURE__ */ jsxRuntime.jsx("input", __spreadProps(__spreadValues({}, restOfProps), {
540
540
  ref,
541
- className: css.cx(next.useStyle({
541
+ className: css.cx(reactPage.useStyle({
542
542
  position: "absolute",
543
543
  opacity: 0,
544
544
  width: "100%",
@@ -628,9 +628,9 @@ var Checkbox = React.forwardRef(function Checkbox2(_m, ref) {
628
628
  brandColor
629
629
  } = next.useFormContext();
630
630
  return /* @__PURE__ */ jsxRuntime.jsxs("div", {
631
- className: css.cx(next.useStyle({
631
+ className: css.cx(reactPage.useStyle({
632
632
  position: "relative"
633
- }), next.useStyle(next.useResponsiveStyle([size], ([size2 = next.Sizes.MEDIUM]) => ({
633
+ }), reactPage.useStyle(next.useResponsiveStyle([size], ([size2 = next.Sizes.MEDIUM]) => ({
634
634
  height: getSizeHeight(size2),
635
635
  width: getSizeHeight(size2)
636
636
  })))),
@@ -676,17 +676,17 @@ var CheckboxTableField = React.forwardRef(function CheckboxTableField2(_o, ref)
676
676
  form.setFieldValue(name, event.currentTarget.checked);
677
677
  }
678
678
  return /* @__PURE__ */ jsxRuntime.jsxs(Label$1, {
679
- className: css.cx(next.useStyle({
679
+ className: css.cx(reactPage.useStyle({
680
680
  display: "flex",
681
681
  alignItems: "center",
682
682
  margin: 0
683
- }), next.useStyle(next.useResponsiveStyle([size], ([size2 = next.Sizes.MEDIUM]) => ({
683
+ }), reactPage.useStyle(next.useResponsiveStyle([size], ([size2 = next.Sizes.MEDIUM]) => ({
684
684
  minHeight: getSizeHeight$1(size2),
685
685
  maxHeight: getSizeHeight$1(size2)
686
686
  })))),
687
687
  htmlFor: id,
688
688
  children: [/* @__PURE__ */ jsxRuntime.jsx("span", {
689
- className: next.useStyle({
689
+ className: reactPage.useStyle({
690
690
  marginRight: 8
691
691
  }),
692
692
  children: /* @__PURE__ */ jsxRuntime.jsx(Checkbox, __spreadProps(__spreadValues({}, restOfProps), {
@@ -707,7 +707,7 @@ function MainLabel(_q) {
707
707
  "className"
708
708
  ]);
709
709
  return /* @__PURE__ */ jsxRuntime.jsx(Label$1, __spreadProps(__spreadValues({}, restOfProps), {
710
- className: css.cx(next.useStyle({
710
+ className: css.cx(reactPage.useStyle({
711
711
  margin: "0 0 4px 0"
712
712
  }), className)
713
713
  }));
@@ -719,7 +719,7 @@ function StyledLabel$1(_s) {
719
719
  "className"
720
720
  ]);
721
721
  return /* @__PURE__ */ jsxRuntime.jsx(Label$1, __spreadProps(__spreadValues({}, restOfProps), {
722
- className: css.cx(next.useStyle({
722
+ className: css.cx(reactPage.useStyle({
723
723
  display: "flex",
724
724
  alignItems: "center",
725
725
  margin: "8px 0",
@@ -736,7 +736,7 @@ function CheckboxContainer(_u) {
736
736
  "className"
737
737
  ]);
738
738
  return /* @__PURE__ */ jsxRuntime.jsx("span", __spreadProps(__spreadValues({}, restOfProps), {
739
- className: css.cx(next.useStyle({
739
+ className: css.cx(reactPage.useStyle({
740
740
  marginRight: 8
741
741
  }), className)
742
742
  }));
@@ -812,9 +812,9 @@ function Container$1(_y) {
812
812
  "className"
813
813
  ]);
814
814
  return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
815
- className: css.cx(next.useStyle({
815
+ className: css.cx(reactPage.useStyle({
816
816
  position: "relative"
817
- }), next.useStyle(next.useResponsiveStyle([size], ([size2 = next.Sizes.MEDIUM]) => ({
817
+ }), reactPage.useStyle(next.useResponsiveStyle([size], ([size2 = next.Sizes.MEDIUM]) => ({
818
818
  height: getSizeHeight(size2),
819
819
  width: getSizeHeight(size2)
820
820
  }))), className)
@@ -832,7 +832,7 @@ function FakeRadioButton(_A) {
832
832
  "error"
833
833
  ]);
834
834
  return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
835
- className: css.cx(FAKE_RADIO_BUTTON_CLASS_NAME, next.useStyle({
835
+ className: css.cx(FAKE_RADIO_BUTTON_CLASS_NAME, reactPage.useStyle({
836
836
  position: "absolute",
837
837
  width: "100%",
838
838
  height: "100%",
@@ -840,7 +840,7 @@ function FakeRadioButton(_A) {
840
840
  borderRadius: "50%",
841
841
  pointerEvents: "none",
842
842
  borderWidth: 1
843
- }), next.useStyle(next.useResponsiveStyle([contrast], ([contrast2 = next.Contrasts.LIGHT]) => ({
843
+ }), reactPage.useStyle(next.useResponsiveStyle([contrast], ([contrast2 = next.Contrasts.LIGHT]) => ({
844
844
  borderColor: getContrastBorderColor(contrast2, error),
845
845
  backgroundColor: getContrastBackgroundColor(contrast2)
846
846
  }))), className)
@@ -860,7 +860,7 @@ const HiddenRadioButton = React.forwardRef(function HiddenRadioButton2(_C, ref)
860
860
  ]);
861
861
  return /* @__PURE__ */ jsxRuntime.jsx("input", __spreadProps(__spreadValues({}, restOfProps), {
862
862
  type: "radio",
863
- className: css.cx(next.useStyle({
863
+ className: css.cx(reactPage.useStyle({
864
864
  position: "absolute",
865
865
  opacity: 0,
866
866
  width: "100%",
@@ -964,7 +964,7 @@ function StyledLabel(_G) {
964
964
  "className"
965
965
  ]);
966
966
  return /* @__PURE__ */ jsxRuntime.jsx(Label$1, __spreadProps(__spreadValues({}, restOfProps), {
967
- className: css.cx(next.useStyle({
967
+ className: css.cx(reactPage.useStyle({
968
968
  display: "flex",
969
969
  alignItems: "center",
970
970
  margin: "8px 0",
@@ -981,7 +981,7 @@ function RadioButtonContainer(_I) {
981
981
  "className"
982
982
  ]);
983
983
  return /* @__PURE__ */ jsxRuntime.jsx("span", __spreadProps(__spreadValues({}, restOfProps), {
984
- className: css.cx(next.useStyle({
984
+ className: css.cx(reactPage.useStyle({
985
985
  marginRight: 8
986
986
  }), className)
987
987
  }));
@@ -1048,13 +1048,13 @@ function Container(_M) {
1048
1048
  "className"
1049
1049
  ]);
1050
1050
  return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
1051
- className: css.cx(next.useStyle(responsiveField({
1051
+ className: css.cx(reactPage.useStyle(responsiveField({
1052
1052
  shape,
1053
1053
  size,
1054
1054
  contrast,
1055
1055
  brandColor,
1056
1056
  error
1057
- })), next.useStyle(__spreadValues({
1057
+ })), reactPage.useStyle(__spreadValues({
1058
1058
  display: "flex",
1059
1059
  alignItems: "center",
1060
1060
  position: "relative",
@@ -1086,7 +1086,7 @@ const Select = React.forwardRef(function Select2(_O, ref) {
1086
1086
  ]);
1087
1087
  return /* @__PURE__ */ jsxRuntime.jsx("select", __spreadProps(__spreadValues({}, restOfProps), {
1088
1088
  ref,
1089
- className: css.cx(next.useStyle({
1089
+ className: css.cx(reactPage.useStyle({
1090
1090
  appearance: "none",
1091
1091
  position: "absolute",
1092
1092
  top: 0,
@@ -1285,14 +1285,14 @@ function Label({
1285
1285
  size
1286
1286
  }) {
1287
1287
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
1288
- className: css.cx(next.useStyle({
1288
+ className: css.cx(reactPage.useStyle({
1289
1289
  display: "block",
1290
1290
  maxWidth: 120,
1291
1291
  minWidth: 60,
1292
1292
  borderRadius: 2,
1293
1293
  backgroundColor: "#5f49f4",
1294
1294
  opacity: 0.4
1295
- }), next.useStyle(next.useResponsiveStyle([size], ([size2 = next.Sizes.MEDIUM]) => ({
1295
+ }), reactPage.useStyle(next.useResponsiveStyle([size], ([size2 = next.Sizes.MEDIUM]) => ({
1296
1296
  margin: `calc(0.25 * ${getSizeHeight(size2)}px + 2px) 0`,
1297
1297
  minHeight: 0.5 * getSizeHeight(size2),
1298
1298
  maxHeight: 0.5 * getSizeHeight(size2)
@@ -1304,14 +1304,14 @@ function Input({
1304
1304
  size
1305
1305
  }) {
1306
1306
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
1307
- className: css.cx(next.useStyle({
1307
+ className: css.cx(reactPage.useStyle({
1308
1308
  display: "block",
1309
1309
  width: "100%",
1310
1310
  borderWidth: 2,
1311
1311
  borderStyle: "solid",
1312
1312
  borderColor: "#5f49f4",
1313
1313
  opacity: 0.4
1314
- }), next.useStyle(next.useResponsiveStyle([shape, size], ([shape2 = next.Shapes.ROUNDED, size2 = next.Sizes.MEDIUM]) => ({
1314
+ }), reactPage.useStyle(next.useResponsiveStyle([shape, size], ([shape2 = next.Shapes.ROUNDED, size2 = next.Sizes.MEDIUM]) => ({
1315
1315
  minHeight: getSizeHeight$1(size2),
1316
1316
  maxHeight: getSizeHeight$1(size2),
1317
1317
  borderRadius: getShapeBorderRadius(shape2)
@@ -1474,7 +1474,7 @@ const spin = css.keyframes`
1474
1474
  `;
1475
1475
  function Spinner() {
1476
1476
  return /* @__PURE__ */ jsxRuntime.jsx(SvgSpinner20, {
1477
- className: next.useStyle({
1477
+ className: reactPage.useStyle({
1478
1478
  display: "inline-flex",
1479
1479
  animation: `${spin} 1s linear infinite`,
1480
1480
  stroke: "currentColor"
@@ -1533,11 +1533,11 @@ const GridForm = React.forwardRef(function GridFrom(_aa, ref) {
1533
1533
  ]);
1534
1534
  return /* @__PURE__ */ jsxRuntime.jsx("form", __spreadProps(__spreadValues({}, restOfProps), {
1535
1535
  ref,
1536
- className: css.cx(next.useStyle({
1536
+ className: css.cx(reactPage.useStyle({
1537
1537
  display: "flex",
1538
1538
  flexWrap: "wrap",
1539
1539
  width: "100%"
1540
- }), next.useStyle(next.useResponsiveStyle([size], ([size2 = next.Sizes.MEDIUM]) => ({
1540
+ }), reactPage.useStyle(next.useResponsiveStyle([size], ([size2 = next.Sizes.MEDIUM]) => ({
1541
1541
  fontSize: getSizeFontSize(size2)
1542
1542
  }))), className)
1543
1543
  }));
@@ -1558,10 +1558,10 @@ const GridItem = React.forwardRef(function GridItem2(_ca, ref) {
1558
1558
  ]);
1559
1559
  return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
1560
1560
  ref,
1561
- className: css.cx(next.useStyle({
1561
+ className: css.cx(reactPage.useStyle({
1562
1562
  alignSelf: "flex-end",
1563
1563
  flexDirection: "column"
1564
- }), next.useStyle(next.useResponsiveGridItem({
1564
+ }), reactPage.useStyle(next.useResponsiveGridItem({
1565
1565
  grid,
1566
1566
  index: index2,
1567
1567
  rowGap,
@@ -1591,11 +1591,11 @@ function StyledButton(_ea) {
1591
1591
  ]);
1592
1592
  return /* @__PURE__ */ jsxRuntime.jsx(Button$1["default"], __spreadProps(__spreadValues({}, restOfProps), {
1593
1593
  as: "button",
1594
- className: css.cx(next.useStyle({
1594
+ className: css.cx(reactPage.useStyle({
1595
1595
  display: "flex",
1596
1596
  alignItems: "center",
1597
1597
  justifyContent: "center"
1598
- }), next.useStyle(next.useResponsiveStyle([size, alignment], ([size2 = next.Sizes.MEDIUM, alignment2 = next.Alignments.CENTER]) => ({
1598
+ }), reactPage.useStyle(next.useResponsiveStyle([size, alignment], ([size2 = next.Sizes.MEDIUM, alignment2 = next.Alignments.CENTER]) => ({
1599
1599
  minHeight: getSizeHeight$1(size2),
1600
1600
  maxHeight: getSizeHeight$1(size2),
1601
1601
  margin: getAlignmentMargin(alignment2),
@@ -1611,7 +1611,7 @@ function ErrorContainer(_ga) {
1611
1611
  "className"
1612
1612
  ]);
1613
1613
  return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
1614
- className: css.cx(next.useStyle({
1614
+ className: css.cx(reactPage.useStyle({
1615
1615
  padding: "8px 16px",
1616
1616
  backgroundColor: "#f19eb9",
1617
1617
  borderRadius: 4,
@@ -1626,7 +1626,7 @@ function IconContainer(_ia) {
1626
1626
  "className"
1627
1627
  ]);
1628
1628
  return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({}, restOfProps), {
1629
- className: css.cx(next.useStyle({
1629
+ className: css.cx(reactPage.useStyle({
1630
1630
  fill: "currentColor"
1631
1631
  }), className)
1632
1632
  }));
@@ -1638,7 +1638,7 @@ function ErrorMessage(_ka) {
1638
1638
  "className"
1639
1639
  ]);
1640
1640
  return /* @__PURE__ */ jsxRuntime.jsx("p", __spreadProps(__spreadValues({}, restOfProps), {
1641
- className: css.cx(next.useStyle({
1641
+ className: css.cx(reactPage.useStyle({
1642
1642
  fontSize: 12,
1643
1643
  margin: "8px 0",
1644
1644
  color: "rgba(127, 0, 0, 0.95)"