@san-siva/blogkit 1.1.42 → 1.1.43
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/cjs/components/Blog.js +2 -2
- package/dist/cjs/components/Blog.js.map +1 -1
- package/dist/cjs/dynamicComponents/BlogDynamic.js +2 -2
- package/dist/cjs/dynamicComponents/BlogDynamic.js.map +1 -1
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.css.map +1 -1
- package/dist/cjs/staticComponents/BlogStatic.js +2 -2
- package/dist/cjs/staticComponents/BlogStatic.js.map +1 -1
- package/dist/cjs/styles/Blog.module.scss.js +1 -1
- package/dist/esm/components/Blog.js +2 -2
- package/dist/esm/components/Blog.js.map +1 -1
- package/dist/esm/dynamicComponents/BlogDynamic.js +2 -2
- package/dist/esm/dynamicComponents/BlogDynamic.js.map +1 -1
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.css.map +1 -1
- package/dist/esm/staticComponents/BlogStatic.js +2 -2
- package/dist/esm/staticComponents/BlogStatic.js.map +1 -1
- package/dist/esm/styles/Blog.module.scss.js +1 -1
- package/dist/types/components/Blog.d.ts +2 -1
- package/dist/types/components/Blog.d.ts.map +1 -1
- package/dist/types/dynamicComponents/BlogDynamic.d.ts +2 -1
- package/dist/types/dynamicComponents/BlogDynamic.d.ts.map +1 -1
- package/dist/types/staticComponents/BlogStatic.d.ts +2 -1
- package/dist/types/staticComponents/BlogStatic.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/Blog.tsx +4 -3
- package/src/dynamicComponents/BlogDynamic.tsx +3 -1
- package/src/staticComponents/BlogStatic.tsx +4 -2
- package/src/styles/Blog.module.scss +22 -4
- package/src/styles/Blog.module.scss.d.ts +1 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import styles from '../styles/Blog.module.scss.js';
|
|
3
3
|
|
|
4
|
-
const BlogStatic = ({ children, jsonLd }) => {
|
|
5
|
-
return (jsxs("div", { className: styles.blog
|
|
4
|
+
const BlogStatic = ({ children, jsonLd, increasedWidthMode = false }) => {
|
|
5
|
+
return (jsxs("div", { className: `${styles.blog} ${increasedWidthMode ? styles['blog--increased-width'] : ''}`, children: [jsonLd && (jsx("script", { type: "application/ld+json", dangerouslySetInnerHTML: { __html: JSON.stringify(jsonLd) } })), jsx("div", { className: styles['blog__content'], children: children })] }));
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export { BlogStatic as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlogStatic.js","sources":["../../../src/staticComponents/BlogStatic.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { Thing, WithContext } from 'schema-dts';\nimport styles from '../styles/Blog.module.scss';\n\ninterface BlogStaticProperties {\n\tchildren: ReactNode;\n\tjsonLd?: WithContext<Thing>;\n}\n\nconst BlogStatic = ({ children, jsonLd }: BlogStaticProperties) => {\n\treturn (\n\t\t<div className={styles.blog}>\n\t\t\t{jsonLd && (\n\t\t\t\t<script\n\t\t\t\t\ttype=\"application/ld+json\"\n\t\t\t\t\tdangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<div className={styles['blog__content']}>{children}</div>\n\t\t</div>\n\t);\n};\n\nexport default BlogStatic;\n"],"names":["_jsxs","_jsx"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"BlogStatic.js","sources":["../../../src/staticComponents/BlogStatic.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { Thing, WithContext } from 'schema-dts';\nimport styles from '../styles/Blog.module.scss';\n\ninterface BlogStaticProperties {\n\tchildren: ReactNode;\n\tjsonLd?: WithContext<Thing>;\n\tincreasedWidthMode?: boolean;\n}\n\nconst BlogStatic = ({ children, jsonLd, increasedWidthMode = false }: BlogStaticProperties) => {\n\treturn (\n\t\t<div className={`${styles.blog} ${increasedWidthMode ? styles['blog--increased-width'] : ''}`}>\n\n\t\t\t{jsonLd && (\n\t\t\t\t<script\n\t\t\t\t\ttype=\"application/ld+json\"\n\t\t\t\t\tdangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<div className={styles['blog__content']}>{children}</div>\n\t\t</div>\n\t);\n};\n\nexport default BlogStatic;\n"],"names":["_jsxs","_jsx"],"mappings":";;;AAUA,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,kBAAkB,GAAG,KAAK,EAAwB,KAAI;IAC7F,QACCA,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,CAAA,EAAG,MAAM,CAAC,IAAI,CAAA,CAAA,EAAI,kBAAkB,GAAG,MAAM,CAAC,uBAAuB,CAAC,GAAG,EAAE,CAAA,CAAE,EAAA,QAAA,EAAA,CAE3F,MAAM,KACNC,GAAA,CAAA,QAAA,EAAA,EACC,IAAI,EAAC,qBAAqB,EAC1B,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,EAAA,CAC1D,CACF,EACDA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAO,CAAA,EAAA,CACpD;AAER;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var styles = {"margin-bottom--3":"Blog-module_margin-bottom--3__ir35O","category__header":"Blog-module_category__header__F1K0V","blog":"Blog-module_blog__Lpv6Z","blog__content":"Blog-module_blog__content__RMDiY","blog__sidebar":"Blog-module_blog__sidebar__uSu3l"};
|
|
1
|
+
var styles = {"margin-bottom--3":"Blog-module_margin-bottom--3__ir35O","category__header":"Blog-module_category__header__F1K0V","blog":"Blog-module_blog__Lpv6Z","blog__content":"Blog-module_blog__content__RMDiY","blog__sidebar":"Blog-module_blog__sidebar__uSu3l","blog--increased-width":"Blog-module_blog--increased-width__QxyOD"};
|
|
2
2
|
|
|
3
3
|
export { styles as default };
|
|
4
4
|
//# sourceMappingURL=Blog.module.scss.js.map
|
|
@@ -4,7 +4,8 @@ interface BlogProperties {
|
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
title?: string;
|
|
6
6
|
jsonLd?: WithContext<Thing>;
|
|
7
|
+
increasedWidthMode?: boolean;
|
|
7
8
|
}
|
|
8
|
-
declare const Blog: ({ children, title, jsonLd }: BlogProperties) => import("react").JSX.Element;
|
|
9
|
+
declare const Blog: ({ children, title, jsonLd, increasedWidthMode }: BlogProperties) => import("react").JSX.Element;
|
|
9
10
|
export default Blog;
|
|
10
11
|
//# sourceMappingURL=Blog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Blog.d.ts","sourceRoot":"","sources":["../../../src/components/Blog.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAKrD,UAAU,cAAc;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"Blog.d.ts","sourceRoot":"","sources":["../../../src/components/Blog.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAKrD,UAAU,cAAc;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,QAAA,MAAM,IAAI,GAAI,iDAA6E,cAAc,gCAMxG,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -4,11 +4,12 @@ interface BlogProperties {
|
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
title?: string;
|
|
6
6
|
jsonLd?: WithContext<Thing>;
|
|
7
|
+
increasedWidthMode?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export interface ForwardedReference {
|
|
9
10
|
parentRef: HTMLDivElement;
|
|
10
11
|
childRefs: ForwardedReference[];
|
|
11
12
|
}
|
|
12
|
-
declare const Blog: ({ children, title, jsonLd, }: BlogProperties) => import("react").JSX.Element;
|
|
13
|
+
declare const Blog: ({ children, title, jsonLd, increasedWidthMode, }: BlogProperties) => import("react").JSX.Element;
|
|
13
14
|
export default Blog;
|
|
14
15
|
//# sourceMappingURL=BlogDynamic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlogDynamic.d.ts","sourceRoot":"","sources":["../../../src/dynamicComponents/BlogDynamic.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AASrD,UAAU,cAAc;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"BlogDynamic.d.ts","sourceRoot":"","sources":["../../../src/dynamicComponents/BlogDynamic.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AASrD,UAAU,cAAc;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAkB;IAClC,SAAS,EAAE,cAAc,CAAC;IAC1B,SAAS,EAAE,kBAAkB,EAAE,CAAC;CAChC;AAsBD,QAAA,MAAM,IAAI,GAAI,kDAKX,cAAc,gCAuDhB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -3,7 +3,8 @@ import type { Thing, WithContext } from 'schema-dts';
|
|
|
3
3
|
interface BlogStaticProperties {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
jsonLd?: WithContext<Thing>;
|
|
6
|
+
increasedWidthMode?: boolean;
|
|
6
7
|
}
|
|
7
|
-
declare const BlogStatic: ({ children, jsonLd }: BlogStaticProperties) => import("react").JSX.Element;
|
|
8
|
+
declare const BlogStatic: ({ children, jsonLd, increasedWidthMode }: BlogStaticProperties) => import("react").JSX.Element;
|
|
8
9
|
export default BlogStatic;
|
|
9
10
|
//# sourceMappingURL=BlogStatic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlogStatic.d.ts","sourceRoot":"","sources":["../../../src/staticComponents/BlogStatic.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGrD,UAAU,oBAAoB;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"BlogStatic.d.ts","sourceRoot":"","sources":["../../../src/staticComponents/BlogStatic.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGrD,UAAU,oBAAoB;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,QAAA,MAAM,UAAU,GAAI,0CAAkD,oBAAoB,gCAazF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@san-siva/blogkit",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.43",
|
|
4
4
|
"description": "A reusable blog component library for React/Next.js applications with code highlighting, diagrams, and rich content features",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"author": "Santhosh Siva",
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@san-siva/stylekit": "^1.0.
|
|
44
|
+
"@san-siva/stylekit": "^1.0.14",
|
|
45
45
|
"schema-dts": "^1.1.5"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
package/src/components/Blog.tsx
CHANGED
|
@@ -11,12 +11,13 @@ interface BlogProperties {
|
|
|
11
11
|
children: ReactNode;
|
|
12
12
|
title?: string;
|
|
13
13
|
jsonLd?: WithContext<Thing>;
|
|
14
|
+
increasedWidthMode?: boolean;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
const Blog = ({ children, title = 'In this article', jsonLd }: BlogProperties) => {
|
|
17
|
+
const Blog = ({ children, title = 'In this article', jsonLd, increasedWidthMode = false }: BlogProperties) => {
|
|
17
18
|
return (
|
|
18
|
-
<Suspense fallback={<BlogStatic jsonLd={jsonLd}>{children}</BlogStatic>}>
|
|
19
|
-
<BlogDynamic title={title} jsonLd={jsonLd}>{children}</BlogDynamic>
|
|
19
|
+
<Suspense fallback={<BlogStatic jsonLd={jsonLd} increasedWidthMode={increasedWidthMode}>{children}</BlogStatic>}>
|
|
20
|
+
<BlogDynamic title={title} jsonLd={jsonLd} increasedWidthMode={increasedWidthMode}>{children}</BlogDynamic>
|
|
20
21
|
</Suspense>
|
|
21
22
|
);
|
|
22
23
|
};
|
|
@@ -22,6 +22,7 @@ interface BlogProperties {
|
|
|
22
22
|
children: ReactNode;
|
|
23
23
|
title?: string;
|
|
24
24
|
jsonLd?: WithContext<Thing>;
|
|
25
|
+
increasedWidthMode?: boolean;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export interface ForwardedReference {
|
|
@@ -53,6 +54,7 @@ const Blog = ({
|
|
|
53
54
|
children,
|
|
54
55
|
title = 'In this article',
|
|
55
56
|
jsonLd,
|
|
57
|
+
increasedWidthMode = false,
|
|
56
58
|
}: BlogProperties) => {
|
|
57
59
|
const [visibleTitle, setVisibleTitle] = useState<string | null>(null);
|
|
58
60
|
const [showTOC, setShowTOC] = useState(false);
|
|
@@ -75,7 +77,7 @@ const Blog = ({
|
|
|
75
77
|
});
|
|
76
78
|
|
|
77
79
|
return (
|
|
78
|
-
<div className={styles.blog}>
|
|
80
|
+
<div className={`${styles.blog} ${increasedWidthMode ? styles['blog--increased-width'] : ''}`}>
|
|
79
81
|
{jsonLd && (
|
|
80
82
|
<script
|
|
81
83
|
type="application/ld+json"
|
|
@@ -5,11 +5,13 @@ import styles from '../styles/Blog.module.scss';
|
|
|
5
5
|
interface BlogStaticProperties {
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
jsonLd?: WithContext<Thing>;
|
|
8
|
+
increasedWidthMode?: boolean;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
const BlogStatic = ({ children, jsonLd }: BlogStaticProperties) => {
|
|
11
|
+
const BlogStatic = ({ children, jsonLd, increasedWidthMode = false }: BlogStaticProperties) => {
|
|
11
12
|
return (
|
|
12
|
-
<div className={styles.blog}>
|
|
13
|
+
<div className={`${styles.blog} ${increasedWidthMode ? styles['blog--increased-width'] : ''}`}>
|
|
14
|
+
|
|
13
15
|
{jsonLd && (
|
|
14
16
|
<script
|
|
15
17
|
type="application/ld+json"
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
@use '@san-siva/stylekit/styles/
|
|
1
|
+
@use '@san-siva/stylekit/styles/utils.module.scss' as utils;
|
|
2
|
+
@use '@san-siva/stylekit/styles/index.module.scss' as styles with (
|
|
3
|
+
$max-width--page-contents: utils.rem(1200)
|
|
4
|
+
);
|
|
5
|
+
|
|
6
|
+
$sidebar-width: 22rem;
|
|
7
|
+
$content-width: styles.rem(780);
|
|
8
|
+
$total-width: calc(#{$content-width} + #{styles.space(8)} + #{$sidebar-width});
|
|
2
9
|
|
|
3
10
|
.blog {
|
|
4
11
|
width: 100%;
|
|
5
|
-
max-width:
|
|
12
|
+
max-width: $total-width;
|
|
13
|
+
margin: 0 auto;
|
|
6
14
|
display: grid;
|
|
7
|
-
grid-template-columns:
|
|
15
|
+
grid-template-columns: $content-width $sidebar-width;
|
|
8
16
|
grid-gap: styles.space(8);
|
|
9
17
|
|
|
10
18
|
&__content {
|
|
@@ -23,11 +31,21 @@
|
|
|
23
31
|
padding-right: 0;
|
|
24
32
|
border-radius: styles.$border-radius--1;
|
|
25
33
|
}
|
|
34
|
+
|
|
35
|
+
&--increased-width {
|
|
36
|
+
max-width: 100%;
|
|
37
|
+
grid-template-columns: minmax(0, 1fr) $sidebar-width;
|
|
38
|
+
|
|
39
|
+
.blog__content {
|
|
40
|
+
max-width: none;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
26
44
|
}
|
|
27
45
|
|
|
28
46
|
$breakpoint: calc(
|
|
29
47
|
#{styles.rem(120)} + #{styles.rem(780)} + #{styles.space(8)} +
|
|
30
|
-
#{
|
|
48
|
+
#{$sidebar-width} + #{styles.rem(120)}
|
|
31
49
|
);
|
|
32
50
|
|
|
33
51
|
@media (max-width: $breakpoint) {
|