@famibee/skynovel 1.64.21 → 1.65.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/Button.js +59 -57
- package/dist/Button.js.map +1 -1
- package/dist/CmnTween.js +921 -109
- package/dist/CmnTween.js.map +1 -1
- package/dist/EventMng.js +1 -1
- package/dist/EventMng.js.map +1 -1
- package/dist/GrpLayer.js +10 -11
- package/dist/GrpLayer.js.map +1 -1
- package/dist/LayerMng.js +43 -44
- package/dist/LayerMng.js.map +1 -1
- package/dist/Main.js.map +1 -1
- package/dist/RubySpliter.js +18 -15
- package/dist/RubySpliter.js.map +1 -1
- package/dist/ScriptIterator.js +1 -2
- package/dist/ScriptIterator.js.map +1 -1
- package/dist/SndBuf.js +83 -77
- package/dist/SndBuf.js.map +1 -1
- package/dist/SpritesMng.js +50 -46
- package/dist/SpritesMng.js.map +1 -1
- package/dist/TxtLayer.js +435 -420
- package/dist/TxtLayer.js.map +1 -1
- package/dist/Variable.js +1 -1
- package/dist/sn/Button.d.ts.map +1 -1
- package/dist/sn/CmnTween.d.ts +4 -4
- package/dist/sn/CmnTween.d.ts.map +1 -1
- package/dist/sn/FocusMng.d.ts +2 -2
- package/dist/sn/FocusMng.d.ts.map +1 -1
- package/dist/sn/FrameMng.d.ts.map +1 -1
- package/dist/sn/GrpLayer.d.ts.map +1 -1
- package/dist/sn/Log.d.ts.map +1 -1
- package/dist/sn/Main.d.ts.map +1 -1
- package/dist/sn/Pages.d.ts.map +1 -1
- package/dist/sn/Reading.d.ts +1 -0
- package/dist/sn/Reading.d.ts.map +1 -1
- package/dist/sn/RubySpliter.d.ts.map +1 -1
- package/dist/sn/SndBuf.d.ts.map +1 -1
- package/dist/sn/SpritesMng.d.ts.map +1 -1
- package/dist/sn/SysBase.d.ts.map +1 -1
- package/dist/sn/TxtLayer.d.ts.map +1 -1
- package/dist/sn/TxtStage.d.ts +2 -0
- package/dist/sn/TxtStage.d.ts.map +1 -1
- package/dist/web2.js.map +1 -1
- package/dist_app/Button.js +59 -57
- package/dist_app/Button.js.map +1 -1
- package/dist_app/CmnTween.js +921 -109
- package/dist_app/CmnTween.js.map +1 -1
- package/dist_app/EventMng.js +1 -1
- package/dist_app/EventMng.js.map +1 -1
- package/dist_app/GrpLayer.js +10 -11
- package/dist_app/GrpLayer.js.map +1 -1
- package/dist_app/LayerMng.js +2 -3
- package/dist_app/LayerMng.js.map +1 -1
- package/dist_app/Main.js.map +1 -1
- package/dist_app/RubySpliter.js +18 -15
- package/dist_app/RubySpliter.js.map +1 -1
- package/dist_app/ScriptIterator.js +1 -2
- package/dist_app/ScriptIterator.js.map +1 -1
- package/dist_app/SndBuf.js +83 -77
- package/dist_app/SndBuf.js.map +1 -1
- package/dist_app/SpritesMng.js +46 -42
- package/dist_app/SpritesMng.js.map +1 -1
- package/dist_app/TxtLayer.js +435 -420
- package/dist_app/TxtLayer.js.map +1 -1
- package/dist_app/Variable.js +1 -1
- package/dist_app/app2.js.map +1 -1
- package/dist_app/sn/Button.d.ts.map +1 -1
- package/dist_app/sn/CmnTween.d.ts +4 -4
- package/dist_app/sn/CmnTween.d.ts.map +1 -1
- package/dist_app/sn/FocusMng.d.ts.map +1 -1
- package/dist_app/sn/FrameMng.d.ts.map +1 -1
- package/dist_app/sn/GrpLayer.d.ts.map +1 -1
- package/dist_app/sn/Log.d.ts.map +1 -1
- package/dist_app/sn/Main.d.ts.map +1 -1
- package/dist_app/sn/Pages.d.ts.map +1 -1
- package/dist_app/sn/Reading.d.ts +1 -0
- package/dist_app/sn/Reading.d.ts.map +1 -1
- package/dist_app/sn/RubySpliter.d.ts.map +1 -1
- package/dist_app/sn/SndBuf.d.ts.map +1 -1
- package/dist_app/sn/SpritesMng.d.ts.map +1 -1
- package/dist_app/sn/SysBase.d.ts.map +1 -1
- package/dist_app/sn/TxtLayer.d.ts.map +1 -1
- package/dist_app/sn/TxtStage.d.ts +2 -0
- package/dist_app/sn/TxtStage.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/TxtLayer.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { e as F, l as
|
|
2
|
-
import { C as
|
|
3
|
-
import { S as
|
|
1
|
+
import { e as F, l as S, y as ot, q as P, a as T, R as A, G as B, x as U, M as X, z as tt, N as ct, w as V, S as et, u as M, r as dt } from "./web2.js";
|
|
2
|
+
import { a as I, C as st, G as pt, T as ft } from "./CmnTween.js";
|
|
3
|
+
import { S as W } from "./SpritesMng.js";
|
|
4
4
|
import { D as K } from "./DebugMng.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class _t {
|
|
5
|
+
import { R as it } from "./RubySpliter.js";
|
|
6
|
+
import { Button as ut } from "./Button.js";
|
|
7
|
+
const H = "、。,.)]}〉」』】〕”〟ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶ!?!?‼⁉・ーゝゞヽヾ々", G = "[({〈「『【〔“〝", q = "─‥…", Y = H, nt = new RegExp(`[${H}]`), gt = new RegExp(`[${G}]`), _t = new RegExp(`[${q}]`), yt = nt;
|
|
8
|
+
class mt {
|
|
10
9
|
#c = H;
|
|
11
|
-
#n =
|
|
12
|
-
#r =
|
|
10
|
+
#n = G;
|
|
11
|
+
#r = q;
|
|
13
12
|
#a = Y;
|
|
14
13
|
get 行頭禁則() {
|
|
15
14
|
return this.#c;
|
|
@@ -23,16 +22,16 @@ class _t {
|
|
|
23
22
|
get ぶら下げ() {
|
|
24
23
|
return this.#a;
|
|
25
24
|
}
|
|
26
|
-
#e =
|
|
27
|
-
#h =
|
|
28
|
-
#
|
|
29
|
-
#k =
|
|
25
|
+
#e = nt;
|
|
26
|
+
#h = gt;
|
|
27
|
+
#p = _t;
|
|
28
|
+
#k = yt;
|
|
30
29
|
break_fixed = !1;
|
|
31
30
|
break_fixed_left = 0;
|
|
32
31
|
break_fixed_top = 0;
|
|
33
32
|
bura = !1;
|
|
34
33
|
lay(t) {
|
|
35
|
-
t.kinsoku_sol && (this.#c = t.kinsoku_sol, this.#e = new RegExp(`[${this.#c}]`)), t.kinsoku_eol && (this.#n = t.kinsoku_eol, this.#l(), this.#h = new RegExp(`[${this.#n}]`)), t.kinsoku_dns && (this.#r = t.kinsoku_dns, this.#
|
|
34
|
+
t.kinsoku_sol && (this.#c = t.kinsoku_sol, this.#e = new RegExp(`[${this.#c}]`)), t.kinsoku_eol && (this.#n = t.kinsoku_eol, this.#l(), this.#h = new RegExp(`[${this.#n}]`)), t.kinsoku_dns && (this.#r = t.kinsoku_dns, this.#g(), this.#p = new RegExp(`[${this.#r}]`)), t.kinsoku_bura && (this.#a = t.kinsoku_bura, this.#l(), this.#g(), this.#k = new RegExp(`[${this.#a}]`)), "bura" in t && (this.bura = F(t, "bura", !1)), this.break_fixed = F(t, "break_fixed", this.break_fixed), this.break_fixed_left = S(t, "break_fixed_left", this.break_fixed_left), this.break_fixed_top = S(t, "break_fixed_top", this.break_fixed_top);
|
|
36
35
|
}
|
|
37
36
|
// 禁則の競合(ぶら下げ と 行末禁則 の両方に含まれる文字があってはならない)
|
|
38
37
|
#l() {
|
|
@@ -49,7 +48,7 @@ class _t {
|
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
50
|
// 禁則の競合(ぶら下げ と 分割禁止 の両方に含まれる文字があってはならない)
|
|
52
|
-
#
|
|
51
|
+
#g() {
|
|
53
52
|
const t = this.#r.length, e = this.#a.length;
|
|
54
53
|
if (t < e)
|
|
55
54
|
for (let s = 0; s < t; ++s) {
|
|
@@ -66,7 +65,7 @@ class _t {
|
|
|
66
65
|
t.#t(this.#c, this.#n, this.#r, this.#a), t.break_fixed = this.break_fixed, t.break_fixed_left = this.break_fixed_left, t.break_fixed_top = this.break_fixed_top, t.bura = this.bura;
|
|
67
66
|
}
|
|
68
67
|
#t(t, e, s, i) {
|
|
69
|
-
this.#c !== t && (this.#c = t, this.#e = new RegExp(`[${t}]`)), this.#n !== e && (this.#n = e, this.#h = new RegExp(`[${e}]`)), this.#r !== s && (this.#r = s, this.#
|
|
68
|
+
this.#c !== t && (this.#c = t, this.#e = new RegExp(`[${t}]`)), this.#n !== e && (this.#n = e, this.#h = new RegExp(`[${e}]`)), this.#r !== s && (this.#r = s, this.#p = new RegExp(`[${s}]`)), this.#a !== i && (this.#a = i, this.#k = new RegExp(`[${i}]`));
|
|
70
69
|
}
|
|
71
70
|
record() {
|
|
72
71
|
const t = {
|
|
@@ -75,45 +74,45 @@ class _t {
|
|
|
75
74
|
break_fixed_top: this.break_fixed_top,
|
|
76
75
|
bura: this.bura
|
|
77
76
|
};
|
|
78
|
-
return this.#c === H && (t.行頭禁則 = this.#c), this.#n ===
|
|
77
|
+
return this.#c === H && (t.行頭禁則 = this.#c), this.#n === G && (t.行末禁則 = this.#n), this.#r === q && (t.分割禁止 = this.#r), this.#a === Y && (t.ぶら下げ = this.#a), t;
|
|
79
78
|
}
|
|
80
79
|
playback(t) {
|
|
81
80
|
t && (this.#t(
|
|
82
81
|
t.行頭禁則 ?? H,
|
|
83
|
-
t.行末禁則 ??
|
|
84
|
-
t.分割禁止 ??
|
|
82
|
+
t.行末禁則 ?? G,
|
|
83
|
+
t.分割禁止 ?? q,
|
|
85
84
|
t.ぶら下げ ?? Y
|
|
86
85
|
), this.break_fixed = t.break_fixed, this.break_fixed_left = t.break_fixed_left, this.break_fixed_top = t.break_fixed_top, this.bura = t.bura);
|
|
87
86
|
}
|
|
88
87
|
hyph(t, e, s, i, a) {
|
|
89
88
|
let n, l = 0, h = 2, r = (b) => (r = () => !1, i === b ? (i > 0 && (t.innerHTML = a.replaceAll('class="sn_ch"', 'class="sn_ch sn_ch_in_default"')), !0) : b < 2);
|
|
90
89
|
do {
|
|
91
|
-
if (n = this.#
|
|
90
|
+
if (n = this.#_(t, e), l = n.length, r(l)) break;
|
|
92
91
|
let b = -1 / 0;
|
|
93
92
|
for (; h < l; ++h) {
|
|
94
|
-
const { elm:
|
|
95
|
-
if (
|
|
93
|
+
const { elm: y, rect: w, ch: C } = n[h];
|
|
94
|
+
if (y.tagName === "RT") continue;
|
|
96
95
|
const x = s ? w.y : w.x;
|
|
97
|
-
if (b <= x ||
|
|
96
|
+
if (b <= x || y.previousElementSibling?.tagName === "SPAN" && y.previousElementSibling?.innerHTML.includes("<br>") || y.parentElement?.previousElementSibling?.tagName === "SPAN" && y.parentElement?.previousElementSibling?.innerHTML.includes("<br>")) {
|
|
98
97
|
b = x, this.break_fixed || (this.break_fixed_left = w.x, this.break_fixed_top = w.y);
|
|
99
98
|
continue;
|
|
100
99
|
}
|
|
101
|
-
const
|
|
100
|
+
const N = this.#u(n, h), { elm: g, rect: $, ch: o } = n[N];
|
|
102
101
|
if (!this.break_fixed) {
|
|
103
|
-
this.break_fixed_left =
|
|
104
|
-
const
|
|
105
|
-
s ? this.break_fixed_top +=
|
|
102
|
+
this.break_fixed_left = $.x, this.break_fixed_top = $.y;
|
|
103
|
+
const p = globalThis.getComputedStyle(g), E = parseFloat(p.fontSize);
|
|
104
|
+
s ? this.break_fixed_top += E : this.break_fixed_left += E;
|
|
106
105
|
}
|
|
107
106
|
b = -1 / 0;
|
|
108
|
-
const
|
|
109
|
-
if (h =
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
107
|
+
const d = h, { cont: u, ins: m } = this.bura ? this.hyph_alg_bura(n, N, o, h) : this.hyph_alg(n, N, o, h, C);
|
|
108
|
+
if (h = m, u) continue;
|
|
109
|
+
const v = n[h].elm, _ = v.parentElement, f = document.createElement("br");
|
|
110
|
+
if (_.classList.contains("sn_tx")) _.insertBefore(f, v);
|
|
112
111
|
else {
|
|
113
|
-
const
|
|
114
|
-
|
|
112
|
+
const p = _.parentElement;
|
|
113
|
+
p.classList.contains("sn_ch") ? p.parentElement.insertBefore(f, p) : p.insertBefore(f, _);
|
|
115
114
|
}
|
|
116
|
-
h += 2, h <
|
|
115
|
+
h += 2, h < d && (h = d), l = -1;
|
|
117
116
|
break;
|
|
118
117
|
}
|
|
119
118
|
} while (l < 0);
|
|
@@ -124,9 +123,9 @@ class _t {
|
|
|
124
123
|
const s = e - 1, { elm: i } = t[s];
|
|
125
124
|
return i.tagName !== "RT" ? s - (i.style.textCombineUpright === "all" ? Array.from(i.textContent).length - 1 : 0) : s - Array.from(i.textContent).length;
|
|
126
125
|
}
|
|
127
|
-
#
|
|
126
|
+
#_(t, e) {
|
|
128
127
|
const s = [];
|
|
129
|
-
if (t.nodeType !== t.TEXT_NODE) return Array.from(t.childNodes).map((l) => this.#
|
|
128
|
+
if (t.nodeType !== t.TEXT_NODE) return Array.from(t.childNodes).map((l) => this.#_(l, e)).flat();
|
|
130
129
|
const i = t.ownerDocument.createRange();
|
|
131
130
|
i.selectNodeContents(t);
|
|
132
131
|
let a = 0;
|
|
@@ -160,7 +159,7 @@ class _t {
|
|
|
160
159
|
if (this.#e.test(a))
|
|
161
160
|
for (; (n = this.#u(t, n)) >= 0 && this.#e.test(t[n].ch); )
|
|
162
161
|
;
|
|
163
|
-
else if (!(s === a && this.#
|
|
162
|
+
else if (!(s === a && this.#p.test(s))) return { cont: !0, ins: n + 1 };
|
|
164
163
|
}
|
|
165
164
|
for (n = e; (n = this.#u(t, n)) >= 0 && this.#h.test(t[n].ch); )
|
|
166
165
|
;
|
|
@@ -182,8 +181,8 @@ class _t {
|
|
|
182
181
|
if (this.#k.test(n) || this.#e.test(n)) {
|
|
183
182
|
let h = e;
|
|
184
183
|
(this.#k.test(s) || this.#e.test(s)) && ++h;
|
|
185
|
-
const r = this.#u(t, h), { ch: b } = t[r], { ch:
|
|
186
|
-
if (b ===
|
|
184
|
+
const r = this.#u(t, h), { ch: b } = t[r], { ch: y } = t[h];
|
|
185
|
+
if (b === y && this.#p.test(y)) return { cont: !1, ins: r };
|
|
187
186
|
if (!this.#h.test(b)) return { cont: !1, ins: h };
|
|
188
187
|
h = r;
|
|
189
188
|
do
|
|
@@ -194,7 +193,7 @@ class _t {
|
|
|
194
193
|
const l = this.#u(t, a);
|
|
195
194
|
if (i >= 3) {
|
|
196
195
|
const { ch: h } = t[l];
|
|
197
|
-
if (this.#
|
|
196
|
+
if (this.#p.test(n) && h === n)
|
|
198
197
|
return { cont: !1, ins: l };
|
|
199
198
|
if (this.#h.test(h)) {
|
|
200
199
|
let r = l;
|
|
@@ -206,187 +205,187 @@ class _t {
|
|
|
206
205
|
return { cont: !1, ins: a };
|
|
207
206
|
}
|
|
208
207
|
}
|
|
209
|
-
function
|
|
208
|
+
function bt(Q, t, e, s, i, a = !0) {
|
|
210
209
|
const n = {
|
|
211
|
-
escape: (
|
|
212
|
-
mimeType: (
|
|
213
|
-
const
|
|
214
|
-
return l()[
|
|
210
|
+
escape: (o) => o.replaceAll(/([.*+?^${}()|[\]/\\])/g, "\\$1"),
|
|
211
|
+
mimeType: (o) => {
|
|
212
|
+
const d = y(o).toLowerCase();
|
|
213
|
+
return l()[d] || "";
|
|
215
214
|
},
|
|
216
|
-
dataAsUrl:
|
|
215
|
+
dataAsUrl: N,
|
|
217
216
|
isDataUrl: w,
|
|
218
|
-
resolveUrl:
|
|
217
|
+
resolveUrl: C,
|
|
219
218
|
getAndEncode: x,
|
|
220
|
-
asArray: (
|
|
221
|
-
const
|
|
222
|
-
for (let
|
|
223
|
-
return
|
|
219
|
+
asArray: (o) => {
|
|
220
|
+
const d = [], u = o.length;
|
|
221
|
+
for (let m = 0; m < u; ++m) d.push(o[m]);
|
|
222
|
+
return d;
|
|
224
223
|
}
|
|
225
224
|
};
|
|
226
225
|
function l() {
|
|
227
|
-
const
|
|
226
|
+
const o = "application/font-woff", d = "image/jpeg";
|
|
228
227
|
return {
|
|
229
|
-
woff:
|
|
230
|
-
woff2:
|
|
228
|
+
woff: o,
|
|
229
|
+
woff2: o,
|
|
231
230
|
ttf: "application/font-truetype",
|
|
232
231
|
eot: "application/vnd.ms-fontobject",
|
|
233
232
|
png: "image/png",
|
|
234
|
-
jpg:
|
|
235
|
-
jpeg:
|
|
233
|
+
jpg: d,
|
|
234
|
+
jpeg: d,
|
|
236
235
|
gif: "image/gif",
|
|
237
236
|
tiff: "image/tiff",
|
|
238
237
|
svg: "image/svg+xml"
|
|
239
238
|
};
|
|
240
239
|
}
|
|
241
|
-
const h =
|
|
242
|
-
function b(
|
|
243
|
-
return r.resolveAll().then((
|
|
244
|
-
const
|
|
245
|
-
return
|
|
240
|
+
const h = g(), r = $();
|
|
241
|
+
function b(o) {
|
|
242
|
+
return r.resolveAll().then((d) => {
|
|
243
|
+
const u = document.createElement("style");
|
|
244
|
+
return o.appendChild(u), u.appendChild(document.createTextNode(d)), o;
|
|
246
245
|
});
|
|
247
246
|
}
|
|
248
|
-
function
|
|
249
|
-
return /\.([^./]*?)$/g.exec(
|
|
250
|
-
}
|
|
251
|
-
function w(
|
|
252
|
-
return
|
|
253
|
-
}
|
|
254
|
-
function
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
const
|
|
258
|
-
return
|
|
259
|
-
}
|
|
260
|
-
function x(
|
|
261
|
-
return new Promise(function(
|
|
262
|
-
const
|
|
263
|
-
|
|
264
|
-
function
|
|
265
|
-
if (
|
|
266
|
-
if (
|
|
267
|
-
|
|
247
|
+
function y(o) {
|
|
248
|
+
return /\.([^./]*?)$/g.exec(o)?.[1] ?? "";
|
|
249
|
+
}
|
|
250
|
+
function w(o) {
|
|
251
|
+
return o.search(/^(data:)/) !== -1;
|
|
252
|
+
}
|
|
253
|
+
function C(o, d) {
|
|
254
|
+
const u = document.implementation.createHTMLDocument(), m = u.createElement("base");
|
|
255
|
+
u.head.appendChild(m);
|
|
256
|
+
const v = u.createElement("a");
|
|
257
|
+
return u.body.appendChild(v), m.href = d, v.href = o, v.href;
|
|
258
|
+
}
|
|
259
|
+
function x(o) {
|
|
260
|
+
return new Promise(function(u) {
|
|
261
|
+
const m = new XMLHttpRequest();
|
|
262
|
+
m.onreadystatechange = v, m.ontimeout = _, m.responseType = "blob", m.timeout = 3e4, m.open("GET", o, !0), m.send();
|
|
263
|
+
function v() {
|
|
264
|
+
if (m.readyState !== 4) return;
|
|
265
|
+
if (m.status !== 200) {
|
|
266
|
+
f("cannot fetch resource: " + o + ", status: " + m.status);
|
|
268
267
|
return;
|
|
269
268
|
}
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
},
|
|
269
|
+
const p = new FileReader();
|
|
270
|
+
p.onloadend = function() {
|
|
271
|
+
const E = p.result.toString().split(/,/)[1];
|
|
272
|
+
u(E);
|
|
273
|
+
}, p.readAsDataURL(m.response);
|
|
275
274
|
}
|
|
276
|
-
function
|
|
277
|
-
|
|
275
|
+
function _() {
|
|
276
|
+
f("timeout of 30000ms occured while fetching resource: " + o);
|
|
278
277
|
}
|
|
279
|
-
function p
|
|
280
|
-
console.error(
|
|
278
|
+
function f(p) {
|
|
279
|
+
console.error(p), u("");
|
|
281
280
|
}
|
|
282
281
|
});
|
|
283
282
|
}
|
|
284
|
-
function
|
|
285
|
-
return "data:" +
|
|
283
|
+
function N(o, d) {
|
|
284
|
+
return "data:" + d + ";base64," + o;
|
|
286
285
|
}
|
|
287
|
-
function
|
|
288
|
-
const
|
|
286
|
+
function g() {
|
|
287
|
+
const o = /url\(['"]?([^'"]+?)['"]?\)/g;
|
|
289
288
|
return {
|
|
290
|
-
inlineAll:
|
|
291
|
-
shouldProcess:
|
|
289
|
+
inlineAll: v,
|
|
290
|
+
shouldProcess: d
|
|
292
291
|
};
|
|
293
|
-
function
|
|
294
|
-
return
|
|
292
|
+
function d(_) {
|
|
293
|
+
return _.search(o) !== -1;
|
|
295
294
|
}
|
|
296
|
-
function
|
|
297
|
-
const
|
|
298
|
-
let
|
|
299
|
-
for (;
|
|
300
|
-
|
|
301
|
-
return
|
|
302
|
-
return !n.isDataUrl(
|
|
295
|
+
function u(_) {
|
|
296
|
+
const f = [];
|
|
297
|
+
let p;
|
|
298
|
+
for (; p = o.exec(_); )
|
|
299
|
+
f.push(p[1]);
|
|
300
|
+
return f.filter(function(E) {
|
|
301
|
+
return !n.isDataUrl(E);
|
|
303
302
|
});
|
|
304
303
|
}
|
|
305
|
-
function
|
|
306
|
-
return Promise.resolve(
|
|
307
|
-
function
|
|
308
|
-
return new RegExp(`(url\\(['"]?)(` + n.escape(
|
|
304
|
+
function m(_, f, p, E) {
|
|
305
|
+
return Promise.resolve(f).then((R) => p ? n.resolveUrl(R, p) : R).then(E || n.getAndEncode).then((R) => n.dataAsUrl(R, n.mimeType(f))).then((R) => _.replace(j(f), "$1" + R + "$3"));
|
|
306
|
+
function j(R) {
|
|
307
|
+
return new RegExp(`(url\\(['"]?)(` + n.escape(R) + `)(['"]?\\))`, "g");
|
|
309
308
|
}
|
|
310
309
|
}
|
|
311
|
-
function
|
|
312
|
-
if (
|
|
313
|
-
return Promise.resolve(
|
|
314
|
-
let
|
|
315
|
-
for (const
|
|
316
|
-
return
|
|
310
|
+
function v(_, f, p) {
|
|
311
|
+
if (E()) return Promise.resolve(_);
|
|
312
|
+
return Promise.resolve(_).then(u).then((j) => {
|
|
313
|
+
let R = Promise.resolve(_);
|
|
314
|
+
for (const J of j) R = R.then((O) => m(O, J, f, p));
|
|
315
|
+
return R;
|
|
317
316
|
});
|
|
318
|
-
function
|
|
319
|
-
return !
|
|
317
|
+
function E() {
|
|
318
|
+
return !d(_);
|
|
320
319
|
}
|
|
321
320
|
}
|
|
322
321
|
}
|
|
323
|
-
function
|
|
322
|
+
function $() {
|
|
324
323
|
return {
|
|
325
|
-
resolveAll:
|
|
326
|
-
impl: { readAll:
|
|
324
|
+
resolveAll: o,
|
|
325
|
+
impl: { readAll: d }
|
|
327
326
|
};
|
|
328
|
-
function
|
|
329
|
-
return
|
|
330
|
-
|
|
331
|
-
)).then((
|
|
327
|
+
function o() {
|
|
328
|
+
return d().then((u) => Promise.allSettled(
|
|
329
|
+
u.map((m) => m.resolve())
|
|
330
|
+
)).then((u) => u.join(`
|
|
332
331
|
`));
|
|
333
332
|
}
|
|
334
|
-
function
|
|
335
|
-
return Promise.resolve(n.asArray(document.styleSheets)).then(
|
|
336
|
-
function
|
|
337
|
-
return
|
|
333
|
+
function d() {
|
|
334
|
+
return Promise.resolve(n.asArray(document.styleSheets)).then(m).then(u).then((_) => _.map(v));
|
|
335
|
+
function u(_) {
|
|
336
|
+
return _.filter((f) => f.type === CSSRule.FONT_FACE_RULE).filter((f) => h.shouldProcess(f.style.getPropertyValue("src")));
|
|
338
337
|
}
|
|
339
|
-
function
|
|
340
|
-
const
|
|
341
|
-
for (const
|
|
338
|
+
function m(_) {
|
|
339
|
+
const f = [];
|
|
340
|
+
for (const p of _)
|
|
342
341
|
try {
|
|
343
|
-
if (
|
|
344
|
-
n.asArray(
|
|
345
|
-
} catch (
|
|
346
|
-
console.error("Error while reading CSS rules from " +
|
|
342
|
+
if (p.href) continue;
|
|
343
|
+
n.asArray(p.cssRules || []).forEach(f.push.bind(f));
|
|
344
|
+
} catch (E) {
|
|
345
|
+
console.error("Error while reading CSS rules from " + p.href, String(E));
|
|
347
346
|
}
|
|
348
|
-
return
|
|
347
|
+
return f;
|
|
349
348
|
}
|
|
350
|
-
function
|
|
349
|
+
function v(_) {
|
|
351
350
|
return {
|
|
352
351
|
resolve: function() {
|
|
353
|
-
const
|
|
354
|
-
return h.inlineAll(
|
|
352
|
+
const p = (_.parentStyleSheet || {}).href;
|
|
353
|
+
return h.inlineAll(_.cssText, p);
|
|
355
354
|
},
|
|
356
355
|
src() {
|
|
357
|
-
return
|
|
356
|
+
return _.style.getPropertyValue("src");
|
|
358
357
|
}
|
|
359
358
|
};
|
|
360
359
|
}
|
|
361
360
|
}
|
|
362
361
|
}
|
|
363
|
-
Promise.resolve(t).then((
|
|
364
|
-
const
|
|
365
|
-
return
|
|
366
|
-
}).then(b).then((
|
|
367
|
-
|
|
368
|
-
const
|
|
369
|
-
return
|
|
370
|
-
`, "%0A")}</foreignObject></svg>`, new Promise((
|
|
371
|
-
|
|
362
|
+
Promise.resolve(t).then((o) => {
|
|
363
|
+
const d = o.cloneNode(!0);
|
|
364
|
+
return d.style.padding = "0px", d.style.paddingRight = s + "px", d.style.paddingTop = i + "px", d.style.left = "0px", d.style.top = "0px", d.style.width = e.$width - e.pad_left - e.pad_right + "px", d.style.height = e.$height - e.pad_top - e.pad_bottom + "px", t.hidden = a, d;
|
|
365
|
+
}).then(b).then((o) => {
|
|
366
|
+
o.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
|
|
367
|
+
const d = new Image();
|
|
368
|
+
return d.src = `data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="${String(e.$width)}px" height="${String(e.$height)}px"><foreignObject x="0" y="0" width="100%" height="100%">${new XMLSerializer().serializeToString(o).replaceAll("#", "%23").replaceAll(`
|
|
369
|
+
`, "%0A")}</foreignObject></svg>`, new Promise((u) => {
|
|
370
|
+
d.onload = () => u(d);
|
|
372
371
|
});
|
|
373
|
-
}).then((
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
}).catch((
|
|
372
|
+
}).then((o) => new Promise((d) => setTimeout(() => d(o), 100))).then((o) => {
|
|
373
|
+
const d = document.createElement("canvas");
|
|
374
|
+
d.width = e.$width, d.height = e.$height, d.getContext("2d").drawImage(o, 0, 0), Q(ot.from(d));
|
|
375
|
+
}).catch((o) => K.myTrace(`goTxt() = ${String(o)}`));
|
|
377
376
|
}
|
|
378
|
-
class c extends
|
|
377
|
+
class c extends P {
|
|
379
378
|
constructor(t, e, s) {
|
|
380
|
-
super(), this.ctn = t, this.canFocus = e, this.sys = s, this.#e.classList.add("sn_tx"), this.#e.style.position = "absolute", c.#n.view.parentElement.appendChild(this.#e), this.addChild(this.#h), this.addChild(this.#
|
|
381
|
-
const i =
|
|
379
|
+
super(), this.ctn = t, this.canFocus = e, this.sys = s, this.#e.classList.add("sn_tx"), this.#e.style.position = "absolute", c.#n.view.parentElement.appendChild(this.#e), this.addChild(this.#h), this.addChild(this.#p), this.#p.name = "grpDbgMasume";
|
|
380
|
+
const i = T.debugLog ? ({ ch: a, rect: { x: n, y: l, width: h, height: r } }) => console.log(`🍌 masume ch:${a} x:${String(n)} y:${String(l)} w:${String(h)} h:${String(r)}`) : () => {
|
|
382
381
|
};
|
|
383
|
-
this.#
|
|
382
|
+
this.#g = c.#c.oCfg.debug.masume ? (a) => {
|
|
384
383
|
i(a);
|
|
385
384
|
const { x: n, y: l, width: h, height: r } = a.rect;
|
|
386
|
-
this.#
|
|
385
|
+
this.#p.beginFill(6737151, 0.5).lineStyle(2, 16724736, 1).drawRect(n, l, h, r).endFill();
|
|
387
386
|
} : () => {
|
|
388
387
|
}, this.noticeCompTxt = s.isApp && c.#c.oCfg.debug.dumpHtm ? () => {
|
|
389
|
-
|
|
388
|
+
I.notifyEndProc(A);
|
|
390
389
|
const a = this.#e.innerHTML;
|
|
391
390
|
if (a === "") return;
|
|
392
391
|
const { fn: n, ln: l } = c.#a.nowScrFnLn(), h = `dumpHtm ${t.name.slice(0, -7).replaceAll(":", "=")}(fn=${n} line=${String(l)})`;
|
|
@@ -398,26 +397,27 @@ $1
|
|
|
398
397
|
`).replaceAll(/<(br|\/span)>/g, `<$1>
|
|
399
398
|
`)}`
|
|
400
399
|
);
|
|
401
|
-
} : () =>
|
|
400
|
+
} : () => I.notifyEndProc(A);
|
|
402
401
|
}
|
|
403
402
|
static #c;
|
|
404
403
|
static #n;
|
|
405
404
|
static init(t, e) {
|
|
406
|
-
c.#c = t, c.#n = e;
|
|
405
|
+
c.#c = t, c.#n = e, st.addGrp(c.grp);
|
|
407
406
|
}
|
|
407
|
+
static grp = new pt();
|
|
408
408
|
static #r;
|
|
409
409
|
static #a;
|
|
410
410
|
static setEvtMng(t, e) {
|
|
411
411
|
c.#r = t, c.#a = e;
|
|
412
412
|
}
|
|
413
413
|
static destroy() {
|
|
414
|
-
c.#$ = /* @__PURE__ */ Object.create(null), c.#
|
|
414
|
+
c.#$ = /* @__PURE__ */ Object.create(null), c.#E = /* @__PURE__ */ Object.create(null), c.delBreak();
|
|
415
415
|
}
|
|
416
416
|
#e = document.createElement("span");
|
|
417
417
|
// サンプリング元
|
|
418
|
-
#h = new
|
|
418
|
+
#h = new P();
|
|
419
419
|
// サンプリング先
|
|
420
|
-
#
|
|
420
|
+
#p = new B();
|
|
421
421
|
static #k = {
|
|
422
422
|
"background-color": 0,
|
|
423
423
|
"border-bottom-width": 0,
|
|
@@ -429,10 +429,10 @@ $1
|
|
|
429
429
|
"margin-right": 0,
|
|
430
430
|
"margin-top": 0
|
|
431
431
|
};
|
|
432
|
-
#l = new
|
|
432
|
+
#l = new mt();
|
|
433
433
|
noticeCompTxt = () => {
|
|
434
434
|
};
|
|
435
|
-
#
|
|
435
|
+
#g;
|
|
436
436
|
// readonly #idc :TxtLayDesignCast;
|
|
437
437
|
// readonly #idcCh = new TxtLayPadDesignCast(this);
|
|
438
438
|
#t = {
|
|
@@ -467,31 +467,31 @@ $1
|
|
|
467
467
|
!s.style.opacity && "alpha" in t && (e.opacity = String(this.ctn.alpha));
|
|
468
468
|
} else this.#e.style.cssText = "";
|
|
469
469
|
else "alpha" in t && (e.opacity = String(this.ctn.alpha));
|
|
470
|
-
if ("width" in t && (e.width = String(t.width ?? "0") + "px"), "height" in t && (e.height = String(t.height ?? "0") + "px"), "pl" in t && (e.paddingLeft = String(t.pl ?? "0") + "px"), "pr" in t && (e.paddingRight = String(t.pr ?? "0") + "px"), "pt" in t && (e.paddingTop = String(t.pt ?? "0") + "px"), "pb" in t && (e.paddingBottom = String(t.pb ?? "0") + "px"), this.#l.lay(t), this.#
|
|
470
|
+
if ("width" in t && (e.width = String(t.width ?? "0") + "px"), "height" in t && (e.height = String(t.height ?? "0") + "px"), "pl" in t && (e.paddingLeft = String(t.pl ?? "0") + "px"), "pr" in t && (e.paddingRight = String(t.pr ?? "0") + "px"), "pt" in t && (e.paddingTop = String(t.pt ?? "0") + "px"), "pb" in t && (e.paddingBottom = String(t.pb ?? "0") + "px"), this.#l.lay(t), this.#_(), this.#o = this.ctn.position.x, e.transformOrigin = `${String(this.ctn.pivot.x)}px ${String(this.ctn.pivot.y)}px`, this.cvsResize(), e.display = this.ctn.visible ? "inline" : "none", ":redraw" in t && this.#y > 0) {
|
|
471
471
|
const s = [
|
|
472
472
|
this.#e.innerHTML.replaceAll(/(animation-delay: )\d+ms/g, "$10ms"),
|
|
473
473
|
`<span class='sn_ch' data-add='{"ch_in_style":"default"}'> </span>`
|
|
474
474
|
];
|
|
475
|
-
this.#
|
|
475
|
+
this.#z(), this.goTxt(s, !0);
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
478
|
// oxlint-disable-next-line no-unused-private-class-members
|
|
479
479
|
#u = 0;
|
|
480
480
|
// 「g」などで下が欠ける問題対策
|
|
481
|
-
#
|
|
481
|
+
#_() {
|
|
482
482
|
const t = this.#e.style, e = parseFloat(t.fontSize || "0");
|
|
483
|
-
this.#t.fontsize = e, this.#t.pad_left = parseFloat(t.paddingLeft || "0"), this.#t.pad_right = parseFloat(t.paddingRight || "0"), this.#t.pad_top = parseFloat(t.paddingTop || "0"), this.#t.pad_bottom = parseFloat(t.paddingBottom || "0"), this.#t.$width = parseFloat(t.width || "0"), this.#t.$height = parseFloat(t.height || "0"), this.position.set(this.#t.pad_left, this.#t.pad_top), this.#
|
|
483
|
+
this.#t.fontsize = e, this.#t.pad_left = parseFloat(t.paddingLeft || "0"), this.#t.pad_right = parseFloat(t.paddingRight || "0"), this.#t.pad_top = parseFloat(t.paddingTop || "0"), this.#t.pad_bottom = parseFloat(t.paddingBottom || "0"), this.#t.$width = parseFloat(t.width || "0"), this.#t.$height = parseFloat(t.height || "0"), this.position.set(this.#t.pad_left, this.#t.pad_top), this.#f = t.writingMode === "vertical-rl", this.#i = 0, this.#b = 0;
|
|
484
484
|
const s = t.lineHeight ?? "0";
|
|
485
|
-
this.#u = this.#
|
|
485
|
+
this.#u = this.#f ? 0 : (s.endsWith("px") ? parseFloat(s) : e * parseFloat(s) - e) / 2;
|
|
486
486
|
}
|
|
487
487
|
cvsResize() {
|
|
488
488
|
const t = this.#e.style, e = this.sys.cvsScale;
|
|
489
489
|
t.left = `${String(this.sys.ofsLeft4elm + this.#o * e)}px`, t.top = `${String(this.sys.ofsTop4elm + this.ctn.position.y * e)}px`, t.transform = `rotate(${String(this.ctn.angle)}deg) scale(${String(this.ctn.scale.x * e)}, ${String(this.ctn.scale.y * e)})`;
|
|
490
490
|
}
|
|
491
491
|
#o = 0;
|
|
492
|
-
#
|
|
492
|
+
#f = !1;
|
|
493
493
|
get tategaki() {
|
|
494
|
-
return this.#
|
|
494
|
+
return this.#f;
|
|
495
495
|
}
|
|
496
496
|
#i = 0;
|
|
497
497
|
#b = 0;
|
|
@@ -510,148 +510,150 @@ $1
|
|
|
510
510
|
#s = [];
|
|
511
511
|
// FIFO実行バッファ
|
|
512
512
|
goTxt(t, e) {
|
|
513
|
-
const s = () => this.#
|
|
513
|
+
const s = () => this.#m(t, e);
|
|
514
514
|
this.#s.push(s) === 1 && s();
|
|
515
515
|
}
|
|
516
|
-
#
|
|
517
|
-
#
|
|
518
|
-
static #
|
|
519
|
-
#
|
|
520
|
-
c.#
|
|
521
|
-
let s = this.#
|
|
516
|
+
#v = [];
|
|
517
|
+
#y = 0;
|
|
518
|
+
static #G = "<span class='sn_ch sn_ch_last'> </span>";
|
|
519
|
+
#m(t, e) {
|
|
520
|
+
c.#O.visible = !1;
|
|
521
|
+
let s = this.#v.length, i = "";
|
|
522
522
|
if (s === 0) {
|
|
523
|
-
if (c.#c.oCfg.debug.masume && (
|
|
523
|
+
if (c.#c.oCfg.debug.masume && (T.debugLog && console.log(`🍌 masume ${this.name} v:${String(this.visible)} l:${String(this.x)} t:${String(this.y)} a:${String(this.alpha)} pl:${String(this.#t.pad_left)} pr:${String(this.#t.pad_right)} pt:${String(this.#t.pad_top)} pb:${String(this.#t.pad_bottom)} w:${String(this.#t.$width)} h:${String(this.#t.$height)}`), this.#p.clear().beginFill(3407616, 0.2).lineStyle(1, 3407616, 1).drawRect(-this.#t.pad_left, -this.#t.pad_top, this.#t.$width, this.#t.$height).endFill().beginFill(13311, 0.2).lineStyle(2, 13311, 1).drawRect(
|
|
524
524
|
0,
|
|
525
525
|
0,
|
|
526
526
|
this.#t.$width - this.#t.pad_left - this.#t.pad_right,
|
|
527
527
|
this.#t.$height - this.#t.pad_top - this.#t.pad_bottom
|
|
528
|
-
).endFill()), this.#e.innerHTML = [...t].join("").replaceAll(/[\n\t]/g, "") + c.#
|
|
529
|
-
const
|
|
530
|
-
this.#
|
|
528
|
+
).endFill()), this.#e.innerHTML = [...t].join("").replaceAll(/[\n\t]/g, "") + c.#G, !this.#l.break_fixed) {
|
|
529
|
+
const g = globalThis.getComputedStyle(this.#e), $ = parseFloat(g.fontSize);
|
|
530
|
+
this.#f ? (this.#l.break_fixed_left = (this.#t.$width - this.#t.pad_left - this.#t.pad_right - $ * 1.5) * this.sys.cvsScale, this.#l.break_fixed_top = 0) : (this.#l.break_fixed_left = 0, this.#l.break_fixed_top = $ / 2 * this.sys.cvsScale);
|
|
531
531
|
}
|
|
532
532
|
} else
|
|
533
|
-
i = this.#e.innerHTML, --s, this.#e.getElementsByClassName("sn_ch_last").item(0)?.remove(), this.#e.querySelectorAll(":scope > br").forEach((
|
|
533
|
+
i = this.#e.innerHTML, --s, this.#e.getElementsByClassName("sn_ch_last").item(0)?.remove(), this.#e.querySelectorAll(":scope > br").forEach((g) => g.remove()), this.#e.insertAdjacentHTML(
|
|
534
534
|
"beforeend",
|
|
535
|
-
t.slice(this.#
|
|
535
|
+
t.slice(this.#y).join("").replaceAll(/[\n\t]/g, "") + c.#G
|
|
536
536
|
// 末尾改行削除挙動対策
|
|
537
537
|
);
|
|
538
|
-
this.#e.querySelectorAll(".sn_ch:has(> ruby)").forEach((
|
|
539
|
-
|
|
540
|
-
}), this.#
|
|
538
|
+
this.#e.querySelectorAll(".sn_ch:has(> ruby)").forEach((g) => {
|
|
539
|
+
g.style.background = "";
|
|
540
|
+
}), this.#y = t.length;
|
|
541
541
|
const a = this.sys.cvsScale, n = this.#e.getBoundingClientRect(), l = n.left + this.#t.pad_left, h = n.top + this.#t.pad_top;
|
|
542
542
|
let r;
|
|
543
|
-
if (a === 1) r = (
|
|
544
|
-
const
|
|
543
|
+
if (a === 1) r = (g, $) => {
|
|
544
|
+
const o = g.getBoundingClientRect();
|
|
545
545
|
return new X(
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
546
|
+
o.left - l,
|
|
547
|
+
o.top - h,
|
|
548
|
+
o.width,
|
|
549
|
+
o.height + ("gjqy".includes($) ? this.#u : 0)
|
|
550
550
|
);
|
|
551
551
|
};
|
|
552
552
|
else {
|
|
553
|
-
const
|
|
554
|
-
r = (
|
|
555
|
-
const
|
|
553
|
+
const g = this.sys.ofsPadLeft_Dom2PIXI + n.left * (1 - a), $ = this.sys.ofsPadTop_Dom2PIXI + n.top * (1 - a);
|
|
554
|
+
r = (o, d) => {
|
|
555
|
+
const u = o.getBoundingClientRect();
|
|
556
556
|
return new X(
|
|
557
|
-
(
|
|
558
|
-
(
|
|
559
|
-
|
|
560
|
-
(
|
|
557
|
+
(u.left - g) / a - l,
|
|
558
|
+
(u.top - $) / a - h,
|
|
559
|
+
u.width / a,
|
|
560
|
+
(u.height + ("gjqy".includes(d) ? this.#u : 0)) / a
|
|
561
561
|
);
|
|
562
562
|
};
|
|
563
563
|
}
|
|
564
|
-
const [b,
|
|
565
|
-
this.#
|
|
566
|
-
const w =
|
|
567
|
-
for (let
|
|
568
|
-
const $ = this.#
|
|
569
|
-
if (this.#
|
|
570
|
-
const f = new
|
|
571
|
-
this.#h.addChild(f), new
|
|
572
|
-
this.#
|
|
564
|
+
const [b, y] = this.#l.hyph(this.#e, r, this.#f, s, i);
|
|
565
|
+
this.#v = b;
|
|
566
|
+
const w = st.ease(this.#C);
|
|
567
|
+
for (let g = s; g < y; ++g) {
|
|
568
|
+
const $ = this.#v[g], { elm: { dataset: o, parentElement: d }, rect: u } = $, m = JSON.parse(o.arg ?? '{"delay": 0}'), v = JSON.parse(o.add ?? "{}"), _ = c.#$[v.ch_in_style];
|
|
569
|
+
if (this.#g($), o.cmd === "grp") {
|
|
570
|
+
const f = new P();
|
|
571
|
+
this.#h.addChild(f), new W(m.pic, f, (p) => {
|
|
572
|
+
this.#B(f, m, v, u, w, _ ?? {}), f.parent || f.removeChild(p);
|
|
573
573
|
});
|
|
574
574
|
}
|
|
575
|
-
if (
|
|
575
|
+
if (o.lnk) {
|
|
576
576
|
const f = d.closest("[data-arg]"), p = JSON.parse(f.dataset.arg ?? "{}");
|
|
577
|
-
p.key = `lnk=[${String(
|
|
578
|
-
const
|
|
579
|
-
this.#
|
|
580
|
-
const
|
|
577
|
+
p.key = `lnk=[${String(g)}] ` + this.name;
|
|
578
|
+
const E = new U();
|
|
579
|
+
this.#B(E, p, v, u, w, _ ?? {});
|
|
580
|
+
const j = p.style ?? "", R = j + (p.style_hover ?? ""), J = j + (p.style_clicked ?? ""), O = p.r_style ?? "", at = O + (p.r_style_hover ?? ""), ht = O + (p.r_style_clicked ?? ""), Z = Array.from(f.getElementsByTagName("rt"));
|
|
581
581
|
for (const z of Z) z.dataset.st_r_bk = z.style.cssText;
|
|
582
|
-
const
|
|
583
|
-
f.style.cssText =
|
|
584
|
-
for (const L of Z) L.style.cssText = L.dataset.st_r_bk +
|
|
582
|
+
const lt = f.style.cssText, D = (z, rt) => {
|
|
583
|
+
f.style.cssText = lt + z;
|
|
584
|
+
for (const L of Z) L.style.cssText = L.dataset.st_r_bk + rt;
|
|
585
585
|
};
|
|
586
586
|
F(p, "enabled", !0) ? c.#r.button(
|
|
587
587
|
p,
|
|
588
|
-
|
|
589
|
-
() => D(
|
|
590
|
-
() => this.canFocus() ? (D(
|
|
591
|
-
() => D(
|
|
588
|
+
E,
|
|
589
|
+
() => D(j, O),
|
|
590
|
+
() => this.canFocus() ? (D(R, at), !0) : !1,
|
|
591
|
+
() => D(J, ht)
|
|
592
592
|
) : D(
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
), this.#h.addChild(
|
|
593
|
+
j + (p.style_disable ?? "color: gray;"),
|
|
594
|
+
O + (p.r_style_disable ?? "color: gray;")
|
|
595
|
+
), this.#h.addChild(E);
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
|
-
const
|
|
598
|
+
const C = Array.from(this.#e.getElementsByClassName("sn_ch_yet"));
|
|
599
599
|
this.#S = () => {
|
|
600
600
|
this.#S = () => !1;
|
|
601
|
-
for (const $ of
|
|
602
|
-
c.#
|
|
601
|
+
for (const $ of C) $.className = "sn_ch";
|
|
602
|
+
c.#O.position.set(
|
|
603
603
|
this.#l.break_fixed_left,
|
|
604
604
|
this.#l.break_fixed_top
|
|
605
|
-
), c.#
|
|
606
|
-
const
|
|
607
|
-
return this.#s.length > 0 &&
|
|
605
|
+
), c.#O.visible = !0, this.noticeCompTxt();
|
|
606
|
+
const g = this.#s.shift();
|
|
607
|
+
return this.#s.length > 0 && g(), !0;
|
|
608
608
|
};
|
|
609
|
-
for (const
|
|
609
|
+
for (const g of C) g.className = g.className.replace("sn_ch_yet sn", "go");
|
|
610
610
|
s > 0 && ++s;
|
|
611
611
|
let x;
|
|
612
|
-
for (let
|
|
613
|
-
const { elm: $ } = this.#
|
|
612
|
+
for (let g = y - 2; g >= 0; --g) {
|
|
613
|
+
const { elm: $ } = this.#v[g];
|
|
614
614
|
if ($.tagName === "SPAN") {
|
|
615
615
|
x = $.parentElement?.tagName === "RUBY" ? $.parentElement.parentElement ?? $ : $;
|
|
616
616
|
break;
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
|
-
if (!x || e || s ===
|
|
619
|
+
if (!x || e || s === y) {
|
|
620
620
|
this.#S();
|
|
621
621
|
return;
|
|
622
622
|
}
|
|
623
|
-
|
|
623
|
+
const N = () => {
|
|
624
|
+
x.removeEventListener("animationend", N), this.#S();
|
|
625
|
+
};
|
|
626
|
+
x.addEventListener("animationend", N, { once: !0, signal: this.#N.signal });
|
|
624
627
|
}
|
|
625
628
|
#S = () => !1;
|
|
626
629
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
627
|
-
#
|
|
630
|
+
#B(t, e, s, i, a, n) {
|
|
628
631
|
t.alpha = 0, e.x && (i.x = e.x.startsWith("=") ? i.x + parseInt(e.x.slice(1)) : parseInt(e.x)), e.y && (i.y = e.y.startsWith("=") ? i.y + parseInt(e.y.slice(1)) : parseInt(e.y)), e.width && (i.width = parseInt(e.width)), e.height && (i.height = parseInt(e.height)), e.wait && (n.wait = e.wait), t.width = i.width, t.height = i.height, n.x ? t.position.set(
|
|
629
632
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
630
633
|
n.x.startsWith("=") ? i.x + t.width * n.nx : n.nx,
|
|
631
634
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
632
635
|
n.y.startsWith("=") ? i.y + t.height * n.ny : n.ny
|
|
633
636
|
) : t.position.set(i.x, i.y);
|
|
634
|
-
const l = {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
#O = [];
|
|
637
|
+
const l = new ft(t).to({ alpha: 1, x: i.x, y: i.y, width: i.width, height: i.height, angle: 0 }, n.wait ?? 0).easing(a).delay((s.wait ?? 0) + (e.delay ?? 0)).onComplete(() => {
|
|
638
|
+
h.tw = void 0;
|
|
639
|
+
}).start();
|
|
640
|
+
c.grp.add(l);
|
|
641
|
+
const h = { sp: t, tw: l };
|
|
642
|
+
this.#P.push(h);
|
|
643
|
+
}
|
|
644
|
+
#P = [];
|
|
643
645
|
skipChIn() {
|
|
644
646
|
let t = this.#S();
|
|
645
|
-
for (const e of this.#
|
|
647
|
+
for (const e of this.#P)
|
|
646
648
|
e.tw && (e.tw.stop().end(), t = !0);
|
|
647
|
-
return this.#
|
|
649
|
+
return this.#P = [], t;
|
|
648
650
|
}
|
|
649
651
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
650
652
|
static #$ = /* @__PURE__ */ Object.create(null);
|
|
651
|
-
static #
|
|
653
|
+
static #W = /[{\s.,*{]/;
|
|
652
654
|
// https://regex101.com/r/APC91I/1
|
|
653
655
|
static initChStyle() {
|
|
654
|
-
c.#$ = /* @__PURE__ */ Object.create(null), c.#
|
|
656
|
+
c.#$ = /* @__PURE__ */ Object.create(null), c.#E = /* @__PURE__ */ Object.create(null);
|
|
655
657
|
}
|
|
656
658
|
static getChInStyle(t) {
|
|
657
659
|
return c.#$[t];
|
|
@@ -659,13 +661,13 @@ $1
|
|
|
659
661
|
static ch_in_style(t) {
|
|
660
662
|
const { name: e } = t;
|
|
661
663
|
if (!e) throw "nameは必須です";
|
|
662
|
-
if (c.#
|
|
664
|
+
if (c.#W.test(e)) throw `name【${e}】に使えない文字が含まれます`;
|
|
663
665
|
if (e in c.#$) throw `name【${e}】はすでにあります`;
|
|
664
666
|
const s = String(t.x ?? "=0"), i = String(t.y ?? "=0");
|
|
665
667
|
return c.#$[e] = {
|
|
666
|
-
wait:
|
|
668
|
+
wait: S(t, "wait", 500),
|
|
667
669
|
// アニメ・FI時間
|
|
668
|
-
alpha:
|
|
670
|
+
alpha: S(t, "alpha", 0),
|
|
669
671
|
x: s,
|
|
670
672
|
// 初期x値
|
|
671
673
|
y: i,
|
|
@@ -677,29 +679,29 @@ $1
|
|
|
677
679
|
// {x:'=250,500'} +250から+500までの間でランダムな値を現在のX位置に加算
|
|
678
680
|
nx: parseFloat(s.at(0) === "=" ? s.slice(1) : s),
|
|
679
681
|
ny: parseFloat(i.at(0) === "=" ? i.slice(1) : i),
|
|
680
|
-
scale_x:
|
|
681
|
-
scale_y:
|
|
682
|
-
rotate:
|
|
682
|
+
scale_x: S(t, "scale_x", 1),
|
|
683
|
+
scale_y: S(t, "scale_y", 1),
|
|
684
|
+
rotate: S(t, "rotate", 0),
|
|
683
685
|
join: F(t, "join", !0),
|
|
684
686
|
// 文字を順番に出すか(true)同時か(false)
|
|
685
687
|
ease: t.ease ?? "ease-out"
|
|
686
688
|
};
|
|
687
689
|
}
|
|
688
690
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
689
|
-
static #
|
|
691
|
+
static #E = /* @__PURE__ */ Object.create(null);
|
|
690
692
|
static getChOutStyle(t) {
|
|
691
|
-
return c.#
|
|
693
|
+
return c.#E[t];
|
|
692
694
|
}
|
|
693
695
|
static ch_out_style(t) {
|
|
694
696
|
const { name: e } = t;
|
|
695
697
|
if (!e) throw "nameは必須です";
|
|
696
|
-
if (c.#
|
|
697
|
-
if (e in c.#
|
|
698
|
+
if (c.#W.test(e)) throw `name【${e}】に使えない文字が含まれます`;
|
|
699
|
+
if (e in c.#E) throw `name【${e}】はすでにあります`;
|
|
698
700
|
const s = String(t.x ?? "=0"), i = String(t.y ?? "=0");
|
|
699
|
-
return c.#
|
|
700
|
-
wait:
|
|
701
|
+
return c.#E[e] = {
|
|
702
|
+
wait: S(t, "wait", 500),
|
|
701
703
|
// アニメ・FI時間
|
|
702
|
-
alpha:
|
|
704
|
+
alpha: S(t, "alpha", 0),
|
|
703
705
|
x: s,
|
|
704
706
|
// 初期x値
|
|
705
707
|
y: i,
|
|
@@ -711,33 +713,34 @@ $1
|
|
|
711
713
|
// {x:'=250,500'} +250から+500までの間でランダムな値を現在のX位置に加算
|
|
712
714
|
nx: parseFloat(s.at(0) === "=" ? s.slice(1) : s),
|
|
713
715
|
ny: parseFloat(i.at(0) === "=" ? i.slice(1) : i),
|
|
714
|
-
scale_x:
|
|
715
|
-
scale_y:
|
|
716
|
-
rotate:
|
|
716
|
+
scale_x: S(t, "scale_x", 1),
|
|
717
|
+
scale_y: S(t, "scale_y", 1),
|
|
718
|
+
rotate: S(t, "rotate", 0),
|
|
717
719
|
join: F(t, "join", !1),
|
|
718
720
|
// 文字を順番に出すか(true)同時か(false)
|
|
719
721
|
ease: t.ease ?? "ease-out"
|
|
720
722
|
};
|
|
721
723
|
}
|
|
722
|
-
static #
|
|
723
|
-
static #
|
|
724
|
+
static #O = new P();
|
|
725
|
+
static #H = new W();
|
|
724
726
|
dispBreak(t) {
|
|
725
727
|
c.delBreak();
|
|
726
|
-
const e = c.#
|
|
727
|
-
e.visible = !1, this.addChild(e), c.#
|
|
728
|
-
e.parent ? (s.x =
|
|
728
|
+
const e = c.#O;
|
|
729
|
+
e.visible = !1, this.addChild(e), c.#H.destroy(), c.#H = new W(t.pic, e, (s) => {
|
|
730
|
+
e.parent ? (s.x = S(t, "x", 0), s.y = S(t, "y", 0), s.width = S(t, "width", this.#t.fontsize), s.height = S(t, "height", this.#t.fontsize)) : e.removeChild(s);
|
|
729
731
|
});
|
|
730
732
|
}
|
|
731
733
|
static delBreak() {
|
|
732
|
-
const t = c.#
|
|
733
|
-
t.parent?.removeChild(t), c.#
|
|
734
|
+
const t = c.#O;
|
|
735
|
+
t.parent?.removeChild(t), c.#H.destroy();
|
|
734
736
|
}
|
|
735
737
|
#C = "Quadratic.Out";
|
|
736
|
-
#
|
|
737
|
-
#
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
t
|
|
738
|
+
#R = "Quadratic.Out";
|
|
739
|
+
#N = new AbortController();
|
|
740
|
+
#z() {
|
|
741
|
+
this.#p.clear(), this.#v = [], this.#y = 0, this.#s = [], this.#N.abort(), this.#N = new AbortController(), this.skipChIn();
|
|
742
|
+
const t = document.createElement("span");
|
|
743
|
+
t.style.cssText = this.#e.style.cssText, t.classList.value = this.#e.classList.value;
|
|
741
744
|
const e = this.#e, s = Array.from(e.getElementsByClassName("sn_ch"));
|
|
742
745
|
e.parentElement.insertBefore(t, e);
|
|
743
746
|
let i = 0;
|
|
@@ -749,7 +752,7 @@ $1
|
|
|
749
752
|
// 縦中横
|
|
750
753
|
);
|
|
751
754
|
if (!l.ch_out_style) return;
|
|
752
|
-
const h = c.#
|
|
755
|
+
const h = c.#E[l.ch_out_style];
|
|
753
756
|
if (h) {
|
|
754
757
|
if (h.wait === 0) {
|
|
755
758
|
n.style.display = "none";
|
|
@@ -761,17 +764,28 @@ $1
|
|
|
761
764
|
const a = () => {
|
|
762
765
|
e.parentElement.removeChild(e);
|
|
763
766
|
for (const n of this.#h.removeChildren())
|
|
764
|
-
n instanceof
|
|
767
|
+
n instanceof P && c.#r.unButton(n), n.destroy();
|
|
765
768
|
};
|
|
766
|
-
i === 0
|
|
769
|
+
if (i === 0)
|
|
770
|
+
this.#e.textContent = "", this.#e = document.createElement("span"), a();
|
|
771
|
+
else {
|
|
772
|
+
const n = e.lastElementChild;
|
|
773
|
+
if (n) {
|
|
774
|
+
const l = () => {
|
|
775
|
+
n.removeEventListener("animationend", l), a();
|
|
776
|
+
};
|
|
777
|
+
n.addEventListener("animationend", l, { once: !0, signal: this.#N.signal });
|
|
778
|
+
} else a();
|
|
779
|
+
}
|
|
780
|
+
this.#e = t;
|
|
767
781
|
}
|
|
768
782
|
reNew() {
|
|
769
|
-
this.#
|
|
770
|
-
const t = new c(this.ctn,
|
|
771
|
-
return t.#t = this.#t, t.#e.style.cssText = this.#e.style.cssText, t.#o = this.#o, t.name = this.name, t.#
|
|
783
|
+
this.#z();
|
|
784
|
+
const t = new c(this.ctn, this.canFocus, this.sys);
|
|
785
|
+
return t.#t = this.#t, t.#e.style.cssText = this.#e.style.cssText, t.#o = this.#o, t.name = this.name, t.#_(), t.#F = this.#F, t.#C = this.#C, t.#R = this.#R, this.#l.reNew(t.#l), this.destroy(), t;
|
|
772
786
|
}
|
|
773
787
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
774
|
-
#
|
|
788
|
+
#F = void 0;
|
|
775
789
|
// 文字にかけるフィルター
|
|
776
790
|
record() {
|
|
777
791
|
return {
|
|
@@ -779,14 +793,14 @@ $1
|
|
|
779
793
|
cssText: this.#e.style.cssText,
|
|
780
794
|
left: this.#o,
|
|
781
795
|
// idc_hArg : this.#idc.gethArg(),
|
|
782
|
-
ch_filter: this.#
|
|
796
|
+
ch_filter: this.#F,
|
|
783
797
|
fi_easing: this.#C,
|
|
784
|
-
fo_easing: this.#
|
|
798
|
+
fo_easing: this.#R,
|
|
785
799
|
hyph: this.#l.record()
|
|
786
800
|
};
|
|
787
801
|
}
|
|
788
802
|
playback(t) {
|
|
789
|
-
this.#t = t.infTL, this.position.set(this.#t.pad_left, this.#t.pad_top), this.#e.style.cssText = t.cssText, this.#o = t.left, this.#
|
|
803
|
+
this.#t = t.infTL, this.position.set(this.#t.pad_left, this.#t.pad_top), this.#e.style.cssText = t.cssText, this.#o = t.left, this.#_(), this.#F = t.ch_filter, this.#C = t.fi_easing, this.#R = t.fo_easing, this.#l.playback(t.hyph);
|
|
790
804
|
}
|
|
791
805
|
get cssText() {
|
|
792
806
|
return this.#e.style.cssText;
|
|
@@ -794,19 +808,19 @@ $1
|
|
|
794
808
|
set cssText(t) {
|
|
795
809
|
this.#e.style.cssText = t;
|
|
796
810
|
}
|
|
797
|
-
#
|
|
811
|
+
#d = void 0;
|
|
798
812
|
snapshot(t, e) {
|
|
799
|
-
|
|
800
|
-
this.#
|
|
813
|
+
bt((s) => {
|
|
814
|
+
this.#d = U.from(s), this.#f && (this.#d.x += T.stageW - (this.#o + this.#t.$width)), this.#d.y -= this.#b, this.#d.texture.frame = new X(
|
|
801
815
|
0,
|
|
802
816
|
0,
|
|
803
|
-
Math.min(this.#
|
|
804
|
-
Math.min(this.#
|
|
805
|
-
), this.#h.addChild(this.#
|
|
817
|
+
Math.min(this.#d.width, this.#t.$width - this.#o),
|
|
818
|
+
Math.min(this.#d.height, this.#t.$height)
|
|
819
|
+
), this.#h.addChild(this.#d), t.render(this.#d, { clear: !1 }), e();
|
|
806
820
|
}, this.#e, this.#t, this.#i, this.#b, !1);
|
|
807
821
|
}
|
|
808
822
|
snapshot_end() {
|
|
809
|
-
this.#
|
|
823
|
+
this.#d && (this.#h.removeChild(this.#d), this.#d = void 0);
|
|
810
824
|
}
|
|
811
825
|
makeDesignCast(t) {
|
|
812
826
|
}
|
|
@@ -822,7 +836,8 @@ $1
|
|
|
822
836
|
return `"txt":"${this.#e.textContent.replaceAll(/(["\\])/g, "\\$1")}", "style":{${t.join(",")}}`;
|
|
823
837
|
}
|
|
824
838
|
destroy() {
|
|
825
|
-
c.delBreak(), this.#e.parentElement.removeChild(this.#e), this.removeChild(this.#h), this.removeChild(this.#
|
|
839
|
+
c.delBreak(), this.#e.parentElement.removeChild(this.#e), this.#e = document.createElement("span"), this.removeChild(this.#h), this.removeChild(this.#p), this.#p.clear(), this.#g = () => {
|
|
840
|
+
}, this.#s = [], this.#v = [], this.#y = 0, this.#P = [], this.#N.abort(), this.#F = void 0, super.destroy();
|
|
826
841
|
}
|
|
827
842
|
}
|
|
828
843
|
class k extends tt {
|
|
@@ -831,7 +846,7 @@ class k extends tt {
|
|
|
831
846
|
static #r;
|
|
832
847
|
static #a;
|
|
833
848
|
static init(t, e, s, i, a, n) {
|
|
834
|
-
this.#c = t, c.init(t, n), this.#n = s, this.#a = i, this.#r = a, s.setDoRecProc((l) => this.chgDoRec(l)), e.autowc = (l) => this.#u(l), e.autowc({ enabled: !1, text: "", time: 0 }), e.ch_in_style = (l) => this.#e(l), e.ch_out_style = (l) => this.#h(l), c.initChStyle(),
|
|
849
|
+
this.#c = t, c.init(t, n), this.#n = s, this.#a = i, this.#r = a, s.setDoRecProc((l) => this.chgDoRec(l)), e.autowc = (l) => this.#u(l), e.autowc({ enabled: !1, text: "", time: 0 }), e.ch_in_style = (l) => this.#e(l), e.ch_out_style = (l) => this.#h(l), c.initChStyle(), ct(), V(
|
|
835
850
|
t.matchPath(".+", et.FONT).flatMap((l) => Object.values(l).map((h) => `
|
|
836
851
|
@font-face {
|
|
837
852
|
font-family: '${String(h)}';
|
|
@@ -876,7 +891,7 @@ class k extends tt {
|
|
|
876
891
|
}
|
|
877
892
|
// 文字出現演出
|
|
878
893
|
static #e(t) {
|
|
879
|
-
const { x: e, y: s, nx: i, ny: a, alpha: n, wait: l, ease: h, rotate: r, scale_x: b, scale_y:
|
|
894
|
+
const { x: e, y: s, nx: i, ny: a, alpha: n, wait: l, ease: h, rotate: r, scale_x: b, scale_y: y } = c.ch_in_style(t), w = e.startsWith("=") ? `${String(i * 100)}%` : `${String(i)}px`, C = s.startsWith("=") ? `${String(a * 100)}%` : `${String(a)}px`, { name: x = "" } = t;
|
|
880
895
|
return V(`
|
|
881
896
|
.sn_ch_in_${x} {
|
|
882
897
|
position: relative;
|
|
@@ -889,14 +904,14 @@ class k extends tt {
|
|
|
889
904
|
animation: sn_ch_in_${x} ${String(l)}ms ${h} 0s both;
|
|
890
905
|
}
|
|
891
906
|
@keyframes sn_ch_in_${x} {
|
|
892
|
-
from {transform: rotate(${String(r)}deg) scale(${String(b)}, ${String(
|
|
907
|
+
from {transform: rotate(${String(r)}deg) scale(${String(b)}, ${String(y)}) translate(${w}, ${C})}
|
|
893
908
|
to {opacity: 1; transform: none;}
|
|
894
909
|
}
|
|
895
910
|
`), !1;
|
|
896
911
|
}
|
|
897
912
|
// 文字消去演出
|
|
898
913
|
static #h(t) {
|
|
899
|
-
const { x: e, y: s, nx: i, ny: a, alpha: n, wait: l, ease: h, rotate: r, scale_x: b, scale_y:
|
|
914
|
+
const { x: e, y: s, nx: i, ny: a, alpha: n, wait: l, ease: h, rotate: r, scale_x: b, scale_y: y } = c.ch_out_style(t), w = e.startsWith("=") ? `${String(i * 100)}%` : `${String(i)}px`, C = s.startsWith("=") ? `${String(a * 100)}%` : `${String(a)}px`, { name: x = "" } = t;
|
|
900
915
|
return V(`
|
|
901
916
|
.go_ch_out_${x} {
|
|
902
917
|
position: relative;
|
|
@@ -906,16 +921,16 @@ class k extends tt {
|
|
|
906
921
|
@keyframes go_ch_out_${x} {
|
|
907
922
|
to {
|
|
908
923
|
opacity: ${String(n)};
|
|
909
|
-
transform: rotate(${String(r)}deg) scale(${String(b)}, ${String(
|
|
924
|
+
transform: rotate(${String(r)}deg) scale(${String(b)}, ${String(y)}) translate(${w}, ${C});
|
|
910
925
|
}
|
|
911
926
|
`), !1;
|
|
912
927
|
}
|
|
913
|
-
static #
|
|
928
|
+
static #p = 10;
|
|
914
929
|
static set msecChWait(t) {
|
|
915
|
-
k.#
|
|
930
|
+
k.#p = t;
|
|
916
931
|
}
|
|
917
932
|
static get msecChWait() {
|
|
918
|
-
return k.#
|
|
933
|
+
return k.#p;
|
|
919
934
|
}
|
|
920
935
|
static #k;
|
|
921
936
|
static #l;
|
|
@@ -923,35 +938,35 @@ class k extends tt {
|
|
|
923
938
|
this.#k = t, this.#l = e, c.setEvtMng(t, s);
|
|
924
939
|
}
|
|
925
940
|
// 文字ごとのウェイト
|
|
926
|
-
static #
|
|
941
|
+
static #g = !1;
|
|
927
942
|
static #t = {};
|
|
928
943
|
static #u(t) {
|
|
929
|
-
this.#
|
|
944
|
+
this.#g = F(t, "enabled", this.#g), this.#n.setVal_Nochk("save", "const.sn.autowc.enabled", this.#g);
|
|
930
945
|
const { text: e } = t;
|
|
931
946
|
if ("text" in t != "time" in t) throw "[autowc] textとtimeは同時指定必須です";
|
|
932
947
|
if (this.#n.setVal_Nochk("save", "const.sn.autowc.text", e), !e)
|
|
933
948
|
return this.#n.setVal_Nochk("save", "const.sn.autowc.time", ""), !1;
|
|
934
949
|
const s = e.length;
|
|
935
|
-
if (this.#
|
|
950
|
+
if (this.#g && s === 0) throw '[autowc] enabled === false かつ text === "" は許されません';
|
|
936
951
|
const i = String(t.time).split(",");
|
|
937
952
|
if (i.length !== s) throw "[autowc] text文字数とtimeに記述された待ち時間(コンマ区切り)は同数にして下さい";
|
|
938
953
|
this.#t = {};
|
|
939
|
-
for (let a = 0; a < s; ++a) this.#t[e[a]] =
|
|
954
|
+
for (let a = 0; a < s; ++a) this.#t[e[a]] = M(i[a]);
|
|
940
955
|
return this.#n.setVal_Nochk("save", "const.sn.autowc.time", t.time), !1;
|
|
941
956
|
}
|
|
942
957
|
// バック
|
|
943
|
-
#
|
|
958
|
+
#_ = 0;
|
|
944
959
|
#o = 0;
|
|
945
|
-
#
|
|
960
|
+
#f = !1;
|
|
946
961
|
#i = void 0;
|
|
947
962
|
#b = "";
|
|
948
963
|
// 背景画像無し(=単色塗り)
|
|
949
964
|
// 文字表示
|
|
950
965
|
#s = new c(this.ctn, () => this.canFocus(), k.#l);
|
|
951
|
-
#
|
|
952
|
-
#
|
|
966
|
+
#v = new it();
|
|
967
|
+
#y = document.createElement("span");
|
|
953
968
|
// cssチェック・保存用
|
|
954
|
-
static #
|
|
969
|
+
static #G = {
|
|
955
970
|
"text-align": 0,
|
|
956
971
|
"text-align-last": 0,
|
|
957
972
|
height: 0,
|
|
@@ -961,15 +976,15 @@ class k extends tt {
|
|
|
961
976
|
"padding-top": 0,
|
|
962
977
|
"padding-bottom": 0
|
|
963
978
|
};
|
|
964
|
-
#
|
|
979
|
+
#m = new P();
|
|
965
980
|
constructor() {
|
|
966
|
-
super(), this.ctn.addChild(this.#s), this.#
|
|
981
|
+
super(), this.ctn.addChild(this.#s), this.#v.init(this.#Y), this.ctn.addChild(this.#m), this.#m.name = "cntBtn", this.lay({ style: `width: ${String(T.stageW)}px; height: ${String(T.stageH)}px; font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', '游ゴシック Medium', meiryo, sans-serif; color: white; font-size: 24px; line-height: 1.5; padding: ${String(16)}px;`, in_style: "default", out_style: "default", back_clear: "true" });
|
|
967
982
|
}
|
|
968
983
|
destroy() {
|
|
969
984
|
this.#i && (this.ctn.removeChild(this.#i).destroy(), this.#i = void 0), k.#a.pagebreak(), this.#s.destroy();
|
|
970
985
|
}
|
|
971
986
|
static destroy() {
|
|
972
|
-
this.#
|
|
987
|
+
this.#g = !1, this.#t = {}, this.#F = (t) => t;
|
|
973
988
|
}
|
|
974
989
|
set name(t) {
|
|
975
990
|
this.name_ = t, this.#s.name = t;
|
|
@@ -982,7 +997,7 @@ class k extends tt {
|
|
|
982
997
|
this.#s.cvsResize();
|
|
983
998
|
}
|
|
984
999
|
cvsResizeChildren() {
|
|
985
|
-
for (const t of this.#
|
|
1000
|
+
for (const t of this.#m.children) t.cvsResize();
|
|
986
1001
|
}
|
|
987
1002
|
procSetX(t) {
|
|
988
1003
|
this.#s.lay({ x: t });
|
|
@@ -991,37 +1006,37 @@ class k extends tt {
|
|
|
991
1006
|
this.#s.lay({ y: t });
|
|
992
1007
|
}
|
|
993
1008
|
lay(t) {
|
|
994
|
-
if (super.lay(t), tt.setXY(this.ctn, t, this.ctn), t[":id_tag"] = this.name_.slice(0, -7),
|
|
1009
|
+
if (super.lay(t), tt.setXY(this.ctn, t, this.ctn), t[":id_tag"] = this.name_.slice(0, -7), it.setting(t), this.#H(t), this.#s.lay(t), "r_align" in t && (this.#x = t.r_align ?? ""), this.#d = T.isSafari ? this.#s.tategaki ? (i, a) => `text-align: start; height: ${String(a)}em; padding-top: ${i}; padding-bottom: ${i};` : (i, a) => `text-align: start; width: ${String(a)}em; padding-left: ${i}; padding-right: ${i};` : this.#s.tategaki ? (i) => `text-align: justify; text-align-last: justify; padding-top: ${i}; padding-bottom: ${i};` : (i) => `text-align: justify; text-align-last: justify; padding-left: ${i}; padding-right: ${i};`, T.isFirefox && (this.#q = this.#Z), "r_style" in t)
|
|
995
1010
|
if (t.r_style) {
|
|
996
1011
|
const i = document.createElement("span");
|
|
997
1012
|
i.style.cssText = t.r_style;
|
|
998
|
-
const a = i.style.length, n = this.#
|
|
1013
|
+
const a = i.style.length, n = this.#y.style;
|
|
999
1014
|
for (let l = 0; l < a; ++l) {
|
|
1000
1015
|
const h = i.style[l];
|
|
1001
|
-
if (h in k.#
|
|
1016
|
+
if (h in k.#G) {
|
|
1002
1017
|
K.myTrace(`${String(h)}は指定できません`, "W");
|
|
1003
1018
|
continue;
|
|
1004
1019
|
}
|
|
1005
1020
|
const r = i.style[h];
|
|
1006
1021
|
r && (n[h] = r);
|
|
1007
1022
|
}
|
|
1008
|
-
} else this.#
|
|
1009
|
-
if ("alpha" in t) for (const i of this.#
|
|
1023
|
+
} else this.#y.style.cssText = "";
|
|
1024
|
+
if ("alpha" in t) for (const i of this.#m.children) i.alpha = this.ctn.alpha;
|
|
1010
1025
|
this.#S(t), this.#$(t);
|
|
1011
|
-
const e =
|
|
1012
|
-
i &&
|
|
1026
|
+
const e = I.procID + `TxtLayer lay name:${this.name_}`, s = this.#O(t, (i) => {
|
|
1027
|
+
i && I.endProc(e);
|
|
1013
1028
|
});
|
|
1014
|
-
return s &&
|
|
1029
|
+
return s && I.beginProc(e), s;
|
|
1015
1030
|
}
|
|
1016
1031
|
#S(t) {
|
|
1017
1032
|
const { in_style: e } = t;
|
|
1018
1033
|
if (!e) return;
|
|
1019
1034
|
const s = c.getChInStyle(e);
|
|
1020
1035
|
if (!s) throw `存在しないin_style【${e}】です`;
|
|
1021
|
-
this.#
|
|
1036
|
+
this.#B = e, this.#P = s.join;
|
|
1022
1037
|
}
|
|
1023
|
-
#
|
|
1024
|
-
#
|
|
1038
|
+
#B = "";
|
|
1039
|
+
#P = !0;
|
|
1025
1040
|
get width() {
|
|
1026
1041
|
return this.#s.getWidth;
|
|
1027
1042
|
}
|
|
@@ -1032,65 +1047,65 @@ class k extends tt {
|
|
|
1032
1047
|
const { out_style: e } = t;
|
|
1033
1048
|
if (!e) return;
|
|
1034
1049
|
if (!c.getChOutStyle(e)) throw `存在しないout_style【${e}】です`;
|
|
1035
|
-
this.#
|
|
1050
|
+
this.#W = e;
|
|
1036
1051
|
}
|
|
1037
|
-
#
|
|
1038
|
-
#
|
|
1039
|
-
#
|
|
1052
|
+
#W = "";
|
|
1053
|
+
#E = new W();
|
|
1054
|
+
#O(t, e) {
|
|
1040
1055
|
if ("back_clear" in t)
|
|
1041
|
-
return F(t, "back_clear", !1) && (this.#
|
|
1042
|
-
this.#o =
|
|
1043
|
-
const s = (this.#
|
|
1056
|
+
return F(t, "back_clear", !1) && (this.#_ = 0, this.#o = 0, this.#f = !1, this.#b = ""), e(!1), !1;
|
|
1057
|
+
this.#o = S(t, "b_alpha", this.#o), this.#f = F(t, "b_alpha_isfixed", this.#f);
|
|
1058
|
+
const s = (this.#f ? 1 : Number(k.#n.getVal("sys:TextLayer.Back.Alpha"))) * this.#o;
|
|
1044
1059
|
if (t.b_pic) {
|
|
1045
1060
|
if (this.#b !== t.b_pic)
|
|
1046
|
-
return this.#b = t.b_pic, this.#i && (this.ctn.removeChild(this.#i), this.#i.destroy()), this.#
|
|
1061
|
+
return this.#b = t.b_pic, this.#i && (this.ctn.removeChild(this.#i), this.#i.destroy()), this.#E = new W(this.#b, this.ctn, (i) => {
|
|
1047
1062
|
this.#i = i, i.name = "back(pic)", i.visible = s > 0, i.alpha = s, this.#s.setMySize(i.width, i.height), this.ctn.setChildIndex(i, 0), e(!0);
|
|
1048
|
-
}), this.#
|
|
1049
|
-
} else "b_color" in t && (this.#
|
|
1050
|
-
(this.#i = new B()).beginFill(this.#
|
|
1063
|
+
}), this.#E.ret;
|
|
1064
|
+
} else "b_color" in t && (this.#_ = dt(t, "b_color", 0), this.#i && (this.ctn.removeChild(this.#i), this.#i.destroy()), this.#b = "", this.ctn.addChildAt(
|
|
1065
|
+
(this.#i = new B()).beginFill(this.#_, s).lineStyle(void 0).drawRect(0, 0, this.#s.getWidth, this.#s.getHeight).endFill(),
|
|
1051
1066
|
0
|
|
1052
1067
|
), this.#i.name = "back(color)");
|
|
1053
1068
|
return this.#i && (this.#i.visible = s > 0, this.#i.alpha = s), e(!1), !1;
|
|
1054
1069
|
}
|
|
1055
1070
|
chgBackAlpha(t) {
|
|
1056
|
-
const e = this.#
|
|
1071
|
+
const e = this.#f ? this.#o : t * this.#o;
|
|
1057
1072
|
this.#i instanceof B && (this.#i && (this.ctn.removeChild(this.#i), this.#i.destroy()), this.ctn.addChildAt(
|
|
1058
|
-
(this.#i = new B()).beginFill(this.#
|
|
1073
|
+
(this.#i = new B()).beginFill(this.#_, e).lineStyle(void 0).drawRect(0, 0, this.#s.getWidth, this.#s.getHeight).endFill(),
|
|
1059
1074
|
0
|
|
1060
1075
|
), this.#i.name = "back(color)"), this.#i && (this.#i.visible = e > 0, this.#i.alpha = e);
|
|
1061
1076
|
}
|
|
1062
|
-
#
|
|
1063
|
-
"noffs" in t && (this.#
|
|
1077
|
+
#H(t) {
|
|
1078
|
+
"noffs" in t && (this.#N = t.noffs ?? "", this.#z = new RegExp(`[ ${this.#N}]`)), "ffs" in t && (this.#C ??= "", this.#R = this.#C === "" ? () => "" : (e) => this.#z.test(e) ? "" : ` font-feature-settings: ${this.#C};`);
|
|
1064
1079
|
}
|
|
1065
1080
|
#C = "";
|
|
1066
|
-
#
|
|
1067
|
-
#
|
|
1081
|
+
#R = (t) => "";
|
|
1082
|
+
#N = "";
|
|
1068
1083
|
// eslint-disable-next-line no-irregular-whitespace
|
|
1069
|
-
#
|
|
1084
|
+
#z = /[ ]/;
|
|
1070
1085
|
// Safariが全体に「font-feature-settings」した後、特定文字の「font-feature-settings: initial;」を受け付けてくれないのでわざわざ一つずつ指定
|
|
1071
1086
|
static chgDoRec(t) {
|
|
1072
|
-
this.#
|
|
1087
|
+
this.#F = t ? (e) => e : (e) => `<span class='offrec'>${e}</span>`;
|
|
1073
1088
|
}
|
|
1074
|
-
static #
|
|
1089
|
+
static #F = (t) => t;
|
|
1075
1090
|
isCur = !1;
|
|
1076
|
-
#
|
|
1077
|
-
#
|
|
1091
|
+
#d = () => "";
|
|
1092
|
+
#q = (t, e, s, i = "") => {
|
|
1078
1093
|
if (!s) return ` style='${i}'`;
|
|
1079
1094
|
const a = t.length * 2;
|
|
1080
1095
|
if (a - e.length < 0) return ` style='text-align: ${s}; ${i}'`;
|
|
1081
1096
|
let n = "";
|
|
1082
1097
|
switch (s) {
|
|
1083
1098
|
case "justify":
|
|
1084
|
-
n = this.#
|
|
1099
|
+
n = this.#d("0", a);
|
|
1085
1100
|
break;
|
|
1086
1101
|
case "121":
|
|
1087
|
-
n = this.#
|
|
1102
|
+
n = this.#d(`calc(${String((a - e.length) / (e.length * 2))}em)`, a);
|
|
1088
1103
|
break;
|
|
1089
1104
|
case "even":
|
|
1090
|
-
n = this.#
|
|
1105
|
+
n = this.#d(`calc(${String((a - e.length) / (e.length + 1))}em)`, a);
|
|
1091
1106
|
break;
|
|
1092
1107
|
case "1ruby":
|
|
1093
|
-
n = this.#
|
|
1108
|
+
n = this.#d("1em", a);
|
|
1094
1109
|
break;
|
|
1095
1110
|
default:
|
|
1096
1111
|
n = `text-align: ${s};`;
|
|
@@ -1134,7 +1149,7 @@ class k extends tt {
|
|
|
1134
1149
|
return ` style='${n} ${i}'`;
|
|
1135
1150
|
}
|
|
1136
1151
|
tagCh(t) {
|
|
1137
|
-
this.#
|
|
1152
|
+
this.#v.putTxt(t);
|
|
1138
1153
|
}
|
|
1139
1154
|
#w = !1;
|
|
1140
1155
|
get needGoTxt() {
|
|
@@ -1150,10 +1165,10 @@ class k extends tt {
|
|
|
1150
1165
|
case 1:
|
|
1151
1166
|
if (this.#w = !0, t === `
|
|
1152
1167
|
`) {
|
|
1153
|
-
this.#
|
|
1168
|
+
this.#M ? (this.#M = !1, a = "<ruby> <rt> </rt></ruby><br/>") : a = "<br/>";
|
|
1154
1169
|
break;
|
|
1155
1170
|
}
|
|
1156
|
-
this.#
|
|
1171
|
+
this.#M && (this.#M = !1, s === "" && (s = " ")), a = this.#X(t, s, this.#x);
|
|
1157
1172
|
break;
|
|
1158
1173
|
default:
|
|
1159
1174
|
switch (n) {
|
|
@@ -1173,54 +1188,54 @@ class k extends tt {
|
|
|
1173
1188
|
case "even":
|
|
1174
1189
|
//(均等アキ)ルビの前後、ルビ間も均等にあける
|
|
1175
1190
|
case "1ruby":
|
|
1176
|
-
this.#
|
|
1191
|
+
this.#M = !1, this.#w = !0, a = this.#X(t, h, n);
|
|
1177
1192
|
break;
|
|
1178
1193
|
case "gotxt":
|
|
1179
1194
|
this.#V(), this.#w ? (this.isCur && k.#a.recText(
|
|
1180
|
-
this.#
|
|
1181
|
-
), this.#s.goTxt(this.#
|
|
1195
|
+
this.#j.join("").replace(/^<ruby> <rt> <\/rt><\/ruby>(<br\/>)+/, "").replaceAll(/style='(anim\S+ [^;]+;\s*)+/g, "style='").replaceAll(/( style=''| data-(add|arg|cmd)='[^']+'|\n+|\t+)/g, "").replaceAll(/class='sn_ch[^']+/g, "class='sn_ch").replaceAll("display: none;", "").replaceAll("class='offrec'", "style='display: none;'")
|
|
1196
|
+
), this.#s.goTxt(this.#j, this.#I === 0), this.#w = !1, this.#I = 0) : this.isCur && this.#s.noticeCompTxt();
|
|
1182
1197
|
return;
|
|
1183
1198
|
// breakではない
|
|
1184
1199
|
case "add":
|
|
1185
1200
|
{
|
|
1186
|
-
const r = JSON.parse(h), { style: b = "", wait:
|
|
1187
|
-
this.#
|
|
1201
|
+
const r = JSON.parse(h), { style: b = "", wait: y = null } = r, { cl: w, sty: C } = this.#D(!0, y ? M(y) : null);
|
|
1202
|
+
this.#j.push(`<span${w} style='${C} display: inline; ${b}'>`), delete r.style, this.#K(r);
|
|
1188
1203
|
}
|
|
1189
1204
|
return;
|
|
1190
1205
|
// breakではない
|
|
1191
1206
|
case "add_close":
|
|
1192
|
-
this.#
|
|
1207
|
+
this.#j.push("</span>"), this.#V();
|
|
1193
1208
|
return;
|
|
1194
1209
|
// breakではない
|
|
1195
1210
|
case "grp":
|
|
1196
1211
|
this.#w = !0;
|
|
1197
1212
|
{
|
|
1198
1213
|
const r = JSON.parse(h);
|
|
1199
|
-
if (r.id ??= String(this.#
|
|
1214
|
+
if (r.id ??= String(this.#j.length), r.id === "break") {
|
|
1200
1215
|
this.#s.dispBreak(r);
|
|
1201
1216
|
return;
|
|
1202
1217
|
}
|
|
1203
|
-
this.#
|
|
1204
|
-
const { r: b, wait:
|
|
1205
|
-
a = `<span${
|
|
1218
|
+
this.#M = !1, r.delay = this.#I, r.r ??= "", r.style ??= "", r.r_style ??= "";
|
|
1219
|
+
const { r: b, wait: y = null, r_style: w } = r, { cl: C, sty: x, lnk: N } = this.#D(!0, y ? M(y) : null);
|
|
1220
|
+
a = `<span${C} style='${x} ${r.style}'><ruby><span data-cmd='grp' data-arg='${JSON.stringify(r)}'${N} style='${x} display: inline;'> </span><rt${N}${this.#q(
|
|
1206
1221
|
" ",
|
|
1207
1222
|
b,
|
|
1208
1223
|
this.#x,
|
|
1209
|
-
this.#
|
|
1224
|
+
this.#y.style.cssText + (this.#T.at(-1)?.o.r_style ?? "") + w
|
|
1210
1225
|
)}>${r.r}</rt></ruby></span>`;
|
|
1211
1226
|
}
|
|
1212
1227
|
break;
|
|
1213
1228
|
case "tcy":
|
|
1214
|
-
this.#
|
|
1229
|
+
this.#M = !1, this.#w = !0;
|
|
1215
1230
|
{
|
|
1216
|
-
const { t: r = "", r: b = "", wait:
|
|
1217
|
-
k.#n.doRecLog() && (this.#
|
|
1218
|
-
const x =
|
|
1219
|
-
a = `<span${
|
|
1231
|
+
const { t: r = "", r: b = "", wait: y = null, style: w = "", r_style: C = "" } = JSON.parse(h);
|
|
1232
|
+
k.#n.doRecLog() && (this.#U += t + (s ? `《${s}》` : ""), this.#J += r);
|
|
1233
|
+
const x = T.isSafari ? b.replaceAll(/[A-Za-z0-9]/g, (o) => String.fromCharCode(o.charCodeAt(0) + 65248)) : b, { cl: N, sty: g, lnk: $ } = this.#D(!0, y ? M(y) : null);
|
|
1234
|
+
a = `<span${N} style='${g}${this.#R(r)} ${w}'><ruby><span${$} style='${g} display: inline; text-combine-upright: all;'>${r}</span><rt${$}${this.#q(
|
|
1220
1235
|
r,
|
|
1221
1236
|
x,
|
|
1222
1237
|
this.#x,
|
|
1223
|
-
this.#
|
|
1238
|
+
this.#y.style.cssText + (this.#T.at(-1)?.o.r_style ?? "") + C
|
|
1224
1239
|
)}>${x}</rt></ruby></span>`;
|
|
1225
1240
|
}
|
|
1226
1241
|
break;
|
|
@@ -1237,13 +1252,13 @@ class k extends tt {
|
|
|
1237
1252
|
{
|
|
1238
1253
|
const r = JSON.parse(h);
|
|
1239
1254
|
r[":link"] = " data-lnk='@'";
|
|
1240
|
-
const { cl: b, sty:
|
|
1241
|
-
this.#
|
|
1255
|
+
const { cl: b, sty: y, curpos: w } = this.#D(!1, r.wait ? M(r.wait) : null);
|
|
1256
|
+
this.#j.push(`<span${b} style='${y} display: inline; ${r.style ?? ""}' ${w} data-arg='${h}'>`), delete r.style, this.#Q(r);
|
|
1242
1257
|
}
|
|
1243
1258
|
return;
|
|
1244
1259
|
// breakではない
|
|
1245
1260
|
case "endlink":
|
|
1246
|
-
this.#w = !0, this.#
|
|
1261
|
+
this.#w = !0, this.#j.push("</span>"), this.#V();
|
|
1247
1262
|
return;
|
|
1248
1263
|
// breakではない
|
|
1249
1264
|
default:
|
|
@@ -1251,52 +1266,52 @@ class k extends tt {
|
|
|
1251
1266
|
}
|
|
1252
1267
|
break;
|
|
1253
1268
|
}
|
|
1254
|
-
this.#
|
|
1269
|
+
this.#j.push(k.#F(a));
|
|
1255
1270
|
};
|
|
1256
1271
|
#X(t, e, s) {
|
|
1257
1272
|
const i = t === " " ? " " : t === " " ? " " : t;
|
|
1258
|
-
k.#n.doRecLog() && (this.#
|
|
1273
|
+
k.#n.doRecLog() && (this.#U += i + (e ? `《${e}》` : ""), t !== " " && (this.#J += t));
|
|
1259
1274
|
const { cl: a, sty: n, lnk: l } = this.#D(!0, null, t);
|
|
1260
|
-
return e ? `<span${a} style='${n} ${this.#
|
|
1261
|
-
Array.from(t).map((h, r) => `<span${a}${l} style='${r > 0 ? this.#D(!0, null, t).sty : n} display: inline;'>${h === " " ? " " : h === " " ? " " : h}</span>`).join("")}<rt${l}${this.#
|
|
1275
|
+
return e ? `<span${a} style='${n} ${this.#R(t)}'><ruby>${// 文字個別に出現させるため以下にも ${cl} が必要
|
|
1276
|
+
Array.from(t).map((h, r) => `<span${a}${l} style='${r > 0 ? this.#D(!0, null, t).sty : n} display: inline;'>${h === " " ? " " : h === " " ? " " : h}</span>`).join("")}<rt${l}${this.#q(
|
|
1262
1277
|
t,
|
|
1263
1278
|
e,
|
|
1264
1279
|
s,
|
|
1265
|
-
this.#
|
|
1266
|
-
)}>${e}</rt></ruby></span>` : `<span${a} style='${n} ${this.#
|
|
1280
|
+
this.#y.style.cssText + (this.#T.at(-1)?.o.r_style ?? "")
|
|
1281
|
+
)}>${e}</rt></ruby></span>` : `<span${a} style='${n} ${this.#R(t)}'${l}>${i}</span>`;
|
|
1267
1282
|
}
|
|
1268
1283
|
#D(t, e, s = `
|
|
1269
1284
|
`) {
|
|
1270
|
-
const i = this.#
|
|
1271
|
-
k.#k.isSkipping ? this.#
|
|
1272
|
-
const a = `data-add='{"ch_in_style":"${this.#
|
|
1285
|
+
const i = this.#P ? e ?? this.#T.at(0)?.o.wait ?? (k.#g ? k.#t[s.at(0) ?? ""] ?? 0 : k.msecChWait) : 0;
|
|
1286
|
+
k.#k.isSkipping ? this.#I = 0 : t && this.#P && (this.#I += M(i));
|
|
1287
|
+
const a = `data-add='{"ch_in_style":"${this.#B}", "ch_out_style":"${this.#W}"}'`;
|
|
1273
1288
|
return {
|
|
1274
|
-
cl: ` class='sn_ch sn_ch_yet sn_ch_in_${this.#
|
|
1289
|
+
cl: ` class='sn_ch sn_ch_yet sn_ch_in_${this.#B}'`,
|
|
1275
1290
|
// TxtStage.goTxt()はこれ単位で文字出現させる
|
|
1276
|
-
sty: `animation-delay: ${String(this.#
|
|
1291
|
+
sty: `animation-delay: ${String(this.#I)}ms;${this.#T.at(-1)?.o.style ?? ""}`,
|
|
1277
1292
|
// TxtStage.goTxt()はこれ単位で文字出現させる
|
|
1278
|
-
lnk: (this.#
|
|
1293
|
+
lnk: (this.#T.at(0)?.o[":link"] ?? "") + " " + a,
|
|
1279
1294
|
curpos: a
|
|
1280
1295
|
};
|
|
1281
1296
|
}
|
|
1282
|
-
#
|
|
1283
|
-
#
|
|
1284
|
-
#
|
|
1285
|
-
#
|
|
1297
|
+
#I = 0;
|
|
1298
|
+
#M = !0;
|
|
1299
|
+
#j = [];
|
|
1300
|
+
#T = [];
|
|
1286
1301
|
#K(t) {
|
|
1287
|
-
this.#
|
|
1302
|
+
this.#T.push({
|
|
1288
1303
|
o: t,
|
|
1289
1304
|
r_align: this.#x,
|
|
1290
|
-
ch_in_style: this.#
|
|
1291
|
-
ch_out_style: this.#
|
|
1305
|
+
ch_in_style: this.#B,
|
|
1306
|
+
ch_out_style: this.#W
|
|
1292
1307
|
}), t.r_align && (this.#x = t.r_align), this.#S(t), this.#$(t);
|
|
1293
1308
|
}
|
|
1294
1309
|
#V() {
|
|
1295
|
-
const t = this.#
|
|
1310
|
+
const t = this.#T.pop();
|
|
1296
1311
|
t && (this.#x = t.r_align, this.#S({ in_style: t.ch_in_style }), this.#$({ out_style: t.ch_out_style }));
|
|
1297
1312
|
}
|
|
1298
1313
|
#Q(t) {
|
|
1299
|
-
const e = this.#
|
|
1314
|
+
const e = this.#T.at(-1);
|
|
1300
1315
|
if (!e) {
|
|
1301
1316
|
this.#K(t);
|
|
1302
1317
|
return;
|
|
@@ -1305,12 +1320,12 @@ class k extends tt {
|
|
|
1305
1320
|
}
|
|
1306
1321
|
click = () => !this.ctn.interactiveChildren || !this.ctn.visible ? !1 : this.#s.skipChIn();
|
|
1307
1322
|
clearText() {
|
|
1308
|
-
this.ctn.addChild(this.#s = this.#s.reNew()), this.#
|
|
1323
|
+
this.ctn.removeChild(this.#s), this.ctn.addChild(this.#s = this.#s.reNew()), this.#I = 0, this.#M = !0, this.#j = [], this.#U = "", this.#J = "", k.#a.pagebreak();
|
|
1309
1324
|
}
|
|
1310
|
-
#
|
|
1325
|
+
#U = "";
|
|
1311
1326
|
#J = "";
|
|
1312
1327
|
get pageText() {
|
|
1313
|
-
return this.#
|
|
1328
|
+
return this.#U.replace("《 》", "");
|
|
1314
1329
|
}
|
|
1315
1330
|
get pagePlainText() {
|
|
1316
1331
|
return this.#J;
|
|
@@ -1322,38 +1337,38 @@ class k extends tt {
|
|
|
1322
1337
|
this.ctn.interactiveChildren = t;
|
|
1323
1338
|
}
|
|
1324
1339
|
addButton = (t) => new Promise((e) => {
|
|
1325
|
-
t.key = `btn=[${String(this.#
|
|
1326
|
-
const s = new
|
|
1327
|
-
s.name = JSON.stringify(t).replaceAll('"', "'"), this.#
|
|
1340
|
+
t.key = `btn=[${String(this.#m.children.length)}] ` + this.name_, t[":id_tag"] = t.key.slice(0, -7), F(t, "hint_tate", this.#s.tategaki);
|
|
1341
|
+
const s = new ut(t, k.#k, () => e(), () => this.canFocus());
|
|
1342
|
+
s.name = JSON.stringify(t).replaceAll('"', "'"), this.#m.addChild(s);
|
|
1328
1343
|
});
|
|
1329
1344
|
canFocus() {
|
|
1330
1345
|
return (this.ctn.interactiveChildren ?? !1) && this.ctn.visible && k.#r(this);
|
|
1331
1346
|
}
|
|
1332
1347
|
clearLay(t) {
|
|
1333
1348
|
super.clearLay(t), this.clearText();
|
|
1334
|
-
for (const e of this.#
|
|
1349
|
+
for (const e of this.#m.removeChildren()) e.destroy();
|
|
1335
1350
|
}
|
|
1336
1351
|
record = () => ({
|
|
1337
1352
|
...super.record(),
|
|
1338
1353
|
enabled: this.enabled,
|
|
1339
|
-
r_cssText: this.#
|
|
1354
|
+
r_cssText: this.#y.style.cssText,
|
|
1340
1355
|
r_align: this.#x,
|
|
1341
1356
|
// バック
|
|
1342
|
-
b_do: this.#i === void 0 ? void 0 : this.#i instanceof
|
|
1357
|
+
b_do: this.#i === void 0 ? void 0 : this.#i instanceof U ? "Sprite" : "Graphics",
|
|
1343
1358
|
b_pic: this.#b,
|
|
1344
|
-
b_color: this.#
|
|
1359
|
+
b_color: this.#_,
|
|
1345
1360
|
b_alpha: this.#o,
|
|
1346
|
-
b_alpha_isfixed: this.#
|
|
1361
|
+
b_alpha_isfixed: this.#f,
|
|
1347
1362
|
ffs: this.#C,
|
|
1348
1363
|
txs: this.#s.record(),
|
|
1349
|
-
strNoFFS: this.#
|
|
1350
|
-
btns: this.#
|
|
1364
|
+
strNoFFS: this.#N,
|
|
1365
|
+
btns: this.#m.children.map((t) => t.name)
|
|
1351
1366
|
});
|
|
1352
1367
|
playback(t, e) {
|
|
1353
|
-
super.playback(t, e), this.enabled = t.enabled, this.#
|
|
1368
|
+
super.playback(t, e), this.enabled = t.enabled, this.#y.style.cssText = t.r_cssText, this.#x = t.r_align, this.cvsResize(), this.#H(t), this.#s.playback(t.txs), this.#o = t.b_alpha, this.#f = t.b_alpha_isfixed, e.push(
|
|
1354
1369
|
new Promise((s) => {
|
|
1355
1370
|
const i = t.b_do ? t.b_do === "Sprite" ? { b_pic: t.b_pic } : { b_color: t.b_color } : { b_pic: "" };
|
|
1356
|
-
i.b_alpha = t.b_alpha, i.b_alpha_isfixed = t.b_alpha_isfixed, this.#
|
|
1371
|
+
i.b_alpha = t.b_alpha, i.b_alpha_isfixed = t.b_alpha_isfixed, this.#O(i, (a) => {
|
|
1357
1372
|
a && s();
|
|
1358
1373
|
}) || s();
|
|
1359
1374
|
}),
|
|
@@ -1377,25 +1392,25 @@ class k extends tt {
|
|
|
1377
1392
|
}
|
|
1378
1393
|
makeDesignCastChildren(t) {
|
|
1379
1394
|
if (this.ctn.visible)
|
|
1380
|
-
for (const e of this.#
|
|
1395
|
+
for (const e of this.#m.children) e.makeDesignCast(t);
|
|
1381
1396
|
}
|
|
1382
1397
|
showDesignCast() {
|
|
1383
1398
|
this.#s.showDesignCast();
|
|
1384
1399
|
}
|
|
1385
1400
|
showDesignCastChildren() {
|
|
1386
|
-
for (const t of this.#
|
|
1401
|
+
for (const t of this.#m.children) t.showDesignCast();
|
|
1387
1402
|
}
|
|
1388
1403
|
dump() {
|
|
1389
|
-
return this.#Y("", "gotxt|"), super.dump() + `, "enabled":"${String(this.enabled)}", ${this.#s.dump()}, "b_pic":"${this.#b}", "b_color":"${String(this.#
|
|
1404
|
+
return this.#Y("", "gotxt|"), super.dump() + `, "enabled":"${String(this.enabled)}", ${this.#s.dump()}, "b_pic":"${this.#b}", "b_color":"${String(this.#_)}", "b_alpha":${String(this.#o)}, "b_alpha_isfixed":"${String(this.#f)}", "width":${String(this.#s.getWidth)}, "height":${String(this.#s.getHeight)}, "pixi_obj":[${this.ctn.children.map((t) => `{"class":"${t instanceof U ? "Sprite" : t instanceof B ? "Graphics" : t instanceof P ? "Container" : "?"}", "name":"${t.name}", "alpha":${String(t.alpha)}, "x":${String(t.x)}, "y":${String(t.y)}, "visible":"${String(t.visible)}"}`).join(",")}], "button":[${this.#m.children.map((t) => t.children[0]?.name ?? "{}").join(",")}]`;
|
|
1390
1405
|
}
|
|
1391
1406
|
}
|
|
1392
|
-
const
|
|
1407
|
+
const Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1393
1408
|
__proto__: null,
|
|
1394
1409
|
TxtLayer: k
|
|
1395
1410
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1396
1411
|
export {
|
|
1397
1412
|
k as T,
|
|
1398
1413
|
c as a,
|
|
1399
|
-
|
|
1414
|
+
Et as b
|
|
1400
1415
|
};
|
|
1401
1416
|
//# sourceMappingURL=TxtLayer.js.map
|