@zcomponent/core 2.0.0-alpha.1 → 2.0.0-alpha.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 (167) hide show
  1. package/css/zcomponent.css +121 -122
  2. package/index.js +0 -3
  3. package/lib/actionbehavior.d.ts +3 -3
  4. package/lib/actionbehavior.js +20 -19
  5. package/lib/animation/animation.d.ts +13 -6
  6. package/lib/animation/animation.js +56 -43
  7. package/lib/animation/bezier.d.ts +6 -0
  8. package/lib/animation/bezier.js +8 -2
  9. package/lib/animation/clips/clip.d.ts +13 -1
  10. package/lib/animation/clips/clip.js +34 -14
  11. package/lib/animation/index.d.ts +4 -4
  12. package/lib/animation/index.js +4 -4
  13. package/lib/animation/layer.d.ts +9 -0
  14. package/lib/animation/layer.js +33 -12
  15. package/lib/animation/layerclip.d.ts +21 -0
  16. package/lib/animation/layerclip.js +82 -45
  17. package/lib/animation/tracks/cliptrack.d.ts +18 -0
  18. package/lib/animation/tracks/cliptrack.js +27 -6
  19. package/lib/animation/tracks/functiontrack.d.ts +9 -0
  20. package/lib/animation/tracks/functiontrack.js +16 -3
  21. package/lib/animation/tracks/propertytrack.d.ts +20 -1
  22. package/lib/animation/tracks/propertytrack.js +48 -11
  23. package/lib/animation/tracks/streamtrack.d.ts +18 -0
  24. package/lib/animation/tracks/streamtrack.js +44 -7
  25. package/lib/animation/tracks/track.d.ts +8 -2
  26. package/lib/animation/tracks/track.js +3 -2
  27. package/lib/behavior.js +13 -10
  28. package/lib/behaviors/ActivateState.d.ts +22 -24
  29. package/lib/behaviors/ActivateState.js +145 -35
  30. package/lib/behaviors/CallFunction.d.ts +2 -4
  31. package/lib/behaviors/CallFunction.js +69 -11
  32. package/lib/behaviors/ChangeRootScene.d.ts +35 -0
  33. package/lib/behaviors/ChangeRootScene.js +123 -0
  34. package/lib/behaviors/ConsoleLog.d.ts +6 -5
  35. package/lib/behaviors/ConsoleLog.js +95 -12
  36. package/lib/behaviors/DownloadSnapshot.d.ts +7 -12
  37. package/lib/behaviors/DownloadSnapshot.js +70 -19
  38. package/lib/behaviors/EmitComponentPropEvent.d.ts +1 -3
  39. package/lib/behaviors/EmitComponentPropEvent.js +80 -12
  40. package/lib/behaviors/LaunchURL.d.ts +5 -5
  41. package/lib/behaviors/LaunchURL.js +92 -10
  42. package/lib/behaviors/LogAnalyticsEvent.d.ts +10 -4
  43. package/lib/behaviors/LogAnalyticsEvent.js +88 -7
  44. package/lib/behaviors/PauseLayerClip.d.ts +7 -9
  45. package/lib/behaviors/PauseLayerClip.js +89 -21
  46. package/lib/behaviors/PlayLayerClip.d.ts +35 -32
  47. package/lib/behaviors/PlayLayerClip.js +202 -48
  48. package/lib/behaviors/PlaySound.d.ts +19 -25
  49. package/lib/behaviors/PlaySound.js +122 -28
  50. package/lib/behaviors/SetLayerOff.d.ts +7 -9
  51. package/lib/behaviors/SetLayerOff.js +88 -21
  52. package/lib/behaviors/ShareSnapshot.d.ts +5 -9
  53. package/lib/behaviors/ShareSnapshot.js +70 -17
  54. package/lib/behaviors/ShowTextAlert.d.ts +16 -29
  55. package/lib/behaviors/ShowTextAlert.js +116 -48
  56. package/lib/behaviors/TakeSnapshot.d.ts +22 -26
  57. package/lib/behaviors/TakeSnapshot.js +131 -56
  58. package/lib/behaviors/ToggleLayerClips.d.ts +45 -62
  59. package/lib/behaviors/ToggleLayerClips.js +233 -64
  60. package/lib/behaviors/stream/PauseStream.d.ts +5 -16
  61. package/lib/behaviors/stream/PauseStream.js +94 -34
  62. package/lib/behaviors/stream/PlayStream.d.ts +14 -27
  63. package/lib/behaviors/stream/PlayStream.js +123 -34
  64. package/lib/behaviors/stream/SeekStream.d.ts +8 -18
  65. package/lib/behaviors/stream/SeekStream.js +97 -31
  66. package/lib/behaviors/stream/StopStream.d.ts +6 -15
  67. package/lib/behaviors/stream/StopStream.js +89 -27
  68. package/lib/component.d.ts +36 -13
  69. package/lib/component.js +237 -151
  70. package/lib/components/AnimatedLoader.d.ts +51 -0
  71. package/lib/components/AnimatedLoader.js +159 -0
  72. package/lib/components/Audio.d.ts +35 -37
  73. package/lib/components/Audio.js +264 -151
  74. package/lib/components/AudioLayerSettings.d.ts +13 -11
  75. package/lib/components/AudioLayerSettings.js +76 -18
  76. package/lib/components/Children.d.ts +2 -1
  77. package/lib/components/Children.js +66 -13
  78. package/lib/components/ConditionalConstruct.d.ts +44 -0
  79. package/lib/components/ConditionalConstruct.js +142 -0
  80. package/lib/components/DefaultCookieConsent.d.ts +53 -73
  81. package/lib/components/DefaultCookieConsent.js +382 -264
  82. package/lib/components/DefaultLoader.d.ts +40 -28
  83. package/lib/components/DefaultLoader.js +198 -46
  84. package/lib/components/Gamepad.d.ts +5 -26
  85. package/lib/components/Gamepad.js +201 -65
  86. package/lib/components/LoaderScope.d.ts +15 -0
  87. package/lib/components/LoaderScope.js +71 -0
  88. package/lib/components/LongLoad.d.ts +11 -15
  89. package/lib/components/LongLoad.js +89 -34
  90. package/lib/components/SnapshotUI.d.ts +19 -24
  91. package/lib/components/SnapshotUI.js +202 -105
  92. package/lib/context.d.ts +23 -5
  93. package/lib/context.js +12 -6
  94. package/lib/contexts/analyticscontext.d.ts +12 -2
  95. package/lib/contexts/analyticscontext.js +68 -10
  96. package/lib/contexts/audiocontextcontext.d.ts +1 -1
  97. package/lib/contexts/audiocontextcontext.js +9 -8
  98. package/lib/contexts/canvascontext.d.ts +32 -18
  99. package/lib/contexts/canvascontext.js +195 -120
  100. package/lib/contexts/cookieconsentcontext.d.ts +38 -28
  101. package/lib/contexts/cookieconsentcontext.js +35 -32
  102. package/lib/contexts/documentflagmanager.js +15 -11
  103. package/lib/contexts/environmentcontext.d.ts +22 -6
  104. package/lib/contexts/environmentcontext.js +135 -21
  105. package/lib/contexts/gamepadcontext.d.ts +29 -26
  106. package/lib/contexts/gamepadcontext.js +46 -46
  107. package/lib/contexts/gesturecontext.d.ts +31 -6
  108. package/lib/contexts/gesturecontext.js +110 -85
  109. package/lib/contexts/globaltagcontext.d.ts +1 -1
  110. package/lib/contexts/globaltagcontext.js +8 -11
  111. package/lib/contexts/loadcontext.d.ts +45 -8
  112. package/lib/contexts/loadcontext.js +232 -82
  113. package/lib/contexts/orientationcontext.d.ts +13 -15
  114. package/lib/contexts/orientationcontext.js +150 -67
  115. package/lib/contexts/rootcomponentscontext.d.ts +16 -0
  116. package/lib/contexts/rootcomponentscontext.js +65 -0
  117. package/lib/contexts/snapshotContext.d.ts +0 -3
  118. package/lib/contexts/snapshotContext.js +78 -23
  119. package/lib/contexts/tagcontext.d.ts +5 -5
  120. package/lib/contexts/tagcontext.js +16 -16
  121. package/lib/contexts/textalertcontext.d.ts +1 -5
  122. package/lib/contexts/textalertcontext.js +1 -5
  123. package/lib/contexts/usereventcontext.d.ts +1 -1
  124. package/lib/contexts/usereventcontext.js +12 -12
  125. package/lib/data/animation.d.ts +10 -2
  126. package/lib/data/change.d.ts +1 -1
  127. package/lib/data/change.js +7 -0
  128. package/lib/data/core.d.ts +9 -1
  129. package/lib/data/index.d.ts +1 -1
  130. package/lib/data/index.js +1 -1
  131. package/lib/decorators.d.ts +348 -0
  132. package/lib/decorators.js +239 -0
  133. package/lib/decoratorutils.d.ts +3 -0
  134. package/lib/decoratorutils.js +8 -0
  135. package/lib/emitter.d.ts +15 -2
  136. package/lib/emitter.js +15 -6
  137. package/lib/entity.d.ts +43 -25
  138. package/lib/entity.js +104 -71
  139. package/lib/event.d.ts +2 -1
  140. package/lib/event.js +1 -4
  141. package/lib/groups.d.ts +18 -0
  142. package/lib/groups.js +19 -0
  143. package/lib/icons.d.ts +3372 -0
  144. package/lib/icons.js +1 -0
  145. package/lib/index.d.ts +18 -13
  146. package/lib/index.js +17 -13
  147. package/lib/inflate.d.ts +7 -7
  148. package/lib/inflate.js +5 -5
  149. package/lib/observable.d.ts +9 -2
  150. package/lib/observable.js +5 -4
  151. package/lib/observe.d.ts +18 -0
  152. package/lib/observe.js +177 -0
  153. package/lib/profile.d.ts +9 -5
  154. package/lib/profile.js +27 -17
  155. package/lib/selectors.d.ts +1 -1
  156. package/lib/selectors.js +5 -4
  157. package/lib/types.d.ts +161 -19
  158. package/lib/types.js +22 -1
  159. package/lib/values/values.d.ts +7 -8
  160. package/lib/values/values.js +1 -2
  161. package/lib/values/valuesmutator.d.ts +4 -1
  162. package/lib/values/valuesmutator.js +10 -8
  163. package/lib/zcomponent.d.ts +21 -10
  164. package/lib/zcomponent.js +717 -540
  165. package/package.json +84 -67
  166. package/lib/behaviors/ChangeCursor.d.ts +0 -39
  167. package/lib/behaviors/ChangeCursor.js +0 -44
package/package.json CHANGED
@@ -1,69 +1,86 @@
1
1
  {
2
- "name": "@zcomponent/core",
3
- "version": "2.0.0-alpha.1",
4
- "description": "The core component model and built-in functionality for Mattercraft.",
5
- "author": "Zappar Limited",
6
- "license": "Proprietary",
7
- "main": "index.js",
8
- "types": "index.d.ts",
9
- "type": "module",
10
- "engines": {
11
- "node": ">=12.0.0",
12
- "browsers": "defaults"
13
- },
14
- "zexports": [
15
- "./lib/components/**/*",
16
- "./lib/behaviors/**/*",
17
- "./lib/contexts/**/*"
18
- ],
19
- "directories": {
20
- "lib": "lib"
21
- },
22
- "files": [
23
- "index.js",
24
- "index.d.ts",
25
- "lib/**/*",
26
- "css/**/*",
27
- "assets/**/*"
28
- ],
29
- "scripts": {
30
- "build": "rm -rf lib && tsc && tsc-alias",
31
- "watch": "tsc -w",
32
- "docs": "typedoc --out docs",
33
- "test": "env TS_NODE_PROJECT=\"tsconfig.testing.json\" mocha --es-module-specifier-resolution=node",
34
- "build-animation-tests": "tsc -p ./tsconfig.test.animation.json",
35
- "predocs": "npm run ctix",
36
- "ctix": "ctix build"
37
- },
38
- "devDependencies": {
39
- "@types/mocha": "^10.0.1",
40
- "mocha": "^10.2.0"
41
- },
42
- "keywords": [],
43
- "release": {
44
- "extends": "semantic-release-commit-filter",
45
- "ci": true,
46
- "branches": [
47
- "main",
48
- {
49
- "name": "beta",
50
- "channel": "beta",
51
- "prerelease": "beta"
52
- },
53
- {
54
- "name": "alpha",
55
- "channel": "alpha",
56
- "prerelease": "alpha"
57
- }
58
- ],
59
- "plugins": [
60
- "@semantic-release/commit-analyzer",
61
- "@semantic-release/release-notes-generator",
62
- "@semantic-release/changelog",
63
- "@semantic-release/npm",
64
- "@semantic-release/gitlab",
65
- "@semantic-release/git"
66
- ],
67
- "tagFormat": "@zcomponent/core@${version}"
68
- }
2
+ "name": "@zcomponent/core",
3
+ "version": "2.0.0-alpha.3",
4
+ "description": "The core component model and built-in functionality for Mattercraft.",
5
+ "author": "Zappar Limited",
6
+ "license": "Proprietary",
7
+ "main": "index.js",
8
+ "types": "index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "development": "./src/index.ts",
12
+ "types": "./index.d.ts",
13
+ "default": "./index.js"
14
+ },
15
+ "./*": {
16
+ "development": "./src/*.ts",
17
+ "types": "./lib/*.d.ts",
18
+ "default": "./lib/*.js"
19
+ },
20
+ "./lib/*": {
21
+ "development": "./src/*.ts",
22
+ "types": "./lib/*.d.ts",
23
+ "default": "./lib/*.js"
24
+ }
25
+ },
26
+ "type": "module",
27
+ "engines": {
28
+ "node": ">=12.0.0",
29
+ "browsers": "defaults"
30
+ },
31
+ "zexports": [
32
+ "./lib/components/**/*",
33
+ "./lib/behaviors/**/*",
34
+ "./lib/contexts/**/*"
35
+ ],
36
+ "directories": {
37
+ "lib": "lib"
38
+ },
39
+ "files": [
40
+ "index.js",
41
+ "index.d.ts",
42
+ "lib/**/*",
43
+ "css/**/*",
44
+ "assets/**/*"
45
+ ],
46
+ "scripts": {
47
+ "build": "rm -rf lib && tspc && tsc-alias",
48
+ "watch": "tsc -w",
49
+ "docs": "typedoc --out docs",
50
+ "test": "vitest run",
51
+ "build-animation-tests": "tsc -p ./tsconfig.test.animation.json",
52
+ "predocs": "npm run ctix",
53
+ "ctix": "ctix build"
54
+ },
55
+ "devDependencies": {
56
+ "ts-patch": "^3.3.0",
57
+ "vitest": "3.1.3"
58
+ },
59
+ "keywords": [],
60
+ "release": {
61
+ "extends": "semantic-release-commit-filter",
62
+ "ci": true,
63
+ "branches": [
64
+ "main",
65
+ {
66
+ "name": "beta",
67
+ "channel": "beta",
68
+ "prerelease": "beta"
69
+ },
70
+ {
71
+ "name": "alpha",
72
+ "channel": "alpha",
73
+ "prerelease": "alpha"
74
+ }
75
+ ],
76
+ "plugins": [
77
+ "@semantic-release/commit-analyzer",
78
+ "@semantic-release/release-notes-generator",
79
+ "@semantic-release/changelog",
80
+ "@semantic-release/npm",
81
+ "@semantic-release/gitlab",
82
+ "@semantic-release/git"
83
+ ],
84
+ "tagFormat": "@zcomponent/core@${version}"
85
+ }
69
86
  }
@@ -1,39 +0,0 @@
1
- import { ActionBehavior, ActionBehaviorConstructorProps } from '../actionbehavior';
2
- import { Component } from '../component';
3
- import { ContextManager } from '../context';
4
- import { Observable } from '../observable';
5
- /**
6
- * Enum for different cursor styles
7
- */
8
- export declare enum CursorStyle {
9
- Default = "default",
10
- Pointer = "pointer",
11
- Move = "move",
12
- Grab = "grab",
13
- Grabbing = "grabbing",
14
- Wait = "wait",
15
- Text = "text",
16
- NotAllowed = "not-allowed",
17
- ZoomIn = "zoom-in",
18
- ZoomOut = "zoom-out"
19
- }
20
- /**
21
- * Action behavior to change the cursor style.
22
- * @zbehavior
23
- * @zicon mouse
24
- * @zgroup Actions
25
- */
26
- export declare class ChangeCursor extends ActionBehavior {
27
- /**
28
- * The cursor style to apply.
29
- * @zprop
30
- * @zdefault default
31
- */
32
- cursorStyle: Observable<CursorStyle, never>;
33
- constructor(contextManager: ContextManager, instance: Component, props: ActionBehaviorConstructorProps);
34
- /**
35
- * Performs the cursor change action.
36
- * @zprop
37
- */
38
- perform(): void;
39
- }
@@ -1,44 +0,0 @@
1
- import { ActionBehavior } from '../actionbehavior';
2
- import { registerBehaviorRunAtDesignTime } from '../behavior';
3
- import { Observable } from '../observable';
4
- /**
5
- * Enum for different cursor styles
6
- */
7
- export var CursorStyle;
8
- (function (CursorStyle) {
9
- CursorStyle["Default"] = "default";
10
- CursorStyle["Pointer"] = "pointer";
11
- CursorStyle["Move"] = "move";
12
- CursorStyle["Grab"] = "grab";
13
- CursorStyle["Grabbing"] = "grabbing";
14
- CursorStyle["Wait"] = "wait";
15
- CursorStyle["Text"] = "text";
16
- CursorStyle["NotAllowed"] = "not-allowed";
17
- CursorStyle["ZoomIn"] = "zoom-in";
18
- CursorStyle["ZoomOut"] = "zoom-out";
19
- })(CursorStyle || (CursorStyle = {}));
20
- /**
21
- * Action behavior to change the cursor style.
22
- * @zbehavior
23
- * @zicon mouse
24
- * @zgroup Actions
25
- */
26
- export class ChangeCursor extends ActionBehavior {
27
- constructor(contextManager, instance, props) {
28
- super(contextManager, instance, props);
29
- /**
30
- * The cursor style to apply.
31
- * @zprop
32
- * @zdefault default
33
- */
34
- this.cursorStyle = new Observable(CursorStyle.Default);
35
- }
36
- /**
37
- * Performs the cursor change action.
38
- * @zprop
39
- */
40
- perform() {
41
- document.body.style.cursor = this.cursorStyle.value;
42
- }
43
- }
44
- registerBehaviorRunAtDesignTime(ChangeCursor);