@dcl/protocol 1.0.0-6314457636.commit-a9a962a → 1.0.0-6473373363.commit-d038938

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.
@@ -0,0 +1,134 @@
1
+ /* eslint-disable */
2
+ import _m0 from "protobufjs/minimal";
3
+ import { PBTween } from "./tween.gen";
4
+
5
+ export const protobufPackage = "decentraland.sdk.components";
6
+
7
+ export enum TweenLoop {
8
+ TL_RESTART = 0,
9
+ TL_YOYO = 1,
10
+ UNRECOGNIZED = -1,
11
+ }
12
+
13
+ export function tweenLoopFromJSON(object: any): TweenLoop {
14
+ switch (object) {
15
+ case 0:
16
+ case "TL_RESTART":
17
+ return TweenLoop.TL_RESTART;
18
+ case 1:
19
+ case "TL_YOYO":
20
+ return TweenLoop.TL_YOYO;
21
+ case -1:
22
+ case "UNRECOGNIZED":
23
+ default:
24
+ return TweenLoop.UNRECOGNIZED;
25
+ }
26
+ }
27
+
28
+ export function tweenLoopToJSON(object: TweenLoop): string {
29
+ switch (object) {
30
+ case TweenLoop.TL_RESTART:
31
+ return "TL_RESTART";
32
+ case TweenLoop.TL_YOYO:
33
+ return "TL_YOYO";
34
+ case TweenLoop.UNRECOGNIZED:
35
+ default:
36
+ return "UNRECOGNIZED";
37
+ }
38
+ }
39
+
40
+ export interface PBTweenSequence {
41
+ sequence: PBTween[];
42
+ loop?: TweenLoop | undefined;
43
+ }
44
+
45
+ function createBasePBTweenSequence(): PBTweenSequence {
46
+ return { sequence: [], loop: undefined };
47
+ }
48
+
49
+ export namespace PBTweenSequence {
50
+ export function encode(message: PBTweenSequence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
51
+ for (const v of message.sequence) {
52
+ PBTween.encode(v!, writer.uint32(10).fork()).ldelim();
53
+ }
54
+ if (message.loop !== undefined) {
55
+ writer.uint32(16).int32(message.loop);
56
+ }
57
+ return writer;
58
+ }
59
+
60
+ export function decode(input: _m0.Reader | Uint8Array, length?: number): PBTweenSequence {
61
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
62
+ let end = length === undefined ? reader.len : reader.pos + length;
63
+ const message = createBasePBTweenSequence();
64
+ while (reader.pos < end) {
65
+ const tag = reader.uint32();
66
+ switch (tag >>> 3) {
67
+ case 1:
68
+ if (tag !== 10) {
69
+ break;
70
+ }
71
+
72
+ message.sequence.push(PBTween.decode(reader, reader.uint32()));
73
+ continue;
74
+ case 2:
75
+ if (tag !== 16) {
76
+ break;
77
+ }
78
+
79
+ message.loop = reader.int32() as any;
80
+ continue;
81
+ }
82
+ if ((tag & 7) === 4 || tag === 0) {
83
+ break;
84
+ }
85
+ reader.skipType(tag & 7);
86
+ }
87
+ return message;
88
+ }
89
+
90
+ export function fromJSON(object: any): PBTweenSequence {
91
+ return {
92
+ sequence: Array.isArray(object?.sequence) ? object.sequence.map((e: any) => PBTween.fromJSON(e)) : [],
93
+ loop: isSet(object.loop) ? tweenLoopFromJSON(object.loop) : undefined,
94
+ };
95
+ }
96
+
97
+ export function toJSON(message: PBTweenSequence): unknown {
98
+ const obj: any = {};
99
+ if (message.sequence) {
100
+ obj.sequence = message.sequence.map((e) => e ? PBTween.toJSON(e) : undefined);
101
+ } else {
102
+ obj.sequence = [];
103
+ }
104
+ message.loop !== undefined && (obj.loop = message.loop !== undefined ? tweenLoopToJSON(message.loop) : undefined);
105
+ return obj;
106
+ }
107
+
108
+ export function create<I extends Exact<DeepPartial<PBTweenSequence>, I>>(base?: I): PBTweenSequence {
109
+ return PBTweenSequence.fromPartial(base ?? {});
110
+ }
111
+
112
+ export function fromPartial<I extends Exact<DeepPartial<PBTweenSequence>, I>>(object: I): PBTweenSequence {
113
+ const message = createBasePBTweenSequence();
114
+ message.sequence = object.sequence?.map((e) => PBTween.fromPartial(e)) || [];
115
+ message.loop = object.loop ?? undefined;
116
+ return message;
117
+ }
118
+ }
119
+
120
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
121
+
122
+ export type DeepPartial<T> = T extends Builtin ? T
123
+ : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
124
+ : T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
125
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
126
+ : Partial<T>;
127
+
128
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
129
+ export type Exact<P, I extends P> = P extends Builtin ? P
130
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
131
+
132
+ function isSet(value: any): boolean {
133
+ return value !== null && value !== undefined;
134
+ }
@@ -0,0 +1,136 @@
1
+ /* eslint-disable */
2
+ import _m0 from "protobufjs/minimal";
3
+
4
+ export const protobufPackage = "decentraland.sdk.components";
5
+
6
+ export enum TweenStateStatus {
7
+ TS_ACTIVE = 0,
8
+ TS_COMPLETED = 1,
9
+ TS_PAUSED = 2,
10
+ UNRECOGNIZED = -1,
11
+ }
12
+
13
+ export function tweenStateStatusFromJSON(object: any): TweenStateStatus {
14
+ switch (object) {
15
+ case 0:
16
+ case "TS_ACTIVE":
17
+ return TweenStateStatus.TS_ACTIVE;
18
+ case 1:
19
+ case "TS_COMPLETED":
20
+ return TweenStateStatus.TS_COMPLETED;
21
+ case 2:
22
+ case "TS_PAUSED":
23
+ return TweenStateStatus.TS_PAUSED;
24
+ case -1:
25
+ case "UNRECOGNIZED":
26
+ default:
27
+ return TweenStateStatus.UNRECOGNIZED;
28
+ }
29
+ }
30
+
31
+ export function tweenStateStatusToJSON(object: TweenStateStatus): string {
32
+ switch (object) {
33
+ case TweenStateStatus.TS_ACTIVE:
34
+ return "TS_ACTIVE";
35
+ case TweenStateStatus.TS_COMPLETED:
36
+ return "TS_COMPLETED";
37
+ case TweenStateStatus.TS_PAUSED:
38
+ return "TS_PAUSED";
39
+ case TweenStateStatus.UNRECOGNIZED:
40
+ default:
41
+ return "UNRECOGNIZED";
42
+ }
43
+ }
44
+
45
+ export interface PBTweenState {
46
+ state: TweenStateStatus;
47
+ /** between 0 and 1 */
48
+ currentTime: number;
49
+ }
50
+
51
+ function createBasePBTweenState(): PBTweenState {
52
+ return { state: 0, currentTime: 0 };
53
+ }
54
+
55
+ export namespace PBTweenState {
56
+ export function encode(message: PBTweenState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
57
+ if (message.state !== 0) {
58
+ writer.uint32(8).int32(message.state);
59
+ }
60
+ if (message.currentTime !== 0) {
61
+ writer.uint32(21).float(message.currentTime);
62
+ }
63
+ return writer;
64
+ }
65
+
66
+ export function decode(input: _m0.Reader | Uint8Array, length?: number): PBTweenState {
67
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
68
+ let end = length === undefined ? reader.len : reader.pos + length;
69
+ const message = createBasePBTweenState();
70
+ while (reader.pos < end) {
71
+ const tag = reader.uint32();
72
+ switch (tag >>> 3) {
73
+ case 1:
74
+ if (tag !== 8) {
75
+ break;
76
+ }
77
+
78
+ message.state = reader.int32() as any;
79
+ continue;
80
+ case 2:
81
+ if (tag !== 21) {
82
+ break;
83
+ }
84
+
85
+ message.currentTime = reader.float();
86
+ continue;
87
+ }
88
+ if ((tag & 7) === 4 || tag === 0) {
89
+ break;
90
+ }
91
+ reader.skipType(tag & 7);
92
+ }
93
+ return message;
94
+ }
95
+
96
+ export function fromJSON(object: any): PBTweenState {
97
+ return {
98
+ state: isSet(object.state) ? tweenStateStatusFromJSON(object.state) : 0,
99
+ currentTime: isSet(object.currentTime) ? Number(object.currentTime) : 0,
100
+ };
101
+ }
102
+
103
+ export function toJSON(message: PBTweenState): unknown {
104
+ const obj: any = {};
105
+ message.state !== undefined && (obj.state = tweenStateStatusToJSON(message.state));
106
+ message.currentTime !== undefined && (obj.currentTime = message.currentTime);
107
+ return obj;
108
+ }
109
+
110
+ export function create<I extends Exact<DeepPartial<PBTweenState>, I>>(base?: I): PBTweenState {
111
+ return PBTweenState.fromPartial(base ?? {});
112
+ }
113
+
114
+ export function fromPartial<I extends Exact<DeepPartial<PBTweenState>, I>>(object: I): PBTweenState {
115
+ const message = createBasePBTweenState();
116
+ message.state = object.state ?? 0;
117
+ message.currentTime = object.currentTime ?? 0;
118
+ return message;
119
+ }
120
+ }
121
+
122
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
123
+
124
+ export type DeepPartial<T> = T extends Builtin ? T
125
+ : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
126
+ : T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
127
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
128
+ : Partial<T>;
129
+
130
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
131
+ export type Exact<P, I extends P> = P extends Builtin ? P
132
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
133
+
134
+ function isSet(value: any): boolean {
135
+ return value !== null && value !== undefined;
136
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl/protocol",
3
- "version": "1.0.0-6314457636.commit-a9a962a",
3
+ "version": "1.0.0-6473373363.commit-d038938",
4
4
  "description": "",
5
5
  "repository": "decentraland/protocol.git",
6
6
  "homepage": "https://github.com/decentraland/protocol#readme",
@@ -29,5 +29,5 @@
29
29
  "out-js",
30
30
  "public"
31
31
  ],
32
- "commit": "a9a962adc727481961dad2d379121a912672cae5"
32
+ "commit": "d038938481f1322ac81ac748eaeaaccc897536b3"
33
33
  }
@@ -14,9 +14,9 @@ enum TextureFilterMode {
14
14
  }
15
15
 
16
16
  message Texture {
17
- string src = 1;
18
- optional TextureWrapMode wrap_mode = 2; // default = TextureWrapMode.Clamp
19
- optional TextureFilterMode filter_mode = 3; // default = FilterMode.Bilinear
17
+ string src = 1;
18
+ optional TextureWrapMode wrap_mode = 2; // default = TextureWrapMode.Clamp
19
+ optional TextureFilterMode filter_mode = 3; // default = FilterMode.Bilinear
20
20
  }
21
21
 
22
22
  message AvatarTexture {
@@ -32,9 +32,9 @@ message VideoTexture {
32
32
  }
33
33
 
34
34
  message TextureUnion {
35
- oneof tex {
36
- Texture texture = 1; // default = null
37
- AvatarTexture avatar_texture = 2; // default = null
38
- VideoTexture video_texture = 3; // default = null
39
- }
35
+ oneof tex {
36
+ Texture texture = 1; // default = null
37
+ AvatarTexture avatar_texture = 2; // default = null
38
+ VideoTexture video_texture = 3; // default = null
39
+ }
40
40
  }
@@ -0,0 +1,74 @@
1
+ syntax = "proto3";
2
+
3
+ package decentraland.sdk.components;
4
+
5
+ import "decentraland/common/vectors.proto";
6
+ import "decentraland/sdk/components/common/id.proto";
7
+
8
+ option (common.ecs_component_id) = 1102;
9
+
10
+ message PBTween {
11
+ float duration = 1; // in milliseconds
12
+ EasingFunction easing_function = 2;
13
+
14
+ oneof mode {
15
+ Move move = 3;
16
+ Rotate rotate = 4;
17
+ Scale scale = 5;
18
+ }
19
+
20
+ optional bool playing = 6; // default true (pause or running)
21
+ optional float current_time = 7; // between 0 and 1
22
+ }
23
+
24
+ message Move {
25
+ decentraland.common.Vector3 start = 1;
26
+ decentraland.common.Vector3 end = 2;
27
+ optional bool face_direction = 3;
28
+ }
29
+
30
+ message Rotate {
31
+ decentraland.common.Quaternion start = 1;
32
+ decentraland.common.Quaternion end = 2;
33
+ }
34
+
35
+ message Scale {
36
+ decentraland.common.Vector3 start = 1;
37
+ decentraland.common.Vector3 end = 2;
38
+ }
39
+
40
+ // Implementation guidelines for these easing functions can be found
41
+ // at https://github.com/ai/easings.net/blob/6fcd5f852a470bf1a7890e8178afa0f471d5f2ec/src/easings/easingsFunctions.ts
42
+ enum EasingFunction {
43
+ EF_LINEAR = 0; // default
44
+ EF_EASEINQUAD = 1;
45
+ EF_EASEOUTQUAD = 2;
46
+ EF_EASEQUAD = 3;
47
+ EF_EASEINSINE = 4;
48
+ EF_EASEOUTSINE = 5;
49
+ EF_EASESINE = 6;
50
+ EF_EASEINEXPO = 7;
51
+ EF_EASEOUTEXPO = 8;
52
+ EF_EASEEXPO = 9;
53
+ EF_EASEINELASTIC = 10;
54
+ EF_EASEOUTELASTIC = 11;
55
+ EF_EASEELASTIC = 12;
56
+ EF_EASEINBOUNCE = 13;
57
+ EF_EASEOUTBOUNCE = 14;
58
+ EF_EASEBOUNCE = 15;
59
+ EF_EASEINCUBIC = 16;
60
+ EF_EASEOUTCUBIC = 17;
61
+ EF_EASECUBIC = 18;
62
+ EF_EASEINQUART = 19;
63
+ EF_EASEOUTQUART = 20;
64
+ EF_EASEQUART = 21;
65
+ EF_EASEINQUINT = 22;
66
+ EF_EASEOUTQUINT = 23;
67
+ EF_EASEQUINT = 24;
68
+ EF_EASEINCIRC = 25;
69
+ EF_EASEOUTCIRC = 26;
70
+ EF_EASECIRC = 27;
71
+ EF_EASEINBACK = 28;
72
+ EF_EASEOUTBACK = 29;
73
+ EF_EASEBACK = 30;
74
+ }
@@ -0,0 +1,18 @@
1
+ syntax = "proto3";
2
+
3
+ package decentraland.sdk.components;
4
+
5
+ import "decentraland/sdk/components/common/id.proto";
6
+ import "decentraland/sdk/components/tween.proto";
7
+
8
+ option (common.ecs_component_id) = 1104;
9
+
10
+ message PBTweenSequence {
11
+ repeated PBTween sequence = 1;
12
+ optional TweenLoop loop = 2;
13
+ }
14
+
15
+ enum TweenLoop {
16
+ TL_RESTART = 0;
17
+ TL_YOYO = 1;
18
+ }
@@ -0,0 +1,18 @@
1
+ syntax = "proto3";
2
+
3
+ package decentraland.sdk.components;
4
+
5
+ import "decentraland/sdk/components/common/id.proto";
6
+
7
+ option (common.ecs_component_id) = 1103;
8
+
9
+ message PBTweenState {
10
+ TweenStateStatus state = 1;
11
+ float current_time = 2; // between 0 and 1
12
+ }
13
+
14
+ enum TweenStateStatus {
15
+ TS_ACTIVE = 0;
16
+ TS_COMPLETED = 1;
17
+ TS_PAUSED= 2;
18
+ }
@@ -27,6 +27,9 @@ import public "decentraland/sdk/components/pointer_lock.proto";
27
27
  import public "decentraland/sdk/components/raycast_result.proto";
28
28
  import public "decentraland/sdk/components/raycast.proto";
29
29
  import public "decentraland/sdk/components/text_shape.proto";
30
+ import public "decentraland/sdk/components/tween.proto";
31
+ import public "decentraland/sdk/components/tween_state.proto";
32
+ import public "decentraland/sdk/components/tween_sequence.proto";
30
33
  import public "decentraland/sdk/components/ui_background.proto";
31
34
  import public "decentraland/sdk/components/ui_dropdown_result.proto";
32
35
  import public "decentraland/sdk/components/ui_dropdown.proto";