@hackersheet/next-document-content-components 0.1.0-alpha.4 → 0.1.0-alpha.6
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/heading/heading.d.ts +6 -0
- package/dist/cjs/components/heading/heading.js +39 -0
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/components/index.js +3 -0
- package/dist/cjs/components/mermaid/mermaid.js +4 -3
- package/dist/cjs/components/youtube/youtube.js +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/esm/components/heading/heading.d.mts +6 -0
- package/dist/esm/components/heading/heading.mjs +9 -0
- package/dist/esm/components/index.d.mts +1 -0
- package/dist/esm/components/index.mjs +2 -0
- package/dist/esm/components/mermaid/mermaid.mjs +4 -3
- package/dist/esm/components/youtube/youtube.mjs +1 -1
- package/dist/esm/index.d.mts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
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 heading_exports = {};
|
|
30
|
+
__export(heading_exports, {
|
|
31
|
+
default: () => Heading
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(heading_exports);
|
|
34
|
+
var import_link = __toESM(require("next/link"));
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_md = require("react-icons/md");
|
|
37
|
+
function Heading({ HeadingTag, id, children }) {
|
|
38
|
+
return /* @__PURE__ */ import_react.default.createElement(HeadingTag, { id, className: "heading" }, /* @__PURE__ */ import_react.default.createElement(import_link.default, { href: `#${id}` }, /* @__PURE__ */ import_react.default.createElement("span", { className: "heading-label" }, children), /* @__PURE__ */ import_react.default.createElement("span", { className: "heading-link-icon" }, /* @__PURE__ */ import_react.default.createElement(import_md.MdLink, null))));
|
|
39
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as CodeBlock } from './code-block/code-block.js';
|
|
2
|
+
export { default as Heading } from './heading/heading.js';
|
|
2
3
|
export { default as Image } from './image/image.js';
|
|
3
4
|
export { default as Link } from './link/link.js';
|
|
4
5
|
export { default as LinkCard } from './link-card/link-card.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
|
+
Heading: () => import_heading.default,
|
|
32
33
|
Image: () => import_image.default,
|
|
33
34
|
Link: () => import_link.default,
|
|
34
35
|
LinkCard: () => import_link_card.default,
|
|
@@ -38,6 +39,7 @@ __export(components_exports, {
|
|
|
38
39
|
});
|
|
39
40
|
module.exports = __toCommonJS(components_exports);
|
|
40
41
|
var import_code_block = __toESM(require("./code-block/code-block"));
|
|
42
|
+
var import_heading = __toESM(require("./heading/heading"));
|
|
41
43
|
var import_image = __toESM(require("./image/image"));
|
|
42
44
|
var import_link = __toESM(require("./link/link"));
|
|
43
45
|
var import_link_card = __toESM(require("./link-card/link-card"));
|
|
@@ -47,6 +49,7 @@ var import_youtube = __toESM(require("./youtube/youtube"));
|
|
|
47
49
|
// Annotate the CommonJS export names for ESM import in node:
|
|
48
50
|
0 && (module.exports = {
|
|
49
51
|
CodeBlock,
|
|
52
|
+
Heading,
|
|
50
53
|
Image,
|
|
51
54
|
Link,
|
|
52
55
|
LinkCard,
|
|
@@ -65,7 +65,8 @@ function Mermaid({ code }) {
|
|
|
65
65
|
};
|
|
66
66
|
renderMermaid();
|
|
67
67
|
}, [mounted, code, id, theme, systemTheme, setSvg, setMounted]);
|
|
68
|
-
if (!mounted)
|
|
69
|
-
return /* @__PURE__ */ import_react.default.createElement("div",
|
|
70
|
-
|
|
68
|
+
if (!mounted) {
|
|
69
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "mermaid-block mermaid-loading" }, /* @__PURE__ */ import_react.default.createElement("div", null, "Loading..."));
|
|
70
|
+
}
|
|
71
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "mermaid-block", dangerouslySetInnerHTML: { __html: svg }, ref });
|
|
71
72
|
}
|
|
@@ -35,5 +35,5 @@ var import_google = require("@next/third-parties/google");
|
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
async function Youtube({ videoId, params, playLabel, ...props }) {
|
|
37
37
|
const paramsString = params ? Object.entries(params).filter(([, value]) => value !== void 0).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&") : void 0;
|
|
38
|
-
return /* @__PURE__ */ import_react.default.createElement(import_google.YouTubeEmbed, { ...props, videoid: videoId, params: paramsString, playlabel: playLabel });
|
|
38
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "youtube-block" }, /* @__PURE__ */ import_react.default.createElement(import_google.YouTubeEmbed, { ...props, videoid: videoId, params: paramsString, playlabel: playLabel }));
|
|
39
39
|
}
|
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 Heading } from './components/heading/heading.js';
|
|
2
3
|
export { default as Image } from './components/image/image.js';
|
|
3
4
|
export { default as Link } from './components/link/link.js';
|
|
4
5
|
export { default as LinkCard } from './components/link-card/link-card.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { MdLink } from "react-icons/md";
|
|
4
|
+
function Heading({ HeadingTag, id, children }) {
|
|
5
|
+
return /* @__PURE__ */ React.createElement(HeadingTag, { id, className: "heading" }, /* @__PURE__ */ React.createElement(Link, { href: `#${id}` }, /* @__PURE__ */ React.createElement("span", { className: "heading-label" }, children), /* @__PURE__ */ React.createElement("span", { className: "heading-link-icon" }, /* @__PURE__ */ React.createElement(MdLink, null))));
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
Heading as default
|
|
9
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as CodeBlock } from './code-block/code-block.mjs';
|
|
2
|
+
export { default as Heading } from './heading/heading.mjs';
|
|
2
3
|
export { default as Image } from './image/image.mjs';
|
|
3
4
|
export { default as Link } from './link/link.mjs';
|
|
4
5
|
export { default as LinkCard } from './link-card/link-card.mjs';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import CodeBlock from "./code-block/code-block";
|
|
2
|
+
import Heading from "./heading/heading";
|
|
2
3
|
import Image from "./image/image";
|
|
3
4
|
import Link from "./link/link";
|
|
4
5
|
import LinkCard from "./link-card/link-card";
|
|
@@ -7,6 +8,7 @@ import XPost from "./x-post/x-post";
|
|
|
7
8
|
import Youtube from "./youtube/youtube";
|
|
8
9
|
export {
|
|
9
10
|
CodeBlock,
|
|
11
|
+
Heading,
|
|
10
12
|
Image,
|
|
11
13
|
Link,
|
|
12
14
|
LinkCard,
|
|
@@ -32,9 +32,10 @@ function Mermaid({ code }) {
|
|
|
32
32
|
};
|
|
33
33
|
renderMermaid();
|
|
34
34
|
}, [mounted, code, id, theme, systemTheme, setSvg, setMounted]);
|
|
35
|
-
if (!mounted)
|
|
36
|
-
return /* @__PURE__ */ React.createElement("div",
|
|
37
|
-
|
|
35
|
+
if (!mounted) {
|
|
36
|
+
return /* @__PURE__ */ React.createElement("div", { className: "mermaid-block mermaid-loading" }, /* @__PURE__ */ React.createElement("div", null, "Loading..."));
|
|
37
|
+
}
|
|
38
|
+
return /* @__PURE__ */ React.createElement("div", { className: "mermaid-block", dangerouslySetInnerHTML: { __html: svg }, ref });
|
|
38
39
|
}
|
|
39
40
|
export {
|
|
40
41
|
Mermaid as default
|
|
@@ -2,7 +2,7 @@ import { YouTubeEmbed } from "@next/third-parties/google";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
async function Youtube({ videoId, params, playLabel, ...props }) {
|
|
4
4
|
const paramsString = params ? Object.entries(params).filter(([, value]) => value !== void 0).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&") : void 0;
|
|
5
|
-
return /* @__PURE__ */ React.createElement(YouTubeEmbed, { ...props, videoid: videoId, params: paramsString, playlabel: playLabel });
|
|
5
|
+
return /* @__PURE__ */ React.createElement("div", { className: "youtube-block" }, /* @__PURE__ */ React.createElement(YouTubeEmbed, { ...props, videoid: videoId, params: paramsString, playlabel: playLabel }));
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
8
|
Youtube as default
|
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 Heading } from './components/heading/heading.mjs';
|
|
2
3
|
export { default as Image } from './components/image/image.mjs';
|
|
3
4
|
export { default as Link } from './components/link/link.mjs';
|
|
4
5
|
export { default as LinkCard } from './components/link-card/link-card.mjs';
|