genshin-interface 3.8.1 → 3.9.0

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/index.d.ts CHANGED
@@ -165,6 +165,9 @@ export declare const ORNAMENT_END_PATH = "M 210.5 53 L 216.5 53 L 224 59.5 L 227
165
165
  export declare const SERVER_MARK_DIAMOND_PATH = "M 23.44 6.62 L 24.44 7.25 L 25.88 8.56 L 26.31 9.12 L 28 10.56 L 28.56 11.25 L 28.88 11.44 L 29.44 12.12 L 30.25 12.81 Q 30.16 13.09 30.44 13 L 32.19 15 L 32.69 15.38 L 32.88 15.38 L 32.88 15.56 L 33.5 16.31 L 36.44 19.25 L 37.12 19.81 L 38.44 21.25 L 38.88 21.56 L 39.44 22.25 L 39.88 22.56 L 40.56 23.38 Q 40.84 23.28 40.75 23.56 Q 41.29 23.84 41.12 24.81 L 39.94 26.12 L 38.88 27.06 L 38.06 28 L 35.88 30.06 L 31.56 34.62 L 30.88 35.06 L 27.81 38.25 L 26.88 39.06 L 24.44 41.62 L 23.94 41.88 L 23.06 41.88 L 22.69 41.75 L 22.25 41.31 L 21.69 40.62 Q 21.41 40.72 21.5 40.44 L 19.12 38.19 L 18.94 37.88 L 18.25 37.31 L 17.69 36.62 L 17.38 36.44 L 17.19 36.12 L 16.25 35.44 L 15.56 34.62 Q 15.28 34.72 15.38 34.44 L 13.06 32 L 10.25 29.44 L 8.81 27.88 L 8.12 27.31 L 6.12 25.19 L 5.75 24.69 L 5.75 24.19 L 6 23.69 L 7.69 22 Q 7.97 22.09 7.88 21.81 Q 8.31 21.66 8.25 21.25 L 8.44 21.25 L 8.94 20.88 L 11 18.81 L 11.12 18.38 L 11.31 18.38 L 12.12 17.69 L 12.81 16.88 L 13.12 16.69 L 14.31 15.38 L 15.12 14.69 L 15.31 14.38 L 16.12 13.69 L 16.44 13.12 L 17 12.88 L 17 12.69 L 17.56 12.12 L 18.12 11.69 L 18.44 11.25 L 19.12 10.69 L 19.56 10.12 L 20.12 9.69 L 20.38 9.12 L 20.56 9.12 L 22.69 7.12 L 23.44 6.62 Z";
166
166
  export declare const SERVER_MARK_TICK_PATH = "M 30.12 16.88 L 29.88 17 L 29.5 17.62 L 27 20.25 L 25.25 21.88 L 24 23.25 L 23.75 23.75 L 23.62 23.75 L 22.75 24.62 Q 22.88 24.88 22.62 24.75 L 21.88 25.62 L 20.62 26.62 L 20.25 26.5 L 19.62 26 L 19.12 25.5 L 18.62 25 L 18.12 24.5 L 16.75 23.25 L 16 23 L 15.62 23 L 15 23.25 Q 14.25 23.62 14 24.5 L 14 25.62 L 14.25 26.25 L 14.75 26.88 L 15.12 27 L 17.75 30 L 18.25 30.75 L 19.88 32 L 20.88 32 L 21.88 31.25 L 22.25 30.75 L 22.88 30.25 L 23.25 29.75 L 23.88 29.25 L 24.38 28.62 L 24.75 28.38 L 25.38 27.62 L 25.88 27.25 L 26.25 26.75 L 26.88 26.25 L 27.12 25.88 L 28 25.12 L 28.38 24.5 L 28.88 24.12 L 29.25 23.62 L 29.62 23.38 Q 30 23 30.25 22.5 L 31 22 L 31.12 21.75 L 31.88 21.12 L 33 20 Q 33.25 19.75 33.12 19.25 L 33.25 19.12 L 33.12 18.38 L 32.62 17.75 L 31.88 17 Q 31.25 17.12 31.25 16.88 L 30.12 16.88 Z";
167
167
  //#endregion
168
+ //#region src/services/computeRectOffsets.d.ts
169
+ export declare const computeRectOffsets: ({ pivot, position, size }: Pick<CanvasRect, "pivot" | "position" | "size">) => Record<"offsetMax" | "offsetMin", [number, number]>;
170
+ //#endregion
168
171
  //#region src/services/constants.d.ts
169
172
  export declare const GAME_FONT_FAMILY = "\"HYWenHei 85W\", \"HYWenHei-85W\", Signika, ui-sans-serif, sans-serif";
170
173
  export declare const GAME_UNIT = "min(100cqh / 1080, 100cqw / 1920)";
@@ -190,7 +193,7 @@ export declare const readInterfaceClip: ({ durationMs, tracks }: {
190
193
  }) => InterfaceClip;
191
194
  //#endregion
192
195
  //#region src/services/toCanvasRectStyle.d.ts
193
- export declare const toCanvasRectStyle: ({ anchorMax, anchorMin, pivot, position, size }: CanvasRect, isOnCanvas?: boolean) => Record<"bottom" | "height" | "left" | "width", string> & {
196
+ export declare const toCanvasRectStyle: (rect: CanvasRect, isOnCanvas?: boolean) => Record<"bottom" | "height" | "left" | "width", string> & {
194
197
  position: "absolute";
195
198
  };
196
199
  //#endregion
package/dist/index.js CHANGED
@@ -296,6 +296,15 @@ let GameSourceKind = /* @__PURE__ */ function(GameSourceKind) {
296
296
  return GameSourceKind;
297
297
  }({});
298
298
  //#endregion
299
+ //#region src/services/computeRectOffsets.ts
300
+ const computeRectOffsets = ({ pivot, position, size }) => {
301
+ const offsetMin = [position[0] - size[0] * pivot[0], position[1] - size[1] * pivot[1]];
302
+ return {
303
+ offsetMax: [offsetMin[0] + size[0], offsetMin[1] + size[1]],
304
+ offsetMin
305
+ };
306
+ };
307
+ //#endregion
299
308
  //#region src/services/playInterfaceClip.ts
300
309
  const InterfaceClipPropertyKeyframeMap = {
301
310
  ["opacity"]: (value) => ({ opacity: value }),
@@ -329,13 +338,12 @@ const readInterfaceClip = ({ durationMs, tracks }) => ({
329
338
  });
330
339
  //#endregion
331
340
  //#region src/services/toCanvasRectStyle.ts
332
- const toAxis = (anchorMin, anchorMax, pivot, position, size, span, start) => {
333
- const length = `calc(${anchorMax - anchorMin} * ${span} + ${size} * var(--canvas-unit))`;
334
- return [`calc(${start} + ${anchorMin} * ${span} + ${position - pivot * size} * var(--canvas-unit))`, length];
335
- };
336
- const toCanvasRectStyle = ({ anchorMax, anchorMin, pivot, position, size }, isOnCanvas = false) => {
337
- const [left, width] = toAxis(anchorMin[0], anchorMax[0], pivot[0], position[0], size[0], isOnCanvas ? "(100% - 2 * var(--canvas-inset))" : "100%", isOnCanvas ? "var(--canvas-inset)" : "0px");
338
- const [bottom, height] = toAxis(anchorMin[1], anchorMax[1], pivot[1], position[1], size[1], "100%", "0px");
341
+ const toAxis = (anchorMin, anchorMax, offsetMin, size, span, start) => [`calc(${start} + ${anchorMin} * ${span} + ${offsetMin} * var(--canvas-unit))`, `calc(${anchorMax - anchorMin} * ${span} + ${size} * var(--canvas-unit))`];
342
+ const toCanvasRectStyle = (rect, isOnCanvas = false) => {
343
+ const { anchorMax, anchorMin, size } = rect;
344
+ const { offsetMin } = computeRectOffsets(rect);
345
+ const [left, width] = toAxis(anchorMin[0], anchorMax[0], offsetMin[0], size[0], isOnCanvas ? "(100% - 2 * var(--canvas-inset))" : "100%", isOnCanvas ? "var(--canvas-inset)" : "0px");
346
+ const [bottom, height] = toAxis(anchorMin[1], anchorMax[1], offsetMin[1], size[1], "100%", "0px");
339
347
  return {
340
348
  bottom,
341
349
  height,
@@ -345,4 +353,4 @@ const toCanvasRectStyle = ({ anchorMax, anchorMin, pivot, position, size }, isOn
345
353
  };
346
354
  };
347
355
  //#endregion
348
- export { FIXTURE_VARIANT_SEPARATOR, GAME_CANVAS_INSET, GAME_CANVAS_UNIT, GAME_CURSOR, GAME_FONT_FAMILY, GAME_UNIT, Index_default as GameScreen, GameSourceKind, InterfaceClipProperty, InterfaceIcon, InterfaceIconCentreMap, InterfaceIconPathMap, Index_default$1 as LoadingSpinner, ORNAMENT_END_PATH, ORNAMENT_MIDDLE_PATH, Index_default$2 as OrnamentDivider, Index_default$3 as ProgressBar, Index_default$4 as PromptBand, Index_default$5 as RoundButton, SERVER_MARK_DIAMOND_PATH, SERVER_MARK_TICK_PATH, SETTINGS_RING_CENTRE, SETTINGS_RING_RADIUS, SETTINGS_RING_WIDTH, Index_default$6 as ServerBar, Index_default$7 as ToastNotice, playInterfaceClip, readInterfaceClip, toCanvasRectStyle };
356
+ export { FIXTURE_VARIANT_SEPARATOR, GAME_CANVAS_INSET, GAME_CANVAS_UNIT, GAME_CURSOR, GAME_FONT_FAMILY, GAME_UNIT, Index_default as GameScreen, GameSourceKind, InterfaceClipProperty, InterfaceIcon, InterfaceIconCentreMap, InterfaceIconPathMap, Index_default$1 as LoadingSpinner, ORNAMENT_END_PATH, ORNAMENT_MIDDLE_PATH, Index_default$2 as OrnamentDivider, Index_default$3 as ProgressBar, Index_default$4 as PromptBand, Index_default$5 as RoundButton, SERVER_MARK_DIAMOND_PATH, SERVER_MARK_TICK_PATH, SETTINGS_RING_CENTRE, SETTINGS_RING_RADIUS, SETTINGS_RING_WIDTH, Index_default$6 as ServerBar, Index_default$7 as ToastNotice, computeRectOffsets, playInterfaceClip, readInterfaceClip, toCanvasRectStyle };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genshin-interface",
3
- "version": "3.8.1",
3
+ "version": "3.9.0",
4
4
  "description": "Genshin Impact's interface as a fan recreation: the game's own screen units, face and pointer, and its buttons, dividers, bars and notices as presentational Vue components.",
5
5
  "keywords": [
6
6
  "component-library",
@@ -49,14 +49,14 @@
49
49
  "typecheck": "vue-tsc"
50
50
  },
51
51
  "devDependencies": {
52
- "@esposter/configuration": "3.8.1",
52
+ "@esposter/configuration": "3.9.0",
53
53
  "@fontsource/signika": "^5.3.0",
54
54
  "@tsdown/css": "^0.23.0",
55
- "@types/node": "^26.6.3",
55
+ "@types/node": "^26.6.4",
56
56
  "@vitest/browser-playwright": "^5.0.3",
57
57
  "playwright": "^1.63.0",
58
58
  "tsdown": "^0.23.0",
59
- "vite": "^8.3.1",
59
+ "vite": "^8.3.2",
60
60
  "vitest": "^5.0.3",
61
61
  "vitest-browser-vue": "^3.1.0",
62
62
  "vue-tsc": "^3.3.11"
@@ -64,5 +64,5 @@
64
64
  "peerDependencies": {
65
65
  "vue": "^3.5.43"
66
66
  },
67
- "gitHead": "1cc0b24081a5fd56ec0c57b784f978f1ad0df0f4"
67
+ "gitHead": "f9f6208c35e6cff4ed33910623c798cd88f09301"
68
68
  }