@meduza/ui-kit-2 0.6.8 → 0.6.9
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/ui-kit-2.cjs.development.js +16 -6
- package/dist/ui-kit-2.cjs.development.js.map +1 -1
- package/dist/ui-kit-2.cjs.production.min.js +1 -1
- package/dist/ui-kit-2.cjs.production.min.js.map +1 -1
- package/dist/ui-kit-2.esm.js +16 -6
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/RenderBlocks/index.tsx +7 -4
- package/src/SimpleBlock/index.tsx +7 -2
package/package.json
CHANGED
|
@@ -64,16 +64,19 @@ export const RenderBlocks: React.FC<RenderBlocksProps> = ({
|
|
|
64
64
|
)
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
case 'h1':
|
|
68
|
-
case 'h2':
|
|
69
|
-
case 'h3':
|
|
70
|
-
case 'h4':
|
|
71
67
|
case 'blockquote':
|
|
72
68
|
case 'p':
|
|
73
69
|
case 'context_p':
|
|
74
70
|
case 'divider':
|
|
75
71
|
case 'lead':
|
|
76
72
|
case 'lead_hr': {
|
|
73
|
+
return <SimpleBlock block={block} styleContext={styleContext} />
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
case 'h1':
|
|
77
|
+
case 'h2':
|
|
78
|
+
case 'h3':
|
|
79
|
+
case 'h4': {
|
|
77
80
|
return <SimpleBlock block={block} styleContext={styleContext} id={block.id} />
|
|
78
81
|
}
|
|
79
82
|
|
|
@@ -8,9 +8,10 @@ import styles from './SimpleBlock.module.css'
|
|
|
8
8
|
export const SimpleBlock: React.FC<SimpleBlockProps> = ({
|
|
9
9
|
block: { data, type, only_on: onlyOn },
|
|
10
10
|
styleContext,
|
|
11
|
-
id
|
|
11
|
+
id = null
|
|
12
12
|
}) => {
|
|
13
13
|
let TagName
|
|
14
|
+
let tagProps: {id?: string} = {}
|
|
14
15
|
|
|
15
16
|
let classNames: ClassNames = [
|
|
16
17
|
[styles[type], !!type && !!styles[type]],
|
|
@@ -39,11 +40,15 @@ export const SimpleBlock: React.FC<SimpleBlockProps> = ({
|
|
|
39
40
|
TagName = type
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
if (id) {
|
|
44
|
+
tagProps.id = id
|
|
45
|
+
}
|
|
46
|
+
|
|
42
47
|
return (
|
|
43
48
|
<TagName
|
|
44
49
|
className={makeClassName(classNames)}
|
|
45
50
|
dangerouslySetInnerHTML={{ __html: data }}
|
|
46
|
-
|
|
51
|
+
{...tagProps}
|
|
47
52
|
/>
|
|
48
53
|
)
|
|
49
54
|
}
|