@hackersheet/react-document-content 0.1.0-alpha.13 → 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.
- package/dist/component-resolvers/a-component-resolver.js +40 -1
- package/dist/component-resolvers/a-component-resolver.mjs +10 -1
- package/dist/component-resolvers/gist-component-resolver.js +57 -1
- package/dist/component-resolvers/gist-component-resolver.mjs +27 -1
- package/dist/component-resolvers/heading-component-resolver.js +46 -1
- package/dist/component-resolvers/heading-component-resolver.mjs +16 -1
- package/dist/component-resolvers/img-component-resolver.js +47 -1
- package/dist/component-resolvers/img-component-resolver.mjs +17 -1
- package/dist/component-resolvers/index.js +62 -1
- package/dist/component-resolvers/index.mjs +20 -1
- package/dist/component-resolvers/kifu-to-component-resolver.js +43 -1
- package/dist/component-resolvers/kifu-to-component-resolver.mjs +13 -1
- package/dist/component-resolvers/link-card-component-resolver.js +65 -1
- package/dist/component-resolvers/link-card-component-resolver.mjs +35 -1
- package/dist/component-resolvers/pre-component-resolver.js +73 -1
- package/dist/component-resolvers/pre-component-resolver.mjs +43 -1
- package/dist/component-resolvers/x-post-component-resolver.js +53 -1
- package/dist/component-resolvers/x-post-component-resolver.mjs +23 -1
- package/dist/component-resolvers/youtube-component-resolver.js +61 -1
- package/dist/component-resolvers/youtube-component-resolver.mjs +31 -1
- package/dist/components/code-block/code-block.js +37 -1
- package/dist/components/code-block/code-block.mjs +7 -1
- package/dist/components/gist/gist.js +37 -1
- package/dist/components/gist/gist.mjs +7 -1
- package/dist/components/heading/heading.js +37 -1
- package/dist/components/heading/heading.mjs +7 -1
- package/dist/components/image/image.js +37 -1
- package/dist/components/image/image.mjs +7 -1
- package/dist/components/index.js +62 -1
- package/dist/components/index.mjs +20 -1
- package/dist/components/kifu-to/kifu-to.js +40 -1
- package/dist/components/kifu-to/kifu-to.mjs +10 -1
- package/dist/components/link/link.js +37 -1
- package/dist/components/link/link.mjs +7 -1
- package/dist/components/link-card/link-card.js +37 -1
- package/dist/components/link-card/link-card.mjs +7 -1
- package/dist/components/x-post/x-post.js +37 -1
- package/dist/components/x-post/x-post.mjs +7 -1
- package/dist/components/youtube/youtube.js +37 -1
- package/dist/components/youtube/youtube.mjs +7 -1
- package/dist/document-content.js +109 -1
- package/dist/document-content.mjs +85 -1
- package/dist/index.js +28 -1
- package/dist/index.mjs +4 -1
- package/dist/rehype-plugins/index.js +44 -1
- package/dist/rehype-plugins/index.mjs +8 -1
- package/dist/rehype-plugins/process-internal-links.js +76 -1
- package/dist/rehype-plugins/process-internal-links.mjs +46 -1
- package/dist/rehype-plugins/rehype-clobber-url-decode.js +35 -1
- package/dist/rehype-plugins/rehype-clobber-url-decode.mjs +15 -1
- package/dist/rehype-plugins/rehype-footnote-links.js +37 -1
- package/dist/rehype-plugins/rehype-footnote-links.mjs +17 -1
- package/dist/utils/index.js +38 -1
- package/dist/utils/index.mjs +4 -1
- package/dist/utils/is-url.js +31 -1
- package/dist/utils/is-url.mjs +11 -1
- package/package.json +11 -11
- package/dist/chunk-3T5XKKF2.mjs +0 -1
- package/dist/chunk-3VNFD2PT.mjs +0 -1
- package/dist/chunk-4AECATS3.mjs +0 -1
- package/dist/chunk-73TKYZKK.mjs +0 -0
- package/dist/chunk-BKU6TR65.mjs +0 -1
- package/dist/chunk-DMHUI7N4.mjs +0 -1
- package/dist/chunk-EW2BRESH.mjs +0 -0
- package/dist/chunk-GBGPKOHZ.mjs +0 -1
- package/dist/chunk-HZCV33BD.mjs +0 -1
- package/dist/chunk-IBSO6OTV.mjs +0 -1
- package/dist/chunk-KBFID3JF.mjs +0 -1
- package/dist/chunk-KHY6ACRD.mjs +0 -1
- package/dist/chunk-KWMHEAK7.mjs +0 -1
- package/dist/chunk-LH6PDTY7.mjs +0 -1
- package/dist/chunk-LSMKHHUW.mjs +0 -1
- package/dist/chunk-N7IDTKXU.mjs +0 -1
- package/dist/chunk-O2ZRKYA4.mjs +0 -0
- package/dist/chunk-O73IQILA.mjs +0 -1
- package/dist/chunk-PRANC7GD.mjs +0 -1
- package/dist/chunk-Q5S4HHFX.mjs +0 -1
- package/dist/chunk-SZ4JBPX3.mjs +0 -1
- package/dist/chunk-T5IU4GT3.mjs +0 -1
- package/dist/chunk-V3EETEZ2.mjs +0 -1
- package/dist/chunk-VAJW32XH.mjs +0 -1
- package/dist/chunk-VQ6LMBM5.mjs +0 -1
- package/dist/chunk-WCR2TQ7A.mjs +0 -1
- package/dist/chunk-X6VPHWKN.mjs +0 -0
|
@@ -1 +1,43 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
function PreComponentResolver({
|
|
3
|
+
children,
|
|
4
|
+
node,
|
|
5
|
+
document,
|
|
6
|
+
CodeBlockComponent,
|
|
7
|
+
MermaidComponent,
|
|
8
|
+
KifuComponent,
|
|
9
|
+
DirectoryTreeComponent
|
|
10
|
+
}) {
|
|
11
|
+
const childrenElm = /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
12
|
+
if (!node) {
|
|
13
|
+
return childrenElm;
|
|
14
|
+
}
|
|
15
|
+
const code = node["children"][0];
|
|
16
|
+
if (code["type"] !== "element" || code["tagName"] !== "code") {
|
|
17
|
+
return childrenElm;
|
|
18
|
+
}
|
|
19
|
+
const text = code["children"][0];
|
|
20
|
+
if (text["type"] !== "text") {
|
|
21
|
+
return childrenElm;
|
|
22
|
+
}
|
|
23
|
+
const className = code.properties.className;
|
|
24
|
+
const codeValue = text.value;
|
|
25
|
+
const match = /language-(.+)/.exec(className || "");
|
|
26
|
+
const language = match && match[1] ? match[1] : "";
|
|
27
|
+
const isMermaid = /^mermaid(:.*$|$)/.test(language);
|
|
28
|
+
const isKifu = /^kifu(:.*$|$)/.test(language);
|
|
29
|
+
const isDirectoryTree = /^tree(:.*$|$)/.test(language);
|
|
30
|
+
const props = {
|
|
31
|
+
code: codeValue,
|
|
32
|
+
language,
|
|
33
|
+
document,
|
|
34
|
+
children
|
|
35
|
+
};
|
|
36
|
+
if (isMermaid && MermaidComponent) return /* @__PURE__ */ React.createElement(MermaidComponent, { ...props });
|
|
37
|
+
if (isKifu && KifuComponent) return /* @__PURE__ */ React.createElement(KifuComponent, { ...props });
|
|
38
|
+
if (isDirectoryTree && DirectoryTreeComponent) return /* @__PURE__ */ React.createElement(DirectoryTreeComponent, { ...props });
|
|
39
|
+
return /* @__PURE__ */ React.createElement(CodeBlockComponent, { ...props });
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
PreComponentResolver as default
|
|
43
|
+
};
|
|
@@ -1 +1,53 @@
|
|
|
1
|
-
"use strict";
|
|
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 x_post_component_resolver_exports = {};
|
|
30
|
+
__export(x_post_component_resolver_exports, {
|
|
31
|
+
default: () => XPostComponentResolver
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(x_post_component_resolver_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
function XPostComponentResolver({ children, node, XPostComponent }) {
|
|
36
|
+
const childrenElm = /* @__PURE__ */ import_react.default.createElement("p", null, children);
|
|
37
|
+
if (!node) return childrenElm;
|
|
38
|
+
const href = node["children"][0].properties?.href;
|
|
39
|
+
if (!href || typeof href !== "string") return /* @__PURE__ */ import_react.default.createElement("p", null, children);
|
|
40
|
+
const id = getIdFromTwitterUrl(href);
|
|
41
|
+
if (!id) return /* @__PURE__ */ import_react.default.createElement("p", null, children);
|
|
42
|
+
return /* @__PURE__ */ import_react.default.createElement(XPostComponent, { id, children });
|
|
43
|
+
}
|
|
44
|
+
function getIdFromTwitterUrl(value) {
|
|
45
|
+
try {
|
|
46
|
+
const url = new URL(value);
|
|
47
|
+
if (/(^|\.)(twitter|x).com$/.test(url.host)) {
|
|
48
|
+
return url.pathname.match(/\/status(es)?\/(\d+)/)?.[2];
|
|
49
|
+
}
|
|
50
|
+
} catch {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -1 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
function XPostComponentResolver({ children, node, XPostComponent }) {
|
|
3
|
+
const childrenElm = /* @__PURE__ */ React.createElement("p", null, children);
|
|
4
|
+
if (!node) return childrenElm;
|
|
5
|
+
const href = node["children"][0].properties?.href;
|
|
6
|
+
if (!href || typeof href !== "string") return /* @__PURE__ */ React.createElement("p", null, children);
|
|
7
|
+
const id = getIdFromTwitterUrl(href);
|
|
8
|
+
if (!id) return /* @__PURE__ */ React.createElement("p", null, children);
|
|
9
|
+
return /* @__PURE__ */ React.createElement(XPostComponent, { id, children });
|
|
10
|
+
}
|
|
11
|
+
function getIdFromTwitterUrl(value) {
|
|
12
|
+
try {
|
|
13
|
+
const url = new URL(value);
|
|
14
|
+
if (/(^|\.)(twitter|x).com$/.test(url.host)) {
|
|
15
|
+
return url.pathname.match(/\/status(es)?\/(\d+)/)?.[2];
|
|
16
|
+
}
|
|
17
|
+
} catch {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
XPostComponentResolver as default
|
|
23
|
+
};
|
|
@@ -1 +1,61 @@
|
|
|
1
|
-
"use strict";
|
|
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 youtube_component_resolver_exports = {};
|
|
30
|
+
__export(youtube_component_resolver_exports, {
|
|
31
|
+
default: () => YoutubeComponentResolver
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(youtube_component_resolver_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
function YoutubeComponentResolver({ children, node, YoutubeComponent }) {
|
|
36
|
+
const childrenElm = /* @__PURE__ */ import_react.default.createElement("p", null, children);
|
|
37
|
+
if (!node) return childrenElm;
|
|
38
|
+
const href = node["children"][0].properties?.href;
|
|
39
|
+
if (!href || typeof href !== "string") return childrenElm;
|
|
40
|
+
const id = getIdFromYoutubeUrl(href);
|
|
41
|
+
if (!id) return childrenElm;
|
|
42
|
+
const start = getStartFromYoutubeUrl(href);
|
|
43
|
+
return /* @__PURE__ */ import_react.default.createElement(YoutubeComponent, { videoId: id, params: { start }, children });
|
|
44
|
+
}
|
|
45
|
+
function getIdFromYoutubeUrl(value) {
|
|
46
|
+
const matched = /^https?:\/\/(www\.)?youtube\.com\/watch\?(.*&)?v=(?<videoId>[^&]+)/.exec(value) ?? /^https?:\/\/youtu\.be\/(?<videoId>[^?]+)/.exec(value) ?? /^https?:\/\/(www\.)?youtube\.com\/embed\/(?<videoId>[^?]+)/.exec(value);
|
|
47
|
+
if (matched?.groups?.videoId) {
|
|
48
|
+
return matched.groups.videoId;
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
function getStartFromYoutubeUrl(value) {
|
|
53
|
+
try {
|
|
54
|
+
const url = new URL(value);
|
|
55
|
+
const t = url.searchParams.get("t");
|
|
56
|
+
if (!t) return;
|
|
57
|
+
return Number(t.endsWith("s") ? t.slice(0, -1) : t);
|
|
58
|
+
} catch {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -1 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
function YoutubeComponentResolver({ children, node, YoutubeComponent }) {
|
|
3
|
+
const childrenElm = /* @__PURE__ */ React.createElement("p", null, children);
|
|
4
|
+
if (!node) return childrenElm;
|
|
5
|
+
const href = node["children"][0].properties?.href;
|
|
6
|
+
if (!href || typeof href !== "string") return childrenElm;
|
|
7
|
+
const id = getIdFromYoutubeUrl(href);
|
|
8
|
+
if (!id) return childrenElm;
|
|
9
|
+
const start = getStartFromYoutubeUrl(href);
|
|
10
|
+
return /* @__PURE__ */ React.createElement(YoutubeComponent, { videoId: id, params: { start }, children });
|
|
11
|
+
}
|
|
12
|
+
function getIdFromYoutubeUrl(value) {
|
|
13
|
+
const matched = /^https?:\/\/(www\.)?youtube\.com\/watch\?(.*&)?v=(?<videoId>[^&]+)/.exec(value) ?? /^https?:\/\/youtu\.be\/(?<videoId>[^?]+)/.exec(value) ?? /^https?:\/\/(www\.)?youtube\.com\/embed\/(?<videoId>[^?]+)/.exec(value);
|
|
14
|
+
if (matched?.groups?.videoId) {
|
|
15
|
+
return matched.groups.videoId;
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
function getStartFromYoutubeUrl(value) {
|
|
20
|
+
try {
|
|
21
|
+
const url = new URL(value);
|
|
22
|
+
const t = url.searchParams.get("t");
|
|
23
|
+
if (!t) return;
|
|
24
|
+
return Number(t.endsWith("s") ? t.slice(0, -1) : t);
|
|
25
|
+
} catch {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
YoutubeComponentResolver as default
|
|
31
|
+
};
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
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 code_block_exports = {};
|
|
30
|
+
__export(code_block_exports, {
|
|
31
|
+
default: () => CodeBlock
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(code_block_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
function CodeBlock(props) {
|
|
36
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("pre", null, props.code));
|
|
37
|
+
}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
function CodeBlock(props) {
|
|
3
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("pre", null, props.code));
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
CodeBlock as default
|
|
7
|
+
};
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
+
function Gist({ children }) {
|
|
36
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, children);
|
|
37
|
+
}
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
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_react = __toESM(require("react"));
|
|
35
|
+
function Heading({ HeadingTag, id, children }) {
|
|
36
|
+
return /* @__PURE__ */ import_react.default.createElement(HeadingTag, { id }, children);
|
|
37
|
+
}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
function Heading({ HeadingTag, id, children }) {
|
|
3
|
+
return /* @__PURE__ */ React.createElement(HeadingTag, { id }, children);
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
Heading as default
|
|
7
|
+
};
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
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 image_exports = {};
|
|
30
|
+
__export(image_exports, {
|
|
31
|
+
default: () => Image
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(image_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
function Image({ src, width, height, alt }) {
|
|
36
|
+
return /* @__PURE__ */ import_react.default.createElement("img", { src, width, height, alt });
|
|
37
|
+
}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
function Image({ src, width, height, alt }) {
|
|
3
|
+
return /* @__PURE__ */ React.createElement("img", { src, width, height, alt });
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
Image as default
|
|
7
|
+
};
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1,62 @@
|
|
|
1
|
-
"use strict";
|
|
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 components_exports = {};
|
|
30
|
+
__export(components_exports, {
|
|
31
|
+
CodeBlock: () => import_code_block.default,
|
|
32
|
+
Gist: () => import_gist.default,
|
|
33
|
+
Heading: () => import_heading.default,
|
|
34
|
+
Image: () => import_image.default,
|
|
35
|
+
KifuTo: () => import_kifu_to.default,
|
|
36
|
+
Link: () => import_link.default,
|
|
37
|
+
LinkCard: () => import_link_card.default,
|
|
38
|
+
XPost: () => import_x_post.default,
|
|
39
|
+
Youtube: () => import_youtube.default
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(components_exports);
|
|
42
|
+
var import_code_block = __toESM(require("./code-block/code-block"));
|
|
43
|
+
var import_gist = __toESM(require("./gist/gist"));
|
|
44
|
+
var import_heading = __toESM(require("./heading/heading"));
|
|
45
|
+
var import_image = __toESM(require("./image/image"));
|
|
46
|
+
var import_kifu_to = __toESM(require("./kifu-to/kifu-to"));
|
|
47
|
+
var import_link = __toESM(require("./link/link"));
|
|
48
|
+
var import_link_card = __toESM(require("./link-card/link-card"));
|
|
49
|
+
var import_x_post = __toESM(require("./x-post/x-post"));
|
|
50
|
+
var import_youtube = __toESM(require("./youtube/youtube"));
|
|
51
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
+
0 && (module.exports = {
|
|
53
|
+
CodeBlock,
|
|
54
|
+
Gist,
|
|
55
|
+
Heading,
|
|
56
|
+
Image,
|
|
57
|
+
KifuTo,
|
|
58
|
+
Link,
|
|
59
|
+
LinkCard,
|
|
60
|
+
XPost,
|
|
61
|
+
Youtube
|
|
62
|
+
});
|
|
@@ -1 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import CodeBlock from "./code-block/code-block";
|
|
2
|
+
import Gist from "./gist/gist";
|
|
3
|
+
import Heading from "./heading/heading";
|
|
4
|
+
import Image from "./image/image";
|
|
5
|
+
import KifuTo from "./kifu-to/kifu-to";
|
|
6
|
+
import Link from "./link/link";
|
|
7
|
+
import LinkCard from "./link-card/link-card";
|
|
8
|
+
import XPost from "./x-post/x-post";
|
|
9
|
+
import Youtube from "./youtube/youtube";
|
|
10
|
+
export {
|
|
11
|
+
CodeBlock,
|
|
12
|
+
Gist,
|
|
13
|
+
Heading,
|
|
14
|
+
Image,
|
|
15
|
+
KifuTo,
|
|
16
|
+
Link,
|
|
17
|
+
LinkCard,
|
|
18
|
+
XPost,
|
|
19
|
+
Youtube
|
|
20
|
+
};
|
|
@@ -1 +1,40 @@
|
|
|
1
|
-
"use strict";
|
|
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 kifu_to_exports = {};
|
|
30
|
+
__export(kifu_to_exports, {
|
|
31
|
+
default: () => KifuTo
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(kifu_to_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
function KifuTo({ id, ply, label: defaultLabel }) {
|
|
36
|
+
const fullId = `user-content-${id}`;
|
|
37
|
+
const href = `?ply=${ply}#${fullId}`;
|
|
38
|
+
const label = defaultLabel ?? `${ply}\u624B\u76EE`;
|
|
39
|
+
return /* @__PURE__ */ import_react.default.createElement("a", { href }, label);
|
|
40
|
+
}
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
function KifuTo({ id, ply, label: defaultLabel }) {
|
|
3
|
+
const fullId = `user-content-${id}`;
|
|
4
|
+
const href = `?ply=${ply}#${fullId}`;
|
|
5
|
+
const label = defaultLabel ?? `${ply}\u624B\u76EE`;
|
|
6
|
+
return /* @__PURE__ */ React.createElement("a", { href }, label);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
KifuTo as default
|
|
10
|
+
};
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
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 link_exports = {};
|
|
30
|
+
__export(link_exports, {
|
|
31
|
+
default: () => Link
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(link_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
function Link({ href, id, children }) {
|
|
36
|
+
return /* @__PURE__ */ import_react.default.createElement("a", { href, id }, children);
|
|
37
|
+
}
|