@edv4h/usketch-plugin-tool-vim 0.1.6 → 0.1.7
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/viewport-utils.d.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { BoardStore, Point } from "@edv4h/usketch-shared";
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
height: number;
|
|
6
|
-
};
|
|
7
|
-
/** 画面中央に対応する world 座標。 */
|
|
8
|
-
export declare function screenCenterWorld(store: BoardStore): Point;
|
|
9
|
-
/** world 座標 `target` が画面中央に来るようビューポートを移動する。 */
|
|
2
|
+
import { getScreenSize, screenCenterWorld } from "@edv4h/usketch-shared";
|
|
3
|
+
export { getScreenSize, screenCenterWorld };
|
|
4
|
+
/** world 座標 `target` が画面中央に来るようビューポートを移動する(スムーズ)。 */
|
|
10
5
|
export declare function centerViewportOn(store: BoardStore, target: Point): void;
|
|
11
6
|
//# sourceMappingURL=viewport-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewport-utils.d.ts","sourceRoot":"","sources":["../src/viewport-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"viewport-utils.d.ts","sourceRoot":"","sources":["../src/viewport-utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAiB,aAAa,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAExF,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,CAAC;AAE5C,qDAAqD;AACrD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,GAAG,IAAI,CAEvE"}
|
package/dist/viewport-utils.js
CHANGED
|
@@ -1,26 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
return { width: 1280, height: 720 };
|
|
5
|
-
return { width: window.innerWidth, height: window.innerHeight };
|
|
6
|
-
}
|
|
7
|
-
/** 画面中央に対応する world 座標。 */
|
|
8
|
-
export function screenCenterWorld(store) {
|
|
9
|
-
const { width, height } = getScreenSize();
|
|
10
|
-
const vp = store.getViewport();
|
|
11
|
-
return {
|
|
12
|
-
x: (width / 2 - vp.x) / vp.zoom,
|
|
13
|
-
y: (height / 2 - vp.y) / vp.zoom,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
/** world 座標 `target` が画面中央に来るようビューポートを移動する。 */
|
|
1
|
+
import { centerOnWorld, getScreenSize, screenCenterWorld } from "@edv4h/usketch-shared";
|
|
2
|
+
export { getScreenSize, screenCenterWorld };
|
|
3
|
+
/** world 座標 `target` が画面中央に来るようビューポートを移動する(スムーズ)。 */
|
|
17
4
|
export function centerViewportOn(store, target) {
|
|
18
|
-
|
|
19
|
-
const vp = store.getViewport();
|
|
20
|
-
store.setViewport({
|
|
21
|
-
x: width / 2 - target.x * vp.zoom,
|
|
22
|
-
y: height / 2 - target.y * vp.zoom,
|
|
23
|
-
zoom: vp.zoom,
|
|
24
|
-
});
|
|
5
|
+
centerOnWorld(store, target);
|
|
25
6
|
}
|
|
26
7
|
//# sourceMappingURL=viewport-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewport-utils.js","sourceRoot":"","sources":["../src/viewport-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"viewport-utils.js","sourceRoot":"","sources":["../src/viewport-utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAExF,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,CAAC;AAE5C,qDAAqD;AACrD,MAAM,UAAU,gBAAgB,CAAC,KAAiB,EAAE,MAAa;IAChE,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC9B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edv4h/usketch-plugin-tool-vim",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"xstate": "^5.18.0",
|
|
16
16
|
"zod": "^4.0.0",
|
|
17
|
-
"@edv4h/usketch-
|
|
18
|
-
"@edv4h/usketch-
|
|
19
|
-
"@edv4h/usketch-store": "3.
|
|
20
|
-
"@edv4h/usketch-tool-helpers": "0.6.
|
|
17
|
+
"@edv4h/usketch-shared": "4.8.0",
|
|
18
|
+
"@edv4h/usketch-core": "2.3.1",
|
|
19
|
+
"@edv4h/usketch-store": "3.5.0",
|
|
20
|
+
"@edv4h/usketch-tool-helpers": "0.6.2"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": ">=19"
|