@makeswift/runtime 0.28.8-canary.11 → 0.28.8-canary.12
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/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/components/builtin/Root/index.js.map +1 -0
- package/dist/cjs/components/builtin/Root/register.js.map +1 -0
- package/dist/cjs/runtimes/react/hooks/use-resolved-props.js.map +1 -0
- package/dist/cjs/state/modules/is-in-builder.js.map +1 -0
- 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/package.json +3 -3
|
@@ -27,7 +27,7 @@ class MakeswiftGraphQLApiClient {
|
|
|
27
27
|
graphqlClient;
|
|
28
28
|
constructor({ endpoint }) {
|
|
29
29
|
this.graphqlClient = new import_client.GraphQLClient(endpoint, {
|
|
30
|
-
"makeswift-runtime-version": "0.28.8-canary.
|
|
30
|
+
"makeswift-runtime-version": "0.28.8-canary.12"
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
async createTableRecord(tableId, columns) {
|
|
@@ -147,7 +147,7 @@ class MakeswiftRestAPIClient {
|
|
|
147
147
|
const requestHeaders = new Headers({
|
|
148
148
|
"x-api-key": this.apiKey,
|
|
149
149
|
"makeswift-site-api-key": this.apiKey,
|
|
150
|
-
"makeswift-runtime-version": "0.28.8-canary.
|
|
150
|
+
"makeswift-runtime-version": "0.28.8-canary.12"
|
|
151
151
|
});
|
|
152
152
|
if (siteVersion?.token) {
|
|
153
153
|
requestUrl.searchParams.set("version", siteVersion.version);
|
|
@@ -28,7 +28,7 @@ async function manifestHandler(req, { apiKey, manifest }) {
|
|
|
28
28
|
return import_request_response.ApiResponse.json({ message: "Unauthorized" }, { status: 401 });
|
|
29
29
|
}
|
|
30
30
|
return import_request_response.ApiResponse.json({
|
|
31
|
-
version: "0.28.8-canary.
|
|
31
|
+
version: "0.28.8-canary.12",
|
|
32
32
|
interactionMode: true,
|
|
33
33
|
clientSideNavigation: false,
|
|
34
34
|
elementFromPoint: false,
|
package/dist/cjs/client/index.js
CHANGED
|
@@ -689,7 +689,7 @@ Received "${apiKey}" instead.`
|
|
|
689
689
|
headers: {
|
|
690
690
|
"x-api-key": this.apiKey,
|
|
691
691
|
"makeswift-site-api-key": this.apiKey,
|
|
692
|
-
"makeswift-runtime-version": "0.28.8-canary.
|
|
692
|
+
"makeswift-runtime-version": "0.28.8-canary.12",
|
|
693
693
|
"content-type": "application/json"
|
|
694
694
|
},
|
|
695
695
|
body: JSON.stringify({ token }),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/builtin/Root/index.tsx"],"sourcesContent":["export { default } from './Root'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/builtin/Root/register.ts"],"sourcesContent":["import { Backgrounds, GapX, GapY, Grid } from '@makeswift/prop-controllers'\nimport { type ReactRuntimeCore } from '../../../runtimes/react/react-runtime-core'\nimport { MakeswiftComponentType } from '../constants'\nimport { lazy } from 'react'\n\nexport function registerComponent(runtime: ReactRuntimeCore) {\n return runtime.registerComponent(\n lazy(() => import('./Root')),\n {\n type: MakeswiftComponentType.Root,\n label: 'Page',\n hidden: true,\n props: {\n children: Grid(),\n backgrounds: Backgrounds(),\n rowGap: GapY(),\n columnGap: GapX(),\n },\n },\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAA8C;AAE9C,uBAAuC;AACvC,mBAAqB;AAEd,SAAS,kBAAkB,SAA2B;AAC3D,SAAO,QAAQ;AAAA,QACb,mBAAK,MAAM,6CAAO,QAAQ,GAAC;AAAA,IAC3B;AAAA,MACE,MAAM,wCAAuB;AAAA,MAC7B,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO;AAAA,QACL,cAAU,8BAAK;AAAA,QACf,iBAAa,qCAAY;AAAA,QACzB,YAAQ,8BAAK;AAAA,QACb,eAAW,8BAAK;AAAA,MAClB;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/runtimes/react/hooks/use-resolved-props.ts"],"sourcesContent":["import { useMemo, useEffect, useRef, useSyncExternalStore, useCallback } from 'react'\nimport {\n ControlDefinition,\n ControlInstance,\n mapValues,\n type Data,\n type Resolvable,\n} from '@makeswift/controls'\n\nimport { useResourceResolver } from './use-resource-resolver'\n\nimport { type StylesheetFactory } from '../stylesheet-factory'\nimport { propErrorHandlingProxy } from '../utils/prop-error-handling-proxy'\n\nimport { useControlInstances } from './use-control-instances'\nimport { useResolvableRecord } from './use-resolvable-record'\n\ntype CacheItem = {\n data: Data\n control: ControlInstance | undefined\n resolvedValue: Resolvable<unknown>\n}\n\nexport function useResolvedProps({\n propDefs,\n propData,\n elementKey,\n stylesheetFactory,\n}: {\n propDefs: Record<string, ControlDefinition>\n propData: Record<string, Data>\n elementKey: string\n stylesheetFactory: StylesheetFactory\n}): Record<string, unknown> {\n const resourceResolver = useResourceResolver()\n const controls = useControlInstances(elementKey)\n\n const cache = useRef<Record<string, CacheItem>>({}).current\n const resolveProp = useCallback(\n (def: ControlDefinition, propName: string) => {\n const data = propData[propName]\n const control = controls?.[propName]\n\n if (\n cache[propName] != null &&\n data === cache[propName].data &&\n control === cache[propName].control\n ) {\n return cache[propName].resolvedValue\n }\n\n const resolvedValue = def.resolveValue(\n data,\n resourceResolver,\n stylesheetFactory.get(propName),\n control,\n )\n\n cache[propName] = { data, control, resolvedValue }\n return resolvedValue\n },\n [controls, propData, resourceResolver, stylesheetFactory],\n )\n\n const resolvables = useMemo<Record<string, Resolvable<unknown>>>(\n () =>\n mapValues(propDefs, (def, propName) => {\n const defaultValue = (def.config as any)?.defaultValue\n return propErrorHandlingProxy(resolveProp(def, propName), defaultValue, error => {\n console.warn(\n `Error reading value for prop \"${propName}\", falling back to \\`${defaultValue}\\`.`,\n { control: def, error },\n )\n })\n }),\n [propDefs, resolveProp],\n )\n\n const props = useResolvableRecord(resolvables)\n\n // no need to call `triggerResolve` on the server, all the resources should already be in\n // the host API client's cache (populated from the snapshot's cache)\n useEffect(() => {\n props.triggerResolve()\n }, [props])\n\n // the order is important here, the styles are defined in the process of the props resolution,\n // calling `useDefinedStyles` before the props are resolved would effectively be a noop\n const resolvedProps = useSyncExternalStore(props.subscribe, props.readStable, props.readStable)\n\n stylesheetFactory.useDefinedStyles()\n\n return resolvedProps\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA8E;AAC9E,sBAMO;AAEP,mCAAoC;AAGpC,uCAAuC;AAEvC,mCAAoC;AACpC,mCAAoC;AAQ7B,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAK4B;AAC1B,QAAM,uBAAmB,kDAAoB;AAC7C,QAAM,eAAW,kDAAoB,UAAU;AAE/C,QAAM,YAAQ,qBAAkC,CAAC,CAAC,EAAE;AACpD,QAAM,kBAAc;AAAA,IAClB,CAAC,KAAwB,aAAqB;AAC5C,YAAM,OAAO,SAAS,QAAQ;AAC9B,YAAM,UAAU,WAAW,QAAQ;AAEnC,UACE,MAAM,QAAQ,KAAK,QACnB,SAAS,MAAM,QAAQ,EAAE,QACzB,YAAY,MAAM,QAAQ,EAAE,SAC5B;AACA,eAAO,MAAM,QAAQ,EAAE;AAAA,MACzB;AAEA,YAAM,gBAAgB,IAAI;AAAA,QACxB;AAAA,QACA;AAAA,QACA,kBAAkB,IAAI,QAAQ;AAAA,QAC9B;AAAA,MACF;AAEA,YAAM,QAAQ,IAAI,EAAE,MAAM,SAAS,cAAc;AACjD,aAAO;AAAA,IACT;AAAA,IACA,CAAC,UAAU,UAAU,kBAAkB,iBAAiB;AAAA,EAC1D;AAEA,QAAM,kBAAc;AAAA,IAClB,UACE,2BAAU,UAAU,CAAC,KAAK,aAAa;AACrC,YAAM,eAAgB,IAAI,QAAgB;AAC1C,iBAAO,yDAAuB,YAAY,KAAK,QAAQ,GAAG,cAAc,WAAS;AAC/E,gBAAQ;AAAA,UACN,iCAAiC,QAAQ,wBAAwB,YAAY;AAAA,UAC7E,EAAE,SAAS,KAAK,MAAM;AAAA,QACxB;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,IACH,CAAC,UAAU,WAAW;AAAA,EACxB;AAEA,QAAM,YAAQ,kDAAoB,WAAW;AAI7C,8BAAU,MAAM;AACd,UAAM,eAAe;AAAA,EACvB,GAAG,CAAC,KAAK,CAAC;AAIV,QAAM,oBAAgB,mCAAqB,MAAM,WAAW,MAAM,YAAY,MAAM,UAAU;AAE9F,oBAAkB,iBAAiB;AAEnC,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/state/modules/is-in-builder.ts"],"sourcesContent":["import { type Action, type UnknownAction, isKnownAction } from '../actions'\nimport { ReadOnlyActionTypes } from '../actions/internal/read-only-actions'\n\nexport type State = boolean\n\nexport function getInitialState(): State {\n return false\n}\n\nexport function getIsInBuilder(state: State): boolean {\n return state\n}\n\nexport function reducer(state: State = getInitialState(), action: Action | UnknownAction): State {\n if (!isKnownAction(action)) return state\n\n switch (action.type) {\n case ReadOnlyActionTypes.SET_IS_IN_BUILDER:\n return action.payload\n\n default:\n return state\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA+D;AAC/D,+BAAoC;AAI7B,SAAS,kBAAyB;AACvC,SAAO;AACT;AAEO,SAAS,eAAe,OAAuB;AACpD,SAAO;AACT;AAEO,SAAS,QAAQ,QAAe,gBAAgB,GAAG,QAAuC;AAC/F,MAAI,KAAC,8BAAc,MAAM;AAAG,WAAO;AAEnC,UAAQ,OAAO,MAAM;AAAA,IACnB,KAAK,6CAAoB;AACvB,aAAO,OAAO;AAAA,IAEhB;AACE,aAAO;AAAA,EACX;AACF;","names":[]}
|
|
@@ -9,7 +9,7 @@ class MakeswiftGraphQLApiClient {
|
|
|
9
9
|
graphqlClient;
|
|
10
10
|
constructor({ endpoint }) {
|
|
11
11
|
this.graphqlClient = new GraphQLClient(endpoint, {
|
|
12
|
-
"makeswift-runtime-version": "0.28.8-canary.
|
|
12
|
+
"makeswift-runtime-version": "0.28.8-canary.12"
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
async createTableRecord(tableId, columns) {
|
|
@@ -113,7 +113,7 @@ class MakeswiftRestAPIClient {
|
|
|
113
113
|
const requestHeaders = new Headers({
|
|
114
114
|
"x-api-key": this.apiKey,
|
|
115
115
|
"makeswift-site-api-key": this.apiKey,
|
|
116
|
-
"makeswift-runtime-version": "0.28.8-canary.
|
|
116
|
+
"makeswift-runtime-version": "0.28.8-canary.12"
|
|
117
117
|
});
|
|
118
118
|
if (siteVersion?.token) {
|
|
119
119
|
requestUrl.searchParams.set("version", siteVersion.version);
|
|
@@ -8,7 +8,7 @@ async function manifestHandler(req, { apiKey, manifest }) {
|
|
|
8
8
|
return ApiResponse.json({ message: "Unauthorized" }, { status: 401 });
|
|
9
9
|
}
|
|
10
10
|
return ApiResponse.json({
|
|
11
|
-
version: "0.28.8-canary.
|
|
11
|
+
version: "0.28.8-canary.12",
|
|
12
12
|
interactionMode: true,
|
|
13
13
|
clientSideNavigation: false,
|
|
14
14
|
elementFromPoint: false,
|
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.12",
|
|
673
673
|
"content-type": "application/json"
|
|
674
674
|
},
|
|
675
675
|
body: JSON.stringify({ token }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@makeswift/runtime",
|
|
3
|
-
"version": "0.28.8-canary.
|
|
3
|
+
"version": "0.28.8-canary.12",
|
|
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.21-canary.
|
|
241
|
+
"@makeswift/controls": "0.1.21-canary.6",
|
|
242
242
|
"@makeswift/next-plugin": "0.6.1",
|
|
243
|
-
"@makeswift/prop-controllers": "0.4.15-canary.
|
|
243
|
+
"@makeswift/prop-controllers": "0.4.15-canary.6"
|
|
244
244
|
},
|
|
245
245
|
"devDependencies": {
|
|
246
246
|
"@emotion/jest": "^11.11.0",
|