testomatio-editor-blocks 0.4.56 → 0.4.57
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/styles.css +5 -0
- package/package.json +1 -1
- package/src/App.tsx +22 -6
- package/src/editor/styles.css +5 -0
package/package/styles.css
CHANGED
package/package.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -364,20 +364,36 @@ function CustomSlashMenu() {
|
|
|
364
364
|
offset(10),
|
|
365
365
|
size({
|
|
366
366
|
apply({ elements }) {
|
|
367
|
-
Object.assign(elements.floating.style, { maxHeight: "" });
|
|
367
|
+
Object.assign(elements.floating.style, { maxHeight: "", overflowY: "" });
|
|
368
368
|
},
|
|
369
369
|
}),
|
|
370
370
|
flip({
|
|
371
|
+
padding: 10,
|
|
371
372
|
fallbackPlacements: ["top-start"],
|
|
372
373
|
}),
|
|
373
|
-
shift(),
|
|
374
|
-
|
|
375
|
-
|
|
374
|
+
shift({ padding: 10 }),
|
|
375
|
+
{
|
|
376
|
+
name: "fitToViewport",
|
|
377
|
+
fn({ y, rects, elements }) {
|
|
378
|
+
const padding = 10;
|
|
379
|
+
if (y < padding) {
|
|
380
|
+
const bottomEdge = rects.reference.y - 10;
|
|
381
|
+
const maxHeight = Math.max(bottomEdge - padding, 100);
|
|
382
|
+
Object.assign(elements.floating.style, {
|
|
383
|
+
maxHeight: `${maxHeight}px`,
|
|
384
|
+
overflowY: "auto",
|
|
385
|
+
});
|
|
386
|
+
return { y: padding };
|
|
387
|
+
}
|
|
388
|
+
const viewportHeight = window.innerHeight;
|
|
389
|
+
const available = viewportHeight - y - padding;
|
|
376
390
|
Object.assign(elements.floating.style, {
|
|
377
|
-
maxHeight: `${Math.max(
|
|
391
|
+
maxHeight: `${Math.max(available, 100)}px`,
|
|
392
|
+
overflowY: "auto",
|
|
378
393
|
});
|
|
394
|
+
return {};
|
|
379
395
|
},
|
|
380
|
-
}
|
|
396
|
+
},
|
|
381
397
|
],
|
|
382
398
|
}}
|
|
383
399
|
/>
|
package/src/editor/styles.css
CHANGED