@tldraw/editor 5.2.0-canary.9ef8e979cbfc → 5.2.0-canary.a1c843a2b505
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/README.md +1 -1
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/lib/editor/Editor.js +17 -3
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.js +1 -1
- package/dist-cjs/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.js.map +2 -2
- package/dist-cjs/version.js +3 -3
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/editor/Editor.mjs +17 -3
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.mjs +1 -1
- package/dist-esm/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/package.json +7 -7
- package/src/lib/editor/Editor.ts +24 -3
- package/src/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.test.ts +14 -0
- package/src/lib/editor/managers/CollaboratorsManager/CollaboratorsManager.ts +6 -3
- package/src/version.ts +3 -3
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ You can find tldraw on npm [here](https://www.npmjs.com/package/@tldraw/tldraw?a
|
|
|
20
20
|
|
|
21
21
|
## Contribution
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Found a bug? Please [submit an issue](https://github.com/tldraw/tldraw/issues/new).
|
|
24
24
|
|
|
25
25
|
## Community
|
|
26
26
|
|
package/dist-cjs/index.js
CHANGED
|
@@ -379,7 +379,7 @@ var import_uniq = require("./lib/utils/uniq");
|
|
|
379
379
|
var import_defaultThemes2 = require("./lib/editor/managers/ThemeManager/defaultThemes");
|
|
380
380
|
(0, import_utils.registerTldrawLibraryVersion)(
|
|
381
381
|
"@tldraw/editor",
|
|
382
|
-
"5.2.0-canary.
|
|
382
|
+
"5.2.0-canary.a1c843a2b505",
|
|
383
383
|
"cjs"
|
|
384
384
|
);
|
|
385
385
|
//# sourceMappingURL=index.js.map
|
|
@@ -2862,14 +2862,25 @@ class Editor extends import_eventemitter3.default {
|
|
|
2862
2862
|
this.off("stop-camera-animation", cancel);
|
|
2863
2863
|
};
|
|
2864
2864
|
this.once("stop-camera-animation", cancel);
|
|
2865
|
+
const dirZ = direction.z ?? 0;
|
|
2865
2866
|
const moveCamera = (elapsed) => {
|
|
2866
2867
|
const { x: cx, y: cy, z: cz } = this.getCamera();
|
|
2867
|
-
const
|
|
2868
|
+
const dx = direction.x * (currentSpeed * elapsed) / cz;
|
|
2869
|
+
const dy = direction.y * (currentSpeed * elapsed) / cz;
|
|
2870
|
+
let newCx = cx + dx;
|
|
2871
|
+
let newCy = cy + dy;
|
|
2872
|
+
let newCz = cz;
|
|
2873
|
+
if (dirZ !== 0) {
|
|
2874
|
+
newCz = cz * (1 + dirZ * currentSpeed * elapsed);
|
|
2875
|
+
const center = this.getViewportScreenCenter();
|
|
2876
|
+
newCx += center.x / newCz - center.x / cz;
|
|
2877
|
+
newCy += center.y / newCz - center.y / cz;
|
|
2878
|
+
}
|
|
2868
2879
|
currentSpeed *= 1 - friction;
|
|
2869
2880
|
if (currentSpeed < speedThreshold) {
|
|
2870
2881
|
cancel();
|
|
2871
2882
|
} else {
|
|
2872
|
-
this._setCamera(new import_Vec.Vec(
|
|
2883
|
+
this._setCamera(new import_Vec.Vec(newCx, newCy, newCz));
|
|
2873
2884
|
}
|
|
2874
2885
|
};
|
|
2875
2886
|
this.on("tick", moveCamera);
|
|
@@ -8237,7 +8248,10 @@ class Editor extends import_eventemitter3.default {
|
|
|
8237
8248
|
}
|
|
8238
8249
|
}
|
|
8239
8250
|
if (slideSpeed > 0) {
|
|
8240
|
-
this.slideCamera({
|
|
8251
|
+
this.slideCamera({
|
|
8252
|
+
speed: slideSpeed,
|
|
8253
|
+
direction: { x: slideDirection.x, y: slideDirection.y, z: 0 }
|
|
8254
|
+
});
|
|
8241
8255
|
}
|
|
8242
8256
|
} else {
|
|
8243
8257
|
if (info.button === import_constants.STYLUS_ERASER_BUTTON) {
|