@xsolla/xui-markdown 0.64.0-pr56.1768440195

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.
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+
3
+ interface MarkdownProps {
4
+ children: string;
5
+ className?: string;
6
+ }
7
+ declare const Markdown: React.FC<MarkdownProps>;
8
+
9
+ export { Markdown, type MarkdownProps };
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+
3
+ interface MarkdownProps {
4
+ children: string;
5
+ className?: string;
6
+ }
7
+ declare const Markdown: React.FC<MarkdownProps>;
8
+
9
+ export { Markdown, type MarkdownProps };
@@ -0,0 +1,166 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.tsx
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ Markdown: () => Markdown
34
+ });
35
+ module.exports = __toCommonJS(index_exports);
36
+
37
+ // src/Markdown.tsx
38
+ var import_react_markdown = __toESM(require("react-markdown"));
39
+ var import_styled_components = __toESM(require("styled-components"));
40
+ var import_xui_core = require("@xsolla/xui-core");
41
+ var import_jsx_runtime = require("react/jsx-runtime");
42
+ var MarkdownContainer = import_styled_components.default.div`
43
+ color: ${(props) => props.themeColors?.content?.primary || "white"};
44
+ font-family: ${(props) => props.fonts?.primary || "sans-serif"};
45
+
46
+ h1 {
47
+ font-size: 40px;
48
+ font-weight: 700;
49
+ line-height: 48px;
50
+ margin: 0;
51
+ padding-top: 0px;
52
+ padding-bottom: 6px;
53
+ }
54
+
55
+ h2 {
56
+ font-size: 32px;
57
+ font-weight: 700;
58
+ line-height: 38px;
59
+ margin: 0;
60
+ padding-top: 2px;
61
+ padding-bottom: 8px;
62
+ }
63
+
64
+ h3 {
65
+ font-size: 28px;
66
+ font-weight: 700;
67
+ line-height: 34px;
68
+ margin: 0;
69
+ padding-top: 4px;
70
+ padding-bottom: 8px;
71
+ }
72
+
73
+ h4 {
74
+ font-size: 24px;
75
+ font-weight: 700;
76
+ line-height: 28px;
77
+ margin: 0;
78
+ padding-top: 6px;
79
+ padding-bottom: 10px;
80
+ }
81
+
82
+ p {
83
+ font-size: 16px;
84
+ font-weight: 400;
85
+ line-height: 22px;
86
+ margin: 0;
87
+ padding-top: 0px;
88
+ padding-bottom: 4px;
89
+ }
90
+
91
+ img {
92
+ max-width: 100%;
93
+ height: auto;
94
+ display: block;
95
+ margin: 16px 0;
96
+ }
97
+
98
+ ul,
99
+ ol {
100
+ margin: 8px 0;
101
+ padding-left: 24px;
102
+ }
103
+
104
+ li {
105
+ font-size: 16px;
106
+ line-height: 22px;
107
+ margin-bottom: 4px;
108
+ }
109
+
110
+ code {
111
+ background: rgba(255, 255, 255, 0.1);
112
+ padding: 2px 4px;
113
+ border-radius: 4px;
114
+ font-family: monospace;
115
+ }
116
+
117
+ pre {
118
+ background: rgba(255, 255, 255, 0.05);
119
+ padding: 16px;
120
+ border-radius: 8px;
121
+ overflow-x: auto;
122
+ margin: 16px 0;
123
+
124
+ code {
125
+ background: none;
126
+ padding: 0;
127
+ }
128
+ }
129
+
130
+ blockquote {
131
+ border-left: 4px solid
132
+ ${(props) => props.themeColors?.border?.brand || "#66e6ff"};
133
+ margin: 16px 0;
134
+ padding: 8px 16px;
135
+ background: rgba(102, 230, 255, 0.05);
136
+
137
+ p {
138
+ padding-bottom: 0;
139
+ }
140
+ }
141
+
142
+ a {
143
+ color: ${(props) => props.themeColors?.control?.link?.primary || "#66e6ff"};
144
+ text-decoration: none;
145
+ &:hover {
146
+ text-decoration: underline;
147
+ }
148
+ }
149
+ `;
150
+ var Markdown = ({ children, className }) => {
151
+ const { theme } = (0, import_xui_core.useDesignSystem)();
152
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
153
+ MarkdownContainer,
154
+ {
155
+ className,
156
+ themeColors: theme.colors,
157
+ fonts: theme.fonts,
158
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_markdown.default, { children })
159
+ }
160
+ );
161
+ };
162
+ // Annotate the CommonJS export names for ESM import in node:
163
+ 0 && (module.exports = {
164
+ Markdown
165
+ });
166
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.tsx","../../src/Markdown.tsx"],"sourcesContent":["export * from \"./Markdown\";\n","import React from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport styled from \"styled-components\";\nimport { useDesignSystem, ThemeColors } from \"@xsolla/xui-core\";\n\ninterface MarkdownContainerProps {\n themeColors: ThemeColors;\n fonts: { primary: string };\n}\n\nconst MarkdownContainer = styled.div<MarkdownContainerProps>`\n color: ${(props) => props.themeColors?.content?.primary || \"white\"};\n font-family: ${(props) => props.fonts?.primary || \"sans-serif\"};\n\n h1 {\n font-size: 40px;\n font-weight: 700;\n line-height: 48px;\n margin: 0;\n padding-top: 0px;\n padding-bottom: 6px;\n }\n\n h2 {\n font-size: 32px;\n font-weight: 700;\n line-height: 38px;\n margin: 0;\n padding-top: 2px;\n padding-bottom: 8px;\n }\n\n h3 {\n font-size: 28px;\n font-weight: 700;\n line-height: 34px;\n margin: 0;\n padding-top: 4px;\n padding-bottom: 8px;\n }\n\n h4 {\n font-size: 24px;\n font-weight: 700;\n line-height: 28px;\n margin: 0;\n padding-top: 6px;\n padding-bottom: 10px;\n }\n\n p {\n font-size: 16px;\n font-weight: 400;\n line-height: 22px;\n margin: 0;\n padding-top: 0px;\n padding-bottom: 4px;\n }\n\n img {\n max-width: 100%;\n height: auto;\n display: block;\n margin: 16px 0;\n }\n\n ul,\n ol {\n margin: 8px 0;\n padding-left: 24px;\n }\n\n li {\n font-size: 16px;\n line-height: 22px;\n margin-bottom: 4px;\n }\n\n code {\n background: rgba(255, 255, 255, 0.1);\n padding: 2px 4px;\n border-radius: 4px;\n font-family: monospace;\n }\n\n pre {\n background: rgba(255, 255, 255, 0.05);\n padding: 16px;\n border-radius: 8px;\n overflow-x: auto;\n margin: 16px 0;\n\n code {\n background: none;\n padding: 0;\n }\n }\n\n blockquote {\n border-left: 4px solid\n ${(props) => props.themeColors?.border?.brand || \"#66e6ff\"};\n margin: 16px 0;\n padding: 8px 16px;\n background: rgba(102, 230, 255, 0.05);\n\n p {\n padding-bottom: 0;\n }\n }\n\n a {\n color: ${(props) => props.themeColors?.control?.link?.primary || \"#66e6ff\"};\n text-decoration: none;\n &:hover {\n text-decoration: underline;\n }\n }\n`;\n\nexport interface MarkdownProps {\n children: string;\n className?: string;\n}\n\nexport const Markdown: React.FC<MarkdownProps> = ({ children, className }) => {\n const { theme } = useDesignSystem();\n\n return (\n <MarkdownContainer\n className={className}\n themeColors={theme.colors}\n fonts={theme.fonts}\n >\n <ReactMarkdown>{children}</ReactMarkdown>\n </MarkdownContainer>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,4BAA0B;AAC1B,+BAAmB;AACnB,sBAA6C;AAkIvC;AA3HN,IAAM,oBAAoB,yBAAAA,QAAO;AAAA,WACtB,CAAC,UAAU,MAAM,aAAa,SAAS,WAAW,OAAO;AAAA,iBACnD,CAAC,UAAU,MAAM,OAAO,WAAW,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAwFxD,CAAC,UAAU,MAAM,aAAa,QAAQ,SAAS,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAWnD,CAAC,UAAU,MAAM,aAAa,SAAS,MAAM,WAAW,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAavE,IAAM,WAAoC,CAAC,EAAE,UAAU,UAAU,MAAM;AAC5E,QAAM,EAAE,MAAM,QAAI,iCAAgB;AAElC,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,aAAa,MAAM;AAAA,MACnB,OAAO,MAAM;AAAA,MAEb,sDAAC,sBAAAC,SAAA,EAAe,UAAS;AAAA;AAAA,EAC3B;AAEJ;","names":["styled","ReactMarkdown"]}
@@ -0,0 +1,129 @@
1
+ // src/Markdown.tsx
2
+ import ReactMarkdown from "react-markdown";
3
+ import styled from "styled-components";
4
+ import { useDesignSystem } from "@xsolla/xui-core";
5
+ import { jsx } from "react/jsx-runtime";
6
+ var MarkdownContainer = styled.div`
7
+ color: ${(props) => props.themeColors?.content?.primary || "white"};
8
+ font-family: ${(props) => props.fonts?.primary || "sans-serif"};
9
+
10
+ h1 {
11
+ font-size: 40px;
12
+ font-weight: 700;
13
+ line-height: 48px;
14
+ margin: 0;
15
+ padding-top: 0px;
16
+ padding-bottom: 6px;
17
+ }
18
+
19
+ h2 {
20
+ font-size: 32px;
21
+ font-weight: 700;
22
+ line-height: 38px;
23
+ margin: 0;
24
+ padding-top: 2px;
25
+ padding-bottom: 8px;
26
+ }
27
+
28
+ h3 {
29
+ font-size: 28px;
30
+ font-weight: 700;
31
+ line-height: 34px;
32
+ margin: 0;
33
+ padding-top: 4px;
34
+ padding-bottom: 8px;
35
+ }
36
+
37
+ h4 {
38
+ font-size: 24px;
39
+ font-weight: 700;
40
+ line-height: 28px;
41
+ margin: 0;
42
+ padding-top: 6px;
43
+ padding-bottom: 10px;
44
+ }
45
+
46
+ p {
47
+ font-size: 16px;
48
+ font-weight: 400;
49
+ line-height: 22px;
50
+ margin: 0;
51
+ padding-top: 0px;
52
+ padding-bottom: 4px;
53
+ }
54
+
55
+ img {
56
+ max-width: 100%;
57
+ height: auto;
58
+ display: block;
59
+ margin: 16px 0;
60
+ }
61
+
62
+ ul,
63
+ ol {
64
+ margin: 8px 0;
65
+ padding-left: 24px;
66
+ }
67
+
68
+ li {
69
+ font-size: 16px;
70
+ line-height: 22px;
71
+ margin-bottom: 4px;
72
+ }
73
+
74
+ code {
75
+ background: rgba(255, 255, 255, 0.1);
76
+ padding: 2px 4px;
77
+ border-radius: 4px;
78
+ font-family: monospace;
79
+ }
80
+
81
+ pre {
82
+ background: rgba(255, 255, 255, 0.05);
83
+ padding: 16px;
84
+ border-radius: 8px;
85
+ overflow-x: auto;
86
+ margin: 16px 0;
87
+
88
+ code {
89
+ background: none;
90
+ padding: 0;
91
+ }
92
+ }
93
+
94
+ blockquote {
95
+ border-left: 4px solid
96
+ ${(props) => props.themeColors?.border?.brand || "#66e6ff"};
97
+ margin: 16px 0;
98
+ padding: 8px 16px;
99
+ background: rgba(102, 230, 255, 0.05);
100
+
101
+ p {
102
+ padding-bottom: 0;
103
+ }
104
+ }
105
+
106
+ a {
107
+ color: ${(props) => props.themeColors?.control?.link?.primary || "#66e6ff"};
108
+ text-decoration: none;
109
+ &:hover {
110
+ text-decoration: underline;
111
+ }
112
+ }
113
+ `;
114
+ var Markdown = ({ children, className }) => {
115
+ const { theme } = useDesignSystem();
116
+ return /* @__PURE__ */ jsx(
117
+ MarkdownContainer,
118
+ {
119
+ className,
120
+ themeColors: theme.colors,
121
+ fonts: theme.fonts,
122
+ children: /* @__PURE__ */ jsx(ReactMarkdown, { children })
123
+ }
124
+ );
125
+ };
126
+ export {
127
+ Markdown
128
+ };
129
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Markdown.tsx"],"sourcesContent":["import React from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport styled from \"styled-components\";\nimport { useDesignSystem, ThemeColors } from \"@xsolla/xui-core\";\n\ninterface MarkdownContainerProps {\n themeColors: ThemeColors;\n fonts: { primary: string };\n}\n\nconst MarkdownContainer = styled.div<MarkdownContainerProps>`\n color: ${(props) => props.themeColors?.content?.primary || \"white\"};\n font-family: ${(props) => props.fonts?.primary || \"sans-serif\"};\n\n h1 {\n font-size: 40px;\n font-weight: 700;\n line-height: 48px;\n margin: 0;\n padding-top: 0px;\n padding-bottom: 6px;\n }\n\n h2 {\n font-size: 32px;\n font-weight: 700;\n line-height: 38px;\n margin: 0;\n padding-top: 2px;\n padding-bottom: 8px;\n }\n\n h3 {\n font-size: 28px;\n font-weight: 700;\n line-height: 34px;\n margin: 0;\n padding-top: 4px;\n padding-bottom: 8px;\n }\n\n h4 {\n font-size: 24px;\n font-weight: 700;\n line-height: 28px;\n margin: 0;\n padding-top: 6px;\n padding-bottom: 10px;\n }\n\n p {\n font-size: 16px;\n font-weight: 400;\n line-height: 22px;\n margin: 0;\n padding-top: 0px;\n padding-bottom: 4px;\n }\n\n img {\n max-width: 100%;\n height: auto;\n display: block;\n margin: 16px 0;\n }\n\n ul,\n ol {\n margin: 8px 0;\n padding-left: 24px;\n }\n\n li {\n font-size: 16px;\n line-height: 22px;\n margin-bottom: 4px;\n }\n\n code {\n background: rgba(255, 255, 255, 0.1);\n padding: 2px 4px;\n border-radius: 4px;\n font-family: monospace;\n }\n\n pre {\n background: rgba(255, 255, 255, 0.05);\n padding: 16px;\n border-radius: 8px;\n overflow-x: auto;\n margin: 16px 0;\n\n code {\n background: none;\n padding: 0;\n }\n }\n\n blockquote {\n border-left: 4px solid\n ${(props) => props.themeColors?.border?.brand || \"#66e6ff\"};\n margin: 16px 0;\n padding: 8px 16px;\n background: rgba(102, 230, 255, 0.05);\n\n p {\n padding-bottom: 0;\n }\n }\n\n a {\n color: ${(props) => props.themeColors?.control?.link?.primary || \"#66e6ff\"};\n text-decoration: none;\n &:hover {\n text-decoration: underline;\n }\n }\n`;\n\nexport interface MarkdownProps {\n children: string;\n className?: string;\n}\n\nexport const Markdown: React.FC<MarkdownProps> = ({ children, className }) => {\n const { theme } = useDesignSystem();\n\n return (\n <MarkdownContainer\n className={className}\n themeColors={theme.colors}\n fonts={theme.fonts}\n >\n <ReactMarkdown>{children}</ReactMarkdown>\n </MarkdownContainer>\n );\n};\n"],"mappings":";AACA,OAAO,mBAAmB;AAC1B,OAAO,YAAY;AACnB,SAAS,uBAAoC;AAkIvC;AA3HN,IAAM,oBAAoB,OAAO;AAAA,WACtB,CAAC,UAAU,MAAM,aAAa,SAAS,WAAW,OAAO;AAAA,iBACnD,CAAC,UAAU,MAAM,OAAO,WAAW,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAwFxD,CAAC,UAAU,MAAM,aAAa,QAAQ,SAAS,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAWnD,CAAC,UAAU,MAAM,aAAa,SAAS,MAAM,WAAW,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAavE,IAAM,WAAoC,CAAC,EAAE,UAAU,UAAU,MAAM;AAC5E,QAAM,EAAE,MAAM,IAAI,gBAAgB;AAElC,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,aAAa,MAAM;AAAA,MACnB,OAAO,MAAM;AAAA,MAEb,8BAAC,iBAAe,UAAS;AAAA;AAAA,EAC3B;AAEJ;","names":[]}
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@xsolla/xui-markdown",
3
+ "version": "0.64.0-pr56.1768440195",
4
+ "main": "./web/index.js",
5
+ "module": "./web/index.mjs",
6
+ "types": "./web/index.d.ts",
7
+ "scripts": {
8
+ "build": "yarn build:web && yarn build:native",
9
+ "build:web": "PLATFORM=web tsup src/index.tsx --format esm,cjs --dts --env.PLATFORM web --clean",
10
+ "build:native": "PLATFORM=native tsup src/index.tsx --format esm,cjs --dts --env.PLATFORM native --clean"
11
+ },
12
+ "dependencies": {
13
+ "@xsolla/xui-core": "0.64.0-pr56.1768440195",
14
+ "@xsolla/xui-primitives-core": "0.64.0-pr56.1768440195",
15
+ "react-markdown": "^9.0.0"
16
+ },
17
+ "peerDependencies": {
18
+ "react": ">=16.8.0",
19
+ "styled-components": ">=4"
20
+ },
21
+ "devDependencies": {
22
+ "@types/react": "^18.0.0",
23
+ "@types/styled-components": "^5.1.0",
24
+ "tsup": "^8.0.0"
25
+ },
26
+ "license": "MIT",
27
+ "react-native": "./native/index.js",
28
+ "exports": {
29
+ ".": {
30
+ "react-native": {
31
+ "types": "./native/index.d.ts",
32
+ "import": "./native/index.mjs",
33
+ "require": "./native/index.js"
34
+ },
35
+ "import": {
36
+ "types": "./web/index.d.ts",
37
+ "default": "./web/index.mjs"
38
+ },
39
+ "require": {
40
+ "types": "./web/index.d.ts",
41
+ "default": "./web/index.js"
42
+ },
43
+ "default": {
44
+ "types": "./web/index.d.ts",
45
+ "default": "./web/index.js"
46
+ }
47
+ }
48
+ }
49
+ }
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+
3
+ interface MarkdownProps {
4
+ children: string;
5
+ className?: string;
6
+ }
7
+ declare const Markdown: React.FC<MarkdownProps>;
8
+
9
+ export { Markdown, type MarkdownProps };
package/web/index.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+
3
+ interface MarkdownProps {
4
+ children: string;
5
+ className?: string;
6
+ }
7
+ declare const Markdown: React.FC<MarkdownProps>;
8
+
9
+ export { Markdown, type MarkdownProps };
package/web/index.js ADDED
@@ -0,0 +1,166 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.tsx
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ Markdown: () => Markdown
34
+ });
35
+ module.exports = __toCommonJS(index_exports);
36
+
37
+ // src/Markdown.tsx
38
+ var import_react_markdown = __toESM(require("react-markdown"));
39
+ var import_styled_components = __toESM(require("styled-components"));
40
+ var import_xui_core = require("@xsolla/xui-core");
41
+ var import_jsx_runtime = require("react/jsx-runtime");
42
+ var MarkdownContainer = import_styled_components.default.div`
43
+ color: ${(props) => props.themeColors?.content?.primary || "white"};
44
+ font-family: ${(props) => props.fonts?.primary || "sans-serif"};
45
+
46
+ h1 {
47
+ font-size: 40px;
48
+ font-weight: 700;
49
+ line-height: 48px;
50
+ margin: 0;
51
+ padding-top: 0px;
52
+ padding-bottom: 6px;
53
+ }
54
+
55
+ h2 {
56
+ font-size: 32px;
57
+ font-weight: 700;
58
+ line-height: 38px;
59
+ margin: 0;
60
+ padding-top: 2px;
61
+ padding-bottom: 8px;
62
+ }
63
+
64
+ h3 {
65
+ font-size: 28px;
66
+ font-weight: 700;
67
+ line-height: 34px;
68
+ margin: 0;
69
+ padding-top: 4px;
70
+ padding-bottom: 8px;
71
+ }
72
+
73
+ h4 {
74
+ font-size: 24px;
75
+ font-weight: 700;
76
+ line-height: 28px;
77
+ margin: 0;
78
+ padding-top: 6px;
79
+ padding-bottom: 10px;
80
+ }
81
+
82
+ p {
83
+ font-size: 16px;
84
+ font-weight: 400;
85
+ line-height: 22px;
86
+ margin: 0;
87
+ padding-top: 0px;
88
+ padding-bottom: 4px;
89
+ }
90
+
91
+ img {
92
+ max-width: 100%;
93
+ height: auto;
94
+ display: block;
95
+ margin: 16px 0;
96
+ }
97
+
98
+ ul,
99
+ ol {
100
+ margin: 8px 0;
101
+ padding-left: 24px;
102
+ }
103
+
104
+ li {
105
+ font-size: 16px;
106
+ line-height: 22px;
107
+ margin-bottom: 4px;
108
+ }
109
+
110
+ code {
111
+ background: rgba(255, 255, 255, 0.1);
112
+ padding: 2px 4px;
113
+ border-radius: 4px;
114
+ font-family: monospace;
115
+ }
116
+
117
+ pre {
118
+ background: rgba(255, 255, 255, 0.05);
119
+ padding: 16px;
120
+ border-radius: 8px;
121
+ overflow-x: auto;
122
+ margin: 16px 0;
123
+
124
+ code {
125
+ background: none;
126
+ padding: 0;
127
+ }
128
+ }
129
+
130
+ blockquote {
131
+ border-left: 4px solid
132
+ ${(props) => props.themeColors?.border?.brand || "#66e6ff"};
133
+ margin: 16px 0;
134
+ padding: 8px 16px;
135
+ background: rgba(102, 230, 255, 0.05);
136
+
137
+ p {
138
+ padding-bottom: 0;
139
+ }
140
+ }
141
+
142
+ a {
143
+ color: ${(props) => props.themeColors?.control?.link?.primary || "#66e6ff"};
144
+ text-decoration: none;
145
+ &:hover {
146
+ text-decoration: underline;
147
+ }
148
+ }
149
+ `;
150
+ var Markdown = ({ children, className }) => {
151
+ const { theme } = (0, import_xui_core.useDesignSystem)();
152
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
153
+ MarkdownContainer,
154
+ {
155
+ className,
156
+ themeColors: theme.colors,
157
+ fonts: theme.fonts,
158
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_markdown.default, { children })
159
+ }
160
+ );
161
+ };
162
+ // Annotate the CommonJS export names for ESM import in node:
163
+ 0 && (module.exports = {
164
+ Markdown
165
+ });
166
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.tsx","../../src/Markdown.tsx"],"sourcesContent":["export * from \"./Markdown\";\n","import React from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport styled from \"styled-components\";\nimport { useDesignSystem, ThemeColors } from \"@xsolla/xui-core\";\n\ninterface MarkdownContainerProps {\n themeColors: ThemeColors;\n fonts: { primary: string };\n}\n\nconst MarkdownContainer = styled.div<MarkdownContainerProps>`\n color: ${(props) => props.themeColors?.content?.primary || \"white\"};\n font-family: ${(props) => props.fonts?.primary || \"sans-serif\"};\n\n h1 {\n font-size: 40px;\n font-weight: 700;\n line-height: 48px;\n margin: 0;\n padding-top: 0px;\n padding-bottom: 6px;\n }\n\n h2 {\n font-size: 32px;\n font-weight: 700;\n line-height: 38px;\n margin: 0;\n padding-top: 2px;\n padding-bottom: 8px;\n }\n\n h3 {\n font-size: 28px;\n font-weight: 700;\n line-height: 34px;\n margin: 0;\n padding-top: 4px;\n padding-bottom: 8px;\n }\n\n h4 {\n font-size: 24px;\n font-weight: 700;\n line-height: 28px;\n margin: 0;\n padding-top: 6px;\n padding-bottom: 10px;\n }\n\n p {\n font-size: 16px;\n font-weight: 400;\n line-height: 22px;\n margin: 0;\n padding-top: 0px;\n padding-bottom: 4px;\n }\n\n img {\n max-width: 100%;\n height: auto;\n display: block;\n margin: 16px 0;\n }\n\n ul,\n ol {\n margin: 8px 0;\n padding-left: 24px;\n }\n\n li {\n font-size: 16px;\n line-height: 22px;\n margin-bottom: 4px;\n }\n\n code {\n background: rgba(255, 255, 255, 0.1);\n padding: 2px 4px;\n border-radius: 4px;\n font-family: monospace;\n }\n\n pre {\n background: rgba(255, 255, 255, 0.05);\n padding: 16px;\n border-radius: 8px;\n overflow-x: auto;\n margin: 16px 0;\n\n code {\n background: none;\n padding: 0;\n }\n }\n\n blockquote {\n border-left: 4px solid\n ${(props) => props.themeColors?.border?.brand || \"#66e6ff\"};\n margin: 16px 0;\n padding: 8px 16px;\n background: rgba(102, 230, 255, 0.05);\n\n p {\n padding-bottom: 0;\n }\n }\n\n a {\n color: ${(props) => props.themeColors?.control?.link?.primary || \"#66e6ff\"};\n text-decoration: none;\n &:hover {\n text-decoration: underline;\n }\n }\n`;\n\nexport interface MarkdownProps {\n children: string;\n className?: string;\n}\n\nexport const Markdown: React.FC<MarkdownProps> = ({ children, className }) => {\n const { theme } = useDesignSystem();\n\n return (\n <MarkdownContainer\n className={className}\n themeColors={theme.colors}\n fonts={theme.fonts}\n >\n <ReactMarkdown>{children}</ReactMarkdown>\n </MarkdownContainer>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,4BAA0B;AAC1B,+BAAmB;AACnB,sBAA6C;AAkIvC;AA3HN,IAAM,oBAAoB,yBAAAA,QAAO;AAAA,WACtB,CAAC,UAAU,MAAM,aAAa,SAAS,WAAW,OAAO;AAAA,iBACnD,CAAC,UAAU,MAAM,OAAO,WAAW,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAwFxD,CAAC,UAAU,MAAM,aAAa,QAAQ,SAAS,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAWnD,CAAC,UAAU,MAAM,aAAa,SAAS,MAAM,WAAW,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAavE,IAAM,WAAoC,CAAC,EAAE,UAAU,UAAU,MAAM;AAC5E,QAAM,EAAE,MAAM,QAAI,iCAAgB;AAElC,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,aAAa,MAAM;AAAA,MACnB,OAAO,MAAM;AAAA,MAEb,sDAAC,sBAAAC,SAAA,EAAe,UAAS;AAAA;AAAA,EAC3B;AAEJ;","names":["styled","ReactMarkdown"]}
package/web/index.mjs ADDED
@@ -0,0 +1,129 @@
1
+ // src/Markdown.tsx
2
+ import ReactMarkdown from "react-markdown";
3
+ import styled from "styled-components";
4
+ import { useDesignSystem } from "@xsolla/xui-core";
5
+ import { jsx } from "react/jsx-runtime";
6
+ var MarkdownContainer = styled.div`
7
+ color: ${(props) => props.themeColors?.content?.primary || "white"};
8
+ font-family: ${(props) => props.fonts?.primary || "sans-serif"};
9
+
10
+ h1 {
11
+ font-size: 40px;
12
+ font-weight: 700;
13
+ line-height: 48px;
14
+ margin: 0;
15
+ padding-top: 0px;
16
+ padding-bottom: 6px;
17
+ }
18
+
19
+ h2 {
20
+ font-size: 32px;
21
+ font-weight: 700;
22
+ line-height: 38px;
23
+ margin: 0;
24
+ padding-top: 2px;
25
+ padding-bottom: 8px;
26
+ }
27
+
28
+ h3 {
29
+ font-size: 28px;
30
+ font-weight: 700;
31
+ line-height: 34px;
32
+ margin: 0;
33
+ padding-top: 4px;
34
+ padding-bottom: 8px;
35
+ }
36
+
37
+ h4 {
38
+ font-size: 24px;
39
+ font-weight: 700;
40
+ line-height: 28px;
41
+ margin: 0;
42
+ padding-top: 6px;
43
+ padding-bottom: 10px;
44
+ }
45
+
46
+ p {
47
+ font-size: 16px;
48
+ font-weight: 400;
49
+ line-height: 22px;
50
+ margin: 0;
51
+ padding-top: 0px;
52
+ padding-bottom: 4px;
53
+ }
54
+
55
+ img {
56
+ max-width: 100%;
57
+ height: auto;
58
+ display: block;
59
+ margin: 16px 0;
60
+ }
61
+
62
+ ul,
63
+ ol {
64
+ margin: 8px 0;
65
+ padding-left: 24px;
66
+ }
67
+
68
+ li {
69
+ font-size: 16px;
70
+ line-height: 22px;
71
+ margin-bottom: 4px;
72
+ }
73
+
74
+ code {
75
+ background: rgba(255, 255, 255, 0.1);
76
+ padding: 2px 4px;
77
+ border-radius: 4px;
78
+ font-family: monospace;
79
+ }
80
+
81
+ pre {
82
+ background: rgba(255, 255, 255, 0.05);
83
+ padding: 16px;
84
+ border-radius: 8px;
85
+ overflow-x: auto;
86
+ margin: 16px 0;
87
+
88
+ code {
89
+ background: none;
90
+ padding: 0;
91
+ }
92
+ }
93
+
94
+ blockquote {
95
+ border-left: 4px solid
96
+ ${(props) => props.themeColors?.border?.brand || "#66e6ff"};
97
+ margin: 16px 0;
98
+ padding: 8px 16px;
99
+ background: rgba(102, 230, 255, 0.05);
100
+
101
+ p {
102
+ padding-bottom: 0;
103
+ }
104
+ }
105
+
106
+ a {
107
+ color: ${(props) => props.themeColors?.control?.link?.primary || "#66e6ff"};
108
+ text-decoration: none;
109
+ &:hover {
110
+ text-decoration: underline;
111
+ }
112
+ }
113
+ `;
114
+ var Markdown = ({ children, className }) => {
115
+ const { theme } = useDesignSystem();
116
+ return /* @__PURE__ */ jsx(
117
+ MarkdownContainer,
118
+ {
119
+ className,
120
+ themeColors: theme.colors,
121
+ fonts: theme.fonts,
122
+ children: /* @__PURE__ */ jsx(ReactMarkdown, { children })
123
+ }
124
+ );
125
+ };
126
+ export {
127
+ Markdown
128
+ };
129
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Markdown.tsx"],"sourcesContent":["import React from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport styled from \"styled-components\";\nimport { useDesignSystem, ThemeColors } from \"@xsolla/xui-core\";\n\ninterface MarkdownContainerProps {\n themeColors: ThemeColors;\n fonts: { primary: string };\n}\n\nconst MarkdownContainer = styled.div<MarkdownContainerProps>`\n color: ${(props) => props.themeColors?.content?.primary || \"white\"};\n font-family: ${(props) => props.fonts?.primary || \"sans-serif\"};\n\n h1 {\n font-size: 40px;\n font-weight: 700;\n line-height: 48px;\n margin: 0;\n padding-top: 0px;\n padding-bottom: 6px;\n }\n\n h2 {\n font-size: 32px;\n font-weight: 700;\n line-height: 38px;\n margin: 0;\n padding-top: 2px;\n padding-bottom: 8px;\n }\n\n h3 {\n font-size: 28px;\n font-weight: 700;\n line-height: 34px;\n margin: 0;\n padding-top: 4px;\n padding-bottom: 8px;\n }\n\n h4 {\n font-size: 24px;\n font-weight: 700;\n line-height: 28px;\n margin: 0;\n padding-top: 6px;\n padding-bottom: 10px;\n }\n\n p {\n font-size: 16px;\n font-weight: 400;\n line-height: 22px;\n margin: 0;\n padding-top: 0px;\n padding-bottom: 4px;\n }\n\n img {\n max-width: 100%;\n height: auto;\n display: block;\n margin: 16px 0;\n }\n\n ul,\n ol {\n margin: 8px 0;\n padding-left: 24px;\n }\n\n li {\n font-size: 16px;\n line-height: 22px;\n margin-bottom: 4px;\n }\n\n code {\n background: rgba(255, 255, 255, 0.1);\n padding: 2px 4px;\n border-radius: 4px;\n font-family: monospace;\n }\n\n pre {\n background: rgba(255, 255, 255, 0.05);\n padding: 16px;\n border-radius: 8px;\n overflow-x: auto;\n margin: 16px 0;\n\n code {\n background: none;\n padding: 0;\n }\n }\n\n blockquote {\n border-left: 4px solid\n ${(props) => props.themeColors?.border?.brand || \"#66e6ff\"};\n margin: 16px 0;\n padding: 8px 16px;\n background: rgba(102, 230, 255, 0.05);\n\n p {\n padding-bottom: 0;\n }\n }\n\n a {\n color: ${(props) => props.themeColors?.control?.link?.primary || \"#66e6ff\"};\n text-decoration: none;\n &:hover {\n text-decoration: underline;\n }\n }\n`;\n\nexport interface MarkdownProps {\n children: string;\n className?: string;\n}\n\nexport const Markdown: React.FC<MarkdownProps> = ({ children, className }) => {\n const { theme } = useDesignSystem();\n\n return (\n <MarkdownContainer\n className={className}\n themeColors={theme.colors}\n fonts={theme.fonts}\n >\n <ReactMarkdown>{children}</ReactMarkdown>\n </MarkdownContainer>\n );\n};\n"],"mappings":";AACA,OAAO,mBAAmB;AAC1B,OAAO,YAAY;AACnB,SAAS,uBAAoC;AAkIvC;AA3HN,IAAM,oBAAoB,OAAO;AAAA,WACtB,CAAC,UAAU,MAAM,aAAa,SAAS,WAAW,OAAO;AAAA,iBACnD,CAAC,UAAU,MAAM,OAAO,WAAW,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAwFxD,CAAC,UAAU,MAAM,aAAa,QAAQ,SAAS,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAWnD,CAAC,UAAU,MAAM,aAAa,SAAS,MAAM,WAAW,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAavE,IAAM,WAAoC,CAAC,EAAE,UAAU,UAAU,MAAM;AAC5E,QAAM,EAAE,MAAM,IAAI,gBAAgB;AAElC,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,aAAa,MAAM;AAAA,MACnB,OAAO,MAAM;AAAA,MAEb,8BAAC,iBAAe,UAAS;AAAA;AAAA,EAC3B;AAEJ;","names":[]}