@synerise/ds-code-snippet 2.0.2 → 2.0.4
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,18 @@
|
|
|
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.4](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-snippet@2.0.3...@synerise/ds-code-snippet@2.0.4) (2026-09-18)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-code-snippet
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.0.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-snippet@2.0.2...@synerise/ds-code-snippet@2.0.3) (2026-09-16)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @synerise/ds-code-snippet
|
|
17
|
+
|
|
6
18
|
## [2.0.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-snippet@2.0.1...@synerise/ds-code-snippet@2.0.2) (2026-09-08)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @synerise/ds-code-snippet
|
|
@@ -41,7 +41,7 @@ const MultiCode = ({
|
|
|
41
41
|
return (numberRows + 1) * LINE_HEIGHT_DEFAULT;
|
|
42
42
|
}, [rows, allRows]);
|
|
43
43
|
const onMounting = React.useCallback(() => {
|
|
44
|
-
if (
|
|
44
|
+
if (codeRef && codeRef?.current) {
|
|
45
45
|
setAllRows(Math.round(codeRef.current.offsetHeight / LINE_HEIGHT_DEFAULT));
|
|
46
46
|
}
|
|
47
47
|
}, [codeRef]);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { __vitePreload } from "../_virtual/preload-helper.js";
|
|
2
1
|
import { jsx } from "react/jsx-runtime";
|
|
3
2
|
import hljs from "highlight.js/lib/core";
|
|
4
3
|
import css from "highlight.js/lib/languages/css";
|
|
@@ -42,10 +41,10 @@ const Highlight = ({
|
|
|
42
41
|
const unbundled = languages.filter((lang) => !registeredLanguages.has(lang));
|
|
43
42
|
await Promise.all(unbundled.map(async (language) => {
|
|
44
43
|
try {
|
|
45
|
-
const module = await
|
|
44
|
+
const module = await import(
|
|
46
45
|
/* @vite-ignore */
|
|
47
46
|
`highlight.js/lib/languages/${language}`
|
|
48
|
-
)
|
|
47
|
+
);
|
|
49
48
|
hljs.registerLanguage(language, module.default);
|
|
50
49
|
registeredLanguages.add(language);
|
|
51
50
|
} catch {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from './CodeSnippet';
|
|
2
|
-
export {
|
|
2
|
+
export { type CodeSnippetProps, CodeSnippetType } from './CodeSnippet.types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-code-snippet",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "CodeSnippet UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
],
|
|
44
44
|
"types": "dist/index.d.ts",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@synerise/ds-button": "^2.0.
|
|
47
|
-
"@synerise/ds-copy-icon": "^2.0.
|
|
48
|
-
"@synerise/ds-icon": "^2.1.
|
|
49
|
-
"@synerise/ds-scrollbar": "^2.0.
|
|
50
|
-
"@synerise/ds-tooltip": "^2.0.
|
|
51
|
-
"@synerise/ds-utils": "^2.
|
|
46
|
+
"@synerise/ds-button": "^2.0.4",
|
|
47
|
+
"@synerise/ds-copy-icon": "^2.0.4",
|
|
48
|
+
"@synerise/ds-icon": "^2.1.2",
|
|
49
|
+
"@synerise/ds-scrollbar": "^2.0.3",
|
|
50
|
+
"@synerise/ds-tooltip": "^2.0.4",
|
|
51
|
+
"@synerise/ds-utils": "^2.1.1",
|
|
52
52
|
"highlight.js": "^10.7.2",
|
|
53
53
|
"react-animate-height": "^2.0.23"
|
|
54
54
|
},
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"react": ">=16.9.0 <= 18.3.1",
|
|
62
62
|
"styled-components": "^5.3.3"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "b1d905617dfb186b5d80966d63ce55bf29df743d"
|
|
65
65
|
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
const scriptRel = "modulepreload";
|
|
2
|
-
const assetsURL = function(dep) {
|
|
3
|
-
return "/" + dep;
|
|
4
|
-
};
|
|
5
|
-
const seen = {};
|
|
6
|
-
const __vitePreload = function preload(baseModule, deps, importerUrl) {
|
|
7
|
-
let promise = Promise.resolve();
|
|
8
|
-
if (deps && deps.length > 0) {
|
|
9
|
-
let allSettled = function(promises$2) {
|
|
10
|
-
return Promise.all(promises$2.map((p) => Promise.resolve(p).then((value$1) => ({
|
|
11
|
-
status: "fulfilled",
|
|
12
|
-
value: value$1
|
|
13
|
-
}), (reason) => ({
|
|
14
|
-
status: "rejected",
|
|
15
|
-
reason
|
|
16
|
-
}))));
|
|
17
|
-
};
|
|
18
|
-
document.getElementsByTagName("link");
|
|
19
|
-
const cspNonceMeta = document.querySelector("meta[property=csp-nonce]");
|
|
20
|
-
const cspNonce = cspNonceMeta?.nonce || cspNonceMeta?.getAttribute("nonce");
|
|
21
|
-
promise = allSettled(deps.map((dep) => {
|
|
22
|
-
dep = assetsURL(dep);
|
|
23
|
-
if (dep in seen) return;
|
|
24
|
-
seen[dep] = true;
|
|
25
|
-
const isCss = dep.endsWith(".css");
|
|
26
|
-
const cssSelector = isCss ? '[rel="stylesheet"]' : "";
|
|
27
|
-
if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) return;
|
|
28
|
-
const link = document.createElement("link");
|
|
29
|
-
link.rel = isCss ? "stylesheet" : scriptRel;
|
|
30
|
-
if (!isCss) link.as = "script";
|
|
31
|
-
link.crossOrigin = "";
|
|
32
|
-
link.href = dep;
|
|
33
|
-
if (cspNonce) link.setAttribute("nonce", cspNonce);
|
|
34
|
-
document.head.appendChild(link);
|
|
35
|
-
if (isCss) return new Promise((res, rej) => {
|
|
36
|
-
link.addEventListener("load", res);
|
|
37
|
-
link.addEventListener("error", () => rej(/* @__PURE__ */ new Error(`Unable to preload CSS for ${dep}`)));
|
|
38
|
-
});
|
|
39
|
-
}));
|
|
40
|
-
}
|
|
41
|
-
function handlePreloadError(err$2) {
|
|
42
|
-
const e$1 = new Event("vite:preloadError", { cancelable: true });
|
|
43
|
-
e$1.payload = err$2;
|
|
44
|
-
window.dispatchEvent(e$1);
|
|
45
|
-
if (!e$1.defaultPrevented) throw err$2;
|
|
46
|
-
}
|
|
47
|
-
return promise.then((res) => {
|
|
48
|
-
for (const item of res || []) {
|
|
49
|
-
if (item.status !== "rejected") continue;
|
|
50
|
-
handlePreloadError(item.reason);
|
|
51
|
-
}
|
|
52
|
-
return baseModule().catch(handlePreloadError);
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
export {
|
|
56
|
-
__vitePreload
|
|
57
|
-
};
|