@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.
@@ -1,11 +1,6 @@
1
1
  import type { BoardStore, Point } from "@edv4h/usketch-shared";
2
- /** ビューポート(キャンバス)のサイズ。テスト等で window が無い場合は既定値。 */
3
- export declare function getScreenSize(): {
4
- width: number;
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":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE/D,gDAAgD;AAChD,wBAAgB,aAAa,IAAI;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAGjE;AAED,0BAA0B;AAC1B,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,KAAK,CAO1D;AAED,+CAA+C;AAC/C,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,GAAG,IAAI,CAQvE"}
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"}
@@ -1,26 +1,7 @@
1
- /** ビューポート(キャンバス)のサイズ。テスト等で window が無い場合は既定値。 */
2
- export function getScreenSize() {
3
- if (typeof window === "undefined")
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
- const { width, height } = getScreenSize();
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":"AAEA,gDAAgD;AAChD,MAAM,UAAU,aAAa;IAC5B,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IACvE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,WAAW,EAA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6 +1,6 @@
1
1
  {
2
2
  "name": "@edv4h/usketch-plugin-tool-vim",
3
- "version": "0.1.6",
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-core": "2.3.0",
18
- "@edv4h/usketch-shared": "4.7.0",
19
- "@edv4h/usketch-store": "3.4.1",
20
- "@edv4h/usketch-tool-helpers": "0.6.1"
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"