@prosekit/lit
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -8,3 +8,3 @@ import { | ||
Popover | ||
} from "./chunk-I6N76F4U.js"; | ||
} from "./chunk-7WLKD2U6.js"; | ||
import "./chunk-PCXKL6TA.js"; | ||
@@ -86,5 +86,2 @@ import { | ||
this.handleSubmit = options.deleteMatch; | ||
setTimeout(() => { | ||
this.host.requestUpdate(); | ||
}, 0); | ||
}; | ||
@@ -126,9 +123,12 @@ const handleLeave = () => { | ||
var defaultPopoverOptions = { | ||
placement: "bottom-end", | ||
// The main axis is the y axis, and we place the popover at the bottom of the | ||
// reference element. | ||
// | ||
// The cross axis is the x axis, and we place the popover at the start of the | ||
// reference element. The reference element and the popover are left-aligned. | ||
placement: "bottom-start", | ||
middleware: [ | ||
// Use the text caret as the reference point | ||
inline(), | ||
offset(({ rects }) => ({ | ||
// Put the popover at the bottom right corner | ||
alignmentAxis: -rects.floating.width, | ||
offset(() => ({ | ||
// Move down the popover by 4px | ||
@@ -138,16 +138,27 @@ mainAxis: 4 | ||
// Flip the popover to the top if it's overflowing the viewport | ||
// | ||
// When `flipAlignment` is true, which is the default, ensure `flip() `is | ||
// placed before `shift()` in your middleware array. | ||
// | ||
// https://floating-ui.com/docs/flip#flipalignment | ||
flip({ | ||
fallbackStrategy: "initialPlacement", | ||
fallbackAxisSideDirection: "start", | ||
// Flip the popover to the top if necessary. | ||
mainAxis: true, | ||
// We don't want to flip the popover to the left or right, since `shift()` | ||
// will handle this. | ||
crossAxis: false, | ||
...defaultDetectOverflowOptions | ||
}), | ||
// We need to place `shift()` after `flip()`. See https://floating-ui.com/docs/flip#flipalignment | ||
shift({ | ||
...defaultDetectOverflowOptions | ||
}), | ||
size({ | ||
apply: ({ availableWidth, availableHeight, elements }) => { | ||
elements.floating.style.setProperty( | ||
"--prosekit-popover-available-width", | ||
"max-width", | ||
`${Math.floor(availableWidth)}px` | ||
); | ||
elements.floating.style.setProperty( | ||
"--prosekit-popover-available-height", | ||
"max-height", | ||
`${Math.floor(availableHeight)}px` | ||
@@ -157,5 +168,2 @@ ); | ||
...defaultDetectOverflowOptions | ||
}), | ||
shift({ | ||
...defaultDetectOverflowOptions | ||
}) | ||
@@ -162,0 +170,0 @@ ] |
import { | ||
Popover | ||
} from "./chunk-I6N76F4U.js"; | ||
} from "./chunk-7WLKD2U6.js"; | ||
import { | ||
@@ -5,0 +5,0 @@ ListManager |
import { | ||
Popover | ||
} from "./chunk-I6N76F4U.js"; | ||
} from "./chunk-7WLKD2U6.js"; | ||
import { | ||
@@ -5,0 +5,0 @@ __decorateClass |
import { | ||
Popover, | ||
propNames | ||
} from "./chunk-I6N76F4U.js"; | ||
} from "./chunk-7WLKD2U6.js"; | ||
import "./chunk-O5JP3B34.js"; | ||
@@ -6,0 +6,0 @@ export { |
{ | ||
"name": "@prosekit/lit", | ||
"type": "module", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
89120
2244