@kolkrabbi/kol-component 0.387.0 → 0.389.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/package.json +1 -1
- package/src/index.js +1 -1
- package/src/molecules/AccountMenu.jsx +11 -6
- package/src/molecules/AlignmentGrid.jsx +5 -5
- package/src/molecules/ButtonGroup.jsx +30 -48
- package/src/molecules/ButtonSplit.jsx +66 -66
- package/src/molecules/ContextMenu.jsx +1 -1
- package/src/molecules/Dropdown.jsx +24 -56
- package/src/molecules/Menu.jsx +190 -255
- package/src/molecules/MenuItem.jsx +45 -12
- package/src/molecules/MenuList.jsx +48 -17
- package/src/molecules/ParamBindDot.jsx +8 -24
- package/src/molecules/TabsDocument.jsx +42 -66
- package/src/molecules/TabsRow.jsx +19 -12
- package/src/organisms/FindBar.jsx +18 -32
- package/src/utilities/Popover.jsx +8 -4
|
@@ -163,8 +163,9 @@ export function usePopover({
|
|
|
163
163
|
const anchorEl = (anchor) => (anchor && 'current' in anchor ? anchor.current : anchor)
|
|
164
164
|
const later = (a, b) => !!(a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING)
|
|
165
165
|
/* spend a press: stop it here, and swallow the mouse events and the click it raises until the press ends. Several
|
|
166
|
-
layers may close on one press; the first spends it, the rest find it stopped and do nothing more.
|
|
167
|
-
|
|
166
|
+
layers may close on one press; the first spends it, the rest find it stopped and do nothing more. Menu's press outside
|
|
167
|
+
spends a press on the canvas the same way (plan-2026-11-29-one-set-fold W3). */
|
|
168
|
+
export function spend(e) {
|
|
168
169
|
if (e.cancelBubble) return
|
|
169
170
|
e.stopPropagation(); e.preventDefault()
|
|
170
171
|
const stop = (ev) => { ev.stopPropagation(); ev.preventDefault() }
|
|
@@ -555,6 +556,9 @@ function PopoverPanelOn({
|
|
|
555
556
|
motion,
|
|
556
557
|
className = '',
|
|
557
558
|
style: extraStyle,
|
|
559
|
+
/* Menu's panel (plan-2026-11-29-one-set-fold W3): its own attributes and handlers on the floating node, and its ref */
|
|
560
|
+
floatingProps,
|
|
561
|
+
panelRef,
|
|
558
562
|
}) {
|
|
559
563
|
const depth = useContext(FloatDepth)
|
|
560
564
|
const fm = motion == null ? null : floatMotion(motion)
|
|
@@ -577,13 +581,13 @@ function PopoverPanelOn({
|
|
|
577
581
|
* for non-editor consumers since they ignore the attr. */
|
|
578
582
|
const node = (
|
|
579
583
|
<div
|
|
580
|
-
ref={refs.setFloating}
|
|
584
|
+
ref={panelRef ? (n) => { refs.setFloating(n); panelRef(n) } : refs.setFloating}
|
|
581
585
|
style={{ ...floatingStyles, ...(depth ? { '--kol-float-depth': depth } : null), ...fm?.style, ...extraStyle }}
|
|
582
586
|
className={cls}
|
|
583
587
|
data-editor-keep-selection
|
|
584
588
|
data-side={fm ? popover.placement?.split('-')[0] : undefined}
|
|
585
589
|
data-exit={fm && presence.exiting ? '' : undefined}
|
|
586
|
-
{...getFloatingProps()}
|
|
590
|
+
{...getFloatingProps(floatingProps)}
|
|
587
591
|
>
|
|
588
592
|
<FloatDepth.Provider value={depth + 1}>{children}</FloatDepth.Provider>
|
|
589
593
|
</div>
|