@hackersheet/next-document-content-components 0.1.0-alpha.7 → 0.1.0-alpha.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.
|
@@ -31,18 +31,19 @@ __export(gist_exports, {
|
|
|
31
31
|
default: () => Gist
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(gist_exports);
|
|
34
|
+
var import_script = __toESM(require("next/script"));
|
|
34
35
|
var import_react = __toESM(require("react"));
|
|
35
36
|
async function Gist({ gistId, username, filename }) {
|
|
36
|
-
const
|
|
37
|
+
const gistUrl = (() => {
|
|
37
38
|
const base = `https://gist.github.com/${username}/${gistId}.json`;
|
|
38
39
|
if (filename) {
|
|
39
40
|
return base + `?file=${filename}`;
|
|
40
41
|
}
|
|
41
42
|
return base;
|
|
42
43
|
})();
|
|
43
|
-
const result = await fetch(
|
|
44
|
+
const result = await fetch(gistUrl);
|
|
44
45
|
const json = await result.json();
|
|
45
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
46
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
46
47
|
"div",
|
|
47
48
|
{
|
|
48
49
|
className: "gist-block",
|
|
@@ -50,5 +51,5 @@ async function Gist({ gistId, username, filename }) {
|
|
|
50
51
|
__html: json.div
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
|
-
);
|
|
54
|
+
), /* @__PURE__ */ import_react.default.createElement(import_script.default, { stylesheets: [json.stylesheet] }));
|
|
54
55
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import Script from "next/script";
|
|
1
2
|
import React from "react";
|
|
2
3
|
async function Gist({ gistId, username, filename }) {
|
|
3
|
-
const
|
|
4
|
+
const gistUrl = (() => {
|
|
4
5
|
const base = `https://gist.github.com/${username}/${gistId}.json`;
|
|
5
6
|
if (filename) {
|
|
6
7
|
return base + `?file=${filename}`;
|
|
7
8
|
}
|
|
8
9
|
return base;
|
|
9
10
|
})();
|
|
10
|
-
const result = await fetch(
|
|
11
|
+
const result = await fetch(gistUrl);
|
|
11
12
|
const json = await result.json();
|
|
12
|
-
return /* @__PURE__ */ React.createElement(
|
|
13
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
13
14
|
"div",
|
|
14
15
|
{
|
|
15
16
|
className: "gist-block",
|
|
@@ -17,7 +18,7 @@ async function Gist({ gistId, username, filename }) {
|
|
|
17
18
|
__html: json.div
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
|
-
);
|
|
21
|
+
), /* @__PURE__ */ React.createElement(Script, { stylesheets: [json.stylesheet] }));
|
|
21
22
|
}
|
|
22
23
|
export {
|
|
23
24
|
Gist as default
|
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.8",
|
|
4
4
|
"description": "Hacker Sheet document content components for Next.js",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"repository": {
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
"dist"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@hackersheet/core": "alpha",
|
|
28
|
-
"@hackersheet/react-document-content": "alpha",
|
|
29
27
|
"@next/third-parties": "^14.2.5",
|
|
30
28
|
"@shikijs/transformers": "^1.10.3",
|
|
31
29
|
"mermaid": "^10.9.1",
|
|
32
30
|
"next-themes": "^0.3.0",
|
|
33
31
|
"react-icons": "^5.2.1",
|
|
34
32
|
"react-tweet": "^3.2.1",
|
|
35
|
-
"shiki": "^1.10.3"
|
|
33
|
+
"shiki": "^1.10.3",
|
|
34
|
+
"@hackersheet/core": "0.1.0-alpha.4",
|
|
35
|
+
"@hackersheet/react-document-content": "0.1.0-alpha.7"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/react": "^18.0.0",
|