@san-siva/blogkit 1.1.45 → 1.1.46

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.
@@ -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, 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 })] }));
4
+ const BlogStatic = ({ children, jsonLd, increasedWidthMode = false, isTocEnabled = true }) => {
5
+ return (jsxs("div", { className: `${styles.blog} ${increasedWidthMode ? styles['blog--increased-width'] : ''} ${isTocEnabled ? '' : styles['blog--no-toc']}`, 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\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
+ {"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\tisTocEnabled?: boolean;\n}\n\nconst BlogStatic = ({ children, jsonLd, increasedWidthMode = false, isTocEnabled = true }: BlogStaticProperties) => {\n\treturn (\n\t\t<div\n\t\t\tclassName={`${styles.blog} ${increasedWidthMode ? styles['blog--increased-width'] : ''} ${\n\t\t\t\tisTocEnabled ? '' : styles['blog--no-toc']\n\t\t\t}`}\n\t\t>\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":";;;AAWA,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,kBAAkB,GAAG,KAAK,EAAE,YAAY,GAAG,IAAI,EAAwB,KAAI;AAClH,IAAA,QACCA,IAAA,CAAA,KAAA,EAAA,EACC,SAAS,EAAE,GAAG,MAAM,CAAC,IAAI,CAAA,CAAA,EAAI,kBAAkB,GAAG,MAAM,CAAC,uBAAuB,CAAC,GAAG,EAAE,CAAA,CAAA,EACrF,YAAY,GAAG,EAAE,GAAG,MAAM,CAAC,cAAc,CAC1C,CAAA,CAAE,EAAA,QAAA,EAAA,CAGD,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","blog--increased-width":"Blog-module_blog--increased-width__QxyOD"};
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","blog--no-toc":"Blog-module_blog--no-toc__ggkFH"};
2
2
 
3
3
  export { styles as default };
4
4
  //# sourceMappingURL=Blog.module.scss.js.map
@@ -4,7 +4,8 @@ interface BlogStaticProperties {
4
4
  children: ReactNode;
5
5
  jsonLd?: WithContext<Thing>;
6
6
  increasedWidthMode?: boolean;
7
+ isTocEnabled?: boolean;
7
8
  }
8
- declare const BlogStatic: ({ children, jsonLd, increasedWidthMode }: BlogStaticProperties) => import("react").JSX.Element;
9
+ declare const BlogStatic: ({ children, jsonLd, increasedWidthMode, isTocEnabled }: BlogStaticProperties) => import("react").JSX.Element;
9
10
  export default BlogStatic;
10
11
  //# 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;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,QAAA,MAAM,UAAU,GAAI,0CAAkD,oBAAoB,gCAazF,CAAC;AAEF,eAAe,UAAU,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;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,UAAU,GAAI,wDAAuE,oBAAoB,gCAiB9G,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.45",
3
+ "version": "1.1.46",
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",
@@ -10,6 +10,7 @@ describe('Blog', () => {
10
10
  const element = Blog({ children: 'hello', isTocEnabled: false } as never);
11
11
  expect(element.type).toBe(BlogStatic);
12
12
  expect(element.props.children).toBe('hello');
13
+ expect(element.props.isTocEnabled).toBe(false);
13
14
  });
14
15
 
15
16
  it('wraps BlogDynamic in a Suspense boundary with a BlogStatic fallback when isTocEnabled is true (default)', () => {
@@ -24,7 +24,7 @@ const Blog = ({
24
24
  }: BlogProperties) => {
25
25
  if (!isTocEnabled) {
26
26
  return (
27
- <BlogStatic jsonLd={jsonLd} increasedWidthMode={increasedWidthMode}>
27
+ <BlogStatic jsonLd={jsonLd} increasedWidthMode={increasedWidthMode} isTocEnabled={false}>
28
28
  {children}
29
29
  </BlogStatic>
30
30
  );
@@ -6,11 +6,16 @@ interface BlogStaticProperties {
6
6
  children: ReactNode;
7
7
  jsonLd?: WithContext<Thing>;
8
8
  increasedWidthMode?: boolean;
9
+ isTocEnabled?: boolean;
9
10
  }
10
11
 
11
- const BlogStatic = ({ children, jsonLd, increasedWidthMode = false }: BlogStaticProperties) => {
12
+ const BlogStatic = ({ children, jsonLd, increasedWidthMode = false, isTocEnabled = true }: BlogStaticProperties) => {
12
13
  return (
13
- <div className={`${styles.blog} ${increasedWidthMode ? styles['blog--increased-width'] : ''}`}>
14
+ <div
15
+ className={`${styles.blog} ${increasedWidthMode ? styles['blog--increased-width'] : ''} ${
16
+ isTocEnabled ? '' : styles['blog--no-toc']
17
+ }`}
18
+ >
14
19
 
15
20
  {jsonLd && (
16
21
  <script
@@ -41,6 +41,15 @@ $total-width: calc(#{$content-width} + #{styles.space(8)} + #{$sidebar-width});
41
41
  min-width: 0;
42
42
  }
43
43
  }
44
+
45
+ &--no-toc {
46
+ grid-template-columns: minmax(0, 1fr);
47
+ max-width: $content-width;
48
+
49
+ &.blog--increased-width {
50
+ max-width: 100%;
51
+ }
52
+ }
44
53
  }
45
54
 
46
55
  $breakpoint: calc(
@@ -1,6 +1,7 @@
1
1
  declare const styles: {
2
2
  readonly blog: string;
3
3
  readonly 'blog--increased-width': string;
4
+ readonly 'blog--no-toc': string;
4
5
  readonly 'blog__content': string;
5
6
  readonly 'blog__sidebar': string;
6
7
  readonly 'margin-bottom--3': string;