testomatio-editor-blocks 0.1.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/README.md +121 -0
- package/package/editor/customMarkdownConverter.d.ts +8 -0
- package/package/editor/customMarkdownConverter.js +1038 -0
- package/package/editor/customSchema.d.ts +636 -0
- package/package/editor/customSchema.js +379 -0
- package/package/index.d.ts +3 -0
- package/package/index.js +3 -0
- package/package/styles.css +238 -0
- package/package.json +64 -0
- package/src/App.css +162 -0
- package/src/App.tsx +351 -0
- package/src/assets/react.svg +1 -0
- package/src/editor/customMarkdownConverter.test.ts +749 -0
- package/src/editor/customMarkdownConverter.ts +1237 -0
- package/src/editor/customSchema.test.ts +39 -0
- package/src/editor/customSchema.tsx +594 -0
- package/src/editor/styles.css +238 -0
- package/src/index.css +33 -0
- package/src/index.ts +15 -0
- package/src/main.tsx +12 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
.testomatio-editor {
|
|
2
|
+
font-family: "Inter", system-ui, -apple-system, sans-serif;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.bn-testcase {
|
|
6
|
+
--status-color: #94a3b8;
|
|
7
|
+
position: relative;
|
|
8
|
+
border-radius: 1rem;
|
|
9
|
+
border-left: 6px solid var(--status-color);
|
|
10
|
+
padding: 1rem 1.25rem;
|
|
11
|
+
background: rgba(148, 163, 184, 0.12);
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: 0.75rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.bn-testcase::after {
|
|
18
|
+
content: "";
|
|
19
|
+
position: absolute;
|
|
20
|
+
inset: 0;
|
|
21
|
+
border-radius: inherit;
|
|
22
|
+
pointer-events: none;
|
|
23
|
+
box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.05);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.bn-testcase__header {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-wrap: wrap;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: 0.75rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.bn-testcase__meta {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
gap: 0.5rem;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.bn-testcase__label {
|
|
41
|
+
font-size: 0.85rem;
|
|
42
|
+
font-weight: 700;
|
|
43
|
+
text-transform: uppercase;
|
|
44
|
+
letter-spacing: 0.08em;
|
|
45
|
+
color: #0f172a;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.bn-testcase__reference {
|
|
49
|
+
padding: 0.35rem 0.6rem;
|
|
50
|
+
border-radius: 0.5rem;
|
|
51
|
+
border: 1px solid rgba(15, 23, 42, 0.1);
|
|
52
|
+
background: rgba(255, 255, 255, 0.85);
|
|
53
|
+
font-size: 0.85rem;
|
|
54
|
+
min-width: 8rem;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.bn-testcase__reference:focus-visible {
|
|
58
|
+
outline: 2px solid rgba(37, 99, 235, 0.4);
|
|
59
|
+
outline-offset: 2px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.bn-testcase__status {
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
gap: 0.35rem;
|
|
66
|
+
font-size: 0.85rem;
|
|
67
|
+
color: #0f172a;
|
|
68
|
+
font-weight: 600;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.bn-testcase__status select {
|
|
72
|
+
border-radius: 0.5rem;
|
|
73
|
+
border: 1px solid rgba(15, 23, 42, 0.12);
|
|
74
|
+
padding: 0.35rem 0.6rem;
|
|
75
|
+
background: rgba(255, 255, 255, 0.95);
|
|
76
|
+
font-size: 0.85rem;
|
|
77
|
+
font-weight: 600;
|
|
78
|
+
color: inherit;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.bn-testcase__body {
|
|
82
|
+
min-height: 2.5rem;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.bn-testcase--ready {
|
|
86
|
+
--status-color: #22c55e;
|
|
87
|
+
background: rgba(34, 197, 94, 0.12);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.bn-testcase--blocked {
|
|
91
|
+
--status-color: #ef4444;
|
|
92
|
+
background: rgba(239, 68, 68, 0.12);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.bn-teststep {
|
|
96
|
+
border-radius: 0.85rem;
|
|
97
|
+
border-left: 5px solid rgba(59, 130, 246, 0.65);
|
|
98
|
+
background: rgba(59, 130, 246, 0.12);
|
|
99
|
+
padding: 0.85rem 1.1rem 1rem;
|
|
100
|
+
display: grid;
|
|
101
|
+
gap: 0.75rem;
|
|
102
|
+
position: relative;
|
|
103
|
+
width: 100%;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.bn-teststep::after {
|
|
107
|
+
content: "";
|
|
108
|
+
position: absolute;
|
|
109
|
+
inset: 0;
|
|
110
|
+
border-radius: inherit;
|
|
111
|
+
pointer-events: none;
|
|
112
|
+
box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.08);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.bn-teststep__toggle {
|
|
116
|
+
align-self: flex-start;
|
|
117
|
+
padding: 0.35rem 0.6rem;
|
|
118
|
+
border-radius: 0.5rem;
|
|
119
|
+
border: 1px dashed rgba(37, 99, 235, 0.45);
|
|
120
|
+
background: rgba(59, 130, 246, 0.1);
|
|
121
|
+
color: #1d4ed8;
|
|
122
|
+
font-size: 0.75rem;
|
|
123
|
+
font-weight: 700;
|
|
124
|
+
letter-spacing: 0.06em;
|
|
125
|
+
text-transform: uppercase;
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
transition:
|
|
128
|
+
background-color 120ms ease,
|
|
129
|
+
border-color 120ms ease,
|
|
130
|
+
box-shadow 120ms ease;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.bn-teststep__toggle:hover {
|
|
134
|
+
background: rgba(59, 130, 246, 0.18);
|
|
135
|
+
border-color: rgba(37, 99, 235, 0.55);
|
|
136
|
+
box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.bn-step-field {
|
|
140
|
+
display: flex;
|
|
141
|
+
flex-direction: column;
|
|
142
|
+
gap: 0.35rem;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.bn-step-field__top {
|
|
146
|
+
display: flex;
|
|
147
|
+
justify-content: space-between;
|
|
148
|
+
align-items: center;
|
|
149
|
+
gap: 0.5rem;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.bn-step-field__label {
|
|
153
|
+
font-size: 0.8rem;
|
|
154
|
+
text-transform: uppercase;
|
|
155
|
+
letter-spacing: 0.08em;
|
|
156
|
+
font-weight: 700;
|
|
157
|
+
color: #1d4ed8;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.bn-step-toolbar {
|
|
161
|
+
display: flex;
|
|
162
|
+
gap: 0.35rem;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.bn-step-toolbar__button {
|
|
166
|
+
width: 2rem;
|
|
167
|
+
height: 2rem;
|
|
168
|
+
border-radius: 0.4rem;
|
|
169
|
+
border: 1px solid rgba(37, 99, 235, 0.35);
|
|
170
|
+
background: rgba(255, 255, 255, 0.85);
|
|
171
|
+
color: #1d4ed8;
|
|
172
|
+
font-weight: 700;
|
|
173
|
+
font-size: 0.9rem;
|
|
174
|
+
display: flex;
|
|
175
|
+
align-items: center;
|
|
176
|
+
justify-content: center;
|
|
177
|
+
cursor: pointer;
|
|
178
|
+
transition:
|
|
179
|
+
background-color 120ms ease,
|
|
180
|
+
border-color 120ms ease,
|
|
181
|
+
box-shadow 120ms ease;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.bn-step-toolbar__button:hover {
|
|
185
|
+
background: rgba(37, 99, 235, 0.12);
|
|
186
|
+
border-color: rgba(37, 99, 235, 0.55);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.bn-step-editor {
|
|
190
|
+
border-radius: 0.6rem;
|
|
191
|
+
border: 1px solid rgba(37, 99, 235, 0.25);
|
|
192
|
+
padding: 0.5rem 0.75rem;
|
|
193
|
+
font-size: 0.95rem;
|
|
194
|
+
background: rgba(255, 255, 255, 0.92);
|
|
195
|
+
transition:
|
|
196
|
+
border-color 120ms ease,
|
|
197
|
+
box-shadow 120ms ease;
|
|
198
|
+
min-height: 2.5rem;
|
|
199
|
+
white-space: pre-wrap;
|
|
200
|
+
word-break: break-word;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.bn-step-editor[data-multiline="true"] {
|
|
204
|
+
min-height: 4rem;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.bn-step-editor:focus-visible {
|
|
208
|
+
outline: none;
|
|
209
|
+
border-color: rgba(37, 99, 235, 0.7);
|
|
210
|
+
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.bn-step-editor:empty::before {
|
|
214
|
+
content: attr(data-placeholder);
|
|
215
|
+
color: rgba(15, 23, 42, 0.45);
|
|
216
|
+
pointer-events: none;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.bn-inline-image {
|
|
220
|
+
display: block;
|
|
221
|
+
max-width: 100%;
|
|
222
|
+
border-radius: 0.65rem;
|
|
223
|
+
margin: 0.5rem 0;
|
|
224
|
+
pointer-events: none;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.bn-suggestion-icon {
|
|
228
|
+
display: inline-flex;
|
|
229
|
+
align-items: center;
|
|
230
|
+
justify-content: center;
|
|
231
|
+
width: 20px;
|
|
232
|
+
height: 20px;
|
|
233
|
+
font-size: 14px;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.bn-testcase--draft {
|
|
237
|
+
--status-color: #94a3b8;
|
|
238
|
+
}
|
package/src/index.css
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
font-family: "Inter", system-ui, -apple-system, sans-serif;
|
|
3
|
+
line-height: 1.5;
|
|
4
|
+
font-weight: 400;
|
|
5
|
+
color: #0f172a;
|
|
6
|
+
background-color: #f8fafc;
|
|
7
|
+
text-rendering: optimizeLegibility;
|
|
8
|
+
-webkit-font-smoothing: antialiased;
|
|
9
|
+
-moz-osx-font-smoothing: grayscale;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
a {
|
|
13
|
+
color: inherit;
|
|
14
|
+
text-decoration: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
a:hover {
|
|
18
|
+
text-decoration: underline;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
body {
|
|
22
|
+
margin: 0;
|
|
23
|
+
background-color: #f8fafc;
|
|
24
|
+
min-height: 100vh;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
button {
|
|
28
|
+
font-family: inherit;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
* {
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export {
|
|
2
|
+
customSchema,
|
|
3
|
+
type CustomSchema,
|
|
4
|
+
type CustomBlock,
|
|
5
|
+
type CustomEditor,
|
|
6
|
+
} from "./editor/customSchema";
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
blocksToMarkdown,
|
|
10
|
+
markdownToBlocks,
|
|
11
|
+
type CustomEditorBlock,
|
|
12
|
+
type CustomPartialBlock,
|
|
13
|
+
} from "./editor/customMarkdownConverter";
|
|
14
|
+
|
|
15
|
+
export const testomatioEditorClassName = "markdown testomatio-editor";
|
package/src/main.tsx
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StrictMode } from "react";
|
|
2
|
+
import { createRoot } from "react-dom/client";
|
|
3
|
+
import "@blocknote/mantine/style.css";
|
|
4
|
+
import "@blocknote/core/fonts/inter.css";
|
|
5
|
+
import "./index.css";
|
|
6
|
+
import App from "./App.tsx";
|
|
7
|
+
|
|
8
|
+
createRoot(document.getElementById("root")!).render(
|
|
9
|
+
<StrictMode>
|
|
10
|
+
<App />
|
|
11
|
+
</StrictMode>,
|
|
12
|
+
);
|