@synerise/ds-code-snippet 2.0.6 → 2.0.8

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/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.0.8](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-snippet@2.0.7...@synerise/ds-code-snippet@2.0.8) (2026-10-20)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **code-snippet:** re-highlight only when the code or languages change ([fa3489c](https://github.com/Synerise/synerise-design/commit/fa3489c73448ee72573a0e2a83fc8e1fd1233554))
12
+
13
+
14
+
15
+
16
+
17
+ ## [2.0.7](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-snippet@2.0.6...@synerise/ds-code-snippet@2.0.7) (2026-10-09)
18
+
19
+ **Note:** Version bump only for package @synerise/ds-code-snippet
20
+
21
+
22
+
23
+
24
+
6
25
  ## [2.0.6](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-snippet@2.0.5...@synerise/ds-code-snippet@2.0.6) (2026-09-24)
7
26
 
8
27
  **Note:** Version bump only for package @synerise/ds-code-snippet
@@ -0,0 +1,2 @@
1
+ import { CodeSnippetProps } from './CodeSnippet.types';
2
+ export declare const DEFAULT_LANGUAGES: NonNullable<CodeSnippetProps['languages']>;
@@ -0,0 +1,4 @@
1
+ const DEFAULT_LANGUAGES = ["javascript", "typescript", "json"];
2
+ export {
3
+ DEFAULT_LANGUAGES
4
+ };
@@ -1,4 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import { DEFAULT_LANGUAGES } from "./CodeSnippet.constants.js";
2
3
  import { CodeSnippetType, FontSize } from "./CodeSnippet.types.js";
3
4
  import InlineCode from "./CodeTypes/InlineCode/InlineCode.js";
4
5
  import MultiCode from "./CodeTypes/MultiCode/MultiCode.js";
@@ -6,7 +7,7 @@ import SingleCode from "./CodeTypes/SingleCode/SingleCode.js";
6
7
  import "./style/index.css";
7
8
  const CodeSnippet = ({
8
9
  type = CodeSnippetType.INLINE,
9
- languages = ["javascript", "typescript", "json"],
10
+ languages = DEFAULT_LANGUAGES,
10
11
  children = "",
11
12
  colorSyntax = false,
12
13
  fontSize = FontSize.SMALL,
@@ -3,12 +3,13 @@ import React from "react";
3
3
  import AnimateHeight from "react-animate-height";
4
4
  import Icon, { DuplicateS, ArrowDownCircleM } from "@synerise/ds-icon";
5
5
  import Scrollbar from "@synerise/ds-scrollbar";
6
+ import { DEFAULT_LANGUAGES } from "../../CodeSnippet.constants.js";
6
7
  import Highlight from "../../Highlight/Highlight.js";
7
8
  import { LINE_HEIGHT_DEFAULT, ICON_CLASSNAME } from "../SingleCode/SingleCode.styles.js";
8
9
  import { PreBlock, BlockCodeWrapperMulti, MultiIconCopy, CodeSnippetWrapperMulti, ContentIconWrapper, ExpanderButton } from "./MultiCode.styles.js";
9
10
  const ANIMATE_HEIGHT_TIME = 300;
10
11
  const MultiCode = ({
11
- languages = ["javascript", "typescript", "json"],
12
+ languages = DEFAULT_LANGUAGES,
12
13
  children = "",
13
14
  className,
14
15
  colorSyntax = false,
@@ -57,7 +57,7 @@ const Highlight = ({
57
57
  }, [languages]);
58
58
  useEffect(() => {
59
59
  manageHighlight();
60
- }, [manageHighlight]);
60
+ }, [manageHighlight, children]);
61
61
  return /* @__PURE__ */ jsx(Highlight$1, { ref: elementRef, style, children });
62
62
  };
63
63
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-code-snippet",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
4
4
  "description": "CodeSnippet UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -43,12 +43,10 @@
43
43
  ],
44
44
  "types": "dist/index.d.ts",
45
45
  "dependencies": {
46
- "@synerise/ds-button": "^2.1.1",
47
- "@synerise/ds-copy-icon": "^2.0.6",
48
- "@synerise/ds-icon": "^2.2.0",
49
- "@synerise/ds-scrollbar": "^2.0.5",
50
- "@synerise/ds-tooltip": "^2.0.6",
51
- "@synerise/ds-utils": "^2.2.0",
46
+ "@synerise/ds-button": "^2.1.3",
47
+ "@synerise/ds-copy-icon": "^2.0.8",
48
+ "@synerise/ds-icon": "^2.2.2",
49
+ "@synerise/ds-scrollbar": "^2.0.7",
52
50
  "highlight.js": "^10.7.2",
53
51
  "react-animate-height": "^2.0.23"
54
52
  },
@@ -61,5 +59,5 @@
61
59
  "react": ">=16.9.0 <= 18.3.1",
62
60
  "styled-components": "^5.3.3"
63
61
  },
64
- "gitHead": "6b725db2b0de1a2dfc6e9a3744f6c2fb2a04cc04"
62
+ "gitHead": "ac1a96b3cd66d2836b0639b3d9920fc0ebd7f8f3"
65
63
  }