@dfds-ui/storybook-design 2.2.0-alpha.e010e72f → 2.2.0-alpha.eac8b0de
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/cjs/components/ExampleContainer.d.ts +4 -4
- package/cjs/components/ExampleContainer.js +1 -2
- package/cjs/components/Paper.d.ts +3 -3
- package/cjs/components/Paper.js +1 -2
- package/cjs/components/Placeholder.d.ts +2 -1
- package/cjs/components/Placeholder.js +11 -13
- package/cjs/components/StoryPage.d.ts +2 -2
- package/cjs/components/StoryPage.js +2 -4
- package/cjs/components/index.d.ts +0 -2
- package/cjs/components/index.js +4 -18
- package/cjs/index.d.ts +0 -3
- package/cjs/index.js +3 -40
- package/cjs/markdown/Markdown.d.ts +2 -2
- package/cjs/markdown/Markdown.js +16 -50
- package/cjs/markdown/Md.d.ts +2 -1
- package/cjs/markdown/Md.js +5 -4
- package/cjs/markdown/index.js +2 -2
- package/components/ExampleContainer.d.ts +4 -4
- package/components/Paper.d.ts +3 -3
- package/components/Placeholder.d.ts +2 -1
- package/components/Placeholder.js +11 -6
- package/components/StoryPage.d.ts +2 -2
- package/components/StoryPage.js +1 -2
- package/components/index.d.ts +0 -2
- package/components/index.js +1 -3
- package/index.d.ts +0 -3
- package/index.js +1 -4
- package/markdown/Markdown.d.ts +2 -2
- package/markdown/Markdown.js +13 -50
- package/markdown/Md.d.ts +2 -1
- package/markdown/Md.js +4 -2
- package/package.json +6 -7
- package/cjs/components/GlobalStorybookStyles.d.ts +0 -2
- package/cjs/components/GlobalStorybookStyles.js +0 -28
- package/cjs/components/MarkdownStory.d.ts +0 -8
- package/cjs/components/MarkdownStory.js +0 -42
- package/cjs/createDfdsTheme.d.ts +0 -1
- package/cjs/createDfdsTheme.js +0 -14
- package/cjs/helpers/components.d.ts +0 -40
- package/cjs/helpers/components.js +0 -367
- package/cjs/helpers/decorators.d.ts +0 -3
- package/cjs/helpers/decorators.js +0 -27
- package/cjs/types/global.d.js +0 -1
- package/components/GlobalStorybookStyles.d.ts +0 -2
- package/components/GlobalStorybookStyles.js +0 -21
- package/components/MarkdownStory.d.ts +0 -8
- package/components/MarkdownStory.js +0 -33
- package/createDfdsTheme.d.ts +0 -1
- package/createDfdsTheme.js +0 -8
- package/helpers/components.d.ts +0 -40
- package/helpers/components.js +0 -349
- package/helpers/decorators.d.ts +0 -3
- package/helpers/decorators.js +0 -26
- package/types/global.d.js +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
declare const ExampleContainer: import("@emotion/styled").StyledComponent<{
|
|
2
|
-
theme?: import("@emotion/react").Theme
|
|
3
|
-
as?:
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
|
+
as?: React.ElementType;
|
|
4
4
|
} & {
|
|
5
|
-
headline?: string
|
|
6
|
-
dark?: boolean
|
|
5
|
+
headline?: string;
|
|
6
|
+
dark?: boolean;
|
|
7
7
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
8
8
|
export default ExampleContainer;
|
|
@@ -12,5 +12,4 @@ const ExampleContainer = /*#__PURE__*/(0, _base.default)("div", process.env.NODE
|
|
|
12
12
|
target: "e111yhd70",
|
|
13
13
|
label: "ExampleContainer"
|
|
14
14
|
})("background-color:", p => p.dark ? '#002b45' : 'white', ";padding:25px 15px 15px;margin-bottom:16px;border:1px solid #f4f6f8;position:relative;::before{position:absolute;top:2px;content:'", p => p.headline || 'example', "';right:2px;font-size:10px;padding:4px 8px;color:", p => p.dark ? 'white' : 'black', ";background-color:", p => p.dark ? '#031c2b' : '#eee', ";text-transform:uppercase;letter-spacing:1.2px;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0V4YW1wbGVDb250YWluZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUUwRSIsImZpbGUiOiIuLi8uLi8uLi9zcmMvY29tcG9uZW50cy9FeGFtcGxlQ29udGFpbmVyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJ1xuXG5jb25zdCBFeGFtcGxlQ29udGFpbmVyID0gc3R5bGVkLmRpdjx7IGhlYWRsaW5lPzogc3RyaW5nOyBkYXJrPzogYm9vbGVhbiB9PmBcbiAgYmFja2dyb3VuZC1jb2xvcjogJHsocCkgPT4gKHAuZGFyayA/ICcjMDAyYjQ1JyA6ICd3aGl0ZScpfTtcbiAgcGFkZGluZzogMjVweCAxNXB4IDE1cHg7XG4gIG1hcmdpbi1ib3R0b206IDE2cHg7XG4gIGJvcmRlcjogMXB4IHNvbGlkICNmNGY2Zjg7XG4gIHBvc2l0aW9uOiByZWxhdGl2ZTtcblxuICA6OmJlZm9yZSB7XG4gICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgIHRvcDogMnB4O1xuICAgIGNvbnRlbnQ6ICckeyhwKSA9PiBwLmhlYWRsaW5lIHx8ICdleGFtcGxlJ30nO1xuICAgIHJpZ2h0OiAycHg7XG4gICAgZm9udC1zaXplOiAxMHB4O1xuICAgIHBhZGRpbmc6IDRweCA4cHg7XG4gICAgY29sb3I6ICR7KHApID0+IChwLmRhcmsgPyAnd2hpdGUnIDogJ2JsYWNrJyl9O1xuICAgIGJhY2tncm91bmQtY29sb3I6ICR7KHApID0+IChwLmRhcmsgPyAnIzAzMWMyYicgOiAnI2VlZScpfTtcbiAgICB0ZXh0LXRyYW5zZm9ybTogdXBwZXJjYXNlO1xuICAgIGxldHRlci1zcGFjaW5nOiAxLjJweDtcbiAgfVxuYFxuXG5leHBvcnQgZGVmYXVsdCBFeGFtcGxlQ29udGFpbmVyXG4iXX0= */"));
|
|
15
|
-
var _default = ExampleContainer;
|
|
16
|
-
exports.default = _default;
|
|
15
|
+
var _default = exports.default = ExampleContainer;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
type PaperProps = {
|
|
2
2
|
width?: number | string;
|
|
3
3
|
};
|
|
4
4
|
declare const Paper: import("@emotion/styled").StyledComponent<{
|
|
5
|
-
theme?: import("@emotion/react").Theme
|
|
6
|
-
as?:
|
|
5
|
+
theme?: import("@emotion/react").Theme;
|
|
6
|
+
as?: React.ElementType;
|
|
7
7
|
} & PaperProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
8
8
|
export default Paper;
|
package/cjs/components/Paper.js
CHANGED
|
@@ -14,5 +14,4 @@ const Paper = /*#__PURE__*/(0, _base.default)("div", process.env.NODE_ENV === "p
|
|
|
14
14
|
})("box-sizing:content-box;background-color:#eaf4fb;padding:10px;width:", ({
|
|
15
15
|
width
|
|
16
16
|
}) => width === undefined ? 'auto' : typeof width === 'number' ? `${width}px` : width, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL1BhcGVyLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNb0MiLCJmaWxlIjoiLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvUGFwZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnXG5cbnR5cGUgUGFwZXJQcm9wcyA9IHtcbiAgd2lkdGg/OiBudW1iZXIgfCBzdHJpbmdcbn1cblxuY29uc3QgUGFwZXIgPSBzdHlsZWQuZGl2PFBhcGVyUHJvcHM+YFxuICBib3gtc2l6aW5nOiBjb250ZW50LWJveDtcbiAgYmFja2dyb3VuZC1jb2xvcjogI2VhZjRmYjtcbiAgcGFkZGluZzogMTBweDtcbiAgd2lkdGg6ICR7KHsgd2lkdGggfSkgPT4gKHdpZHRoID09PSB1bmRlZmluZWQgPyAnYXV0bycgOiB0eXBlb2Ygd2lkdGggPT09ICdudW1iZXInID8gYCR7d2lkdGh9cHhgIDogd2lkdGgpfTtcbmBcblxuZXhwb3J0IGRlZmF1bHQgUGFwZXJcbiJdfQ== */"));
|
|
17
|
-
var _default = Paper;
|
|
18
|
-
exports.default = _default;
|
|
17
|
+
var _default = exports.default = Paper;
|
|
@@ -6,18 +6,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _react2 = require("@emotion/react");
|
|
9
|
-
|
|
9
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}, rest));
|
|
11
|
+
const Placeholder = ({
|
|
12
|
+
width,
|
|
13
|
+
height,
|
|
14
|
+
...rest
|
|
15
|
+
}) => {
|
|
16
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
17
|
+
css: /*#__PURE__*/(0, _react2.css)("display:flex;margin-left:0;background-image:radial-gradient(circle at 50% 50%, #f8f9f9, #eef0f1);color:#b8b8b7;text-align:center;justify-content:center;align-items:center;font-size:10px;font-weight:300;width:", width, "px;height:", height, "px;" + (process.env.NODE_ENV === "production" ? "" : ";label:Placeholder;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL1BsYWNlaG9sZGVyLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFRYyIsImZpbGUiOiIuLi8uLi8uLi9zcmMvY29tcG9uZW50cy9QbGFjZWhvbGRlci50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcblxudHlwZSBQbGFjZWhvbGRlclByb3BzID0geyBjaGlsZHJlbj86IFJlYWN0LlJlYWN0Tm9kZTsgd2lkdGg6IG51bWJlcjsgaGVpZ2h0OiBudW1iZXIgfVxuXG5jb25zdCBQbGFjZWhvbGRlcjogUmVhY3QuRnVuY3Rpb25Db21wb25lbnQ8UGxhY2Vob2xkZXJQcm9wcz4gPSAoeyB3aWR0aCwgaGVpZ2h0LCAuLi5yZXN0IH0pID0+IHtcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICBjc3M9e2Nzc2BcbiAgICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgICAgbWFyZ2luLWxlZnQ6IDA7XG4gICAgICAgIGJhY2tncm91bmQtaW1hZ2U6IHJhZGlhbC1ncmFkaWVudChjaXJjbGUgYXQgNTAlIDUwJSwgI2Y4ZjlmOSwgI2VlZjBmMSk7XG4gICAgICAgIGNvbG9yOiAjYjhiOGI3O1xuICAgICAgICB0ZXh0LWFsaWduOiBjZW50ZXI7XG4gICAgICAgIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICAgICAgICBhbGlnbi1pdGVtczogY2VudGVyO1xuICAgICAgICBmb250LXNpemU6IDEwcHg7XG4gICAgICAgIGZvbnQtd2VpZ2h0OiAzMDA7XG4gICAgICAgIHdpZHRoOiAke3dpZHRofXB4O1xuICAgICAgICBoZWlnaHQ6ICR7aGVpZ2h0fXB4O1xuICAgICAgYH1cbiAgICAgIHsuLi5yZXN0fVxuICAgIC8+XG4gIClcbn1cblxuZXhwb3J0IGRlZmF1bHQgUGxhY2Vob2xkZXJcbiJdfQ== */"),
|
|
18
|
+
...rest
|
|
19
|
+
});
|
|
21
20
|
};
|
|
22
|
-
var _default = Placeholder;
|
|
23
|
-
exports.default = _default;
|
|
21
|
+
var _default = exports.default = Placeholder;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const StoryPage: import("@emotion/styled").StyledComponent<{
|
|
2
|
-
theme?: import("@emotion/react").Theme
|
|
3
|
-
as?:
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
|
+
as?: React.ElementType;
|
|
4
4
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
5
5
|
export default StoryPage;
|
|
@@ -17,9 +17,7 @@ const StoryPage = /*#__PURE__*/(0, _base.default)("div", process.env.NODE_ENV ==
|
|
|
17
17
|
styles: "padding:5px 15px;max-width:1600px;&>h2{margin-top:30px!important;}"
|
|
18
18
|
} : {
|
|
19
19
|
name: "3hldis",
|
|
20
|
-
styles: "padding:5px 15px;max-width:1600px;&>h2{margin-top:30px!important;}",
|
|
21
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL1N0b3J5UGFnZS50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRTRCIiwiZmlsZSI6Ii4uLy4uLy4uL3NyYy9jb21wb25lbnRzL1N0b3J5UGFnZS50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCdcblxuY29uc3QgU3RvcnlQYWdlID0gc3R5bGVkLmRpdmBcbiAgcGFkZGluZzogNXB4IDE1cHg7XG4gIG1heC13aWR0aDogMTYwMHB4O1xuICAmID4gaDIge1xuICAgIC8qIHN0eWxlbGludC1kaXNhYmxlICovXG4gICAgbWFyZ2luLXRvcDogMzBweCAhaW1wb3J0YW50O1xuICAgIC8qIHN0eWxlbGludC1lbmFibGUgKi9cbiAgfVxuYFxuXG5leHBvcnQgZGVmYXVsdCBTdG9yeVBhZ2VcbiJdfQ== */",
|
|
20
|
+
styles: "padding:5px 15px;max-width:1600px;&>h2{margin-top:30px!important;}/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL1N0b3J5UGFnZS50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRTRCIiwiZmlsZSI6Ii4uLy4uLy4uL3NyYy9jb21wb25lbnRzL1N0b3J5UGFnZS50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCdcblxuY29uc3QgU3RvcnlQYWdlID0gc3R5bGVkLmRpdmBcbiAgcGFkZGluZzogNXB4IDE1cHg7XG4gIG1heC13aWR0aDogMTYwMHB4O1xuICAmID4gaDIge1xuICAgIC8qIHN0eWxlbGludC1kaXNhYmxlICovXG4gICAgbWFyZ2luLXRvcDogMzBweCAhaW1wb3J0YW50O1xuICAgIC8qIHN0eWxlbGludC1lbmFibGUgKi9cbiAgfVxuYFxuXG5leHBvcnQgZGVmYXVsdCBTdG9yeVBhZ2VcbiJdfQ== */",
|
|
22
21
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
23
22
|
});
|
|
24
|
-
var _default = StoryPage;
|
|
25
|
-
exports.default = _default;
|
|
23
|
+
var _default = exports.default = StoryPage;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export { default as GlobalStorybookStyles } from './GlobalStorybookStyles';
|
|
2
1
|
export { default as StoryPage } from './StoryPage';
|
|
3
2
|
export { default as ExampleContainer } from './ExampleContainer';
|
|
4
3
|
export { default as Paper } from './Paper';
|
|
5
4
|
export { default as Placeholder } from './Placeholder';
|
|
6
|
-
export { default as MarkdownStory } from './MarkdownStory';
|
package/cjs/components/index.js
CHANGED
|
@@ -5,44 +5,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "ExampleContainer", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _ExampleContainer.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "GlobalStorybookStyles", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _GlobalStorybookStyles.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "MarkdownStory", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _MarkdownStory.default;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
12
|
Object.defineProperty(exports, "Paper", {
|
|
25
13
|
enumerable: true,
|
|
26
|
-
get: function
|
|
14
|
+
get: function () {
|
|
27
15
|
return _Paper.default;
|
|
28
16
|
}
|
|
29
17
|
});
|
|
30
18
|
Object.defineProperty(exports, "Placeholder", {
|
|
31
19
|
enumerable: true,
|
|
32
|
-
get: function
|
|
20
|
+
get: function () {
|
|
33
21
|
return _Placeholder.default;
|
|
34
22
|
}
|
|
35
23
|
});
|
|
36
24
|
Object.defineProperty(exports, "StoryPage", {
|
|
37
25
|
enumerable: true,
|
|
38
|
-
get: function
|
|
26
|
+
get: function () {
|
|
39
27
|
return _StoryPage.default;
|
|
40
28
|
}
|
|
41
29
|
});
|
|
42
|
-
var _GlobalStorybookStyles = _interopRequireDefault(require("./GlobalStorybookStyles"));
|
|
43
30
|
var _StoryPage = _interopRequireDefault(require("./StoryPage"));
|
|
44
31
|
var _ExampleContainer = _interopRequireDefault(require("./ExampleContainer"));
|
|
45
32
|
var _Paper = _interopRequireDefault(require("./Paper"));
|
|
46
33
|
var _Placeholder = _interopRequireDefault(require("./Placeholder"));
|
|
47
|
-
var _MarkdownStory = _interopRequireDefault(require("./MarkdownStory"));
|
|
48
34
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -3,23 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var _exportNames = {
|
|
7
|
-
createDfdsTheme: true
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "createDfdsTheme", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function get() {
|
|
12
|
-
return _createDfdsTheme.default;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
6
|
var _components = require("./components");
|
|
16
7
|
Object.keys(_components).forEach(function (key) {
|
|
17
8
|
if (key === "default" || key === "__esModule") return;
|
|
18
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
19
9
|
if (key in exports && exports[key] === _components[key]) return;
|
|
20
10
|
Object.defineProperty(exports, key, {
|
|
21
11
|
enumerable: true,
|
|
22
|
-
get: function
|
|
12
|
+
get: function () {
|
|
23
13
|
return _components[key];
|
|
24
14
|
}
|
|
25
15
|
});
|
|
@@ -27,38 +17,11 @@ Object.keys(_components).forEach(function (key) {
|
|
|
27
17
|
var _markdown = require("./markdown");
|
|
28
18
|
Object.keys(_markdown).forEach(function (key) {
|
|
29
19
|
if (key === "default" || key === "__esModule") return;
|
|
30
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
31
20
|
if (key in exports && exports[key] === _markdown[key]) return;
|
|
32
21
|
Object.defineProperty(exports, key, {
|
|
33
22
|
enumerable: true,
|
|
34
|
-
get: function
|
|
23
|
+
get: function () {
|
|
35
24
|
return _markdown[key];
|
|
36
25
|
}
|
|
37
26
|
});
|
|
38
|
-
});
|
|
39
|
-
var _createDfdsTheme = _interopRequireDefault(require("./createDfdsTheme"));
|
|
40
|
-
var _components2 = require("./helpers/components");
|
|
41
|
-
Object.keys(_components2).forEach(function (key) {
|
|
42
|
-
if (key === "default" || key === "__esModule") return;
|
|
43
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
44
|
-
if (key in exports && exports[key] === _components2[key]) return;
|
|
45
|
-
Object.defineProperty(exports, key, {
|
|
46
|
-
enumerable: true,
|
|
47
|
-
get: function get() {
|
|
48
|
-
return _components2[key];
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
var _decorators = require("./helpers/decorators");
|
|
53
|
-
Object.keys(_decorators).forEach(function (key) {
|
|
54
|
-
if (key === "default" || key === "__esModule") return;
|
|
55
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
56
|
-
if (key in exports && exports[key] === _decorators[key]) return;
|
|
57
|
-
Object.defineProperty(exports, key, {
|
|
58
|
-
enumerable: true,
|
|
59
|
-
get: function get() {
|
|
60
|
-
return _decorators[key];
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
27
|
+
});
|
package/cjs/markdown/Markdown.js
CHANGED
|
@@ -5,56 +5,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var _react2 = require("@emotion/react");
|
|
11
|
-
const _excluded = ["children"];
|
|
8
|
+
var _marked = require("marked");
|
|
9
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
12
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
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; }
|
|
17
|
-
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; }
|
|
18
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
19
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
20
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // the ListItem renderer from react-markdown-github-renderers does not render checkboxes so we create our own
|
|
21
|
-
const ListItemRenderer = props => {
|
|
22
|
-
let checkbox = null;
|
|
23
|
-
if (props.checked !== null) {
|
|
24
|
-
const checked = props.checked;
|
|
25
|
-
checkbox = /*#__PURE__*/_react.default.createElement('input', {
|
|
26
|
-
type: 'checkbox',
|
|
27
|
-
checked,
|
|
28
|
-
readOnly: true,
|
|
29
|
-
style: {
|
|
30
|
-
margin: '4px'
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
return /*#__PURE__*/_react.default.createElement('li', {
|
|
35
|
-
style: {
|
|
36
|
-
marginTop: 4,
|
|
37
|
-
lineHeight: 1.5
|
|
38
|
-
}
|
|
39
|
-
}, checkbox, props.children);
|
|
40
|
-
};
|
|
41
|
-
const TableRenderer = props => {
|
|
42
|
-
return /*#__PURE__*/_react.default.createElement('table', {
|
|
43
|
-
className: 'markdown-table'
|
|
44
|
-
}, props.children);
|
|
45
|
-
};
|
|
46
|
-
const customRenderers = _objectSpread(_objectSpread({}, _reactMarkdownGithubRenderers.default), {}, {
|
|
47
|
-
listItem: ListItemRenderer,
|
|
48
|
-
table: TableRenderer
|
|
11
|
+
_marked.marked.setOptions({
|
|
12
|
+
gfm: true,
|
|
13
|
+
breaks: false
|
|
49
14
|
});
|
|
50
|
-
const Markdown =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
15
|
+
const Markdown = ({
|
|
16
|
+
children
|
|
17
|
+
}) => {
|
|
18
|
+
const html = _marked.marked.parse(children);
|
|
19
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
20
|
+
className: "markdown-body",
|
|
21
|
+
dangerouslySetInnerHTML: {
|
|
22
|
+
__html: html
|
|
23
|
+
}
|
|
24
|
+
});
|
|
58
25
|
};
|
|
59
|
-
var _default = Markdown;
|
|
60
|
-
exports.default = _default;
|
|
26
|
+
var _default = exports.default = Markdown;
|
package/cjs/markdown/Md.d.ts
CHANGED
package/cjs/markdown/Md.js
CHANGED
|
@@ -6,14 +6,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = exports.Md = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _Markdown = _interopRequireDefault(require("./Markdown"));
|
|
9
|
-
var
|
|
9
|
+
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
const Md = (strings, ...values) => {
|
|
12
12
|
const source = strings.reduce((res, str, i) => {
|
|
13
13
|
return `${res}${str}${values[i] || ''}`;
|
|
14
14
|
});
|
|
15
|
-
return (0,
|
|
15
|
+
return (0, _jsxRuntime.jsx)(_Markdown.default, {
|
|
16
|
+
children: source
|
|
17
|
+
});
|
|
16
18
|
};
|
|
17
19
|
exports.Md = Md;
|
|
18
|
-
var _default = Md;
|
|
19
|
-
exports.default = _default;
|
|
20
|
+
var _default = exports.default = Md;
|
package/cjs/markdown/index.js
CHANGED
|
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "Markdown", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _Markdown.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "Md", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function
|
|
14
|
+
get: function () {
|
|
15
15
|
return _Md.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
declare const ExampleContainer: import("@emotion/styled").StyledComponent<{
|
|
2
|
-
theme?: import("@emotion/react").Theme
|
|
3
|
-
as?:
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
|
+
as?: React.ElementType;
|
|
4
4
|
} & {
|
|
5
|
-
headline?: string
|
|
6
|
-
dark?: boolean
|
|
5
|
+
headline?: string;
|
|
6
|
+
dark?: boolean;
|
|
7
7
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
8
8
|
export default ExampleContainer;
|
package/components/Paper.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
type PaperProps = {
|
|
2
2
|
width?: number | string;
|
|
3
3
|
};
|
|
4
4
|
declare const Paper: import("@emotion/styled").StyledComponent<{
|
|
5
|
-
theme?: import("@emotion/react").Theme
|
|
6
|
-
as?:
|
|
5
|
+
theme?: import("@emotion/react").Theme;
|
|
6
|
+
as?: React.ElementType;
|
|
7
7
|
} & PaperProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
8
8
|
export default Paper;
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
var _excluded = ["width", "height"];
|
|
2
|
-
function
|
|
3
|
-
function
|
|
4
|
-
function
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
10
|
import React from 'react';
|
|
6
11
|
import { css } from '@emotion/react';
|
|
7
|
-
import { jsx as
|
|
12
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
8
13
|
var Placeholder = function Placeholder(_ref) {
|
|
9
14
|
var width = _ref.width,
|
|
10
15
|
height = _ref.height,
|
|
11
16
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
-
return
|
|
13
|
-
css: /*#__PURE__*/css("display:flex;margin-left:0;background-image:radial-gradient(circle at 50% 50%, #f8f9f9, #eef0f1);color:#b8b8b7;text-align:center;justify-content:center;align-items:center;font-size:10px;font-weight:300;width:", width, "px;height:", height, "px;" + (process.env.NODE_ENV === "production" ? "" : ";label:Placeholder;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
17
|
+
return _jsx("div", _objectSpread({
|
|
18
|
+
css: /*#__PURE__*/css("display:flex;margin-left:0;background-image:radial-gradient(circle at 50% 50%, #f8f9f9, #eef0f1);color:#b8b8b7;text-align:center;justify-content:center;align-items:center;font-size:10px;font-weight:300;width:", width, "px;height:", height, "px;" + (process.env.NODE_ENV === "production" ? "" : ";label:Placeholder;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL1BsYWNlaG9sZGVyLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFRYyIsImZpbGUiOiIuLi8uLi9zcmMvY29tcG9uZW50cy9QbGFjZWhvbGRlci50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcblxudHlwZSBQbGFjZWhvbGRlclByb3BzID0geyBjaGlsZHJlbj86IFJlYWN0LlJlYWN0Tm9kZTsgd2lkdGg6IG51bWJlcjsgaGVpZ2h0OiBudW1iZXIgfVxuXG5jb25zdCBQbGFjZWhvbGRlcjogUmVhY3QuRnVuY3Rpb25Db21wb25lbnQ8UGxhY2Vob2xkZXJQcm9wcz4gPSAoeyB3aWR0aCwgaGVpZ2h0LCAuLi5yZXN0IH0pID0+IHtcbiAgcmV0dXJuIChcbiAgICA8ZGl2XG4gICAgICBjc3M9e2Nzc2BcbiAgICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgICAgbWFyZ2luLWxlZnQ6IDA7XG4gICAgICAgIGJhY2tncm91bmQtaW1hZ2U6IHJhZGlhbC1ncmFkaWVudChjaXJjbGUgYXQgNTAlIDUwJSwgI2Y4ZjlmOSwgI2VlZjBmMSk7XG4gICAgICAgIGNvbG9yOiAjYjhiOGI3O1xuICAgICAgICB0ZXh0LWFsaWduOiBjZW50ZXI7XG4gICAgICAgIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICAgICAgICBhbGlnbi1pdGVtczogY2VudGVyO1xuICAgICAgICBmb250LXNpemU6IDEwcHg7XG4gICAgICAgIGZvbnQtd2VpZ2h0OiAzMDA7XG4gICAgICAgIHdpZHRoOiAke3dpZHRofXB4O1xuICAgICAgICBoZWlnaHQ6ICR7aGVpZ2h0fXB4O1xuICAgICAgYH1cbiAgICAgIHsuLi5yZXN0fVxuICAgIC8+XG4gIClcbn1cblxuZXhwb3J0IGRlZmF1bHQgUGxhY2Vob2xkZXJcbiJdfQ== */")
|
|
14
19
|
}, rest));
|
|
15
20
|
};
|
|
16
21
|
export default Placeholder;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const StoryPage: import("@emotion/styled").StyledComponent<{
|
|
2
|
-
theme?: import("@emotion/react").Theme
|
|
3
|
-
as?:
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
|
+
as?: React.ElementType;
|
|
4
4
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
5
5
|
export default StoryPage;
|
package/components/StoryPage.js
CHANGED
|
@@ -10,8 +10,7 @@ var StoryPage = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production
|
|
|
10
10
|
styles: "padding:5px 15px;max-width:1600px;&>h2{margin-top:30px!important;}"
|
|
11
11
|
} : {
|
|
12
12
|
name: "3hldis",
|
|
13
|
-
styles: "padding:5px 15px;max-width:1600px;&>h2{margin-top:30px!important;}",
|
|
14
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL1N0b3J5UGFnZS50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRTRCIiwiZmlsZSI6Ii4uLy4uL3NyYy9jb21wb25lbnRzL1N0b3J5UGFnZS50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCdcblxuY29uc3QgU3RvcnlQYWdlID0gc3R5bGVkLmRpdmBcbiAgcGFkZGluZzogNXB4IDE1cHg7XG4gIG1heC13aWR0aDogMTYwMHB4O1xuICAmID4gaDIge1xuICAgIC8qIHN0eWxlbGludC1kaXNhYmxlICovXG4gICAgbWFyZ2luLXRvcDogMzBweCAhaW1wb3J0YW50O1xuICAgIC8qIHN0eWxlbGludC1lbmFibGUgKi9cbiAgfVxuYFxuXG5leHBvcnQgZGVmYXVsdCBTdG9yeVBhZ2VcbiJdfQ== */",
|
|
13
|
+
styles: "padding:5px 15px;max-width:1600px;&>h2{margin-top:30px!important;}/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL1N0b3J5UGFnZS50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRTRCIiwiZmlsZSI6Ii4uLy4uL3NyYy9jb21wb25lbnRzL1N0b3J5UGFnZS50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCdcblxuY29uc3QgU3RvcnlQYWdlID0gc3R5bGVkLmRpdmBcbiAgcGFkZGluZzogNXB4IDE1cHg7XG4gIG1heC13aWR0aDogMTYwMHB4O1xuICAmID4gaDIge1xuICAgIC8qIHN0eWxlbGludC1kaXNhYmxlICovXG4gICAgbWFyZ2luLXRvcDogMzBweCAhaW1wb3J0YW50O1xuICAgIC8qIHN0eWxlbGludC1lbmFibGUgKi9cbiAgfVxuYFxuXG5leHBvcnQgZGVmYXVsdCBTdG9yeVBhZ2VcbiJdfQ== */",
|
|
15
14
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
16
15
|
});
|
|
17
16
|
export default StoryPage;
|
package/components/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export { default as GlobalStorybookStyles } from './GlobalStorybookStyles';
|
|
2
1
|
export { default as StoryPage } from './StoryPage';
|
|
3
2
|
export { default as ExampleContainer } from './ExampleContainer';
|
|
4
3
|
export { default as Paper } from './Paper';
|
|
5
4
|
export { default as Placeholder } from './Placeholder';
|
|
6
|
-
export { default as MarkdownStory } from './MarkdownStory';
|
package/components/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export { default as GlobalStorybookStyles } from './GlobalStorybookStyles';
|
|
2
1
|
export { default as StoryPage } from './StoryPage';
|
|
3
2
|
export { default as ExampleContainer } from './ExampleContainer';
|
|
4
3
|
export { default as Paper } from './Paper';
|
|
5
|
-
export { default as Placeholder } from './Placeholder';
|
|
6
|
-
export { default as MarkdownStory } from './MarkdownStory';
|
|
4
|
+
export { default as Placeholder } from './Placeholder';
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/markdown/Markdown.d.ts
CHANGED
package/markdown/Markdown.js
CHANGED
|
@@ -1,55 +1,18 @@
|
|
|
1
|
-
var _excluded = ["children"];
|
|
2
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
|
|
4
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) { o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
|
|
5
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } } return t; }
|
|
6
|
-
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; }
|
|
7
|
-
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; }
|
|
8
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
9
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
10
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
11
1
|
import React from 'react';
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var ListItemRenderer = function ListItemRenderer(props) {
|
|
18
|
-
var checkbox = null;
|
|
19
|
-
if (props.checked !== null) {
|
|
20
|
-
var checked = props.checked;
|
|
21
|
-
checkbox = /*#__PURE__*/React.createElement('input', {
|
|
22
|
-
type: 'checkbox',
|
|
23
|
-
checked: checked,
|
|
24
|
-
readOnly: true,
|
|
25
|
-
style: {
|
|
26
|
-
margin: '4px'
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
return /*#__PURE__*/React.createElement('li', {
|
|
31
|
-
style: {
|
|
32
|
-
marginTop: 4,
|
|
33
|
-
lineHeight: 1.5
|
|
34
|
-
}
|
|
35
|
-
}, checkbox, props.children);
|
|
36
|
-
};
|
|
37
|
-
var TableRenderer = function TableRenderer(props) {
|
|
38
|
-
return /*#__PURE__*/React.createElement('table', {
|
|
39
|
-
className: 'markdown-table'
|
|
40
|
-
}, props.children);
|
|
41
|
-
};
|
|
42
|
-
var customRenderers = _objectSpread(_objectSpread({}, renderers), {}, {
|
|
43
|
-
listItem: ListItemRenderer,
|
|
44
|
-
table: TableRenderer
|
|
2
|
+
import { marked } from 'marked';
|
|
3
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
4
|
+
marked.setOptions({
|
|
5
|
+
gfm: true,
|
|
6
|
+
breaks: false
|
|
45
7
|
});
|
|
46
8
|
var Markdown = function Markdown(_ref) {
|
|
47
|
-
var children = _ref.children
|
|
48
|
-
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
9
|
+
var children = _ref.children;
|
|
10
|
+
var html = marked.parse(children);
|
|
11
|
+
return _jsx("div", {
|
|
12
|
+
className: "markdown-body",
|
|
13
|
+
dangerouslySetInnerHTML: {
|
|
14
|
+
__html: html
|
|
15
|
+
}
|
|
16
|
+
});
|
|
54
17
|
};
|
|
55
18
|
export default Markdown;
|
package/markdown/Md.d.ts
CHANGED
package/markdown/Md.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Markdown from './Markdown';
|
|
3
|
-
import { jsx as
|
|
3
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
4
4
|
export var Md = function Md(strings) {
|
|
5
5
|
for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
6
6
|
values[_key - 1] = arguments[_key];
|
|
@@ -8,6 +8,8 @@ export var Md = function Md(strings) {
|
|
|
8
8
|
var source = strings.reduce(function (res, str, i) {
|
|
9
9
|
return "".concat(res).concat(str).concat(values[i] || '');
|
|
10
10
|
});
|
|
11
|
-
return
|
|
11
|
+
return _jsx(Markdown, {
|
|
12
|
+
children: source
|
|
13
|
+
});
|
|
12
14
|
};
|
|
13
15
|
export default Md;
|