@levo-so/blocks 0.1.89 → 0.1.91

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@levo-so/blocks",
3
- "version": "0.1.89",
3
+ "version": "0.1.91",
4
4
  "author": "Levo Engineering <devs@theinternetfolks.com>",
5
5
  "description": "Set of blocks for Levo studio",
6
6
  "type": "module",
@@ -16,7 +16,7 @@
16
16
  "react": ">=18",
17
17
  "react-dom": ">=18",
18
18
  "@levo-so/react": "0.1.86",
19
- "@levo-so/studio": "0.1.89",
19
+ "@levo-so/studio": "0.1.91",
20
20
  "@levo-so/core": "0.1.82"
21
21
  },
22
22
  "dependencies": {
@@ -29,10 +29,10 @@
29
29
  "@types/react": "19.2.14",
30
30
  "@types/react-dom": "19.2.3",
31
31
  "typescript": "5.9.3",
32
- "@levo-so/react": "0.1.86",
32
+ "@levo/ts-config": "0.0.0",
33
+ "@levo-so/studio": "0.1.91",
33
34
  "@levo-so/core": "0.1.82",
34
- "@levo-so/studio": "0.1.89",
35
- "@levo/ts-config": "0.0.0"
35
+ "@levo-so/react": "0.1.86"
36
36
  },
37
37
  "main": "./src/index.ts",
38
38
  "exports": {
@@ -31,12 +31,13 @@ interface IBlogMeta {
31
31
 
32
32
  const BlogListing1: React.FC<ILevoBlockBaseProps<IBlogListing1Content>> = ({ content }) => {
33
33
  const { response, query, setQuery } = useContextEngine<IPost, IBlogMeta>("blogs");
34
- const { isBuilder } = useBlockContext();
34
+ const { isBuilder, blockData } = useBlockContext();
35
35
 
36
36
  const handleNext = () => setQuery({ page: (query?.page || 0) + 1 });
37
37
  const handlePrevious = () => setQuery({ page: (query?.page || 0) - 1 });
38
38
 
39
39
  const studioConfig = response?.meta?.blog?.studio_config?.find((item) => !item.block_instance_id);
40
+ const fallbackConfig = (blockData as any)?.config?.blogs?.[0]?.blog?.action?.value;
40
41
 
41
42
  return (
42
43
  <Section elementKey="layout">
@@ -79,7 +80,15 @@ const BlogListing1: React.FC<ILevoBlockBaseProps<IBlogListing1Content>> = ({ con
79
80
  options: {},
80
81
  },
81
82
  }
82
- : {}
83
+ : fallbackConfig
84
+ ? {
85
+ action: {
86
+ type: "external_link" as const,
87
+ value: fallbackConfig.replace(/\{[^}]+\}/g, item?.slug),
88
+ options: {},
89
+ },
90
+ }
91
+ : {}
83
92
  }
84
93
  >
85
94
  <Image
@@ -31,12 +31,13 @@ interface IBlogMeta {
31
31
 
32
32
  const BlogListing2: React.FC<ILevoBlockBaseProps<IBlogListing2Content>> = ({ content }) => {
33
33
  const { response, query, setQuery } = useContextEngine<IPost, IBlogMeta>("blogs");
34
- const { isBuilder } = useBlockContext();
34
+ const { isBuilder, blockData } = useBlockContext();
35
35
 
36
36
  const handleNext = () => setQuery({ page: (query?.page || 0) + 1 });
37
37
  const handlePrevious = () => setQuery({ page: (query?.page || 0) - 1 });
38
38
 
39
39
  const studioConfig = response?.meta?.blog?.studio_config?.find((item) => !item.block_instance_id);
40
+ const fallbackConfig = (blockData as any)?.config?.blogs?.[0]?.blog?.action?.value;
40
41
 
41
42
  return (
42
43
  <Section elementKey="layout">
@@ -79,7 +80,15 @@ const BlogListing2: React.FC<ILevoBlockBaseProps<IBlogListing2Content>> = ({ con
79
80
  options: {},
80
81
  },
81
82
  }
82
- : {}
83
+ : fallbackConfig
84
+ ? {
85
+ action: {
86
+ type: "external_link" as const,
87
+ value: fallbackConfig.replace(/\{[^}]+\}/g, item?.slug),
88
+ options: {},
89
+ },
90
+ }
91
+ : {}
83
92
  }
84
93
  >
85
94
  <Media
@@ -29,14 +29,15 @@ interface IBlogMeta {
29
29
  };
30
30
  }
31
31
 
32
- const BlogListing3: React.FC<ILevoBlockBaseProps<IBlogListing3Content>> = ({ content }) => {
32
+ const BlogListing3: React.FC<ILevoBlockBaseProps<IBlogListing3Content>> = ({ content, config }) => {
33
33
  const { response, query, setQuery } = useContextEngine<IPost, IBlogMeta>("blogs");
34
- const { isBuilder } = useBlockContext();
34
+ const { isBuilder, blockData } = useBlockContext();
35
35
 
36
36
  const handleNext = () => setQuery({ page: (query?.page || 0) + 1 });
37
37
  const handlePrevious = () => setQuery({ page: (query?.page || 0) - 1 });
38
38
 
39
39
  const studioConfig = response?.meta?.blog?.studio_config?.find((item) => !item.block_instance_id);
40
+ const fallbackConfig = (blockData as any)?.config?.blogs?.[0]?.blog?.action?.value;
40
41
 
41
42
  return (
42
43
  <Section elementKey="layout">
@@ -75,7 +76,15 @@ const BlogListing3: React.FC<ILevoBlockBaseProps<IBlogListing3Content>> = ({ con
75
76
  options: {},
76
77
  },
77
78
  }
78
- : {}
79
+ : fallbackConfig
80
+ ? {
81
+ action: {
82
+ type: "external_link" as const,
83
+ value: fallbackConfig.replace(/\{[^}]+\}/g, item?.slug),
84
+ options: {},
85
+ },
86
+ }
87
+ : {}
79
88
  }
80
89
  >
81
90
  <Media