{"version":3,"file":"text.cjs","sources":["../../../src/components/pixi/text.ts"],"sourcesContent":["import {\n    BitmapText as PixiBitmapText,\n    HTMLText as PixiHTMLText,\n    type HTMLTextOptions,\n    Text as PixiText,\n    type TextOptions,\n} from 'pixi.js';\nimport { BaseView, type ViewOptions } from './base';\n\n/**\n * A wrapper around the PixiJS Text class that supports additional layout properties.\n * e.g backgroundColor, borderColor, and overflow properties.\n */\nexport class LayoutText extends BaseView<PixiText> {\n    constructor(opts: TextOptions & ViewOptions) {\n        super({\n            ...opts,\n            ClassType: PixiText,\n        });\n    }\n}\n\n/**\n * A re-export of the PixiJS Text class that ensures the layout is set after construction.\n *\n * The Text object is a specialized sprite for rendering text.\n */\nexport class Text extends PixiText {\n    constructor(opts: TextOptions) {\n        const { layout, ...options } = opts;\n\n        super(options as TextOptions);\n        this.layout = layout!;\n    }\n}\n\n/**\n * A wrapper around the PixiJS BitmapText class that supports additional layout properties.\n * e.g backgroundColor, borderColor, and overflow properties.\n */\nexport class LayoutBitmapText extends BaseView<PixiBitmapText> {\n    constructor(opts: TextOptions & ViewOptions) {\n        super({\n            ...opts,\n            ClassType: PixiBitmapText,\n        });\n    }\n}\n\n/**\n * A re-export of the PixiJS BitmapText class that ensures the layout is set after construction.\n *\n * The BitmapText object is a specialized sprite for rendering bitmap text.\n */\nexport class BitmapText extends PixiBitmapText {\n    constructor(opts: TextOptions) {\n        const { layout, ...options } = opts;\n\n        super(options as TextOptions);\n        this.layout = layout!;\n    }\n}\n\n/**\n * A wrapper around the PixiJS HTMLText class that supports additional layout properties.\n * e.g backgroundColor, borderColor, and overflow properties.\n */\nexport class LayoutHTMLText extends BaseView<PixiHTMLText> {\n    constructor(opts: HTMLTextOptions & ViewOptions) {\n        super({\n            ...opts,\n            ClassType: PixiHTMLText,\n        });\n    }\n}\n\n/**\n * A re-export of the PixiJS HTMLText class that ensures the layout is set after construction.\n *\n * The HTMLText object is a specialized sprite for rendering HTML text.\n */\nexport class HTMLText extends PixiHTMLText {\n    constructor(opts: HTMLTextOptions) {\n        const { layout, ...options } = opts ?? {};\n\n        super(options as HTMLTextOptions);\n        this.layout = layout!;\n    }\n}\n"],"names":["BaseView","PixiText","PixiBitmapText","PixiHTMLText"],"mappings":";;;;AAaO,MAAM,mBAAmBA,KAAAA,SAAmB;AAAA,EAC/C,YAAY,MAAiC;AACnC,UAAA;AAAA,MACF,GAAG;AAAA,MACH,WAAWC,QAAAA;AAAAA,IAAA,CACd;AAAA,EAAA;AAET;AAOO,MAAM,aAAaA,QAAAA,KAAS;AAAA,EAC/B,YAAY,MAAmB;AAC3B,UAAM,EAAE,QAAQ,GAAG,QAAA,IAAY;AAE/B,UAAM,OAAsB;AAC5B,SAAK,SAAS;AAAA,EAAA;AAEtB;AAMO,MAAM,yBAAyBD,KAAAA,SAAyB;AAAA,EAC3D,YAAY,MAAiC;AACnC,UAAA;AAAA,MACF,GAAG;AAAA,MACH,WAAWE,QAAAA;AAAAA,IAAA,CACd;AAAA,EAAA;AAET;AAOO,MAAM,mBAAmBA,QAAAA,WAAe;AAAA,EAC3C,YAAY,MAAmB;AAC3B,UAAM,EAAE,QAAQ,GAAG,QAAA,IAAY;AAE/B,UAAM,OAAsB;AAC5B,SAAK,SAAS;AAAA,EAAA;AAEtB;AAMO,MAAM,uBAAuBF,KAAAA,SAAuB;AAAA,EACvD,YAAY,MAAqC;AACvC,UAAA;AAAA,MACF,GAAG;AAAA,MACH,WAAWG,QAAAA;AAAAA,IAAA,CACd;AAAA,EAAA;AAET;AAOO,MAAM,iBAAiBA,QAAAA,SAAa;AAAA,EACvC,YAAY,MAAuB;AAC/B,UAAM,EAAE,QAAQ,GAAG,QAAQ,IAAI,QAAQ,CAAC;AAExC,UAAM,OAA0B;AAChC,SAAK,SAAS;AAAA,EAAA;AAEtB;;;;;;;"}