pixi-solid 0.1.16 → 0.1.18
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/dist/components/bind-props/event-names.js +5 -3
- package/dist/components/bind-props/event-names.js.map +1 -1
- package/dist/components/bind-props/is-event-property.js +2 -2
- package/dist/components/bind-props/is-event-property.js.map +1 -1
- package/dist/components/component-factories.js.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/on-resize.js +12 -9
- package/dist/on-resize.js.map +1 -1
- package/dist/pixi-application/pixi-application-provider.js.map +1 -1
- package/dist/types/components/bind-props/event-names.d.ts +3 -3
- package/dist/types/components/bind-props/index.d.ts +1 -1
- package/dist/types/components/bind-props/is-event-property.d.ts +2 -2
- package/dist/types/components/component-factories.d.ts +5 -5
- package/dist/types/components/components.d.ts +13 -13
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/index.d.ts +1 -2
- package/package.json +1 -1
|
@@ -66,10 +66,12 @@ const PIXI_EVENT_NAMES = [
|
|
|
66
66
|
const PIXI_SOLID_EVENT_HANDLER_NAMES = PIXI_EVENT_NAMES.map(
|
|
67
67
|
(eventName) => `on${eventName}`
|
|
68
68
|
);
|
|
69
|
-
const
|
|
69
|
+
const PIXI_SOLID_EVENT_HANDLER_NAME_SET = new Set(
|
|
70
|
+
PIXI_SOLID_EVENT_HANDLER_NAMES
|
|
71
|
+
);
|
|
70
72
|
export {
|
|
71
|
-
PIXI_EVENT_HANDLER_NAME_SET,
|
|
72
73
|
PIXI_EVENT_NAMES,
|
|
73
|
-
PIXI_SOLID_EVENT_HANDLER_NAMES
|
|
74
|
+
PIXI_SOLID_EVENT_HANDLER_NAMES,
|
|
75
|
+
PIXI_SOLID_EVENT_HANDLER_NAME_SET
|
|
74
76
|
};
|
|
75
77
|
//# sourceMappingURL=event-names.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-names.js","sources":["../../../src/components/bind-props/event-names.ts"],"sourcesContent":["import type { FederatedEventEmitterTypes } from \"pixi.js\";\n\nexport const PIXI_EVENT_NAMES: (keyof FederatedEventEmitterTypes)[] = [\n \"click\",\n \"mousedown\",\n \"mouseenter\",\n \"mouseleave\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"mouseupoutside\",\n \"pointercancel\",\n \"pointerdown\",\n \"pointerenter\",\n \"pointerleave\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointertap\",\n \"pointerup\",\n \"pointerupoutside\",\n \"rightclick\",\n \"rightdown\",\n \"rightup\",\n \"rightupoutside\",\n \"tap\",\n \"touchcancel\",\n \"touchend\",\n \"touchendoutside\",\n \"touchmove\",\n \"touchstart\",\n \"wheel\",\n \"globalmousemove\",\n \"globalpointermove\",\n \"globaltouchmove\",\n \"clickcapture\",\n \"mousedowncapture\",\n \"mouseentercapture\",\n \"mouseleavecapture\",\n \"mousemovecapture\",\n \"mouseoutcapture\",\n \"mouseovercapture\",\n \"mouseupcapture\",\n \"mouseupoutsidecapture\",\n \"pointercancelcapture\",\n \"pointerdowncapture\",\n \"pointerentercapture\",\n \"pointerleavecapture\",\n \"pointermovecapture\",\n \"pointeroutcapture\",\n \"pointerovercapture\",\n \"pointertapcapture\",\n \"pointerupcapture\",\n \"pointerupoutsidecapture\",\n \"rightclickcapture\",\n \"rightdowncapture\",\n \"rightupcapture\",\n \"rightupoutsidecapture\",\n \"tapcapture\",\n \"touchcancelcapture\",\n \"touchendcapture\",\n \"touchendoutsidecapture\",\n \"touchmovecapture\",\n \"touchstartcapture\",\n \"wheelcapture\",\n] as const;\n\nexport const PIXI_SOLID_EVENT_HANDLER_NAMES = PIXI_EVENT_NAMES.map(\n (eventName) => `on${eventName}` as const,\n);\n\nexport type
|
|
1
|
+
{"version":3,"file":"event-names.js","sources":["../../../src/components/bind-props/event-names.ts"],"sourcesContent":["import type { FederatedEventEmitterTypes } from \"pixi.js\";\n\nexport const PIXI_EVENT_NAMES: (keyof FederatedEventEmitterTypes)[] = [\n \"click\",\n \"mousedown\",\n \"mouseenter\",\n \"mouseleave\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"mouseupoutside\",\n \"pointercancel\",\n \"pointerdown\",\n \"pointerenter\",\n \"pointerleave\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointertap\",\n \"pointerup\",\n \"pointerupoutside\",\n \"rightclick\",\n \"rightdown\",\n \"rightup\",\n \"rightupoutside\",\n \"tap\",\n \"touchcancel\",\n \"touchend\",\n \"touchendoutside\",\n \"touchmove\",\n \"touchstart\",\n \"wheel\",\n \"globalmousemove\",\n \"globalpointermove\",\n \"globaltouchmove\",\n \"clickcapture\",\n \"mousedowncapture\",\n \"mouseentercapture\",\n \"mouseleavecapture\",\n \"mousemovecapture\",\n \"mouseoutcapture\",\n \"mouseovercapture\",\n \"mouseupcapture\",\n \"mouseupoutsidecapture\",\n \"pointercancelcapture\",\n \"pointerdowncapture\",\n \"pointerentercapture\",\n \"pointerleavecapture\",\n \"pointermovecapture\",\n \"pointeroutcapture\",\n \"pointerovercapture\",\n \"pointertapcapture\",\n \"pointerupcapture\",\n \"pointerupoutsidecapture\",\n \"rightclickcapture\",\n \"rightdowncapture\",\n \"rightupcapture\",\n \"rightupoutsidecapture\",\n \"tapcapture\",\n \"touchcancelcapture\",\n \"touchendcapture\",\n \"touchendoutsidecapture\",\n \"touchmovecapture\",\n \"touchstartcapture\",\n \"wheelcapture\",\n] as const;\n\nexport const PIXI_SOLID_EVENT_HANDLER_NAMES = PIXI_EVENT_NAMES.map(\n (eventName) => `on${eventName}` as const,\n);\n\nexport type PixiSolidEventHandlerName = (typeof PIXI_SOLID_EVENT_HANDLER_NAMES)[number];\n\nexport type PixiSolidEventHandlerMap = {\n [K in (typeof PIXI_EVENT_NAMES)[number] as `on${K}`]?:\n | null\n | ((...args: FederatedEventEmitterTypes[K]) => void);\n};\n\nexport const PIXI_SOLID_EVENT_HANDLER_NAME_SET: Set<string> = new Set(\n PIXI_SOLID_EVENT_HANDLER_NAMES,\n);\n\n/**\n * This is a type-safe check that ensures `PIXI_EVENT_NAMES` includes every key from Pixi's `AllFederatedEventMap` type.\n * It will cause a build error if any event names are missing.\n */\ntype MissingKeys = Exclude<keyof FederatedEventEmitterTypes, (typeof PIXI_EVENT_NAMES)[number]>;\ntype AllEventsAreHandled = MissingKeys extends never\n ? true\n : `Error: Missing event keys: ${MissingKeys}`;\nconst allEventsAreHandled: AllEventsAreHandled = true;\nvoid allEventsAreHandled;\n"],"names":[],"mappings":"AAEO,MAAM,mBAAyD;AAAA,EACpE;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;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;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;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;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,iCAAiC,iBAAiB;AAAA,EAC7D,CAAC,cAAc,KAAK,SAAS;AAC/B;AAUO,MAAM,oCAAiD,IAAI;AAAA,EAChE;AACF;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const isEventProperty = (name) =>
|
|
1
|
+
import { PIXI_SOLID_EVENT_HANDLER_NAME_SET } from "./event-names.js";
|
|
2
|
+
const isEventProperty = (name) => PIXI_SOLID_EVENT_HANDLER_NAME_SET.has(name);
|
|
3
3
|
export {
|
|
4
4
|
isEventProperty
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-event-property.js","sources":["../../../src/components/bind-props/is-event-property.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"is-event-property.js","sources":["../../../src/components/bind-props/is-event-property.ts"],"sourcesContent":["import type { PixiSolidEventHandlerName } from \"./event-names\";\nimport { PIXI_SOLID_EVENT_HANDLER_NAME_SET } from \"./event-names\";\n\nexport const isEventProperty = (name: string): name is PixiSolidEventHandlerName =>\n PIXI_SOLID_EVENT_HANDLER_NAME_SET.has(name);\n"],"names":[],"mappings":";AAGO,MAAM,kBAAkB,CAAC,SAC9B,kCAAkC,IAAI,IAAI;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-factories.js","sources":["../../src/components/component-factories.ts"],"sourcesContent":["import type * as Pixi from \"pixi.js\";\nimport type { JSX, Ref } from \"solid-js\";\nimport { createRenderEffect, on, splitProps, onCleanup } from \"solid-js\";\n\nimport { getTicker } from \"../pixi-application\";\n\nimport { bindInitialisationProps, bindRuntimeProps } from \"./bind-props\";\nimport type { PixiEventHandlerMap } from \"./bind-props/event-names\";\nimport { PIXI_SOLID_EVENT_HANDLER_NAMES } from \"./bind-props/event-names\";\nimport type {\n CommonPointAxisPropName,\n AnchorPointAxisPropName,\n TilingPointAxisPropName,\n} from \"./bind-props/point-property-names\";\nimport {\n COMMON_POINT_PROP_AXIS_NAMES,\n ANCHOR_POINT_PROP_AXIS_NAMES,\n TILING_POINT_PROP_AXIS_NAMES,\n} from \"./bind-props/point-property-names\";\n\n/**\n * Common point axis properties available on all Container-based components\n */\nexport type CommonPointAxisProps = Partial<Record<CommonPointAxisPropName, number>>;\n\n/**\n * Anchor point axis properties available on Sprite-like components\n */\nexport type AnchorPointAxisProps = Partial<Record<AnchorPointAxisPropName, number>>;\n\n/**\n * Tiling point axis properties available on TilingSprite\n */\nexport type TilingPointAxisProps = Partial<Record<TilingPointAxisPropName, number>>;\n\n/**\n * This is a utility type useful for extending the props of custom components to allow props to be passed through to the underlying Pixi instance.\n *\n * If you don't require them all it's recommended to narrow the type by using Pick or Omit the props to only allow the ones you need.\n *\n * @example PixiComponentProps<Pixi.SpriteOptions>.\n */\nexport type PixiComponentProps<\n ComponentOptions extends Pixi.ContainerOptions = Pixi.ContainerOptions,\n> = PixiEventHandlerMap & CommonPointAxisProps & Omit<ComponentOptions, \"children\">;\n\n/**\n * Prop definition for basic Container components (position, scale, pivot, skew only)\n */\nexport type ContainerProps<Component> = PixiEventHandlerMap &\n CommonPointAxisProps &\n Record<string, unknown> & {\n ref?: Ref<Component>;\n as?: Component;\n children?: JSX.Element;\n };\n\n/**\n * Prop definition for components that cannot have children\n */\nexport type LeafProps<Component> = Omit<ContainerProps<Component>, \"children\">;\n\n/**\n * Prop definition for Sprite-like components (includes anchor properties)\n */\nexport type SpriteProps<Component> = PixiEventHandlerMap &\n CommonPointAxisProps &\n AnchorPointAxisProps & {\n ref?: Ref<Component>;\n as?: Component;\n };\n\nexport type AnimatedSpriteProps<Component> = SpriteProps<Component> &\n Pick<Pixi.AnimatedSpriteOptions, \"autoUpdate\">;\n\ntype AnimatedSpriteLike = Pixi.Container & {\n autoUpdate: boolean;\n update: (ticker: Pixi.Ticker) => void;\n};\n\n/**\n * Prop definition for TilingSprite (includes anchor and tiling properties)\n */\nexport type TilingSpriteProps<Component> = PixiEventHandlerMap &\n CommonPointAxisProps &\n AnchorPointAxisProps &\n TilingPointAxisProps & {\n ref?: Ref<Component>;\n as?: Component;\n };\n\n/**\n * Prop definition for filter components\n */\nexport type FilterProps<Component> = {\n ref?: Ref<Component>;\n as?: Component;\n};\n\n// Keys that are specific to Solid components and not Pixi props\nexport const SOLID_PROP_KEYS = [\"ref\", \"as\", \"children\"] as const;\n\n// Combined keys for splitting props\nconst CONTAINER_RUNTIME_KEYS = [\n ...SOLID_PROP_KEYS,\n ...PIXI_SOLID_EVENT_HANDLER_NAMES,\n ...COMMON_POINT_PROP_AXIS_NAMES,\n] as const;\n\n// Sprite components don't accept \"children\" since they can't have children\nconst SPRITE_RUNTIME_KEYS = [\n \"ref\",\n \"as\",\n ...PIXI_SOLID_EVENT_HANDLER_NAMES,\n ...COMMON_POINT_PROP_AXIS_NAMES,\n ...ANCHOR_POINT_PROP_AXIS_NAMES,\n] as const;\n\nconst TILING_SPRITE_RUNTIME_KEYS = [\n \"ref\",\n \"as\",\n ...PIXI_SOLID_EVENT_HANDLER_NAMES,\n ...COMMON_POINT_PROP_AXIS_NAMES,\n ...ANCHOR_POINT_PROP_AXIS_NAMES,\n ...TILING_POINT_PROP_AXIS_NAMES,\n] as const;\n\nexport const createContainerComponent = <\n InstanceType extends Pixi.Container,\n OptionsType extends object,\n>(\n PixiClass: new (props: OptionsType) => InstanceType,\n): ((\n props: Omit<OptionsType, \"children\"> & ContainerProps<InstanceType>,\n) => InstanceType & JSX.Element) => {\n return (props): InstanceType & JSX.Element => {\n const [runtimeProps, initialisationProps] = splitProps(props, CONTAINER_RUNTIME_KEYS);\n\n const instance = props.as || new PixiClass(initialisationProps as any);\n\n bindInitialisationProps(instance, initialisationProps);\n bindRuntimeProps(instance, runtimeProps);\n\n onCleanup(() => {\n if (\"attach\" in instance) {\n // Means it's a render layer so we don't want to destroy children as they are managed elsewhere in the tree.\n instance.destroy({ children: false });\n } else {\n instance.destroy({ children: true });\n }\n });\n\n return instance as InstanceType & JSX.Element;\n };\n};\n\nexport const createLeafComponent = <\n InstanceType extends Pixi.Container,\n OptionsType extends object,\n>(\n PixiClass: new (props: OptionsType) => InstanceType,\n) => {\n return (\n props: Omit<OptionsType, \"children\"> & LeafProps<InstanceType>,\n ): InstanceType & JSX.Element => {\n return createContainerComponent<InstanceType, OptionsType>(PixiClass)(props);\n };\n};\n\nexport const createSpriteComponent = <\n InstanceType extends Pixi.Container,\n OptionsType extends object,\n>(\n PixiClass: new (props: OptionsType) => InstanceType,\n) => {\n return (\n props: Omit<OptionsType, \"children\"> & SpriteProps<InstanceType>,\n ): InstanceType & JSX.Element => {\n const [runtimeProps, initialisationProps] = splitProps(props, SPRITE_RUNTIME_KEYS);\n\n const instance = props.as || new PixiClass(initialisationProps as any);\n\n bindInitialisationProps(instance, initialisationProps);\n bindRuntimeProps(instance, runtimeProps);\n\n onCleanup(() => {\n instance.destroy({ children: true });\n });\n\n return instance as InstanceType & JSX.Element;\n };\n};\n\nexport const createAnimatedSpriteComponent = <\n InstanceType extends AnimatedSpriteLike,\n OptionsType extends object,\n>(\n PixiClass: new (props: OptionsType) => InstanceType,\n) => {\n return (\n props: Omit<OptionsType, \"children\"> & AnimatedSpriteProps<InstanceType>,\n ): InstanceType & JSX.Element => {\n // Specifically separate `autoUpdate` as we handle it manually below.\n const [runtimeProps, update, initialisationProps] = splitProps(props, SPRITE_RUNTIME_KEYS, [\n \"autoUpdate\",\n ]);\n\n const instance = props.as || new PixiClass(initialisationProps as any);\n\n // Set this to false to override Pixi's default shared ticker behaviour.\n instance.autoUpdate = false;\n\n createRenderEffect(\n on(\n () => update.autoUpdate,\n (autoUpdate) => {\n const updateInstance = (ticker: Pixi.Ticker) => {\n instance.update(ticker);\n };\n\n if (autoUpdate !== false) {\n const ticker = getTicker();\n ticker.add(updateInstance);\n onCleanup(() => {\n ticker.remove(updateInstance);\n });\n }\n },\n ),\n );\n\n bindInitialisationProps(instance, initialisationProps);\n bindRuntimeProps(instance, runtimeProps);\n\n onCleanup(() => {\n instance.destroy({ children: true });\n });\n\n return instance as InstanceType & JSX.Element;\n };\n};\n\nexport const createTilingSpriteComponent = <\n InstanceType extends Pixi.Container,\n OptionsType extends object,\n>(\n PixiClass: new (props: OptionsType) => InstanceType,\n) => {\n return (\n props: Omit<OptionsType, \"children\"> & TilingSpriteProps<InstanceType>,\n ): InstanceType & JSX.Element => {\n const [runtimeProps, initialisationProps] = splitProps(props, TILING_SPRITE_RUNTIME_KEYS);\n\n const instance = props.as || new PixiClass(initialisationProps as any);\n\n bindInitialisationProps(instance, initialisationProps);\n bindRuntimeProps(instance, runtimeProps);\n\n onCleanup(() => {\n instance.destroy({ children: true });\n });\n\n return instance as InstanceType & JSX.Element;\n };\n};\n\nexport const createFilterComponent = <InstanceType extends Pixi.Filter, OptionsType extends object>(\n PixiClass: new (props: OptionsType) => InstanceType,\n) => {\n return (props: OptionsType & FilterProps<InstanceType>): InstanceType & JSX.Element => {\n const [runtimeProps, initialisationProps] = splitProps(props, [\"ref\", \"as\"]);\n\n const instance = props.as || new PixiClass(initialisationProps as any);\n\n for (const key in initialisationProps) {\n if (key === \"as\") continue;\n\n if (key === \"ref\") {\n createRenderEffect(() => {\n // Solid converts the ref prop to a callback function\n (props[key] as unknown as (arg: any) => void)(instance);\n });\n } else if (key === \"children\") {\n throw new Error(`Cannot set children on non-container instance.`);\n } else {\n createRenderEffect(\n on(\n () => props[key as keyof typeof initialisationProps],\n () => {\n (instance as any)[key] = initialisationProps[key];\n },\n { defer: true },\n ),\n );\n }\n }\n\n for (const key in runtimeProps) {\n if (key === \"as\") continue;\n\n if (key === \"ref\") {\n createRenderEffect(() => {\n // Solid converts the ref prop to a callback function\n (props[key] as unknown as (arg: any) => void)(instance);\n });\n }\n }\n\n onCleanup(() => {\n instance.destroy();\n });\n\n return instance as InstanceType & JSX.Element;\n };\n};\n"],"names":[],"mappings":";;;;;AAoGO,MAAM,kBAAkB,CAAC,OAAO,MAAM,UAAU;AAGvD,MAAM,yBAAyB;AAAA,EAC7B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,sBAAsB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,6BAA6B;AAAA,EACjC;AAAA,EACA;AAAA,EACA,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEO,MAAM,2BAA2B,CAItC,cAGkC;AAClC,SAAO,CAAC,UAAsC;AAC5C,UAAM,CAAC,cAAc,mBAAmB,IAAI,WAAW,OAAO,sBAAsB;AAEpF,UAAM,WAAW,MAAM,MAAM,IAAI,UAAU,mBAA0B;AAErE,4BAAwB,UAAU,mBAAmB;AACrD,qBAAiB,UAAU,YAAY;AAEvC,cAAU,MAAM;AACd,UAAI,YAAY,UAAU;AAExB,iBAAS,QAAQ,EAAE,UAAU,MAAA,CAAO;AAAA,MACtC,OAAO;AACL,iBAAS,QAAQ,EAAE,UAAU,KAAA,CAAM;AAAA,MACrC;AAAA,IACF,CAAC;AAED,WAAO;AAAA,EACT;AACF;AAEO,MAAM,sBAAsB,CAIjC,cACG;AACH,SAAO,CACL,UAC+B;AAC/B,WAAO,yBAAoD,SAAS,EAAE,KAAK;AAAA,EAC7E;AACF;AAEO,MAAM,wBAAwB,CAInC,cACG;AACH,SAAO,CACL,UAC+B;AAC/B,UAAM,CAAC,cAAc,mBAAmB,IAAI,WAAW,OAAO,mBAAmB;AAEjF,UAAM,WAAW,MAAM,MAAM,IAAI,UAAU,mBAA0B;AAErE,4BAAwB,UAAU,mBAAmB;AACrD,qBAAiB,UAAU,YAAY;AAEvC,cAAU,MAAM;AACd,eAAS,QAAQ,EAAE,UAAU,KAAA,CAAM;AAAA,IACrC,CAAC;AAED,WAAO;AAAA,EACT;AACF;AAEO,MAAM,gCAAgC,CAI3C,cACG;AACH,SAAO,CACL,UAC+B;AAE/B,UAAM,CAAC,cAAc,QAAQ,mBAAmB,IAAI,WAAW,OAAO,qBAAqB;AAAA,MACzF;AAAA,IAAA,CACD;AAED,UAAM,WAAW,MAAM,MAAM,IAAI,UAAU,mBAA0B;AAGrE,aAAS,aAAa;AAEtB;AAAA,MACE;AAAA,QACE,MAAM,OAAO;AAAA,QACb,CAAC,eAAe;AACd,gBAAM,iBAAiB,CAAC,WAAwB;AAC9C,qBAAS,OAAO,MAAM;AAAA,UACxB;AAEA,cAAI,eAAe,OAAO;AACxB,kBAAM,SAAS,UAAA;AACf,mBAAO,IAAI,cAAc;AACzB,sBAAU,MAAM;AACd,qBAAO,OAAO,cAAc;AAAA,YAC9B,CAAC;AAAA,UACH;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAGF,4BAAwB,UAAU,mBAAmB;AACrD,qBAAiB,UAAU,YAAY;AAEvC,cAAU,MAAM;AACd,eAAS,QAAQ,EAAE,UAAU,KAAA,CAAM;AAAA,IACrC,CAAC;AAED,WAAO;AAAA,EACT;AACF;AAEO,MAAM,8BAA8B,CAIzC,cACG;AACH,SAAO,CACL,UAC+B;AAC/B,UAAM,CAAC,cAAc,mBAAmB,IAAI,WAAW,OAAO,0BAA0B;AAExF,UAAM,WAAW,MAAM,MAAM,IAAI,UAAU,mBAA0B;AAErE,4BAAwB,UAAU,mBAAmB;AACrD,qBAAiB,UAAU,YAAY;AAEvC,cAAU,MAAM;AACd,eAAS,QAAQ,EAAE,UAAU,KAAA,CAAM;AAAA,IACrC,CAAC;AAED,WAAO;AAAA,EACT;AACF;"}
|
|
1
|
+
{"version":3,"file":"component-factories.js","sources":["../../src/components/component-factories.ts"],"sourcesContent":["import type * as Pixi from \"pixi.js\";\nimport type { JSX, Ref } from \"solid-js\";\nimport { createRenderEffect, on, splitProps, onCleanup } from \"solid-js\";\n\nimport { getTicker } from \"../pixi-application\";\n\nimport { bindInitialisationProps, bindRuntimeProps } from \"./bind-props\";\nimport type { PixiSolidEventHandlerMap } from \"./bind-props/event-names\";\nimport { PIXI_SOLID_EVENT_HANDLER_NAMES } from \"./bind-props/event-names\";\nimport type {\n CommonPointAxisPropName,\n AnchorPointAxisPropName,\n TilingPointAxisPropName,\n} from \"./bind-props/point-property-names\";\nimport {\n COMMON_POINT_PROP_AXIS_NAMES,\n ANCHOR_POINT_PROP_AXIS_NAMES,\n TILING_POINT_PROP_AXIS_NAMES,\n} from \"./bind-props/point-property-names\";\n\n/**\n * Common point axis properties available on all Container-based components\n */\nexport type CommonPointAxisProps = Partial<Record<CommonPointAxisPropName, number>>;\n\n/**\n * Anchor point axis properties available on Sprite-like components\n */\nexport type AnchorPointAxisProps = Partial<Record<AnchorPointAxisPropName, number>>;\n\n/**\n * Tiling point axis properties available on TilingSprite\n */\nexport type TilingPointAxisProps = Partial<Record<TilingPointAxisPropName, number>>;\n\n/**\n * This is a utility type useful for extending the props of custom components to allow props to be passed through to the underlying Pixi instance.\n *\n * If you don't require them all it's recommended to narrow the type by using Pick or Omit the props to only allow the ones you need.\n *\n * @example PixiComponentProps<Pixi.SpriteOptions>.\n */\nexport type PixiComponentProps<\n ComponentOptions extends Pixi.ContainerOptions = Pixi.ContainerOptions,\n> = PixiSolidEventHandlerMap & CommonPointAxisProps & Omit<ComponentOptions, \"children\">;\n\n/**\n * Prop definition for basic Container components (position, scale, pivot, skew only)\n */\nexport type ContainerProps<Component> = PixiSolidEventHandlerMap &\n CommonPointAxisProps &\n Record<string, unknown> & {\n ref?: Ref<Component>;\n as?: Component;\n children?: JSX.Element;\n };\n\n/**\n * Prop definition for components that cannot have children\n */\nexport type LeafProps<Component> = Omit<ContainerProps<Component>, \"children\">;\n\n/**\n * Prop definition for Sprite-like components (includes anchor properties)\n */\nexport type SpriteProps<Component> = PixiSolidEventHandlerMap &\n CommonPointAxisProps &\n AnchorPointAxisProps & {\n ref?: Ref<Component>;\n as?: Component;\n };\n\nexport type AnimatedSpriteProps<Component> = SpriteProps<Component> &\n Pick<Pixi.AnimatedSpriteOptions, \"autoUpdate\">;\n\ntype AnimatedSpriteLike = Pixi.Container & {\n autoUpdate: boolean;\n update: (ticker: Pixi.Ticker) => void;\n};\n\n/**\n * Prop definition for TilingSprite (includes anchor and tiling properties)\n */\nexport type TilingSpriteProps<Component> = PixiSolidEventHandlerMap &\n CommonPointAxisProps &\n AnchorPointAxisProps &\n TilingPointAxisProps & {\n ref?: Ref<Component>;\n as?: Component;\n };\n\n/**\n * Prop definition for filter components\n */\nexport type FilterProps<Component> = {\n ref?: Ref<Component>;\n as?: Component;\n};\n\n// Keys that are specific to Solid components and not Pixi props\nexport const SOLID_PROP_KEYS = [\"ref\", \"as\", \"children\"] as const;\n\n// Combined keys for splitting props\nconst CONTAINER_RUNTIME_KEYS = [\n ...SOLID_PROP_KEYS,\n ...PIXI_SOLID_EVENT_HANDLER_NAMES,\n ...COMMON_POINT_PROP_AXIS_NAMES,\n] as const;\n\n// Sprite components don't accept \"children\" since they can't have children\nconst SPRITE_RUNTIME_KEYS = [\n \"ref\",\n \"as\",\n ...PIXI_SOLID_EVENT_HANDLER_NAMES,\n ...COMMON_POINT_PROP_AXIS_NAMES,\n ...ANCHOR_POINT_PROP_AXIS_NAMES,\n] as const;\n\nconst TILING_SPRITE_RUNTIME_KEYS = [\n \"ref\",\n \"as\",\n ...PIXI_SOLID_EVENT_HANDLER_NAMES,\n ...COMMON_POINT_PROP_AXIS_NAMES,\n ...ANCHOR_POINT_PROP_AXIS_NAMES,\n ...TILING_POINT_PROP_AXIS_NAMES,\n] as const;\n\nexport const createContainerComponent = <\n InstanceType extends Pixi.Container,\n OptionsType extends object,\n>(\n PixiClass: new (props: OptionsType) => InstanceType,\n): ((\n props: Omit<OptionsType, \"children\"> & ContainerProps<InstanceType>,\n) => InstanceType & JSX.Element) => {\n return (props): InstanceType & JSX.Element => {\n const [runtimeProps, initialisationProps] = splitProps(props, CONTAINER_RUNTIME_KEYS);\n\n const instance = props.as || new PixiClass(initialisationProps as any);\n\n bindInitialisationProps(instance, initialisationProps);\n bindRuntimeProps(instance, runtimeProps);\n\n onCleanup(() => {\n if (\"attach\" in instance) {\n // Means it's a render layer so we don't want to destroy children as they are managed elsewhere in the tree.\n instance.destroy({ children: false });\n } else {\n instance.destroy({ children: true });\n }\n });\n\n return instance as InstanceType & JSX.Element;\n };\n};\n\nexport const createLeafComponent = <\n InstanceType extends Pixi.Container,\n OptionsType extends object,\n>(\n PixiClass: new (props: OptionsType) => InstanceType,\n) => {\n return (\n props: Omit<OptionsType, \"children\"> & LeafProps<InstanceType>,\n ): InstanceType & JSX.Element => {\n return createContainerComponent<InstanceType, OptionsType>(PixiClass)(props);\n };\n};\n\nexport const createSpriteComponent = <\n InstanceType extends Pixi.Container,\n OptionsType extends object,\n>(\n PixiClass: new (props: OptionsType) => InstanceType,\n) => {\n return (\n props: Omit<OptionsType, \"children\"> & SpriteProps<InstanceType>,\n ): InstanceType & JSX.Element => {\n const [runtimeProps, initialisationProps] = splitProps(props, SPRITE_RUNTIME_KEYS);\n\n const instance = props.as || new PixiClass(initialisationProps as any);\n\n bindInitialisationProps(instance, initialisationProps);\n bindRuntimeProps(instance, runtimeProps);\n\n onCleanup(() => {\n instance.destroy({ children: true });\n });\n\n return instance as InstanceType & JSX.Element;\n };\n};\n\nexport const createAnimatedSpriteComponent = <\n InstanceType extends AnimatedSpriteLike,\n OptionsType extends object,\n>(\n PixiClass: new (props: OptionsType) => InstanceType,\n) => {\n return (\n props: Omit<OptionsType, \"children\"> & AnimatedSpriteProps<InstanceType>,\n ): InstanceType & JSX.Element => {\n // Specifically separate `autoUpdate` as we handle it manually below.\n const [runtimeProps, update, initialisationProps] = splitProps(props, SPRITE_RUNTIME_KEYS, [\n \"autoUpdate\",\n ]);\n\n const instance = props.as || new PixiClass(initialisationProps as any);\n\n // Set this to false to override Pixi's default shared ticker behaviour.\n instance.autoUpdate = false;\n\n createRenderEffect(\n on(\n () => update.autoUpdate,\n (autoUpdate) => {\n const updateInstance = (ticker: Pixi.Ticker) => {\n instance.update(ticker);\n };\n\n if (autoUpdate !== false) {\n const ticker = getTicker();\n ticker.add(updateInstance);\n onCleanup(() => {\n ticker.remove(updateInstance);\n });\n }\n },\n ),\n );\n\n bindInitialisationProps(instance, initialisationProps);\n bindRuntimeProps(instance, runtimeProps);\n\n onCleanup(() => {\n instance.destroy({ children: true });\n });\n\n return instance as InstanceType & JSX.Element;\n };\n};\n\nexport const createTilingSpriteComponent = <\n InstanceType extends Pixi.Container,\n OptionsType extends object,\n>(\n PixiClass: new (props: OptionsType) => InstanceType,\n) => {\n return (\n props: Omit<OptionsType, \"children\"> & TilingSpriteProps<InstanceType>,\n ): InstanceType & JSX.Element => {\n const [runtimeProps, initialisationProps] = splitProps(props, TILING_SPRITE_RUNTIME_KEYS);\n\n const instance = props.as || new PixiClass(initialisationProps as any);\n\n bindInitialisationProps(instance, initialisationProps);\n bindRuntimeProps(instance, runtimeProps);\n\n onCleanup(() => {\n instance.destroy({ children: true });\n });\n\n return instance as InstanceType & JSX.Element;\n };\n};\n\nexport const createFilterComponent = <InstanceType extends Pixi.Filter, OptionsType extends object>(\n PixiClass: new (props: OptionsType) => InstanceType,\n) => {\n return (props: OptionsType & FilterProps<InstanceType>): InstanceType & JSX.Element => {\n const [runtimeProps, initialisationProps] = splitProps(props, [\"ref\", \"as\"]);\n\n const instance = props.as || new PixiClass(initialisationProps as any);\n\n for (const key in initialisationProps) {\n if (key === \"as\") continue;\n\n if (key === \"ref\") {\n createRenderEffect(() => {\n // Solid converts the ref prop to a callback function\n (props[key] as unknown as (arg: any) => void)(instance);\n });\n } else if (key === \"children\") {\n throw new Error(`Cannot set children on non-container instance.`);\n } else {\n createRenderEffect(\n on(\n () => props[key as keyof typeof initialisationProps],\n () => {\n (instance as any)[key] = initialisationProps[key];\n },\n { defer: true },\n ),\n );\n }\n }\n\n for (const key in runtimeProps) {\n if (key === \"as\") continue;\n\n if (key === \"ref\") {\n createRenderEffect(() => {\n // Solid converts the ref prop to a callback function\n (props[key] as unknown as (arg: any) => void)(instance);\n });\n }\n }\n\n onCleanup(() => {\n instance.destroy();\n });\n\n return instance as InstanceType & JSX.Element;\n };\n};\n"],"names":[],"mappings":";;;;;AAoGO,MAAM,kBAAkB,CAAC,OAAO,MAAM,UAAU;AAGvD,MAAM,yBAAyB;AAAA,EAC7B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,sBAAsB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,6BAA6B;AAAA,EACjC;AAAA,EACA;AAAA,EACA,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEO,MAAM,2BAA2B,CAItC,cAGkC;AAClC,SAAO,CAAC,UAAsC;AAC5C,UAAM,CAAC,cAAc,mBAAmB,IAAI,WAAW,OAAO,sBAAsB;AAEpF,UAAM,WAAW,MAAM,MAAM,IAAI,UAAU,mBAA0B;AAErE,4BAAwB,UAAU,mBAAmB;AACrD,qBAAiB,UAAU,YAAY;AAEvC,cAAU,MAAM;AACd,UAAI,YAAY,UAAU;AAExB,iBAAS,QAAQ,EAAE,UAAU,MAAA,CAAO;AAAA,MACtC,OAAO;AACL,iBAAS,QAAQ,EAAE,UAAU,KAAA,CAAM;AAAA,MACrC;AAAA,IACF,CAAC;AAED,WAAO;AAAA,EACT;AACF;AAEO,MAAM,sBAAsB,CAIjC,cACG;AACH,SAAO,CACL,UAC+B;AAC/B,WAAO,yBAAoD,SAAS,EAAE,KAAK;AAAA,EAC7E;AACF;AAEO,MAAM,wBAAwB,CAInC,cACG;AACH,SAAO,CACL,UAC+B;AAC/B,UAAM,CAAC,cAAc,mBAAmB,IAAI,WAAW,OAAO,mBAAmB;AAEjF,UAAM,WAAW,MAAM,MAAM,IAAI,UAAU,mBAA0B;AAErE,4BAAwB,UAAU,mBAAmB;AACrD,qBAAiB,UAAU,YAAY;AAEvC,cAAU,MAAM;AACd,eAAS,QAAQ,EAAE,UAAU,KAAA,CAAM;AAAA,IACrC,CAAC;AAED,WAAO;AAAA,EACT;AACF;AAEO,MAAM,gCAAgC,CAI3C,cACG;AACH,SAAO,CACL,UAC+B;AAE/B,UAAM,CAAC,cAAc,QAAQ,mBAAmB,IAAI,WAAW,OAAO,qBAAqB;AAAA,MACzF;AAAA,IAAA,CACD;AAED,UAAM,WAAW,MAAM,MAAM,IAAI,UAAU,mBAA0B;AAGrE,aAAS,aAAa;AAEtB;AAAA,MACE;AAAA,QACE,MAAM,OAAO;AAAA,QACb,CAAC,eAAe;AACd,gBAAM,iBAAiB,CAAC,WAAwB;AAC9C,qBAAS,OAAO,MAAM;AAAA,UACxB;AAEA,cAAI,eAAe,OAAO;AACxB,kBAAM,SAAS,UAAA;AACf,mBAAO,IAAI,cAAc;AACzB,sBAAU,MAAM;AACd,qBAAO,OAAO,cAAc;AAAA,YAC9B,CAAC;AAAA,UACH;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAGF,4BAAwB,UAAU,mBAAmB;AACrD,qBAAiB,UAAU,YAAY;AAEvC,cAAU,MAAM;AACd,eAAS,QAAQ,EAAE,UAAU,KAAA,CAAM;AAAA,IACrC,CAAC;AAED,WAAO;AAAA,EACT;AACF;AAEO,MAAM,8BAA8B,CAIzC,cACG;AACH,SAAO,CACL,UAC+B;AAC/B,UAAM,CAAC,cAAc,mBAAmB,IAAI,WAAW,OAAO,0BAA0B;AAExF,UAAM,WAAW,MAAM,MAAM,IAAI,UAAU,mBAA0B;AAErE,4BAAwB,UAAU,mBAAmB;AACrD,qBAAiB,UAAU,YAAY;AAEvC,cAAU,MAAM;AACd,eAAS,QAAQ,EAAE,UAAU,KAAA,CAAM;AAAA,IACrC,CAAC;AAED,WAAO;AAAA,EACT;AACF;"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,6 @@ import { onResize } from "./on-resize.js";
|
|
|
2
2
|
import { onTick } from "./on-tick.js";
|
|
3
3
|
import { createAsyncDelay, delay } from "./delay.js";
|
|
4
4
|
import { PixiCanvas } from "./pixi-canvas.js";
|
|
5
|
-
import { PIXI_EVENT_NAMES, PIXI_SOLID_EVENT_HANDLER_NAMES } from "./components/bind-props/event-names.js";
|
|
6
5
|
import { getPixiApp } from "./pixi-application/get-pixi-app.js";
|
|
7
6
|
import { getTicker } from "./pixi-application/get-ticker.js";
|
|
8
7
|
import { PixiApplicationProvider, TickerProvider } from "./pixi-application/pixi-application-provider.js";
|
|
@@ -17,8 +16,6 @@ export {
|
|
|
17
16
|
MeshPlane,
|
|
18
17
|
MeshRope,
|
|
19
18
|
NineSliceSprite,
|
|
20
|
-
PIXI_EVENT_NAMES,
|
|
21
|
-
PIXI_SOLID_EVENT_HANDLER_NAMES,
|
|
22
19
|
ParticleContainer,
|
|
23
20
|
PerspectiveMesh,
|
|
24
21
|
PixiApplicationProvider,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
package/dist/on-resize.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createEffect, on } from "solid-js";
|
|
2
2
|
import { getPixiApp } from "./pixi-application/get-pixi-app.js";
|
|
3
|
+
import { usePixiScreen } from "./use-pixi-screen/use-pixi-screen.js";
|
|
3
4
|
const onResize = (resizeCallback) => {
|
|
4
5
|
let pixiApp;
|
|
5
6
|
try {
|
|
@@ -7,14 +8,16 @@ const onResize = (resizeCallback) => {
|
|
|
7
8
|
} catch {
|
|
8
9
|
throw new Error("onResize must be used within a PixiApplicationProvider or a PixiCanvas");
|
|
9
10
|
}
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
const screen = usePixiScreen();
|
|
12
|
+
createEffect(
|
|
13
|
+
on(
|
|
14
|
+
() => [screen.width, screen.height, screen.x, screen.y],
|
|
15
|
+
() => {
|
|
16
|
+
resizeCallback(pixiApp.renderer.screen);
|
|
17
|
+
},
|
|
18
|
+
{ defer: false }
|
|
19
|
+
)
|
|
20
|
+
);
|
|
18
21
|
};
|
|
19
22
|
export {
|
|
20
23
|
onResize
|
package/dist/on-resize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"on-resize.js","sources":["../src/on-resize.ts"],"sourcesContent":["import type * as Pixi from \"pixi.js\";\nimport {
|
|
1
|
+
{"version":3,"file":"on-resize.js","sources":["../src/on-resize.ts"],"sourcesContent":["import type * as Pixi from \"pixi.js\";\nimport { createEffect, on } from \"solid-js\";\n\nimport { getPixiApp } from \"./pixi-application\";\nimport { usePixiScreen } from \"./use-pixi-screen\";\n\n/**\n *\n * A SolidJS hook that runs a callback function whenever the PixiJS renderer is resized.\n * The callback is automatically removed when the component or hook's owning computation is cleaned up.\n *\n * This hook must be called from a component that is a descendant of `PixiCanvas` or `PixiApplicationProvider`.\n *\n * @param resizeCallback - A callback function that receives the updated screen dimensions as a `Pixi.Rectangle` object. This function will be called immediately upon hook initialization and then on every subsequent resize event.\n *\n * We listen for the renderer's \"resize\" event so this hook will work correctly whether the window is resized or just the DOM element the PixiCanvas is inside of changes size.\n */\nexport const onResize = (resizeCallback: (screen: Pixi.Rectangle) => void): void => {\n let pixiApp: Pixi.Application;\n\n try {\n pixiApp = getPixiApp();\n } catch {\n throw new Error(\"onResize must be used within a PixiApplicationProvider or a PixiCanvas\");\n }\n\n const screen = usePixiScreen();\n\n /**\n * We derive from the reactive screen store so this hook always fires after `usePixiScreen()` has\n * been updated.\n * This avoids a race condition and guarantees consistent values when both are used together.\n */\n createEffect(\n on(\n () => [screen.width, screen.height, screen.x, screen.y],\n () => {\n resizeCallback(pixiApp.renderer.screen);\n },\n { defer: false },\n ),\n );\n};\n"],"names":[],"mappings":";;;AAiBO,MAAM,WAAW,CAAC,mBAA2D;AAClF,MAAI;AAEJ,MAAI;AACF,cAAU,WAAA;AAAA,EACZ,QAAQ;AACN,UAAM,IAAI,MAAM,wEAAwE;AAAA,EAC1F;AAEA,QAAM,SAAS,cAAA;AAOf;AAAA,IACE;AAAA,MACE,MAAM,CAAC,OAAO,OAAO,OAAO,QAAQ,OAAO,GAAG,OAAO,CAAC;AAAA,MACtD,MAAM;AACJ,uBAAe,QAAQ,SAAS,MAAM;AAAA,MACxC;AAAA,MACA,EAAE,OAAO,MAAA;AAAA,IAAM;AAAA,EACjB;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-application-provider.js","sources":["../../src/pixi-application/pixi-application-provider.tsx"],"sourcesContent":["import type * as Pixi from \"pixi.js\";\nimport type { JSX, ParentProps } from \"solid-js\";\nimport { createResource, onCleanup, Show, splitProps, useContext } from \"solid-js\";\n\nimport { createPixiScreenStore } from \"../use-pixi-screen/pixi-screen-store\";\n\nimport { PixiAppContext, TickerContext } from \"./context\";\nimport { createPixiApplication } from \"./pixi-application\";\n\n/**\n * Props for the `PixiApplication` component. It extends the PIXI.ApplicationOptions\n * minus the `children` and `resizeTo` properties, which are handled by pixi-solid internally.\n * There is also an optional `existingApp` property to pass in an already created Pixi.Application instance, which will be used instead of creating a new one.\n */\nexport type PixiApplicationProps = Partial<\n Omit<Pixi.ApplicationOptions, \"children\" | \"resizeTo\">\n> & {\n children?: JSX.Element;\n existingApp?: Pixi.Application;\n};\n\n/**\n * A SolidJS component that creates a Pixi.Application instance and works as a context provider.\n * It provides the application instance through context to be used by child components\n * and custom hooks like `getPixiApp`, `onTick`, `getTicker` and `usePixiScreen`.\n *\n * This component should only be used once in your application.\n *\n * @param props The properties to configure the Pixi.js Application.\n *\n */\nexport const PixiApplicationProvider = (props: PixiApplicationProps): JSX.Element => {\n let externallyProvidedApp: Pixi.Application | undefined = props.existingApp;\n\n const [appResource] = createResource(async () => {\n if (externallyProvidedApp) {\n return externallyProvidedApp;\n }\n\n const existingContext = useContext(PixiAppContext);\n if (existingContext?.app) {\n externallyProvidedApp = existingContext.app;\n return existingContext.app;\n }\n\n const [, initialisationProps] = splitProps(props, [\"children\", \"existingApp\"]);\n return await createPixiApplication(initialisationProps);\n });\n\n onCleanup(() => {\n // Only
|
|
1
|
+
{"version":3,"file":"pixi-application-provider.js","sources":["../../src/pixi-application/pixi-application-provider.tsx"],"sourcesContent":["import type * as Pixi from \"pixi.js\";\nimport type { JSX, ParentProps } from \"solid-js\";\nimport { createResource, onCleanup, Show, splitProps, useContext } from \"solid-js\";\n\nimport { createPixiScreenStore } from \"../use-pixi-screen/pixi-screen-store\";\n\nimport { PixiAppContext, TickerContext } from \"./context\";\nimport { createPixiApplication } from \"./pixi-application\";\n\n/**\n * Props for the `PixiApplication` component. It extends the PIXI.ApplicationOptions\n * minus the `children` and `resizeTo` properties, which are handled by pixi-solid internally.\n * There is also an optional `existingApp` property to pass in an already created Pixi.Application instance, which will be used instead of creating a new one.\n */\nexport type PixiApplicationProps = Partial<\n Omit<Pixi.ApplicationOptions, \"children\" | \"resizeTo\">\n> & {\n children?: JSX.Element;\n existingApp?: Pixi.Application;\n};\n\n/**\n * A SolidJS component that creates a Pixi.Application instance and works as a context provider.\n * It provides the application instance through context to be used by child components\n * and custom hooks like `getPixiApp`, `onTick`, `getTicker` and `usePixiScreen`.\n *\n * This component should only be used once in your application.\n *\n * @param props The properties to configure the Pixi.js Application.\n *\n */\nexport const PixiApplicationProvider = (props: PixiApplicationProps): JSX.Element => {\n let externallyProvidedApp: Pixi.Application | undefined = props.existingApp;\n\n const [appResource] = createResource(async () => {\n if (externallyProvidedApp) {\n return externallyProvidedApp;\n }\n\n const existingContext = useContext(PixiAppContext);\n if (existingContext?.app) {\n externallyProvidedApp = existingContext.app;\n return existingContext.app;\n }\n\n const [, initialisationProps] = splitProps(props, [\"children\", \"existingApp\"]);\n return await createPixiApplication(initialisationProps);\n });\n\n onCleanup(() => {\n // Only destroy the app if it was created here.\n if (externallyProvidedApp) return;\n appResource()?.destroy(true, { children: true });\n });\n\n return (\n <Show when={appResource()}>\n {(app) => {\n const pixiScreenStore = createPixiScreenStore(app().renderer);\n const contextValue = {\n app: app(),\n pixiScreenStore,\n };\n\n return (\n <PixiAppContext.Provider value={contextValue}>\n <TickerContext.Provider value={app().ticker}>{props.children}</TickerContext.Provider>\n </PixiAppContext.Provider>\n );\n }}\n </Show>\n );\n};\n\nexport type TickerProviderProps = ParentProps<{ ticker: Pixi.Ticker }>;\n\n/**\n * This is only required if you want a ticker without the Pixi Application.\n * For applications that want to use multiple tickers or for testing a store that relies on the ticker related utilities.\n * It provides context for the `onTick`, `delay`, `createAsyncDelay` and `getTicker` utilities.\n *\n * The ticker instance you want to use needs to be passed in as a prop so it can be manually controlled from the outside for testing.\n */\nexport const TickerProvider = (props: TickerProviderProps): JSX.Element => {\n return <TickerContext.Provider value={props.ticker}>{props.children}</TickerContext.Provider>;\n};\n"],"names":["PixiApplicationProvider","props","externallyProvidedApp","existingApp","appResource","createResource","existingContext","useContext","PixiAppContext","app","initialisationProps","splitProps","createPixiApplication","onCleanup","destroy","children","_$createComponent","Show","when","pixiScreenStore","createPixiScreenStore","renderer","contextValue","Provider","value","TickerContext","ticker","TickerProvider"],"mappings":";;;;;AA+BO,MAAMA,0BAA0BA,CAACC,UAA6C;AACnF,MAAIC,wBAAsDD,MAAME;AAEhE,QAAM,CAACC,WAAW,IAAIC,eAAe,YAAY;AAC/C,QAAIH,uBAAuB;AACzB,aAAOA;AAAAA,IACT;AAEA,UAAMI,kBAAkBC,WAAWC,cAAc;AACjD,QAAIF,iBAAiBG,KAAK;AACxBP,8BAAwBI,gBAAgBG;AACxC,aAAOH,gBAAgBG;AAAAA,IACzB;AAEA,UAAM,CAAA,EAAGC,mBAAmB,IAAIC,WAAWV,OAAO,CAAC,YAAY,aAAa,CAAC;AAC7E,WAAO,MAAMW,sBAAsBF,mBAAmB;AAAA,EACxD,CAAC;AAEDG,YAAU,MAAM;AAEd,QAAIX,sBAAuB;AAC3BE,gBAAAA,GAAeU,QAAQ,MAAM;AAAA,MAAEC,UAAU;AAAA,IAAA,CAAM;AAAA,EACjD,CAAC;AAED,SAAAC,gBACGC,MAAI;AAAA,IAAA,IAACC,OAAI;AAAA,aAAEd,YAAAA;AAAAA,IAAa;AAAA,IAAAW,UACrBN,CAAAA,QAAQ;AACR,YAAMU,kBAAkBC,sBAAsBX,IAAAA,EAAMY,QAAQ;AAC5D,YAAMC,eAAe;AAAA,QACnBb,KAAKA,IAAAA;AAAAA,QACLU;AAAAA,MAAAA;AAGF,aAAAH,gBACGR,eAAee,UAAQ;AAAA,QAACC,OAAOF;AAAAA,QAAY,IAAAP,WAAA;AAAA,iBAAAC,gBACzCS,cAAcF,UAAQ;AAAA,YAAA,IAACC,QAAK;AAAA,qBAAEf,MAAMiB;AAAAA,YAAM;AAAA,YAAA,IAAAX,WAAA;AAAA,qBAAGd,MAAMc;AAAAA,YAAQ;AAAA,UAAA,CAAA;AAAA,QAAA;AAAA,MAAA,CAAA;AAAA,IAGlE;AAAA,EAAA,CAAC;AAGP;AAWO,MAAMY,iBAAiBA,CAAC1B,UAA4C;AACzE,SAAAe,gBAAQS,cAAcF,UAAQ;AAAA,IAAA,IAACC,QAAK;AAAA,aAAEvB,MAAMyB;AAAAA,IAAM;AAAA,IAAA,IAAAX,WAAA;AAAA,aAAGd,MAAMc;AAAAA,IAAQ;AAAA,EAAA,CAAA;AACrE;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { FederatedEventEmitterTypes } from "pixi.js";
|
|
2
2
|
export declare const PIXI_EVENT_NAMES: (keyof FederatedEventEmitterTypes)[];
|
|
3
3
|
export declare const PIXI_SOLID_EVENT_HANDLER_NAMES: ("onclick" | "onmousedown" | "onmouseenter" | "onmouseleave" | "onmousemove" | "onmouseout" | "onmouseover" | "onmouseup" | "onmouseupoutside" | "onpointercancel" | "onpointerdown" | "onpointerenter" | "onpointerleave" | "onpointermove" | "onpointerout" | "onpointerover" | "onpointertap" | "onpointerup" | "onpointerupoutside" | "onrightclick" | "onrightdown" | "onrightup" | "onrightupoutside" | "ontap" | "ontouchcancel" | "ontouchend" | "ontouchendoutside" | "ontouchmove" | "ontouchstart" | "onwheel" | "onglobalmousemove" | "onglobalpointermove" | "onglobaltouchmove" | "onclickcapture" | "onmousedowncapture" | "onmouseentercapture" | "onmouseleavecapture" | "onmousemovecapture" | "onmouseoutcapture" | "onmouseovercapture" | "onmouseupcapture" | "onmouseupoutsidecapture" | "onpointercancelcapture" | "onpointerdowncapture" | "onpointerentercapture" | "onpointerleavecapture" | "onpointermovecapture" | "onpointeroutcapture" | "onpointerovercapture" | "onpointertapcapture" | "onpointerupcapture" | "onpointerupoutsidecapture" | "onrightclickcapture" | "onrightdowncapture" | "onrightupcapture" | "onrightupoutsidecapture" | "ontapcapture" | "ontouchcancelcapture" | "ontouchendcapture" | "ontouchendoutsidecapture" | "ontouchmovecapture" | "ontouchstartcapture" | "onwheelcapture")[];
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
4
|
+
export type PixiSolidEventHandlerName = (typeof PIXI_SOLID_EVENT_HANDLER_NAMES)[number];
|
|
5
|
+
export type PixiSolidEventHandlerMap = {
|
|
6
6
|
[K in (typeof PIXI_EVENT_NAMES)[number] as `on${K}`]?: null | ((...args: FederatedEventEmitterTypes[K]) => void);
|
|
7
7
|
};
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const PIXI_SOLID_EVENT_HANDLER_NAME_SET: Set<string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { bindRuntimeProps, bindInitialisationProps } from "./bind-props";
|
|
2
|
-
export type {
|
|
2
|
+
export type { PixiSolidEventHandlerMap, PixiSolidEventHandlerName } from "./event-names";
|
|
3
3
|
export type { PointAxisPropName, CommonPointAxisPropName, AnchorPointAxisPropName, TilingPointAxisPropName, } from "./point-property-names";
|
|
4
4
|
export { PIXI_EVENT_NAMES, PIXI_SOLID_EVENT_HANDLER_NAMES } from "./event-names";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const isEventProperty: (name: string) => name is
|
|
1
|
+
import type { PixiSolidEventHandlerName } from "./event-names";
|
|
2
|
+
export declare const isEventProperty: (name: string) => name is PixiSolidEventHandlerName;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as Pixi from "pixi.js";
|
|
2
2
|
import type { JSX, Ref } from "solid-js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { PixiSolidEventHandlerMap } from "./bind-props/event-names";
|
|
4
4
|
import type { CommonPointAxisPropName, AnchorPointAxisPropName, TilingPointAxisPropName } from "./bind-props/point-property-names";
|
|
5
5
|
/**
|
|
6
6
|
* Common point axis properties available on all Container-based components
|
|
@@ -21,11 +21,11 @@ export type TilingPointAxisProps = Partial<Record<TilingPointAxisPropName, numbe
|
|
|
21
21
|
*
|
|
22
22
|
* @example PixiComponentProps<Pixi.SpriteOptions>.
|
|
23
23
|
*/
|
|
24
|
-
export type PixiComponentProps<ComponentOptions extends Pixi.ContainerOptions = Pixi.ContainerOptions> =
|
|
24
|
+
export type PixiComponentProps<ComponentOptions extends Pixi.ContainerOptions = Pixi.ContainerOptions> = PixiSolidEventHandlerMap & CommonPointAxisProps & Omit<ComponentOptions, "children">;
|
|
25
25
|
/**
|
|
26
26
|
* Prop definition for basic Container components (position, scale, pivot, skew only)
|
|
27
27
|
*/
|
|
28
|
-
export type ContainerProps<Component> =
|
|
28
|
+
export type ContainerProps<Component> = PixiSolidEventHandlerMap & CommonPointAxisProps & Record<string, unknown> & {
|
|
29
29
|
ref?: Ref<Component>;
|
|
30
30
|
as?: Component;
|
|
31
31
|
children?: JSX.Element;
|
|
@@ -37,7 +37,7 @@ export type LeafProps<Component> = Omit<ContainerProps<Component>, "children">;
|
|
|
37
37
|
/**
|
|
38
38
|
* Prop definition for Sprite-like components (includes anchor properties)
|
|
39
39
|
*/
|
|
40
|
-
export type SpriteProps<Component> =
|
|
40
|
+
export type SpriteProps<Component> = PixiSolidEventHandlerMap & CommonPointAxisProps & AnchorPointAxisProps & {
|
|
41
41
|
ref?: Ref<Component>;
|
|
42
42
|
as?: Component;
|
|
43
43
|
};
|
|
@@ -49,7 +49,7 @@ type AnimatedSpriteLike = Pixi.Container & {
|
|
|
49
49
|
/**
|
|
50
50
|
* Prop definition for TilingSprite (includes anchor and tiling properties)
|
|
51
51
|
*/
|
|
52
|
-
export type TilingSpriteProps<Component> =
|
|
52
|
+
export type TilingSpriteProps<Component> = PixiSolidEventHandlerMap & CommonPointAxisProps & AnchorPointAxisProps & TilingPointAxisProps & {
|
|
53
53
|
ref?: Ref<Component>;
|
|
54
54
|
as?: Component;
|
|
55
55
|
};
|
|
@@ -2,21 +2,21 @@ import type * as Pixi from "pixi.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* A SolidJS component that renders a `PIXI.AnimatedSprite`.
|
|
4
4
|
*/
|
|
5
|
-
export declare const AnimatedSprite: (props: Omit<Pixi.AnimatedSpriteOptions, "children"> & import("./bind-props").
|
|
5
|
+
export declare const AnimatedSprite: (props: Omit<Pixi.AnimatedSpriteOptions, "children"> & import("./bind-props").PixiSolidEventHandlerMap & Partial<Record<"positionX" | "positionY" | "scaleX" | "scaleY" | "pivotX" | "pivotY" | "skewX" | "skewY", number>> & Partial<Record<"anchorX" | "anchorY", number>> & {
|
|
6
6
|
ref?: import("solid-js").Ref<Pixi.AnimatedSprite> | undefined;
|
|
7
7
|
as?: Pixi.AnimatedSprite | undefined;
|
|
8
8
|
} & Pick<Pixi.AnimatedSpriteOptions, "autoUpdate">) => Pixi.AnimatedSprite & import("solid-js").JSX.Element;
|
|
9
9
|
/**
|
|
10
10
|
* A SolidJS component that renders a `PIXI.BitmapText`.
|
|
11
11
|
*/
|
|
12
|
-
export declare const BitmapText: (props: Omit<Pixi.TextOptions<Pixi.TextStyle, Pixi.TextStyleOptions>, "children"> & import("./bind-props").
|
|
12
|
+
export declare const BitmapText: (props: Omit<Pixi.TextOptions<Pixi.TextStyle, Pixi.TextStyleOptions>, "children"> & import("./bind-props").PixiSolidEventHandlerMap & Partial<Record<"positionX" | "positionY" | "scaleX" | "scaleY" | "pivotX" | "pivotY" | "skewX" | "skewY", number>> & Partial<Record<"anchorX" | "anchorY", number>> & {
|
|
13
13
|
ref?: import("solid-js").Ref<Pixi.BitmapText> | undefined;
|
|
14
14
|
as?: Pixi.BitmapText | undefined;
|
|
15
15
|
}) => Pixi.BitmapText & import("solid-js").JSX.Element;
|
|
16
16
|
/**
|
|
17
17
|
* A SolidJS component that renders a `PIXI.Container`.
|
|
18
18
|
*/
|
|
19
|
-
export declare const Container: (props: Omit<Pixi.ContainerOptions<Pixi.ContainerChild>, "children"> & import("./bind-props").
|
|
19
|
+
export declare const Container: (props: Omit<Pixi.ContainerOptions<Pixi.ContainerChild>, "children"> & import("./bind-props").PixiSolidEventHandlerMap & Partial<Record<"positionX" | "positionY" | "scaleX" | "scaleY" | "pivotX" | "pivotY" | "skewX" | "skewY", number>> & Record<string, unknown> & {
|
|
20
20
|
ref?: import("solid-js").Ref<Pixi.Container<Pixi.ContainerChild>> | undefined;
|
|
21
21
|
as?: Pixi.Container<Pixi.ContainerChild> | undefined;
|
|
22
22
|
children?: import("solid-js").JSX.Element;
|
|
@@ -29,28 +29,28 @@ export declare const Graphics: (props: Omit<Pixi.GraphicsOptions, "children"> &
|
|
|
29
29
|
/**
|
|
30
30
|
* A SolidJS component that renders a `PIXI.HTMLText`.
|
|
31
31
|
*/
|
|
32
|
-
export declare const HTMLText: (props: Omit<Pixi.HTMLTextOptions, "children"> & import("./bind-props").
|
|
32
|
+
export declare const HTMLText: (props: Omit<Pixi.HTMLTextOptions, "children"> & import("./bind-props").PixiSolidEventHandlerMap & Partial<Record<"positionX" | "positionY" | "scaleX" | "scaleY" | "pivotX" | "pivotY" | "skewX" | "skewY", number>> & Partial<Record<"anchorX" | "anchorY", number>> & {
|
|
33
33
|
ref?: import("solid-js").Ref<Pixi.HTMLText> | undefined;
|
|
34
34
|
as?: Pixi.HTMLText | undefined;
|
|
35
35
|
}) => Pixi.HTMLText & import("solid-js").JSX.Element;
|
|
36
36
|
/**
|
|
37
37
|
* A SolidJS component that renders a `PIXI.MeshPlane`.
|
|
38
38
|
*/
|
|
39
|
-
export declare const MeshPlane: (props: Omit<Pixi.MeshPlaneOptions, "children"> & import("./bind-props").
|
|
39
|
+
export declare const MeshPlane: (props: Omit<Pixi.MeshPlaneOptions, "children"> & import("./bind-props").PixiSolidEventHandlerMap & Partial<Record<"positionX" | "positionY" | "scaleX" | "scaleY" | "pivotX" | "pivotY" | "skewX" | "skewY", number>> & Partial<Record<"anchorX" | "anchorY", number>> & {
|
|
40
40
|
ref?: import("solid-js").Ref<Pixi.MeshPlane> | undefined;
|
|
41
41
|
as?: Pixi.MeshPlane | undefined;
|
|
42
42
|
}) => Pixi.MeshPlane & import("solid-js").JSX.Element;
|
|
43
43
|
/**
|
|
44
44
|
* A SolidJS component that renders a `PIXI.MeshRope`.
|
|
45
45
|
*/
|
|
46
|
-
export declare const MeshRope: (props: Omit<Pixi.MeshRopeOptions, "children"> & import("./bind-props").
|
|
46
|
+
export declare const MeshRope: (props: Omit<Pixi.MeshRopeOptions, "children"> & import("./bind-props").PixiSolidEventHandlerMap & Partial<Record<"positionX" | "positionY" | "scaleX" | "scaleY" | "pivotX" | "pivotY" | "skewX" | "skewY", number>> & Partial<Record<"anchorX" | "anchorY", number>> & {
|
|
47
47
|
ref?: import("solid-js").Ref<Pixi.MeshRope> | undefined;
|
|
48
48
|
as?: Pixi.MeshRope | undefined;
|
|
49
49
|
}) => Pixi.MeshRope & import("solid-js").JSX.Element;
|
|
50
50
|
/**
|
|
51
51
|
* A SolidJS component that renders a `PIXI.NineSliceSprite`.
|
|
52
52
|
*/
|
|
53
|
-
export declare const NineSliceSprite: (props: Omit<Pixi.NineSliceSpriteOptions, "children"> & import("./bind-props").
|
|
53
|
+
export declare const NineSliceSprite: (props: Omit<Pixi.NineSliceSpriteOptions, "children"> & import("./bind-props").PixiSolidEventHandlerMap & Partial<Record<"positionX" | "positionY" | "scaleX" | "scaleY" | "pivotX" | "pivotY" | "skewX" | "skewY", number>> & Partial<Record<"anchorX" | "anchorY", number>> & {
|
|
54
54
|
ref?: import("solid-js").Ref<Pixi.NineSliceSprite> | undefined;
|
|
55
55
|
as?: Pixi.NineSliceSprite | undefined;
|
|
56
56
|
}) => Pixi.NineSliceSprite & import("solid-js").JSX.Element;
|
|
@@ -63,14 +63,14 @@ export declare const ParticleContainer: (props: Omit<Pixi.ParticleContainerOptio
|
|
|
63
63
|
/**
|
|
64
64
|
* A SolidJS component that renders a `PIXI.PerspectiveMesh`.
|
|
65
65
|
*/
|
|
66
|
-
export declare const PerspectiveMesh: (props: Omit<Pixi.PerspectivePlaneOptions, "children"> & import("./bind-props").
|
|
66
|
+
export declare const PerspectiveMesh: (props: Omit<Pixi.PerspectivePlaneOptions, "children"> & import("./bind-props").PixiSolidEventHandlerMap & Partial<Record<"positionX" | "positionY" | "scaleX" | "scaleY" | "pivotX" | "pivotY" | "skewX" | "skewY", number>> & Partial<Record<"anchorX" | "anchorY", number>> & {
|
|
67
67
|
ref?: import("solid-js").Ref<Pixi.PerspectiveMesh> | undefined;
|
|
68
68
|
as?: Pixi.PerspectiveMesh | undefined;
|
|
69
69
|
}) => Pixi.PerspectiveMesh & import("solid-js").JSX.Element;
|
|
70
70
|
/**
|
|
71
71
|
* A SolidJS component that renders a `PIXI.RenderContainer`.
|
|
72
72
|
*/
|
|
73
|
-
export declare const RenderContainer: (props: Omit<Pixi.RenderContainerOptions, "children"> & import("./bind-props").
|
|
73
|
+
export declare const RenderContainer: (props: Omit<Pixi.RenderContainerOptions, "children"> & import("./bind-props").PixiSolidEventHandlerMap & Partial<Record<"positionX" | "positionY" | "scaleX" | "scaleY" | "pivotX" | "pivotY" | "skewX" | "skewY", number>> & Record<string, unknown> & {
|
|
74
74
|
ref?: import("solid-js").Ref<Pixi.RenderContainer> | undefined;
|
|
75
75
|
as?: Pixi.RenderContainer | undefined;
|
|
76
76
|
children?: import("solid-js").JSX.Element;
|
|
@@ -78,7 +78,7 @@ export declare const RenderContainer: (props: Omit<Pixi.RenderContainerOptions,
|
|
|
78
78
|
/**
|
|
79
79
|
* A SolidJS component that renders a `PIXI.RenderLayer`.
|
|
80
80
|
*/
|
|
81
|
-
export declare const RenderLayer: (props: Omit<Pixi.RenderLayerOptions, "children"> & import("./bind-props").
|
|
81
|
+
export declare const RenderLayer: (props: Omit<Pixi.RenderLayerOptions, "children"> & import("./bind-props").PixiSolidEventHandlerMap & Partial<Record<"positionX" | "positionY" | "scaleX" | "scaleY" | "pivotX" | "pivotY" | "skewX" | "skewY", number>> & Record<string, unknown> & {
|
|
82
82
|
ref?: import("solid-js").Ref<Pixi.RenderLayer> | undefined;
|
|
83
83
|
as?: Pixi.RenderLayer | undefined;
|
|
84
84
|
children?: import("solid-js").JSX.Element;
|
|
@@ -86,21 +86,21 @@ export declare const RenderLayer: (props: Omit<Pixi.RenderLayerOptions, "childre
|
|
|
86
86
|
/**
|
|
87
87
|
* A SolidJS component that renders a `PIXI.Sprite`.
|
|
88
88
|
*/
|
|
89
|
-
export declare const Sprite: (props: Omit<Pixi.SpriteOptions, "children"> & import("./bind-props").
|
|
89
|
+
export declare const Sprite: (props: Omit<Pixi.SpriteOptions, "children"> & import("./bind-props").PixiSolidEventHandlerMap & Partial<Record<"positionX" | "positionY" | "scaleX" | "scaleY" | "pivotX" | "pivotY" | "skewX" | "skewY", number>> & Partial<Record<"anchorX" | "anchorY", number>> & {
|
|
90
90
|
ref?: import("solid-js").Ref<Pixi.Sprite> | undefined;
|
|
91
91
|
as?: Pixi.Sprite | undefined;
|
|
92
92
|
}) => Pixi.Sprite & import("solid-js").JSX.Element;
|
|
93
93
|
/**
|
|
94
94
|
* A SolidJS component that renders a `PIXI.Text`.
|
|
95
95
|
*/
|
|
96
|
-
export declare const Text: (props: Omit<Pixi.CanvasTextOptions, "children"> & import("./bind-props").
|
|
96
|
+
export declare const Text: (props: Omit<Pixi.CanvasTextOptions, "children"> & import("./bind-props").PixiSolidEventHandlerMap & Partial<Record<"positionX" | "positionY" | "scaleX" | "scaleY" | "pivotX" | "pivotY" | "skewX" | "skewY", number>> & Partial<Record<"anchorX" | "anchorY", number>> & {
|
|
97
97
|
ref?: import("solid-js").Ref<Pixi.Text> | undefined;
|
|
98
98
|
as?: Pixi.Text | undefined;
|
|
99
99
|
}) => Pixi.Text & import("solid-js").JSX.Element;
|
|
100
100
|
/**
|
|
101
101
|
* A SolidJS component that renders a `PIXI.TilingSprite`.
|
|
102
102
|
*/
|
|
103
|
-
export declare const TilingSprite: (props: Omit<Pixi.TilingSpriteOptions, "children"> & import("./bind-props").
|
|
103
|
+
export declare const TilingSprite: (props: Omit<Pixi.TilingSpriteOptions, "children"> & import("./bind-props").PixiSolidEventHandlerMap & Partial<Record<"positionX" | "positionY" | "scaleX" | "scaleY" | "pivotX" | "pivotY" | "skewX" | "skewY", number>> & Partial<Record<"anchorX" | "anchorY", number>> & Partial<Record<"tilePositionX" | "tilePositionY" | "tileScaleX" | "tileScaleY", number>> & {
|
|
104
104
|
ref?: import("solid-js").Ref<Pixi.TilingSprite> | undefined;
|
|
105
105
|
as?: Pixi.TilingSprite | undefined;
|
|
106
106
|
}) => Pixi.TilingSprite & import("solid-js").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { AnimatedSprite, BitmapText, Container, Graphics, HTMLText, MeshPlane, MeshRope, NineSliceSprite, ParticleContainer, PerspectiveMesh, Sprite, Text, RenderContainer, RenderLayer, TilingSprite, } from "./components";
|
|
2
2
|
export { PIXI_EVENT_NAMES, PIXI_SOLID_EVENT_HANDLER_NAMES, bindRuntimeProps, bindInitialisationProps, } from "./bind-props";
|
|
3
|
-
export type {
|
|
3
|
+
export type { PixiSolidEventHandlerMap, PixiSolidEventHandlerName, PointAxisPropName, CommonPointAxisPropName, AnchorPointAxisPropName, TilingPointAxisPropName, } from "./bind-props";
|
|
4
4
|
export type { AnimatedSpriteProps, ContainerProps, LeafProps, SpriteProps, TilingSpriteProps, PixiComponentProps, CommonPointAxisProps, AnchorPointAxisProps, TilingPointAxisProps, } from "./component-factories";
|
|
5
5
|
export { createAnimatedSpriteComponent, createContainerComponent, createLeafComponent, createSpriteComponent, createTilingSpriteComponent, createFilterComponent, } from "./component-factories";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export type { AnimatedSpriteProps, ContainerProps, LeafProps, SpriteProps, TilingSpriteProps, PixiComponentProps, CommonPointAxisProps, AnchorPointAxisProps, TilingPointAxisProps,
|
|
2
|
-
export { PIXI_EVENT_NAMES, PIXI_SOLID_EVENT_HANDLER_NAMES } from "./components";
|
|
1
|
+
export type { AnimatedSpriteProps, ContainerProps, LeafProps, SpriteProps, TilingSpriteProps, PixiComponentProps, CommonPointAxisProps, AnchorPointAxisProps, TilingPointAxisProps, PointAxisPropName, CommonPointAxisPropName, AnchorPointAxisPropName, TilingPointAxisPropName, PixiSolidEventHandlerName, } from "./components";
|
|
3
2
|
export { onResize } from "./on-resize";
|
|
4
3
|
export { onTick } from "./on-tick";
|
|
5
4
|
export type { PixiApplicationProps } from "./pixi-application";
|