@makeswift/runtime 0.23.7-canary.0 → 0.23.7
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/next/api-handler/handlers/manifest.js +1 -1
- package/dist/cjs/runtimes/react/hooks/use-resolvable-record.js +68 -0
- package/dist/cjs/runtimes/react/hooks/use-resolvable-record.js.map +1 -0
- package/dist/cjs/runtimes/react/hooks/use-resolved-props.js +3 -3
- package/dist/cjs/runtimes/react/hooks/use-resolved-props.js.map +1 -1
- package/dist/esm/next/api-handler/handlers/manifest.js +1 -1
- package/dist/esm/runtimes/react/hooks/use-resolvable-record.js +44 -0
- package/dist/esm/runtimes/react/hooks/use-resolvable-record.js.map +1 -0
- package/dist/esm/runtimes/react/hooks/use-resolved-props.js +3 -3
- package/dist/esm/runtimes/react/hooks/use-resolved-props.js.map +1 -1
- package/dist/types/runtimes/react/hooks/use-resolvable-record.d.ts +3 -0
- package/dist/types/runtimes/react/hooks/use-resolvable-record.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/cjs/runtimes/react/resolvable-record.js +0 -67
- package/dist/cjs/runtimes/react/resolvable-record.js.map +0 -1
- package/dist/esm/runtimes/react/resolvable-record.js +0 -43
- package/dist/esm/runtimes/react/resolvable-record.js.map +0 -1
- package/dist/types/runtimes/react/resolvable-record.d.ts +0 -3
- package/dist/types/runtimes/react/resolvable-record.d.ts.map +0 -1
|
@@ -37,7 +37,7 @@ async function handler(...args) {
|
|
|
37
37
|
const supportsDraftMode = (0, import_ts_pattern.match)(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
|
|
38
38
|
const supportsWebhook = (0, import_ts_pattern.match)(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
|
|
39
39
|
const body = {
|
|
40
|
-
version: "0.23.7
|
|
40
|
+
version: "0.23.7",
|
|
41
41
|
previewMode: supportsPreviewMode,
|
|
42
42
|
draftMode: supportsDraftMode,
|
|
43
43
|
interactionMode: true,
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var use_resolvable_record_exports = {};
|
|
20
|
+
__export(use_resolvable_record_exports, {
|
|
21
|
+
useResolvableRecord: () => useResolvableRecord
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(use_resolvable_record_exports);
|
|
24
|
+
var import_react = require("react");
|
|
25
|
+
function useResolvableRecord(resolvables) {
|
|
26
|
+
const snapshot = (0, import_react.useRef)({ resolvedValues: {}, dirtyProps: /* @__PURE__ */ new Set() });
|
|
27
|
+
return (0, import_react.useMemo)(() => {
|
|
28
|
+
return {
|
|
29
|
+
name: "resolvable-record",
|
|
30
|
+
subscribe: (onUpdate) => {
|
|
31
|
+
const unsubscribes = Object.values(resolvables).map((s) => s.subscribe(onUpdate));
|
|
32
|
+
return () => {
|
|
33
|
+
unsubscribes.forEach((u) => u());
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
readStable: () => {
|
|
37
|
+
const nextSnapshot = Object.entries(resolvables).reduce(
|
|
38
|
+
({ dirtyProps, resolvedValues }, [propName, subscription]) => {
|
|
39
|
+
const lastPropValue = snapshot.current.resolvedValues[propName];
|
|
40
|
+
const propValue = subscription.readStable();
|
|
41
|
+
const isDirty = propValue !== lastPropValue;
|
|
42
|
+
return {
|
|
43
|
+
dirtyProps: isDirty ? dirtyProps.add(propName) : dirtyProps,
|
|
44
|
+
resolvedValues: { ...resolvedValues, [propName]: propValue }
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
{ resolvedValues: {}, dirtyProps: /* @__PURE__ */ new Set() }
|
|
48
|
+
);
|
|
49
|
+
if (nextSnapshot.dirtyProps.size > 0) {
|
|
50
|
+
snapshot.current = nextSnapshot;
|
|
51
|
+
}
|
|
52
|
+
return snapshot.current.resolvedValues;
|
|
53
|
+
},
|
|
54
|
+
triggerResolve: async () => {
|
|
55
|
+
return await Promise.all(
|
|
56
|
+
Object.entries(resolvables).map(
|
|
57
|
+
([propName, sub]) => sub.triggerResolve(snapshot.current.resolvedValues[propName])
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}, [resolvables]);
|
|
63
|
+
}
|
|
64
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
+
0 && (module.exports = {
|
|
66
|
+
useResolvableRecord
|
|
67
|
+
});
|
|
68
|
+
//# sourceMappingURL=use-resolvable-record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/runtimes/react/hooks/use-resolvable-record.tsx"],"sourcesContent":["import { type Resolvable } from '@makeswift/controls'\nimport { useMemo, useRef } from 'react'\n\ntype Snapshot = {\n resolvedValues: Record<string, unknown>\n dirtyProps: Set<string>\n}\n\nexport function useResolvableRecord(\n resolvables: Record<string, Resolvable<unknown>>,\n): Resolvable<Record<string, unknown>> {\n const snapshot = useRef<Snapshot>({ resolvedValues: {}, dirtyProps: new Set() })\n\n return useMemo<Resolvable<Record<string, unknown>>>(() => {\n return {\n name: 'resolvable-record',\n subscribe: (onUpdate: () => void): (() => void) => {\n const unsubscribes = Object.values(resolvables).map(s => s.subscribe(onUpdate))\n return () => {\n unsubscribes.forEach(u => u())\n }\n },\n\n readStable: () => {\n const nextSnapshot = Object.entries(resolvables).reduce<Snapshot>(\n ({ dirtyProps, resolvedValues }, [propName, subscription]) => {\n const lastPropValue = snapshot.current.resolvedValues[propName]\n const propValue = subscription.readStable()\n const isDirty = propValue !== lastPropValue\n\n return {\n dirtyProps: isDirty ? dirtyProps.add(propName) : dirtyProps,\n resolvedValues: { ...resolvedValues, [propName]: propValue },\n }\n },\n { resolvedValues: {}, dirtyProps: new Set() },\n )\n\n if (nextSnapshot.dirtyProps.size > 0) {\n snapshot.current = nextSnapshot\n }\n\n return snapshot.current.resolvedValues\n },\n\n triggerResolve: async () => {\n // While we _could_ only trigger resolution on the dirty props, this is\n // not an airtight solution. Some controls will resolve to nullish\n // values even when the underlying data changes, so they won't be dirty\n // (ex: an Image control where the data changes from `undefined` to a\n // file that has not yet been fetched). Even if you add a nullish check\n // on the resolved value, some controls can resolve to non-nullish value\n // when the resolution does not occur (ex: swatches can resolve to\n // black). The true solution is to trigger resolve on underlying data\n // change, and moving these dirtiness optimizations for resolution\n // triggering at the control level.\n return await Promise.all(\n Object.entries(resolvables).map(([propName, sub]) =>\n sub.triggerResolve(snapshot.current.resolvedValues[propName]),\n ),\n )\n },\n }\n }, [resolvables])\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAgC;AAOzB,SAAS,oBACd,aACqC;AACrC,QAAM,eAAW,qBAAiB,EAAE,gBAAgB,CAAC,GAAG,YAAY,oBAAI,IAAI,EAAE,CAAC;AAE/E,aAAO,sBAA6C,MAAM;AACxD,WAAO;AAAA,MACL,MAAM;AAAA,MACN,WAAW,CAAC,aAAuC;AACjD,cAAM,eAAe,OAAO,OAAO,WAAW,EAAE,IAAI,OAAK,EAAE,UAAU,QAAQ,CAAC;AAC9E,eAAO,MAAM;AACX,uBAAa,QAAQ,OAAK,EAAE,CAAC;AAAA,QAC/B;AAAA,MACF;AAAA,MAEA,YAAY,MAAM;AAChB,cAAM,eAAe,OAAO,QAAQ,WAAW,EAAE;AAAA,UAC/C,CAAC,EAAE,YAAY,eAAe,GAAG,CAAC,UAAU,YAAY,MAAM;AAC5D,kBAAM,gBAAgB,SAAS,QAAQ,eAAe,QAAQ;AAC9D,kBAAM,YAAY,aAAa,WAAW;AAC1C,kBAAM,UAAU,cAAc;AAE9B,mBAAO;AAAA,cACL,YAAY,UAAU,WAAW,IAAI,QAAQ,IAAI;AAAA,cACjD,gBAAgB,EAAE,GAAG,gBAAgB,CAAC,QAAQ,GAAG,UAAU;AAAA,YAC7D;AAAA,UACF;AAAA,UACA,EAAE,gBAAgB,CAAC,GAAG,YAAY,oBAAI,IAAI,EAAE;AAAA,QAC9C;AAEA,YAAI,aAAa,WAAW,OAAO,GAAG;AACpC,mBAAS,UAAU;AAAA,QACrB;AAEA,eAAO,SAAS,QAAQ;AAAA,MAC1B;AAAA,MAEA,gBAAgB,YAAY;AAW1B,eAAO,MAAM,QAAQ;AAAA,UACnB,OAAO,QAAQ,WAAW,EAAE;AAAA,YAAI,CAAC,CAAC,UAAU,GAAG,MAC7C,IAAI,eAAe,SAAS,QAAQ,eAAe,QAAQ,CAAC;AAAA,UAC9D;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF,GAAG,CAAC,WAAW,CAAC;AAClB;","names":[]}
|
|
@@ -38,7 +38,7 @@ var import_use_resource_resolver = require("./use-resource-resolver");
|
|
|
38
38
|
var import_use_document_context = require("./use-document-context");
|
|
39
39
|
var import_use_selector = require("./use-selector");
|
|
40
40
|
var import_use_stylesheet_factory = require("./use-stylesheet-factory");
|
|
41
|
-
var
|
|
41
|
+
var import_use_resolvable_record = require("./use-resolvable-record");
|
|
42
42
|
var import_prop_error_handling_proxy = require("../utils/prop-error-handling-proxy");
|
|
43
43
|
function useControlInstances(elementKey) {
|
|
44
44
|
const documentKey = (0, import_use_document_context.useDocumentKey)();
|
|
@@ -83,10 +83,10 @@ function useResolvedProps(propDefs, elementData, elementKey) {
|
|
|
83
83
|
}),
|
|
84
84
|
[propDefs, resolveProp]
|
|
85
85
|
);
|
|
86
|
-
const props = (0,
|
|
86
|
+
const props = (0, import_use_resolvable_record.useResolvableRecord)(resolvables);
|
|
87
87
|
(0, import_react.useEffect)(() => {
|
|
88
88
|
props.triggerResolve();
|
|
89
|
-
}, []);
|
|
89
|
+
}, [props]);
|
|
90
90
|
const resolvedProps = (0, import_react.useSyncExternalStore)(props.subscribe, props.readStable, props.readStable);
|
|
91
91
|
stylesheetFactory.useDefinedStyles();
|
|
92
92
|
return resolvedProps;
|
|
@@ -1 +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 * as ReactPage from '../../../state/react-page'\nimport { useResourceResolver } from './use-resource-resolver'\nimport { useDocumentKey } from './use-document-context'\nimport { useSelector } from './use-selector'\n\nimport { useStylesheetFactory } from './use-stylesheet-factory'\n\nimport {
|
|
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 * as ReactPage from '../../../state/react-page'\nimport { useResourceResolver } from './use-resource-resolver'\nimport { useDocumentKey } from './use-document-context'\nimport { useSelector } from './use-selector'\n\nimport { useStylesheetFactory } from './use-stylesheet-factory'\n\nimport { useResolvableRecord } from './use-resolvable-record'\nimport { propErrorHandlingProxy } from '../utils/prop-error-handling-proxy'\n\nfunction useControlInstances(elementKey: string): Record<string, ControlInstance> | null {\n const documentKey = useDocumentKey()\n\n return useSelector(state => {\n if (documentKey == null) return null\n\n return ReactPage.getPropControllers(state, documentKey, elementKey)\n })\n}\n\ntype CacheItem = {\n data: Data\n control: ControlInstance | undefined\n resolvedValue: Resolvable<unknown>\n}\n\nexport function useResolvedProps(\n propDefs: Record<string, ControlDefinition>,\n elementData: Record<string, Data>,\n elementKey: string,\n): Record<string, unknown> {\n const stylesheetFactory = useStylesheetFactory()\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 = elementData[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, elementData, 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,gBAA2B;AAC3B,mCAAoC;AACpC,kCAA+B;AAC/B,0BAA4B;AAE5B,oCAAqC;AAErC,mCAAoC;AACpC,uCAAuC;AAEvC,SAAS,oBAAoB,YAA4D;AACvF,QAAM,kBAAc,4CAAe;AAEnC,aAAO,iCAAY,WAAS;AAC1B,QAAI,eAAe;AAAM,aAAO;AAEhC,WAAO,UAAU,mBAAmB,OAAO,aAAa,UAAU;AAAA,EACpE,CAAC;AACH;AAQO,SAAS,iBACd,UACA,aACA,YACyB;AACzB,QAAM,wBAAoB,oDAAqB;AAC/C,QAAM,uBAAmB,kDAAoB;AAC7C,QAAM,WAAW,oBAAoB,UAAU;AAE/C,QAAM,YAAQ,qBAAkC,CAAC,CAAC,EAAE;AACpD,QAAM,kBAAc;AAAA,IAClB,CAAC,KAAwB,aAAqB;AAC5C,YAAM,OAAO,YAAY,QAAQ;AACjC,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,aAAa,kBAAkB,iBAAiB;AAAA,EAC7D;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":[]}
|
|
@@ -14,7 +14,7 @@ async function handler(...args) {
|
|
|
14
14
|
const supportsDraftMode = match(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
|
|
15
15
|
const supportsWebhook = match(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
|
|
16
16
|
const body = {
|
|
17
|
-
version: "0.23.7
|
|
17
|
+
version: "0.23.7",
|
|
18
18
|
previewMode: supportsPreviewMode,
|
|
19
19
|
draftMode: supportsDraftMode,
|
|
20
20
|
interactionMode: true,
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useMemo, useRef } from "react";
|
|
2
|
+
function useResolvableRecord(resolvables) {
|
|
3
|
+
const snapshot = useRef({ resolvedValues: {}, dirtyProps: /* @__PURE__ */ new Set() });
|
|
4
|
+
return useMemo(() => {
|
|
5
|
+
return {
|
|
6
|
+
name: "resolvable-record",
|
|
7
|
+
subscribe: (onUpdate) => {
|
|
8
|
+
const unsubscribes = Object.values(resolvables).map((s) => s.subscribe(onUpdate));
|
|
9
|
+
return () => {
|
|
10
|
+
unsubscribes.forEach((u) => u());
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
readStable: () => {
|
|
14
|
+
const nextSnapshot = Object.entries(resolvables).reduce(
|
|
15
|
+
({ dirtyProps, resolvedValues }, [propName, subscription]) => {
|
|
16
|
+
const lastPropValue = snapshot.current.resolvedValues[propName];
|
|
17
|
+
const propValue = subscription.readStable();
|
|
18
|
+
const isDirty = propValue !== lastPropValue;
|
|
19
|
+
return {
|
|
20
|
+
dirtyProps: isDirty ? dirtyProps.add(propName) : dirtyProps,
|
|
21
|
+
resolvedValues: { ...resolvedValues, [propName]: propValue }
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
{ resolvedValues: {}, dirtyProps: /* @__PURE__ */ new Set() }
|
|
25
|
+
);
|
|
26
|
+
if (nextSnapshot.dirtyProps.size > 0) {
|
|
27
|
+
snapshot.current = nextSnapshot;
|
|
28
|
+
}
|
|
29
|
+
return snapshot.current.resolvedValues;
|
|
30
|
+
},
|
|
31
|
+
triggerResolve: async () => {
|
|
32
|
+
return await Promise.all(
|
|
33
|
+
Object.entries(resolvables).map(
|
|
34
|
+
([propName, sub]) => sub.triggerResolve(snapshot.current.resolvedValues[propName])
|
|
35
|
+
)
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}, [resolvables]);
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
useResolvableRecord
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=use-resolvable-record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/runtimes/react/hooks/use-resolvable-record.tsx"],"sourcesContent":["import { type Resolvable } from '@makeswift/controls'\nimport { useMemo, useRef } from 'react'\n\ntype Snapshot = {\n resolvedValues: Record<string, unknown>\n dirtyProps: Set<string>\n}\n\nexport function useResolvableRecord(\n resolvables: Record<string, Resolvable<unknown>>,\n): Resolvable<Record<string, unknown>> {\n const snapshot = useRef<Snapshot>({ resolvedValues: {}, dirtyProps: new Set() })\n\n return useMemo<Resolvable<Record<string, unknown>>>(() => {\n return {\n name: 'resolvable-record',\n subscribe: (onUpdate: () => void): (() => void) => {\n const unsubscribes = Object.values(resolvables).map(s => s.subscribe(onUpdate))\n return () => {\n unsubscribes.forEach(u => u())\n }\n },\n\n readStable: () => {\n const nextSnapshot = Object.entries(resolvables).reduce<Snapshot>(\n ({ dirtyProps, resolvedValues }, [propName, subscription]) => {\n const lastPropValue = snapshot.current.resolvedValues[propName]\n const propValue = subscription.readStable()\n const isDirty = propValue !== lastPropValue\n\n return {\n dirtyProps: isDirty ? dirtyProps.add(propName) : dirtyProps,\n resolvedValues: { ...resolvedValues, [propName]: propValue },\n }\n },\n { resolvedValues: {}, dirtyProps: new Set() },\n )\n\n if (nextSnapshot.dirtyProps.size > 0) {\n snapshot.current = nextSnapshot\n }\n\n return snapshot.current.resolvedValues\n },\n\n triggerResolve: async () => {\n // While we _could_ only trigger resolution on the dirty props, this is\n // not an airtight solution. Some controls will resolve to nullish\n // values even when the underlying data changes, so they won't be dirty\n // (ex: an Image control where the data changes from `undefined` to a\n // file that has not yet been fetched). Even if you add a nullish check\n // on the resolved value, some controls can resolve to non-nullish value\n // when the resolution does not occur (ex: swatches can resolve to\n // black). The true solution is to trigger resolve on underlying data\n // change, and moving these dirtiness optimizations for resolution\n // triggering at the control level.\n return await Promise.all(\n Object.entries(resolvables).map(([propName, sub]) =>\n sub.triggerResolve(snapshot.current.resolvedValues[propName]),\n ),\n )\n },\n }\n }, [resolvables])\n}\n"],"mappings":"AACA,SAAS,SAAS,cAAc;AAOzB,SAAS,oBACd,aACqC;AACrC,QAAM,WAAW,OAAiB,EAAE,gBAAgB,CAAC,GAAG,YAAY,oBAAI,IAAI,EAAE,CAAC;AAE/E,SAAO,QAA6C,MAAM;AACxD,WAAO;AAAA,MACL,MAAM;AAAA,MACN,WAAW,CAAC,aAAuC;AACjD,cAAM,eAAe,OAAO,OAAO,WAAW,EAAE,IAAI,OAAK,EAAE,UAAU,QAAQ,CAAC;AAC9E,eAAO,MAAM;AACX,uBAAa,QAAQ,OAAK,EAAE,CAAC;AAAA,QAC/B;AAAA,MACF;AAAA,MAEA,YAAY,MAAM;AAChB,cAAM,eAAe,OAAO,QAAQ,WAAW,EAAE;AAAA,UAC/C,CAAC,EAAE,YAAY,eAAe,GAAG,CAAC,UAAU,YAAY,MAAM;AAC5D,kBAAM,gBAAgB,SAAS,QAAQ,eAAe,QAAQ;AAC9D,kBAAM,YAAY,aAAa,WAAW;AAC1C,kBAAM,UAAU,cAAc;AAE9B,mBAAO;AAAA,cACL,YAAY,UAAU,WAAW,IAAI,QAAQ,IAAI;AAAA,cACjD,gBAAgB,EAAE,GAAG,gBAAgB,CAAC,QAAQ,GAAG,UAAU;AAAA,YAC7D;AAAA,UACF;AAAA,UACA,EAAE,gBAAgB,CAAC,GAAG,YAAY,oBAAI,IAAI,EAAE;AAAA,QAC9C;AAEA,YAAI,aAAa,WAAW,OAAO,GAAG;AACpC,mBAAS,UAAU;AAAA,QACrB;AAEA,eAAO,SAAS,QAAQ;AAAA,MAC1B;AAAA,MAEA,gBAAgB,YAAY;AAW1B,eAAO,MAAM,QAAQ;AAAA,UACnB,OAAO,QAAQ,WAAW,EAAE;AAAA,YAAI,CAAC,CAAC,UAAU,GAAG,MAC7C,IAAI,eAAe,SAAS,QAAQ,eAAe,QAAQ,CAAC;AAAA,UAC9D;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF,GAAG,CAAC,WAAW,CAAC;AAClB;","names":[]}
|
|
@@ -7,7 +7,7 @@ import { useResourceResolver } from "./use-resource-resolver";
|
|
|
7
7
|
import { useDocumentKey } from "./use-document-context";
|
|
8
8
|
import { useSelector } from "./use-selector";
|
|
9
9
|
import { useStylesheetFactory } from "./use-stylesheet-factory";
|
|
10
|
-
import {
|
|
10
|
+
import { useResolvableRecord } from "./use-resolvable-record";
|
|
11
11
|
import { propErrorHandlingProxy } from "../utils/prop-error-handling-proxy";
|
|
12
12
|
function useControlInstances(elementKey) {
|
|
13
13
|
const documentKey = useDocumentKey();
|
|
@@ -52,10 +52,10 @@ function useResolvedProps(propDefs, elementData, elementKey) {
|
|
|
52
52
|
}),
|
|
53
53
|
[propDefs, resolveProp]
|
|
54
54
|
);
|
|
55
|
-
const props =
|
|
55
|
+
const props = useResolvableRecord(resolvables);
|
|
56
56
|
useEffect(() => {
|
|
57
57
|
props.triggerResolve();
|
|
58
|
-
}, []);
|
|
58
|
+
}, [props]);
|
|
59
59
|
const resolvedProps = useSyncExternalStore(props.subscribe, props.readStable, props.readStable);
|
|
60
60
|
stylesheetFactory.useDefinedStyles();
|
|
61
61
|
return resolvedProps;
|
|
@@ -1 +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 * as ReactPage from '../../../state/react-page'\nimport { useResourceResolver } from './use-resource-resolver'\nimport { useDocumentKey } from './use-document-context'\nimport { useSelector } from './use-selector'\n\nimport { useStylesheetFactory } from './use-stylesheet-factory'\n\nimport {
|
|
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 * as ReactPage from '../../../state/react-page'\nimport { useResourceResolver } from './use-resource-resolver'\nimport { useDocumentKey } from './use-document-context'\nimport { useSelector } from './use-selector'\n\nimport { useStylesheetFactory } from './use-stylesheet-factory'\n\nimport { useResolvableRecord } from './use-resolvable-record'\nimport { propErrorHandlingProxy } from '../utils/prop-error-handling-proxy'\n\nfunction useControlInstances(elementKey: string): Record<string, ControlInstance> | null {\n const documentKey = useDocumentKey()\n\n return useSelector(state => {\n if (documentKey == null) return null\n\n return ReactPage.getPropControllers(state, documentKey, elementKey)\n })\n}\n\ntype CacheItem = {\n data: Data\n control: ControlInstance | undefined\n resolvedValue: Resolvable<unknown>\n}\n\nexport function useResolvedProps(\n propDefs: Record<string, ControlDefinition>,\n elementData: Record<string, Data>,\n elementKey: string,\n): Record<string, unknown> {\n const stylesheetFactory = useStylesheetFactory()\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 = elementData[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, elementData, 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,SAAS,SAAS,WAAW,QAAQ,sBAAsB,mBAAmB;AAC9E;AAAA,EAGE;AAAA,OAGK;AAEP,YAAY,eAAe;AAC3B,SAAS,2BAA2B;AACpC,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAE5B,SAAS,4BAA4B;AAErC,SAAS,2BAA2B;AACpC,SAAS,8BAA8B;AAEvC,SAAS,oBAAoB,YAA4D;AACvF,QAAM,cAAc,eAAe;AAEnC,SAAO,YAAY,WAAS;AAC1B,QAAI,eAAe;AAAM,aAAO;AAEhC,WAAO,UAAU,mBAAmB,OAAO,aAAa,UAAU;AAAA,EACpE,CAAC;AACH;AAQO,SAAS,iBACd,UACA,aACA,YACyB;AACzB,QAAM,oBAAoB,qBAAqB;AAC/C,QAAM,mBAAmB,oBAAoB;AAC7C,QAAM,WAAW,oBAAoB,UAAU;AAE/C,QAAM,QAAQ,OAAkC,CAAC,CAAC,EAAE;AACpD,QAAM,cAAc;AAAA,IAClB,CAAC,KAAwB,aAAqB;AAC5C,YAAM,OAAO,YAAY,QAAQ;AACjC,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,aAAa,kBAAkB,iBAAiB;AAAA,EAC7D;AAEA,QAAM,cAAc;AAAA,IAClB,MACE,UAAU,UAAU,CAAC,KAAK,aAAa;AACrC,YAAM,eAAgB,IAAI,QAAgB;AAC1C,aAAO,uBAAuB,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,QAAQ,oBAAoB,WAAW;AAI7C,YAAU,MAAM;AACd,UAAM,eAAe;AAAA,EACvB,GAAG,CAAC,KAAK,CAAC;AAIV,QAAM,gBAAgB,qBAAqB,MAAM,WAAW,MAAM,YAAY,MAAM,UAAU;AAE9F,oBAAkB,iBAAiB;AAEnC,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-resolvable-record.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/hooks/use-resolvable-record.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAQrD,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,GAC/C,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAsDrC"}
|
package/package.json
CHANGED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var resolvable_record_exports = {};
|
|
20
|
-
__export(resolvable_record_exports, {
|
|
21
|
-
resolvableRecord: () => resolvableRecord
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(resolvable_record_exports);
|
|
24
|
-
function resolvableRecord(resolvables) {
|
|
25
|
-
let resolvedValues = {};
|
|
26
|
-
return {
|
|
27
|
-
name: "resolvable-record",
|
|
28
|
-
subscribe: (onUpdate) => {
|
|
29
|
-
const unsubscribes = Object.values(resolvables).map((s) => s.subscribe(onUpdate));
|
|
30
|
-
return () => {
|
|
31
|
-
unsubscribes.forEach((u) => u());
|
|
32
|
-
};
|
|
33
|
-
},
|
|
34
|
-
readStable: () => {
|
|
35
|
-
const { isDirty, resolved } = Object.entries(resolvables).reduce(
|
|
36
|
-
({ isDirty: isDirty2, resolved: resolved2 }, [propName, subscription]) => {
|
|
37
|
-
const lastPropValue = resolvedValues[propName];
|
|
38
|
-
const propValue = subscription.readStable();
|
|
39
|
-
return {
|
|
40
|
-
isDirty: isDirty2 || propValue !== lastPropValue,
|
|
41
|
-
resolved: {
|
|
42
|
-
...resolved2,
|
|
43
|
-
[propName]: propValue
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
},
|
|
47
|
-
{ isDirty: false, resolved: {} }
|
|
48
|
-
);
|
|
49
|
-
if (isDirty) {
|
|
50
|
-
resolvedValues = resolved;
|
|
51
|
-
}
|
|
52
|
-
return resolvedValues;
|
|
53
|
-
},
|
|
54
|
-
triggerResolve: async () => {
|
|
55
|
-
return await Promise.all(
|
|
56
|
-
Object.entries(resolvables).map(
|
|
57
|
-
([propName, sub]) => sub.triggerResolve(resolvedValues[propName])
|
|
58
|
-
)
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
-
0 && (module.exports = {
|
|
65
|
-
resolvableRecord
|
|
66
|
-
});
|
|
67
|
-
//# sourceMappingURL=resolvable-record.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/runtimes/react/resolvable-record.tsx"],"sourcesContent":["import { type Resolvable } from '@makeswift/controls'\n\nexport function resolvableRecord(\n resolvables: Record<string, Resolvable<unknown>>,\n): Resolvable<Record<string, unknown>> {\n let resolvedValues: Record<string, unknown> = {}\n\n return {\n name: 'resolvable-record',\n subscribe: (onUpdate: () => void): (() => void) => {\n const unsubscribes = Object.values(resolvables).map(s => s.subscribe(onUpdate))\n return () => {\n unsubscribes.forEach(u => u())\n }\n },\n\n readStable: () => {\n const { isDirty, resolved } = Object.entries(resolvables).reduce(\n ({ isDirty, resolved }, [propName, subscription]) => {\n const lastPropValue = resolvedValues[propName]\n const propValue = subscription.readStable()\n return {\n isDirty: isDirty || propValue !== lastPropValue,\n resolved: {\n ...resolved,\n [propName]: propValue,\n },\n }\n },\n { isDirty: false, resolved: {} },\n )\n\n if (isDirty) {\n resolvedValues = resolved\n }\n\n return resolvedValues\n },\n\n triggerResolve: async () => {\n return await Promise.all(\n Object.entries(resolvables).map(([propName, sub]) =>\n sub.triggerResolve(resolvedValues[propName]),\n ),\n )\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,SAAS,iBACd,aACqC;AACrC,MAAI,iBAA0C,CAAC;AAE/C,SAAO;AAAA,IACL,MAAM;AAAA,IACN,WAAW,CAAC,aAAuC;AACjD,YAAM,eAAe,OAAO,OAAO,WAAW,EAAE,IAAI,OAAK,EAAE,UAAU,QAAQ,CAAC;AAC9E,aAAO,MAAM;AACX,qBAAa,QAAQ,OAAK,EAAE,CAAC;AAAA,MAC/B;AAAA,IACF;AAAA,IAEA,YAAY,MAAM;AAChB,YAAM,EAAE,SAAS,SAAS,IAAI,OAAO,QAAQ,WAAW,EAAE;AAAA,QACxD,CAAC,EAAE,SAAAA,UAAS,UAAAC,UAAS,GAAG,CAAC,UAAU,YAAY,MAAM;AACnD,gBAAM,gBAAgB,eAAe,QAAQ;AAC7C,gBAAM,YAAY,aAAa,WAAW;AAC1C,iBAAO;AAAA,YACL,SAASD,YAAW,cAAc;AAAA,YAClC,UAAU;AAAA,cACR,GAAGC;AAAA,cACH,CAAC,QAAQ,GAAG;AAAA,YACd;AAAA,UACF;AAAA,QACF;AAAA,QACA,EAAE,SAAS,OAAO,UAAU,CAAC,EAAE;AAAA,MACjC;AAEA,UAAI,SAAS;AACX,yBAAiB;AAAA,MACnB;AAEA,aAAO;AAAA,IACT;AAAA,IAEA,gBAAgB,YAAY;AAC1B,aAAO,MAAM,QAAQ;AAAA,QACnB,OAAO,QAAQ,WAAW,EAAE;AAAA,UAAI,CAAC,CAAC,UAAU,GAAG,MAC7C,IAAI,eAAe,eAAe,QAAQ,CAAC;AAAA,QAC7C;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":["isDirty","resolved"]}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
function resolvableRecord(resolvables) {
|
|
2
|
-
let resolvedValues = {};
|
|
3
|
-
return {
|
|
4
|
-
name: "resolvable-record",
|
|
5
|
-
subscribe: (onUpdate) => {
|
|
6
|
-
const unsubscribes = Object.values(resolvables).map((s) => s.subscribe(onUpdate));
|
|
7
|
-
return () => {
|
|
8
|
-
unsubscribes.forEach((u) => u());
|
|
9
|
-
};
|
|
10
|
-
},
|
|
11
|
-
readStable: () => {
|
|
12
|
-
const { isDirty, resolved } = Object.entries(resolvables).reduce(
|
|
13
|
-
({ isDirty: isDirty2, resolved: resolved2 }, [propName, subscription]) => {
|
|
14
|
-
const lastPropValue = resolvedValues[propName];
|
|
15
|
-
const propValue = subscription.readStable();
|
|
16
|
-
return {
|
|
17
|
-
isDirty: isDirty2 || propValue !== lastPropValue,
|
|
18
|
-
resolved: {
|
|
19
|
-
...resolved2,
|
|
20
|
-
[propName]: propValue
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
{ isDirty: false, resolved: {} }
|
|
25
|
-
);
|
|
26
|
-
if (isDirty) {
|
|
27
|
-
resolvedValues = resolved;
|
|
28
|
-
}
|
|
29
|
-
return resolvedValues;
|
|
30
|
-
},
|
|
31
|
-
triggerResolve: async () => {
|
|
32
|
-
return await Promise.all(
|
|
33
|
-
Object.entries(resolvables).map(
|
|
34
|
-
([propName, sub]) => sub.triggerResolve(resolvedValues[propName])
|
|
35
|
-
)
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
export {
|
|
41
|
-
resolvableRecord
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=resolvable-record.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/runtimes/react/resolvable-record.tsx"],"sourcesContent":["import { type Resolvable } from '@makeswift/controls'\n\nexport function resolvableRecord(\n resolvables: Record<string, Resolvable<unknown>>,\n): Resolvable<Record<string, unknown>> {\n let resolvedValues: Record<string, unknown> = {}\n\n return {\n name: 'resolvable-record',\n subscribe: (onUpdate: () => void): (() => void) => {\n const unsubscribes = Object.values(resolvables).map(s => s.subscribe(onUpdate))\n return () => {\n unsubscribes.forEach(u => u())\n }\n },\n\n readStable: () => {\n const { isDirty, resolved } = Object.entries(resolvables).reduce(\n ({ isDirty, resolved }, [propName, subscription]) => {\n const lastPropValue = resolvedValues[propName]\n const propValue = subscription.readStable()\n return {\n isDirty: isDirty || propValue !== lastPropValue,\n resolved: {\n ...resolved,\n [propName]: propValue,\n },\n }\n },\n { isDirty: false, resolved: {} },\n )\n\n if (isDirty) {\n resolvedValues = resolved\n }\n\n return resolvedValues\n },\n\n triggerResolve: async () => {\n return await Promise.all(\n Object.entries(resolvables).map(([propName, sub]) =>\n sub.triggerResolve(resolvedValues[propName]),\n ),\n )\n },\n }\n}\n"],"mappings":"AAEO,SAAS,iBACd,aACqC;AACrC,MAAI,iBAA0C,CAAC;AAE/C,SAAO;AAAA,IACL,MAAM;AAAA,IACN,WAAW,CAAC,aAAuC;AACjD,YAAM,eAAe,OAAO,OAAO,WAAW,EAAE,IAAI,OAAK,EAAE,UAAU,QAAQ,CAAC;AAC9E,aAAO,MAAM;AACX,qBAAa,QAAQ,OAAK,EAAE,CAAC;AAAA,MAC/B;AAAA,IACF;AAAA,IAEA,YAAY,MAAM;AAChB,YAAM,EAAE,SAAS,SAAS,IAAI,OAAO,QAAQ,WAAW,EAAE;AAAA,QACxD,CAAC,EAAE,SAAAA,UAAS,UAAAC,UAAS,GAAG,CAAC,UAAU,YAAY,MAAM;AACnD,gBAAM,gBAAgB,eAAe,QAAQ;AAC7C,gBAAM,YAAY,aAAa,WAAW;AAC1C,iBAAO;AAAA,YACL,SAASD,YAAW,cAAc;AAAA,YAClC,UAAU;AAAA,cACR,GAAGC;AAAA,cACH,CAAC,QAAQ,GAAG;AAAA,YACd;AAAA,UACF;AAAA,QACF;AAAA,QACA,EAAE,SAAS,OAAO,UAAU,CAAC,EAAE;AAAA,MACjC;AAEA,UAAI,SAAS;AACX,yBAAiB;AAAA,MACnB;AAEA,aAAO;AAAA,IACT;AAAA,IAEA,gBAAgB,YAAY;AAC1B,aAAO,MAAM,QAAQ;AAAA,QACnB,OAAO,QAAQ,WAAW,EAAE;AAAA,UAAI,CAAC,CAAC,UAAU,GAAG,MAC7C,IAAI,eAAe,eAAe,QAAQ,CAAC;AAAA,QAC7C;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":["isDirty","resolved"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolvable-record.d.ts","sourceRoot":"","sources":["../../../../src/runtimes/react/resolvable-record.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAErD,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,GAC/C,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA2CrC"}
|