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