@hyperbook/markdown 0.4.3 → 0.5.1
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/index.cjs.js +142 -158
- package/dist/index.cjs.js.map +2 -2
- package/dist/index.css +13 -1
- package/dist/index.css.map +2 -2
- package/dist/index.esm.mjs +142 -158
- package/dist/index.esm.mjs.map +2 -2
- package/package.json +5 -5
package/dist/index.cjs.js
CHANGED
|
@@ -65,79 +65,97 @@ var import_provider = require("@hyperbook/provider");
|
|
|
65
65
|
var import_react = require("react");
|
|
66
66
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
67
67
|
var MdContentCopy = () => {
|
|
68
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
fill: "none"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
]
|
|
85
|
-
});
|
|
68
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
69
|
+
"svg",
|
|
70
|
+
{
|
|
71
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
72
|
+
stroke: "currentColor",
|
|
73
|
+
fill: "currentColor",
|
|
74
|
+
strokeWidth: "0",
|
|
75
|
+
height: "1em",
|
|
76
|
+
width: "1em",
|
|
77
|
+
viewBox: "0 0 24 24",
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
80
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" })
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
);
|
|
86
84
|
};
|
|
87
85
|
var MdDone = () => {
|
|
88
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
fill: "none"
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
]
|
|
105
|
-
});
|
|
86
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
87
|
+
"svg",
|
|
88
|
+
{
|
|
89
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
90
|
+
stroke: "currentColor",
|
|
91
|
+
fill: "currentColor",
|
|
92
|
+
strokeWidth: "0",
|
|
93
|
+
height: "1em",
|
|
94
|
+
width: "1em",
|
|
95
|
+
viewBox: "0 0 24 24",
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
98
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" })
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
);
|
|
106
102
|
};
|
|
107
|
-
var
|
|
103
|
+
var copyNoNavigator = (text) => {
|
|
104
|
+
const isIos = navigator.userAgent.match(/ipad|iphone/i);
|
|
105
|
+
const textarea = document.createElement("textarea");
|
|
106
|
+
textarea.value = text;
|
|
107
|
+
textarea.style.fontSize = "20px";
|
|
108
|
+
document.body.appendChild(textarea);
|
|
109
|
+
if (isIos) {
|
|
110
|
+
const range = document.createRange();
|
|
111
|
+
range.selectNodeContents(textarea);
|
|
112
|
+
const selection = window.getSelection();
|
|
113
|
+
if (selection) {
|
|
114
|
+
selection.removeAllRanges();
|
|
115
|
+
selection.addRange(range);
|
|
116
|
+
}
|
|
117
|
+
textarea.setSelectionRange(0, 999999);
|
|
118
|
+
} else {
|
|
119
|
+
textarea.select();
|
|
120
|
+
}
|
|
121
|
+
document.execCommand("copy");
|
|
122
|
+
document.body.removeChild(textarea);
|
|
123
|
+
};
|
|
124
|
+
var Code = ({ children, className, inline }) => {
|
|
125
|
+
console.log(inline);
|
|
108
126
|
const directives = (0, import_provider.useDirectives)();
|
|
109
127
|
if (className === "language-mermaid" && directives["mermaid"]) {
|
|
110
128
|
const Mermaid = directives["mermaid"];
|
|
111
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Mermaid, {
|
|
112
|
-
children
|
|
113
|
-
});
|
|
129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Mermaid, { children });
|
|
114
130
|
}
|
|
115
131
|
const ref = (0, import_react.useRef)(null);
|
|
116
132
|
const [copied, setCopied] = (0, import_react.useState)(false);
|
|
117
133
|
const copyCode = () => {
|
|
118
|
-
if (
|
|
134
|
+
if (ref.current) {
|
|
119
135
|
const text = ref.current.innerText;
|
|
120
|
-
navigator.clipboard
|
|
136
|
+
if (navigator.clipboard) {
|
|
137
|
+
navigator.clipboard.writeText(text).then(() => {
|
|
138
|
+
setCopied(true);
|
|
139
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
140
|
+
}).catch(() => {
|
|
141
|
+
copyNoNavigator(text);
|
|
142
|
+
setCopied(true);
|
|
143
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
144
|
+
});
|
|
145
|
+
} else {
|
|
146
|
+
copyNoNavigator(text);
|
|
121
147
|
setCopied(true);
|
|
122
148
|
setTimeout(() => setCopied(false), 2e3);
|
|
123
|
-
}
|
|
149
|
+
}
|
|
124
150
|
}
|
|
125
151
|
};
|
|
126
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
127
|
-
children
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
134
|
-
className: "copy",
|
|
135
|
-
onPointerDown: copyCode,
|
|
136
|
-
"aria-label": "Copy Code",
|
|
137
|
-
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MdDone, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MdContentCopy, {})
|
|
138
|
-
})
|
|
139
|
-
]
|
|
140
|
-
});
|
|
152
|
+
return inline ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "inline", children: [
|
|
153
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { ref, className, children }),
|
|
154
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: "copy", onClick: copyCode, "aria-label": "Copy Code", children: copied ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MdDone, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MdContentCopy, {}) })
|
|
155
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
|
|
156
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { ref, className, children }),
|
|
157
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: "copy", onClick: copyCode, "aria-label": "Copy Code", children: copied ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MdDone, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MdContentCopy, {}) })
|
|
158
|
+
] });
|
|
141
159
|
};
|
|
142
160
|
|
|
143
161
|
// src/Link.tsx
|
|
@@ -155,11 +173,7 @@ function formatUrl(url) {
|
|
|
155
173
|
}
|
|
156
174
|
var Link = ({ href, title, children }) => {
|
|
157
175
|
const L = (0, import_provider2.useLink)();
|
|
158
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(L, {
|
|
159
|
-
href,
|
|
160
|
-
title,
|
|
161
|
-
children: formatUrl(children)
|
|
162
|
-
});
|
|
176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(L, { href, title, children: formatUrl(children) });
|
|
163
177
|
};
|
|
164
178
|
|
|
165
179
|
// src/Table.tsx
|
|
@@ -168,31 +182,18 @@ var tableHeaders = [];
|
|
|
168
182
|
var tdIndex = 0;
|
|
169
183
|
var Table = ({ children, style }) => {
|
|
170
184
|
tableHeaders = [];
|
|
171
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("table", {
|
|
172
|
-
style,
|
|
173
|
-
children
|
|
174
|
-
});
|
|
185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("table", { style, children });
|
|
175
186
|
};
|
|
176
187
|
var Tr = ({ children, style }) => {
|
|
177
188
|
tdIndex = 0;
|
|
178
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("tr", {
|
|
179
|
-
style,
|
|
180
|
-
children
|
|
181
|
-
});
|
|
189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("tr", { style, children });
|
|
182
190
|
};
|
|
183
191
|
var Td = ({ children, style }) => {
|
|
184
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", {
|
|
185
|
-
"data-label": tableHeaders[tdIndex++],
|
|
186
|
-
style,
|
|
187
|
-
children
|
|
188
|
-
});
|
|
192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", { "data-label": tableHeaders[tdIndex++], style, children });
|
|
189
193
|
};
|
|
190
194
|
var Th = ({ children, style }) => {
|
|
191
195
|
tableHeaders.push(children);
|
|
192
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("th", {
|
|
193
|
-
style,
|
|
194
|
-
children
|
|
195
|
-
});
|
|
196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("th", { style, children });
|
|
196
197
|
};
|
|
197
198
|
|
|
198
199
|
// src/Headings.tsx
|
|
@@ -212,49 +213,31 @@ var Headings = ({ level, children }) => {
|
|
|
212
213
|
let anchor = typeof heading === "string" ? makeAnchor(heading) : "";
|
|
213
214
|
const label = typeof heading === "string" ? heading : anchor;
|
|
214
215
|
const [bookmark, toggleBookmark] = (0, import_provider3.useBookmark)(anchor, label);
|
|
215
|
-
const container = (children2) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, {
|
|
216
|
-
children:
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
href: `#${anchor}`,
|
|
221
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", {
|
|
222
|
-
children: children2
|
|
223
|
-
})
|
|
224
|
-
}),
|
|
225
|
-
bookmarksConfig !== false && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", {
|
|
216
|
+
const container = (children2) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
217
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("a", { className: "heading", id: anchor, href: `#${anchor}`, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: children2 }) }),
|
|
218
|
+
bookmarksConfig !== false && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
219
|
+
"button",
|
|
220
|
+
{
|
|
226
221
|
className: bookmark ? "bookmark active" : "bookmark",
|
|
227
222
|
onClick: () => toggleBookmark(),
|
|
228
223
|
title: "Bookmark",
|
|
229
224
|
children: "\u{1F516}"
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
});
|
|
225
|
+
}
|
|
226
|
+
)
|
|
227
|
+
] });
|
|
233
228
|
switch (level) {
|
|
234
229
|
case 1:
|
|
235
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h1", {
|
|
236
|
-
children: container(children)
|
|
237
|
-
});
|
|
230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h1", { children: container(children) });
|
|
238
231
|
case 2:
|
|
239
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", {
|
|
240
|
-
children: container(children)
|
|
241
|
-
});
|
|
232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { children: container(children) });
|
|
242
233
|
case 3:
|
|
243
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", {
|
|
244
|
-
children: container(children)
|
|
245
|
-
});
|
|
234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { children: container(children) });
|
|
246
235
|
case 4:
|
|
247
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h4", {
|
|
248
|
-
children: container(children)
|
|
249
|
-
});
|
|
236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h4", { children: container(children) });
|
|
250
237
|
case 5:
|
|
251
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h5", {
|
|
252
|
-
children: container(children)
|
|
253
|
-
});
|
|
238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h5", { children: container(children) });
|
|
254
239
|
default:
|
|
255
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h6", {
|
|
256
|
-
children: container(children)
|
|
257
|
-
});
|
|
240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h6", { children: container(children) });
|
|
258
241
|
}
|
|
259
242
|
};
|
|
260
243
|
|
|
@@ -266,19 +249,17 @@ var Image = ({ src, title, alt }) => {
|
|
|
266
249
|
const makeUrl = (0, import_provider4.useMakeUrl)();
|
|
267
250
|
const [full, setFull] = (0, import_react2.useState)(false);
|
|
268
251
|
src = makeUrl(src, "public");
|
|
269
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
alt
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
]
|
|
281
|
-
});
|
|
252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
253
|
+
"figure",
|
|
254
|
+
{
|
|
255
|
+
onClick: () => setFull((f) => !f),
|
|
256
|
+
className: full ? "lightbox" : void 0,
|
|
257
|
+
children: [
|
|
258
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("img", { src, alt }),
|
|
259
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("figcaption", { children: title })
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
);
|
|
282
263
|
};
|
|
283
264
|
|
|
284
265
|
// src/Markdown.tsx
|
|
@@ -297,38 +278,41 @@ var remarkRemoveComments = () => (tree) => {
|
|
|
297
278
|
};
|
|
298
279
|
var Markdown = ({ children }) => {
|
|
299
280
|
const directives = (0, import_provider5.useDirectives)();
|
|
300
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
282
|
+
import_react_markdown.default,
|
|
283
|
+
{
|
|
284
|
+
className: "hyperbook-markdown",
|
|
285
|
+
components: __spreadProps(__spreadValues({}, directives), {
|
|
286
|
+
a: Link,
|
|
287
|
+
code: Code,
|
|
288
|
+
td: Td,
|
|
289
|
+
th: Th,
|
|
290
|
+
table: Table,
|
|
291
|
+
tr: Tr,
|
|
292
|
+
h1: Headings,
|
|
293
|
+
h2: Headings,
|
|
294
|
+
h3: Headings,
|
|
295
|
+
h4: Headings,
|
|
296
|
+
h5: Headings,
|
|
297
|
+
h6: Headings,
|
|
298
|
+
img: Image
|
|
299
|
+
}),
|
|
300
|
+
remarkPlugins: [
|
|
301
|
+
remarkRemoveComments,
|
|
302
|
+
import_remark_directive.default,
|
|
303
|
+
import_remark_directive_rehype.default,
|
|
304
|
+
import_remark_gfm.default,
|
|
305
|
+
import_remark_math.default,
|
|
306
|
+
import_remark_gemoji.default,
|
|
307
|
+
import_remark_unwrap_images.default
|
|
308
|
+
],
|
|
309
|
+
rehypePlugins: [
|
|
310
|
+
import_rehype_katex.default,
|
|
311
|
+
[import_rehype_highlight.default, { ignoreMissing: true, plainText: ["mermaid"] }]
|
|
312
|
+
],
|
|
313
|
+
skipHtml: false,
|
|
314
|
+
children
|
|
315
|
+
}
|
|
316
|
+
);
|
|
333
317
|
};
|
|
334
318
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/Markdown.tsx", "../src/Code.tsx", "../src/Link.tsx", "../src/Table.tsx", "../src/Headings.tsx", "../src/Image.tsx"],
|
|
4
|
-
"sourcesContent": ["export * from \"./Markdown\";\n", "import ReactMarkdown from \"react-markdown\";\nimport remarkDirective from \"remark-directive\";\nimport remarkDirectiveRehype from \"remark-directive-rehype\";\nimport remarkGfm from \"remark-gfm\";\nimport remarkMath from \"remark-math\";\nimport remarkGemoji from \"remark-gemoji\";\nimport remarkUnwrapImages from \"remark-unwrap-images\";\nimport rehypeKatex from \"rehype-katex\";\nimport rehypeHighlight from \"rehype-highlight\";\nimport { useDirectives } from \"@hyperbook/provider\";\nimport { visit, SKIP } from \"unist-util-visit\";\nimport { Code } from \"./Code\";\nimport { Link } from \"./Link\";\nimport { Table, Td, Th, Tr } from \"./Table\";\nimport { Headings } from \"./Headings\";\nimport { Image } from \"./Image\";\n\nimport \"./index.css\";\nimport { Transformer } from \"unified\";\nimport { BuildVisitor } from \"unist-util-visit/complex-types\";\n\nconst remarkRemoveComments: () => Transformer = () => (tree) => {\n const htmlCommentRegex = /<!--([\\s\\S]*?)-->/g;\n\n const handler: BuildVisitor = (node, index, parent) => {\n const isComment = node.value.match(htmlCommentRegex);\n\n if (isComment) {\n // remove node\n parent.children.splice(index, 1);\n // Do not traverse `node`, continue at the node *now* at `index`. http://unifiedjs.com/learn/recipe/remove-node/\n return [SKIP, index];\n }\n };\n\n visit(tree, \"html\", handler);\n\n visit(tree, \"jsx\", handler);\n};\n\nexport type MarkdownProps = {\n children: string;\n};\n\nexport const Markdown = ({ children }: MarkdownProps) => {\n const directives = useDirectives();\n\n return (\n <ReactMarkdown\n className=\"hyperbook-markdown\"\n components={{\n ...directives,\n a: Link,\n code: Code,\n td: Td,\n th: Th,\n table: Table,\n tr: Tr,\n h1: Headings,\n h2: Headings,\n h3: Headings,\n h4: Headings,\n h5: Headings,\n h6: Headings,\n img: Image,\n }}\n remarkPlugins={[\n remarkRemoveComments,\n remarkDirective,\n remarkDirectiveRehype,\n remarkGfm,\n remarkMath,\n remarkGemoji,\n remarkUnwrapImages,\n ]}\n rehypePlugins={[\n rehypeKatex,\n [rehypeHighlight, { ignoreMissing: true, plainText: [\"mermaid\"] }],\n ]}\n skipHtml={false}\n >\n {children}\n </ReactMarkdown>\n );\n};\n", "import { useDirectives } from \"@hyperbook/provider\";\nimport { Fragment, useRef, useState } from \"react\";\nimport { Components } from \"react-markdown\";\n\nconst MdContentCopy = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n height=\"1em\"\n width=\"1em\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z\" />\n </svg>\n );\n};\n\nconst MdDone = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n height=\"1em\"\n width=\"1em\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z\" />\n </svg>\n );\n};\n\nexport const Code: Components[\"code\"] = ({ children, className }) => {\n const directives = useDirectives();\n if (className === \"language-mermaid\" && directives[\"mermaid\"]) {\n const Mermaid = directives[\"mermaid\"];\n return <Mermaid children={children} />;\n }\n\n const ref = useRef<HTMLElement>(null);\n const [copied, setCopied] = useState(false);\n const copyCode = () => {\n if (navigator.clipboard && ref.current) {\n const text = ref.current.innerText;\n navigator.clipboard.writeText(text).then(() => {\n setCopied(true);\n\n setTimeout(() => setCopied(false), 2000);\n });\n }\n };\n\n return (\n <Fragment>\n <code ref={ref} className={className}>\n {children}\n </code>\n <button className=\"copy\" onPointerDown={copyCode} aria-label=\"Copy Code\">\n {copied ? <MdDone /> : <MdContentCopy />}\n </button>\n </Fragment>\n );\n};\n", "import { useLink } from \"@hyperbook/provider\";\nimport { ReactNode } from \"react\";\nimport { Components } from \"react-markdown\";\n\n// see: https://css-tricks.com/better-line-breaks-for-long-urls/\nfunction formatUrl(url: ReactNode) {\n if (typeof url !== \"string\") {\n return url;\n }\n // Split the URL into an array to distinguish double slashes from single slashes\n var doubleSlash = url.split(\"//\");\n\n // Format the strings on either side of double slashes separately\n var formatted = doubleSlash\n .map(\n (str) =>\n // Insert a word break opportunity after a colon\n str\n .replace(/(?<after>:)/giu, \"$1<wbr>\")\n // Before a single slash, tilde, period, comma, hyphen, underline, question mark, number sign, or percent symbol\n .replace(/(?<before>[/~.,\\-_?#%])/giu, \"<wbr>$1\")\n // Before and after an equals sign or ampersand\n .replace(/(?<beforeAndAfter>[=&])/giu, \"<wbr>$1<wbr>\")\n // Reconnect the strings with word break opportunities after double slashes\n )\n .join(\"//<wbr>\");\n\n return formatted;\n}\n\nexport const Link: Components[\"a\"] = ({ href, title, children }) => {\n const L = useLink();\n\n return (\n <L href={href} title={title}>\n {formatUrl(children)}\n </L>\n );\n};\n", "import { ReactNode } from \"react\";\nimport { Components } from \"react-markdown\";\n\nlet tableHeaders: ReactNode[][] = [];\nlet tdIndex = 0;\n\nexport const Table: Components[\"table\"] = ({ children, style }) => {\n tableHeaders = [];\n return <table style={style}>{children}</table>;\n};\n\nexport const Tr: Components[\"tr\"] = ({ children, style }) => {\n tdIndex = 0;\n return <tr style={style}>{children}</tr>;\n};\n\nexport const Td: Components[\"td\"] = ({ children, style }) => {\n return (\n <td data-label={tableHeaders[tdIndex++]} style={style}>\n {children}\n </td>\n );\n};\n\nexport const Th: Components[\"th\"] = ({ children, style }) => {\n tableHeaders.push(children);\n return <th style={style}>{children}</th>;\n};\n", "import { useBookmark, useConfig } from \"@hyperbook/provider\";\nimport { Components } from \"react-markdown\";\n\nexport const makeAnchor = (heading: string) => {\n // If we have a heading, make it lower case\n let anchor = heading.toLowerCase();\n\n // Clean anchor (replace special characters whitespaces).\n // Alternatively, use encodeURIComponent() if you don't care about\n // pretty anchor links\n anchor = anchor.replace(/[^a-zA-Z0-9 ]/g, \"\");\n anchor = anchor.replace(/ /g, \"-\");\n\n return anchor;\n};\n\nexport const Headings: Components[\"h1\"] = ({ level, children }) => {\n const config = useConfig();\n const bookmarksConfig = config?.elements?.bookmarks;\n // Access actual (string) value of heading\n const heading = children?.[0] || \"\";\n\n // If we have a heading, make it lower case\n let anchor = typeof heading === \"string\" ? makeAnchor(heading) : \"\";\n\n const label = typeof heading === \"string\" ? heading : anchor;\n\n const [bookmark, toggleBookmark] = useBookmark(anchor, label);\n\n // Utility\n const container = (children: React.ReactNode): JSX.Element => (\n <>\n <a className=\"heading\" id={anchor} href={`#${anchor}`}>\n <span>{children}</span>\n </a>\n {bookmarksConfig !== false && (\n <button\n className={bookmark ? \"bookmark active\" : \"bookmark\"}\n onClick={() => toggleBookmark()}\n title=\"Bookmark\"\n >\n \uD83D\uDD16\n </button>\n )}\n </>\n );\n\n switch (level) {\n case 1:\n return <h1>{container(children)}</h1>;\n case 2:\n return <h2>{container(children)}</h2>;\n case 3:\n return <h3>{container(children)}</h3>;\n case 4:\n return <h4>{container(children)}</h4>;\n case 5:\n return <h5>{container(children)}</h5>;\n\n default:\n return <h6>{container(children)}</h6>;\n }\n};\n", "import { useMakeUrl } from \"@hyperbook/provider\";\nimport { useState } from \"react\";\nimport { Components } from \"react-markdown\";\n\nexport const Image: Components[\"img\"] = ({ src, title, alt }) => {\n const makeUrl = useMakeUrl();\n const [full, setFull] = useState(false);\n src = makeUrl(src, \"public\");\n\n return (\n <figure\n onClick={() => setFull((f) => !f)}\n className={full ? \"lightbox\" : undefined}\n >\n <img src={src} alt={alt} />\n {title && <figcaption>{title}</figcaption>}\n </figure>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,4BAA0B;AAC1B,8BAA4B;AAC5B,qCAAkC;AAClC,wBAAsB;AACtB,yBAAuB;AACvB,2BAAyB;AACzB,kCAA+B;AAC/B,0BAAwB;AACxB,8BAA4B;AAC5B,IAAAA,mBAA8B;AAC9B,8BAA4B;;;ACV5B,sBAA8B;AAC9B,mBAA2C;AAKvC;AAFJ,IAAM,gBAAgB,MAAM;AAC1B,SACE,
|
|
4
|
+
"sourcesContent": ["export * from \"./Markdown\";\n", "import ReactMarkdown from \"react-markdown\";\nimport remarkDirective from \"remark-directive\";\nimport remarkDirectiveRehype from \"remark-directive-rehype\";\nimport remarkGfm from \"remark-gfm\";\nimport remarkMath from \"remark-math\";\nimport remarkGemoji from \"remark-gemoji\";\nimport remarkUnwrapImages from \"remark-unwrap-images\";\nimport rehypeKatex from \"rehype-katex\";\nimport rehypeHighlight from \"rehype-highlight\";\nimport { useDirectives } from \"@hyperbook/provider\";\nimport { visit, SKIP } from \"unist-util-visit\";\nimport { Code } from \"./Code\";\nimport { Link } from \"./Link\";\nimport { Table, Td, Th, Tr } from \"./Table\";\nimport { Headings } from \"./Headings\";\nimport { Image } from \"./Image\";\n\nimport \"./index.css\";\nimport { Transformer } from \"unified\";\nimport { BuildVisitor } from \"unist-util-visit/complex-types\";\n\nconst remarkRemoveComments: () => Transformer = () => (tree) => {\n const htmlCommentRegex = /<!--([\\s\\S]*?)-->/g;\n\n const handler: BuildVisitor = (node, index, parent) => {\n const isComment = node.value.match(htmlCommentRegex);\n\n if (isComment) {\n // remove node\n parent.children.splice(index, 1);\n // Do not traverse `node`, continue at the node *now* at `index`. http://unifiedjs.com/learn/recipe/remove-node/\n return [SKIP, index];\n }\n };\n\n visit(tree, \"html\", handler);\n\n visit(tree, \"jsx\", handler);\n};\n\nexport type MarkdownProps = {\n children: string;\n};\n\nexport const Markdown = ({ children }: MarkdownProps) => {\n const directives = useDirectives();\n\n return (\n <ReactMarkdown\n className=\"hyperbook-markdown\"\n components={{\n ...directives,\n a: Link,\n code: Code,\n td: Td,\n th: Th,\n table: Table,\n tr: Tr,\n h1: Headings,\n h2: Headings,\n h3: Headings,\n h4: Headings,\n h5: Headings,\n h6: Headings,\n img: Image,\n }}\n remarkPlugins={[\n remarkRemoveComments,\n remarkDirective,\n remarkDirectiveRehype,\n remarkGfm,\n remarkMath,\n remarkGemoji,\n remarkUnwrapImages,\n ]}\n rehypePlugins={[\n rehypeKatex,\n [rehypeHighlight, { ignoreMissing: true, plainText: [\"mermaid\"] }],\n ]}\n skipHtml={false}\n >\n {children}\n </ReactMarkdown>\n );\n};\n", "import { useDirectives } from \"@hyperbook/provider\";\nimport { Fragment, useRef, useState } from \"react\";\nimport { Components } from \"react-markdown\";\n\nconst MdContentCopy = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n height=\"1em\"\n width=\"1em\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z\" />\n </svg>\n );\n};\n\nconst MdDone = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n height=\"1em\"\n width=\"1em\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z\" />\n </svg>\n );\n};\n\nconst copyNoNavigator = (text: string) => {\n const isIos = navigator.userAgent.match(/ipad|iphone/i);\n const textarea = document.createElement(\"textarea\");\n\n // create textarea\n textarea.value = text;\n\n // ios will zoom in on the input if the font-size is < 16px\n textarea.style.fontSize = \"20px\";\n document.body.appendChild(textarea);\n\n // select text\n if (isIos) {\n const range = document.createRange();\n range.selectNodeContents(textarea);\n\n const selection = window.getSelection();\n if (selection) {\n selection.removeAllRanges();\n selection.addRange(range);\n }\n textarea.setSelectionRange(0, 999999);\n } else {\n textarea.select();\n }\n\n // copy selection\n document.execCommand(\"copy\");\n\n // cleanup\n document.body.removeChild(textarea);\n};\n\nexport const Code: Components[\"code\"] = ({ children, className, inline }) => {\n console.log(inline);\n const directives = useDirectives();\n if (className === \"language-mermaid\" && directives[\"mermaid\"]) {\n const Mermaid = directives[\"mermaid\"];\n return <Mermaid children={children} />;\n }\n\n const ref = useRef<HTMLElement>(null);\n const [copied, setCopied] = useState(false);\n const copyCode = () => {\n if (ref.current) {\n const text = ref.current.innerText;\n if (navigator.clipboard) {\n navigator.clipboard\n .writeText(text)\n .then(() => {\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n })\n .catch(() => {\n copyNoNavigator(text);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n });\n } else {\n copyNoNavigator(text);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n }\n }\n };\n\n return inline ? (\n <span className=\"inline\">\n <code ref={ref} className={className}>\n {children}\n </code>\n <button className=\"copy\" onClick={copyCode} aria-label=\"Copy Code\">\n {copied ? <MdDone /> : <MdContentCopy />}\n </button>\n </span>\n ) : (\n <Fragment>\n <code ref={ref} className={className}>\n {children}\n </code>\n <button className=\"copy\" onClick={copyCode} aria-label=\"Copy Code\">\n {copied ? <MdDone /> : <MdContentCopy />}\n </button>\n </Fragment>\n );\n};\n", "import { useLink } from \"@hyperbook/provider\";\nimport { ReactNode } from \"react\";\nimport { Components } from \"react-markdown\";\n\n// see: https://css-tricks.com/better-line-breaks-for-long-urls/\nfunction formatUrl(url: ReactNode) {\n if (typeof url !== \"string\") {\n return url;\n }\n // Split the URL into an array to distinguish double slashes from single slashes\n var doubleSlash = url.split(\"//\");\n\n // Format the strings on either side of double slashes separately\n var formatted = doubleSlash\n .map(\n (str) =>\n // Insert a word break opportunity after a colon\n str\n .replace(/(?<after>:)/giu, \"$1<wbr>\")\n // Before a single slash, tilde, period, comma, hyphen, underline, question mark, number sign, or percent symbol\n .replace(/(?<before>[/~.,\\-_?#%])/giu, \"<wbr>$1\")\n // Before and after an equals sign or ampersand\n .replace(/(?<beforeAndAfter>[=&])/giu, \"<wbr>$1<wbr>\")\n // Reconnect the strings with word break opportunities after double slashes\n )\n .join(\"//<wbr>\");\n\n return formatted;\n}\n\nexport const Link: Components[\"a\"] = ({ href, title, children }) => {\n const L = useLink();\n\n return (\n <L href={href} title={title}>\n {formatUrl(children)}\n </L>\n );\n};\n", "import { ReactNode } from \"react\";\nimport { Components } from \"react-markdown\";\n\nlet tableHeaders: ReactNode[][] = [];\nlet tdIndex = 0;\n\nexport const Table: Components[\"table\"] = ({ children, style }) => {\n tableHeaders = [];\n return <table style={style}>{children}</table>;\n};\n\nexport const Tr: Components[\"tr\"] = ({ children, style }) => {\n tdIndex = 0;\n return <tr style={style}>{children}</tr>;\n};\n\nexport const Td: Components[\"td\"] = ({ children, style }) => {\n return (\n <td data-label={tableHeaders[tdIndex++]} style={style}>\n {children}\n </td>\n );\n};\n\nexport const Th: Components[\"th\"] = ({ children, style }) => {\n tableHeaders.push(children);\n return <th style={style}>{children}</th>;\n};\n", "import { useBookmark, useConfig } from \"@hyperbook/provider\";\nimport { Components } from \"react-markdown\";\n\nexport const makeAnchor = (heading: string) => {\n // If we have a heading, make it lower case\n let anchor = heading.toLowerCase();\n\n // Clean anchor (replace special characters whitespaces).\n // Alternatively, use encodeURIComponent() if you don't care about\n // pretty anchor links\n anchor = anchor.replace(/[^a-zA-Z0-9 ]/g, \"\");\n anchor = anchor.replace(/ /g, \"-\");\n\n return anchor;\n};\n\nexport const Headings: Components[\"h1\"] = ({ level, children }) => {\n const config = useConfig();\n const bookmarksConfig = config?.elements?.bookmarks;\n // Access actual (string) value of heading\n const heading = children?.[0] || \"\";\n\n // If we have a heading, make it lower case\n let anchor = typeof heading === \"string\" ? makeAnchor(heading) : \"\";\n\n const label = typeof heading === \"string\" ? heading : anchor;\n\n const [bookmark, toggleBookmark] = useBookmark(anchor, label);\n\n // Utility\n const container = (children: React.ReactNode): JSX.Element => (\n <>\n <a className=\"heading\" id={anchor} href={`#${anchor}`}>\n <span>{children}</span>\n </a>\n {bookmarksConfig !== false && (\n <button\n className={bookmark ? \"bookmark active\" : \"bookmark\"}\n onClick={() => toggleBookmark()}\n title=\"Bookmark\"\n >\n \uD83D\uDD16\n </button>\n )}\n </>\n );\n\n switch (level) {\n case 1:\n return <h1>{container(children)}</h1>;\n case 2:\n return <h2>{container(children)}</h2>;\n case 3:\n return <h3>{container(children)}</h3>;\n case 4:\n return <h4>{container(children)}</h4>;\n case 5:\n return <h5>{container(children)}</h5>;\n\n default:\n return <h6>{container(children)}</h6>;\n }\n};\n", "import { useMakeUrl } from \"@hyperbook/provider\";\nimport { useState } from \"react\";\nimport { Components } from \"react-markdown\";\n\nexport const Image: Components[\"img\"] = ({ src, title, alt }) => {\n const makeUrl = useMakeUrl();\n const [full, setFull] = useState(false);\n src = makeUrl(src, \"public\");\n\n return (\n <figure\n onClick={() => setFull((f) => !f)}\n className={full ? \"lightbox\" : undefined}\n >\n <img src={src} alt={alt} />\n {title && <figcaption>{title}</figcaption>}\n </figure>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,4BAA0B;AAC1B,8BAA4B;AAC5B,qCAAkC;AAClC,wBAAsB;AACtB,yBAAuB;AACvB,2BAAyB;AACzB,kCAA+B;AAC/B,0BAAwB;AACxB,8BAA4B;AAC5B,IAAAA,mBAA8B;AAC9B,8BAA4B;;;ACV5B,sBAA8B;AAC9B,mBAA2C;AAKvC;AAFJ,IAAM,gBAAgB,MAAM;AAC1B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,QAAO;AAAA,MACP,MAAK;AAAA,MACL,aAAY;AAAA,MACZ,QAAO;AAAA,MACP,OAAM;AAAA,MACN,SAAQ;AAAA,MAER;AAAA,oDAAC,UAAK,GAAE,iBAAgB,MAAK,QAAO;AAAA,QACpC,4CAAC,UAAK,GAAE,mIAAkI;AAAA;AAAA;AAAA,EAC5I;AAEJ;AAEA,IAAM,SAAS,MAAM;AACnB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,QAAO;AAAA,MACP,MAAK;AAAA,MACL,aAAY;AAAA,MACZ,Q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,OAAO,OAAO;AAC5B;AAMO,IAAM,WAAW,CAAC,EAAE,SAAS,MAAqB;AACvD,QAAM,iBAAa,gCAAc;AAEjC,SACE;AAAA,IAAC,sBAAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,YAAY,iCACP,aADO;AAAA,QAEV,GAAG;AAAA,QACH,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,KAAK;AAAA,MACP;AAAA,MACA,eAAe;AAAA,QACb;AAAA,QACA,wBAAAC;AAAA,QACA,+BAAAC;AAAA,QACA,kBAAAC;AAAA,QACA,mBAAAC;AAAA,QACA,qBAAAC;AAAA,QACA,4BAAAC;AAAA,MACF;AAAA,MACA,eAAe;AAAA,QACb,oBAAAC;AAAA,QACA,CAAC,wBAAAC,SAAiB,EAAE,eAAe,MAAM,WAAW,CAAC,SAAS,EAAE,CAAC;AAAA,MACnE;AAAA,MACA,UAAU;AAAA,MAET;AAAA;AAAA,EACH;AAEJ;",
|
|
6
6
|
"names": ["import_provider", "import_provider", "import_jsx_runtime", "import_jsx_runtime", "import_provider", "import_jsx_runtime", "children", "import_provider", "import_react", "import_jsx_runtime", "import_jsx_runtime", "ReactMarkdown", "remarkDirective", "remarkDirectiveRehype", "remarkGfm", "remarkMath", "remarkGemoji", "remarkUnwrapImages", "rehypeKatex", "rehypeHighlight"]
|
|
7
7
|
}
|
package/dist/index.css
CHANGED
|
@@ -102,6 +102,18 @@
|
|
|
102
102
|
padding: 0.2em 0.4em;
|
|
103
103
|
border-radius: 6px;
|
|
104
104
|
}
|
|
105
|
+
.hyperbook-markdown .inline {
|
|
106
|
+
display: inline-flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
color: var(--color-text);
|
|
109
|
+
border-width: 1px;
|
|
110
|
+
border-style: solid;
|
|
111
|
+
background: var(--color-nav) !important;
|
|
112
|
+
border-color: var(--color-spacer);
|
|
113
|
+
font-family: hyperbook-code, monospace;
|
|
114
|
+
padding: 0em 0.4em 0em 0em;
|
|
115
|
+
border-radius: 6px;
|
|
116
|
+
}
|
|
105
117
|
.hyperbook-markdown ul,
|
|
106
118
|
.hyperbook-markdown ol {
|
|
107
119
|
margin-top: 0;
|
|
@@ -306,7 +318,7 @@
|
|
|
306
318
|
overflow-x: auto;
|
|
307
319
|
padding: 1em;
|
|
308
320
|
}
|
|
309
|
-
.hyperbook-markdown code {
|
|
321
|
+
.hyperbook-markdown pre code {
|
|
310
322
|
display: inline-flex;
|
|
311
323
|
align-items: center;
|
|
312
324
|
color: var(--color-text);
|
package/dist/index.css.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.css"],
|
|
4
|
-
"sourcesContent": [".hyperbook-markdown {\n background: var(--color-background);\n color: var(--color-text);\n font-family: hyperbook-body, sans-serif;\n}\n\n.hyperbook-markdown a {\n color: var(--color-brand);\n}\n\n/**\n * IE 8\u201311 and Prince don\u2019t recognize the `wbr` element,\n * but a pseudo-element can achieve the same effect with IE 9+ and Prince.\n */\n.hyperbook-markdown wbr:before {\n /* Unicode zero width space */\n content: \"\\200B\";\n white-space: normal;\n}\n\n.hyperbook-markdown .copy {\n color: var(--color-text);\n}\n\n.hyperbook-markdown .hljs {\n background: var(--color-nav) !important;\n border-color: var(--color-spacer);\n}\n\n.hyperbook-markdown p > code {\n background: var(--color-nav) !important;\n border-color: var(--color-spacer);\n}\n\n.hyperbook-markdown img {\n max-width: 100%;\n}\n\n.hyperbook-markdown figure.lightbox {\n position: fixed;\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n padding: 1em;\n z-index: 10000;\n margin: 0px;\n cursor: zoom-out;\n background: rgba(0, 0, 0, 0.5);\n}\n\n.hyperbook-markdown figure.lightbox img {\n min-width: 100%;\n min-height: 100%;\n object-fit: contain;\n}\n\n.hyperbook-markdown table {\n border-color: var(--color-spacer);\n}\n\n.hyperbook-markdown table tr {\n background-color: var(--color-nav);\n border-color: var(--color-spacer);\n}\n\n.hyperbook-markdown h2 {\n border-bottom-color: var(--color-spacer);\n}\n\n.hyperbook-markdown ul.bookmarks li {\n border-color: var(--color-spacer);\n}\n\n.hyperbook-markdown ul.bookmarks li:hover {\n background: var(--color-nav);\n}\n\n.hyperbook-markdown ul.bookmarks li:last-of-type {\n border-color: var(--color-spacer);\n}\n\n@media screen and (max-width: 600px) {\n .hyperbook-markdown table td {\n border-bottom-color: var(--color-spacer);\n }\n}\n\n.hyperbook-markdown figure {\n text-align: center;\n margin-top: 10px;\n margin-bottom: 10px;\n cursor: zoom-in;\n}\n\n.hyperbook-markdown figcaption {\n font-style: italic;\n font-size: 14px;\n max-width: 400px;\n margin: 0 auto;\n}\n\n.hyperbook-markdown a.heading {\n position: relative;\n text-decoration: none;\n padding-left: 16px;\n margin-left: -16px;\n}\n\n.hyperbook-markdown a.heading:hover::before {\n position: absolute;\n content: \"\uD83D\uDCCE\";\n font-size: 12px;\n top: 50%;\n transform: translateY(-50%);\n left: 0px;\n}\n\n.hyperbook-markdown code {\n font-family: hyperbook-code, monospace;\n font-size: 85%;\n padding: 0.2em 0.4em;\n border-radius: 6px;\n}\n\n.hyperbook-markdown ul,\n.hyperbook-markdown ol {\n margin-top: 0;\n margin-bottom: 0;\n padding-left: 2em;\n}\n\n.hyperbook-markdown ol ol,\n.hyperbook-markdown ul ol {\n list-style-type: lower-roman;\n}\n\n.hyperbook-markdown ul ul ol,\n.hyperbook-markdown ul ol ol,\n.hyperbook-markdown ol ul ol,\n.hyperbook-markdown ol ol ol {\n list-style-type: lower-alpha;\n}\n\n.hyperbook-markdown ul ul,\n.hyperbook-markdown ul ol,\n.hyperbook-markdown ol ol,\n.hyperbook-markdown ol ul {\n margin-top: 0;\n margin-bottom: 0;\n}\n\n.hyperbook-markdown li + li {\n margin-top: 0.25em;\n}\n\n.hyperbook-markdown li > p {\n margin-top: 16px;\n}\n\n.hyperbook-markdown p,\n.hyperbook-markdown blockquote,\n.hyperbook-markdown ol,\n.hyperbook-markdown ul,\n.hyperbook-markdown table,\n.hyperbook-markdown pre,\n.hyperbook-markdown details {\n margin-top: 0;\n margin-bottom: 10px;\n}\n\n.hyperbook-markdown blockquote {\n width: 90%;\n margin: 20px auto;\n font-style: italic;\n padding: 1.2em 30px 1.2em 75px;\n border-left: 8px solid var(--color-brand);\n line-height: 1.5;\n position: relative;\n background: var(--color-nav);\n}\n\n.hyperbook-markdown blockquote::before {\n content: \"\\201C\";\n color: var(--color-brand);\n font-size: 4em;\n position: absolute;\n left: 10px;\n top: -10px;\n}\n\n.hyperbook-markdown blockquote::after {\n content: \"\";\n}\n\n.hyperbook-markdown table {\n border-width: 1px;\n border-style: solid;\n border-collapse: collapse;\n width: 100%;\n table-layout: fixed;\n}\n\n.hyperbook-markdown table caption {\n font-size: 1.5em;\n margin: 0.5em 0 0.75em;\n}\n\n.hyperbook-markdown table tr {\n border-width: 1px;\n border-style: solid;\n padding: 0.35em;\n}\n\n.hyperbook-markdown table th,\n.hyperbook-markdown table td {\n padding: 0.625em;\n}\n\n.hyperbook-markdown table th {\n font-size: 0.85em;\n letter-spacing: 0.1em;\n text-transform: uppercase;\n}\n\n@media screen and (max-width: 600px) {\n .hyperbook-markdown table {\n border: 0;\n }\n\n .hyperbook-markdown table caption {\n font-size: 1.3em;\n }\n\n .hyperbook-markdown table thead {\n border: none;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n }\n\n .hyperbook-markdown table tr {\n border-bottom-width: 3px;\n display: block;\n margin-bottom: 0.625em;\n }\n\n .hyperbook-markdown table td {\n border-bottom-width: 1px;\n border-bottom-style: solid;\n display: block;\n font-size: 0.8em;\n text-align: right;\n }\n\n .hyperbook-markdown table td::before {\n /*\n * aria-label has no advantage, it won't be read inside a table\n content: attr(aria-label);\n */\n content: attr(data-label);\n float: left;\n font-weight: bold;\n text-transform: uppercase;\n margin-right: 8px;\n }\n\n .hyperbook-markdown table td:last-child {\n border-bottom: 0;\n }\n}\n\n.hyperbook-markdown h1,\n.hyperbook-markdown h2,\n.hyperbook-markdown h3,\n.hyperbook-markdown h4,\n.hyperbook-markdown h5,\n.hyperbook-markdown h6 {\n font-family: hyperbook-heading, sans-serif;\n margin-top: 24px;\n margin-bottom: 16px;\n font-weight: 600;\n line-height: 1.25;\n}\n\n.hyperbook-markdown h1 {\n font-size: 1.75em;\n font-weight: 700;\n}\n\n.hyperbook-markdown h2 {\n font-weight: 600;\n padding-bottom: 0.3em;\n font-size: 1.5em;\n border-bottom-width: 1px;\n border-bottom-style: solid;\n}\n\n.hyperbook-markdown h3 {\n font-weight: 600;\n font-size: 1.25em;\n}\n\n.hyperbook-markdown h4 {\n font-weight: 600;\n font-size: 1em;\n}\n\n.hyperbook-markdown h5 {\n font-weight: 600;\n font-size: 0.875em;\n}\n\n.hyperbook-markdown h6 {\n font-weight: 600;\n font-size: 0.85em;\n}\n\n.hyperbook-markdown p {\n margin-top: 0;\n margin-bottom: 10px;\n}\n\n.hyperbook-markdown h1,\n.hyperbook-markdown h2,\n.hyperbook-markdown h3,\n.hyperbook-markdown h4,\n.hyperbook-markdown h5,\n.hyperbook-markdown h6 {\n display: flex;\n align-items: center;\n}\n\n.hyperbook-markdown .bookmark {\n margin-left: 10px;\n background: none;\n border: none;\n opacity: 0.5;\n font-size: 16px;\n}\n\n.hyperbook-markdown .bookmark:hover {\n opacity: 1;\n}\n\n.hyperbook-markdown .bookmark.active {\n opacity: 1;\n}\n\n.hyperbook-markdown ul.bookmarks {\n padding-left: 0;\n}\n\n.hyperbook-markdown ul.bookmarks li {\n list-style-type: none;\n}\n\n.hyperbook-markdown pre {\n position: relative;\n}\n\n.hyperbook-markdown pre code.hljs {\n display: block;\n overflow-x: auto;\n padding: 1em;\n}\n\n.hyperbook-markdown code {\n display: inline-flex;\n align-items: center;\n color: var(--color-text);\n border-width: 1px;\n border-style: solid;\n}\n\n.hyperbook-markdown button.copy {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n margin-left: 4px;\n background: var(--color-nav);\n border: none;\n padding: 0;\n border-radius: 4px;\n opacity: 0.9;\n}\n\n.hyperbook-markdown button.copy:hover {\n opacity: 1;\n}\n\n.hyperbook-markdown pre > button.copy {\n position: absolute;\n right: 10px;\n top: 10px;\n}\n\n/*!\n Theme: GitHub\n Description: Light theme as seen on github.com\n Author: github.com\n Maintainer: @Hirse\n Updated: 2021-05-15\n\n Outdated base version: https://github.com/primer/github-syntax-light\n Current colors taken from GitHub's CSS\n*/\n\n.hljs {\n color: #24292e;\n background: #ffffff;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-meta .hljs-keyword,\n.hljs-template-tag,\n.hljs-template-variable,\n.hljs-type,\n.hljs-variable.language_ {\n /* prettylights-syntax-keyword */\n color: #d73a49;\n}\n\n.hljs-title,\n.hljs-title.class_,\n.hljs-title.class_.inherited__,\n.hljs-title.function_ {\n /* prettylights-syntax-entity */\n color: #6f42c1;\n}\n\n.hljs-attr,\n.hljs-attribute,\n.hljs-literal,\n.hljs-meta,\n.hljs-number,\n.hljs-operator,\n.hljs-variable,\n.hljs-selector-attr,\n.hljs-selector-class,\n.hljs-selector-id {\n /* prettylights-syntax-constant */\n color: #005cc5;\n}\n\n.hljs-regexp,\n.hljs-string,\n.hljs-meta .hljs-string {\n /* prettylights-syntax-string */\n color: #032f62;\n}\n\n.hljs-built_in,\n.hljs-symbol {\n /* prettylights-syntax-variable */\n color: #e36209;\n}\n\n.hljs-comment,\n.hljs-code,\n.hljs-formula {\n /* prettylights-syntax-comment */\n color: #6a737d;\n}\n\n.hljs-name,\n.hljs-quote,\n.hljs-selector-tag,\n.hljs-selector-pseudo {\n /* prettylights-syntax-entity-tag */\n color: #22863a;\n}\n\n.hljs-subst {\n /* prettylights-syntax-storage-modifier-import */\n color: #24292e;\n}\n\n.hljs-section {\n /* prettylights-syntax-markup-heading */\n color: #005cc5;\n font-weight: bold;\n}\n\n.hljs-bullet {\n /* prettylights-syntax-markup-list */\n color: #735c0f;\n}\n\n.hljs-emphasis {\n /* prettylights-syntax-markup-italic */\n color: #24292e;\n font-style: italic;\n}\n\n.hljs-strong {\n /* prettylights-syntax-markup-bold */\n color: #24292e;\n font-weight: bold;\n}\n\n.hljs-addition {\n /* prettylights-syntax-markup-inserted */\n color: #22863a;\n background-color: #f0fff4;\n}\n\n.hljs-deletion {\n /* prettylights-syntax-markup-deleted */\n color: #b31d28;\n background-color: #ffeef0;\n}\n\n.hljs-char.escape_,\n.hljs-link,\n.hljs-params,\n.hljs-property,\n.hljs-punctuation,\n.hljs-tag {\n /* purposely ignored */\n}\n\n/*!\n Theme: GitHub Dark\n Description: Dark theme as seen on github.com\n Author: github.com\n Maintainer: @Hirse\n Updated: 2021-05-15\n\n Outdated base version: https://github.com/primer/github-syntax-dark\n Current colors taken from GitHub's CSS\n*/\n\n@media (prefers-color-scheme: dark) {\n .hljs {\n color: #c9d1d9;\n background: #0d1117;\n }\n\n .hljs-doctag,\n .hljs-keyword,\n .hljs-meta .hljs-keyword,\n .hljs-template-tag,\n .hljs-template-variable,\n .hljs-type,\n .hljs-variable.language_ {\n /* prettylights-syntax-keyword */\n color: #ff7b72;\n }\n\n .hljs-title,\n .hljs-title.class_,\n .hljs-title.class_.inherited__,\n .hljs-title.function_ {\n /* prettylights-syntax-entity */\n color: #d2a8ff;\n }\n\n .hljs-attr,\n .hljs-attribute,\n .hljs-literal,\n .hljs-meta,\n .hljs-number,\n .hljs-operator,\n .hljs-variable,\n .hljs-selector-attr,\n .hljs-selector-class,\n .hljs-selector-id {\n /* prettylights-syntax-constant */\n color: #79c0ff;\n }\n\n .hljs-regexp,\n .hljs-string,\n .hljs-meta .hljs-string {\n /* prettylights-syntax-string */\n color: #a5d6ff;\n }\n\n .hljs-built_in,\n .hljs-symbol {\n /* prettylights-syntax-variable */\n color: #ffa657;\n }\n\n .hljs-comment,\n .hljs-code,\n .hljs-formula {\n /* prettylights-syntax-comment */\n color: #8b949e;\n }\n\n .hljs-name,\n .hljs-quote,\n .hljs-selector-tag,\n .hljs-selector-pseudo {\n /* prettylights-syntax-entity-tag */\n color: #7ee787;\n }\n\n .hljs-subst {\n /* prettylights-syntax-storage-modifier-import */\n color: #c9d1d9;\n }\n\n .hljs-section {\n /* prettylights-syntax-markup-heading */\n color: #1f6feb;\n font-weight: bold;\n }\n\n .hljs-bullet {\n /* prettylights-syntax-markup-list */\n color: #f2cc60;\n }\n\n .hljs-emphasis {\n /* prettylights-syntax-markup-italic */\n color: #c9d1d9;\n font-style: italic;\n }\n\n .hljs-strong {\n /* prettylights-syntax-markup-bold */\n color: #c9d1d9;\n font-weight: bold;\n }\n\n .hljs-addition {\n /* prettylights-syntax-markup-inserted */\n color: #aff5b4;\n background-color: #033a16;\n }\n\n .hljs-deletion {\n /* prettylights-syntax-markup-deleted */\n color: #ffdcd7;\n background-color: #67060c;\n }\n\n .hljs-char.escape_,\n .hljs-link,\n .hljs-params,\n .hljs-property,\n .hljs-punctuation,\n .hljs-tag {\n /* purposely ignored */\n }\n}\n"],
|
|
5
|
-
"mappings": ";AAAA;AACE;AACA;AACA;AAAA;AAGF;AACE;AAAA;AAOF;AAEE;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACE;AAAA;AAAA;AAIJ;AACE;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AAAA;AAGF;AAAA;AAEE;AACA;AACA;AAAA;AAGF;AAAA;AAEE;AAAA;AAGF;AAAA;AAAA;AAAA;AAIE;AAAA;AAGF;AAAA;AAAA;AAAA;AAIE;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOE;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AACA;AAAA;AAGF;AAAA;AAEE;AAAA;AAGF;AACE;AACA;AACA;AAAA;AAGF;AACE;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AAAA;AAGF;AAKE;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AAAA;AAAA;AAIJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAME;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAME;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AAAA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color-background);\n color: var(--color-text);\n font-family: hyperbook-body, sans-serif;\n}\n\n.hyperbook-markdown a {\n color: var(--color-brand);\n}\n\n/**\n * IE 8\u201311 and Prince don\u2019t recognize the `wbr` element,\n * but a pseudo-element can achieve the same effect with IE 9+ and Prince.\n */\n.hyperbook-markdown wbr:before {\n /* Unicode zero width space */\n content: \"\\200B\";\n white-space: normal;\n}\n\n.hyperbook-markdown .copy {\n color: var(--color-text);\n}\n\n.hyperbook-markdown .hljs {\n background: var(--color-nav) !important;\n border-color: var(--color-spacer);\n}\n\n.hyperbook-markdown p > code {\n background: var(--color-nav) !important;\n border-color: var(--color-spacer);\n}\n\n.hyperbook-markdown img {\n max-width: 100%;\n}\n\n.hyperbook-markdown figure.lightbox {\n position: fixed;\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n padding: 1em;\n z-index: 10000;\n margin: 0px;\n cursor: zoom-out;\n background: rgba(0, 0, 0, 0.5);\n}\n\n.hyperbook-markdown figure.lightbox img {\n min-width: 100%;\n min-height: 100%;\n object-fit: contain;\n}\n\n.hyperbook-markdown table {\n border-color: var(--color-spacer);\n}\n\n.hyperbook-markdown table tr {\n background-color: var(--color-nav);\n border-color: var(--color-spacer);\n}\n\n.hyperbook-markdown h2 {\n border-bottom-color: var(--color-spacer);\n}\n\n.hyperbook-markdown ul.bookmarks li {\n border-color: var(--color-spacer);\n}\n\n.hyperbook-markdown ul.bookmarks li:hover {\n background: var(--color-nav);\n}\n\n.hyperbook-markdown ul.bookmarks li:last-of-type {\n border-color: var(--color-spacer);\n}\n\n@media screen and (max-width: 600px) {\n .hyperbook-markdown table td {\n border-bottom-color: var(--color-spacer);\n }\n}\n\n.hyperbook-markdown figure {\n text-align: center;\n margin-top: 10px;\n margin-bottom: 10px;\n cursor: zoom-in;\n}\n\n.hyperbook-markdown figcaption {\n font-style: italic;\n font-size: 14px;\n max-width: 400px;\n margin: 0 auto;\n}\n\n.hyperbook-markdown a.heading {\n position: relative;\n text-decoration: none;\n padding-left: 16px;\n margin-left: -16px;\n}\n\n.hyperbook-markdown a.heading:hover::before {\n position: absolute;\n content: \"\uD83D\uDCCE\";\n font-size: 12px;\n top: 50%;\n transform: translateY(-50%);\n left: 0px;\n}\n\n.hyperbook-markdown code {\n font-family: hyperbook-code, monospace;\n font-size: 85%;\n padding: 0.2em 0.4em;\n border-radius: 6px;\n}\n\n.hyperbook-markdown .inline {\n display: inline-flex;\n align-items: center;\n color: var(--color-text);\n border-width: 1px;\n border-style: solid;\n background: var(--color-nav) !important;\n border-color: var(--color-spacer);\n font-family: hyperbook-code, monospace;\n padding: 0em 0.4em 0em 0em;\n border-radius: 6px;\n}\n\n.hyperbook-markdown ul,\n.hyperbook-markdown ol {\n margin-top: 0;\n margin-bottom: 0;\n padding-left: 2em;\n}\n\n.hyperbook-markdown ol ol,\n.hyperbook-markdown ul ol {\n list-style-type: lower-roman;\n}\n\n.hyperbook-markdown ul ul ol,\n.hyperbook-markdown ul ol ol,\n.hyperbook-markdown ol ul ol,\n.hyperbook-markdown ol ol ol {\n list-style-type: lower-alpha;\n}\n\n.hyperbook-markdown ul ul,\n.hyperbook-markdown ul ol,\n.hyperbook-markdown ol ol,\n.hyperbook-markdown ol ul {\n margin-top: 0;\n margin-bottom: 0;\n}\n\n.hyperbook-markdown li + li {\n margin-top: 0.25em;\n}\n\n.hyperbook-markdown li > p {\n margin-top: 16px;\n}\n\n.hyperbook-markdown p,\n.hyperbook-markdown blockquote,\n.hyperbook-markdown ol,\n.hyperbook-markdown ul,\n.hyperbook-markdown table,\n.hyperbook-markdown pre,\n.hyperbook-markdown details {\n margin-top: 0;\n margin-bottom: 10px;\n}\n\n.hyperbook-markdown blockquote {\n width: 90%;\n margin: 20px auto;\n font-style: italic;\n padding: 1.2em 30px 1.2em 75px;\n border-left: 8px solid var(--color-brand);\n line-height: 1.5;\n position: relative;\n background: var(--color-nav);\n}\n\n.hyperbook-markdown blockquote::before {\n content: \"\\201C\";\n color: var(--color-brand);\n font-size: 4em;\n position: absolute;\n left: 10px;\n top: -10px;\n}\n\n.hyperbook-markdown blockquote::after {\n content: \"\";\n}\n\n.hyperbook-markdown table {\n border-width: 1px;\n border-style: solid;\n border-collapse: collapse;\n width: 100%;\n table-layout: fixed;\n}\n\n.hyperbook-markdown table caption {\n font-size: 1.5em;\n margin: 0.5em 0 0.75em;\n}\n\n.hyperbook-markdown table tr {\n border-width: 1px;\n border-style: solid;\n padding: 0.35em;\n}\n\n.hyperbook-markdown table th,\n.hyperbook-markdown table td {\n padding: 0.625em;\n}\n\n.hyperbook-markdown table th {\n font-size: 0.85em;\n letter-spacing: 0.1em;\n text-transform: uppercase;\n}\n\n@media screen and (max-width: 600px) {\n .hyperbook-markdown table {\n border: 0;\n }\n\n .hyperbook-markdown table caption {\n font-size: 1.3em;\n }\n\n .hyperbook-markdown table thead {\n border: none;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n }\n\n .hyperbook-markdown table tr {\n border-bottom-width: 3px;\n display: block;\n margin-bottom: 0.625em;\n }\n\n .hyperbook-markdown table td {\n border-bottom-width: 1px;\n border-bottom-style: solid;\n display: block;\n font-size: 0.8em;\n text-align: right;\n }\n\n .hyperbook-markdown table td::before {\n /*\n * aria-label has no advantage, it won't be read inside a table\n content: attr(aria-label);\n */\n content: attr(data-label);\n float: left;\n font-weight: bold;\n text-transform: uppercase;\n margin-right: 8px;\n }\n\n .hyperbook-markdown table td:last-child {\n border-bottom: 0;\n }\n}\n\n.hyperbook-markdown h1,\n.hyperbook-markdown h2,\n.hyperbook-markdown h3,\n.hyperbook-markdown h4,\n.hyperbook-markdown h5,\n.hyperbook-markdown h6 {\n font-family: hyperbook-heading, sans-serif;\n margin-top: 24px;\n margin-bottom: 16px;\n font-weight: 600;\n line-height: 1.25;\n}\n\n.hyperbook-markdown h1 {\n font-size: 1.75em;\n font-weight: 700;\n}\n\n.hyperbook-markdown h2 {\n font-weight: 600;\n padding-bottom: 0.3em;\n font-size: 1.5em;\n border-bottom-width: 1px;\n border-bottom-style: solid;\n}\n\n.hyperbook-markdown h3 {\n font-weight: 600;\n font-size: 1.25em;\n}\n\n.hyperbook-markdown h4 {\n font-weight: 600;\n font-size: 1em;\n}\n\n.hyperbook-markdown h5 {\n font-weight: 600;\n font-size: 0.875em;\n}\n\n.hyperbook-markdown h6 {\n font-weight: 600;\n font-size: 0.85em;\n}\n\n.hyperbook-markdown p {\n margin-top: 0;\n margin-bottom: 10px;\n}\n\n.hyperbook-markdown h1,\n.hyperbook-markdown h2,\n.hyperbook-markdown h3,\n.hyperbook-markdown h4,\n.hyperbook-markdown h5,\n.hyperbook-markdown h6 {\n display: flex;\n align-items: center;\n}\n\n.hyperbook-markdown .bookmark {\n margin-left: 10px;\n background: none;\n border: none;\n opacity: 0.5;\n font-size: 16px;\n}\n\n.hyperbook-markdown .bookmark:hover {\n opacity: 1;\n}\n\n.hyperbook-markdown .bookmark.active {\n opacity: 1;\n}\n\n.hyperbook-markdown ul.bookmarks {\n padding-left: 0;\n}\n\n.hyperbook-markdown ul.bookmarks li {\n list-style-type: none;\n}\n\n.hyperbook-markdown pre {\n position: relative;\n}\n\n.hyperbook-markdown pre code.hljs {\n display: block;\n overflow-x: auto;\n padding: 1em;\n}\n\n.hyperbook-markdown pre code {\n display: inline-flex;\n align-items: center;\n color: var(--color-text);\n border-width: 1px;\n border-style: solid;\n}\n\n.hyperbook-markdown button.copy {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n margin-left: 4px;\n background: var(--color-nav);\n border: none;\n padding: 0;\n border-radius: 4px;\n opacity: 0.9;\n}\n\n.hyperbook-markdown button.copy:hover {\n opacity: 1;\n}\n\n.hyperbook-markdown pre > button.copy {\n position: absolute;\n right: 10px;\n top: 10px;\n}\n\n/*!\n Theme: GitHub\n Description: Light theme as seen on github.com\n Author: github.com\n Maintainer: @Hirse\n Updated: 2021-05-15\n\n Outdated base version: https://github.com/primer/github-syntax-light\n Current colors taken from GitHub's CSS\n*/\n\n.hljs {\n color: #24292e;\n background: #ffffff;\n}\n\n.hljs-doctag,\n.hljs-keyword,\n.hljs-meta .hljs-keyword,\n.hljs-template-tag,\n.hljs-template-variable,\n.hljs-type,\n.hljs-variable.language_ {\n /* prettylights-syntax-keyword */\n color: #d73a49;\n}\n\n.hljs-title,\n.hljs-title.class_,\n.hljs-title.class_.inherited__,\n.hljs-title.function_ {\n /* prettylights-syntax-entity */\n color: #6f42c1;\n}\n\n.hljs-attr,\n.hljs-attribute,\n.hljs-literal,\n.hljs-meta,\n.hljs-number,\n.hljs-operator,\n.hljs-variable,\n.hljs-selector-attr,\n.hljs-selector-class,\n.hljs-selector-id {\n /* prettylights-syntax-constant */\n color: #005cc5;\n}\n\n.hljs-regexp,\n.hljs-string,\n.hljs-meta .hljs-string {\n /* prettylights-syntax-string */\n color: #032f62;\n}\n\n.hljs-built_in,\n.hljs-symbol {\n /* prettylights-syntax-variable */\n color: #e36209;\n}\n\n.hljs-comment,\n.hljs-code,\n.hljs-formula {\n /* prettylights-syntax-comment */\n color: #6a737d;\n}\n\n.hljs-name,\n.hljs-quote,\n.hljs-selector-tag,\n.hljs-selector-pseudo {\n /* prettylights-syntax-entity-tag */\n color: #22863a;\n}\n\n.hljs-subst {\n /* prettylights-syntax-storage-modifier-import */\n color: #24292e;\n}\n\n.hljs-section {\n /* prettylights-syntax-markup-heading */\n color: #005cc5;\n font-weight: bold;\n}\n\n.hljs-bullet {\n /* prettylights-syntax-markup-list */\n color: #735c0f;\n}\n\n.hljs-emphasis {\n /* prettylights-syntax-markup-italic */\n color: #24292e;\n font-style: italic;\n}\n\n.hljs-strong {\n /* prettylights-syntax-markup-bold */\n color: #24292e;\n font-weight: bold;\n}\n\n.hljs-addition {\n /* prettylights-syntax-markup-inserted */\n color: #22863a;\n background-color: #f0fff4;\n}\n\n.hljs-deletion {\n /* prettylights-syntax-markup-deleted */\n color: #b31d28;\n background-color: #ffeef0;\n}\n\n.hljs-char.escape_,\n.hljs-link,\n.hljs-params,\n.hljs-property,\n.hljs-punctuation,\n.hljs-tag {\n /* purposely ignored */\n}\n\n/*!\n Theme: GitHub Dark\n Description: Dark theme as seen on github.com\n Author: github.com\n Maintainer: @Hirse\n Updated: 2021-05-15\n\n Outdated base version: https://github.com/primer/github-syntax-dark\n Current colors taken from GitHub's CSS\n*/\n\n@media (prefers-color-scheme: dark) {\n .hljs {\n color: #c9d1d9;\n background: #0d1117;\n }\n\n .hljs-doctag,\n .hljs-keyword,\n .hljs-meta .hljs-keyword,\n .hljs-template-tag,\n .hljs-template-variable,\n .hljs-type,\n .hljs-variable.language_ {\n /* prettylights-syntax-keyword */\n color: #ff7b72;\n }\n\n .hljs-title,\n .hljs-title.class_,\n .hljs-title.class_.inherited__,\n .hljs-title.function_ {\n /* prettylights-syntax-entity */\n color: #d2a8ff;\n }\n\n .hljs-attr,\n .hljs-attribute,\n .hljs-literal,\n .hljs-meta,\n .hljs-number,\n .hljs-operator,\n .hljs-variable,\n .hljs-selector-attr,\n .hljs-selector-class,\n .hljs-selector-id {\n /* prettylights-syntax-constant */\n color: #79c0ff;\n }\n\n .hljs-regexp,\n .hljs-string,\n .hljs-meta .hljs-string {\n /* prettylights-syntax-string */\n color: #a5d6ff;\n }\n\n .hljs-built_in,\n .hljs-symbol {\n /* prettylights-syntax-variable */\n color: #ffa657;\n }\n\n .hljs-comment,\n .hljs-code,\n .hljs-formula {\n /* prettylights-syntax-comment */\n color: #8b949e;\n }\n\n .hljs-name,\n .hljs-quote,\n .hljs-selector-tag,\n .hljs-selector-pseudo {\n /* prettylights-syntax-entity-tag */\n color: #7ee787;\n }\n\n .hljs-subst {\n /* prettylights-syntax-storage-modifier-import */\n color: #c9d1d9;\n }\n\n .hljs-section {\n /* prettylights-syntax-markup-heading */\n color: #1f6feb;\n font-weight: bold;\n }\n\n .hljs-bullet {\n /* prettylights-syntax-markup-list */\n color: #f2cc60;\n }\n\n .hljs-emphasis {\n /* prettylights-syntax-markup-italic */\n color: #c9d1d9;\n font-style: italic;\n }\n\n .hljs-strong {\n /* prettylights-syntax-markup-bold */\n color: #c9d1d9;\n font-weight: bold;\n }\n\n .hljs-addition {\n /* prettylights-syntax-markup-inserted */\n color: #aff5b4;\n background-color: #033a16;\n }\n\n .hljs-deletion {\n /* prettylights-syntax-markup-deleted */\n color: #ffdcd7;\n background-color: #67060c;\n }\n\n .hljs-char.escape_,\n .hljs-link,\n .hljs-params,\n .hljs-property,\n .hljs-punctuation,\n .hljs-tag {\n /* purposely ignored */\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAAA;AACE;AACA;AACA;AAAA;AAGF;AACE;AAAA;AAOF;AAEE;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACE;AAAA;AAAA;AAIJ;AACE;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AAAA;AAEE;AACA;AACA;AAAA;AAGF;AAAA;AAEE;AAAA;AAGF;AAAA;AAAA;AAAA;AAIE;AAAA;AAGF;AAAA;AAAA;AAAA;AAIE;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOE;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AACA;AAAA;AAGF;AAAA;AAEE;AAAA;AAGF;AACE;AACA;AACA;AAAA;AAGF;AACE;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AAAA;AAGF;AAKE;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AAAA;AAAA;AAIJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAME;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AACE;AACA;AAAA;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAME;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGF;AACE;AAAA;AAGF;AACE;AACA;AACA;AAAA;AAcF;AACE;AACA;AAAA;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQE;AAAA;AAGF;AAAA;AAAA;AAAA;AAKE;AAAA;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWE;AAAA;AAGF;AAAA;AAAA;AAIE;AAAA;AAGF;AAAA;AAGE;AAAA;AAGF;AAAA;AAAA;AAIE;AAAA;AAGF;AAAA;AAAA;AAAA;AAKE;AAAA;AAGF;AAEE;AAAA;AAGF;AAEE;AACA;AAAA;AAGF;AAEE;AAAA;AAGF;AAEE;AACA;AAAA;AAGF;AAEE;AACA;AAAA;AAGF;AAEE;AACA;AAAA;AAGF;AAEE;AACA;AAAA;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBA;AACE;AACE;AACA;AAAA;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQE;AAAA;AAGF;AAAA;AAAA;AAAA;AAKE;AAAA;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWE;AAAA;AAGF;AAAA;AAAA;AAIE;AAAA;AAGF;AAAA;AAGE;AAAA;AAGF;AAAA;AAAA;AAIE;AAAA;AAGF;AAAA;AAAA;AAAA;AAKE;AAAA;AAGF;AAEE;AAAA;AAGF;AAEE;AACA;AAAA;AAGF;AAEE;AAAA;AAGF;AAEE;AACA;AAAA;AAGF;AAEE;AACA;AAAA;AAGF;AAEE;AACA;AAAA;AAGF;AAEE;AACA;AAAA;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.esm.mjs
CHANGED
|
@@ -36,79 +36,97 @@ import { useDirectives } from "@hyperbook/provider";
|
|
|
36
36
|
import { Fragment, useRef, useState } from "react";
|
|
37
37
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
38
38
|
var MdContentCopy = () => {
|
|
39
|
-
return /* @__PURE__ */ jsxs(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
fill: "none"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
]
|
|
56
|
-
});
|
|
39
|
+
return /* @__PURE__ */ jsxs(
|
|
40
|
+
"svg",
|
|
41
|
+
{
|
|
42
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
43
|
+
stroke: "currentColor",
|
|
44
|
+
fill: "currentColor",
|
|
45
|
+
strokeWidth: "0",
|
|
46
|
+
height: "1em",
|
|
47
|
+
width: "1em",
|
|
48
|
+
viewBox: "0 0 24 24",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsx("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
51
|
+
/* @__PURE__ */ jsx("path", { d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" })
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
);
|
|
57
55
|
};
|
|
58
56
|
var MdDone = () => {
|
|
59
|
-
return /* @__PURE__ */ jsxs(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
fill: "none"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
]
|
|
76
|
-
});
|
|
57
|
+
return /* @__PURE__ */ jsxs(
|
|
58
|
+
"svg",
|
|
59
|
+
{
|
|
60
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
61
|
+
stroke: "currentColor",
|
|
62
|
+
fill: "currentColor",
|
|
63
|
+
strokeWidth: "0",
|
|
64
|
+
height: "1em",
|
|
65
|
+
width: "1em",
|
|
66
|
+
viewBox: "0 0 24 24",
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ jsx("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
69
|
+
/* @__PURE__ */ jsx("path", { d: "M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" })
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
);
|
|
77
73
|
};
|
|
78
|
-
var
|
|
74
|
+
var copyNoNavigator = (text) => {
|
|
75
|
+
const isIos = navigator.userAgent.match(/ipad|iphone/i);
|
|
76
|
+
const textarea = document.createElement("textarea");
|
|
77
|
+
textarea.value = text;
|
|
78
|
+
textarea.style.fontSize = "20px";
|
|
79
|
+
document.body.appendChild(textarea);
|
|
80
|
+
if (isIos) {
|
|
81
|
+
const range = document.createRange();
|
|
82
|
+
range.selectNodeContents(textarea);
|
|
83
|
+
const selection = window.getSelection();
|
|
84
|
+
if (selection) {
|
|
85
|
+
selection.removeAllRanges();
|
|
86
|
+
selection.addRange(range);
|
|
87
|
+
}
|
|
88
|
+
textarea.setSelectionRange(0, 999999);
|
|
89
|
+
} else {
|
|
90
|
+
textarea.select();
|
|
91
|
+
}
|
|
92
|
+
document.execCommand("copy");
|
|
93
|
+
document.body.removeChild(textarea);
|
|
94
|
+
};
|
|
95
|
+
var Code = ({ children, className, inline }) => {
|
|
96
|
+
console.log(inline);
|
|
79
97
|
const directives = useDirectives();
|
|
80
98
|
if (className === "language-mermaid" && directives["mermaid"]) {
|
|
81
99
|
const Mermaid = directives["mermaid"];
|
|
82
|
-
return /* @__PURE__ */ jsx(Mermaid, {
|
|
83
|
-
children
|
|
84
|
-
});
|
|
100
|
+
return /* @__PURE__ */ jsx(Mermaid, { children });
|
|
85
101
|
}
|
|
86
102
|
const ref = useRef(null);
|
|
87
103
|
const [copied, setCopied] = useState(false);
|
|
88
104
|
const copyCode = () => {
|
|
89
|
-
if (
|
|
105
|
+
if (ref.current) {
|
|
90
106
|
const text = ref.current.innerText;
|
|
91
|
-
navigator.clipboard
|
|
107
|
+
if (navigator.clipboard) {
|
|
108
|
+
navigator.clipboard.writeText(text).then(() => {
|
|
109
|
+
setCopied(true);
|
|
110
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
111
|
+
}).catch(() => {
|
|
112
|
+
copyNoNavigator(text);
|
|
113
|
+
setCopied(true);
|
|
114
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
115
|
+
});
|
|
116
|
+
} else {
|
|
117
|
+
copyNoNavigator(text);
|
|
92
118
|
setCopied(true);
|
|
93
119
|
setTimeout(() => setCopied(false), 2e3);
|
|
94
|
-
}
|
|
120
|
+
}
|
|
95
121
|
}
|
|
96
122
|
};
|
|
97
|
-
return /* @__PURE__ */ jsxs(
|
|
98
|
-
children
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
/* @__PURE__ */ jsx("button", {
|
|
105
|
-
className: "copy",
|
|
106
|
-
onPointerDown: copyCode,
|
|
107
|
-
"aria-label": "Copy Code",
|
|
108
|
-
children: copied ? /* @__PURE__ */ jsx(MdDone, {}) : /* @__PURE__ */ jsx(MdContentCopy, {})
|
|
109
|
-
})
|
|
110
|
-
]
|
|
111
|
-
});
|
|
123
|
+
return inline ? /* @__PURE__ */ jsxs("span", { className: "inline", children: [
|
|
124
|
+
/* @__PURE__ */ jsx("code", { ref, className, children }),
|
|
125
|
+
/* @__PURE__ */ jsx("button", { className: "copy", onClick: copyCode, "aria-label": "Copy Code", children: copied ? /* @__PURE__ */ jsx(MdDone, {}) : /* @__PURE__ */ jsx(MdContentCopy, {}) })
|
|
126
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
127
|
+
/* @__PURE__ */ jsx("code", { ref, className, children }),
|
|
128
|
+
/* @__PURE__ */ jsx("button", { className: "copy", onClick: copyCode, "aria-label": "Copy Code", children: copied ? /* @__PURE__ */ jsx(MdDone, {}) : /* @__PURE__ */ jsx(MdContentCopy, {}) })
|
|
129
|
+
] });
|
|
112
130
|
};
|
|
113
131
|
|
|
114
132
|
// src/Link.tsx
|
|
@@ -126,11 +144,7 @@ function formatUrl(url) {
|
|
|
126
144
|
}
|
|
127
145
|
var Link = ({ href, title, children }) => {
|
|
128
146
|
const L = useLink();
|
|
129
|
-
return /* @__PURE__ */ jsx2(L, {
|
|
130
|
-
href,
|
|
131
|
-
title,
|
|
132
|
-
children: formatUrl(children)
|
|
133
|
-
});
|
|
147
|
+
return /* @__PURE__ */ jsx2(L, { href, title, children: formatUrl(children) });
|
|
134
148
|
};
|
|
135
149
|
|
|
136
150
|
// src/Table.tsx
|
|
@@ -139,31 +153,18 @@ var tableHeaders = [];
|
|
|
139
153
|
var tdIndex = 0;
|
|
140
154
|
var Table = ({ children, style }) => {
|
|
141
155
|
tableHeaders = [];
|
|
142
|
-
return /* @__PURE__ */ jsx3("table", {
|
|
143
|
-
style,
|
|
144
|
-
children
|
|
145
|
-
});
|
|
156
|
+
return /* @__PURE__ */ jsx3("table", { style, children });
|
|
146
157
|
};
|
|
147
158
|
var Tr = ({ children, style }) => {
|
|
148
159
|
tdIndex = 0;
|
|
149
|
-
return /* @__PURE__ */ jsx3("tr", {
|
|
150
|
-
style,
|
|
151
|
-
children
|
|
152
|
-
});
|
|
160
|
+
return /* @__PURE__ */ jsx3("tr", { style, children });
|
|
153
161
|
};
|
|
154
162
|
var Td = ({ children, style }) => {
|
|
155
|
-
return /* @__PURE__ */ jsx3("td", {
|
|
156
|
-
"data-label": tableHeaders[tdIndex++],
|
|
157
|
-
style,
|
|
158
|
-
children
|
|
159
|
-
});
|
|
163
|
+
return /* @__PURE__ */ jsx3("td", { "data-label": tableHeaders[tdIndex++], style, children });
|
|
160
164
|
};
|
|
161
165
|
var Th = ({ children, style }) => {
|
|
162
166
|
tableHeaders.push(children);
|
|
163
|
-
return /* @__PURE__ */ jsx3("th", {
|
|
164
|
-
style,
|
|
165
|
-
children
|
|
166
|
-
});
|
|
167
|
+
return /* @__PURE__ */ jsx3("th", { style, children });
|
|
167
168
|
};
|
|
168
169
|
|
|
169
170
|
// src/Headings.tsx
|
|
@@ -183,49 +184,31 @@ var Headings = ({ level, children }) => {
|
|
|
183
184
|
let anchor = typeof heading === "string" ? makeAnchor(heading) : "";
|
|
184
185
|
const label = typeof heading === "string" ? heading : anchor;
|
|
185
186
|
const [bookmark, toggleBookmark] = useBookmark(anchor, label);
|
|
186
|
-
const container = (children2) => /* @__PURE__ */ jsxs2(Fragment2, {
|
|
187
|
-
children:
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
href: `#${anchor}`,
|
|
192
|
-
children: /* @__PURE__ */ jsx4("span", {
|
|
193
|
-
children: children2
|
|
194
|
-
})
|
|
195
|
-
}),
|
|
196
|
-
bookmarksConfig !== false && /* @__PURE__ */ jsx4("button", {
|
|
187
|
+
const container = (children2) => /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
188
|
+
/* @__PURE__ */ jsx4("a", { className: "heading", id: anchor, href: `#${anchor}`, children: /* @__PURE__ */ jsx4("span", { children: children2 }) }),
|
|
189
|
+
bookmarksConfig !== false && /* @__PURE__ */ jsx4(
|
|
190
|
+
"button",
|
|
191
|
+
{
|
|
197
192
|
className: bookmark ? "bookmark active" : "bookmark",
|
|
198
193
|
onClick: () => toggleBookmark(),
|
|
199
194
|
title: "Bookmark",
|
|
200
195
|
children: "\u{1F516}"
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
});
|
|
196
|
+
}
|
|
197
|
+
)
|
|
198
|
+
] });
|
|
204
199
|
switch (level) {
|
|
205
200
|
case 1:
|
|
206
|
-
return /* @__PURE__ */ jsx4("h1", {
|
|
207
|
-
children: container(children)
|
|
208
|
-
});
|
|
201
|
+
return /* @__PURE__ */ jsx4("h1", { children: container(children) });
|
|
209
202
|
case 2:
|
|
210
|
-
return /* @__PURE__ */ jsx4("h2", {
|
|
211
|
-
children: container(children)
|
|
212
|
-
});
|
|
203
|
+
return /* @__PURE__ */ jsx4("h2", { children: container(children) });
|
|
213
204
|
case 3:
|
|
214
|
-
return /* @__PURE__ */ jsx4("h3", {
|
|
215
|
-
children: container(children)
|
|
216
|
-
});
|
|
205
|
+
return /* @__PURE__ */ jsx4("h3", { children: container(children) });
|
|
217
206
|
case 4:
|
|
218
|
-
return /* @__PURE__ */ jsx4("h4", {
|
|
219
|
-
children: container(children)
|
|
220
|
-
});
|
|
207
|
+
return /* @__PURE__ */ jsx4("h4", { children: container(children) });
|
|
221
208
|
case 5:
|
|
222
|
-
return /* @__PURE__ */ jsx4("h5", {
|
|
223
|
-
children: container(children)
|
|
224
|
-
});
|
|
209
|
+
return /* @__PURE__ */ jsx4("h5", { children: container(children) });
|
|
225
210
|
default:
|
|
226
|
-
return /* @__PURE__ */ jsx4("h6", {
|
|
227
|
-
children: container(children)
|
|
228
|
-
});
|
|
211
|
+
return /* @__PURE__ */ jsx4("h6", { children: container(children) });
|
|
229
212
|
}
|
|
230
213
|
};
|
|
231
214
|
|
|
@@ -237,19 +220,17 @@ var Image = ({ src, title, alt }) => {
|
|
|
237
220
|
const makeUrl = useMakeUrl();
|
|
238
221
|
const [full, setFull] = useState2(false);
|
|
239
222
|
src = makeUrl(src, "public");
|
|
240
|
-
return /* @__PURE__ */ jsxs3(
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
alt
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
]
|
|
252
|
-
});
|
|
223
|
+
return /* @__PURE__ */ jsxs3(
|
|
224
|
+
"figure",
|
|
225
|
+
{
|
|
226
|
+
onClick: () => setFull((f) => !f),
|
|
227
|
+
className: full ? "lightbox" : void 0,
|
|
228
|
+
children: [
|
|
229
|
+
/* @__PURE__ */ jsx5("img", { src, alt }),
|
|
230
|
+
title && /* @__PURE__ */ jsx5("figcaption", { children: title })
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
);
|
|
253
234
|
};
|
|
254
235
|
|
|
255
236
|
// src/Markdown.tsx
|
|
@@ -268,39 +249,42 @@ var remarkRemoveComments = () => (tree) => {
|
|
|
268
249
|
};
|
|
269
250
|
var Markdown = ({ children }) => {
|
|
270
251
|
const directives = useDirectives2();
|
|
271
|
-
return /* @__PURE__ */ jsx6(
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
252
|
+
return /* @__PURE__ */ jsx6(
|
|
253
|
+
ReactMarkdown,
|
|
254
|
+
{
|
|
255
|
+
className: "hyperbook-markdown",
|
|
256
|
+
components: __spreadProps(__spreadValues({}, directives), {
|
|
257
|
+
a: Link,
|
|
258
|
+
code: Code,
|
|
259
|
+
td: Td,
|
|
260
|
+
th: Th,
|
|
261
|
+
table: Table,
|
|
262
|
+
tr: Tr,
|
|
263
|
+
h1: Headings,
|
|
264
|
+
h2: Headings,
|
|
265
|
+
h3: Headings,
|
|
266
|
+
h4: Headings,
|
|
267
|
+
h5: Headings,
|
|
268
|
+
h6: Headings,
|
|
269
|
+
img: Image
|
|
270
|
+
}),
|
|
271
|
+
remarkPlugins: [
|
|
272
|
+
remarkRemoveComments,
|
|
273
|
+
remarkDirective,
|
|
274
|
+
remarkDirectiveRehype,
|
|
275
|
+
remarkGfm,
|
|
276
|
+
remarkMath,
|
|
277
|
+
remarkGemoji,
|
|
278
|
+
remarkUnwrapImages
|
|
279
|
+
],
|
|
280
|
+
rehypePlugins: [
|
|
281
|
+
rehypeKatex,
|
|
282
|
+
[rehypeHighlight, { ignoreMissing: true, plainText: ["mermaid"] }]
|
|
283
|
+
],
|
|
284
|
+
skipHtml: false,
|
|
285
|
+
children
|
|
286
|
+
}
|
|
287
|
+
);
|
|
304
288
|
};
|
|
305
289
|
export {
|
|
306
290
|
Markdown
|
package/dist/index.esm.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/Markdown.tsx", "../src/Code.tsx", "../src/Link.tsx", "../src/Table.tsx", "../src/Headings.tsx", "../src/Image.tsx"],
|
|
4
|
-
"sourcesContent": ["import ReactMarkdown from \"react-markdown\";\nimport remarkDirective from \"remark-directive\";\nimport remarkDirectiveRehype from \"remark-directive-rehype\";\nimport remarkGfm from \"remark-gfm\";\nimport remarkMath from \"remark-math\";\nimport remarkGemoji from \"remark-gemoji\";\nimport remarkUnwrapImages from \"remark-unwrap-images\";\nimport rehypeKatex from \"rehype-katex\";\nimport rehypeHighlight from \"rehype-highlight\";\nimport { useDirectives } from \"@hyperbook/provider\";\nimport { visit, SKIP } from \"unist-util-visit\";\nimport { Code } from \"./Code\";\nimport { Link } from \"./Link\";\nimport { Table, Td, Th, Tr } from \"./Table\";\nimport { Headings } from \"./Headings\";\nimport { Image } from \"./Image\";\n\nimport \"./index.css\";\nimport { Transformer } from \"unified\";\nimport { BuildVisitor } from \"unist-util-visit/complex-types\";\n\nconst remarkRemoveComments: () => Transformer = () => (tree) => {\n const htmlCommentRegex = /<!--([\\s\\S]*?)-->/g;\n\n const handler: BuildVisitor = (node, index, parent) => {\n const isComment = node.value.match(htmlCommentRegex);\n\n if (isComment) {\n // remove node\n parent.children.splice(index, 1);\n // Do not traverse `node`, continue at the node *now* at `index`. http://unifiedjs.com/learn/recipe/remove-node/\n return [SKIP, index];\n }\n };\n\n visit(tree, \"html\", handler);\n\n visit(tree, \"jsx\", handler);\n};\n\nexport type MarkdownProps = {\n children: string;\n};\n\nexport const Markdown = ({ children }: MarkdownProps) => {\n const directives = useDirectives();\n\n return (\n <ReactMarkdown\n className=\"hyperbook-markdown\"\n components={{\n ...directives,\n a: Link,\n code: Code,\n td: Td,\n th: Th,\n table: Table,\n tr: Tr,\n h1: Headings,\n h2: Headings,\n h3: Headings,\n h4: Headings,\n h5: Headings,\n h6: Headings,\n img: Image,\n }}\n remarkPlugins={[\n remarkRemoveComments,\n remarkDirective,\n remarkDirectiveRehype,\n remarkGfm,\n remarkMath,\n remarkGemoji,\n remarkUnwrapImages,\n ]}\n rehypePlugins={[\n rehypeKatex,\n [rehypeHighlight, { ignoreMissing: true, plainText: [\"mermaid\"] }],\n ]}\n skipHtml={false}\n >\n {children}\n </ReactMarkdown>\n );\n};\n", "import { useDirectives } from \"@hyperbook/provider\";\nimport { Fragment, useRef, useState } from \"react\";\nimport { Components } from \"react-markdown\";\n\nconst MdContentCopy = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n height=\"1em\"\n width=\"1em\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z\" />\n </svg>\n );\n};\n\nconst MdDone = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n height=\"1em\"\n width=\"1em\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z\" />\n </svg>\n );\n};\n\nexport const Code: Components[\"code\"] = ({ children, className }) => {\n const directives = useDirectives();\n if (className === \"language-mermaid\" && directives[\"mermaid\"]) {\n const Mermaid = directives[\"mermaid\"];\n return <Mermaid children={children} />;\n }\n\n const ref = useRef<HTMLElement>(null);\n const [copied, setCopied] = useState(false);\n const copyCode = () => {\n if (navigator.clipboard && ref.current) {\n const text = ref.current.innerText;\n navigator.clipboard.writeText(text).then(() => {\n setCopied(true);\n\n setTimeout(() => setCopied(false), 2000);\n });\n }\n };\n\n return (\n <Fragment>\n <code ref={ref} className={className}>\n {children}\n </code>\n <button className=\"copy\" onPointerDown={copyCode} aria-label=\"Copy Code\">\n {copied ? <MdDone /> : <MdContentCopy />}\n </button>\n </Fragment>\n );\n};\n", "import { useLink } from \"@hyperbook/provider\";\nimport { ReactNode } from \"react\";\nimport { Components } from \"react-markdown\";\n\n// see: https://css-tricks.com/better-line-breaks-for-long-urls/\nfunction formatUrl(url: ReactNode) {\n if (typeof url !== \"string\") {\n return url;\n }\n // Split the URL into an array to distinguish double slashes from single slashes\n var doubleSlash = url.split(\"//\");\n\n // Format the strings on either side of double slashes separately\n var formatted = doubleSlash\n .map(\n (str) =>\n // Insert a word break opportunity after a colon\n str\n .replace(/(?<after>:)/giu, \"$1<wbr>\")\n // Before a single slash, tilde, period, comma, hyphen, underline, question mark, number sign, or percent symbol\n .replace(/(?<before>[/~.,\\-_?#%])/giu, \"<wbr>$1\")\n // Before and after an equals sign or ampersand\n .replace(/(?<beforeAndAfter>[=&])/giu, \"<wbr>$1<wbr>\")\n // Reconnect the strings with word break opportunities after double slashes\n )\n .join(\"//<wbr>\");\n\n return formatted;\n}\n\nexport const Link: Components[\"a\"] = ({ href, title, children }) => {\n const L = useLink();\n\n return (\n <L href={href} title={title}>\n {formatUrl(children)}\n </L>\n );\n};\n", "import { ReactNode } from \"react\";\nimport { Components } from \"react-markdown\";\n\nlet tableHeaders: ReactNode[][] = [];\nlet tdIndex = 0;\n\nexport const Table: Components[\"table\"] = ({ children, style }) => {\n tableHeaders = [];\n return <table style={style}>{children}</table>;\n};\n\nexport const Tr: Components[\"tr\"] = ({ children, style }) => {\n tdIndex = 0;\n return <tr style={style}>{children}</tr>;\n};\n\nexport const Td: Components[\"td\"] = ({ children, style }) => {\n return (\n <td data-label={tableHeaders[tdIndex++]} style={style}>\n {children}\n </td>\n );\n};\n\nexport const Th: Components[\"th\"] = ({ children, style }) => {\n tableHeaders.push(children);\n return <th style={style}>{children}</th>;\n};\n", "import { useBookmark, useConfig } from \"@hyperbook/provider\";\nimport { Components } from \"react-markdown\";\n\nexport const makeAnchor = (heading: string) => {\n // If we have a heading, make it lower case\n let anchor = heading.toLowerCase();\n\n // Clean anchor (replace special characters whitespaces).\n // Alternatively, use encodeURIComponent() if you don't care about\n // pretty anchor links\n anchor = anchor.replace(/[^a-zA-Z0-9 ]/g, \"\");\n anchor = anchor.replace(/ /g, \"-\");\n\n return anchor;\n};\n\nexport const Headings: Components[\"h1\"] = ({ level, children }) => {\n const config = useConfig();\n const bookmarksConfig = config?.elements?.bookmarks;\n // Access actual (string) value of heading\n const heading = children?.[0] || \"\";\n\n // If we have a heading, make it lower case\n let anchor = typeof heading === \"string\" ? makeAnchor(heading) : \"\";\n\n const label = typeof heading === \"string\" ? heading : anchor;\n\n const [bookmark, toggleBookmark] = useBookmark(anchor, label);\n\n // Utility\n const container = (children: React.ReactNode): JSX.Element => (\n <>\n <a className=\"heading\" id={anchor} href={`#${anchor}`}>\n <span>{children}</span>\n </a>\n {bookmarksConfig !== false && (\n <button\n className={bookmark ? \"bookmark active\" : \"bookmark\"}\n onClick={() => toggleBookmark()}\n title=\"Bookmark\"\n >\n \uD83D\uDD16\n </button>\n )}\n </>\n );\n\n switch (level) {\n case 1:\n return <h1>{container(children)}</h1>;\n case 2:\n return <h2>{container(children)}</h2>;\n case 3:\n return <h3>{container(children)}</h3>;\n case 4:\n return <h4>{container(children)}</h4>;\n case 5:\n return <h5>{container(children)}</h5>;\n\n default:\n return <h6>{container(children)}</h6>;\n }\n};\n", "import { useMakeUrl } from \"@hyperbook/provider\";\nimport { useState } from \"react\";\nimport { Components } from \"react-markdown\";\n\nexport const Image: Components[\"img\"] = ({ src, title, alt }) => {\n const makeUrl = useMakeUrl();\n const [full, setFull] = useState(false);\n src = makeUrl(src, \"public\");\n\n return (\n <figure\n onClick={() => setFull((f) => !f)}\n className={full ? \"lightbox\" : undefined}\n >\n <img src={src} alt={alt} />\n {title && <figcaption>{title}</figcaption>}\n </figure>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,mBAAmB;AAC1B,OAAO,qBAAqB;AAC5B,OAAO,2BAA2B;AAClC,OAAO,eAAe;AACtB,OAAO,gBAAgB;AACvB,OAAO,kBAAkB;AACzB,OAAO,wBAAwB;AAC/B,OAAO,iBAAiB;AACxB,OAAO,qBAAqB;AAC5B,SAAS,iBAAAA,sBAAqB;AAC9B,SAAS,OAAO,YAAY;;;ACV5B,SAAS,qBAAqB;AAC9B,SAAS,UAAU,QAAQ,gBAAgB;AAKvC,SASE,KATF;AAFJ,IAAM,gBAAgB,MAAM;AAC1B,SACE,
|
|
4
|
+
"sourcesContent": ["import ReactMarkdown from \"react-markdown\";\nimport remarkDirective from \"remark-directive\";\nimport remarkDirectiveRehype from \"remark-directive-rehype\";\nimport remarkGfm from \"remark-gfm\";\nimport remarkMath from \"remark-math\";\nimport remarkGemoji from \"remark-gemoji\";\nimport remarkUnwrapImages from \"remark-unwrap-images\";\nimport rehypeKatex from \"rehype-katex\";\nimport rehypeHighlight from \"rehype-highlight\";\nimport { useDirectives } from \"@hyperbook/provider\";\nimport { visit, SKIP } from \"unist-util-visit\";\nimport { Code } from \"./Code\";\nimport { Link } from \"./Link\";\nimport { Table, Td, Th, Tr } from \"./Table\";\nimport { Headings } from \"./Headings\";\nimport { Image } from \"./Image\";\n\nimport \"./index.css\";\nimport { Transformer } from \"unified\";\nimport { BuildVisitor } from \"unist-util-visit/complex-types\";\n\nconst remarkRemoveComments: () => Transformer = () => (tree) => {\n const htmlCommentRegex = /<!--([\\s\\S]*?)-->/g;\n\n const handler: BuildVisitor = (node, index, parent) => {\n const isComment = node.value.match(htmlCommentRegex);\n\n if (isComment) {\n // remove node\n parent.children.splice(index, 1);\n // Do not traverse `node`, continue at the node *now* at `index`. http://unifiedjs.com/learn/recipe/remove-node/\n return [SKIP, index];\n }\n };\n\n visit(tree, \"html\", handler);\n\n visit(tree, \"jsx\", handler);\n};\n\nexport type MarkdownProps = {\n children: string;\n};\n\nexport const Markdown = ({ children }: MarkdownProps) => {\n const directives = useDirectives();\n\n return (\n <ReactMarkdown\n className=\"hyperbook-markdown\"\n components={{\n ...directives,\n a: Link,\n code: Code,\n td: Td,\n th: Th,\n table: Table,\n tr: Tr,\n h1: Headings,\n h2: Headings,\n h3: Headings,\n h4: Headings,\n h5: Headings,\n h6: Headings,\n img: Image,\n }}\n remarkPlugins={[\n remarkRemoveComments,\n remarkDirective,\n remarkDirectiveRehype,\n remarkGfm,\n remarkMath,\n remarkGemoji,\n remarkUnwrapImages,\n ]}\n rehypePlugins={[\n rehypeKatex,\n [rehypeHighlight, { ignoreMissing: true, plainText: [\"mermaid\"] }],\n ]}\n skipHtml={false}\n >\n {children}\n </ReactMarkdown>\n );\n};\n", "import { useDirectives } from \"@hyperbook/provider\";\nimport { Fragment, useRef, useState } from \"react\";\nimport { Components } from \"react-markdown\";\n\nconst MdContentCopy = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n height=\"1em\"\n width=\"1em\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z\" />\n </svg>\n );\n};\n\nconst MdDone = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n strokeWidth=\"0\"\n height=\"1em\"\n width=\"1em\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z\" />\n </svg>\n );\n};\n\nconst copyNoNavigator = (text: string) => {\n const isIos = navigator.userAgent.match(/ipad|iphone/i);\n const textarea = document.createElement(\"textarea\");\n\n // create textarea\n textarea.value = text;\n\n // ios will zoom in on the input if the font-size is < 16px\n textarea.style.fontSize = \"20px\";\n document.body.appendChild(textarea);\n\n // select text\n if (isIos) {\n const range = document.createRange();\n range.selectNodeContents(textarea);\n\n const selection = window.getSelection();\n if (selection) {\n selection.removeAllRanges();\n selection.addRange(range);\n }\n textarea.setSelectionRange(0, 999999);\n } else {\n textarea.select();\n }\n\n // copy selection\n document.execCommand(\"copy\");\n\n // cleanup\n document.body.removeChild(textarea);\n};\n\nexport const Code: Components[\"code\"] = ({ children, className, inline }) => {\n console.log(inline);\n const directives = useDirectives();\n if (className === \"language-mermaid\" && directives[\"mermaid\"]) {\n const Mermaid = directives[\"mermaid\"];\n return <Mermaid children={children} />;\n }\n\n const ref = useRef<HTMLElement>(null);\n const [copied, setCopied] = useState(false);\n const copyCode = () => {\n if (ref.current) {\n const text = ref.current.innerText;\n if (navigator.clipboard) {\n navigator.clipboard\n .writeText(text)\n .then(() => {\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n })\n .catch(() => {\n copyNoNavigator(text);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n });\n } else {\n copyNoNavigator(text);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n }\n }\n };\n\n return inline ? (\n <span className=\"inline\">\n <code ref={ref} className={className}>\n {children}\n </code>\n <button className=\"copy\" onClick={copyCode} aria-label=\"Copy Code\">\n {copied ? <MdDone /> : <MdContentCopy />}\n </button>\n </span>\n ) : (\n <Fragment>\n <code ref={ref} className={className}>\n {children}\n </code>\n <button className=\"copy\" onClick={copyCode} aria-label=\"Copy Code\">\n {copied ? <MdDone /> : <MdContentCopy />}\n </button>\n </Fragment>\n );\n};\n", "import { useLink } from \"@hyperbook/provider\";\nimport { ReactNode } from \"react\";\nimport { Components } from \"react-markdown\";\n\n// see: https://css-tricks.com/better-line-breaks-for-long-urls/\nfunction formatUrl(url: ReactNode) {\n if (typeof url !== \"string\") {\n return url;\n }\n // Split the URL into an array to distinguish double slashes from single slashes\n var doubleSlash = url.split(\"//\");\n\n // Format the strings on either side of double slashes separately\n var formatted = doubleSlash\n .map(\n (str) =>\n // Insert a word break opportunity after a colon\n str\n .replace(/(?<after>:)/giu, \"$1<wbr>\")\n // Before a single slash, tilde, period, comma, hyphen, underline, question mark, number sign, or percent symbol\n .replace(/(?<before>[/~.,\\-_?#%])/giu, \"<wbr>$1\")\n // Before and after an equals sign or ampersand\n .replace(/(?<beforeAndAfter>[=&])/giu, \"<wbr>$1<wbr>\")\n // Reconnect the strings with word break opportunities after double slashes\n )\n .join(\"//<wbr>\");\n\n return formatted;\n}\n\nexport const Link: Components[\"a\"] = ({ href, title, children }) => {\n const L = useLink();\n\n return (\n <L href={href} title={title}>\n {formatUrl(children)}\n </L>\n );\n};\n", "import { ReactNode } from \"react\";\nimport { Components } from \"react-markdown\";\n\nlet tableHeaders: ReactNode[][] = [];\nlet tdIndex = 0;\n\nexport const Table: Components[\"table\"] = ({ children, style }) => {\n tableHeaders = [];\n return <table style={style}>{children}</table>;\n};\n\nexport const Tr: Components[\"tr\"] = ({ children, style }) => {\n tdIndex = 0;\n return <tr style={style}>{children}</tr>;\n};\n\nexport const Td: Components[\"td\"] = ({ children, style }) => {\n return (\n <td data-label={tableHeaders[tdIndex++]} style={style}>\n {children}\n </td>\n );\n};\n\nexport const Th: Components[\"th\"] = ({ children, style }) => {\n tableHeaders.push(children);\n return <th style={style}>{children}</th>;\n};\n", "import { useBookmark, useConfig } from \"@hyperbook/provider\";\nimport { Components } from \"react-markdown\";\n\nexport const makeAnchor = (heading: string) => {\n // If we have a heading, make it lower case\n let anchor = heading.toLowerCase();\n\n // Clean anchor (replace special characters whitespaces).\n // Alternatively, use encodeURIComponent() if you don't care about\n // pretty anchor links\n anchor = anchor.replace(/[^a-zA-Z0-9 ]/g, \"\");\n anchor = anchor.replace(/ /g, \"-\");\n\n return anchor;\n};\n\nexport const Headings: Components[\"h1\"] = ({ level, children }) => {\n const config = useConfig();\n const bookmarksConfig = config?.elements?.bookmarks;\n // Access actual (string) value of heading\n const heading = children?.[0] || \"\";\n\n // If we have a heading, make it lower case\n let anchor = typeof heading === \"string\" ? makeAnchor(heading) : \"\";\n\n const label = typeof heading === \"string\" ? heading : anchor;\n\n const [bookmark, toggleBookmark] = useBookmark(anchor, label);\n\n // Utility\n const container = (children: React.ReactNode): JSX.Element => (\n <>\n <a className=\"heading\" id={anchor} href={`#${anchor}`}>\n <span>{children}</span>\n </a>\n {bookmarksConfig !== false && (\n <button\n className={bookmark ? \"bookmark active\" : \"bookmark\"}\n onClick={() => toggleBookmark()}\n title=\"Bookmark\"\n >\n \uD83D\uDD16\n </button>\n )}\n </>\n );\n\n switch (level) {\n case 1:\n return <h1>{container(children)}</h1>;\n case 2:\n return <h2>{container(children)}</h2>;\n case 3:\n return <h3>{container(children)}</h3>;\n case 4:\n return <h4>{container(children)}</h4>;\n case 5:\n return <h5>{container(children)}</h5>;\n\n default:\n return <h6>{container(children)}</h6>;\n }\n};\n", "import { useMakeUrl } from \"@hyperbook/provider\";\nimport { useState } from \"react\";\nimport { Components } from \"react-markdown\";\n\nexport const Image: Components[\"img\"] = ({ src, title, alt }) => {\n const makeUrl = useMakeUrl();\n const [full, setFull] = useState(false);\n src = makeUrl(src, \"public\");\n\n return (\n <figure\n onClick={() => setFull((f) => !f)}\n className={full ? \"lightbox\" : undefined}\n >\n <img src={src} alt={alt} />\n {title && <figcaption>{title}</figcaption>}\n </figure>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,mBAAmB;AAC1B,OAAO,qBAAqB;AAC5B,O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IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,KAAK;AAAA,MACP;AAAA,MACA,eAAe;AAAA,QACb;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,eAAe;AAAA,QACb;AAAA,QACA,CAAC,iBAAiB,EAAE,eAAe,MAAM,WAAW,CAAC,SAAS,EAAE,CAAC;AAAA,MACnE;AAAA,MACA,UAAU;AAAA,MAET;AAAA;AAAA,EACH;AAEJ;",
|
|
6
6
|
"names": ["useDirectives", "jsx", "jsx", "Fragment", "jsx", "jsxs", "children", "useState", "jsx", "jsxs", "jsx", "useDirectives"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperbook/markdown",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"author": "Mike Barkmin",
|
|
5
5
|
"homepage": "https://github.com/openpatch/hyperbook#readme",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"url": "https://github.com/openpatch/hyperbook/issues"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@hyperbook/provider": "0.2.
|
|
36
|
-
"react-markdown": "8.0.
|
|
35
|
+
"@hyperbook/provider": "0.2.1",
|
|
36
|
+
"react-markdown": "8.0.4",
|
|
37
37
|
"rehype-highlight": "5.0.2",
|
|
38
38
|
"rehype-katex": "6.0.2",
|
|
39
39
|
"remark-directive": "2.0.1",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/hast": "2.3.4",
|
|
54
|
-
"@types/react": "18.0.
|
|
55
|
-
"@types/react-dom": "18.0.
|
|
54
|
+
"@types/react": "18.0.26",
|
|
55
|
+
"@types/react-dom": "18.0.10",
|
|
56
56
|
"@types/unist": "2.0.6",
|
|
57
57
|
"react": "18.2.0",
|
|
58
58
|
"react-dom": "18.2.0"
|