@hackersheet/next-document-content-components 0.1.0-alpha.14 → 0.1.0-alpha.15
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,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
var shiki_exports = {};
|
|
20
30
|
__export(shiki_exports, {
|
|
@@ -23,10 +33,12 @@ __export(shiki_exports, {
|
|
|
23
33
|
module.exports = __toCommonJS(shiki_exports);
|
|
24
34
|
var import_transformers = require("@shikijs/transformers");
|
|
25
35
|
var import_react = require("react");
|
|
26
|
-
var
|
|
36
|
+
var import_web = require("shiki/bundle/web");
|
|
37
|
+
var import_javascript = require("shiki/engine/javascript");
|
|
27
38
|
async function highlighteCode(code, language) {
|
|
28
39
|
const highlighter = await getShikiHighlighter();
|
|
29
|
-
const
|
|
40
|
+
const shikiLangs = highlighter.getLoadedLanguages();
|
|
41
|
+
const shikiLang = shikiLangs.find((lang) => lang === language);
|
|
30
42
|
if (shikiLang === void 0 && language !== "text") {
|
|
31
43
|
return null;
|
|
32
44
|
}
|
|
@@ -46,9 +58,10 @@ async function highlighteCode(code, language) {
|
|
|
46
58
|
return html;
|
|
47
59
|
}
|
|
48
60
|
const getShikiHighlighter = (0, import_react.cache)(async () => {
|
|
49
|
-
return (0,
|
|
50
|
-
themes:
|
|
51
|
-
langs: Object.
|
|
61
|
+
return (0, import_web.getSingletonHighlighterCore)({
|
|
62
|
+
themes: [import("@shikijs/themes/github-light"), import("@shikijs/themes/github-dark-dimmed")],
|
|
63
|
+
langs: Object.values(import_web.bundledLanguages),
|
|
64
|
+
engine: (0, import_javascript.createJavaScriptRegexEngine)()
|
|
52
65
|
});
|
|
53
66
|
});
|
|
54
67
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -5,10 +5,12 @@ import {
|
|
|
5
5
|
transformerNotationHighlight
|
|
6
6
|
} from "@shikijs/transformers";
|
|
7
7
|
import { cache } from "react";
|
|
8
|
-
import { bundledLanguages,
|
|
8
|
+
import { bundledLanguages, getSingletonHighlighterCore } from "shiki/bundle/web";
|
|
9
|
+
import { createJavaScriptRegexEngine } from "shiki/engine/javascript";
|
|
9
10
|
async function highlighteCode(code, language) {
|
|
10
11
|
const highlighter = await getShikiHighlighter();
|
|
11
|
-
const
|
|
12
|
+
const shikiLangs = highlighter.getLoadedLanguages();
|
|
13
|
+
const shikiLang = shikiLangs.find((lang) => lang === language);
|
|
12
14
|
if (shikiLang === void 0 && language !== "text") {
|
|
13
15
|
return null;
|
|
14
16
|
}
|
|
@@ -28,9 +30,10 @@ async function highlighteCode(code, language) {
|
|
|
28
30
|
return html;
|
|
29
31
|
}
|
|
30
32
|
const getShikiHighlighter = cache(async () => {
|
|
31
|
-
return
|
|
32
|
-
themes:
|
|
33
|
-
langs: Object.
|
|
33
|
+
return getSingletonHighlighterCore({
|
|
34
|
+
themes: [import("@shikijs/themes/github-light"), import("@shikijs/themes/github-dark-dimmed")],
|
|
35
|
+
langs: Object.values(bundledLanguages),
|
|
36
|
+
engine: createJavaScriptRegexEngine()
|
|
34
37
|
});
|
|
35
38
|
});
|
|
36
39
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hackersheet/next-document-content-components",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.15",
|
|
4
4
|
"description": "Hacker Sheet document content components for Next.js",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"repository": {
|
|
@@ -25,12 +25,14 @@
|
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@next/third-parties": "^15.5.4",
|
|
28
|
-
"@shikijs/
|
|
28
|
+
"@shikijs/langs": "3.13.0",
|
|
29
|
+
"@shikijs/themes": "3.13.0",
|
|
30
|
+
"@shikijs/transformers": "^3.13.0",
|
|
29
31
|
"mermaid": "^10.9.1",
|
|
30
32
|
"next-themes": "^0.4.6",
|
|
31
33
|
"react-icons": "^5.5.0",
|
|
32
34
|
"react-tweet": "^3.2.2",
|
|
33
|
-
"shiki": "^
|
|
35
|
+
"shiki": "^3.13.0",
|
|
34
36
|
"@hackersheet/core": "0.1.0-alpha.11",
|
|
35
37
|
"@hackersheet/react-document-content": "0.1.0-alpha.12"
|
|
36
38
|
},
|