@cntrl-site/sdk-nextjs 1.0.14 → 1.0.16
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/lib/components/Head.js
CHANGED
|
@@ -25,7 +25,7 @@ const CNTRLHead = ({ meta, project }) => {
|
|
|
25
25
|
return;
|
|
26
26
|
return ((0, jsx_runtime_1.jsx)("link", { rel: rel, href: href }, `link-${rel}-${href}`));
|
|
27
27
|
});
|
|
28
|
-
return ((0, jsx_runtime_1.jsxs)(head_1.default, { children: [(0, jsx_runtime_1.jsx)("title", { children: meta.title }), (0, jsx_runtime_1.jsx)("meta", { name: "description", content: meta.description }), (0, jsx_runtime_1.jsx)("meta", { name: "keywords", content: meta.keywords }), (0, jsx_runtime_1.jsx)("meta", { name: "og:image", content: meta.opengraphThumbnail }), (0, jsx_runtime_1.jsx)("meta", { name: "generator", content: "https://cntrl.site" }), (0, jsx_runtime_1.jsx)("link", { rel: "icon", href: meta.favicon }), customFonts.length > 0 && ((0, jsx_runtime_1.jsx)("style", { dangerouslySetInnerHTML: {
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)(head_1.default, { children: [(0, jsx_runtime_1.jsx)("title", { children: meta.title }), (0, jsx_runtime_1.jsx)("meta", { name: "description", content: meta.description }), (0, jsx_runtime_1.jsx)("meta", { name: "og:description", content: meta.description }), (0, jsx_runtime_1.jsx)("meta", { name: "twitter:description", content: meta.description }), (0, jsx_runtime_1.jsx)("meta", { name: "keywords", content: meta.keywords }), (0, jsx_runtime_1.jsx)("meta", { name: "og:image", content: meta.opengraphThumbnail }), (0, jsx_runtime_1.jsx)("meta", { name: "generator", content: "https://cntrl.site" }), (0, jsx_runtime_1.jsx)("link", { rel: "icon", href: meta.favicon }), customFonts.length > 0 && ((0, jsx_runtime_1.jsx)("style", { dangerouslySetInnerHTML: {
|
|
29
29
|
__html: ffGenerator.generate()
|
|
30
30
|
} })), links, htmlHead] }));
|
|
31
31
|
};
|
|
@@ -30,7 +30,7 @@ class RichTextConverter {
|
|
|
30
30
|
const block = blocks[blockIndex];
|
|
31
31
|
const content = text.slice(block.start, block.end + 1);
|
|
32
32
|
const entities = (_a = block.entities.sort((a, b) => a.start - b.start)) !== null && _a !== void 0 ? _a : [];
|
|
33
|
-
if (content.length ===
|
|
33
|
+
if (content.length === 1) {
|
|
34
34
|
const id = `rt_${richText.id}_br_${blockIndex}`;
|
|
35
35
|
root.push((0, jsx_runtime_1.jsx)("div", { className: id, children: (0, jsx_runtime_1.jsx)("br", {}) }, id));
|
|
36
36
|
layouts.forEach(l => {
|
|
@@ -171,7 +171,7 @@ class RichTextConverter {
|
|
|
171
171
|
groupEntities(entities, styleGroups) {
|
|
172
172
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
173
173
|
const entitiesGroups = [];
|
|
174
|
-
if (!entities.length &&
|
|
174
|
+
if (!entities.length && !styleGroups)
|
|
175
175
|
return;
|
|
176
176
|
if (!styleGroups || styleGroups.length === 0) {
|
|
177
177
|
const dividersSet = entities.reduce((ds, e) => {
|
package/package.json
CHANGED
package/src/components/Head.tsx
CHANGED
|
@@ -31,6 +31,8 @@ export const CNTRLHead: FC<Props> = ({ meta, project }) => {
|
|
|
31
31
|
<Head>
|
|
32
32
|
<title>{meta.title}</title>
|
|
33
33
|
<meta name="description" content={meta.description} />
|
|
34
|
+
<meta name="og:description" content={meta.description} />
|
|
35
|
+
<meta name="twitter:description" content={meta.description} />
|
|
34
36
|
<meta name="keywords" content={meta.keywords} />
|
|
35
37
|
<meta name="og:image" content={meta.opengraphThumbnail} />
|
|
36
38
|
<meta name="generator" content="https://cntrl.site" />
|
|
@@ -58,7 +58,7 @@ export class RichTextConverter {
|
|
|
58
58
|
const block = blocks[blockIndex];
|
|
59
59
|
const content = text.slice(block.start, block.end + 1);
|
|
60
60
|
const entities = block.entities!.sort((a, b) => a.start - b.start) ?? [];
|
|
61
|
-
if (content.length ===
|
|
61
|
+
if (content.length === 1) {
|
|
62
62
|
const id = `rt_${richText.id}_br_${blockIndex}`;
|
|
63
63
|
root.push(<div key={id} className={id}><br /></div>);
|
|
64
64
|
layouts.forEach(l => {
|
|
@@ -202,7 +202,7 @@ export class RichTextConverter {
|
|
|
202
202
|
|
|
203
203
|
private groupEntities(entities: RichTextEntity[], styleGroups?: StyleGroup[]): EntitiesGroup[] | undefined {
|
|
204
204
|
const entitiesGroups: EntitiesGroup[] = [];
|
|
205
|
-
if (!entities.length &&
|
|
205
|
+
if (!entities.length && !styleGroups) return;
|
|
206
206
|
if (!styleGroups || styleGroups.length === 0) {
|
|
207
207
|
const dividersSet = entities.reduce((ds, e) => {
|
|
208
208
|
// some entities may have no data, need to filter them out
|