{"version":3,"file":"LayoutContainer.mjs","sources":["../../src/components/LayoutContainer.ts"],"sourcesContent":["import {\n    Container,\n    type ContainerChild,\n    type ContainerOptions,\n    type DestroyOptions,\n    Graphics,\n    Rectangle,\n    Ticker,\n} from 'pixi.js';\nimport { BoxSizing, Edge } from 'yoga-layout/load';\nimport { type ComputedLayout } from '../core/types';\nimport { Trackpad, type TrackpadOptions } from './trackpad/Trackpad';\n\nconst CONTAINER_METHOD_NAMES = [\n    'addChild',\n    'addChildAt',\n    'removeChild',\n    'removeChildAt',\n    'getChildAt',\n    'getChildIndex',\n    'setChildIndex',\n    'getChildByName',\n    'removeChildren',\n    'sortChildren',\n    'swapChildren',\n    'reparentChild',\n    'reparentChildAt',\n    'getChildByLabel',\n    'getChildrenByLabel',\n] as const;\n\nfunction bindAndPreserve<T extends object, K extends keyof T>(\n    base: T,\n    source: Container,\n    methodNames: readonly K[],\n): Pick<T, K> {\n    const bound = {} as Pick<T, K>;\n    const proto = Object.getPrototypeOf(base);\n\n    for (const name of methodNames) {\n        const method = proto[name];\n\n        bound[name] = method.bind(base);\n        (base as any)[name] = (...args: any[]) => (source as any)[name](...args);\n    }\n\n    return bound;\n}\n\n/**\n * Options for configuring the layout container.\n * @property {TrackpadOptions} [trackpad] - Options to configure the trackpad for scrolling\n */\nexport interface LayoutContainerOptions extends ContainerOptions {\n    /** Options to configure the trackpad for scrolling */\n    trackpad?: TrackpadOptions;\n    /** A container to be used for the background */\n    background?: ContainerChild;\n}\n\n/**\n * A specialized container that serves as an overflow container for scrolling content.\n */\nexport interface OverflowContainer extends Container {\n    isOverflowContainer: boolean;\n}\n\n/**\n * A container that behaves like an HTML div element with flexbox-style layout capabilities.\n *\n * Supports objectFit, objectPosition, backgroundColor, borderColor, and overflow\n *\n * @example\n * ```typescript\n * // Create a container with background and border\n * const container = new LayoutContainer();\n * container.layout = {\n *     width: 300,\n *     height: 200,\n *     backgroundColor: 0xFF0000,\n *     borderWidth: 2,\n *     borderColor: 0x000000,\n *     borderRadius: 8,\n *     padding: 16,\n *     flexDirection: 'row',\n *     justifyContent: 'center',\n *     alignItems: 'center',\n * };\n *\n * // Create child elements\n * const child1 = new Container();\n * child1.layout = { flex: 1 };\n * const child2 = new Container();\n * child2.layout = { flex: 2 };\n *\n * // Add children which will be positioned using flex layout\n * container.addChild(child1, child2);\n * ```\n */\nexport class LayoutContainer extends Container {\n    /** Graphics object used for rendering background and borders */\n    public background: Container | Graphics;\n    public stroke: Graphics = new Graphics({ label: 'stroke' });\n\n    /** The container that holds the overflow content */\n    public overflowContainer: OverflowContainer = new Container({\n        label: 'overflowContainer',\n    }) as OverflowContainer;\n\n    /** Access to original Container methods */\n    public readonly containerMethods: Readonly<{\n        addChild: <T extends ContainerChild>(...children: T[]) => T;\n        addChildAt: <T extends ContainerChild>(child: T, index: number) => T;\n        removeChild: <T extends ContainerChild>(...children: T[]) => T;\n        removeChildAt: (index: number) => ContainerChild;\n        getChildAt: (index: number) => ContainerChild;\n        getChildIndex: (child: ContainerChild) => number;\n        setChildIndex: (child: ContainerChild, index: number) => void;\n        getChildByName: (name: string, deep?: boolean) => ContainerChild | null;\n        removeChildren: (beginIndex?: number, endIndex?: number) => ContainerChild[];\n        sortChildren: () => void;\n        swapChildren: (child1: ContainerChild, child2: ContainerChild) => void;\n        reparentChild: <T extends ContainerChild[]>(...children: T) => T[0];\n        reparentChildAt: <T extends ContainerChild>(child: T, index: number) => T;\n        getChildByLabel: (label: string, deep?: boolean) => ContainerChild | null;\n        getChildrenByLabel: (label: string, deep?: boolean, out?: ContainerChild[]) => ContainerChild[];\n    }>;\n\n    /** The trackpad for handling scrolling */\n    protected _trackpad: Trackpad;\n\n    /** Mask for overflow handling */\n    private _mask: Graphics = new Graphics();\n\n    /** Whether or not the background was created by the user */\n    private _isUserBackground: boolean = false;\n\n    /** The maximum visual bounds of the layout */\n    private _visualBounds = new Rectangle();\n    /** The scroll bounds for the container where scroll events can occur */\n    private _scrollBounds = new Rectangle();\n\n    constructor(params: LayoutContainerOptions = {}) {\n        const { layout, trackpad, background, children, ...options } = params;\n\n        super(options);\n        this.layout = layout ?? {};\n        children?.forEach((child) => this.addChild(child));\n\n        this.overflowContainer.isOverflowContainer = true;\n        this.background = background ?? new Graphics({ label: 'background' });\n        this._isUserBackground = !!background;\n\n        this.addChild(this.background, this.overflowContainer, this._mask, this.stroke);\n        // Preserve original Container methods and bind them to use the overflowContainer\n        this.containerMethods = bindAndPreserve(\n            this,\n            this.overflowContainer,\n            CONTAINER_METHOD_NAMES,\n        ) as typeof this.containerMethods;\n\n        this._trackpad = new Trackpad({\n            constrain: true,\n            ...trackpad,\n        });\n        this.eventMode = 'static';\n        this.on(\n            'pointerdown',\n            (e) => this.isPointWithinBounds(e.global.x, e.global.y) && this._trackpad.pointerDown(e.global),\n        );\n        this.on('pointerup', () => this._trackpad.pointerUp());\n        this.on('pointerupoutside', () => this._trackpad.pointerUp());\n        this.on(\n            'pointermove',\n            (e) => this.isPointWithinBounds(e.global.x, e.global.y) && this._trackpad.pointerMove(e.global),\n        );\n        this.on('pointercancel', () => this._trackpad.pointerUp());\n        this.on('wheel', (e) => {\n            const overflow = this.layout?.style.overflow;\n\n            if (overflow !== 'scroll') {\n                return;\n            }\n            // check that the pointer position is within the visual bounds\n            if (!this.isPointWithinBounds(e.global.x, e.global.y)) {\n                return;\n            }\n            const shift = e.shiftKey ? 1 : 0;\n            const deltaX = e.deltaX * (shift ? 1 : -1);\n            const deltaY = e.deltaY * (shift ? -1 : 1);\n\n            const targetX = this._trackpad.xAxis.value - deltaX;\n            const targetY = this._trackpad.yAxis.value - deltaY;\n\n            if (this._trackpad.xAxis.constrainPercent >= 0) {\n                this._trackpad.xAxis.value = Math.max(\n                    this._trackpad.xAxis.max,\n                    Math.min(this._trackpad.xAxis.min, targetX),\n                );\n            }\n\n            if (this._trackpad.yAxis.constrainPercent >= 0) {\n                this._trackpad.yAxis.value = Math.max(\n                    this._trackpad.yAxis.max,\n                    Math.min(this._trackpad.yAxis.min, targetY),\n                );\n            }\n        });\n        Ticker.shared.add(this.update, this);\n    }\n\n    /**\n     * Computes the layout data for this container based on yoga calculations and draws the background.\n     * @param computedLayout - The computed layout data from yoga\n     * @returns Position and scale information for the container\n     * @internal\n     */\n    override computeLayoutData(computedLayout: ComputedLayout) {\n        this._drawBackground(computedLayout);\n\n        return {\n            x: computedLayout.left,\n            y: computedLayout.top,\n            offsetX: 0,\n            offsetY: 0,\n            scaleX: 1,\n            scaleY: 1,\n        };\n    }\n\n    /**\n     * Updates the container mask based on overflow settings\n     * @param width - Container width\n     * @param height - Container height\n     * @param radius - Border radius\n     */\n    protected _updateMask(\n        width: number,\n        height: number,\n        radius: number = 0,\n        borderWidth: number = 0,\n        isContentBox: boolean = false,\n    ) {\n        // Account for border width if box-sizing is content-box. In content-box mode the computed\n        // layout width/height excludes the border, so the visible (masked) area should include it.\n        const maskX = isContentBox ? -borderWidth : 0;\n        const maskY = isContentBox ? -borderWidth : 0;\n        const maskWidth = isContentBox ? width + borderWidth * 2 : width;\n        const maskHeight = isContentBox ? height + borderWidth * 2 : height;\n\n        // Draw a single rounded rect used as the clip mask.\n        this._mask.clear();\n        this._mask.roundRect(0, 0, maskWidth, maskHeight, radius);\n        this._mask.position.set(maskX, maskY);\n        this._mask.fill(0xffffff);\n        this._scrollBounds.set(\n            maskX + borderWidth,\n            maskY + borderWidth,\n            maskWidth - borderWidth * 2,\n            maskHeight - borderWidth * 2,\n        );\n    }\n\n    protected _updateBackground(computedLayout: ComputedLayout) {\n        const layoutStyles = this.layout!.style;\n        const { backgroundColor, borderRadius } = layoutStyles;\n\n        if (this._isUserBackground) {\n            this.background.position.set(0, 0);\n            this.background.setSize(computedLayout.width, computedLayout.height);\n        } else {\n            const background = this.background as Graphics;\n\n            background.clear();\n            background.roundRect(0, 0, computedLayout.width, computedLayout.height, borderRadius ?? 0);\n            // eslint-disable-next-line no-eq-null, eqeqeq\n            if (backgroundColor != null) {\n                background.fill({ color: backgroundColor });\n            } else {\n                background.fill({ color: 0xffffff, alpha: 0 });\n            }\n        }\n    }\n\n    /**\n     * Draws the container's background including:\n     * - Background color\n     * - Border\n     * - Border radius\n     *\n     * @param computedLayout - The computed layout data from yoga\n     * @protected\n     */\n    protected _drawBackground(computedLayout: ComputedLayout) {\n        let borderWidth = this.layout!.yoga.getBorder(Edge.All);\n\n        if (isNaN(borderWidth) || borderWidth < 0) {\n            borderWidth = 0;\n        }\n        const boxSizing = this.layout!.yoga.getBoxSizing();\n        const alignment = boxSizing === BoxSizing.BorderBox ? 1 : 0;\n\n        const layoutStyles = this.layout!.style;\n        const { borderColor, borderRadius } = layoutStyles;\n\n        this._updateBackground(computedLayout);\n        this.stroke.clear();\n\n        // eslint-disable-next-line no-eq-null, eqeqeq\n        if (borderWidth > 0 && borderColor != null) {\n            this.stroke.roundRect(0, 0, computedLayout.width, computedLayout.height, borderRadius ?? 0);\n            this.stroke.stroke({ color: borderColor, width: borderWidth, alignment });\n        }\n\n        // Handle overflow\n        const overflow = this.layout?.style.overflow;\n\n        if (overflow !== 'visible') {\n            this._updateMask(\n                computedLayout.width,\n                computedLayout.height,\n                layoutStyles.borderRadius ?? 0,\n                borderWidth,\n                boxSizing === BoxSizing.ContentBox,\n            );\n            this._updateScrollArea();\n            this.setMask({ mask: this._mask });\n\n            const maskWidth = computedLayout.width - this._visualBounds.width;\n            const maskHeight = computedLayout.height - this._visualBounds.height;\n\n            this._trackpad.xAxis.max = Math.min(0, maskWidth);\n            this._trackpad.yAxis.max = Math.min(0, maskHeight);\n        } else {\n            this.mask = null;\n            this._trackpad.xAxis.value = 0;\n            this._trackpad.yAxis.value = 0;\n            this.overflowContainer.position.set(0, 0);\n        }\n    }\n\n    protected _updateScrollArea() {\n        let maxBottom = 0;\n        let maxRight = 0;\n\n        for (let i = 0; i < this.layout!.yoga.getChildCount(); i++) {\n            const child = this.layout!.yoga.getChild(i);\n            const bottom = child.getComputedTop() + child.getComputedHeight();\n            const right = child.getComputedLeft() + child.getComputedWidth();\n\n            if (right > maxRight) maxRight = right;\n            if (bottom > maxBottom) maxBottom = bottom;\n        }\n\n        maxRight += this.layout!.yoga.getComputedPadding(Edge.Right);\n        maxBottom += this.layout!.yoga.getComputedPadding(Edge.Bottom);\n\n        const borderWidth = this.layout!.yoga.getBorder(Edge.All) || 0;\n\n        maxRight += borderWidth;\n        maxBottom += borderWidth;\n\n        this._visualBounds.width = Math.max(0, maxRight);\n        this._visualBounds.height = Math.max(0, maxBottom);\n    }\n\n    /**\n     * Checks if a point is within the visual bounds of the container, accounting for world transformations.\n     * @param x - The x-coordinate of the point to check\n     * @param y - The y-coordinate of the point to check\n     * @returns True if the point is within the visual bounds, false otherwise\n     */\n    protected isPointWithinBounds(x: number, y: number): boolean {\n        return this._scrollBounds.contains(x - this.worldTransform.tx, y - this.worldTransform.ty);\n    }\n\n    protected update(): void {\n        const overflow = this.layout?.style.overflow;\n\n        if (overflow !== 'scroll') {\n            return;\n        }\n        this._trackpad.update();\n        this.overflowContainer.x = this._trackpad.x;\n        this.overflowContainer.y = this._trackpad.y;\n    }\n\n    public override destroy(options?: DestroyOptions): void {\n        // Restore original Container methods so Container.destroy() operates on this container's\n        // own children (background, overflowContainer, mask, stroke) instead of the\n        // overflowContainer's children.\n        for (const name of CONTAINER_METHOD_NAMES) {\n            (this as any)[name] = this.containerMethods[name];\n        }\n\n        this.overflowContainer.destroy(options);\n\n        Ticker.shared.remove(this.update, this);\n        super.destroy(options);\n    }\n}\n"],"names":["Graphics"],"mappings":";;;;;;AAaA,MAAM,yBAAyB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;AAEA,SAAS,gBACL,MACA,QACA,aACU;AACV,QAAM,QAAQ,CAAC;AACT,QAAA,QAAQ,OAAO,eAAe,IAAI;AAExC,aAAW,QAAQ,aAAa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