@makeswift/runtime 0.5.5 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Box.cjs.js +11 -6
- package/dist/Box.cjs.js.map +1 -1
- package/dist/Box.es.js +12 -7
- package/dist/Box.es.js.map +1 -1
- package/dist/Button.cjs.js +2 -1
- package/dist/Button.cjs.js.map +1 -1
- package/dist/Button.es.js +2 -1
- package/dist/Button.es.js.map +1 -1
- package/dist/Carousel.cjs.js +2 -1
- package/dist/Carousel.cjs.js.map +1 -1
- package/dist/Carousel.es.js +2 -1
- package/dist/Carousel.es.js.map +1 -1
- package/dist/Countdown.cjs.js +2 -1
- package/dist/Countdown.cjs.js.map +1 -1
- package/dist/Countdown.es.js +2 -1
- package/dist/Countdown.es.js.map +1 -1
- package/dist/Divider.cjs.js +2 -1
- package/dist/Divider.cjs.js.map +1 -1
- package/dist/Divider.es.js +2 -1
- package/dist/Divider.es.js.map +1 -1
- package/dist/EditableText.cjs.js +359 -0
- package/dist/EditableText.cjs.js.map +1 -0
- package/dist/EditableText.es.js +352 -0
- package/dist/EditableText.es.js.map +1 -0
- package/dist/Embed.cjs.js +2 -1
- package/dist/Embed.cjs.js.map +1 -1
- package/dist/Embed.es.js +2 -1
- package/dist/Embed.es.js.map +1 -1
- package/dist/Form.cjs.js +73 -67
- package/dist/Form.cjs.js.map +1 -1
- package/dist/Form.es.js +73 -67
- package/dist/Form.es.js.map +1 -1
- package/dist/Image.cjs.js +2 -1
- package/dist/Image.cjs.js.map +1 -1
- package/dist/Image.es.js +2 -1
- package/dist/Image.es.js.map +1 -1
- package/dist/LiveProvider.cjs.js +3 -11
- package/dist/LiveProvider.cjs.js.map +1 -1
- package/dist/LiveProvider.es.js +6 -14
- package/dist/LiveProvider.es.js.map +1 -1
- package/dist/Navigation.cjs.js +2 -1
- package/dist/Navigation.cjs.js.map +1 -1
- package/dist/Navigation.es.js +2 -1
- package/dist/Navigation.es.js.map +1 -1
- package/dist/PreviewProvider.cjs.js +6 -3
- package/dist/PreviewProvider.cjs.js.map +1 -1
- package/dist/PreviewProvider.es.js +8 -5
- package/dist/PreviewProvider.es.js.map +1 -1
- package/dist/ReadOnlyText.cjs.js +206 -0
- package/dist/ReadOnlyText.cjs.js.map +1 -0
- package/dist/ReadOnlyText.es.js +204 -0
- package/dist/ReadOnlyText.es.js.map +1 -0
- package/dist/Root.cjs.js +4 -3
- package/dist/Root.cjs.js.map +1 -1
- package/dist/Root.es.js +3 -2
- package/dist/Root.es.js.map +1 -1
- package/dist/SocialLinks.cjs.js +2 -1
- package/dist/SocialLinks.cjs.js.map +1 -1
- package/dist/SocialLinks.es.js +2 -1
- package/dist/SocialLinks.es.js.map +1 -1
- package/dist/Text.cjs.js +26 -405
- package/dist/Text.cjs.js.map +1 -1
- package/dist/Text.es.js +23 -405
- package/dist/Text.es.js.map +1 -1
- package/dist/Video.cjs.js +2 -1
- package/dist/Video.cjs.js.map +1 -1
- package/dist/Video.es.js +2 -1
- package/dist/Video.es.js.map +1 -1
- package/dist/actions.cjs.js.map +1 -1
- package/dist/actions.es.js.map +1 -1
- package/dist/components.cjs.js +2 -5
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +2 -5
- package/dist/components.es.js.map +1 -1
- package/dist/constants.cjs.js +45 -26
- package/dist/constants.cjs.js.map +1 -1
- package/dist/constants.es.js +36 -20
- package/dist/constants.es.js.map +1 -1
- package/dist/index.cjs.js +78 -310
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs2.js +20 -21
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs5.js +141 -0
- package/dist/index.cjs5.js.map +1 -0
- package/dist/index.es.js +77 -308
- package/dist/index.es.js.map +1 -1
- package/dist/index.es2.js +23 -24
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es3.js +1 -1
- package/dist/index.es5.js +139 -0
- package/dist/index.es5.js.map +1 -0
- package/dist/next.cjs.js +2 -1
- package/dist/next.cjs.js.map +1 -1
- package/dist/next.es.js +3 -2
- package/dist/next.es.js.map +1 -1
- package/dist/react.cjs.js +2 -1
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.es.js +2 -1
- package/dist/react.es.js.map +1 -1
- package/dist/types/src/api/react.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Box/Box.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Box/animations.d.ts +1 -1
- package/dist/types/src/components/builtin/Box/animations.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/EditableText.d.ts +16 -0
- package/dist/types/src/components/builtin/Text/EditableText.d.ts.map +1 -0
- package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts +11 -0
- package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -0
- package/dist/types/src/components/builtin/Text/Text.d.ts +3 -7
- package/dist/types/src/components/builtin/Text/Text.d.ts.map +1 -1
- package/dist/types/src/components/builtin/register.d.ts.map +1 -1
- package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts.map +1 -1
- package/dist/types/src/next/document.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/components/LiveProvider.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/element-imperative-handle.d.ts +12 -0
- package/dist/types/src/runtimes/react/element-imperative-handle.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/find-dom-node.d.ts +1 -1
- package/dist/types/src/runtimes/react/find-dom-node.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/index.d.ts +4 -2
- package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
- package/dist/types/src/state/actions.d.ts +4 -3
- package/dist/types/src/state/actions.d.ts.map +1 -1
- package/dist/types/src/state/modules/is-preview.d.ts +6 -0
- package/dist/types/src/state/modules/is-preview.d.ts.map +1 -0
- package/dist/types/src/state/react-builder-preview.d.ts +1 -0
- package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
- package/dist/types/src/state/react-page.d.ts +2 -0
- package/dist/types/src/state/react-page.d.ts.map +1 -1
- package/package.json +4 -1
package/dist/actions.cjs.js.map
CHANGED
|
@@ -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, Typography } from '../api/graphql/types'\nimport type { SerializedControl } from '../builder'\nimport { IntrospectedResourcesQueryResult } from '../api/graphql/generated/types'\nimport { IntrospectedResourceIds } from '../api/introspection'\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 INTROSPECTED_RESOURCES_FULFILLED: 'INTROSPECTED_RESOURCES_FULFILLED',\n TYPOGRAPHIES_FULFILLED: 'TYPOGRAPHIES_FULFILLED',\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: unknown }\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 IntrospectedResourcesFulfilled = {\n type: typeof ActionTypes.INTROSPECTED_RESOURCES_FULFILLED\n payload: {\n introspectedResourceIds: IntrospectedResourceIds\n introspectedResources: IntrospectedResourcesQueryResult\n }\n}\n\ntype TypographiesFulfilledAction = {\n type: typeof ActionTypes.TYPOGRAPHIES_FULFILLED\n payload: { typographyIds: string[]; typographies: (Typography | null)[] }\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 | IntrospectedResourcesFulfilled\n | TypographiesFulfilledAction\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: unknown,\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: unknown,\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 typographiesFulfilled(\n typographyIds: string[],\n typographies: (Typography | null)[],\n): TypographiesFulfilledAction {\n return { type: ActionTypes.TYPOGRAPHIES_FULFILLED, payload: { typographyIds, typographies } }\n}\n\nexport function introspectedResourcesFulfilled(\n introspectedResourceIds: IntrospectedResourceIds,\n introspectedResources: IntrospectedResourcesQueryResult,\n): IntrospectedResourcesFulfilled {\n return {\n type: ActionTypes.INTROSPECTED_RESOURCES_FULFILLED,\n payload: { introspectedResourceIds, introspectedResources },\n }\n}\n"],"names":[],"mappings":";AAgBO,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,EACxB,kCAAkC;AAAA,EAClC,wBAAwB;AAC1B;AA+NmC,gBAAA;AAC1B,SAAA,EAAE,MAAM,YAAY;AAC7B;AAEyC,mBAAA;AAChC,SAAA,EAAE,MAAM,YAAY;AAC7B;AAEO,0BAA0B,UAA4C;AACpE,SAAA,EAAE,MAAM,YAAY,mBAAmB,SAAS,EAAE,aA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cAC6B;AACtB,SAAA,EAAE,MAAM,YAAY,wBAAwB,SAAS,EAAE,eAAe;AAC/E;AAEO,wCACL,yBACA,uBACgC;AACzB,SAAA;AAAA,IACL,MAAM,YAAY;AAAA,IAClB,SAAS,EAAE,yBAAyB,sBAAsB;AAAA,EAAA;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
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, Typography } from '../api/graphql/types'\nimport type { SerializedControl } from '../builder'\nimport { IntrospectedResourcesQueryResult } from '../api/graphql/generated/types'\nimport { IntrospectedResourceIds } from '../api/introspection'\nimport { ElementImperativeHandle } from '../runtimes/react/element-imperative-handle'\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 INTROSPECTED_RESOURCES_FULFILLED: 'INTROSPECTED_RESOURCES_FULFILLED',\n TYPOGRAPHIES_FULFILLED: 'TYPOGRAPHIES_FULFILLED',\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 IntrospectedResourcesFulfilled = {\n type: typeof ActionTypes.INTROSPECTED_RESOURCES_FULFILLED\n payload: {\n introspectedResourceIds: IntrospectedResourceIds\n introspectedResources: IntrospectedResourcesQueryResult\n }\n}\n\ntype TypographiesFulfilledAction = {\n type: typeof ActionTypes.TYPOGRAPHIES_FULFILLED\n payload: { typographyIds: string[]; typographies: (Typography | null)[] }\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 | IntrospectedResourcesFulfilled\n | TypographiesFulfilledAction\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 typographiesFulfilled(\n typographyIds: string[],\n typographies: (Typography | null)[],\n): TypographiesFulfilledAction {\n return { type: ActionTypes.TYPOGRAPHIES_FULFILLED, payload: { typographyIds, typographies } }\n}\n\nexport function introspectedResourcesFulfilled(\n introspectedResourceIds: IntrospectedResourceIds,\n introspectedResources: IntrospectedResourcesQueryResult,\n): IntrospectedResourcesFulfilled {\n return {\n type: ActionTypes.INTROSPECTED_RESOURCES_FULFILLED,\n payload: { introspectedResourceIds, introspectedResources },\n }\n}\n"],"names":[],"mappings":";AAiBO,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,EACxB,kCAAkC;AAAA,EAClC,wBAAwB;AAC1B;AA+NmC,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,+BACL,eACA,cAC6B;AACtB,SAAA,EAAE,MAAM,YAAY,wBAAwB,SAAS,EAAE,eAAe;AAC/E;AAEO,wCACL,yBACA,uBACgC;AACzB,SAAA;AAAA,IACL,MAAM,YAAY;AAAA,IAClB,SAAS,EAAE,yBAAyB,sBAAsB;AAAA,EAAA;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/actions.es.js.map
CHANGED
|
@@ -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, Typography } from '../api/graphql/types'\nimport type { SerializedControl } from '../builder'\nimport { IntrospectedResourcesQueryResult } from '../api/graphql/generated/types'\nimport { IntrospectedResourceIds } from '../api/introspection'\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 INTROSPECTED_RESOURCES_FULFILLED: 'INTROSPECTED_RESOURCES_FULFILLED',\n TYPOGRAPHIES_FULFILLED: 'TYPOGRAPHIES_FULFILLED',\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: unknown }\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 IntrospectedResourcesFulfilled = {\n type: typeof ActionTypes.INTROSPECTED_RESOURCES_FULFILLED\n payload: {\n introspectedResourceIds: IntrospectedResourceIds\n introspectedResources: IntrospectedResourcesQueryResult\n }\n}\n\ntype TypographiesFulfilledAction = {\n type: typeof ActionTypes.TYPOGRAPHIES_FULFILLED\n payload: { typographyIds: string[]; typographies: (Typography | null)[] }\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 | IntrospectedResourcesFulfilled\n | TypographiesFulfilledAction\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: unknown,\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: unknown,\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 typographiesFulfilled(\n typographyIds: string[],\n typographies: (Typography | null)[],\n): TypographiesFulfilledAction {\n return { type: ActionTypes.TYPOGRAPHIES_FULFILLED, payload: { typographyIds, typographies } }\n}\n\nexport function introspectedResourcesFulfilled(\n introspectedResourceIds: IntrospectedResourceIds,\n introspectedResources: IntrospectedResourcesQueryResult,\n): IntrospectedResourcesFulfilled {\n return {\n type: ActionTypes.INTROSPECTED_RESOURCES_FULFILLED,\n payload: { introspectedResourceIds, introspectedResources },\n }\n}\n"],"names":[],"mappings":"AAgBO,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,E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ACnD;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,+BACL,eACA,cAC6B;AACtB,SAAA,EAAE,MAAM,YAAY,wBAAwB,SAAS,EAAE,eAAe;AAC/E;AAEO,wCACL,yBACA,uBACgC;AACzB,SAAA;AAAA,IACL,MAAM,YAAY;AAAA,IAClB,SAAS,EAAE,yBAAyB,sBAAsB;AAAA,EAAA;AAE9D;;"}
|
|
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, Typography } from '../api/graphql/types'\nimport type { SerializedControl } from '../builder'\nimport { IntrospectedResourcesQueryResult } from '../api/graphql/generated/types'\nimport { IntrospectedResourceIds } from '../api/introspection'\nimport { ElementImperativeHandle } from '../runtimes/react/element-imperative-handle'\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 INTROSPECTED_RESOURCES_FULFILLED: 'INTROSPECTED_RESOURCES_FULFILLED',\n TYPOGRAPHIES_FULFILLED: 'TYPOGRAPHIES_FULFILLED',\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 IntrospectedResourcesFulfilled = {\n type: typeof ActionTypes.INTROSPECTED_RESOURCES_FULFILLED\n payload: {\n introspectedResourceIds: IntrospectedResourceIds\n introspectedResources: IntrospectedResourcesQueryResult\n }\n}\n\ntype TypographiesFulfilledAction = {\n type: typeof ActionTypes.TYPOGRAPHIES_FULFILLED\n payload: { typographyIds: string[]; typographies: (Typography | null)[] }\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 | IntrospectedResourcesFulfilled\n | TypographiesFulfilledAction\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 typographiesFulfilled(\n typographyIds: string[],\n typographies: (Typography | null)[],\n): TypographiesFulfilledAction {\n return { type: ActionTypes.TYPOGRAPHIES_FULFILLED, payload: { typographyIds, typographies } }\n}\n\nexport function introspectedResourcesFulfilled(\n introspectedResourceIds: IntrospectedResourceIds,\n introspectedResources: IntrospectedResourcesQueryResult,\n): IntrospectedResourcesFulfilled {\n return {\n type: ActionTypes.INTROSPECTED_RESOURCES_FULFILLED,\n payload: { introspectedResourceIds, introspectedResources },\n }\n}\n"],"names":[],"mappings":"AAiBO,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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AS,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,+BACL,eACA,cAC6B;AACtB,SAAA,EAAE,MAAM,YAAY,wBAAwB,SAAS,EAAE,eAAe;AAC/E;AAEO,wCACL,yBACA,uBACgC;AACzB,SAAA;AAAA,IACL,MAAM,YAAY;AAAA,IAClB,SAAS,EAAE,yBAAyB,sBAAsB;AAAA,EAAA;AAE9D;;"}
|
package/dist/components.cjs.js
CHANGED
|
@@ -25,12 +25,13 @@ require("css-box-model");
|
|
|
25
25
|
require("./actions.cjs.js");
|
|
26
26
|
require("use-sync-external-store/shim/with-selector");
|
|
27
27
|
require("next/dynamic");
|
|
28
|
+
require("@emotion/serialize");
|
|
29
|
+
require("@emotion/utils");
|
|
28
30
|
require("./slot.cjs.js");
|
|
29
31
|
require("./text-input.cjs.js");
|
|
30
32
|
require("./combobox.cjs.js");
|
|
31
33
|
require("./control.cjs.js");
|
|
32
34
|
require("use-sync-external-store/shim");
|
|
33
|
-
require("slate");
|
|
34
35
|
require("redux");
|
|
35
36
|
require("redux-thunk");
|
|
36
37
|
require("./types.cjs.js");
|
|
@@ -60,10 +61,6 @@ require("./next-version.cjs.js");
|
|
|
60
61
|
require("next/package.json");
|
|
61
62
|
require("./index.cjs4.js");
|
|
62
63
|
require("polished");
|
|
63
|
-
require("slate-hotkeys");
|
|
64
|
-
require("is-hotkey");
|
|
65
|
-
require("slate-react");
|
|
66
|
-
require("@convertkit/slate-lists");
|
|
67
64
|
require("react-player");
|
|
68
65
|
exports.Box = Box["default"];
|
|
69
66
|
exports.DEFAULT_BOX_ANIMATE_DELAY = next.DEFAULT_BOX_ANIMATE_DELAY;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"components.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/components.es.js
CHANGED
|
@@ -23,12 +23,13 @@ import "css-box-model";
|
|
|
23
23
|
import "./actions.es.js";
|
|
24
24
|
import "use-sync-external-store/shim/with-selector";
|
|
25
25
|
import "next/dynamic";
|
|
26
|
+
import "@emotion/serialize";
|
|
27
|
+
import "@emotion/utils";
|
|
26
28
|
import "./slot.es.js";
|
|
27
29
|
import "./text-input.es.js";
|
|
28
30
|
import "./combobox.es.js";
|
|
29
31
|
import "./control.es.js";
|
|
30
32
|
import "use-sync-external-store/shim";
|
|
31
|
-
import "slate";
|
|
32
33
|
import "redux";
|
|
33
34
|
import "redux-thunk";
|
|
34
35
|
import "./types.es.js";
|
|
@@ -58,9 +59,5 @@ import "./next-version.es.js";
|
|
|
58
59
|
import "next/package.json";
|
|
59
60
|
import "./index.es4.js";
|
|
60
61
|
import "polished";
|
|
61
|
-
import "slate-hotkeys";
|
|
62
|
-
import "is-hotkey";
|
|
63
|
-
import "slate-react";
|
|
64
|
-
import "@convertkit/slate-lists";
|
|
65
62
|
import "react-player";
|
|
66
63
|
//# sourceMappingURL=components.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"components.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/constants.cjs.js
CHANGED
|
@@ -36,7 +36,7 @@ function createDocumentReference(key) {
|
|
|
36
36
|
function createDocument(key, rootElement) {
|
|
37
37
|
return { key, rootElement };
|
|
38
38
|
}
|
|
39
|
-
function getInitialState$
|
|
39
|
+
function getInitialState$6({
|
|
40
40
|
rootElements = /* @__PURE__ */ new Map()
|
|
41
41
|
} = {}) {
|
|
42
42
|
const initialState = /* @__PURE__ */ new Map();
|
|
@@ -52,7 +52,7 @@ function getDocument$1(state, documentKey) {
|
|
|
52
52
|
var _a;
|
|
53
53
|
return (_a = getDocuments(state).get(documentKey)) != null ? _a : null;
|
|
54
54
|
}
|
|
55
|
-
function reducer$
|
|
55
|
+
function reducer$7(state = getInitialState$6(), action) {
|
|
56
56
|
switch (action.type) {
|
|
57
57
|
case actions.ActionTypes.REGISTER_DOCUMENT:
|
|
58
58
|
return new Map(state).set(action.payload.documentKey, action.payload.document);
|
|
@@ -65,7 +65,7 @@ function reducer$6(state = getInitialState$5(), action) {
|
|
|
65
65
|
return state;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
function getInitialState$
|
|
68
|
+
function getInitialState$5({
|
|
69
69
|
reactComponents = /* @__PURE__ */ new Map()
|
|
70
70
|
} = {}) {
|
|
71
71
|
return reactComponents;
|
|
@@ -77,7 +77,7 @@ function getReactComponent$1(state, type) {
|
|
|
77
77
|
var _a;
|
|
78
78
|
return (_a = getReactComponents(state).get(type)) != null ? _a : null;
|
|
79
79
|
}
|
|
80
|
-
function reducer$
|
|
80
|
+
function reducer$6(state = getInitialState$5(), action) {
|
|
81
81
|
switch (action.type) {
|
|
82
82
|
case actions.ActionTypes.REGISTER_REACT_COMPONENT:
|
|
83
83
|
return new Map(state).set(action.payload.type, action.payload.component);
|
|
@@ -90,7 +90,7 @@ function reducer$5(state = getInitialState$4(), action) {
|
|
|
90
90
|
return state;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
function getInitialState$
|
|
93
|
+
function getInitialState$4({
|
|
94
94
|
componentsMeta = /* @__PURE__ */ new Map()
|
|
95
95
|
} = {}) {
|
|
96
96
|
return componentsMeta;
|
|
@@ -98,7 +98,7 @@ function getInitialState$3({
|
|
|
98
98
|
function getComponentsMeta(state) {
|
|
99
99
|
return state;
|
|
100
100
|
}
|
|
101
|
-
function reducer$
|
|
101
|
+
function reducer$5(state = getInitialState$4(), action) {
|
|
102
102
|
switch (action.type) {
|
|
103
103
|
case actions.ActionTypes.REGISTER_COMPONENT:
|
|
104
104
|
return new Map(state).set(action.payload.type, action.payload.meta);
|
|
@@ -111,7 +111,7 @@ function reducer$4(state = getInitialState$3(), action) {
|
|
|
111
111
|
return state;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
function getInitialState$
|
|
114
|
+
function getInitialState$3({
|
|
115
115
|
propControllerDescriptors = /* @__PURE__ */ new Map()
|
|
116
116
|
} = {}) {
|
|
117
117
|
return propControllerDescriptors;
|
|
@@ -123,7 +123,7 @@ function getComponentPropControllerDescriptors$1(state, componentType) {
|
|
|
123
123
|
var _a;
|
|
124
124
|
return (_a = getPropControllerDescriptors$1(state).get(componentType)) != null ? _a : null;
|
|
125
125
|
}
|
|
126
|
-
function reducer$
|
|
126
|
+
function reducer$4(state = getInitialState$3(), action) {
|
|
127
127
|
switch (action.type) {
|
|
128
128
|
case actions.ActionTypes.REGISTER_COMPONENT:
|
|
129
129
|
return new Map(state).set(action.payload.type, action.payload.propControllerDescriptors);
|
|
@@ -142,7 +142,7 @@ function isPropControllersHandle(value) {
|
|
|
142
142
|
}
|
|
143
143
|
return false;
|
|
144
144
|
}
|
|
145
|
-
function getInitialState$
|
|
145
|
+
function getInitialState$2() {
|
|
146
146
|
return { handles: /* @__PURE__ */ new Map(), instances: /* @__PURE__ */ new Map() };
|
|
147
147
|
}
|
|
148
148
|
function getPropControllersHandle(state, documentKey, elementKey) {
|
|
@@ -157,7 +157,7 @@ function getPropController(state, documentKey, elementKey, propName) {
|
|
|
157
157
|
var _a, _b;
|
|
158
158
|
return (_b = (_a = getPropControllers$1(state, documentKey, elementKey)) == null ? void 0 : _a[propName]) != null ? _b : null;
|
|
159
159
|
}
|
|
160
|
-
function reducer$
|
|
160
|
+
function reducer$3(state = getInitialState$2(), action) {
|
|
161
161
|
var _a, _b, _c, _d;
|
|
162
162
|
switch (action.type) {
|
|
163
163
|
case actions.ActionTypes.REGISTER_PROP_CONTROLLERS_HANDLE: {
|
|
@@ -188,10 +188,10 @@ function reducer$2(state = getInitialState$1(), action) {
|
|
|
188
188
|
return state;
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
function getInitialState() {
|
|
191
|
+
function getInitialState$1() {
|
|
192
192
|
return false;
|
|
193
193
|
}
|
|
194
|
-
function reducer$
|
|
194
|
+
function reducer$2(state = getInitialState$1(), action) {
|
|
195
195
|
switch (action.type) {
|
|
196
196
|
case actions.ActionTypes.SET_IS_IN_BUILDER:
|
|
197
197
|
return action.payload;
|
|
@@ -199,6 +199,18 @@ function reducer$1(state = getInitialState(), action) {
|
|
|
199
199
|
return state;
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
+
function getInitialState(isPreview = false) {
|
|
203
|
+
return isPreview;
|
|
204
|
+
}
|
|
205
|
+
function getIsPreview$1(state) {
|
|
206
|
+
return state;
|
|
207
|
+
}
|
|
208
|
+
function reducer$1(state = getInitialState(), action) {
|
|
209
|
+
switch (action.type) {
|
|
210
|
+
default:
|
|
211
|
+
return state;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
202
214
|
function isNonNullable(value) {
|
|
203
215
|
return value != null;
|
|
204
216
|
}
|
|
@@ -490,12 +502,13 @@ function getPageIds(descriptor, prop) {
|
|
|
490
502
|
}
|
|
491
503
|
}
|
|
492
504
|
const reducer = redux.combineReducers({
|
|
493
|
-
documents: reducer$
|
|
494
|
-
reactComponents: reducer$
|
|
495
|
-
componentsMeta: reducer$
|
|
496
|
-
propControllers: reducer$
|
|
497
|
-
propControllerHandles: reducer$
|
|
498
|
-
isInBuilder: reducer$
|
|
505
|
+
documents: reducer$7,
|
|
506
|
+
reactComponents: reducer$6,
|
|
507
|
+
componentsMeta: reducer$5,
|
|
508
|
+
propControllers: reducer$4,
|
|
509
|
+
propControllerHandles: reducer$3,
|
|
510
|
+
isInBuilder: reducer$2,
|
|
511
|
+
isPreview: reducer$1
|
|
499
512
|
});
|
|
500
513
|
function getDocumentsStateSlice(state) {
|
|
501
514
|
return state.documents;
|
|
@@ -614,11 +627,14 @@ function copyElementTree(state, elementTree, replacementContext) {
|
|
|
614
627
|
function getIsInBuilder(state) {
|
|
615
628
|
return state.isInBuilder;
|
|
616
629
|
}
|
|
630
|
+
function getIsPreview(state) {
|
|
631
|
+
return getIsPreview$1(state.isPreview);
|
|
632
|
+
}
|
|
617
633
|
function configureStore({
|
|
618
634
|
rootElements,
|
|
619
635
|
preloadedState
|
|
620
636
|
} = {}) {
|
|
621
|
-
return redux.createStore(reducer, __spreadProps(__spreadValues({}, preloadedState), { documents: getInitialState$
|
|
637
|
+
return redux.createStore(reducer, __spreadProps(__spreadValues({}, preloadedState), { documents: getInitialState$6({ rootElements }) }), redux.applyMiddleware(thunk__default["default"]));
|
|
622
638
|
}
|
|
623
639
|
const MakeswiftComponentType = {
|
|
624
640
|
Box: "./components/Box/index.js",
|
|
@@ -655,8 +671,10 @@ exports.getElementId = getElementId;
|
|
|
655
671
|
exports.getElementPropControllerDescriptors = getElementPropControllerDescriptors;
|
|
656
672
|
exports.getElementSwatchIds = getElementSwatchIds;
|
|
657
673
|
exports.getFileIds = getFileIds;
|
|
658
|
-
exports.getInitialState = getInitialState$
|
|
674
|
+
exports.getInitialState = getInitialState$6;
|
|
675
|
+
exports.getInitialState$1 = getInitialState;
|
|
659
676
|
exports.getIsInBuilder = getIsInBuilder;
|
|
677
|
+
exports.getIsPreview = getIsPreview;
|
|
660
678
|
exports.getPageIds = getPageIds;
|
|
661
679
|
exports.getPropController = getPropController;
|
|
662
680
|
exports.getPropControllerDescriptors = getPropControllerDescriptors;
|
|
@@ -670,10 +688,11 @@ exports.getTypographyStyleSwatchIds = getTypographyStyleSwatchIds;
|
|
|
670
688
|
exports.isElementReference = isElementReference;
|
|
671
689
|
exports.isNonNullable = isNonNullable;
|
|
672
690
|
exports.isPropControllersHandle = isPropControllersHandle;
|
|
673
|
-
exports.reducer = reducer$
|
|
674
|
-
exports.reducer$1 = reducer$
|
|
675
|
-
exports.reducer$2 = reducer$
|
|
676
|
-
exports.reducer$3 = reducer$
|
|
677
|
-
exports.reducer$4 = reducer$
|
|
678
|
-
exports.reducer$5 = reducer$
|
|
691
|
+
exports.reducer = reducer$7;
|
|
692
|
+
exports.reducer$1 = reducer$6;
|
|
693
|
+
exports.reducer$2 = reducer$5;
|
|
694
|
+
exports.reducer$3 = reducer$4;
|
|
695
|
+
exports.reducer$4 = reducer$3;
|
|
696
|
+
exports.reducer$5 = reducer$2;
|
|
697
|
+
exports.reducer$6 = reducer$1;
|
|
679
698
|
//# sourceMappingURL=constants.cjs.js.map
|