@famibee/skynovel 1.64.19 → 1.64.21
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/CmnTween.js +26 -27
- package/dist/CmnTween.js.map +1 -1
- package/dist/DebugMng.js +2 -2
- package/dist/DebugMng.js.map +1 -1
- package/dist/EventMng.js +218 -213
- package/dist/EventMng.js.map +1 -1
- package/dist/LayerMng.js +64 -52
- package/dist/LayerMng.js.map +1 -1
- package/dist/Reading.js +34 -28
- package/dist/Reading.js.map +1 -1
- package/dist/ScriptIterator.js +1 -1
- package/dist/ScriptIterator.js.map +1 -1
- package/dist/SndBuf.js +22 -22
- package/dist/SndBuf.js.map +1 -1
- package/dist/TxtLayer.js +238 -239
- package/dist/TxtLayer.js.map +1 -1
- package/dist/appMain_cmn.d.ts.map +1 -1
- package/dist/sn/CmnInterface.d.ts +1 -1
- package/dist/sn/CmnInterface.d.ts.map +1 -1
- package/dist/sn/CmnLib.d.ts +1 -0
- package/dist/sn/CmnLib.d.ts.map +1 -1
- package/dist/sn/CmnTween.d.ts.map +1 -1
- package/dist/sn/EventMng.d.ts.map +1 -1
- package/dist/sn/FocusMng.d.ts +2 -0
- package/dist/sn/FocusMng.d.ts.map +1 -1
- package/dist/sn/FrameMng.d.ts.map +1 -1
- package/dist/sn/Hyphenation.d.ts.map +1 -1
- package/dist/sn/Layer.d.ts.map +1 -1
- package/dist/sn/Reading.d.ts.map +1 -1
- package/dist/sn/SndBuf.d.ts.map +1 -1
- package/dist/sn/TxtLayer.d.ts.map +1 -1
- package/dist/sn/TxtStage.d.ts.map +1 -1
- package/dist/sn/htm2tx.d.ts.map +1 -1
- package/dist/web2.js +4 -4
- package/dist/web2.js.map +1 -1
- package/dist_app/CmnTween.js +28 -29
- package/dist_app/CmnTween.js.map +1 -1
- package/dist_app/EventMng.js +326 -321
- package/dist_app/EventMng.js.map +1 -1
- package/dist_app/LayerMng.js +64 -52
- package/dist_app/LayerMng.js.map +1 -1
- package/dist_app/Reading.js +34 -28
- package/dist_app/Reading.js.map +1 -1
- package/dist_app/ScriptIterator.js +1 -1
- package/dist_app/ScriptIterator.js.map +1 -1
- package/dist_app/SndBuf.js +22 -22
- package/dist_app/SndBuf.js.map +1 -1
- package/dist_app/TxtLayer.js +306 -307
- package/dist_app/TxtLayer.js.map +1 -1
- package/dist_app/app2.js +6 -6
- package/dist_app/app2.js.map +1 -1
- package/dist_app/appMain.js +1 -1
- package/dist_app/appMain.js.map +1 -1
- package/dist_app/appMain_cmn.d.ts.map +1 -1
- package/dist_app/sn/CmnInterface.d.ts +1 -1
- package/dist_app/sn/CmnInterface.d.ts.map +1 -1
- package/dist_app/sn/CmnLib.d.ts +1 -0
- package/dist_app/sn/CmnLib.d.ts.map +1 -1
- package/dist_app/sn/CmnTween.d.ts.map +1 -1
- package/dist_app/sn/EventMng.d.ts.map +1 -1
- package/dist_app/sn/FocusMng.d.ts +2 -2
- package/dist_app/sn/FocusMng.d.ts.map +1 -1
- package/dist_app/sn/FrameMng.d.ts.map +1 -1
- package/dist_app/sn/Hyphenation.d.ts.map +1 -1
- package/dist_app/sn/Layer.d.ts.map +1 -1
- package/dist_app/sn/Reading.d.ts.map +1 -1
- package/dist_app/sn/SndBuf.d.ts.map +1 -1
- package/dist_app/sn/TxtLayer.d.ts.map +1 -1
- package/dist_app/sn/TxtStage.d.ts.map +1 -1
- package/dist_app/sn/htm2tx.d.ts.map +1 -1
- package/package.json +2 -2
package/dist_app/TxtLayer.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { e as F, k as v, y as lt, D as K, o as T, a as j, R as A, G as B, x as G, N as X, z as tt, O as
|
|
1
|
+
import { e as F, k as v, y as lt, D as K, o as T, a as j, R as A, G as B, x as G, N as X, z as tt, O as rt, w as V, S as et, u as O, r as ot } from "./app2.js";
|
|
2
2
|
import { C as ct } from "./CmnTween.js";
|
|
3
3
|
import { S as I } from "./SpritesMng.js";
|
|
4
4
|
import { a as W, T as dt } from "./Reading.js";
|
|
5
5
|
import { R as st } from "./RubySpliter.js";
|
|
6
6
|
import { Button as pt } from "./Button.js";
|
|
7
|
-
const H = "、。,.)]}〉」』】〕”〟ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶ!?!?‼⁉・ーゝゞヽヾ々", U = "[({〈「『【〔“〝", q = "─‥…", Y = H, it = new RegExp(`[${H}]`), ft = new RegExp(`[${U}]`), ut = new RegExp(`[${q}]`),
|
|
8
|
-
class
|
|
7
|
+
const H = "、。,.)]}〉」』】〕”〟ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶ!?!?‼⁉・ーゝゞヽヾ々", U = "[({〈「『【〔“〝", q = "─‥…", Y = H, it = new RegExp(`[${H}]`), ft = new RegExp(`[${U}]`), ut = new RegExp(`[${q}]`), gt = it;
|
|
8
|
+
class _t {
|
|
9
9
|
#c = H;
|
|
10
10
|
#n = U;
|
|
11
|
-
#
|
|
11
|
+
#r = q;
|
|
12
12
|
#a = Y;
|
|
13
13
|
get 行頭禁則() {
|
|
14
14
|
return this.#c;
|
|
@@ -17,7 +17,7 @@ class yt {
|
|
|
17
17
|
return this.#n;
|
|
18
18
|
}
|
|
19
19
|
get 分割禁止() {
|
|
20
|
-
return this.#
|
|
20
|
+
return this.#r;
|
|
21
21
|
}
|
|
22
22
|
get ぶら下げ() {
|
|
23
23
|
return this.#a;
|
|
@@ -25,13 +25,13 @@ class yt {
|
|
|
25
25
|
#e = it;
|
|
26
26
|
#h = ft;
|
|
27
27
|
#d = ut;
|
|
28
|
-
#k =
|
|
28
|
+
#k = gt;
|
|
29
29
|
break_fixed = !1;
|
|
30
30
|
break_fixed_left = 0;
|
|
31
31
|
break_fixed_top = 0;
|
|
32
32
|
bura = !1;
|
|
33
33
|
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.#
|
|
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.#y(), this.#d = new RegExp(`[${this.#r}]`)), t.kinsoku_bura && (this.#a = t.kinsoku_bura, this.#l(), this.#y(), 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 = v(t, "break_fixed_left", this.break_fixed_left), this.break_fixed_top = v(t, "break_fixed_top", this.break_fixed_top);
|
|
35
35
|
}
|
|
36
36
|
// 禁則の競合(ぶら下げ と 行末禁則 の両方に含まれる文字があってはならない)
|
|
37
37
|
#l() {
|
|
@@ -39,33 +39,33 @@ class yt {
|
|
|
39
39
|
if (t < e)
|
|
40
40
|
for (let s = 0; s < t; ++s) {
|
|
41
41
|
const i = this.#n[s];
|
|
42
|
-
if (this.#a.includes(i)) throw `禁則の競合があります。文字 ${i} がぶら下げ と 行末禁則 の両方に含まれます`;
|
|
42
|
+
if (this.#a.includes(i)) throw `禁則の競合があります。文字 ${String(i)} がぶら下げ と 行末禁則 の両方に含まれます`;
|
|
43
43
|
}
|
|
44
44
|
else
|
|
45
45
|
for (let s = 0; s < e; ++s) {
|
|
46
46
|
const i = this.#a[s];
|
|
47
|
-
if (this.#n.includes(i)) throw `禁則の競合があります。文字 ${i} がぶら下げ と 行末禁則 の両方に含まれます`;
|
|
47
|
+
if (this.#n.includes(i)) throw `禁則の競合があります。文字 ${String(i)} がぶら下げ と 行末禁則 の両方に含まれます`;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
// 禁則の競合(ぶら下げ と 分割禁止 の両方に含まれる文字があってはならない)
|
|
51
|
-
#
|
|
52
|
-
const t = this.#
|
|
51
|
+
#y() {
|
|
52
|
+
const t = this.#r.length, e = this.#a.length;
|
|
53
53
|
if (t < e)
|
|
54
54
|
for (let s = 0; s < t; ++s) {
|
|
55
|
-
const i = this.#
|
|
56
|
-
if (this.#a.includes(i)) throw `禁則の競合があります。文字 ${i} がぶら下げ と 分割禁止 の両方に含まれます`;
|
|
55
|
+
const i = this.#r[s];
|
|
56
|
+
if (this.#a.includes(i)) throw `禁則の競合があります。文字 ${String(i)} がぶら下げ と 分割禁止 の両方に含まれます`;
|
|
57
57
|
}
|
|
58
58
|
else
|
|
59
59
|
for (let s = 0; s < e; ++s) {
|
|
60
60
|
const i = this.#a[s];
|
|
61
|
-
if (this.#
|
|
61
|
+
if (this.#r.includes(i)) throw `禁則の競合があります。文字 ${String(i)} がぶら下げ と 分割禁止 の両方に含まれます`;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
reNew(t) {
|
|
65
|
-
t.#t(this.#c, this.#n, this.#
|
|
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;
|
|
66
66
|
}
|
|
67
67
|
#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.#
|
|
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.#d = new RegExp(`[${s}]`)), this.#a !== i && (this.#a = i, this.#k = new RegExp(`[${i}]`));
|
|
69
69
|
}
|
|
70
70
|
record() {
|
|
71
71
|
const t = {
|
|
@@ -74,7 +74,7 @@ class yt {
|
|
|
74
74
|
break_fixed_top: this.break_fixed_top,
|
|
75
75
|
bura: this.bura
|
|
76
76
|
};
|
|
77
|
-
return this.#c === H && (t.行頭禁則 = this.#c), this.#n === U && (t.行末禁則 = this.#n), this.#
|
|
77
|
+
return this.#c === H && (t.行頭禁則 = this.#c), this.#n === U && (t.行末禁則 = this.#n), this.#r === q && (t.分割禁止 = this.#r), this.#a === Y && (t.ぶら下げ = this.#a), t;
|
|
78
78
|
}
|
|
79
79
|
playback(t) {
|
|
80
80
|
t && (this.#t(
|
|
@@ -85,34 +85,34 @@ class yt {
|
|
|
85
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);
|
|
86
86
|
}
|
|
87
87
|
hyph(t, e, s, i, a) {
|
|
88
|
-
let n, l = 0, h = 2,
|
|
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);
|
|
89
89
|
do {
|
|
90
|
-
if (n = this.#
|
|
91
|
-
let
|
|
90
|
+
if (n = this.#g(t, e), l = n.length, r(l)) break;
|
|
91
|
+
let b = -1 / 0;
|
|
92
92
|
for (; h < l; ++h) {
|
|
93
|
-
const { elm:
|
|
94
|
-
if (
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
97
|
-
|
|
93
|
+
const { elm: _, rect: w, ch: E } = n[h];
|
|
94
|
+
if (_.tagName === "RT") continue;
|
|
95
|
+
const x = s ? w.y : w.x;
|
|
96
|
+
if (b <= x || _.previousElementSibling?.tagName === "SPAN" && _.previousElementSibling?.innerHTML.includes("<br>") || _.parentElement?.previousElementSibling?.tagName === "SPAN" && _.parentElement?.previousElementSibling?.innerHTML.includes("<br>")) {
|
|
97
|
+
b = x, this.break_fixed || (this.break_fixed_left = w.x, this.break_fixed_top = w.y);
|
|
98
98
|
continue;
|
|
99
99
|
}
|
|
100
|
-
const u = this.#u(n, h), { elm:
|
|
100
|
+
const u = this.#u(n, h), { elm: $, rect: S, ch: d } = n[u];
|
|
101
101
|
if (!this.break_fixed) {
|
|
102
|
-
this.break_fixed_left =
|
|
103
|
-
const
|
|
102
|
+
this.break_fixed_left = S.x, this.break_fixed_top = S.y;
|
|
103
|
+
const g = globalThis.getComputedStyle($), C = parseFloat(g.fontSize);
|
|
104
104
|
s ? this.break_fixed_top += C : this.break_fixed_left += C;
|
|
105
105
|
}
|
|
106
|
-
|
|
107
|
-
const
|
|
106
|
+
b = -1 / 0;
|
|
107
|
+
const o = h, { cont: m, ins: y } = this.bura ? this.hyph_alg_bura(n, u, d, h) : this.hyph_alg(n, u, d, h, E);
|
|
108
108
|
if (h = y, m) continue;
|
|
109
|
-
const
|
|
110
|
-
if (f.classList.contains("sn_tx")) f.insertBefore(p,
|
|
109
|
+
const R = n[h].elm, f = R.parentElement, p = document.createElement("br");
|
|
110
|
+
if (f.classList.contains("sn_tx")) f.insertBefore(p, R);
|
|
111
111
|
else {
|
|
112
|
-
const
|
|
113
|
-
|
|
112
|
+
const g = f.parentElement;
|
|
113
|
+
g.classList.contains("sn_ch") ? g.parentElement.insertBefore(p, g) : g.insertBefore(p, f);
|
|
114
114
|
}
|
|
115
|
-
h += 2, h <
|
|
115
|
+
h += 2, h < o && (h = o), l = -1;
|
|
116
116
|
break;
|
|
117
117
|
}
|
|
118
118
|
} while (l < 0);
|
|
@@ -123,9 +123,9 @@ class yt {
|
|
|
123
123
|
const s = e - 1, { elm: i } = t[s];
|
|
124
124
|
return i.tagName !== "RT" ? s - (i.style.textCombineUpright === "all" ? Array.from(i.textContent).length - 1 : 0) : s - Array.from(i.textContent).length;
|
|
125
125
|
}
|
|
126
|
-
#
|
|
126
|
+
#g(t, e) {
|
|
127
127
|
const s = [];
|
|
128
|
-
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.#g(l, e)).flat();
|
|
129
129
|
const i = t.ownerDocument.createRange();
|
|
130
130
|
i.selectNodeContents(t);
|
|
131
131
|
let a = 0;
|
|
@@ -181,10 +181,10 @@ class yt {
|
|
|
181
181
|
if (this.#k.test(n) || this.#e.test(n)) {
|
|
182
182
|
let h = e;
|
|
183
183
|
(this.#k.test(s) || this.#e.test(s)) && ++h;
|
|
184
|
-
const
|
|
185
|
-
if (
|
|
186
|
-
if (!this.#h.test(
|
|
187
|
-
h =
|
|
184
|
+
const r = this.#u(t, h), { ch: b } = t[r], { ch: _ } = t[h];
|
|
185
|
+
if (b === _ && this.#d.test(_)) return { cont: !1, ins: r };
|
|
186
|
+
if (!this.#h.test(b)) return { cont: !1, ins: h };
|
|
187
|
+
h = r;
|
|
188
188
|
do
|
|
189
189
|
if (!this.#h.test(t[h].ch)) break;
|
|
190
190
|
while ((h = this.#u(t, h)) >= 0);
|
|
@@ -196,161 +196,161 @@ class yt {
|
|
|
196
196
|
if (this.#d.test(n) && h === n)
|
|
197
197
|
return { cont: !1, ins: l };
|
|
198
198
|
if (this.#h.test(h)) {
|
|
199
|
-
let
|
|
200
|
-
for (; (
|
|
199
|
+
let r = l;
|
|
200
|
+
for (; (r = this.#u(t, r)) >= 0 && this.#h.test(t[r].ch); )
|
|
201
201
|
;
|
|
202
|
-
return { cont: !1, ins:
|
|
202
|
+
return { cont: !1, ins: r + 1 };
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
return { cont: !1, ins: a };
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function yt(Q, t, e, s, i, a = !0) {
|
|
209
209
|
const n = {
|
|
210
210
|
escape: (d) => d.replaceAll(/([.*+?^${}()|[\]/\\])/g, "\\$1"),
|
|
211
211
|
mimeType: (d) => {
|
|
212
|
-
const
|
|
213
|
-
return l()[
|
|
212
|
+
const o = _(d).toLowerCase();
|
|
213
|
+
return l()[o] || "";
|
|
214
214
|
},
|
|
215
215
|
dataAsUrl: u,
|
|
216
|
-
isDataUrl:
|
|
217
|
-
resolveUrl:
|
|
218
|
-
getAndEncode:
|
|
216
|
+
isDataUrl: w,
|
|
217
|
+
resolveUrl: E,
|
|
218
|
+
getAndEncode: x,
|
|
219
219
|
asArray: (d) => {
|
|
220
|
-
const
|
|
221
|
-
for (let y = 0; y < m; ++y)
|
|
222
|
-
return
|
|
220
|
+
const o = [], m = d.length;
|
|
221
|
+
for (let y = 0; y < m; ++y) o.push(d[y]);
|
|
222
|
+
return o;
|
|
223
223
|
}
|
|
224
224
|
};
|
|
225
225
|
function l() {
|
|
226
|
-
const d = "application/font-woff",
|
|
226
|
+
const d = "application/font-woff", o = "image/jpeg";
|
|
227
227
|
return {
|
|
228
228
|
woff: d,
|
|
229
229
|
woff2: d,
|
|
230
230
|
ttf: "application/font-truetype",
|
|
231
231
|
eot: "application/vnd.ms-fontobject",
|
|
232
232
|
png: "image/png",
|
|
233
|
-
jpg:
|
|
234
|
-
jpeg:
|
|
233
|
+
jpg: o,
|
|
234
|
+
jpeg: o,
|
|
235
235
|
gif: "image/gif",
|
|
236
236
|
tiff: "image/tiff",
|
|
237
237
|
svg: "image/svg+xml"
|
|
238
238
|
};
|
|
239
239
|
}
|
|
240
|
-
const h =
|
|
241
|
-
function
|
|
242
|
-
return
|
|
240
|
+
const h = $(), r = S();
|
|
241
|
+
function b(d) {
|
|
242
|
+
return r.resolveAll().then((o) => {
|
|
243
243
|
const m = document.createElement("style");
|
|
244
|
-
return d.appendChild(m), m.appendChild(document.createTextNode(
|
|
244
|
+
return d.appendChild(m), m.appendChild(document.createTextNode(o)), d;
|
|
245
245
|
});
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function _(d) {
|
|
248
248
|
return /\.([^./]*?)$/g.exec(d)?.[1] ?? "";
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function w(d) {
|
|
251
251
|
return d.search(/^(data:)/) !== -1;
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function E(d, o) {
|
|
254
254
|
const m = document.implementation.createHTMLDocument(), y = m.createElement("base");
|
|
255
255
|
m.head.appendChild(y);
|
|
256
|
-
const
|
|
257
|
-
return m.body.appendChild(
|
|
256
|
+
const R = m.createElement("a");
|
|
257
|
+
return m.body.appendChild(R), y.href = o, R.href = d, R.href;
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function x(d) {
|
|
260
260
|
return new Promise(function(m) {
|
|
261
261
|
const y = new XMLHttpRequest();
|
|
262
|
-
y.onreadystatechange =
|
|
263
|
-
function
|
|
262
|
+
y.onreadystatechange = R, y.ontimeout = f, y.responseType = "blob", y.timeout = 3e4, y.open("GET", d, !0), y.send();
|
|
263
|
+
function R() {
|
|
264
264
|
if (y.readyState !== 4) return;
|
|
265
265
|
if (y.status !== 200) {
|
|
266
266
|
p("cannot fetch resource: " + d + ", status: " + y.status);
|
|
267
267
|
return;
|
|
268
268
|
}
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
const C =
|
|
269
|
+
const g = new FileReader();
|
|
270
|
+
g.onloadend = function() {
|
|
271
|
+
const C = g.result.toString().split(/,/)[1];
|
|
272
272
|
m(C);
|
|
273
|
-
},
|
|
273
|
+
}, g.readAsDataURL(y.response);
|
|
274
274
|
}
|
|
275
275
|
function f() {
|
|
276
276
|
p("timeout of 30000ms occured while fetching resource: " + d);
|
|
277
277
|
}
|
|
278
|
-
function p(
|
|
279
|
-
console.error(
|
|
278
|
+
function p(g) {
|
|
279
|
+
console.error(g), m("");
|
|
280
280
|
}
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
|
-
function u(d,
|
|
284
|
-
return "data:" +
|
|
283
|
+
function u(d, o) {
|
|
284
|
+
return "data:" + o + ";base64," + d;
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function $() {
|
|
287
287
|
const d = /url\(['"]?([^'"]+?)['"]?\)/g;
|
|
288
288
|
return {
|
|
289
|
-
inlineAll:
|
|
290
|
-
shouldProcess:
|
|
289
|
+
inlineAll: R,
|
|
290
|
+
shouldProcess: o
|
|
291
291
|
};
|
|
292
|
-
function
|
|
292
|
+
function o(f) {
|
|
293
293
|
return f.search(d) !== -1;
|
|
294
294
|
}
|
|
295
295
|
function m(f) {
|
|
296
296
|
const p = [];
|
|
297
|
-
let
|
|
298
|
-
for (;
|
|
299
|
-
p.push(
|
|
297
|
+
let g;
|
|
298
|
+
for (; g = d.exec(f); )
|
|
299
|
+
p.push(g[1]);
|
|
300
300
|
return p.filter(function(C) {
|
|
301
301
|
return !n.isDataUrl(C);
|
|
302
302
|
});
|
|
303
303
|
}
|
|
304
|
-
function y(f, p,
|
|
305
|
-
return Promise.resolve(p).then((
|
|
306
|
-
function M(
|
|
307
|
-
return new RegExp(`(url\\(['"]?)(` + n.escape(
|
|
304
|
+
function y(f, p, g, C) {
|
|
305
|
+
return Promise.resolve(p).then((N) => g ? n.resolveUrl(N, g) : N).then(C || n.getAndEncode).then((N) => n.dataAsUrl(N, n.mimeType(p))).then((N) => f.replace(M(p), "$1" + N + "$3"));
|
|
306
|
+
function M(N) {
|
|
307
|
+
return new RegExp(`(url\\(['"]?)(` + n.escape(N) + `)(['"]?\\))`, "g");
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function R(f, p, g) {
|
|
311
311
|
if (C()) return Promise.resolve(f);
|
|
312
312
|
return Promise.resolve(f).then(m).then((M) => {
|
|
313
|
-
let
|
|
314
|
-
for (const P of M)
|
|
315
|
-
return
|
|
313
|
+
let N = Promise.resolve(f);
|
|
314
|
+
for (const P of M) N = N.then((J) => y(J, P, p, g));
|
|
315
|
+
return N;
|
|
316
316
|
});
|
|
317
317
|
function C() {
|
|
318
|
-
return !
|
|
318
|
+
return !o(f);
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function S() {
|
|
323
323
|
return {
|
|
324
324
|
resolveAll: d,
|
|
325
|
-
impl: { readAll:
|
|
325
|
+
impl: { readAll: o }
|
|
326
326
|
};
|
|
327
327
|
function d() {
|
|
328
|
-
return
|
|
328
|
+
return o().then((m) => Promise.allSettled(
|
|
329
329
|
m.map((y) => y.resolve())
|
|
330
330
|
)).then((m) => m.join(`
|
|
331
331
|
`));
|
|
332
332
|
}
|
|
333
|
-
function
|
|
334
|
-
return Promise.resolve(n.asArray(document.styleSheets)).then(y).then(m).then((f) => f.map(
|
|
333
|
+
function o() {
|
|
334
|
+
return Promise.resolve(n.asArray(document.styleSheets)).then(y).then(m).then((f) => f.map(R));
|
|
335
335
|
function m(f) {
|
|
336
336
|
return f.filter((p) => p.type === CSSRule.FONT_FACE_RULE).filter((p) => h.shouldProcess(p.style.getPropertyValue("src")));
|
|
337
337
|
}
|
|
338
338
|
function y(f) {
|
|
339
339
|
const p = [];
|
|
340
|
-
for (const
|
|
340
|
+
for (const g of f)
|
|
341
341
|
try {
|
|
342
|
-
if (
|
|
343
|
-
n.asArray(
|
|
342
|
+
if (g.href) continue;
|
|
343
|
+
n.asArray(g.cssRules || []).forEach(p.push.bind(p));
|
|
344
344
|
} catch (C) {
|
|
345
|
-
console.error("Error while reading CSS rules from " +
|
|
345
|
+
console.error("Error while reading CSS rules from " + g.href, String(C));
|
|
346
346
|
}
|
|
347
347
|
return p;
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function R(f) {
|
|
350
350
|
return {
|
|
351
351
|
resolve: function() {
|
|
352
|
-
const
|
|
353
|
-
return h.inlineAll(f.cssText,
|
|
352
|
+
const g = (f.parentStyleSheet || {}).href;
|
|
353
|
+
return h.inlineAll(f.cssText, g);
|
|
354
354
|
},
|
|
355
355
|
src() {
|
|
356
356
|
return f.style.getPropertyValue("src");
|
|
@@ -360,29 +360,29 @@ function mt(Q, t, e, s, i, a = !0) {
|
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
362
|
Promise.resolve(t).then((d) => {
|
|
363
|
-
const
|
|
364
|
-
return
|
|
365
|
-
}).then(
|
|
363
|
+
const o = d.cloneNode(!0);
|
|
364
|
+
return o.style.padding = "0px", o.style.paddingRight = s + "px", o.style.paddingTop = i + "px", o.style.left = "0px", o.style.top = "0px", o.style.width = e.$width - e.pad_left - e.pad_right + "px", o.style.height = e.$height - e.pad_top - e.pad_bottom + "px", t.hidden = a, o;
|
|
365
|
+
}).then(b).then((d) => {
|
|
366
366
|
d.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
|
|
367
|
-
const
|
|
368
|
-
return
|
|
367
|
+
const o = new Image();
|
|
368
|
+
return o.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(d).replaceAll("#", "%23").replaceAll(`
|
|
369
369
|
`, "%0A")}</foreignObject></svg>`, new Promise((m) => {
|
|
370
|
-
|
|
370
|
+
o.onload = () => m(o);
|
|
371
371
|
});
|
|
372
|
-
}).then((d) => new Promise((
|
|
373
|
-
const
|
|
374
|
-
|
|
375
|
-
}).catch((d) => K.myTrace(`goTxt() = ${d}`));
|
|
372
|
+
}).then((d) => new Promise((o) => setTimeout(() => o(d), 100))).then((d) => {
|
|
373
|
+
const o = document.createElement("canvas");
|
|
374
|
+
o.width = e.$width, o.height = e.$height, o.getContext("2d").drawImage(d, 0, 0), Q(lt.from(o));
|
|
375
|
+
}).catch((d) => K.myTrace(`goTxt() = ${String(d)}`));
|
|
376
376
|
}
|
|
377
377
|
class c extends T {
|
|
378
378
|
constructor(t, e, s) {
|
|
379
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.#d), this.#d.name = "grpDbgMasume";
|
|
380
|
-
const i = j.debugLog ? ({ ch: a, rect: { x: n, y: l, width: h, height:
|
|
380
|
+
const i = j.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
381
|
};
|
|
382
|
-
this.#
|
|
382
|
+
this.#y = c.#c.oCfg.debug.masume ? (a) => {
|
|
383
383
|
i(a);
|
|
384
|
-
const { x: n, y: l, width: h, height:
|
|
385
|
-
this.#d.beginFill(6737151, 0.5).lineStyle(2, 16724736, 1).drawRect(n, l, h,
|
|
384
|
+
const { x: n, y: l, width: h, height: r } = a.rect;
|
|
385
|
+
this.#d.beginFill(6737151, 0.5).lineStyle(2, 16724736, 1).drawRect(n, l, h, r).endFill();
|
|
386
386
|
} : () => {
|
|
387
387
|
}, this.noticeCompTxt = s.isApp && c.#c.oCfg.debug.dumpHtm ? () => {
|
|
388
388
|
W.notifyEndProc(A);
|
|
@@ -404,13 +404,13 @@ $1
|
|
|
404
404
|
static init(t, e) {
|
|
405
405
|
c.#c = t, c.#n = e;
|
|
406
406
|
}
|
|
407
|
-
static #
|
|
407
|
+
static #r;
|
|
408
408
|
static #a;
|
|
409
409
|
static setEvtMng(t, e) {
|
|
410
|
-
c.#
|
|
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.#v = /* @__PURE__ */ Object.create(null), c.delBreak();
|
|
414
414
|
}
|
|
415
415
|
#e = document.createElement("span");
|
|
416
416
|
// サンプリング元
|
|
@@ -428,10 +428,10 @@ $1
|
|
|
428
428
|
"margin-right": 0,
|
|
429
429
|
"margin-top": 0
|
|
430
430
|
};
|
|
431
|
-
#l = new
|
|
431
|
+
#l = new _t();
|
|
432
432
|
noticeCompTxt = () => {
|
|
433
433
|
};
|
|
434
|
-
#
|
|
434
|
+
#y;
|
|
435
435
|
// readonly #idc :TxtLayDesignCast;
|
|
436
436
|
// readonly #idcCh = new TxtLayPadDesignCast(this);
|
|
437
437
|
#t = {
|
|
@@ -466,7 +466,7 @@ $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.#g(), 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.#m > 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>`
|
|
@@ -477,7 +477,7 @@ $1
|
|
|
477
477
|
// oxlint-disable-next-line no-unused-private-class-members
|
|
478
478
|
#u = 0;
|
|
479
479
|
// 「g」などで下が欠ける問題対策
|
|
480
|
-
#
|
|
480
|
+
#g() {
|
|
481
481
|
const t = this.#e.style, e = parseFloat(t.fontSize || "0");
|
|
482
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.#p = t.writingMode === "vertical-rl", this.#i = 0, this.#b = 0;
|
|
483
483
|
const s = t.lineHeight ?? "0";
|
|
@@ -485,9 +485,9 @@ $1
|
|
|
485
485
|
}
|
|
486
486
|
cvsResize() {
|
|
487
487
|
const t = this.#e.style, e = this.sys.cvsScale;
|
|
488
|
-
t.left = `${this.sys.ofsLeft4elm + this.#
|
|
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
|
#p = !1;
|
|
492
492
|
get tategaki() {
|
|
493
493
|
return this.#p;
|
|
@@ -509,96 +509,95 @@ $1
|
|
|
509
509
|
#s = [];
|
|
510
510
|
// FIFO実行バッファ
|
|
511
511
|
goTxt(t, e) {
|
|
512
|
-
const s = () => this.#
|
|
512
|
+
const s = () => this.#_(t, e);
|
|
513
513
|
this.#s.push(s) === 1 && s();
|
|
514
514
|
}
|
|
515
515
|
#F = [];
|
|
516
|
-
#
|
|
516
|
+
#m = 0;
|
|
517
517
|
static #U = "<span class='sn_ch sn_ch_last'> </span>";
|
|
518
|
-
#
|
|
518
|
+
#_(t, e) {
|
|
519
519
|
c.#j.visible = !1;
|
|
520
520
|
let s = this.#F.length, i = "";
|
|
521
521
|
if (s === 0) {
|
|
522
|
-
if (c.#c.oCfg.debug.masume && (j.debugLog && console.log(`🍌 masume ${
|
|
523
|
-
this.name} v:${this.visible} l:${this.x} t:${this.y} a:${this.alpha} pl:${this.#t.pad_left} pr:${this.#t.pad_right} pt:${this.#t.pad_top} pb:${this.#t.pad_bottom} w:${this.#t.$width} h:${this.#t.$height}`), this.#d.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(
|
|
522
|
+
if (c.#c.oCfg.debug.masume && (j.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.#d.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
523
|
0,
|
|
525
524
|
0,
|
|
526
525
|
this.#t.$width - this.#t.pad_left - this.#t.pad_right,
|
|
527
526
|
this.#t.$height - this.#t.pad_top - this.#t.pad_bottom
|
|
528
527
|
).endFill()), this.#e.innerHTML = [...t].join("").replaceAll(/[\n\t]/g, "") + c.#U, !this.#l.break_fixed) {
|
|
529
|
-
const u = globalThis.getComputedStyle(this.#e),
|
|
530
|
-
this.#p ? (this.#l.break_fixed_left = (this.#t.$width - this.#t.pad_left - this.#t.pad_right -
|
|
528
|
+
const u = globalThis.getComputedStyle(this.#e), $ = parseFloat(u.fontSize);
|
|
529
|
+
this.#p ? (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
530
|
}
|
|
532
531
|
} else
|
|
533
532
|
i = this.#e.innerHTML, --s, this.#e.getElementsByClassName("sn_ch_last").item(0)?.remove(), this.#e.querySelectorAll(":scope > br").forEach((u) => u.remove()), this.#e.insertAdjacentHTML(
|
|
534
533
|
"beforeend",
|
|
535
|
-
t.slice(this.#
|
|
534
|
+
t.slice(this.#m).join("").replaceAll(/[\n\t]/g, "") + c.#U
|
|
536
535
|
// 末尾改行削除挙動対策
|
|
537
536
|
);
|
|
538
537
|
this.#e.querySelectorAll(".sn_ch:has(> ruby)").forEach((u) => {
|
|
539
538
|
u.style.background = "";
|
|
540
|
-
}), this.#
|
|
539
|
+
}), this.#m = t.length;
|
|
541
540
|
const a = this.sys.cvsScale, n = this.#e.getBoundingClientRect(), l = n.left + this.#t.pad_left, h = n.top + this.#t.pad_top;
|
|
542
|
-
let
|
|
543
|
-
if (a === 1)
|
|
544
|
-
const
|
|
541
|
+
let r;
|
|
542
|
+
if (a === 1) r = (u, $) => {
|
|
543
|
+
const S = u.getBoundingClientRect();
|
|
545
544
|
return new X(
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
545
|
+
S.left - l,
|
|
546
|
+
S.top - h,
|
|
547
|
+
S.width,
|
|
548
|
+
S.height + ("gjqy".includes($) ? this.#u : 0)
|
|
550
549
|
);
|
|
551
550
|
};
|
|
552
551
|
else {
|
|
553
|
-
const u = this.sys.ofsPadLeft_Dom2PIXI + n.left * (1 - a),
|
|
554
|
-
|
|
555
|
-
const
|
|
552
|
+
const u = this.sys.ofsPadLeft_Dom2PIXI + n.left * (1 - a), $ = this.sys.ofsPadTop_Dom2PIXI + n.top * (1 - a);
|
|
553
|
+
r = (S, d) => {
|
|
554
|
+
const o = S.getBoundingClientRect();
|
|
556
555
|
return new X(
|
|
557
|
-
(
|
|
558
|
-
(
|
|
559
|
-
|
|
560
|
-
(
|
|
556
|
+
(o.left - u) / a - l,
|
|
557
|
+
(o.top - $) / a - h,
|
|
558
|
+
o.width / a,
|
|
559
|
+
(o.height + ("gjqy".includes(d) ? this.#u : 0)) / a
|
|
561
560
|
);
|
|
562
561
|
};
|
|
563
562
|
}
|
|
564
|
-
const [
|
|
565
|
-
this.#F =
|
|
566
|
-
const
|
|
567
|
-
for (let u = s; u <
|
|
568
|
-
const
|
|
569
|
-
if (this.#
|
|
563
|
+
const [b, _] = this.#l.hyph(this.#e, r, this.#p, s, i);
|
|
564
|
+
this.#F = b;
|
|
565
|
+
const w = ct.ease(this.#C);
|
|
566
|
+
for (let u = s; u < _; ++u) {
|
|
567
|
+
const $ = this.#F[u], { elm: { dataset: S, parentElement: d }, rect: o } = $, m = JSON.parse(S.arg ?? '{"delay": 0}'), y = JSON.parse(S.add ?? "{}"), R = c.#$[y.ch_in_style];
|
|
568
|
+
if (this.#y($), S.cmd === "grp") {
|
|
570
569
|
const f = new T();
|
|
571
570
|
this.#h.addChild(f), new I(m.pic, f, (p) => {
|
|
572
|
-
this.#P(f, m, y,
|
|
571
|
+
this.#P(f, m, y, o, w, R ?? {}), f.parent || f.removeChild(p);
|
|
573
572
|
});
|
|
574
573
|
}
|
|
575
|
-
if (
|
|
574
|
+
if (S.lnk) {
|
|
576
575
|
const f = d.closest("[data-arg]"), p = JSON.parse(f.dataset.arg ?? "{}");
|
|
577
576
|
p.key = `lnk=[${String(u)}] ` + this.name;
|
|
578
|
-
const
|
|
579
|
-
this.#P(
|
|
580
|
-
const C = p.style ?? "", M = C + (p.style_hover ?? ""),
|
|
577
|
+
const g = new G();
|
|
578
|
+
this.#P(g, p, y, o, w, R ?? {});
|
|
579
|
+
const C = p.style ?? "", M = C + (p.style_hover ?? ""), N = C + (p.style_clicked ?? ""), P = p.r_style ?? "", J = P + (p.r_style_hover ?? ""), nt = P + (p.r_style_clicked ?? ""), Z = Array.from(f.getElementsByTagName("rt"));
|
|
581
580
|
for (const z of Z) z.dataset.st_r_bk = z.style.cssText;
|
|
582
581
|
const at = f.style.cssText, D = (z, ht) => {
|
|
583
582
|
f.style.cssText = at + z;
|
|
584
583
|
for (const L of Z) L.style.cssText = L.dataset.st_r_bk + ht;
|
|
585
584
|
};
|
|
586
|
-
F(p, "enabled", !0) ? c.#
|
|
585
|
+
F(p, "enabled", !0) ? c.#r.button(
|
|
587
586
|
p,
|
|
588
|
-
|
|
587
|
+
g,
|
|
589
588
|
() => D(C, P),
|
|
590
589
|
() => this.canFocus() ? (D(M, J), !0) : !1,
|
|
591
|
-
() => D(
|
|
590
|
+
() => D(N, nt)
|
|
592
591
|
) : D(
|
|
593
592
|
C + (p.style_disable ?? "color: gray;"),
|
|
594
593
|
P + (p.r_style_disable ?? "color: gray;")
|
|
595
|
-
), this.#h.addChild(
|
|
594
|
+
), this.#h.addChild(g);
|
|
596
595
|
}
|
|
597
596
|
}
|
|
598
|
-
const
|
|
599
|
-
this.#
|
|
600
|
-
this.#
|
|
601
|
-
for (const
|
|
597
|
+
const E = Array.from(this.#e.getElementsByClassName("sn_ch_yet"));
|
|
598
|
+
this.#S = () => {
|
|
599
|
+
this.#S = () => !1;
|
|
600
|
+
for (const $ of E) $.className = "sn_ch";
|
|
602
601
|
c.#j.position.set(
|
|
603
602
|
this.#l.break_fixed_left,
|
|
604
603
|
this.#l.break_fixed_top
|
|
@@ -606,23 +605,23 @@ $1
|
|
|
606
605
|
const u = this.#s.shift();
|
|
607
606
|
return this.#s.length > 0 && u(), !0;
|
|
608
607
|
};
|
|
609
|
-
for (const u of
|
|
608
|
+
for (const u of E) u.className = u.className.replace("sn_ch_yet sn", "go");
|
|
610
609
|
s > 0 && ++s;
|
|
611
|
-
let
|
|
612
|
-
for (let u =
|
|
613
|
-
const { elm:
|
|
614
|
-
if (
|
|
615
|
-
|
|
610
|
+
let x;
|
|
611
|
+
for (let u = _ - 2; u >= 0; --u) {
|
|
612
|
+
const { elm: $ } = this.#F[u];
|
|
613
|
+
if ($.tagName === "SPAN") {
|
|
614
|
+
x = $.parentElement?.tagName === "RUBY" ? $.parentElement.parentElement ?? $ : $;
|
|
616
615
|
break;
|
|
617
616
|
}
|
|
618
617
|
}
|
|
619
|
-
if (!
|
|
620
|
-
this.#
|
|
618
|
+
if (!x || e || s === _) {
|
|
619
|
+
this.#S();
|
|
621
620
|
return;
|
|
622
621
|
}
|
|
623
|
-
|
|
622
|
+
x.addEventListener("animationend", () => this.#S(), { once: !0 });
|
|
624
623
|
}
|
|
625
|
-
#
|
|
624
|
+
#S = () => !1;
|
|
626
625
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
627
626
|
#P(t, e, s, i, a, n) {
|
|
628
627
|
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(
|
|
@@ -641,7 +640,7 @@ $1
|
|
|
641
640
|
}
|
|
642
641
|
#O = [];
|
|
643
642
|
skipChIn() {
|
|
644
|
-
let t = this.#
|
|
643
|
+
let t = this.#S();
|
|
645
644
|
for (const e of this.#O)
|
|
646
645
|
e.tw && (e.tw.stop().end(), t = !0);
|
|
647
646
|
return this.#O = [], t;
|
|
@@ -651,7 +650,7 @@ $1
|
|
|
651
650
|
static #I = /[{\s.,*{]/;
|
|
652
651
|
// https://regex101.com/r/APC91I/1
|
|
653
652
|
static initChStyle() {
|
|
654
|
-
c.#$ = /* @__PURE__ */ Object.create(null), c.#
|
|
653
|
+
c.#$ = /* @__PURE__ */ Object.create(null), c.#v = /* @__PURE__ */ Object.create(null);
|
|
655
654
|
}
|
|
656
655
|
static getChInStyle(t) {
|
|
657
656
|
return c.#$[t];
|
|
@@ -686,17 +685,17 @@ $1
|
|
|
686
685
|
};
|
|
687
686
|
}
|
|
688
687
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
689
|
-
static #
|
|
688
|
+
static #v = /* @__PURE__ */ Object.create(null);
|
|
690
689
|
static getChOutStyle(t) {
|
|
691
|
-
return c.#
|
|
690
|
+
return c.#v[t];
|
|
692
691
|
}
|
|
693
692
|
static ch_out_style(t) {
|
|
694
693
|
const { name: e } = t;
|
|
695
694
|
if (!e) throw "nameは必須です";
|
|
696
695
|
if (c.#I.test(e)) throw `name【${e}】に使えない文字が含まれます`;
|
|
697
|
-
if (e in c.#
|
|
696
|
+
if (e in c.#v) throw `name【${e}】はすでにあります`;
|
|
698
697
|
const s = String(t.x ?? "=0"), i = String(t.y ?? "=0");
|
|
699
|
-
return c.#
|
|
698
|
+
return c.#v[e] = {
|
|
700
699
|
wait: v(t, "wait", 500),
|
|
701
700
|
// アニメ・FI時間
|
|
702
701
|
alpha: v(t, "alpha", 0),
|
|
@@ -732,10 +731,10 @@ $1
|
|
|
732
731
|
const t = c.#j;
|
|
733
732
|
t.parent?.removeChild(t), c.#W.destroy();
|
|
734
733
|
}
|
|
735
|
-
#
|
|
734
|
+
#C = "Quadratic.Out";
|
|
736
735
|
#E = "Quadratic.Out";
|
|
737
736
|
#H() {
|
|
738
|
-
this.#d.clear(), this.#F = [], this.#
|
|
737
|
+
this.#d.clear(), this.#F = [], this.#m = 0, this.#s = [], this.skipChIn();
|
|
739
738
|
const t = this.#e.cloneNode(!0);
|
|
740
739
|
t.textContent = "";
|
|
741
740
|
const e = this.#e, s = Array.from(e.getElementsByClassName("sn_ch"));
|
|
@@ -749,7 +748,7 @@ $1
|
|
|
749
748
|
// 縦中横
|
|
750
749
|
);
|
|
751
750
|
if (!l.ch_out_style) return;
|
|
752
|
-
const h = c.#
|
|
751
|
+
const h = c.#v[l.ch_out_style];
|
|
753
752
|
if (h) {
|
|
754
753
|
if (h.wait === 0) {
|
|
755
754
|
n.style.display = "none";
|
|
@@ -761,14 +760,14 @@ $1
|
|
|
761
760
|
const a = () => {
|
|
762
761
|
e.parentElement.removeChild(e);
|
|
763
762
|
for (const n of this.#h.removeChildren())
|
|
764
|
-
n instanceof T && c.#
|
|
763
|
+
n instanceof T && c.#r.unButton(n), n.destroy();
|
|
765
764
|
};
|
|
766
765
|
i === 0 ? (this.#e.textContent = "", a()) : e.lastElementChild?.addEventListener("animationend", a, { once: !0 }), this.#e = t;
|
|
767
766
|
}
|
|
768
767
|
reNew() {
|
|
769
768
|
this.#H();
|
|
770
769
|
const t = new c(this.ctn, () => this.canFocus(), this.sys);
|
|
771
|
-
return t.#t = this.#t, t.#e.style.cssText = this.#e.style.cssText, t.#
|
|
770
|
+
return t.#t = this.#t, t.#e.style.cssText = this.#e.style.cssText, t.#o = this.#o, t.name = this.name, t.#g(), t.#M = this.#M, t.#C = this.#C, t.#E = this.#E, this.#l.reNew(t.#l), this.destroy(), t;
|
|
772
771
|
}
|
|
773
772
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
774
773
|
#M = void 0;
|
|
@@ -777,16 +776,16 @@ $1
|
|
|
777
776
|
return {
|
|
778
777
|
infTL: this.#t,
|
|
779
778
|
cssText: this.#e.style.cssText,
|
|
780
|
-
left: this.#
|
|
779
|
+
left: this.#o,
|
|
781
780
|
// idc_hArg : this.#idc.gethArg(),
|
|
782
781
|
ch_filter: this.#M,
|
|
783
|
-
fi_easing: this.#
|
|
782
|
+
fi_easing: this.#C,
|
|
784
783
|
fo_easing: this.#E,
|
|
785
784
|
hyph: this.#l.record()
|
|
786
785
|
};
|
|
787
786
|
}
|
|
788
787
|
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.#
|
|
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.#g(), this.#M = t.ch_filter, this.#C = t.fi_easing, this.#E = t.fo_easing, this.#l.playback(t.hyph);
|
|
790
789
|
}
|
|
791
790
|
get cssText() {
|
|
792
791
|
return this.#e.style.cssText;
|
|
@@ -796,11 +795,11 @@ $1
|
|
|
796
795
|
}
|
|
797
796
|
#f = void 0;
|
|
798
797
|
snapshot(t, e) {
|
|
799
|
-
|
|
800
|
-
this.#f = G.from(s), this.#p && (this.#f.x += j.stageW - (this.#
|
|
798
|
+
yt((s) => {
|
|
799
|
+
this.#f = G.from(s), this.#p && (this.#f.x += j.stageW - (this.#o + this.#t.$width)), this.#f.y -= this.#b, this.#f.texture.frame = new X(
|
|
801
800
|
0,
|
|
802
801
|
0,
|
|
803
|
-
Math.min(this.#f.width, this.#t.$width - this.#
|
|
802
|
+
Math.min(this.#f.width, this.#t.$width - this.#o),
|
|
804
803
|
Math.min(this.#f.height, this.#t.$height)
|
|
805
804
|
), this.#h.addChild(this.#f), t.render(this.#f, { clear: !1 }), e();
|
|
806
805
|
}, this.#e, this.#t, this.#i, this.#b, !1);
|
|
@@ -825,16 +824,16 @@ $1
|
|
|
825
824
|
c.delBreak(), this.#e.parentElement.removeChild(this.#e), this.removeChild(this.#h), this.removeChild(this.#d), super.destroy();
|
|
826
825
|
}
|
|
827
826
|
}
|
|
828
|
-
class
|
|
827
|
+
class k extends tt {
|
|
829
828
|
static #c;
|
|
830
829
|
static #n;
|
|
831
|
-
static #
|
|
830
|
+
static #r;
|
|
832
831
|
static #a;
|
|
833
832
|
static init(t, e, s, i, a, n) {
|
|
834
|
-
this.#c = t, c.init(t, n), this.#n = s, this.#a = i, this.#
|
|
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(), rt(), V(
|
|
835
834
|
t.matchPath(".+", et.FONT).flatMap((l) => Object.values(l).map((h) => `
|
|
836
835
|
@font-face {
|
|
837
|
-
font-family: '${h}';
|
|
836
|
+
font-family: '${String(h)}';
|
|
838
837
|
src: url('${this.#c.searchPath(String(h), et.FONT)}');
|
|
839
838
|
}
|
|
840
839
|
`)).join("") + `
|
|
@@ -876,46 +875,46 @@ class x extends tt {
|
|
|
876
875
|
}
|
|
877
876
|
// 文字出現演出
|
|
878
877
|
static #e(t) {
|
|
879
|
-
const e = c.ch_in_style(t),
|
|
878
|
+
const { x: e, y: s, nx: i, ny: a, alpha: n, wait: l, ease: h, rotate: r, scale_x: b, scale_y: _ } = c.ch_in_style(t), w = e.startsWith("=") ? `${String(i * 100)}%` : `${String(i)}px`, E = s.startsWith("=") ? `${String(a * 100)}%` : `${String(a)}px`, { name: x = "" } = t;
|
|
880
879
|
return V(`
|
|
881
|
-
.sn_ch_in_${
|
|
880
|
+
.sn_ch_in_${x} {
|
|
882
881
|
position: relative;
|
|
883
882
|
display: inline-block;
|
|
884
883
|
}
|
|
885
|
-
.go_ch_in_${
|
|
886
|
-
opacity: ${
|
|
884
|
+
.go_ch_in_${x} {
|
|
885
|
+
opacity: ${String(n)};
|
|
887
886
|
position: relative;
|
|
888
887
|
display: inline-block;
|
|
889
|
-
animation: sn_ch_in_${
|
|
888
|
+
animation: sn_ch_in_${x} ${String(l)}ms ${h} 0s both;
|
|
890
889
|
}
|
|
891
|
-
@keyframes sn_ch_in_${
|
|
892
|
-
from {transform: rotate(${
|
|
890
|
+
@keyframes sn_ch_in_${x} {
|
|
891
|
+
from {transform: rotate(${String(r)}deg) scale(${String(b)}, ${String(_)}) translate(${w}, ${E})}
|
|
893
892
|
to {opacity: 1; transform: none;}
|
|
894
893
|
}
|
|
895
894
|
`), !1;
|
|
896
895
|
}
|
|
897
896
|
// 文字消去演出
|
|
898
897
|
static #h(t) {
|
|
899
|
-
const e = c.ch_out_style(t),
|
|
898
|
+
const { x: e, y: s, nx: i, ny: a, alpha: n, wait: l, ease: h, rotate: r, scale_x: b, scale_y: _ } = c.ch_out_style(t), w = e.startsWith("=") ? `${String(i * 100)}%` : `${String(i)}px`, E = s.startsWith("=") ? `${String(a * 100)}%` : `${String(a)}px`, { name: x = "" } = t;
|
|
900
899
|
return V(`
|
|
901
|
-
.go_ch_out_${
|
|
900
|
+
.go_ch_out_${x} {
|
|
902
901
|
position: relative;
|
|
903
902
|
display: inline-block;
|
|
904
|
-
animation: go_ch_out_${
|
|
903
|
+
animation: go_ch_out_${x} ${String(l)}ms ${h} 0s both;
|
|
905
904
|
}
|
|
906
|
-
@keyframes go_ch_out_${
|
|
905
|
+
@keyframes go_ch_out_${x} {
|
|
907
906
|
to {
|
|
908
|
-
opacity: ${
|
|
909
|
-
transform: rotate(${
|
|
907
|
+
opacity: ${String(n)};
|
|
908
|
+
transform: rotate(${String(r)}deg) scale(${String(b)}, ${String(_)}) translate(${w}, ${E});
|
|
910
909
|
}
|
|
911
910
|
`), !1;
|
|
912
911
|
}
|
|
913
912
|
static #d = 10;
|
|
914
913
|
static set msecChWait(t) {
|
|
915
|
-
|
|
914
|
+
k.#d = t;
|
|
916
915
|
}
|
|
917
916
|
static get msecChWait() {
|
|
918
|
-
return
|
|
917
|
+
return k.#d;
|
|
919
918
|
}
|
|
920
919
|
static #k;
|
|
921
920
|
static #l;
|
|
@@ -923,16 +922,16 @@ class x extends tt {
|
|
|
923
922
|
this.#k = t, this.#l = e, c.setEvtMng(t, s);
|
|
924
923
|
}
|
|
925
924
|
// 文字ごとのウェイト
|
|
926
|
-
static #
|
|
925
|
+
static #y = !1;
|
|
927
926
|
static #t = {};
|
|
928
927
|
static #u(t) {
|
|
929
|
-
this.#
|
|
928
|
+
this.#y = F(t, "enabled", this.#y), this.#n.setVal_Nochk("save", "const.sn.autowc.enabled", this.#y);
|
|
930
929
|
const { text: e } = t;
|
|
931
930
|
if ("text" in t != "time" in t) throw "[autowc] textとtimeは同時指定必須です";
|
|
932
931
|
if (this.#n.setVal_Nochk("save", "const.sn.autowc.text", e), !e)
|
|
933
932
|
return this.#n.setVal_Nochk("save", "const.sn.autowc.time", ""), !1;
|
|
934
933
|
const s = e.length;
|
|
935
|
-
if (this.#
|
|
934
|
+
if (this.#y && s === 0) throw '[autowc] enabled === false かつ text === "" は許されません';
|
|
936
935
|
const i = String(t.time).split(",");
|
|
937
936
|
if (i.length !== s) throw "[autowc] text文字数とtimeに記述された待ち時間(コンマ区切り)は同数にして下さい";
|
|
938
937
|
this.#t = {};
|
|
@@ -940,16 +939,16 @@ class x extends tt {
|
|
|
940
939
|
return this.#n.setVal_Nochk("save", "const.sn.autowc.time", t.time), !1;
|
|
941
940
|
}
|
|
942
941
|
// バック
|
|
943
|
-
#
|
|
944
|
-
#
|
|
942
|
+
#g = 0;
|
|
943
|
+
#o = 0;
|
|
945
944
|
#p = !1;
|
|
946
945
|
#i = void 0;
|
|
947
946
|
#b = "";
|
|
948
947
|
// 背景画像無し(=単色塗り)
|
|
949
948
|
// 文字表示
|
|
950
|
-
#s = new c(this.ctn, () => this.canFocus(),
|
|
949
|
+
#s = new c(this.ctn, () => this.canFocus(), k.#l);
|
|
951
950
|
#F = new st();
|
|
952
|
-
#
|
|
951
|
+
#m = document.createElement("span");
|
|
953
952
|
// cssチェック・保存用
|
|
954
953
|
static #U = {
|
|
955
954
|
"text-align": 0,
|
|
@@ -961,15 +960,15 @@ class x extends tt {
|
|
|
961
960
|
"padding-top": 0,
|
|
962
961
|
"padding-bottom": 0
|
|
963
962
|
};
|
|
964
|
-
#
|
|
963
|
+
#_ = new T();
|
|
965
964
|
constructor() {
|
|
966
|
-
super(), this.ctn.addChild(this.#s), this.#F.init(this.#Y), this.ctn.addChild(this.#
|
|
965
|
+
super(), this.ctn.addChild(this.#s), this.#F.init(this.#Y), this.ctn.addChild(this.#_), this.#_.name = "cntBtn", this.lay({ style: `width: ${String(j.stageW)}px; height: ${String(j.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
966
|
}
|
|
968
967
|
destroy() {
|
|
969
|
-
this.#i && (this.ctn.removeChild(this.#i).destroy(), this.#i = void 0),
|
|
968
|
+
this.#i && (this.ctn.removeChild(this.#i).destroy(), this.#i = void 0), k.#a.pagebreak(), this.#s.destroy();
|
|
970
969
|
}
|
|
971
970
|
static destroy() {
|
|
972
|
-
this.#
|
|
971
|
+
this.#y = !1, this.#t = {}, this.#f = (t) => t;
|
|
973
972
|
}
|
|
974
973
|
set name(t) {
|
|
975
974
|
this.name_ = t, this.#s.name = t;
|
|
@@ -982,7 +981,7 @@ class x extends tt {
|
|
|
982
981
|
this.#s.cvsResize();
|
|
983
982
|
}
|
|
984
983
|
cvsResizeChildren() {
|
|
985
|
-
for (const t of this.#
|
|
984
|
+
for (const t of this.#_.children) t.cvsResize();
|
|
986
985
|
}
|
|
987
986
|
procSetX(t) {
|
|
988
987
|
this.#s.lay({ x: t });
|
|
@@ -991,29 +990,29 @@ class x extends tt {
|
|
|
991
990
|
this.#s.lay({ y: t });
|
|
992
991
|
}
|
|
993
992
|
lay(t) {
|
|
994
|
-
if (super.lay(t), tt.setXY(this.ctn, t, this.ctn), t[":id_tag"] = this.name_.slice(0, -7), st.setting(t), this.#W(t), this.#s.lay(t), "r_align" in t && (this.#x = t.r_align ?? ""), this.#z = j.isSafari ? this.#s.tategaki ? (i, a) => `text-align: start; height: ${a}em; padding-top: ${i}; padding-bottom: ${i};` : (i, a) => `text-align: start; width: ${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};`, j.isFirefox && (this.#q = this.#Z), "r_style" in t)
|
|
993
|
+
if (super.lay(t), tt.setXY(this.ctn, t, this.ctn), t[":id_tag"] = this.name_.slice(0, -7), st.setting(t), this.#W(t), this.#s.lay(t), "r_align" in t && (this.#x = t.r_align ?? ""), this.#z = j.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};`, j.isFirefox && (this.#q = this.#Z), "r_style" in t)
|
|
995
994
|
if (t.r_style) {
|
|
996
995
|
const i = document.createElement("span");
|
|
997
996
|
i.style.cssText = t.r_style;
|
|
998
|
-
const a = i.style.length, n = this.#
|
|
997
|
+
const a = i.style.length, n = this.#m.style;
|
|
999
998
|
for (let l = 0; l < a; ++l) {
|
|
1000
999
|
const h = i.style[l];
|
|
1001
|
-
if (h in
|
|
1002
|
-
K.myTrace(`${h}は指定できません`, "W");
|
|
1000
|
+
if (h in k.#U) {
|
|
1001
|
+
K.myTrace(`${String(h)}は指定できません`, "W");
|
|
1003
1002
|
continue;
|
|
1004
1003
|
}
|
|
1005
|
-
const
|
|
1006
|
-
|
|
1004
|
+
const r = i.style[h];
|
|
1005
|
+
r && (n[h] = r);
|
|
1007
1006
|
}
|
|
1008
|
-
} else this.#
|
|
1009
|
-
if ("alpha" in t) for (const i of this.#
|
|
1010
|
-
this.#
|
|
1007
|
+
} else this.#m.style.cssText = "";
|
|
1008
|
+
if ("alpha" in t) for (const i of this.#_.children) i.alpha = this.ctn.alpha;
|
|
1009
|
+
this.#S(t), this.#$(t);
|
|
1011
1010
|
const e = W.procID + `TxtLayer lay name:${this.name_}`, s = this.#j(t, (i) => {
|
|
1012
1011
|
i && W.endProc(e);
|
|
1013
1012
|
});
|
|
1014
1013
|
return s && W.beginProc(e), s;
|
|
1015
1014
|
}
|
|
1016
|
-
#
|
|
1015
|
+
#S(t) {
|
|
1017
1016
|
const { in_style: e } = t;
|
|
1018
1017
|
if (!e) return;
|
|
1019
1018
|
const s = c.getChInStyle(e);
|
|
@@ -1035,34 +1034,34 @@ class x extends tt {
|
|
|
1035
1034
|
this.#I = e;
|
|
1036
1035
|
}
|
|
1037
1036
|
#I = "";
|
|
1038
|
-
#
|
|
1037
|
+
#v = new I();
|
|
1039
1038
|
#j(t, e) {
|
|
1040
1039
|
if ("back_clear" in t)
|
|
1041
|
-
return F(t, "back_clear", !1) && (this.#
|
|
1042
|
-
this.#
|
|
1043
|
-
const s = (this.#p ? 1 : Number(
|
|
1040
|
+
return F(t, "back_clear", !1) && (this.#g = 0, this.#o = 0, this.#p = !1, this.#b = ""), e(!1), !1;
|
|
1041
|
+
this.#o = v(t, "b_alpha", this.#o), this.#p = F(t, "b_alpha_isfixed", this.#p);
|
|
1042
|
+
const s = (this.#p ? 1 : Number(k.#n.getVal("sys:TextLayer.Back.Alpha"))) * this.#o;
|
|
1044
1043
|
if (t.b_pic) {
|
|
1045
1044
|
if (this.#b !== t.b_pic)
|
|
1046
|
-
return this.#b = t.b_pic, this.#i && (this.ctn.removeChild(this.#i), this.#i.destroy()), this.#
|
|
1045
|
+
return this.#b = t.b_pic, this.#i && (this.ctn.removeChild(this.#i), this.#i.destroy()), this.#v = new I(this.#b, this.ctn, (i) => {
|
|
1047
1046
|
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.#
|
|
1047
|
+
}), this.#v.ret;
|
|
1048
|
+
} else "b_color" in t && (this.#g = ot(t, "b_color", 0), this.#i && (this.ctn.removeChild(this.#i), this.#i.destroy()), this.#b = "", this.ctn.addChildAt(
|
|
1049
|
+
(this.#i = new B()).beginFill(this.#g, s).lineStyle(void 0).drawRect(0, 0, this.#s.getWidth, this.#s.getHeight).endFill(),
|
|
1051
1050
|
0
|
|
1052
1051
|
), this.#i.name = "back(color)");
|
|
1053
1052
|
return this.#i && (this.#i.visible = s > 0, this.#i.alpha = s), e(!1), !1;
|
|
1054
1053
|
}
|
|
1055
1054
|
chgBackAlpha(t) {
|
|
1056
|
-
const e = this.#p ? this.#
|
|
1055
|
+
const e = this.#p ? this.#o : t * this.#o;
|
|
1057
1056
|
this.#i instanceof B && (this.#i && (this.ctn.removeChild(this.#i), this.#i.destroy()), this.ctn.addChildAt(
|
|
1058
|
-
(this.#i = new B()).beginFill(this.#
|
|
1057
|
+
(this.#i = new B()).beginFill(this.#g, e).lineStyle(void 0).drawRect(0, 0, this.#s.getWidth, this.#s.getHeight).endFill(),
|
|
1059
1058
|
0
|
|
1060
1059
|
), this.#i.name = "back(color)"), this.#i && (this.#i.visible = e > 0, this.#i.alpha = e);
|
|
1061
1060
|
}
|
|
1062
1061
|
#W(t) {
|
|
1063
|
-
"noffs" in t && (this.#H = t.noffs ?? "", this.#M = new RegExp(`[ ${this.#H}]`)), "ffs" in t && (this.#
|
|
1062
|
+
"noffs" in t && (this.#H = t.noffs ?? "", this.#M = new RegExp(`[ ${this.#H}]`)), "ffs" in t && (this.#C ??= "", this.#E = this.#C === "" ? () => "" : (e) => this.#M.test(e) ? "" : ` font-feature-settings: ${this.#C};`);
|
|
1064
1063
|
}
|
|
1065
|
-
#
|
|
1064
|
+
#C = "";
|
|
1066
1065
|
#E = (t) => "";
|
|
1067
1066
|
#H = "";
|
|
1068
1067
|
// eslint-disable-next-line no-irregular-whitespace
|
|
@@ -1084,10 +1083,10 @@ class x extends tt {
|
|
|
1084
1083
|
n = this.#z("0", a);
|
|
1085
1084
|
break;
|
|
1086
1085
|
case "121":
|
|
1087
|
-
n = this.#z(`calc(${(a - e.length) / (e.length * 2)}em)`, a);
|
|
1086
|
+
n = this.#z(`calc(${String((a - e.length) / (e.length * 2))}em)`, a);
|
|
1088
1087
|
break;
|
|
1089
1088
|
case "even":
|
|
1090
|
-
n = this.#z(`calc(${(a - e.length) / (e.length + 1)}em)`, a);
|
|
1089
|
+
n = this.#z(`calc(${String((a - e.length) / (e.length + 1))}em)`, a);
|
|
1091
1090
|
break;
|
|
1092
1091
|
case "1ruby":
|
|
1093
1092
|
n = this.#z("1em", a);
|
|
@@ -1121,8 +1120,8 @@ class x extends tt {
|
|
|
1121
1120
|
break;
|
|
1122
1121
|
case "even":
|
|
1123
1122
|
{
|
|
1124
|
-
const l = (a - e.length) / (e.length + 1)
|
|
1125
|
-
n = "ruby-align: space-between; " + (this.#s.tategaki ? `padding-top
|
|
1123
|
+
const l = ` ${String((a - e.length) / (e.length + 1))}em;`;
|
|
1124
|
+
n = "ruby-align: space-between; " + (this.#s.tategaki ? `padding-top:${l} padding-bottom:${l}` : `padding-left:${l} padding-right:${l}`);
|
|
1126
1125
|
}
|
|
1127
1126
|
break;
|
|
1128
1127
|
case "1ruby":
|
|
@@ -1142,7 +1141,7 @@ class x extends tt {
|
|
|
1142
1141
|
}
|
|
1143
1142
|
#Y = (t, e) => {
|
|
1144
1143
|
let s = e;
|
|
1145
|
-
|
|
1144
|
+
k.#c.oCfg.debug.putCh && console.log(`🖊 文字表示 text:\`${t}\`(${t.charCodeAt(0).toString(16)}) ruby:\`${s}\` name:\`${this.name_}\``);
|
|
1146
1145
|
const i = s.split("|");
|
|
1147
1146
|
let a = "";
|
|
1148
1147
|
const [n, ...l] = i, h = l.join("|");
|
|
@@ -1176,15 +1175,15 @@ class x extends tt {
|
|
|
1176
1175
|
this.#T = !1, this.#w = !0, a = this.#X(t, h, n);
|
|
1177
1176
|
break;
|
|
1178
1177
|
case "gotxt":
|
|
1179
|
-
this.#V(), this.#w ? (this.isCur &&
|
|
1178
|
+
this.#V(), this.#w ? (this.isCur && k.#a.recText(
|
|
1180
1179
|
this.#R.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;'")
|
|
1181
1180
|
), this.#s.goTxt(this.#R, this.#B === 0), this.#w = !1, this.#B = 0) : this.isCur && this.#s.noticeCompTxt();
|
|
1182
1181
|
return;
|
|
1183
1182
|
// breakではない
|
|
1184
1183
|
case "add":
|
|
1185
1184
|
{
|
|
1186
|
-
const
|
|
1187
|
-
this.#R.push(`<span${
|
|
1185
|
+
const r = JSON.parse(h), { style: b = "", wait: _ = null } = r, { cl: w, sty: E } = this.#D(!0, _ ? O(_) : null);
|
|
1186
|
+
this.#R.push(`<span${w} style='${E} display: inline; ${b}'>`), delete r.style, this.#K(r);
|
|
1188
1187
|
}
|
|
1189
1188
|
return;
|
|
1190
1189
|
// breakではない
|
|
@@ -1195,33 +1194,33 @@ class x extends tt {
|
|
|
1195
1194
|
case "grp":
|
|
1196
1195
|
this.#w = !0;
|
|
1197
1196
|
{
|
|
1198
|
-
const
|
|
1199
|
-
if (
|
|
1200
|
-
this.#s.dispBreak(
|
|
1197
|
+
const r = JSON.parse(h);
|
|
1198
|
+
if (r.id ??= String(this.#R.length), r.id === "break") {
|
|
1199
|
+
this.#s.dispBreak(r);
|
|
1201
1200
|
return;
|
|
1202
1201
|
}
|
|
1203
|
-
this.#T = !1,
|
|
1204
|
-
const { r:
|
|
1205
|
-
a = `<span${
|
|
1202
|
+
this.#T = !1, r.delay = this.#B, r.r ??= "", r.style ??= "", r.r_style ??= "";
|
|
1203
|
+
const { r: b, wait: _ = null, r_style: w } = r, { cl: E, sty: x, lnk: u } = this.#D(!0, _ ? O(_) : null);
|
|
1204
|
+
a = `<span${E} style='${x} ${r.style}'><ruby><span data-cmd='grp' data-arg='${JSON.stringify(r)}'${u} style='${x} display: inline;'> </span><rt${u}${this.#q(
|
|
1206
1205
|
" ",
|
|
1207
|
-
|
|
1206
|
+
b,
|
|
1208
1207
|
this.#x,
|
|
1209
|
-
this.#
|
|
1210
|
-
)}>${
|
|
1208
|
+
this.#m.style.cssText + (this.#N.at(-1)?.o.r_style ?? "") + w
|
|
1209
|
+
)}>${r.r}</rt></ruby></span>`;
|
|
1211
1210
|
}
|
|
1212
1211
|
break;
|
|
1213
1212
|
case "tcy":
|
|
1214
1213
|
this.#T = !1, this.#w = !0;
|
|
1215
1214
|
{
|
|
1216
|
-
const { t:
|
|
1217
|
-
|
|
1218
|
-
const
|
|
1219
|
-
a = `<span${u} style='${
|
|
1220
|
-
|
|
1221
|
-
|
|
1215
|
+
const { t: r = "", r: b = "", wait: _ = null, style: w = "", r_style: E = "" } = JSON.parse(h);
|
|
1216
|
+
k.#n.doRecLog() && (this.#G += t + (s ? `《${s}》` : ""), this.#J += r);
|
|
1217
|
+
const x = j.isSafari ? b.replaceAll(/[A-Za-z0-9]/g, (d) => String.fromCharCode(d.charCodeAt(0) + 65248)) : b, { cl: u, sty: $, lnk: S } = this.#D(!0, _ ? O(_) : null);
|
|
1218
|
+
a = `<span${u} style='${$}${this.#E(r)} ${w}'><ruby><span${S} style='${$} display: inline; text-combine-upright: all;'>${r}</span><rt${S}${this.#q(
|
|
1219
|
+
r,
|
|
1220
|
+
x,
|
|
1222
1221
|
this.#x,
|
|
1223
|
-
this.#
|
|
1224
|
-
)}>${
|
|
1222
|
+
this.#m.style.cssText + (this.#N.at(-1)?.o.r_style ?? "") + E
|
|
1223
|
+
)}>${x}</rt></ruby></span>`;
|
|
1225
1224
|
}
|
|
1226
1225
|
break;
|
|
1227
1226
|
case "del":
|
|
@@ -1235,10 +1234,10 @@ class x extends tt {
|
|
|
1235
1234
|
case "link":
|
|
1236
1235
|
this.#w = !0;
|
|
1237
1236
|
{
|
|
1238
|
-
const
|
|
1239
|
-
|
|
1240
|
-
const { cl:
|
|
1241
|
-
this.#R.push(`<span${
|
|
1237
|
+
const r = JSON.parse(h);
|
|
1238
|
+
r[":link"] = " data-lnk='@'";
|
|
1239
|
+
const { cl: b, sty: _, curpos: w } = this.#D(!1, r.wait ? O(r.wait) : null);
|
|
1240
|
+
this.#R.push(`<span${b} style='${_} display: inline; ${r.style ?? ""}' ${w} data-arg='${h}'>`), delete r.style, this.#Q(r);
|
|
1242
1241
|
}
|
|
1243
1242
|
return;
|
|
1244
1243
|
// breakではない
|
|
@@ -1251,29 +1250,29 @@ class x extends tt {
|
|
|
1251
1250
|
}
|
|
1252
1251
|
break;
|
|
1253
1252
|
}
|
|
1254
|
-
this.#R.push(
|
|
1253
|
+
this.#R.push(k.#f(a));
|
|
1255
1254
|
};
|
|
1256
1255
|
#X(t, e, s) {
|
|
1257
1256
|
const i = t === " " ? " " : t === " " ? " " : t;
|
|
1258
|
-
|
|
1257
|
+
k.#n.doRecLog() && (this.#G += i + (e ? `《${e}》` : ""), t !== " " && (this.#J += t));
|
|
1259
1258
|
const { cl: a, sty: n, lnk: l } = this.#D(!0, null, t);
|
|
1260
1259
|
return e ? `<span${a} style='${n} ${this.#E(t)}'><ruby>${// 文字個別に出現させるため以下にも ${cl} が必要
|
|
1261
|
-
Array.from(t).map((h,
|
|
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.#q(
|
|
1262
1261
|
t,
|
|
1263
1262
|
e,
|
|
1264
1263
|
s,
|
|
1265
|
-
this.#
|
|
1264
|
+
this.#m.style.cssText + (this.#N.at(-1)?.o.r_style ?? "")
|
|
1266
1265
|
)}>${e}</rt></ruby></span>` : `<span${a} style='${n} ${this.#E(t)}'${l}>${i}</span>`;
|
|
1267
1266
|
}
|
|
1268
1267
|
#D(t, e, s = `
|
|
1269
1268
|
`) {
|
|
1270
|
-
const i = this.#O ? e ?? this.#N.at(0)?.o.wait ?? (
|
|
1271
|
-
|
|
1269
|
+
const i = this.#O ? e ?? this.#N.at(0)?.o.wait ?? (k.#y ? k.#t[s.at(0) ?? ""] ?? 0 : k.msecChWait) : 0;
|
|
1270
|
+
k.#k.isSkipping ? this.#B = 0 : t && this.#O && (this.#B += O(i));
|
|
1272
1271
|
const a = `data-add='{"ch_in_style":"${this.#P}", "ch_out_style":"${this.#I}"}'`;
|
|
1273
1272
|
return {
|
|
1274
1273
|
cl: ` class='sn_ch sn_ch_yet sn_ch_in_${this.#P}'`,
|
|
1275
1274
|
// TxtStage.goTxt()はこれ単位で文字出現させる
|
|
1276
|
-
sty: `animation-delay: ${this.#B}ms;${this.#N.at(-1)?.o.style ?? ""}`,
|
|
1275
|
+
sty: `animation-delay: ${String(this.#B)}ms;${this.#N.at(-1)?.o.style ?? ""}`,
|
|
1277
1276
|
// TxtStage.goTxt()はこれ単位で文字出現させる
|
|
1278
1277
|
lnk: (this.#N.at(0)?.o[":link"] ?? "") + " " + a,
|
|
1279
1278
|
curpos: a
|
|
@@ -1289,11 +1288,11 @@ class x extends tt {
|
|
|
1289
1288
|
r_align: this.#x,
|
|
1290
1289
|
ch_in_style: this.#P,
|
|
1291
1290
|
ch_out_style: this.#I
|
|
1292
|
-
}), t.r_align && (this.#x = t.r_align), this.#
|
|
1291
|
+
}), t.r_align && (this.#x = t.r_align), this.#S(t), this.#$(t);
|
|
1293
1292
|
}
|
|
1294
1293
|
#V() {
|
|
1295
1294
|
const t = this.#N.pop();
|
|
1296
|
-
t && (this.#x = t.r_align, this.#
|
|
1295
|
+
t && (this.#x = t.r_align, this.#S({ in_style: t.ch_in_style }), this.#$({ out_style: t.ch_out_style }));
|
|
1297
1296
|
}
|
|
1298
1297
|
#Q(t) {
|
|
1299
1298
|
const e = this.#N.at(-1);
|
|
@@ -1301,11 +1300,11 @@ class x extends tt {
|
|
|
1301
1300
|
this.#K(t);
|
|
1302
1301
|
return;
|
|
1303
1302
|
}
|
|
1304
|
-
e.o = { ...e.o, ...t }, !t.style && !t.r_style && (e.o.style = "", e.o.r_style = ""), t.r_align && (this.#x = t.r_align), this.#
|
|
1303
|
+
e.o = { ...e.o, ...t }, !t.style && !t.r_style && (e.o.style = "", e.o.r_style = ""), t.r_align && (this.#x = t.r_align), this.#S(t), this.#$(t);
|
|
1305
1304
|
}
|
|
1306
1305
|
click = () => !this.ctn.interactiveChildren || !this.ctn.visible ? !1 : this.#s.skipChIn();
|
|
1307
1306
|
clearText() {
|
|
1308
|
-
this.ctn.addChild(this.#s = this.#s.reNew()), this.#B = 0, this.#T = !0, this.#R = [], this.#G = "", this.#J = "",
|
|
1307
|
+
this.ctn.addChild(this.#s = this.#s.reNew()), this.#B = 0, this.#T = !0, this.#R = [], this.#G = "", this.#J = "", k.#a.pagebreak();
|
|
1309
1308
|
}
|
|
1310
1309
|
#G = "";
|
|
1311
1310
|
#J = "";
|
|
@@ -1322,35 +1321,35 @@ class x extends tt {
|
|
|
1322
1321
|
this.ctn.interactiveChildren = t;
|
|
1323
1322
|
}
|
|
1324
1323
|
addButton = (t) => new Promise((e) => {
|
|
1325
|
-
t.key = `btn=[${this.#
|
|
1326
|
-
const s = new pt(t,
|
|
1327
|
-
s.name = JSON.stringify(t).replaceAll('"', "'"), this.#
|
|
1324
|
+
t.key = `btn=[${String(this.#_.children.length)}] ` + this.name_, t[":id_tag"] = t.key.slice(0, -7), F(t, "hint_tate", this.#s.tategaki);
|
|
1325
|
+
const s = new pt(t, k.#k, () => e(), () => this.canFocus());
|
|
1326
|
+
s.name = JSON.stringify(t).replaceAll('"', "'"), this.#_.addChild(s);
|
|
1328
1327
|
});
|
|
1329
1328
|
canFocus() {
|
|
1330
|
-
return (this.ctn.interactiveChildren ?? !1) && this.ctn.visible &&
|
|
1329
|
+
return (this.ctn.interactiveChildren ?? !1) && this.ctn.visible && k.#r(this);
|
|
1331
1330
|
}
|
|
1332
1331
|
clearLay(t) {
|
|
1333
1332
|
super.clearLay(t), this.clearText();
|
|
1334
|
-
for (const e of this.#
|
|
1333
|
+
for (const e of this.#_.removeChildren()) e.destroy();
|
|
1335
1334
|
}
|
|
1336
1335
|
record = () => ({
|
|
1337
1336
|
...super.record(),
|
|
1338
1337
|
enabled: this.enabled,
|
|
1339
|
-
r_cssText: this.#
|
|
1338
|
+
r_cssText: this.#m.style.cssText,
|
|
1340
1339
|
r_align: this.#x,
|
|
1341
1340
|
// バック
|
|
1342
1341
|
b_do: this.#i === void 0 ? void 0 : this.#i instanceof G ? "Sprite" : "Graphics",
|
|
1343
1342
|
b_pic: this.#b,
|
|
1344
|
-
b_color: this.#
|
|
1345
|
-
b_alpha: this.#
|
|
1343
|
+
b_color: this.#g,
|
|
1344
|
+
b_alpha: this.#o,
|
|
1346
1345
|
b_alpha_isfixed: this.#p,
|
|
1347
|
-
ffs: this.#
|
|
1346
|
+
ffs: this.#C,
|
|
1348
1347
|
txs: this.#s.record(),
|
|
1349
1348
|
strNoFFS: this.#H,
|
|
1350
|
-
btns: this.#
|
|
1349
|
+
btns: this.#_.children.map((t) => t.name)
|
|
1351
1350
|
});
|
|
1352
1351
|
playback(t, e) {
|
|
1353
|
-
super.playback(t, e), this.enabled = t.enabled, this.#
|
|
1352
|
+
super.playback(t, e), this.enabled = t.enabled, this.#m.style.cssText = t.r_cssText, this.#x = t.r_align, this.cvsResize(), this.#W(t), this.#s.playback(t.txs), this.#o = t.b_alpha, this.#p = t.b_alpha_isfixed, e.push(
|
|
1354
1353
|
new Promise((s) => {
|
|
1355
1354
|
const i = t.b_do ? t.b_do === "Sprite" ? { b_pic: t.b_pic } : { b_color: t.b_color } : { b_pic: "" };
|
|
1356
1355
|
i.b_alpha = t.b_alpha, i.b_alpha_isfixed = t.b_alpha_isfixed, this.#j(i, (a) => {
|
|
@@ -1377,25 +1376,25 @@ class x extends tt {
|
|
|
1377
1376
|
}
|
|
1378
1377
|
makeDesignCastChildren(t) {
|
|
1379
1378
|
if (this.ctn.visible)
|
|
1380
|
-
for (const e of this.#
|
|
1379
|
+
for (const e of this.#_.children) e.makeDesignCast(t);
|
|
1381
1380
|
}
|
|
1382
1381
|
showDesignCast() {
|
|
1383
1382
|
this.#s.showDesignCast();
|
|
1384
1383
|
}
|
|
1385
1384
|
showDesignCastChildren() {
|
|
1386
|
-
for (const t of this.#
|
|
1385
|
+
for (const t of this.#_.children) t.showDesignCast();
|
|
1387
1386
|
}
|
|
1388
1387
|
dump() {
|
|
1389
|
-
return this.#Y("", "gotxt|"), super.dump() + `, "enabled":"${this.enabled}", ${this.#s.dump()}, "b_pic":"${this.#b}", "b_color":"${this.#
|
|
1388
|
+
return this.#Y("", "gotxt|"), super.dump() + `, "enabled":"${String(this.enabled)}", ${this.#s.dump()}, "b_pic":"${this.#b}", "b_color":"${String(this.#g)}", "b_alpha":${String(this.#o)}, "b_alpha_isfixed":"${String(this.#p)}", "width":${String(this.#s.getWidth)}, "height":${String(this.#s.getHeight)}, "pixi_obj":[${this.ctn.children.map((t) => `{"class":"${t instanceof G ? "Sprite" : t instanceof B ? "Graphics" : t instanceof T ? "Container" : "?"}", "name":"${t.name}", "alpha":${String(t.alpha)}, "x":${String(t.x)}, "y":${String(t.y)}, "visible":"${String(t.visible)}"}`).join(",")}], "button":[${this.#_.children.map((t) => t.children[0]?.name ?? "{}").join(",")}]`;
|
|
1390
1389
|
}
|
|
1391
1390
|
}
|
|
1392
|
-
const
|
|
1391
|
+
const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1393
1392
|
__proto__: null,
|
|
1394
|
-
TxtLayer:
|
|
1393
|
+
TxtLayer: k
|
|
1395
1394
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1396
1395
|
export {
|
|
1397
|
-
|
|
1396
|
+
k as T,
|
|
1398
1397
|
c as a,
|
|
1399
|
-
|
|
1398
|
+
Ct as b
|
|
1400
1399
|
};
|
|
1401
1400
|
//# sourceMappingURL=TxtLayer.js.map
|