@makeswift/runtime 0.8.9 → 0.8.10

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 (249) hide show
  1. package/dist/Box.cjs.js +2 -4
  2. package/dist/Box.cjs.js.map +1 -1
  3. package/dist/Box.es.js +2 -4
  4. package/dist/Box.es.js.map +1 -1
  5. package/dist/Button.cjs.js +1 -4
  6. package/dist/Button.cjs.js.map +1 -1
  7. package/dist/Button.es.js +1 -4
  8. package/dist/Button.es.js.map +1 -1
  9. package/dist/Carousel.cjs.js +1 -4
  10. package/dist/Carousel.cjs.js.map +1 -1
  11. package/dist/Carousel.es.js +1 -4
  12. package/dist/Carousel.es.js.map +1 -1
  13. package/dist/Countdown.cjs.js +1 -4
  14. package/dist/Countdown.cjs.js.map +1 -1
  15. package/dist/Countdown.es.js +1 -4
  16. package/dist/Countdown.es.js.map +1 -1
  17. package/dist/Divider.cjs.js +1 -4
  18. package/dist/Divider.cjs.js.map +1 -1
  19. package/dist/Divider.es.js +1 -4
  20. package/dist/Divider.es.js.map +1 -1
  21. package/dist/Embed.cjs.js +3 -5
  22. package/dist/Embed.cjs.js.map +1 -1
  23. package/dist/Embed.es.js +3 -5
  24. package/dist/Embed.es.js.map +1 -1
  25. package/dist/Form.cjs.js +1 -4
  26. package/dist/Form.cjs.js.map +1 -1
  27. package/dist/Form.es.js +2 -5
  28. package/dist/Form.es.js.map +1 -1
  29. package/dist/Image.cjs.js +1 -4
  30. package/dist/Image.cjs.js.map +1 -1
  31. package/dist/Image.es.js +2 -5
  32. package/dist/Image.es.js.map +1 -1
  33. package/dist/LiveProvider.cjs.js +1 -4
  34. package/dist/LiveProvider.cjs.js.map +1 -1
  35. package/dist/LiveProvider.es.js +2 -5
  36. package/dist/LiveProvider.es.js.map +1 -1
  37. package/dist/Navigation.cjs.js +3 -5
  38. package/dist/Navigation.cjs.js.map +1 -1
  39. package/dist/Navigation.es.js +3 -5
  40. package/dist/Navigation.es.js.map +1 -1
  41. package/dist/PreviewProvider.cjs.js +1 -4
  42. package/dist/PreviewProvider.cjs.js.map +1 -1
  43. package/dist/PreviewProvider.es.js +3 -6
  44. package/dist/PreviewProvider.es.js.map +1 -1
  45. package/dist/ReadOnlyText.cjs.js +62 -60
  46. package/dist/ReadOnlyText.cjs.js.map +1 -1
  47. package/dist/ReadOnlyText.es.js +9 -7
  48. package/dist/ReadOnlyText.es.js.map +1 -1
  49. package/dist/ReadOnlyTextV2.cjs.js +318 -0
  50. package/dist/ReadOnlyTextV2.cjs.js.map +1 -0
  51. package/dist/ReadOnlyTextV2.es.js +314 -0
  52. package/dist/ReadOnlyTextV2.es.js.map +1 -0
  53. package/dist/Root.cjs.js +2 -4
  54. package/dist/Root.cjs.js.map +1 -1
  55. package/dist/Root.es.js +2 -4
  56. package/dist/Root.es.js.map +1 -1
  57. package/dist/SocialLinks.cjs.js +1 -4
  58. package/dist/SocialLinks.cjs.js.map +1 -1
  59. package/dist/SocialLinks.es.js +1 -4
  60. package/dist/SocialLinks.es.js.map +1 -1
  61. package/dist/Text.cjs.js +2 -5
  62. package/dist/Text.cjs.js.map +1 -1
  63. package/dist/Text.es.js +3 -6
  64. package/dist/Text.es.js.map +1 -1
  65. package/dist/Video.cjs.js +1 -4
  66. package/dist/Video.cjs.js.map +1 -1
  67. package/dist/Video.es.js +1 -4
  68. package/dist/Video.es.js.map +1 -1
  69. package/dist/actions.cjs.js.map +1 -1
  70. package/dist/actions.es.js.map +1 -1
  71. package/dist/builder.cjs.js +1 -2
  72. package/dist/builder.cjs.js.map +1 -1
  73. package/dist/builder.es.js +1 -2
  74. package/dist/builder.es.js.map +1 -1
  75. package/dist/components.cjs.js +2 -4
  76. package/dist/components.cjs.js.map +1 -1
  77. package/dist/components.es.js +2 -4
  78. package/dist/components.es.js.map +1 -1
  79. package/dist/constants.cjs.js.map +1 -1
  80. package/dist/constants.es.js.map +1 -1
  81. package/dist/control-serialization.cjs.js +0 -2
  82. package/dist/control-serialization.cjs.js.map +1 -1
  83. package/dist/control-serialization.es.js +0 -2
  84. package/dist/control-serialization.es.js.map +1 -1
  85. package/dist/controls.cjs.js +2 -6
  86. package/dist/controls.cjs.js.map +1 -1
  87. package/dist/controls.es.js +2 -3
  88. package/dist/controls.es.js.map +1 -1
  89. package/dist/descriptors.cjs.js +53 -88
  90. package/dist/descriptors.cjs.js.map +1 -1
  91. package/dist/descriptors.es.js +32 -64
  92. package/dist/descriptors.es.js.map +1 -1
  93. package/dist/element.cjs.js +55 -0
  94. package/dist/element.cjs.js.map +1 -0
  95. package/dist/element.es.js +54 -0
  96. package/dist/element.es.js.map +1 -0
  97. package/dist/index.cjs.js +33 -116
  98. package/dist/index.cjs.js.map +1 -1
  99. package/dist/index.cjs2.js +3 -4
  100. package/dist/index.cjs2.js.map +1 -1
  101. package/dist/index.cjs5.js +48 -82
  102. package/dist/index.cjs5.js.map +1 -1
  103. package/dist/index.cjs6.js +41 -42
  104. package/dist/index.cjs6.js.map +1 -1
  105. package/dist/index.cjs7.js +14 -341
  106. package/dist/index.cjs7.js.map +1 -1
  107. package/dist/index.cjs8.js +209 -0
  108. package/dist/index.cjs8.js.map +1 -0
  109. package/dist/index.cjs9.js +370 -0
  110. package/dist/index.cjs9.js.map +1 -0
  111. package/dist/index.es.js +32 -117
  112. package/dist/index.es.js.map +1 -1
  113. package/dist/index.es2.js +2 -3
  114. package/dist/index.es2.js.map +1 -1
  115. package/dist/index.es3.js +1 -1
  116. package/dist/index.es5.js +19 -54
  117. package/dist/index.es5.js.map +1 -1
  118. package/dist/index.es6.js +36 -40
  119. package/dist/index.es6.js.map +1 -1
  120. package/dist/index.es7.js +13 -336
  121. package/dist/index.es7.js.map +1 -1
  122. package/dist/index.es8.js +202 -0
  123. package/dist/index.es8.js.map +1 -0
  124. package/dist/index.es9.js +363 -0
  125. package/dist/index.es9.js.map +1 -0
  126. package/dist/introspection.cjs.js +0 -2
  127. package/dist/introspection.cjs.js.map +1 -1
  128. package/dist/introspection.es.js +0 -2
  129. package/dist/introspection.es.js.map +1 -1
  130. package/dist/leaf.cjs.js.map +1 -1
  131. package/dist/leaf.es.js +1 -1
  132. package/dist/leaf.es.js.map +1 -1
  133. package/dist/main.cjs.js +1 -2
  134. package/dist/main.cjs.js.map +1 -1
  135. package/dist/main.es.js +1 -2
  136. package/dist/main.es.js.map +1 -1
  137. package/dist/next.cjs.js +1 -4
  138. package/dist/next.cjs.js.map +1 -1
  139. package/dist/next.es.js +2 -5
  140. package/dist/next.es.js.map +1 -1
  141. package/dist/prop-controllers.cjs.js +1 -2
  142. package/dist/prop-controllers.cjs.js.map +1 -1
  143. package/dist/prop-controllers.es.js +1 -2
  144. package/dist/prop-controllers.es.js.map +1 -1
  145. package/dist/react.cjs.js +1 -4
  146. package/dist/react.cjs.js.map +1 -1
  147. package/dist/react.es.js +1 -4
  148. package/dist/react.es.js.map +1 -1
  149. package/dist/slate.cjs.js +8 -3
  150. package/dist/slate.cjs.js.map +1 -1
  151. package/dist/slate.cjs2.js +46 -0
  152. package/dist/slate.cjs2.js.map +1 -0
  153. package/dist/slate.es.js +6 -4
  154. package/dist/slate.es.js.map +1 -1
  155. package/dist/slate.es2.js +44 -0
  156. package/dist/slate.es2.js.map +1 -0
  157. package/dist/types/src/components/builtin/Button/Button.d.ts +1 -1
  158. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
  159. package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts.map +1 -1
  160. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts +2 -1
  161. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
  162. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts +1 -1
  163. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +1 -1
  164. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts +1 -1
  165. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts.map +1 -1
  166. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +1 -1
  167. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
  168. package/dist/types/src/controls/list.d.ts +2 -1
  169. package/dist/types/src/controls/list.d.ts.map +1 -1
  170. package/dist/types/src/controls/rich-text/dto-types.d.ts +1 -1
  171. package/dist/types/src/controls/rich-text/dto-types.d.ts.map +1 -1
  172. package/dist/types/src/controls/rich-text/index.d.ts +0 -1
  173. package/dist/types/src/controls/rich-text/index.d.ts.map +1 -1
  174. package/dist/types/src/controls/rich-text/rich-text.d.ts +1 -1
  175. package/dist/types/src/controls/rich-text/rich-text.d.ts.map +1 -1
  176. package/dist/types/src/controls/rich-text/translation.d.ts +1 -1
  177. package/dist/types/src/controls/rich-text/translation.d.ts.map +1 -1
  178. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +25 -4
  179. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  180. package/dist/types/src/controls/shape.d.ts +2 -1
  181. package/dist/types/src/controls/shape.d.ts.map +1 -1
  182. package/dist/types/src/controls/slot.d.ts +1 -1
  183. package/dist/types/src/controls/slot.d.ts.map +1 -1
  184. package/dist/types/src/controls/style.d.ts +2 -1
  185. package/dist/types/src/controls/style.d.ts.map +1 -1
  186. package/dist/types/src/prop-controllers/base.d.ts +7 -0
  187. package/dist/types/src/prop-controllers/base.d.ts.map +1 -0
  188. package/dist/types/src/prop-controllers/instances.d.ts +1 -5
  189. package/dist/types/src/prop-controllers/instances.d.ts.map +1 -1
  190. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts +13 -0
  191. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -0
  192. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/index.d.ts +4 -0
  193. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/index.d.ts.map +1 -0
  194. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useSyncDOMSelection.d.ts +9 -0
  195. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useSyncDOMSelection.d.ts.map +1 -0
  196. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts +21 -0
  197. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -0
  198. package/dist/types/src/runtimes/react/controls/rich-text-v2/index.d.ts +2 -0
  199. package/dist/types/src/runtimes/react/controls/rich-text-v2/index.d.ts.map +1 -0
  200. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts +8 -0
  201. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -0
  202. package/dist/types/src/slate/BlockPlugin/index.d.ts +1 -1
  203. package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
  204. package/dist/types/src/slate/BlockPlugin/types.d.ts +1 -1
  205. package/dist/types/src/slate/BlockPlugin/types.d.ts.map +1 -1
  206. package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts +1 -1
  207. package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts.map +1 -1
  208. package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts +1 -1
  209. package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts.map +1 -1
  210. package/dist/types/src/slate/BuilderPlugin/index.d.ts +7 -0
  211. package/dist/types/src/slate/BuilderPlugin/index.d.ts.map +1 -0
  212. package/dist/types/src/slate/InlineModePlugin/index.d.ts +5 -0
  213. package/dist/types/src/slate/InlineModePlugin/index.d.ts.map +1 -0
  214. package/dist/types/src/slate/ListPlugin/index.d.ts +1 -1
  215. package/dist/types/src/slate/ListPlugin/index.d.ts.map +1 -1
  216. package/dist/types/src/slate/ListPlugin/toggleList.d.ts +1 -1
  217. package/dist/types/src/slate/ListPlugin/toggleList.d.ts.map +1 -1
  218. package/dist/types/src/slate/ListPlugin/wrapList.d.ts +1 -1
  219. package/dist/types/src/slate/ListPlugin/wrapList.d.ts.map +1 -1
  220. package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts +1 -1
  221. package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts.map +1 -1
  222. package/dist/types/src/slate/TypographyPlugin/index.d.ts +1 -1
  223. package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
  224. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts.map +1 -1
  225. package/dist/types/src/slate/index.d.ts +2 -0
  226. package/dist/types/src/slate/index.d.ts.map +1 -1
  227. package/dist/types/src/slate/selectors.d.ts +1 -1
  228. package/dist/types/src/slate/selectors.d.ts.map +1 -1
  229. package/dist/types/src/slate/utils/editor.d.ts +1 -1
  230. package/dist/types/src/slate/utils/editor.d.ts.map +1 -1
  231. package/dist/types/src/slate/utils/element.d.ts +1 -1
  232. package/dist/types/src/slate/utils/element.d.ts.map +1 -1
  233. package/dist/types/src/state/actions.d.ts +2 -1
  234. package/dist/types/src/state/actions.d.ts.map +1 -1
  235. package/dist/types/src/state/modules/prop-controller-handles.d.ts +2 -1
  236. package/dist/types/src/state/modules/prop-controller-handles.d.ts.map +1 -1
  237. package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
  238. package/dist/types/src/state/react-page.d.ts +1 -1
  239. package/dist/types/src/state/react-page.d.ts.map +1 -1
  240. package/dist/types/{src/controls/rich-text/types.d.ts → types/slate.d.ts} +20 -17
  241. package/dist/types/types/slate.d.ts.map +1 -0
  242. package/dist/useIsomorphicLayoutEffect.cjs.js +6 -0
  243. package/dist/useIsomorphicLayoutEffect.cjs.js.map +1 -0
  244. package/dist/useIsomorphicLayoutEffect.es.js +5 -0
  245. package/dist/useIsomorphicLayoutEffect.es.js.map +1 -0
  246. package/package.json +1 -1
  247. package/dist/types/src/controls/rich-text/types.d.ts.map +0 -1
  248. package/dist/types/src/runtimes/react/controls/rich-text-v2.d.ts +0 -15
  249. package/dist/types/src/runtimes/react/controls/rich-text-v2.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"actions.cjs.js","sources":["../src/state/actions.ts"],"sourcesContent":["import type { Operation } from 'ot-json0'\n\nimport type { Document } from './modules/read-only-documents'\nimport type { ComponentType } from './modules/react-components'\nimport type { Measurable, BoxModel } from './modules/box-models'\nimport type { ThunkAction } from 'redux-thunk'\nimport { ComponentMeta } from './modules/components-meta'\nimport { PropControllerDescriptor } from '../prop-controllers'\nimport type { Size } from './react-builder-preview'\nimport type { PropControllersHandle } from './modules/prop-controller-handles'\nimport type { PropController, PropControllerMessage } from '../prop-controllers/instances'\nimport type { APIResource, APIResourceType } from '../api/graphql/types'\nimport type { SerializedControl } from '../builder'\nimport { ElementImperativeHandle } from '../runtimes/react/element-imperative-handle'\nimport { BuilderEditMode } from './modules/builder-edit-mode'\nimport type { Point } from './modules/pointer'\nimport { Breakpoints } from './modules/breakpoints'\n\nexport const ActionTypes = {\n INIT: 'INIT',\n CLEAN_UP: 'CLEAN_UP',\n\n REGISTER_DOCUMENT: 'REGISTER_DOCUMENT',\n UNREGISTER_DOCUMENT: 'UNREGISTER_DOCUMENT',\n\n CHANGE_DOCUMENT: 'CHANGE_DOCUMENT',\n\n REGISTER_COMPONENT: 'REGISTER_COMPONENT',\n UNREGISTER_COMPONENT: 'UNREGISTER_COMPONENT',\n\n REGISTER_BUILDER_COMPONENT: 'REGISTER_BUILDER_COMPONENT',\n UNREGISTER_BUILDER_COMPONENT: 'UNREGISTER_BUILDER_COMPONENT',\n\n REGISTER_REACT_COMPONENT: 'REGISTER_REACT_COMPONENT',\n UNREGISTER_REACT_COMPONENT: 'UNREGISTER_REACT_COMPONENT',\n\n MOUNT_COMPONENT: 'MOUNT_COMPONENT',\n UNMOUNT_COMPONENT: 'UNMOUNT_COMPONENT',\n\n REGISTER_COMPONENT_HANDLE: 'REGISTER_COMPONENT_HANDLE',\n UNREGISTER_COMPONENT_HANDLE: 'UNREGISTER_COMPONENT_HANDLE',\n\n REGISTER_MEASURABLE: 'REGISTER_MEASURABLE',\n UNREGISTER_MEASURABLE: 'UNREGISTER_MEASURABLE',\n\n CHANGE_ELEMENT_BOX_MODELS: 'CHANGE_ELEMENT_BOX_MODELS',\n\n CHANGE_DOCUMENT_ELEMENT_SIZE: 'CHANGE_DOCUMENT_ELEMENT_SIZE',\n CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP: 'CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP',\n SCROLL_DOCUMENT_ELEMENT: 'SCROLL_DOCUMENT_ELEMENT',\n\n REGISTER_PROP_CONTROLLERS_HANDLE: 'REGISTER_PROP_CONTROLLERS_HANDLE',\n UNREGISTER_PROP_CONTROLLERS_HANDLE: 'UNREGISTER_PROP_CONTROLLERS_HANDLE',\n REGISTER_PROP_CONTROLLERS: 'REGISTER_PROP_CONTROLLERS',\n UNREGISTER_PROP_CONTROLLERS: 'UNREGISTER_PROP_CONTROLLERS',\n MESSAGE_HOST_PROP_CONTROLLER: 'MESSAGE_HOST_PROP_CONTROLLER',\n MESSAGE_BUILDER_PROP_CONTROLLER: 'MESSAGE_BUILDER_PROP_CONTROLLER',\n\n CHANGE_API_RESOURCE: 'CHANGE_API_RESOURCE',\n EVICT_API_RESOURCE: 'EVICT_API_RESOURCE',\n\n SET_IS_IN_BUILDER: 'SET_IS_IN_BUILDER',\n\n HANDLE_WHEEL: 'HANDLE_WHEEL',\n HANDLE_POINTER_MOVE: 'HANDLE_POINTER_MOVE',\n\n API_RESOURCE_FULFILLED: 'API_RESOURCE_FULFILLED',\n\n SET_BUILDER_EDIT_MODE: 'SET_BUILDER_EDIT_MODE',\n MAKESWIFT_CONNECTION_INIT: 'MAKESWIFT_CONNECTION_INIT',\n MAKESWIFT_CONNECTION_CHECK: 'MAKESWIFT_CONNECTION_CHECK',\n\n CHANGE_PATHNAME: 'CHANGE_PATHNAME',\n CHANGE_PATHNAME_START: 'CHANGE_PATHNAME_START',\n CHANGE_PATHNAME_COMPLETE: 'CHANGE_PATHNAME_COMPLETE',\n\n BUILDER_POINTER_MOVE: 'BUILDER_POINTER_MOVE',\n ELEMENT_FROM_POINT_CHANGE: 'ELEMENT_FROM_POINT_CHANGE',\n\n SET_BREAKPOINTS: 'SET_BREAKPOINTS',\n} as const\n\ntype InitAction = { type: typeof ActionTypes.INIT }\n\ntype CleanUpAction = { type: typeof ActionTypes.CLEAN_UP }\n\ntype RegisterDocumentAction = {\n type: typeof ActionTypes.REGISTER_DOCUMENT\n payload: { documentKey: string; document: Document }\n}\n\ntype UnregisterDocumentAction = {\n type: typeof ActionTypes.UNREGISTER_DOCUMENT\n payload: { documentKey: string }\n}\n\ntype ChangeDocumentAction = {\n type: typeof ActionTypes.CHANGE_DOCUMENT\n payload: { documentKey: string; operation: Operation }\n}\n\ntype RegisterComponentAction = {\n type: typeof ActionTypes.REGISTER_COMPONENT\n payload: {\n type: string\n meta: ComponentMeta\n propControllerDescriptors: Record<string, PropControllerDescriptor>\n }\n}\n\ntype UnregisterComponentAction = {\n type: typeof ActionTypes.UNREGISTER_COMPONENT\n payload: { type: string }\n}\n\ntype RegisterBuilderComponentAction = {\n type: typeof ActionTypes.REGISTER_BUILDER_COMPONENT\n payload: {\n type: string\n meta: ComponentMeta\n serializedControls: Record<string, SerializedControl>\n }\n}\n\ntype UnregisterBuilderComponentAction = {\n type: typeof ActionTypes.UNREGISTER_BUILDER_COMPONENT\n payload: { type: string }\n}\n\ntype RegisterReactComponentAction = {\n type: typeof ActionTypes.REGISTER_REACT_COMPONENT\n payload: { type: string; component: ComponentType }\n}\n\ntype UnregisterReactComponentAction = {\n type: typeof ActionTypes.UNREGISTER_REACT_COMPONENT\n payload: { type: string }\n}\n\ntype MountComponentAction = {\n type: typeof ActionTypes.MOUNT_COMPONENT\n payload: { documentKey: string; elementKey: string }\n}\n\ntype UnmountComponentAction = {\n type: typeof ActionTypes.UNMOUNT_COMPONENT\n payload: { documentKey: string; elementKey: string }\n}\n\ntype RegisterComponentHandleAction = {\n type: typeof ActionTypes.REGISTER_COMPONENT_HANDLE\n payload: { documentKey: string; elementKey: string; componentHandle: ElementImperativeHandle }\n}\n\ntype UnregisterComponentHandleAction = {\n type: typeof ActionTypes.UNREGISTER_COMPONENT_HANDLE\n payload: { documentKey: string; elementKey: string }\n}\n\ntype RegisterMeasurableAction = {\n type: typeof ActionTypes.REGISTER_MEASURABLE\n payload: { documentKey: string; elementKey: string; measurable: Measurable }\n}\n\ntype UnregisterMeasurableAction = {\n type: typeof ActionTypes.UNREGISTER_MEASURABLE\n payload: { documentKey: string; elementKey: string }\n}\n\ntype ChangeElementBoxModelsAction = {\n type: typeof ActionTypes.CHANGE_ELEMENT_BOX_MODELS\n payload: { changedElementBoxModels: Map<string, Map<string, BoxModel | null>> }\n}\n\ntype ChangeDocumentElementSizeAction = {\n type: typeof ActionTypes.CHANGE_DOCUMENT_ELEMENT_SIZE\n payload: { size: Size }\n}\n\ntype ChangeDocumentElementScrollTopAction = {\n type: typeof ActionTypes.CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP\n payload: { scrollTop: number }\n}\n\ntype ScrollDocumentElementAction = {\n type: typeof ActionTypes.SCROLL_DOCUMENT_ELEMENT\n payload: { scrollTopDelta: number }\n}\n\ntype RegisterPropControllersHandleAction = {\n type: typeof ActionTypes.REGISTER_PROP_CONTROLLERS_HANDLE\n payload: { documentKey: string; elementKey: string; handle: PropControllersHandle }\n}\n\ntype UnregisterPropControllersHandleAction = {\n type: typeof ActionTypes.UNREGISTER_PROP_CONTROLLERS_HANDLE\n payload: { documentKey: string; elementKey: string }\n}\n\ntype RegisterPropControllersAction = {\n type: typeof ActionTypes.REGISTER_PROP_CONTROLLERS\n payload: {\n documentKey: string\n elementKey: string\n propControllers: Record<string, PropController>\n }\n}\n\ntype UnregisterPropControllersAction = {\n type: typeof ActionTypes.UNREGISTER_PROP_CONTROLLERS\n payload: { documentKey: string; elementKey: string }\n}\n\ntype MessageHostPropControllerAction<T = PropControllerMessage> = {\n type: typeof ActionTypes.MESSAGE_HOST_PROP_CONTROLLER\n payload: { documentKey: string; elementKey: string; propName: string; message: T }\n}\n\ntype MessageBuilderPropControllerAction<T = PropControllerMessage> = {\n type: typeof ActionTypes.MESSAGE_BUILDER_PROP_CONTROLLER\n payload: { documentKey: string; elementKey: string; propName: string; message: T }\n}\n\ntype ChangeAPIResourceAction = {\n type: typeof ActionTypes.CHANGE_API_RESOURCE\n payload: { resource: APIResource }\n}\n\ntype EvictAPIResourceAction = {\n type: typeof ActionTypes.EVICT_API_RESOURCE\n payload: { id: string }\n}\n\ntype SetIsInBuilderAction = {\n type: typeof ActionTypes.SET_IS_IN_BUILDER\n payload: boolean\n}\n\ntype HandleWheelAction = {\n type: typeof ActionTypes.HANDLE_WHEEL\n payload: { deltaX: number; deltaY: number }\n}\n\ntype HandlePointerMoveAction = {\n type: typeof ActionTypes.HANDLE_POINTER_MOVE\n payload: { clientX: number; clientY: number }\n}\n\ntype APIResourceFulfilledAction = {\n type: typeof ActionTypes.API_RESOURCE_FULFILLED\n payload: { resourceType: APIResourceType; resourceId: string; resource: APIResource | null }\n}\n\ntype SetBuilderEditModeAction = {\n type: typeof ActionTypes.SET_BUILDER_EDIT_MODE\n payload: { editMode: BuilderEditMode }\n}\n\ntype ChangePathnameAction = {\n type: typeof ActionTypes.CHANGE_PATHNAME\n payload: { pathname: string }\n}\n\ntype ChangePathnameStartAction = {\n type: typeof ActionTypes.CHANGE_PATHNAME_START\n}\n\ntype ChangePathnameCompleteAction = {\n type: typeof ActionTypes.CHANGE_PATHNAME_COMPLETE\n}\n\ntype BuilderPointerMoveAction = {\n type: typeof ActionTypes.BUILDER_POINTER_MOVE\n payload: { pointer: Point | null }\n}\n\ntype ElementFromPointChangeAction = {\n type: typeof ActionTypes.ELEMENT_FROM_POINT_CHANGE\n payload: { keys: { documentKey: string; elementKey: string } | null }\n}\n\nexport type SetBreakpointsAction = {\n type: typeof ActionTypes.SET_BREAKPOINTS\n payload: { breakpoints: Breakpoints }\n}\n\nexport type Action =\n | InitAction\n | CleanUpAction\n | ChangeDocumentAction\n | RegisterDocumentAction\n | UnregisterDocumentAction\n | RegisterComponentAction\n | UnregisterComponentAction\n | RegisterBuilderComponentAction\n | UnregisterBuilderComponentAction\n | RegisterReactComponentAction\n | UnregisterReactComponentAction\n | MountComponentAction\n | UnmountComponentAction\n | RegisterComponentHandleAction\n | UnregisterComponentHandleAction\n | RegisterMeasurableAction\n | UnregisterMeasurableAction\n | ChangeElementBoxModelsAction\n | ChangeDocumentElementSizeAction\n | ChangeDocumentElementScrollTopAction\n | ScrollDocumentElementAction\n | RegisterPropControllersHandleAction\n | UnregisterPropControllersHandleAction\n | RegisterPropControllersAction\n | UnregisterPropControllersAction\n | MessageHostPropControllerAction\n | MessageBuilderPropControllerAction\n | ChangeAPIResourceAction\n | EvictAPIResourceAction\n | SetIsInBuilderAction\n | HandleWheelAction\n | HandlePointerMoveAction\n | APIResourceFulfilledAction\n | SetBuilderEditModeAction\n | ChangePathnameAction\n | ChangePathnameStartAction\n | ChangePathnameCompleteAction\n | BuilderPointerMoveAction\n | ElementFromPointChangeAction\n | SetBreakpointsAction\n\nexport function init(): InitAction {\n return { type: ActionTypes.INIT }\n}\n\nexport function cleanUp(): CleanUpAction {\n return { type: ActionTypes.CLEAN_UP }\n}\n\nexport function registerDocument(document: Document): RegisterDocumentAction {\n return { type: ActionTypes.REGISTER_DOCUMENT, payload: { documentKey: document.key, document } }\n}\n\nexport function unregisterDocument(documentKey: string): UnregisterDocumentAction {\n return { type: ActionTypes.UNREGISTER_DOCUMENT, payload: { documentKey } }\n}\n\nexport function registerDocumentEffect(\n document: Document,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerDocument(document))\n\n return () => {\n dispatch(unregisterDocument(document.key))\n }\n }\n}\n\nexport function changeDocument(documentKey: string, operation: Operation): ChangeDocumentAction {\n return { type: ActionTypes.CHANGE_DOCUMENT, payload: { documentKey, operation } }\n}\n\nexport function registerComponent(\n type: string,\n meta: ComponentMeta,\n propControllerDescriptors: Record<string, PropControllerDescriptor>,\n): RegisterComponentAction {\n return {\n type: ActionTypes.REGISTER_COMPONENT,\n payload: { type, meta, propControllerDescriptors },\n }\n}\n\nexport function unregisterComponent(type: string): UnregisterComponentAction {\n return { type: ActionTypes.UNREGISTER_COMPONENT, payload: { type } }\n}\n\nexport function registerComponentEffect(\n type: string,\n meta: ComponentMeta,\n propControllerDescriptors: Record<string, PropControllerDescriptor>,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerComponent(type, meta, propControllerDescriptors))\n\n return () => {\n dispatch(unregisterComponent(type))\n }\n }\n}\n\nexport function registerBuilderComponent(\n type: string,\n meta: ComponentMeta,\n serializedControls: Record<string, SerializedControl>,\n): RegisterBuilderComponentAction {\n return {\n type: ActionTypes.REGISTER_BUILDER_COMPONENT,\n payload: { type, meta, serializedControls },\n }\n}\n\nexport function unregisterBuilderComponent(type: string): UnregisterBuilderComponentAction {\n return { type: ActionTypes.UNREGISTER_BUILDER_COMPONENT, payload: { type } }\n}\n\nfunction registerReactComponent(\n type: string,\n component: ComponentType,\n): RegisterReactComponentAction {\n return { type: ActionTypes.REGISTER_REACT_COMPONENT, payload: { type, component } }\n}\n\nfunction unregisterReactComponent(type: string): UnregisterReactComponentAction {\n return { type: ActionTypes.UNREGISTER_REACT_COMPONENT, payload: { type } }\n}\n\nexport function registerReactComponentEffect(\n type: string,\n component: ComponentType,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerReactComponent(type, component))\n\n return () => {\n dispatch(unregisterReactComponent(type))\n }\n }\n}\n\nexport function mountComponent(documentKey: string, elementKey: string): MountComponentAction {\n return { type: ActionTypes.MOUNT_COMPONENT, payload: { documentKey, elementKey } }\n}\n\nexport function unmountComponent(documentKey: string, elementKey: string): UnmountComponentAction {\n return { type: ActionTypes.UNMOUNT_COMPONENT, payload: { documentKey, elementKey } }\n}\n\nexport function mountComponentEffect(\n documentKey: string,\n elementKey: string,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(mountComponent(documentKey, elementKey))\n\n return () => {\n dispatch(unmountComponent(documentKey, elementKey))\n }\n }\n}\n\nexport function registerComponentHandle(\n documentKey: string,\n elementKey: string,\n componentHandle: ElementImperativeHandle,\n): RegisterComponentHandleAction {\n return {\n type: ActionTypes.REGISTER_COMPONENT_HANDLE,\n payload: { documentKey, elementKey, componentHandle },\n }\n}\n\nfunction unregisterComponentHandle(\n documentKey: string,\n elementKey: string,\n): UnregisterComponentHandleAction {\n return { type: ActionTypes.UNREGISTER_COMPONENT_HANDLE, payload: { documentKey, elementKey } }\n}\n\nexport function registerComponentHandleEffect(\n documentKey: string,\n elementKey: string,\n componentHandle: ElementImperativeHandle,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerComponentHandle(documentKey, elementKey, componentHandle))\n\n return () => {\n dispatch(unregisterComponentHandle(documentKey, elementKey))\n }\n }\n}\n\nexport function registerMeasurable(\n documentKey: string,\n elementKey: string,\n measurable: Measurable,\n): RegisterMeasurableAction {\n return { type: ActionTypes.REGISTER_MEASURABLE, payload: { documentKey, elementKey, measurable } }\n}\n\nexport function unregisterMeasurable(\n documentKey: string,\n elementKey: string,\n): UnregisterMeasurableAction {\n return { type: ActionTypes.UNREGISTER_MEASURABLE, payload: { documentKey, elementKey } }\n}\n\nexport function registerMeasurableEffect(\n documentKey: string,\n elementKey: string,\n measurable: Measurable,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerMeasurable(documentKey, elementKey, measurable))\n\n return () => {\n dispatch(unregisterMeasurable(documentKey, elementKey))\n }\n }\n}\n\nexport function changeElementBoxModels(\n changedElementBoxModels: Map<string, Map<string, BoxModel | null>>,\n): ChangeElementBoxModelsAction {\n return { type: ActionTypes.CHANGE_ELEMENT_BOX_MODELS, payload: { changedElementBoxModels } }\n}\n\nexport function changeDocumentElementSize(size: Size): ChangeDocumentElementSizeAction {\n return { type: ActionTypes.CHANGE_DOCUMENT_ELEMENT_SIZE, payload: { size } }\n}\n\nexport function changeDocumentElementScrollTop(\n scrollTop: number,\n): ChangeDocumentElementScrollTopAction {\n return { type: ActionTypes.CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP, payload: { scrollTop } }\n}\n\nexport function scrollDocumentElement(scrollTopDelta: number): ScrollDocumentElementAction {\n return { type: ActionTypes.SCROLL_DOCUMENT_ELEMENT, payload: { scrollTopDelta } }\n}\n\nexport function registerPropControllersHandle(\n documentKey: string,\n elementKey: string,\n handle: PropControllersHandle,\n): RegisterPropControllersHandleAction {\n return {\n type: ActionTypes.REGISTER_PROP_CONTROLLERS_HANDLE,\n payload: { documentKey, elementKey, handle },\n }\n}\n\nexport function unregisterPropControllersHandle(\n documentKey: string,\n elementKey: string,\n): UnregisterPropControllersHandleAction {\n return {\n type: ActionTypes.UNREGISTER_PROP_CONTROLLERS_HANDLE,\n payload: { documentKey, elementKey },\n }\n}\n\nexport function registerPropControllers(\n documentKey: string,\n elementKey: string,\n propControllers: Record<string, PropController>,\n): RegisterPropControllersAction {\n return {\n type: ActionTypes.REGISTER_PROP_CONTROLLERS,\n payload: { documentKey, elementKey, propControllers },\n }\n}\n\nexport function unregisterPropControllers(\n documentKey: string,\n elementKey: string,\n): UnregisterPropControllersAction {\n return { type: ActionTypes.UNREGISTER_PROP_CONTROLLERS, payload: { documentKey, elementKey } }\n}\n\nexport function messageHostPropController<T>(\n documentKey: string,\n elementKey: string,\n propName: string,\n message: T,\n): MessageHostPropControllerAction<T> {\n return {\n type: ActionTypes.MESSAGE_HOST_PROP_CONTROLLER,\n payload: { documentKey, elementKey, propName, message },\n }\n}\n\nexport function messageBuilderPropController<T>(\n documentKey: string,\n elementKey: string,\n propName: string,\n message: T,\n): MessageBuilderPropControllerAction<T> {\n return {\n type: ActionTypes.MESSAGE_BUILDER_PROP_CONTROLLER,\n payload: { documentKey, elementKey, propName, message },\n }\n}\n\nexport function changeApiResource(resource: APIResource): ChangeAPIResourceAction {\n return { type: ActionTypes.CHANGE_API_RESOURCE, payload: { resource } }\n}\n\nexport function evictApiResource(id: string): EvictAPIResourceAction {\n return { type: ActionTypes.EVICT_API_RESOURCE, payload: { id } }\n}\n\nexport function setIsInBuilder(isInBuilder: boolean): SetIsInBuilderAction {\n return { type: ActionTypes.SET_IS_IN_BUILDER, payload: isInBuilder }\n}\n\nexport function handleWheel(payload: { deltaX: number; deltaY: number }): HandleWheelAction {\n return { type: ActionTypes.HANDLE_WHEEL, payload }\n}\n\nexport function handlePointerMove(payload: {\n clientX: number\n clientY: number\n}): HandlePointerMoveAction {\n return { type: ActionTypes.HANDLE_POINTER_MOVE, payload }\n}\n\nexport function apiResourceFulfilled(\n resourceType: APIResourceType,\n resourceId: string,\n resource: APIResource | null,\n): APIResourceFulfilledAction {\n return {\n type: ActionTypes.API_RESOURCE_FULFILLED,\n payload: { resourceType, resourceId, resource },\n }\n}\n\nexport function setBuilderEditMode(editMode: BuilderEditMode): SetBuilderEditModeAction {\n return {\n type: ActionTypes.SET_BUILDER_EDIT_MODE,\n payload: { editMode },\n }\n}\n\nexport function changePathname(pathname: string): ChangePathnameAction {\n return {\n type: ActionTypes.CHANGE_PATHNAME,\n payload: { pathname },\n }\n}\n\nexport function changePathnameStart(): ChangePathnameStartAction {\n return {\n type: ActionTypes.CHANGE_PATHNAME_START,\n }\n}\n\nexport function changePathnameComplete(): ChangePathnameCompleteAction {\n return {\n type: ActionTypes.CHANGE_PATHNAME_COMPLETE,\n }\n}\n\nexport function builderPointerMove(pointer: Point | null): BuilderPointerMoveAction {\n return { type: ActionTypes.BUILDER_POINTER_MOVE, payload: { pointer } }\n}\n\nexport function elementFromPointChange(\n keys: {\n documentKey: string\n elementKey: string\n } | null,\n): ElementFromPointChangeAction {\n return { type: ActionTypes.ELEMENT_FROM_POINT_CHANGE, payload: { keys } }\n}\n\nexport function setBreakpoints(breakpoints: Breakpoints): SetBreakpointsAction {\n return { type: ActionTypes.S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wB,UAAwC;AAC9D,SAAA;AAAA,IACL,MAAM,YAAY;AAAA,IAClB,SAAS,EAAE,SAAS;AAAA,EAAA;AAExB;AAEiE,+BAAA;AACxD,SAAA;AAAA,IACL,MAAM,YAAY;AAAA,EAAA;AAEtB;AAEuE,kCAAA;AAC9D,SAAA;AAAA,IACL,MAAM,YAAY;AAAA,EAAA;AAEtB;AAEO,4BAA4B,SAAiD;AAClF,SAAO,EAAE,MAAM,YAAY,sBAAsB,SAAS,EAAE;AAC9D;AAEO,gCACL,MAI8B;AAC9B,SAAO,EAAE,MAAM,YAAY,2BAA2B,SAAS,EAAE;AACnE;AAEO,wBAAwB,aAAgD;AAC7E,SAAO,EAAE,MAAM,YAAY,iBAAiB,SAAS,EAAE;AACzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"actions.cjs.js","sources":["../src/state/actions.ts"],"sourcesContent":["import type { Operation } from 'ot-json0'\n\nimport type { Document } from './modules/read-only-documents'\nimport type { ComponentType } from './modules/react-components'\nimport type { Measurable, BoxModel } from './modules/box-models'\nimport type { ThunkAction } from 'redux-thunk'\nimport { ComponentMeta } from './modules/components-meta'\nimport { PropControllerDescriptor } from '../prop-controllers'\nimport type { Size } from './react-builder-preview'\nimport type { PropControllersHandle } from './modules/prop-controller-handles'\nimport type { PropControllerMessage } from '../prop-controllers/instances'\nimport type { PropController } from '../prop-controllers/base'\nimport type { APIResource, APIResourceType } from '../api/graphql/types'\nimport type { SerializedControl } from '../builder'\nimport { ElementImperativeHandle } from '../runtimes/react/element-imperative-handle'\nimport { BuilderEditMode } from './modules/builder-edit-mode'\nimport type { Point } from './modules/pointer'\nimport { Breakpoints } from './modules/breakpoints'\n\nexport const ActionTypes = {\n INIT: 'INIT',\n CLEAN_UP: 'CLEAN_UP',\n\n REGISTER_DOCUMENT: 'REGISTER_DOCUMENT',\n UNREGISTER_DOCUMENT: 'UNREGISTER_DOCUMENT',\n\n CHANGE_DOCUMENT: 'CHANGE_DOCUMENT',\n\n REGISTER_COMPONENT: 'REGISTER_COMPONENT',\n UNREGISTER_COMPONENT: 'UNREGISTER_COMPONENT',\n\n REGISTER_BUILDER_COMPONENT: 'REGISTER_BUILDER_COMPONENT',\n UNREGISTER_BUILDER_COMPONENT: 'UNREGISTER_BUILDER_COMPONENT',\n\n REGISTER_REACT_COMPONENT: 'REGISTER_REACT_COMPONENT',\n UNREGISTER_REACT_COMPONENT: 'UNREGISTER_REACT_COMPONENT',\n\n MOUNT_COMPONENT: 'MOUNT_COMPONENT',\n UNMOUNT_COMPONENT: 'UNMOUNT_COMPONENT',\n\n REGISTER_COMPONENT_HANDLE: 'REGISTER_COMPONENT_HANDLE',\n UNREGISTER_COMPONENT_HANDLE: 'UNREGISTER_COMPONENT_HANDLE',\n\n REGISTER_MEASURABLE: 'REGISTER_MEASURABLE',\n UNREGISTER_MEASURABLE: 'UNREGISTER_MEASURABLE',\n\n CHANGE_ELEMENT_BOX_MODELS: 'CHANGE_ELEMENT_BOX_MODELS',\n\n CHANGE_DOCUMENT_ELEMENT_SIZE: 'CHANGE_DOCUMENT_ELEMENT_SIZE',\n CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP: 'CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP',\n SCROLL_DOCUMENT_ELEMENT: 'SCROLL_DOCUMENT_ELEMENT',\n\n REGISTER_PROP_CONTROLLERS_HANDLE: 'REGISTER_PROP_CONTROLLERS_HANDLE',\n UNREGISTER_PROP_CONTROLLERS_HANDLE: 'UNREGISTER_PROP_CONTROLLERS_HANDLE',\n REGISTER_PROP_CONTROLLERS: 'REGISTER_PROP_CONTROLLERS',\n UNREGISTER_PROP_CONTROLLERS: 'UNREGISTER_PROP_CONTROLLERS',\n MESSAGE_HOST_PROP_CONTROLLER: 'MESSAGE_HOST_PROP_CONTROLLER',\n MESSAGE_BUILDER_PROP_CONTROLLER: 'MESSAGE_BUILDER_PROP_CONTROLLER',\n\n CHANGE_API_RESOURCE: 'CHANGE_API_RESOURCE',\n EVICT_API_RESOURCE: 'EVICT_API_RESOURCE',\n\n SET_IS_IN_BUILDER: 'SET_IS_IN_BUILDER',\n\n HANDLE_WHEEL: 'HANDLE_WHEEL',\n HANDLE_POINTER_MOVE: 'HANDLE_POINTER_MOVE',\n\n API_RESOURCE_FULFILLED: 'API_RESOURCE_FULFILLED',\n\n SET_BUILDER_EDIT_MODE: 'SET_BUILDER_EDIT_MODE',\n MAKESWIFT_CONNECTION_INIT: 'MAKESWIFT_CONNECTION_INIT',\n MAKESWIFT_CONNECTION_CHECK: 'MAKESWIFT_CONNECTION_CHECK',\n\n CHANGE_PATHNAME: 'CHANGE_PATHNAME',\n CHANGE_PATHNAME_START: 'CHANGE_PATHNAME_START',\n CHANGE_PATHNAME_COMPLETE: 'CHANGE_PATHNAME_COMPLETE',\n\n BUILDER_POINTER_MOVE: 'BUILDER_POINTER_MOVE',\n ELEMENT_FROM_POINT_CHANGE: 'ELEMENT_FROM_POINT_CHANGE',\n\n SET_BREAKPOINTS: 'SET_BREAKPOINTS',\n} as const\n\ntype InitAction = { type: typeof ActionTypes.INIT }\n\ntype CleanUpAction = { type: typeof ActionTypes.CLEAN_UP }\n\ntype RegisterDocumentAction = {\n type: typeof ActionTypes.REGISTER_DOCUMENT\n payload: { documentKey: string; document: Document }\n}\n\ntype UnregisterDocumentAction = {\n type: typeof ActionTypes.UNREGISTER_DOCUMENT\n payload: { documentKey: string }\n}\n\ntype ChangeDocumentAction = {\n type: typeof ActionTypes.CHANGE_DOCUMENT\n payload: { documentKey: string; operation: Operation }\n}\n\ntype RegisterComponentAction = {\n type: typeof ActionTypes.REGISTER_COMPONENT\n payload: {\n type: string\n meta: ComponentMeta\n propControllerDescriptors: Record<string, PropControllerDescriptor>\n }\n}\n\ntype UnregisterComponentAction = {\n type: typeof ActionTypes.UNREGISTER_COMPONENT\n payload: { type: string }\n}\n\ntype RegisterBuilderComponentAction = {\n type: typeof ActionTypes.REGISTER_BUILDER_COMPONENT\n payload: {\n type: string\n meta: ComponentMeta\n serializedControls: Record<string, SerializedControl>\n }\n}\n\ntype UnregisterBuilderComponentAction = {\n type: typeof ActionTypes.UNREGISTER_BUILDER_COMPONENT\n payload: { type: string }\n}\n\ntype RegisterReactComponentAction = {\n type: typeof ActionTypes.REGISTER_REACT_COMPONENT\n payload: { type: string; component: ComponentType }\n}\n\ntype UnregisterReactComponentAction = {\n type: typeof ActionTypes.UNREGISTER_REACT_COMPONENT\n payload: { type: string }\n}\n\ntype MountComponentAction = {\n type: typeof ActionTypes.MOUNT_COMPONENT\n payload: { documentKey: string; elementKey: string }\n}\n\ntype UnmountComponentAction = {\n type: typeof ActionTypes.UNMOUNT_COMPONENT\n payload: { documentKey: string; elementKey: string }\n}\n\ntype RegisterComponentHandleAction = {\n type: typeof ActionTypes.REGISTER_COMPONENT_HANDLE\n payload: { documentKey: string; elementKey: string; componentHandle: ElementImperativeHandle }\n}\n\ntype UnregisterComponentHandleAction = {\n type: typeof ActionTypes.UNREGISTER_COMPONENT_HANDLE\n payload: { documentKey: string; elementKey: string }\n}\n\ntype RegisterMeasurableAction = {\n type: typeof ActionTypes.REGISTER_MEASURABLE\n payload: { documentKey: string; elementKey: string; measurable: Measurable }\n}\n\ntype UnregisterMeasurableAction = {\n type: typeof ActionTypes.UNREGISTER_MEASURABLE\n payload: { documentKey: string; elementKey: string }\n}\n\ntype ChangeElementBoxModelsAction = {\n type: typeof ActionTypes.CHANGE_ELEMENT_BOX_MODELS\n payload: { changedElementBoxModels: Map<string, Map<string, BoxModel | null>> }\n}\n\ntype ChangeDocumentElementSizeAction = {\n type: typeof ActionTypes.CHANGE_DOCUMENT_ELEMENT_SIZE\n payload: { size: Size }\n}\n\ntype ChangeDocumentElementScrollTopAction = {\n type: typeof ActionTypes.CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP\n payload: { scrollTop: number }\n}\n\ntype ScrollDocumentElementAction = {\n type: typeof ActionTypes.SCROLL_DOCUMENT_ELEMENT\n payload: { scrollTopDelta: number }\n}\n\ntype RegisterPropControllersHandleAction = {\n type: typeof ActionTypes.REGISTER_PROP_CONTROLLERS_HANDLE\n payload: { documentKey: string; elementKey: string; handle: PropControllersHandle }\n}\n\ntype UnregisterPropControllersHandleAction = {\n type: typeof ActionTypes.UNREGISTER_PROP_CONTROLLERS_HANDLE\n payload: { documentKey: string; elementKey: string }\n}\n\ntype RegisterPropControllersAction = {\n type: typeof ActionTypes.REGISTER_PROP_CONTROLLERS\n payload: {\n documentKey: string\n elementKey: string\n propControllers: Record<string, PropController>\n }\n}\n\ntype UnregisterPropControllersAction = {\n type: typeof ActionTypes.UNREGISTER_PROP_CONTROLLERS\n payload: { documentKey: string; elementKey: string }\n}\n\ntype MessageHostPropControllerAction<T = PropControllerMessage> = {\n type: typeof ActionTypes.MESSAGE_HOST_PROP_CONTROLLER\n payload: { documentKey: string; elementKey: string; propName: string; message: T }\n}\n\ntype MessageBuilderPropControllerAction<T = PropControllerMessage> = {\n type: typeof ActionTypes.MESSAGE_BUILDER_PROP_CONTROLLER\n payload: { documentKey: string; elementKey: string; propName: string; message: T }\n}\n\ntype ChangeAPIResourceAction = {\n type: typeof ActionTypes.CHANGE_API_RESOURCE\n payload: { resource: APIResource }\n}\n\ntype EvictAPIResourceAction = {\n type: typeof ActionTypes.EVICT_API_RESOURCE\n payload: { id: string }\n}\n\ntype SetIsInBuilderAction = {\n type: typeof ActionTypes.SET_IS_IN_BUILDER\n payload: boolean\n}\n\ntype HandleWheelAction = {\n type: typeof ActionTypes.HANDLE_WHEEL\n payload: { deltaX: number; deltaY: number }\n}\n\ntype HandlePointerMoveAction = {\n type: typeof ActionTypes.HANDLE_POINTER_MOVE\n payload: { clientX: number; clientY: number }\n}\n\ntype APIResourceFulfilledAction = {\n type: typeof ActionTypes.API_RESOURCE_FULFILLED\n payload: { resourceType: APIResourceType; resourceId: string; resource: APIResource | null }\n}\n\ntype SetBuilderEditModeAction = {\n type: typeof ActionTypes.SET_BUILDER_EDIT_MODE\n payload: { editMode: BuilderEditMode }\n}\n\ntype ChangePathnameAction = {\n type: typeof ActionTypes.CHANGE_PATHNAME\n payload: { pathname: string }\n}\n\ntype ChangePathnameStartAction = {\n type: typeof ActionTypes.CHANGE_PATHNAME_START\n}\n\ntype ChangePathnameCompleteAction = {\n type: typeof ActionTypes.CHANGE_PATHNAME_COMPLETE\n}\n\ntype BuilderPointerMoveAction = {\n type: typeof ActionTypes.BUILDER_POINTER_MOVE\n payload: { pointer: Point | null }\n}\n\ntype ElementFromPointChangeAction = {\n type: typeof ActionTypes.ELEMENT_FROM_POINT_CHANGE\n payload: { keys: { documentKey: string; elementKey: string } | null }\n}\n\nexport type SetBreakpointsAction = {\n type: typeof ActionTypes.SET_BREAKPOINTS\n payload: { breakpoints: Breakpoints }\n}\n\nexport type Action =\n | InitAction\n | CleanUpAction\n | ChangeDocumentAction\n | RegisterDocumentAction\n | UnregisterDocumentAction\n | RegisterComponentAction\n | UnregisterComponentAction\n | RegisterBuilderComponentAction\n | UnregisterBuilderComponentAction\n | RegisterReactComponentAction\n | UnregisterReactComponentAction\n | MountComponentAction\n | UnmountComponentAction\n | RegisterComponentHandleAction\n | UnregisterComponentHandleAction\n | RegisterMeasurableAction\n | UnregisterMeasurableAction\n | ChangeElementBoxModelsAction\n | ChangeDocumentElementSizeAction\n | ChangeDocumentElementScrollTopAction\n | ScrollDocumentElementAction\n | RegisterPropControllersHandleAction\n | UnregisterPropControllersHandleAction\n | RegisterPropControllersAction\n | UnregisterPropControllersAction\n | MessageHostPropControllerAction\n | MessageBuilderPropControllerAction\n | ChangeAPIResourceAction\n | EvictAPIResourceAction\n | SetIsInBuilderAction\n | HandleWheelAction\n | HandlePointerMoveAction\n | APIResourceFulfilledAction\n | SetBuilderEditModeAction\n | ChangePathnameAction\n | ChangePathnameStartAction\n | ChangePathnameCompleteAction\n | BuilderPointerMoveAction\n | ElementFromPointChangeAction\n | SetBreakpointsAction\n\nexport function init(): InitAction {\n return { type: ActionTypes.INIT }\n}\n\nexport function cleanUp(): CleanUpAction {\n return { type: ActionTypes.CLEAN_UP }\n}\n\nexport function registerDocument(document: Document): RegisterDocumentAction {\n return { type: ActionTypes.REGISTER_DOCUMENT, payload: { documentKey: document.key, document } }\n}\n\nexport function unregisterDocument(documentKey: string): UnregisterDocumentAction {\n return { type: ActionTypes.UNREGISTER_DOCUMENT, payload: { documentKey } }\n}\n\nexport function registerDocumentEffect(\n document: Document,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerDocument(document))\n\n return () => {\n dispatch(unregisterDocument(document.key))\n }\n }\n}\n\nexport function changeDocument(documentKey: string, operation: Operation): ChangeDocumentAction {\n return { type: ActionTypes.CHANGE_DOCUMENT, payload: { documentKey, operation } }\n}\n\nexport function registerComponent(\n type: string,\n meta: ComponentMeta,\n propControllerDescriptors: Record<string, PropControllerDescriptor>,\n): RegisterComponentAction {\n return {\n type: ActionTypes.REGISTER_COMPONENT,\n payload: { type, meta, propControllerDescriptors },\n }\n}\n\nexport function unregisterComponent(type: string): UnregisterComponentAction {\n return { type: ActionTypes.UNREGISTER_COMPONENT, payload: { type } }\n}\n\nexport function registerComponentEffect(\n type: string,\n meta: ComponentMeta,\n propControllerDescriptors: Record<string, PropControllerDescriptor>,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerComponent(type, meta, propControllerDescriptors))\n\n return () => {\n dispatch(unregisterComponent(type))\n }\n }\n}\n\nexport function registerBuilderComponent(\n type: string,\n meta: ComponentMeta,\n serializedControls: Record<string, SerializedControl>,\n): RegisterBuilderComponentAction {\n return {\n type: ActionTypes.REGISTER_BUILDER_COMPONENT,\n payload: { type, meta, serializedControls },\n }\n}\n\nexport function unregisterBuilderComponent(type: string): UnregisterBuilderComponentAction {\n return { type: ActionTypes.UNREGISTER_BUILDER_COMPONENT, payload: { type } }\n}\n\nfunction registerReactComponent(\n type: string,\n component: ComponentType,\n): RegisterReactComponentAction {\n return { type: ActionTypes.REGISTER_REACT_COMPONENT, payload: { type, component } }\n}\n\nfunction unregisterReactComponent(type: string): UnregisterReactComponentAction {\n return { type: ActionTypes.UNREGISTER_REACT_COMPONENT, payload: { type } }\n}\n\nexport function registerReactComponentEffect(\n type: string,\n component: ComponentType,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerReactComponent(type, component))\n\n return () => {\n dispatch(unregisterReactComponent(type))\n }\n }\n}\n\nexport function mountComponent(documentKey: string, elementKey: string): MountComponentAction {\n return { type: ActionTypes.MOUNT_COMPONENT, payload: { documentKey, elementKey } }\n}\n\nexport function unmountComponent(documentKey: string, elementKey: string): UnmountComponentAction {\n return { type: ActionTypes.UNMOUNT_COMPONENT, payload: { documentKey, elementKey } }\n}\n\nexport function mountComponentEffect(\n documentKey: string,\n elementKey: string,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(mountComponent(documentKey, elementKey))\n\n return () => {\n dispatch(unmountComponent(documentKey, elementKey))\n }\n }\n}\n\nexport function registerComponentHandle(\n documentKey: string,\n elementKey: string,\n componentHandle: ElementImperativeHandle,\n): RegisterComponentHandleAction {\n return {\n type: ActionTypes.REGISTER_COMPONENT_HANDLE,\n payload: { documentKey, elementKey, componentHandle },\n }\n}\n\nfunction unregisterComponentHandle(\n documentKey: string,\n elementKey: string,\n): UnregisterComponentHandleAction {\n return { type: ActionTypes.UNREGISTER_COMPONENT_HANDLE, payload: { documentKey, elementKey } }\n}\n\nexport function registerComponentHandleEffect(\n documentKey: string,\n elementKey: string,\n componentHandle: ElementImperativeHandle,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerComponentHandle(documentKey, elementKey, componentHandle))\n\n return () => {\n dispatch(unregisterComponentHandle(documentKey, elementKey))\n }\n }\n}\n\nexport function registerMeasurable(\n documentKey: string,\n elementKey: string,\n measurable: Measurable,\n): RegisterMeasurableAction {\n return { type: ActionTypes.REGISTER_MEASURABLE, payload: { documentKey, elementKey, measurable } }\n}\n\nexport function unregisterMeasurable(\n documentKey: string,\n elementKey: string,\n): UnregisterMeasurableAction {\n return { type: ActionTypes.UNREGISTER_MEASURABLE, payload: { documentKey, elementKey } }\n}\n\nexport function registerMeasurableEffect(\n documentKey: string,\n elementKey: string,\n measurable: Measurable,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerMeasurable(documentKey, elementKey, measurable))\n\n return () => {\n dispatch(unregisterMeasurable(documentKey, elementKey))\n }\n }\n}\n\nexport function changeElementBoxModels(\n changedElementBoxModels: Map<string, Map<string, BoxModel | null>>,\n): ChangeElementBoxModelsAction {\n return { type: ActionTypes.CHANGE_ELEMENT_BOX_MODELS, payload: { changedElementBoxModels } }\n}\n\nexport function changeDocumentElementSize(size: Size): ChangeDocumentElementSizeAction {\n return { type: ActionTypes.CHANGE_DOCUMENT_ELEMENT_SIZE, payload: { size } }\n}\n\nexport function changeDocumentElementScrollTop(\n scrollTop: number,\n): ChangeDocumentElementScrollTopAction {\n return { type: ActionTypes.CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP, payload: { scrollTop } }\n}\n\nexport function scrollDocumentElement(scrollTopDelta: number): ScrollDocumentElementAction {\n return { type: ActionTypes.SCROLL_DOCUMENT_ELEMENT, payload: { scrollTopDelta } }\n}\n\nexport function registerPropControllersHandle(\n documentKey: string,\n elementKey: string,\n handle: PropControllersHandle,\n): RegisterPropControllersHandleAction {\n return {\n type: ActionTypes.REGISTER_PROP_CONTROLLERS_HANDLE,\n payload: { documentKey, elementKey, handle },\n }\n}\n\nexport function unregisterPropControllersHandle(\n documentKey: string,\n elementKey: string,\n): UnregisterPropControllersHandleAction {\n return {\n type: ActionTypes.UNREGISTER_PROP_CONTROLLERS_HANDLE,\n payload: { documentKey, elementKey },\n }\n}\n\nexport function registerPropControllers(\n documentKey: string,\n elementKey: string,\n propControllers: Record<string, PropController>,\n): RegisterPropControllersAction {\n return {\n type: ActionTypes.REGISTER_PROP_CONTROLLERS,\n payload: { documentKey, elementKey, propControllers },\n }\n}\n\nexport function unregisterPropControllers(\n documentKey: string,\n elementKey: string,\n): UnregisterPropControllersAction {\n return { type: ActionTypes.UNREGISTER_PROP_CONTROLLERS, payload: { documentKey, elementKey } }\n}\n\nexport function messageHostPropController<T>(\n documentKey: string,\n elementKey: string,\n propName: string,\n message: T,\n): MessageHostPropControllerAction<T> {\n return {\n type: ActionTypes.MESSAGE_HOST_PROP_CONTROLLER,\n payload: { documentKey, elementKey, propName, message },\n }\n}\n\nexport function messageBuilderPropController<T>(\n documentKey: string,\n elementKey: string,\n propName: string,\n message: T,\n): MessageBuilderPropControllerAction<T> {\n return {\n type: ActionTypes.MESSAGE_BUILDER_PROP_CONTROLLER,\n payload: { documentKey, elementKey, propName, message },\n }\n}\n\nexport function changeApiResource(resource: APIResource): ChangeAPIResourceAction {\n return { type: ActionTypes.CHANGE_API_RESOURCE, payload: { resource } }\n}\n\nexport function evictApiResource(id: string): EvictAPIResourceAction {\n return { type: ActionTypes.EVICT_API_RESOURCE, payload: { id } }\n}\n\nexport function setIsInBuilder(isInBuilder: boolean): SetIsInBuilderAction {\n return { type: ActionTypes.SET_IS_IN_BUILDER, payload: isInBuilder }\n}\n\nexport function handleWheel(payload: { deltaX: number; deltaY: number }): HandleWheelAction {\n return { type: ActionTypes.HANDLE_WHEEL, payload }\n}\n\nexport function handlePointerMove(payload: {\n clientX: number\n clientY: number\n}): HandlePointerMoveAction {\n return { type: ActionTypes.HANDLE_POINTER_MOVE, payload }\n}\n\nexport function apiResourceFulfilled(\n resourceType: APIResourceType,\n resourceId: string,\n resource: APIResource | null,\n): APIResourceFulfilledAction {\n return {\n type: ActionTypes.API_RESOURCE_FULFILLED,\n payload: { resourceType, resourceId, resource },\n }\n}\n\nexport function setBuilderEditMode(editMode: BuilderEditMode): SetBuilderEditModeAction {\n return {\n type: ActionTypes.SET_BUILDER_EDIT_MODE,\n payload: { editMode },\n }\n}\n\nexport function changePathname(pathname: string): ChangePathnameAction {\n return {\n type: ActionTypes.CHANGE_PATHNAME,\n payload: { pathname },\n }\n}\n\nexport function changePathnameStart(): ChangePathnameStartAction {\n return {\n type: ActionTypes.CHANGE_PATHNAME_START,\n }\n}\n\nexport function changePathnameComplete(): ChangePathnameCompleteAction {\n return {\n type: ActionTypes.CHANGE_PATHNAME_COMPLETE,\n }\n}\n\nexport function builderPointerMove(pointer: Point | null): BuilderPointerMoveAction {\n return { type: ActionTypes.BUILDER_POINTER_MOVE, payload: { pointer } }\n}\n\nexport function elementFromPointChange(\n keys: {\n documentKey: string\n elementKey: string\n } | null,\n): ElementFromPointChangeAction {\n return { type: ActionTypes.ELEMENT_FROM_POINT_CHANGE, payload: { keys } }\n}\n\nexport function setBreakpoints(breakpoints: Breakpoints): SetBreakpointsAction {\n return { type: ActionTypes.SET_BREAKPOINTS, payload: { breakpoints } }\n}\n"],"names":[],"mappings":";AAmBO,MAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,UAAU;AAAA,EAEV,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EAErB,iBAAiB;AAAA,EAEjB,oBAAoB;AAAA,EACpB,sBAAsB;AAAA,EAEtB,4BAA4B;AAAA,EAC5B,8BAA8B;AAAA,EAE9B,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAE5B,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EAEnB,2BAA2B;AAAA,EAC3B,6BAA6B;AAAA,EAE7B,qBAAqB;AAAA,EACrB,uBAAuB;AAAA,EAEvB,2BAA2B;AAAA,EAE3B,8BAA8B;AAAA,EAC9B,oCAAoC;AAAA,EACpC,yBAAyB;AAAA,EAEzB,kCAAkC;AAAA,EAClC,oCAAoC;AAAA,EACpC,2BAA2B;AAAA,EAC3B,6BAA6B;AAAA,EAC7B,8BAA8B;AAAA,EAC9B,iCAAiC;AAAA,EAEjC,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EAEpB,mBAAmB;AAAA,EAEnB,cAAc;AAAA,EACd,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AM,YAAY,oBAAoB,SAAS,EAAE;AAC5D;AAEO,wBAAwB,aAA4C;AACzE,SAAO,EAAE,MAAM,YAAY,mBAAmB,SAAS,YAAY;AACrE;AAEO,qBAAqB,SAAgE;AAC1F,SAAO,EAAE,MAAM,YAAY,cAAc,QAAQ;AACnD;AAEO,2BAA2B,SAGN;AAC1B,SAAO,EAAE,MAAM,YAAY,qBAAqB,QAAQ;AAC1D;AAGE,8BAAA,cACA,YACA,UAC4B;AACrB,SAAA;AAAA,IACL,MAAM,YAAY;AAAA,IAClB,SAAS,EAAE,cAAc,YAAY,SAAS;AAAA,EAAA;AAElD;AAEO,4BAA4B,UAAqD;AAC/E,SAAA;AAAA,IACL,MAAM,YAAY;AAAA,IAClB,SAAS,EAAE,SAAS;AAAA,EAAA;AAExB;AAEO,wBAAwB,UAAwC;AAC9D,SAAA;AAAA,IACL,MAAM,YAAY;AAAA,IAClB,SAAS,EAAE,SAAS;AAAA,EAAA;AAExB;AAEiE,+BAAA;AACxD,SAAA;AAAA,IACL,MAAM,YAAY;AAAA,EAAA;AAEtB;AAEuE,kCAAA;AAC9D,SAAA;AAAA,IACL,MAAM,YAAY;AAAA,EAAA;AAEtB;AAEO,4BAA4B,SAAiD;AAClF,SAAO,EAAE,MAAM,YAAY,sBAAsB,SAAS,EAAE;AAC9D;AAEO,gCACL,MAI8B;AAC9B,SAAO,EAAE,MAAM,YAAY,2BAA2B,SAAS,EAAE;AACnE;AAEO,wBAAwB,aAAgD;AAC7E,SAAO,EAAE,MAAM,YAAY,iBAAiB,SAAS,EAAE;AACzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"actions.es.js","sources":["../src/state/actions.ts"],"sourcesContent":["import type { Operation } from 'ot-json0'\n\nimport type { Document } from './modules/read-only-documents'\nimport type { ComponentType } from './modules/react-components'\nimport type { Measurable, BoxModel } from './modules/box-models'\nimport type { ThunkAction } from 'redux-thunk'\nimport { ComponentMeta } from './modules/components-meta'\nimport { PropControllerDescriptor } from '../prop-controllers'\nimport type { Size } from './react-builder-preview'\nimport type { PropControllersHandle } from './modules/prop-controller-handles'\nimport type { PropController, PropControllerMessage } from '../prop-controllers/instances'\nimport type { APIResource, APIResourceType } from '../api/graphql/types'\nimport type { SerializedControl } from '../builder'\nimport { ElementImperativeHandle } from '../runtimes/react/element-imperative-handle'\nimport { BuilderEditMode } from './modules/builder-edit-mode'\nimport type { Point } from './modules/pointer'\nimport { Breakpoints } from './modules/breakpoints'\n\nexport const ActionTypes = {\n INIT: 'INIT',\n CLEAN_UP: 'CLEAN_UP',\n\n REGISTER_DOCUMENT: 'REGISTER_DOCUMENT',\n UNREGISTER_DOCUMENT: 'UNREGISTER_DOCUMENT',\n\n CHANGE_DOCUMENT: 'CHANGE_DOCUMENT',\n\n REGISTER_COMPONENT: 'REGISTER_COMPONENT',\n UNREGISTER_COMPONENT: 'UNREGISTER_COMPONENT',\n\n REGISTER_BUILDER_COMPONENT: 'REGISTER_BUILDER_COMPONENT',\n UNREGISTER_BUILDER_COMPONENT: 'UNREGISTER_BUILDER_COMPONENT',\n\n REGISTER_REACT_COMPONENT: 'REGISTER_REACT_COMPONENT',\n UNREGISTER_REACT_COMPONENT: 'UNREGISTER_REACT_COMPONENT',\n\n MOUNT_COMPONENT: 'MOUNT_COMPONENT',\n UNMOUNT_COMPONENT: 'UNMOUNT_COMPONENT',\n\n REGISTER_COMPONENT_HANDLE: 'REGISTER_COMPONENT_HANDLE',\n UNREGISTER_COMPONENT_HANDLE: 'UNREGISTER_COMPONENT_HANDLE',\n\n REGISTER_MEASURABLE: 'REGISTER_MEASURABLE',\n UNREGISTER_MEASURABLE: 'UNREGISTER_MEASURABLE',\n\n CHANGE_ELEMENT_BOX_MODELS: 'CHANGE_ELEMENT_BOX_MODELS',\n\n CHANGE_DOCUMENT_ELEMENT_SIZE: 'CHANGE_DOCUMENT_ELEMENT_SIZE',\n CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP: 'CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP',\n SCROLL_DOCUMENT_ELEMENT: 'SCROLL_DOCUMENT_ELEMENT',\n\n REGISTER_PROP_CONTROLLERS_HANDLE: 'REGISTER_PROP_CONTROLLERS_HANDLE',\n UNREGISTER_PROP_CONTROLLERS_HANDLE: 'UNREGISTER_PROP_CONTROLLERS_HANDLE',\n REGISTER_PROP_CONTROLLERS: 'REGISTER_PROP_CONTROLLERS',\n UNREGISTER_PROP_CONTROLLERS: 'UNREGISTER_PROP_CONTROLLERS',\n MESSAGE_HOST_PROP_CONTROLLER: 'MESSAGE_HOST_PROP_CONTROLLER',\n MESSAGE_BUILDER_PROP_CONTROLLER: 'MESSAGE_BUILDER_PROP_CONTROLLER',\n\n CHANGE_API_RESOURCE: 'CHANGE_API_RESOURCE',\n EVICT_API_RESOURCE: 'EVICT_API_RESOURCE',\n\n SET_IS_IN_BUILDER: 'SET_IS_IN_BUILDER',\n\n HANDLE_WHEEL: 'HANDLE_WHEEL',\n HANDLE_POINTER_MOVE: 'HANDLE_POINTER_MOVE',\n\n API_RESOURCE_FULFILLED: 'API_RESOURCE_FULFILLED',\n\n SET_BUILDER_EDIT_MODE: 'SET_BUILDER_EDIT_MODE',\n MAKESWIFT_CONNECTION_INIT: 'MAKESWIFT_CONNECTION_INIT',\n MAKESWIFT_CONNECTION_CHECK: 'MAKESWIFT_CONNECTION_CHECK',\n\n CHANGE_PATHNAME: 'CHANGE_PATHNAME',\n CHANGE_PATHNAME_START: 'CHANGE_PATHNAME_START',\n CHANGE_PATHNAME_COMPLETE: 'CHANGE_PATHNAME_COMPLETE',\n\n BUILDER_POINTER_MOVE: 'BUILDER_POINTER_MOVE',\n ELEMENT_FROM_POINT_CHANGE: 'ELEMENT_FROM_POINT_CHANGE',\n\n SET_BREAKPOINTS: 'SET_BREAKPOINTS',\n} as const\n\ntype InitAction = { type: typeof ActionTypes.INIT }\n\ntype CleanUpAction = { type: typeof ActionTypes.CLEAN_UP }\n\ntype RegisterDocumentAction = {\n type: typeof ActionTypes.REGISTER_DOCUMENT\n payload: { documentKey: string; document: Document }\n}\n\ntype UnregisterDocumentAction = {\n type: typeof ActionTypes.UNREGISTER_DOCUMENT\n payload: { documentKey: string }\n}\n\ntype ChangeDocumentAction = {\n type: typeof ActionTypes.CHANGE_DOCUMENT\n payload: { documentKey: string; operation: Operation }\n}\n\ntype RegisterComponentAction = {\n type: typeof ActionTypes.REGISTER_COMPONENT\n payload: {\n type: string\n meta: ComponentMeta\n propControllerDescriptors: Record<string, PropControllerDescriptor>\n }\n}\n\ntype UnregisterComponentAction = {\n type: typeof ActionTypes.UNREGISTER_COMPONENT\n payload: { type: string }\n}\n\ntype RegisterBuilderComponentAction = {\n type: typeof ActionTypes.REGISTER_BUILDER_COMPONENT\n payload: {\n type: string\n meta: ComponentMeta\n serializedControls: Record<string, SerializedControl>\n }\n}\n\ntype UnregisterBuilderComponentAction = {\n type: typeof ActionTypes.UNREGISTER_BUILDER_COMPONENT\n payload: { type: string }\n}\n\ntype RegisterReactComponentAction = {\n type: typeof ActionTypes.REGISTER_REACT_COMPONENT\n payload: { type: string; component: ComponentType }\n}\n\ntype UnregisterReactComponentAction = {\n type: typeof ActionTypes.UNREGISTER_REACT_COMPONENT\n payload: { type: string }\n}\n\ntype MountComponentAction = {\n type: typeof ActionTypes.MOUNT_COMPONENT\n payload: { documentKey: string; elementKey: string }\n}\n\ntype UnmountComponentAction = {\n type: typeof ActionTypes.UNMOUNT_COMPONENT\n payload: { documentKey: string; elementKey: string }\n}\n\ntype RegisterComponentHandleAction = {\n type: typeof ActionTypes.REGISTER_COMPONENT_HANDLE\n payload: { documentKey: string; elementKey: string; componentHandle: ElementImperativeHandle }\n}\n\ntype UnregisterComponentHandleAction = {\n type: typeof ActionTypes.UNREGISTER_COMPONENT_HANDLE\n payload: { documentKey: string; elementKey: string }\n}\n\ntype RegisterMeasurableAction = {\n type: typeof ActionTypes.REGISTER_MEASURABLE\n payload: { documentKey: string; elementKey: string; measurable: Measurable }\n}\n\ntype UnregisterMeasurableAction = {\n type: typeof ActionTypes.UNREGISTER_MEASURABLE\n payload: { documentKey: string; elementKey: string }\n}\n\ntype ChangeElementBoxModelsAction = {\n type: typeof ActionTypes.CHANGE_ELEMENT_BOX_MODELS\n payload: { changedElementBoxModels: Map<string, Map<string, BoxModel | null>> }\n}\n\ntype ChangeDocumentElementSizeAction = {\n type: typeof ActionTypes.CHANGE_DOCUMENT_ELEMENT_SIZE\n payload: { size: Size }\n}\n\ntype ChangeDocumentElementScrollTopAction = {\n type: typeof ActionTypes.CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP\n payload: { scrollTop: number }\n}\n\ntype ScrollDocumentElementAction = {\n type: typeof ActionTypes.SCROLL_DOCUMENT_ELEMENT\n payload: { scrollTopDelta: number }\n}\n\ntype RegisterPropControllersHandleAction = {\n type: typeof ActionTypes.REGISTER_PROP_CONTROLLERS_HANDLE\n payload: { documentKey: string; elementKey: string; handle: PropControllersHandle }\n}\n\ntype UnregisterPropControllersHandleAction = {\n type: typeof ActionTypes.UNREGISTER_PROP_CONTROLLERS_HANDLE\n payload: { documentKey: string; elementKey: string }\n}\n\ntype RegisterPropControllersAction = {\n type: typeof ActionTypes.REGISTER_PROP_CONTROLLERS\n payload: {\n documentKey: string\n elementKey: string\n propControllers: Record<string, PropController>\n }\n}\n\ntype UnregisterPropControllersAction = {\n type: typeof ActionTypes.UNREGISTER_PROP_CONTROLLERS\n payload: { documentKey: string; elementKey: string }\n}\n\ntype MessageHostPropControllerAction<T = PropControllerMessage> = {\n type: typeof ActionTypes.MESSAGE_HOST_PROP_CONTROLLER\n payload: { documentKey: string; elementKey: string; propName: string; message: T }\n}\n\ntype MessageBuilderPropControllerAction<T = PropControllerMessage> = {\n type: typeof ActionTypes.MESSAGE_BUILDER_PROP_CONTROLLER\n payload: { documentKey: string; elementKey: string; propName: string; message: T }\n}\n\ntype ChangeAPIResourceAction = {\n type: typeof ActionTypes.CHANGE_API_RESOURCE\n payload: { resource: APIResource }\n}\n\ntype EvictAPIResourceAction = {\n type: typeof ActionTypes.EVICT_API_RESOURCE\n payload: { id: string }\n}\n\ntype SetIsInBuilderAction = {\n type: typeof ActionTypes.SET_IS_IN_BUILDER\n payload: boolean\n}\n\ntype HandleWheelAction = {\n type: typeof ActionTypes.HANDLE_WHEEL\n payload: { deltaX: number; deltaY: number }\n}\n\ntype HandlePointerMoveAction = {\n type: typeof ActionTypes.HANDLE_POINTER_MOVE\n payload: { clientX: number; clientY: number }\n}\n\ntype APIResourceFulfilledAction = {\n type: typeof ActionTypes.API_RESOURCE_FULFILLED\n payload: { resourceType: APIResourceType; resourceId: string; resource: APIResource | null }\n}\n\ntype SetBuilderEditModeAction = {\n type: typeof ActionTypes.SET_BUILDER_EDIT_MODE\n payload: { editMode: BuilderEditMode }\n}\n\ntype ChangePathnameAction = {\n type: typeof ActionTypes.CHANGE_PATHNAME\n payload: { pathname: string }\n}\n\ntype ChangePathnameStartAction = {\n type: typeof ActionTypes.CHANGE_PATHNAME_START\n}\n\ntype ChangePathnameCompleteAction = {\n type: typeof ActionTypes.CHANGE_PATHNAME_COMPLETE\n}\n\ntype BuilderPointerMoveAction = {\n type: typeof ActionTypes.BUILDER_POINTER_MOVE\n payload: { pointer: Point | null }\n}\n\ntype ElementFromPointChangeAction = {\n type: typeof ActionTypes.ELEMENT_FROM_POINT_CHANGE\n payload: { keys: { documentKey: string; elementKey: string } | null }\n}\n\nexport type SetBreakpointsAction = {\n type: typeof ActionTypes.SET_BREAKPOINTS\n payload: { breakpoints: Breakpoints }\n}\n\nexport type Action =\n | InitAction\n | CleanUpAction\n | ChangeDocumentAction\n | RegisterDocumentAction\n | UnregisterDocumentAction\n | RegisterComponentAction\n | UnregisterComponentAction\n | RegisterBuilderComponentAction\n | UnregisterBuilderComponentAction\n | RegisterReactComponentAction\n | UnregisterReactComponentAction\n | MountComponentAction\n | UnmountComponentAction\n | RegisterComponentHandleAction\n | UnregisterComponentHandleAction\n | RegisterMeasurableAction\n | UnregisterMeasurableAction\n | ChangeElementBoxModelsAction\n | ChangeDocumentElementSizeAction\n | ChangeDocumentElementScrollTopAction\n | ScrollDocumentElementAction\n | RegisterPropControllersHandleAction\n | UnregisterPropControllersHandleAction\n | RegisterPropControllersAction\n | UnregisterPropControllersAction\n | MessageHostPropControllerAction\n | MessageBuilderPropControllerAction\n | ChangeAPIResourceAction\n | EvictAPIResourceAction\n | SetIsInBuilderAction\n | HandleWheelAction\n | HandlePointerMoveAction\n | APIResourceFulfilledAction\n | SetBuilderEditModeAction\n | ChangePathnameAction\n | ChangePathnameStartAction\n | ChangePathnameCompleteAction\n | BuilderPointerMoveAction\n | ElementFromPointChangeAction\n | SetBreakpointsAction\n\nexport function init(): InitAction {\n return { type: ActionTypes.INIT }\n}\n\nexport function cleanUp(): CleanUpAction {\n return { type: ActionTypes.CLEAN_UP }\n}\n\nexport function registerDocument(document: Document): RegisterDocumentAction {\n return { type: ActionTypes.REGISTER_DOCUMENT, payload: { documentKey: document.key, document } }\n}\n\nexport function unregisterDocument(documentKey: string): UnregisterDocumentAction {\n return { type: ActionTypes.UNREGISTER_DOCUMENT, payload: { documentKey } }\n}\n\nexport function registerDocumentEffect(\n document: Document,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerDocument(document))\n\n return () => {\n dispatch(unregisterDocument(document.key))\n }\n }\n}\n\nexport function changeDocument(documentKey: string, operation: Operation): ChangeDocumentAction {\n return { type: ActionTypes.CHANGE_DOCUMENT, payload: { documentKey, operation } }\n}\n\nexport function registerComponent(\n type: string,\n meta: ComponentMeta,\n propControllerDescriptors: Record<string, PropControllerDescriptor>,\n): RegisterComponentAction {\n return {\n type: ActionTypes.REGISTER_COMPONENT,\n payload: { type, meta, propControllerDescriptors },\n }\n}\n\nexport function unregisterComponent(type: string): UnregisterComponentAction {\n return { type: ActionTypes.UNREGISTER_COMPONENT, payload: { type } }\n}\n\nexport function registerComponentEffect(\n type: string,\n meta: ComponentMeta,\n propControllerDescriptors: Record<string, PropControllerDescriptor>,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerComponent(type, meta, propControllerDescriptors))\n\n return () => {\n dispatch(unregisterComponent(type))\n }\n }\n}\n\nexport function registerBuilderComponent(\n type: string,\n meta: ComponentMeta,\n serializedControls: Record<string, SerializedControl>,\n): RegisterBuilderComponentAction {\n return {\n type: ActionTypes.REGISTER_BUILDER_COMPONENT,\n payload: { type, meta, serializedControls },\n }\n}\n\nexport function unregisterBuilderComponent(type: string): UnregisterBuilderComponentAction {\n return { type: ActionTypes.UNREGISTER_BUILDER_COMPONENT, payload: { type } }\n}\n\nfunction registerReactComponent(\n type: string,\n component: ComponentType,\n): RegisterReactComponentAction {\n return { type: ActionTypes.REGISTER_REACT_COMPONENT, payload: { type, component } }\n}\n\nfunction unregisterReactComponent(type: string): UnregisterReactComponentAction {\n return { type: ActionTypes.UNREGISTER_REACT_COMPONENT, payload: { type } }\n}\n\nexport function registerReactComponentEffect(\n type: string,\n component: ComponentType,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerReactComponent(type, component))\n\n return () => {\n dispatch(unregisterReactComponent(type))\n }\n }\n}\n\nexport function mountComponent(documentKey: string, elementKey: string): MountComponentAction {\n return { type: ActionTypes.MOUNT_COMPONENT, payload: { documentKey, elementKey } }\n}\n\nexport function unmountComponent(documentKey: string, elementKey: string): UnmountComponentAction {\n return { type: ActionTypes.UNMOUNT_COMPONENT, payload: { documentKey, elementKey } }\n}\n\nexport function mountComponentEffect(\n documentKey: string,\n elementKey: string,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(mountComponent(documentKey, elementKey))\n\n return () => {\n dispatch(unmountComponent(documentKey, elementKey))\n }\n }\n}\n\nexport function registerComponentHandle(\n documentKey: string,\n elementKey: string,\n componentHandle: ElementImperativeHandle,\n): RegisterComponentHandleAction {\n return {\n type: ActionTypes.REGISTER_COMPONENT_HANDLE,\n payload: { documentKey, elementKey, componentHandle },\n }\n}\n\nfunction unregisterComponentHandle(\n documentKey: string,\n elementKey: string,\n): UnregisterComponentHandleAction {\n return { type: ActionTypes.UNREGISTER_COMPONENT_HANDLE, payload: { documentKey, elementKey } }\n}\n\nexport function registerComponentHandleEffect(\n documentKey: string,\n elementKey: string,\n componentHandle: ElementImperativeHandle,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerComponentHandle(documentKey, elementKey, componentHandle))\n\n return () => {\n dispatch(unregisterComponentHandle(documentKey, elementKey))\n }\n }\n}\n\nexport function registerMeasurable(\n documentKey: string,\n elementKey: string,\n measurable: Measurable,\n): RegisterMeasurableAction {\n return { type: ActionTypes.REGISTER_MEASURABLE, payload: { documentKey, elementKey, measurable } }\n}\n\nexport function unregisterMeasurable(\n documentKey: string,\n elementKey: string,\n): UnregisterMeasurableAction {\n return { type: ActionTypes.UNREGISTER_MEASURABLE, payload: { documentKey, elementKey } }\n}\n\nexport function registerMeasurableEffect(\n documentKey: string,\n elementKey: string,\n measurable: Measurable,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerMeasurable(documentKey, elementKey, measurable))\n\n return () => {\n dispatch(unregisterMeasurable(documentKey, elementKey))\n }\n }\n}\n\nexport function changeElementBoxModels(\n changedElementBoxModels: Map<string, Map<string, BoxModel | null>>,\n): ChangeElementBoxModelsAction {\n return { type: ActionTypes.CHANGE_ELEMENT_BOX_MODELS, payload: { changedElementBoxModels } }\n}\n\nexport function changeDocumentElementSize(size: Size): ChangeDocumentElementSizeAction {\n return { type: ActionTypes.CHANGE_DOCUMENT_ELEMENT_SIZE, payload: { size } }\n}\n\nexport function changeDocumentElementScrollTop(\n scrollTop: number,\n): ChangeDocumentElementScrollTopAction {\n return { type: ActionTypes.CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP, payload: { scrollTop } }\n}\n\nexport function scrollDocumentElement(scrollTopDelta: number): ScrollDocumentElementAction {\n return { type: ActionTypes.SCROLL_DOCUMENT_ELEMENT, payload: { scrollTopDelta } }\n}\n\nexport function registerPropControllersHandle(\n documentKey: string,\n elementKey: string,\n handle: PropControllersHandle,\n): RegisterPropControllersHandleAction {\n return {\n type: ActionTypes.REGISTER_PROP_CONTROLLERS_HANDLE,\n payload: { documentKey, elementKey, handle },\n }\n}\n\nexport function unregisterPropControllersHandle(\n documentKey: string,\n elementKey: string,\n): UnregisterPropControllersHandleAction {\n return {\n type: ActionTypes.UNREGISTER_PROP_CONTROLLERS_HANDLE,\n payload: { documentKey, elementKey },\n }\n}\n\nexport function registerPropControllers(\n documentKey: string,\n elementKey: string,\n propControllers: Record<string, PropController>,\n): RegisterPropControllersAction {\n return {\n type: ActionTypes.REGISTER_PROP_CONTROLLERS,\n payload: { documentKey, elementKey, propControllers },\n }\n}\n\nexport function unregisterPropControllers(\n documentKey: string,\n elementKey: string,\n): UnregisterPropControllersAction {\n return { type: ActionTypes.UNREGISTER_PROP_CONTROLLERS, payload: { documentKey, elementKey } }\n}\n\nexport function messageHostPropController<T>(\n documentKey: string,\n elementKey: string,\n propName: string,\n message: T,\n): MessageHostPropControllerAction<T> {\n return {\n type: ActionTypes.MESSAGE_HOST_PROP_CONTROLLER,\n payload: { documentKey, elementKey, propName, message },\n }\n}\n\nexport function messageBuilderPropController<T>(\n documentKey: string,\n elementKey: string,\n propName: string,\n message: T,\n): MessageBuilderPropControllerAction<T> {\n return {\n type: ActionTypes.MESSAGE_BUILDER_PROP_CONTROLLER,\n payload: { documentKey, elementKey, propName, message },\n }\n}\n\nexport function changeApiResource(resource: APIResource): ChangeAPIResourceAction {\n return { type: ActionTypes.CHANGE_API_RESOURCE, payload: { resource } }\n}\n\nexport function evictApiResource(id: string): EvictAPIResourceAction {\n return { type: ActionTypes.EVICT_API_RESOURCE, payload: { id } }\n}\n\nexport function setIsInBuilder(isInBuilder: boolean): SetIsInBuilderAction {\n return { type: ActionTypes.SET_IS_IN_BUILDER, payload: isInBuilder }\n}\n\nexport function handleWheel(payload: { deltaX: number; deltaY: number }): HandleWheelAction {\n return { type: ActionTypes.HANDLE_WHEEL, payload }\n}\n\nexport function handlePointerMove(payload: {\n clientX: number\n clientY: number\n}): HandlePointerMoveAction {\n return { type: ActionTypes.HANDLE_POINTER_MOVE, payload }\n}\n\nexport function apiResourceFulfilled(\n resourceType: APIResourceType,\n resourceId: string,\n resource: APIResource | null,\n): APIResourceFulfilledAction {\n return {\n type: ActionTypes.API_RESOURCE_FULFILLED,\n payload: { resourceType, resourceId, resource },\n }\n}\n\nexport function setBuilderEditMode(editMode: BuilderEditMode): SetBuilderEditModeAction {\n return {\n type: ActionTypes.SET_BUILDER_EDIT_MODE,\n payload: { editMode },\n }\n}\n\nexport function changePathname(pathname: string): ChangePathnameAction {\n return {\n type: ActionTypes.CHANGE_PATHNAME,\n payload: { pathname },\n }\n}\n\nexport function changePathnameStart(): ChangePathnameStartAction {\n return {\n type: ActionTypes.CHANGE_PATHNAME_START,\n }\n}\n\nexport function changePathnameComplete(): ChangePathnameCompleteAction {\n return {\n type: ActionTypes.CHANGE_PATHNAME_COMPLETE,\n }\n}\n\nexport function builderPointerMove(pointer: Point | null): BuilderPointerMoveAction {\n return { type: ActionTypes.BUILDER_POINTER_MOVE, payload: { pointer } }\n}\n\nexport function elementFromPointChange(\n keys: {\n documentKey: string\n elementKey: string\n } | null,\n): ElementFromPointChangeAction {\n return { type: ActionTypes.ELEMENT_FROM_POINT_CHANGE, payload: { keys } }\n}\n\nexport function setBreakpoints(breakpoints: Breakpoints): SetBreakpointsAction {\n return { type: ActionTypes.SET_BREAKPOINTS, payload: { breakpoints } }\n}\n"],"names":[],"mappings":"AAkBO,MAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,UAAU;AAAA,EAEV,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EAErB,iBAAiB;AAAA,EAEjB,oBAAoB;AAAA,EACpB,sBAAsB;AAAA,EAEtB,4BAA4B;AAAA,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AEO,4BAA4B,SAAiD;AAClF,SAAO,EAAE,MAAM,YAAY,sBAAsB,SAAS,EAAE;AAC9D;AAEO,gCACL,MAI8B;AAC9B,SAAO,EAAE,MAAM,YAAY,2BAA2B,SAAS,EAAE;AACnE;AAEO,wBAAwB,aAAgD;AAC7E,SAAO,EAAE,MAAM,YAAY,iBAAiB,SAAS,EAAE;AACzD;;"}
1
+ {"version":3,"file":"actions.es.js","sources":["../src/state/actions.ts"],"sourcesContent":["import type { Operation } from 'ot-json0'\n\nimport type { Document } from './modules/read-only-documents'\nimport type { ComponentType } from './modules/react-components'\nimport type { Measurable, BoxModel } from './modules/box-models'\nimport type { ThunkAction } from 'redux-thunk'\nimport { ComponentMeta } from './modules/components-meta'\nimport { PropControllerDescriptor } from '../prop-controllers'\nimport type { Size } from './react-builder-preview'\nimport type { PropControllersHandle } from './modules/prop-controller-handles'\nimport type { PropControllerMessage } from '../prop-controllers/instances'\nimport type { PropController } from '../prop-controllers/base'\nimport type { APIResource, APIResourceType } from '../api/graphql/types'\nimport type { SerializedControl } from '../builder'\nimport { ElementImperativeHandle } from '../runtimes/react/element-imperative-handle'\nimport { BuilderEditMode } from './modules/builder-edit-mode'\nimport type { Point } from './modules/pointer'\nimport { Breakpoints } from './modules/breakpoints'\n\nexport const ActionTypes = {\n INIT: 'INIT',\n CLEAN_UP: 'CLEAN_UP',\n\n REGISTER_DOCUMENT: 'REGISTER_DOCUMENT',\n UNREGISTER_DOCUMENT: 'UNREGISTER_DOCUMENT',\n\n CHANGE_DOCUMENT: 'CHANGE_DOCUMENT',\n\n REGISTER_COMPONENT: 'REGISTER_COMPONENT',\n UNREGISTER_COMPONENT: 'UNREGISTER_COMPONENT',\n\n REGISTER_BUILDER_COMPONENT: 'REGISTER_BUILDER_COMPONENT',\n UNREGISTER_BUILDER_COMPONENT: 'UNREGISTER_BUILDER_COMPONENT',\n\n REGISTER_REACT_COMPONENT: 'REGISTER_REACT_COMPONENT',\n UNREGISTER_REACT_COMPONENT: 'UNREGISTER_REACT_COMPONENT',\n\n MOUNT_COMPONENT: 'MOUNT_COMPONENT',\n UNMOUNT_COMPONENT: 'UNMOUNT_COMPONENT',\n\n REGISTER_COMPONENT_HANDLE: 'REGISTER_COMPONENT_HANDLE',\n UNREGISTER_COMPONENT_HANDLE: 'UNREGISTER_COMPONENT_HANDLE',\n\n REGISTER_MEASURABLE: 'REGISTER_MEASURABLE',\n UNREGISTER_MEASURABLE: 'UNREGISTER_MEASURABLE',\n\n CHANGE_ELEMENT_BOX_MODELS: 'CHANGE_ELEMENT_BOX_MODELS',\n\n CHANGE_DOCUMENT_ELEMENT_SIZE: 'CHANGE_DOCUMENT_ELEMENT_SIZE',\n CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP: 'CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP',\n SCROLL_DOCUMENT_ELEMENT: 'SCROLL_DOCUMENT_ELEMENT',\n\n REGISTER_PROP_CONTROLLERS_HANDLE: 'REGISTER_PROP_CONTROLLERS_HANDLE',\n UNREGISTER_PROP_CONTROLLERS_HANDLE: 'UNREGISTER_PROP_CONTROLLERS_HANDLE',\n REGISTER_PROP_CONTROLLERS: 'REGISTER_PROP_CONTROLLERS',\n UNREGISTER_PROP_CONTROLLERS: 'UNREGISTER_PROP_CONTROLLERS',\n MESSAGE_HOST_PROP_CONTROLLER: 'MESSAGE_HOST_PROP_CONTROLLER',\n MESSAGE_BUILDER_PROP_CONTROLLER: 'MESSAGE_BUILDER_PROP_CONTROLLER',\n\n CHANGE_API_RESOURCE: 'CHANGE_API_RESOURCE',\n EVICT_API_RESOURCE: 'EVICT_API_RESOURCE',\n\n SET_IS_IN_BUILDER: 'SET_IS_IN_BUILDER',\n\n HANDLE_WHEEL: 'HANDLE_WHEEL',\n HANDLE_POINTER_MOVE: 'HANDLE_POINTER_MOVE',\n\n API_RESOURCE_FULFILLED: 'API_RESOURCE_FULFILLED',\n\n SET_BUILDER_EDIT_MODE: 'SET_BUILDER_EDIT_MODE',\n MAKESWIFT_CONNECTION_INIT: 'MAKESWIFT_CONNECTION_INIT',\n MAKESWIFT_CONNECTION_CHECK: 'MAKESWIFT_CONNECTION_CHECK',\n\n CHANGE_PATHNAME: 'CHANGE_PATHNAME',\n CHANGE_PATHNAME_START: 'CHANGE_PATHNAME_START',\n CHANGE_PATHNAME_COMPLETE: 'CHANGE_PATHNAME_COMPLETE',\n\n BUILDER_POINTER_MOVE: 'BUILDER_POINTER_MOVE',\n ELEMENT_FROM_POINT_CHANGE: 'ELEMENT_FROM_POINT_CHANGE',\n\n SET_BREAKPOINTS: 'SET_BREAKPOINTS',\n} as const\n\ntype InitAction = { type: typeof ActionTypes.INIT }\n\ntype CleanUpAction = { type: typeof ActionTypes.CLEAN_UP }\n\ntype RegisterDocumentAction = {\n type: typeof ActionTypes.REGISTER_DOCUMENT\n payload: { documentKey: string; document: Document }\n}\n\ntype UnregisterDocumentAction = {\n type: typeof ActionTypes.UNREGISTER_DOCUMENT\n payload: { documentKey: string }\n}\n\ntype ChangeDocumentAction = {\n type: typeof ActionTypes.CHANGE_DOCUMENT\n payload: { documentKey: string; operation: Operation }\n}\n\ntype RegisterComponentAction = {\n type: typeof ActionTypes.REGISTER_COMPONENT\n payload: {\n type: string\n meta: ComponentMeta\n propControllerDescriptors: Record<string, PropControllerDescriptor>\n }\n}\n\ntype UnregisterComponentAction = {\n type: typeof ActionTypes.UNREGISTER_COMPONENT\n payload: { type: string }\n}\n\ntype RegisterBuilderComponentAction = {\n type: typeof ActionTypes.REGISTER_BUILDER_COMPONENT\n payload: {\n type: string\n meta: ComponentMeta\n serializedControls: Record<string, SerializedControl>\n }\n}\n\ntype UnregisterBuilderComponentAction = {\n type: typeof ActionTypes.UNREGISTER_BUILDER_COMPONENT\n payload: { type: string }\n}\n\ntype RegisterReactComponentAction = {\n type: typeof ActionTypes.REGISTER_REACT_COMPONENT\n payload: { type: string; component: ComponentType }\n}\n\ntype UnregisterReactComponentAction = {\n type: typeof ActionTypes.UNREGISTER_REACT_COMPONENT\n payload: { type: string }\n}\n\ntype MountComponentAction = {\n type: typeof ActionTypes.MOUNT_COMPONENT\n payload: { documentKey: string; elementKey: string }\n}\n\ntype UnmountComponentAction = {\n type: typeof ActionTypes.UNMOUNT_COMPONENT\n payload: { documentKey: string; elementKey: string }\n}\n\ntype RegisterComponentHandleAction = {\n type: typeof ActionTypes.REGISTER_COMPONENT_HANDLE\n payload: { documentKey: string; elementKey: string; componentHandle: ElementImperativeHandle }\n}\n\ntype UnregisterComponentHandleAction = {\n type: typeof ActionTypes.UNREGISTER_COMPONENT_HANDLE\n payload: { documentKey: string; elementKey: string }\n}\n\ntype RegisterMeasurableAction = {\n type: typeof ActionTypes.REGISTER_MEASURABLE\n payload: { documentKey: string; elementKey: string; measurable: Measurable }\n}\n\ntype UnregisterMeasurableAction = {\n type: typeof ActionTypes.UNREGISTER_MEASURABLE\n payload: { documentKey: string; elementKey: string }\n}\n\ntype ChangeElementBoxModelsAction = {\n type: typeof ActionTypes.CHANGE_ELEMENT_BOX_MODELS\n payload: { changedElementBoxModels: Map<string, Map<string, BoxModel | null>> }\n}\n\ntype ChangeDocumentElementSizeAction = {\n type: typeof ActionTypes.CHANGE_DOCUMENT_ELEMENT_SIZE\n payload: { size: Size }\n}\n\ntype ChangeDocumentElementScrollTopAction = {\n type: typeof ActionTypes.CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP\n payload: { scrollTop: number }\n}\n\ntype ScrollDocumentElementAction = {\n type: typeof ActionTypes.SCROLL_DOCUMENT_ELEMENT\n payload: { scrollTopDelta: number }\n}\n\ntype RegisterPropControllersHandleAction = {\n type: typeof ActionTypes.REGISTER_PROP_CONTROLLERS_HANDLE\n payload: { documentKey: string; elementKey: string; handle: PropControllersHandle }\n}\n\ntype UnregisterPropControllersHandleAction = {\n type: typeof ActionTypes.UNREGISTER_PROP_CONTROLLERS_HANDLE\n payload: { documentKey: string; elementKey: string }\n}\n\ntype RegisterPropControllersAction = {\n type: typeof ActionTypes.REGISTER_PROP_CONTROLLERS\n payload: {\n documentKey: string\n elementKey: string\n propControllers: Record<string, PropController>\n }\n}\n\ntype UnregisterPropControllersAction = {\n type: typeof ActionTypes.UNREGISTER_PROP_CONTROLLERS\n payload: { documentKey: string; elementKey: string }\n}\n\ntype MessageHostPropControllerAction<T = PropControllerMessage> = {\n type: typeof ActionTypes.MESSAGE_HOST_PROP_CONTROLLER\n payload: { documentKey: string; elementKey: string; propName: string; message: T }\n}\n\ntype MessageBuilderPropControllerAction<T = PropControllerMessage> = {\n type: typeof ActionTypes.MESSAGE_BUILDER_PROP_CONTROLLER\n payload: { documentKey: string; elementKey: string; propName: string; message: T }\n}\n\ntype ChangeAPIResourceAction = {\n type: typeof ActionTypes.CHANGE_API_RESOURCE\n payload: { resource: APIResource }\n}\n\ntype EvictAPIResourceAction = {\n type: typeof ActionTypes.EVICT_API_RESOURCE\n payload: { id: string }\n}\n\ntype SetIsInBuilderAction = {\n type: typeof ActionTypes.SET_IS_IN_BUILDER\n payload: boolean\n}\n\ntype HandleWheelAction = {\n type: typeof ActionTypes.HANDLE_WHEEL\n payload: { deltaX: number; deltaY: number }\n}\n\ntype HandlePointerMoveAction = {\n type: typeof ActionTypes.HANDLE_POINTER_MOVE\n payload: { clientX: number; clientY: number }\n}\n\ntype APIResourceFulfilledAction = {\n type: typeof ActionTypes.API_RESOURCE_FULFILLED\n payload: { resourceType: APIResourceType; resourceId: string; resource: APIResource | null }\n}\n\ntype SetBuilderEditModeAction = {\n type: typeof ActionTypes.SET_BUILDER_EDIT_MODE\n payload: { editMode: BuilderEditMode }\n}\n\ntype ChangePathnameAction = {\n type: typeof ActionTypes.CHANGE_PATHNAME\n payload: { pathname: string }\n}\n\ntype ChangePathnameStartAction = {\n type: typeof ActionTypes.CHANGE_PATHNAME_START\n}\n\ntype ChangePathnameCompleteAction = {\n type: typeof ActionTypes.CHANGE_PATHNAME_COMPLETE\n}\n\ntype BuilderPointerMoveAction = {\n type: typeof ActionTypes.BUILDER_POINTER_MOVE\n payload: { pointer: Point | null }\n}\n\ntype ElementFromPointChangeAction = {\n type: typeof ActionTypes.ELEMENT_FROM_POINT_CHANGE\n payload: { keys: { documentKey: string; elementKey: string } | null }\n}\n\nexport type SetBreakpointsAction = {\n type: typeof ActionTypes.SET_BREAKPOINTS\n payload: { breakpoints: Breakpoints }\n}\n\nexport type Action =\n | InitAction\n | CleanUpAction\n | ChangeDocumentAction\n | RegisterDocumentAction\n | UnregisterDocumentAction\n | RegisterComponentAction\n | UnregisterComponentAction\n | RegisterBuilderComponentAction\n | UnregisterBuilderComponentAction\n | RegisterReactComponentAction\n | UnregisterReactComponentAction\n | MountComponentAction\n | UnmountComponentAction\n | RegisterComponentHandleAction\n | UnregisterComponentHandleAction\n | RegisterMeasurableAction\n | UnregisterMeasurableAction\n | ChangeElementBoxModelsAction\n | ChangeDocumentElementSizeAction\n | ChangeDocumentElementScrollTopAction\n | ScrollDocumentElementAction\n | RegisterPropControllersHandleAction\n | UnregisterPropControllersHandleAction\n | RegisterPropControllersAction\n | UnregisterPropControllersAction\n | MessageHostPropControllerAction\n | MessageBuilderPropControllerAction\n | ChangeAPIResourceAction\n | EvictAPIResourceAction\n | SetIsInBuilderAction\n | HandleWheelAction\n | HandlePointerMoveAction\n | APIResourceFulfilledAction\n | SetBuilderEditModeAction\n | ChangePathnameAction\n | ChangePathnameStartAction\n | ChangePathnameCompleteAction\n | BuilderPointerMoveAction\n | ElementFromPointChangeAction\n | SetBreakpointsAction\n\nexport function init(): InitAction {\n return { type: ActionTypes.INIT }\n}\n\nexport function cleanUp(): CleanUpAction {\n return { type: ActionTypes.CLEAN_UP }\n}\n\nexport function registerDocument(document: Document): RegisterDocumentAction {\n return { type: ActionTypes.REGISTER_DOCUMENT, payload: { documentKey: document.key, document } }\n}\n\nexport function unregisterDocument(documentKey: string): UnregisterDocumentAction {\n return { type: ActionTypes.UNREGISTER_DOCUMENT, payload: { documentKey } }\n}\n\nexport function registerDocumentEffect(\n document: Document,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerDocument(document))\n\n return () => {\n dispatch(unregisterDocument(document.key))\n }\n }\n}\n\nexport function changeDocument(documentKey: string, operation: Operation): ChangeDocumentAction {\n return { type: ActionTypes.CHANGE_DOCUMENT, payload: { documentKey, operation } }\n}\n\nexport function registerComponent(\n type: string,\n meta: ComponentMeta,\n propControllerDescriptors: Record<string, PropControllerDescriptor>,\n): RegisterComponentAction {\n return {\n type: ActionTypes.REGISTER_COMPONENT,\n payload: { type, meta, propControllerDescriptors },\n }\n}\n\nexport function unregisterComponent(type: string): UnregisterComponentAction {\n return { type: ActionTypes.UNREGISTER_COMPONENT, payload: { type } }\n}\n\nexport function registerComponentEffect(\n type: string,\n meta: ComponentMeta,\n propControllerDescriptors: Record<string, PropControllerDescriptor>,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerComponent(type, meta, propControllerDescriptors))\n\n return () => {\n dispatch(unregisterComponent(type))\n }\n }\n}\n\nexport function registerBuilderComponent(\n type: string,\n meta: ComponentMeta,\n serializedControls: Record<string, SerializedControl>,\n): RegisterBuilderComponentAction {\n return {\n type: ActionTypes.REGISTER_BUILDER_COMPONENT,\n payload: { type, meta, serializedControls },\n }\n}\n\nexport function unregisterBuilderComponent(type: string): UnregisterBuilderComponentAction {\n return { type: ActionTypes.UNREGISTER_BUILDER_COMPONENT, payload: { type } }\n}\n\nfunction registerReactComponent(\n type: string,\n component: ComponentType,\n): RegisterReactComponentAction {\n return { type: ActionTypes.REGISTER_REACT_COMPONENT, payload: { type, component } }\n}\n\nfunction unregisterReactComponent(type: string): UnregisterReactComponentAction {\n return { type: ActionTypes.UNREGISTER_REACT_COMPONENT, payload: { type } }\n}\n\nexport function registerReactComponentEffect(\n type: string,\n component: ComponentType,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerReactComponent(type, component))\n\n return () => {\n dispatch(unregisterReactComponent(type))\n }\n }\n}\n\nexport function mountComponent(documentKey: string, elementKey: string): MountComponentAction {\n return { type: ActionTypes.MOUNT_COMPONENT, payload: { documentKey, elementKey } }\n}\n\nexport function unmountComponent(documentKey: string, elementKey: string): UnmountComponentAction {\n return { type: ActionTypes.UNMOUNT_COMPONENT, payload: { documentKey, elementKey } }\n}\n\nexport function mountComponentEffect(\n documentKey: string,\n elementKey: string,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(mountComponent(documentKey, elementKey))\n\n return () => {\n dispatch(unmountComponent(documentKey, elementKey))\n }\n }\n}\n\nexport function registerComponentHandle(\n documentKey: string,\n elementKey: string,\n componentHandle: ElementImperativeHandle,\n): RegisterComponentHandleAction {\n return {\n type: ActionTypes.REGISTER_COMPONENT_HANDLE,\n payload: { documentKey, elementKey, componentHandle },\n }\n}\n\nfunction unregisterComponentHandle(\n documentKey: string,\n elementKey: string,\n): UnregisterComponentHandleAction {\n return { type: ActionTypes.UNREGISTER_COMPONENT_HANDLE, payload: { documentKey, elementKey } }\n}\n\nexport function registerComponentHandleEffect(\n documentKey: string,\n elementKey: string,\n componentHandle: ElementImperativeHandle,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerComponentHandle(documentKey, elementKey, componentHandle))\n\n return () => {\n dispatch(unregisterComponentHandle(documentKey, elementKey))\n }\n }\n}\n\nexport function registerMeasurable(\n documentKey: string,\n elementKey: string,\n measurable: Measurable,\n): RegisterMeasurableAction {\n return { type: ActionTypes.REGISTER_MEASURABLE, payload: { documentKey, elementKey, measurable } }\n}\n\nexport function unregisterMeasurable(\n documentKey: string,\n elementKey: string,\n): UnregisterMeasurableAction {\n return { type: ActionTypes.UNREGISTER_MEASURABLE, payload: { documentKey, elementKey } }\n}\n\nexport function registerMeasurableEffect(\n documentKey: string,\n elementKey: string,\n measurable: Measurable,\n): ThunkAction<() => void, unknown, unknown, Action> {\n return dispatch => {\n dispatch(registerMeasurable(documentKey, elementKey, measurable))\n\n return () => {\n dispatch(unregisterMeasurable(documentKey, elementKey))\n }\n }\n}\n\nexport function changeElementBoxModels(\n changedElementBoxModels: Map<string, Map<string, BoxModel | null>>,\n): ChangeElementBoxModelsAction {\n return { type: ActionTypes.CHANGE_ELEMENT_BOX_MODELS, payload: { changedElementBoxModels } }\n}\n\nexport function changeDocumentElementSize(size: Size): ChangeDocumentElementSizeAction {\n return { type: ActionTypes.CHANGE_DOCUMENT_ELEMENT_SIZE, payload: { size } }\n}\n\nexport function changeDocumentElementScrollTop(\n scrollTop: number,\n): ChangeDocumentElementScrollTopAction {\n return { type: ActionTypes.CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP, payload: { scrollTop } }\n}\n\nexport function scrollDocumentElement(scrollTopDelta: number): ScrollDocumentElementAction {\n return { type: ActionTypes.SCROLL_DOCUMENT_ELEMENT, payload: { scrollTopDelta } }\n}\n\nexport function registerPropControllersHandle(\n documentKey: string,\n elementKey: string,\n handle: PropControllersHandle,\n): RegisterPropControllersHandleAction {\n return {\n type: ActionTypes.REGISTER_PROP_CONTROLLERS_HANDLE,\n payload: { documentKey, elementKey, handle },\n }\n}\n\nexport function unregisterPropControllersHandle(\n documentKey: string,\n elementKey: string,\n): UnregisterPropControllersHandleAction {\n return {\n type: ActionTypes.UNREGISTER_PROP_CONTROLLERS_HANDLE,\n payload: { documentKey, elementKey },\n }\n}\n\nexport function registerPropControllers(\n documentKey: string,\n elementKey: string,\n propControllers: Record<string, PropController>,\n): RegisterPropControllersAction {\n return {\n type: ActionTypes.REGISTER_PROP_CONTROLLERS,\n payload: { documentKey, elementKey, propControllers },\n }\n}\n\nexport function unregisterPropControllers(\n documentKey: string,\n elementKey: string,\n): UnregisterPropControllersAction {\n return { type: ActionTypes.UNREGISTER_PROP_CONTROLLERS, payload: { documentKey, elementKey } }\n}\n\nexport function messageHostPropController<T>(\n documentKey: string,\n elementKey: string,\n propName: string,\n message: T,\n): MessageHostPropControllerAction<T> {\n return {\n type: ActionTypes.MESSAGE_HOST_PROP_CONTROLLER,\n payload: { documentKey, elementKey, propName, message },\n }\n}\n\nexport function messageBuilderPropController<T>(\n documentKey: string,\n elementKey: string,\n propName: string,\n message: T,\n): MessageBuilderPropControllerAction<T> {\n return {\n type: ActionTypes.MESSAGE_BUILDER_PROP_CONTROLLER,\n payload: { documentKey, elementKey, propName, message },\n }\n}\n\nexport function changeApiResource(resource: APIResource): ChangeAPIResourceAction {\n return { type: ActionTypes.CHANGE_API_RESOURCE, payload: { resource } }\n}\n\nexport function evictApiResource(id: string): EvictAPIResourceAction {\n return { type: ActionTypes.EVICT_API_RESOURCE, payload: { id } }\n}\n\nexport function setIsInBuilder(isInBuilder: boolean): SetIsInBuilderAction {\n return { type: ActionTypes.SET_IS_IN_BUILDER, payload: isInBuilder }\n}\n\nexport function handleWheel(payload: { deltaX: number; deltaY: number }): HandleWheelAction {\n return { type: ActionTypes.HANDLE_WHEEL, payload }\n}\n\nexport function handlePointerMove(payload: {\n clientX: number\n clientY: number\n}): HandlePointerMoveAction {\n return { type: ActionTypes.HANDLE_POINTER_MOVE, payload }\n}\n\nexport function apiResourceFulfilled(\n resourceType: APIResourceType,\n resourceId: string,\n resource: APIResource | null,\n): APIResourceFulfilledAction {\n return {\n type: ActionTypes.API_RESOURCE_FULFILLED,\n payload: { resourceType, resourceId, resource },\n }\n}\n\nexport function setBuilderEditMode(editMode: BuilderEditMode): SetBuilderEditModeAction {\n return {\n type: ActionTypes.SET_BUILDER_EDIT_MODE,\n payload: { editMode },\n }\n}\n\nexport function changePathname(pathname: string): ChangePathnameAction {\n return {\n type: ActionTypes.CHANGE_PATHNAME,\n payload: { pathname },\n }\n}\n\nexport function changePathnameStart(): ChangePathnameStartAction {\n return {\n type: ActionTypes.CHANGE_PATHNAME_START,\n }\n}\n\nexport function changePathnameComplete(): ChangePathnameCompleteAction {\n return {\n type: ActionTypes.CHANGE_PATHNAME_COMPLETE,\n }\n}\n\nexport function builderPointerMove(pointer: Point | null): BuilderPointerMoveAction {\n return { type: ActionTypes.BUILDER_POINTER_MOVE, payload: { pointer } }\n}\n\nexport function elementFromPointChange(\n keys: {\n documentKey: string\n elementKey: string\n } | null,\n): ElementFromPointChangeAction {\n return { type: ActionTypes.ELEMENT_FROM_POINT_CHANGE, payload: { keys } }\n}\n\nexport function setBreakpoints(breakpoints: Breakpoints): SetBreakpointsAction {\n return { type: ActionTypes.SET_BREAKPOINTS, payload: { breakpoints } }\n}\n"],"names":[],"mappings":"AAmBO,MAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,UAAU;AAAA,EAEV,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EAErB,iBAAiB;AAAA,EAEjB,oBAAoB;AAAA,EACpB,sBAAsB;AAAA,EAEtB,4BAA4B;AAAA,EAC5B,8BAA8B;AAAA,EAE9B,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAE5B,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EAEnB,2BAA2B;AAAA,EAC3B,6BAA6B;AAAA,EAE7B,qBAAqB;AAAA,EACrB,uBAAuB;AAAA,EAEvB,2BAA2B;AAAA,EAE3B,8BAA8B;AAAA,EAC9B,oCAAoC;AAAA,EACpC,yBAAyB;AAAA,EAEzB,kCAAkC;AAAA,EAClC,oCAAoC;AAAA,EACpC,2BAA2B;AAAA,EAC3B,6BAA6B;AAAA,EAC7B,8BAA8B;AAAA,EAC9B,iCAAiC;AAAA,EAEjC,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EAEpB,mBAAmB;AAAA,EAEnB,cAAc;AAAA,EACd,qBAAqB;AAAA,EAErB,wBAAwB;AAAA,EAExB,uBAAuB;AAAA,EACvB,2BAA2B;AAAA,EAC3B,4BAA4B;AAAA,EAE5B,iBAAiB;AAAA,EACjB,uBAAuB;AAAA,EACvB,0BAA0B;AAAA,EAE1B,sBAAsB;AAAA,EACtB,2BAA2B;AAAA,EAE3B,iBAAiB;AACnB;AAwPmC,gBAAA;AAC1B,SAAA,EAAE,MAAM,YAAY;AAC7B;AAE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ACA,UAC4B;AACrB,SAAA;AAAA,IACL,MAAM,YAAY;AAAA,IAClB,SAAS,EAAE,cAAc,YAAY,SAAS;AAAA,EAAA;AAElD;AAEO,4BAA4B,UAAqD;AAC/E,SAAA;AAAA,IACL,MAAM,YAAY;AAAA,IAClB,SAAS,EAAE,SAAS;AAAA,EAAA;AAExB;AAEO,wBAAwB,UAAwC;AAC9D,SAAA;AAAA,IACL,MAAM,YAAY;AAAA,IAClB,SAAS,EAAE,SAAS;AAAA,EAAA;AAExB;AAEiE,+BAAA;AACxD,SAAA;AAAA,IACL,MAAM,YAAY;AAAA,EAAA;AAEtB;AAEuE,kCAAA;AAC9D,SAAA;AAAA,IACL,MAAM,YAAY;AAAA,EAAA;AAEtB;AAEO,4BAA4B,SAAiD;AAClF,SAAO,EAAE,MAAM,YAAY,sBAAsB,SAAS,EAAE;AAC9D;AAEO,gCACL,MAI8B;AAC9B,SAAO,EAAE,MAAM,YAAY,2BAA2B,SAAS,EAAE;AACnE;AAEO,wBAAwB,aAAgD;AAC7E,SAAO,EAAE,MAAM,YAAY,iBAAiB,SAAS,EAAE;AACzD;;"}
@@ -3,9 +3,8 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
3
3
  var controlSerialization = require("./control-serialization.cjs.js");
4
4
  require("./combobox.cjs.js");
5
5
  require("./descriptors.cjs.js");
6
- require("slate");
7
- require("slate-react");
8
6
  require("./actions.cjs.js");
7
+ require("./slate.cjs2.js");
9
8
  exports.deserializeControl = controlSerialization.deserializeControl;
10
9
  exports.deserializeControls = controlSerialization.deserializeControls;
11
10
  exports.deserializeFunction = controlSerialization.deserializeFunction;
@@ -1 +1 @@
1
- {"version":3,"file":"builder.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"builder.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
@@ -1,7 +1,6 @@
1
1
  export { d as deserializeControl, b as deserializeControls, e as deserializeFunction, i as isSerializedFunction, s as serializeControl, a as serializeControls, c as serializeFunction } from "./control-serialization.es.js";
2
2
  import "./combobox.es.js";
3
3
  import "./descriptors.es.js";
4
- import "slate";
5
- import "slate-react";
6
4
  import "./actions.es.js";
5
+ import "./slate.es2.js";
7
6
  //# sourceMappingURL=builder.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"builder.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
1
+ {"version":3,"file":"builder.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -29,8 +29,7 @@ require("next/dynamic");
29
29
  require("@emotion/serialize");
30
30
  require("@emotion/utils");
31
31
  require("./descriptors.cjs.js");
32
- require("slate");
33
- require("slate-react");
32
+ require("./slate.cjs2.js");
34
33
  require("./text-input.cjs.js");
35
34
  require("./combobox.cjs.js");
36
35
  require("use-sync-external-store/shim");
@@ -41,8 +40,6 @@ require("./introspection.cjs.js");
41
40
  require("./state/breakpoints.cjs.js");
42
41
  require("color");
43
42
  require("scroll-into-view-if-needed");
44
- require("is-hotkey");
45
- require("slate-history");
46
43
  require("react-dom");
47
44
  require("html-react-parser");
48
45
  require("next/head");
@@ -59,6 +56,7 @@ require("next/link");
59
56
  require("framer-motion");
60
57
  require("@use-gesture/react");
61
58
  require("@popmotion/popcorn");
59
+ require("./useIsomorphicLayoutEffect.cjs.js");
62
60
  require("formik");
63
61
  require("next/image");
64
62
  require("./placeholders.cjs.js");
@@ -1 +1 @@
1
- {"version":3,"file":"components.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"components.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -27,8 +27,7 @@ import "next/dynamic";
27
27
  import "@emotion/serialize";
28
28
  import "@emotion/utils";
29
29
  import "./descriptors.es.js";
30
- import "slate";
31
- import "slate-react";
30
+ import "./slate.es2.js";
32
31
  import "./text-input.es.js";
33
32
  import "./combobox.es.js";
34
33
  import "use-sync-external-store/shim";
@@ -39,8 +38,6 @@ import "./introspection.es.js";
39
38
  import "./state/breakpoints.es.js";
40
39
  import "color";
41
40
  import "scroll-into-view-if-needed";
42
- import "is-hotkey";
43
- import "slate-history";
44
41
  import "react-dom";
45
42
  import "html-react-parser";
46
43
  import "next/head";
@@ -57,6 +54,7 @@ import "next/link";
57
54
  import "framer-motion";
58
55
  import "@use-gesture/react";
59
56
  import "@popmotion/popcorn";
57
+ import "./useIsomorphicLayoutEffect.es.js";
60
58
  import "formik";
61
59
  import "next/image";
62
60
  import "./placeholders.es.js";
@@ -1 +1 @@
1
- {"version":3,"file":"components.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"components.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.cjs.js","sources":["../src/state/modules/read-only-documents.ts","../src/state/modules/react-components.tsx","../src/state/modules/components-meta.ts","../src/state/modules/prop-controllers.ts","../src/state/modules/prop-controller-handles.ts","../src/state/modules/is-in-builder.ts","../src/state/modules/is-preview.ts","../src/state/react-page.ts","../src/components/builtin/constants.ts"],"sourcesContent":["import { Action, ActionTypes } from '../actions'\n\nexport type Data = undefined | null | boolean | number | string | Data[] | { [key: string]: Data }\n\nexport type ElementData = { type: string; key: string; props: Record<string, Data> }\n\nexport type ElementReference = { type: 'reference'; key: string; value: string }\n\nexport type Element = ElementData | ElementReference\n\nexport function isElementReference(element: Element): element is ElementReference {\n return !('props' in element)\n}\n\nexport type DocumentReference = {\n key: string\n}\n\nexport function createDocumentReference(key: string): DocumentReference {\n return { key }\n}\n\nexport type Document = {\n key: string\n rootElement: Element\n}\n\nexport function createDocument(key: string, rootElement: Element): Document {\n return { key, rootElement }\n}\n\nexport type State = Map<string, Document>\n\nexport function getInitialState({\n rootElements = new Map(),\n}: { rootElements?: Map<string, Element> } = {}): State {\n const initialState = new Map()\n\n rootElements.forEach((rootElement, documentKey) => {\n initialState.set(documentKey, createDocument(documentKey, rootElement))\n })\n\n return initialState\n}\n\nexport function getDocuments(state: State): Map<string, Document> {\n return state\n}\n\nexport function getDocument(state: State, documentKey: string): Document | null {\n return getDocuments(state).get(documentKey) ?? null\n}\n\nexport function reducer(state: State = getInitialState(), action: Action): State {\n switch (action.type) {\n case ActionTypes.REGISTER_DOCUMENT:\n return new Map(state).set(action.payload.documentKey, action.payload.document)\n\n case ActionTypes.UNREGISTER_DOCUMENT: {\n const nextState = new Map(state)\n\n const deleted = nextState.delete(action.payload.documentKey)\n\n return deleted ? nextState : state\n }\n\n default:\n return state\n }\n}\n","import type { Component, PropsWithoutRef, ReactElement, RefAttributes } from 'react'\n\nimport { Action, ActionTypes } from '../actions'\n\nexport type ComponentType<P = Record<string, any>, T = any> =\n | { new (props: PropsWithoutRef<P> & RefAttributes<T>, context?: any): Component<P> }\n | ((props: PropsWithoutRef<P> & RefAttributes<T>, context?: any) => ReactElement<any, any> | null)\n\nexport type State = Map<string, ComponentType>\n\nexport function getInitialState({\n reactComponents = new Map(),\n}: { reactComponents?: Map<string, ComponentType> } = {}): State {\n return reactComponents\n}\n\nfunction getReactComponents(state: State): Map<string, ComponentType> {\n return state\n}\n\nexport function getReactComponent(state: State, type: string): ComponentType | null {\n return getReactComponents(state).get(type) ?? null\n}\n\nexport function reducer(state: State = getInitialState(), action: Action) {\n switch (action.type) {\n case ActionTypes.REGISTER_REACT_COMPONENT:\n return new Map(state).set(action.payload.type, action.payload.component)\n\n case ActionTypes.UNREGISTER_REACT_COMPONENT: {\n const nextState = new Map(state)\n\n const deleted = nextState.delete(action.payload.type)\n\n return deleted ? nextState : state\n }\n\n default:\n return state\n }\n}\n","import { Action, ActionTypes } from '../actions'\n\nexport type ComponentIcon =\n | 'Carousel40'\n | 'Code40'\n | 'Countdown40'\n | 'Cube40'\n | 'Divider40'\n | 'Form40'\n | 'Navigation40'\n | 'SocialLinks40'\n | 'Video40'\n\nexport type ComponentMeta = { label: string; icon: ComponentIcon; hidden: boolean }\n\nexport type State = Map<string, ComponentMeta>\n\nexport function getInitialState({\n componentsMeta = new Map(),\n}: { componentsMeta?: Map<string, ComponentMeta> } = {}): State {\n return componentsMeta\n}\n\nexport function getComponentsMeta(state: State): Map<string, ComponentMeta> {\n return state\n}\n\nexport function reducer(state: State = getInitialState(), action: Action): State {\n switch (action.type) {\n case ActionTypes.REGISTER_COMPONENT:\n return new Map(state).set(action.payload.type, action.payload.meta)\n\n case ActionTypes.UNREGISTER_COMPONENT: {\n const nextState = new Map(state)\n\n const deleted = nextState.delete(action.payload.type)\n\n return deleted ? nextState : state\n }\n\n default:\n return state\n }\n}\n","import { Action, ActionTypes } from '../actions'\nimport { PropControllerDescriptor } from '../../prop-controllers'\n\nexport type { PropControllerDescriptor }\n\nexport type State = Map<string, Record<string, PropControllerDescriptor>>\n\nexport function getInitialState({\n propControllerDescriptors = new Map(),\n}: {\n propControllerDescriptors?: Map<string, Record<string, PropControllerDescriptor>>\n} = {}): State {\n return propControllerDescriptors\n}\n\nexport function getPropControllerDescriptors(\n state: State,\n): Map<string, Record<string, PropControllerDescriptor>> {\n return state\n}\n\nexport function getComponentPropControllerDescriptors(\n state: State,\n componentType: string,\n): Record<string, PropControllerDescriptor> | null {\n return getPropControllerDescriptors(state).get(componentType) ?? null\n}\n\nexport function reducer(state: State = getInitialState(), action: Action): State {\n switch (action.type) {\n case ActionTypes.REGISTER_COMPONENT:\n return new Map(state).set(action.payload.type, action.payload.propControllerDescriptors)\n\n case ActionTypes.UNREGISTER_COMPONENT: {\n const nextState = new Map(state)\n\n const deleted = nextState.delete(action.payload.type)\n\n return deleted ? nextState : state\n }\n\n default:\n return state\n }\n}\n","import { Action, ActionTypes } from '../actions'\nimport type { DescriptorsPropControllers, PropController } from '../../prop-controllers/instances'\nimport type { Descriptor } from '../../prop-controllers/descriptors'\n\nexport interface PropControllersHandle<\n T extends Record<string, Descriptor> = Record<string, Descriptor>,\n> {\n setPropControllers(propControllers: DescriptorsPropControllers<T> | null): void\n}\n\nexport function isPropControllersHandle(value: unknown): value is PropControllersHandle {\n if (\n typeof value === 'object' &&\n value !== null &&\n 'setPropControllers' in value &&\n typeof (value as { setPropControllers: unknown }).setPropControllers === 'function'\n ) {\n return true\n }\n\n return false\n}\n\nexport type State = {\n handles: Map<string, Map<string, PropControllersHandle>>\n instances: Map<string, Map<string, Record<string, PropController>>>\n}\n\nexport function getInitialState(): State {\n return { handles: new Map(), instances: new Map() }\n}\n\nexport function getPropControllersHandle(\n state: State,\n documentKey: string,\n elementKey: string,\n): PropControllersHandle | null {\n return state.handles.get(documentKey)?.get(elementKey) ?? null\n}\n\nexport function getPropControllers(\n state: State,\n documentKey: string,\n elementKey: string,\n): Record<string, PropController> | null {\n return state.instances.get(documentKey)?.get(elementKey) ?? null\n}\n\nexport function getPropController(\n state: State,\n documentKey: string,\n elementKey: string,\n propName: string,\n): PropController | null {\n return getPropControllers(state, documentKey, elementKey)?.[propName] ?? null\n}\n\nexport function reducer(state: State = getInitialState(), action: Action): State {\n switch (action.type) {\n case ActionTypes.REGISTER_PROP_CONTROLLERS_HANDLE: {\n const { documentKey, elementKey, handle } = action.payload\n\n return {\n ...state,\n handles: new Map(state.handles).set(\n documentKey,\n new Map(state.handles.get(documentKey) ?? []).set(elementKey, handle),\n ),\n }\n }\n\n case ActionTypes.UNREGISTER_PROP_CONTROLLERS_HANDLE: {\n const { documentKey, elementKey } = action.payload\n const nextHandles = new Map(state.handles.get(documentKey) ?? [])\n\n const deleted = nextHandles.delete(elementKey)\n\n return deleted\n ? { ...state, handles: new Map(state.handles).set(documentKey, nextHandles) }\n : state\n }\n\n case ActionTypes.REGISTER_PROP_CONTROLLERS: {\n const { documentKey, elementKey, propControllers } = action.payload\n\n return {\n ...state,\n instances: new Map(state.instances).set(\n documentKey,\n new Map(state.instances.get(documentKey) ?? []).set(elementKey, propControllers),\n ),\n }\n }\n\n case ActionTypes.UNREGISTER_PROP_CONTROLLERS: {\n const { documentKey, elementKey } = action.payload\n const nextInstances = new Map(state.instances.get(documentKey) ?? [])\n\n const deleted = nextInstances.delete(elementKey)\n\n return deleted\n ? { ...state, instances: new Map(state.instances).set(documentKey, nextInstances) }\n : state\n }\n\n default:\n return state\n }\n}\n","import { Action, ActionTypes } from '../actions'\n\nexport type State = boolean\n\nexport function getInitialState(): State {\n return false\n}\n\nexport function getIsInBuilder(state: State): boolean {\n return state\n}\n\nexport function reducer(state: State = getInitialState(), action: Action): State {\n switch (action.type) {\n case ActionTypes.SET_IS_IN_BUILDER:\n return action.payload\n\n default:\n return state\n }\n}\n","import { Action } from '../actions'\n\nexport type State = boolean\n\nexport function getInitialState(isPreview = false): State {\n return isPreview\n}\n\nexport function getIsPreview(state: State): boolean {\n return state\n}\n\nexport function reducer(state = getInitialState(), action: Action): State {\n switch (action.type) {\n default:\n return state\n }\n}\n","import {\n applyMiddleware,\n combineReducers,\n createStore,\n PreloadedState,\n Store as ReduxStore,\n} from 'redux'\nimport thunk, { ThunkDispatch } from 'redux-thunk'\n\nimport * as Documents from './modules/read-only-documents'\nimport * as ReactComponents from './modules/react-components'\nimport * as ComponentsMeta from './modules/components-meta'\nimport * as PropControllers from './modules/prop-controllers'\nimport * as PropControllerHandles from './modules/prop-controller-handles'\nimport * as IsInBuilder from './modules/is-in-builder'\nimport * as IsPreview from './modules/is-preview'\nimport * as BuilderEditMode from './modules/builder-edit-mode'\nimport * as Breakpoints from './modules/breakpoints'\nimport * as Introspection from '../prop-controllers/introspection'\nimport { Action } from './actions'\nimport { copyElementReference } from '../prop-controllers/copy'\nimport { copy as copyFromControl } from '../controls/control'\n\nexport type {\n Data,\n Document,\n DocumentReference,\n Element,\n ElementData,\n ElementReference,\n} from './modules/read-only-documents'\nexport {\n createDocument,\n createDocumentReference,\n isElementReference,\n} from './modules/read-only-documents'\nexport type { ComponentType } from './modules/react-components'\n\nconst reducer = combineReducers({\n documents: Documents.reducer,\n reactComponents: ReactComponents.reducer,\n componentsMeta: ComponentsMeta.reducer,\n propControllers: PropControllers.reducer,\n propControllerHandles: PropControllerHandles.reducer,\n isInBuilder: IsInBuilder.reducer,\n isPreview: IsPreview.reducer,\n builderEditMode: BuilderEditMode.reducer,\n breakpoints: Breakpoints.reducer,\n})\n\nexport type State = ReturnType<typeof reducer>\n\nfunction getDocumentsStateSlice(state: State): Documents.State {\n return state.documents\n}\n\nexport function getDocument(state: State, documentKey: string): Documents.Document | null {\n return Documents.getDocument(getDocumentsStateSlice(state), documentKey)\n}\n\nfunction getReactComponentsStateSlice(state: State): ReactComponents.State {\n return state.reactComponents\n}\n\nexport function getReactComponent(\n state: State,\n type: string,\n): ReactComponents.ComponentType | null {\n return ReactComponents.getReactComponent(getReactComponentsStateSlice(state), type)\n}\n\nfunction getPropControllersStateSlice(state: State): PropControllers.State {\n return state.propControllers\n}\n\nexport function getPropControllerDescriptors(\n state: State,\n): Map<string, Record<string, PropControllers.PropControllerDescriptor>> {\n return PropControllers.getPropControllerDescriptors(getPropControllersStateSlice(state))\n}\n\nexport function getComponentPropControllerDescriptors(\n state: State,\n componentType: string,\n): Record<string, PropControllers.PropControllerDescriptor> | null {\n return PropControllers.getComponentPropControllerDescriptors(\n getPropControllersStateSlice(state),\n componentType,\n )\n}\n\nfunction getPropControllerHandlesStateSlice(state: State): PropControllerHandles.State {\n return state.propControllerHandles\n}\n\nexport function getPropControllers(state: State, documentKey: string, elementKey: string) {\n return PropControllerHandles.getPropControllers(\n getPropControllerHandlesStateSlice(state),\n documentKey,\n elementKey,\n )\n}\n\nfunction normalizeElement(\n element: Documents.Element,\n descriptors: Map<string, Record<string, PropControllers.PropControllerDescriptor>>,\n): Map<string, Documents.Element> {\n const elements = new Map<string, Documents.Element>()\n const remaining = [element]\n let current: Documents.Element | undefined\n\n while ((current = remaining.pop())) {\n elements.set(current.key, current)\n\n if (Documents.isElementReference(current)) continue\n\n const elementDescriptors = descriptors.get(current.type)\n\n if (elementDescriptors == null) continue\n\n const parent = current\n const children = Object.entries(elementDescriptors).reduce((acc, [propName, descriptor]) => {\n return [...acc, ...Introspection.getElementChildren(descriptor, parent.props[propName])]\n }, [] as Documents.Element[])\n\n remaining.push(...children)\n }\n\n return elements\n}\n\nfunction getDocumentElements(state: State, documentKey: string): Map<string, Documents.Element> {\n const document = getDocument(state, documentKey)\n const descriptors = getPropControllerDescriptors(state)\n\n if (document == null) return new Map()\n\n return normalizeElement(document.rootElement, descriptors)\n}\n\n/**\n * Returns all document keys sorted by depth, i.e., parent documents come before child documents.\n *\n * @todo Make this selector more efficient.\n */\nexport function getDocumentKeysSortedByDepth(state: State): string[] {\n const documents = Documents.getDocuments(getDocumentsStateSlice(state))\n const keys = Array.from(documents.keys())\n\n if (keys.length < 2) return keys\n\n const elements = new Map<string, Map<string, Documents.Element>>()\n\n keys.forEach(key => {\n elements.set(key, getDocumentElements(state, key))\n })\n\n keys.sort((a, b) => (elements.get(a)?.has(b) ? -1 : 1))\n\n return keys\n}\n\nexport function getElement(\n state: State,\n documentKey: string,\n elementKey: string,\n): Documents.Element | null {\n return getDocumentElements(state, documentKey).get(elementKey) ?? null\n}\n\nexport function getElementPropControllerDescriptors(\n state: State,\n documentKey: string,\n elementKey: string,\n): Record<string, PropControllers.PropControllerDescriptor> | null {\n const element = getElement(state, documentKey, elementKey)\n\n if (element == null || Documents.isElementReference(element)) return null\n\n return getComponentPropControllerDescriptors(state, element.type)\n}\n\nexport function getElementId(state: State, documentKey: string, elementKey: string): string | null {\n const element = getElement(state, documentKey, elementKey)\n\n if (element == null || Documents.isElementReference(element)) return null\n\n const descriptors = getComponentPropControllerDescriptors(state, element.type)\n\n if (descriptors == null) return null\n\n const elementId = Object.entries(descriptors).reduce((acc, [propName, descriptor]) => {\n if (acc != null) return acc\n\n return Introspection.getElementId(descriptor, element.props[propName])\n }, null as string | null)\n\n return elementId\n}\n\nexport type ReplacementContext = {\n elementHtmlIds: Set<string>\n elementKeys: Map<string, string>\n swatchIds: Map<string, string>\n fileIds: Map<string, string>\n typographyIds: Map<string, string>\n tableIds: Map<string, string>\n tableColumnIds: Map<string, string>\n pageIds: Map<string, string>\n globalElementIds: Map<string, string>\n globalElementData: Map<string, Documents.ElementData>\n}\n\nexport type SerializableReplacementContext = {\n elementHtmlIds: string[]\n elementKeys: { [s: string]: string }\n swatchIds: { [s: string]: string }\n fileIds: { [s: string]: string }\n typographyIds: { [s: string]: string }\n tableIds: { [s: string]: string }\n tableColumnIds: { [s: string]: string }\n pageIds: { [s: string]: string }\n globalElementIds: { [s: string]: string }\n globalElementData: { [s: string]: Documents.ElementData }\n}\n\nexport function createReplacementContext(\n serializableReplacementContext: SerializableReplacementContext,\n): ReplacementContext {\n const rc: ReplacementContext = {\n elementHtmlIds: new Set(serializableReplacementContext.elementHtmlIds),\n elementKeys: new Map(\n serializableReplacementContext.elementKeys &&\n Object.entries(serializableReplacementContext.elementKeys),\n ),\n swatchIds: new Map(\n serializableReplacementContext.swatchIds &&\n Object.entries(serializableReplacementContext.swatchIds),\n ),\n fileIds: new Map(\n serializableReplacementContext.fileIds &&\n Object.entries(serializableReplacementContext.fileIds),\n ),\n typographyIds: new Map(\n serializableReplacementContext.typographyIds &&\n Object.entries(serializableReplacementContext.typographyIds),\n ),\n tableIds: new Map(\n serializableReplacementContext.tableIds &&\n Object.entries(serializableReplacementContext.tableIds),\n ),\n tableColumnIds: new Map(\n serializableReplacementContext.tableColumnIds &&\n Object.entries(serializableReplacementContext.tableColumnIds),\n ),\n pageIds: new Map(\n serializableReplacementContext.pageIds &&\n Object.entries(serializableReplacementContext.pageIds),\n ),\n globalElementIds: new Map(\n serializableReplacementContext.globalElementIds &&\n Object.entries(serializableReplacementContext.globalElementIds),\n ),\n globalElementData: new Map(\n serializableReplacementContext.globalElementData &&\n Object.entries(serializableReplacementContext.globalElementData),\n ),\n }\n\n return rc\n}\n\nexport type CopyContext = {\n replacementContext: ReplacementContext\n copyElement: (node: Documents.Element) => Documents.Element\n}\n\nexport function copyElementTree(\n state: State,\n elementTree: Documents.ElementData,\n replacementContext: SerializableReplacementContext,\n) {\n /*\n * This is structured a bit weird.\n *\n * This is done so that we can pass a callable function into some of the copy functions\n * themselves, to enable mutual recursion.\n *\n * Consider the slot control. It has to iterate through its elements, and for each of them,\n * call some version of the below function.\n *\n * That is how the recursing through the tree happens.\n */\n function copyElementTreeNode(state: State, replacementContext: ReplacementContext) {\n return function (node: Documents.Element) {\n const context = {\n replacementContext,\n copyElement: copyElementTreeNode(state, replacementContext),\n }\n\n if (Documents.isElementReference(node)) {\n return { ...node, value: copyElementReference(node.value, context) }\n }\n\n const descriptors = getComponentPropControllerDescriptors(state, node.type)\n\n if (descriptors == null) return node\n\n for (const [propKey, descriptor] of Object.entries(descriptors)) {\n node.props[propKey] = copyFromControl(descriptor, node.props[propKey], context)\n }\n\n return node\n }\n }\n\n const copy = JSON.parse(JSON.stringify(elementTree)) as Documents.ElementData\n\n return copyElementTreeNode(state, createReplacementContext(replacementContext))(copy)\n}\n\nexport function getIsInBuilder(state: State): boolean {\n return state.isInBuilder\n}\n\nexport function getIsPreview(state: State): boolean {\n return IsPreview.getIsPreview(state.isPreview)\n}\n\nexport function getBuilderEditMode(state: State): BuilderEditMode.State {\n return state.builderEditMode\n}\n\nexport function getBreakpoints(state: State): Breakpoints.State {\n return state.breakpoints\n}\n\nexport type Dispatch = ThunkDispatch<State, unknown, Action>\n\nexport type Store = ReduxStore<State, Action> & { dispatch: Dispatch }\n\nexport function configureStore({\n rootElements,\n preloadedState,\n breakpoints,\n}: {\n rootElements?: Map<string, Documents.Element>\n preloadedState?: PreloadedState<State>\n breakpoints?: Breakpoints.State\n} = {}): Store {\n return createStore(\n reducer,\n {\n ...preloadedState,\n documents: Documents.getInitialState({ rootElements }),\n breakpoints: Breakpoints.getInitialState(breakpoints ?? preloadedState?.breakpoints),\n },\n applyMiddleware(thunk),\n )\n}\n","/**\n * These are the element types that have been used since the beginning of Makeswift and are saved in\n * the database.\n */\nexport const MakeswiftComponentType = {\n Box: './components/Box/index.js',\n Button: './components/Button/index.js',\n Carousel: './components/Carousel/index.js',\n Countdown: './components/Countdown/index.js',\n Divider: './components/Divider/index.js',\n Embed: './components/Embed/index.js',\n Form: './components/Form/index.js',\n Image: './components/Image/index.js',\n Navigation: './components/Navigation/index.js',\n Root: './components/Root/index.js',\n SocialLinks: './components/SocialLinks/index.js',\n Text: './components/Text/index.js',\n Video: './components/Video/index.js',\n} as const\n"],"names":["getInitialState","ActionTypes","reactComponents","Map","state","type","getReactComponents","get","action","REGISTER_REACT_COMPONENT","set","payload","component","UNREGISTER_REACT_COMPONENT","nextState","deleted","delete","getPropControllerDescriptors","getPropControllers","combineReducers","Documents.reducer","ReactComponents.reducer","ComponentsMeta.reducer","PropControllers.reducer","PropControllerHandles.reducer","IsInBuilder.reducer","IsPreview.reducer","BuilderEditMode.reducer","Breakpoints.reducer","Documents.getDocument","ReactComponents.getReactComponent","PropControllers.getPropControllerDescriptors","PropControllers.getComponentPropControllerDescriptors","PropControllerHandles.getPropControllers","Documents.isElementReference","Introspection.getElementChildren","Documents.getDocuments","Introspection.getElementId","copyElementReference","descriptors","copyFromControl","IsPreview.getIsPreview","createStore","Documents.getInitialState","Breakpoints.getInitialState","applyMiddleware","thunk"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUO,4BAA4B,SAA+C;AAChF,SAAO,CAAa,YAAA;AACtB;AAMO,iCAAiC,KAAgC;AACtE,SAAO,EAAE,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AAK,MAAM,KAAK,UAAU,WAAW,CAAC;AAEnD,SAAO,oBAAoB,OAAO,yBAAyB,kBAAkB,CAAC,EAAE,IAAI;AACtF;AAEO,wBAAwB,OAAuB;AACpD,SAAO,MAAM;AACf;AAEO,sBAAsB,OAAuB;AAC3C,SAAAC,eAAuB,MAAM,SAAS;AAC/C;AAEO,4BAA4B,OAAqC;AACtE,SAAO,MAAM;AACf;AAEO,wBAAwB,OAAiC;AAC9D,SAAO,MAAM;AACf;AAM+B,wBAAA;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,IAKE,IAAW;AACb,SAAOC,MAAAA,YACL,SACA,iCACK,iBADL;AAAA,IAEE,WAAWC,kBAA0B,EAAE,cAAc;AAAA,IACrD,aAAaC,kBAA4B,gBAAA,oCAAe,iDAAgB,WAAW;AAAA,EAAA,IAErFC,MAAgB,gBAAAC,eAAK,UAAA,CACvB;AACF;ACnWO,MAAM,yBAAyB;AAAA,EACpC,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,aAAa;AAAA,EACb,MAAM;AAAA,EACN,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"constants.cjs.js","sources":["../src/state/modules/read-only-documents.ts","../src/state/modules/react-components.tsx","../src/state/modules/components-meta.ts","../src/state/modules/prop-controllers.ts","../src/state/modules/prop-controller-handles.ts","../src/state/modules/is-in-builder.ts","../src/state/modules/is-preview.ts","../src/state/react-page.ts","../src/components/builtin/constants.ts"],"sourcesContent":["import { Action, ActionTypes } from '../actions'\n\nexport type Data = undefined | null | boolean | number | string | Data[] | { [key: string]: Data }\n\nexport type ElementData = { type: string; key: string; props: Record<string, Data> }\n\nexport type ElementReference = { type: 'reference'; key: string; value: string }\n\nexport type Element = ElementData | ElementReference\n\nexport function isElementReference(element: Element): element is ElementReference {\n return !('props' in element)\n}\n\nexport type DocumentReference = {\n key: string\n}\n\nexport function createDocumentReference(key: string): DocumentReference {\n return { key }\n}\n\nexport type Document = {\n key: string\n rootElement: Element\n}\n\nexport function createDocument(key: string, rootElement: Element): Document {\n return { key, rootElement }\n}\n\nexport type State = Map<string, Document>\n\nexport function getInitialState({\n rootElements = new Map(),\n}: { rootElements?: Map<string, Element> } = {}): State {\n const initialState = new Map()\n\n rootElements.forEach((rootElement, documentKey) => {\n initialState.set(documentKey, createDocument(documentKey, rootElement))\n })\n\n return initialState\n}\n\nexport function getDocuments(state: State): Map<string, Document> {\n return state\n}\n\nexport function getDocument(state: State, documentKey: string): Document | null {\n return getDocuments(state).get(documentKey) ?? null\n}\n\nexport function reducer(state: State = getInitialState(), action: Action): State {\n switch (action.type) {\n case ActionTypes.REGISTER_DOCUMENT:\n return new Map(state).set(action.payload.documentKey, action.payload.document)\n\n case ActionTypes.UNREGISTER_DOCUMENT: {\n const nextState = new Map(state)\n\n const deleted = nextState.delete(action.payload.documentKey)\n\n return deleted ? nextState : state\n }\n\n default:\n return state\n }\n}\n","import type { Component, PropsWithoutRef, ReactElement, RefAttributes } from 'react'\n\nimport { Action, ActionTypes } from '../actions'\n\nexport type ComponentType<P = Record<string, any>, T = any> =\n | { new (props: PropsWithoutRef<P> & RefAttributes<T>, context?: any): Component<P> }\n | ((props: PropsWithoutRef<P> & RefAttributes<T>, context?: any) => ReactElement<any, any> | null)\n\nexport type State = Map<string, ComponentType>\n\nexport function getInitialState({\n reactComponents = new Map(),\n}: { reactComponents?: Map<string, ComponentType> } = {}): State {\n return reactComponents\n}\n\nfunction getReactComponents(state: State): Map<string, ComponentType> {\n return state\n}\n\nexport function getReactComponent(state: State, type: string): ComponentType | null {\n return getReactComponents(state).get(type) ?? null\n}\n\nexport function reducer(state: State = getInitialState(), action: Action) {\n switch (action.type) {\n case ActionTypes.REGISTER_REACT_COMPONENT:\n return new Map(state).set(action.payload.type, action.payload.component)\n\n case ActionTypes.UNREGISTER_REACT_COMPONENT: {\n const nextState = new Map(state)\n\n const deleted = nextState.delete(action.payload.type)\n\n return deleted ? nextState : state\n }\n\n default:\n return state\n }\n}\n","import { Action, ActionTypes } from '../actions'\n\nexport type ComponentIcon =\n | 'Carousel40'\n | 'Code40'\n | 'Countdown40'\n | 'Cube40'\n | 'Divider40'\n | 'Form40'\n | 'Navigation40'\n | 'SocialLinks40'\n | 'Video40'\n\nexport type ComponentMeta = { label: string; icon: ComponentIcon; hidden: boolean }\n\nexport type State = Map<string, ComponentMeta>\n\nexport function getInitialState({\n componentsMeta = new Map(),\n}: { componentsMeta?: Map<string, ComponentMeta> } = {}): State {\n return componentsMeta\n}\n\nexport function getComponentsMeta(state: State): Map<string, ComponentMeta> {\n return state\n}\n\nexport function reducer(state: State = getInitialState(), action: Action): State {\n switch (action.type) {\n case ActionTypes.REGISTER_COMPONENT:\n return new Map(state).set(action.payload.type, action.payload.meta)\n\n case ActionTypes.UNREGISTER_COMPONENT: {\n const nextState = new Map(state)\n\n const deleted = nextState.delete(action.payload.type)\n\n return deleted ? nextState : state\n }\n\n default:\n return state\n }\n}\n","import { Action, ActionTypes } from '../actions'\nimport { PropControllerDescriptor } from '../../prop-controllers'\n\nexport type { PropControllerDescriptor }\n\nexport type State = Map<string, Record<string, PropControllerDescriptor>>\n\nexport function getInitialState({\n propControllerDescriptors = new Map(),\n}: {\n propControllerDescriptors?: Map<string, Record<string, PropControllerDescriptor>>\n} = {}): State {\n return propControllerDescriptors\n}\n\nexport function getPropControllerDescriptors(\n state: State,\n): Map<string, Record<string, PropControllerDescriptor>> {\n return state\n}\n\nexport function getComponentPropControllerDescriptors(\n state: State,\n componentType: string,\n): Record<string, PropControllerDescriptor> | null {\n return getPropControllerDescriptors(state).get(componentType) ?? null\n}\n\nexport function reducer(state: State = getInitialState(), action: Action): State {\n switch (action.type) {\n case ActionTypes.REGISTER_COMPONENT:\n return new Map(state).set(action.payload.type, action.payload.propControllerDescriptors)\n\n case ActionTypes.UNREGISTER_COMPONENT: {\n const nextState = new Map(state)\n\n const deleted = nextState.delete(action.payload.type)\n\n return deleted ? nextState : state\n }\n\n default:\n return state\n }\n}\n","import { Action, ActionTypes } from '../actions'\nimport type { DescriptorsPropControllers } from '../../prop-controllers/instances'\nimport { PropController } from '../../prop-controllers/base'\nimport type { Descriptor } from '../../prop-controllers/descriptors'\n\nexport interface PropControllersHandle<\n T extends Record<string, Descriptor> = Record<string, Descriptor>,\n> {\n setPropControllers(propControllers: DescriptorsPropControllers<T> | null): void\n}\n\nexport function isPropControllersHandle(value: unknown): value is PropControllersHandle {\n if (\n typeof value === 'object' &&\n value !== null &&\n 'setPropControllers' in value &&\n typeof (value as { setPropControllers: unknown }).setPropControllers === 'function'\n ) {\n return true\n }\n\n return false\n}\n\nexport type State = {\n handles: Map<string, Map<string, PropControllersHandle>>\n instances: Map<string, Map<string, Record<string, PropController>>>\n}\n\nexport function getInitialState(): State {\n return { handles: new Map(), instances: new Map() }\n}\n\nexport function getPropControllersHandle(\n state: State,\n documentKey: string,\n elementKey: string,\n): PropControllersHandle | null {\n return state.handles.get(documentKey)?.get(elementKey) ?? null\n}\n\nexport function getPropControllers(\n state: State,\n documentKey: string,\n elementKey: string,\n): Record<string, PropController> | null {\n return state.instances.get(documentKey)?.get(elementKey) ?? null\n}\n\nexport function getPropController(\n state: State,\n documentKey: string,\n elementKey: string,\n propName: string,\n): PropController | null {\n return getPropControllers(state, documentKey, elementKey)?.[propName] ?? null\n}\n\nexport function reducer(state: State = getInitialState(), action: Action): State {\n switch (action.type) {\n case ActionTypes.REGISTER_PROP_CONTROLLERS_HANDLE: {\n const { documentKey, elementKey, handle } = action.payload\n\n return {\n ...state,\n handles: new Map(state.handles).set(\n documentKey,\n new Map(state.handles.get(documentKey) ?? []).set(elementKey, handle),\n ),\n }\n }\n\n case ActionTypes.UNREGISTER_PROP_CONTROLLERS_HANDLE: {\n const { documentKey, elementKey } = action.payload\n const nextHandles = new Map(state.handles.get(documentKey) ?? [])\n\n const deleted = nextHandles.delete(elementKey)\n\n return deleted\n ? { ...state, handles: new Map(state.handles).set(documentKey, nextHandles) }\n : state\n }\n\n case ActionTypes.REGISTER_PROP_CONTROLLERS: {\n const { documentKey, elementKey, propControllers } = action.payload\n\n return {\n ...state,\n instances: new Map(state.instances).set(\n documentKey,\n new Map(state.instances.get(documentKey) ?? []).set(elementKey, propControllers),\n ),\n }\n }\n\n case ActionTypes.UNREGISTER_PROP_CONTROLLERS: {\n const { documentKey, elementKey } = action.payload\n const nextInstances = new Map(state.instances.get(documentKey) ?? [])\n\n const deleted = nextInstances.delete(elementKey)\n\n return deleted\n ? { ...state, instances: new Map(state.instances).set(documentKey, nextInstances) }\n : state\n }\n\n default:\n return state\n }\n}\n","import { Action, ActionTypes } from '../actions'\n\nexport type State = boolean\n\nexport function getInitialState(): State {\n return false\n}\n\nexport function getIsInBuilder(state: State): boolean {\n return state\n}\n\nexport function reducer(state: State = getInitialState(), action: Action): State {\n switch (action.type) {\n case ActionTypes.SET_IS_IN_BUILDER:\n return action.payload\n\n default:\n return state\n }\n}\n","import { Action } from '../actions'\n\nexport type State = boolean\n\nexport function getInitialState(isPreview = false): State {\n return isPreview\n}\n\nexport function getIsPreview(state: State): boolean {\n return state\n}\n\nexport function reducer(state = getInitialState(), action: Action): State {\n switch (action.type) {\n default:\n return state\n }\n}\n","import {\n applyMiddleware,\n combineReducers,\n createStore,\n PreloadedState,\n Store as ReduxStore,\n} from 'redux'\nimport thunk, { ThunkDispatch } from 'redux-thunk'\n\nimport * as Documents from './modules/read-only-documents'\nimport * as ReactComponents from './modules/react-components'\nimport * as ComponentsMeta from './modules/components-meta'\nimport * as PropControllers from './modules/prop-controllers'\nimport * as PropControllerHandles from './modules/prop-controller-handles'\nimport * as IsInBuilder from './modules/is-in-builder'\nimport * as IsPreview from './modules/is-preview'\nimport * as BuilderEditMode from './modules/builder-edit-mode'\nimport * as Breakpoints from './modules/breakpoints'\nimport * as Introspection from '../prop-controllers/introspection'\nimport { Action } from './actions'\nimport { copyElementReference } from '../prop-controllers/copy'\nimport { copy as copyFromControl } from '../controls/control'\n\nexport type {\n Data,\n Document,\n DocumentReference,\n Element,\n ElementData,\n ElementReference,\n} from './modules/read-only-documents'\nexport {\n createDocument,\n createDocumentReference,\n isElementReference,\n} from './modules/read-only-documents'\nexport type { ComponentType } from './modules/react-components'\n\nconst reducer = combineReducers({\n documents: Documents.reducer,\n reactComponents: ReactComponents.reducer,\n componentsMeta: ComponentsMeta.reducer,\n propControllers: PropControllers.reducer,\n propControllerHandles: PropControllerHandles.reducer,\n isInBuilder: IsInBuilder.reducer,\n isPreview: IsPreview.reducer,\n builderEditMode: BuilderEditMode.reducer,\n breakpoints: Breakpoints.reducer,\n})\n\nexport type State = ReturnType<typeof reducer>\n\nfunction getDocumentsStateSlice(state: State): Documents.State {\n return state.documents\n}\n\nexport function getDocument(state: State, documentKey: string): Documents.Document | null {\n return Documents.getDocument(getDocumentsStateSlice(state), documentKey)\n}\n\nfunction getReactComponentsStateSlice(state: State): ReactComponents.State {\n return state.reactComponents\n}\n\nexport function getReactComponent(\n state: State,\n type: string,\n): ReactComponents.ComponentType | null {\n return ReactComponents.getReactComponent(getReactComponentsStateSlice(state), type)\n}\n\nfunction getPropControllersStateSlice(state: State): PropControllers.State {\n return state.propControllers\n}\n\nexport function getPropControllerDescriptors(\n state: State,\n): Map<string, Record<string, PropControllers.PropControllerDescriptor>> {\n return PropControllers.getPropControllerDescriptors(getPropControllersStateSlice(state))\n}\n\nexport function getComponentPropControllerDescriptors(\n state: State,\n componentType: string,\n): Record<string, PropControllers.PropControllerDescriptor> | null {\n return PropControllers.getComponentPropControllerDescriptors(\n getPropControllersStateSlice(state),\n componentType,\n )\n}\n\nfunction getPropControllerHandlesStateSlice(state: State): PropControllerHandles.State {\n return state.propControllerHandles\n}\n\nexport function getPropControllers(state: State, documentKey: string, elementKey: string) {\n return PropControllerHandles.getPropControllers(\n getPropControllerHandlesStateSlice(state),\n documentKey,\n elementKey,\n )\n}\n\nfunction normalizeElement(\n element: Documents.Element,\n descriptors: Map<string, Record<string, PropControllers.PropControllerDescriptor>>,\n): Map<string, Documents.Element> {\n const elements = new Map<string, Documents.Element>()\n const remaining = [element]\n let current: Documents.Element | undefined\n\n while ((current = remaining.pop())) {\n elements.set(current.key, current)\n\n if (Documents.isElementReference(current)) continue\n\n const elementDescriptors = descriptors.get(current.type)\n\n if (elementDescriptors == null) continue\n\n const parent = current\n const children = Object.entries(elementDescriptors).reduce((acc, [propName, descriptor]) => {\n return [...acc, ...Introspection.getElementChildren(descriptor, parent.props[propName])]\n }, [] as Documents.Element[])\n\n remaining.push(...children)\n }\n\n return elements\n}\n\nfunction getDocumentElements(state: State, documentKey: string): Map<string, Documents.Element> {\n const document = getDocument(state, documentKey)\n const descriptors = getPropControllerDescriptors(state)\n\n if (document == null) return new Map()\n\n return normalizeElement(document.rootElement, descriptors)\n}\n\n/**\n * Returns all document keys sorted by depth, i.e., parent documents come before child documents.\n *\n * @todo Make this selector more efficient.\n */\nexport function getDocumentKeysSortedByDepth(state: State): string[] {\n const documents = Documents.getDocuments(getDocumentsStateSlice(state))\n const keys = Array.from(documents.keys())\n\n if (keys.length < 2) return keys\n\n const elements = new Map<string, Map<string, Documents.Element>>()\n\n keys.forEach(key => {\n elements.set(key, getDocumentElements(state, key))\n })\n\n keys.sort((a, b) => (elements.get(a)?.has(b) ? -1 : 1))\n\n return keys\n}\n\nexport function getElement(\n state: State,\n documentKey: string,\n elementKey: string,\n): Documents.Element | null {\n return getDocumentElements(state, documentKey).get(elementKey) ?? null\n}\n\nexport function getElementPropControllerDescriptors(\n state: State,\n documentKey: string,\n elementKey: string,\n): Record<string, PropControllers.PropControllerDescriptor> | null {\n const element = getElement(state, documentKey, elementKey)\n\n if (element == null || Documents.isElementReference(element)) return null\n\n return getComponentPropControllerDescriptors(state, element.type)\n}\n\nexport function getElementId(state: State, documentKey: string, elementKey: string): string | null {\n const element = getElement(state, documentKey, elementKey)\n\n if (element == null || Documents.isElementReference(element)) return null\n\n const descriptors = getComponentPropControllerDescriptors(state, element.type)\n\n if (descriptors == null) return null\n\n const elementId = Object.entries(descriptors).reduce((acc, [propName, descriptor]) => {\n if (acc != null) return acc\n\n return Introspection.getElementId(descriptor, element.props[propName])\n }, null as string | null)\n\n return elementId\n}\n\nexport type ReplacementContext = {\n elementHtmlIds: Set<string>\n elementKeys: Map<string, string>\n swatchIds: Map<string, string>\n fileIds: Map<string, string>\n typographyIds: Map<string, string>\n tableIds: Map<string, string>\n tableColumnIds: Map<string, string>\n pageIds: Map<string, string>\n globalElementIds: Map<string, string>\n globalElementData: Map<string, Documents.ElementData>\n}\n\nexport type SerializableReplacementContext = {\n elementHtmlIds: string[]\n elementKeys: { [s: string]: string }\n swatchIds: { [s: string]: string }\n fileIds: { [s: string]: string }\n typographyIds: { [s: string]: string }\n tableIds: { [s: string]: string }\n tableColumnIds: { [s: string]: string }\n pageIds: { [s: string]: string }\n globalElementIds: { [s: string]: string }\n globalElementData: { [s: string]: Documents.ElementData }\n}\n\nexport function createReplacementContext(\n serializableReplacementContext: SerializableReplacementContext,\n): ReplacementContext {\n const rc: ReplacementContext = {\n elementHtmlIds: new Set(serializableReplacementContext.elementHtmlIds),\n elementKeys: new Map(\n serializableReplacementContext.elementKeys &&\n Object.entries(serializableReplacementContext.elementKeys),\n ),\n swatchIds: new Map(\n serializableReplacementContext.swatchIds &&\n Object.entries(serializableReplacementContext.swatchIds),\n ),\n fileIds: new Map(\n serializableReplacementContext.fileIds &&\n Object.entries(serializableReplacementContext.fileIds),\n ),\n typographyIds: new Map(\n serializableReplacementContext.typographyIds &&\n Object.entries(serializableReplacementContext.typographyIds),\n ),\n tableIds: new Map(\n serializableReplacementContext.tableIds &&\n Object.entries(serializableReplacementContext.tableIds),\n ),\n tableColumnIds: new Map(\n serializableReplacementContext.tableColumnIds &&\n Object.entries(serializableReplacementContext.tableColumnIds),\n ),\n pageIds: new Map(\n serializableReplacementContext.pageIds &&\n Object.entries(serializableReplacementContext.pageIds),\n ),\n globalElementIds: new Map(\n serializableReplacementContext.globalElementIds &&\n Object.entries(serializableReplacementContext.globalElementIds),\n ),\n globalElementData: new Map(\n serializableReplacementContext.globalElementData &&\n Object.entries(serializableReplacementContext.globalElementData),\n ),\n }\n\n return rc\n}\n\nexport type CopyContext = {\n replacementContext: ReplacementContext\n copyElement: (node: Documents.Element) => Documents.Element\n}\n\nexport function copyElementTree(\n state: State,\n elementTree: Documents.ElementData,\n replacementContext: SerializableReplacementContext,\n) {\n /*\n * This is structured a bit weird.\n *\n * This is done so that we can pass a callable function into some of the copy functions\n * themselves, to enable mutual recursion.\n *\n * Consider the slot control. It has to iterate through its elements, and for each of them,\n * call some version of the below function.\n *\n * That is how the recursing through the tree happens.\n */\n function copyElementTreeNode(state: State, replacementContext: ReplacementContext) {\n return function (node: Documents.Element) {\n const context = {\n replacementContext,\n copyElement: copyElementTreeNode(state, replacementContext),\n }\n\n if (Documents.isElementReference(node)) {\n return { ...node, value: copyElementReference(node.value, context) }\n }\n\n const descriptors = getComponentPropControllerDescriptors(state, node.type)\n\n if (descriptors == null) return node\n\n for (const [propKey, descriptor] of Object.entries(descriptors)) {\n node.props[propKey] = copyFromControl(descriptor, node.props[propKey], context)\n }\n\n return node\n }\n }\n\n const copy = JSON.parse(JSON.stringify(elementTree)) as Documents.ElementData\n\n return copyElementTreeNode(state, createReplacementContext(replacementContext))(copy)\n}\n\nexport function getIsInBuilder(state: State): boolean {\n return state.isInBuilder\n}\n\nexport function getIsPreview(state: State): boolean {\n return IsPreview.getIsPreview(state.isPreview)\n}\n\nexport function getBuilderEditMode(state: State): BuilderEditMode.State {\n return state.builderEditMode\n}\n\nexport function getBreakpoints(state: State): Breakpoints.State {\n return state.breakpoints\n}\n\nexport type Dispatch = ThunkDispatch<State, unknown, Action>\n\nexport type Store = ReduxStore<State, Action> & { dispatch: Dispatch }\n\nexport function configureStore({\n rootElements,\n preloadedState,\n breakpoints,\n}: {\n rootElements?: Map<string, Documents.Element>\n preloadedState?: PreloadedState<State>\n breakpoints?: Breakpoints.State\n} = {}): Store {\n return createStore(\n reducer,\n {\n ...preloadedState,\n documents: Documents.getInitialState({ rootElements }),\n breakpoints: Breakpoints.getInitialState(breakpoints ?? preloadedState?.breakpoints),\n },\n applyMiddleware(thunk),\n )\n}\n","/**\n * These are the element types that have been used since the beginning of Makeswift and are saved in\n * the database.\n */\nexport const MakeswiftComponentType = {\n Box: './components/Box/index.js',\n Button: './components/Button/index.js',\n Carousel: './components/Carousel/index.js',\n Countdown: './components/Countdown/index.js',\n Divider: './components/Divider/index.js',\n Embed: './components/Embed/index.js',\n Form: './components/Form/index.js',\n Image: './components/Image/index.js',\n Navigation: './components/Navigation/index.js',\n Root: './components/Root/index.js',\n SocialLinks: './components/SocialLinks/index.js',\n Text: './components/Text/index.js',\n Video: './components/Video/index.js',\n} as const\n"],"names":["getInitialState","ActionTypes","reactComponents","Map","state","type","getReactComponents","get","action","REGISTER_REACT_COMPONENT","set","payload","component","UNREGISTER_REACT_COMPONENT","nextState","deleted","delete","getPropControllerDescriptors","getPropControllers","combineReducers","Documents.reducer","ReactComponents.reducer","ComponentsMeta.reducer","PropControllers.reducer","PropControllerHandles.reducer","IsInBuilder.reducer","IsPreview.reducer","BuilderEditMode.reducer","Breakpoints.reducer","Documents.getDocument","ReactComponents.getReactComponent","PropControllers.getPropControllerDescriptors","PropControllers.getComponentPropControllerDescriptors","PropControllerHandles.getPropControllers","Documents.isElementReference","Introspection.getElementChildren","Documents.getDocuments","Introspection.getElementId","copyElementReference","descriptors","copyFromControl","IsPreview.getIsPreview","createStore","Documents.getInitialState","Breakpoints.getInitialState","applyMiddleware","thunk"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUO,4BAA4B,SAA+C;AAChF,SAAO,CAAa,YAAA;AACtB;AAMO,iCAAiC,KAAgC;AACtE,SAAO,EAAE,IAAI;AACf;AAO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