@makeswift/runtime 0.28.8-canary.23 → 0.28.8-canary.25
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/cjs/api/api-resources-client.js +3 -0
- package/dist/cjs/api/api-resources-client.js.map +1 -1
- package/dist/cjs/api/graphql-api-client.js +1 -1
- package/dist/cjs/api/rest-api-client.js +1 -1
- package/dist/cjs/api-handler/handlers/manifest.js +1 -1
- package/dist/cjs/client/index.js +1 -1
- package/dist/cjs/runtimes/react/components/framework-context.js +1 -0
- package/dist/cjs/runtimes/react/components/framework-context.js.map +1 -1
- package/dist/cjs/state/api-client/state.js +8 -0
- package/dist/cjs/state/api-client/state.js.map +1 -1
- package/dist/cjs/state/builder-api/actions.js.map +1 -1
- package/dist/cjs/state/middleware/read-write/builder-api/index.js +2 -58
- package/dist/cjs/state/middleware/read-write/builder-api/index.js.map +1 -1
- package/dist/cjs/state/middleware/read-write/builder-api/middleware.js +89 -0
- package/dist/cjs/state/middleware/read-write/builder-api/middleware.js.map +1 -0
- package/dist/cjs/state/middleware/read-write/builder-api/mount-change-action-buffer.js +72 -0
- package/dist/cjs/state/middleware/read-write/builder-api/mount-change-action-buffer.js.map +1 -0
- package/dist/esm/api/api-resources-client.js +3 -0
- package/dist/esm/api/api-resources-client.js.map +1 -1
- package/dist/esm/api/graphql-api-client.js +1 -1
- package/dist/esm/api/rest-api-client.js +1 -1
- package/dist/esm/api-handler/handlers/manifest.js +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/runtimes/react/components/framework-context.js +1 -0
- package/dist/esm/runtimes/react/components/framework-context.js.map +1 -1
- package/dist/esm/state/api-client/state.js +7 -0
- package/dist/esm/state/api-client/state.js.map +1 -1
- package/dist/esm/state/builder-api/actions.js.map +1 -1
- package/dist/esm/state/middleware/read-write/builder-api/index.js +1 -57
- package/dist/esm/state/middleware/read-write/builder-api/index.js.map +1 -1
- package/dist/esm/state/middleware/read-write/builder-api/middleware.js +65 -0
- package/dist/esm/state/middleware/read-write/builder-api/middleware.js.map +1 -0
- package/dist/esm/state/middleware/read-write/builder-api/mount-change-action-buffer.js +48 -0
- package/dist/esm/state/middleware/read-write/builder-api/mount-change-action-buffer.js.map +1 -0
- package/dist/types/api/api-resources-client.d.ts +1 -0
- package/dist/types/api/api-resources-client.d.ts.map +1 -1
- package/dist/types/runtimes/react/components/framework-context.d.ts.map +1 -1
- package/dist/types/state/api-client/state.d.ts +1 -0
- package/dist/types/state/api-client/state.d.ts.map +1 -1
- package/dist/types/state/builder-api/actions.d.ts +2 -2
- package/dist/types/state/builder-api/actions.d.ts.map +1 -1
- package/dist/types/state/middleware/read-write/builder-api/__tests__/middleware.test.d.ts +2 -0
- package/dist/types/state/middleware/read-write/builder-api/__tests__/middleware.test.d.ts.map +1 -0
- package/dist/types/state/middleware/read-write/builder-api/__tests__/mount-change-action-buffer.test.d.ts +2 -0
- package/dist/types/state/middleware/read-write/builder-api/__tests__/mount-change-action-buffer.test.d.ts.map +1 -0
- package/dist/types/state/middleware/read-write/builder-api/index.d.ts +1 -4
- package/dist/types/state/middleware/read-write/builder-api/index.d.ts.map +1 -1
- package/dist/types/state/middleware/read-write/builder-api/middleware.d.ts +5 -0
- package/dist/types/state/middleware/read-write/builder-api/middleware.d.ts.map +1 -0
- package/dist/types/state/middleware/read-write/builder-api/mount-change-action-buffer.d.ts +28 -0
- package/dist/types/state/middleware/read-write/builder-api/mount-change-action-buffer.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/esm/client/index.js
CHANGED
|
@@ -669,7 +669,7 @@ Received "${apiKey}" instead.`
|
|
|
669
669
|
headers: {
|
|
670
670
|
"x-api-key": this.apiKey,
|
|
671
671
|
"makeswift-site-api-key": this.apiKey,
|
|
672
|
-
"makeswift-runtime-version": "0.28.8-canary.
|
|
672
|
+
"makeswift-runtime-version": "0.28.8-canary.25",
|
|
673
673
|
"content-type": "application/json"
|
|
674
674
|
},
|
|
675
675
|
body: JSON.stringify({ token }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/runtimes/react/components/framework-context.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../../../../src/runtimes/react/components/framework-context.tsx"],"sourcesContent":["'use client'\n\nimport {\n type ReactNode,\n type PropsWithChildren,\n type CSSProperties,\n type ComponentPropsWithoutRef,\n type MouseEvent,\n type ForwardRefExoticComponent,\n type RefAttributes,\n forwardRef,\n createContext,\n useContext,\n useMemo,\n} from 'react'\n\nimport { type LinkData } from '@makeswift/prop-controllers'\n\nimport { type Snippet } from '../../../client'\n\nimport { BaseHeadSnippet } from './page/HeadSnippet'\n\ntype HeadComponent = (props: { children: ReactNode }) => ReactNode\ntype HeadSnippet = (props: { snippet: Snippet }) => ReactNode\ntype ImageComponent = (props: {\n src: string\n alt: string\n sizes?: string\n width?: number\n height?: number\n priority?: boolean\n fill?: boolean\n style?: CSSProperties\n}) => ReactNode\n\ntype LinkProps = Omit<ComponentPropsWithoutRef<'a'>, 'onClick'> & {\n linkType?: LinkData['type']\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => unknown\n}\n\ntype LinkComponent = ForwardRefExoticComponent<RefAttributes<HTMLAnchorElement> & LinkProps>\n\nexport type FrameworkContext = {\n Head: HeadComponent\n HeadSnippet: HeadSnippet\n Image: ImageComponent\n Link: LinkComponent\n}\n\n// React 19 automatically hoists metadata tags to the <head>\nconst DefaultHead = ({ children }: PropsWithChildren) => <>{children}</>\n\nconst DefaultHeadSnippet = BaseHeadSnippet\n\nconst DefaultImage: ImageComponent = ({ priority, fill, style, ...props }) => (\n <img\n {...props}\n style={{\n ...(fill\n ? {\n height: '100%',\n width: '100%',\n objectFit: 'cover',\n }\n : {}),\n ...style,\n }}\n loading={priority ? 'eager' : 'lazy'}\n />\n)\n\nconst DefaultLink: LinkComponent = forwardRef<HTMLAnchorElement, LinkProps>(\n ({ linkType, ...props }, ref) => <a {...props} ref={ref} />,\n)\n\nconst FrameworkContext = createContext<Partial<FrameworkContext>>({})\n\nexport const FrameworkContextProvider = ({\n value,\n children,\n}: PropsWithChildren<{ value: Partial<FrameworkContext> }>) => {\n const parentContext = useContext(FrameworkContext)\n const mergedContext = useMemo(() => ({ ...parentContext, ...value }), [parentContext, value])\n\n return <FrameworkContext.Provider value={mergedContext}>{children}</FrameworkContext.Provider>\n}\n\nconst defaultContext: FrameworkContext = {\n Head: DefaultHead,\n HeadSnippet: DefaultHeadSnippet,\n Image: DefaultImage,\n Link: DefaultLink,\n}\n\nexport function useFrameworkContext(): FrameworkContext {\n return { ...defaultContext, ...useContext(FrameworkContext) }\n}\n"],"mappings":";AAkDyD;AAhDzD;AAAA,EAQE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP,SAAS,uBAAuB;AA8BhC,MAAM,cAAc,CAAC,EAAE,SAAS,MAAyB,gCAAG,UAAS;AAErE,MAAM,qBAAqB;AAE3B,MAAM,eAA+B,CAAC,EAAE,UAAU,MAAM,OAAO,GAAG,MAAM,MACtE;AAAA,EAAC;AAAA;AAAA,IACE,GAAG;AAAA,IACJ,OAAO;AAAA,MACL,GAAI,OACA;AAAA,QACE,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,WAAW;AAAA,MACb,IACA,CAAC;AAAA,MACL,GAAG;AAAA,IACL;AAAA,IACA,SAAS,WAAW,UAAU;AAAA;AAChC;AAGF,MAAM,cAA6B;AAAA,EACjC,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,oBAAC,OAAG,GAAG,OAAO,KAAU;AAC3D;AAEA,MAAM,mBAAmB,cAAyC,CAAC,CAAC;AAE7D,MAAM,2BAA2B,CAAC;AAAA,EACvC;AAAA,EACA;AACF,MAA+D;AAC7D,QAAM,gBAAgB,WAAW,gBAAgB;AACjD,QAAM,gBAAgB,QAAQ,OAAO,EAAE,GAAG,eAAe,GAAG,MAAM,IAAI,CAAC,eAAe,KAAK,CAAC;AAE5F,SAAO,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,eAAgB,UAAS;AACpE;AAEA,MAAM,iBAAmC;AAAA,EACvC,MAAM;AAAA,EACN,aAAa;AAAA,EACb,OAAO;AAAA,EACP,MAAM;AACR;AAEO,SAAS,sBAAwC;AACtD,SAAO,EAAE,GAAG,gBAAgB,GAAG,WAAW,gBAAgB,EAAE;AAC9D;","names":[]}
|
|
@@ -10,6 +10,12 @@ const reducer = combineReducers({
|
|
|
10
10
|
apiResources: APIResources.reducer,
|
|
11
11
|
localizedResourcesMap: LocalizedResourcesMap.reducer
|
|
12
12
|
});
|
|
13
|
+
function getSerializedState(state) {
|
|
14
|
+
return {
|
|
15
|
+
apiResources: APIResources.getSerializedState(state.apiResources),
|
|
16
|
+
localizedResourcesMap: LocalizedResourcesMap.getSerializedState(state.localizedResourcesMap)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
13
19
|
function getLocalizedResourceId(state, locale, resourceId) {
|
|
14
20
|
return LocalizedResourcesMap.getLocalizedResourceId(
|
|
15
21
|
state.localizedResourcesMap,
|
|
@@ -47,6 +53,7 @@ export {
|
|
|
47
53
|
getAPIResource,
|
|
48
54
|
getHasAPIResource,
|
|
49
55
|
getLocalizedResourceId,
|
|
56
|
+
getSerializedState,
|
|
50
57
|
reducer
|
|
51
58
|
};
|
|
52
59
|
//# sourceMappingURL=state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/state/api-client/state.ts"],"sourcesContent":["import { combineReducers, type ThunkDispatch } from '@reduxjs/toolkit'\n\nimport * as SiteVersionState from '../modules/site-version'\nimport * as LocaleState from '../modules/locale'\nimport * as APIResources from '../modules/api-resources'\nimport * as LocalizedResourcesMap from '../modules/localized-resources-map'\n\nimport { type Action } from '../actions'\n\nimport { APIResourceType, type APIResource, type APIResourceLocale } from '../../api'\n\nexport const reducer = combineReducers({\n siteVersion: SiteVersionState.reducer,\n locale: LocaleState.reducer,\n apiResources: APIResources.reducer,\n localizedResourcesMap: LocalizedResourcesMap.reducer,\n})\n\nexport type State = ReturnType<typeof reducer>\nexport type Dispatch = ThunkDispatch<State, unknown, Action>\n\nexport type SerializedState = {\n apiResources: APIResources.SerializedState\n localizedResourcesMap: LocalizedResourcesMap.SerializedState\n}\n\nexport function getLocalizedResourceId(\n state: State,\n locale: string,\n resourceId: string,\n): string | undefined | null {\n return LocalizedResourcesMap.getLocalizedResourceId(\n state.localizedResourcesMap,\n locale,\n resourceId,\n )\n}\n\nexport function getHasAPIResource<T extends APIResourceType>(\n state: State,\n resourceType: APIResourceType,\n resourceId: string,\n locale?: APIResourceLocale<T>,\n): boolean {\n switch (resourceType) {\n case APIResourceType.LocalizedGlobalElement:\n if (locale == null) {\n console.error(`Attempt to access ${resourceType} ${resourceId} without a locale`)\n return false\n }\n\n const localizedId = getLocalizedResourceId(state, locale, resourceId)\n return (\n localizedId != null &&\n APIResources.getHasAPIResource(state.apiResources, resourceType, localizedId, locale)\n )\n\n default:\n return APIResources.getHasAPIResource(state.apiResources, resourceType, resourceId, locale)\n }\n}\n\nexport function getAPIResource<T extends APIResourceType>(\n state: State,\n resourceType: T,\n resourceId: string,\n locale?: APIResourceLocale<T>,\n): Extract<APIResource, { __typename: T }> | null {\n switch (resourceType) {\n case APIResourceType.LocalizedGlobalElement:\n if (locale == null) {\n console.error(`Attempt to access ${resourceType} ${resourceId} without a locale`)\n return null\n }\n\n const localizedId = getLocalizedResourceId(state, locale, resourceId)\n return localizedId != null\n ? APIResources.getAPIResource(state.apiResources, resourceType, localizedId, locale)\n : null\n\n default:\n return APIResources.getAPIResource(state.apiResources, resourceType, resourceId, locale)\n }\n}\n"],"mappings":"AAAA,SAAS,uBAA2C;AAEpD,YAAY,sBAAsB;AAClC,YAAY,iBAAiB;AAC7B,YAAY,kBAAkB;AAC9B,YAAY,2BAA2B;AAIvC,SAAS,uBAAiE;AAEnE,MAAM,UAAU,gBAAgB;AAAA,EACrC,aAAa,iBAAiB;AAAA,EAC9B,QAAQ,YAAY;AAAA,EACpB,cAAc,aAAa;AAAA,EAC3B,uBAAuB,sBAAsB;AAC/C,CAAC;AAUM,SAAS,uBACd,OACA,QACA,YAC2B;AAC3B,SAAO,sBAAsB;AAAA,IAC3B,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACF;AACF;AAEO,SAAS,kBACd,OACA,cACA,YACA,QACS;AACT,UAAQ,cAAc;AAAA,IACpB,KAAK,gBAAgB;AACnB,UAAI,UAAU,MAAM;AAClB,gBAAQ,MAAM,qBAAqB,YAAY,IAAI,UAAU,mBAAmB;AAChF,eAAO;AAAA,MACT;AAEA,YAAM,cAAc,uBAAuB,OAAO,QAAQ,UAAU;AACpE,aACE,eAAe,QACf,aAAa,kBAAkB,MAAM,cAAc,cAAc,aAAa,MAAM;AAAA,IAGxF;AACE,aAAO,aAAa,kBAAkB,MAAM,cAAc,cAAc,YAAY,MAAM;AAAA,EAC9F;AACF;AAEO,SAAS,eACd,OACA,cACA,YACA,QACgD;AAChD,UAAQ,cAAc;AAAA,IACpB,KAAK,gBAAgB;AACnB,UAAI,UAAU,MAAM;AAClB,gBAAQ,MAAM,qBAAqB,YAAY,IAAI,UAAU,mBAAmB;AAChF,eAAO;AAAA,MACT;AAEA,YAAM,cAAc,uBAAuB,OAAO,QAAQ,UAAU;AACpE,aAAO,eAAe,OAClB,aAAa,eAAe,MAAM,cAAc,cAAc,aAAa,MAAM,IACjF;AAAA,IAEN;AACE,aAAO,aAAa,eAAe,MAAM,cAAc,cAAc,YAAY,MAAM;AAAA,EAC3F;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/state/api-client/state.ts"],"sourcesContent":["import { combineReducers, type ThunkDispatch } from '@reduxjs/toolkit'\n\nimport * as SiteVersionState from '../modules/site-version'\nimport * as LocaleState from '../modules/locale'\nimport * as APIResources from '../modules/api-resources'\nimport * as LocalizedResourcesMap from '../modules/localized-resources-map'\n\nimport { type Action } from '../actions'\n\nimport { APIResourceType, type APIResource, type APIResourceLocale } from '../../api'\n\nexport const reducer = combineReducers({\n siteVersion: SiteVersionState.reducer,\n locale: LocaleState.reducer,\n apiResources: APIResources.reducer,\n localizedResourcesMap: LocalizedResourcesMap.reducer,\n})\n\nexport type State = ReturnType<typeof reducer>\nexport type Dispatch = ThunkDispatch<State, unknown, Action>\n\nexport type SerializedState = {\n apiResources: APIResources.SerializedState\n localizedResourcesMap: LocalizedResourcesMap.SerializedState\n}\n\nexport function getSerializedState(state: State): SerializedState {\n return {\n apiResources: APIResources.getSerializedState(state.apiResources),\n localizedResourcesMap: LocalizedResourcesMap.getSerializedState(state.localizedResourcesMap),\n }\n}\n\nexport function getLocalizedResourceId(\n state: State,\n locale: string,\n resourceId: string,\n): string | undefined | null {\n return LocalizedResourcesMap.getLocalizedResourceId(\n state.localizedResourcesMap,\n locale,\n resourceId,\n )\n}\n\nexport function getHasAPIResource<T extends APIResourceType>(\n state: State,\n resourceType: APIResourceType,\n resourceId: string,\n locale?: APIResourceLocale<T>,\n): boolean {\n switch (resourceType) {\n case APIResourceType.LocalizedGlobalElement:\n if (locale == null) {\n console.error(`Attempt to access ${resourceType} ${resourceId} without a locale`)\n return false\n }\n\n const localizedId = getLocalizedResourceId(state, locale, resourceId)\n return (\n localizedId != null &&\n APIResources.getHasAPIResource(state.apiResources, resourceType, localizedId, locale)\n )\n\n default:\n return APIResources.getHasAPIResource(state.apiResources, resourceType, resourceId, locale)\n }\n}\n\nexport function getAPIResource<T extends APIResourceType>(\n state: State,\n resourceType: T,\n resourceId: string,\n locale?: APIResourceLocale<T>,\n): Extract<APIResource, { __typename: T }> | null {\n switch (resourceType) {\n case APIResourceType.LocalizedGlobalElement:\n if (locale == null) {\n console.error(`Attempt to access ${resourceType} ${resourceId} without a locale`)\n return null\n }\n\n const localizedId = getLocalizedResourceId(state, locale, resourceId)\n return localizedId != null\n ? APIResources.getAPIResource(state.apiResources, resourceType, localizedId, locale)\n : null\n\n default:\n return APIResources.getAPIResource(state.apiResources, resourceType, resourceId, locale)\n }\n}\n"],"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;AAAA,IAEN;AACE,aAAO,aAAa,eAAe,MAAM,cAAc,cAAc,YAAY,MAAM;AAAA,EAC3F;AACF;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/state/builder-api/actions.ts"],"sourcesContent":["import { type ThunkAction } from '@reduxjs/toolkit'\n\nimport { type SerializedControl } from '../../builder'\nimport { type PropControllerMessage } from '../../prop-controllers/instances'\n\nimport { type Document } from '../modules/read-only-documents'\nimport { type ComponentMeta } from '../modules/components-meta'\nimport { type BoxDisplayModel } from '../modules/read-write/box-models'\n\nimport { type ElementSize } from '../middleware/read-write/builder-api/element-size'\nimport { type DocumentPayload, type SharedAction } from '../shared-api'\n\nimport { type HostNavigationEvent } from './api'\nimport {\n type SetBreakpointsAction,\n type SetLocaleAction,\n} from '../actions/internal/read-only-actions'\n\nexport * from '../shared-api'\nexport { setBreakpoints } from '../actions/internal/read-only-actions'\nexport { setLocale } from '../actions/internal/read-only-actions'\n\nimport { BuilderActionTypes } from './action-types'\n\ntype ActionWithTransferables<A> = A & {\n transferables?: Transferable[]\n}\n\ntype MakeswiftConnectionCheckAction = {\n type: typeof BuilderActionTypes.MAKESWIFT_CONNECTION_CHECK\n}\n\
|
|
1
|
+
{"version":3,"sources":["../../../../src/state/builder-api/actions.ts"],"sourcesContent":["import { type ThunkAction } from '@reduxjs/toolkit'\n\nimport { type SerializedControl } from '../../builder'\nimport { type PropControllerMessage } from '../../prop-controllers/instances'\n\nimport { type Document } from '../modules/read-only-documents'\nimport { type ComponentMeta } from '../modules/components-meta'\nimport { type BoxDisplayModel } from '../modules/read-write/box-models'\n\nimport { type ElementSize } from '../middleware/read-write/builder-api/element-size'\nimport { type DocumentPayload, type SharedAction } from '../shared-api'\n\nimport { type HostNavigationEvent } from './api'\nimport {\n type SetBreakpointsAction,\n type SetLocaleAction,\n} from '../actions/internal/read-only-actions'\n\nexport * from '../shared-api'\nexport { setBreakpoints } from '../actions/internal/read-only-actions'\nexport { setLocale } from '../actions/internal/read-only-actions'\n\nimport { BuilderActionTypes } from './action-types'\n\ntype ActionWithTransferables<A> = A & {\n transferables?: Transferable[]\n}\n\ntype MakeswiftConnectionCheckAction = {\n type: typeof BuilderActionTypes.MAKESWIFT_CONNECTION_CHECK\n}\n\nexport type MountComponentAction = {\n type: typeof BuilderActionTypes.MOUNT_COMPONENT\n payload: { documentKey: string; elementKey: string }\n}\n\nexport type UnmountComponentAction = {\n type: typeof BuilderActionTypes.UNMOUNT_COMPONENT\n payload: { documentKey: string; elementKey: string }\n}\n\ntype ChangeDocumentElementSizeAction = {\n type: typeof BuilderActionTypes.CHANGE_DOCUMENT_ELEMENT_SIZE\n payload: { size: ElementSize }\n}\n\ntype ChangeElementBoxModelsAction = {\n type: typeof BuilderActionTypes.CHANGE_ELEMENT_BOX_MODELS\n payload: { changedElementBoxModels: Map<string, Map<string, BoxDisplayModel | null>> }\n}\n\ntype MessageBuilderPropControllerAction<T = PropControllerMessage> = {\n type: typeof BuilderActionTypes.MESSAGE_BUILDER_PROP_CONTROLLER\n payload: { documentKey: string; elementKey: string; propName: string; message: T }\n}\n\ntype HandleWheelAction = {\n type: typeof BuilderActionTypes.HANDLE_WHEEL\n payload: { deltaX: number; deltaY: number }\n}\n\ntype HandlePointerMoveAction = {\n type: typeof BuilderActionTypes.HANDLE_POINTER_MOVE\n payload: { clientX: number; clientY: number }\n}\n\ntype ElementFromPointChangeAction = {\n type: typeof BuilderActionTypes.ELEMENT_FROM_POINT_CHANGE\n payload: { keys: { documentKey: string; elementKey: string } | null }\n}\n\ntype RegisterBuilderDocumentAction = {\n type: typeof BuilderActionTypes.REGISTER_BUILDER_DOCUMENT\n payload: { documentKey: string; document: DocumentPayload }\n}\n\ntype UnregisterBuilderDocumentAction = {\n type: typeof BuilderActionTypes.UNREGISTER_BUILDER_DOCUMENT\n payload: { documentKey: string }\n}\n\ntype RegisterBuilderComponentAction = {\n type: typeof BuilderActionTypes.REGISTER_BUILDER_COMPONENT\n payload: {\n type: string\n meta: ComponentMeta\n serializedControls: Record<string, SerializedControl>\n }\n}\n\ntype UnregisterBuilderComponentAction = {\n type: typeof BuilderActionTypes.UNREGISTER_BUILDER_COMPONENT\n payload: { type: string }\n}\n\ntype HandleHostNavigateAction = {\n type: typeof BuilderActionTypes.HANDLE_HOST_NAVIGATE\n payload: HostNavigationEvent\n}\n\nexport type BuilderAction =\n | SharedAction\n | SetBreakpointsAction\n | SetLocaleAction\n | MakeswiftConnectionCheckAction\n | MountComponentAction\n | UnmountComponentAction\n | ChangeDocumentElementSizeAction\n | ChangeElementBoxModelsAction\n | MessageBuilderPropControllerAction\n | HandleWheelAction\n | HandlePointerMoveAction\n | ElementFromPointChangeAction\n | RegisterBuilderDocumentAction\n | UnregisterBuilderDocumentAction\n | RegisterBuilderComponentAction\n | UnregisterBuilderComponentAction\n | HandleHostNavigateAction\n\nexport function makeswiftConnectionCheck(): MakeswiftConnectionCheckAction {\n return { type: BuilderActionTypes.MAKESWIFT_CONNECTION_CHECK }\n}\n\nexport function mountComponent(documentKey: string, elementKey: string): MountComponentAction {\n return { type: BuilderActionTypes.MOUNT_COMPONENT, payload: { documentKey, elementKey } }\n}\n\nexport function unmountComponent(documentKey: string, elementKey: string): UnmountComponentAction {\n return { type: BuilderActionTypes.UNMOUNT_COMPONENT, payload: { documentKey, elementKey } }\n}\n\nexport function mountComponentEffect(\n documentKey: string,\n elementKey: string,\n): ThunkAction<() => void, unknown, unknown, BuilderAction> {\n return dispatch => {\n dispatch(mountComponent(documentKey, elementKey))\n\n return () => {\n dispatch(unmountComponent(documentKey, elementKey))\n }\n }\n}\n\nexport function changeDocumentElementSize(size: ElementSize): ChangeDocumentElementSizeAction {\n return { type: BuilderActionTypes.CHANGE_DOCUMENT_ELEMENT_SIZE, payload: { size } }\n}\n\nexport function changeElementBoxModels(\n changedElementBoxModels: Map<string, Map<string, BoxDisplayModel | null>>,\n): ChangeElementBoxModelsAction {\n return {\n type: BuilderActionTypes.CHANGE_ELEMENT_BOX_MODELS,\n payload: { changedElementBoxModels },\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: BuilderActionTypes.MESSAGE_BUILDER_PROP_CONTROLLER,\n payload: { documentKey, elementKey, propName, message },\n }\n}\n\nexport function handleWheel(payload: { deltaX: number; deltaY: number }): HandleWheelAction {\n return { type: BuilderActionTypes.HANDLE_WHEEL, payload }\n}\n\nexport function handlePointerMove(payload: {\n clientX: number\n clientY: number\n}): HandlePointerMoveAction {\n return { type: BuilderActionTypes.HANDLE_POINTER_MOVE, payload }\n}\n\nexport function elementFromPointChange(\n keys: {\n documentKey: string\n elementKey: string\n } | null,\n): ElementFromPointChangeAction {\n return { type: BuilderActionTypes.ELEMENT_FROM_POINT_CHANGE, payload: { keys } }\n}\n\nexport function registerBuilderDocument(document: Document): RegisterBuilderDocumentAction {\n return {\n type: BuilderActionTypes.REGISTER_BUILDER_DOCUMENT,\n payload: { documentKey: document.key, document },\n }\n}\n\nexport function unregisterBuilderDocument(documentKey: string): UnregisterBuilderDocumentAction {\n return { type: BuilderActionTypes.UNREGISTER_BUILDER_DOCUMENT, payload: { documentKey } }\n}\n\nexport function registerBuilderDocumentsEffect(\n documents: Document[],\n): ThunkAction<() => void, unknown, unknown, BuilderAction> {\n return dispatch => {\n documents.forEach(document => dispatch(registerBuilderDocument(document)))\n\n return () => {\n documents.forEach(document => dispatch(unregisterBuilderDocument(document.key)))\n }\n }\n}\n\nexport function registerBuilderComponent(\n payload: RegisterBuilderComponentAction['payload'],\n transferables?: Transferable[],\n): ActionWithTransferables<RegisterBuilderComponentAction> {\n return {\n type: BuilderActionTypes.REGISTER_BUILDER_COMPONENT,\n payload,\n transferables,\n }\n}\n\nexport function unregisterBuilderComponent(\n payload: UnregisterBuilderComponentAction['payload'],\n): UnregisterBuilderComponentAction {\n return { type: BuilderActionTypes.UNREGISTER_BUILDER_COMPONENT, payload }\n}\n\nexport function hasTransferables<A extends BuilderAction>(\n action: A,\n): action is ActionWithTransferables<A> {\n return 'transferables' in action && Array.isArray(action.transferables)\n}\n"],"mappings":"AAkBA,cAAc;AACd,SAAS,sBAAsB;AAC/B,SAAS,iBAAiB;AAE1B,SAAS,0BAA0B;AAkG5B,SAAS,2BAA2D;AACzE,SAAO,EAAE,MAAM,mBAAmB,2BAA2B;AAC/D;AAEO,SAAS,eAAe,aAAqB,YAA0C;AAC5F,SAAO,EAAE,MAAM,mBAAmB,iBAAiB,SAAS,EAAE,aAAa,WAAW,EAAE;AAC1F;AAEO,SAAS,iBAAiB,aAAqB,YAA4C;AAChG,SAAO,EAAE,MAAM,mBAAmB,mBAAmB,SAAS,EAAE,aAAa,WAAW,EAAE;AAC5F;AAEO,SAAS,qBACd,aACA,YAC0D;AAC1D,SAAO,cAAY;AACjB,aAAS,eAAe,aAAa,UAAU,CAAC;AAEhD,WAAO,MAAM;AACX,eAAS,iBAAiB,aAAa,UAAU,CAAC;AAAA,IACpD;AAAA,EACF;AACF;AAEO,SAAS,0BAA0B,MAAoD;AAC5F,SAAO,EAAE,MAAM,mBAAmB,8BAA8B,SAAS,EAAE,KAAK,EAAE;AACpF;AAEO,SAAS,uBACd,yBAC8B;AAC9B,SAAO;AAAA,IACL,MAAM,mBAAmB;AAAA,IACzB,SAAS,EAAE,wBAAwB;AAAA,EACrC;AACF;AAEO,SAAS,6BACd,aACA,YACA,UACA,SACuC;AACvC,SAAO;AAAA,IACL,MAAM,mBAAmB;AAAA,IACzB,SAAS,EAAE,aAAa,YAAY,UAAU,QAAQ;AAAA,EACxD;AACF;AAEO,SAAS,YAAY,SAAgE;AAC1F,SAAO,EAAE,MAAM,mBAAmB,cAAc,QAAQ;AAC1D;AAEO,SAAS,kBAAkB,SAGN;AAC1B,SAAO,EAAE,MAAM,mBAAmB,qBAAqB,QAAQ;AACjE;AAEO,SAAS,uBACd,MAI8B;AAC9B,SAAO,EAAE,MAAM,mBAAmB,2BAA2B,SAAS,EAAE,KAAK,EAAE;AACjF;AAEO,SAAS,wBAAwB,UAAmD;AACzF,SAAO;AAAA,IACL,MAAM,mBAAmB;AAAA,IACzB,SAAS,EAAE,aAAa,SAAS,KAAK,SAAS;AAAA,EACjD;AACF;AAEO,SAAS,0BAA0B,aAAsD;AAC9F,SAAO,EAAE,MAAM,mBAAmB,6BAA6B,SAAS,EAAE,YAAY,EAAE;AAC1F;AAEO,SAAS,+BACd,WAC0D;AAC1D,SAAO,cAAY;AACjB,cAAU,QAAQ,cAAY,SAAS,wBAAwB,QAAQ,CAAC,CAAC;AAEzE,WAAO,MAAM;AACX,gBAAU,QAAQ,cAAY,SAAS,0BAA0B,SAAS,GAAG,CAAC,CAAC;AAAA,IACjF;AAAA,EACF;AACF;AAEO,SAAS,yBACd,SACA,eACyD;AACzD,SAAO;AAAA,IACL,MAAM,mBAAmB;AAAA,IACzB;AAAA,IACA;AAAA,EACF;AACF;AAEO,SAAS,2BACd,SACkC;AAClC,SAAO,EAAE,MAAM,mBAAmB,8BAA8B,QAAQ;AAC1E;AAEO,SAAS,iBACd,QACsC;AACtC,SAAO,mBAAmB,UAAU,MAAM,QAAQ,OAAO,aAAa;AACxE;","names":[]}
|
|
@@ -1,60 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { actionMiddleware } from "../../../toolkit";
|
|
3
|
-
import { HostActionTypes } from "../../../host-api";
|
|
4
|
-
import { initializeBuilderConnection } from "./initialize-connection";
|
|
5
|
-
function builderAPIMiddleware(builderProxy) {
|
|
6
|
-
return actionMiddleware(({ dispatch }) => (next) => {
|
|
7
|
-
if (typeof window === "undefined")
|
|
8
|
-
return (action) => next(action);
|
|
9
|
-
let cleanUp = () => {
|
|
10
|
-
};
|
|
11
|
-
return (action) => {
|
|
12
|
-
switch (action.type) {
|
|
13
|
-
case BuilderActionTypes.CHANGE_ELEMENT_BOX_MODELS:
|
|
14
|
-
case BuilderActionTypes.MOUNT_COMPONENT:
|
|
15
|
-
case BuilderActionTypes.UNMOUNT_COMPONENT:
|
|
16
|
-
case BuilderActionTypes.CHANGE_DOCUMENT_ELEMENT_SIZE:
|
|
17
|
-
case BuilderActionTypes.MESSAGE_BUILDER_PROP_CONTROLLER:
|
|
18
|
-
case BuilderActionTypes.HANDLE_WHEEL:
|
|
19
|
-
case BuilderActionTypes.HANDLE_POINTER_MOVE:
|
|
20
|
-
case BuilderActionTypes.ELEMENT_FROM_POINT_CHANGE:
|
|
21
|
-
case BuilderActionTypes.SET_LOCALE:
|
|
22
|
-
case BuilderActionTypes.SET_BREAKPOINTS:
|
|
23
|
-
case BuilderActionTypes.REGISTER_BUILDER_DOCUMENT:
|
|
24
|
-
case BuilderActionTypes.UNREGISTER_BUILDER_DOCUMENT:
|
|
25
|
-
case BuilderActionTypes.REGISTER_BUILDER_COMPONENT:
|
|
26
|
-
case BuilderActionTypes.UNREGISTER_BUILDER_COMPONENT:
|
|
27
|
-
builderProxy.execute(action);
|
|
28
|
-
break;
|
|
29
|
-
case HostActionTypes.CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP:
|
|
30
|
-
window.document.documentElement.scrollTo({
|
|
31
|
-
top: action.payload.scrollTop,
|
|
32
|
-
behavior: "instant"
|
|
33
|
-
});
|
|
34
|
-
break;
|
|
35
|
-
case HostActionTypes.SCROLL_DOCUMENT_ELEMENT:
|
|
36
|
-
window.document.documentElement.scrollBy({
|
|
37
|
-
top: action.payload.scrollTopDelta,
|
|
38
|
-
behavior: "instant"
|
|
39
|
-
});
|
|
40
|
-
break;
|
|
41
|
-
case HostActionTypes.SET_BUILDER_EDIT_MODE:
|
|
42
|
-
window.getSelection()?.removeAllRanges();
|
|
43
|
-
break;
|
|
44
|
-
case HostActionTypes.INIT:
|
|
45
|
-
cleanUp();
|
|
46
|
-
cleanUp = dispatch(initializeBuilderConnection(builderProxy));
|
|
47
|
-
break;
|
|
48
|
-
case HostActionTypes.CLEAN_UP:
|
|
49
|
-
cleanUp();
|
|
50
|
-
cleanUp = () => {
|
|
51
|
-
};
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
return next(action);
|
|
55
|
-
};
|
|
56
|
-
});
|
|
57
|
-
}
|
|
1
|
+
import { builderAPIMiddleware } from "./middleware";
|
|
58
2
|
export {
|
|
59
3
|
builderAPIMiddleware
|
|
60
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/state/middleware/read-write/builder-api/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/state/middleware/read-write/builder-api/index.ts"],"sourcesContent":["export { builderAPIMiddleware } from './middleware'\n"],"mappings":"AAAA,SAAS,4BAA4B;","names":[]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { BuilderActionTypes } from "../../../builder-api/action-types";
|
|
2
|
+
import { actionMiddleware } from "../../../toolkit";
|
|
3
|
+
import { HostActionTypes } from "../../../host-api";
|
|
4
|
+
import { initializeBuilderConnection } from "./initialize-connection";
|
|
5
|
+
import { MountChangeActionBuffer } from "./mount-change-action-buffer";
|
|
6
|
+
function builderAPIMiddleware(builderProxy) {
|
|
7
|
+
const mountChangeBuffer = new MountChangeActionBuffer((action) => builderProxy.execute(action));
|
|
8
|
+
return actionMiddleware(({ dispatch }) => (next) => {
|
|
9
|
+
if (typeof window === "undefined")
|
|
10
|
+
return (action) => next(action);
|
|
11
|
+
let cleanUp = () => {
|
|
12
|
+
};
|
|
13
|
+
return (action) => {
|
|
14
|
+
switch (action.type) {
|
|
15
|
+
case BuilderActionTypes.MOUNT_COMPONENT:
|
|
16
|
+
case BuilderActionTypes.UNMOUNT_COMPONENT:
|
|
17
|
+
mountChangeBuffer.schedule(action);
|
|
18
|
+
break;
|
|
19
|
+
case BuilderActionTypes.CHANGE_ELEMENT_BOX_MODELS:
|
|
20
|
+
case BuilderActionTypes.CHANGE_DOCUMENT_ELEMENT_SIZE:
|
|
21
|
+
case BuilderActionTypes.MESSAGE_BUILDER_PROP_CONTROLLER:
|
|
22
|
+
case BuilderActionTypes.HANDLE_WHEEL:
|
|
23
|
+
case BuilderActionTypes.HANDLE_POINTER_MOVE:
|
|
24
|
+
case BuilderActionTypes.ELEMENT_FROM_POINT_CHANGE:
|
|
25
|
+
case BuilderActionTypes.SET_LOCALE:
|
|
26
|
+
case BuilderActionTypes.SET_BREAKPOINTS:
|
|
27
|
+
case BuilderActionTypes.REGISTER_BUILDER_DOCUMENT:
|
|
28
|
+
case BuilderActionTypes.UNREGISTER_BUILDER_DOCUMENT:
|
|
29
|
+
case BuilderActionTypes.REGISTER_BUILDER_COMPONENT:
|
|
30
|
+
case BuilderActionTypes.UNREGISTER_BUILDER_COMPONENT:
|
|
31
|
+
builderProxy.execute(action);
|
|
32
|
+
break;
|
|
33
|
+
case HostActionTypes.CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP:
|
|
34
|
+
window.document.documentElement.scrollTo({
|
|
35
|
+
top: action.payload.scrollTop,
|
|
36
|
+
behavior: "instant"
|
|
37
|
+
});
|
|
38
|
+
break;
|
|
39
|
+
case HostActionTypes.SCROLL_DOCUMENT_ELEMENT:
|
|
40
|
+
window.document.documentElement.scrollBy({
|
|
41
|
+
top: action.payload.scrollTopDelta,
|
|
42
|
+
behavior: "instant"
|
|
43
|
+
});
|
|
44
|
+
break;
|
|
45
|
+
case HostActionTypes.SET_BUILDER_EDIT_MODE:
|
|
46
|
+
window.getSelection()?.removeAllRanges();
|
|
47
|
+
break;
|
|
48
|
+
case HostActionTypes.INIT:
|
|
49
|
+
cleanUp();
|
|
50
|
+
cleanUp = dispatch(initializeBuilderConnection(builderProxy));
|
|
51
|
+
break;
|
|
52
|
+
case HostActionTypes.CLEAN_UP:
|
|
53
|
+
cleanUp();
|
|
54
|
+
cleanUp = () => {
|
|
55
|
+
};
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
return next(action);
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
builderAPIMiddleware
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=middleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/state/middleware/read-write/builder-api/middleware.ts"],"sourcesContent":["import { type Middleware } from '@reduxjs/toolkit'\n\nimport { type Action } from '../../../actions'\n\nimport { BuilderActionTypes } from '../../../builder-api/action-types'\n\nimport { actionMiddleware } from '../../../toolkit'\n\nimport { type BuilderAPIProxy } from '../../../builder-api/proxy'\nimport { HostActionTypes } from '../../../host-api'\n\nimport { type State, type Dispatch } from '../../../read-write-state'\nimport { initializeBuilderConnection } from './initialize-connection'\nimport { MountChangeActionBuffer } from './mount-change-action-buffer'\n\nexport function builderAPIMiddleware(\n builderProxy: BuilderAPIProxy,\n): Middleware<Dispatch, State, Dispatch> {\n const mountChangeBuffer = new MountChangeActionBuffer(action => builderProxy.execute(action))\n\n return actionMiddleware(({ dispatch }) => next => {\n if (typeof window === 'undefined') return (action: Action) => next(action)\n\n let cleanUp = () => {}\n return (action: Action) => {\n switch (action.type) {\n case BuilderActionTypes.MOUNT_COMPONENT:\n case BuilderActionTypes.UNMOUNT_COMPONENT:\n mountChangeBuffer.schedule(action)\n break\n\n case BuilderActionTypes.CHANGE_ELEMENT_BOX_MODELS:\n case BuilderActionTypes.CHANGE_DOCUMENT_ELEMENT_SIZE:\n case BuilderActionTypes.MESSAGE_BUILDER_PROP_CONTROLLER:\n case BuilderActionTypes.HANDLE_WHEEL:\n case BuilderActionTypes.HANDLE_POINTER_MOVE:\n case BuilderActionTypes.ELEMENT_FROM_POINT_CHANGE:\n case BuilderActionTypes.SET_LOCALE:\n case BuilderActionTypes.SET_BREAKPOINTS:\n case BuilderActionTypes.REGISTER_BUILDER_DOCUMENT:\n case BuilderActionTypes.UNREGISTER_BUILDER_DOCUMENT:\n case BuilderActionTypes.REGISTER_BUILDER_COMPONENT:\n case BuilderActionTypes.UNREGISTER_BUILDER_COMPONENT:\n builderProxy.execute(action)\n break\n\n case HostActionTypes.CHANGE_DOCUMENT_ELEMENT_SCROLL_TOP:\n window.document.documentElement.scrollTo({\n top: action.payload.scrollTop,\n behavior: 'instant',\n })\n break\n\n case HostActionTypes.SCROLL_DOCUMENT_ELEMENT:\n window.document.documentElement.scrollBy({\n top: action.payload.scrollTopDelta,\n behavior: 'instant',\n })\n break\n\n case HostActionTypes.SET_BUILDER_EDIT_MODE:\n window.getSelection()?.removeAllRanges()\n break\n\n case HostActionTypes.INIT:\n // dispatched by the parent window after establishing the connection\n // and in response to host's client-side navigation\n cleanUp() // cleanup existing connection setup, if any\n cleanUp = dispatch(initializeBuilderConnection(builderProxy))\n break\n\n case HostActionTypes.CLEAN_UP:\n // dispatched by the parent window on disconnect\n cleanUp()\n cleanUp = () => {}\n break\n }\n\n return next(action)\n }\n })\n}\n"],"mappings":"AAIA,SAAS,0BAA0B;AAEnC,SAAS,wBAAwB;AAGjC,SAAS,uBAAuB;AAGhC,SAAS,mCAAmC;AAC5C,SAAS,+BAA+B;AAEjC,SAAS,qBACd,cACuC;AACvC,QAAM,oBAAoB,IAAI,wBAAwB,YAAU,aAAa,QAAQ,MAAM,CAAC;AAE5F,SAAO,iBAAiB,CAAC,EAAE,SAAS,MAAM,UAAQ;AAChD,QAAI,OAAO,WAAW;AAAa,aAAO,CAAC,WAAmB,KAAK,MAAM;AAEzE,QAAI,UAAU,MAAM;AAAA,IAAC;AACrB,WAAO,CAAC,WAAmB;AACzB,cAAQ,OAAO,MAAM;AAAA,QACnB,KAAK,mBAAmB;AAAA,QACxB,KAAK,mBAAmB;AACtB,4BAAkB,SAAS,MAAM;AACjC;AAAA,QAEF,KAAK,mBAAmB;AAAA,QACxB,KAAK,mBAAmB;AAAA,QACxB,KAAK,mBAAmB;AAAA,QACxB,KAAK,mBAAmB;AAAA,QACxB,KAAK,mBAAmB;AAAA,QACxB,KAAK,mBAAmB;AAAA,QACxB,KAAK,mBAAmB;AAAA,QACxB,KAAK,mBAAmB;AAAA,QACxB,KAAK,mBAAmB;AAAA,QACxB,KAAK,mBAAmB;AAAA,QACxB,KAAK,mBAAmB;AAAA,QACxB,KAAK,mBAAmB;AACtB,uBAAa,QAAQ,MAAM;AAC3B;AAAA,QAEF,KAAK,gBAAgB;AACnB,iBAAO,SAAS,gBAAgB,SAAS;AAAA,YACvC,KAAK,OAAO,QAAQ;AAAA,YACpB,UAAU;AAAA,UACZ,CAAC;AACD;AAAA,QAEF,KAAK,gBAAgB;AACnB,iBAAO,SAAS,gBAAgB,SAAS;AAAA,YACvC,KAAK,OAAO,QAAQ;AAAA,YACpB,UAAU;AAAA,UACZ,CAAC;AACD;AAAA,QAEF,KAAK,gBAAgB;AACnB,iBAAO,aAAa,GAAG,gBAAgB;AACvC;AAAA,QAEF,KAAK,gBAAgB;AAGnB,kBAAQ;AACR,oBAAU,SAAS,4BAA4B,YAAY,CAAC;AAC5D;AAAA,QAEF,KAAK,gBAAgB;AAEnB,kBAAQ;AACR,oBAAU,MAAM;AAAA,UAAC;AACjB;AAAA,MACJ;AAEA,aAAO,KAAK,MAAM;AAAA,IACpB;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BuilderActionTypes } from "../../../builder-api/action-types";
|
|
2
|
+
class MountChangeActionBuffer {
|
|
3
|
+
constructor(execute) {
|
|
4
|
+
this.execute = execute;
|
|
5
|
+
this.scheduledActions = [];
|
|
6
|
+
this.flushScheduled = false;
|
|
7
|
+
}
|
|
8
|
+
scheduledActions;
|
|
9
|
+
flushScheduled;
|
|
10
|
+
schedule(action) {
|
|
11
|
+
this.scheduledActions.push(action);
|
|
12
|
+
if (!this.flushScheduled) {
|
|
13
|
+
this.scheduleFlush();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
scheduleFlush() {
|
|
17
|
+
this.flushScheduled = true;
|
|
18
|
+
queueMicrotask(() => {
|
|
19
|
+
this.flushScheduled = false;
|
|
20
|
+
const batch = this.scheduledActions;
|
|
21
|
+
this.scheduledActions = [];
|
|
22
|
+
const coalescedBatch = coalesceMountChangeActions(batch);
|
|
23
|
+
coalescedBatch.forEach((action) => this.execute(action));
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function key(a) {
|
|
28
|
+
return `${a.payload.documentKey}:${a.payload.elementKey}`;
|
|
29
|
+
}
|
|
30
|
+
function coalesceMountChangeActions(batch) {
|
|
31
|
+
const mountsPerElement = /* @__PURE__ */ new Map();
|
|
32
|
+
batch.forEach((action) => {
|
|
33
|
+
const actionKey = key(action);
|
|
34
|
+
const currentCount = mountsPerElement.get(actionKey)?.count ?? 0;
|
|
35
|
+
mountsPerElement.set(actionKey, {
|
|
36
|
+
count: action.type === BuilderActionTypes.MOUNT_COMPONENT ? currentCount + 1 : currentCount - 1,
|
|
37
|
+
payload: action.payload
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
return [...mountsPerElement.values()].filter(({ count }) => count != 0).map(({ count, payload }) => ({
|
|
41
|
+
type: count > 0 ? BuilderActionTypes.MOUNT_COMPONENT : BuilderActionTypes.UNMOUNT_COMPONENT,
|
|
42
|
+
payload
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
MountChangeActionBuffer
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=mount-change-action-buffer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/state/middleware/read-write/builder-api/mount-change-action-buffer.ts"],"sourcesContent":["import { BuilderActionTypes } from '../../../builder-api/action-types'\nimport type { MountComponentAction, UnmountComponentAction } from '../../../builder-api/actions'\n\ntype MountChangeAction = UnmountComponentAction | MountComponentAction\n\n/**\n * Allows for queuing MountChangeActions dispatched via React effects into a buffer\n * processed after the completion of the current React commit (scheduled using queueMicrotask).\n *\n * Before executing the actions in the buffer, the buffer is processed removing any\n * pairs of MOUNT_COMPONENT and UNMOUNT_COMPONENT actions corresponding to the same\n * element.\n *\n * Without this buffer, moved elements will result in separate UNMOUNT and MOUNT\n * actions being sent to the builder at the time of the elements unmount at its original\n * location and remount at its new location. This causes a flicker in the builder as\n * the element is considered unmounted in the time between its UNMOUNT and MOUNT actions.\n *\n * Note that it is safe to remove these actions pairs as these actions do not communicate\n * the location of a component's mount but simply whether it is currently mounted.\n */\nexport class MountChangeActionBuffer {\n private scheduledActions: MountChangeAction[]\n private flushScheduled: boolean\n\n constructor(private readonly execute: (action: MountChangeAction) => void) {\n this.scheduledActions = []\n this.flushScheduled = false\n }\n\n schedule(action: MountChangeAction) {\n this.scheduledActions.push(action)\n\n if (!this.flushScheduled) {\n this.scheduleFlush()\n }\n }\n\n private scheduleFlush() {\n this.flushScheduled = true\n\n queueMicrotask(() => {\n this.flushScheduled = false\n const batch = this.scheduledActions\n this.scheduledActions = []\n\n const coalescedBatch = coalesceMountChangeActions(batch)\n coalescedBatch.forEach(action => this.execute(action))\n })\n }\n}\n\n/**\n * Provides a key for the target of a MountChangeAction. elementKey on its own is\n * not enough as it is not unique across documents.\n */\nfunction key(a: { payload: { documentKey: string; elementKey: string } }) {\n return `${a.payload.documentKey}:${a.payload.elementKey}`\n}\n\n/**\n * Removes pairs of MOUNT_COMPONENT and UNMOUNT_COMPONENT actions, if there are actions leftover it returns a single\n * action corresponding to the leftover type.\n */\nfunction coalesceMountChangeActions(batch: MountChangeAction[]): MountChangeAction[] {\n const mountsPerElement = new Map<\n string,\n { count: number; payload: MountChangeAction['payload'] }\n >()\n\n batch.forEach(action => {\n const actionKey = key(action)\n const currentCount = mountsPerElement.get(actionKey)?.count ?? 0\n mountsPerElement.set(actionKey, {\n count:\n action.type === BuilderActionTypes.MOUNT_COMPONENT ? currentCount + 1 : currentCount - 1,\n payload: action.payload,\n })\n })\n\n return [...mountsPerElement.values()]\n .filter(({ count }) => count != 0)\n .map(({ count, payload }) => ({\n type: count > 0 ? BuilderActionTypes.MOUNT_COMPONENT : BuilderActionTypes.UNMOUNT_COMPONENT,\n payload,\n }))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,7 @@ export declare abstract class ApiResourcesClient {
|
|
|
13
13
|
constructor({ store }: {
|
|
14
14
|
store: ApiClientStore;
|
|
15
15
|
});
|
|
16
|
+
get cacheData(): CacheData;
|
|
16
17
|
fetchSwatch(swatchId: string): Promise<Swatch | null>;
|
|
17
18
|
readSwatch(swatchId: string): Swatch | null;
|
|
18
19
|
resolveSwatch(swatchId: string | undefined): FetchableValue<Swatch | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-resources-client.d.ts","sourceRoot":"","sources":["../../../src/api/api-resources-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,EAAE,KAAK,KAAK,IAAI,cAAc,EAAE,MAAM,2BAA2B,CAAA;AACxE,OAAO,KAAK,cAAc,MAAM,2BAA2B,CAAA;AAG3D,OAAO,EACL,KAAK,IAAI,EACT,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,IAAI,EACT,KAAK,iBAAiB,EACtB,KAAK,IAAI,EACT,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,UAAU,EACf,eAAe,EAChB,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjD,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC,eAAe,CAAA;AAEtD,eAAO,MAAM,SAAS;aACX,SAAS;CAMnB,CAAA;AAED,8BAAsB,kBAAkB;IACtC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAA;IAC9B,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC,CAAA;gBAEnC,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,EAAE,cAAc,CAAA;KAAE;
|
|
1
|
+
{"version":3,"file":"api-resources-client.d.ts","sourceRoot":"","sources":["../../../src/api/api-resources-client.ts"],"names":[],"mappings":"AAAA,OAAO,EA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,IAAI,CAAC;IAEhC,SAAS,CAAC,QAAQ,CAAC,+BAA+B,CAChD,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC;IAEzC,SAAS,CAAC,QAAQ,CAAC,0BAA0B,CAC3C,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAChC,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAEpC,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;CAClG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework-context.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/components/framework-context.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"framework-context.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/components/framework-context.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,UAAU,EACf,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAKnB,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAE3D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAI9C,KAAK,aAAa,GAAG,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,KAAK,SAAS,CAAA;AAClE,KAAK,WAAW,GAAG,CAAC,KAAK,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,KAAK,SAAS,CAAA;AAC7D,KAAK,cAAc,GAAG,CAAC,KAAK,EAAE;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB,KAAK,SAAS,CAAA;AAEf,KAAK,SAAS,GAAG,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,GAAG;IAChE,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;IAC3B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,OAAO,CAAA;CAC5D,CAAA;AAED,KAAK,aAAa,GAAG,yBAAyB,CAAC,aAAa,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAC,CAAA;AAE5F,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,aAAa,CAAA;IACnB,WAAW,EAAE,WAAW,CAAA;IACxB,KAAK,EAAE,cAAc,CAAA;IACrB,IAAI,EAAE,aAAa,CAAA;CACpB,CAAA;AA8BD,eAAO,MAAM,wBAAwB,GAAI,sBAGtC,iBAAiB,CAAC;IAAE,KAAK,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAA;CAAE,CAAC,4CAKzD,CAAA;AASD,wBAAgB,mBAAmB,IAAI,gBAAgB,CAEtD"}
|
|
@@ -22,6 +22,7 @@ export type SerializedState = {
|
|
|
22
22
|
apiResources: APIResources.SerializedState;
|
|
23
23
|
localizedResourcesMap: LocalizedResourcesMap.SerializedState;
|
|
24
24
|
};
|
|
25
|
+
export declare function getSerializedState(state: State): SerializedState;
|
|
25
26
|
export declare function getLocalizedResourceId(state: State, locale: string, resourceId: string): string | undefined | null;
|
|
26
27
|
export declare function getHasAPIResource<T extends APIResourceType>(state: State, resourceType: APIResourceType, resourceId: string, locale?: APIResourceLocale<T>): boolean;
|
|
27
28
|
export declare function getAPIResource<T extends APIResourceType>(state: State, resourceType: T, resourceId: string, locale?: APIResourceLocale<T>): Extract<APIResource, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/state/api-client/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEtE,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,qBAAqB,MAAM,oCAAoC,CAAA;AAE3E,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,YAAY,CAAA;AAExC,OAAO,EAAE,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAErF,eAAO,MAAM,OAAO;;;;;;;;;;GAKlB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAA;AAC9C,MAAM,MAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;AAE5D,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,EAAE,YAAY,CAAC,eAAe,CAAA;IAC1C,qBAAqB,EAAE,qBAAqB,CAAC,eAAe,CAAA;CAC7D,CAAA;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GACjB,MAAM,GAAG,SAAS,GAAG,IAAI,CAM3B;AAED,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,eAAe,EACzD,KAAK,EAAE,KAAK,EACZ,Y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AAe,CAKhE;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GACjB,MAAM,GAAG,SAAS,GAAG,IAAI,CAM3B;AAED,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,eAAe,EACzD,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,eAAe,EAC7B,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC5B,OAAO,CAiBT;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,eAAe,EACtD,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,CAAC,EACf,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC5B,OAAO,CAAC,WAAW,EAAE;IAAE,UAAU,EAAE,CAAC,CAAA;CAAE,CAAC,GAAG,IAAI,CAgBhD"}
|
|
@@ -18,14 +18,14 @@ type ActionWithTransferables<A> = A & {
|
|
|
18
18
|
type MakeswiftConnectionCheckAction = {
|
|
19
19
|
type: typeof BuilderActionTypes.MAKESWIFT_CONNECTION_CHECK;
|
|
20
20
|
};
|
|
21
|
-
type MountComponentAction = {
|
|
21
|
+
export type MountComponentAction = {
|
|
22
22
|
type: typeof BuilderActionTypes.MOUNT_COMPONENT;
|
|
23
23
|
payload: {
|
|
24
24
|
documentKey: string;
|
|
25
25
|
elementKey: string;
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
type UnmountComponentAction = {
|
|
28
|
+
export type UnmountComponentAction = {
|
|
29
29
|
type: typeof BuilderActionTypes.UNMOUNT_COMPONENT;
|
|
30
30
|
payload: {
|
|
31
31
|
documentKey: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/state/builder-api/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,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AE,OAAO,EAAE,aAAa,CAAC,CAQ1D;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,8BAA8B,CAAC,SAAS,CAAC,EAClD,aAAa,CAAC,EAAE,YAAY,EAAE,GAC7B,uBAAuB,CAAC,8BAA8B,CAAC,CAMzD;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,gCAAgC,CAAC,SAAS,CAAC,GACnD,gCAAgC,CAElC;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,aAAa,EACtD,MAAM,EAAE,CAAC,GACR,MAAM,IAAI,uBAAuB,CAAC,CAAC,CAAC,CAEtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/state/middleware/read-write/builder-api/__tests__/middleware.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mount-change-action-buffer.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/state/middleware/read-write/builder-api/__tests__/mount-change-action-buffer.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { type BuilderAPIProxy } from '../../../builder-api/proxy';
|
|
3
|
-
import { type State, type Dispatch } from '../../../read-write-state';
|
|
4
|
-
export declare function builderAPIMiddleware(builderProxy: BuilderAPIProxy): Middleware<Dispatch, State, Dispatch>;
|
|
1
|
+
export { builderAPIMiddleware } from './middleware';
|
|
5
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/state/middleware/read-write/builder-api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/state/middleware/read-write/builder-api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Middleware } from '@reduxjs/toolkit';
|
|
2
|
+
import { type BuilderAPIProxy } from '../../../builder-api/proxy';
|
|
3
|
+
import { type State, type Dispatch } from '../../../read-write-state';
|
|
4
|
+
export declare function builderAPIMiddleware(builderProxy: BuilderAPIProxy): Middleware<Dispatch, State, Dispatch>;
|
|
5
|
+
//# sourceMappingURL=middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../../../../../src/state/middleware/read-write/builder-api/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAQlD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAGjE,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAIrE,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,eAAe,GAC5B,UAAU,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,CAgEvC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { MountComponentAction, UnmountComponentAction } from '../../../builder-api/actions';
|
|
2
|
+
type MountChangeAction = UnmountComponentAction | MountComponentAction;
|
|
3
|
+
/**
|
|
4
|
+
* Allows for queuing MountChangeActions dispatched via React effects into a buffer
|
|
5
|
+
* processed after the completion of the current React commit (scheduled using queueMicrotask).
|
|
6
|
+
*
|
|
7
|
+
* Before executing the actions in the buffer, the buffer is processed removing any
|
|
8
|
+
* pairs of MOUNT_COMPONENT and UNMOUNT_COMPONENT actions corresponding to the same
|
|
9
|
+
* element.
|
|
10
|
+
*
|
|
11
|
+
* Without this buffer, moved elements will result in separate UNMOUNT and MOUNT
|
|
12
|
+
* actions being sent to the builder at the time of the elements unmount at its original
|
|
13
|
+
* location and remount at its new location. This causes a flicker in the builder as
|
|
14
|
+
* the element is considered unmounted in the time between its UNMOUNT and MOUNT actions.
|
|
15
|
+
*
|
|
16
|
+
* Note that it is safe to remove these actions pairs as these actions do not communicate
|
|
17
|
+
* the location of a component's mount but simply whether it is currently mounted.
|
|
18
|
+
*/
|
|
19
|
+
export declare class MountChangeActionBuffer {
|
|
20
|
+
private readonly execute;
|
|
21
|
+
private scheduledActions;
|
|
22
|
+
private flushScheduled;
|
|
23
|
+
constructor(execute: (action: MountChangeAction) => void);
|
|
24
|
+
schedule(action: MountChangeAction): void;
|
|
25
|
+
private scheduleFlush;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=mount-change-action-buffer.d.ts.map
|
package/dist/types/state/middleware/read-write/builder-api/mount-change-action-buffer.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mount-change-action-buffer.d.ts","sourceRoot":"","sources":["../../../../../../src/state/middleware/read-write/builder-api/mount-change-action-buffer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAEhG,KAAK,iBAAiB,GAAG,sBAAsB,GAAG,oBAAoB,CAAA;AAEtE;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,uBAAuB;IAItB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAHpC,OAAO,CAAC,gBAAgB,CAAqB;IAC7C,OAAO,CAAC,cAAc,CAAS;gBAEF,OAAO,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI;IAKzE,QAAQ,CAAC,MAAM,EAAE,iBAAiB;IAQlC,OAAO,CAAC,aAAa;CAYtB"}
|