@raketa-builder/markdown-input 0.2.0 → 0.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/.turbo/turbo-build.log +2 -2
- package/.turbo/turbo-lint.log +12 -12
- package/dist/index.js +457 -724
- package/package.json +2 -3
- package/src/MarkdownInput.js +18 -55
- package/src/styles.css +47 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raketa-builder/markdown-input",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"dev": "tsup src/index.js --format cjs --loader \".js=jsx\" --watch"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"styled-components": "^5.1.0",
|
|
14
13
|
"react": "18.2.0",
|
|
15
14
|
"react-dom": "18.2.0"
|
|
16
15
|
},
|
|
@@ -26,7 +25,7 @@
|
|
|
26
25
|
"eslint-config-custom": "*",
|
|
27
26
|
"react": "18.2.0",
|
|
28
27
|
"tsconfig": "*",
|
|
29
|
-
"tsup": "
|
|
28
|
+
"tsup": "6.5.0",
|
|
30
29
|
"typescript": "4.5.2"
|
|
31
30
|
}
|
|
32
31
|
}
|
package/src/MarkdownInput.js
CHANGED
|
@@ -1,62 +1,25 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
FormGroup,
|
|
4
|
-
Label,
|
|
5
|
-
Textarea,
|
|
6
|
-
buttonReset,
|
|
7
|
-
Hint,
|
|
8
|
-
} from "@raketa-builder/ui";
|
|
9
|
-
import styled from "styled-components";
|
|
2
|
+
import { FormGroup, Label, Textarea, Hint, cn } from "@raketa-builder/ui";
|
|
10
3
|
import toHTML from "./toHTML";
|
|
11
4
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const IconButton = styled.button`
|
|
19
|
-
${buttonReset};
|
|
20
|
-
width: 2em;
|
|
21
|
-
height: 2em;
|
|
22
|
-
border-radius: 50%;
|
|
23
|
-
background-color: ${(props) => props.theme.colors.black};
|
|
24
|
-
background-repeat: no-repeat;
|
|
25
|
-
background-position: center;
|
|
26
|
-
background-size: 50%;
|
|
27
|
-
color: ${(props) => props.theme.colors.white};
|
|
28
|
-
font-weight: 700;
|
|
29
|
-
text-align: center;
|
|
30
|
-
text-decoration: none;
|
|
31
|
-
line-height: 1.5;
|
|
32
|
-
text-indent: -9999px;
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
transition: all 0.3s ease-in-out;
|
|
35
|
-
|
|
36
|
-
&:hover {
|
|
37
|
-
background-color: ${(props) => props.theme.colors.primary};
|
|
38
|
-
}
|
|
39
|
-
`;
|
|
5
|
+
const IconButton = ({ className, ...props }) => (
|
|
6
|
+
<button
|
|
7
|
+
className={cn("r-reset-button", "r-md-icon-btn", className)}
|
|
8
|
+
{...props}
|
|
9
|
+
/>
|
|
10
|
+
);
|
|
40
11
|
|
|
41
|
-
const TextareaWrapper =
|
|
42
|
-
|
|
43
|
-
|
|
12
|
+
const TextareaWrapper = ({ className, ...props }) => (
|
|
13
|
+
<div className={cn("r-reset", "r-md-textarea", className)} {...props} />
|
|
14
|
+
);
|
|
44
15
|
|
|
45
|
-
const ButtonToolbar =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
bottom: 1em;
|
|
49
|
-
display: flex;
|
|
50
|
-
gap: 0.5em;
|
|
51
|
-
`;
|
|
16
|
+
const ButtonToolbar = ({ className, ...props }) => (
|
|
17
|
+
<div className={cn("r-reset", "r-md-btn-toolbar", className)} {...props} />
|
|
18
|
+
);
|
|
52
19
|
|
|
53
|
-
const PreviewPane =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
overflow-y: auto;
|
|
57
|
-
border: 1px dashed ${(props) => props.theme.colors.primary};
|
|
58
|
-
background-color: ${(props) => props.theme.colors.trueWhite};
|
|
59
|
-
`;
|
|
20
|
+
const PreviewPane = ({ className, ...props }) => (
|
|
21
|
+
<div className={cn("r-reset", "r-md-preview-pane", className)} {...props} />
|
|
22
|
+
);
|
|
60
23
|
|
|
61
24
|
const MarkdownInput = ({
|
|
62
25
|
label = "Text",
|
|
@@ -99,7 +62,7 @@ const MarkdownInput = ({
|
|
|
99
62
|
<ButtonToolbar>
|
|
100
63
|
<IconButton
|
|
101
64
|
type="button"
|
|
102
|
-
style={{ backgroundImage: `
|
|
65
|
+
style={{ backgroundImage: `var(--icon-eye)` }}
|
|
103
66
|
onClick={() => setOpen(!open)}
|
|
104
67
|
>
|
|
105
68
|
Preview
|
|
@@ -107,7 +70,7 @@ const MarkdownInput = ({
|
|
|
107
70
|
<IconButton
|
|
108
71
|
as="a"
|
|
109
72
|
style={{
|
|
110
|
-
backgroundImage: `
|
|
73
|
+
backgroundImage: `var(--icon-question-mark)`,
|
|
111
74
|
backgroundSize: "30%",
|
|
112
75
|
}}
|
|
113
76
|
href={documentationLink}
|
package/src/styles.css
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
@layer raketa-builder {
|
|
2
|
+
.r-md-icon-btn {
|
|
3
|
+
width: 2em;
|
|
4
|
+
height: 2em;
|
|
5
|
+
border-radius: 50%;
|
|
6
|
+
background-color: var(--r-black);
|
|
7
|
+
background-repeat: no-repeat;
|
|
8
|
+
background-position: center;
|
|
9
|
+
background-size: 50%;
|
|
10
|
+
color: var(--r-white);
|
|
11
|
+
font-weight: 700;
|
|
12
|
+
text-align: center;
|
|
13
|
+
text-decoration: none;
|
|
14
|
+
line-height: 1.5;
|
|
15
|
+
text-indent: -9999px;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
transition: all 0.3s ease-in-out;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.r-md-icon-btn:hover {
|
|
21
|
+
background-color: var(--r-primary);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.r-md-textarea {
|
|
25
|
+
position: relative;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.r-md-btn-toolbar {
|
|
29
|
+
position: absolute;
|
|
30
|
+
right: 0.5em;
|
|
31
|
+
bottom: 1em;
|
|
32
|
+
display: flex;
|
|
33
|
+
gap: 0.5em;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.r-md-preview-pane {
|
|
37
|
+
padding: 1em;
|
|
38
|
+
overflow-y: auto;
|
|
39
|
+
border: 1px dashed var(--r-primary);
|
|
40
|
+
background-color: var(--r-true-white);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:root {
|
|
44
|
+
--icon-eye: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAuNzUgOUMwLjc1IDkgMy43NSAzIDkgM0MxNC4yNSAzIDE3LjI1IDkgMTcuMjUgOUMxNy4yNSA5IDE0LjI1IDE1IDkgMTVDMy43NSAxNSAwLjc1IDkgMC43NSA5WiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNOSAxMS4yNUMxMC4yNDI2IDExLjI1IDExLjI1IDEwLjI0MjYgMTEuMjUgOUMxMS4yNSA3Ljc1NzM2IDEwLjI0MjYgNi43NSA5IDYuNzVDNy43NTczNiA2Ljc1IDYuNzUgNy43NTczNiA2Ljc1IDlDNi43NSAxMC4yNDI2IDcuNzU3MzYgMTEuMjUgOSAxMS4yNVoiIHN0cm9rZT0id2hpdGUiIHN0cm9rZ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