@famibee/skynovel 1.64.12 → 1.64.14

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/LayerMng.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { e as w, S as H, L as F, n as D, l as v, a as k, p as M, G, q as U, E as A, f as tt, r as et, t as st, v as B, w as it, x as q, y as at, F as nt, u as W, z as J } from "./web2.js";
2
- import { C as _, T as R } from "./CmnTween.js";
2
+ import { C as _, T as P } from "./CmnTween.js";
3
3
  import { G as X, D as Y } from "./GrpLayer.js";
4
4
  import { S as I } from "./SpritesMng.js";
5
- import { T as C, a as rt } from "./TxtLayer.js";
5
+ import { T as $, a as rt } from "./TxtLayer.js";
6
6
  import { R as ot } from "./RubySpliter.js";
7
7
  import { P as ct, b as K } from "./Main.js";
8
- import { a as $ } from "./Reading.js";
8
+ import { a as C } from "./Reading.js";
9
9
  import { Button as Q } from "./Button.js";
10
- class P {
10
+ class R {
11
11
  constructor(t, e, s, i, n, o, r, l) {
12
12
  this.cls = e, this.hArg = n, this.sys = o, this.val = r, this.ret = l;
13
13
  const f = o.hFactoryCls[e];
@@ -24,7 +24,7 @@ class P {
24
24
  this.#e.fore.destroy(), this.#e.back.destroy();
25
25
  }
26
26
  lay = (t) => this.getPage(t).lay(t);
27
- getPage = (t) => P.argChk_page(t, "fore") !== "back" ? this.#e.fore : this.#e.back;
27
+ getPage = (t) => R.argChk_page(t, "fore") !== "back" ? this.#e.fore : this.#e.back;
28
28
  static argChk_page(t, e) {
29
29
  const s = t.page ?? e;
30
30
  if (s === "fore" || s === "back")
@@ -84,8 +84,8 @@ class u {
84
84
  if (this.val.getVal(`tmp:${l}`)) throw `frame【${e}】はすでにあります`;
85
85
  const f = w(t, "visible", !0), d = t.b_color ? ` background-color: ${t.b_color};` : "", h = this.#b(t);
86
86
  u.#i.cvs.insertAdjacentHTML("beforebegin", `<iframe id="${e}" style="opacity: ${i}; ${d} position: absolute; left:${u.#t.ofsLeft4elm + h.x * u.#t.cvsScale}px; top: ${u.#t.ofsTop4elm + h.y * u.#t.cvsScale}px; z-index: 1; border: 0px; overflow: hidden; display: ${f ? "inline" : "none"}; transform: scale(${n}, ${o}) rotate(${r}deg);" width="${h.width * u.#t.cvsScale}" height="${h.height * u.#t.cvsScale}"></iframe>`);
87
- const p = $.procID + `add_frame id:${e}`;
88
- $.beginProc(p);
87
+ const p = C.procID + `add_frame id:${e}`;
88
+ C.beginProc(p);
89
89
  const c = u.#e.searchPath(s, H.HTML), a = new F().add({ name: s, url: c, xhrType: D.XHR_RESPONSE_TYPE.TEXT });
90
90
  return u.#t.arg.crypto && a.use(
91
91
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
@@ -106,7 +106,7 @@ class u {
106
106
  /data-src="(.+?\.)(?:jpe?g|png)/g,
107
107
  (m, N) => `data-src="${N}webp`
108
108
  )), b.onload = () => {
109
- $.endProc(p), this.val.setVal_Nochk("tmp", l, !0), this.val.setVal_Nochk("tmp", l + ".alpha", i), this.val.setVal_Nochk("tmp", l + ".x", h.x), this.val.setVal_Nochk("tmp", l + ".y", h.y), this.val.setVal_Nochk("tmp", l + ".scale_x", n), this.val.setVal_Nochk("tmp", l + ".scale_y", o), this.val.setVal_Nochk("tmp", l + ".rotate", r), this.val.setVal_Nochk("tmp", l + ".width", h.width), this.val.setVal_Nochk("tmp", l + ".height", h.height), this.val.setVal_Nochk("tmp", l + ".visible", f);
109
+ C.endProc(p), this.val.setVal_Nochk("tmp", l, !0), this.val.setVal_Nochk("tmp", l + ".alpha", i), this.val.setVal_Nochk("tmp", l + ".x", h.x), this.val.setVal_Nochk("tmp", l + ".y", h.y), this.val.setVal_Nochk("tmp", l + ".scale_x", n), this.val.setVal_Nochk("tmp", l + ".scale_y", o), this.val.setVal_Nochk("tmp", l + ".rotate", r), this.val.setVal_Nochk("tmp", l + ".width", h.width), this.val.setVal_Nochk("tmp", l + ".height", h.height), this.val.setVal_Nochk("tmp", l + ".visible", f);
110
110
  const m = b.contentWindow;
111
111
  this.#o.resvFlameEvent(m.document.body), m.sn_repRes?.((N) => u.#_(N.dataset.src ?? "", N));
112
112
  };
@@ -359,7 +359,7 @@ class Z {
359
359
  }, 1e3 / 60 * 10));
360
360
  }, { passive: !0 });
361
361
  }
362
- r.cvsResize(), this.#l = new lt(this.cfg.oCfg, e, i), C.init(t, e, i, this.#l, (a) => this.#s[a.layname].fore === a, s), X.init(n, t, s, r, l, i), u.init(t, r, n), this.#o = new u(e, s, i), e.loadplugin = (a) => this.#O(a), e.snapshot = (a) => this.#S(a), this.#w = this.sys.isApp ? (a, y, x, b, g) => this.#B(a, y, x, b, g) : (a, y, x, b, g) => this.#W(a, y, x, b, g), e.add_lay = (a) => this.#j(a), e.clear_lay = (a) => this.#H(a), e.finish_trans = () => !1, e.lay = (a) => this.#z(a), e.trans = (a) => this.#G(a), e.wt = (a) => _.wt(a), e.quake = (a) => this.#q(a), e.stop_quake = e.finish_trans, e.wq = e.wt, e.pause_tsy = (a) => _.pause_tsy(a), e.resume_tsy = (a) => _.resume_tsy(a), e.stop_tsy = (a) => _.stop_tsy(a), e.tsy = (a) => this.#J(a), e.wait_tsy = (a) => _.wait_tsy(a), e.add_filter = (a) => this.#X(a), e.clear_filter = (a) => this.#Y(a), e.enable_filter = (a) => this.#K(a), e.ch = (a) => this.#I(a), e.clear_text = (a) => this.#M(a), e.current = (a) => this.#D(a), e.endlink = (a) => this.#A(a), e.er = (a) => this.#tt(a), e.graph = (a) => this.#et(a), e.link = (a) => this.#st(a), e.r = (a) => this.#it(a), e.ruby2 = (a) => this.#at(a), e.span = (a) => this.#nt(a), e.tcy = (a) => this.#rt(a), e.add_face = (a) => I.add_face(a), e.wv = (a) => I.wv(a), e.dump_lay = (a) => this.#ot(a), e.enable_event = (a) => this.#ct(a), e.button = (a) => this.#lt(a), t.existsBreakline && (this.breakLine = (a) => {
362
+ r.cvsResize(), this.#l = new lt(this.cfg.oCfg, e, i), $.init(t, e, i, this.#l, (a) => this.#s[a.layname].fore === a, s), X.init(n, t, s, r, l, i), u.init(t, r, n), this.#o = new u(e, s, i), e.loadplugin = (a) => this.#O(a), e.snapshot = (a) => this.#S(a), this.#w = this.sys.isApp ? (a, y, x, b, g) => this.#B(a, y, x, b, g) : (a, y, x, b, g) => this.#W(a, y, x, b, g), e.add_lay = (a) => this.#j(a), e.clear_lay = (a) => this.#H(a), e.finish_trans = () => !1, e.lay = (a) => this.#z(a), e.trans = (a) => this.#G(a), e.wt = (a) => _.wt(a), e.quake = (a) => this.#q(a), e.stop_quake = e.finish_trans, e.wq = e.wt, e.pause_tsy = (a) => _.pause_tsy(a), e.resume_tsy = (a) => _.resume_tsy(a), e.stop_tsy = (a) => _.stop_tsy(a), e.tsy = (a) => this.#J(a), e.wait_tsy = (a) => _.wait_tsy(a), e.add_filter = (a) => this.#X(a), e.clear_filter = (a) => this.#Y(a), e.enable_filter = (a) => this.#K(a), e.ch = (a) => this.#I(a), e.clear_text = (a) => this.#M(a), e.current = (a) => this.#D(a), e.endlink = (a) => this.#A(a), e.er = (a) => this.#tt(a), e.graph = (a) => this.#et(a), e.link = (a) => this.#st(a), e.r = (a) => this.#it(a), e.ruby2 = (a) => this.#at(a), e.span = (a) => this.#nt(a), e.tcy = (a) => this.#rt(a), e.add_face = (a) => I.add_face(a), e.wv = (a) => I.wv(a), e.dump_lay = (a) => this.#ot(a), e.enable_event = (a) => this.#ct(a), e.button = (a) => this.#lt(a), t.existsBreakline && (this.breakLine = (a) => {
363
363
  delete a.visible, a.id = "break", a.pic = "breakline", this.#n("grp|" + V(a));
364
364
  }), t.existsBreakpage && (this.breakPage = (a) => {
365
365
  delete a.visible, a.id = "break", a.pic = "breakpage", this.#n("grp|" + V(a));
@@ -421,13 +421,13 @@ class Z {
421
421
  }
422
422
  destroy() {
423
423
  for (const t of Object.values(this.#s)) t.destroy();
424
- this.#k.clear(), X.destroy(), ot.destroy(), rt.destroy(), C.destroy(), this.#o.destroy(), _.destroy(), C.msecChWait = 10;
424
+ this.#k.clear(), X.destroy(), ot.destroy(), rt.destroy(), $.destroy(), this.#o.destroy(), _.destroy(), $.msecChWait = 10;
425
425
  }
426
426
  // 既存の全文字レイヤの実際のバック不透明度、を再計算
427
427
  #N(t) {
428
428
  for (const e of this.#r) {
429
429
  const { fore: s, back: i } = this.#s[e];
430
- s instanceof C && (s.chgBackAlpha(t), i.chgBackAlpha(t));
430
+ s instanceof $ && (s.chgBackAlpha(t), i.chgBackAlpha(t));
431
431
  }
432
432
  }
433
433
  #n = (t, e = this.currentTxtlayForeNeedErr, s = !0) => e.tagCh("|&emsp;《" + t + "》");
@@ -444,7 +444,7 @@ class Z {
444
444
  this.currentTxtlayFore && (this.clearBreak = () => this.#n("del|break"), this.clearBreak());
445
445
  }
446
446
  clickTxtLay() {
447
- return this.currentTxtlayFore ? this.#r.map((t) => this.#s[t].fore).some((t) => t instanceof C && t.click()) : !1;
447
+ return this.currentTxtlayFore ? this.#r.map((t) => this.#s[t].fore).some((t) => t instanceof $ && t.click()) : !1;
448
448
  }
449
449
  // // システム
450
450
  //MARK: スナップショット
@@ -454,9 +454,9 @@ class Z {
454
454
  }
455
455
  #w = () => !1;
456
456
  #B({ layer: t }, e, s, i, n) {
457
- if (this.#o.hideAllFrame(), $.beginProc(n), !t)
457
+ if (this.#o.hideAllFrame(), C.beginProc(n), !t)
458
458
  return this.sys.capturePage(e, s, i, () => {
459
- this.#o.restoreAllFrame(), $.endProc(n);
459
+ this.#o.restoreAllFrame(), C.endProc(n);
460
460
  }), !0;
461
461
  const o = this.#r.map((r) => {
462
462
  const { ctn: l } = this.#s[r].fore, f = [l, l.visible];
@@ -465,11 +465,11 @@ class Z {
465
465
  for (const r of this.#p(t)) this.#s[r].fore.ctn.visible = !0;
466
466
  return this.sys.capturePage(e, s, i, () => {
467
467
  for (const [r, l] of o) r.visible = l;
468
- this.#o.restoreAllFrame(), $.endProc(n);
468
+ this.#o.restoreAllFrame(), C.endProc(n);
469
469
  }), !0;
470
470
  }
471
471
  #W(t, e, s, i, n) {
472
- $.beginProc(n);
472
+ C.beginProc(n);
473
473
  const o = et(t, "b_color", this.#c), r = st({
474
474
  width: s,
475
475
  height: i,
@@ -491,7 +491,7 @@ class Z {
491
491
  r.plugins.extract.base64(d)
492
492
  ), d.destroy();
493
493
  for (const h of this.#p(f)) this.#s[h][l].snapshot_end();
494
- r.destroy(!0), $.endProc(n);
494
+ r.destroy(!0), C.endProc(n);
495
495
  }), !0;
496
496
  }
497
497
  //MARK: プラグインの読み込み
@@ -499,11 +499,11 @@ class Z {
499
499
  const { fn: e } = t;
500
500
  if (!e) throw "fnは必須です";
501
501
  if (!e.endsWith(".css")) throw "サポートされない拡張子です";
502
- const s = w(t, "join", !0), i = $.procID + `loadplugin fn:${e}`;
503
- return s && $.beginProc(i), (async () => {
502
+ const s = w(t, "join", !0), i = C.procID + `loadplugin fn:${e}`;
503
+ return s && C.beginProc(i), (async () => {
504
504
  const n = await fetch(e);
505
505
  if (!n.ok) throw new Error("Network response was not ok.");
506
- it(await n.text()), s && $.endProc(i);
506
+ it(await n.text()), s && C.endProc(i);
507
507
  })(), s;
508
508
  }
509
509
  // // レイヤ共通
@@ -515,14 +515,14 @@ class Z {
515
515
  if (e in this.#s) throw `layer【${e}】はすでにあります`;
516
516
  if (!s) throw "clsは必須です";
517
517
  const i = { isWait: !1 };
518
- switch (this.#s[e] = new P(e, s, this.#t, this.#i, t, this.sys, this.val, i), this.#r.push(e), s) {
518
+ switch (this.#s[e] = new R(e, s, this.#t, this.#i, t, this.sys, this.val, i), this.#r.push(e), s) {
519
519
  case "txt":
520
520
  this.#v || (this.#$ = () => {
521
521
  }, this.#h = (n) => this.#Q(n), this.#D = (n) => this.#Z(n), this.hTag.current({ layer: e }), this.goTxt = () => {
522
- this.#d.isSkipping ? C.msecChWait = 0 : this.setNormalChWait();
522
+ this.#d.isSkipping ? $.msecChWait = 0 : this.setNormalChWait();
523
523
  for (const n of this.#r) {
524
524
  const o = this.#s[n].fore;
525
- o instanceof C && this.#n("gotxt|", o, !1);
525
+ o instanceof $ && this.#n("gotxt|", o, !1);
526
526
  }
527
527
  }), this.val.setVal_Nochk("save", "const.sn.layer." + e + ".enabled", !0);
528
528
  break;
@@ -640,7 +640,7 @@ void main() {
640
640
  this.#t.removeChild(E), this.#i.removeChild(T), this.#t.addChildAt(T, z), this.#i.addChildAt(E, z);
641
641
  }
642
642
  Promise.allSettled(m).then(() => {
643
- this.#t.visible = !0, this.#i.visible = !1, this.#T.visible = !1, this.#a.visible = !1, $.notifyEndProc(R);
643
+ this.#t.visible = !0, this.#i.visible = !1, this.#T.visible = !1, this.#a.visible = !1, C.notifyEndProc(P);
644
644
  });
645
645
  };
646
646
  if (this.#a.filters = [], this.#a.alpha = 1, v(t, "time", 0) === 0 || this.#d.isSkipping)
@@ -681,7 +681,7 @@ void main() {
681
681
  f.remove(a), n();
682
682
  };
683
683
  if (!y && !x)
684
- return _.tween(R, t, this.#a, { alpha: 0 }, () => {
684
+ return _.tween(P, t, this.#a, { alpha: 0 }, () => {
685
685
  }, b, () => {
686
686
  }), f.add(a), !1;
687
687
  const g = {
@@ -694,7 +694,7 @@ void main() {
694
694
  y ?? Z.#F,
695
695
  g
696
696
  )];
697
- const S = _.tween(R, t, g, { tick: 1 }, () => {
697
+ const S = _.tween(P, t, g, { tick: 1 }, () => {
698
698
  }, b, () => {
699
699
  }, !x);
700
700
  return x ? new I(x, void 0, (m) => {
@@ -724,7 +724,7 @@ void main() {
724
724
  setAllStyle2TxtLay(t) {
725
725
  for (const e of this.#r) {
726
726
  const s = this.#s[e].fore;
727
- s instanceof C && s.lay({ style: t });
727
+ s instanceof $ && s.lay({ style: t });
728
728
  }
729
729
  }
730
730
  //MARK: 画面を揺らす
@@ -748,10 +748,10 @@ void main() {
748
748
  } : () => {
749
749
  this.#a.y = Math.round(Math.random() * r * 2) - r;
750
750
  };
751
- return this.#a.filters = [], _.tween(R, t, this.#a, { x: 0, y: 0 }, () => {
751
+ return this.#a.filters = [], _.tween(P, t, this.#a, { x: 0, y: 0 }, () => {
752
752
  l(), f();
753
753
  }, () => {
754
- i.remove(n), this.#t.visible = !0, this.#a.visible = !1, this.#a.x = 0, this.#a.y = 0;
754
+ i.remove(n), this.#t.visible = !0, this.#a.visible = !1, this.#a.x = 0, this.#a.y = 0, C.notifyEndProc(P);
755
755
  }, () => {
756
756
  }), i.add(n), !1;
757
757
  }
@@ -833,11 +833,11 @@ void main() {
833
833
  };
834
834
  #Q(t) {
835
835
  const e = this.#u(t, this.#v), i = this.#s[e].getPage(t);
836
- if (!(i instanceof C)) throw e + "はTxtLayerではありません";
836
+ if (!(i instanceof $)) throw e + "はTxtLayerではありません";
837
837
  return i;
838
838
  }
839
839
  setNormalChWait() {
840
- C.msecChWait = this.scrItr.normalWait;
840
+ $.msecChWait = this.scrItr.normalWait;
841
841
  }
842
842
  //MARK: 操作対象のメッセージレイヤの指定
843
843
  #D = (t) => {
@@ -847,11 +847,11 @@ void main() {
847
847
  const { layer: e } = t;
848
848
  if (!e) throw "[current] layerは必須です";
849
849
  const s = this.#s[e];
850
- if (!s || !(s.getPage(t) instanceof C)) throw `${e}はTxtLayerではありません`;
850
+ if (!s || !(s.getPage(t) instanceof $)) throw `${e}はTxtLayerではありません`;
851
851
  this.#x = s, this.#l.pagebreak(), this.#v = e, this.val.setVal_Nochk("save", "const.sn.mesLayer", e);
852
852
  for (const i of this.#r) {
853
853
  const { fore: n, back: o } = this.#s[i];
854
- n instanceof C && (n.isCur = o.isCur = i === e);
854
+ n instanceof $ && (n.isCur = o.isCur = i === e);
855
855
  }
856
856
  return !1;
857
857
  }
@@ -943,7 +943,7 @@ void main() {
943
943
  }
944
944
  //MARK: ボタンを表示
945
945
  #lt(t) {
946
- return P.argChk_page(t, "back"), t.fn ??= this.scrItr.scriptFn, this.#h(t).addButton(t), this.scrItr.recodeDesign(t), !1;
946
+ return R.argChk_page(t, "back"), t.fn ??= this.scrItr.scriptFn, this.#h(t).addButton(t), this.scrItr.recodeDesign(t), !1;
947
947
  }
948
948
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
949
949
  record() {
@@ -963,7 +963,7 @@ void main() {
963
963
  const e = [], s = [];
964
964
  for (const [n, { fore: o, fore: { idx: r }, back: l, cls: f }] of Object.entries(t)) {
965
965
  s.push({ ln: n, idx: r });
966
- const d = this.#s[n] ??= new P(n, f, this.#t, this.#i, {}, this.sys, this.val, { isWait: !1 });
966
+ const d = this.#s[n] ??= new R(n, f, this.#t, this.#i, {}, this.sys, this.val, { isWait: !1 });
967
967
  d.fore.playback(o, e), d.back.playback(l, e);
968
968
  }
969
969
  const i = this.#t.children.length;