@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.cjs.js CHANGED
@@ -571,7 +571,6 @@ function Page$1({
571
571
  const socialImage = (_e = baseLocalizedPage == null ? void 0 : baseLocalizedPage.meta.socialImage) != null ? _e : page.meta.socialImage;
572
572
  const canonicalUrl = (_f = baseLocalizedPage == null ? void 0 : baseLocalizedPage.seo.canonicalUrl) != null ? _f : page.seo.canonicalUrl;
573
573
  const isIndexingBlocked = (_g = baseLocalizedPage == null ? void 0 : baseLocalizedPage.seo.isIndexingBlocked) != null ? _g : page.seo.isIndexingBlocked;
574
- const hreflangs = page.hreflangs;
575
574
  const fontFamilyParamValue = React.useMemo(() => {
576
575
  if (site == null) {
577
576
  return page.fonts.map(({
@@ -683,14 +682,7 @@ function Page$1({
683
682
  rel: "stylesheet",
684
683
  href: `https://fonts.googleapis.com/css?family=${fontFamilyParamValue}&display=swap`
685
684
  })
686
- }), hreflangs.map(({
687
- hreflang,
688
- href
689
- }) => /* @__PURE__ */ jsxRuntime.jsx("link", {
690
- rel: "alternate",
691
- hrefLang: hreflang,
692
- href
693
- }, hreflang)), headSnippets.map(snippetToElement).map((children) => React.Children.map(children, (child) => {
685
+ }), headSnippets.map(snippetToElement).map((children) => React.Children.map(children, (child) => {
694
686
  if (typeof child === "string")
695
687
  return child;
696
688
  if (VALID_HEAD_ELEMENT_TYPES.includes(child.type))
@@ -1211,7 +1203,7 @@ async function fonts(_req, res, { getFonts } = {}) {
1211
1203
  const fonts2 = (_a = await (getFonts == null ? void 0 : getFonts())) != null ? _a : [];
1212
1204
  return res.json(fonts2);
1213
1205
  }
1214
- const version = "0.11.5";
1206
+ const version = "0.11.7";
1215
1207
  async function handler(req, res, { apiKey, siteVersions }) {
1216
1208
  if (req.query.secret !== apiKey) {
1217
1209
  return res.status(401).json({ message: "Unauthorized" });
@@ -1313,10 +1305,14 @@ Read more here: https://nextjs.org/blog/next-12-2#on-demand-incremental-static-r
1313
1305
  async function translatableData(req, res, client) {
1314
1306
  const elementTree2 = req.body.elementTree;
1315
1307
  if (elementTree2 == null) {
1316
- return res.status(400).json({ message: "elementTree must be defined" });
1308
+ return res.status(400).json({ message: "elementTree must be defined." });
1309
+ }
1310
+ try {
1311
+ let translatableData2 = client.getTranslatableData(elementTree2);
1312
+ return res.json({ translatableData: translatableData2 });
1313
+ } catch (error) {
1314
+ res.status(500).json({ message: "Failed to get traslatable data." });
1317
1315
  }
1318
- const translatableData2 = client.getTranslatableData(elementTree2);
1319
- return res.json({ translatableData: translatableData2 });
1320
1316
  }
1321
1317
  async function mergeTranslatedData(req, res, client) {
1322
1318
  const translatedData = req.body.translatedData;