@dcl/ecs 7.20.5-22639691829.commit-b96024f → 7.20.5-22670537517.commit-a403a9f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/generated/PhysicsCombinedForce.gen.d.ts +1 -0
- package/dist/components/generated/PhysicsCombinedForce.gen.js +25 -0
- package/dist/components/generated/PhysicsCombinedImpulse.gen.d.ts +1 -0
- package/dist/components/generated/PhysicsCombinedImpulse.gen.js +25 -0
- package/dist/components/generated/component-names.gen.js +2 -0
- package/dist/components/generated/global.gen.d.ts +4 -0
- package/dist/components/generated/global.gen.js +2 -0
- package/dist/components/generated/index.gen.d.ts +8 -0
- package/dist/components/generated/index.gen.js +10 -0
- package/dist/components/generated/pb/decentraland/sdk/components/input_modifier.gen.d.ts +2 -0
- package/dist/components/generated/pb/decentraland/sdk/components/input_modifier.gen.js +20 -0
- package/dist/components/generated/pb/decentraland/sdk/components/physics_combined_force.gen.d.ts +25 -0
- package/dist/components/generated/pb/decentraland/sdk/components/physics_combined_force.gen.js +42 -0
- package/dist/components/generated/pb/decentraland/sdk/components/physics_combined_impulse.gen.d.ts +28 -0
- package/dist/components/generated/pb/decentraland/sdk/components/physics_combined_impulse.gen.js +51 -0
- package/dist/components/index.d.ts +0 -5
- package/dist/components/index.js +2 -5
- package/dist/components/manual/Transform.d.ts +0 -9
- package/dist/components/manual/Transform.js +3 -3
- package/dist/components/types.d.ts +0 -1
- package/dist/engine/component.d.ts +1 -52
- package/dist/engine/grow-only-value-set-component-definition.js +2 -45
- package/dist/engine/lww-element-set-component-definition.d.ts +1 -3
- package/dist/engine/lww-element-set-component-definition.js +12 -65
- package/dist/index.d.ts +1 -2
- package/dist/index.js +0 -1
- package/dist/serialization/crdt/index.d.ts +0 -1
- package/dist/serialization/crdt/index.js +0 -1
- package/dist/serialization/crdt/network/utils.d.ts +9 -0
- package/dist/serialization/crdt/network/utils.js +60 -0
- package/dist/serialization/crdt/types.d.ts +3 -25
- package/dist/serialization/crdt/types.js +1 -3
- package/dist/systems/crdt/index.d.ts +1 -0
- package/dist/systems/crdt/index.js +146 -55
- package/dist-cjs/components/generated/PhysicsCombinedForce.gen.d.ts +1 -0
- package/dist-cjs/components/generated/PhysicsCombinedForce.gen.js +28 -0
- package/dist-cjs/components/generated/PhysicsCombinedImpulse.gen.d.ts +1 -0
- package/dist-cjs/components/generated/PhysicsCombinedImpulse.gen.js +28 -0
- package/dist-cjs/components/generated/component-names.gen.js +2 -0
- package/dist-cjs/components/generated/global.gen.d.ts +4 -0
- package/dist-cjs/components/generated/global.gen.js +3 -1
- package/dist-cjs/components/generated/index.gen.d.ts +8 -0
- package/dist-cjs/components/generated/index.gen.js +14 -2
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/input_modifier.gen.d.ts +2 -0
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/input_modifier.gen.js +20 -0
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/physics_combined_force.gen.d.ts +25 -0
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/physics_combined_force.gen.js +48 -0
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/physics_combined_impulse.gen.d.ts +28 -0
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/physics_combined_impulse.gen.js +57 -0
- package/dist-cjs/components/index.d.ts +0 -5
- package/dist-cjs/components/index.js +3 -7
- package/dist-cjs/components/manual/Transform.d.ts +0 -9
- package/dist-cjs/components/manual/Transform.js +3 -3
- package/dist-cjs/components/types.d.ts +0 -1
- package/dist-cjs/engine/component.d.ts +1 -52
- package/dist-cjs/engine/grow-only-value-set-component-definition.js +1 -44
- package/dist-cjs/engine/lww-element-set-component-definition.d.ts +1 -3
- package/dist-cjs/engine/lww-element-set-component-definition.js +13 -68
- package/dist-cjs/index.d.ts +1 -2
- package/dist-cjs/index.js +1 -2
- package/dist-cjs/serialization/crdt/index.d.ts +0 -1
- package/dist-cjs/serialization/crdt/index.js +0 -1
- package/dist-cjs/serialization/crdt/network/utils.d.ts +9 -0
- package/dist-cjs/serialization/crdt/network/utils.js +67 -0
- package/dist-cjs/serialization/crdt/types.d.ts +3 -25
- package/dist-cjs/serialization/crdt/types.js +1 -3
- package/dist-cjs/systems/crdt/index.d.ts +1 -0
- package/dist-cjs/systems/crdt/index.js +169 -55
- package/package.json +2 -2
- package/dist/components/manual/CreatedBy.d.ts +0 -9
- package/dist/components/manual/CreatedBy.js +0 -8
- package/dist/serialization/crdt/authoritativePutComponent.d.ts +0 -15
- package/dist/serialization/crdt/authoritativePutComponent.js +0 -47
- package/dist-cjs/components/manual/CreatedBy.d.ts +0 -9
- package/dist-cjs/components/manual/CreatedBy.js +0 -10
- package/dist-cjs/serialization/crdt/authoritativePutComponent.d.ts +0 -15
- package/dist-cjs/serialization/crdt/authoritativePutComponent.js +0 -50
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PhysicsCombinedImpulseSchema = void 0;
|
|
4
|
+
const physics_combined_impulse_gen_1 = require("./pb/decentraland/sdk/components/physics_combined_impulse.gen");
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
exports.PhysicsCombinedImpulseSchema = {
|
|
9
|
+
COMPONENT_ID: 1215,
|
|
10
|
+
serialize(value, builder) {
|
|
11
|
+
const writer = physics_combined_impulse_gen_1.PBPhysicsCombinedImpulse.encode(value);
|
|
12
|
+
const buffer = new Uint8Array(writer.finish(), 0, writer.len);
|
|
13
|
+
builder.writeBuffer(buffer, false);
|
|
14
|
+
},
|
|
15
|
+
deserialize(reader) {
|
|
16
|
+
return physics_combined_impulse_gen_1.PBPhysicsCombinedImpulse.decode(reader.buffer(), reader.remainingBytes());
|
|
17
|
+
},
|
|
18
|
+
create() {
|
|
19
|
+
// TODO: this is a hack.
|
|
20
|
+
return physics_combined_impulse_gen_1.PBPhysicsCombinedImpulse.decode(new Uint8Array());
|
|
21
|
+
},
|
|
22
|
+
jsonSchema: {
|
|
23
|
+
type: "object",
|
|
24
|
+
properties: {},
|
|
25
|
+
serializationType: "protocol-buffer",
|
|
26
|
+
protocolBuffer: "PBPhysicsCombinedImpulse"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
@@ -33,6 +33,8 @@ exports.coreComponentMappings = {
|
|
|
33
33
|
"core::MeshCollider": 1019,
|
|
34
34
|
"core::MeshRenderer": 1018,
|
|
35
35
|
"core::NftShape": 1040,
|
|
36
|
+
"core::PhysicsCombinedForce": 1216,
|
|
37
|
+
"core::PhysicsCombinedImpulse": 1215,
|
|
36
38
|
"core::PlayerIdentityData": 1089,
|
|
37
39
|
"core::PointerEvents": 1062,
|
|
38
40
|
"core::PointerEventsResult": 1063,
|
|
@@ -22,6 +22,8 @@ import { PBInputModifier } from './pb/decentraland/sdk/components/input_modifier
|
|
|
22
22
|
import { PBLightSource } from './pb/decentraland/sdk/components/light_source.gen';
|
|
23
23
|
import { PBMainCamera } from './pb/decentraland/sdk/components/main_camera.gen';
|
|
24
24
|
import { PBNftShape } from './pb/decentraland/sdk/components/nft_shape.gen';
|
|
25
|
+
import { PBPhysicsCombinedForce } from './pb/decentraland/sdk/components/physics_combined_force.gen';
|
|
26
|
+
import { PBPhysicsCombinedImpulse } from './pb/decentraland/sdk/components/physics_combined_impulse.gen';
|
|
25
27
|
import { PBPlayerIdentityData } from './pb/decentraland/sdk/components/player_identity_data.gen';
|
|
26
28
|
import { PBPointerEvents } from './pb/decentraland/sdk/components/pointer_events.gen';
|
|
27
29
|
import { PBPointerEventsResult } from './pb/decentraland/sdk/components/pointer_events_result.gen';
|
|
@@ -70,6 +72,8 @@ import { PBVisibilityComponent } from './pb/decentraland/sdk/components/visibili
|
|
|
70
72
|
/** @public */ export declare const LightSource: LastWriteWinElementSetComponentDefinition<PBLightSource>;
|
|
71
73
|
/** @public */ export declare const MainCamera: LastWriteWinElementSetComponentDefinition<PBMainCamera>;
|
|
72
74
|
/** @public */ export declare const NftShape: LastWriteWinElementSetComponentDefinition<PBNftShape>;
|
|
75
|
+
/** @public */ export declare const PhysicsCombinedForce: LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedForce>;
|
|
76
|
+
/** @public */ export declare const PhysicsCombinedImpulse: LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedImpulse>;
|
|
73
77
|
/** @public */ export declare const PlayerIdentityData: LastWriteWinElementSetComponentDefinition<PBPlayerIdentityData>;
|
|
74
78
|
/** @public */ export declare const PointerEvents: LastWriteWinElementSetComponentDefinition<PBPointerEvents>;
|
|
75
79
|
/** @public */ export declare const PointerEventsResult: GrowOnlyValueSetComponentDefinition<PBPointerEventsResult>;
|
|
@@ -26,7 +26,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
26
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.VisibilityComponent = exports.VirtualCamera = exports.VideoPlayer = exports.VideoEvent = exports.UiTransform = exports.UiText = exports.UiInputResult = exports.UiInput = exports.UiDropdownResult = exports.UiDropdown = exports.UiCanvasInformation = exports.UiBackground = exports.TweenState = exports.TweenSequence = exports.TriggerAreaResult = exports.TriggerArea = exports.TextShape = exports.SkyboxTime = exports.RealmInfo = exports.RaycastResult = exports.Raycast = exports.PrimaryPointerInfo = exports.PointerLock = exports.PointerEventsResult = exports.PointerEvents = exports.PlayerIdentityData = exports.NftShape = exports.MainCamera = exports.LightSource = exports.InputModifier = exports.GltfNodeModifiers = exports.GltfContainerLoadingState = exports.GltfContainer = exports.EngineInfo = exports.CameraModeArea = exports.CameraMode = exports.Billboard = exports.AvatarShape = exports.AvatarModifierArea = exports.AvatarEquippedData = exports.AvatarEmoteCommand = exports.AvatarBase = exports.AvatarAttach = exports.AudioStream = exports.AudioSource = exports.AudioEvent = exports.AssetLoadLoadingState = exports.AssetLoad = void 0;
|
|
29
|
+
exports.VisibilityComponent = exports.VirtualCamera = exports.VideoPlayer = exports.VideoEvent = exports.UiTransform = exports.UiText = exports.UiInputResult = exports.UiInput = exports.UiDropdownResult = exports.UiDropdown = exports.UiCanvasInformation = exports.UiBackground = exports.TweenState = exports.TweenSequence = exports.TriggerAreaResult = exports.TriggerArea = exports.TextShape = exports.SkyboxTime = exports.RealmInfo = exports.RaycastResult = exports.Raycast = exports.PrimaryPointerInfo = exports.PointerLock = exports.PointerEventsResult = exports.PointerEvents = exports.PlayerIdentityData = exports.PhysicsCombinedImpulse = exports.PhysicsCombinedForce = exports.NftShape = exports.MainCamera = exports.LightSource = exports.InputModifier = exports.GltfNodeModifiers = exports.GltfContainerLoadingState = exports.GltfContainer = exports.EngineInfo = exports.CameraModeArea = exports.CameraMode = exports.Billboard = exports.AvatarShape = exports.AvatarModifierArea = exports.AvatarEquippedData = exports.AvatarEmoteCommand = exports.AvatarBase = exports.AvatarAttach = exports.AudioStream = exports.AudioSource = exports.AudioEvent = exports.AssetLoadLoadingState = exports.AssetLoad = void 0;
|
|
30
30
|
const initialization_1 = require("../../runtime/initialization");
|
|
31
31
|
const components = __importStar(require("./index.gen"));
|
|
32
32
|
__exportStar(require("./index.gen"), exports);
|
|
@@ -52,6 +52,8 @@ __exportStar(require("./index.gen"), exports);
|
|
|
52
52
|
/** @public */ exports.LightSource = components.LightSource(initialization_1.engine);
|
|
53
53
|
/** @public */ exports.MainCamera = components.MainCamera(initialization_1.engine);
|
|
54
54
|
/** @public */ exports.NftShape = components.NftShape(initialization_1.engine);
|
|
55
|
+
/** @public */ exports.PhysicsCombinedForce = components.PhysicsCombinedForce(initialization_1.engine);
|
|
56
|
+
/** @public */ exports.PhysicsCombinedImpulse = components.PhysicsCombinedImpulse(initialization_1.engine);
|
|
55
57
|
/** @public */ exports.PlayerIdentityData = components.PlayerIdentityData(initialization_1.engine);
|
|
56
58
|
/** @public */ exports.PointerEvents = components.PointerEvents(initialization_1.engine);
|
|
57
59
|
/** @public */ exports.PointerEventsResult = components.PointerEventsResult(initialization_1.engine);
|
|
@@ -26,6 +26,8 @@ import { PBMaterial } from './pb/decentraland/sdk/components/material.gen';
|
|
|
26
26
|
import { PBMeshCollider } from './pb/decentraland/sdk/components/mesh_collider.gen';
|
|
27
27
|
import { PBMeshRenderer } from './pb/decentraland/sdk/components/mesh_renderer.gen';
|
|
28
28
|
import { PBNftShape } from './pb/decentraland/sdk/components/nft_shape.gen';
|
|
29
|
+
import { PBPhysicsCombinedForce } from './pb/decentraland/sdk/components/physics_combined_force.gen';
|
|
30
|
+
import { PBPhysicsCombinedImpulse } from './pb/decentraland/sdk/components/physics_combined_impulse.gen';
|
|
29
31
|
import { PBPlayerIdentityData } from './pb/decentraland/sdk/components/player_identity_data.gen';
|
|
30
32
|
import { PBPointerEvents } from './pb/decentraland/sdk/components/pointer_events.gen';
|
|
31
33
|
import { PBPointerEventsResult } from './pb/decentraland/sdk/components/pointer_events_result.gen';
|
|
@@ -79,6 +81,8 @@ export * from './pb/decentraland/sdk/components/material.gen';
|
|
|
79
81
|
export * from './pb/decentraland/sdk/components/mesh_collider.gen';
|
|
80
82
|
export * from './pb/decentraland/sdk/components/mesh_renderer.gen';
|
|
81
83
|
export * from './pb/decentraland/sdk/components/nft_shape.gen';
|
|
84
|
+
export * from './pb/decentraland/sdk/components/physics_combined_force.gen';
|
|
85
|
+
export * from './pb/decentraland/sdk/components/physics_combined_impulse.gen';
|
|
82
86
|
export * from './pb/decentraland/sdk/components/player_identity_data.gen';
|
|
83
87
|
export * from './pb/decentraland/sdk/components/pointer_events.gen';
|
|
84
88
|
export * from './pb/decentraland/sdk/components/pointer_events_result.gen';
|
|
@@ -134,6 +138,8 @@ export type GSetComponentGetter<T extends GrowOnlyValueSetComponentDefinition<an
|
|
|
134
138
|
/** @public */ export declare const MeshCollider: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBMeshCollider>>;
|
|
135
139
|
/** @public */ export declare const MeshRenderer: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBMeshRenderer>>;
|
|
136
140
|
/** @public */ export declare const NftShape: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBNftShape>>;
|
|
141
|
+
/** @public */ export declare const PhysicsCombinedForce: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedForce>>;
|
|
142
|
+
/** @public */ export declare const PhysicsCombinedImpulse: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedImpulse>>;
|
|
137
143
|
/** @public */ export declare const PlayerIdentityData: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPlayerIdentityData>>;
|
|
138
144
|
/** @public */ export declare const PointerEvents: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPointerEvents>>;
|
|
139
145
|
/** @public */ export declare const PointerEventsResult: GSetComponentGetter<GrowOnlyValueSetComponentDefinition<PBPointerEventsResult>>;
|
|
@@ -189,6 +195,8 @@ export declare const componentDefinitionByName: {
|
|
|
189
195
|
"core::MeshCollider": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBMeshCollider>>;
|
|
190
196
|
"core::MeshRenderer": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBMeshRenderer>>;
|
|
191
197
|
"core::NftShape": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBNftShape>>;
|
|
198
|
+
"core::PhysicsCombinedForce": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedForce>>;
|
|
199
|
+
"core::PhysicsCombinedImpulse": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPhysicsCombinedImpulse>>;
|
|
192
200
|
"core::PlayerIdentityData": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPlayerIdentityData>>;
|
|
193
201
|
"core::PointerEvents": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBPointerEvents>>;
|
|
194
202
|
"core::PointerEventsResult": GSetComponentGetter<GrowOnlyValueSetComponentDefinition<PBPointerEventsResult>>;
|
|
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
18
|
-
exports.componentDefinitionByName = exports.VisibilityComponent = exports.VirtualCamera = exports.VideoPlayer = void 0;
|
|
17
|
+
exports.UiText = exports.UiInputResult = exports.UiInput = exports.UiDropdownResult = exports.UiDropdown = exports.UiCanvasInformation = exports.UiBackground = exports.TweenState = exports.TweenSequence = exports.Tween = exports.TriggerAreaResult = exports.TriggerArea = exports.TextShape = exports.SkyboxTime = exports.RealmInfo = exports.RaycastResult = exports.Raycast = exports.PrimaryPointerInfo = exports.PointerLock = exports.PointerEventsResult = exports.PointerEvents = exports.PlayerIdentityData = exports.PhysicsCombinedImpulse = exports.PhysicsCombinedForce = exports.NftShape = exports.MeshRenderer = exports.MeshCollider = exports.Material = exports.MainCamera = exports.LightSource = exports.InputModifier = exports.GltfNodeModifiers = exports.GltfContainerLoadingState = exports.GltfContainer = exports.EngineInfo = exports.CameraModeArea = exports.CameraMode = exports.Billboard = exports.AvatarShape = exports.AvatarModifierArea = exports.AvatarEquippedData = exports.AvatarEmoteCommand = exports.AvatarBase = exports.AvatarAttach = exports.AudioStream = exports.AudioSource = exports.AudioEvent = exports.AssetLoadLoadingState = exports.AssetLoad = exports.Animator = void 0;
|
|
18
|
+
exports.componentDefinitionByName = exports.VisibilityComponent = exports.VirtualCamera = exports.VideoPlayer = exports.VideoEvent = exports.UiTransform = void 0;
|
|
19
19
|
const Animator_gen_1 = require("./Animator.gen");
|
|
20
20
|
const AssetLoad_gen_1 = require("./AssetLoad.gen");
|
|
21
21
|
const AssetLoadLoadingState_gen_1 = require("./AssetLoadLoadingState.gen");
|
|
@@ -42,6 +42,8 @@ const Material_gen_1 = require("./Material.gen");
|
|
|
42
42
|
const MeshCollider_gen_1 = require("./MeshCollider.gen");
|
|
43
43
|
const MeshRenderer_gen_1 = require("./MeshRenderer.gen");
|
|
44
44
|
const NftShape_gen_1 = require("./NftShape.gen");
|
|
45
|
+
const PhysicsCombinedForce_gen_1 = require("./PhysicsCombinedForce.gen");
|
|
46
|
+
const PhysicsCombinedImpulse_gen_1 = require("./PhysicsCombinedImpulse.gen");
|
|
45
47
|
const PlayerIdentityData_gen_1 = require("./PlayerIdentityData.gen");
|
|
46
48
|
const PointerEvents_gen_1 = require("./PointerEvents.gen");
|
|
47
49
|
const PointerEventsResult_gen_1 = require("./PointerEventsResult.gen");
|
|
@@ -95,6 +97,8 @@ __exportStar(require("./pb/decentraland/sdk/components/material.gen"), exports);
|
|
|
95
97
|
__exportStar(require("./pb/decentraland/sdk/components/mesh_collider.gen"), exports);
|
|
96
98
|
__exportStar(require("./pb/decentraland/sdk/components/mesh_renderer.gen"), exports);
|
|
97
99
|
__exportStar(require("./pb/decentraland/sdk/components/nft_shape.gen"), exports);
|
|
100
|
+
__exportStar(require("./pb/decentraland/sdk/components/physics_combined_force.gen"), exports);
|
|
101
|
+
__exportStar(require("./pb/decentraland/sdk/components/physics_combined_impulse.gen"), exports);
|
|
98
102
|
__exportStar(require("./pb/decentraland/sdk/components/player_identity_data.gen"), exports);
|
|
99
103
|
__exportStar(require("./pb/decentraland/sdk/components/pointer_events.gen"), exports);
|
|
100
104
|
__exportStar(require("./pb/decentraland/sdk/components/pointer_events_result.gen"), exports);
|
|
@@ -206,6 +210,12 @@ exports.MeshRenderer = MeshRenderer;
|
|
|
206
210
|
/** @public */ const NftShape = engine =>
|
|
207
211
|
/* @__PURE__ */ engine.defineComponentFromSchema("core::NftShape", NftShape_gen_1.NftShapeSchema);
|
|
208
212
|
exports.NftShape = NftShape;
|
|
213
|
+
/** @public */ const PhysicsCombinedForce = engine =>
|
|
214
|
+
/* @__PURE__ */ engine.defineComponentFromSchema("core::PhysicsCombinedForce", PhysicsCombinedForce_gen_1.PhysicsCombinedForceSchema);
|
|
215
|
+
exports.PhysicsCombinedForce = PhysicsCombinedForce;
|
|
216
|
+
/** @public */ const PhysicsCombinedImpulse = engine =>
|
|
217
|
+
/* @__PURE__ */ engine.defineComponentFromSchema("core::PhysicsCombinedImpulse", PhysicsCombinedImpulse_gen_1.PhysicsCombinedImpulseSchema);
|
|
218
|
+
exports.PhysicsCombinedImpulse = PhysicsCombinedImpulse;
|
|
209
219
|
/** @public */ const PlayerIdentityData = engine =>
|
|
210
220
|
/* @__PURE__ */ engine.defineComponentFromSchema("core::PlayerIdentityData", PlayerIdentityData_gen_1.PlayerIdentityDataSchema);
|
|
211
221
|
exports.PlayerIdentityData = PlayerIdentityData;
|
|
@@ -321,6 +331,8 @@ exports.componentDefinitionByName = {
|
|
|
321
331
|
"core::MeshCollider": exports.MeshCollider,
|
|
322
332
|
"core::MeshRenderer": exports.MeshRenderer,
|
|
323
333
|
"core::NftShape": exports.NftShape,
|
|
334
|
+
"core::PhysicsCombinedForce": exports.PhysicsCombinedForce,
|
|
335
|
+
"core::PhysicsCombinedImpulse": exports.PhysicsCombinedImpulse,
|
|
324
336
|
"core::PlayerIdentityData": exports.PlayerIdentityData,
|
|
325
337
|
"core::PointerEvents": exports.PointerEvents,
|
|
326
338
|
"core::PointerEventsResult": exports.PointerEventsResult,
|
package/dist-cjs/components/generated/pb/decentraland/sdk/components/input_modifier.gen.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export interface PBInputModifier_StandardInput {
|
|
|
19
19
|
disableRun?: boolean | undefined;
|
|
20
20
|
disableJump?: boolean | undefined;
|
|
21
21
|
disableEmote?: boolean | undefined;
|
|
22
|
+
disableDoubleJump?: boolean | undefined;
|
|
23
|
+
disableGliding?: boolean | undefined;
|
|
22
24
|
}
|
|
23
25
|
/**
|
|
24
26
|
* @public
|
|
@@ -55,6 +55,8 @@ function createBasePBInputModifier_StandardInput() {
|
|
|
55
55
|
disableRun: undefined,
|
|
56
56
|
disableJump: undefined,
|
|
57
57
|
disableEmote: undefined,
|
|
58
|
+
disableDoubleJump: undefined,
|
|
59
|
+
disableGliding: undefined,
|
|
58
60
|
};
|
|
59
61
|
}
|
|
60
62
|
/**
|
|
@@ -81,6 +83,12 @@ var PBInputModifier_StandardInput;
|
|
|
81
83
|
if (message.disableEmote !== undefined) {
|
|
82
84
|
writer.uint32(48).bool(message.disableEmote);
|
|
83
85
|
}
|
|
86
|
+
if (message.disableDoubleJump !== undefined) {
|
|
87
|
+
writer.uint32(56).bool(message.disableDoubleJump);
|
|
88
|
+
}
|
|
89
|
+
if (message.disableGliding !== undefined) {
|
|
90
|
+
writer.uint32(64).bool(message.disableGliding);
|
|
91
|
+
}
|
|
84
92
|
return writer;
|
|
85
93
|
}
|
|
86
94
|
PBInputModifier_StandardInput.encode = encode;
|
|
@@ -127,6 +135,18 @@ var PBInputModifier_StandardInput;
|
|
|
127
135
|
}
|
|
128
136
|
message.disableEmote = reader.bool();
|
|
129
137
|
continue;
|
|
138
|
+
case 7:
|
|
139
|
+
if (tag !== 56) {
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
message.disableDoubleJump = reader.bool();
|
|
143
|
+
continue;
|
|
144
|
+
case 8:
|
|
145
|
+
if (tag !== 64) {
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
message.disableGliding = reader.bool();
|
|
149
|
+
continue;
|
|
130
150
|
}
|
|
131
151
|
if ((tag & 7) === 4 || tag === 0) {
|
|
132
152
|
break;
|
package/dist-cjs/components/generated/pb/decentraland/sdk/components/physics_combined_force.gen.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _m0 from "protobufjs/minimal";
|
|
2
|
+
import { Vector3 } from "../../common/vectors.gen";
|
|
3
|
+
/**
|
|
4
|
+
* This component applies a continuous physics force.
|
|
5
|
+
*
|
|
6
|
+
* @remarks Low-level component. Use Physics.applyForceToPlayer()/.removeForceToPlayer() instead.
|
|
7
|
+
* Direct manipulation will conflict with the force accumulation registry.
|
|
8
|
+
* Summary component: stores the accumulated result of all active forces registered by the scene in the current frame.
|
|
9
|
+
*
|
|
10
|
+
* State-like component: the force is applied every physics tick while the component is present on the entity.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export interface PBPhysicsCombinedForce {
|
|
16
|
+
/** Includes force direction and magnitude */
|
|
17
|
+
vector: Vector3 | undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export declare namespace PBPhysicsCombinedForce {
|
|
23
|
+
function encode(message: PBPhysicsCombinedForce, writer?: _m0.Writer): _m0.Writer;
|
|
24
|
+
function decode(input: _m0.Reader | Uint8Array, length?: number): PBPhysicsCombinedForce;
|
|
25
|
+
}
|
package/dist-cjs/components/generated/pb/decentraland/sdk/components/physics_combined_force.gen.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PBPhysicsCombinedForce = void 0;
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
9
|
+
const vectors_gen_1 = require("../../common/vectors.gen");
|
|
10
|
+
const protobufPackageSarasa = "decentraland.sdk.components";
|
|
11
|
+
function createBasePBPhysicsCombinedForce() {
|
|
12
|
+
return { vector: undefined };
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
var PBPhysicsCombinedForce;
|
|
18
|
+
(function (PBPhysicsCombinedForce) {
|
|
19
|
+
function encode(message, writer = minimal_1.default.Writer.create()) {
|
|
20
|
+
if (message.vector !== undefined) {
|
|
21
|
+
vectors_gen_1.Vector3.encode(message.vector, writer.uint32(10).fork()).ldelim();
|
|
22
|
+
}
|
|
23
|
+
return writer;
|
|
24
|
+
}
|
|
25
|
+
PBPhysicsCombinedForce.encode = encode;
|
|
26
|
+
function decode(input, length) {
|
|
27
|
+
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
28
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
29
|
+
const message = createBasePBPhysicsCombinedForce();
|
|
30
|
+
while (reader.pos < end) {
|
|
31
|
+
const tag = reader.uint32();
|
|
32
|
+
switch (tag >>> 3) {
|
|
33
|
+
case 1:
|
|
34
|
+
if (tag !== 10) {
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
message.vector = vectors_gen_1.Vector3.decode(reader, reader.uint32());
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
reader.skipType(tag & 7);
|
|
44
|
+
}
|
|
45
|
+
return message;
|
|
46
|
+
}
|
|
47
|
+
PBPhysicsCombinedForce.decode = decode;
|
|
48
|
+
})(PBPhysicsCombinedForce = exports.PBPhysicsCombinedForce || (exports.PBPhysicsCombinedForce = {}));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _m0 from "protobufjs/minimal";
|
|
2
|
+
import { Vector3 } from "../../common/vectors.gen";
|
|
3
|
+
/**
|
|
4
|
+
* This component applies a one-shot physics summary impulse.
|
|
5
|
+
*
|
|
6
|
+
* @remarks Low-level component. Use Physics.applyImpulseToPlayer() instead.
|
|
7
|
+
* Direct manipulation will conflict with the force accumulation registry.
|
|
8
|
+
* Summary component: stores the accumulated result of all impulses registered by the scene in the current frame.
|
|
9
|
+
*
|
|
10
|
+
* Event-like component: each new impulse must increment the eventID to ensure delivery via CRDT, even if the direction is identical to the previous one.
|
|
11
|
+
* Renderer processes impulse with the unique ID only once. Increase eventID of the component to apply another impulse.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export interface PBPhysicsCombinedImpulse {
|
|
17
|
+
/** Includes impulse direction and magnitude */
|
|
18
|
+
vector: Vector3 | undefined;
|
|
19
|
+
/** Monotonic counter to distinguish different impulses. */
|
|
20
|
+
eventId: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export declare namespace PBPhysicsCombinedImpulse {
|
|
26
|
+
function encode(message: PBPhysicsCombinedImpulse, writer?: _m0.Writer): _m0.Writer;
|
|
27
|
+
function decode(input: _m0.Reader | Uint8Array, length?: number): PBPhysicsCombinedImpulse;
|
|
28
|
+
}
|
package/dist-cjs/components/generated/pb/decentraland/sdk/components/physics_combined_impulse.gen.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PBPhysicsCombinedImpulse = void 0;
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
9
|
+
const vectors_gen_1 = require("../../common/vectors.gen");
|
|
10
|
+
const protobufPackageSarasa = "decentraland.sdk.components";
|
|
11
|
+
function createBasePBPhysicsCombinedImpulse() {
|
|
12
|
+
return { vector: undefined, eventId: 0 };
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
var PBPhysicsCombinedImpulse;
|
|
18
|
+
(function (PBPhysicsCombinedImpulse) {
|
|
19
|
+
function encode(message, writer = minimal_1.default.Writer.create()) {
|
|
20
|
+
if (message.vector !== undefined) {
|
|
21
|
+
vectors_gen_1.Vector3.encode(message.vector, writer.uint32(10).fork()).ldelim();
|
|
22
|
+
}
|
|
23
|
+
if (message.eventId !== 0) {
|
|
24
|
+
writer.uint32(16).uint32(message.eventId);
|
|
25
|
+
}
|
|
26
|
+
return writer;
|
|
27
|
+
}
|
|
28
|
+
PBPhysicsCombinedImpulse.encode = encode;
|
|
29
|
+
function decode(input, length) {
|
|
30
|
+
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
31
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
32
|
+
const message = createBasePBPhysicsCombinedImpulse();
|
|
33
|
+
while (reader.pos < end) {
|
|
34
|
+
const tag = reader.uint32();
|
|
35
|
+
switch (tag >>> 3) {
|
|
36
|
+
case 1:
|
|
37
|
+
if (tag !== 10) {
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
message.vector = vectors_gen_1.Vector3.decode(reader, reader.uint32());
|
|
41
|
+
continue;
|
|
42
|
+
case 2:
|
|
43
|
+
if (tag !== 16) {
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
message.eventId = reader.uint32();
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
reader.skipType(tag & 7);
|
|
53
|
+
}
|
|
54
|
+
return message;
|
|
55
|
+
}
|
|
56
|
+
PBPhysicsCombinedImpulse.decode = decode;
|
|
57
|
+
})(PBPhysicsCombinedImpulse = exports.PBPhysicsCombinedImpulse || (exports.PBPhysicsCombinedImpulse = {}));
|
|
@@ -19,7 +19,6 @@ import { InputModifierComponentDefinitionExtended } from './extended/InputModifi
|
|
|
19
19
|
import { LightSourceComponentDefinitionExtended } from './extended/LightSource';
|
|
20
20
|
import { TriggerAreaComponentDefinitionExtended } from './extended/TriggerArea';
|
|
21
21
|
import { TagsComponentDefinitionExtended } from './manual/Tags';
|
|
22
|
-
import { ICreatedByType } from './manual/CreatedBy';
|
|
23
22
|
export * from './generated/index.gen';
|
|
24
23
|
export type { GrowOnlyValueSetComponentDefinition, LastWriteWinElementSetComponentDefinition, LwwComponentGetter, GSetComponentGetter };
|
|
25
24
|
export declare const Transform: LwwComponentGetter<TransformComponentExtended>;
|
|
@@ -51,8 +50,4 @@ export declare const NetworkEntity: (engine: Pick<IEngine, 'defineComponent'>) =
|
|
|
51
50
|
* @alpha
|
|
52
51
|
*/
|
|
53
52
|
export declare const NetworkParent: (engine: Pick<IEngine, 'defineComponent'>) => LastWriteWinElementSetComponentDefinition<INetowrkParentType>;
|
|
54
|
-
/**
|
|
55
|
-
* @public
|
|
56
|
-
*/
|
|
57
|
-
export declare const CreatedBy: (engine: Pick<IEngine, 'defineComponent'>) => LastWriteWinElementSetComponentDefinition<ICreatedByType>;
|
|
58
53
|
export { MediaState };
|
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.MediaState = exports.
|
|
20
|
+
exports.MediaState = exports.NetworkParent = exports.NetworkEntity = exports.SyncComponents = exports.Tags = exports.Name = exports.TriggerArea = exports.LightSource = exports.InputModifier = exports.VirtualCamera = exports.Tween = exports.MeshCollider = exports.MeshRenderer = exports.AudioStream = exports.AudioSource = exports.Animator = exports.Material = exports.Transform = void 0;
|
|
21
21
|
const Animator_1 = require("./extended/Animator");
|
|
22
22
|
const AudioSource_1 = require("./extended/AudioSource");
|
|
23
23
|
const Material_1 = require("./extended/Material");
|
|
@@ -37,7 +37,6 @@ const InputModifier_1 = require("./extended/InputModifier");
|
|
|
37
37
|
const LightSource_1 = require("./extended/LightSource");
|
|
38
38
|
const TriggerArea_1 = require("./extended/TriggerArea");
|
|
39
39
|
const Tags_1 = __importDefault(require("./manual/Tags"));
|
|
40
|
-
const CreatedBy_1 = __importDefault(require("./manual/CreatedBy"));
|
|
41
40
|
__exportStar(require("./generated/index.gen"), exports);
|
|
42
41
|
/* @__PURE__ */
|
|
43
42
|
const Transform = (engine) => (0, Transform_1.defineTransformComponent)(engine);
|
|
@@ -93,15 +92,12 @@ exports.SyncComponents = SyncComponents;
|
|
|
93
92
|
/**
|
|
94
93
|
* @alpha
|
|
95
94
|
*/
|
|
95
|
+
/* @__PURE__ */
|
|
96
96
|
const NetworkEntity = (engine) => (0, NetworkEntity_1.default)(engine);
|
|
97
97
|
exports.NetworkEntity = NetworkEntity;
|
|
98
98
|
/**
|
|
99
99
|
* @alpha
|
|
100
100
|
*/
|
|
101
|
+
/* @__PURE__ */
|
|
101
102
|
const NetworkParent = (engine) => (0, NetworkParent_1.default)(engine);
|
|
102
103
|
exports.NetworkParent = NetworkParent;
|
|
103
|
-
/**
|
|
104
|
-
* @public
|
|
105
|
-
*/
|
|
106
|
-
const CreatedBy = (engine) => (0, CreatedBy_1.default)(engine);
|
|
107
|
-
exports.CreatedBy = CreatedBy;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LastWriteWinElementSetComponentDefinition, IEngine } from '../../engine';
|
|
2
2
|
import { Entity } from '../../engine/entity';
|
|
3
|
-
import type { ISchema } from '../../schemas/ISchema';
|
|
4
3
|
/**
|
|
5
4
|
* @public
|
|
6
5
|
*/
|
|
@@ -12,10 +11,6 @@ export interface TransformComponentExtended extends TransformComponent {
|
|
|
12
11
|
create(entity: Entity, val?: TransformTypeWithOptionals): TransformType;
|
|
13
12
|
createOrReplace(entity: Entity, val?: TransformTypeWithOptionals): TransformType;
|
|
14
13
|
}
|
|
15
|
-
/**
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
export declare const COMPONENT_ID = 1;
|
|
19
14
|
/**
|
|
20
15
|
* @public
|
|
21
16
|
*/
|
|
@@ -38,10 +33,6 @@ export type TransformType = {
|
|
|
38
33
|
};
|
|
39
34
|
parent?: Entity;
|
|
40
35
|
};
|
|
41
|
-
/** @public */
|
|
42
|
-
export declare const TRANSFORM_LENGTH = 44;
|
|
43
|
-
/** @public */
|
|
44
|
-
export declare const TransformSchema: ISchema<TransformType>;
|
|
45
36
|
/**
|
|
46
37
|
* @public
|
|
47
38
|
*/
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defineTransformComponent = exports.TransformSchema = exports.TRANSFORM_LENGTH = exports.COMPONENT_ID = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* @
|
|
5
|
+
* @internal
|
|
6
6
|
*/
|
|
7
7
|
exports.COMPONENT_ID = 1;
|
|
8
|
-
/** @
|
|
8
|
+
/** @internal */
|
|
9
9
|
exports.TRANSFORM_LENGTH = 44;
|
|
10
|
-
/** @
|
|
10
|
+
/** @internal */
|
|
11
11
|
exports.TransformSchema = {
|
|
12
12
|
serialize(value, builder) {
|
|
13
13
|
const ptr = builder.incrementWriteOffset(exports.TRANSFORM_LENGTH);
|
|
@@ -12,7 +12,6 @@ export type { TagsComponentDefinitionExtended, TagsType } from './manual/Tags';
|
|
|
12
12
|
export type { ISyncComponents, ISyncComponentsType } from './manual/SyncComponents';
|
|
13
13
|
export type { INetowrkEntity, INetowrkEntityType } from './manual/NetworkEntity';
|
|
14
14
|
export type { INetowrkParent, INetowrkParentType } from './manual/NetworkParent';
|
|
15
|
-
export type { ICreatedBy, ICreatedByType } from './manual/CreatedBy';
|
|
16
15
|
export type { InputModifierHelper, InputModifierComponentDefinitionExtended } from './extended/InputModifier';
|
|
17
16
|
export type { LightSourceHelper, LightSourceComponentDefinitionExtended } from './extended/LightSource';
|
|
18
17
|
export type { TriggerAreaComponentDefinitionExtended } from './extended/TriggerArea';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ISchema } from '../schemas';
|
|
2
2
|
import { ByteBuffer } from '../serialization/ByteBuffer';
|
|
3
|
-
import { CrdtMessageBody, DeleteComponentMessageBody,
|
|
3
|
+
import { CrdtMessageBody, DeleteComponentMessageBody, PutComponentMessageBody } from '../serialization/crdt';
|
|
4
4
|
import { Entity } from './entity';
|
|
5
5
|
import { DeepReadonly, DeepReadonlySet } from './readonly';
|
|
6
6
|
/**
|
|
@@ -70,58 +70,7 @@ export interface BaseComponent<T> {
|
|
|
70
70
|
* If the value is undefined, the component was deleted.
|
|
71
71
|
*/
|
|
72
72
|
onChange(entity: Entity, cb: (value: T | undefined) => void): void;
|
|
73
|
-
/**
|
|
74
|
-
* @public
|
|
75
|
-
*
|
|
76
|
-
*/
|
|
77
|
-
validateBeforeChange(entity: Entity, cb: ValidateCallback<T>): void;
|
|
78
|
-
validateBeforeChange(cb: ValidateCallback<T>): void;
|
|
79
|
-
/**
|
|
80
|
-
* Get the CRDT state for an entity (serialized data and timestamp)
|
|
81
|
-
* @param entity - Entity to get the CRDT state for
|
|
82
|
-
* @returns Object with serialized data and timestamp, or null if entity doesn't have the component
|
|
83
|
-
* @public
|
|
84
|
-
*/
|
|
85
|
-
getCrdtState(entity: Entity): {
|
|
86
|
-
data: Uint8Array;
|
|
87
|
-
timestamp: number;
|
|
88
|
-
} | null;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Internal component interface that exposes all internal methods for SDK use
|
|
92
|
-
* This is not exposed to users, only for internal SDK operations
|
|
93
|
-
*/
|
|
94
|
-
export interface InternalBaseComponent<T> extends BaseComponent<T> {
|
|
95
|
-
/**
|
|
96
|
-
* @public
|
|
97
|
-
* Dry run update to check if a CRDT message would be accepted without actually applying it
|
|
98
|
-
*/
|
|
99
|
-
__dry_run_updateFromCrdt(body: CrdtMessageBody): ProcessMessageResultType;
|
|
100
|
-
/**
|
|
101
|
-
* @public
|
|
102
|
-
* Get the iterator to every entity has the component
|
|
103
|
-
*/
|
|
104
|
-
iterator(): Iterable<[Entity, any]>;
|
|
105
|
-
/**
|
|
106
|
-
* @public
|
|
107
|
-
*/
|
|
108
|
-
dirtyIterator(): Iterable<Entity>;
|
|
109
|
-
/**
|
|
110
|
-
* @public
|
|
111
|
-
*/
|
|
112
|
-
__onChangeCallbacks(entity: Entity, value: T): void;
|
|
113
|
-
/**
|
|
114
|
-
* @public
|
|
115
|
-
*/
|
|
116
|
-
__run_validateBeforeChange(entity: Entity, newValue: T | undefined, senderAddress: string, createdBy: string): boolean;
|
|
117
73
|
}
|
|
118
|
-
export type ValidateCallback<T> = (value: {
|
|
119
|
-
entity: Entity;
|
|
120
|
-
currentValue: T | undefined;
|
|
121
|
-
newValue: T | undefined;
|
|
122
|
-
senderAddress: string;
|
|
123
|
-
createdBy: string;
|
|
124
|
-
}) => boolean;
|
|
125
74
|
/**
|
|
126
75
|
* @public
|
|
127
76
|
*/
|
|
@@ -5,7 +5,6 @@ const ByteBuffer_1 = require("../serialization/ByteBuffer");
|
|
|
5
5
|
const crdt_1 = require("../serialization/crdt");
|
|
6
6
|
const invariant_1 = require("../runtime/invariant");
|
|
7
7
|
const emptyReadonlySet = freezeSet(new Set());
|
|
8
|
-
const __GLOBAL_ENTITY = '__GLOBAL_ENTITY';
|
|
9
8
|
function frozenError() {
|
|
10
9
|
throw new Error('The set is frozen');
|
|
11
10
|
}
|
|
@@ -26,7 +25,6 @@ function createValueSetComponentDefinitionFromSchema(componentName, componentId,
|
|
|
26
25
|
const dirtyIterator = new Set();
|
|
27
26
|
const queuedCommands = [];
|
|
28
27
|
const onChangeCallbacks = new Map();
|
|
29
|
-
const validateCallbacks = new Map();
|
|
30
28
|
// only sort the array if the latest (N) element has a timestamp <= N-1
|
|
31
29
|
function shouldSort(row) {
|
|
32
30
|
const len = row.raw.length;
|
|
@@ -85,11 +83,8 @@ function createValueSetComponentDefinitionFromSchema(componentName, componentId,
|
|
|
85
83
|
has(entity) {
|
|
86
84
|
return data.has(entity);
|
|
87
85
|
},
|
|
88
|
-
entityDeleted(entity
|
|
86
|
+
entityDeleted(entity) {
|
|
89
87
|
data.delete(entity);
|
|
90
|
-
if (markAsDirty) {
|
|
91
|
-
// For grow-only sets, we don't need to mark as dirty since deletion doesn't generate CRDT messages
|
|
92
|
-
}
|
|
93
88
|
},
|
|
94
89
|
get(entity) {
|
|
95
90
|
const values = data.get(entity);
|
|
@@ -160,44 +155,6 @@ function createValueSetComponentDefinitionFromSchema(componentName, componentId,
|
|
|
160
155
|
for (const cb of cbs) {
|
|
161
156
|
cb(value);
|
|
162
157
|
}
|
|
163
|
-
},
|
|
164
|
-
__dry_run_updateFromCrdt(_body) {
|
|
165
|
-
return crdt_1.ProcessMessageResultType.StateUpdatedData;
|
|
166
|
-
},
|
|
167
|
-
validateBeforeChange(entityOrCb, cb) {
|
|
168
|
-
if (arguments.length === 1) {
|
|
169
|
-
// Second overload: just callback (global validation)
|
|
170
|
-
validateCallbacks.set(__GLOBAL_ENTITY, entityOrCb);
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
if (cb) {
|
|
174
|
-
validateCallbacks.set(entityOrCb, cb);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
__run_validateBeforeChange(entity, newValue, senderAddress, createdBy) {
|
|
179
|
-
const cb = entity && validateCallbacks.get(entity);
|
|
180
|
-
const globalCb = validateCallbacks.get(__GLOBAL_ENTITY);
|
|
181
|
-
const currentValue = [...this.get(entity).values()];
|
|
182
|
-
const value = { entity, currentValue: currentValue, newValue, senderAddress, createdBy };
|
|
183
|
-
const globalResult = globalCb?.(value) ?? true;
|
|
184
|
-
const entityResult = (globalResult && cb?.(value)) ?? true;
|
|
185
|
-
return globalResult && entityResult;
|
|
186
|
-
},
|
|
187
|
-
getCrdtState(entity) {
|
|
188
|
-
const row = data.get(entity);
|
|
189
|
-
if (!row || row.raw.length === 0) {
|
|
190
|
-
return null;
|
|
191
|
-
}
|
|
192
|
-
// For GrowOnlySet, we need to return the complete CRDT messages for all values
|
|
193
|
-
// This is complex because GrowOnlySet uses APPEND messages, not a single PUT
|
|
194
|
-
// For now, return null to indicate this component type doesn't support simple corrections
|
|
195
|
-
return null;
|
|
196
|
-
},
|
|
197
|
-
__forceUpdateFromCrdt(_msg) {
|
|
198
|
-
// GrowOnlySet doesn't support authoritative corrections in the same way as LWW
|
|
199
|
-
// since it uses APPEND_VALUE messages instead of PUT_COMPONENT messages
|
|
200
|
-
return [null, undefined];
|
|
201
158
|
}
|
|
202
159
|
};
|
|
203
160
|
return ret;
|