testomatio-editor-blocks 0.4.21 → 0.4.22

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.
@@ -3,5 +3,5 @@ import { StepField } from "./stepField";
3
3
  const STEP_PLACEHOLDER = "Enter step name";
4
4
  const EXPECTED_RESULT_PLACEHOLDER = "Enter expected result";
5
5
  export function StepHorizontalView({ blockId, stepNumber, stepValue, expectedResult, onStepChange, onExpectedChange, onInsertNextStep, onFieldFocus, viewToggle, }) {
6
- return (_jsxs("div", { className: "bn-teststep bn-teststep--horizontal", "data-block-id": blockId, children: [_jsxs("div", { className: "bn-teststep__timeline", children: [_jsx("span", { className: "bn-teststep__number", children: stepNumber }), _jsx("div", { className: "bn-teststep__line" })] }), _jsxs("div", { className: "bn-teststep__content", children: [_jsxs("div", { className: "bn-teststep__horizontal-fields", children: [_jsxs("div", { className: "bn-teststep__horizontal-col", children: [_jsx("div", { className: "bn-teststep__header", children: _jsx("span", { className: "bn-teststep__title", children: "Step" }) }), _jsx(StepField, { label: "Step", showLabel: false, value: stepValue, onChange: onStepChange, placeholder: STEP_PLACEHOLDER, enableAutocomplete: true, fieldName: "title", suggestionFilter: (suggestion) => suggestion.isSnippet !== true, onFieldFocus: onFieldFocus, multiline: true, enableImageUpload: true, showFormattingButtons: true, showImageButton: true })] }), _jsxs("div", { className: "bn-teststep__horizontal-col", children: [_jsxs("div", { className: "bn-teststep__header", children: [_jsx("span", { className: "bn-teststep__title", children: "Expected result" }), viewToggle] }), _jsx(StepField, { label: "Expected result", showLabel: false, value: expectedResult, onChange: onExpectedChange, placeholder: EXPECTED_RESULT_PLACEHOLDER, multiline: true, enableAutocomplete: true, enableImageUpload: true, showFormattingButtons: true, showImageButton: true, onFieldFocus: onFieldFocus })] })] }), _jsx("div", { className: "bn-step-actions", children: _jsxs("button", { type: "button", className: "bn-step-action-btn", onClick: onInsertNextStep, children: [_jsx("svg", { className: "bn-step-action-btn__icon", width: "16", height: "16", viewBox: "0 0 13.334 13.334", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M6.667 0a6.667 6.667 0 1 1 0 13.334A6.667 6.667 0 0 1 6.667 0Zm0 1.334a5.333 5.333 0 1 0 0 10.666 5.333 5.333 0 0 0 0-10.666ZM7.334 3.334V6H10v1.334H7.334V10H6V7.334H3.334V6H6V3.334h1.334Z", fill: "currentColor" }) }), "Add new step"] }) })] })] }));
6
+ return (_jsxs("div", { className: "bn-teststep bn-teststep--horizontal", "data-block-id": blockId, children: [_jsxs("div", { className: "bn-teststep__timeline", children: [_jsx("span", { className: "bn-teststep__number", children: stepNumber }), _jsx("div", { className: "bn-teststep__line" })] }), _jsxs("div", { className: "bn-teststep__content", children: [_jsxs("div", { className: "bn-teststep__header", children: [_jsx("span", { className: "bn-teststep__title", children: "Step" }), viewToggle] }), _jsxs("div", { className: "bn-teststep__horizontal-fields", children: [_jsxs("div", { className: "bn-teststep__horizontal-col", children: [_jsx("div", { className: "bn-teststep__header", children: _jsx("span", { className: "bn-teststep__title", children: "Step" }) }), _jsx(StepField, { label: "Step", showLabel: false, value: stepValue, onChange: onStepChange, placeholder: STEP_PLACEHOLDER, enableAutocomplete: true, fieldName: "title", suggestionFilter: (suggestion) => suggestion.isSnippet !== true, onFieldFocus: onFieldFocus, multiline: true, enableImageUpload: true, showFormattingButtons: true, showImageButton: true })] }), _jsxs("div", { className: "bn-teststep__horizontal-col", children: [_jsx("div", { className: "bn-teststep__header", children: _jsx("span", { className: "bn-teststep__title", children: "Expected result" }) }), _jsx(StepField, { label: "Expected result", showLabel: false, value: expectedResult, onChange: onExpectedChange, placeholder: EXPECTED_RESULT_PLACEHOLDER, multiline: true, enableAutocomplete: true, enableImageUpload: true, showFormattingButtons: true, showImageButton: true, onFieldFocus: onFieldFocus })] })] }), _jsx("div", { className: "bn-step-actions", children: _jsxs("button", { type: "button", className: "bn-step-action-btn", onClick: onInsertNextStep, children: [_jsx("svg", { className: "bn-step-action-btn__icon", width: "16", height: "16", viewBox: "0 0 13.334 13.334", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M6.667 0a6.667 6.667 0 1 1 0 13.334A6.667 6.667 0 0 1 6.667 0Zm0 1.334a5.333 5.333 0 1 0 0 10.666 5.333 5.333 0 0 0 0-10.666ZM7.334 3.334V6H10v1.334H7.334V10H6V7.334H3.334V6H6V3.334h1.334Z", fill: "currentColor" }) }), "Add new step"] }) })] })] }));
7
7
  }
@@ -10,7 +10,9 @@ export function useAutoResize({ textarea, multiline = false, minRows = 2, maxRow
10
10
  const lineHeight = parseFloat(getComputedStyle(textarea).lineHeight || "16");
11
11
  const minHeight = lineHeight * minRows;
12
12
  const maxHeight = lineHeight * maxRows;
13
- textarea.style.height = `${Math.min(Math.max(textarea.scrollHeight, minHeight), maxHeight)}px`;
13
+ const clampedHeight = Math.min(Math.max(textarea.scrollHeight, minHeight), maxHeight);
14
+ textarea.style.height = `${clampedHeight}px`;
15
+ textarea.style.overflowY = textarea.scrollHeight > maxHeight ? "auto" : "hidden";
14
16
  };
15
17
  const observer = new MutationObserver(resize);
16
18
  observer.observe(textarea, { childList: true, characterData: true, subtree: true });
@@ -500,22 +500,10 @@ html.dark .bn-step-image-preview__content {
500
500
  color: #0a0a0a;
501
501
  }
502
502
 
503
- .bn-teststep__view-toggle--horizontal {
503
+ .bn-teststep__view-toggle--horizontal svg {
504
504
  transform: rotate(90deg);
505
505
  }
506
506
 
507
- .bn-teststep__view-toggle[data-tooltip]::after {
508
- top: calc(100% + 6px);
509
- left: 50%;
510
- transform: translateX(-50%);
511
- }
512
-
513
- .bn-teststep__view-toggle--horizontal[data-tooltip]::after {
514
- top: calc(100% + 6px);
515
- left: 50%;
516
- transform: translateX(-50%);
517
- }
518
-
519
507
  .bn-teststep__horizontal-fields {
520
508
  display: flex;
521
509
  gap: 16px;
@@ -997,7 +985,21 @@ html.dark .bn-step-image-preview__content {
997
985
  font-weight: 400;
998
986
  line-height: 20px;
999
987
  color: #262626;
1000
- overflow: visible;
988
+ overflow: hidden;
989
+ }
990
+
991
+ .bn-step-editor .overtype-wrapper .overtype-input {
992
+ scrollbar-width: thin;
993
+ scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
994
+ }
995
+
996
+ .bn-step-editor .overtype-wrapper .overtype-input::-webkit-scrollbar {
997
+ width: 6px;
998
+ }
999
+
1000
+ .bn-step-editor .overtype-wrapper .overtype-input::-webkit-scrollbar-thumb {
1001
+ background: rgba(0, 0, 0, 0.2);
1002
+ border-radius: 3px;
1001
1003
  }
1002
1004
 
1003
1005
  .bn-step-editor--multiline {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testomatio-editor-blocks",
3
- "version": "0.4.21",
3
+ "version": "0.4.22",
4
4
  "description": "Custom BlockNote schema, markdown conversion helpers, and UI for Testomatio-style test cases and steps.",
5
5
  "type": "module",
6
6
  "main": "./package/index.js",
@@ -35,6 +35,10 @@ export function StepHorizontalView({
35
35
  <div className="bn-teststep__line" />
36
36
  </div>
37
37
  <div className="bn-teststep__content">
38
+ <div className="bn-teststep__header">
39
+ <span className="bn-teststep__title">Step</span>
40
+ {viewToggle}
41
+ </div>
38
42
  <div className="bn-teststep__horizontal-fields">
39
43
  <div className="bn-teststep__horizontal-col">
40
44
  <div className="bn-teststep__header">
@@ -59,7 +63,6 @@ export function StepHorizontalView({
59
63
  <div className="bn-teststep__horizontal-col">
60
64
  <div className="bn-teststep__header">
61
65
  <span className="bn-teststep__title">Expected result</span>
62
- {viewToggle}
63
66
  </div>
64
67
  <StepField
65
68
  label="Expected result"
@@ -21,7 +21,9 @@ export function useAutoResize({ textarea, multiline = false, minRows = 2, maxRow
21
21
  const minHeight = lineHeight * minRows;
22
22
  const maxHeight = lineHeight * maxRows;
23
23
 
24
- textarea.style.height = `${Math.min(Math.max(textarea.scrollHeight, minHeight), maxHeight)}px`;
24
+ const clampedHeight = Math.min(Math.max(textarea.scrollHeight, minHeight), maxHeight);
25
+ textarea.style.height = `${clampedHeight}px`;
26
+ textarea.style.overflowY = textarea.scrollHeight > maxHeight ? "auto" : "hidden";
25
27
  };
26
28
 
27
29
  const observer = new MutationObserver(resize);
@@ -500,22 +500,10 @@ html.dark .bn-step-image-preview__content {
500
500
  color: #0a0a0a;
501
501
  }
502
502
 
503
- .bn-teststep__view-toggle--horizontal {
503
+ .bn-teststep__view-toggle--horizontal svg {
504
504
  transform: rotate(90deg);
505
505
  }
506
506
 
507
- .bn-teststep__view-toggle[data-tooltip]::after {
508
- top: calc(100% + 6px);
509
- left: 50%;
510
- transform: translateX(-50%);
511
- }
512
-
513
- .bn-teststep__view-toggle--horizontal[data-tooltip]::after {
514
- top: calc(100% + 6px);
515
- left: 50%;
516
- transform: translateX(-50%);
517
- }
518
-
519
507
  .bn-teststep__horizontal-fields {
520
508
  display: flex;
521
509
  gap: 16px;
@@ -997,7 +985,21 @@ html.dark .bn-step-image-preview__content {
997
985
  font-weight: 400;
998
986
  line-height: 20px;
999
987
  color: #262626;
1000
- overflow: visible;
988
+ overflow: hidden;
989
+ }
990
+
991
+ .bn-step-editor .overtype-wrapper .overtype-input {
992
+ scrollbar-width: thin;
993
+ scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
994
+ }
995
+
996
+ .bn-step-editor .overtype-wrapper .overtype-input::-webkit-scrollbar {
997
+ width: 6px;
998
+ }
999
+
1000
+ .bn-step-editor .overtype-wrapper .overtype-input::-webkit-scrollbar-thumb {
1001
+ background: rgba(0, 0, 0, 0.2);
1002
+ border-radius: 3px;
1001
1003
  }
1002
1004
 
1003
1005
  .bn-step-editor--multiline {