@makeswift/runtime 0.28.7-canary.2 → 0.28.7-canary.4
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 +160 -0
- package/dist/cjs/api/api-resources-client.js.map +1 -0
- package/dist/cjs/api/client.js +20 -190
- package/dist/cjs/api/client.js.map +1 -1
- package/dist/cjs/api/graphql-api-client.js +39 -0
- package/dist/cjs/api/graphql-api-client.js.map +1 -0
- package/dist/cjs/api-handler/handlers/manifest.js +1 -1
- package/dist/cjs/client/index.js +3 -3
- package/dist/cjs/components/builtin/Form/Form.js +2 -2
- package/dist/cjs/components/builtin/Form/Form.js.map +1 -1
- package/dist/cjs/controls/index.js +2 -2
- package/dist/cjs/controls/index.js.map +1 -1
- package/dist/cjs/next/fetch.js.map +1 -1
- package/dist/cjs/runtimes/react/components/GoogleFontLink.js +2 -2
- package/dist/cjs/runtimes/react/components/GoogleFontLink.js.map +1 -1
- package/dist/cjs/runtimes/react/components/hooks/use-page-snippets.js +2 -2
- package/dist/cjs/runtimes/react/components/hooks/use-page-snippets.js.map +1 -1
- package/dist/cjs/runtimes/react/components/page/PageHead.js +2 -2
- package/dist/cjs/runtimes/react/components/page/PageHead.js.map +1 -1
- package/dist/cjs/runtimes/react/hooks/makeswift-api.js +10 -10
- package/dist/cjs/runtimes/react/hooks/makeswift-api.js.map +1 -1
- package/dist/cjs/runtimes/react/{host-api-client.js → hooks/use-api-resources-client.js} +9 -9
- package/dist/cjs/runtimes/react/hooks/use-api-resources-client.js.map +1 -0
- package/dist/cjs/runtimes/react/hooks/use-cache-data.js +2 -2
- package/dist/cjs/runtimes/react/hooks/use-cache-data.js.map +1 -1
- package/dist/cjs/runtimes/react/hooks/use-graphql-api-client.js +35 -0
- package/dist/cjs/runtimes/react/hooks/use-graphql-api-client.js.map +1 -0
- package/dist/cjs/runtimes/react/hooks/use-resource-resolver.js +13 -34
- package/dist/cjs/runtimes/react/hooks/use-resource-resolver.js.map +1 -1
- package/dist/cjs/runtimes/react/resource-resolver.js +52 -0
- package/dist/cjs/runtimes/react/resource-resolver.js.map +1 -0
- package/dist/cjs/runtimes/react/runtime-core.js +11 -6
- package/dist/cjs/runtimes/react/runtime-core.js.map +1 -1
- package/dist/cjs/slate/InlinePlugin/index.js +1 -1
- package/dist/cjs/slate/InlinePlugin/index.js.map +1 -1
- package/dist/cjs/slate/InlinePlugin/types.js +3 -3
- package/dist/cjs/slate/InlinePlugin/types.js.map +1 -1
- package/dist/cjs/slate/TextAlignPlugin/index.js +5 -5
- package/dist/cjs/slate/TextAlignPlugin/index.js.map +1 -1
- package/dist/cjs/state/actions/internal/read-write-actions.js.map +1 -1
- package/dist/cjs/state/api-client/client-store.js +81 -0
- package/dist/cjs/state/api-client/client-store.js.map +1 -0
- package/dist/cjs/state/{makeswift-api-client.js → api-client/fetch-api-resource.js} +15 -101
- package/dist/cjs/state/api-client/fetch-api-resource.js.map +1 -0
- package/dist/cjs/state/api-client/state.js +89 -0
- package/dist/cjs/state/api-client/state.js.map +1 -0
- package/dist/cjs/state/api-client/store.js +36 -0
- package/dist/cjs/state/api-client/store.js.map +1 -0
- package/dist/cjs/state/middleware/makeswift-api-client-sync.js +1 -1
- package/dist/cjs/state/middleware/makeswift-api-client-sync.js.map +1 -1
- package/dist/cjs/state/store.js +3 -3
- package/dist/cjs/state/store.js.map +1 -1
- package/dist/esm/api/api-resources-client.js +127 -0
- package/dist/esm/api/api-resources-client.js.map +1 -0
- package/dist/esm/api/client.js +19 -179
- package/dist/esm/api/client.js.map +1 -1
- package/dist/esm/api/graphql-api-client.js +15 -0
- package/dist/esm/api/graphql-api-client.js.map +1 -0
- package/dist/esm/api-handler/handlers/manifest.js +1 -1
- package/dist/esm/client/index.js +3 -3
- package/dist/esm/components/builtin/Form/Form.js +2 -2
- package/dist/esm/components/builtin/Form/Form.js.map +1 -1
- package/dist/esm/controls/index.js +2 -2
- package/dist/esm/controls/index.js.map +1 -1
- package/dist/esm/next/fetch.js.map +1 -1
- package/dist/esm/runtimes/react/components/GoogleFontLink.js +2 -2
- package/dist/esm/runtimes/react/components/GoogleFontLink.js.map +1 -1
- package/dist/esm/runtimes/react/components/hooks/use-page-snippets.js +2 -2
- package/dist/esm/runtimes/react/components/hooks/use-page-snippets.js.map +1 -1
- package/dist/esm/runtimes/react/components/page/PageHead.js +2 -2
- package/dist/esm/runtimes/react/components/page/PageHead.js.map +1 -1
- package/dist/esm/runtimes/react/hooks/makeswift-api.js +10 -10
- package/dist/esm/runtimes/react/hooks/makeswift-api.js.map +1 -1
- package/dist/esm/runtimes/react/hooks/use-api-resources-client.js +9 -0
- package/dist/esm/runtimes/react/hooks/use-api-resources-client.js.map +1 -0
- package/dist/esm/runtimes/react/hooks/use-cache-data.js +2 -2
- package/dist/esm/runtimes/react/hooks/use-cache-data.js.map +1 -1
- package/dist/esm/runtimes/react/hooks/use-graphql-api-client.js +11 -0
- package/dist/esm/runtimes/react/hooks/use-graphql-api-client.js.map +1 -0
- package/dist/esm/runtimes/react/hooks/use-resource-resolver.js +13 -24
- package/dist/esm/runtimes/react/hooks/use-resource-resolver.js.map +1 -1
- package/dist/esm/runtimes/react/resource-resolver.js +28 -0
- package/dist/esm/runtimes/react/resource-resolver.js.map +1 -0
- package/dist/esm/runtimes/react/runtime-core.js +11 -6
- package/dist/esm/runtimes/react/runtime-core.js.map +1 -1
- package/dist/esm/slate/InlinePlugin/index.js +2 -2
- package/dist/esm/slate/InlinePlugin/index.js.map +1 -1
- package/dist/esm/slate/InlinePlugin/types.js +4 -4
- package/dist/esm/slate/InlinePlugin/types.js.map +1 -1
- package/dist/esm/slate/TextAlignPlugin/index.js +6 -6
- package/dist/esm/slate/TextAlignPlugin/index.js.map +1 -1
- package/dist/esm/state/actions/internal/read-write-actions.js.map +1 -1
- package/dist/esm/state/api-client/client-store.js +49 -0
- package/dist/esm/state/api-client/client-store.js.map +1 -0
- package/dist/esm/state/api-client/fetch-api-resource.js +93 -0
- package/dist/esm/state/api-client/fetch-api-resource.js.map +1 -0
- package/dist/esm/state/api-client/state.js +52 -0
- package/dist/esm/state/api-client/state.js.map +1 -0
- package/dist/esm/state/api-client/store.js +12 -0
- package/dist/esm/state/api-client/store.js.map +1 -0
- package/dist/esm/state/middleware/makeswift-api-client-sync.js +1 -1
- package/dist/esm/state/middleware/makeswift-api-client-sync.js.map +1 -1
- package/dist/esm/state/store.js +3 -3
- package/dist/esm/state/store.js.map +1 -1
- package/dist/types/api/api-resources-client.d.ts +57 -0
- package/dist/types/api/api-resources-client.d.ts.map +1 -0
- package/dist/types/api/client.d.ts +10 -46
- package/dist/types/api/client.d.ts.map +1 -1
- package/dist/types/api/graphql-api-client.d.ts +9 -0
- package/dist/types/api/graphql-api-client.d.ts.map +1 -0
- package/dist/types/client/index.d.ts +9 -9
- package/dist/types/controls/index.d.ts +1 -1
- package/dist/types/controls/index.d.ts.map +1 -1
- package/dist/types/next/fetch.d.ts +1 -1
- package/dist/types/next/fetch.d.ts.map +1 -1
- package/dist/types/runtimes/react/components/GoogleFontLink.d.ts.map +1 -1
- package/dist/types/runtimes/react/components/page/PageHead.d.ts.map +1 -1
- package/dist/types/runtimes/react/hooks/use-api-resources-client.d.ts +3 -0
- package/dist/types/runtimes/react/hooks/use-api-resources-client.d.ts.map +1 -0
- package/dist/types/runtimes/react/hooks/use-graphql-api-client.d.ts +3 -0
- package/dist/types/runtimes/react/hooks/use-graphql-api-client.d.ts.map +1 -0
- package/dist/types/runtimes/react/hooks/use-resource-resolver.d.ts.map +1 -1
- package/dist/types/runtimes/react/resource-resolver.d.ts +10 -0
- package/dist/types/runtimes/react/resource-resolver.d.ts.map +1 -0
- package/dist/types/runtimes/react/runtime-core.d.ts +5 -3
- package/dist/types/runtimes/react/runtime-core.d.ts.map +1 -1
- package/dist/types/slate/InlinePlugin/types.d.ts +3 -3
- package/dist/types/slate/InlinePlugin/types.d.ts.map +1 -1
- package/dist/types/slate/TextAlignPlugin/index.d.ts.map +1 -1
- package/dist/types/state/actions/internal/read-write-actions.d.ts +1 -1
- package/dist/types/state/actions/internal/read-write-actions.d.ts.map +1 -1
- package/dist/types/state/api-client/client-store.d.ts +6 -0
- package/dist/types/state/api-client/client-store.d.ts.map +1 -0
- package/dist/types/state/api-client/fetch-api-resource.d.ts +11 -0
- package/dist/types/state/api-client/fetch-api-resource.d.ts.map +1 -0
- package/dist/types/state/api-client/state.d.ts +30 -0
- package/dist/types/state/api-client/state.d.ts.map +1 -0
- package/dist/types/state/api-client/store.d.ts +18 -0
- package/dist/types/state/api-client/store.d.ts.map +1 -0
- package/dist/types/state/middleware/makeswift-api-client-sync.d.ts +2 -2
- package/dist/types/state/middleware/makeswift-api-client-sync.d.ts.map +1 -1
- package/dist/types/state/store.d.ts +4 -4
- package/dist/types/state/store.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/cjs/runtimes/react/host-api-client.js.map +0 -1
- package/dist/cjs/state/makeswift-api-client.js.map +0 -1
- package/dist/esm/runtimes/react/host-api-client.js +0 -9
- package/dist/esm/runtimes/react/host-api-client.js.map +0 -1
- package/dist/esm/state/makeswift-api-client.js +0 -179
- package/dist/esm/state/makeswift-api-client.js.map +0 -1
- package/dist/types/runtimes/react/host-api-client.d.ts +0 -3
- package/dist/types/runtimes/react/host-api-client.d.ts.map +0 -1
- package/dist/types/state/makeswift-api-client.d.ts +0 -51
- package/dist/types/state/makeswift-api-client.d.ts.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type State } from './state';
|
|
2
|
+
export declare function configureStore({ preloadedState }: {
|
|
3
|
+
preloadedState: Partial<State>;
|
|
4
|
+
}): import("@reduxjs/toolkit").EnhancedStore<{
|
|
5
|
+
siteVersion: import("../modules/site-version").State;
|
|
6
|
+
locale: import("../modules/locale").State;
|
|
7
|
+
apiResources: import("../modules/api-resources").State;
|
|
8
|
+
localizedResourcesMap: Map<string, Map<string, string | null>>;
|
|
9
|
+
}, import("../actions").Action | import("@reduxjs/toolkit").UnknownAction, import("@reduxjs/toolkit").Tuple<[import("@reduxjs/toolkit").StoreEnhancer<{
|
|
10
|
+
dispatch: import("@reduxjs/toolkit").ThunkDispatch<{
|
|
11
|
+
siteVersion: import("../modules/site-version").State;
|
|
12
|
+
locale: import("../modules/locale").State;
|
|
13
|
+
apiResources: import("../modules/api-resources").State;
|
|
14
|
+
localizedResourcesMap: Map<string, Map<string, string | null>>;
|
|
15
|
+
}, undefined, import("@reduxjs/toolkit").UnknownAction>;
|
|
16
|
+
}>, import("@reduxjs/toolkit").StoreEnhancer]>>;
|
|
17
|
+
export type Store = ReturnType<typeof configureStore>;
|
|
18
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../src/state/api-client/store.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,KAAK,EAAW,MAAM,SAAS,CAAA;AAE7C,wBAAgB,cAAc,CAAC,EAAE,cAAc,EAAE,EAAE;IAAE,cAAc,EAAE,OAAO,CAAC,KAAK,CAAC,CAAA;CAAE;;;;;;;;;;;;gDAKpF;AAED,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Middleware } from '@reduxjs/toolkit';
|
|
2
|
-
import {
|
|
2
|
+
import { ApiResourcesClient } from '../../api/api-resources-client';
|
|
3
3
|
import { type State, type Dispatch } from '../unified-state';
|
|
4
|
-
export declare function makeswiftApiClientSyncMiddleware(client:
|
|
4
|
+
export declare function makeswiftApiClientSyncMiddleware(client: ApiResourcesClient): Middleware<Dispatch, State, Dispatch>;
|
|
5
5
|
//# sourceMappingURL=makeswift-api-client-sync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeswift-api-client-sync.d.ts","sourceRoot":"","sources":["../../../../src/state/middleware/makeswift-api-client-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"makeswift-api-client-sync.d.ts","sourceRoot":"","sources":["../../../../src/state/middleware/makeswift-api-client-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAInE,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE5D,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,kBAAkB,GACzB,UAAU,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,CAQvC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Middleware, type StoreEnhancer, Tuple } from '@reduxjs/toolkit';
|
|
2
|
-
import {
|
|
2
|
+
import { ApiResourcesClient } from '../api/api-resources-client';
|
|
3
3
|
import * as Breakpoints from './modules/breakpoints';
|
|
4
4
|
import { type BreakpointWatch } from './mixins/breakpoint-watch';
|
|
5
5
|
import { type Action } from './actions';
|
|
@@ -45,13 +45,13 @@ type ReadWriteMiddlewareRef = {
|
|
|
45
45
|
};
|
|
46
46
|
export declare function conditionalReadWriteMiddleware(middlewareRef: ReadWriteMiddlewareRef): Middleware<Dispatch, State, Dispatch>;
|
|
47
47
|
export interface ReadWriteStateMixin {
|
|
48
|
-
readonly
|
|
48
|
+
readonly apiResourcesClient: ApiResourcesClient;
|
|
49
49
|
loadReadWriteStateIfNeeded(): Promise<() => void>;
|
|
50
50
|
}
|
|
51
|
-
export declare function configureReadWriteStore({ name, appOrigin,
|
|
51
|
+
export declare function configureReadWriteStore({ name, appOrigin, apiResourcesClient, preloadedState, }: {
|
|
52
52
|
name: string;
|
|
53
53
|
appOrigin: string;
|
|
54
|
-
|
|
54
|
+
apiResourcesClient: ApiResourcesClient;
|
|
55
55
|
preloadedState: Partial<State>;
|
|
56
56
|
}): import("@reduxjs/toolkit").EnhancedStore<{
|
|
57
57
|
siteVersion: import("./modules/site-version").State;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/state/store.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,aAAa,EAElB,KAAK,EAIN,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/state/store.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,aAAa,EAElB,KAAK,EAIN,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAMhE,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAA;AAIpD,OAAO,EAAE,KAAK,eAAe,EAAwB,MAAM,2BAA2B,CAAA;AAEtF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,WAAW,CAAA;AAGvC,OAAO,KAAK,aAAa,MAAM,mBAAmB,CAAA;AAClD,OAAO,EACL,KAAK,KAAK,EACV,KAAK,QAAQ,EAGd,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAsC5C,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,WAAW,GACZ,EAAE;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,WAAW,CAAC,WAAW,GAAG,SAAS,CAAA;CACjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAQA;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D,KAAK,mBAAmB,GAAG,UAAU,CACnC,cAAc,yBAAyB,EAAE,yBAAyB,CACnE,CAAA;AAED,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAA;CACpC,CAAA;AAED,wBAAgB,8BAA8B,CAC5C,aAAa,EAAE,sBAAsB,GACpC,UAAU,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,CAyDvC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAA;IAE/C,0BAA0B,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,CAAA;CAClD;AASD,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,EACJ,SAAS,EACT,kBAAkB,EAClB,cAAc,GACf,EAAE;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,kBAAkB,EAAE,kBAAkB,CAAA;IACtC,cAAc,EAAE,OAAO,CAAC,KAAK,CAAC,CAAA;CAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;0EA8GA;AAED,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@makeswift/runtime",
|
|
3
|
-
"version": "0.28.7-canary.
|
|
3
|
+
"version": "0.28.7-canary.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "makeswift/makeswift",
|
|
@@ -238,9 +238,9 @@
|
|
|
238
238
|
"use-sync-external-store": "^1.5.0",
|
|
239
239
|
"uuid": "^9.0.0",
|
|
240
240
|
"zod": "^3.21.4",
|
|
241
|
-
"@makeswift/controls": "0.1.20-canary.
|
|
241
|
+
"@makeswift/controls": "0.1.20-canary.2",
|
|
242
242
|
"@makeswift/next-plugin": "0.6.1",
|
|
243
|
-
"@makeswift/prop-controllers": "0.4.14-canary.
|
|
243
|
+
"@makeswift/prop-controllers": "0.4.14-canary.2"
|
|
244
244
|
},
|
|
245
245
|
"devDependencies": {
|
|
246
246
|
"@emotion/jest": "^11.11.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/runtimes/react/host-api-client.tsx"],"sourcesContent":["'use client'\n\nimport { MakeswiftHostApiClient } from '../../api/client'\n\nimport { useStore } from './hooks/use-store'\n\nexport function useMakeswiftHostApiClient(): MakeswiftHostApiClient {\n return useStore().hostApiClient\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,uBAAyB;AAElB,SAAS,4BAAoD;AAClE,aAAO,2BAAS,EAAE;AACpB;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/state/makeswift-api-client.ts"],"sourcesContent":["import {\n configureStore as configureReduxStore,\n combineReducers,\n type ThunkAction,\n type ThunkMiddleware,\n type ThunkDispatch,\n UnknownAction,\n} from '@reduxjs/toolkit'\n\nimport { type SiteVersion, ApiHandlerHeaders, serializeSiteVersion } from '../api/site-version'\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, ActionTypes } from './actions'\nimport { apiResourceFulfilled } from './actions/internal/read-only-actions'\nimport { setLocalizedResourceId } from './host-api'\nimport { actionMiddleware, middlewareOptions, devToolsConfig } from './toolkit'\n\nimport {\n APIResourceType,\n type APIResource,\n type Swatch,\n type File,\n type Typography,\n type GlobalElement,\n type PagePathnameSlice,\n type Table,\n type LocalizedGlobalElement,\n type APIResourceLocale,\n} from '../api'\n\nconst 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>\nexport type HttpFetch = (url: string | URL, init?: RequestInit) => Promise<Response>\n\nexport type SerializedState = {\n apiResources: APIResources.SerializedState\n localizedResourcesMap: LocalizedResourcesMap.SerializedState\n}\n\nfunction 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\ntype Thunk<ReturnType> = ThunkAction<ReturnType, State, unknown, Action>\n\nexport function fetchAPIResource<T extends APIResourceType>(\n resourceType: T,\n resourceId: string,\n fetch: HttpFetch,\n locale?: APIResourceLocale<T>,\n): Thunk<Promise<Extract<APIResource, { __typename: T }> | null>> {\n const fetchVersioned = async <T>(url: string, version: SiteVersion | null): Promise<T | null> => {\n const response = await fetch(url, {\n headers: {\n 'Content-Type': 'application/json',\n ...(version != null\n ? { [ApiHandlerHeaders.SiteVersion]: serializeSiteVersion(version) }\n : {}),\n },\n })\n\n if (response.status === 404) return null\n if (!response.ok) throw new Error(response.statusText)\n\n if (response.headers.get('content-type')?.includes('application/json') !== true) {\n throw new Error(\n `Expected JSON response from \"${url}\" but got \"${response.headers.get('content-type')}\"`,\n )\n }\n\n return response.json()\n }\n\n return async (dispatch, getState) => {\n const state = getState()\n const version = SiteVersionState.getSiteVersion(state.siteVersion)\n\n if (getHasAPIResource(state, resourceType, resourceId, locale)) {\n return getAPIResource(state, resourceType, resourceId, locale)\n }\n\n let resource: APIResource | null\n\n switch (resourceType) {\n case APIResourceType.Swatch:\n resource = await fetchVersioned<Swatch>(`/api/makeswift/swatches/${resourceId}`, version)\n break\n\n case APIResourceType.File:\n resource = await fetchVersioned<File>(`/api/makeswift/files/${resourceId}`, version)\n break\n\n case APIResourceType.Typography:\n resource = await fetchVersioned<Typography>(\n `/api/makeswift/typographies/${resourceId}`,\n version,\n )\n break\n\n case APIResourceType.GlobalElement:\n resource = await fetchVersioned<GlobalElement>(\n `/api/makeswift/global-elements/${resourceId}`,\n version,\n )\n break\n\n case APIResourceType.LocalizedGlobalElement: {\n if (locale == null) throw new Error('Locale is required to fetch LocalizedGlobalElement')\n\n // If `getLocalizedResourceId` returns null, it means we have tried to fetch the resource,\n // but the resource is not available. If we haven't fetched it yet, it'll return undefined.\n if (getLocalizedResourceId(state, locale, resourceId) === null) {\n return null\n }\n\n resource = await fetchVersioned<LocalizedGlobalElement>(\n `/api/makeswift/localized-global-elements/${resourceId}/${locale}`,\n version,\n )\n\n dispatch(\n setLocalizedResourceId({\n locale,\n resourceId,\n localizedResourceId: resource?.id ?? null,\n }),\n )\n\n break\n }\n\n case APIResourceType.PagePathnameSlice: {\n const url = new URL(`/api/makeswift/page-pathname-slices/${resourceId}`, 'http://n')\n\n if (locale != null) url.searchParams.set('locale', locale)\n\n resource = await fetchVersioned<PagePathnameSlice>(url.pathname + url.search, version)\n break\n }\n\n case APIResourceType.Table:\n resource = await fetchVersioned<Table>(`/api/makeswift/tables/${resourceId}`, version)\n break\n\n default:\n resource = null\n }\n\n dispatch(apiResourceFulfilled(resourceType, resourceId, resource, locale))\n\n return resource as Extract<APIResource, { __typename: T }> | null\n }\n}\n\n// FIXME: this middleware can be removed once we've upgraded the builder\n// to always provide the locale when dispatching resource actions\nfunction defaultLocaleMiddleware(): ThunkMiddleware<State, UnknownAction> {\n return actionMiddleware(({ getState }) => next => {\n return (action: Action) => {\n switch (action.type) {\n case ActionTypes.CHANGE_API_RESOURCE:\n case ActionTypes.EVICT_API_RESOURCE:\n case ActionTypes.SET_LOCALIZED_RESOURCE_ID: {\n const { locale } = action.payload\n return next({\n ...action,\n payload: {\n ...action.payload,\n locale: locale ?? LocaleState.getLocale(getState().locale),\n },\n } as Action)\n }\n }\n\n return next(action)\n }\n })\n}\n\nexport function configureStore({ preloadedState }: { preloadedState: Partial<State> }) {\n return configureReduxStore({\n reducer,\n preloadedState,\n\n middleware: getDefaultMiddleware =>\n getDefaultMiddleware(middlewareOptions).concat(defaultLocaleMiddleware()),\n\n devTools: devToolsConfig({\n name: `API client store (${new Date().toISOString()})`,\n actionsDenylist: [\n ActionTypes.BUILDER_POINTER_MOVE,\n ActionTypes.HANDLE_POINTER_MOVE,\n ActionTypes.ELEMENT_FROM_POINT_CHANGE,\n ],\n }),\n })\n}\n\nexport type Store = ReturnType<typeof configureStore>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAOO;AAEP,0BAA0E;AAE1E,uBAAkC;AAClC,kBAA6B;AAC7B,mBAA8B;AAC9B,4BAAuC;AAEvC,qBAAyC;AACzC,+BAAqC;AACrC,sBAAuC;AACvC,IAAAA,kBAAoE;AAEpE,iBAWO;AAEP,MAAM,cAAU,gCAAgB;AAAA,EAC9B,aAAa,iBAAiB;AAAA,EAC9B,QAAQ,YAAY;AAAA,EACpB,cAAc,aAAa;AAAA,EAC3B,uBAAuB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,MACd;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;","names":["import_toolkit","configureReduxStore"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/runtimes/react/host-api-client.tsx"],"sourcesContent":["'use client'\n\nimport { MakeswiftHostApiClient } from '../../api/client'\n\nimport { useStore } from './hooks/use-store'\n\nexport function useMakeswiftHostApiClient(): MakeswiftHostApiClient {\n return useStore().hostApiClient\n}\n"],"mappings":";AAIA,SAAS,gBAAgB;AAElB,SAAS,4BAAoD;AAClE,SAAO,SAAS,EAAE;AACpB;","names":[]}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
configureStore as configureReduxStore,
|
|
3
|
-
combineReducers
|
|
4
|
-
} from "@reduxjs/toolkit";
|
|
5
|
-
import { ApiHandlerHeaders, serializeSiteVersion } from "../api/site-version";
|
|
6
|
-
import * as SiteVersionState from "./modules/site-version";
|
|
7
|
-
import * as LocaleState from "./modules/locale";
|
|
8
|
-
import * as APIResources from "./modules/api-resources";
|
|
9
|
-
import * as LocalizedResourcesMap from "./modules/localized-resources-map";
|
|
10
|
-
import { ActionTypes } from "./actions";
|
|
11
|
-
import { apiResourceFulfilled } from "./actions/internal/read-only-actions";
|
|
12
|
-
import { setLocalizedResourceId } from "./host-api";
|
|
13
|
-
import { actionMiddleware, middlewareOptions, devToolsConfig } from "./toolkit";
|
|
14
|
-
import {
|
|
15
|
-
APIResourceType
|
|
16
|
-
} from "../api";
|
|
17
|
-
const reducer = combineReducers({
|
|
18
|
-
siteVersion: SiteVersionState.reducer,
|
|
19
|
-
locale: LocaleState.reducer,
|
|
20
|
-
apiResources: APIResources.reducer,
|
|
21
|
-
localizedResourcesMap: LocalizedResourcesMap.reducer
|
|
22
|
-
});
|
|
23
|
-
function getLocalizedResourceId(state, locale, resourceId) {
|
|
24
|
-
return LocalizedResourcesMap.getLocalizedResourceId(
|
|
25
|
-
state.localizedResourcesMap,
|
|
26
|
-
locale,
|
|
27
|
-
resourceId
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
function getHasAPIResource(state, resourceType, resourceId, locale) {
|
|
31
|
-
switch (resourceType) {
|
|
32
|
-
case APIResourceType.LocalizedGlobalElement:
|
|
33
|
-
if (locale == null) {
|
|
34
|
-
console.error(`Attempt to access ${resourceType} ${resourceId} without a locale`);
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
const localizedId = getLocalizedResourceId(state, locale, resourceId);
|
|
38
|
-
return localizedId != null && APIResources.getHasAPIResource(state.apiResources, resourceType, localizedId, locale);
|
|
39
|
-
default:
|
|
40
|
-
return APIResources.getHasAPIResource(state.apiResources, resourceType, resourceId, locale);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function getAPIResource(state, resourceType, resourceId, locale) {
|
|
44
|
-
switch (resourceType) {
|
|
45
|
-
case APIResourceType.LocalizedGlobalElement:
|
|
46
|
-
if (locale == null) {
|
|
47
|
-
console.error(`Attempt to access ${resourceType} ${resourceId} without a locale`);
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
const localizedId = getLocalizedResourceId(state, locale, resourceId);
|
|
51
|
-
return localizedId != null ? APIResources.getAPIResource(state.apiResources, resourceType, localizedId, locale) : null;
|
|
52
|
-
default:
|
|
53
|
-
return APIResources.getAPIResource(state.apiResources, resourceType, resourceId, locale);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
function fetchAPIResource(resourceType, resourceId, fetch, locale) {
|
|
57
|
-
const fetchVersioned = async (url, version) => {
|
|
58
|
-
const response = await fetch(url, {
|
|
59
|
-
headers: {
|
|
60
|
-
"Content-Type": "application/json",
|
|
61
|
-
...version != null ? { [ApiHandlerHeaders.SiteVersion]: serializeSiteVersion(version) } : {}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
if (response.status === 404)
|
|
65
|
-
return null;
|
|
66
|
-
if (!response.ok)
|
|
67
|
-
throw new Error(response.statusText);
|
|
68
|
-
if (response.headers.get("content-type")?.includes("application/json") !== true) {
|
|
69
|
-
throw new Error(
|
|
70
|
-
`Expected JSON response from "${url}" but got "${response.headers.get("content-type")}"`
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
return response.json();
|
|
74
|
-
};
|
|
75
|
-
return async (dispatch, getState) => {
|
|
76
|
-
const state = getState();
|
|
77
|
-
const version = SiteVersionState.getSiteVersion(state.siteVersion);
|
|
78
|
-
if (getHasAPIResource(state, resourceType, resourceId, locale)) {
|
|
79
|
-
return getAPIResource(state, resourceType, resourceId, locale);
|
|
80
|
-
}
|
|
81
|
-
let resource;
|
|
82
|
-
switch (resourceType) {
|
|
83
|
-
case APIResourceType.Swatch:
|
|
84
|
-
resource = await fetchVersioned(`/api/makeswift/swatches/${resourceId}`, version);
|
|
85
|
-
break;
|
|
86
|
-
case APIResourceType.File:
|
|
87
|
-
resource = await fetchVersioned(`/api/makeswift/files/${resourceId}`, version);
|
|
88
|
-
break;
|
|
89
|
-
case APIResourceType.Typography:
|
|
90
|
-
resource = await fetchVersioned(
|
|
91
|
-
`/api/makeswift/typographies/${resourceId}`,
|
|
92
|
-
version
|
|
93
|
-
);
|
|
94
|
-
break;
|
|
95
|
-
case APIResourceType.GlobalElement:
|
|
96
|
-
resource = await fetchVersioned(
|
|
97
|
-
`/api/makeswift/global-elements/${resourceId}`,
|
|
98
|
-
version
|
|
99
|
-
);
|
|
100
|
-
break;
|
|
101
|
-
case APIResourceType.LocalizedGlobalElement: {
|
|
102
|
-
if (locale == null)
|
|
103
|
-
throw new Error("Locale is required to fetch LocalizedGlobalElement");
|
|
104
|
-
if (getLocalizedResourceId(state, locale, resourceId) === null) {
|
|
105
|
-
return null;
|
|
106
|
-
}
|
|
107
|
-
resource = await fetchVersioned(
|
|
108
|
-
`/api/makeswift/localized-global-elements/${resourceId}/${locale}`,
|
|
109
|
-
version
|
|
110
|
-
);
|
|
111
|
-
dispatch(
|
|
112
|
-
setLocalizedResourceId({
|
|
113
|
-
locale,
|
|
114
|
-
resourceId,
|
|
115
|
-
localizedResourceId: resource?.id ?? null
|
|
116
|
-
})
|
|
117
|
-
);
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
120
|
-
case APIResourceType.PagePathnameSlice: {
|
|
121
|
-
const url = new URL(`/api/makeswift/page-pathname-slices/${resourceId}`, "http://n");
|
|
122
|
-
if (locale != null)
|
|
123
|
-
url.searchParams.set("locale", locale);
|
|
124
|
-
resource = await fetchVersioned(url.pathname + url.search, version);
|
|
125
|
-
break;
|
|
126
|
-
}
|
|
127
|
-
case APIResourceType.Table:
|
|
128
|
-
resource = await fetchVersioned(`/api/makeswift/tables/${resourceId}`, version);
|
|
129
|
-
break;
|
|
130
|
-
default:
|
|
131
|
-
resource = null;
|
|
132
|
-
}
|
|
133
|
-
dispatch(apiResourceFulfilled(resourceType, resourceId, resource, locale));
|
|
134
|
-
return resource;
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
function defaultLocaleMiddleware() {
|
|
138
|
-
return actionMiddleware(({ getState }) => (next) => {
|
|
139
|
-
return (action) => {
|
|
140
|
-
switch (action.type) {
|
|
141
|
-
case ActionTypes.CHANGE_API_RESOURCE:
|
|
142
|
-
case ActionTypes.EVICT_API_RESOURCE:
|
|
143
|
-
case ActionTypes.SET_LOCALIZED_RESOURCE_ID: {
|
|
144
|
-
const { locale } = action.payload;
|
|
145
|
-
return next({
|
|
146
|
-
...action,
|
|
147
|
-
payload: {
|
|
148
|
-
...action.payload,
|
|
149
|
-
locale: locale ?? LocaleState.getLocale(getState().locale)
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return next(action);
|
|
155
|
-
};
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
function configureStore({ preloadedState }) {
|
|
159
|
-
return configureReduxStore({
|
|
160
|
-
reducer,
|
|
161
|
-
preloadedState,
|
|
162
|
-
middleware: (getDefaultMiddleware) => getDefaultMiddleware(middlewareOptions).concat(defaultLocaleMiddleware()),
|
|
163
|
-
devTools: devToolsConfig({
|
|
164
|
-
name: `API client store (${(/* @__PURE__ */ new Date()).toISOString()})`,
|
|
165
|
-
actionsDenylist: [
|
|
166
|
-
ActionTypes.BUILDER_POINTER_MOVE,
|
|
167
|
-
ActionTypes.HANDLE_POINTER_MOVE,
|
|
168
|
-
ActionTypes.ELEMENT_FROM_POINT_CHANGE
|
|
169
|
-
]
|
|
170
|
-
})
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
export {
|
|
174
|
-
configureStore,
|
|
175
|
-
fetchAPIResource,
|
|
176
|
-
getAPIResource,
|
|
177
|
-
getHasAPIResource
|
|
178
|
-
};
|
|
179
|
-
//# sourceMappingURL=makeswift-api-client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/state/makeswift-api-client.ts"],"sourcesContent":["import {\n configureStore as configureReduxStore,\n combineReducers,\n type ThunkAction,\n type ThunkMiddleware,\n type ThunkDispatch,\n UnknownAction,\n} from '@reduxjs/toolkit'\n\nimport { type SiteVersion, ApiHandlerHeaders, serializeSiteVersion } from '../api/site-version'\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, ActionTypes } from './actions'\nimport { apiResourceFulfilled } from './actions/internal/read-only-actions'\nimport { setLocalizedResourceId } from './host-api'\nimport { actionMiddleware, middlewareOptions, devToolsConfig } from './toolkit'\n\nimport {\n APIResourceType,\n type APIResource,\n type Swatch,\n type File,\n type Typography,\n type GlobalElement,\n type PagePathnameSlice,\n type Table,\n type LocalizedGlobalElement,\n type APIResourceLocale,\n} from '../api'\n\nconst 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>\nexport type HttpFetch = (url: string | URL, init?: RequestInit) => Promise<Response>\n\nexport type SerializedState = {\n apiResources: APIResources.SerializedState\n localizedResourcesMap: LocalizedResourcesMap.SerializedState\n}\n\nfunction 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\ntype Thunk<ReturnType> = ThunkAction<ReturnType, State, unknown, Action>\n\nexport function fetchAPIResource<T extends APIResourceType>(\n resourceType: T,\n resourceId: string,\n fetch: HttpFetch,\n locale?: APIResourceLocale<T>,\n): Thunk<Promise<Extract<APIResource, { __typename: T }> | null>> {\n const fetchVersioned = async <T>(url: string, version: SiteVersion | null): Promise<T | null> => {\n const response = await fetch(url, {\n headers: {\n 'Content-Type': 'application/json',\n ...(version != null\n ? { [ApiHandlerHeaders.SiteVersion]: serializeSiteVersion(version) }\n : {}),\n },\n })\n\n if (response.status === 404) return null\n if (!response.ok) throw new Error(response.statusText)\n\n if (response.headers.get('content-type')?.includes('application/json') !== true) {\n throw new Error(\n `Expected JSON response from \"${url}\" but got \"${response.headers.get('content-type')}\"`,\n )\n }\n\n return response.json()\n }\n\n return async (dispatch, getState) => {\n const state = getState()\n const version = SiteVersionState.getSiteVersion(state.siteVersion)\n\n if (getHasAPIResource(state, resourceType, resourceId, locale)) {\n return getAPIResource(state, resourceType, resourceId, locale)\n }\n\n let resource: APIResource | null\n\n switch (resourceType) {\n case APIResourceType.Swatch:\n resource = await fetchVersioned<Swatch>(`/api/makeswift/swatches/${resourceId}`, version)\n break\n\n case APIResourceType.File:\n resource = await fetchVersioned<File>(`/api/makeswift/files/${resourceId}`, version)\n break\n\n case APIResourceType.Typography:\n resource = await fetchVersioned<Typography>(\n `/api/makeswift/typographies/${resourceId}`,\n version,\n )\n break\n\n case APIResourceType.GlobalElement:\n resource = await fetchVersioned<GlobalElement>(\n `/api/makeswift/global-elements/${resourceId}`,\n version,\n )\n break\n\n case APIResourceType.LocalizedGlobalElement: {\n if (locale == null) throw new Error('Locale is required to fetch LocalizedGlobalElement')\n\n // If `getLocalizedResourceId` returns null, it means we have tried to fetch the resource,\n // but the resource is not available. If we haven't fetched it yet, it'll return undefined.\n if (getLocalizedResourceId(state, locale, resourceId) === null) {\n return null\n }\n\n resource = await fetchVersioned<LocalizedGlobalElement>(\n `/api/makeswift/localized-global-elements/${resourceId}/${locale}`,\n version,\n )\n\n dispatch(\n setLocalizedResourceId({\n locale,\n resourceId,\n localizedResourceId: resource?.id ?? null,\n }),\n )\n\n break\n }\n\n case APIResourceType.PagePathnameSlice: {\n const url = new URL(`/api/makeswift/page-pathname-slices/${resourceId}`, 'http://n')\n\n if (locale != null) url.searchParams.set('locale', locale)\n\n resource = await fetchVersioned<PagePathnameSlice>(url.pathname + url.search, version)\n break\n }\n\n case APIResourceType.Table:\n resource = await fetchVersioned<Table>(`/api/makeswift/tables/${resourceId}`, version)\n break\n\n default:\n resource = null\n }\n\n dispatch(apiResourceFulfilled(resourceType, resourceId, resource, locale))\n\n return resource as Extract<APIResource, { __typename: T }> | null\n }\n}\n\n// FIXME: this middleware can be removed once we've upgraded the builder\n// to always provide the locale when dispatching resource actions\nfunction defaultLocaleMiddleware(): ThunkMiddleware<State, UnknownAction> {\n return actionMiddleware(({ getState }) => next => {\n return (action: Action) => {\n switch (action.type) {\n case ActionTypes.CHANGE_API_RESOURCE:\n case ActionTypes.EVICT_API_RESOURCE:\n case ActionTypes.SET_LOCALIZED_RESOURCE_ID: {\n const { locale } = action.payload\n return next({\n ...action,\n payload: {\n ...action.payload,\n locale: locale ?? LocaleState.getLocale(getState().locale),\n },\n } as Action)\n }\n }\n\n return next(action)\n }\n })\n}\n\nexport function configureStore({ preloadedState }: { preloadedState: Partial<State> }) {\n return configureReduxStore({\n reducer,\n preloadedState,\n\n middleware: getDefaultMiddleware =>\n getDefaultMiddleware(middlewareOptions).concat(defaultLocaleMiddleware()),\n\n devTools: devToolsConfig({\n name: `API client store (${new Date().toISOString()})`,\n actionsDenylist: [\n ActionTypes.BUILDER_POINTER_MOVE,\n ActionTypes.HANDLE_POINTER_MOVE,\n ActionTypes.ELEMENT_FROM_POINT_CHANGE,\n ],\n }),\n })\n}\n\nexport type Store = ReturnType<typeof configureStore>\n"],"mappings":"AAAA;AAAA,EACE,kBAAkB;AAAA,EAClB;AAAA,OAKK;AAEP,SAA2B,mBAAmB,4BAA4B;AAE1E,YAAY,sBAAsB;AAClC,YAAY,iBAAiB;AAC7B,YAAY,kBAAkB;AAC9B,YAAY,2BAA2B;AAEvC,SAAsB,mBAAmB;AACzC,SAAS,4BAA4B;AACrC,SAAS,8BAA8B;AACvC,SAAS,kBAAkB,mBAAmB,sBAAsB;AAEpE;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,MACvB,MAAM,sBAAqB,oBAAI,KAAK,GAAE,YAAY,CAAC;AAAA,MACnD,iBAAiB;AAAA,QACf,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"host-api-client.d.ts","sourceRoot":"","sources":["../../../../src/runtimes/react/host-api-client.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAIzD,wBAAgB,yBAAyB,IAAI,sBAAsB,CAElE"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { type ThunkAction, type ThunkDispatch, UnknownAction } from '@reduxjs/toolkit';
|
|
2
|
-
import * as SiteVersionState from './modules/site-version';
|
|
3
|
-
import * as LocaleState from './modules/locale';
|
|
4
|
-
import * as APIResources from './modules/api-resources';
|
|
5
|
-
import * as LocalizedResourcesMap from './modules/localized-resources-map';
|
|
6
|
-
import { type Action } from './actions';
|
|
7
|
-
import { APIResourceType, type APIResource, type APIResourceLocale } from '../api';
|
|
8
|
-
declare const reducer: import("@reduxjs/toolkit").Reducer<{
|
|
9
|
-
siteVersion: SiteVersionState.State;
|
|
10
|
-
locale: LocaleState.State;
|
|
11
|
-
apiResources: APIResources.State;
|
|
12
|
-
localizedResourcesMap: Map<string, Map<string, string | null>>;
|
|
13
|
-
}, Action | UnknownAction, Partial<{
|
|
14
|
-
siteVersion: SiteVersionState.State | undefined;
|
|
15
|
-
locale: LocaleState.State | undefined;
|
|
16
|
-
apiResources: APIResources.State | undefined;
|
|
17
|
-
localizedResourcesMap: Map<string, Map<string, string | null>> | undefined;
|
|
18
|
-
}>>;
|
|
19
|
-
export type State = ReturnType<typeof reducer>;
|
|
20
|
-
export type Dispatch = ThunkDispatch<State, unknown, Action>;
|
|
21
|
-
export type HttpFetch = (url: string | URL, init?: RequestInit) => Promise<Response>;
|
|
22
|
-
export type SerializedState = {
|
|
23
|
-
apiResources: APIResources.SerializedState;
|
|
24
|
-
localizedResourcesMap: LocalizedResourcesMap.SerializedState;
|
|
25
|
-
};
|
|
26
|
-
export declare function getHasAPIResource<T extends APIResourceType>(state: State, resourceType: APIResourceType, resourceId: string, locale?: APIResourceLocale<T>): boolean;
|
|
27
|
-
export declare function getAPIResource<T extends APIResourceType>(state: State, resourceType: T, resourceId: string, locale?: APIResourceLocale<T>): Extract<APIResource, {
|
|
28
|
-
__typename: T;
|
|
29
|
-
}> | null;
|
|
30
|
-
type Thunk<ReturnType> = ThunkAction<ReturnType, State, unknown, Action>;
|
|
31
|
-
export declare function fetchAPIResource<T extends APIResourceType>(resourceType: T, resourceId: string, fetch: HttpFetch, locale?: APIResourceLocale<T>): Thunk<Promise<Extract<APIResource, {
|
|
32
|
-
__typename: T;
|
|
33
|
-
}> | null>>;
|
|
34
|
-
export declare function configureStore({ preloadedState }: {
|
|
35
|
-
preloadedState: Partial<State>;
|
|
36
|
-
}): import("@reduxjs/toolkit").EnhancedStore<{
|
|
37
|
-
siteVersion: SiteVersionState.State;
|
|
38
|
-
locale: LocaleState.State;
|
|
39
|
-
apiResources: APIResources.State;
|
|
40
|
-
localizedResourcesMap: Map<string, Map<string, string | null>>;
|
|
41
|
-
}, Action | UnknownAction, import("@reduxjs/toolkit").Tuple<[import("@reduxjs/toolkit").StoreEnhancer<{
|
|
42
|
-
dispatch: ThunkDispatch<{
|
|
43
|
-
siteVersion: SiteVersionState.State;
|
|
44
|
-
locale: LocaleState.State;
|
|
45
|
-
apiResources: APIResources.State;
|
|
46
|
-
localizedResourcesMap: Map<string, Map<string, string | null>>;
|
|
47
|
-
}, undefined, UnknownAction>;
|
|
48
|
-
}>, import("@reduxjs/toolkit").StoreEnhancer]>>;
|
|
49
|
-
export type Store = ReturnType<typeof configureStore>;
|
|
50
|
-
export {};
|
|
51
|
-
//# sourceMappingURL=makeswift-api-client.d.ts.map
|
|
@@ -1 +0,0 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