ryugi-artifacts 1.44.2 → 1.45.1

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/cli.cjs CHANGED
@@ -16060,7 +16060,7 @@ var updateCommand = {
16060
16060
  },
16061
16061
  run: ({ values }, emit) => update2(
16062
16062
  {
16063
- current: "1.44.2",
16063
+ current: "1.45.1",
16064
16064
  file: __filename,
16065
16065
  env: process.env,
16066
16066
  registry: process.env.npm_config_registry || "https://registry.npmjs.org/",
@@ -16141,7 +16141,7 @@ async function main(argv) {
16141
16141
  const [name, ...rest] = argv;
16142
16142
  const command = COMMANDS.find((candidate) => candidate.name === name);
16143
16143
  const json = argv.includes("--json") || !command?.explicitJson && !process.stdout.isTTY;
16144
- notifyUpdate("1.44.2", json, argv);
16144
+ notifyUpdate("1.45.1", json, argv);
16145
16145
  const emit = (value) => {
16146
16146
  const line = json ? JSON.stringify(value) : text(value);
16147
16147
  if (!json && typeof value.error === "string") console.error(line);
@@ -16160,7 +16160,7 @@ async function main(argv) {
16160
16160
  return await command.run(parse(rest, command.options, command.positionals), emit);
16161
16161
  }
16162
16162
  if (name === "--version" || name === "-v") {
16163
- console.info("1.44.2");
16163
+ console.info("1.45.1");
16164
16164
  return 0;
16165
16165
  }
16166
16166
  if (name === "--help" || name === "-h") {
package/dist/server.cjs CHANGED
@@ -5176,7 +5176,7 @@ var import_node_os2 = __toESM(require("node:os"), 1);
5176
5176
  var import_node_path23 = __toESM(require("node:path"), 1);
5177
5177
 
5178
5178
  // package.json
5179
- var version = "1.44.2";
5179
+ var version = "1.45.1";
5180
5180
 
5181
5181
  // src/server/app.ts
5182
5182
  var import_node_fs24 = __toESM(require("node:fs"), 1);
@@ -6087,10 +6087,8 @@ function installInspector(win, properties, commentCursor = "crosshair") {
6087
6087
  hoverId = null;
6088
6088
  if (enabled) post("hover", { rect: null, id: null });
6089
6089
  };
6090
- const wheel = (event) => {
6091
- if (!enabled) return;
6090
+ const forwardWheel = (event) => {
6092
6091
  event.preventDefault();
6093
- event.stopImmediatePropagation();
6094
6092
  const factor = event.deltaMode === 1 ? 16 : event.deltaMode === 2 ? win.innerHeight : 1;
6095
6093
  post("wheel", {
6096
6094
  deltaX: event.deltaX * factor,
@@ -6100,6 +6098,14 @@ function installInspector(win, properties, commentCursor = "crosshair") {
6100
6098
  zoom: event.ctrlKey || event.metaKey
6101
6099
  });
6102
6100
  };
6101
+ const wheel = (event) => {
6102
+ if (!enabled) return;
6103
+ event.stopImmediatePropagation();
6104
+ forwardWheel(event);
6105
+ };
6106
+ const pinch = (event) => {
6107
+ if (event.ctrlKey && !event.defaultPrevented) forwardWheel(event);
6108
+ };
6103
6109
  const key2 = (event) => {
6104
6110
  if (!enabled || event.composedPath().some(
6105
6111
  (target) => target instanceof win.Element && target.matches("input,textarea,select,[contenteditable]")
@@ -6287,6 +6293,7 @@ function installInspector(win, properties, commentCursor = "crosshair") {
6287
6293
  doc.addEventListener("pointercancel", endDrag, true);
6288
6294
  doc.addEventListener("pointerleave", leave);
6289
6295
  doc.addEventListener("wheel", wheel, { passive: false, capture: true });
6296
+ win.addEventListener("wheel", pinch, { passive: false });
6290
6297
  doc.addEventListener("keydown", key2, true);
6291
6298
  doc.addEventListener("keyup", key2, true);
6292
6299
  win.addEventListener("scroll", scroll, true);
@@ -6301,6 +6308,7 @@ function installInspector(win, properties, commentCursor = "crosshair") {
6301
6308
  doc.removeEventListener("pointercancel", endDrag, true);
6302
6309
  doc.removeEventListener("pointerleave", leave);
6303
6310
  doc.removeEventListener("wheel", wheel, true);
6311
+ win.removeEventListener("wheel", pinch);
6304
6312
  doc.removeEventListener("keydown", key2, true);
6305
6313
  doc.removeEventListener("keyup", key2, true);
6306
6314
  win.removeEventListener("scroll", scroll, true);
@@ -6314,10 +6322,14 @@ function installSnapshot(win, serialize) {
6314
6322
  const post = (type, data = {}) => win.parent.postMessage({ type: `ryugi:board:${type}`, ...data }, "*");
6315
6323
  const frame = () => new Promise((resolve) => win.requestAnimationFrame(() => resolve()));
6316
6324
  const settle = async () => {
6317
- try {
6318
- await doc.fonts?.ready;
6319
- } catch {
6320
- }
6325
+ const fonts = doc.fonts?.ready;
6326
+ if (fonts)
6327
+ await Promise.race([
6328
+ fonts.catch(() => void 0),
6329
+ new Promise((resolve) => {
6330
+ win.setTimeout(resolve, 800);
6331
+ })
6332
+ ]);
6321
6333
  for (let round = 0; round < 20; round++) {
6322
6334
  const running = (doc.getAnimations?.() ?? []).filter(
6323
6335
  (animation) => animation.playState === "running" && animation.effect?.getComputedTiming().endTime !== Infinity
@@ -6325,8 +6337,12 @@ function installSnapshot(win, serialize) {
6325
6337
  if (!running.length) break;
6326
6338
  await Promise.all(running.map((animation) => animation.finished.catch(() => void 0)));
6327
6339
  }
6328
- await frame();
6329
- await frame();
6340
+ await Promise.race([
6341
+ Promise.all([frame(), frame()]),
6342
+ new Promise((resolve) => {
6343
+ win.setTimeout(resolve, 100);
6344
+ })
6345
+ ]);
6330
6346
  post("ready");
6331
6347
  };
6332
6348
  if (doc.readyState === "complete") void settle();