@readme/markdown 9.2.1 → 9.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/CodeTabs/index.tsx +4 -4
- package/components/TutorialTile.tsx +46 -0
- package/components/index.ts +1 -0
- package/dist/components/TutorialTile.d.ts +3 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/example/RenderError.d.ts +1 -1
- package/dist/main.js +44 -4
- package/dist/main.node.js +44 -4
- package/dist/main.node.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,11 +14,11 @@ interface Props {
|
|
|
14
14
|
const CodeTabs = (props: Props) => {
|
|
15
15
|
const { children } = props;
|
|
16
16
|
const theme = useContext(ThemeContext);
|
|
17
|
-
|
|
17
|
+
const hasMermaid = !Array.isArray(children) && children.props?.children.props.lang === 'mermaid';
|
|
18
18
|
|
|
19
19
|
// render Mermaid diagram
|
|
20
20
|
useEffect(() => {
|
|
21
|
-
if (typeof window !== 'undefined') {
|
|
21
|
+
if (typeof window !== 'undefined' && hasMermaid) {
|
|
22
22
|
import('mermaid').then(module => {
|
|
23
23
|
mermaid = module.default;
|
|
24
24
|
mermaid.initialize({
|
|
@@ -27,7 +27,7 @@ const CodeTabs = (props: Props) => {
|
|
|
27
27
|
mermaid.contentLoaded();
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
}, [theme]);
|
|
30
|
+
}, [hasMermaid, theme]);
|
|
31
31
|
|
|
32
32
|
function handleClick({ target }, index: number) {
|
|
33
33
|
const $wrap = target.parentElement.parentElement;
|
|
@@ -42,7 +42,7 @@ const CodeTabs = (props: Props) => {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
// render single Mermaid diagram
|
|
45
|
-
if (
|
|
45
|
+
if (hasMermaid) {
|
|
46
46
|
const value = children.props.children.props.value;
|
|
47
47
|
return <pre className="mermaid mermaid_single">{value}</pre>;
|
|
48
48
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
// We render a placeholder in this library, as the actual implemenation is
|
|
4
|
+
// deeply tied to the main app
|
|
5
|
+
const TutorialTile = () => {
|
|
6
|
+
const style = {
|
|
7
|
+
height: '50px',
|
|
8
|
+
border: '1px solid var(--color-border-default, rgba(black, 0.1))',
|
|
9
|
+
borderRadius: 'var(--border-radius-lg, 7.5px)',
|
|
10
|
+
minWidth: '230px',
|
|
11
|
+
display: 'inline-flex',
|
|
12
|
+
padding: '10px',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const placeholderStyle = {
|
|
16
|
+
borderRadius: 'var(--border-radius-lg, 7.5px)',
|
|
17
|
+
backgroundColor: 'var(--color-skeleton, #384248)',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const avatarStyle = {
|
|
21
|
+
...placeholderStyle,
|
|
22
|
+
height: '30px',
|
|
23
|
+
width: '30px',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const lineStyle = {
|
|
27
|
+
...placeholderStyle,
|
|
28
|
+
height: '12px',
|
|
29
|
+
width: '150px',
|
|
30
|
+
margin: '0 15px',
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div>
|
|
35
|
+
<div style={style}>
|
|
36
|
+
<div style={avatarStyle} />
|
|
37
|
+
<div>
|
|
38
|
+
<div style={{ ...lineStyle, marginBottom: '6px' }} />
|
|
39
|
+
<div style={{ ...lineStyle, width: '75px' }} />
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default TutorialTile;
|
package/components/index.ts
CHANGED
|
@@ -15,3 +15,4 @@ export { default as TableOfContents } from './TableOfContents';
|
|
|
15
15
|
export { default as Tabs, Tab } from './Tabs';
|
|
16
16
|
export { default as TailwindRoot } from './TailwindRoot';
|
|
17
17
|
export { default as TailwindStyle } from './TailwindStyle';
|
|
18
|
+
export { default as TutorialTile } from './TutorialTile';
|
|
@@ -15,3 +15,4 @@ export { default as TableOfContents } from './TableOfContents';
|
|
|
15
15
|
export { default as Tabs, Tab } from './Tabs';
|
|
16
16
|
export { default as TailwindRoot } from './TailwindRoot';
|
|
17
17
|
export { default as TailwindStyle } from './TailwindStyle';
|
|
18
|
+
export { default as TutorialTile } from './TutorialTile';
|
|
@@ -19,6 +19,6 @@ declare class RenderError extends React.Component<PropsWithChildren<Props>, Stat
|
|
|
19
19
|
static componentDidCatch(error: Error, info: {
|
|
20
20
|
componentStack: string;
|
|
21
21
|
}): void;
|
|
22
|
-
render(): string | number | boolean |
|
|
22
|
+
render(): string | number | boolean | React.JSX.Element | Iterable<React.ReactNode>;
|
|
23
23
|
}
|
|
24
24
|
export default RenderError;
|
package/dist/main.js
CHANGED
|
@@ -11709,7 +11709,8 @@ __webpack_require__.d(components_namespaceObject, {
|
|
|
11709
11709
|
TableOfContents: () => (components_TableOfContents),
|
|
11710
11710
|
Tabs: () => (components_Tabs),
|
|
11711
11711
|
TailwindRoot: () => (components_TailwindRoot),
|
|
11712
|
-
TailwindStyle: () => (components_TailwindStyle)
|
|
11712
|
+
TailwindStyle: () => (components_TailwindStyle),
|
|
11713
|
+
TutorialTile: () => (components_TutorialTile)
|
|
11713
11714
|
});
|
|
11714
11715
|
|
|
11715
11716
|
// NAMESPACE OBJECT: ./node_modules/micromark/lib/constructs.js
|
|
@@ -12039,9 +12040,10 @@ let mermaid;
|
|
|
12039
12040
|
const CodeTabs = (props) => {
|
|
12040
12041
|
const { children } = props;
|
|
12041
12042
|
const theme = (0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useContext)(Theme);
|
|
12043
|
+
const hasMermaid = !Array.isArray(children) && children.props?.children.props.lang === 'mermaid';
|
|
12042
12044
|
// render Mermaid diagram
|
|
12043
12045
|
(0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useEffect)(() => {
|
|
12044
|
-
if (typeof window !== 'undefined') {
|
|
12046
|
+
if (typeof window !== 'undefined' && hasMermaid) {
|
|
12045
12047
|
Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 1387, 23)).then(module => {
|
|
12046
12048
|
mermaid = module.default;
|
|
12047
12049
|
mermaid.initialize({
|
|
@@ -12050,7 +12052,7 @@ const CodeTabs = (props) => {
|
|
|
12050
12052
|
mermaid.contentLoaded();
|
|
12051
12053
|
});
|
|
12052
12054
|
}
|
|
12053
|
-
}, [theme]);
|
|
12055
|
+
}, [hasMermaid, theme]);
|
|
12054
12056
|
function handleClick({ target }, index) {
|
|
12055
12057
|
const $wrap = target.parentElement.parentElement;
|
|
12056
12058
|
const $open = [].slice.call($wrap.querySelectorAll('.CodeTabs_active'));
|
|
@@ -12061,7 +12063,7 @@ const CodeTabs = (props) => {
|
|
|
12061
12063
|
target.classList.add('CodeTabs_active');
|
|
12062
12064
|
}
|
|
12063
12065
|
// render single Mermaid diagram
|
|
12064
|
-
if (
|
|
12066
|
+
if (hasMermaid) {
|
|
12065
12067
|
const value = children.props.children.props.value;
|
|
12066
12068
|
return external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("pre", { className: "mermaid mermaid_single" }, value);
|
|
12067
12069
|
}
|
|
@@ -12568,6 +12570,43 @@ const TailwindStyle = ({ children, darkModeDataAttribute }) => {
|
|
|
12568
12570
|
};
|
|
12569
12571
|
/* harmony default export */ const components_TailwindStyle = (TailwindStyle);
|
|
12570
12572
|
|
|
12573
|
+
;// ./components/TutorialTile.tsx
|
|
12574
|
+
|
|
12575
|
+
// We render a placeholder in this library, as the actual implemenation is
|
|
12576
|
+
// deeply tied to the main app
|
|
12577
|
+
const TutorialTile = () => {
|
|
12578
|
+
const style = {
|
|
12579
|
+
height: '50px',
|
|
12580
|
+
border: '1px solid var(--color-border-default, rgba(black, 0.1))',
|
|
12581
|
+
borderRadius: 'var(--border-radius-lg, 7.5px)',
|
|
12582
|
+
minWidth: '230px',
|
|
12583
|
+
display: 'inline-flex',
|
|
12584
|
+
padding: '10px',
|
|
12585
|
+
};
|
|
12586
|
+
const placeholderStyle = {
|
|
12587
|
+
borderRadius: 'var(--border-radius-lg, 7.5px)',
|
|
12588
|
+
backgroundColor: 'var(--color-skeleton, #384248)',
|
|
12589
|
+
};
|
|
12590
|
+
const avatarStyle = {
|
|
12591
|
+
...placeholderStyle,
|
|
12592
|
+
height: '30px',
|
|
12593
|
+
width: '30px',
|
|
12594
|
+
};
|
|
12595
|
+
const lineStyle = {
|
|
12596
|
+
...placeholderStyle,
|
|
12597
|
+
height: '12px',
|
|
12598
|
+
width: '150px',
|
|
12599
|
+
margin: '0 15px',
|
|
12600
|
+
};
|
|
12601
|
+
return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", null,
|
|
12602
|
+
external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { style: style },
|
|
12603
|
+
external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { style: avatarStyle }),
|
|
12604
|
+
external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", null,
|
|
12605
|
+
external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { style: { ...lineStyle, marginBottom: '6px' } }),
|
|
12606
|
+
external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { style: { ...lineStyle, width: '75px' } })))));
|
|
12607
|
+
};
|
|
12608
|
+
/* harmony default export */ const components_TutorialTile = (TutorialTile);
|
|
12609
|
+
|
|
12571
12610
|
;// ./components/index.ts
|
|
12572
12611
|
|
|
12573
12612
|
|
|
@@ -12587,6 +12626,7 @@ const TailwindStyle = ({ children, darkModeDataAttribute }) => {
|
|
|
12587
12626
|
|
|
12588
12627
|
|
|
12589
12628
|
|
|
12629
|
+
|
|
12590
12630
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.to-primitive.js
|
|
12591
12631
|
var es_symbol_to_primitive = __webpack_require__(6611);
|
|
12592
12632
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js
|
package/dist/main.node.js
CHANGED
|
@@ -16152,7 +16152,8 @@ __webpack_require__.d(components_namespaceObject, {
|
|
|
16152
16152
|
TableOfContents: () => (components_TableOfContents),
|
|
16153
16153
|
Tabs: () => (components_Tabs),
|
|
16154
16154
|
TailwindRoot: () => (components_TailwindRoot),
|
|
16155
|
-
TailwindStyle: () => (components_TailwindStyle)
|
|
16155
|
+
TailwindStyle: () => (components_TailwindStyle),
|
|
16156
|
+
TutorialTile: () => (components_TutorialTile)
|
|
16156
16157
|
});
|
|
16157
16158
|
|
|
16158
16159
|
// NAMESPACE OBJECT: ./node_modules/micromark/lib/constructs.js
|
|
@@ -16415,9 +16416,10 @@ let mermaid;
|
|
|
16415
16416
|
const CodeTabs = (props) => {
|
|
16416
16417
|
const { children } = props;
|
|
16417
16418
|
const theme = (0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useContext)(Theme);
|
|
16419
|
+
const hasMermaid = !Array.isArray(children) && children.props?.children.props.lang === 'mermaid';
|
|
16418
16420
|
// render Mermaid diagram
|
|
16419
16421
|
(0,external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_.useEffect)(() => {
|
|
16420
|
-
if (typeof window !== 'undefined') {
|
|
16422
|
+
if (typeof window !== 'undefined' && hasMermaid) {
|
|
16421
16423
|
__webpack_require__.e(/* import() */ 486).then(__webpack_require__.bind(__webpack_require__, 5486)).then(module => {
|
|
16422
16424
|
mermaid = module.default;
|
|
16423
16425
|
mermaid.initialize({
|
|
@@ -16426,7 +16428,7 @@ const CodeTabs = (props) => {
|
|
|
16426
16428
|
mermaid.contentLoaded();
|
|
16427
16429
|
});
|
|
16428
16430
|
}
|
|
16429
|
-
}, [theme]);
|
|
16431
|
+
}, [hasMermaid, theme]);
|
|
16430
16432
|
function handleClick({ target }, index) {
|
|
16431
16433
|
const $wrap = target.parentElement.parentElement;
|
|
16432
16434
|
const $open = [].slice.call($wrap.querySelectorAll('.CodeTabs_active'));
|
|
@@ -16437,7 +16439,7 @@ const CodeTabs = (props) => {
|
|
|
16437
16439
|
target.classList.add('CodeTabs_active');
|
|
16438
16440
|
}
|
|
16439
16441
|
// render single Mermaid diagram
|
|
16440
|
-
if (
|
|
16442
|
+
if (hasMermaid) {
|
|
16441
16443
|
const value = children.props.children.props.value;
|
|
16442
16444
|
return external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("pre", { className: "mermaid mermaid_single" }, value);
|
|
16443
16445
|
}
|
|
@@ -21888,6 +21890,43 @@ const TailwindStyle = ({ children, darkModeDataAttribute }) => {
|
|
|
21888
21890
|
};
|
|
21889
21891
|
/* harmony default export */ const components_TailwindStyle = (TailwindStyle);
|
|
21890
21892
|
|
|
21893
|
+
;// ./components/TutorialTile.tsx
|
|
21894
|
+
|
|
21895
|
+
// We render a placeholder in this library, as the actual implemenation is
|
|
21896
|
+
// deeply tied to the main app
|
|
21897
|
+
const TutorialTile = () => {
|
|
21898
|
+
const style = {
|
|
21899
|
+
height: '50px',
|
|
21900
|
+
border: '1px solid var(--color-border-default, rgba(black, 0.1))',
|
|
21901
|
+
borderRadius: 'var(--border-radius-lg, 7.5px)',
|
|
21902
|
+
minWidth: '230px',
|
|
21903
|
+
display: 'inline-flex',
|
|
21904
|
+
padding: '10px',
|
|
21905
|
+
};
|
|
21906
|
+
const placeholderStyle = {
|
|
21907
|
+
borderRadius: 'var(--border-radius-lg, 7.5px)',
|
|
21908
|
+
backgroundColor: 'var(--color-skeleton, #384248)',
|
|
21909
|
+
};
|
|
21910
|
+
const avatarStyle = {
|
|
21911
|
+
...placeholderStyle,
|
|
21912
|
+
height: '30px',
|
|
21913
|
+
width: '30px',
|
|
21914
|
+
};
|
|
21915
|
+
const lineStyle = {
|
|
21916
|
+
...placeholderStyle,
|
|
21917
|
+
height: '12px',
|
|
21918
|
+
width: '150px',
|
|
21919
|
+
margin: '0 15px',
|
|
21920
|
+
};
|
|
21921
|
+
return (external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", null,
|
|
21922
|
+
external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { style: style },
|
|
21923
|
+
external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { style: avatarStyle }),
|
|
21924
|
+
external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", null,
|
|
21925
|
+
external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { style: { ...lineStyle, marginBottom: '6px' } }),
|
|
21926
|
+
external_amd_react_commonjs_react_commonjs2_react_root_React_umd_react_default().createElement("div", { style: { ...lineStyle, width: '75px' } })))));
|
|
21927
|
+
};
|
|
21928
|
+
/* harmony default export */ const components_TutorialTile = (TutorialTile);
|
|
21929
|
+
|
|
21891
21930
|
;// ./components/index.ts
|
|
21892
21931
|
|
|
21893
21932
|
|
|
@@ -21907,6 +21946,7 @@ const TailwindStyle = ({ children, darkModeDataAttribute }) => {
|
|
|
21907
21946
|
|
|
21908
21947
|
|
|
21909
21948
|
|
|
21949
|
+
|
|
21910
21950
|
;// ./options.js
|
|
21911
21951
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21912
21952
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|