@makeswift/runtime 0.11.4 → 0.11.6

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