@hackersheet/next-document-content-components 0.1.0-alpha.6 → 0.1.0-alpha.7
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/cjs/components/gist/gist.d.ts +6 -0
- package/dist/cjs/components/gist/gist.js +54 -0
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/components/index.js +3 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/esm/components/gist/gist.d.mts +6 -0
- package/dist/esm/components/gist/gist.mjs +24 -0
- package/dist/esm/components/index.d.mts +1 -0
- package/dist/esm/components/index.mjs +2 -0
- package/dist/esm/index.d.mts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
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
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var gist_exports = {};
|
|
30
|
+
__export(gist_exports, {
|
|
31
|
+
default: () => Gist
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(gist_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
async function Gist({ gistId, username, filename }) {
|
|
36
|
+
const src = (() => {
|
|
37
|
+
const base = `https://gist.github.com/${username}/${gistId}.json`;
|
|
38
|
+
if (filename) {
|
|
39
|
+
return base + `?file=${filename}`;
|
|
40
|
+
}
|
|
41
|
+
return base;
|
|
42
|
+
})();
|
|
43
|
+
const result = await fetch(src);
|
|
44
|
+
const json = await result.json();
|
|
45
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
className: "gist-block",
|
|
49
|
+
dangerouslySetInnerHTML: {
|
|
50
|
+
__html: json.div
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as CodeBlock } from './code-block/code-block.js';
|
|
2
|
+
export { default as Gist } from './gist/gist.js';
|
|
2
3
|
export { default as Heading } from './heading/heading.js';
|
|
3
4
|
export { default as Image } from './image/image.js';
|
|
4
5
|
export { default as Link } from './link/link.js';
|
|
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var components_exports = {};
|
|
30
30
|
__export(components_exports, {
|
|
31
31
|
CodeBlock: () => import_code_block.default,
|
|
32
|
+
Gist: () => import_gist.default,
|
|
32
33
|
Heading: () => import_heading.default,
|
|
33
34
|
Image: () => import_image.default,
|
|
34
35
|
Link: () => import_link.default,
|
|
@@ -39,6 +40,7 @@ __export(components_exports, {
|
|
|
39
40
|
});
|
|
40
41
|
module.exports = __toCommonJS(components_exports);
|
|
41
42
|
var import_code_block = __toESM(require("./code-block/code-block"));
|
|
43
|
+
var import_gist = __toESM(require("./gist/gist"));
|
|
42
44
|
var import_heading = __toESM(require("./heading/heading"));
|
|
43
45
|
var import_image = __toESM(require("./image/image"));
|
|
44
46
|
var import_link = __toESM(require("./link/link"));
|
|
@@ -49,6 +51,7 @@ var import_youtube = __toESM(require("./youtube/youtube"));
|
|
|
49
51
|
// Annotate the CommonJS export names for ESM import in node:
|
|
50
52
|
0 && (module.exports = {
|
|
51
53
|
CodeBlock,
|
|
54
|
+
Gist,
|
|
52
55
|
Heading,
|
|
53
56
|
Image,
|
|
54
57
|
Link,
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as CodeBlock } from './components/code-block/code-block.js';
|
|
2
|
+
export { default as Gist } from './components/gist/gist.js';
|
|
2
3
|
export { default as Heading } from './components/heading/heading.js';
|
|
3
4
|
export { default as Image } from './components/image/image.js';
|
|
4
5
|
export { default as Link } from './components/link/link.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
async function Gist({ gistId, username, filename }) {
|
|
3
|
+
const src = (() => {
|
|
4
|
+
const base = `https://gist.github.com/${username}/${gistId}.json`;
|
|
5
|
+
if (filename) {
|
|
6
|
+
return base + `?file=${filename}`;
|
|
7
|
+
}
|
|
8
|
+
return base;
|
|
9
|
+
})();
|
|
10
|
+
const result = await fetch(src);
|
|
11
|
+
const json = await result.json();
|
|
12
|
+
return /* @__PURE__ */ React.createElement(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
className: "gist-block",
|
|
16
|
+
dangerouslySetInnerHTML: {
|
|
17
|
+
__html: json.div
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
Gist as default
|
|
24
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as CodeBlock } from './code-block/code-block.mjs';
|
|
2
|
+
export { default as Gist } from './gist/gist.mjs';
|
|
2
3
|
export { default as Heading } from './heading/heading.mjs';
|
|
3
4
|
export { default as Image } from './image/image.mjs';
|
|
4
5
|
export { default as Link } from './link/link.mjs';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import CodeBlock from "./code-block/code-block";
|
|
2
|
+
import Gist from "./gist/gist";
|
|
2
3
|
import Heading from "./heading/heading";
|
|
3
4
|
import Image from "./image/image";
|
|
4
5
|
import Link from "./link/link";
|
|
@@ -8,6 +9,7 @@ import XPost from "./x-post/x-post";
|
|
|
8
9
|
import Youtube from "./youtube/youtube";
|
|
9
10
|
export {
|
|
10
11
|
CodeBlock,
|
|
12
|
+
Gist,
|
|
11
13
|
Heading,
|
|
12
14
|
Image,
|
|
13
15
|
Link,
|
package/dist/esm/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as CodeBlock } from './components/code-block/code-block.mjs';
|
|
2
|
+
export { default as Gist } from './components/gist/gist.mjs';
|
|
2
3
|
export { default as Heading } from './components/heading/heading.mjs';
|
|
3
4
|
export { default as Image } from './components/image/image.mjs';
|
|
4
5
|
export { default as Link } from './components/link/link.mjs';
|