@makeswift/runtime 0.29.2 → 0.29.3-canary.0

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.
Files changed (33) hide show
  1. package/dist/cjs/api/graphql-api-client.js +1 -1
  2. package/dist/cjs/api/rest-api-client.js +1 -1
  3. package/dist/cjs/api-handler/handlers/manifest.js +1 -1
  4. package/dist/cjs/client/component-snapshot.js +2 -1
  5. package/dist/cjs/client/component-snapshot.js.map +1 -1
  6. package/dist/cjs/runtimes/react/components/MakeswiftComponent.js +20 -17
  7. package/dist/cjs/runtimes/react/components/MakeswiftComponent.js.map +1 -1
  8. package/dist/cjs/runtimes/react/server/components/snapshot-renderer.js +2 -0
  9. package/dist/cjs/runtimes/react/server/components/snapshot-renderer.js.map +1 -1
  10. package/dist/cjs/state/modules/read-only-documents.js.map +1 -1
  11. package/dist/cjs/state/shared-api/actions.js.map +1 -1
  12. package/dist/esm/api/graphql-api-client.js +1 -1
  13. package/dist/esm/api/rest-api-client.js +1 -1
  14. package/dist/esm/api-handler/handlers/manifest.js +1 -1
  15. package/dist/esm/client/component-snapshot.js +5 -2
  16. package/dist/esm/client/component-snapshot.js.map +1 -1
  17. package/dist/esm/runtimes/react/components/MakeswiftComponent.js +20 -17
  18. package/dist/esm/runtimes/react/components/MakeswiftComponent.js.map +1 -1
  19. package/dist/esm/runtimes/react/server/components/snapshot-renderer.js +2 -0
  20. package/dist/esm/runtimes/react/server/components/snapshot-renderer.js.map +1 -1
  21. package/dist/esm/state/modules/read-only-documents.js.map +1 -1
  22. package/dist/esm/state/shared-api/actions.js.map +1 -1
  23. package/dist/types/client/component-snapshot.d.ts +4 -2
  24. package/dist/types/client/component-snapshot.d.ts.map +1 -1
  25. package/dist/types/runtimes/react/components/MakeswiftComponent.d.ts +4 -1
  26. package/dist/types/runtimes/react/components/MakeswiftComponent.d.ts.map +1 -1
  27. package/dist/types/runtimes/react/server/components/snapshot-renderer.d.ts +1 -1
  28. package/dist/types/runtimes/react/server/components/snapshot-renderer.d.ts.map +1 -1
  29. package/dist/types/state/modules/read-only-documents.d.ts +8 -6
  30. package/dist/types/state/modules/read-only-documents.d.ts.map +1 -1
  31. package/dist/types/state/shared-api/actions.d.ts +2 -6
  32. package/dist/types/state/shared-api/actions.d.ts.map +1 -1
  33. package/package.json +2 -2
@@ -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.29.2"
30
+ "makeswift-runtime-version": "0.29.3-canary.0"
31
31
  });
32
32
  }
33
33
  async getUnversionedResources({
@@ -223,7 +223,7 @@ class MakeswiftRestAPIClient {
223
223
  const requestHeaders = new Headers({
224
224
  "x-api-key": this.apiKey,
225
225
  "makeswift-site-api-key": this.apiKey,
226
- "makeswift-runtime-version": "0.29.2"
226
+ "makeswift-runtime-version": "0.29.3-canary.0"
227
227
  });
228
228
  if (siteVersion?.token) {
229
229
  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.29.2",
31
+ version: "0.29.3-canary.0",
32
32
  interactionMode: true,
33
33
  clientSideNavigation: false,
34
34
  elementFromPoint: false,
@@ -29,6 +29,7 @@ function componentDocumentToRootEmbeddedDocument({
29
29
  name,
30
30
  type,
31
31
  description,
32
+ internal_MakeswiftBuilderData,
32
33
  meta
33
34
  }) {
34
35
  const { data: rootElement, locale, id } = document;
@@ -51,7 +52,7 @@ function componentDocumentToRootEmbeddedDocument({
51
52
  id,
52
53
  type,
53
54
  name,
54
- meta: { ...meta, description },
55
+ meta: { ...meta, description, internal_MakeswiftBuilderData },
55
56
  __type: import_read_only_documents.EMBEDDED_DOCUMENT_TYPE
56
57
  };
57
58
  return rootDocument;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/client/component-snapshot.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { type CacheData } from '../api/api-resources-client'\n\nimport { EMBEDDED_DOCUMENT_TYPE, type EmbeddedDocument } from '../state/modules/read-only-documents'\n\nimport { deterministicUUID } from '../utils/deterministic-uuid'\n\nimport * as Schema from './schema/component-document'\n\nexport type MakeswiftComponentDocument = z.infer<typeof Schema.componentDocument>\nexport type MakeswiftComponentDocumentFallback = z.infer<typeof Schema.componentDocumentFallback>\n\nexport type MakeswiftComponentMetadata = {\n allowLocaleFallback: boolean\n requestedLocale: string | null\n}\n\nexport function componentDocumentToRootEmbeddedDocument({\n document,\n documentKey,\n name,\n type,\n description,\n meta,\n}: {\n document: MakeswiftComponentDocument | MakeswiftComponentDocumentFallback\n documentKey: string\n name: string\n type: string\n description?: string\n meta: MakeswiftComponentMetadata\n}): EmbeddedDocument {\n const { data: rootElement, locale, id } = document\n\n if (rootElement != null && rootElement.type !== type) {\n throw new Error(\n `Type \"${rootElement.type}\" does not match the expected type \"${type}\" from the snapshot`,\n )\n }\n\n const rootDocument: EmbeddedDocument = {\n key: documentKey,\n rootElement: rootElement ?? {\n // Fallback rootElement\n // Create a stable uuid so two different clients will have the same empty element data.\n // This is needed to make presence feature work for an element that is not yet created.\n key: deterministicUUID({ id, locale, seed: documentKey }),\n type,\n props: {},\n },\n locale,\n id,\n type,\n name,\n meta: { ...meta, description },\n __type: EMBEDDED_DOCUMENT_TYPE,\n }\n\n return rootDocument\n}\n\nexport type MakeswiftComponentSnapshot = {\n document: MakeswiftComponentDocument | MakeswiftComponentDocumentFallback\n key: string\n cacheData: CacheData\n meta: MakeswiftComponentMetadata\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,iCAA8D;AAE9D,gCAAkC;AAY3B,SAAS,wCAAwC;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAOqB;AACnB,QAAM,EAAE,MAAM,aAAa,QAAQ,GAAG,IAAI;AAE1C,MAAI,eAAe,QAAQ,YAAY,SAAS,MAAM;AACpD,UAAM,IAAI;AAAA,MACR,SAAS,YAAY,IAAI,uCAAuC,IAAI;AAAA,IACtE;AAAA,EACF;AAEA,QAAM,eAAiC;AAAA,IACrC,KAAK;AAAA,IACL,aAAa,eAAe;AAAA;AAAA;AAAA;AAAA,MAI1B,SAAK,6CAAkB,EAAE,IAAI,QAAQ,MAAM,YAAY,CAAC;AAAA,MACxD;AAAA,MACA,OAAO,CAAC;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM,EAAE,GAAG,MAAM,YAAY;AAAA,IAC7B,QAAQ;AAAA,EACV;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/client/component-snapshot.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { type CacheData } from '../api/api-resources-client'\n\nimport {\n type Data,\n EMBEDDED_DOCUMENT_TYPE,\n type EmbeddedDocument,\n} from '../state/modules/read-only-documents'\n\nimport { deterministicUUID } from '../utils/deterministic-uuid'\n\nimport * as Schema from './schema/component-document'\n\nexport type MakeswiftComponentDocument = z.infer<typeof Schema.componentDocument>\nexport type MakeswiftComponentDocumentFallback = z.infer<typeof Schema.componentDocumentFallback>\n\nexport type MakeswiftComponentMetadata = {\n allowLocaleFallback: boolean\n requestedLocale: string | null\n}\n\nexport function componentDocumentToRootEmbeddedDocument({\n document,\n documentKey,\n name,\n type,\n description,\n internal_MakeswiftBuilderData,\n meta,\n}: {\n document: MakeswiftComponentDocument | MakeswiftComponentDocumentFallback\n documentKey: string\n name: string\n type: string\n description?: string\n /** For internal Makeswift builder use only */\n internal_MakeswiftBuilderData?: Data\n meta: MakeswiftComponentMetadata\n}): EmbeddedDocument {\n const { data: rootElement, locale, id } = document\n\n if (rootElement != null && rootElement.type !== type) {\n throw new Error(\n `Type \"${rootElement.type}\" does not match the expected type \"${type}\" from the snapshot`,\n )\n }\n\n const rootDocument: EmbeddedDocument = {\n key: documentKey,\n rootElement: rootElement ?? {\n // Fallback rootElement\n // Create a stable uuid so two different clients will have the same empty element data.\n // This is needed to make presence feature work for an element that is not yet created.\n key: deterministicUUID({ id, locale, seed: documentKey }),\n type,\n props: {},\n },\n locale,\n id,\n type,\n name,\n meta: { ...meta, description, internal_MakeswiftBuilderData },\n __type: EMBEDDED_DOCUMENT_TYPE,\n }\n\n return rootDocument\n}\n\nexport type MakeswiftComponentSnapshot = {\n document: MakeswiftComponentDocument | MakeswiftComponentDocumentFallback\n key: string\n cacheData: CacheData\n meta: MakeswiftComponentMetadata\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,iCAIO;AAEP,gCAAkC;AAY3B,SAAS,wCAAwC;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GASqB;AACnB,QAAM,EAAE,MAAM,aAAa,QAAQ,GAAG,IAAI;AAE1C,MAAI,eAAe,QAAQ,YAAY,SAAS,MAAM;AACpD,UAAM,IAAI;AAAA,MACR,SAAS,YAAY,IAAI,uCAAuC,IAAI;AAAA,IACtE;AAAA,EACF;AAEA,QAAM,eAAiC;AAAA,IACrC,KAAK;AAAA,IACL,aAAa,eAAe;AAAA;AAAA;AAAA;AAAA,MAI1B,SAAK,6CAAkB,EAAE,IAAI,QAAQ,MAAM,YAAY,CAAC;AAAA,MACxD;AAAA,MACA,OAAO,CAAC;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM,EAAE,GAAG,MAAM,aAAa,8BAA8B;AAAA,IAC5D,QAAQ;AAAA,EACV;AAEA,SAAO;AACT;","names":[]}
@@ -31,23 +31,26 @@ var import_use_register_document = require("../hooks/use-register-document");
31
31
  var import_use_builtin_suspense = require("../hooks/use-builtin-suspense");
32
32
  var import_activity_with_fallback = require("./activity-with-fallback");
33
33
  var import_DocumentRoot = require("./DocumentRoot");
34
- const MakeswiftComponent = (0, import_react.memo)(({ snapshot, label, type, description }) => {
35
- (0, import_use_cache_data.useCacheData)(snapshot.cacheData);
36
- const rootDocument = (0, import_react.useMemo)(
37
- () => (0, import_client.componentDocumentToRootEmbeddedDocument)({
38
- document: snapshot.document,
39
- documentKey: snapshot.key,
40
- name: label,
41
- type,
42
- description,
43
- meta: snapshot.meta
44
- }),
45
- [snapshot, label, type, description]
46
- );
47
- (0, import_use_register_document.useRegisterDocument)(rootDocument);
48
- const builtinSuspense = (0, import_use_builtin_suspense.useBuiltinSuspense)((0, import_read_only_state.getRootElement)(rootDocument).type);
49
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_activity_with_fallback.ActivityOrFallback, { suspenseFallback: builtinSuspense, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DocumentRoot.DocumentRoot, { rootDocument }) });
50
- });
34
+ const MakeswiftComponent = (0, import_react.memo)(
35
+ ({ snapshot, label, type, description, internal_MakeswiftBuilderData }) => {
36
+ (0, import_use_cache_data.useCacheData)(snapshot.cacheData);
37
+ const rootDocument = (0, import_react.useMemo)(
38
+ () => (0, import_client.componentDocumentToRootEmbeddedDocument)({
39
+ document: snapshot.document,
40
+ documentKey: snapshot.key,
41
+ name: label,
42
+ type,
43
+ description,
44
+ internal_MakeswiftBuilderData,
45
+ meta: snapshot.meta
46
+ }),
47
+ [snapshot, label, type, description, internal_MakeswiftBuilderData]
48
+ );
49
+ (0, import_use_register_document.useRegisterDocument)(rootDocument);
50
+ const builtinSuspense = (0, import_use_builtin_suspense.useBuiltinSuspense)((0, import_read_only_state.getRootElement)(rootDocument).type);
51
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_activity_with_fallback.ActivityOrFallback, { suspenseFallback: builtinSuspense, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DocumentRoot.DocumentRoot, { rootDocument }) });
52
+ }
53
+ );
51
54
  // Annotate the CommonJS export names for ESM import in node:
52
55
  0 && (module.exports = {
53
56
  MakeswiftComponent
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/runtimes/react/components/MakeswiftComponent.tsx"],"sourcesContent":["'use client'\n\nimport { memo, useMemo } from 'react'\n\nimport {\n componentDocumentToRootEmbeddedDocument,\n MakeswiftComponentSnapshot,\n} from '../../../client'\nimport { getRootElement } from '../../../state/read-only-state'\n\nimport { useCacheData } from '../hooks/use-cache-data'\nimport { useRegisterDocument } from '../hooks/use-register-document'\nimport { useBuiltinSuspense } from '../hooks/use-builtin-suspense'\nimport { ActivityOrFallback } from './activity-with-fallback'\n\nimport { DocumentRoot } from './DocumentRoot'\n\ntype Props = {\n snapshot: MakeswiftComponentSnapshot\n label: string\n type: string\n description?: string\n}\n\nexport const MakeswiftComponent = memo(({ snapshot, label, type, description }: Props) => {\n useCacheData(snapshot.cacheData)\n\n const rootDocument = useMemo(\n () =>\n componentDocumentToRootEmbeddedDocument({\n document: snapshot.document,\n documentKey: snapshot.key,\n name: label,\n type,\n description,\n meta: snapshot.meta,\n }),\n [snapshot, label, type, description],\n )\n\n useRegisterDocument(rootDocument)\n\n const builtinSuspense = useBuiltinSuspense(getRootElement(rootDocument).type)\n\n return (\n <ActivityOrFallback suspenseFallback={builtinSuspense}>\n <DocumentRoot rootDocument={rootDocument} />\n </ActivityOrFallback>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8CM;AA5CN,mBAA8B;AAE9B,oBAGO;AACP,6BAA+B;AAE/B,4BAA6B;AAC7B,mCAAoC;AACpC,kCAAmC;AACnC,oCAAmC;AAEnC,0BAA6B;AAStB,MAAM,yBAAqB,mBAAK,CAAC,EAAE,UAAU,OAAO,MAAM,YAAY,MAAa;AACxF,0CAAa,SAAS,SAAS;AAE/B,QAAM,mBAAe;AAAA,IACnB,UACE,uDAAwC;AAAA,MACtC,UAAU,SAAS;AAAA,MACnB,aAAa,SAAS;AAAA,MACtB,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA,MAAM,SAAS;AAAA,IACjB,CAAC;AAAA,IACH,CAAC,UAAU,OAAO,MAAM,WAAW;AAAA,EACrC;AAEA,wDAAoB,YAAY;AAEhC,QAAM,sBAAkB,oDAAmB,uCAAe,YAAY,EAAE,IAAI;AAE5E,SACE,4CAAC,oDAAmB,kBAAkB,iBACpC,sDAAC,oCAAa,cAA4B,GAC5C;AAEJ,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../../../src/runtimes/react/components/MakeswiftComponent.tsx"],"sourcesContent":["'use client'\n\nimport { memo, useMemo } from 'react'\n\nimport {\n componentDocumentToRootEmbeddedDocument,\n MakeswiftComponentSnapshot,\n} from '../../../client'\nimport { type Data } from '../../../state/modules/read-only-documents'\nimport { getRootElement } from '../../../state/read-only-state'\n\nimport { useCacheData } from '../hooks/use-cache-data'\nimport { useRegisterDocument } from '../hooks/use-register-document'\nimport { useBuiltinSuspense } from '../hooks/use-builtin-suspense'\nimport { ActivityOrFallback } from './activity-with-fallback'\n\nimport { DocumentRoot } from './DocumentRoot'\n\ntype Props = {\n snapshot: MakeswiftComponentSnapshot\n label: string\n type: string\n description?: string\n /** For internal Makeswift builder use only */\n internal_MakeswiftBuilderData?: Data\n}\n\nexport const MakeswiftComponent = memo(\n ({ snapshot, label, type, description, internal_MakeswiftBuilderData }: Props) => {\n useCacheData(snapshot.cacheData)\n\n const rootDocument = useMemo(\n () =>\n componentDocumentToRootEmbeddedDocument({\n document: snapshot.document,\n documentKey: snapshot.key,\n name: label,\n type,\n description,\n internal_MakeswiftBuilderData,\n meta: snapshot.meta,\n }),\n [snapshot, label, type, description, internal_MakeswiftBuilderData],\n )\n\n useRegisterDocument(rootDocument)\n\n const builtinSuspense = useBuiltinSuspense(getRootElement(rootDocument).type)\n\n return (\n <ActivityOrFallback suspenseFallback={builtinSuspense}>\n <DocumentRoot rootDocument={rootDocument} />\n </ActivityOrFallback>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmDQ;AAjDR,mBAA8B;AAE9B,oBAGO;AAEP,6BAA+B;AAE/B,4BAA6B;AAC7B,mCAAoC;AACpC,kCAAmC;AACnC,oCAAmC;AAEnC,0BAA6B;AAWtB,MAAM,yBAAqB;AAAA,EAChC,CAAC,EAAE,UAAU,OAAO,MAAM,aAAa,8BAA8B,MAAa;AAChF,4CAAa,SAAS,SAAS;AAE/B,UAAM,mBAAe;AAAA,MACnB,UACE,uDAAwC;AAAA,QACtC,UAAU,SAAS;AAAA,QACnB,aAAa,SAAS;AAAA,QACtB,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,QACA,MAAM,SAAS;AAAA,MACjB,CAAC;AAAA,MACH,CAAC,UAAU,OAAO,MAAM,aAAa,6BAA6B;AAAA,IACpE;AAEA,0DAAoB,YAAY;AAEhC,UAAM,sBAAkB,oDAAmB,uCAAe,YAAY,EAAE,IAAI;AAE5E,WACE,4CAAC,oDAAmB,kBAAkB,iBACpC,sDAAC,oCAAa,cAA4B,GAC5C;AAAA,EAEJ;AACF;","names":[]}
@@ -30,6 +30,7 @@ const RSCSnapshotRenderer = ({
30
30
  label,
31
31
  type,
32
32
  description,
33
+ internal_MakeswiftBuilderData,
33
34
  children
34
35
  }) => {
35
36
  const rootDocument = (0, import_component_snapshot.componentDocumentToRootEmbeddedDocument)({
@@ -38,6 +39,7 @@ const RSCSnapshotRenderer = ({
38
39
  name: label,
39
40
  type,
40
41
  description,
42
+ internal_MakeswiftBuilderData,
41
43
  meta: snapshot.meta
42
44
  });
43
45
  const context = (0, import_render_context.getRenderContext)();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/runtimes/react/server/components/snapshot-renderer.tsx"],"sourcesContent":["import { type ComponentProps, type PropsWithChildren } from 'react'\n\nimport { componentDocumentToRootEmbeddedDocument } from '../../../../client/component-snapshot'\nimport { MakeswiftComponent } from '../../components/MakeswiftComponent'\n\nimport { getRenderContext } from '../render-context'\n\nimport { RSCRenderer } from './renderer'\n\n/**\n * High-level helper for rendering server versions of snapshot-backed components\n * (`MakeswiftComponent`, `Slot`). Creates a root document from the snapshot\n * and delegates to `RSCRenderer` to render the server elements and make them\n * editable on the client.\n */\nexport const RSCSnapshotRenderer = ({\n snapshot,\n label,\n type,\n description,\n children,\n}: PropsWithChildren<ComponentProps<typeof MakeswiftComponent>>) => {\n const rootDocument = componentDocumentToRootEmbeddedDocument({\n document: snapshot.document,\n documentKey: snapshot.key,\n name: label,\n type,\n description,\n meta: snapshot.meta,\n })\n\n const context = getRenderContext()\n\n return (\n <RSCRenderer context={context} cacheData={snapshot.cacheData} document={rootDocument}>\n {children}\n </RSCRenderer>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkCI;AAhCJ,gCAAwD;AAGxD,4BAAiC;AAEjC,sBAA4B;AAQrB,MAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAoE;AAClE,QAAM,mBAAe,mEAAwC;AAAA,IAC3D,UAAU,SAAS;AAAA,IACnB,aAAa,SAAS;AAAA,IACtB,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,MAAM,SAAS;AAAA,EACjB,CAAC;AAED,QAAM,cAAU,wCAAiB;AAEjC,SACE,4CAAC,+BAAY,SAAkB,WAAW,SAAS,WAAW,UAAU,cACrE,UACH;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../../../../src/runtimes/react/server/components/snapshot-renderer.tsx"],"sourcesContent":["import { type ComponentProps, type PropsWithChildren } from 'react'\n\nimport { componentDocumentToRootEmbeddedDocument } from '../../../../client/component-snapshot'\nimport { MakeswiftComponent } from '../../components/MakeswiftComponent'\n\nimport { getRenderContext } from '../render-context'\n\nimport { RSCRenderer } from './renderer'\n\n/**\n * High-level helper for rendering server versions of snapshot-backed components\n * (`MakeswiftComponent`, `Slot`). Creates a root document from the snapshot\n * and delegates to `RSCRenderer` to render the server elements and make them\n * editable on the client.\n */\nexport const RSCSnapshotRenderer = ({\n snapshot,\n label,\n type,\n description,\n internal_MakeswiftBuilderData,\n children,\n}: PropsWithChildren<ComponentProps<typeof MakeswiftComponent>>) => {\n const rootDocument = componentDocumentToRootEmbeddedDocument({\n document: snapshot.document,\n documentKey: snapshot.key,\n name: label,\n type,\n description,\n internal_MakeswiftBuilderData,\n meta: snapshot.meta,\n })\n\n const context = getRenderContext()\n\n return (\n <RSCRenderer context={context} cacheData={snapshot.cacheData} document={rootDocument}>\n {children}\n </RSCRenderer>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCI;AAlCJ,gCAAwD;AAGxD,4BAAiC;AAEjC,sBAA4B;AAQrB,MAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAoE;AAClE,QAAM,mBAAe,mEAAwC;AAAA,IAC3D,UAAU,SAAS;AAAA,IACnB,aAAa,SAAS;AAAA,IACtB,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM,SAAS;AAAA,EACjB,CAAC;AAED,QAAM,cAAU,wCAAiB;AAEjC,SACE,4CAAC,+BAAY,SAAkB,WAAW,SAAS,WAAW,UAAU,cACrE,UACH;AAEJ;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/state/modules/read-only-documents.ts"],"sourcesContent":["import { type Element } from '@makeswift/controls'\n\nimport { type Action, type UnknownAction, type DocumentPayload, isKnownAction } from '../actions'\n\nimport { SharedActionTypes } from '../shared-api'\n\nexport {\n type Data,\n type ElementData,\n type ElementReference,\n type Element,\n isElementReference,\n} from '@makeswift/controls'\n\nexport type DocumentReference = {\n key: string\n}\n\nexport function createDocumentReference(key: string): DocumentReference {\n return { key }\n}\n\ntype BaseDocument = {\n key: string\n rootElement: Element\n locale: string | null\n}\n\nexport const EMBEDDED_DOCUMENT_TYPE = 'EMBEDDED_DOCUMENT' as const\n\nexport type EmbeddedDocument = {\n key: string\n locale: string | null\n id: string\n type: string\n name: string\n rootElement: Element\n meta: { allowLocaleFallback: boolean; requestedLocale: string | null; description?: string }\n __type: typeof EMBEDDED_DOCUMENT_TYPE\n}\n\nexport type Document = BaseDocument | EmbeddedDocument\n\nexport function getRootElement(document: Document | DocumentPayload): Element {\n return document.rootElement\n}\n\nexport function createBaseDocument(\n key: string,\n rootElement: Element,\n locale: string | null,\n): Document {\n return { key, rootElement, locale }\n}\n\nexport type State = Map<string, Document>\n\nexport function getInitialState({ documents = [] }: { documents?: Document[] } = {}): State {\n return new Map(documents.map(document => [document.key, document]))\n}\n\nexport function getDocuments(state: State): State {\n return state\n}\n\nexport function getDocument(state: State, documentKey: string): Document | null {\n return getDocuments(state).get(documentKey) ?? null\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 SharedActionTypes.REGISTER_DOCUMENT:\n const { documentKey, document } = action.payload\n return new Map(state).set(documentKey, { ...document, locale: document.locale ?? null })\n\n case SharedActionTypes.UNREGISTER_DOCUMENT: {\n const nextState = new Map(state)\n\n const deleted = nextState.delete(action.payload.documentKey)\n\n return deleted ? nextState : state\n }\n\n default:\n return state\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAAqF;AAErF,wBAAkC;AAElC,IAAAA,mBAMO;AAMA,SAAS,wBAAwB,KAAgC;AACtE,SAAO,EAAE,IAAI;AACf;AAQO,MAAM,yBAAyB;AAe/B,SAAS,eAAe,UAA+C;AAC5E,SAAO,SAAS;AAClB;AAEO,SAAS,mBACd,KACA,aACA,QACU;AACV,SAAO,EAAE,KAAK,aAAa,OAAO;AACpC;AAIO,SAAS,gBAAgB,EAAE,YAAY,CAAC,EAAE,IAAgC,CAAC,GAAU;AAC1F,SAAO,IAAI,IAAI,UAAU,IAAI,cAAY,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC;AACpE;AAEO,SAAS,aAAa,OAAqB;AAChD,SAAO;AACT;AAEO,SAAS,YAAY,OAAc,aAAsC;AAC9E,SAAO,aAAa,KAAK,EAAE,IAAI,WAAW,KAAK;AACjD;AAEO,SAAS,QAAQ,QAAe,gBAAgB,GAAG,QAAuC;AAC/F,MAAI,KAAC,8BAAc,MAAM;AAAG,WAAO;AAEnC,UAAQ,OAAO,MAAM;AAAA,IACnB,KAAK,oCAAkB;AACrB,YAAM,EAAE,aAAa,SAAS,IAAI,OAAO;AACzC,aAAO,IAAI,IAAI,KAAK,EAAE,IAAI,aAAa,EAAE,GAAG,UAAU,QAAQ,SAAS,UAAU,KAAK,CAAC;AAAA,IAEzF,KAAK,oCAAkB,qBAAqB;AAC1C,YAAM,YAAY,IAAI,IAAI,KAAK;AAE/B,YAAM,UAAU,UAAU,OAAO,OAAO,QAAQ,WAAW;AAE3D,aAAO,UAAU,YAAY;AAAA,IAC/B;AAAA,IAEA;AACE,aAAO;AAAA,EACX;AACF;","names":["import_controls"]}
1
+ {"version":3,"sources":["../../../../src/state/modules/read-only-documents.ts"],"sourcesContent":["import { type Data, type Element } from '@makeswift/controls'\n\nimport { type Action, type UnknownAction, type DocumentPayload, isKnownAction } from '../actions'\n\nimport { SharedActionTypes } from '../shared-api'\n\nexport {\n type Data,\n type ElementData,\n type ElementReference,\n type Element,\n isElementReference,\n} from '@makeswift/controls'\n\nexport type DocumentReference = {\n key: string\n}\n\nexport function createDocumentReference(key: string): DocumentReference {\n return { key }\n}\n\ntype BaseDocument = {\n key: string\n rootElement: Element\n locale: string | null\n}\n\nexport const EMBEDDED_DOCUMENT_TYPE = 'EMBEDDED_DOCUMENT' as const\n\nexport type EmbeddedDocumentMeta = {\n allowLocaleFallback: boolean\n requestedLocale: string | null\n description?: string\n internal_MakeswiftBuilderData?: Data\n}\n\nexport type EmbeddedDocument = {\n key: string\n locale: string | null\n id: string\n type: string\n name: string\n rootElement: Element\n meta: EmbeddedDocumentMeta\n __type: typeof EMBEDDED_DOCUMENT_TYPE\n}\n\nexport type Document = BaseDocument | EmbeddedDocument\n\nexport function getRootElement(document: Document | DocumentPayload): Element {\n return document.rootElement\n}\n\nexport function createBaseDocument(\n key: string,\n rootElement: Element,\n locale: string | null,\n): Document {\n return { key, rootElement, locale }\n}\n\nexport type State = Map<string, Document>\n\nexport function getInitialState({ documents = [] }: { documents?: Document[] } = {}): State {\n return new Map(documents.map(document => [document.key, document]))\n}\n\nexport function getDocuments(state: State): State {\n return state\n}\n\nexport function getDocument(state: State, documentKey: string): Document | null {\n return getDocuments(state).get(documentKey) ?? null\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 SharedActionTypes.REGISTER_DOCUMENT:\n const { documentKey, document } = action.payload\n return new Map(state).set(documentKey, { ...document, locale: document.locale ?? null })\n\n case SharedActionTypes.UNREGISTER_DOCUMENT: {\n const nextState = new Map(state)\n\n const deleted = nextState.delete(action.payload.documentKey)\n\n return deleted ? nextState : state\n }\n\n default:\n return state\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAAqF;AAErF,wBAAkC;AAElC,IAAAA,mBAMO;AAMA,SAAS,wBAAwB,KAAgC;AACtE,SAAO,EAAE,IAAI;AACf;AAQO,MAAM,yBAAyB;AAsB/B,SAAS,eAAe,UAA+C;AAC5E,SAAO,SAAS;AAClB;AAEO,SAAS,mBACd,KACA,aACA,QACU;AACV,SAAO,EAAE,KAAK,aAAa,OAAO;AACpC;AAIO,SAAS,gBAAgB,EAAE,YAAY,CAAC,EAAE,IAAgC,CAAC,GAAU;AAC1F,SAAO,IAAI,IAAI,UAAU,IAAI,cAAY,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC;AACpE;AAEO,SAAS,aAAa,OAAqB;AAChD,SAAO;AACT;AAEO,SAAS,YAAY,OAAc,aAAsC;AAC9E,SAAO,aAAa,KAAK,EAAE,IAAI,WAAW,KAAK;AACjD;AAEO,SAAS,QAAQ,QAAe,gBAAgB,GAAG,QAAuC;AAC/F,MAAI,KAAC,8BAAc,MAAM;AAAG,WAAO;AAEnC,UAAQ,OAAO,MAAM;AAAA,IACnB,KAAK,oCAAkB;AACrB,YAAM,EAAE,aAAa,SAAS,IAAI,OAAO;AACzC,aAAO,IAAI,IAAI,KAAK,EAAE,IAAI,aAAa,EAAE,GAAG,UAAU,QAAQ,SAAS,UAAU,KAAK,CAAC;AAAA,IAEzF,KAAK,oCAAkB,qBAAqB;AAC1C,YAAM,YAAY,IAAI,IAAI,KAAK;AAE/B,YAAM,UAAU,UAAU,OAAO,OAAO,QAAQ,WAAW;AAE3D,aAAO,UAAU,YAAY;AAAA,IAC/B;AAAA,IAEA;AACE,aAAO;AAAA,EACX;AACF;","names":["import_controls"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/state/shared-api/actions.ts"],"sourcesContent":["import { type ThunkAction } from '@reduxjs/toolkit'\n\nimport { type Element, type Document, EMBEDDED_DOCUMENT_TYPE } from '../modules/read-only-documents'\n\nimport { SharedActionTypes } from './action-types'\n\ntype DocumentPayloadBaseDocument = {\n key: string\n rootElement: Element\n locale?: string | null // older versions of the runtime may not provide this field\n}\n\ntype DocumentPayloadEmbeddedDocument = {\n key: string\n locale: string | null\n id: string\n type: string\n name: string\n rootElement: Element\n meta: { allowLocaleFallback: boolean; requestedLocale: string | null; description?: string }\n __type: typeof EMBEDDED_DOCUMENT_TYPE\n}\n\nexport type DocumentPayload = DocumentPayloadBaseDocument | DocumentPayloadEmbeddedDocument\n\ntype MakeswiftConnectionInitAction = { type: typeof SharedActionTypes.MAKESWIFT_CONNECTION_INIT }\n\ntype RegisterDocumentAction = {\n type: typeof SharedActionTypes.REGISTER_DOCUMENT\n payload: { documentKey: string; document: DocumentPayload }\n}\n\ntype UnregisterDocumentAction = {\n type: typeof SharedActionTypes.UNREGISTER_DOCUMENT\n payload: { documentKey: string }\n}\n\nexport type SharedAction =\n | MakeswiftConnectionInitAction\n | RegisterDocumentAction\n | UnregisterDocumentAction\n\nexport function makeswiftConnectionInit(): MakeswiftConnectionInitAction {\n return {\n type: SharedActionTypes.MAKESWIFT_CONNECTION_INIT,\n }\n}\n\nexport function registerDocument(document: Document): RegisterDocumentAction {\n return {\n type: SharedActionTypes.REGISTER_DOCUMENT,\n payload: { documentKey: document.key, document },\n }\n}\n\nexport function unregisterDocument(documentKey: string): UnregisterDocumentAction {\n return { type: SharedActionTypes.UNREGISTER_DOCUMENT, payload: { documentKey } }\n}\n\nexport function registerDocumentsEffect(\n documents: Document[],\n): ThunkAction<() => void, unknown, unknown, SharedAction> {\n return dispatch => {\n documents.forEach(document => dispatch(registerDocument(document)))\n\n return () => {\n documents.forEach(document => dispatch(unregisterDocument(document.key)))\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,0BAAkC;AAsC3B,SAAS,0BAAyD;AACvE,SAAO;AAAA,IACL,MAAM,sCAAkB;AAAA,EAC1B;AACF;AAEO,SAAS,iBAAiB,UAA4C;AAC3E,SAAO;AAAA,IACL,MAAM,sCAAkB;AAAA,IACxB,SAAS,EAAE,aAAa,SAAS,KAAK,SAAS;AAAA,EACjD;AACF;AAEO,SAAS,mBAAmB,aAA+C;AAChF,SAAO,EAAE,MAAM,sCAAkB,qBAAqB,SAAS,EAAE,YAAY,EAAE;AACjF;AAEO,SAAS,wBACd,WACyD;AACzD,SAAO,cAAY;AACjB,cAAU,QAAQ,cAAY,SAAS,iBAAiB,QAAQ,CAAC,CAAC;AAElE,WAAO,MAAM;AACX,gBAAU,QAAQ,cAAY,SAAS,mBAAmB,SAAS,GAAG,CAAC,CAAC;AAAA,IAC1E;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/state/shared-api/actions.ts"],"sourcesContent":["import { type ThunkAction } from '@reduxjs/toolkit'\n\nimport {\n type Element,\n type Document,\n type EmbeddedDocumentMeta,\n EMBEDDED_DOCUMENT_TYPE,\n} from '../modules/read-only-documents'\n\nimport { SharedActionTypes } from './action-types'\n\ntype DocumentPayloadBaseDocument = {\n key: string\n rootElement: Element\n locale?: string | null // older versions of the runtime may not provide this field\n}\n\ntype DocumentPayloadEmbeddedDocument = {\n key: string\n locale: string | null\n id: string\n type: string\n name: string\n rootElement: Element\n meta: EmbeddedDocumentMeta\n __type: typeof EMBEDDED_DOCUMENT_TYPE\n}\n\nexport type DocumentPayload = DocumentPayloadBaseDocument | DocumentPayloadEmbeddedDocument\n\ntype MakeswiftConnectionInitAction = { type: typeof SharedActionTypes.MAKESWIFT_CONNECTION_INIT }\n\ntype RegisterDocumentAction = {\n type: typeof SharedActionTypes.REGISTER_DOCUMENT\n payload: { documentKey: string; document: DocumentPayload }\n}\n\ntype UnregisterDocumentAction = {\n type: typeof SharedActionTypes.UNREGISTER_DOCUMENT\n payload: { documentKey: string }\n}\n\nexport type SharedAction =\n | MakeswiftConnectionInitAction\n | RegisterDocumentAction\n | UnregisterDocumentAction\n\nexport function makeswiftConnectionInit(): MakeswiftConnectionInitAction {\n return {\n type: SharedActionTypes.MAKESWIFT_CONNECTION_INIT,\n }\n}\n\nexport function registerDocument(document: Document): RegisterDocumentAction {\n return {\n type: SharedActionTypes.REGISTER_DOCUMENT,\n payload: { documentKey: document.key, document },\n }\n}\n\nexport function unregisterDocument(documentKey: string): UnregisterDocumentAction {\n return { type: SharedActionTypes.UNREGISTER_DOCUMENT, payload: { documentKey } }\n}\n\nexport function registerDocumentsEffect(\n documents: Document[],\n): ThunkAction<() => void, unknown, unknown, SharedAction> {\n return dispatch => {\n documents.forEach(document => dispatch(registerDocument(document)))\n\n return () => {\n documents.forEach(document => dispatch(unregisterDocument(document.key)))\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,0BAAkC;AAsC3B,SAAS,0BAAyD;AACvE,SAAO;AAAA,IACL,MAAM,sCAAkB;AAAA,EAC1B;AACF;AAEO,SAAS,iBAAiB,UAA4C;AAC3E,SAAO;AAAA,IACL,MAAM,sCAAkB;AAAA,IACxB,SAAS,EAAE,aAAa,SAAS,KAAK,SAAS;AAAA,EACjD;AACF;AAEO,SAAS,mBAAmB,aAA+C;AAChF,SAAO,EAAE,MAAM,sCAAkB,qBAAqB,SAAS,EAAE,YAAY,EAAE;AACjF;AAEO,SAAS,wBACd,WACyD;AACzD,SAAO,cAAY;AACjB,cAAU,QAAQ,cAAY,SAAS,iBAAiB,QAAQ,CAAC,CAAC;AAElE,WAAO,MAAM;AACX,gBAAU,QAAQ,cAAY,SAAS,mBAAmB,SAAS,GAAG,CAAC,CAAC;AAAA,IAC1E;AAAA,EACF;AACF;","names":[]}
@@ -4,7 +4,7 @@ class MakeswiftGraphQLApiClient {
4
4
  graphqlClient;
5
5
  constructor({ endpoint }) {
6
6
  this.graphqlClient = new GraphQLClient(endpoint, {
7
- "makeswift-runtime-version": "0.29.2"
7
+ "makeswift-runtime-version": "0.29.3-canary.0"
8
8
  });
9
9
  }
10
10
  async getUnversionedResources({
@@ -188,7 +188,7 @@ class MakeswiftRestAPIClient {
188
188
  const requestHeaders = new Headers({
189
189
  "x-api-key": this.apiKey,
190
190
  "makeswift-site-api-key": this.apiKey,
191
- "makeswift-runtime-version": "0.29.2"
191
+ "makeswift-runtime-version": "0.29.3-canary.0"
192
192
  });
193
193
  if (siteVersion?.token) {
194
194
  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.29.2",
11
+ version: "0.29.3-canary.0",
12
12
  interactionMode: true,
13
13
  clientSideNavigation: false,
14
14
  elementFromPoint: false,
@@ -1,4 +1,6 @@
1
- import { EMBEDDED_DOCUMENT_TYPE } from "../state/modules/read-only-documents";
1
+ import {
2
+ EMBEDDED_DOCUMENT_TYPE
3
+ } from "../state/modules/read-only-documents";
2
4
  import { deterministicUUID } from "../utils/deterministic-uuid";
3
5
  function componentDocumentToRootEmbeddedDocument({
4
6
  document,
@@ -6,6 +8,7 @@ function componentDocumentToRootEmbeddedDocument({
6
8
  name,
7
9
  type,
8
10
  description,
11
+ internal_MakeswiftBuilderData,
9
12
  meta
10
13
  }) {
11
14
  const { data: rootElement, locale, id } = document;
@@ -28,7 +31,7 @@ function componentDocumentToRootEmbeddedDocument({
28
31
  id,
29
32
  type,
30
33
  name,
31
- meta: { ...meta, description },
34
+ meta: { ...meta, description, internal_MakeswiftBuilderData },
32
35
  __type: EMBEDDED_DOCUMENT_TYPE
33
36
  };
34
37
  return rootDocument;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/client/component-snapshot.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { type CacheData } from '../api/api-resources-client'\n\nimport { EMBEDDED_DOCUMENT_TYPE, type EmbeddedDocument } from '../state/modules/read-only-documents'\n\nimport { deterministicUUID } from '../utils/deterministic-uuid'\n\nimport * as Schema from './schema/component-document'\n\nexport type MakeswiftComponentDocument = z.infer<typeof Schema.componentDocument>\nexport type MakeswiftComponentDocumentFallback = z.infer<typeof Schema.componentDocumentFallback>\n\nexport type MakeswiftComponentMetadata = {\n allowLocaleFallback: boolean\n requestedLocale: string | null\n}\n\nexport function componentDocumentToRootEmbeddedDocument({\n document,\n documentKey,\n name,\n type,\n description,\n meta,\n}: {\n document: MakeswiftComponentDocument | MakeswiftComponentDocumentFallback\n documentKey: string\n name: string\n type: string\n description?: string\n meta: MakeswiftComponentMetadata\n}): EmbeddedDocument {\n const { data: rootElement, locale, id } = document\n\n if (rootElement != null && rootElement.type !== type) {\n throw new Error(\n `Type \"${rootElement.type}\" does not match the expected type \"${type}\" from the snapshot`,\n )\n }\n\n const rootDocument: EmbeddedDocument = {\n key: documentKey,\n rootElement: rootElement ?? {\n // Fallback rootElement\n // Create a stable uuid so two different clients will have the same empty element data.\n // This is needed to make presence feature work for an element that is not yet created.\n key: deterministicUUID({ id, locale, seed: documentKey }),\n type,\n props: {},\n },\n locale,\n id,\n type,\n name,\n meta: { ...meta, description },\n __type: EMBEDDED_DOCUMENT_TYPE,\n }\n\n return rootDocument\n}\n\nexport type MakeswiftComponentSnapshot = {\n document: MakeswiftComponentDocument | MakeswiftComponentDocumentFallback\n key: string\n cacheData: CacheData\n meta: MakeswiftComponentMetadata\n}\n"],"mappings":"AAIA,SAAS,8BAAqD;AAE9D,SAAS,yBAAyB;AAY3B,SAAS,wCAAwC;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAOqB;AACnB,QAAM,EAAE,MAAM,aAAa,QAAQ,GAAG,IAAI;AAE1C,MAAI,eAAe,QAAQ,YAAY,SAAS,MAAM;AACpD,UAAM,IAAI;AAAA,MACR,SAAS,YAAY,IAAI,uCAAuC,IAAI;AAAA,IACtE;AAAA,EACF;AAEA,QAAM,eAAiC;AAAA,IACrC,KAAK;AAAA,IACL,aAAa,eAAe;AAAA;AAAA;AAAA;AAAA,MAI1B,KAAK,kBAAkB,EAAE,IAAI,QAAQ,MAAM,YAAY,CAAC;AAAA,MACxD;AAAA,MACA,OAAO,CAAC;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM,EAAE,GAAG,MAAM,YAAY;AAAA,IAC7B,QAAQ;AAAA,EACV;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/client/component-snapshot.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { type CacheData } from '../api/api-resources-client'\n\nimport {\n type Data,\n EMBEDDED_DOCUMENT_TYPE,\n type EmbeddedDocument,\n} from '../state/modules/read-only-documents'\n\nimport { deterministicUUID } from '../utils/deterministic-uuid'\n\nimport * as Schema from './schema/component-document'\n\nexport type MakeswiftComponentDocument = z.infer<typeof Schema.componentDocument>\nexport type MakeswiftComponentDocumentFallback = z.infer<typeof Schema.componentDocumentFallback>\n\nexport type MakeswiftComponentMetadata = {\n allowLocaleFallback: boolean\n requestedLocale: string | null\n}\n\nexport function componentDocumentToRootEmbeddedDocument({\n document,\n documentKey,\n name,\n type,\n description,\n internal_MakeswiftBuilderData,\n meta,\n}: {\n document: MakeswiftComponentDocument | MakeswiftComponentDocumentFallback\n documentKey: string\n name: string\n type: string\n description?: string\n /** For internal Makeswift builder use only */\n internal_MakeswiftBuilderData?: Data\n meta: MakeswiftComponentMetadata\n}): EmbeddedDocument {\n const { data: rootElement, locale, id } = document\n\n if (rootElement != null && rootElement.type !== type) {\n throw new Error(\n `Type \"${rootElement.type}\" does not match the expected type \"${type}\" from the snapshot`,\n )\n }\n\n const rootDocument: EmbeddedDocument = {\n key: documentKey,\n rootElement: rootElement ?? {\n // Fallback rootElement\n // Create a stable uuid so two different clients will have the same empty element data.\n // This is needed to make presence feature work for an element that is not yet created.\n key: deterministicUUID({ id, locale, seed: documentKey }),\n type,\n props: {},\n },\n locale,\n id,\n type,\n name,\n meta: { ...meta, description, internal_MakeswiftBuilderData },\n __type: EMBEDDED_DOCUMENT_TYPE,\n }\n\n return rootDocument\n}\n\nexport type MakeswiftComponentSnapshot = {\n document: MakeswiftComponentDocument | MakeswiftComponentDocumentFallback\n key: string\n cacheData: CacheData\n meta: MakeswiftComponentMetadata\n}\n"],"mappings":"AAIA;AAAA,EAEE;AAAA,OAEK;AAEP,SAAS,yBAAyB;AAY3B,SAAS,wCAAwC;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GASqB;AACnB,QAAM,EAAE,MAAM,aAAa,QAAQ,GAAG,IAAI;AAE1C,MAAI,eAAe,QAAQ,YAAY,SAAS,MAAM;AACpD,UAAM,IAAI;AAAA,MACR,SAAS,YAAY,IAAI,uCAAuC,IAAI;AAAA,IACtE;AAAA,EACF;AAEA,QAAM,eAAiC;AAAA,IACrC,KAAK;AAAA,IACL,aAAa,eAAe;AAAA;AAAA;AAAA;AAAA,MAI1B,KAAK,kBAAkB,EAAE,IAAI,QAAQ,MAAM,YAAY,CAAC;AAAA,MACxD;AAAA,MACA,OAAO,CAAC;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM,EAAE,GAAG,MAAM,aAAa,8BAA8B;AAAA,IAC5D,QAAQ;AAAA,EACV;AAEA,SAAO;AACT;","names":[]}
@@ -10,23 +10,26 @@ import { useRegisterDocument } from "../hooks/use-register-document";
10
10
  import { useBuiltinSuspense } from "../hooks/use-builtin-suspense";
11
11
  import { ActivityOrFallback } from "./activity-with-fallback";
12
12
  import { DocumentRoot } from "./DocumentRoot";
13
- const MakeswiftComponent = memo(({ snapshot, label, type, description }) => {
14
- useCacheData(snapshot.cacheData);
15
- const rootDocument = useMemo(
16
- () => componentDocumentToRootEmbeddedDocument({
17
- document: snapshot.document,
18
- documentKey: snapshot.key,
19
- name: label,
20
- type,
21
- description,
22
- meta: snapshot.meta
23
- }),
24
- [snapshot, label, type, description]
25
- );
26
- useRegisterDocument(rootDocument);
27
- const builtinSuspense = useBuiltinSuspense(getRootElement(rootDocument).type);
28
- return /* @__PURE__ */ jsx(ActivityOrFallback, { suspenseFallback: builtinSuspense, children: /* @__PURE__ */ jsx(DocumentRoot, { rootDocument }) });
29
- });
13
+ const MakeswiftComponent = memo(
14
+ ({ snapshot, label, type, description, internal_MakeswiftBuilderData }) => {
15
+ useCacheData(snapshot.cacheData);
16
+ const rootDocument = useMemo(
17
+ () => componentDocumentToRootEmbeddedDocument({
18
+ document: snapshot.document,
19
+ documentKey: snapshot.key,
20
+ name: label,
21
+ type,
22
+ description,
23
+ internal_MakeswiftBuilderData,
24
+ meta: snapshot.meta
25
+ }),
26
+ [snapshot, label, type, description, internal_MakeswiftBuilderData]
27
+ );
28
+ useRegisterDocument(rootDocument);
29
+ const builtinSuspense = useBuiltinSuspense(getRootElement(rootDocument).type);
30
+ return /* @__PURE__ */ jsx(ActivityOrFallback, { suspenseFallback: builtinSuspense, children: /* @__PURE__ */ jsx(DocumentRoot, { rootDocument }) });
31
+ }
32
+ );
30
33
  export {
31
34
  MakeswiftComponent
32
35
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/runtimes/react/components/MakeswiftComponent.tsx"],"sourcesContent":["'use client'\n\nimport { memo, useMemo } from 'react'\n\nimport {\n componentDocumentToRootEmbeddedDocument,\n MakeswiftComponentSnapshot,\n} from '../../../client'\nimport { getRootElement } from '../../../state/read-only-state'\n\nimport { useCacheData } from '../hooks/use-cache-data'\nimport { useRegisterDocument } from '../hooks/use-register-document'\nimport { useBuiltinSuspense } from '../hooks/use-builtin-suspense'\nimport { ActivityOrFallback } from './activity-with-fallback'\n\nimport { DocumentRoot } from './DocumentRoot'\n\ntype Props = {\n snapshot: MakeswiftComponentSnapshot\n label: string\n type: string\n description?: string\n}\n\nexport const MakeswiftComponent = memo(({ snapshot, label, type, description }: Props) => {\n useCacheData(snapshot.cacheData)\n\n const rootDocument = useMemo(\n () =>\n componentDocumentToRootEmbeddedDocument({\n document: snapshot.document,\n documentKey: snapshot.key,\n name: label,\n type,\n description,\n meta: snapshot.meta,\n }),\n [snapshot, label, type, description],\n )\n\n useRegisterDocument(rootDocument)\n\n const builtinSuspense = useBuiltinSuspense(getRootElement(rootDocument).type)\n\n return (\n <ActivityOrFallback suspenseFallback={builtinSuspense}>\n <DocumentRoot rootDocument={rootDocument} />\n </ActivityOrFallback>\n )\n})\n"],"mappings":";AA8CM;AA5CN,SAAS,MAAM,eAAe;AAE9B;AAAA,EACE;AAAA,OAEK;AACP,SAAS,sBAAsB;AAE/B,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AACpC,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AAEnC,SAAS,oBAAoB;AAStB,MAAM,qBAAqB,KAAK,CAAC,EAAE,UAAU,OAAO,MAAM,YAAY,MAAa;AACxF,eAAa,SAAS,SAAS;AAE/B,QAAM,eAAe;AAAA,IACnB,MACE,wCAAwC;AAAA,MACtC,UAAU,SAAS;AAAA,MACnB,aAAa,SAAS;AAAA,MACtB,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA,MAAM,SAAS;AAAA,IACjB,CAAC;AAAA,IACH,CAAC,UAAU,OAAO,MAAM,WAAW;AAAA,EACrC;AAEA,sBAAoB,YAAY;AAEhC,QAAM,kBAAkB,mBAAmB,eAAe,YAAY,EAAE,IAAI;AAE5E,SACE,oBAAC,sBAAmB,kBAAkB,iBACpC,8BAAC,gBAAa,cAA4B,GAC5C;AAEJ,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../../../src/runtimes/react/components/MakeswiftComponent.tsx"],"sourcesContent":["'use client'\n\nimport { memo, useMemo } from 'react'\n\nimport {\n componentDocumentToRootEmbeddedDocument,\n MakeswiftComponentSnapshot,\n} from '../../../client'\nimport { type Data } from '../../../state/modules/read-only-documents'\nimport { getRootElement } from '../../../state/read-only-state'\n\nimport { useCacheData } from '../hooks/use-cache-data'\nimport { useRegisterDocument } from '../hooks/use-register-document'\nimport { useBuiltinSuspense } from '../hooks/use-builtin-suspense'\nimport { ActivityOrFallback } from './activity-with-fallback'\n\nimport { DocumentRoot } from './DocumentRoot'\n\ntype Props = {\n snapshot: MakeswiftComponentSnapshot\n label: string\n type: string\n description?: string\n /** For internal Makeswift builder use only */\n internal_MakeswiftBuilderData?: Data\n}\n\nexport const MakeswiftComponent = memo(\n ({ snapshot, label, type, description, internal_MakeswiftBuilderData }: Props) => {\n useCacheData(snapshot.cacheData)\n\n const rootDocument = useMemo(\n () =>\n componentDocumentToRootEmbeddedDocument({\n document: snapshot.document,\n documentKey: snapshot.key,\n name: label,\n type,\n description,\n internal_MakeswiftBuilderData,\n meta: snapshot.meta,\n }),\n [snapshot, label, type, description, internal_MakeswiftBuilderData],\n )\n\n useRegisterDocument(rootDocument)\n\n const builtinSuspense = useBuiltinSuspense(getRootElement(rootDocument).type)\n\n return (\n <ActivityOrFallback suspenseFallback={builtinSuspense}>\n <DocumentRoot rootDocument={rootDocument} />\n </ActivityOrFallback>\n )\n },\n)\n"],"mappings":";AAmDQ;AAjDR,SAAS,MAAM,eAAe;AAE9B;AAAA,EACE;AAAA,OAEK;AAEP,SAAS,sBAAsB;AAE/B,SAAS,oBAAoB;AAC7B,SAAS,2BAA2B;AACpC,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AAEnC,SAAS,oBAAoB;AAWtB,MAAM,qBAAqB;AAAA,EAChC,CAAC,EAAE,UAAU,OAAO,MAAM,aAAa,8BAA8B,MAAa;AAChF,iBAAa,SAAS,SAAS;AAE/B,UAAM,eAAe;AAAA,MACnB,MACE,wCAAwC;AAAA,QACtC,UAAU,SAAS;AAAA,QACnB,aAAa,SAAS;AAAA,QACtB,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,QACA,MAAM,SAAS;AAAA,MACjB,CAAC;AAAA,MACH,CAAC,UAAU,OAAO,MAAM,aAAa,6BAA6B;AAAA,IACpE;AAEA,wBAAoB,YAAY;AAEhC,UAAM,kBAAkB,mBAAmB,eAAe,YAAY,EAAE,IAAI;AAE5E,WACE,oBAAC,sBAAmB,kBAAkB,iBACpC,8BAAC,gBAAa,cAA4B,GAC5C;AAAA,EAEJ;AACF;","names":[]}
@@ -7,6 +7,7 @@ const RSCSnapshotRenderer = ({
7
7
  label,
8
8
  type,
9
9
  description,
10
+ internal_MakeswiftBuilderData,
10
11
  children
11
12
  }) => {
12
13
  const rootDocument = componentDocumentToRootEmbeddedDocument({
@@ -15,6 +16,7 @@ const RSCSnapshotRenderer = ({
15
16
  name: label,
16
17
  type,
17
18
  description,
19
+ internal_MakeswiftBuilderData,
18
20
  meta: snapshot.meta
19
21
  });
20
22
  const context = getRenderContext();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/runtimes/react/server/components/snapshot-renderer.tsx"],"sourcesContent":["import { type ComponentProps, type PropsWithChildren } from 'react'\n\nimport { componentDocumentToRootEmbeddedDocument } from '../../../../client/component-snapshot'\nimport { MakeswiftComponent } from '../../components/MakeswiftComponent'\n\nimport { getRenderContext } from '../render-context'\n\nimport { RSCRenderer } from './renderer'\n\n/**\n * High-level helper for rendering server versions of snapshot-backed components\n * (`MakeswiftComponent`, `Slot`). Creates a root document from the snapshot\n * and delegates to `RSCRenderer` to render the server elements and make them\n * editable on the client.\n */\nexport const RSCSnapshotRenderer = ({\n snapshot,\n label,\n type,\n description,\n children,\n}: PropsWithChildren<ComponentProps<typeof MakeswiftComponent>>) => {\n const rootDocument = componentDocumentToRootEmbeddedDocument({\n document: snapshot.document,\n documentKey: snapshot.key,\n name: label,\n type,\n description,\n meta: snapshot.meta,\n })\n\n const context = getRenderContext()\n\n return (\n <RSCRenderer context={context} cacheData={snapshot.cacheData} document={rootDocument}>\n {children}\n </RSCRenderer>\n )\n}\n"],"mappings":"AAkCI;AAhCJ,SAAS,+CAA+C;AAGxD,SAAS,wBAAwB;AAEjC,SAAS,mBAAmB;AAQrB,MAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAoE;AAClE,QAAM,eAAe,wCAAwC;AAAA,IAC3D,UAAU,SAAS;AAAA,IACnB,aAAa,SAAS;AAAA,IACtB,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,MAAM,SAAS;AAAA,EACjB,CAAC;AAED,QAAM,UAAU,iBAAiB;AAEjC,SACE,oBAAC,eAAY,SAAkB,WAAW,SAAS,WAAW,UAAU,cACrE,UACH;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../../../../src/runtimes/react/server/components/snapshot-renderer.tsx"],"sourcesContent":["import { type ComponentProps, type PropsWithChildren } from 'react'\n\nimport { componentDocumentToRootEmbeddedDocument } from '../../../../client/component-snapshot'\nimport { MakeswiftComponent } from '../../components/MakeswiftComponent'\n\nimport { getRenderContext } from '../render-context'\n\nimport { RSCRenderer } from './renderer'\n\n/**\n * High-level helper for rendering server versions of snapshot-backed components\n * (`MakeswiftComponent`, `Slot`). Creates a root document from the snapshot\n * and delegates to `RSCRenderer` to render the server elements and make them\n * editable on the client.\n */\nexport const RSCSnapshotRenderer = ({\n snapshot,\n label,\n type,\n description,\n internal_MakeswiftBuilderData,\n children,\n}: PropsWithChildren<ComponentProps<typeof MakeswiftComponent>>) => {\n const rootDocument = componentDocumentToRootEmbeddedDocument({\n document: snapshot.document,\n documentKey: snapshot.key,\n name: label,\n type,\n description,\n internal_MakeswiftBuilderData,\n meta: snapshot.meta,\n })\n\n const context = getRenderContext()\n\n return (\n <RSCRenderer context={context} cacheData={snapshot.cacheData} document={rootDocument}>\n {children}\n </RSCRenderer>\n )\n}\n"],"mappings":"AAoCI;AAlCJ,SAAS,+CAA+C;AAGxD,SAAS,wBAAwB;AAEjC,SAAS,mBAAmB;AAQrB,MAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAoE;AAClE,QAAM,eAAe,wCAAwC;AAAA,IAC3D,UAAU,SAAS;AAAA,IACnB,aAAa,SAAS;AAAA,IACtB,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM,SAAS;AAAA,EACjB,CAAC;AAED,QAAM,UAAU,iBAAiB;AAEjC,SACE,oBAAC,eAAY,SAAkB,WAAW,SAAS,WAAW,UAAU,cACrE,UACH;AAEJ;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/state/modules/read-only-documents.ts"],"sourcesContent":["import { type Element } from '@makeswift/controls'\n\nimport { type Action, type UnknownAction, type DocumentPayload, isKnownAction } from '../actions'\n\nimport { SharedActionTypes } from '../shared-api'\n\nexport {\n type Data,\n type ElementData,\n type ElementReference,\n type Element,\n isElementReference,\n} from '@makeswift/controls'\n\nexport type DocumentReference = {\n key: string\n}\n\nexport function createDocumentReference(key: string): DocumentReference {\n return { key }\n}\n\ntype BaseDocument = {\n key: string\n rootElement: Element\n locale: string | null\n}\n\nexport const EMBEDDED_DOCUMENT_TYPE = 'EMBEDDED_DOCUMENT' as const\n\nexport type EmbeddedDocument = {\n key: string\n locale: string | null\n id: string\n type: string\n name: string\n rootElement: Element\n meta: { allowLocaleFallback: boolean; requestedLocale: string | null; description?: string }\n __type: typeof EMBEDDED_DOCUMENT_TYPE\n}\n\nexport type Document = BaseDocument | EmbeddedDocument\n\nexport function getRootElement(document: Document | DocumentPayload): Element {\n return document.rootElement\n}\n\nexport function createBaseDocument(\n key: string,\n rootElement: Element,\n locale: string | null,\n): Document {\n return { key, rootElement, locale }\n}\n\nexport type State = Map<string, Document>\n\nexport function getInitialState({ documents = [] }: { documents?: Document[] } = {}): State {\n return new Map(documents.map(document => [document.key, document]))\n}\n\nexport function getDocuments(state: State): State {\n return state\n}\n\nexport function getDocument(state: State, documentKey: string): Document | null {\n return getDocuments(state).get(documentKey) ?? null\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 SharedActionTypes.REGISTER_DOCUMENT:\n const { documentKey, document } = action.payload\n return new Map(state).set(documentKey, { ...document, locale: document.locale ?? null })\n\n case SharedActionTypes.UNREGISTER_DOCUMENT: {\n const nextState = new Map(state)\n\n const deleted = nextState.delete(action.payload.documentKey)\n\n return deleted ? nextState : state\n }\n\n default:\n return state\n }\n}\n"],"mappings":"AAEA,SAAgE,qBAAqB;AAErF,SAAS,yBAAyB;AAElC;AAAA,EAKE;AAAA,OACK;AAMA,SAAS,wBAAwB,KAAgC;AACtE,SAAO,EAAE,IAAI;AACf;AAQO,MAAM,yBAAyB;AAe/B,SAAS,eAAe,UAA+C;AAC5E,SAAO,SAAS;AAClB;AAEO,SAAS,mBACd,KACA,aACA,QACU;AACV,SAAO,EAAE,KAAK,aAAa,OAAO;AACpC;AAIO,SAAS,gBAAgB,EAAE,YAAY,CAAC,EAAE,IAAgC,CAAC,GAAU;AAC1F,SAAO,IAAI,IAAI,UAAU,IAAI,cAAY,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC;AACpE;AAEO,SAAS,aAAa,OAAqB;AAChD,SAAO;AACT;AAEO,SAAS,YAAY,OAAc,aAAsC;AAC9E,SAAO,aAAa,KAAK,EAAE,IAAI,WAAW,KAAK;AACjD;AAEO,SAAS,QAAQ,QAAe,gBAAgB,GAAG,QAAuC;AAC/F,MAAI,CAAC,cAAc,MAAM;AAAG,WAAO;AAEnC,UAAQ,OAAO,MAAM;AAAA,IACnB,KAAK,kBAAkB;AACrB,YAAM,EAAE,aAAa,SAAS,IAAI,OAAO;AACzC,aAAO,IAAI,IAAI,KAAK,EAAE,IAAI,aAAa,EAAE,GAAG,UAAU,QAAQ,SAAS,UAAU,KAAK,CAAC;AAAA,IAEzF,KAAK,kBAAkB,qBAAqB;AAC1C,YAAM,YAAY,IAAI,IAAI,KAAK;AAE/B,YAAM,UAAU,UAAU,OAAO,OAAO,QAAQ,WAAW;AAE3D,aAAO,UAAU,YAAY;AAAA,IAC/B;AAAA,IAEA;AACE,aAAO;AAAA,EACX;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/state/modules/read-only-documents.ts"],"sourcesContent":["import { type Data, type Element } from '@makeswift/controls'\n\nimport { type Action, type UnknownAction, type DocumentPayload, isKnownAction } from '../actions'\n\nimport { SharedActionTypes } from '../shared-api'\n\nexport {\n type Data,\n type ElementData,\n type ElementReference,\n type Element,\n isElementReference,\n} from '@makeswift/controls'\n\nexport type DocumentReference = {\n key: string\n}\n\nexport function createDocumentReference(key: string): DocumentReference {\n return { key }\n}\n\ntype BaseDocument = {\n key: string\n rootElement: Element\n locale: string | null\n}\n\nexport const EMBEDDED_DOCUMENT_TYPE = 'EMBEDDED_DOCUMENT' as const\n\nexport type EmbeddedDocumentMeta = {\n allowLocaleFallback: boolean\n requestedLocale: string | null\n description?: string\n internal_MakeswiftBuilderData?: Data\n}\n\nexport type EmbeddedDocument = {\n key: string\n locale: string | null\n id: string\n type: string\n name: string\n rootElement: Element\n meta: EmbeddedDocumentMeta\n __type: typeof EMBEDDED_DOCUMENT_TYPE\n}\n\nexport type Document = BaseDocument | EmbeddedDocument\n\nexport function getRootElement(document: Document | DocumentPayload): Element {\n return document.rootElement\n}\n\nexport function createBaseDocument(\n key: string,\n rootElement: Element,\n locale: string | null,\n): Document {\n return { key, rootElement, locale }\n}\n\nexport type State = Map<string, Document>\n\nexport function getInitialState({ documents = [] }: { documents?: Document[] } = {}): State {\n return new Map(documents.map(document => [document.key, document]))\n}\n\nexport function getDocuments(state: State): State {\n return state\n}\n\nexport function getDocument(state: State, documentKey: string): Document | null {\n return getDocuments(state).get(documentKey) ?? null\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 SharedActionTypes.REGISTER_DOCUMENT:\n const { documentKey, document } = action.payload\n return new Map(state).set(documentKey, { ...document, locale: document.locale ?? null })\n\n case SharedActionTypes.UNREGISTER_DOCUMENT: {\n const nextState = new Map(state)\n\n const deleted = nextState.delete(action.payload.documentKey)\n\n return deleted ? nextState : state\n }\n\n default:\n return state\n }\n}\n"],"mappings":"AAEA,SAAgE,qBAAqB;AAErF,SAAS,yBAAyB;AAElC;AAAA,EAKE;AAAA,OACK;AAMA,SAAS,wBAAwB,KAAgC;AACtE,SAAO,EAAE,IAAI;AACf;AAQO,MAAM,yBAAyB;AAsB/B,SAAS,eAAe,UAA+C;AAC5E,SAAO,SAAS;AAClB;AAEO,SAAS,mBACd,KACA,aACA,QACU;AACV,SAAO,EAAE,KAAK,aAAa,OAAO;AACpC;AAIO,SAAS,gBAAgB,EAAE,YAAY,CAAC,EAAE,IAAgC,CAAC,GAAU;AAC1F,SAAO,IAAI,IAAI,UAAU,IAAI,cAAY,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC;AACpE;AAEO,SAAS,aAAa,OAAqB;AAChD,SAAO;AACT;AAEO,SAAS,YAAY,OAAc,aAAsC;AAC9E,SAAO,aAAa,KAAK,EAAE,IAAI,WAAW,KAAK;AACjD;AAEO,SAAS,QAAQ,QAAe,gBAAgB,GAAG,QAAuC;AAC/F,MAAI,CAAC,cAAc,MAAM;AAAG,WAAO;AAEnC,UAAQ,OAAO,MAAM;AAAA,IACnB,KAAK,kBAAkB;AACrB,YAAM,EAAE,aAAa,SAAS,IAAI,OAAO;AACzC,aAAO,IAAI,IAAI,KAAK,EAAE,IAAI,aAAa,EAAE,GAAG,UAAU,QAAQ,SAAS,UAAU,KAAK,CAAC;AAAA,IAEzF,KAAK,kBAAkB,qBAAqB;AAC1C,YAAM,YAAY,IAAI,IAAI,KAAK;AAE/B,YAAM,UAAU,UAAU,OAAO,OAAO,QAAQ,WAAW;AAE3D,aAAO,UAAU,YAAY;AAAA,IAC/B;AAAA,IAEA;AACE,aAAO;AAAA,EACX;AACF;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/state/shared-api/actions.ts"],"sourcesContent":["import { type ThunkAction } from '@reduxjs/toolkit'\n\nimport { type Element, type Document, EMBEDDED_DOCUMENT_TYPE } from '../modules/read-only-documents'\n\nimport { SharedActionTypes } from './action-types'\n\ntype DocumentPayloadBaseDocument = {\n key: string\n rootElement: Element\n locale?: string | null // older versions of the runtime may not provide this field\n}\n\ntype DocumentPayloadEmbeddedDocument = {\n key: string\n locale: string | null\n id: string\n type: string\n name: string\n rootElement: Element\n meta: { allowLocaleFallback: boolean; requestedLocale: string | null; description?: string }\n __type: typeof EMBEDDED_DOCUMENT_TYPE\n}\n\nexport type DocumentPayload = DocumentPayloadBaseDocument | DocumentPayloadEmbeddedDocument\n\ntype MakeswiftConnectionInitAction = { type: typeof SharedActionTypes.MAKESWIFT_CONNECTION_INIT }\n\ntype RegisterDocumentAction = {\n type: typeof SharedActionTypes.REGISTER_DOCUMENT\n payload: { documentKey: string; document: DocumentPayload }\n}\n\ntype UnregisterDocumentAction = {\n type: typeof SharedActionTypes.UNREGISTER_DOCUMENT\n payload: { documentKey: string }\n}\n\nexport type SharedAction =\n | MakeswiftConnectionInitAction\n | RegisterDocumentAction\n | UnregisterDocumentAction\n\nexport function makeswiftConnectionInit(): MakeswiftConnectionInitAction {\n return {\n type: SharedActionTypes.MAKESWIFT_CONNECTION_INIT,\n }\n}\n\nexport function registerDocument(document: Document): RegisterDocumentAction {\n return {\n type: SharedActionTypes.REGISTER_DOCUMENT,\n payload: { documentKey: document.key, document },\n }\n}\n\nexport function unregisterDocument(documentKey: string): UnregisterDocumentAction {\n return { type: SharedActionTypes.UNREGISTER_DOCUMENT, payload: { documentKey } }\n}\n\nexport function registerDocumentsEffect(\n documents: Document[],\n): ThunkAction<() => void, unknown, unknown, SharedAction> {\n return dispatch => {\n documents.forEach(document => dispatch(registerDocument(document)))\n\n return () => {\n documents.forEach(document => dispatch(unregisterDocument(document.key)))\n }\n }\n}\n"],"mappings":"AAIA,SAAS,yBAAyB;AAsC3B,SAAS,0BAAyD;AACvE,SAAO;AAAA,IACL,MAAM,kBAAkB;AAAA,EAC1B;AACF;AAEO,SAAS,iBAAiB,UAA4C;AAC3E,SAAO;AAAA,IACL,MAAM,kBAAkB;AAAA,IACxB,SAAS,EAAE,aAAa,SAAS,KAAK,SAAS;AAAA,EACjD;AACF;AAEO,SAAS,mBAAmB,aAA+C;AAChF,SAAO,EAAE,MAAM,kBAAkB,qBAAqB,SAAS,EAAE,YAAY,EAAE;AACjF;AAEO,SAAS,wBACd,WACyD;AACzD,SAAO,cAAY;AACjB,cAAU,QAAQ,cAAY,SAAS,iBAAiB,QAAQ,CAAC,CAAC;AAElE,WAAO,MAAM;AACX,gBAAU,QAAQ,cAAY,SAAS,mBAAmB,SAAS,GAAG,CAAC,CAAC;AAAA,IAC1E;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/state/shared-api/actions.ts"],"sourcesContent":["import { type ThunkAction } from '@reduxjs/toolkit'\n\nimport {\n type Element,\n type Document,\n type EmbeddedDocumentMeta,\n EMBEDDED_DOCUMENT_TYPE,\n} from '../modules/read-only-documents'\n\nimport { SharedActionTypes } from './action-types'\n\ntype DocumentPayloadBaseDocument = {\n key: string\n rootElement: Element\n locale?: string | null // older versions of the runtime may not provide this field\n}\n\ntype DocumentPayloadEmbeddedDocument = {\n key: string\n locale: string | null\n id: string\n type: string\n name: string\n rootElement: Element\n meta: EmbeddedDocumentMeta\n __type: typeof EMBEDDED_DOCUMENT_TYPE\n}\n\nexport type DocumentPayload = DocumentPayloadBaseDocument | DocumentPayloadEmbeddedDocument\n\ntype MakeswiftConnectionInitAction = { type: typeof SharedActionTypes.MAKESWIFT_CONNECTION_INIT }\n\ntype RegisterDocumentAction = {\n type: typeof SharedActionTypes.REGISTER_DOCUMENT\n payload: { documentKey: string; document: DocumentPayload }\n}\n\ntype UnregisterDocumentAction = {\n type: typeof SharedActionTypes.UNREGISTER_DOCUMENT\n payload: { documentKey: string }\n}\n\nexport type SharedAction =\n | MakeswiftConnectionInitAction\n | RegisterDocumentAction\n | UnregisterDocumentAction\n\nexport function makeswiftConnectionInit(): MakeswiftConnectionInitAction {\n return {\n type: SharedActionTypes.MAKESWIFT_CONNECTION_INIT,\n }\n}\n\nexport function registerDocument(document: Document): RegisterDocumentAction {\n return {\n type: SharedActionTypes.REGISTER_DOCUMENT,\n payload: { documentKey: document.key, document },\n }\n}\n\nexport function unregisterDocument(documentKey: string): UnregisterDocumentAction {\n return { type: SharedActionTypes.UNREGISTER_DOCUMENT, payload: { documentKey } }\n}\n\nexport function registerDocumentsEffect(\n documents: Document[],\n): ThunkAction<() => void, unknown, unknown, SharedAction> {\n return dispatch => {\n documents.forEach(document => dispatch(registerDocument(document)))\n\n return () => {\n documents.forEach(document => dispatch(unregisterDocument(document.key)))\n }\n }\n}\n"],"mappings":"AASA,SAAS,yBAAyB;AAsC3B,SAAS,0BAAyD;AACvE,SAAO;AAAA,IACL,MAAM,kBAAkB;AAAA,EAC1B;AACF;AAEO,SAAS,iBAAiB,UAA4C;AAC3E,SAAO;AAAA,IACL,MAAM,kBAAkB;AAAA,IACxB,SAAS,EAAE,aAAa,SAAS,KAAK,SAAS;AAAA,EACjD;AACF;AAEO,SAAS,mBAAmB,aAA+C;AAChF,SAAO,EAAE,MAAM,kBAAkB,qBAAqB,SAAS,EAAE,YAAY,EAAE;AACjF;AAEO,SAAS,wBACd,WACyD;AACzD,SAAO,cAAY;AACjB,cAAU,QAAQ,cAAY,SAAS,iBAAiB,QAAQ,CAAC,CAAC;AAElE,WAAO,MAAM;AACX,gBAAU,QAAQ,cAAY,SAAS,mBAAmB,SAAS,GAAG,CAAC,CAAC;AAAA,IAC1E;AAAA,EACF;AACF;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { type CacheData } from '../api/api-resources-client';
3
- import { type EmbeddedDocument } from '../state/modules/read-only-documents';
3
+ import { type Data, type EmbeddedDocument } from '../state/modules/read-only-documents';
4
4
  import * as Schema from './schema/component-document';
5
5
  export type MakeswiftComponentDocument = z.infer<typeof Schema.componentDocument>;
6
6
  export type MakeswiftComponentDocumentFallback = z.infer<typeof Schema.componentDocumentFallback>;
@@ -8,12 +8,14 @@ export type MakeswiftComponentMetadata = {
8
8
  allowLocaleFallback: boolean;
9
9
  requestedLocale: string | null;
10
10
  };
11
- export declare function componentDocumentToRootEmbeddedDocument({ document, documentKey, name, type, description, meta, }: {
11
+ export declare function componentDocumentToRootEmbeddedDocument({ document, documentKey, name, type, description, internal_MakeswiftBuilderData, meta, }: {
12
12
  document: MakeswiftComponentDocument | MakeswiftComponentDocumentFallback;
13
13
  documentKey: string;
14
14
  name: string;
15
15
  type: string;
16
16
  description?: string;
17
+ /** For internal Makeswift builder use only */
18
+ internal_MakeswiftBuilderData?: Data;
17
19
  meta: MakeswiftComponentMetadata;
18
20
  }): EmbeddedDocument;
19
21
  export type MakeswiftComponentSnapshot = {
@@ -1 +1 @@
1
- {"version":3,"file":"component-snapshot.d.ts","sourceRoot":"","sources":["../../../src/client/component-snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAE5D,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAIpG,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAA;AAErD,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,iBAAiB,CAAC,CAAA;AACjF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,yBAAyB,CAAC,CAAA;AAEjG,MAAM,MAAM,0BAA0B,GAAG;IACvC,mBAAmB,EAAE,OAAO,CAAA;IAC5B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B,CAAA;AAED,wBAAgB,uCAAuC,CAAC,EACtD,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,IAAI,GACL,EAAE;IACD,QAAQ,EAAE,0BAA0B,GAAG,kCAAkC,CAAA;IACzE,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,0BAA0B,CAAA;CACjC,GAAG,gBAAgB,CA4BnB;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,EAAE,0BAA0B,GAAG,kCAAkC,CAAA;IACzE,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,SAAS,CAAA;IACpB,IAAI,EAAE,0BAA0B,CAAA;CACjC,CAAA"}
1
+ {"version":3,"file":"component-snapshot.d.ts","sourceRoot":"","sources":["../../../src/client/component-snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAE5D,OAAO,EACL,KAAK,IAAI,EAET,KAAK,gBAAgB,EACtB,MAAM,sCAAsC,CAAA;AAI7C,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAA;AAErD,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,iBAAiB,CAAC,CAAA;AACjF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,yBAAyB,CAAC,CAAA;AAEjG,MAAM,MAAM,0BAA0B,GAAG;IACvC,mBAAmB,EAAE,OAAO,CAAA;IAC5B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B,CAAA;AAED,wBAAgB,uCAAuC,CAAC,EACtD,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,6BAA6B,EAC7B,IAAI,GACL,EAAE;IACD,QAAQ,EAAE,0BAA0B,GAAG,kCAAkC,CAAA;IACzE,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8CAA8C;IAC9C,6BAA6B,CAAC,EAAE,IAAI,CAAA;IACpC,IAAI,EAAE,0BAA0B,CAAA;CACjC,GAAG,gBAAgB,CA4BnB;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,EAAE,0BAA0B,GAAG,kCAAkC,CAAA;IACzE,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,SAAS,CAAA;IACpB,IAAI,EAAE,0BAA0B,CAAA;CACjC,CAAA"}
@@ -1,10 +1,13 @@
1
1
  import { MakeswiftComponentSnapshot } from '../../../client';
2
+ import { type Data } from '../../../state/modules/read-only-documents';
2
3
  type Props = {
3
4
  snapshot: MakeswiftComponentSnapshot;
4
5
  label: string;
5
6
  type: string;
6
7
  description?: string;
8
+ /** For internal Makeswift builder use only */
9
+ internal_MakeswiftBuilderData?: Data;
7
10
  };
8
- export declare const MakeswiftComponent: import("react").MemoExoticComponent<({ snapshot, label, type, description }: Props) => import("react/jsx-runtime").JSX.Element>;
11
+ export declare const MakeswiftComponent: import("react").MemoExoticComponent<({ snapshot, label, type, description, internal_MakeswiftBuilderData }: Props) => import("react/jsx-runtime").JSX.Element>;
9
12
  export {};
10
13
  //# sourceMappingURL=MakeswiftComponent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MakeswiftComponent.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/components/MakeswiftComponent.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,0BAA0B,EAC3B,MAAM,iBAAiB,CAAA;AAUxB,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,0BAA0B,CAAA;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,kBAAkB,+EAAiD,KAAK,6CAyBnF,CAAA"}
1
+ {"version":3,"file":"MakeswiftComponent.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/components/MakeswiftComponent.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,0BAA0B,EAC3B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,4CAA4C,CAAA;AAUtE,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,0BAA0B,CAAA;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8CAA8C;IAC9C,6BAA6B,CAAC,EAAE,IAAI,CAAA;CACrC,CAAA;AAED,eAAO,MAAM,kBAAkB,8GAC2C,KAAK,6CA2B9E,CAAA"}
@@ -6,5 +6,5 @@ import { MakeswiftComponent } from '../../components/MakeswiftComponent';
6
6
  * and delegates to `RSCRenderer` to render the server elements and make them
7
7
  * editable on the client.
8
8
  */
9
- export declare const RSCSnapshotRenderer: ({ snapshot, label, type, description, children, }: PropsWithChildren<ComponentProps<typeof MakeswiftComponent>>) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const RSCSnapshotRenderer: ({ snapshot, label, type, description, internal_MakeswiftBuilderData, children, }: PropsWithChildren<ComponentProps<typeof MakeswiftComponent>>) => import("react/jsx-runtime").JSX.Element;
10
10
  //# sourceMappingURL=snapshot-renderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"snapshot-renderer.d.ts","sourceRoot":"","sources":["../../../../../../src/runtimes/react/server/components/snapshot-renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAGnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AAMxE;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,mDAMjC,iBAAiB,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,CAAC,4CAiB9D,CAAA"}
1
+ {"version":3,"file":"snapshot-renderer.d.ts","sourceRoot":"","sources":["../../../../../../src/runtimes/react/server/components/snapshot-renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAGnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AAMxE;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,kFAOjC,iBAAiB,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,CAAC,4CAkB9D,CAAA"}
@@ -1,4 +1,4 @@
1
- import { type Element } from '@makeswift/controls';
1
+ import { type Data, type Element } from '@makeswift/controls';
2
2
  import { type Action, type UnknownAction, type DocumentPayload } from '../actions';
3
3
  export { type Data, type ElementData, type ElementReference, type Element, isElementReference, } from '@makeswift/controls';
4
4
  export type DocumentReference = {
@@ -11,6 +11,12 @@ type BaseDocument = {
11
11
  locale: string | null;
12
12
  };
13
13
  export declare const EMBEDDED_DOCUMENT_TYPE: "EMBEDDED_DOCUMENT";
14
+ export type EmbeddedDocumentMeta = {
15
+ allowLocaleFallback: boolean;
16
+ requestedLocale: string | null;
17
+ description?: string;
18
+ internal_MakeswiftBuilderData?: Data;
19
+ };
14
20
  export type EmbeddedDocument = {
15
21
  key: string;
16
22
  locale: string | null;
@@ -18,11 +24,7 @@ export type EmbeddedDocument = {
18
24
  type: string;
19
25
  name: string;
20
26
  rootElement: Element;
21
- meta: {
22
- allowLocaleFallback: boolean;
23
- requestedLocale: string | null;
24
- description?: string;
25
- };
27
+ meta: EmbeddedDocumentMeta;
26
28
  __type: typeof EMBEDDED_DOCUMENT_TYPE;
27
29
  };
28
30
  export type Document = BaseDocument | EmbeddedDocument;
@@ -1 +1 @@
1
- {"version":3,"file":"read-only-documents.d.ts","sourceRoot":"","sources":["../../../../src/state/modules/read-only-documents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAiB,MAAM,YAAY,CAAA;AAIjG,OAAO,EACL,KAAK,IAAI,EACT,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,kBAAkB,GACnB,MAAM,qBAAqB,CAAA;AAE5B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAEtE;AAED,KAAK,YAAY,GAAG;IAClB,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,OAAO,CAAA;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAG,mBAA4B,CAAA;AAElE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,OAAO,CAAA;IACpB,IAAI,EAAE;QAAE,mBAAmB,EAAE,OAAO,CAAC;QAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC5F,MAAM,EAAE,OAAO,sBAAsB,CAAA;CACtC,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,gBAAgB,CAAA;AAEtD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,eAAe,GAAG,OAAO,CAE5E;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,OAAO,EACpB,MAAM,EAAE,MAAM,GAAG,IAAI,GACpB,QAAQ,CAEV;AAED,MAAM,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;AAEzC,wBAAgB,eAAe,CAAC,EAAE,SAAc,EAAE,GAAE;IAAE,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAA;CAAO,GAAG,KAAK,CAE1F;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAEhD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAE9E;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,YAAoB,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,KAAK,CAmB/F"}
1
+ {"version":3,"file":"read-only-documents.d.ts","sourceRoot":"","sources":["../../../../src/state/modules/read-only-documents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAE7D,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAiB,MAAM,YAAY,CAAA;AAIjG,OAAO,EACL,KAAK,IAAI,EACT,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,kBAAkB,GACnB,MAAM,qBAAqB,CAAA;AAE5B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAEtE;AAED,KAAK,YAAY,GAAG;IAClB,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,OAAO,CAAA;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAG,mBAA4B,CAAA;AAElE,MAAM,MAAM,oBAAoB,GAAG;IACjC,mBAAmB,EAAE,OAAO,CAAA;IAC5B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,6BAA6B,CAAC,EAAE,IAAI,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,OAAO,CAAA;IACpB,IAAI,EAAE,oBAAoB,CAAA;IAC1B,MAAM,EAAE,OAAO,sBAAsB,CAAA;CACtC,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,gBAAgB,CAAA;AAEtD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,eAAe,GAAG,OAAO,CAE5E;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,OAAO,EACpB,MAAM,EAAE,MAAM,GAAG,IAAI,GACpB,QAAQ,CAEV;AAED,MAAM,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;AAEzC,wBAAgB,eAAe,CAAC,EAAE,SAAc,EAAE,GAAE;IAAE,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAA;CAAO,GAAG,KAAK,CAE1F;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAEhD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAE9E;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,YAAoB,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,KAAK,CAmB/F"}
@@ -1,5 +1,5 @@
1
1
  import { type ThunkAction } from '@reduxjs/toolkit';
2
- import { type Element, type Document, EMBEDDED_DOCUMENT_TYPE } from '../modules/read-only-documents';
2
+ import { type Element, type Document, type EmbeddedDocumentMeta, EMBEDDED_DOCUMENT_TYPE } from '../modules/read-only-documents';
3
3
  import { SharedActionTypes } from './action-types';
4
4
  type DocumentPayloadBaseDocument = {
5
5
  key: string;
@@ -13,11 +13,7 @@ type DocumentPayloadEmbeddedDocument = {
13
13
  type: string;
14
14
  name: string;
15
15
  rootElement: Element;
16
- meta: {
17
- allowLocaleFallback: boolean;
18
- requestedLocale: string | null;
19
- description?: string;
20
- };
16
+ meta: EmbeddedDocumentMeta;
21
17
  __type: typeof EMBEDDED_DOCUMENT_TYPE;
22
18
  };
23
19
  export type DocumentPayload = DocumentPayloadBaseDocument | DocumentPayloadEmbeddedDocument;
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/state/shared-api/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AAEpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAElD,KAAK,2BAA2B,GAAG;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,OAAO,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB,CAAA;AAED,KAAK,+BAA+B,GAAG;IACrC,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,OAAO,CAAA;IACpB,IAAI,EAAE;QAAE,mBAAmB,EAAE,OAAO,CAAC;QAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC5F,MAAM,EAAE,OAAO,sBAAsB,CAAA;CACtC,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,2BAA2B,GAAG,+BAA+B,CAAA;AAE3F,KAAK,6BAA6B,GAAG;IAAE,IAAI,EAAE,OAAO,iBAAiB,CAAC,yBAAyB,CAAA;CAAE,CAAA;AAEjG,KAAK,sBAAsB,GAAG;IAC5B,IAAI,EAAE,OAAO,iBAAiB,CAAC,iBAAiB,CAAA;IAChD,OAAO,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,eAAe,CAAA;KAAE,CAAA;CAC5D,CAAA;AAED,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,OAAO,iBAAiB,CAAC,mBAAmB,CAAA;IAClD,OAAO,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,YAAY,GACpB,6BAA6B,GAC7B,sBAAsB,GACtB,wBAAwB,CAAA;AAE5B,wBAAgB,uBAAuB,IAAI,6BAA6B,CAIvE;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,sBAAsB,CAK3E;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,wBAAwB,CAEhF;AAED,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,QAAQ,EAAE,GACpB,WAAW,CAAC,MAAM,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,CAAC,CAQzD"}
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/state/shared-api/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,oBAAoB,EACzB,sBAAsB,EACvB,MAAM,gCAAgC,CAAA;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAElD,KAAK,2BAA2B,GAAG;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,EAAE,OAAO,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB,CAAA;AAED,KAAK,+BAA+B,GAAG;IACrC,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,OAAO,CAAA;IACpB,IAAI,EAAE,oBAAoB,CAAA;IAC1B,MAAM,EAAE,OAAO,sBAAsB,CAAA;CACtC,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,2BAA2B,GAAG,+BAA+B,CAAA;AAE3F,KAAK,6BAA6B,GAAG;IAAE,IAAI,EAAE,OAAO,iBAAiB,CAAC,yBAAyB,CAAA;CAAE,CAAA;AAEjG,KAAK,sBAAsB,GAAG;IAC5B,IAAI,EAAE,OAAO,iBAAiB,CAAC,iBAAiB,CAAA;IAChD,OAAO,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,eAAe,CAAA;KAAE,CAAA;CAC5D,CAAA;AAED,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,OAAO,iBAAiB,CAAC,mBAAmB,CAAA;IAClD,OAAO,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,YAAY,GACpB,6BAA6B,GAC7B,sBAAsB,GACtB,wBAAwB,CAAA;AAE5B,wBAAgB,uBAAuB,IAAI,6BAA6B,CAIvE;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,sBAAsB,CAK3E;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,wBAAwB,CAEhF;AAED,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,QAAQ,EAAE,GACpB,WAAW,CAAC,MAAM,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,CAAC,CAQzD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makeswift/runtime",
3
- "version": "0.29.2",
3
+ "version": "0.29.3-canary.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "url": "makeswift/makeswift",
@@ -242,8 +242,8 @@
242
242
  "use-sync-external-store": "^1.5.0",
243
243
  "uuid": "^9.0.0",
244
244
  "zod": "^3.21.4",
245
- "@makeswift/next-plugin": "0.6.1",
246
245
  "@makeswift/controls": "0.1.23",
246
+ "@makeswift/next-plugin": "0.6.1",
247
247
  "@makeswift/prop-controllers": "0.4.17"
248
248
  },
249
249
  "devDependencies": {