docusaurus-plugin-gitbook 0.1.0
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/README.md +210 -0
- package/lib/index.d.ts +51 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +39 -0
- package/lib/index.js.map +1 -0
- package/lib/parser/index.d.ts +6 -0
- package/lib/parser/index.d.ts.map +1 -0
- package/lib/parser/index.js +6 -0
- package/lib/parser/index.js.map +1 -0
- package/lib/parser/parser.d.ts +43 -0
- package/lib/parser/parser.d.ts.map +1 -0
- package/lib/parser/parser.js +192 -0
- package/lib/parser/parser.js.map +1 -0
- package/lib/parser/tokenizer.d.ts +37 -0
- package/lib/parser/tokenizer.d.ts.map +1 -0
- package/lib/parser/tokenizer.js +172 -0
- package/lib/parser/tokenizer.js.map +1 -0
- package/lib/rehype/index.d.ts +7 -0
- package/lib/rehype/index.d.ts.map +1 -0
- package/lib/rehype/index.js +6 -0
- package/lib/rehype/index.js.map +1 -0
- package/lib/rehype/plugin.d.ts +18 -0
- package/lib/rehype/plugin.d.ts.map +1 -0
- package/lib/rehype/plugin.js +31 -0
- package/lib/rehype/plugin.js.map +1 -0
- package/lib/rehype/transformers/all.d.ts +8 -0
- package/lib/rehype/transformers/all.d.ts.map +1 -0
- package/lib/rehype/transformers/all.js +10 -0
- package/lib/rehype/transformers/all.js.map +1 -0
- package/lib/rehype/transformers/button.d.ts +17 -0
- package/lib/rehype/transformers/button.d.ts.map +1 -0
- package/lib/rehype/transformers/button.js +46 -0
- package/lib/rehype/transformers/button.js.map +1 -0
- package/lib/rehype/transformers/cards.d.ts +17 -0
- package/lib/rehype/transformers/cards.d.ts.map +1 -0
- package/lib/rehype/transformers/cards.js +111 -0
- package/lib/rehype/transformers/cards.js.map +1 -0
- package/lib/rehype/transformers/expression.d.ts +17 -0
- package/lib/rehype/transformers/expression.d.ts.map +1 -0
- package/lib/rehype/transformers/expression.js +50 -0
- package/lib/rehype/transformers/expression.js.map +1 -0
- package/lib/rehype/transformers/icon.d.ts +18 -0
- package/lib/rehype/transformers/icon.d.ts.map +1 -0
- package/lib/rehype/transformers/icon.js +48 -0
- package/lib/rehype/transformers/icon.js.map +1 -0
- package/lib/rehype/transformers/index.d.ts +26 -0
- package/lib/rehype/transformers/index.d.ts.map +1 -0
- package/lib/rehype/transformers/index.js +31 -0
- package/lib/rehype/transformers/index.js.map +1 -0
- package/lib/remark/index.d.ts +8 -0
- package/lib/remark/index.d.ts.map +1 -0
- package/lib/remark/index.js +7 -0
- package/lib/remark/index.js.map +1 -0
- package/lib/remark/plugin.d.ts +22 -0
- package/lib/remark/plugin.d.ts.map +1 -0
- package/lib/remark/plugin.js +231 -0
- package/lib/remark/plugin.js.map +1 -0
- package/lib/remark/transformers/all.d.ts +14 -0
- package/lib/remark/transformers/all.d.ts.map +1 -0
- package/lib/remark/transformers/all.js +16 -0
- package/lib/remark/transformers/all.js.map +1 -0
- package/lib/remark/transformers/code.d.ts +13 -0
- package/lib/remark/transformers/code.d.ts.map +1 -0
- package/lib/remark/transformers/code.js +35 -0
- package/lib/remark/transformers/code.js.map +1 -0
- package/lib/remark/transformers/columns.d.ts +17 -0
- package/lib/remark/transformers/columns.d.ts.map +1 -0
- package/lib/remark/transformers/columns.js +41 -0
- package/lib/remark/transformers/columns.js.map +1 -0
- package/lib/remark/transformers/embed.d.ts +12 -0
- package/lib/remark/transformers/embed.d.ts.map +1 -0
- package/lib/remark/transformers/embed.js +23 -0
- package/lib/remark/transformers/embed.js.map +1 -0
- package/lib/remark/transformers/file.d.ts +13 -0
- package/lib/remark/transformers/file.d.ts.map +1 -0
- package/lib/remark/transformers/file.js +26 -0
- package/lib/remark/transformers/file.js.map +1 -0
- package/lib/remark/transformers/hint.d.ts +19 -0
- package/lib/remark/transformers/hint.d.ts.map +1 -0
- package/lib/remark/transformers/hint.js +37 -0
- package/lib/remark/transformers/hint.js.map +1 -0
- package/lib/remark/transformers/include.d.ts +16 -0
- package/lib/remark/transformers/include.d.ts.map +1 -0
- package/lib/remark/transformers/include.js +28 -0
- package/lib/remark/transformers/include.js.map +1 -0
- package/lib/remark/transformers/index.d.ts +27 -0
- package/lib/remark/transformers/index.d.ts.map +1 -0
- package/lib/remark/transformers/index.js +32 -0
- package/lib/remark/transformers/index.js.map +1 -0
- package/lib/remark/transformers/openapi.d.ts +17 -0
- package/lib/remark/transformers/openapi.d.ts.map +1 -0
- package/lib/remark/transformers/openapi.js +30 -0
- package/lib/remark/transformers/openapi.js.map +1 -0
- package/lib/remark/transformers/stepper.d.ts +17 -0
- package/lib/remark/transformers/stepper.d.ts.map +1 -0
- package/lib/remark/transformers/stepper.js +44 -0
- package/lib/remark/transformers/stepper.js.map +1 -0
- package/lib/remark/transformers/tabs.d.ts +18 -0
- package/lib/remark/transformers/tabs.d.ts.map +1 -0
- package/lib/remark/transformers/tabs.js +45 -0
- package/lib/remark/transformers/tabs.js.map +1 -0
- package/lib/remark/transformers/updates.d.ts +17 -0
- package/lib/remark/transformers/updates.d.ts.map +1 -0
- package/lib/remark/transformers/updates.js +44 -0
- package/lib/remark/transformers/updates.js.map +1 -0
- package/lib/remark/utils.d.ts +39 -0
- package/lib/remark/utils.d.ts.map +1 -0
- package/lib/remark/utils.js +139 -0
- package/lib/remark/utils.js.map +1 -0
- package/lib/theme/FAIcon/index.d.ts +10 -0
- package/lib/theme/FAIcon/index.d.ts.map +1 -0
- package/lib/theme/FAIcon/index.js +5 -0
- package/lib/theme/FAIcon/index.js.map +1 -0
- package/lib/theme/GitBookButton/index.d.ts +9 -0
- package/lib/theme/GitBookButton/index.d.ts.map +1 -0
- package/lib/theme/GitBookButton/index.js +6 -0
- package/lib/theme/GitBookButton/index.js.map +1 -0
- package/lib/theme/GitBookButton/styles.module.css +66 -0
- package/lib/theme/GitBookCard/index.d.ts +9 -0
- package/lib/theme/GitBookCard/index.d.ts.map +1 -0
- package/lib/theme/GitBookCard/index.js +6 -0
- package/lib/theme/GitBookCard/index.js.map +1 -0
- package/lib/theme/GitBookCard/styles.module.css +51 -0
- package/lib/theme/GitBookCards/index.d.ts +9 -0
- package/lib/theme/GitBookCards/index.d.ts.map +1 -0
- package/lib/theme/GitBookCards/index.js +6 -0
- package/lib/theme/GitBookCards/index.js.map +1 -0
- package/lib/theme/GitBookCards/styles.module.css +16 -0
- package/lib/theme/GitBookCodeBlock/index.d.ts +9 -0
- package/lib/theme/GitBookCodeBlock/index.d.ts.map +1 -0
- package/lib/theme/GitBookCodeBlock/index.js +6 -0
- package/lib/theme/GitBookCodeBlock/index.js.map +1 -0
- package/lib/theme/GitBookCodeBlock/styles.module.css +59 -0
- package/lib/theme/GitBookColumn/index.d.ts +9 -0
- package/lib/theme/GitBookColumn/index.d.ts.map +1 -0
- package/lib/theme/GitBookColumn/index.js +6 -0
- package/lib/theme/GitBookColumn/index.js.map +1 -0
- package/lib/theme/GitBookColumn/styles.module.css +16 -0
- package/lib/theme/GitBookColumns/index.d.ts +9 -0
- package/lib/theme/GitBookColumns/index.d.ts.map +1 -0
- package/lib/theme/GitBookColumns/index.js +6 -0
- package/lib/theme/GitBookColumns/index.js.map +1 -0
- package/lib/theme/GitBookColumns/styles.module.css +17 -0
- package/lib/theme/GitBookEmbed/index.d.ts +9 -0
- package/lib/theme/GitBookEmbed/index.d.ts.map +1 -0
- package/lib/theme/GitBookEmbed/index.js +71 -0
- package/lib/theme/GitBookEmbed/index.js.map +1 -0
- package/lib/theme/GitBookEmbed/styles.module.css +37 -0
- package/lib/theme/GitBookExpression/index.d.ts +13 -0
- package/lib/theme/GitBookExpression/index.d.ts.map +1 -0
- package/lib/theme/GitBookExpression/index.js +12 -0
- package/lib/theme/GitBookExpression/index.js.map +1 -0
- package/lib/theme/GitBookExpression/styles.module.css +16 -0
- package/lib/theme/GitBookFile/index.d.ts +9 -0
- package/lib/theme/GitBookFile/index.d.ts.map +1 -0
- package/lib/theme/GitBookFile/index.js +42 -0
- package/lib/theme/GitBookFile/index.js.map +1 -0
- package/lib/theme/GitBookFile/styles.module.css +61 -0
- package/lib/theme/GitBookInclude/index.d.ts +19 -0
- package/lib/theme/GitBookInclude/index.d.ts.map +1 -0
- package/lib/theme/GitBookInclude/index.js +8 -0
- package/lib/theme/GitBookInclude/index.js.map +1 -0
- package/lib/theme/GitBookInclude/styles.module.css +77 -0
- package/lib/theme/GitBookOpenAPI/index.d.ts +14 -0
- package/lib/theme/GitBookOpenAPI/index.d.ts.map +1 -0
- package/lib/theme/GitBookOpenAPI/index.js +73 -0
- package/lib/theme/GitBookOpenAPI/index.js.map +1 -0
- package/lib/theme/GitBookOpenAPI/styles.module.css +214 -0
- package/lib/theme/GitBookStep/index.d.ts +13 -0
- package/lib/theme/GitBookStep/index.d.ts.map +1 -0
- package/lib/theme/GitBookStep/index.js +6 -0
- package/lib/theme/GitBookStep/index.js.map +1 -0
- package/lib/theme/GitBookStep/styles.module.css +62 -0
- package/lib/theme/GitBookStepper/index.d.ts +9 -0
- package/lib/theme/GitBookStepper/index.d.ts.map +1 -0
- package/lib/theme/GitBookStepper/index.js +6 -0
- package/lib/theme/GitBookStepper/index.js.map +1 -0
- package/lib/theme/GitBookStepper/styles.module.css +7 -0
- package/lib/theme/GitBookTab/index.d.ts +12 -0
- package/lib/theme/GitBookTab/index.d.ts.map +1 -0
- package/lib/theme/GitBookTab/index.js +9 -0
- package/lib/theme/GitBookTab/index.js.map +1 -0
- package/lib/theme/GitBookTab/styles.module.css +15 -0
- package/lib/theme/GitBookTabs/index.d.ts +9 -0
- package/lib/theme/GitBookTabs/index.d.ts.map +1 -0
- package/lib/theme/GitBookTabs/index.js +32 -0
- package/lib/theme/GitBookTabs/index.js.map +1 -0
- package/lib/theme/GitBookTabs/styles.module.css +57 -0
- package/lib/theme/GitBookUpdate/index.d.ts +9 -0
- package/lib/theme/GitBookUpdate/index.d.ts.map +1 -0
- package/lib/theme/GitBookUpdate/index.js +21 -0
- package/lib/theme/GitBookUpdate/index.js.map +1 -0
- package/lib/theme/GitBookUpdate/styles.module.css +68 -0
- package/lib/theme/GitBookUpdates/index.d.ts +9 -0
- package/lib/theme/GitBookUpdates/index.d.ts.map +1 -0
- package/lib/theme/GitBookUpdates/index.js +6 -0
- package/lib/theme/GitBookUpdates/index.js.map +1 -0
- package/lib/theme/GitBookUpdates/styles.module.css +15 -0
- package/lib/theme/gitbook.css +205 -0
- package/lib/theme-types.d.ts +129 -0
- package/lib/theme-types.d.ts.map +1 -0
- package/lib/theme-types.js +5 -0
- package/lib/theme-types.js.map +1 -0
- package/package.json +69 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MDAST manipulation utilities
|
|
3
|
+
*/
|
|
4
|
+
import { trackComponent } from './plugin.js';
|
|
5
|
+
/**
|
|
6
|
+
* Create an MDX JSX element node
|
|
7
|
+
*/
|
|
8
|
+
export function createMdxJsxElement(name, attributes, children = []) {
|
|
9
|
+
// Track this component for import generation
|
|
10
|
+
trackComponent(name);
|
|
11
|
+
const mdxAttributes = Object.entries(attributes).map(([key, value]) => ({
|
|
12
|
+
type: 'mdxJsxAttribute',
|
|
13
|
+
name: key,
|
|
14
|
+
value,
|
|
15
|
+
}));
|
|
16
|
+
return {
|
|
17
|
+
type: 'mdxJsxFlowElement',
|
|
18
|
+
name,
|
|
19
|
+
attributes: mdxAttributes,
|
|
20
|
+
children: children,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Create a text node
|
|
25
|
+
*/
|
|
26
|
+
export function createTextNode(value) {
|
|
27
|
+
return {
|
|
28
|
+
type: 'text',
|
|
29
|
+
value,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create a paragraph node
|
|
34
|
+
*/
|
|
35
|
+
export function createParagraph(children) {
|
|
36
|
+
return {
|
|
37
|
+
type: 'paragraph',
|
|
38
|
+
children: children,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Check if a node is a paragraph with text content
|
|
43
|
+
*/
|
|
44
|
+
export function isParagraphWithText(node) {
|
|
45
|
+
return (node.type === 'paragraph' &&
|
|
46
|
+
node.children.length === 1 &&
|
|
47
|
+
node.children[0].type === 'text');
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get plain text content from a node (inline elements only).
|
|
51
|
+
* Used for checking whether a paragraph contains GitBook syntax.
|
|
52
|
+
*/
|
|
53
|
+
export function getTextContent(node) {
|
|
54
|
+
if (node.type === 'text') {
|
|
55
|
+
return node.value;
|
|
56
|
+
}
|
|
57
|
+
if ('children' in node && Array.isArray(node.children)) {
|
|
58
|
+
return node.children.map((child) => getTextContent(child)).join('');
|
|
59
|
+
}
|
|
60
|
+
return '';
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Serialize an MDAST node back to markdown text.
|
|
64
|
+
* Preserves code fences, heading markers, list markers, inline code, etc.
|
|
65
|
+
* so that re-parsing with remark-parse reproduces the proper AST structure.
|
|
66
|
+
*/
|
|
67
|
+
export function nodeToMarkdown(node) {
|
|
68
|
+
switch (node.type) {
|
|
69
|
+
case 'text':
|
|
70
|
+
return node.value;
|
|
71
|
+
case 'inlineCode':
|
|
72
|
+
return `\`${node.value}\``;
|
|
73
|
+
case 'code': {
|
|
74
|
+
const n = node;
|
|
75
|
+
const lang = n.lang || '';
|
|
76
|
+
const meta = n.meta ? ` ${n.meta}` : '';
|
|
77
|
+
return `\`\`\`${lang}${meta}\n${n.value}\n\`\`\``;
|
|
78
|
+
}
|
|
79
|
+
case 'heading': {
|
|
80
|
+
const h = node;
|
|
81
|
+
const prefix = '#'.repeat(h.depth);
|
|
82
|
+
const text = h.children.map((c) => nodeToMarkdown(c)).join('');
|
|
83
|
+
return `${prefix} ${text}`;
|
|
84
|
+
}
|
|
85
|
+
case 'paragraph':
|
|
86
|
+
return node.children
|
|
87
|
+
.map((c) => nodeToMarkdown(c))
|
|
88
|
+
.join('');
|
|
89
|
+
case 'list': {
|
|
90
|
+
const list = node;
|
|
91
|
+
return list.children
|
|
92
|
+
.map((item, i) => {
|
|
93
|
+
const prefix = list.ordered ? `${i + 1}. ` : '- ';
|
|
94
|
+
const content = item.children
|
|
95
|
+
.map((c) => nodeToMarkdown(c))
|
|
96
|
+
.join('\n');
|
|
97
|
+
return `${prefix}${content}`;
|
|
98
|
+
})
|
|
99
|
+
.join('\n');
|
|
100
|
+
}
|
|
101
|
+
case 'emphasis':
|
|
102
|
+
return `*${node.children.map((c) => nodeToMarkdown(c)).join('')}*`;
|
|
103
|
+
case 'strong':
|
|
104
|
+
return `**${node.children.map((c) => nodeToMarkdown(c)).join('')}**`;
|
|
105
|
+
case 'link': {
|
|
106
|
+
const link = node;
|
|
107
|
+
const text = link.children.map((c) => nodeToMarkdown(c)).join('');
|
|
108
|
+
// If text matches URL, it's an autolink — output just the plain URL
|
|
109
|
+
// to avoid corrupting attribute values inside GitBook tags
|
|
110
|
+
if (text === link.url) {
|
|
111
|
+
return text;
|
|
112
|
+
}
|
|
113
|
+
return `[${text}](${link.url})`;
|
|
114
|
+
}
|
|
115
|
+
case 'blockquote':
|
|
116
|
+
return node.children
|
|
117
|
+
.map((c) => `> ${nodeToMarkdown(c)}`)
|
|
118
|
+
.join('\n');
|
|
119
|
+
case 'thematicBreak':
|
|
120
|
+
return '---';
|
|
121
|
+
default:
|
|
122
|
+
if ('children' in node && Array.isArray(node.children)) {
|
|
123
|
+
return node.children
|
|
124
|
+
.map((c) => nodeToMarkdown(c))
|
|
125
|
+
.join('');
|
|
126
|
+
}
|
|
127
|
+
if ('value' in node) {
|
|
128
|
+
return node.value;
|
|
129
|
+
}
|
|
130
|
+
return '';
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Check if text contains GitBook syntax
|
|
135
|
+
*/
|
|
136
|
+
export function containsGitBookSyntax(text) {
|
|
137
|
+
return /\{%\s*\w+/.test(text);
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@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AAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAY,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC7E,oEAAoE;YACpE,2DAA2D;YAC3D,IAAI,IAAI,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC;gBACtB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,OAAO,IAAI,IAAI,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC;QAClC,CAAC;QACD,KAAK,YAAY;YACf,OAAQ,IAA0C,CAAC,QAAQ;iBACxD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,cAAc,CAAC,CAAY,CAAC,EAAE,CAAC;iBAC/C,IAAI,CAAC,IAAI,CAAC,CAAC;QAChB,KAAK,eAAe;YAClB,OAAO,KAAK,CAAC;QACf;YACE,IAAI,UAAU,IAAI,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACvD,OAAQ,IAAI,CAAC,QAAsB;qBAChC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;qBAC7B,IAAI,CAAC,EAAE,CAAC,CAAC;YACd,CAAC;YACD,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;gBACpB,OAAQ,IAAoC,CAAC,KAAK,CAAC;YACrD,CAAC;YACD,OAAO,EAAE,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FAIcon component
|
|
3
|
+
*
|
|
4
|
+
* Renders Font Awesome icons using CSS classes.
|
|
5
|
+
* Requires Font Awesome CSS to be loaded (e.g., @fortawesome/fontawesome-free).
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactElement } from 'react';
|
|
8
|
+
import type { FAIconProps } from '../../theme-types.js';
|
|
9
|
+
export default function FAIcon({ icon }: FAIconProps): ReactElement;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/FAIcon/index.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,WAAW,GAAG,YAAY,CAElE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/theme/FAIcon/index.tsx"],"names":[],"mappings":";AAWA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,IAAI,EAAe;IAClD,OAAO,YAAG,SAAS,EAAE,IAAI,iBAAc,MAAM,GAAG,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitBook Button component
|
|
3
|
+
*
|
|
4
|
+
* Styled button link with primary/secondary variants
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactElement } from 'react';
|
|
7
|
+
import type { ButtonProps } from '../../theme-types.js';
|
|
8
|
+
export default function GitBookButton({ href, variant, icon: _icon, children, }: ButtonProps): ReactElement;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/GitBookButton/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,IAAI,EACJ,OAAmB,EACnB,IAAI,EAAE,KAAK,EACX,QAAQ,GACT,EAAE,WAAW,GAAG,YAAY,CAW5B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styles from './styles.module.css';
|
|
3
|
+
export default function GitBookButton({ href, variant = 'primary', icon: _icon, children, }) {
|
|
4
|
+
return (_jsx("a", { href: href, className: `${styles.button} ${styles[variant]}`, target: href.startsWith('http') ? '_blank' : undefined, rel: href.startsWith('http') ? 'noopener noreferrer' : undefined, children: children }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/theme/GitBookButton/index.tsx"],"names":[],"mappings":";AASA,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,IAAI,EACJ,OAAO,GAAG,SAAS,EACnB,IAAI,EAAE,KAAK,EACX,QAAQ,GACI;IACZ,OAAO,CACL,YACE,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE,EAChD,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EACtD,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,YAE/D,QAAQ,GACP,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitBook Button styles
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
.button {
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: 0.5rem;
|
|
9
|
+
padding: 0.75rem 1.5rem;
|
|
10
|
+
border-radius: 0.5rem;
|
|
11
|
+
font-weight: 500;
|
|
12
|
+
text-decoration: none;
|
|
13
|
+
transition: background-color 0.2s, color 0.2s, transform 0.1s;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.button:hover {
|
|
18
|
+
transform: translateY(-1px);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.button:active {
|
|
22
|
+
transform: translateY(0);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Primary variant */
|
|
26
|
+
.primary {
|
|
27
|
+
background-color: var(--gitbook-button-primary-bg, #0969da);
|
|
28
|
+
color: var(--gitbook-button-primary-color, #fff);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.primary:hover {
|
|
32
|
+
background-color: var(--gitbook-button-primary-hover-bg, #0756b3);
|
|
33
|
+
color: var(--gitbook-button-primary-color, #fff);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Secondary variant */
|
|
37
|
+
.secondary {
|
|
38
|
+
background-color: transparent;
|
|
39
|
+
color: var(--gitbook-button-secondary-color, #0969da);
|
|
40
|
+
border: 1px solid var(--gitbook-button-secondary-border, #0969da);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.secondary:hover {
|
|
44
|
+
background-color: var(--gitbook-button-secondary-hover-bg, rgba(9, 105, 218, 0.1));
|
|
45
|
+
color: var(--gitbook-button-secondary-color, #0969da);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Dark mode */
|
|
49
|
+
:global([data-theme='dark']) .primary {
|
|
50
|
+
background-color: var(--gitbook-button-primary-bg-dark, #58a6ff);
|
|
51
|
+
color: var(--gitbook-button-primary-color-dark, #000);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:global([data-theme='dark']) .primary:hover {
|
|
55
|
+
background-color: var(--gitbook-button-primary-hover-bg-dark, #79b8ff);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:global([data-theme='dark']) .secondary {
|
|
59
|
+
color: var(--gitbook-button-secondary-color-dark, #58a6ff);
|
|
60
|
+
border-color: var(--gitbook-button-secondary-border-dark, #58a6ff);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:global([data-theme='dark']) .secondary:hover {
|
|
64
|
+
background-color: var(--gitbook-button-secondary-hover-bg-dark, rgba(88, 166, 255, 0.1));
|
|
65
|
+
color: var(--gitbook-button-secondary-color-dark, #58a6ff);
|
|
66
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitBook Card component
|
|
3
|
+
*
|
|
4
|
+
* Individual card in a cards grid
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactElement } from 'react';
|
|
7
|
+
import type { CardProps } from '../../theme-types.js';
|
|
8
|
+
export default function GitBookCard({ title, href, children, }: CardProps): ReactElement;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/GitBookCard/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,KAAK,EACL,IAAI,EACJ,QAAQ,GACT,EAAE,SAAS,GAAG,YAAY,CAO1B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styles from './styles.module.css';
|
|
3
|
+
export default function GitBookCard({ title, href, children, }) {
|
|
4
|
+
return (_jsxs("a", { href: href, className: styles.card, children: [_jsx("div", { className: styles.title, children: title }), children && _jsx("div", { className: styles.content, children: children })] }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/theme/GitBookCard/index.tsx"],"names":[],"mappings":";AASA,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,KAAK,EACL,IAAI,EACJ,QAAQ,GACE;IACV,OAAO,CACL,aAAG,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,aACnC,cAAK,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,GAAO,EAC1C,QAAQ,IAAI,cAAK,SAAS,EAAE,MAAM,CAAC,OAAO,YAAG,QAAQ,GAAO,IAC3D,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitBook Card styles
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
.card {
|
|
6
|
+
display: block;
|
|
7
|
+
padding: 1.5rem;
|
|
8
|
+
border: 1px solid var(--gitbook-card-border, #e0e0e0);
|
|
9
|
+
border-radius: 0.5rem;
|
|
10
|
+
background-color: var(--gitbook-card-bg, #fff);
|
|
11
|
+
text-decoration: none;
|
|
12
|
+
color: inherit;
|
|
13
|
+
transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.card:hover {
|
|
17
|
+
transform: translateY(-2px);
|
|
18
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
19
|
+
border-color: var(--gitbook-card-hover-border, #0969da);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.title {
|
|
23
|
+
font-weight: 600;
|
|
24
|
+
font-size: 1rem;
|
|
25
|
+
margin-bottom: 0.5rem;
|
|
26
|
+
color: var(--gitbook-card-title-color, #0969da);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.content {
|
|
30
|
+
font-size: 0.9rem;
|
|
31
|
+
color: var(--gitbook-card-content-color, #666);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Dark mode */
|
|
35
|
+
:global([data-theme='dark']) .card {
|
|
36
|
+
border-color: var(--gitbook-card-border-dark, #444);
|
|
37
|
+
background-color: var(--gitbook-card-bg-dark, #2a2a2a);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:global([data-theme='dark']) .card:hover {
|
|
41
|
+
border-color: var(--gitbook-card-hover-border-dark, #58a6ff);
|
|
42
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:global([data-theme='dark']) .title {
|
|
46
|
+
color: var(--gitbook-card-title-color-dark, #58a6ff);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:global([data-theme='dark']) .content {
|
|
50
|
+
color: var(--gitbook-card-content-color-dark, #aaa);
|
|
51
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitBook Cards component
|
|
3
|
+
*
|
|
4
|
+
* Grid container for card navigation
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactElement } from 'react';
|
|
7
|
+
import type { CardsProps } from '../../theme-types.js';
|
|
8
|
+
export default function GitBookCards({ children }: CardsProps): ReactElement;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/GitBookCards/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGvD,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,UAAU,GAAG,YAAY,CAE3E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/theme/GitBookCards/index.tsx"],"names":[],"mappings":";AASA,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,QAAQ,EAAc;IAC3D,OAAO,cAAK,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,QAAQ,GAAO,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitBook Cards styles
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
.cards {
|
|
6
|
+
display: grid;
|
|
7
|
+
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
8
|
+
gap: 1rem;
|
|
9
|
+
margin: 1rem 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@media (max-width: 600px) {
|
|
13
|
+
.cards {
|
|
14
|
+
grid-template-columns: 1fr;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitBook Code Block component
|
|
3
|
+
*
|
|
4
|
+
* Wraps a code block with a title/filename header
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactElement } from 'react';
|
|
7
|
+
import type { CodeBlockProps } from '../../theme-types.js';
|
|
8
|
+
export default function GitBookCodeBlock({ title, lineNumbers: _lineNumbers, overflow, children, }: CodeBlockProps): ReactElement;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/GitBookCodeBlock/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG3D,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,KAAK,EACL,WAAW,EAAE,YAAY,EACzB,QAAmB,EACnB,QAAQ,GACT,EAAE,cAAc,GAAG,YAAY,CAW/B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styles from './styles.module.css';
|
|
3
|
+
export default function GitBookCodeBlock({ title, lineNumbers: _lineNumbers, overflow = 'scroll', children, }) {
|
|
4
|
+
return (_jsxs("div", { className: `${styles.codeBlock} ${styles[overflow]}`, children: [title && (_jsx("div", { className: styles.header, children: _jsx("span", { className: styles.title, children: title }) })), _jsx("div", { className: styles.content, children: children })] }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/theme/GitBookCodeBlock/index.tsx"],"names":[],"mappings":";AASA,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,KAAK,EACL,WAAW,EAAE,YAAY,EACzB,QAAQ,GAAG,QAAQ,EACnB,QAAQ,GACO;IACf,OAAO,CACL,eAAK,SAAS,EAAE,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE,aACtD,KAAK,IAAI,CACR,cAAK,SAAS,EAAE,MAAM,CAAC,MAAM,YAC3B,eAAM,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,GAAQ,GACzC,CACP,EACD,cAAK,SAAS,EAAE,MAAM,CAAC,OAAO,YAAG,QAAQ,GAAO,IAC5C,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitBook Code Block styles
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
.codeBlock {
|
|
6
|
+
margin: 1rem 0;
|
|
7
|
+
border-radius: 0.5rem;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
border: 1px solid var(--gitbook-code-border, #e0e0e0);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.header {
|
|
13
|
+
padding: 0.5rem 1rem;
|
|
14
|
+
background-color: var(--gitbook-code-header-bg, #f5f5f5);
|
|
15
|
+
border-bottom: 1px solid var(--gitbook-code-border, #e0e0e0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.title {
|
|
19
|
+
font-family: var(--ifm-font-family-monospace, monospace);
|
|
20
|
+
font-size: 0.85rem;
|
|
21
|
+
color: var(--gitbook-code-title-color, #666);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.content {
|
|
25
|
+
margin: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.content :global(.theme-code-block) {
|
|
29
|
+
margin-bottom: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.content pre {
|
|
33
|
+
margin: 0 !important;
|
|
34
|
+
border-radius: 0 !important;
|
|
35
|
+
border: none !important;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.scroll .content {
|
|
39
|
+
overflow-x: auto;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.wrap .content pre {
|
|
43
|
+
white-space: pre-wrap;
|
|
44
|
+
word-wrap: break-word;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Dark mode */
|
|
48
|
+
:global([data-theme='dark']) .codeBlock {
|
|
49
|
+
border-color: var(--gitbook-code-border-dark, #444);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
:global([data-theme='dark']) .header {
|
|
53
|
+
background-color: var(--gitbook-code-header-bg-dark, #2a2a2a);
|
|
54
|
+
border-color: var(--gitbook-code-border-dark, #444);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:global([data-theme='dark']) .title {
|
|
58
|
+
color: var(--gitbook-code-title-color-dark, #aaa);
|
|
59
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitBook Column component
|
|
3
|
+
*
|
|
4
|
+
* Individual column in a columns layout
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactElement } from 'react';
|
|
7
|
+
import type { ColumnProps } from '../../theme-types.js';
|
|
8
|
+
export default function GitBookColumn({ children }: ColumnProps): ReactElement;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/GitBookColumn/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,WAAW,GAAG,YAAY,CAE7E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/theme/GitBookColumn/index.tsx"],"names":[],"mappings":";AASA,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAe;IAC7D,OAAO,cAAK,SAAS,EAAE,MAAM,CAAC,MAAM,YAAG,QAAQ,GAAO,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitBook Columns component
|
|
3
|
+
*
|
|
4
|
+
* Container for side-by-side columns
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactElement } from 'react';
|
|
7
|
+
import type { ColumnsProps } from '../../theme-types.js';
|
|
8
|
+
export default function GitBookColumns({ children }: ColumnsProps): ReactElement;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/GitBookColumns/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,YAAY,GAAG,YAAY,CAE/E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/theme/GitBookColumns/index.tsx"],"names":[],"mappings":";AASA,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,QAAQ,EAAgB;IAC/D,OAAO,cAAK,SAAS,EAAE,MAAM,CAAC,OAAO,YAAG,QAAQ,GAAO,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitBook Embed component
|
|
3
|
+
*
|
|
4
|
+
* Embeds external content (YouTube, Vimeo, CodePen, etc.)
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactElement } from 'react';
|
|
7
|
+
import type { EmbedProps } from '../../theme-types.js';
|
|
8
|
+
export default function GitBookEmbed({ url }: EmbedProps): ReactElement;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/GitBookEmbed/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AA4EvD,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,GAAG,EAAE,EAAE,UAAU,GAAG,YAAY,CAiBtE"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styles from './styles.module.css';
|
|
3
|
+
function parseEmbedUrl(url) {
|
|
4
|
+
try {
|
|
5
|
+
const parsed = new URL(url);
|
|
6
|
+
const hostname = parsed.hostname.replace('www.', '');
|
|
7
|
+
// YouTube
|
|
8
|
+
if (hostname === 'youtube.com' || hostname === 'youtu.be') {
|
|
9
|
+
let videoId = '';
|
|
10
|
+
if (hostname === 'youtu.be') {
|
|
11
|
+
videoId = parsed.pathname.slice(1);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
videoId = parsed.searchParams.get('v') || '';
|
|
15
|
+
}
|
|
16
|
+
if (videoId) {
|
|
17
|
+
return {
|
|
18
|
+
type: 'youtube',
|
|
19
|
+
embedUrl: `https://www.youtube.com/embed/${videoId}`,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
// Vimeo
|
|
24
|
+
if (hostname === 'vimeo.com') {
|
|
25
|
+
const videoId = parsed.pathname.slice(1);
|
|
26
|
+
if (videoId) {
|
|
27
|
+
return {
|
|
28
|
+
type: 'vimeo',
|
|
29
|
+
embedUrl: `https://player.vimeo.com/video/${videoId}`,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// CodePen - handles /user/pen/ID and /team/name/pen/ID
|
|
34
|
+
if (hostname === 'codepen.io') {
|
|
35
|
+
const parts = parsed.pathname.split('/');
|
|
36
|
+
const penIndex = parts.indexOf('pen');
|
|
37
|
+
if (penIndex !== -1 && penIndex + 1 < parts.length) {
|
|
38
|
+
const penId = parts[penIndex + 1];
|
|
39
|
+
const userPath = parts.slice(1, penIndex).join('/');
|
|
40
|
+
return {
|
|
41
|
+
type: 'codepen',
|
|
42
|
+
embedUrl: `https://codepen.io/${userPath}/embed/${penId}?default-tab=result`,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// CodeSandbox
|
|
47
|
+
if (hostname === 'codesandbox.io') {
|
|
48
|
+
const sandboxId = parsed.pathname.replace('/s/', '').replace('/embed/', '');
|
|
49
|
+
return {
|
|
50
|
+
type: 'codesandbox',
|
|
51
|
+
embedUrl: `https://codesandbox.io/embed/${sandboxId}`,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
// Generic iframe
|
|
55
|
+
return {
|
|
56
|
+
type: 'generic',
|
|
57
|
+
embedUrl: url,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return {
|
|
62
|
+
type: 'generic',
|
|
63
|
+
embedUrl: url,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export default function GitBookEmbed({ url }) {
|
|
68
|
+
const embedInfo = parseEmbedUrl(url);
|
|
69
|
+
return (_jsxs("div", { className: styles.embed, children: [_jsx("iframe", { src: embedInfo.embedUrl, className: styles.iframe, title: "Embedded content", allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", allowFullScreen: true }), _jsx("a", { href: url, className: styles.link, target: "_blank", rel: "noopener noreferrer", children: "Open in new tab" })] }));
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=index.js.map
|