@makeswift/runtime 0.11.5 → 0.11.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/index.es.js CHANGED
@@ -538,7 +538,6 @@ function Page$1({
538
538
  const socialImage = (_e = baseLocalizedPage == null ? void 0 : baseLocalizedPage.meta.socialImage) != null ? _e : page.meta.socialImage;
539
539
  const canonicalUrl = (_f = baseLocalizedPage == null ? void 0 : baseLocalizedPage.seo.canonicalUrl) != null ? _f : page.seo.canonicalUrl;
540
540
  const isIndexingBlocked = (_g = baseLocalizedPage == null ? void 0 : baseLocalizedPage.seo.isIndexingBlocked) != null ? _g : page.seo.isIndexingBlocked;
541
- const hreflangs = page.hreflangs;
542
541
  const fontFamilyParamValue = useMemo(() => {
543
542
  if (site == null) {
544
543
  return page.fonts.map(({
@@ -650,14 +649,7 @@ function Page$1({
650
649
  rel: "stylesheet",
651
650
  href: `https://fonts.googleapis.com/css?family=${fontFamilyParamValue}&display=swap`
652
651
  })
653
- }), hreflangs.map(({
654
- hreflang,
655
- href
656
- }) => /* @__PURE__ */ jsx("link", {
657
- rel: "alternate",
658
- hrefLang: hreflang,
659
- href
660
- }, hreflang)), headSnippets.map(snippetToElement).map((children) => Children.map(children, (child) => {
652
+ }), headSnippets.map(snippetToElement).map((children) => Children.map(children, (child) => {
661
653
  if (typeof child === "string")
662
654
  return child;
663
655
  if (VALID_HEAD_ELEMENT_TYPES.includes(child.type))
@@ -1178,7 +1170,7 @@ async function fonts(_req, res, { getFonts } = {}) {
1178
1170
  const fonts2 = (_a = await (getFonts == null ? void 0 : getFonts())) != null ? _a : [];
1179
1171
  return res.json(fonts2);
1180
1172
  }
1181
- const version = "0.11.5";
1173
+ const version = "0.11.7";
1182
1174
  async function handler(req, res, { apiKey, siteVersions }) {
1183
1175
  if (req.query.secret !== apiKey) {
1184
1176
  return res.status(401).json({ message: "Unauthorized" });
@@ -1280,10 +1272,14 @@ Read more here: https://nextjs.org/blog/next-12-2#on-demand-incremental-static-r
1280
1272
  async function translatableData(req, res, client) {
1281
1273
  const elementTree2 = req.body.elementTree;
1282
1274
  if (elementTree2 == null) {
1283
- return res.status(400).json({ message: "elementTree must be defined" });
1275
+ return res.status(400).json({ message: "elementTree must be defined." });
1276
+ }
1277
+ try {
1278
+ let translatableData2 = client.getTranslatableData(elementTree2);
1279
+ return res.json({ translatableData: translatableData2 });
1280
+ } catch (error) {
1281
+ res.status(500).json({ message: "Failed to get traslatable data." });
1284
1282
  }
1285
- const translatableData2 = client.getTranslatableData(elementTree2);
1286
- return res.json({ translatableData: translatableData2 });
1287
1283
  }
1288
1284
  async function mergeTranslatedData(req, res, client) {
1289
1285
  const translatedData = req.body.translatedData;