testomatio-editor-blocks 0.4.46 → 0.4.48
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/package/editor/blocks/step.d.ts +11 -1
- package/package/editor/blocks/step.js +56 -0
- package/package/editor/blocks/stepField.js +134 -12
- package/package/editor/customMarkdownConverter.js +8 -35
- package/package/index.d.ts +1 -1
- package/package/index.js +1 -1
- package/package/styles.css +14 -4
- package/package.json +1 -1
- package/src/App.tsx +27 -48
- package/src/editor/blocks/step.tsx +61 -1
- package/src/editor/blocks/stepField.tsx +141 -8
- package/src/editor/customMarkdownConverter.test.ts +113 -15
- package/src/editor/customMarkdownConverter.ts +8 -36
- package/src/editor/markdownToBlocks.test.ts +15 -3
- package/src/editor/styles.css +14 -4
- package/src/index.ts +1 -1
|
@@ -10,11 +10,15 @@ const baseProps = {
|
|
|
10
10
|
describe("markdownToBlocks", () => {
|
|
11
11
|
it("parses test steps and test cases", () => {
|
|
12
12
|
const markdown = [
|
|
13
|
+
"### Steps",
|
|
14
|
+
"",
|
|
13
15
|
"* Open the Login page.",
|
|
14
16
|
" *Expected*: The Login page loads successfully.",
|
|
15
17
|
].join("\n");
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
const blocks = markdownToBlocks(markdown);
|
|
20
|
+
const stepBlocks = blocks.filter((b) => b.type === "testStep");
|
|
21
|
+
expect(stepBlocks).toEqual([
|
|
18
22
|
{
|
|
19
23
|
type: "testStep",
|
|
20
24
|
props: {
|
|
@@ -30,12 +34,16 @@ describe("markdownToBlocks", () => {
|
|
|
30
34
|
|
|
31
35
|
it("parses snippet markdown into snippet blocks", () => {
|
|
32
36
|
const markdown = [
|
|
37
|
+
"### Steps",
|
|
38
|
+
"",
|
|
33
39
|
"<!-- begin snippet #501 -->",
|
|
34
40
|
"Run the seeder",
|
|
35
41
|
"<!-- end snippet #501 -->",
|
|
36
42
|
].join("\n");
|
|
37
43
|
|
|
38
|
-
|
|
44
|
+
const blocks = markdownToBlocks(markdown);
|
|
45
|
+
const snippetBlocks = blocks.filter((b) => b.type === "snippet");
|
|
46
|
+
expect(snippetBlocks).toEqual([
|
|
39
47
|
{
|
|
40
48
|
type: "snippet",
|
|
41
49
|
props: {
|
|
@@ -51,6 +59,8 @@ describe("markdownToBlocks", () => {
|
|
|
51
59
|
|
|
52
60
|
it("parses snippet bodies and ignores nested snippet markers", () => {
|
|
53
61
|
const markdown = [
|
|
62
|
+
"### Steps",
|
|
63
|
+
"",
|
|
54
64
|
"<!-- begin snippet #888 -->",
|
|
55
65
|
"Prep DB",
|
|
56
66
|
"<!-- begin snippet #ignored -->",
|
|
@@ -59,7 +69,9 @@ describe("markdownToBlocks", () => {
|
|
|
59
69
|
"<!-- end snippet #888 -->",
|
|
60
70
|
].join("\n");
|
|
61
71
|
|
|
62
|
-
|
|
72
|
+
const blocks = markdownToBlocks(markdown);
|
|
73
|
+
const snippetBlocks = blocks.filter((b) => b.type === "snippet");
|
|
74
|
+
expect(snippetBlocks).toEqual([
|
|
63
75
|
{
|
|
64
76
|
type: "snippet",
|
|
65
77
|
props: {
|
package/src/editor/styles.css
CHANGED
|
@@ -942,6 +942,11 @@ html.dark .bn-step-image-preview__content {
|
|
|
942
942
|
background: var(--step-bg-button-hover);
|
|
943
943
|
}
|
|
944
944
|
|
|
945
|
+
.bn-step-toolbar__button--active {
|
|
946
|
+
background: var(--step-bg-button-hover);
|
|
947
|
+
color: var(--step-input-border-focus);
|
|
948
|
+
}
|
|
949
|
+
|
|
945
950
|
[data-tooltip] {
|
|
946
951
|
position: relative;
|
|
947
952
|
}
|
|
@@ -1074,8 +1079,7 @@ html.dark .bn-step-image-preview__content {
|
|
|
1074
1079
|
}
|
|
1075
1080
|
|
|
1076
1081
|
.bn-step-editor .overtype-wrapper .overtype-preview strong.step-preview-bold {
|
|
1077
|
-
-
|
|
1078
|
-
font-weight: inherit !important;
|
|
1082
|
+
font-weight: 600 !important;
|
|
1079
1083
|
color: inherit !important;
|
|
1080
1084
|
}
|
|
1081
1085
|
|
|
@@ -1085,9 +1089,10 @@ html.dark .bn-step-image-preview__content {
|
|
|
1085
1089
|
}
|
|
1086
1090
|
|
|
1087
1091
|
.bn-step-editor .overtype-wrapper .overtype-preview code.step-preview-code {
|
|
1088
|
-
background-color:
|
|
1092
|
+
background-color: transparent !important;
|
|
1089
1093
|
border-radius: 3px !important;
|
|
1090
|
-
|
|
1094
|
+
font-family: "Fira Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
|
|
1095
|
+
color: rgb(146, 64, 14) !important;
|
|
1091
1096
|
}
|
|
1092
1097
|
|
|
1093
1098
|
.bn-step-custom-caret {
|
|
@@ -1334,6 +1339,11 @@ html.dark .bn-step-image-preview__content {
|
|
|
1334
1339
|
pointer-events: none;
|
|
1335
1340
|
}
|
|
1336
1341
|
|
|
1342
|
+
.bn-suggestion-menu .mantine-Badge-label {
|
|
1343
|
+
text-transform: none;
|
|
1344
|
+
font-size: var(--badge-fz-sm);
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1337
1347
|
.bn-suggestion-icon {
|
|
1338
1348
|
display: inline-flex;
|
|
1339
1349
|
align-items: center;
|
package/src/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ export {
|
|
|
4
4
|
type CustomBlock,
|
|
5
5
|
type CustomEditor,
|
|
6
6
|
} from "./editor/customSchema";
|
|
7
|
-
export { stepBlock, canInsertStepOrSnippet, isStepsHeading, addStepsBlock } from "./editor/blocks/step";
|
|
7
|
+
export { stepBlock, canInsertStepOrSnippet, isStepsHeading, addStepsBlock, addSnippetBlock } from "./editor/blocks/step";
|
|
8
8
|
export { snippetBlock } from "./editor/blocks/snippet";
|
|
9
9
|
export { markdownToHtml, htmlToMarkdown } from "./editor/blocks/markdown";
|
|
10
10
|
|