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