pixifact 0.1.3

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 (168) hide show
  1. package/README.md +44 -0
  2. package/dist/authoring/ActionRegistry.d.ts +10 -0
  3. package/dist/authoring/ActionRegistry.js +26 -0
  4. package/dist/authoring/ComponentPalette.d.ts +16 -0
  5. package/dist/authoring/ComponentPalette.js +50 -0
  6. package/dist/authoring/DesignToken.d.ts +16 -0
  7. package/dist/authoring/DesignToken.js +33 -0
  8. package/dist/authoring/DiffModel.d.ts +10 -0
  9. package/dist/authoring/DiffModel.js +104 -0
  10. package/dist/authoring/InspectorModel.d.ts +27 -0
  11. package/dist/authoring/InspectorModel.js +139 -0
  12. package/dist/authoring/LogicGraph.d.ts +66 -0
  13. package/dist/authoring/LogicGraph.js +184 -0
  14. package/dist/authoring/OverrideJournal.d.ts +18 -0
  15. package/dist/authoring/OverrideJournal.js +23 -0
  16. package/dist/authoring/PreferenceMemory.d.ts +21 -0
  17. package/dist/authoring/PreferenceMemory.js +39 -0
  18. package/dist/authoring/ProjectConfig.d.ts +20 -0
  19. package/dist/authoring/ProjectConfig.js +78 -0
  20. package/dist/authoring/RuntimePreview.d.ts +11 -0
  21. package/dist/authoring/RuntimePreview.js +25 -0
  22. package/dist/authoring/SceneDocument.d.ts +74 -0
  23. package/dist/authoring/SceneDocument.js +332 -0
  24. package/dist/authoring/SceneProjectState.d.ts +20 -0
  25. package/dist/authoring/SceneProjectState.js +8 -0
  26. package/dist/authoring/SceneSelection.d.ts +11 -0
  27. package/dist/authoring/SceneSelection.js +1 -0
  28. package/dist/authoring/index.d.ts +13 -0
  29. package/dist/authoring/index.js +13 -0
  30. package/dist/commands/Command.d.ts +63 -0
  31. package/dist/commands/Command.js +1 -0
  32. package/dist/commands/CommandStack.d.ts +14 -0
  33. package/dist/commands/CommandStack.js +45 -0
  34. package/dist/commands/applyCommand.d.ts +23 -0
  35. package/dist/commands/applyCommand.js +316 -0
  36. package/dist/commands/index.d.ts +4 -0
  37. package/dist/commands/index.js +4 -0
  38. package/dist/commands/utils.d.ts +17 -0
  39. package/dist/commands/utils.js +77 -0
  40. package/dist/commands/validateCommand.d.ts +12 -0
  41. package/dist/commands/validateCommand.js +285 -0
  42. package/dist/compiler/commands/index.d.ts +109 -0
  43. package/dist/compiler/commands/index.js +492 -0
  44. package/dist/compiler/compileScenes.d.ts +11 -0
  45. package/dist/compiler/compileScenes.js +220 -0
  46. package/dist/compiler/decorators.d.ts +6 -0
  47. package/dist/compiler/decorators.js +79 -0
  48. package/dist/compiler/eventRuntime.d.ts +8 -0
  49. package/dist/compiler/eventRuntime.js +29 -0
  50. package/dist/compiler/index.d.ts +14 -0
  51. package/dist/compiler/index.js +14 -0
  52. package/dist/compiler/pixiNodeSchema.d.ts +39 -0
  53. package/dist/compiler/pixiNodeSchema.js +267 -0
  54. package/dist/compiler/sceneAssetPair.d.ts +11 -0
  55. package/dist/compiler/sceneAssetPair.js +92 -0
  56. package/dist/compiler/scenePartValidation.d.ts +6 -0
  57. package/dist/compiler/scenePartValidation.js +24 -0
  58. package/dist/compiler/sceneRuntime.d.ts +13 -0
  59. package/dist/compiler/sceneRuntime.js +22 -0
  60. package/dist/compiler/sceneValidation.d.ts +48 -0
  61. package/dist/compiler/sceneValidation.js +383 -0
  62. package/dist/compiler/scriptInterfaceExtractor.d.ts +6 -0
  63. package/dist/compiler/scriptInterfaceExtractor.js +258 -0
  64. package/dist/compiler/slotRuntime.d.ts +3 -0
  65. package/dist/compiler/slotRuntime.js +17 -0
  66. package/dist/compiler/spec.d.ts +95 -0
  67. package/dist/compiler/spec.js +1 -0
  68. package/dist/compiler/templateParser.d.ts +2 -0
  69. package/dist/compiler/templateParser.js +302 -0
  70. package/dist/compiler/templateSerializer.d.ts +2 -0
  71. package/dist/compiler/templateSerializer.js +101 -0
  72. package/dist/compiler/typescriptCompiler.d.ts +2 -0
  73. package/dist/compiler/typescriptCompiler.js +494 -0
  74. package/dist/compiler-node/index.d.ts +2 -0
  75. package/dist/compiler-node/index.js +2 -0
  76. package/dist/compiler-node/vite.d.ts +8 -0
  77. package/dist/compiler-node/vite.js +21 -0
  78. package/dist/index.d.ts +6 -0
  79. package/dist/index.js +6 -0
  80. package/dist/nodes/Input.d.ts +91 -0
  81. package/dist/nodes/Input.js +352 -0
  82. package/dist/nodes/Textarea.d.ts +10 -0
  83. package/dist/nodes/Textarea.js +38 -0
  84. package/dist/nodes/components/Button.d.ts +8 -0
  85. package/dist/nodes/components/Button.js +45 -0
  86. package/dist/nodes/components/InputField.d.ts +12 -0
  87. package/dist/nodes/components/InputField.js +53 -0
  88. package/dist/nodes/components/ProgressBar.d.ts +14 -0
  89. package/dist/nodes/components/ProgressBar.js +66 -0
  90. package/dist/nodes/components/ScrollRect.d.ts +23 -0
  91. package/dist/nodes/components/ScrollRect.js +108 -0
  92. package/dist/nodes/components/Selectable.d.ts +32 -0
  93. package/dist/nodes/components/Selectable.js +153 -0
  94. package/dist/nodes/components/index.d.ts +5 -0
  95. package/dist/nodes/components/index.js +5 -0
  96. package/dist/nodes/graphics/Graphic.d.ts +14 -0
  97. package/dist/nodes/graphics/Graphic.js +47 -0
  98. package/dist/nodes/graphics/ImageGraphic.d.ts +9 -0
  99. package/dist/nodes/graphics/ImageGraphic.js +42 -0
  100. package/dist/nodes/graphics/RoundedRectGraphic.d.ts +13 -0
  101. package/dist/nodes/graphics/RoundedRectGraphic.js +65 -0
  102. package/dist/nodes/graphics/TextGraphic.d.ts +13 -0
  103. package/dist/nodes/graphics/TextGraphic.js +70 -0
  104. package/dist/nodes/graphics/index.d.ts +4 -0
  105. package/dist/nodes/graphics/index.js +4 -0
  106. package/dist/nodes/index.d.ts +3 -0
  107. package/dist/nodes/index.js +3 -0
  108. package/dist/runtime/Application.d.ts +15 -0
  109. package/dist/runtime/Application.js +67 -0
  110. package/dist/runtime/GameObject.d.ts +100 -0
  111. package/dist/runtime/GameObject.js +297 -0
  112. package/dist/runtime/GameObjectEvent.d.ts +52 -0
  113. package/dist/runtime/GameObjectEvent.js +38 -0
  114. package/dist/runtime/Transform.d.ts +32 -0
  115. package/dist/runtime/Transform.js +157 -0
  116. package/dist/runtime/component/Component.d.ts +13 -0
  117. package/dist/runtime/component/Component.js +13 -0
  118. package/dist/runtime/component/ComponentRegistry.d.ts +49 -0
  119. package/dist/runtime/component/ComponentRegistry.js +25 -0
  120. package/dist/runtime/component/Flex.d.ts +6 -0
  121. package/dist/runtime/component/Flex.js +15 -0
  122. package/dist/runtime/component/FlexGroup.d.ts +26 -0
  123. package/dist/runtime/component/FlexGroup.js +136 -0
  124. package/dist/runtime/component/GridLayout.d.ts +47 -0
  125. package/dist/runtime/component/GridLayout.js +129 -0
  126. package/dist/runtime/component/Layout.d.ts +104 -0
  127. package/dist/runtime/component/Layout.js +248 -0
  128. package/dist/runtime/component/decorators.d.ts +4 -0
  129. package/dist/runtime/component/decorators.js +52 -0
  130. package/dist/runtime/component/index.d.ts +7 -0
  131. package/dist/runtime/component/index.js +7 -0
  132. package/dist/runtime/graphics/index.d.ts +11 -0
  133. package/dist/runtime/graphics/index.js +29 -0
  134. package/dist/runtime/group/index.d.ts +39 -0
  135. package/dist/runtime/group/index.js +102 -0
  136. package/dist/runtime/image/Image.d.ts +19 -0
  137. package/dist/runtime/image/Image.js +60 -0
  138. package/dist/runtime/image/NineSliceImage.d.ts +23 -0
  139. package/dist/runtime/image/NineSliceImage.js +64 -0
  140. package/dist/runtime/image/index.d.ts +2 -0
  141. package/dist/runtime/image/index.js +2 -0
  142. package/dist/runtime/index.d.ts +9 -0
  143. package/dist/runtime/index.js +9 -0
  144. package/dist/runtime/label/Label.d.ts +11 -0
  145. package/dist/runtime/label/Label.js +26 -0
  146. package/dist/runtime/label/LabelStyle.d.ts +3 -0
  147. package/dist/runtime/label/LabelStyle.js +3 -0
  148. package/dist/runtime/label/index.d.ts +2 -0
  149. package/dist/runtime/label/index.js +2 -0
  150. package/dist/runtime/utils/index.d.ts +1 -0
  151. package/dist/runtime/utils/index.js +1 -0
  152. package/dist/runtime/utils/onlyOnceQueueMicrotask.d.ts +1 -0
  153. package/dist/runtime/utils/onlyOnceQueueMicrotask.js +12 -0
  154. package/dist/runtime/utils/setProps.d.ts +10 -0
  155. package/dist/runtime/utils/setProps.js +17 -0
  156. package/dist/scene/dsl.d.ts +25 -0
  157. package/dist/scene/dsl.js +112 -0
  158. package/dist/scene/index.d.ts +5 -0
  159. package/dist/scene/index.js +5 -0
  160. package/dist/scene/instantiate.d.ts +8 -0
  161. package/dist/scene/instantiate.js +208 -0
  162. package/dist/scene/nodesDsl.d.ts +42 -0
  163. package/dist/scene/nodesDsl.js +169 -0
  164. package/dist/scene/spec.d.ts +100 -0
  165. package/dist/scene/spec.js +1 -0
  166. package/dist/scene/templates.d.ts +21 -0
  167. package/dist/scene/templates.js +239 -0
  168. package/package.json +90 -0
@@ -0,0 +1,23 @@
1
+ import { Component } from "../../runtime/index.js";
2
+ import type { Group } from "../../runtime/index.js";
3
+ export declare class ScrollRect extends Component<Group> {
4
+ viewport?: Group;
5
+ content?: Group;
6
+ contentHeight: number;
7
+ wheelSensitivity: number;
8
+ dragEnabled: boolean;
9
+ private scrollY;
10
+ private dragging;
11
+ private dragStartY;
12
+ private dragStartScrollY;
13
+ awake(): void;
14
+ get maxScrollY(): number;
15
+ scrollTo(y: number): void;
16
+ scrollBy(deltaY: number): void;
17
+ private applyScroll;
18
+ private handleWheel;
19
+ private handlePointerDown;
20
+ private handleGlobalPointerMove;
21
+ private handlePointerUp;
22
+ onDestroy(): void;
23
+ }
@@ -0,0 +1,108 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Rectangle } from "pixi.js";
8
+ import { Component, ComponentMeta, Prop } from "../../runtime/index.js";
9
+ let ScrollRect = class ScrollRect extends Component {
10
+ viewport;
11
+ content;
12
+ contentHeight = 0;
13
+ wheelSensitivity = 1;
14
+ dragEnabled = true;
15
+ scrollY = 0;
16
+ dragging = false;
17
+ dragStartY = 0;
18
+ dragStartScrollY = 0;
19
+ awake() {
20
+ const target = this.viewport ?? this.gameObject;
21
+ target.display.eventMode = 'static';
22
+ target.display.hitArea = new Rectangle(0, 0, target.width, target.height);
23
+ target.display.on('wheel', this.handleWheel, this);
24
+ target.display.on('pointerdown', this.handlePointerDown, this);
25
+ target.display.on('globalpointermove', this.handleGlobalPointerMove, this);
26
+ target.display.on('pointerup', this.handlePointerUp, this);
27
+ target.display.on('pointerupoutside', this.handlePointerUp, this);
28
+ target.display.on('pointercancel', this.handlePointerUp, this);
29
+ this.applyScroll();
30
+ }
31
+ get maxScrollY() {
32
+ const viewport = this.viewport ?? this.gameObject;
33
+ return Math.max(0, this.contentHeight - viewport.height);
34
+ }
35
+ scrollTo(y) {
36
+ this.scrollY = Math.min(Math.max(0, y), this.maxScrollY);
37
+ this.applyScroll();
38
+ }
39
+ scrollBy(deltaY) {
40
+ this.scrollTo(this.scrollY + deltaY);
41
+ }
42
+ applyScroll() {
43
+ if (this.content) {
44
+ this.content.y = -this.scrollY;
45
+ }
46
+ }
47
+ handleWheel(event) {
48
+ if (this.maxScrollY <= 0) {
49
+ return;
50
+ }
51
+ event.preventDefault();
52
+ event.stopPropagation();
53
+ this.scrollBy(event.deltaY * this.wheelSensitivity);
54
+ }
55
+ handlePointerDown(event) {
56
+ if (!this.dragEnabled || this.maxScrollY <= 0) {
57
+ return;
58
+ }
59
+ this.dragging = true;
60
+ this.dragStartY = event.global.y;
61
+ this.dragStartScrollY = this.scrollY;
62
+ event.stopPropagation();
63
+ }
64
+ handleGlobalPointerMove(event) {
65
+ if (!this.dragging) {
66
+ return;
67
+ }
68
+ this.scrollTo(this.dragStartScrollY - (event.global.y - this.dragStartY));
69
+ event.stopPropagation();
70
+ }
71
+ handlePointerUp() {
72
+ this.dragging = false;
73
+ }
74
+ onDestroy() {
75
+ const target = this.viewport ?? this.gameObject;
76
+ target.display.off('wheel', this.handleWheel, this);
77
+ target.display.off('pointerdown', this.handlePointerDown, this);
78
+ target.display.off('globalpointermove', this.handleGlobalPointerMove, this);
79
+ target.display.off('pointerup', this.handlePointerUp, this);
80
+ target.display.off('pointerupoutside', this.handlePointerUp, this);
81
+ target.display.off('pointercancel', this.handlePointerUp, this);
82
+ }
83
+ };
84
+ __decorate([
85
+ Prop({ type: 'nodeRef', description: 'Viewport node that receives scroll input.' })
86
+ ], ScrollRect.prototype, "viewport", void 0);
87
+ __decorate([
88
+ Prop({ type: 'nodeRef', description: 'Content node moved by scroll input.' })
89
+ ], ScrollRect.prototype, "content", void 0);
90
+ __decorate([
91
+ Prop({ type: 'number', default: 0, min: 0 })
92
+ ], ScrollRect.prototype, "contentHeight", void 0);
93
+ __decorate([
94
+ Prop({ type: 'number', default: 1 })
95
+ ], ScrollRect.prototype, "wheelSensitivity", void 0);
96
+ __decorate([
97
+ Prop({ type: 'boolean', default: true })
98
+ ], ScrollRect.prototype, "dragEnabled", void 0);
99
+ ScrollRect = __decorate([
100
+ ComponentMeta({
101
+ type: 'ui.ScrollRect',
102
+ displayName: 'Scroll Rect',
103
+ category: 'UI/Interaction',
104
+ description: 'Moves a content node inside a viewport using wheel and drag input.',
105
+ disallowMultiple: true,
106
+ })
107
+ ], ScrollRect);
108
+ export { ScrollRect };
@@ -0,0 +1,32 @@
1
+ import { Component } from "../../runtime/index.js";
2
+ import type { FederatedPointerEvent } from "pixi.js";
3
+ import type { Group } from "../../runtime/index.js";
4
+ import type { RoundedRectGraphic } from "../graphics/index.js";
5
+ export declare enum SelectionState {
6
+ Normal = "normal",
7
+ Highlighted = "highlighted",
8
+ Pressed = "pressed",
9
+ Disabled = "disabled"
10
+ }
11
+ export declare class Selectable extends Component<Group> {
12
+ interactable: boolean;
13
+ targetGraphic?: RoundedRectGraphic;
14
+ transition: 'none' | 'colorTint' | 'scale';
15
+ normalColor: number;
16
+ highlightedColor: number;
17
+ pressedColor: number;
18
+ disabledColor: number;
19
+ pressedScale: number;
20
+ protected hovered: boolean;
21
+ protected pressed: boolean;
22
+ awake(): void;
23
+ protected handlePointerOver(_event: FederatedPointerEvent): void;
24
+ protected handlePointerOut(_event: FederatedPointerEvent): void;
25
+ protected handlePointerDown(_event: FederatedPointerEvent): void;
26
+ protected handlePointerUp(_event: FederatedPointerEvent): void;
27
+ protected handlePointerCancel(_event: FederatedPointerEvent): void;
28
+ protected get state(): SelectionState;
29
+ protected applyState(): void;
30
+ private get currentColor();
31
+ onDestroy(): void;
32
+ }
@@ -0,0 +1,153 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Component, ComponentMeta, Prop } from "../../runtime/index.js";
8
+ export var SelectionState;
9
+ (function (SelectionState) {
10
+ SelectionState["Normal"] = "normal";
11
+ SelectionState["Highlighted"] = "highlighted";
12
+ SelectionState["Pressed"] = "pressed";
13
+ SelectionState["Disabled"] = "disabled";
14
+ })(SelectionState || (SelectionState = {}));
15
+ let Selectable = class Selectable extends Component {
16
+ interactable = true;
17
+ targetGraphic;
18
+ transition = 'colorTint';
19
+ normalColor = 0x2563eb;
20
+ highlightedColor = 0x1d4ed8;
21
+ pressedColor = 0x1e40af;
22
+ disabledColor = 0x94a3b8;
23
+ pressedScale = 0.96;
24
+ hovered = false;
25
+ pressed = false;
26
+ awake() {
27
+ this.gameObject.display.eventMode = this.interactable ? 'static' : 'none';
28
+ this.gameObject.display.cursor = this.interactable ? 'pointer' : 'default';
29
+ this.gameObject.display.on('pointerover', this.handlePointerOver, this);
30
+ this.gameObject.display.on('pointerout', this.handlePointerOut, this);
31
+ this.gameObject.display.on('pointerdown', this.handlePointerDown, this);
32
+ this.gameObject.display.on('pointerup', this.handlePointerUp, this);
33
+ this.gameObject.display.on('pointerupoutside', this.handlePointerCancel, this);
34
+ this.gameObject.display.on('pointercancel', this.handlePointerCancel, this);
35
+ this.applyState();
36
+ }
37
+ handlePointerOver(_event) {
38
+ if (!this.interactable) {
39
+ return;
40
+ }
41
+ this.hovered = true;
42
+ this.applyState();
43
+ }
44
+ handlePointerOut(_event) {
45
+ this.hovered = false;
46
+ this.pressed = false;
47
+ this.applyState();
48
+ }
49
+ handlePointerDown(_event) {
50
+ if (!this.interactable) {
51
+ return;
52
+ }
53
+ this.pressed = true;
54
+ this.applyState();
55
+ }
56
+ handlePointerUp(_event) {
57
+ if (!this.interactable) {
58
+ return;
59
+ }
60
+ this.pressed = false;
61
+ this.applyState();
62
+ }
63
+ handlePointerCancel(_event) {
64
+ this.pressed = false;
65
+ this.applyState();
66
+ }
67
+ get state() {
68
+ if (!this.interactable) {
69
+ return SelectionState.Disabled;
70
+ }
71
+ if (this.pressed) {
72
+ return SelectionState.Pressed;
73
+ }
74
+ if (this.hovered) {
75
+ return SelectionState.Highlighted;
76
+ }
77
+ return SelectionState.Normal;
78
+ }
79
+ applyState() {
80
+ this.gameObject.display.eventMode = this.interactable ? 'static' : 'none';
81
+ this.gameObject.display.cursor = this.interactable ? 'pointer' : 'default';
82
+ if (this.transition === 'colorTint' && this.targetGraphic) {
83
+ this.targetGraphic.color = this.currentColor;
84
+ this.targetGraphic.setDirty();
85
+ }
86
+ if (this.transition === 'scale') {
87
+ const scale = this.state === SelectionState.Pressed ? this.pressedScale : 1;
88
+ this.gameObject.scaleX = scale;
89
+ this.gameObject.scaleY = scale;
90
+ }
91
+ }
92
+ get currentColor() {
93
+ switch (this.state) {
94
+ case SelectionState.Disabled:
95
+ return this.disabledColor;
96
+ case SelectionState.Pressed:
97
+ return this.pressedColor;
98
+ case SelectionState.Highlighted:
99
+ return this.highlightedColor;
100
+ default:
101
+ return this.normalColor;
102
+ }
103
+ }
104
+ onDestroy() {
105
+ this.gameObject.display.off('pointerover', this.handlePointerOver, this);
106
+ this.gameObject.display.off('pointerout', this.handlePointerOut, this);
107
+ this.gameObject.display.off('pointerdown', this.handlePointerDown, this);
108
+ this.gameObject.display.off('pointerup', this.handlePointerUp, this);
109
+ this.gameObject.display.off('pointerupoutside', this.handlePointerCancel, this);
110
+ this.gameObject.display.off('pointercancel', this.handlePointerCancel, this);
111
+ }
112
+ };
113
+ __decorate([
114
+ Prop({ type: 'boolean', default: true })
115
+ ], Selectable.prototype, "interactable", void 0);
116
+ __decorate([
117
+ Prop({
118
+ type: 'componentRef',
119
+ component: 'ui.Graphic',
120
+ description: 'Graphic changed by this selectable transition.',
121
+ })
122
+ ], Selectable.prototype, "targetGraphic", void 0);
123
+ __decorate([
124
+ Prop({
125
+ type: 'enum',
126
+ default: 'colorTint',
127
+ options: ['none', 'colorTint', 'scale'],
128
+ })
129
+ ], Selectable.prototype, "transition", void 0);
130
+ __decorate([
131
+ Prop({ type: 'color', default: 0x2563eb })
132
+ ], Selectable.prototype, "normalColor", void 0);
133
+ __decorate([
134
+ Prop({ type: 'color', default: 0x1d4ed8 })
135
+ ], Selectable.prototype, "highlightedColor", void 0);
136
+ __decorate([
137
+ Prop({ type: 'color', default: 0x1e40af })
138
+ ], Selectable.prototype, "pressedColor", void 0);
139
+ __decorate([
140
+ Prop({ type: 'color', default: 0x94a3b8 })
141
+ ], Selectable.prototype, "disabledColor", void 0);
142
+ __decorate([
143
+ Prop({ type: 'number', default: 0.96, min: 0 })
144
+ ], Selectable.prototype, "pressedScale", void 0);
145
+ Selectable = __decorate([
146
+ ComponentMeta({
147
+ type: 'ui.Selectable',
148
+ displayName: 'Selectable',
149
+ category: 'UI/Interaction',
150
+ description: 'Base class for pointer-driven selectable controls.',
151
+ })
152
+ ], Selectable);
153
+ export { Selectable };
@@ -0,0 +1,5 @@
1
+ export * from './Selectable.js';
2
+ export { Button as ButtonComponent } from './Button.js';
3
+ export * from './ProgressBar.js';
4
+ export * from './ScrollRect.js';
5
+ export * from './InputField.js';
@@ -0,0 +1,5 @@
1
+ export * from './Selectable.js';
2
+ export { Button as ButtonComponent } from './Button.js';
3
+ export * from './ProgressBar.js';
4
+ export * from './ScrollRect.js';
5
+ export * from './InputField.js';
@@ -0,0 +1,14 @@
1
+ import { Container } from "pixi.js";
2
+ import { Component } from "../../runtime/index.js";
3
+ import type { Group } from "../../runtime/index.js";
4
+ export declare abstract class Graphic<TDisplay extends Container = Container> extends Component<Group> {
5
+ display: TDisplay;
6
+ private _dirty;
7
+ raycastTarget: boolean;
8
+ awake(): void;
9
+ protected abstract createDisplay(): void;
10
+ protected abstract redraw(): void;
11
+ setDirty(): void;
12
+ private redrawNow;
13
+ onDestroy(): void;
14
+ }
@@ -0,0 +1,47 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Component, ComponentMeta, Prop } from "../../runtime/index.js";
8
+ let Graphic = class Graphic extends Component {
9
+ display;
10
+ _dirty = true;
11
+ raycastTarget = true;
12
+ awake() {
13
+ this.createDisplay();
14
+ this.gameObject.display.addChild(this.display);
15
+ this.redrawNow();
16
+ }
17
+ setDirty() {
18
+ this._dirty = true;
19
+ this.redrawNow();
20
+ }
21
+ redrawNow() {
22
+ if (!this._dirty || !this.display) {
23
+ return;
24
+ }
25
+ this._dirty = false;
26
+ this.redraw();
27
+ }
28
+ onDestroy() {
29
+ this.display?.destroy();
30
+ }
31
+ };
32
+ __decorate([
33
+ Prop({
34
+ type: 'boolean',
35
+ default: true,
36
+ description: 'Whether this graphic can be used as an interaction raycast target.',
37
+ })
38
+ ], Graphic.prototype, "raycastTarget", void 0);
39
+ Graphic = __decorate([
40
+ ComponentMeta({
41
+ type: 'ui.Graphic',
42
+ displayName: 'Graphic',
43
+ category: 'UI/Graphic',
44
+ description: 'Base class for renderable UI graphics.',
45
+ })
46
+ ], Graphic);
47
+ export { Graphic };
@@ -0,0 +1,9 @@
1
+ import { Sprite } from "pixi.js";
2
+ import { Graphic } from "./Graphic.js";
3
+ export declare class ImageGraphic extends Graphic<Sprite> {
4
+ src: string;
5
+ tint: number;
6
+ protected createDisplay(): void;
7
+ protected redraw(): void;
8
+ onDestroy(): void;
9
+ }
@@ -0,0 +1,42 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Sprite, Texture } from "pixi.js";
8
+ import { ComponentMeta, GameObject, Prop } from "../../runtime/index.js";
9
+ import { Graphic } from "./Graphic.js";
10
+ let ImageGraphic = class ImageGraphic extends Graphic {
11
+ src = '';
12
+ tint = 0xffffff;
13
+ createDisplay() {
14
+ this.display = new Sprite(Texture.EMPTY);
15
+ this.gameObject.emitter.on(GameObject.Event.RESIZE, this.setDirty, this);
16
+ }
17
+ redraw() {
18
+ this.display.texture = this.src ? Texture.from(this.src) : Texture.EMPTY;
19
+ this.display.width = this.gameObject.width;
20
+ this.display.height = this.gameObject.height;
21
+ this.display.tint = this.tint;
22
+ }
23
+ onDestroy() {
24
+ this.gameObject.emitter.off(GameObject.Event.RESIZE, this.setDirty, this);
25
+ super.onDestroy();
26
+ }
27
+ };
28
+ __decorate([
29
+ Prop({ type: 'assetRef', default: '', assetType: 'image' })
30
+ ], ImageGraphic.prototype, "src", void 0);
31
+ __decorate([
32
+ Prop({ type: 'color', default: 0xffffff })
33
+ ], ImageGraphic.prototype, "tint", void 0);
34
+ ImageGraphic = __decorate([
35
+ ComponentMeta({
36
+ type: 'ui.ImageGraphic',
37
+ displayName: 'Image',
38
+ category: 'UI/Graphic',
39
+ description: 'Draws an image sprite using the host group logical size.',
40
+ })
41
+ ], ImageGraphic);
42
+ export { ImageGraphic };
@@ -0,0 +1,13 @@
1
+ import { Graphics as PixiGraphics } from "pixi.js";
2
+ import { Graphic } from "./Graphic.js";
3
+ export declare class RoundedRectGraphic extends Graphic<PixiGraphics> {
4
+ color: number;
5
+ fillAlpha: number;
6
+ radius: number;
7
+ strokeColor: number;
8
+ strokeWidth: number;
9
+ strokeAlpha: number;
10
+ protected createDisplay(): void;
11
+ protected redraw(): void;
12
+ onDestroy(): void;
13
+ }
@@ -0,0 +1,65 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Graphics as PixiGraphics } from "pixi.js";
8
+ import { ComponentMeta, GameObject, Prop } from "../../runtime/index.js";
9
+ import { Graphic } from "./Graphic.js";
10
+ let RoundedRectGraphic = class RoundedRectGraphic extends Graphic {
11
+ color = 0xffffff;
12
+ fillAlpha = 1;
13
+ radius = 0;
14
+ strokeColor = 0x000000;
15
+ strokeWidth = 0;
16
+ strokeAlpha = 1;
17
+ createDisplay() {
18
+ this.display = new PixiGraphics();
19
+ this.gameObject.emitter.on(GameObject.Event.RESIZE, this.setDirty, this);
20
+ }
21
+ redraw() {
22
+ this.display.clear();
23
+ this.display
24
+ .roundRect(0, 0, this.gameObject.width, this.gameObject.height, this.radius)
25
+ .fill({ color: this.color, alpha: this.fillAlpha });
26
+ if (this.strokeWidth > 0) {
27
+ this.display.stroke({
28
+ width: this.strokeWidth,
29
+ color: this.strokeColor,
30
+ alpha: this.strokeAlpha,
31
+ });
32
+ }
33
+ }
34
+ onDestroy() {
35
+ this.gameObject.emitter.off(GameObject.Event.RESIZE, this.setDirty, this);
36
+ super.onDestroy();
37
+ }
38
+ };
39
+ __decorate([
40
+ Prop({ type: 'color', default: 0xffffff })
41
+ ], RoundedRectGraphic.prototype, "color", void 0);
42
+ __decorate([
43
+ Prop({ type: 'number', default: 1, min: 0, max: 1 })
44
+ ], RoundedRectGraphic.prototype, "fillAlpha", void 0);
45
+ __decorate([
46
+ Prop({ type: 'number', default: 0, min: 0 })
47
+ ], RoundedRectGraphic.prototype, "radius", void 0);
48
+ __decorate([
49
+ Prop({ type: 'color', default: 0x000000 })
50
+ ], RoundedRectGraphic.prototype, "strokeColor", void 0);
51
+ __decorate([
52
+ Prop({ type: 'number', default: 0, min: 0 })
53
+ ], RoundedRectGraphic.prototype, "strokeWidth", void 0);
54
+ __decorate([
55
+ Prop({ type: 'number', default: 1, min: 0, max: 1 })
56
+ ], RoundedRectGraphic.prototype, "strokeAlpha", void 0);
57
+ RoundedRectGraphic = __decorate([
58
+ ComponentMeta({
59
+ type: 'ui.RoundedRectGraphic',
60
+ displayName: 'Rounded Rect',
61
+ category: 'UI/Graphic',
62
+ description: 'Draws a rounded rectangle using the host group logical size.',
63
+ })
64
+ ], RoundedRectGraphic);
65
+ export { RoundedRectGraphic };
@@ -0,0 +1,13 @@
1
+ import { Text } from "pixi.js";
2
+ import type { TextStyleFontWeight } from "pixi.js";
3
+ import { Graphic } from "./Graphic.js";
4
+ export declare class TextGraphic extends Graphic<Text> {
5
+ text: string;
6
+ color: number;
7
+ fontSize: number;
8
+ fontFamily: string | string[];
9
+ fontWeight: TextStyleFontWeight;
10
+ center: boolean;
11
+ protected createDisplay(): void;
12
+ protected redraw(): void;
13
+ }
@@ -0,0 +1,70 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Text } from "pixi.js";
8
+ import { ComponentMeta, Prop } from "../../runtime/index.js";
9
+ import { Graphic } from "./Graphic.js";
10
+ let TextGraphic = class TextGraphic extends Graphic {
11
+ text = '';
12
+ color = 0x000000;
13
+ fontSize = 14;
14
+ fontFamily = 'Arial';
15
+ fontWeight = 'normal';
16
+ center = false;
17
+ createDisplay() {
18
+ this.display = new Text();
19
+ }
20
+ redraw() {
21
+ this.display.text = this.text;
22
+ this.display.style = {
23
+ fill: this.color,
24
+ fontFamily: this.fontFamily,
25
+ fontSize: this.fontSize,
26
+ fontWeight: this.fontWeight,
27
+ };
28
+ if (this.center) {
29
+ this.display.anchor.set(0.5);
30
+ this.display.x = this.gameObject.width / 2;
31
+ this.display.y = this.gameObject.height / 2;
32
+ }
33
+ else {
34
+ this.display.anchor.set(0);
35
+ this.display.x = 0;
36
+ this.display.y = 0;
37
+ }
38
+ }
39
+ };
40
+ __decorate([
41
+ Prop({ type: 'string', default: '' })
42
+ ], TextGraphic.prototype, "text", void 0);
43
+ __decorate([
44
+ Prop({ type: 'color', default: 0x000000 })
45
+ ], TextGraphic.prototype, "color", void 0);
46
+ __decorate([
47
+ Prop({ type: 'number', default: 14, min: 1 })
48
+ ], TextGraphic.prototype, "fontSize", void 0);
49
+ __decorate([
50
+ Prop({ type: 'string', default: 'Arial' })
51
+ ], TextGraphic.prototype, "fontFamily", void 0);
52
+ __decorate([
53
+ Prop({
54
+ type: 'enum',
55
+ default: 'normal',
56
+ options: ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
57
+ })
58
+ ], TextGraphic.prototype, "fontWeight", void 0);
59
+ __decorate([
60
+ Prop({ type: 'boolean', default: false })
61
+ ], TextGraphic.prototype, "center", void 0);
62
+ TextGraphic = __decorate([
63
+ ComponentMeta({
64
+ type: 'ui.TextGraphic',
65
+ displayName: 'Text',
66
+ category: 'UI/Graphic',
67
+ description: 'Draws a text label on the host group.',
68
+ })
69
+ ], TextGraphic);
70
+ export { TextGraphic };
@@ -0,0 +1,4 @@
1
+ export * from './Graphic.js';
2
+ export * from './ImageGraphic.js';
3
+ export * from './RoundedRectGraphic.js';
4
+ export * from './TextGraphic.js';
@@ -0,0 +1,4 @@
1
+ export * from './Graphic.js';
2
+ export * from './ImageGraphic.js';
3
+ export * from './RoundedRectGraphic.js';
4
+ export * from './TextGraphic.js';
@@ -0,0 +1,3 @@
1
+ export * from './Input.js';
2
+ export * from './Textarea.js';
3
+ export * from './components/index.js';
@@ -0,0 +1,3 @@
1
+ export * from './Input.js';
2
+ export * from './Textarea.js';
3
+ export * from './components/index.js';
@@ -0,0 +1,15 @@
1
+ import * as PIXI from 'pixi.js';
2
+ import type { RendererDestroyOptions, DestroyOptions } from 'pixi.js';
3
+ import { GameObject } from './GameObject.js';
4
+ import { Group } from './group/index.js';
5
+ export declare class Application extends PIXI.Application {
6
+ root: Group;
7
+ private updateTargets;
8
+ private isUpdateTickerRegistered;
9
+ private updateGameObjects;
10
+ init(options?: Partial<PIXI.ApplicationOptions>): Promise<void>;
11
+ registerUpdateTarget(target: GameObject): void;
12
+ unregisterUpdateTarget(target: GameObject): void;
13
+ private syncUpdateTicker;
14
+ destroy(rendererDestroyOptions?: RendererDestroyOptions, options?: DestroyOptions): void;
15
+ }