@makeswift/runtime 0.2.13 → 0.2.15

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/index.es.js CHANGED
@@ -38,7 +38,7 @@ var _e;
38
38
  import * as React from "react";
39
39
  import { useEffect, createContext, useContext, useState, useMemo, useRef, Children, createElement, forwardRef, memo, useLayoutEffect, useCallback, Component, useImperativeHandle } from "react";
40
40
  import { useSyncExternalStoreWithSelector } from "use-sync-external-store/shim/with-selector";
41
- import { g as getPropControllerDescriptors, i as isElementReference, a as getElementSwatchIds, b as getFileIds, d as getTypographyIds, e as getTableIds, f as getPageIds, h as getElementChildren, j as createDocumentReference, k as createReplacementContext, l as getComponentPropControllerDescriptors, m as getPropControllers, n as configureStore, o as getDocument, p as getElementId, q as getIsInBuilder, r as copyElementTree, c as createDocument, s as getReactComponent } from "./react-page.es.js";
41
+ import { g as getPropControllerDescriptors, i as isElementReference, a as getElementSwatchIds, b as getFileIds, d as getTypographyIds, e as getTableIds, f as getPageIds, h as getElementChildren, j as createDocumentReference, k as getComponentPropControllerDescriptors, l as getPropControllers, m as configureStore, n as getDocument, o as getElementId, p as getIsInBuilder, q as copyElementTree, c as createDocument, r as getReactComponent } from "./react-page.es.js";
42
42
  import { f as registerDocumentEffect, g as registerComponentHandleEffect, h as mountComponentEffect, j as registerComponentEffect, k as registerReactComponentEffect } from "./actions.es.js";
43
43
  import dynamic from "next/dynamic";
44
44
  import { gql, useQuery as useQuery$1, useMutation as useMutation$1, ApolloClient, InMemoryCache } from "@apollo/client";
@@ -967,7 +967,7 @@ class Document$1 extends NextDocument {
967
967
  });
968
968
  }
969
969
  }
970
- const version = "0.2.13";
970
+ const version = "0.2.15";
971
971
  function isErrorWithMessage(error) {
972
972
  return typeof error === "object" && error !== null && "message" in error && typeof error.message === "string";
973
973
  }
@@ -1068,17 +1068,14 @@ Read more here: https://nextjs.org/blog/next-12-2#on-demand-incremental-static-r
1068
1068
  return res.json(fonts);
1069
1069
  }
1070
1070
  case "element-tree": {
1071
- if (req.query.secret !== apiKey)
1072
- return res.status(401).json({ message: "Unauthorized" });
1073
1071
  const elementTree = req.body.elementTree;
1074
- const serializedReplacementContext = req.body.replacementContext;
1072
+ const replacementContext = req.body.replacementContext;
1075
1073
  if (elementTree == null) {
1076
1074
  return res.status(400).json({ message: "elementTree must be defined" });
1077
1075
  }
1078
- if (serializedReplacementContext == null) {
1076
+ if (replacementContext == null) {
1079
1077
  return res.status(400).json({ message: "replacementContext must be defined" });
1080
1078
  }
1081
- const replacementContext = createReplacementContext(serializedReplacementContext);
1082
1079
  const generatedElementTree = ReactRuntime.copyElementTree(elementTree, replacementContext);
1083
1080
  const response = { elementTree: generatedElementTree };
1084
1081
  return res.json(response);