@ampless/runtime 1.0.0-beta.62 → 1.0.0-beta.64
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.js +11 -16
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -172,9 +172,9 @@ function createSiteSettings(cmsConfig, storage) {
|
|
|
172
172
|
const baseSite = cmsConfig.site;
|
|
173
173
|
return {
|
|
174
174
|
site: {
|
|
175
|
-
name: remote?.site?.name ?? baseSite.name,
|
|
176
|
-
url: remote?.site?.url ?? baseSite.url,
|
|
177
|
-
description: remote?.site?.description ?? baseSite.description
|
|
175
|
+
name: String(remote?.site?.name ?? baseSite.name ?? ""),
|
|
176
|
+
url: String(remote?.site?.url ?? baseSite.url ?? ""),
|
|
177
|
+
description: (remote?.site?.description ?? baseSite.description) != null ? String(remote?.site?.description ?? baseSite.description) : void 0
|
|
178
178
|
},
|
|
179
179
|
media: {
|
|
180
180
|
imageDisplay: remote?.media?.imageDisplay ?? cmsConfig.media?.imageDisplay,
|
|
@@ -221,7 +221,7 @@ function createSeo(cmsConfig, settingsApi) {
|
|
|
221
221
|
async siteMetadata() {
|
|
222
222
|
const settings = await settingsApi.loadSiteSettings();
|
|
223
223
|
const accum = {
|
|
224
|
-
title: settings.site.name,
|
|
224
|
+
title: String(settings.site.name ?? ""),
|
|
225
225
|
description: settings.site.description
|
|
226
226
|
};
|
|
227
227
|
for (const plugin of plugins) {
|
|
@@ -403,7 +403,10 @@ function htmlPassthrough(html) {
|
|
|
403
403
|
return createElement("span", { dangerouslySetInnerHTML: { __html: html } });
|
|
404
404
|
}
|
|
405
405
|
function htmlPassthroughBlock(html, key) {
|
|
406
|
-
const props = {
|
|
406
|
+
const props = {
|
|
407
|
+
dangerouslySetInnerHTML: { __html: html },
|
|
408
|
+
suppressHydrationWarning: true
|
|
409
|
+
};
|
|
407
410
|
if (key !== void 0) props.key = key;
|
|
408
411
|
return createElement("div", props);
|
|
409
412
|
}
|
|
@@ -427,6 +430,9 @@ function renderTiptapNode(node, opts, key) {
|
|
|
427
430
|
if (node.type === "text") {
|
|
428
431
|
return htmlPassthrough(renderTiptapString(node));
|
|
429
432
|
}
|
|
433
|
+
if (node.type === "codeBlock") {
|
|
434
|
+
return htmlPassthroughBlock(renderTiptapString(node), key);
|
|
435
|
+
}
|
|
430
436
|
const childNodes = node.content ?? [];
|
|
431
437
|
const children = childNodes.map(
|
|
432
438
|
(c, i) => renderTiptapNode(c, opts, `${key}.${i}`)
|
|
@@ -450,17 +456,6 @@ function renderTiptapNode(node, opts, key) {
|
|
|
450
456
|
return createElement("ol", { key }, ...children);
|
|
451
457
|
case "listItem":
|
|
452
458
|
return createElement("li", { key }, ...children);
|
|
453
|
-
case "codeBlock": {
|
|
454
|
-
const codeProps = {};
|
|
455
|
-
if (node.attrs?.language) {
|
|
456
|
-
codeProps.className = `language-${String(node.attrs.language)}`;
|
|
457
|
-
}
|
|
458
|
-
return createElement(
|
|
459
|
-
"pre",
|
|
460
|
-
{ key },
|
|
461
|
-
createElement("code", codeProps, ...children)
|
|
462
|
-
);
|
|
463
|
-
}
|
|
464
459
|
case "blockquote":
|
|
465
460
|
return createElement("blockquote", { key }, ...children);
|
|
466
461
|
case "hardBreak":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ampless/runtime",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.64",
|
|
4
4
|
"description": "Public-side runtime for ampless: post fetching, theme dispatch, middleware, public route handlers",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"marked": "^18.0.4",
|
|
52
52
|
"sanitize-html": "^2.17.4",
|
|
53
53
|
"tailwind-merge": "^3.6.0",
|
|
54
|
-
"@ampless/plugin-og-image": "0.2.0-beta.
|
|
55
|
-
"ampless": "1.0.0-beta.
|
|
54
|
+
"@ampless/plugin-og-image": "0.2.0-beta.53",
|
|
55
|
+
"ampless": "1.0.0-beta.53"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@aws-amplify/adapter-nextjs": "^1",
|