pixi-solid 0.1.18 → 0.1.20
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/README.md +39 -16
- package/dist/components/bind-props/bind-children.js +43 -60
- package/dist/components/bind-props/bind-children.js.map +1 -1
- package/dist/components/bind-props/bind-props.js +81 -79
- package/dist/components/bind-props/bind-props.js.map +1 -1
- package/dist/components/bind-props/event-names.js +70 -77
- package/dist/components/bind-props/event-names.js.map +1 -1
- package/dist/components/bind-props/is-event-property.js +6 -5
- package/dist/components/bind-props/is-event-property.js.map +1 -1
- package/dist/components/bind-props/point-property-names.js +47 -51
- package/dist/components/bind-props/point-property-names.js.map +1 -1
- package/dist/components/bind-props/set-point-property.js +17 -21
- package/dist/components/bind-props/set-point-property.js.map +1 -1
- package/dist/components/component-factories.js +90 -102
- package/dist/components/component-factories.js.map +1 -1
- package/dist/components/components.js +77 -35
- package/dist/components/components.js.map +1 -1
- package/dist/delay.js +71 -51
- package/dist/delay.js.map +1 -1
- package/dist/index.js +6 -33
- package/dist/on-resize.js +38 -22
- package/dist/on-resize.js.map +1 -1
- package/dist/on-tick.js +29 -17
- package/dist/on-tick.js.map +1 -1
- package/dist/pixi-application/context.js +7 -7
- package/dist/pixi-application/context.js.map +1 -1
- package/dist/pixi-application/get-pixi-app.js +16 -11
- package/dist/pixi-application/get-pixi-app.js.map +1 -1
- package/dist/pixi-application/get-ticker.js +20 -11
- package/dist/pixi-application/get-ticker.js.map +1 -1
- package/dist/pixi-application/pixi-application-provider.js +75 -62
- package/dist/pixi-application/pixi-application-provider.js.map +1 -1
- package/dist/pixi-application/pixi-application.js +19 -18
- package/dist/pixi-application/pixi-application.js.map +1 -1
- package/dist/pixi-canvas.js +98 -98
- package/dist/pixi-canvas.js.map +1 -1
- package/dist/types/components/components.d.ts +1 -1
- package/dist/types/testing/index.d.ts +7 -7
- package/dist/types/testing/index.test.d.ts +1 -0
- package/dist/use-pixi-screen/pixi-screen-store.js +38 -37
- package/dist/use-pixi-screen/pixi-screen-store.js.map +1 -1
- package/dist/use-pixi-screen/use-pixi-screen.js +19 -11
- package/dist/use-pixi-screen/use-pixi-screen.js.map +1 -1
- package/dist/utils/index.js +1 -6
- package/dist/utils/object-fit.js +51 -46
- package/dist/utils/object-fit.js.map +1 -1
- package/dist/utils/smooth-damp.js +57 -53
- package/dist/utils/smooth-damp.js.map +1 -1
- package/dist/utils/spring.js +42 -33
- package/dist/utils/spring.js.map +1 -1
- package/package.json +3 -3
- package/dist/index.js.map +0 -1
- package/dist/utils/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -14,11 +14,7 @@ A custom renderer for [PixiJS](https://pixijs.com/) that lets you build your sce
|
|
|
14
14
|
- 💫 Useful helper utilities included.
|
|
15
15
|
- 🤩 Full Typescript support for type safety and auto completion.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
### Install
|
|
17
|
+
## Install
|
|
22
18
|
|
|
23
19
|
```bash
|
|
24
20
|
npm i pixi-solid pixi.js solid-js
|
|
@@ -28,33 +24,60 @@ Peer dependencies of
|
|
|
28
24
|
|
|
29
25
|
```json
|
|
30
26
|
{
|
|
31
|
-
"pixi.js": "
|
|
32
|
-
"solid-js": "
|
|
27
|
+
"pixi.js": ">=8.14.3 <9",
|
|
28
|
+
"solid-js": ">=1.9.10 <2"
|
|
33
29
|
}
|
|
34
30
|
```
|
|
35
31
|
|
|
36
|
-
|
|
32
|
+
## Basic usage
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { PixiCanvas, Sprite } from "pixi-solid";
|
|
36
|
+
import { createSignal } from "solid-js";
|
|
37
|
+
import { Texture } from "pixi.js";
|
|
38
|
+
|
|
39
|
+
export const DemoApp = () => {
|
|
40
|
+
const [scale, setScale] = createSignal(10);
|
|
41
|
+
|
|
42
|
+
const handleSpriteTap = () => {
|
|
43
|
+
setScale((currentScale) => currentScale + 1);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<PixiCanvas style={{ width: "100%", height: "100vh" }}>
|
|
48
|
+
<Sprite
|
|
49
|
+
texture={Texture.WHITE}
|
|
50
|
+
scale={scale()}
|
|
51
|
+
onpointertap={handleSpriteTap}
|
|
52
|
+
tint="#ff0000"
|
|
53
|
+
/>
|
|
54
|
+
</PixiCanvas>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Documentation and examples
|
|
60
|
+
|
|
61
|
+
Check out the [documentation site 🧑💻](https://lukecarlthompson.github.io/pixi-solid/) for more comprehensive information and live examples.
|
|
37
62
|
|
|
38
|
-
|
|
63
|
+
## Why combine SolidJS with PixiJS?
|
|
39
64
|
|
|
40
|
-
- **Declarative PixiJS scene graph**: Using SolidJS's JSX templating means we get declarative control over the scene graph.
|
|
65
|
+
- **Declarative PixiJS scene graph**: Using SolidJS's JSX templating means we get declarative control over the scene graph. For improved separation of concerns, simpler views and more scalable projects.
|
|
41
66
|
|
|
42
|
-
- **
|
|
67
|
+
- **SolidJS hooks in our PixiJS components**: SolidJS rendering PixiJS components means we can take advantage of the built in lifecycle methods in SolidJS `onMount`, `onCleanup` as well as extra custom hooks for responsive behaviour and ticker subscriptions.
|
|
43
68
|
|
|
44
|
-
- **Shared State and Reactivity**:
|
|
69
|
+
- **Shared State and Reactivity**: HTML and PixiJS graphics can stay in sync effortlessly because they can subscribe to the same state.
|
|
45
70
|
|
|
46
|
-
- **Combine the best of both worlds**: Pixi Solid makes it easy to use HTML elements alongside a PixiJS canvas, allowing you to create rich user interfaces that combine the strengths of both technologies.
|
|
71
|
+
- **Combine the best of both worlds**: Pixi Solid makes it easy to use HTML elements alongside or on top of a PixiJS canvas, allowing you to create rich user interfaces that combine the strengths of both technologies.
|
|
47
72
|
|
|
48
73
|
- **Composability**: Pixi Solid components can be easily composed together to create complex scenes and animations out of reusable components.
|
|
49
74
|
|
|
50
75
|
- **SolidJS is a thin wrapper**: While Pixi Solid provides a nice abstraction over PixiJS it provides access to all the properties and events of PixiJS objects.
|
|
51
76
|
|
|
52
|
-
- **SolidJS is really fast**:
|
|
77
|
+
- **SolidJS is really fast**: SolidJS is one of the fastest front-end frameworks out there so the overhead is very minimal.
|
|
53
78
|
|
|
54
79
|
- **SolidJS is fully featured**: It has stores, signals, suspense, error boundaries, resource fetching and more. It's a great feature set for simple or complex applications and you won't have to reach for other libraries to manage templating or state.
|
|
55
80
|
|
|
56
|
-
---
|
|
57
|
-
|
|
58
81
|
## Contributing
|
|
59
82
|
|
|
60
83
|
Contributions are welcome! This project is still in its early stages, so feel free to open an issue to report a bug, suggest a feature, or submit a pull request.
|
|
@@ -1,64 +1,47 @@
|
|
|
1
1
|
import { children, createRenderEffect } from "solid-js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
this.name = "InvalidChildTypeError";
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
const bindChildrenToContainer = (parent, children$1) => {
|
|
12
|
-
const resolvedChildren = children(() => children$1);
|
|
13
|
-
const canAddChild = "addChildAt" in parent;
|
|
14
|
-
if (!canAddChild) {
|
|
15
|
-
throw new Error("Parent does not support children.");
|
|
16
|
-
}
|
|
17
|
-
createRenderEffect(() => {
|
|
18
|
-
const nextChildren = resolvedChildren.toArray().filter(Boolean);
|
|
19
|
-
try {
|
|
20
|
-
for (let i = 0; i < nextChildren.length; i += 1) {
|
|
21
|
-
parent.addChildAt(nextChildren[i], i);
|
|
22
|
-
}
|
|
23
|
-
} catch (error) {
|
|
24
|
-
if (error instanceof Error) {
|
|
25
|
-
console.error("Invalid children", nextChildren);
|
|
26
|
-
throw new InvalidChildTypeError(error);
|
|
27
|
-
} else {
|
|
28
|
-
throw error;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
});
|
|
2
|
+
//#region src/components/bind-props/bind-children.ts
|
|
3
|
+
var InvalidChildTypeError = class extends Error {
|
|
4
|
+
constructor(cause) {
|
|
5
|
+
super("Invalid pixi-solid child type. Children must be pixi-solid or PixiJS element. Did you accidentally pass an invalid child to a pixi-solid parent?", { cause });
|
|
6
|
+
this.name = "InvalidChildTypeError";
|
|
7
|
+
}
|
|
32
8
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
} catch (error) {
|
|
49
|
-
if (error instanceof Error) {
|
|
50
|
-
console.error("Invalid children", nextChildren);
|
|
51
|
-
throw new InvalidChildTypeError(error);
|
|
52
|
-
} else {
|
|
53
|
-
throw error;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return nextChildren;
|
|
57
|
-
});
|
|
9
|
+
var bindChildrenToContainer = (parent, children$1) => {
|
|
10
|
+
const resolvedChildren = children(() => children$1);
|
|
11
|
+
if (!("addChildAt" in parent)) throw new Error("Parent does not support children.");
|
|
12
|
+
createRenderEffect(() => {
|
|
13
|
+
const nextChildren = resolvedChildren.toArray().filter(Boolean);
|
|
14
|
+
try {
|
|
15
|
+
for (let i = 0; i < nextChildren.length; i += 1) parent.addChildAt(nextChildren[i], i);
|
|
16
|
+
} catch (error) {
|
|
17
|
+
if (error instanceof Error) {
|
|
18
|
+
console.error("Invalid children", nextChildren);
|
|
19
|
+
throw new InvalidChildTypeError(error);
|
|
20
|
+
} else throw error;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
58
23
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
24
|
+
var bindChildrenToRenderLayer = (parent, children$2) => {
|
|
25
|
+
const resolvedChildren = children(() => children$2);
|
|
26
|
+
createRenderEffect((prevChildren) => {
|
|
27
|
+
const nextChildren = resolvedChildren.toArray().filter(Boolean);
|
|
28
|
+
try {
|
|
29
|
+
if (prevChildren) for (let i = 0; i < prevChildren.length; i += 1) {
|
|
30
|
+
const child = prevChildren[i];
|
|
31
|
+
if (nextChildren.includes(child)) continue;
|
|
32
|
+
parent.detach(child);
|
|
33
|
+
}
|
|
34
|
+
for (let i = 0; i < nextChildren.length; i += 1) parent.attach(nextChildren[i]);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
if (error instanceof Error) {
|
|
37
|
+
console.error("Invalid children", nextChildren);
|
|
38
|
+
throw new InvalidChildTypeError(error);
|
|
39
|
+
} else throw error;
|
|
40
|
+
}
|
|
41
|
+
return nextChildren;
|
|
42
|
+
});
|
|
63
43
|
};
|
|
64
|
-
//#
|
|
44
|
+
//#endregion
|
|
45
|
+
export { bindChildrenToContainer, bindChildrenToRenderLayer };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=bind-children.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bind-children.js","sources":["../../../src/components/bind-props/bind-children.ts"],"sourcesContent":["import type * as Pixi from \"pixi.js\";\nimport { children as resolveChildren, createRenderEffect } from \"solid-js\";\nimport type { JSX } from \"solid-js\";\n\nexport class InvalidChildTypeError extends Error {\n constructor(cause: Error) {\n super(\n \"Invalid pixi-solid child type. Children must be pixi-solid or PixiJS element. Did you accidentally pass an invalid child to a pixi-solid parent?\",\n { cause },\n );\n this.name = \"InvalidChildTypeError\";\n }\n}\n\nexport const bindChildrenToContainer = (parent: Pixi.Container, children?: JSX.Element): void => {\n const resolvedChildren = resolveChildren(() => children);\n\n const canAddChild = \"addChildAt\" in parent;\n\n if (!canAddChild) {\n throw new Error(\"Parent does not support children.\");\n }\n\n createRenderEffect(() => {\n const nextChildren = resolvedChildren.toArray().filter(Boolean) as unknown as Pixi.Container[];\n\n try {\n for (let i = 0; i < nextChildren.length; i += 1) {\n parent.addChildAt(nextChildren[i], i);\n }\n } catch (error) {\n if (error instanceof Error) {\n console.error(\"Invalid children\", nextChildren);\n throw new InvalidChildTypeError(error);\n } else {\n throw error;\n }\n }\n });\n};\n\nexport const bindChildrenToRenderLayer = (\n parent: Pixi.RenderLayer,\n children?: JSX.Element,\n): void => {\n const resolvedChildren = resolveChildren(() => children);\n\n createRenderEffect((prevChildren: Pixi.Container[] | undefined) => {\n const nextChildren = resolvedChildren.toArray().filter(Boolean) as unknown as Pixi.Container[];\n\n try {\n if (prevChildren) {\n for (let i = 0; i < prevChildren.length; i += 1) {\n const child = prevChildren[i];\n if (nextChildren.includes(child)) continue;\n\n parent.detach(child);\n }\n }\n\n for (let i = 0; i < nextChildren.length; i += 1) {\n parent.attach(nextChildren[i]);\n }\n } catch (error) {\n if (error instanceof Error) {\n console.error(\"Invalid children\", nextChildren);\n throw new InvalidChildTypeError(error);\n } else {\n throw error;\n }\n }\n\n return nextChildren;\n });\n};\n"],"
|
|
1
|
+
{"version":3,"file":"bind-children.js","names":[],"sources":["../../../src/components/bind-props/bind-children.ts"],"sourcesContent":["import type * as Pixi from \"pixi.js\";\nimport { children as resolveChildren, createRenderEffect } from \"solid-js\";\nimport type { JSX } from \"solid-js\";\n\nexport class InvalidChildTypeError extends Error {\n constructor(cause: Error) {\n super(\n \"Invalid pixi-solid child type. Children must be pixi-solid or PixiJS element. Did you accidentally pass an invalid child to a pixi-solid parent?\",\n { cause },\n );\n this.name = \"InvalidChildTypeError\";\n }\n}\n\nexport const bindChildrenToContainer = (parent: Pixi.Container, children?: JSX.Element): void => {\n const resolvedChildren = resolveChildren(() => children);\n\n const canAddChild = \"addChildAt\" in parent;\n\n if (!canAddChild) {\n throw new Error(\"Parent does not support children.\");\n }\n\n createRenderEffect(() => {\n const nextChildren = resolvedChildren.toArray().filter(Boolean) as unknown as Pixi.Container[];\n\n try {\n for (let i = 0; i < nextChildren.length; i += 1) {\n parent.addChildAt(nextChildren[i], i);\n }\n } catch (error) {\n if (error instanceof Error) {\n console.error(\"Invalid children\", nextChildren);\n throw new InvalidChildTypeError(error);\n } else {\n throw error;\n }\n }\n });\n};\n\nexport const bindChildrenToRenderLayer = (\n parent: Pixi.RenderLayer,\n children?: JSX.Element,\n): void => {\n const resolvedChildren = resolveChildren(() => children);\n\n createRenderEffect((prevChildren: Pixi.Container[] | undefined) => {\n const nextChildren = resolvedChildren.toArray().filter(Boolean) as unknown as Pixi.Container[];\n\n try {\n if (prevChildren) {\n for (let i = 0; i < prevChildren.length; i += 1) {\n const child = prevChildren[i];\n if (nextChildren.includes(child)) continue;\n\n parent.detach(child);\n }\n }\n\n for (let i = 0; i < nextChildren.length; i += 1) {\n parent.attach(nextChildren[i]);\n }\n } catch (error) {\n if (error instanceof Error) {\n console.error(\"Invalid children\", nextChildren);\n throw new InvalidChildTypeError(error);\n } else {\n throw error;\n }\n }\n\n return nextChildren;\n });\n};\n"],"mappings":";;AAIA,IAAa,wBAAb,cAA2C,MAAM;CAC/C,YAAY,OAAc;AACxB,QACE,oJACA,EAAE,OAAO,CACV;AACD,OAAK,OAAO;;;AAIhB,IAAa,2BAA2B,QAAwB,eAAiC;CAC/F,MAAM,mBAAmB,eAAsB,WAAS;AAIxD,KAAI,EAFgB,gBAAgB,QAGlC,OAAM,IAAI,MAAM,oCAAoC;AAGtD,0BAAyB;EACvB,MAAM,eAAe,iBAAiB,SAAS,CAAC,OAAO,QAAQ;AAE/D,MAAI;AACF,QAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK,EAC5C,QAAO,WAAW,aAAa,IAAI,EAAE;WAEhC,OAAO;AACd,OAAI,iBAAiB,OAAO;AAC1B,YAAQ,MAAM,oBAAoB,aAAa;AAC/C,UAAM,IAAI,sBAAsB,MAAM;SAEtC,OAAM;;GAGV;;AAGJ,IAAa,6BACX,QACA,eACS;CACT,MAAM,mBAAmB,eAAsB,WAAS;AAExD,qBAAoB,iBAA+C;EACjE,MAAM,eAAe,iBAAiB,SAAS,CAAC,OAAO,QAAQ;AAE/D,MAAI;AACF,OAAI,aACF,MAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK,GAAG;IAC/C,MAAM,QAAQ,aAAa;AAC3B,QAAI,aAAa,SAAS,MAAM,CAAE;AAElC,WAAO,OAAO,MAAM;;AAIxB,QAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK,EAC5C,QAAO,OAAO,aAAa,GAAG;WAEzB,OAAO;AACd,OAAI,iBAAiB,OAAO;AAC1B,YAAQ,MAAM,oBAAoB,aAAa;AAC/C,UAAM,IAAI,sBAAsB,MAAM;SAEtC,OAAM;;AAIV,SAAO;GACP"}
|
|
@@ -1,82 +1,84 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { bindChildrenToRenderLayer, bindChildrenToContainer } from "./bind-children.js";
|
|
1
|
+
import { bindChildrenToContainer, bindChildrenToRenderLayer } from "./bind-children.js";
|
|
3
2
|
import { isEventProperty } from "./is-event-property.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
() => props[key],
|
|
55
|
-
() => {
|
|
56
|
-
return setPointProperty(instance, key, props[key]);
|
|
57
|
-
},
|
|
58
|
-
{ defer }
|
|
59
|
-
)
|
|
60
|
-
);
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
if (key in instance) {
|
|
64
|
-
createRenderEffect(
|
|
65
|
-
on(
|
|
66
|
-
() => props[key],
|
|
67
|
-
() => {
|
|
68
|
-
instance[key] = props[key];
|
|
69
|
-
},
|
|
70
|
-
{ defer }
|
|
71
|
-
)
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return false;
|
|
76
|
-
}, true);
|
|
3
|
+
import { isPointAxisProperty, isPointProperty, setPointAxisProperty, setPointProperty } from "./set-point-property.js";
|
|
4
|
+
import { createRenderEffect, on, onCleanup } from "solid-js";
|
|
5
|
+
//#region src/components/bind-props/bind-props.ts
|
|
6
|
+
/**
|
|
7
|
+
* Binds the props to a Pixi instance with subscriptions to maintain reactivity.
|
|
8
|
+
*
|
|
9
|
+
* This is specifically for the runtime props that can't be set at initialisation. These props will be set on the Pixi instance immediately after it is created but before rendering.
|
|
10
|
+
*
|
|
11
|
+
* @param instance The Pixi instance we want to bind the props to.
|
|
12
|
+
* @param props The props object.
|
|
13
|
+
*/
|
|
14
|
+
var bindRuntimeProps = (instance, props) => {
|
|
15
|
+
createRenderEffect(() => {
|
|
16
|
+
for (const key in props) {
|
|
17
|
+
if (key === "as") continue;
|
|
18
|
+
if (key === "ref") {
|
|
19
|
+
props[key](instance);
|
|
20
|
+
continue;
|
|
21
|
+
} else if (key === "children") {
|
|
22
|
+
if ("attach" in instance && "detach" in instance) bindChildrenToRenderLayer(instance, props.children);
|
|
23
|
+
else bindChildrenToContainer(instance, props.children);
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
if (isPointProperty(key)) {
|
|
27
|
+
createRenderEffect(() => setPointProperty(instance, key, props[key]));
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
if (isPointAxisProperty(key)) {
|
|
31
|
+
createRenderEffect(() => setPointAxisProperty(instance, key, props[key]));
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (isEventProperty(key)) {
|
|
35
|
+
createRenderEffect(() => {
|
|
36
|
+
const eventName = key.slice(2);
|
|
37
|
+
const eventHandler = props[key];
|
|
38
|
+
if (eventHandler) {
|
|
39
|
+
instance.on(eventName, eventHandler);
|
|
40
|
+
onCleanup(() => {
|
|
41
|
+
instance.off(eventName, eventHandler);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (key in instance) {
|
|
48
|
+
createRenderEffect(() => instance[key] = props[key]);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
77
53
|
};
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Binds the props to a Pixi instance with subscriptions to maintain reactivity.
|
|
56
|
+
*
|
|
57
|
+
* This is specifically for the initialisation props that can be set at the time of instance creation. These props will be passed into the Pixi class during instantiation but won't be set on the instance until they are changed again. This is to avoid side effects that can be caused by setting certain props after the instance is created, such as the AnimatedSprite's `textures` prop which stops the animation if it was already instantiated with `autoplay: true`.
|
|
58
|
+
*
|
|
59
|
+
* @param instance The Pixi instance we want to bind the props to.
|
|
60
|
+
* @param props The props object.
|
|
61
|
+
*/
|
|
62
|
+
var bindInitialisationProps = (instance, props) => {
|
|
63
|
+
createRenderEffect((defer) => {
|
|
64
|
+
for (const key in props) {
|
|
65
|
+
if (isPointProperty(key)) {
|
|
66
|
+
createRenderEffect(on(() => props[key], () => {
|
|
67
|
+
return setPointProperty(instance, key, props[key]);
|
|
68
|
+
}, { defer }));
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (key in instance) createRenderEffect(on(() => props[key], () => {
|
|
72
|
+
instance[key] = props[key];
|
|
73
|
+
}, { defer }));
|
|
74
|
+
}
|
|
75
|
+
return false;
|
|
76
|
+
}, true);
|
|
77
|
+
/**
|
|
78
|
+
* Do not throw an error here for invalid prop names because there are some initialisation props that are not available as public properties. We want to allow users to pass these props but not try to set them on the instance.
|
|
79
|
+
*/
|
|
81
80
|
};
|
|
82
|
-
//#
|
|
81
|
+
//#endregion
|
|
82
|
+
export { bindInitialisationProps, bindRuntimeProps };
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=bind-props.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bind-props.js","sources":["../../../src/components/bind-props/bind-props.ts"],"sourcesContent":["import type * as Pixi from \"pixi.js\";\nimport { createRenderEffect, onCleanup, on } from \"solid-js\";\n\nimport type { ContainerProps } from \"../component-factories\";\n\nimport { bindChildrenToContainer, bindChildrenToRenderLayer } from \"./bind-children\";\nimport { isEventProperty } from \"./is-event-property\";\nimport {\n isPointProperty,\n setPointProperty,\n isPointAxisProperty,\n setPointAxisProperty,\n} from \"./set-point-property\";\n\n/**\n * Binds the props to a Pixi instance with subscriptions to maintain reactivity.\n *\n * This is specifically for the runtime props that can't be set at initialisation. These props will be set on the Pixi instance immediately after it is created but before rendering.\n *\n * @param instance The Pixi instance we want to bind the props to.\n * @param props The props object.\n */\nexport const bindRuntimeProps = <\n InstanceType extends Pixi.Container,\n OptionsType extends ContainerProps<InstanceType>,\n>(\n instance: InstanceType,\n props: OptionsType,\n): void => {\n createRenderEffect(() => {\n for (const key in props) {\n if (key === \"as\") continue;\n\n if (key === \"ref\") {\n (props[key] as unknown as (arg: any) => void)(instance);\n\n continue;\n } else if (key === \"children\") {\n if (\"attach\" in instance && \"detach\" in instance) {\n bindChildrenToRenderLayer(instance as unknown as Pixi.RenderLayer, props.children);\n } else {\n bindChildrenToContainer(instance, props.children);\n }\n\n continue;\n }\n\n if (isPointProperty(key)) {\n createRenderEffect(() => setPointProperty(instance, key, props[key]));\n\n continue;\n }\n\n if (isPointAxisProperty(key)) {\n createRenderEffect(() => setPointAxisProperty(instance, key, props[key]));\n continue;\n }\n\n if (isEventProperty(key)) {\n createRenderEffect(() => {\n const eventName = key.slice(2);\n const eventHandler = props[key];\n\n if (eventHandler) {\n instance.on(eventName, eventHandler as any);\n onCleanup(() => {\n instance.off(eventName, eventHandler as any);\n });\n }\n });\n\n continue;\n }\n\n if (key in instance) {\n createRenderEffect(() => ((instance as any)[key] = props[key]));\n continue;\n }\n }\n });\n};\n\n/**\n * Binds the props to a Pixi instance with subscriptions to maintain reactivity.\n *\n * This is specifically for the initialisation props that can be set at the time of instance creation. These props will be passed into the Pixi class during instantiation but won't be set on the instance until they are changed again. This is to avoid side effects that can be caused by setting certain props after the instance is created, such as the AnimatedSprite's `textures` prop which stops the animation if it was already instantiated with `autoplay: true`.\n *\n * @param instance The Pixi instance we want to bind the props to.\n * @param props The props object.\n */\nexport const bindInitialisationProps = <\n InstanceType extends Pixi.Container,\n OptionsType extends ContainerProps<InstanceType>,\n>(\n instance: InstanceType,\n props: OptionsType,\n): void => {\n createRenderEffect<boolean>((defer) => {\n for (const key in props) {\n if (isPointProperty(key)) {\n createRenderEffect(\n on(\n () => props[key],\n () => {\n return setPointProperty(instance, key, props[key]);\n },\n { defer },\n ),\n );\n\n continue;\n }\n\n if (key in instance) {\n createRenderEffect(\n on(\n () => props[key],\n () => {\n (instance as any)[key] = props[key];\n },\n { defer },\n ),\n );\n }\n }\n\n return false;\n }, true);\n\n /**\n * Do not throw an error here for invalid prop names because there are some initialisation props that are not available as public properties. We want to allow users to pass these props but not try to set them on the instance.\n */\n};\n"],"
|
|
1
|
+
{"version":3,"file":"bind-props.js","names":[],"sources":["../../../src/components/bind-props/bind-props.ts"],"sourcesContent":["import type * as Pixi from \"pixi.js\";\nimport { createRenderEffect, onCleanup, on } from \"solid-js\";\n\nimport type { ContainerProps } from \"../component-factories\";\n\nimport { bindChildrenToContainer, bindChildrenToRenderLayer } from \"./bind-children\";\nimport { isEventProperty } from \"./is-event-property\";\nimport {\n isPointProperty,\n setPointProperty,\n isPointAxisProperty,\n setPointAxisProperty,\n} from \"./set-point-property\";\n\n/**\n * Binds the props to a Pixi instance with subscriptions to maintain reactivity.\n *\n * This is specifically for the runtime props that can't be set at initialisation. These props will be set on the Pixi instance immediately after it is created but before rendering.\n *\n * @param instance The Pixi instance we want to bind the props to.\n * @param props The props object.\n */\nexport const bindRuntimeProps = <\n InstanceType extends Pixi.Container,\n OptionsType extends ContainerProps<InstanceType>,\n>(\n instance: InstanceType,\n props: OptionsType,\n): void => {\n createRenderEffect(() => {\n for (const key in props) {\n if (key === \"as\") continue;\n\n if (key === \"ref\") {\n (props[key] as unknown as (arg: any) => void)(instance);\n\n continue;\n } else if (key === \"children\") {\n if (\"attach\" in instance && \"detach\" in instance) {\n bindChildrenToRenderLayer(instance as unknown as Pixi.RenderLayer, props.children);\n } else {\n bindChildrenToContainer(instance, props.children);\n }\n\n continue;\n }\n\n if (isPointProperty(key)) {\n createRenderEffect(() => setPointProperty(instance, key, props[key]));\n\n continue;\n }\n\n if (isPointAxisProperty(key)) {\n createRenderEffect(() => setPointAxisProperty(instance, key, props[key]));\n continue;\n }\n\n if (isEventProperty(key)) {\n createRenderEffect(() => {\n const eventName = key.slice(2);\n const eventHandler = props[key];\n\n if (eventHandler) {\n instance.on(eventName, eventHandler as any);\n onCleanup(() => {\n instance.off(eventName, eventHandler as any);\n });\n }\n });\n\n continue;\n }\n\n if (key in instance) {\n createRenderEffect(() => ((instance as any)[key] = props[key]));\n continue;\n }\n }\n });\n};\n\n/**\n * Binds the props to a Pixi instance with subscriptions to maintain reactivity.\n *\n * This is specifically for the initialisation props that can be set at the time of instance creation. These props will be passed into the Pixi class during instantiation but won't be set on the instance until they are changed again. This is to avoid side effects that can be caused by setting certain props after the instance is created, such as the AnimatedSprite's `textures` prop which stops the animation if it was already instantiated with `autoplay: true`.\n *\n * @param instance The Pixi instance we want to bind the props to.\n * @param props The props object.\n */\nexport const bindInitialisationProps = <\n InstanceType extends Pixi.Container,\n OptionsType extends ContainerProps<InstanceType>,\n>(\n instance: InstanceType,\n props: OptionsType,\n): void => {\n createRenderEffect<boolean>((defer) => {\n for (const key in props) {\n if (isPointProperty(key)) {\n createRenderEffect(\n on(\n () => props[key],\n () => {\n return setPointProperty(instance, key, props[key]);\n },\n { defer },\n ),\n );\n\n continue;\n }\n\n if (key in instance) {\n createRenderEffect(\n on(\n () => props[key],\n () => {\n (instance as any)[key] = props[key];\n },\n { defer },\n ),\n );\n }\n }\n\n return false;\n }, true);\n\n /**\n * Do not throw an error here for invalid prop names because there are some initialisation props that are not available as public properties. We want to allow users to pass these props but not try to set them on the instance.\n */\n};\n"],"mappings":";;;;;;;;;;;;;AAsBA,IAAa,oBAIX,UACA,UACS;AACT,0BAAyB;AACvB,OAAK,MAAM,OAAO,OAAO;AACvB,OAAI,QAAQ,KAAM;AAElB,OAAI,QAAQ,OAAO;AAChB,UAAM,KAAuC,SAAS;AAEvD;cACS,QAAQ,YAAY;AAC7B,QAAI,YAAY,YAAY,YAAY,SACtC,2BAA0B,UAAyC,MAAM,SAAS;QAElF,yBAAwB,UAAU,MAAM,SAAS;AAGnD;;AAGF,OAAI,gBAAgB,IAAI,EAAE;AACxB,6BAAyB,iBAAiB,UAAU,KAAK,MAAM,KAAK,CAAC;AAErE;;AAGF,OAAI,oBAAoB,IAAI,EAAE;AAC5B,6BAAyB,qBAAqB,UAAU,KAAK,MAAM,KAAK,CAAC;AACzE;;AAGF,OAAI,gBAAgB,IAAI,EAAE;AACxB,6BAAyB;KACvB,MAAM,YAAY,IAAI,MAAM,EAAE;KAC9B,MAAM,eAAe,MAAM;AAE3B,SAAI,cAAc;AAChB,eAAS,GAAG,WAAW,aAAoB;AAC3C,sBAAgB;AACd,gBAAS,IAAI,WAAW,aAAoB;QAC5C;;MAEJ;AAEF;;AAGF,OAAI,OAAO,UAAU;AACnB,6BAA0B,SAAkB,OAAO,MAAM,KAAM;AAC/D;;;GAGJ;;;;;;;;;;AAWJ,IAAa,2BAIX,UACA,UACS;AACT,qBAA6B,UAAU;AACrC,OAAK,MAAM,OAAO,OAAO;AACvB,OAAI,gBAAgB,IAAI,EAAE;AACxB,uBACE,SACQ,MAAM,YACN;AACJ,YAAO,iBAAiB,UAAU,KAAK,MAAM,KAAK;OAEpD,EAAE,OAAO,CACV,CACF;AAED;;AAGF,OAAI,OAAO,SACT,oBACE,SACQ,MAAM,YACN;AACH,aAAiB,OAAO,MAAM;MAEjC,EAAE,OAAO,CACV,CACF;;AAIL,SAAO;IACN,KAAK"}
|
|
@@ -1,77 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
];
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
);
|
|
72
|
-
export {
|
|
73
|
-
PIXI_EVENT_NAMES,
|
|
74
|
-
PIXI_SOLID_EVENT_HANDLER_NAMES,
|
|
75
|
-
PIXI_SOLID_EVENT_HANDLER_NAME_SET
|
|
76
|
-
};
|
|
77
|
-
//# sourceMappingURL=event-names.js.map
|
|
1
|
+
var PIXI_SOLID_EVENT_HANDLER_NAMES = [
|
|
2
|
+
"click",
|
|
3
|
+
"mousedown",
|
|
4
|
+
"mouseenter",
|
|
5
|
+
"mouseleave",
|
|
6
|
+
"mousemove",
|
|
7
|
+
"mouseout",
|
|
8
|
+
"mouseover",
|
|
9
|
+
"mouseup",
|
|
10
|
+
"mouseupoutside",
|
|
11
|
+
"pointercancel",
|
|
12
|
+
"pointerdown",
|
|
13
|
+
"pointerenter",
|
|
14
|
+
"pointerleave",
|
|
15
|
+
"pointermove",
|
|
16
|
+
"pointerout",
|
|
17
|
+
"pointerover",
|
|
18
|
+
"pointertap",
|
|
19
|
+
"pointerup",
|
|
20
|
+
"pointerupoutside",
|
|
21
|
+
"rightclick",
|
|
22
|
+
"rightdown",
|
|
23
|
+
"rightup",
|
|
24
|
+
"rightupoutside",
|
|
25
|
+
"tap",
|
|
26
|
+
"touchcancel",
|
|
27
|
+
"touchend",
|
|
28
|
+
"touchendoutside",
|
|
29
|
+
"touchmove",
|
|
30
|
+
"touchstart",
|
|
31
|
+
"wheel",
|
|
32
|
+
"globalmousemove",
|
|
33
|
+
"globalpointermove",
|
|
34
|
+
"globaltouchmove",
|
|
35
|
+
"clickcapture",
|
|
36
|
+
"mousedowncapture",
|
|
37
|
+
"mouseentercapture",
|
|
38
|
+
"mouseleavecapture",
|
|
39
|
+
"mousemovecapture",
|
|
40
|
+
"mouseoutcapture",
|
|
41
|
+
"mouseovercapture",
|
|
42
|
+
"mouseupcapture",
|
|
43
|
+
"mouseupoutsidecapture",
|
|
44
|
+
"pointercancelcapture",
|
|
45
|
+
"pointerdowncapture",
|
|
46
|
+
"pointerentercapture",
|
|
47
|
+
"pointerleavecapture",
|
|
48
|
+
"pointermovecapture",
|
|
49
|
+
"pointeroutcapture",
|
|
50
|
+
"pointerovercapture",
|
|
51
|
+
"pointertapcapture",
|
|
52
|
+
"pointerupcapture",
|
|
53
|
+
"pointerupoutsidecapture",
|
|
54
|
+
"rightclickcapture",
|
|
55
|
+
"rightdowncapture",
|
|
56
|
+
"rightupcapture",
|
|
57
|
+
"rightupoutsidecapture",
|
|
58
|
+
"tapcapture",
|
|
59
|
+
"touchcancelcapture",
|
|
60
|
+
"touchendcapture",
|
|
61
|
+
"touchendoutsidecapture",
|
|
62
|
+
"touchmovecapture",
|
|
63
|
+
"touchstartcapture",
|
|
64
|
+
"wheelcapture"
|
|
65
|
+
].map((eventName) => `on${eventName}`);
|
|
66
|
+
var PIXI_SOLID_EVENT_HANDLER_NAME_SET = new Set(PIXI_SOLID_EVENT_HANDLER_NAMES);
|
|
67
|
+
//#endregion
|
|
68
|
+
export { PIXI_SOLID_EVENT_HANDLER_NAMES, PIXI_SOLID_EVENT_HANDLER_NAME_SET };
|
|
69
|
+
|
|
70
|
+
//# 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 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"],"
|
|
1
|
+
{"version":3,"file":"event-names.js","names":[],"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"],"mappings":"AAoEA,IAAa,iCAAiC;CAjE5C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAG4C,CAAiB,KAC5D,cAAc,KAAK,YACrB;AAUD,IAAa,oCAAiD,IAAI,IAChE,+BACD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PIXI_SOLID_EVENT_HANDLER_NAME_SET } from "./event-names.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
2
|
+
//#region src/components/bind-props/is-event-property.ts
|
|
3
|
+
var isEventProperty = (name) => PIXI_SOLID_EVENT_HANDLER_NAME_SET.has(name);
|
|
4
|
+
//#endregion
|
|
5
|
+
export { isEventProperty };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=is-event-property.js.map
|
|
@@ -1 +1 @@
|
|
|
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"],"
|
|
1
|
+
{"version":3,"file":"is-event-property.js","names":[],"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"],"mappings":";;AAGA,IAAa,mBAAmB,SAC9B,kCAAkC,IAAI,KAAK"}
|