@dcl/ecs 7.25.1-30310486734.commit-5ffe873 → 7.25.1-30391610123.commit-26cb925

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 (79) hide show
  1. package/dist/components/generated/TouchScreenControls.gen.d.ts +1 -0
  2. package/dist/components/generated/TouchScreenControls.gen.js +25 -0
  3. package/dist/components/generated/UiInputBinding.gen.d.ts +1 -0
  4. package/dist/components/generated/UiInputBinding.gen.js +25 -0
  5. package/dist/components/generated/component-names.gen.js +2 -0
  6. package/dist/components/generated/global.gen.d.ts +4 -0
  7. package/dist/components/generated/global.gen.js +2 -0
  8. package/dist/components/generated/index.gen.d.ts +8 -0
  9. package/dist/components/generated/index.gen.js +10 -0
  10. package/dist/components/generated/pb/decentraland/sdk/components/avatar_emote_command.gen.d.ts +3 -2
  11. package/dist/components/generated/pb/decentraland/sdk/components/touch_screen_controls.gen.d.ts +63 -0
  12. package/dist/components/generated/pb/decentraland/sdk/components/touch_screen_controls.gen.js +125 -0
  13. package/dist/components/generated/pb/decentraland/sdk/components/ui_input_binding.gen.d.ts +36 -0
  14. package/dist/components/generated/pb/decentraland/sdk/components/ui_input_binding.gen.js +50 -0
  15. package/dist/components/generated/pb/decentraland/sdk/components/virtual_camera.gen.d.ts +3 -0
  16. package/dist/components/generated/pb/decentraland/sdk/components/virtual_camera.gen.js +10 -1
  17. package/dist/components/index.d.ts +0 -5
  18. package/dist/components/index.js +2 -5
  19. package/dist/components/manual/Transform.d.ts +0 -9
  20. package/dist/components/manual/Transform.js +3 -3
  21. package/dist/components/types.d.ts +0 -1
  22. package/dist/engine/component.d.ts +1 -52
  23. package/dist/engine/grow-only-value-set-component-definition.js +2 -45
  24. package/dist/engine/lww-element-set-component-definition.d.ts +1 -3
  25. package/dist/engine/lww-element-set-component-definition.js +13 -68
  26. package/dist/index.d.ts +1 -2
  27. package/dist/index.js +0 -1
  28. package/dist/serialization/crdt/index.d.ts +0 -1
  29. package/dist/serialization/crdt/index.js +0 -1
  30. package/dist/serialization/crdt/network/utils.d.ts +9 -0
  31. package/dist/serialization/crdt/network/utils.js +60 -0
  32. package/dist/serialization/crdt/types.d.ts +3 -25
  33. package/dist/serialization/crdt/types.js +1 -3
  34. package/dist/systems/crdt/index.d.ts +1 -0
  35. package/dist/systems/crdt/index.js +146 -55
  36. package/dist-cjs/components/generated/TouchScreenControls.gen.d.ts +1 -0
  37. package/dist-cjs/components/generated/TouchScreenControls.gen.js +28 -0
  38. package/dist-cjs/components/generated/UiInputBinding.gen.d.ts +1 -0
  39. package/dist-cjs/components/generated/UiInputBinding.gen.js +28 -0
  40. package/dist-cjs/components/generated/component-names.gen.js +2 -0
  41. package/dist-cjs/components/generated/global.gen.d.ts +4 -0
  42. package/dist-cjs/components/generated/global.gen.js +4 -2
  43. package/dist-cjs/components/generated/index.gen.d.ts +8 -0
  44. package/dist-cjs/components/generated/index.gen.js +14 -2
  45. package/dist-cjs/components/generated/pb/decentraland/sdk/components/avatar_emote_command.gen.d.ts +3 -2
  46. package/dist-cjs/components/generated/pb/decentraland/sdk/components/touch_screen_controls.gen.d.ts +63 -0
  47. package/dist-cjs/components/generated/pb/decentraland/sdk/components/touch_screen_controls.gen.js +131 -0
  48. package/dist-cjs/components/generated/pb/decentraland/sdk/components/ui_input_binding.gen.d.ts +36 -0
  49. package/dist-cjs/components/generated/pb/decentraland/sdk/components/ui_input_binding.gen.js +56 -0
  50. package/dist-cjs/components/generated/pb/decentraland/sdk/components/virtual_camera.gen.d.ts +3 -0
  51. package/dist-cjs/components/generated/pb/decentraland/sdk/components/virtual_camera.gen.js +10 -1
  52. package/dist-cjs/components/index.d.ts +0 -5
  53. package/dist-cjs/components/index.js +3 -7
  54. package/dist-cjs/components/manual/Transform.d.ts +0 -9
  55. package/dist-cjs/components/manual/Transform.js +3 -3
  56. package/dist-cjs/components/types.d.ts +0 -1
  57. package/dist-cjs/engine/component.d.ts +1 -52
  58. package/dist-cjs/engine/grow-only-value-set-component-definition.js +1 -44
  59. package/dist-cjs/engine/lww-element-set-component-definition.d.ts +1 -3
  60. package/dist-cjs/engine/lww-element-set-component-definition.js +14 -71
  61. package/dist-cjs/index.d.ts +1 -2
  62. package/dist-cjs/index.js +1 -2
  63. package/dist-cjs/serialization/crdt/index.d.ts +0 -1
  64. package/dist-cjs/serialization/crdt/index.js +0 -1
  65. package/dist-cjs/serialization/crdt/network/utils.d.ts +9 -0
  66. package/dist-cjs/serialization/crdt/network/utils.js +67 -0
  67. package/dist-cjs/serialization/crdt/types.d.ts +3 -25
  68. package/dist-cjs/serialization/crdt/types.js +1 -3
  69. package/dist-cjs/systems/crdt/index.d.ts +1 -0
  70. package/dist-cjs/systems/crdt/index.js +169 -55
  71. package/package.json +2 -2
  72. package/dist/components/manual/CreatedBy.d.ts +0 -9
  73. package/dist/components/manual/CreatedBy.js +0 -8
  74. package/dist/serialization/crdt/authoritativePutComponent.d.ts +0 -15
  75. package/dist/serialization/crdt/authoritativePutComponent.js +0 -47
  76. package/dist-cjs/components/manual/CreatedBy.d.ts +0 -9
  77. package/dist-cjs/components/manual/CreatedBy.js +0 -10
  78. package/dist-cjs/serialization/crdt/authoritativePutComponent.d.ts +0 -15
  79. package/dist-cjs/serialization/crdt/authoritativePutComponent.js +0 -50
@@ -0,0 +1,63 @@
1
+ import _m0 from "protobufjs/minimal";
2
+ import { TextureUnion } from "../../common/texture.gen";
3
+ import { InputAction } from "./common/input_action.gen";
4
+ /**
5
+ * The TouchScreenControls component lets a scene configure the native on-screen touch
6
+ * controls (the mobile joystick + gamepad). It must be set on the RootEntity.
7
+ *
8
+ * By default every on-screen button is shown; list a button in `touch_inputs` with
9
+ * `hide = true` to remove it (declutter). `main_action` picks which action the large
10
+ * central button triggers, and `hide_joystick` removes the native virtual joystick. It is
11
+ * a no-op on platforms without native on-screen controls (e.g. desktop).
12
+ *
13
+ * Accepted actions: only the on-screen gamepad actions map to a button — `IA_POINTER`,
14
+ * `IA_PRIMARY`, `IA_SECONDARY`, `IA_JUMP`, and `IA_ACTION_3`..`IA_ACTION_6`. Any other
15
+ * `InputAction` (movement actions, `IA_ANY`, `IA_MODIFIER`, or unknown/future values) is
16
+ * ignored: a `TouchInput` entry naming a non-button action has no effect, and a `main_action`
17
+ * that isn't a valid gamepad action falls back to the default central button (`IA_JUMP`).
18
+ */
19
+ /**
20
+ * @public
21
+ */
22
+ export interface PBTouchScreenControls {
23
+ touchInputs: PBTouchScreenControls_TouchInput[];
24
+ /**
25
+ * The large central button's action. Only the gamepad actions are valid:
26
+ * jump / pointer / primary (E) / secondary (F) / action_3..action_6 (1/2/3/4).
27
+ * When unset, the default central button (jump) is kept.
28
+ */
29
+ mainAction?: InputAction | undefined;
30
+ /** hide the native virtual joystick */
31
+ hideJoystick: boolean;
32
+ /** hide the on-screen crosshair / reticle */
33
+ hideCrosshair: boolean;
34
+ }
35
+ /** Per-button configuration. A button not listed here keeps its default (shown). */
36
+ /**
37
+ * @public
38
+ */
39
+ export interface PBTouchScreenControls_TouchInput {
40
+ /** which on-screen button this configures */
41
+ inputAction: InputAction;
42
+ /** hide this button (default: shown) */
43
+ hide: boolean;
44
+ /**
45
+ * Override the button glyph with this texture. For the jump button it replaces all
46
+ * of its dynamic states (jump / double-jump / glide).
47
+ */
48
+ icon?: TextureUnion | undefined;
49
+ }
50
+ /**
51
+ * @public
52
+ */
53
+ export declare namespace PBTouchScreenControls {
54
+ function encode(message: PBTouchScreenControls, writer?: _m0.Writer): _m0.Writer;
55
+ function decode(input: _m0.Reader | Uint8Array, length?: number): PBTouchScreenControls;
56
+ }
57
+ /**
58
+ * @public
59
+ */
60
+ export declare namespace PBTouchScreenControls_TouchInput {
61
+ function encode(message: PBTouchScreenControls_TouchInput, writer?: _m0.Writer): _m0.Writer;
62
+ function decode(input: _m0.Reader | Uint8Array, length?: number): PBTouchScreenControls_TouchInput;
63
+ }
@@ -0,0 +1,131 @@
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.PBTouchScreenControls_TouchInput = exports.PBTouchScreenControls = void 0;
7
+ /* eslint-disable */
8
+ const minimal_1 = __importDefault(require("protobufjs/minimal"));
9
+ const texture_gen_1 = require("../../common/texture.gen");
10
+ const protobufPackageSarasa = "decentraland.sdk.components";
11
+ function createBasePBTouchScreenControls() {
12
+ return { touchInputs: [], mainAction: undefined, hideJoystick: false, hideCrosshair: false };
13
+ }
14
+ /**
15
+ * @public
16
+ */
17
+ var PBTouchScreenControls;
18
+ (function (PBTouchScreenControls) {
19
+ function encode(message, writer = minimal_1.default.Writer.create()) {
20
+ for (const v of message.touchInputs) {
21
+ PBTouchScreenControls_TouchInput.encode(v, writer.uint32(10).fork()).ldelim();
22
+ }
23
+ if (message.mainAction !== undefined) {
24
+ writer.uint32(16).int32(message.mainAction);
25
+ }
26
+ if (message.hideJoystick === true) {
27
+ writer.uint32(24).bool(message.hideJoystick);
28
+ }
29
+ if (message.hideCrosshair === true) {
30
+ writer.uint32(32).bool(message.hideCrosshair);
31
+ }
32
+ return writer;
33
+ }
34
+ PBTouchScreenControls.encode = encode;
35
+ function decode(input, length) {
36
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
37
+ let end = length === undefined ? reader.len : reader.pos + length;
38
+ const message = createBasePBTouchScreenControls();
39
+ while (reader.pos < end) {
40
+ const tag = reader.uint32();
41
+ switch (tag >>> 3) {
42
+ case 1:
43
+ if (tag !== 10) {
44
+ break;
45
+ }
46
+ message.touchInputs.push(PBTouchScreenControls_TouchInput.decode(reader, reader.uint32()));
47
+ continue;
48
+ case 2:
49
+ if (tag !== 16) {
50
+ break;
51
+ }
52
+ message.mainAction = reader.int32();
53
+ continue;
54
+ case 3:
55
+ if (tag !== 24) {
56
+ break;
57
+ }
58
+ message.hideJoystick = reader.bool();
59
+ continue;
60
+ case 4:
61
+ if (tag !== 32) {
62
+ break;
63
+ }
64
+ message.hideCrosshair = reader.bool();
65
+ continue;
66
+ }
67
+ if ((tag & 7) === 4 || tag === 0) {
68
+ break;
69
+ }
70
+ reader.skipType(tag & 7);
71
+ }
72
+ return message;
73
+ }
74
+ PBTouchScreenControls.decode = decode;
75
+ })(PBTouchScreenControls = exports.PBTouchScreenControls || (exports.PBTouchScreenControls = {}));
76
+ function createBasePBTouchScreenControls_TouchInput() {
77
+ return { inputAction: 0, hide: false, icon: undefined };
78
+ }
79
+ /**
80
+ * @public
81
+ */
82
+ var PBTouchScreenControls_TouchInput;
83
+ (function (PBTouchScreenControls_TouchInput) {
84
+ function encode(message, writer = minimal_1.default.Writer.create()) {
85
+ if (message.inputAction !== 0) {
86
+ writer.uint32(8).int32(message.inputAction);
87
+ }
88
+ if (message.hide === true) {
89
+ writer.uint32(16).bool(message.hide);
90
+ }
91
+ if (message.icon !== undefined) {
92
+ texture_gen_1.TextureUnion.encode(message.icon, writer.uint32(26).fork()).ldelim();
93
+ }
94
+ return writer;
95
+ }
96
+ PBTouchScreenControls_TouchInput.encode = encode;
97
+ function decode(input, length) {
98
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
99
+ let end = length === undefined ? reader.len : reader.pos + length;
100
+ const message = createBasePBTouchScreenControls_TouchInput();
101
+ while (reader.pos < end) {
102
+ const tag = reader.uint32();
103
+ switch (tag >>> 3) {
104
+ case 1:
105
+ if (tag !== 8) {
106
+ break;
107
+ }
108
+ message.inputAction = reader.int32();
109
+ continue;
110
+ case 2:
111
+ if (tag !== 16) {
112
+ break;
113
+ }
114
+ message.hide = reader.bool();
115
+ continue;
116
+ case 3:
117
+ if (tag !== 26) {
118
+ break;
119
+ }
120
+ message.icon = texture_gen_1.TextureUnion.decode(reader, reader.uint32());
121
+ continue;
122
+ }
123
+ if ((tag & 7) === 4 || tag === 0) {
124
+ break;
125
+ }
126
+ reader.skipType(tag & 7);
127
+ }
128
+ return message;
129
+ }
130
+ PBTouchScreenControls_TouchInput.decode = decode;
131
+ })(PBTouchScreenControls_TouchInput = exports.PBTouchScreenControls_TouchInput || (exports.PBTouchScreenControls_TouchInput = {}));
@@ -0,0 +1,36 @@
1
+ import _m0 from "protobufjs/minimal";
2
+ import { InputAction } from "./common/input_action.gen";
3
+ /**
4
+ * The UiInputBinding component binds a UI entity to one or more InputActions. While the
5
+ * element is pressed (touch or pointer) the listed actions are held down, driving both
6
+ * the local player input and scene InputAction listeners, just like the native on-screen
7
+ * buttons. It is typically combined with PBTouchScreenControls to replace the native
8
+ * controls with a custom touch UI.
9
+ *
10
+ * Release semantics: the held actions are released as soon as the press that started them
11
+ * ends. A renderer MUST release all actions held by this binding when any of the following
12
+ * happens: the press/touch is lifted or cancelled, the pointer/touch leaves the element
13
+ * (loses press ownership), the actions list changes (the previous set is released before
14
+ * the new set is applied), the component is removed or its actions list becomes empty, the
15
+ * UI element is hidden, disabled or removed from the tree, or the scene unloads. In short,
16
+ * no action may remain held once the element is no longer both present and actively pressed.
17
+ *
18
+ * Multi-touch: the binding is a single held state, not reference-counted per pointer. The
19
+ * actions are held while the element is pressed and released when that press ends; a second
20
+ * simultaneous press on the same element does not stack, and does not extend the hold past
21
+ * the first release.
22
+ */
23
+ /**
24
+ * @public
25
+ */
26
+ export interface PBUiInputBinding {
27
+ /** the input actions fired while this element is pressed */
28
+ actions: InputAction[];
29
+ }
30
+ /**
31
+ * @public
32
+ */
33
+ export declare namespace PBUiInputBinding {
34
+ function encode(message: PBUiInputBinding, writer?: _m0.Writer): _m0.Writer;
35
+ function decode(input: _m0.Reader | Uint8Array, length?: number): PBUiInputBinding;
36
+ }
@@ -0,0 +1,56 @@
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.PBUiInputBinding = void 0;
7
+ /* eslint-disable */
8
+ const minimal_1 = __importDefault(require("protobufjs/minimal"));
9
+ const protobufPackageSarasa = "decentraland.sdk.components";
10
+ function createBasePBUiInputBinding() {
11
+ return { actions: [] };
12
+ }
13
+ /**
14
+ * @public
15
+ */
16
+ var PBUiInputBinding;
17
+ (function (PBUiInputBinding) {
18
+ function encode(message, writer = minimal_1.default.Writer.create()) {
19
+ writer.uint32(10).fork();
20
+ for (const v of message.actions) {
21
+ writer.int32(v);
22
+ }
23
+ writer.ldelim();
24
+ return writer;
25
+ }
26
+ PBUiInputBinding.encode = encode;
27
+ function decode(input, length) {
28
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
29
+ let end = length === undefined ? reader.len : reader.pos + length;
30
+ const message = createBasePBUiInputBinding();
31
+ while (reader.pos < end) {
32
+ const tag = reader.uint32();
33
+ switch (tag >>> 3) {
34
+ case 1:
35
+ if (tag === 8) {
36
+ message.actions.push(reader.int32());
37
+ continue;
38
+ }
39
+ if (tag === 10) {
40
+ const end2 = reader.uint32() + reader.pos;
41
+ while (reader.pos < end2) {
42
+ message.actions.push(reader.int32());
43
+ }
44
+ continue;
45
+ }
46
+ break;
47
+ }
48
+ if ((tag & 7) === 4 || tag === 0) {
49
+ break;
50
+ }
51
+ reader.skipType(tag & 7);
52
+ }
53
+ return message;
54
+ }
55
+ PBUiInputBinding.decode = decode;
56
+ })(PBUiInputBinding = exports.PBUiInputBinding || (exports.PBUiInputBinding = {}));
@@ -6,6 +6,7 @@ import { CameraTransition } from "./common/camera_transition.gen";
6
6
  * an 'instant' transition (like using speed/time = 0)
7
7
  * * The lookAtEntity defines to which entity the Camera has to look at constantly (independent from
8
8
  * the holding entity transform).
9
+ * * The fov defines the Field of View of the virtual camera
9
10
  */
10
11
  /**
11
12
  * @public
@@ -13,6 +14,8 @@ import { CameraTransition } from "./common/camera_transition.gen";
13
14
  export interface PBVirtualCamera {
14
15
  defaultTransition?: CameraTransition | undefined;
15
16
  lookAtEntity?: number | undefined;
17
+ /** default: 60 */
18
+ fov?: number | undefined;
16
19
  }
17
20
  /**
18
21
  * @public
@@ -9,7 +9,7 @@ const minimal_1 = __importDefault(require("protobufjs/minimal"));
9
9
  const camera_transition_gen_1 = require("./common/camera_transition.gen");
10
10
  const protobufPackageSarasa = "decentraland.sdk.components";
11
11
  function createBasePBVirtualCamera() {
12
- return { defaultTransition: undefined, lookAtEntity: undefined };
12
+ return { defaultTransition: undefined, lookAtEntity: undefined, fov: undefined };
13
13
  }
14
14
  /**
15
15
  * @public
@@ -23,6 +23,9 @@ var PBVirtualCamera;
23
23
  if (message.lookAtEntity !== undefined) {
24
24
  writer.uint32(16).uint32(message.lookAtEntity);
25
25
  }
26
+ if (message.fov !== undefined) {
27
+ writer.uint32(29).float(message.fov);
28
+ }
26
29
  return writer;
27
30
  }
28
31
  PBVirtualCamera.encode = encode;
@@ -45,6 +48,12 @@ var PBVirtualCamera;
45
48
  }
46
49
  message.lookAtEntity = reader.uint32();
47
50
  continue;
51
+ case 3:
52
+ if (tag !== 29) {
53
+ break;
54
+ }
55
+ message.fov = reader.float();
56
+ continue;
48
57
  }
49
58
  if ((tag & 7) === 4 || tag === 0) {
50
59
  break;
@@ -22,7 +22,6 @@ import { LightSourceComponentDefinitionExtended } from './extended/LightSource';
22
22
  import { TriggerAreaComponentDefinitionExtended } from './extended/TriggerArea';
23
23
  import { ParticleSystemComponentDefinitionExtended } from './extended/ParticleSystem';
24
24
  import { TagsComponentDefinitionExtended } from './manual/Tags';
25
- import { ICreatedByType } from './manual/CreatedBy';
26
25
  export * from './generated/index.gen';
27
26
  export type { GrowOnlyValueSetComponentDefinition, LastWriteWinElementSetComponentDefinition, LwwComponentGetter, GSetComponentGetter };
28
27
  export declare const Transform: LwwComponentGetter<TransformComponentExtended>;
@@ -56,9 +55,5 @@ export declare const NetworkEntity: (engine: Pick<IEngine, 'defineComponent'>) =
56
55
  * @alpha
57
56
  */
58
57
  export declare const NetworkParent: (engine: Pick<IEngine, 'defineComponent'>) => LastWriteWinElementSetComponentDefinition<INetowrkParentType>;
59
- /**
60
- * @public
61
- */
62
- export declare const CreatedBy: (engine: Pick<IEngine, 'defineComponent'>) => LastWriteWinElementSetComponentDefinition<ICreatedByType>;
63
58
  export { MediaState };
64
59
  export type { AudioAnalysisView };
@@ -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.CreatedBy = exports.NetworkParent = exports.NetworkEntity = exports.SyncComponents = exports.Tags = exports.Name = exports.ParticleSystem = exports.TriggerArea = exports.LightSource = exports.InputModifier = exports.VirtualCamera = exports.Tween = exports.MeshCollider = exports.MeshRenderer = exports.AudioStream = exports.AudioAnalysis = exports.AudioSource = exports.Animator = exports.Material = exports.Transform = void 0;
20
+ exports.MediaState = exports.NetworkParent = exports.NetworkEntity = exports.SyncComponents = exports.Tags = exports.Name = exports.ParticleSystem = exports.TriggerArea = exports.LightSource = exports.InputModifier = exports.VirtualCamera = exports.Tween = exports.MeshCollider = exports.MeshRenderer = exports.AudioStream = exports.AudioAnalysis = 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 AudioAnalysis_1 = require("./extended/AudioAnalysis");
@@ -39,7 +39,6 @@ const LightSource_1 = require("./extended/LightSource");
39
39
  const TriggerArea_1 = require("./extended/TriggerArea");
40
40
  const ParticleSystem_1 = require("./extended/ParticleSystem");
41
41
  const Tags_1 = __importDefault(require("./manual/Tags"));
42
- const CreatedBy_1 = __importDefault(require("./manual/CreatedBy"));
43
42
  __exportStar(require("./generated/index.gen"), exports);
44
43
  /* @__PURE__ */
45
44
  const Transform = (engine) => (0, Transform_1.defineTransformComponent)(engine);
@@ -101,15 +100,12 @@ exports.SyncComponents = SyncComponents;
101
100
  /**
102
101
  * @alpha
103
102
  */
103
+ /* @__PURE__ */
104
104
  const NetworkEntity = (engine) => (0, NetworkEntity_1.default)(engine);
105
105
  exports.NetworkEntity = NetworkEntity;
106
106
  /**
107
107
  * @alpha
108
108
  */
109
+ /* @__PURE__ */
109
110
  const NetworkParent = (engine) => (0, NetworkParent_1.default)(engine);
110
111
  exports.NetworkParent = NetworkParent;
111
- /**
112
- * @public
113
- */
114
- const CreatedBy = (engine) => (0, CreatedBy_1.default)(engine);
115
- 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
  import type { Vector3Type } from '../../schemas/custom/Vector3';
5
4
  /**
6
5
  * @public
@@ -25,10 +24,6 @@ export interface TransformComponentExtended extends TransformComponent {
25
24
  */
26
25
  localToWorldDirection(entity: Entity, localDirection: Vector3Type): Vector3Type;
27
26
  }
28
- /**
29
- * @public
30
- */
31
- export declare const COMPONENT_ID = 1;
32
27
  /**
33
28
  * @public
34
29
  */
@@ -51,10 +46,6 @@ export type TransformType = {
51
46
  };
52
47
  parent?: Entity;
53
48
  };
54
- /** @public */
55
- export declare const TRANSFORM_LENGTH = 44;
56
- /** @public */
57
- export declare const TransformSchema: ISchema<TransformType>;
58
49
  /**
59
50
  * @public
60
51
  */
@@ -29,12 +29,12 @@ exports.defineTransformComponent = exports.TransformSchema = exports.TRANSFORM_L
29
29
  // getters via __importStar in CJS), so by the time methods are called all exports are available.
30
30
  const treeHelpers = __importStar(require("../../runtime/helpers/tree"));
31
31
  /**
32
- * @public
32
+ * @internal
33
33
  */
34
34
  exports.COMPONENT_ID = 1;
35
- /** @public */
35
+ /** @internal */
36
36
  exports.TRANSFORM_LENGTH = 44;
37
- /** @public */
37
+ /** @internal */
38
38
  exports.TransformSchema = {
39
39
  serialize(value, builder) {
40
40
  const ptr = builder.incrementWriteOffset(exports.TRANSFORM_LENGTH);
@@ -13,7 +13,6 @@ export type { TagsComponentDefinitionExtended, TagsType } from './manual/Tags';
13
13
  export type { ISyncComponents, ISyncComponentsType } from './manual/SyncComponents';
14
14
  export type { INetowrkEntity, INetowrkEntityType } from './manual/NetworkEntity';
15
15
  export type { INetowrkParent, INetowrkParentType } from './manual/NetworkParent';
16
- export type { ICreatedBy, ICreatedByType } from './manual/CreatedBy';
17
16
  export type { InputModifierHelper, InputModifierComponentDefinitionExtended } from './extended/InputModifier';
18
17
  export type { LightSourceHelper, LightSourceComponentDefinitionExtended } from './extended/LightSource';
19
18
  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, ProcessMessageResultType, PutComponentMessageBody } from '../serialization/crdt';
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, markAsDirty) {
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;
@@ -1,10 +1,8 @@
1
1
  import { ISchema } from '../schemas';
2
2
  import { ByteBuffer } from '../serialization/ByteBuffer';
3
- import { PutComponentMessageBody, DeleteComponentMessageBody, ProcessMessageResultType, CrdtMessageBody, PutNetworkComponentMessageBody, DeleteComponentNetworkMessageBody, AuthoritativePutComponentMessageBody } from '../serialization/crdt';
3
+ import { PutComponentMessageBody, DeleteComponentMessageBody, CrdtMessageBody } from '../serialization/crdt';
4
4
  import { Entity } from './entity';
5
5
  export declare function incrementTimestamp(entity: Entity, timestamps: Map<Entity, number>): number;
6
6
  export declare function createDumpLwwFunctionFromCrdt(componentId: number, timestamps: Map<Entity, number>, schema: Pick<ISchema<any>, 'serialize' | 'deserialize'>, data: Map<Entity, unknown>): (buffer: ByteBuffer, filterEntity?: ((entity: Entity) => boolean) | undefined) => void;
7
- export declare function createCrdtRuleValidator(timestamps: Map<Entity, number>, schema: Pick<ISchema<any>, 'serialize' | 'deserialize'>, data: Map<Entity, unknown>, lastSentData: Map<Entity, Uint8Array>): (message: PutComponentMessageBody | DeleteComponentMessageBody | PutNetworkComponentMessageBody | DeleteComponentNetworkMessageBody) => ProcessMessageResultType;
8
- export declare function createForceUpdateLwwFromCrdt(componentId: number, timestamps: Map<Entity, number>, schema: Pick<ISchema<any>, 'serialize' | 'deserialize'>, data: Map<Entity, unknown>): (msg: AuthoritativePutComponentMessageBody) => [null, any];
9
7
  export declare function createUpdateLwwFromCrdt(componentId: number, timestamps: Map<Entity, number>, schema: Pick<ISchema<any>, 'serialize' | 'deserialize'>, data: Map<Entity, unknown>, lastSentData: Map<Entity, Uint8Array>): (msg: CrdtMessageBody) => [null | PutComponentMessageBody | DeleteComponentMessageBody, any];
10
8
  export declare function createGetCrdtMessagesForLww(componentId: number, timestamps: Map<Entity, number>, dirtyIterator: Set<Entity>, schema: Pick<ISchema<any>, 'serialize'>, data: Map<Entity, unknown>, lastSentData: Map<Entity, Uint8Array>): () => Generator<PutComponentMessageBody | DeleteComponentMessageBody, void, unknown>;