ryugi-artifacts 1.40.0 → 1.41.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.
@@ -153,19 +153,19 @@ var A = (e, t, n) => ({
153
153
  right: n + e.w * t.k,
154
154
  bottom: r + e.h * t.k
155
155
  };
156
- };
157
- function I({ boards: e, view: t, viewport: n, pinned: r, snapshots: i }) {
156
+ }, I = ({ left: e, top: t, right: n, bottom: r }, i) => Math.max(0, Math.min(n, i.width) - Math.max(e, 0)) * Math.max(0, Math.min(r, i.height) - Math.max(t, 0));
157
+ function L({ boards: e, view: t, viewport: n, pinned: r, snapshots: i }) {
158
158
  let a = e.map((e) => {
159
- let { left: r, top: i, right: a, bottom: o } = F(e, t), s = Math.max(0, Math.min(a, n.width) - Math.max(r, 0)) * Math.max(0, Math.min(o, n.height) - Math.max(i, 0)), c = Math.hypot(Math.max(0, -a, r - n.width), Math.max(0, -o, i - n.height));
159
+ let r = F(e, t), { left: i, top: a, right: o, bottom: s } = r, c = I(r, n), l = Math.hypot(Math.max(0, -o, i - n.width), Math.max(0, -s, a - n.height));
160
160
  return {
161
161
  id: e.id,
162
- area: s,
163
- distance: c
162
+ area: c,
163
+ distance: l
164
164
  };
165
165
  }), o = t.k >= .4 ? new Set(a.filter((e) => e.area > 0).sort((e, t) => t.area - e.area).slice(0, 4).map((e) => e.id)) : /* @__PURE__ */ new Set();
166
166
  return new Map(a.map(({ id: e, distance: t }) => r.has(e) || o.has(e) ? [e, "live"] : t > n.width ? [e, "empty"] : [e, i.has(e) ? "snapshot" : "placeholder"]));
167
167
  }
168
- function L({ boards: e, view: t, viewport: n }) {
168
+ function R({ boards: e, view: t, viewport: n }) {
169
169
  return new Map(e.map((e) => {
170
170
  let { left: r, top: i, right: a, bottom: o } = F(e, t), s = a >= -240 && o >= -240 && r <= n.width + N && i <= n.height + N;
171
171
  return [e.id, {
@@ -177,17 +177,23 @@ function L({ boards: e, view: t, viewport: n }) {
177
177
  }];
178
178
  }));
179
179
  }
180
+ function z({ boards: e, view: t, viewport: n, snapshots: r, skip: i }) {
181
+ return e.filter((e) => !r.has(e.id) && !i.has(e.id) && e.w * t.k >= 120).map((e) => ({
182
+ id: e.id,
183
+ area: I(F(e, t), n)
184
+ })).filter((e) => e.area > 0).sort((e, t) => t.area - e.area).map((e) => e.id);
185
+ }
180
186
  //#endregion
181
187
  //#region src/viewer/ViewerContext.tsx
182
- var R = i(null);
183
- function z({ pageWindow: e, children: t }) {
184
- return /* @__PURE__ */ l(R.Provider, {
188
+ var B = i(null);
189
+ function V({ pageWindow: e, children: t }) {
190
+ return /* @__PURE__ */ l(B.Provider, {
185
191
  value: e ?? null,
186
192
  children: t
187
193
  });
188
194
  }
189
- var B = () => o(R) ?? window, V = a(() => import("./shims.js").then(() => import("./SnapshotDocument-De-tiDPI.js").then((e) => e.n))), H = a(() => import("./Canvas-BBqpPRdY.js").then((e) => e.n).then(({ Canvas: e }) => ({ default: e }))), U = () => () => {}, W = () => {}, G = /* @__PURE__ */ new Set();
190
- function K({ type: t, id: n, data: i, failed: a }) {
195
+ var H = () => o(B) ?? window, U = a(() => import("./shims.js").then(() => import("./SnapshotDocument-De-tiDPI.js").then((e) => e.n))), W = a(() => import("./Canvas-BL1JoYEQ.js").then((e) => e.n).then(({ Canvas: e }) => ({ default: e }))), G = () => () => {}, K = () => {}, q = /* @__PURE__ */ new Set();
196
+ function J({ type: t, id: n, data: i, failed: a }) {
191
197
  let { t: o } = e(), [u, d] = c(() => ({
192
198
  width: innerWidth,
193
199
  height: innerHeight
@@ -216,7 +222,7 @@ function K({ type: t, id: n, data: i, failed: a }) {
216
222
  resetKey: i.state,
217
223
  children: /* @__PURE__ */ l(r, {
218
224
  fallback: f(o("preview.loading")),
219
- children: /* @__PURE__ */ l(V, {
225
+ children: /* @__PURE__ */ l(U, {
220
226
  id: n,
221
227
  state: i.state,
222
228
  contentBase: i.contentBase
@@ -237,9 +243,9 @@ function K({ type: t, id: n, data: i, failed: a }) {
237
243
  resetKey: p,
238
244
  children: /* @__PURE__ */ l(r, {
239
245
  fallback: f(o("preview.loading")),
240
- children: /* @__PURE__ */ l(H, {
246
+ children: /* @__PURE__ */ l(W, {
241
247
  view: g,
242
- renders: L({
248
+ renders: R({
243
249
  boards: _.map(([e, t]) => ({
244
250
  id: e,
245
251
  ...t
@@ -252,11 +258,11 @@ function K({ type: t, id: n, data: i, failed: a }) {
252
258
  contentBase: i.contentBase,
253
259
  versions: i.versions ?? {},
254
260
  pending: new Set(i.pending),
255
- playing: G,
261
+ playing: q,
256
262
  replays: {},
257
263
  inspecting: !1,
258
- frameRef: U,
259
- frameLoaded: W
264
+ frameRef: G,
265
+ frameLoaded: K
260
266
  })
261
267
  })
262
268
  })
@@ -264,7 +270,7 @@ function K({ type: t, id: n, data: i, failed: a }) {
264
270
  }
265
271
  //#endregion
266
272
  //#region src/viewer/hooks/useSystemTheme.ts
267
- function q() {
273
+ function Y() {
268
274
  s(() => {
269
275
  let e = window.matchMedia("(prefers-color-scheme: dark)"), t = () => u({ appearance: e.matches ? "dark" : "light" });
270
276
  return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
@@ -272,7 +278,7 @@ function q() {
272
278
  }
273
279
  //#endregion
274
280
  //#region src/shared/cloud-error.ts
275
- function J(e) {
281
+ function X(e) {
276
282
  if (!e || typeof e != "object") return {};
277
283
  let t = e, n = {};
278
284
  if (typeof t.code == "string" && (n.code = t.code), (t.plan === "free" || t.plan === "pro") && (n.plan = t.plan), typeof t.upgradeUrl == "string" && (n.upgradeUrl = t.upgradeUrl), t.limit && typeof t.limit == "object") {
@@ -287,6 +293,6 @@ function J(e) {
287
293
  }
288
294
  //#endregion
289
295
  //#region src/shared/ids.ts
290
- var Y = /^[a-z0-9][a-z0-9-]*$/, X = (e) => Y.test(e), Z = (e) => d.includes(e);
296
+ var Z = /^[a-z0-9][a-z0-9-]*$/, Q = (e) => Z.test(e), $ = (e) => d.includes(e);
291
297
  //#endregion
292
- export { x as C, p as E, y as S, f as T, D as _, K as a, O as b, I as c, j as d, T as f, C as g, v as h, q as i, P as l, k as m, Z as n, z as o, w as p, J as r, B as s, X as t, L as u, b as v, d as w, A as x, S as y };
298
+ export { y as C, p as D, f as E, A as S, d as T, C as _, J as a, S as b, z as c, R as d, j as f, v as g, k as h, Y as i, L as l, w as m, $ as n, V as o, T as p, X as r, H as s, Q as t, P as u, D as v, x as w, O as x, b as y };