@agorapulse/ui-components 22.2.10 → 22.2.11

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.
@@ -396,6 +396,9 @@ function createFloatingOverlay() {
396
396
  }
397
397
  let invariantsWritten = false;
398
398
  reposition = () => {
399
+ // A detached trigger measures as a zero rect at the viewport origin: keep the last position instead.
400
+ if (!state.target.isConnected)
401
+ return;
399
402
  void computePosition(reference, pane, { strategy: 'fixed', placement, middleware }).then(position => {
400
403
  // Whole pixels: a fractional translate blurs text on a non-retina screen.
401
404
  pane.style.transform = `translate(${Math.round(position.x)}px, ${Math.round(position.y)}px)`;
@@ -1 +1 @@
1
- {"version":3,"file":"agorapulse-ui-components-floating.mjs","sources":["../../../libs/ui-components/floating/src/anchor.ts","../../../libs/ui-components/floating/src/rect.ts","../../../libs/ui-components/floating/src/placement.ts","../../../libs/ui-components/floating/src/arrow/arrow-geometry.ts","../../../libs/ui-components/floating/src/arrow/arrow-offset.ts","../../../libs/ui-components/floating/src/arrow/arrow-placement.ts","../../../libs/ui-components/floating/src/arrow/ap-arrow.middleware.ts","../../../libs/ui-components/floating/src/arrow/arrow-styles.ts","../../../libs/ui-components/floating/src/floating-overlay.helper.ts","../../../libs/ui-components/floating/src/agorapulse-ui-components-floating.ts"],"sourcesContent":["import { FloatingPlacement } from './placement';\nimport { FloatingRect } from './rect';\n\n/** What the panel connects to. */\nexport type FloatingAnchorMode = 'trigger' | 'pointer' | 'pointer-free';\n\n/**\n * The placement derived when `placement` is unset. Reads the **configured** anchor mode, not the\n * resolved one: a keyboard opening falls back to the trigger, and if the alignment followed, the\n * component would change shape between mouse and keyboard.\n */\nexport function defaultPlacementFor(anchor: FloatingAnchorMode): FloatingPlacement {\n return anchor === 'trigger' ? 'bottom-start' : 'bottom';\n}\n\n/**\n * `'pointer'` is a hybrid whose zero dimension is the **cross-axis** one; a lateral panel built\n * from a fully point-like anchor would sit inside its own trigger. `'pointer-free'` is the point\n * itself. Both fall back to the trigger when there is no click.\n *\n * @param vertical The opening axis. Invariant under the flip, which only swaps the main axis.\n */\nexport function resolveAnchorRect(\n anchor: FloatingAnchorMode,\n triggerRect: FloatingRect,\n vertical: boolean,\n clickPoint?: { x: number; y: number }\n): FloatingRect {\n if (anchor === 'trigger' || !clickPoint) {\n return triggerRect;\n }\n\n if (anchor === 'pointer-free') {\n return { x: clickPoint.x, y: clickPoint.y, width: 0, height: 0 };\n }\n\n return vertical\n ? { x: clickPoint.x, y: triggerRect.y, width: 0, height: triggerRect.height }\n : { x: triggerRect.x, y: clickPoint.y, width: triggerRect.width, height: 0 };\n}\n\n/**\n * A keyboard-synthesised click carries `detail: 0` and `clientX: 0`, which without this guard puts\n * the pointer anchor in the screen's top-left corner.\n * Only a `click` is checked, because `detail` counts clicks and is 0 on a hover too.\n */\nexport function clickPointOf(event?: MouseEvent): { x: number; y: number } | undefined {\n if (!event || (event.type === 'click' && event.detail === 0)) {\n return undefined;\n }\n\n return { x: event.clientX, y: event.clientY };\n}\n\n/** A point expressed as a proportion of the trigger, on each axis. */\nexport interface ClickRatio {\n x: number;\n y: number;\n}\n\n/**\n * A ratio names a place on the trigger where a viewport coordinate names a place in the window,\n * which is what makes a pointer anchor survive scrolling, resizing and shifting. `undefined` for a\n * trigger with no area, so the anchor falls back to the element rather than divide by zero.\n */\nexport function resolveClickRatio(triggerRect: FloatingRect, clickPoint?: { x: number; y: number }): ClickRatio | undefined {\n if (!clickPoint || triggerRect.width <= 0 || triggerRect.height <= 0) {\n return undefined;\n }\n\n return {\n x: (clickPoint.x - triggerRect.x) / triggerRect.width,\n y: (clickPoint.y - triggerRect.y) / triggerRect.height,\n };\n}\n\n/** The inverse: the viewport point this ratio names within a **fresh** trigger rect. */\nexport function pointFromRatio(triggerRect: FloatingRect, ratio?: ClickRatio): { x: number; y: number } | undefined {\n if (!ratio) {\n return undefined;\n }\n\n return {\n x: triggerRect.x + ratio.x * triggerRect.width,\n y: triggerRect.y + ratio.y * triggerRect.height,\n };\n}\n","/** A minimal rect — neither `DOMRect` nor any DOM dependency, so the pure units stay pure. */\nexport interface FloatingRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/**\n * Whole pixels, to match the panel's rounded translate and to stop the hiding test flickering on\n * sub-pixel noise.\n */\nexport function roundRect(rect: FloatingRect): FloatingRect {\n return {\n x: Math.round(rect.x),\n y: Math.round(rect.y),\n width: Math.round(rect.width),\n height: Math.round(rect.height),\n };\n}\n\nexport function overlaps(a: FloatingRect, b: FloatingRect): boolean {\n return a.x < b.x + b.width && b.x < a.x + a.width && a.y < b.y + b.height && b.y < a.y + a.height;\n}\n","import { Placement, Side } from '@floating-ui/dom';\n\n/**\n * The twelve placements, aliased from Floating UI rather than redeclared. The trade-off: this puts\n * `@floating-ui/dom` in our **public** type surface, so its next major would move our types too.\n *\n * There is no `'auto'`; an unset placement is derived by `defaultPlacementFor`.\n */\nexport type FloatingPlacement = Placement;\n\n/** The four opening sides. Floating UI's `Side`, for the same reason. */\nexport type FloatingSide = Side;\n\nexport function sideOf(placement: FloatingPlacement): FloatingSide {\n return placement.split('-')[0] as FloatingSide;\n}\n\nexport function isVertical(placement: FloatingPlacement): boolean {\n const side = sideOf(placement);\n return side === 'top' || side === 'bottom';\n}\n","/**\n * The arrow drawing's dimensions, shared by the offset computation, the CSS insets and the\n * stylesheet. The mask's `path` in `_floating-arrow.scss` encodes them too and cannot follow a\n * variable, so changing either number here means redrawing that SVG.\n */\nexport const ARROW_WIDTH = 16;\nexport const ARROW_HEIGHT = 8;\n","import { FloatingSide, isVertical } from '../placement';\nimport { FloatingRect } from '../rect';\nimport { ARROW_WIDTH } from './arrow-geometry';\n\nexport interface ArrowOffsetInput {\n /** The side of the panel the arrow sits on — the **resolved** side, not the wanted one. */\n side: FloatingSide;\n anchorRect: FloatingRect;\n floatingRect: FloatingRect;\n /** `'anchor'` aims at the anchor ∩ panel intersection's centre, `'pointer'` at the click. */\n targetMode: 'anchor' | 'pointer';\n clickPoint?: { x: number; y: number };\n}\n\nexport interface ArrowOffsetResult {\n /** The arrow's offset from the panel's start edge, along the cross axis. */\n offset: number;\n clamped: boolean;\n /** The click fell outside the panel, so the intersection centre was used instead. */\n fellBack: boolean;\n /** The panel is too narrow: the clamp range inverts and the arrow is centred outright. */\n centered: boolean;\n}\n\n/** The surface's own corner radius, which the tip must not encroach on. */\nconst RADIUS = 4;\n\n/**\n * Three rules, in order:\n *\n * 1. Aim at the centre of the **anchor ∩ panel intersection**, never the anchor's own centre —\n * `apArrow` documents why this diverges from Floating UI.\n * 2. In `'pointer'` mode, aim at the click, falling back to rule 1 — discontinuously, as the\n * plates specify — when the click lands outside the panel.\n * 3. Clamp to leave the corner radius clear. Below `arrow + 2 × radius` = 24px the range inverts,\n * and the arrow is centred outright.\n *\n * The flags say which rule applied, so the generated plate cases can assert the path taken.\n */\nexport function resolveArrowOffset(input: ArrowOffsetInput): ArrowOffsetResult {\n const vertical = isVertical(input.side);\n const panel = input.floatingRect;\n const anchor = input.anchorRect;\n\n const panelStart = vertical ? panel.x : panel.y;\n const panelEnd = panelStart + (vertical ? panel.width : panel.height);\n const size = vertical ? panel.width : panel.height;\n const anchorStart = vertical ? anchor.x : anchor.y;\n const anchorEnd = anchorStart + (vertical ? anchor.width : anchor.height);\n const click = input.clickPoint ? (vertical ? input.clickPoint.x : input.clickPoint.y) : undefined;\n\n const aimsAtPointer = input.targetMode === 'pointer' && click !== undefined && click >= panelStart && click <= panelEnd;\n\n let target: number;\n let fellBack = false;\n if (aimsAtPointer && click !== undefined) {\n target = click;\n } else {\n fellBack = input.targetMode === 'pointer';\n const from = Math.max(panelStart, anchorStart);\n const to = Math.min(panelEnd, anchorEnd);\n target = to >= from ? (from + to) / 2 : (panelStart + panelEnd) / 2;\n }\n\n const raw = target - panelStart - ARROW_WIDTH / 2;\n const low = RADIUS;\n const high = size - ARROW_WIDTH - RADIUS;\n\n if (high < low) {\n return { offset: (size - ARROW_WIDTH) / 2, clamped: false, fellBack, centered: true };\n }\n\n const offset = Math.max(low, Math.min(high, raw));\n return { offset, clamped: Math.abs(offset - raw) > 0.5, fellBack, centered: false };\n}\n","import { FloatingPlacement, FloatingSide, sideOf } from '../placement';\nimport { ARROW_HEIGHT, ARROW_WIDTH } from './arrow-geometry';\n\nconst OPPOSITE: Record<FloatingSide, FloatingSide> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n};\n\n/**\n * The panel edge an arrow sits on: a panel placed `bottom` hangs below its anchor, so its tip is on\n * its top edge. Give it the **resolved** placement, or a flipped panel grows its arrow away.\n */\nexport function arrowSideFor(placement: FloatingPlacement): FloatingSide {\n return OPPOSITE[sideOf(placement)];\n}\n\n/** Ready-to-use CSS values, `'auto'` for the sides that do not apply. */\nexport interface ArrowPlacement {\n top: string;\n right: string;\n bottom: string;\n left: string;\n rotate: string;\n}\n\n/** One pixel of overlap, or a sub-pixel seam opens at the joint. */\nconst OVERLAP = 1;\n\n/** How far it stands out on the main axis, measured from the panel's edge. */\nconst MAIN_INSET = ARROW_HEIGHT - OVERLAP;\n\n/**\n * The same laterally. A ±90° rotation turns about the box's centre, so the unrotated box is pushed\n * out by half its width less the half height it gains back, for the footprint to clear by `MAIN_INSET`.\n */\nconst SIDE_INSET = ARROW_WIDTH / 2 + ARROW_HEIGHT / 2 - OVERLAP;\n\n/** Compensation for that same rotation centre, on the cross axis. */\nconst CROSS_SHIFT = (ARROW_WIDTH - ARROW_HEIGHT) / 2;\n\n/**\n * The insets and rotation `_floating-arrow.scss` reads off the pane. The rotation-centre\n * compensation lives here rather than in the stylesheet, where it could not be tested.\n *\n * @param side The panel edge the arrow sits on — the **resolved** side, not the wanted one.\n * @param offset The offset from the panel's start edge, along the cross axis.\n */\nexport function resolveArrowPlacement(side: FloatingSide, offset: number): ArrowPlacement {\n const auto = 'auto';\n\n if (side === 'top') {\n return { top: `${-MAIN_INSET}px`, right: auto, bottom: auto, left: `${offset}px`, rotate: '0deg' };\n }\n\n if (side === 'bottom') {\n return { top: auto, right: auto, bottom: `${-MAIN_INSET}px`, left: `${offset}px`, rotate: '180deg' };\n }\n\n const cross = `${offset + CROSS_SHIFT}px`;\n\n return side === 'left'\n ? { top: cross, right: auto, bottom: auto, left: `${-SIDE_INSET}px`, rotate: '-90deg' }\n : { top: cross, right: `${-SIDE_INSET}px`, bottom: auto, left: auto, rotate: '90deg' };\n}\n","import { Middleware, MiddlewareState } from '@floating-ui/dom';\nimport { ClickRatio, FloatingAnchorMode } from '../anchor';\nimport { FloatingSide } from '../placement';\nimport { FloatingRect, overlaps, roundRect } from '../rect';\nimport { resolveArrowOffset } from './arrow-offset';\nimport { arrowSideFor } from './arrow-placement';\n\nexport interface ApArrowOptions {\n /** What the tip aims at — see {@link resolveArrowOffset}. */\n targetMode: 'anchor' | 'pointer';\n /** The configured anchor mode. Decides how the click is recovered from the reference rect. */\n anchorMode: FloatingAnchorMode;\n /** The clicked point as a proportion of the trigger. Absent on a keyboard opening. */\n clickRatio?: ClickRatio;\n}\n\n/** What the middleware leaves in `middlewareData.apArrow`. */\nexport interface ApArrowData {\n /** The arrow's offset from the panel's start edge, along the cross axis. */\n offset: number;\n /** The side of the panel the arrow sits on — read from the **resolved** placement. */\n side: FloatingSide;\n /** The panel covers its **anchor** — in the POI mode the trigger may be covered on purpose. */\n hidden: boolean;\n}\n\nexport const AP_ARROW = 'apArrow';\n\n/**\n * Replaces Floating UI's `arrow`, which aims at the centre of the *reference*: on a 280px trigger\n * with a 100px panel that centre is out of reach and the tip clamps to a corner at 80, where the\n * intersection's centre is 42 (plate 22). {@link resolveArrowOffset} holds the rule.\n *\n * Must run last, after `shift`, since it reads the panel's final position.\n */\nexport function apArrow(options: ApArrowOptions): Middleware {\n return {\n name: AP_ARROW,\n options,\n fn(state: MiddlewareState) {\n // Both rects come from Floating UI, in one space. Measuring the pane here would not.\n const anchorRect = roundRect(state.rects.reference);\n const floatingRect = roundRect({\n x: state.x,\n y: state.y,\n width: state.rects.floating.width,\n height: state.rects.floating.height,\n });\n\n const { offset } = resolveArrowOffset({\n side: arrowSideFor(state.placement),\n anchorRect,\n floatingRect,\n targetMode: options.targetMode,\n clickPoint: clickPointIn(anchorRect, options),\n });\n\n const data: ApArrowData = {\n offset,\n side: arrowSideFor(state.placement),\n hidden: overlaps(floatingRect, anchorRect),\n };\n return { data };\n },\n };\n}\n\n/**\n * In the pointer modes the reference **is** the click, so its origin is the point. Its coordinate\n * on the main axis is the trigger's and goes unread: the offset only ever reads the cross axis.\n */\nfunction clickPointIn(anchorRect: FloatingRect, { anchorMode, clickRatio }: ApArrowOptions): { x: number; y: number } | undefined {\n if (!clickRatio) {\n return undefined;\n }\n if (anchorMode !== 'trigger') {\n return { x: anchorRect.x, y: anchorRect.y };\n }\n return {\n x: anchorRect.x + clickRatio.x * anchorRect.width,\n y: anchorRect.y + clickRatio.y * anchorRect.height,\n };\n}\n","import { ApArrowData } from './ap-arrow.middleware';\nimport { ARROW_HEIGHT, ARROW_WIDTH } from './arrow-geometry';\nimport { resolveArrowPlacement } from './arrow-placement';\n\n/**\n * Set on the pane when an arrow is asked for. The drawing is global CSS because the pane belongs to\n * no component's DOM, so no encapsulated stylesheet can reach it.\n */\nexport const ARROW_CLASS = 'ap-floating-arrow';\n\n/**\n * Written on the first computation only: `getComputedStyle` forces a style recalculation, and the\n * update cycle runs on every scroll of every scrollable ancestor.\n *\n * **A contract for panels that ask for an arrow**: the pane's first element child must be the\n * styled surface, not a wrapper around it. The arrow's colour is lifted off that element, and the\n * stylesheet neutralises its shadow — a wrapper yields a transparent tip and two shadows at the\n * joint.\n *\n * Only CSS knows which element carries a background, so this is checked in a browser, never in a\n * unit test.\n *\n * @returns whether the surface was there to read, so the caller can retry on the next pass.\n */\nexport function writeArrowInvariants(pane: HTMLElement): boolean {\n pane.style.setProperty('--ap-floating-arrow-width', `${ARROW_WIDTH}px`);\n pane.style.setProperty('--ap-floating-arrow-height', `${ARROW_HEIGHT}px`);\n\n const surface = pane.firstElementChild;\n if (!surface) {\n return false;\n }\n\n pane.style.setProperty('--ap-arrow-background', getComputedStyle(surface).backgroundColor);\n return true;\n}\n\n/** The half that moves with the panel. */\nexport function writeArrowStyles(pane: HTMLElement, arrow: ApArrowData): void {\n const placement = resolveArrowPlacement(arrow.side, arrow.offset);\n\n pane.style.setProperty('--ap-arrow-top', placement.top);\n pane.style.setProperty('--ap-arrow-right', placement.right);\n pane.style.setProperty('--ap-arrow-bottom', placement.bottom);\n pane.style.setProperty('--ap-arrow-left', placement.left);\n pane.style.setProperty('--ap-arrow-rotate', placement.rotate);\n pane.style.setProperty('--ap-arrow-visibility', arrow.hidden ? 'hidden' : 'visible');\n}\n","import { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';\nimport { ComponentRef, DestroyRef, ElementRef, inject, signal, TemplateRef, Type, ViewContainerRef } from '@angular/core';\nimport { autoUpdate, computePosition, flip, offset, shift, size, VirtualElement } from '@floating-ui/dom';\nimport { filter } from 'rxjs/operators';\nimport {\n clickPointOf,\n ClickRatio,\n defaultPlacementFor,\n FloatingAnchorMode,\n pointFromRatio,\n resolveAnchorRect,\n resolveClickRatio,\n} from './anchor';\nimport { AP_ARROW, apArrow, ApArrowData } from './arrow/ap-arrow.middleware';\nimport { ARROW_HEIGHT } from './arrow/arrow-geometry';\nimport { ARROW_CLASS, writeArrowInvariants, writeArrowStyles } from './arrow/arrow-styles';\nimport { FloatingPlacement, isVertical } from './placement';\nimport { FloatingRect, roundRect } from './rect';\n\nexport interface FloatingOverlayConfig {\n /** Unset means derived from `anchor`. There is no `'auto'` value. */\n placement?: FloatingPlacement;\n anchor?: FloatingAnchorMode;\n arrow?: boolean;\n arrowTarget?: 'anchor' | 'pointer';\n showBackdrop?: boolean;\n panelClass?: string | string[];\n /** Fallback for the two handlers below. */\n onClose?: () => void;\n /** Escape, which always closes. Unset means `onClose`. */\n onEscape?: () => void;\n /** Outside click. Unset means `onClose`. */\n onOutsideClick?: () => void;\n /**\n * Elements that carry their own toggle, so a click on them is not \"the outside\". Read on every\n * event, since the list may change while the floating is open.\n *\n * Without this, the CDK's capture-phase dispatcher closes before a secondary trigger sees the\n * click, that trigger reopens, and the toggle never closes again.\n */\n additionalTriggers?: () => readonly HTMLElement[];\n}\n\n/** The visual gap between anchor and panel. An arrow adds its own length: the tip must clear the edge. */\n/** Read by a surface that wants to fit: `max-height: var(--ap-floating-available-height)`. */\nexport const AVAILABLE_HEIGHT = '--ap-floating-available-height';\n\nconst GAP = 4;\n\nconst VIEWPORT_MARGIN = 8;\n\ninterface Measurable {\n getBoundingClientRect: () => { left: number; top: number; width: number; height: number };\n}\n\nfunction toRect(source: Measurable): FloatingRect {\n const rect = source.getBoundingClientRect();\n return roundRect({ x: rect.left, y: rect.top, width: rect.width, height: rect.height });\n}\n\ninterface AnchorState {\n target: HTMLElement;\n mode: FloatingAnchorMode;\n /** The opening axis. Invariant under the flip, which only swaps the main axis. */\n vertical: boolean;\n /** The click as a proportion of the trigger, so it survives scrolling, resizing and shifting. */\n ratio?: ClickRatio;\n}\n\nexport function createFloatingOverlay() {\n const elementRef = inject(ElementRef);\n const overlay = inject(Overlay);\n const viewContainerRef = inject(ViewContainerRef);\n\n let _overlayRef: OverlayRef | null = null;\n let stopAutoUpdate: (() => void) | null = null;\n let reposition: (() => void) | null = null;\n let anchorState: AnchorState | null = null;\n const isOpen = signal(false);\n\n inject(DestroyRef).onDestroy(() => close());\n\n /**\n * Opens the floating on a `TemplateRef`, attached as is, or on a component whose `ComponentRef`\n * is handed back, typed on the component, so the caller can set its inputs.\n *\n * The position keeps itself current, so inputs set after this returns need no refresh.\n */\n function open<T = unknown>(\n content: TemplateRef<unknown> | Type<T>,\n triggerElement?: HTMLElement,\n config?: FloatingOverlayConfig,\n event?: MouseEvent\n ): ComponentRef<T> | null {\n if (isOpen()) return null;\n\n const target = triggerElement ?? elementRef.nativeElement;\n const mode = config?.anchor ?? 'trigger';\n const placement = config?.placement ?? defaultPlacementFor(mode);\n\n anchorState = captureAnchor(target, mode, placement, event);\n\n disposeOverlay();\n _overlayRef = createOverlay(config);\n const pane = _overlayRef.overlayElement;\n // Floating UI's coordinates are viewport-relative; the CDK's `absolute` would misread them.\n pane.style.position = 'fixed';\n pane.style.left = '0';\n pane.style.top = '0';\n\n const panelRef = attachContent(content);\n isOpen.set(true);\n\n if (config?.arrow === true) {\n // On opening, so the pane carries the single silhouette's shadow before the first frame.\n pane.classList.add(ARROW_CLASS);\n }\n\n watchPosition(pane, placement, config);\n watchDismissal(target, config);\n\n return panelRef;\n }\n\n function captureAnchor(target: HTMLElement, mode: FloatingAnchorMode, placement: FloatingPlacement, event?: MouseEvent): AnchorState {\n return { target, mode, vertical: isVertical(placement), ratio: resolveClickRatio(toRect(target), clickPointOf(event)) };\n }\n\n /**\n * The reference **is** the anchor in all three modes, which is what lets the arrow read\n * `rects.reference` rather than rebuild it. `contextElement` is load-bearing: without it\n * `autoUpdate` cannot find the scrollable ancestors of an anchor that has no DOM node.\n */\n function toReference(state: AnchorState): HTMLElement | VirtualElement {\n if (state.mode === 'trigger' || !state.ratio) {\n return state.target;\n }\n\n return {\n contextElement: state.target,\n getBoundingClientRect: () => {\n const trigger = toRect(state.target);\n const rect = resolveAnchorRect(state.mode, trigger, state.vertical, pointFromRatio(trigger, state.ratio));\n return new DOMRect(rect.x, rect.y, rect.width, rect.height);\n },\n };\n }\n\n function createOverlay(config?: FloatingOverlayConfig): OverlayRef {\n return overlay.create({\n hasBackdrop: config?.showBackdrop ?? false,\n backdropClass: '',\n panelClass: config?.panelClass ?? '',\n // No scroll strategy: `autoUpdate` owns the update cycle, and the CDK's default is a no-op.\n usePopover: false,\n });\n }\n\n function attachContent<T>(content: TemplateRef<unknown> | Type<T>): ComponentRef<T> | null {\n if (!_overlayRef) return null;\n if (content instanceof TemplateRef) {\n _overlayRef.attach(new TemplatePortal(content, viewContainerRef));\n return null;\n }\n return _overlayRef.attach(new ComponentPortal(content, viewContainerRef));\n }\n\n /**\n * `autoUpdate` is the whole update cycle: scrollable ancestors of both boxes, the viewport,\n * both boxes' own resizing, and layout shifts. Nothing else here watches anything.\n */\n function watchPosition(pane: HTMLElement, placement: FloatingPlacement, config?: FloatingOverlayConfig): void {\n const state = anchorState;\n if (!state) return;\n const reference = toReference(state);\n\n const middleware = [\n offset(config?.arrow === true ? GAP + ARROW_HEIGHT : GAP),\n flip({ crossAxis: false, flipAlignment: false, padding: VIEWPORT_MARGIN }),\n shift({ padding: VIEWPORT_MARGIN }),\n // After flip and shift, so what it publishes is the room left on the side they settled on.\n size({\n padding: VIEWPORT_MARGIN,\n apply: ({ availableHeight }) => pane.style.setProperty(AVAILABLE_HEIGHT, `${Math.round(availableHeight)}px`),\n }),\n ];\n if (config?.arrow === true) {\n middleware.push(apArrow({ targetMode: config.arrowTarget ?? 'anchor', anchorMode: state.mode, clickRatio: state.ratio }));\n }\n\n let invariantsWritten = false;\n\n reposition = () => {\n void computePosition(reference, pane, { strategy: 'fixed', placement, middleware }).then(position => {\n // Whole pixels: a fractional translate blurs text on a non-retina screen.\n pane.style.transform = `translate(${Math.round(position.x)}px, ${Math.round(position.y)}px)`;\n const arrow: ApArrowData | undefined = position.middlewareData[AP_ARROW];\n if (arrow) {\n invariantsWritten = invariantsWritten || writeArrowInvariants(pane);\n writeArrowStyles(pane, arrow);\n }\n });\n };\n\n stopAutoUpdate = autoUpdate(reference, pane, reposition);\n }\n\n function watchDismissal(target: HTMLElement, config?: FloatingOverlayConfig): void {\n if (!_overlayRef) return;\n\n const closeHandler = config?.onClose ?? (() => close());\n const outsideHandler = config?.onOutsideClick ?? closeHandler;\n const escapeHandler = config?.onEscape ?? closeHandler;\n\n const ownsGesture = (node: Node): boolean =>\n target.contains(node) || (config?.additionalTriggers?.() ?? []).some(element => element.contains(node));\n\n // No `take(1)`: a handler may decline to close, and it must still hear the next gesture. Dispose ends both.\n _overlayRef\n .outsidePointerEvents()\n .pipe(filter(pointerEvent => !(pointerEvent.target instanceof Node && ownsGesture(pointerEvent.target))))\n .subscribe(() => outsideHandler());\n\n _overlayRef\n .keydownEvents()\n .pipe(filter(keyEvent => keyEvent.key === 'Escape'))\n .subscribe(() => escapeHandler());\n }\n\n /** The observers never outlive their overlay: they would reposition it after its destruction. */\n function disposeOverlay(): void {\n stopAutoUpdate?.();\n stopAutoUpdate = null;\n reposition = null;\n _overlayRef?.dispose();\n _overlayRef = null;\n }\n\n function close(): void {\n if (!isOpen()) return;\n\n anchorState = null;\n disposeOverlay();\n isOpen.set(false);\n }\n\n /** Recomputes now. For a caller that knows the geometry changed before any observer can see it. */\n function updatePosition(): void {\n reposition?.();\n }\n\n return {\n get overlayRef() {\n return _overlayRef;\n },\n isOpen: isOpen.asReadonly(),\n open,\n close,\n updatePosition,\n };\n}\n\nexport type FloatingOverlayInstance = ReturnType<typeof createFloatingOverlay>;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAMA;;;;AAIG;AACG,SAAU,mBAAmB,CAAC,MAA0B,EAAA;IAC1D,OAAO,MAAM,KAAK,SAAS,GAAG,cAAc,GAAG,QAAQ;AAC3D;AAEA;;;;;;AAMG;AACG,SAAU,iBAAiB,CAC7B,MAA0B,EAC1B,WAAyB,EACzB,QAAiB,EACjB,UAAqC,EAAA;AAErC,IAAA,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,UAAU,EAAE;AACrC,QAAA,OAAO,WAAW;IACtB;AAEA,IAAA,IAAI,MAAM,KAAK,cAAc,EAAE;QAC3B,OAAO,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;IACpE;AAEA,IAAA,OAAO;UACD,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM;UAC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AC,MAAM,EAAE;YAAE;QAEf,WAAW,GAAG,IAAI;AAClB,QAAA,cAAc,EAAE;AAChB,QAAA,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;IACrB;;AAGA,IAAA,SAAS,cAAc,GAAA;QACnB,UAAU,IAAI;IAClB;IAEA,OAAO;AACH,QAAA,IAAI,UAAU,GAAA;AACV,YAAA,OAAO,WAAW;QACtB,CAAC;AACD,QAAA,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE;QAC3B,IAAI;QACJ,KAAK;QACL,cAAc;KACjB;AACL;;ACrQA;;AAEG;;;;"}
1
+ {"version":3,"file":"agorapulse-ui-components-floating.mjs","sources":["../../../libs/ui-components/floating/src/anchor.ts","../../../libs/ui-components/floating/src/rect.ts","../../../libs/ui-components/floating/src/placement.ts","../../../libs/ui-components/floating/src/arrow/arrow-geometry.ts","../../../libs/ui-components/floating/src/arrow/arrow-offset.ts","../../../libs/ui-components/floating/src/arrow/arrow-placement.ts","../../../libs/ui-components/floating/src/arrow/ap-arrow.middleware.ts","../../../libs/ui-components/floating/src/arrow/arrow-styles.ts","../../../libs/ui-components/floating/src/floating-overlay.helper.ts","../../../libs/ui-components/floating/src/agorapulse-ui-components-floating.ts"],"sourcesContent":["import { FloatingPlacement } from './placement';\nimport { FloatingRect } from './rect';\n\n/** What the panel connects to. */\nexport type FloatingAnchorMode = 'trigger' | 'pointer' | 'pointer-free';\n\n/**\n * The placement derived when `placement` is unset. Reads the **configured** anchor mode, not the\n * resolved one: a keyboard opening falls back to the trigger, and if the alignment followed, the\n * component would change shape between mouse and keyboard.\n */\nexport function defaultPlacementFor(anchor: FloatingAnchorMode): FloatingPlacement {\n return anchor === 'trigger' ? 'bottom-start' : 'bottom';\n}\n\n/**\n * `'pointer'` is a hybrid whose zero dimension is the **cross-axis** one; a lateral panel built\n * from a fully point-like anchor would sit inside its own trigger. `'pointer-free'` is the point\n * itself. Both fall back to the trigger when there is no click.\n *\n * @param vertical The opening axis. Invariant under the flip, which only swaps the main axis.\n */\nexport function resolveAnchorRect(\n anchor: FloatingAnchorMode,\n triggerRect: FloatingRect,\n vertical: boolean,\n clickPoint?: { x: number; y: number }\n): FloatingRect {\n if (anchor === 'trigger' || !clickPoint) {\n return triggerRect;\n }\n\n if (anchor === 'pointer-free') {\n return { x: clickPoint.x, y: clickPoint.y, width: 0, height: 0 };\n }\n\n return vertical\n ? { x: clickPoint.x, y: triggerRect.y, width: 0, height: triggerRect.height }\n : { x: triggerRect.x, y: clickPoint.y, width: triggerRect.width, height: 0 };\n}\n\n/**\n * A keyboard-synthesised click carries `detail: 0` and `clientX: 0`, which without this guard puts\n * the pointer anchor in the screen's top-left corner.\n * Only a `click` is checked, because `detail` counts clicks and is 0 on a hover too.\n */\nexport function clickPointOf(event?: MouseEvent): { x: number; y: number } | undefined {\n if (!event || (event.type === 'click' && event.detail === 0)) {\n return undefined;\n }\n\n return { x: event.clientX, y: event.clientY };\n}\n\n/** A point expressed as a proportion of the trigger, on each axis. */\nexport interface ClickRatio {\n x: number;\n y: number;\n}\n\n/**\n * A ratio names a place on the trigger where a viewport coordinate names a place in the window,\n * which is what makes a pointer anchor survive scrolling, resizing and shifting. `undefined` for a\n * trigger with no area, so the anchor falls back to the element rather than divide by zero.\n */\nexport function resolveClickRatio(triggerRect: FloatingRect, clickPoint?: { x: number; y: number }): ClickRatio | undefined {\n if (!clickPoint || triggerRect.width <= 0 || triggerRect.height <= 0) {\n return undefined;\n }\n\n return {\n x: (clickPoint.x - triggerRect.x) / triggerRect.width,\n y: (clickPoint.y - triggerRect.y) / triggerRect.height,\n };\n}\n\n/** The inverse: the viewport point this ratio names within a **fresh** trigger rect. */\nexport function pointFromRatio(triggerRect: FloatingRect, ratio?: ClickRatio): { x: number; y: number } | undefined {\n if (!ratio) {\n return undefined;\n }\n\n return {\n x: triggerRect.x + ratio.x * triggerRect.width,\n y: triggerRect.y + ratio.y * triggerRect.height,\n };\n}\n","/** A minimal rect — neither `DOMRect` nor any DOM dependency, so the pure units stay pure. */\nexport interface FloatingRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/**\n * Whole pixels, to match the panel's rounded translate and to stop the hiding test flickering on\n * sub-pixel noise.\n */\nexport function roundRect(rect: FloatingRect): FloatingRect {\n return {\n x: Math.round(rect.x),\n y: Math.round(rect.y),\n width: Math.round(rect.width),\n height: Math.round(rect.height),\n };\n}\n\nexport function overlaps(a: FloatingRect, b: FloatingRect): boolean {\n return a.x < b.x + b.width && b.x < a.x + a.width && a.y < b.y + b.height && b.y < a.y + a.height;\n}\n","import { Placement, Side } from '@floating-ui/dom';\n\n/**\n * The twelve placements, aliased from Floating UI rather than redeclared. The trade-off: this puts\n * `@floating-ui/dom` in our **public** type surface, so its next major would move our types too.\n *\n * There is no `'auto'`; an unset placement is derived by `defaultPlacementFor`.\n */\nexport type FloatingPlacement = Placement;\n\n/** The four opening sides. Floating UI's `Side`, for the same reason. */\nexport type FloatingSide = Side;\n\nexport function sideOf(placement: FloatingPlacement): FloatingSide {\n return placement.split('-')[0] as FloatingSide;\n}\n\nexport function isVertical(placement: FloatingPlacement): boolean {\n const side = sideOf(placement);\n return side === 'top' || side === 'bottom';\n}\n","/**\n * The arrow drawing's dimensions, shared by the offset computation, the CSS insets and the\n * stylesheet. The mask's `path` in `_floating-arrow.scss` encodes them too and cannot follow a\n * variable, so changing either number here means redrawing that SVG.\n */\nexport const ARROW_WIDTH = 16;\nexport const ARROW_HEIGHT = 8;\n","import { FloatingSide, isVertical } from '../placement';\nimport { FloatingRect } from '../rect';\nimport { ARROW_WIDTH } from './arrow-geometry';\n\nexport interface ArrowOffsetInput {\n /** The side of the panel the arrow sits on — the **resolved** side, not the wanted one. */\n side: FloatingSide;\n anchorRect: FloatingRect;\n floatingRect: FloatingRect;\n /** `'anchor'` aims at the anchor ∩ panel intersection's centre, `'pointer'` at the click. */\n targetMode: 'anchor' | 'pointer';\n clickPoint?: { x: number; y: number };\n}\n\nexport interface ArrowOffsetResult {\n /** The arrow's offset from the panel's start edge, along the cross axis. */\n offset: number;\n clamped: boolean;\n /** The click fell outside the panel, so the intersection centre was used instead. */\n fellBack: boolean;\n /** The panel is too narrow: the clamp range inverts and the arrow is centred outright. */\n centered: boolean;\n}\n\n/** The surface's own corner radius, which the tip must not encroach on. */\nconst RADIUS = 4;\n\n/**\n * Three rules, in order:\n *\n * 1. Aim at the centre of the **anchor ∩ panel intersection**, never the anchor's own centre —\n * `apArrow` documents why this diverges from Floating UI.\n * 2. In `'pointer'` mode, aim at the click, falling back to rule 1 — discontinuously, as the\n * plates specify — when the click lands outside the panel.\n * 3. Clamp to leave the corner radius clear. Below `arrow + 2 × radius` = 24px the range inverts,\n * and the arrow is centred outright.\n *\n * The flags say which rule applied, so the generated plate cases can assert the path taken.\n */\nexport function resolveArrowOffset(input: ArrowOffsetInput): ArrowOffsetResult {\n const vertical = isVertical(input.side);\n const panel = input.floatingRect;\n const anchor = input.anchorRect;\n\n const panelStart = vertical ? panel.x : panel.y;\n const panelEnd = panelStart + (vertical ? panel.width : panel.height);\n const size = vertical ? panel.width : panel.height;\n const anchorStart = vertical ? anchor.x : anchor.y;\n const anchorEnd = anchorStart + (vertical ? anchor.width : anchor.height);\n const click = input.clickPoint ? (vertical ? input.clickPoint.x : input.clickPoint.y) : undefined;\n\n const aimsAtPointer = input.targetMode === 'pointer' && click !== undefined && click >= panelStart && click <= panelEnd;\n\n let target: number;\n let fellBack = false;\n if (aimsAtPointer && click !== undefined) {\n target = click;\n } else {\n fellBack = input.targetMode === 'pointer';\n const from = Math.max(panelStart, anchorStart);\n const to = Math.min(panelEnd, anchorEnd);\n target = to >= from ? (from + to) / 2 : (panelStart + panelEnd) / 2;\n }\n\n const raw = target - panelStart - ARROW_WIDTH / 2;\n const low = RADIUS;\n const high = size - ARROW_WIDTH - RADIUS;\n\n if (high < low) {\n return { offset: (size - ARROW_WIDTH) / 2, clamped: false, fellBack, centered: true };\n }\n\n const offset = Math.max(low, Math.min(high, raw));\n return { offset, clamped: Math.abs(offset - raw) > 0.5, fellBack, centered: false };\n}\n","import { FloatingPlacement, FloatingSide, sideOf } from '../placement';\nimport { ARROW_HEIGHT, ARROW_WIDTH } from './arrow-geometry';\n\nconst OPPOSITE: Record<FloatingSide, FloatingSide> = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left',\n};\n\n/**\n * The panel edge an arrow sits on: a panel placed `bottom` hangs below its anchor, so its tip is on\n * its top edge. Give it the **resolved** placement, or a flipped panel grows its arrow away.\n */\nexport function arrowSideFor(placement: FloatingPlacement): FloatingSide {\n return OPPOSITE[sideOf(placement)];\n}\n\n/** Ready-to-use CSS values, `'auto'` for the sides that do not apply. */\nexport interface ArrowPlacement {\n top: string;\n right: string;\n bottom: string;\n left: string;\n rotate: string;\n}\n\n/** One pixel of overlap, or a sub-pixel seam opens at the joint. */\nconst OVERLAP = 1;\n\n/** How far it stands out on the main axis, measured from the panel's edge. */\nconst MAIN_INSET = ARROW_HEIGHT - OVERLAP;\n\n/**\n * The same laterally. A ±90° rotation turns about the box's centre, so the unrotated box is pushed\n * out by half its width less the half height it gains back, for the footprint to clear by `MAIN_INSET`.\n */\nconst SIDE_INSET = ARROW_WIDTH / 2 + ARROW_HEIGHT / 2 - OVERLAP;\n\n/** Compensation for that same rotation centre, on the cross axis. */\nconst CROSS_SHIFT = (ARROW_WIDTH - ARROW_HEIGHT) / 2;\n\n/**\n * The insets and rotation `_floating-arrow.scss` reads off the pane. The rotation-centre\n * compensation lives here rather than in the stylesheet, where it could not be tested.\n *\n * @param side The panel edge the arrow sits on — the **resolved** side, not the wanted one.\n * @param offset The offset from the panel's start edge, along the cross axis.\n */\nexport function resolveArrowPlacement(side: FloatingSide, offset: number): ArrowPlacement {\n const auto = 'auto';\n\n if (side === 'top') {\n return { top: `${-MAIN_INSET}px`, right: auto, bottom: auto, left: `${offset}px`, rotate: '0deg' };\n }\n\n if (side === 'bottom') {\n return { top: auto, right: auto, bottom: `${-MAIN_INSET}px`, left: `${offset}px`, rotate: '180deg' };\n }\n\n const cross = `${offset + CROSS_SHIFT}px`;\n\n return side === 'left'\n ? { top: cross, right: auto, bottom: auto, left: `${-SIDE_INSET}px`, rotate: '-90deg' }\n : { top: cross, right: `${-SIDE_INSET}px`, bottom: auto, left: auto, rotate: '90deg' };\n}\n","import { Middleware, MiddlewareState } from '@floating-ui/dom';\nimport { ClickRatio, FloatingAnchorMode } from '../anchor';\nimport { FloatingSide } from '../placement';\nimport { FloatingRect, overlaps, roundRect } from '../rect';\nimport { resolveArrowOffset } from './arrow-offset';\nimport { arrowSideFor } from './arrow-placement';\n\nexport interface ApArrowOptions {\n /** What the tip aims at — see {@link resolveArrowOffset}. */\n targetMode: 'anchor' | 'pointer';\n /** The configured anchor mode. Decides how the click is recovered from the reference rect. */\n anchorMode: FloatingAnchorMode;\n /** The clicked point as a proportion of the trigger. Absent on a keyboard opening. */\n clickRatio?: ClickRatio;\n}\n\n/** What the middleware leaves in `middlewareData.apArrow`. */\nexport interface ApArrowData {\n /** The arrow's offset from the panel's start edge, along the cross axis. */\n offset: number;\n /** The side of the panel the arrow sits on — read from the **resolved** placement. */\n side: FloatingSide;\n /** The panel covers its **anchor** — in the POI mode the trigger may be covered on purpose. */\n hidden: boolean;\n}\n\nexport const AP_ARROW = 'apArrow';\n\n/**\n * Replaces Floating UI's `arrow`, which aims at the centre of the *reference*: on a 280px trigger\n * with a 100px panel that centre is out of reach and the tip clamps to a corner at 80, where the\n * intersection's centre is 42 (plate 22). {@link resolveArrowOffset} holds the rule.\n *\n * Must run last, after `shift`, since it reads the panel's final position.\n */\nexport function apArrow(options: ApArrowOptions): Middleware {\n return {\n name: AP_ARROW,\n options,\n fn(state: MiddlewareState) {\n // Both rects come from Floating UI, in one space. Measuring the pane here would not.\n const anchorRect = roundRect(state.rects.reference);\n const floatingRect = roundRect({\n x: state.x,\n y: state.y,\n width: state.rects.floating.width,\n height: state.rects.floating.height,\n });\n\n const { offset } = resolveArrowOffset({\n side: arrowSideFor(state.placement),\n anchorRect,\n floatingRect,\n targetMode: options.targetMode,\n clickPoint: clickPointIn(anchorRect, options),\n });\n\n const data: ApArrowData = {\n offset,\n side: arrowSideFor(state.placement),\n hidden: overlaps(floatingRect, anchorRect),\n };\n return { data };\n },\n };\n}\n\n/**\n * In the pointer modes the reference **is** the click, so its origin is the point. Its coordinate\n * on the main axis is the trigger's and goes unread: the offset only ever reads the cross axis.\n */\nfunction clickPointIn(anchorRect: FloatingRect, { anchorMode, clickRatio }: ApArrowOptions): { x: number; y: number } | undefined {\n if (!clickRatio) {\n return undefined;\n }\n if (anchorMode !== 'trigger') {\n return { x: anchorRect.x, y: anchorRect.y };\n }\n return {\n x: anchorRect.x + clickRatio.x * anchorRect.width,\n y: anchorRect.y + clickRatio.y * anchorRect.height,\n };\n}\n","import { ApArrowData } from './ap-arrow.middleware';\nimport { ARROW_HEIGHT, ARROW_WIDTH } from './arrow-geometry';\nimport { resolveArrowPlacement } from './arrow-placement';\n\n/**\n * Set on the pane when an arrow is asked for. The drawing is global CSS because the pane belongs to\n * no component's DOM, so no encapsulated stylesheet can reach it.\n */\nexport const ARROW_CLASS = 'ap-floating-arrow';\n\n/**\n * Written on the first computation only: `getComputedStyle` forces a style recalculation, and the\n * update cycle runs on every scroll of every scrollable ancestor.\n *\n * **A contract for panels that ask for an arrow**: the pane's first element child must be the\n * styled surface, not a wrapper around it. The arrow's colour is lifted off that element, and the\n * stylesheet neutralises its shadow — a wrapper yields a transparent tip and two shadows at the\n * joint.\n *\n * Only CSS knows which element carries a background, so this is checked in a browser, never in a\n * unit test.\n *\n * @returns whether the surface was there to read, so the caller can retry on the next pass.\n */\nexport function writeArrowInvariants(pane: HTMLElement): boolean {\n pane.style.setProperty('--ap-floating-arrow-width', `${ARROW_WIDTH}px`);\n pane.style.setProperty('--ap-floating-arrow-height', `${ARROW_HEIGHT}px`);\n\n const surface = pane.firstElementChild;\n if (!surface) {\n return false;\n }\n\n pane.style.setProperty('--ap-arrow-background', getComputedStyle(surface).backgroundColor);\n return true;\n}\n\n/** The half that moves with the panel. */\nexport function writeArrowStyles(pane: HTMLElement, arrow: ApArrowData): void {\n const placement = resolveArrowPlacement(arrow.side, arrow.offset);\n\n pane.style.setProperty('--ap-arrow-top', placement.top);\n pane.style.setProperty('--ap-arrow-right', placement.right);\n pane.style.setProperty('--ap-arrow-bottom', placement.bottom);\n pane.style.setProperty('--ap-arrow-left', placement.left);\n pane.style.setProperty('--ap-arrow-rotate', placement.rotate);\n pane.style.setProperty('--ap-arrow-visibility', arrow.hidden ? 'hidden' : 'visible');\n}\n","import { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal, TemplatePortal } from '@angular/cdk/portal';\nimport { ComponentRef, DestroyRef, ElementRef, inject, signal, TemplateRef, Type, ViewContainerRef } from '@angular/core';\nimport { autoUpdate, computePosition, flip, offset, shift, size, VirtualElement } from '@floating-ui/dom';\nimport { filter } from 'rxjs/operators';\nimport {\n clickPointOf,\n ClickRatio,\n defaultPlacementFor,\n FloatingAnchorMode,\n pointFromRatio,\n resolveAnchorRect,\n resolveClickRatio,\n} from './anchor';\nimport { AP_ARROW, apArrow, ApArrowData } from './arrow/ap-arrow.middleware';\nimport { ARROW_HEIGHT } from './arrow/arrow-geometry';\nimport { ARROW_CLASS, writeArrowInvariants, writeArrowStyles } from './arrow/arrow-styles';\nimport { FloatingPlacement, isVertical } from './placement';\nimport { FloatingRect, roundRect } from './rect';\n\nexport interface FloatingOverlayConfig {\n /** Unset means derived from `anchor`. There is no `'auto'` value. */\n placement?: FloatingPlacement;\n anchor?: FloatingAnchorMode;\n arrow?: boolean;\n arrowTarget?: 'anchor' | 'pointer';\n showBackdrop?: boolean;\n panelClass?: string | string[];\n /** Fallback for the two handlers below. */\n onClose?: () => void;\n /** Escape, which always closes. Unset means `onClose`. */\n onEscape?: () => void;\n /** Outside click. Unset means `onClose`. */\n onOutsideClick?: () => void;\n /**\n * Elements that carry their own toggle, so a click on them is not \"the outside\". Read on every\n * event, since the list may change while the floating is open.\n *\n * Without this, the CDK's capture-phase dispatcher closes before a secondary trigger sees the\n * click, that trigger reopens, and the toggle never closes again.\n */\n additionalTriggers?: () => readonly HTMLElement[];\n}\n\n/** The visual gap between anchor and panel. An arrow adds its own length: the tip must clear the edge. */\n/** Read by a surface that wants to fit: `max-height: var(--ap-floating-available-height)`. */\nexport const AVAILABLE_HEIGHT = '--ap-floating-available-height';\n\nconst GAP = 4;\n\nconst VIEWPORT_MARGIN = 8;\n\ninterface Measurable {\n getBoundingClientRect: () => { left: number; top: number; width: number; height: number };\n}\n\nfunction toRect(source: Measurable): FloatingRect {\n const rect = source.getBoundingClientRect();\n return roundRect({ x: rect.left, y: rect.top, width: rect.width, height: rect.height });\n}\n\ninterface AnchorState {\n target: HTMLElement;\n mode: FloatingAnchorMode;\n /** The opening axis. Invariant under the flip, which only swaps the main axis. */\n vertical: boolean;\n /** The click as a proportion of the trigger, so it survives scrolling, resizing and shifting. */\n ratio?: ClickRatio;\n}\n\nexport function createFloatingOverlay() {\n const elementRef = inject(ElementRef);\n const overlay = inject(Overlay);\n const viewContainerRef = inject(ViewContainerRef);\n\n let _overlayRef: OverlayRef | null = null;\n let stopAutoUpdate: (() => void) | null = null;\n let reposition: (() => void) | null = null;\n let anchorState: AnchorState | null = null;\n const isOpen = signal(false);\n\n inject(DestroyRef).onDestroy(() => close());\n\n /**\n * Opens the floating on a `TemplateRef`, attached as is, or on a component whose `ComponentRef`\n * is handed back, typed on the component, so the caller can set its inputs.\n *\n * The position keeps itself current, so inputs set after this returns need no refresh.\n */\n function open<T = unknown>(\n content: TemplateRef<unknown> | Type<T>,\n triggerElement?: HTMLElement,\n config?: FloatingOverlayConfig,\n event?: MouseEvent\n ): ComponentRef<T> | null {\n if (isOpen()) return null;\n\n const target = triggerElement ?? elementRef.nativeElement;\n const mode = config?.anchor ?? 'trigger';\n const placement = config?.placement ?? defaultPlacementFor(mode);\n\n anchorState = captureAnchor(target, mode, placement, event);\n\n disposeOverlay();\n _overlayRef = createOverlay(config);\n const pane = _overlayRef.overlayElement;\n // Floating UI's coordinates are viewport-relative; the CDK's `absolute` would misread them.\n pane.style.position = 'fixed';\n pane.style.left = '0';\n pane.style.top = '0';\n\n const panelRef = attachContent(content);\n isOpen.set(true);\n\n if (config?.arrow === true) {\n // On opening, so the pane carries the single silhouette's shadow before the first frame.\n pane.classList.add(ARROW_CLASS);\n }\n\n watchPosition(pane, placement, config);\n watchDismissal(target, config);\n\n return panelRef;\n }\n\n function captureAnchor(target: HTMLElement, mode: FloatingAnchorMode, placement: FloatingPlacement, event?: MouseEvent): AnchorState {\n return { target, mode, vertical: isVertical(placement), ratio: resolveClickRatio(toRect(target), clickPointOf(event)) };\n }\n\n /**\n * The reference **is** the anchor in all three modes, which is what lets the arrow read\n * `rects.reference` rather than rebuild it. `contextElement` is load-bearing: without it\n * `autoUpdate` cannot find the scrollable ancestors of an anchor that has no DOM node.\n */\n function toReference(state: AnchorState): HTMLElement | VirtualElement {\n if (state.mode === 'trigger' || !state.ratio) {\n return state.target;\n }\n\n return {\n contextElement: state.target,\n getBoundingClientRect: () => {\n const trigger = toRect(state.target);\n const rect = resolveAnchorRect(state.mode, trigger, state.vertical, pointFromRatio(trigger, state.ratio));\n return new DOMRect(rect.x, rect.y, rect.width, rect.height);\n },\n };\n }\n\n function createOverlay(config?: FloatingOverlayConfig): OverlayRef {\n return overlay.create({\n hasBackdrop: config?.showBackdrop ?? false,\n backdropClass: '',\n panelClass: config?.panelClass ?? '',\n // No scroll strategy: `autoUpdate` owns the update cycle, and the CDK's default is a no-op.\n usePopover: false,\n });\n }\n\n function attachContent<T>(content: TemplateRef<unknown> | Type<T>): ComponentRef<T> | null {\n if (!_overlayRef) return null;\n if (content instanceof TemplateRef) {\n _overlayRef.attach(new TemplatePortal(content, viewContainerRef));\n return null;\n }\n return _overlayRef.attach(new ComponentPortal(content, viewContainerRef));\n }\n\n /**\n * `autoUpdate` is the whole update cycle: scrollable ancestors of both boxes, the viewport,\n * both boxes' own resizing, and layout shifts. Nothing else here watches anything.\n */\n function watchPosition(pane: HTMLElement, placement: FloatingPlacement, config?: FloatingOverlayConfig): void {\n const state = anchorState;\n if (!state) return;\n const reference = toReference(state);\n\n const middleware = [\n offset(config?.arrow === true ? GAP + ARROW_HEIGHT : GAP),\n flip({ crossAxis: false, flipAlignment: false, padding: VIEWPORT_MARGIN }),\n shift({ padding: VIEWPORT_MARGIN }),\n // After flip and shift, so what it publishes is the room left on the side they settled on.\n size({\n padding: VIEWPORT_MARGIN,\n apply: ({ availableHeight }) => pane.style.setProperty(AVAILABLE_HEIGHT, `${Math.round(availableHeight)}px`),\n }),\n ];\n if (config?.arrow === true) {\n middleware.push(apArrow({ targetMode: config.arrowTarget ?? 'anchor', anchorMode: state.mode, clickRatio: state.ratio }));\n }\n\n let invariantsWritten = false;\n\n reposition = () => {\n // A detached trigger measures as a zero rect at the viewport origin: keep the last position instead.\n if (!state.target.isConnected) return;\n void computePosition(reference, pane, { strategy: 'fixed', placement, middleware }).then(position => {\n // Whole pixels: a fractional translate blurs text on a non-retina screen.\n pane.style.transform = `translate(${Math.round(position.x)}px, ${Math.round(position.y)}px)`;\n const arrow: ApArrowData | undefined = position.middlewareData[AP_ARROW];\n if (arrow) {\n invariantsWritten = invariantsWritten || writeArrowInvariants(pane);\n writeArrowStyles(pane, arrow);\n }\n });\n };\n\n stopAutoUpdate = autoUpdate(reference, pane, reposition);\n }\n\n function watchDismissal(target: HTMLElement, config?: FloatingOverlayConfig): void {\n if (!_overlayRef) return;\n\n const closeHandler = config?.onClose ?? (() => close());\n const outsideHandler = config?.onOutsideClick ?? closeHandler;\n const escapeHandler = config?.onEscape ?? closeHandler;\n\n const ownsGesture = (node: Node): boolean =>\n target.contains(node) || (config?.additionalTriggers?.() ?? []).some(element => element.contains(node));\n\n // No `take(1)`: a handler may decline to close, and it must still hear the next gesture. Dispose ends both.\n _overlayRef\n .outsidePointerEvents()\n .pipe(filter(pointerEvent => !(pointerEvent.target instanceof Node && ownsGesture(pointerEvent.target))))\n .subscribe(() => outsideHandler());\n\n _overlayRef\n .keydownEvents()\n .pipe(filter(keyEvent => keyEvent.key === 'Escape'))\n .subscribe(() => escapeHandler());\n }\n\n /** The observers never outlive their overlay: they would reposition it after its destruction. */\n function disposeOverlay(): void {\n stopAutoUpdate?.();\n stopAutoUpdate = null;\n reposition = null;\n _overlayRef?.dispose();\n _overlayRef = null;\n }\n\n function close(): void {\n if (!isOpen()) return;\n\n anchorState = null;\n disposeOverlay();\n isOpen.set(false);\n }\n\n /** Recomputes now. For a caller that knows the geometry changed before any observer can see it. */\n function updatePosition(): void {\n reposition?.();\n }\n\n return {\n get overlayRef() {\n return _overlayRef;\n },\n isOpen: isOpen.asReadonly(),\n open,\n close,\n updatePosition,\n };\n}\n\nexport type FloatingOverlayInstance = ReturnType<typeof createFloatingOverlay>;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAMA;;;;AAIG;AACG,SAAU,mBAAmB,CAAC,MAA0B,EAAA;IAC1D,OAAO,MAAM,KAAK,SAAS,GAAG,cAAc,GAAG,QAAQ;AAC3D;AAEA;;;;;;AAMG;AACG,SAAU,iBAAiB,CAC7B,MAA0B,EAC1B,WAAyB,EACzB,QAAiB,EACjB,UAAqC,EAAA;AAErC,IAAA,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,UAAU,EAAE;AACrC,QAAA,OAAO,WAAW;IACtB;AAEA,IAAA,IAAI,MAAM,KAAK,cAAc,EAAE;QAC3B,OAAO,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;IACpE;AAEA,IAAA,OAAO;UACD,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,MAA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B,WAAW,GAAG,IAAI;IACtB;AAEA,IAAA,SAAS,KAAK,GAAA;QACV,IAAI,CAAC,MAAM,EAAE;YAAE;QAEf,WAAW,GAAG,IAAI;AAClB,QAAA,cAAc,EAAE;AAChB,QAAA,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;IACrB;;AAGA,IAAA,SAAS,cAAc,GAAA;QACnB,UAAU,IAAI;IAClB;IAEA,OAAO;AACH,QAAA,IAAI,UAAU,GAAA;AACV,YAAA,OAAO,WAAW;QACtB,CAAC;AACD,QAAA,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE;QAC3B,IAAI;QACJ,KAAK;QACL,cAAc;KACjB;AACL;;ACvQA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agorapulse/ui-components",
3
3
  "description": "Agorapulse UI Components Library",
4
- "version": "22.2.10",
4
+ "version": "22.2.11",
5
5
  "author": "Benoit Hediard",
6
6
  "repository": {
7
7
  "type": "git",