pixi-solid 0.1.17 → 0.1.19

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.
Files changed (58) hide show
  1. package/dist/components/bind-props/bind-children.js +43 -60
  2. package/dist/components/bind-props/bind-children.js.map +1 -1
  3. package/dist/components/bind-props/bind-props.js +81 -79
  4. package/dist/components/bind-props/bind-props.js.map +1 -1
  5. package/dist/components/bind-props/event-names.js +70 -75
  6. package/dist/components/bind-props/event-names.js.map +1 -1
  7. package/dist/components/bind-props/is-event-property.js +7 -6
  8. package/dist/components/bind-props/is-event-property.js.map +1 -1
  9. package/dist/components/bind-props/point-property-names.js +47 -51
  10. package/dist/components/bind-props/point-property-names.js.map +1 -1
  11. package/dist/components/bind-props/set-point-property.js +17 -21
  12. package/dist/components/bind-props/set-point-property.js.map +1 -1
  13. package/dist/components/component-factories.js +90 -102
  14. package/dist/components/component-factories.js.map +1 -1
  15. package/dist/components/components.js +77 -35
  16. package/dist/components/components.js.map +1 -1
  17. package/dist/delay.js +71 -51
  18. package/dist/delay.js.map +1 -1
  19. package/dist/index.js +6 -36
  20. package/dist/on-resize.js +38 -22
  21. package/dist/on-resize.js.map +1 -1
  22. package/dist/on-tick.js +29 -17
  23. package/dist/on-tick.js.map +1 -1
  24. package/dist/pixi-application/context.js +7 -7
  25. package/dist/pixi-application/context.js.map +1 -1
  26. package/dist/pixi-application/get-pixi-app.js +16 -11
  27. package/dist/pixi-application/get-pixi-app.js.map +1 -1
  28. package/dist/pixi-application/get-ticker.js +20 -11
  29. package/dist/pixi-application/get-ticker.js.map +1 -1
  30. package/dist/pixi-application/pixi-application-provider.js +75 -62
  31. package/dist/pixi-application/pixi-application-provider.js.map +1 -1
  32. package/dist/pixi-application/pixi-application.js +19 -18
  33. package/dist/pixi-application/pixi-application.js.map +1 -1
  34. package/dist/pixi-canvas.js +98 -98
  35. package/dist/pixi-canvas.js.map +1 -1
  36. package/dist/types/components/bind-props/event-names.d.ts +3 -3
  37. package/dist/types/components/bind-props/index.d.ts +1 -1
  38. package/dist/types/components/bind-props/is-event-property.d.ts +2 -2
  39. package/dist/types/components/component-factories.d.ts +5 -5
  40. package/dist/types/components/components.d.ts +14 -14
  41. package/dist/types/components/index.d.ts +1 -1
  42. package/dist/types/index.d.ts +1 -2
  43. package/dist/types/testing/index.d.ts +7 -7
  44. package/dist/types/testing/index.test.d.ts +1 -0
  45. package/dist/use-pixi-screen/pixi-screen-store.js +38 -37
  46. package/dist/use-pixi-screen/pixi-screen-store.js.map +1 -1
  47. package/dist/use-pixi-screen/use-pixi-screen.js +19 -11
  48. package/dist/use-pixi-screen/use-pixi-screen.js.map +1 -1
  49. package/dist/utils/index.js +1 -6
  50. package/dist/utils/object-fit.js +51 -46
  51. package/dist/utils/object-fit.js.map +1 -1
  52. package/dist/utils/smooth-damp.js +57 -53
  53. package/dist/utils/smooth-damp.js.map +1 -1
  54. package/dist/utils/spring.js +42 -33
  55. package/dist/utils/spring.js.map +1 -1
  56. package/package.json +3 -3
  57. package/dist/index.js.map +0 -1
  58. package/dist/utils/index.js.map +0 -1
@@ -1,64 +1,47 @@
1
1
  import { children, createRenderEffect } from "solid-js";
2
- class InvalidChildTypeError extends Error {
3
- constructor(cause) {
4
- super(
5
- "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?",
6
- { cause }
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
- const bindChildrenToRenderLayer = (parent, children$1) => {
34
- const resolvedChildren = children(() => children$1);
35
- createRenderEffect((prevChildren) => {
36
- const nextChildren = resolvedChildren.toArray().filter(Boolean);
37
- try {
38
- if (prevChildren) {
39
- for (let i = 0; i < prevChildren.length; i += 1) {
40
- const child = prevChildren[i];
41
- if (nextChildren.includes(child)) continue;
42
- parent.detach(child);
43
- }
44
- }
45
- for (let i = 0; i < nextChildren.length; i += 1) {
46
- parent.attach(nextChildren[i]);
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
- export {
60
- InvalidChildTypeError,
61
- bindChildrenToContainer,
62
- bindChildrenToRenderLayer
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
- //# sourceMappingURL=bind-children.js.map
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"],"names":["children","resolveChildren"],"mappings":";AAIO,MAAM,8BAA8B,MAAM;AAAA,EAC/C,YAAY,OAAc;AACxB;AAAA,MACE;AAAA,MACA,EAAE,MAAA;AAAA,IAAM;AAEV,SAAK,OAAO;AAAA,EACd;AACF;AAEO,MAAM,0BAA0B,CAAC,QAAwBA,eAAiC;AAC/F,QAAM,mBAAmBC,SAAgB,MAAMD,UAAQ;AAEvD,QAAM,cAAc,gBAAgB;AAEpC,MAAI,CAAC,aAAa;AAChB,UAAM,IAAI,MAAM,mCAAmC;AAAA,EACrD;AAEA,qBAAmB,MAAM;AACvB,UAAM,eAAe,iBAAiB,QAAA,EAAU,OAAO,OAAO;AAE9D,QAAI;AACF,eAAS,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK,GAAG;AAC/C,eAAO,WAAW,aAAa,CAAC,GAAG,CAAC;AAAA,MACtC;AAAA,IACF,SAAS,OAAO;AACd,UAAI,iBAAiB,OAAO;AAC1B,gBAAQ,MAAM,oBAAoB,YAAY;AAC9C,cAAM,IAAI,sBAAsB,KAAK;AAAA,MACvC,OAAO;AACL,cAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAEO,MAAM,4BAA4B,CACvC,QACAA,eACS;AACT,QAAM,mBAAmBC,SAAgB,MAAMD,UAAQ;AAEvD,qBAAmB,CAAC,iBAA+C;AACjE,UAAM,eAAe,iBAAiB,QAAA,EAAU,OAAO,OAAO;AAE9D,QAAI;AACF,UAAI,cAAc;AAChB,iBAAS,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK,GAAG;AAC/C,gBAAM,QAAQ,aAAa,CAAC;AAC5B,cAAI,aAAa,SAAS,KAAK,EAAG;AAElC,iBAAO,OAAO,KAAK;AAAA,QACrB;AAAA,MACF;AAEA,eAAS,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK,GAAG;AAC/C,eAAO,OAAO,aAAa,CAAC,CAAC;AAAA,MAC/B;AAAA,IACF,SAAS,OAAO;AACd,UAAI,iBAAiB,OAAO;AAC1B,gBAAQ,MAAM,oBAAoB,YAAY;AAC9C,cAAM,IAAI,sBAAsB,KAAK;AAAA,MACvC,OAAO;AACL,cAAM;AAAA,MACR;AAAA,IACF;AAEA,WAAO;AAAA,EACT,CAAC;AACH;"}
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 { createRenderEffect, on, onCleanup } from "solid-js";
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 { isPointProperty, setPointProperty, isPointAxisProperty, setPointAxisProperty } from "./set-point-property.js";
5
- const bindRuntimeProps = (instance, props) => {
6
- createRenderEffect(() => {
7
- for (const key in props) {
8
- if (key === "as") continue;
9
- if (key === "ref") {
10
- props[key](instance);
11
- continue;
12
- } else if (key === "children") {
13
- if ("attach" in instance && "detach" in instance) {
14
- bindChildrenToRenderLayer(instance, props.children);
15
- } else {
16
- bindChildrenToContainer(instance, props.children);
17
- }
18
- continue;
19
- }
20
- if (isPointProperty(key)) {
21
- createRenderEffect(() => setPointProperty(instance, key, props[key]));
22
- continue;
23
- }
24
- if (isPointAxisProperty(key)) {
25
- createRenderEffect(() => setPointAxisProperty(instance, key, props[key]));
26
- continue;
27
- }
28
- if (isEventProperty(key)) {
29
- createRenderEffect(() => {
30
- const eventName = key.slice(2);
31
- const eventHandler = props[key];
32
- if (eventHandler) {
33
- instance.on(eventName, eventHandler);
34
- onCleanup(() => {
35
- instance.off(eventName, eventHandler);
36
- });
37
- }
38
- });
39
- continue;
40
- }
41
- if (key in instance) {
42
- createRenderEffect(() => instance[key] = props[key]);
43
- continue;
44
- }
45
- }
46
- });
47
- };
48
- const bindInitialisationProps = (instance, props) => {
49
- createRenderEffect((defer) => {
50
- for (const key in props) {
51
- if (isPointProperty(key)) {
52
- createRenderEffect(
53
- on(
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
- export {
79
- bindInitialisationProps,
80
- bindRuntimeProps
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
- //# sourceMappingURL=bind-props.js.map
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"],"names":[],"mappings":";;;;AAsBO,MAAM,mBAAmB,CAI9B,UACA,UACS;AACT,qBAAmB,MAAM;AACvB,eAAW,OAAO,OAAO;AACvB,UAAI,QAAQ,KAAM;AAElB,UAAI,QAAQ,OAAO;AAChB,cAAM,GAAG,EAAoC,QAAQ;AAEtD;AAAA,MACF,WAAW,QAAQ,YAAY;AAC7B,YAAI,YAAY,YAAY,YAAY,UAAU;AAChD,oCAA0B,UAAyC,MAAM,QAAQ;AAAA,QACnF,OAAO;AACL,kCAAwB,UAAU,MAAM,QAAQ;AAAA,QAClD;AAEA;AAAA,MACF;AAEA,UAAI,gBAAgB,GAAG,GAAG;AACxB,2BAAmB,MAAM,iBAAiB,UAAU,KAAK,MAAM,GAAG,CAAC,CAAC;AAEpE;AAAA,MACF;AAEA,UAAI,oBAAoB,GAAG,GAAG;AAC5B,2BAAmB,MAAM,qBAAqB,UAAU,KAAK,MAAM,GAAG,CAAC,CAAC;AACxE;AAAA,MACF;AAEA,UAAI,gBAAgB,GAAG,GAAG;AACxB,2BAAmB,MAAM;AACvB,gBAAM,YAAY,IAAI,MAAM,CAAC;AAC7B,gBAAM,eAAe,MAAM,GAAG;AAE9B,cAAI,cAAc;AAChB,qBAAS,GAAG,WAAW,YAAmB;AAC1C,sBAAU,MAAM;AACd,uBAAS,IAAI,WAAW,YAAmB;AAAA,YAC7C,CAAC;AAAA,UACH;AAAA,QACF,CAAC;AAED;AAAA,MACF;AAEA,UAAI,OAAO,UAAU;AACnB,2BAAmB,MAAQ,SAAiB,GAAG,IAAI,MAAM,GAAG,CAAE;AAC9D;AAAA,MACF;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAUO,MAAM,0BAA0B,CAIrC,UACA,UACS;AACT,qBAA4B,CAAC,UAAU;AACrC,eAAW,OAAO,OAAO;AACvB,UAAI,gBAAgB,GAAG,GAAG;AACxB;AAAA,UACE;AAAA,YACE,MAAM,MAAM,GAAG;AAAA,YACf,MAAM;AACJ,qBAAO,iBAAiB,UAAU,KAAK,MAAM,GAAG,CAAC;AAAA,YACnD;AAAA,YACA,EAAE,MAAA;AAAA,UAAM;AAAA,QACV;AAGF;AAAA,MACF;AAEA,UAAI,OAAO,UAAU;AACnB;AAAA,UACE;AAAA,YACE,MAAM,MAAM,GAAG;AAAA,YACf,MAAM;AACH,uBAAiB,GAAG,IAAI,MAAM,GAAG;AAAA,YACpC;AAAA,YACA,EAAE,MAAA;AAAA,UAAM;AAAA,QACV;AAAA,MAEJ;AAAA,IACF;AAEA,WAAO;AAAA,EACT,GAAG,IAAI;AAKT;"}
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,75 +1,70 @@
1
- const PIXI_EVENT_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
- ];
66
- const PIXI_SOLID_EVENT_HANDLER_NAMES = PIXI_EVENT_NAMES.map(
67
- (eventName) => `on${eventName}`
68
- );
69
- const PIXI_EVENT_HANDLER_NAME_SET = new Set(PIXI_SOLID_EVENT_HANDLER_NAMES);
70
- export {
71
- PIXI_EVENT_HANDLER_NAME_SET,
72
- PIXI_EVENT_NAMES,
73
- PIXI_SOLID_EVENT_HANDLER_NAMES
74
- };
75
- //# 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 PixiEventHandlerName = (typeof PIXI_SOLID_EVENT_HANDLER_NAMES)[number];\n\nexport type PixiEventHandlerMap = {\n [K in (typeof PIXI_EVENT_NAMES)[number] as `on${K}`]?:\n | null\n | ((...args: FederatedEventEmitterTypes[K]) => void);\n};\n\nexport const PIXI_EVENT_HANDLER_NAME_SET: Set<string> = new Set(PIXI_SOLID_EVENT_HANDLER_NAMES);\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,8BAA2C,IAAI,IAAI,8BAA8B;"}
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
- import { PIXI_EVENT_HANDLER_NAME_SET } from "./event-names.js";
2
- const isEventProperty = (name) => PIXI_EVENT_HANDLER_NAME_SET.has(name);
3
- export {
4
- isEventProperty
5
- };
6
- //# sourceMappingURL=is-event-property.js.map
1
+ import { PIXI_SOLID_EVENT_HANDLER_NAME_SET } from "./event-names.js";
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 { PixiEventHandlerName } from \"./event-names\";\nimport { PIXI_EVENT_HANDLER_NAME_SET } from \"./event-names\";\n\nexport const isEventProperty = (name: string): name is PixiEventHandlerName =>\n PIXI_EVENT_HANDLER_NAME_SET.has(name);\n"],"names":[],"mappings":";AAGO,MAAM,kBAAkB,CAAC,SAC9B,4BAA4B,IAAI,IAAI;"}
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"}
@@ -1,56 +1,52 @@
1
- const COMMON_POINT_PROP_NAMES = ["position", "scale", "pivot", "skew"];
2
- const ANCHOR_POINT_PROP_NAMES = ["anchor"];
3
- const TILING_POINT_PROP_NAMES = ["tilePosition", "tileScale"];
4
- const POINT_PROP_NAMES = [
5
- ...COMMON_POINT_PROP_NAMES,
6
- ...ANCHOR_POINT_PROP_NAMES,
7
- ...TILING_POINT_PROP_NAMES
1
+ //#region src/components/bind-props/point-property-names.ts
2
+ var COMMON_POINT_PROP_NAMES = [
3
+ "position",
4
+ "scale",
5
+ "pivot",
6
+ "skew"
8
7
  ];
9
- const POINT_PROP_NAMES_SET = new Set(POINT_PROP_NAMES);
10
- const COMMON_POINT_PROP_AXIS_NAMES = [
11
- "positionX",
12
- "positionY",
13
- "scaleX",
14
- "scaleY",
15
- "pivotX",
16
- "pivotY",
17
- "skewX",
18
- "skewY"
8
+ var ANCHOR_POINT_PROP_NAMES = ["anchor"];
9
+ var TILING_POINT_PROP_NAMES = ["tilePosition", "tileScale"];
10
+ var POINT_PROP_NAMES = [
11
+ ...COMMON_POINT_PROP_NAMES,
12
+ ...ANCHOR_POINT_PROP_NAMES,
13
+ ...TILING_POINT_PROP_NAMES
19
14
  ];
20
- const ANCHOR_POINT_PROP_AXIS_NAMES = ["anchorX", "anchorY"];
21
- const TILING_POINT_PROP_AXIS_NAMES = [
22
- "tilePositionX",
23
- "tilePositionY",
24
- "tileScaleX",
25
- "tileScaleY"
15
+ var POINT_PROP_NAMES_SET = new Set(POINT_PROP_NAMES);
16
+ var COMMON_POINT_PROP_AXIS_NAMES = [
17
+ "positionX",
18
+ "positionY",
19
+ "scaleX",
20
+ "scaleY",
21
+ "pivotX",
22
+ "pivotY",
23
+ "skewX",
24
+ "skewY"
26
25
  ];
27
- const POINT_PROP_AXIS_NAMES = [
28
- ...COMMON_POINT_PROP_AXIS_NAMES,
29
- ...ANCHOR_POINT_PROP_AXIS_NAMES,
30
- ...TILING_POINT_PROP_AXIS_NAMES
26
+ var ANCHOR_POINT_PROP_AXIS_NAMES = ["anchorX", "anchorY"];
27
+ var TILING_POINT_PROP_AXIS_NAMES = [
28
+ "tilePositionX",
29
+ "tilePositionY",
30
+ "tileScaleX",
31
+ "tileScaleY"
31
32
  ];
32
- const POINT_PROP_AXIS_NAMES_SET = new Set(POINT_PROP_AXIS_NAMES);
33
- /* @__PURE__ */ new Set([
34
- ...POINT_PROP_NAMES_SET,
35
- ...POINT_PROP_AXIS_NAMES_SET
36
- ]);
37
- const POINT_PROP_AXIS_MAP = POINT_PROP_AXIS_NAMES.reduce((map, name) => {
38
- const axisName = name[name.length - 1].toLowerCase();
39
- const propertyName = name.slice(0, -1);
40
- map.set(name, { propertyName, axisName });
41
- return map;
33
+ var POINT_PROP_AXIS_NAMES = [
34
+ ...COMMON_POINT_PROP_AXIS_NAMES,
35
+ ...ANCHOR_POINT_PROP_AXIS_NAMES,
36
+ ...TILING_POINT_PROP_AXIS_NAMES
37
+ ];
38
+ var POINT_PROP_AXIS_NAMES_SET = new Set(POINT_PROP_AXIS_NAMES);
39
+ new Set([...POINT_PROP_NAMES_SET, ...POINT_PROP_AXIS_NAMES_SET]);
40
+ var POINT_PROP_AXIS_MAP = POINT_PROP_AXIS_NAMES.reduce((map, name) => {
41
+ const axisName = name[name.length - 1].toLowerCase();
42
+ const propertyName = name.slice(0, -1);
43
+ map.set(name, {
44
+ propertyName,
45
+ axisName
46
+ });
47
+ return map;
42
48
  }, /* @__PURE__ */ new Map());
43
- export {
44
- ANCHOR_POINT_PROP_AXIS_NAMES,
45
- ANCHOR_POINT_PROP_NAMES,
46
- COMMON_POINT_PROP_AXIS_NAMES,
47
- COMMON_POINT_PROP_NAMES,
48
- POINT_PROP_AXIS_MAP,
49
- POINT_PROP_AXIS_NAMES,
50
- POINT_PROP_AXIS_NAMES_SET,
51
- POINT_PROP_NAMES,
52
- POINT_PROP_NAMES_SET,
53
- TILING_POINT_PROP_AXIS_NAMES,
54
- TILING_POINT_PROP_NAMES
55
- };
56
- //# sourceMappingURL=point-property-names.js.map
49
+ //#endregion
50
+ export { ANCHOR_POINT_PROP_AXIS_NAMES, COMMON_POINT_PROP_AXIS_NAMES, POINT_PROP_AXIS_MAP, POINT_PROP_AXIS_NAMES_SET, POINT_PROP_NAMES_SET, TILING_POINT_PROP_AXIS_NAMES };
51
+
52
+ //# sourceMappingURL=point-property-names.js.map