@famibee/skynovel 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button.js +36 -34
- package/dist/Button.js.map +1 -1
- package/dist/CallStack.js +11 -6
- package/dist/CallStack.js.map +1 -1
- package/dist/CmnInterface.js +13 -11
- package/dist/CmnInterface.js.map +1 -1
- package/dist/CmnLib.js +58 -56
- package/dist/CmnLib.js.map +1 -1
- package/dist/Config.js +9 -7
- package/dist/Config.js.map +1 -1
- package/dist/ConfigBase.js +52 -49
- package/dist/ConfigBase.js.map +1 -1
- package/dist/DebugMng.js +9 -6
- package/dist/DebugMng.js.map +1 -1
- package/dist/EventListenerCtn.js +6 -4
- package/dist/EventListenerCtn.js.map +1 -1
- package/dist/EventMng.js +522 -417
- package/dist/EventMng.js.map +1 -1
- package/dist/Grammar.js +22 -20
- package/dist/Grammar.js.map +1 -1
- package/dist/GrpLayer.js +58 -57
- package/dist/GrpLayer.js.map +1 -1
- package/dist/Layer.js +66 -64
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMng.js +461 -441
- package/dist/LayerMng.js.map +1 -1
- package/dist/Main.js +69 -67
- package/dist/Main.js.map +1 -1
- package/dist/PropParser.js +23 -19
- package/dist/PropParser.js.map +1 -1
- package/dist/Reading.js +422 -418
- package/dist/Reading.js.map +1 -1
- package/dist/RubySpliter.js +4 -2
- package/dist/RubySpliter.js.map +1 -1
- package/dist/ScriptIterator.js +374 -370
- package/dist/ScriptIterator.js.map +1 -1
- package/dist/SndBuf.js +643 -622
- package/dist/SndBuf.js.map +1 -1
- package/dist/SoundMng.js +59 -60
- package/dist/SoundMng.js.map +1 -1
- package/dist/SpritesMng.js +135 -129
- package/dist/SpritesMng.js.map +1 -1
- package/dist/SysBase.js +985 -950
- package/dist/SysBase.js.map +1 -1
- package/dist/TxtLayer.js +558 -551
- package/dist/TxtLayer.js.map +1 -1
- package/dist/Variable.js +47 -45
- package/dist/Variable.js.map +1 -1
- package/dist/chunk.js +11 -9
- package/dist/gamepad.js +396 -660
- package/dist/gamepad.js.map +1 -1
- package/dist/pixi.js +2631 -2593
- package/dist/pixi.js.map +1 -1
- package/dist/platform.js +6 -4
- package/dist/platform.js.map +1 -1
- package/dist/rolldown-runtime.js +20 -0
- package/dist/web.js +418 -418
- package/dist/web.js.map +1 -1
- package/dist_app/Button.js +36 -34
- package/dist_app/Button.js.map +1 -1
- package/dist_app/CallStack.js +11 -6
- package/dist_app/CallStack.js.map +1 -1
- package/dist_app/CmnInterface.js +13 -11
- package/dist_app/CmnInterface.js.map +1 -1
- package/dist_app/CmnLib.js +58 -56
- package/dist_app/CmnLib.js.map +1 -1
- package/dist_app/Config.js +9 -7
- package/dist_app/Config.js.map +1 -1
- package/dist_app/ConfigBase.js +52 -49
- package/dist_app/ConfigBase.js.map +1 -1
- package/dist_app/DebugMng.js +9 -6
- package/dist_app/DebugMng.js.map +1 -1
- package/dist_app/EventListenerCtn.js +6 -4
- package/dist_app/EventListenerCtn.js.map +1 -1
- package/dist_app/EventMng.js +522 -417
- package/dist_app/EventMng.js.map +1 -1
- package/dist_app/Grammar.js +22 -20
- package/dist_app/Grammar.js.map +1 -1
- package/dist_app/GrpLayer.js +58 -57
- package/dist_app/GrpLayer.js.map +1 -1
- package/dist_app/Layer.js +66 -64
- package/dist_app/Layer.js.map +1 -1
- package/dist_app/LayerMng.js +461 -441
- package/dist_app/LayerMng.js.map +1 -1
- package/dist_app/Main.js +69 -67
- package/dist_app/Main.js.map +1 -1
- package/dist_app/PropParser.js +23 -19
- package/dist_app/PropParser.js.map +1 -1
- package/dist_app/Reading.js +422 -418
- package/dist_app/Reading.js.map +1 -1
- package/dist_app/RubySpliter.js +4 -2
- package/dist_app/RubySpliter.js.map +1 -1
- package/dist_app/ScriptIterator.js +374 -370
- package/dist_app/ScriptIterator.js.map +1 -1
- package/dist_app/SndBuf.js +643 -622
- package/dist_app/SndBuf.js.map +1 -1
- package/dist_app/SoundMng.js +59 -60
- package/dist_app/SoundMng.js.map +1 -1
- package/dist_app/SpritesMng.js +135 -129
- package/dist_app/SpritesMng.js.map +1 -1
- package/dist_app/SysBase.js +985 -950
- package/dist_app/SysBase.js.map +1 -1
- package/dist_app/TxtLayer.js +558 -551
- package/dist_app/TxtLayer.js.map +1 -1
- package/dist_app/Variable.js +47 -45
- package/dist_app/Variable.js.map +1 -1
- package/dist_app/app.js +62 -63
- package/dist_app/app.js.map +1 -1
- package/dist_app/appMain.js +11 -11
- package/dist_app/appMain.js.map +1 -1
- package/dist_app/chunk.js +11 -9
- package/dist_app/gamepad.js +396 -660
- package/dist_app/gamepad.js.map +1 -1
- package/dist_app/pixi.js +2028 -1990
- package/dist_app/pixi.js.map +1 -1
- package/dist_app/platform.js +6 -4
- package/dist_app/platform.js.map +1 -1
- package/dist_app/preload.js +1 -1
- package/dist_app/preload.js.map +1 -1
- package/dist_app/rolldown-runtime.js +20 -0
- package/package.json +20 -21
package/dist_app/TxtLayer.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { f as
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
#e =
|
|
13
|
-
#t =
|
|
14
|
-
#n =
|
|
15
|
-
#r =
|
|
1
|
+
import { a as e, c as t, f as n, g as r, l as i, o as a, s as o, t as s } from "./CmnLib.js";
|
|
2
|
+
import { f as c, h as l, m as u, o as d, s as f } from "./pixi.js";
|
|
3
|
+
import { n as p } from "./ConfigBase.js";
|
|
4
|
+
import { t as m } from "./DebugMng.js";
|
|
5
|
+
import { t as h } from "./Layer.js";
|
|
6
|
+
import { a as g, o as _, r as v, t as y } from "./Reading.js";
|
|
7
|
+
import { t as b } from "./SpritesMng.js";
|
|
8
|
+
import { Button as x } from "./Button.js";
|
|
9
|
+
import { t as S } from "./RubySpliter.js";
|
|
10
|
+
//#region src/sn/Hyphenation.ts
|
|
11
|
+
var C = "、。,.)]}〉」』】〕”〟ぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮヵヶ!?!?‼⁉・ーゝゞヽヾ々", w = "[({〈「『【〔“〝", T = "─‥…", E = C, D = RegExp(`[${C}]`), O = RegExp(`[${w}]`), k = RegExp(`[${T}]`), A = D, j = class {
|
|
12
|
+
#e = C;
|
|
13
|
+
#t = w;
|
|
14
|
+
#n = T;
|
|
15
|
+
#r = E;
|
|
16
16
|
get 行頭禁則() {
|
|
17
17
|
return this.#e;
|
|
18
18
|
}
|
|
@@ -25,44 +25,44 @@ var def行頭禁則 = "、。,.)]}〉」』】〕”〟ぁぃぅぇぉ
|
|
|
25
25
|
get ぶら下げ() {
|
|
26
26
|
return this.#r;
|
|
27
27
|
}
|
|
28
|
-
#i =
|
|
29
|
-
#a =
|
|
30
|
-
#o =
|
|
31
|
-
#s =
|
|
28
|
+
#i = D;
|
|
29
|
+
#a = O;
|
|
30
|
+
#o = k;
|
|
31
|
+
#s = A;
|
|
32
32
|
break_fixed = !1;
|
|
33
33
|
break_fixed_left = 0;
|
|
34
34
|
break_fixed_top = 0;
|
|
35
35
|
bura = !1;
|
|
36
36
|
lay(e) {
|
|
37
|
-
e.kinsoku_sol && (this.#e = e.kinsoku_sol, this.#i =
|
|
37
|
+
e.kinsoku_sol && (this.#e = e.kinsoku_sol, this.#i = RegExp(`[${this.#e}]`)), e.kinsoku_eol && (this.#t = e.kinsoku_eol, this.#c(), this.#a = RegExp(`[${this.#t}]`)), e.kinsoku_dns && (this.#n = e.kinsoku_dns, this.#l(), this.#o = RegExp(`[${this.#n}]`)), e.kinsoku_bura && (this.#r = e.kinsoku_bura, this.#c(), this.#l(), this.#s = RegExp(`[${this.#r}]`)), "bura" in e && (this.bura = o(e, "bura", !1)), this.break_fixed = o(e, "break_fixed", this.break_fixed), this.break_fixed_left = i(e, "break_fixed_left", this.break_fixed_left), this.break_fixed_top = i(e, "break_fixed_top", this.break_fixed_top);
|
|
38
38
|
}
|
|
39
39
|
#c() {
|
|
40
|
-
let e = this.#t.length,
|
|
41
|
-
if (e <
|
|
42
|
-
let e = this.#t[
|
|
40
|
+
let e = this.#t.length, t = this.#r.length;
|
|
41
|
+
if (e < t) for (let t = 0; t < e; ++t) {
|
|
42
|
+
let e = this.#t[t];
|
|
43
43
|
if (this.#r.includes(e)) throw `禁則の競合があります。文字 ${String(e)} がぶら下げ と 行末禁則 の両方に含まれます`;
|
|
44
44
|
}
|
|
45
|
-
else for (let e = 0; e <
|
|
46
|
-
let
|
|
47
|
-
if (this.#t.includes(
|
|
45
|
+
else for (let e = 0; e < t; ++e) {
|
|
46
|
+
let t = this.#r[e];
|
|
47
|
+
if (this.#t.includes(t)) throw `禁則の競合があります。文字 ${String(t)} がぶら下げ と 行末禁則 の両方に含まれます`;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
#l() {
|
|
51
|
-
let e = this.#n.length,
|
|
52
|
-
if (e <
|
|
53
|
-
let e = this.#n[
|
|
51
|
+
let e = this.#n.length, t = this.#r.length;
|
|
52
|
+
if (e < t) for (let t = 0; t < e; ++t) {
|
|
53
|
+
let e = this.#n[t];
|
|
54
54
|
if (this.#r.includes(e)) throw `禁則の競合があります。文字 ${String(e)} がぶら下げ と 分割禁止 の両方に含まれます`;
|
|
55
55
|
}
|
|
56
|
-
else for (let e = 0; e <
|
|
57
|
-
let
|
|
58
|
-
if (this.#n.includes(
|
|
56
|
+
else for (let e = 0; e < t; ++e) {
|
|
57
|
+
let t = this.#r[e];
|
|
58
|
+
if (this.#n.includes(t)) throw `禁則の競合があります。文字 ${String(t)} がぶら下げ と 分割禁止 の両方に含まれます`;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
reNew(e) {
|
|
62
62
|
e.#u(this.#e, this.#t, this.#n, this.#r), e.break_fixed = this.break_fixed, e.break_fixed_left = this.break_fixed_left, e.break_fixed_top = this.break_fixed_top, e.bura = this.bura;
|
|
63
63
|
}
|
|
64
|
-
#u(e,
|
|
65
|
-
this.#e !== e && (this.#e = e, this.#i =
|
|
64
|
+
#u(e, t, n, r) {
|
|
65
|
+
this.#e !== e && (this.#e = e, this.#i = RegExp(`[${e}]`)), this.#t !== t && (this.#t = t, this.#a = RegExp(`[${t}]`)), this.#n !== n && (this.#n = n, this.#o = RegExp(`[${n}]`)), this.#r !== r && (this.#r = r, this.#s = RegExp(`[${r}]`));
|
|
66
66
|
}
|
|
67
67
|
record() {
|
|
68
68
|
let e = {
|
|
@@ -71,267 +71,268 @@ var def行頭禁則 = "、。,.)]}〉」』】〕”〟ぁぃぅぇぉ
|
|
|
71
71
|
break_fixed_top: this.break_fixed_top,
|
|
72
72
|
bura: this.bura
|
|
73
73
|
};
|
|
74
|
-
return this.#e ===
|
|
74
|
+
return this.#e === C && (e.行頭禁則 = this.#e), this.#t === w && (e.行末禁則 = this.#t), this.#n === T && (e.分割禁止 = this.#n), this.#r === E && (e.ぶら下げ = this.#r), e;
|
|
75
75
|
}
|
|
76
76
|
playback(e) {
|
|
77
|
-
e && (this.#u(e.行頭禁則 ??
|
|
77
|
+
e && (this.#u(e.行頭禁則 ?? C, e.行末禁則 ?? w, e.分割禁止 ?? T, e.ぶら下げ ?? E), this.break_fixed = e.break_fixed, this.break_fixed_left = e.break_fixed_left, this.break_fixed_top = e.break_fixed_top, this.bura = e.bura);
|
|
78
78
|
}
|
|
79
|
-
hyph(e,
|
|
80
|
-
let
|
|
79
|
+
hyph(e, t, n, r, i) {
|
|
80
|
+
let a, o = 0, s = 2, c = (t) => (c = () => !1, r === t ? (r > 0 && (e.innerHTML = i.replaceAll("class=\"sn_ch\"", "class=\"sn_ch sn_ch_in_default\"")), !0) : t < 2);
|
|
81
81
|
do {
|
|
82
|
-
if (
|
|
83
|
-
let
|
|
84
|
-
for (;
|
|
85
|
-
let { elm: e, rect:
|
|
82
|
+
if (a = this.#f(e, t), o = a.length, c(o)) break;
|
|
83
|
+
let r = -Infinity;
|
|
84
|
+
for (; s < o; ++s) {
|
|
85
|
+
let { elm: e, rect: t, ch: i } = a[s];
|
|
86
86
|
if (e.tagName === "RT") continue;
|
|
87
|
-
let
|
|
88
|
-
if (
|
|
89
|
-
|
|
87
|
+
let c = n ? t.y : t.x;
|
|
88
|
+
if (r <= c || e.previousElementSibling?.tagName === "SPAN" && e.previousElementSibling?.innerHTML.includes("<br>") || e.parentElement?.previousElementSibling?.tagName === "SPAN" && e.parentElement?.previousElementSibling?.innerHTML.includes("<br>")) {
|
|
89
|
+
r = c, this.break_fixed || (this.break_fixed_left = t.x, this.break_fixed_top = t.y);
|
|
90
90
|
continue;
|
|
91
91
|
}
|
|
92
|
-
let
|
|
92
|
+
let l = this.#d(a, s), { elm: u, rect: d, ch: f } = a[l];
|
|
93
93
|
if (!this.break_fixed) {
|
|
94
|
-
this.break_fixed_left =
|
|
95
|
-
let e = globalThis.getComputedStyle(
|
|
96
|
-
|
|
94
|
+
this.break_fixed_left = d.x, this.break_fixed_top = d.y;
|
|
95
|
+
let e = globalThis.getComputedStyle(u), t = parseFloat(e.fontSize);
|
|
96
|
+
n ? this.break_fixed_top += t : this.break_fixed_left += t;
|
|
97
97
|
}
|
|
98
|
-
|
|
99
|
-
let
|
|
100
|
-
if (
|
|
101
|
-
let
|
|
102
|
-
if (
|
|
98
|
+
r = -Infinity;
|
|
99
|
+
let p = s, { cont: m, ins: h } = this.bura ? this.hyph_alg_bura(a, l, f, s) : this.hyph_alg(a, l, f, s, i);
|
|
100
|
+
if (s = h, m) continue;
|
|
101
|
+
let g = a[s].elm, _ = g.parentElement, v = document.createElement("br");
|
|
102
|
+
if (_.classList.contains("sn_tx")) _.insertBefore(v, g);
|
|
103
103
|
else {
|
|
104
|
-
let e =
|
|
105
|
-
e.classList.contains("sn_ch") ? e.parentElement.insertBefore(
|
|
104
|
+
let e = _.parentElement;
|
|
105
|
+
e.classList.contains("sn_ch") ? e.parentElement.insertBefore(v, e) : e.insertBefore(v, _);
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
s += 2, s < p && (s = p), o = -1;
|
|
108
108
|
break;
|
|
109
109
|
}
|
|
110
|
-
} while (
|
|
111
|
-
return [
|
|
112
|
-
}
|
|
113
|
-
#d(e,
|
|
114
|
-
let
|
|
115
|
-
return
|
|
116
|
-
}
|
|
117
|
-
#f(e,
|
|
118
|
-
let
|
|
119
|
-
if (e.nodeType !== e.TEXT_NODE) return Array.from(e.childNodes).map((e) => this.#f(e,
|
|
120
|
-
let
|
|
121
|
-
|
|
122
|
-
let
|
|
123
|
-
for (;
|
|
124
|
-
|
|
125
|
-
let
|
|
126
|
-
|
|
127
|
-
ch:
|
|
128
|
-
rect:
|
|
129
|
-
elm:
|
|
110
|
+
} while (o < 0);
|
|
111
|
+
return [a, o];
|
|
112
|
+
}
|
|
113
|
+
#d(e, t) {
|
|
114
|
+
let n = t - 1, { elm: r } = e[n];
|
|
115
|
+
return r.tagName === "RT" ? n - Array.from(r.textContent).length : n - (r.style.textCombineUpright === "all" ? Array.from(r.textContent).length - 1 : 0);
|
|
116
|
+
}
|
|
117
|
+
#f(e, t) {
|
|
118
|
+
let n = [];
|
|
119
|
+
if (e.nodeType !== e.TEXT_NODE) return Array.from(e.childNodes).map((e) => this.#f(e, t)).flat();
|
|
120
|
+
let r = e.ownerDocument.createRange();
|
|
121
|
+
r.selectNodeContents(e);
|
|
122
|
+
let i = 0, a = r.endOffset;
|
|
123
|
+
for (; i < a;) {
|
|
124
|
+
r.setStart(e, i), r.setEnd(e, ++i);
|
|
125
|
+
let a = r.toString();
|
|
126
|
+
n.push({
|
|
127
|
+
ch: a,
|
|
128
|
+
rect: t(r, a),
|
|
129
|
+
elm: r.startContainer.parentElement
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
-
return
|
|
132
|
+
return r.detach(), n;
|
|
133
133
|
}
|
|
134
|
-
hyph_alg(e,
|
|
135
|
-
let
|
|
136
|
-
if (!this.#a.test(
|
|
137
|
-
if (this.#i.test(
|
|
138
|
-
else if (!(
|
|
134
|
+
hyph_alg(e, t, n, r, i) {
|
|
135
|
+
let a = r;
|
|
136
|
+
if (!this.#a.test(n)) {
|
|
137
|
+
if (this.#i.test(i)) for (; (a = this.#d(e, a)) >= 0 && this.#i.test(e[a].ch););
|
|
138
|
+
else if (!(n === i && this.#o.test(n))) return {
|
|
139
139
|
cont: !0,
|
|
140
|
-
ins:
|
|
140
|
+
ins: a + 1
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
for (
|
|
143
|
+
for (a = t; (a = this.#d(e, a)) >= 0 && this.#a.test(e[a].ch););
|
|
144
144
|
return {
|
|
145
145
|
cont: !1,
|
|
146
|
-
ins:
|
|
146
|
+
ins: a + 1
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
hyph_alg_bura(e,
|
|
150
|
-
let
|
|
151
|
-
if (this.#s.test(
|
|
152
|
-
let
|
|
153
|
-
(this.#s.test(
|
|
154
|
-
let
|
|
155
|
-
if (
|
|
149
|
+
hyph_alg_bura(e, t, n, r) {
|
|
150
|
+
let i = this.#d(e, t), { ch: a } = e[i];
|
|
151
|
+
if (this.#s.test(a) || this.#i.test(a)) {
|
|
152
|
+
let r = t;
|
|
153
|
+
(this.#s.test(n) || this.#i.test(n)) && ++r;
|
|
154
|
+
let i = this.#d(e, r), { ch: a } = e[i], { ch: o } = e[r];
|
|
155
|
+
if (a === o && this.#o.test(o)) return {
|
|
156
156
|
cont: !1,
|
|
157
|
-
ins:
|
|
157
|
+
ins: i
|
|
158
158
|
};
|
|
159
|
-
if (!this.#a.test(
|
|
159
|
+
if (!this.#a.test(a)) return {
|
|
160
160
|
cont: !1,
|
|
161
|
-
ins:
|
|
161
|
+
ins: r
|
|
162
162
|
};
|
|
163
|
-
|
|
163
|
+
r = i;
|
|
164
164
|
do
|
|
165
|
-
if (!this.#a.test(e[
|
|
166
|
-
while ((
|
|
165
|
+
if (!this.#a.test(e[r].ch)) break;
|
|
166
|
+
while ((r = this.#d(e, r)) >= 0);
|
|
167
167
|
return {
|
|
168
168
|
cont: !1,
|
|
169
|
-
ins:
|
|
169
|
+
ins: r + 1
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
|
-
let
|
|
173
|
-
if (
|
|
174
|
-
let { ch:
|
|
175
|
-
if (this.#o.test(
|
|
172
|
+
let o = this.#d(e, i);
|
|
173
|
+
if (r >= 3) {
|
|
174
|
+
let { ch: t } = e[o];
|
|
175
|
+
if (this.#o.test(a) && t === a) return {
|
|
176
176
|
cont: !1,
|
|
177
|
-
ins:
|
|
177
|
+
ins: o
|
|
178
178
|
};
|
|
179
|
-
if (this.#a.test(
|
|
180
|
-
let
|
|
181
|
-
for (; (
|
|
179
|
+
if (this.#a.test(t)) {
|
|
180
|
+
let t = o;
|
|
181
|
+
for (; (t = this.#d(e, t)) >= 0 && this.#a.test(e[t].ch););
|
|
182
182
|
return {
|
|
183
183
|
cont: !1,
|
|
184
|
-
ins:
|
|
184
|
+
ins: t + 1
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
return {
|
|
189
189
|
cont: !1,
|
|
190
|
-
ins:
|
|
190
|
+
ins: i
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
193
|
};
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region src/sn/htm2tx.ts
|
|
196
|
+
function M(e, t, n, r, i, a = !0) {
|
|
197
|
+
let o = {
|
|
196
198
|
escape: (e) => e.replaceAll(/([.*+?^${}()|[\]/\\])/g, "\\$1"),
|
|
197
199
|
mimeType: (e) => {
|
|
198
|
-
let
|
|
199
|
-
return
|
|
200
|
+
let t = f(e).toLowerCase();
|
|
201
|
+
return s()[t] || "";
|
|
200
202
|
},
|
|
201
|
-
dataAsUrl:
|
|
202
|
-
isDataUrl:
|
|
203
|
-
resolveUrl:
|
|
204
|
-
getAndEncode:
|
|
203
|
+
dataAsUrl: _,
|
|
204
|
+
isDataUrl: p,
|
|
205
|
+
resolveUrl: h,
|
|
206
|
+
getAndEncode: g,
|
|
205
207
|
asArray: (e) => {
|
|
206
|
-
let
|
|
207
|
-
for (let
|
|
208
|
-
return
|
|
208
|
+
let t = [], n = e.length;
|
|
209
|
+
for (let r = 0; r < n; ++r) t.push(e[r]);
|
|
210
|
+
return t;
|
|
209
211
|
}
|
|
210
212
|
};
|
|
211
|
-
function
|
|
212
|
-
let e = "application/font-woff",
|
|
213
|
+
function s() {
|
|
214
|
+
let e = "application/font-woff", t = "image/jpeg";
|
|
213
215
|
return {
|
|
214
216
|
woff: e,
|
|
215
217
|
woff2: e,
|
|
216
218
|
ttf: "application/font-truetype",
|
|
217
219
|
eot: "application/vnd.ms-fontobject",
|
|
218
220
|
png: "image/png",
|
|
219
|
-
jpg:
|
|
220
|
-
jpeg:
|
|
221
|
+
jpg: t,
|
|
222
|
+
jpeg: t,
|
|
221
223
|
gif: "image/gif",
|
|
222
224
|
tiff: "image/tiff",
|
|
223
225
|
svg: "image/svg+xml"
|
|
224
226
|
};
|
|
225
227
|
}
|
|
226
|
-
let
|
|
227
|
-
function
|
|
228
|
-
return
|
|
229
|
-
let
|
|
230
|
-
return e.appendChild(
|
|
228
|
+
let l = v(), u = y();
|
|
229
|
+
function d(e) {
|
|
230
|
+
return u.resolveAll().then((t) => {
|
|
231
|
+
let n = document.createElement("style");
|
|
232
|
+
return e.appendChild(n), n.appendChild(document.createTextNode(t)), e;
|
|
231
233
|
});
|
|
232
234
|
}
|
|
233
|
-
function
|
|
235
|
+
function f(e) {
|
|
234
236
|
return /\.([^./]*?)$/g.exec(e)?.[1] ?? "";
|
|
235
237
|
}
|
|
236
|
-
function
|
|
238
|
+
function p(e) {
|
|
237
239
|
return e.search(/^(data:)/) !== -1;
|
|
238
240
|
}
|
|
239
|
-
function
|
|
240
|
-
let
|
|
241
|
-
|
|
242
|
-
let
|
|
243
|
-
return
|
|
244
|
-
}
|
|
245
|
-
function
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
if (
|
|
252
|
-
|
|
253
|
-
v("cannot fetch resource: " + e + ", status: " + h.status);
|
|
241
|
+
function h(e, t) {
|
|
242
|
+
let n = document.implementation.createHTMLDocument(), r = n.createElement("base");
|
|
243
|
+
n.head.appendChild(r);
|
|
244
|
+
let i = n.createElement("a");
|
|
245
|
+
return n.body.appendChild(i), r.href = t, i.href = e, i.href;
|
|
246
|
+
}
|
|
247
|
+
function g(e) {
|
|
248
|
+
return new Promise(function(t) {
|
|
249
|
+
let n = new XMLHttpRequest();
|
|
250
|
+
n.onreadystatechange = r, n.ontimeout = i, n.responseType = "blob", n.timeout = 3e4, n.open("GET", e, !0), n.send();
|
|
251
|
+
function r() {
|
|
252
|
+
if (n.readyState !== 4) return;
|
|
253
|
+
if (n.status !== 200) {
|
|
254
|
+
a("cannot fetch resource: " + e + ", status: " + n.status);
|
|
254
255
|
return;
|
|
255
256
|
}
|
|
256
|
-
let
|
|
257
|
-
|
|
258
|
-
let e =
|
|
259
|
-
|
|
260
|
-
},
|
|
257
|
+
let r = new FileReader();
|
|
258
|
+
r.onloadend = function() {
|
|
259
|
+
let e = r.result.toString().split(/,/)[1];
|
|
260
|
+
t(e);
|
|
261
|
+
}, r.readAsDataURL(n.response);
|
|
261
262
|
}
|
|
262
|
-
function
|
|
263
|
-
|
|
263
|
+
function i() {
|
|
264
|
+
a("timeout of 30000ms occured while fetching resource: " + e);
|
|
264
265
|
}
|
|
265
|
-
function
|
|
266
|
-
console.error(e),
|
|
266
|
+
function a(e) {
|
|
267
|
+
console.error(e), t("");
|
|
267
268
|
}
|
|
268
269
|
});
|
|
269
270
|
}
|
|
270
|
-
function
|
|
271
|
-
return "data:" +
|
|
271
|
+
function _(e, t) {
|
|
272
|
+
return "data:" + t + ";base64," + e;
|
|
272
273
|
}
|
|
273
|
-
function
|
|
274
|
+
function v() {
|
|
274
275
|
let e = /url\(['"]?([^'"]+?)['"]?\)/g;
|
|
275
276
|
return {
|
|
276
|
-
inlineAll:
|
|
277
|
-
shouldProcess:
|
|
277
|
+
inlineAll: i,
|
|
278
|
+
shouldProcess: t
|
|
278
279
|
};
|
|
279
|
-
function
|
|
280
|
-
return
|
|
280
|
+
function t(t) {
|
|
281
|
+
return t.search(e) !== -1;
|
|
281
282
|
}
|
|
282
|
-
function
|
|
283
|
-
let
|
|
284
|
-
for (;
|
|
285
|
-
return
|
|
286
|
-
return !
|
|
283
|
+
function n(t) {
|
|
284
|
+
let n = [], r;
|
|
285
|
+
for (; r = e.exec(t);) n.push(r[1]);
|
|
286
|
+
return n.filter(function(e) {
|
|
287
|
+
return !o.isDataUrl(e);
|
|
287
288
|
});
|
|
288
289
|
}
|
|
289
|
-
function
|
|
290
|
-
return Promise.resolve(
|
|
291
|
-
function
|
|
292
|
-
return RegExp("(url\\(['\"]?)(" +
|
|
290
|
+
function r(e, t, n, r) {
|
|
291
|
+
return Promise.resolve(t).then((e) => n ? o.resolveUrl(e, n) : e).then(r || o.getAndEncode).then((e) => o.dataAsUrl(e, o.mimeType(t))).then((n) => e.replace(i(t), "$1" + n + "$3"));
|
|
292
|
+
function i(e) {
|
|
293
|
+
return RegExp("(url\\(['\"]?)(" + o.escape(e) + ")(['\"]?\\))", "g");
|
|
293
294
|
}
|
|
294
295
|
}
|
|
295
|
-
function
|
|
296
|
-
if (
|
|
297
|
-
return Promise.resolve(e).then(
|
|
298
|
-
let
|
|
299
|
-
for (let e of
|
|
300
|
-
return
|
|
296
|
+
function i(e, i, a) {
|
|
297
|
+
if (o()) return Promise.resolve(e);
|
|
298
|
+
return Promise.resolve(e).then(n).then((t) => {
|
|
299
|
+
let n = Promise.resolve(e);
|
|
300
|
+
for (let e of t) n = n.then((t) => r(t, e, i, a));
|
|
301
|
+
return n;
|
|
301
302
|
});
|
|
302
|
-
function
|
|
303
|
-
return !
|
|
303
|
+
function o() {
|
|
304
|
+
return !t(e);
|
|
304
305
|
}
|
|
305
306
|
}
|
|
306
307
|
}
|
|
307
|
-
function
|
|
308
|
+
function y() {
|
|
308
309
|
return {
|
|
309
310
|
resolveAll: e,
|
|
310
|
-
impl: { readAll:
|
|
311
|
+
impl: { readAll: t }
|
|
311
312
|
};
|
|
312
313
|
function e() {
|
|
313
|
-
return
|
|
314
|
+
return t().then((e) => Promise.allSettled(e.map((e) => e.resolve()))).then((e) => e.join("\n"));
|
|
314
315
|
}
|
|
315
|
-
function
|
|
316
|
-
return Promise.resolve(
|
|
316
|
+
function t() {
|
|
317
|
+
return Promise.resolve(o.asArray(document.styleSheets)).then(t).then(e).then((e) => e.map(n));
|
|
317
318
|
function e(e) {
|
|
318
|
-
return e.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) =>
|
|
319
|
+
return e.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) => l.shouldProcess(e.style.getPropertyValue("src")));
|
|
319
320
|
}
|
|
320
|
-
function
|
|
321
|
-
let
|
|
322
|
-
for (let
|
|
323
|
-
if (
|
|
324
|
-
|
|
321
|
+
function t(e) {
|
|
322
|
+
let t = [];
|
|
323
|
+
for (let n of e) try {
|
|
324
|
+
if (n.href) continue;
|
|
325
|
+
o.asArray(n.cssRules || []).forEach(t.push.bind(t));
|
|
325
326
|
} catch (e) {
|
|
326
|
-
console.error("Error while reading CSS rules from " +
|
|
327
|
+
console.error("Error while reading CSS rules from " + n.href, String(e));
|
|
327
328
|
}
|
|
328
|
-
return
|
|
329
|
+
return t;
|
|
329
330
|
}
|
|
330
|
-
function
|
|
331
|
+
function n(e) {
|
|
331
332
|
return {
|
|
332
333
|
resolve: function() {
|
|
333
|
-
let
|
|
334
|
-
return
|
|
334
|
+
let t = (e.parentStyleSheet || {}).href;
|
|
335
|
+
return l.inlineAll(e.cssText, t);
|
|
335
336
|
},
|
|
336
337
|
src() {
|
|
337
338
|
return e.style.getPropertyValue("src");
|
|
@@ -340,38 +341,43 @@ function htm2tx(e, p, m, h, g, _ = !0) {
|
|
|
340
341
|
}
|
|
341
342
|
}
|
|
342
343
|
}
|
|
343
|
-
Promise.resolve(
|
|
344
|
-
let
|
|
345
|
-
return
|
|
346
|
-
}).then(
|
|
344
|
+
Promise.resolve(t).then((e) => {
|
|
345
|
+
let o = e.cloneNode(!0);
|
|
346
|
+
return o.style.padding = "0px", o.style.paddingRight = r + "px", o.style.paddingTop = i + "px", o.style.left = "0px", o.style.top = "0px", o.style.width = n.$width - n.pad_left - n.pad_right + "px", o.style.height = n.$height - n.pad_top - n.pad_bottom + "px", t.hidden = a, o;
|
|
347
|
+
}).then(d).then((e) => {
|
|
347
348
|
e.setAttribute("xmlns", "http://www.w3.org/1999/xhtml");
|
|
348
|
-
let
|
|
349
|
-
return
|
|
350
|
-
|
|
349
|
+
let t = new Image();
|
|
350
|
+
return t.src = `data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="${String(n.$width)}px" height="${String(n.$height)}px"><foreignObject x="0" y="0" width="100%" height="100%">${new XMLSerializer().serializeToString(e).replaceAll("#", "%23").replaceAll("\n", "%0A")}</foreignObject></svg>`, new Promise((e) => {
|
|
351
|
+
t.onload = () => e(t);
|
|
351
352
|
});
|
|
352
|
-
}).then((e) => new Promise((
|
|
353
|
-
let
|
|
354
|
-
|
|
355
|
-
}).catch((e) =>
|
|
353
|
+
}).then((e) => new Promise((t) => setTimeout(() => t(e), 100))).then((t) => {
|
|
354
|
+
let r = document.createElement("canvas");
|
|
355
|
+
r.width = n.$width, r.height = n.$height, r.getContext("2d").drawImage(t, 0, 0), e(c.from(r));
|
|
356
|
+
}).catch((e) => m.myTrace(`goTxt() = ${String(e)}`));
|
|
356
357
|
}
|
|
357
|
-
|
|
358
|
+
//#endregion
|
|
359
|
+
//#region src/sn/TxtStage.ts
|
|
360
|
+
var N = class t extends u {
|
|
361
|
+
ctn;
|
|
362
|
+
canFocus;
|
|
363
|
+
sys;
|
|
358
364
|
static #e;
|
|
359
365
|
static #t;
|
|
360
|
-
static init(e,
|
|
361
|
-
|
|
366
|
+
static init(e, n) {
|
|
367
|
+
t.#e = e, t.#t = n, v.addGrp(t.grp);
|
|
362
368
|
}
|
|
363
|
-
static grp = new
|
|
369
|
+
static grp = new g();
|
|
364
370
|
static #n;
|
|
365
371
|
static #r;
|
|
366
|
-
static setEvtMng(e,
|
|
367
|
-
|
|
372
|
+
static setEvtMng(e, n) {
|
|
373
|
+
t.#n = e, t.#r = n;
|
|
368
374
|
}
|
|
369
375
|
static destroy() {
|
|
370
|
-
|
|
376
|
+
t.grp.removeAll(), t.#T = Object.create(null), t.#D = Object.create(null), t.delBreak();
|
|
371
377
|
}
|
|
372
378
|
#i = document.createElement("span");
|
|
373
|
-
#a = new
|
|
374
|
-
#o = new
|
|
379
|
+
#a = new u();
|
|
380
|
+
#o = new f();
|
|
375
381
|
static #s = {
|
|
376
382
|
"background-color": 0,
|
|
377
383
|
"border-bottom-width": 0,
|
|
@@ -383,24 +389,24 @@ var TxtStage = class p extends Container {
|
|
|
383
389
|
"margin-right": 0,
|
|
384
390
|
"margin-top": 0
|
|
385
391
|
};
|
|
386
|
-
#c = new
|
|
392
|
+
#c = new j();
|
|
387
393
|
noticeCompTxt = () => {};
|
|
388
394
|
#l;
|
|
389
|
-
constructor(
|
|
390
|
-
super(), this.ctn =
|
|
391
|
-
let
|
|
392
|
-
this.#l =
|
|
393
|
-
|
|
394
|
-
let { x:
|
|
395
|
-
this.#o.beginFill(6737151, .5).lineStyle(2, 16724736, 1).drawRect(
|
|
396
|
-
} : () => {}, this.noticeCompTxt =
|
|
397
|
-
|
|
398
|
-
let
|
|
399
|
-
if (
|
|
400
|
-
let { fn:
|
|
401
|
-
|
|
402
|
-
<h1>${
|
|
403
|
-
} : () =>
|
|
395
|
+
constructor(n, r, i) {
|
|
396
|
+
super(), this.ctn = n, this.canFocus = r, this.sys = i, this.#i.classList.add("sn_tx"), this.#i.style.position = "absolute", t.#t.view.parentElement.appendChild(this.#i), this.addChild(this.#a), this.addChild(this.#o), this.#o.name = "grpDbgMasume";
|
|
397
|
+
let a = s.debugLog ? ({ ch: e, rect: { x: t, y: n, width: r, height: i } }) => console.log(`🍌 masume ch:${e} x:${String(t)} y:${String(n)} w:${String(r)} h:${String(i)}`) : () => {};
|
|
398
|
+
this.#l = t.#e.oCfg.debug.masume ? (e) => {
|
|
399
|
+
a(e);
|
|
400
|
+
let { x: t, y: n, width: r, height: i } = e.rect;
|
|
401
|
+
this.#o.beginFill(6737151, .5).lineStyle(2, 16724736, 1).drawRect(t, n, r, i).endFill();
|
|
402
|
+
} : () => {}, this.noticeCompTxt = i.isApp && t.#e.oCfg.debug.dumpHtm ? () => {
|
|
403
|
+
y.notifyEndProc(e);
|
|
404
|
+
let r = this.#i.innerHTML;
|
|
405
|
+
if (r === "") return;
|
|
406
|
+
let { fn: a, ln: o } = t.#r.nowScrFnLn(), s = `dumpHtm ${n.name.slice(0, -7).replaceAll(":", "=")}(fn=${a} line=${String(o)})`;
|
|
407
|
+
i.outputFile(i.path_downloads + s + ".htm", `<!doctype html><html><head><meta charset=utf-8><title>${s}</title>
|
|
408
|
+
<h1>${s}</h1>${r.replaceAll(/ class="sn_ch"|animation-delay: \d+ms; ?| data-add="{"ch_in_style":"default", "ch_out_style":"default"}"/g, "").replaceAll(" style=\"\"", "").replaceAll(/(<\/?ruby>)/g, "\n$1\n").replaceAll(/<(br|\/span)>/g, "<$1>\n")}`);
|
|
409
|
+
} : () => y.notifyEndProc(e);
|
|
404
410
|
}
|
|
405
411
|
#u = {
|
|
406
412
|
fontsize: 24,
|
|
@@ -412,37 +418,37 @@ var TxtStage = class p extends Container {
|
|
|
412
418
|
pad_bottom: 0
|
|
413
419
|
};
|
|
414
420
|
lay(e) {
|
|
415
|
-
let
|
|
421
|
+
let n = this.#i.style;
|
|
416
422
|
if ("style" in e) if (e.style) {
|
|
417
|
-
let
|
|
418
|
-
|
|
419
|
-
let
|
|
420
|
-
for (let e = 0; e <
|
|
421
|
-
let
|
|
422
|
-
if (
|
|
423
|
-
|
|
423
|
+
let r = document.createElement("span");
|
|
424
|
+
r.style.cssText = e.style;
|
|
425
|
+
let i = r.style.length;
|
|
426
|
+
for (let e = 0; e < i; ++e) {
|
|
427
|
+
let i = r.style[e];
|
|
428
|
+
if (i in t.#s) {
|
|
429
|
+
m.myTrace(`${String(i)}は指定できません`, "W");
|
|
424
430
|
continue;
|
|
425
431
|
}
|
|
426
|
-
|
|
432
|
+
n[i] = r.style[i];
|
|
427
433
|
}
|
|
428
|
-
!
|
|
434
|
+
!r.style.opacity && "alpha" in e && (n.opacity = String(this.ctn.alpha));
|
|
429
435
|
} else this.#i.style.cssText = "";
|
|
430
|
-
else "alpha" in e && (
|
|
431
|
-
if ("width" in e && (
|
|
436
|
+
else "alpha" in e && (n.opacity = String(this.ctn.alpha));
|
|
437
|
+
if ("width" in e && (n.width = String(e.width ?? "0") + "px"), "height" in e && (n.height = String(e.height ?? "0") + "px"), "pl" in e && (n.paddingLeft = String(e.pl ?? "0") + "px"), "pr" in e && (n.paddingRight = String(e.pr ?? "0") + "px"), "pt" in e && (n.paddingTop = String(e.pt ?? "0") + "px"), "pb" in e && (n.paddingBottom = String(e.pb ?? "0") + "px"), this.#c.lay(e), this.#f(), this.#p = this.ctn.position.x, n.transformOrigin = `${String(this.ctn.pivot.x)}px ${String(this.ctn.pivot.y)}px`, this.cvsResize(), n.display = this.ctn.visible ? "inline" : "none", ":redraw" in e && this.#y > 0) {
|
|
432
438
|
let e = [this.#i.innerHTML.replaceAll(/(animation-delay: )\d+ms/g, "$10ms"), "<span class='sn_ch' data-add='{\"ch_in_style\":\"default\"}'> </span>"];
|
|
433
439
|
this.#N(), this.goTxt(e, !0);
|
|
434
440
|
}
|
|
435
441
|
}
|
|
436
442
|
#d = 0;
|
|
437
443
|
#f() {
|
|
438
|
-
let e = this.#i.style,
|
|
439
|
-
this.#u.fontsize =
|
|
440
|
-
let
|
|
441
|
-
this.#d = this.#m ? 0 : (
|
|
444
|
+
let e = this.#i.style, t = parseFloat(e.fontSize || "0");
|
|
445
|
+
this.#u.fontsize = t, this.#u.pad_left = parseFloat(e.paddingLeft || "0"), this.#u.pad_right = parseFloat(e.paddingRight || "0"), this.#u.pad_top = parseFloat(e.paddingTop || "0"), this.#u.pad_bottom = parseFloat(e.paddingBottom || "0"), this.#u.$width = parseFloat(e.width || "0"), this.#u.$height = parseFloat(e.height || "0"), this.position.set(this.#u.pad_left, this.#u.pad_top), this.#m = e.writingMode === "vertical-rl", this.#h = 0, this.#g = 0;
|
|
446
|
+
let n = e.lineHeight ?? "0";
|
|
447
|
+
this.#d = this.#m ? 0 : (n.endsWith("px") ? parseFloat(n) : t * parseFloat(n) - t) / 2;
|
|
442
448
|
}
|
|
443
449
|
cvsResize() {
|
|
444
|
-
let e = this.#i.style,
|
|
445
|
-
e.left = `${String(this.sys.ofsLeft4elm + this.#p *
|
|
450
|
+
let e = this.#i.style, t = this.sys.cvsScale;
|
|
451
|
+
e.left = `${String(this.sys.ofsLeft4elm + this.#p * t)}px`, e.top = `${String(this.sys.ofsTop4elm + this.ctn.position.y * t)}px`, e.transform = `rotate(${String(this.ctn.angle)}deg) scale(${String(this.ctn.scale.x * t)}, ${String(this.ctn.scale.y * t)})`;
|
|
446
452
|
}
|
|
447
453
|
#p = 0;
|
|
448
454
|
#m = !1;
|
|
@@ -460,186 +466,186 @@ var TxtStage = class p extends Container {
|
|
|
460
466
|
get getHeight() {
|
|
461
467
|
return this.#u.$height;
|
|
462
468
|
}
|
|
463
|
-
setMySize(e,
|
|
464
|
-
this.#u.$width = e, this.#u.$height =
|
|
469
|
+
setMySize(e, t) {
|
|
470
|
+
this.#u.$width = e, this.#u.$height = t, this.#i.style.width = String(this.#u.$width) + "px", this.#i.style.height = String(this.#u.$height) + "px";
|
|
465
471
|
}
|
|
466
472
|
#_ = [];
|
|
467
|
-
goTxt(e,
|
|
468
|
-
let
|
|
469
|
-
this.#_.push(
|
|
473
|
+
goTxt(e, t) {
|
|
474
|
+
let n = () => this.#x(e, t);
|
|
475
|
+
this.#_.push(n) === 1 && n();
|
|
470
476
|
}
|
|
471
477
|
#v = [];
|
|
472
478
|
#y = 0;
|
|
473
479
|
static #b = "<span class='sn_ch sn_ch_last'> </span>";
|
|
474
|
-
#x(e,
|
|
475
|
-
|
|
476
|
-
let
|
|
477
|
-
if (
|
|
478
|
-
if (
|
|
479
|
-
let e = globalThis.getComputedStyle(this.#i),
|
|
480
|
-
this.#m ? (this.#c.break_fixed_left = (this.#u.$width - this.#u.pad_left - this.#u.pad_right -
|
|
480
|
+
#x(e, n) {
|
|
481
|
+
t.#O.visible = !1;
|
|
482
|
+
let r = this.#v.length, i = "";
|
|
483
|
+
if (r === 0) {
|
|
484
|
+
if (t.#e.oCfg.debug.masume && (s.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.#u.pad_left)} pr:${String(this.#u.pad_right)} pt:${String(this.#u.pad_top)} pb:${String(this.#u.pad_bottom)} w:${String(this.#u.$width)} h:${String(this.#u.$height)}`), this.#o.clear().beginFill(3407616, .2).lineStyle(1, 3407616, 1).drawRect(-this.#u.pad_left, -this.#u.pad_top, this.#u.$width, this.#u.$height).endFill().beginFill(13311, .2).lineStyle(2, 13311, 1).drawRect(0, 0, this.#u.$width - this.#u.pad_left - this.#u.pad_right, this.#u.$height - this.#u.pad_top - this.#u.pad_bottom).endFill()), this.#i.innerHTML = [...e].join("").replaceAll(/[\n\t]/g, "") + t.#b, !this.#c.break_fixed) {
|
|
485
|
+
let e = globalThis.getComputedStyle(this.#i), t = parseFloat(e.fontSize);
|
|
486
|
+
this.#m ? (this.#c.break_fixed_left = (this.#u.$width - this.#u.pad_left - this.#u.pad_right - t * 1.5) * this.sys.cvsScale, this.#c.break_fixed_top = 0) : (this.#c.break_fixed_left = 0, this.#c.break_fixed_top = t / 2 * this.sys.cvsScale);
|
|
481
487
|
}
|
|
482
|
-
} else
|
|
488
|
+
} else i = this.#i.innerHTML, --r, this.#i.getElementsByClassName("sn_ch_last").item(0)?.remove(), this.#i.querySelectorAll(":scope > br").forEach((e) => e.remove()), this.#i.insertAdjacentHTML("beforeend", e.slice(this.#y).join("").replaceAll(/[\n\t]/g, "") + t.#b);
|
|
483
489
|
this.#i.querySelectorAll(".sn_ch:has(> ruby)").forEach((e) => {
|
|
484
490
|
e.style.background = "";
|
|
485
491
|
}), this.#y = e.length;
|
|
486
|
-
let
|
|
487
|
-
if (
|
|
488
|
-
let
|
|
489
|
-
return new
|
|
492
|
+
let a = this.sys.cvsScale, c = this.#i.getBoundingClientRect(), f = c.left + this.#u.pad_left, p = c.top + this.#u.pad_top, m;
|
|
493
|
+
if (a === 1) m = (e, t) => {
|
|
494
|
+
let n = e.getBoundingClientRect();
|
|
495
|
+
return new l(n.left - f, n.top - p, n.width, n.height + ("gjqy".includes(t) ? this.#d : 0));
|
|
490
496
|
};
|
|
491
497
|
else {
|
|
492
|
-
let e = this.sys.ofsPadLeft_Dom2PIXI +
|
|
493
|
-
|
|
494
|
-
let
|
|
495
|
-
return new
|
|
498
|
+
let e = this.sys.ofsPadLeft_Dom2PIXI + c.left * (1 - a), t = this.sys.ofsPadTop_Dom2PIXI + c.top * (1 - a);
|
|
499
|
+
m = (n, r) => {
|
|
500
|
+
let i = n.getBoundingClientRect();
|
|
501
|
+
return new l((i.left - e) / a - f, (i.top - t) / a - p, i.width / a, (i.height + ("gjqy".includes(r) ? this.#d : 0)) / a);
|
|
496
502
|
};
|
|
497
503
|
}
|
|
498
|
-
let [
|
|
499
|
-
this.#v =
|
|
500
|
-
let
|
|
501
|
-
for (let e =
|
|
502
|
-
let
|
|
503
|
-
if (this.#l(
|
|
504
|
-
let e = new
|
|
505
|
-
this.#a.addChild(e), new
|
|
506
|
-
this.#C(e,
|
|
504
|
+
let [h, g] = this.#c.hyph(this.#i, m, this.#m, r, i);
|
|
505
|
+
this.#v = h;
|
|
506
|
+
let _ = v.ease(this.#A);
|
|
507
|
+
for (let e = r; e < g; ++e) {
|
|
508
|
+
let n = this.#v[e], { elm: { dataset: r, parentElement: i }, rect: a } = n, s = JSON.parse(r.arg ?? "{\"delay\": 0}"), c = JSON.parse(r.add ?? "{}"), l = t.#T[c.ch_in_style];
|
|
509
|
+
if (this.#l(n), r.cmd === "grp") {
|
|
510
|
+
let e = new u();
|
|
511
|
+
this.#a.addChild(e), new b(s.pic, e, (t) => {
|
|
512
|
+
this.#C(e, s, c, a, _, l ?? {}), e.parent || e.removeChild(t);
|
|
507
513
|
});
|
|
508
514
|
}
|
|
509
|
-
if (
|
|
510
|
-
let
|
|
511
|
-
|
|
512
|
-
let
|
|
513
|
-
this.#C(
|
|
514
|
-
let
|
|
515
|
-
for (let e of
|
|
516
|
-
let
|
|
517
|
-
|
|
518
|
-
for (let e of
|
|
515
|
+
if (r.lnk) {
|
|
516
|
+
let n = i.closest("[data-arg]"), r = JSON.parse(n.dataset.arg ?? "{}");
|
|
517
|
+
r.key = `lnk=[${String(e)}] ` + this.name;
|
|
518
|
+
let s = new d();
|
|
519
|
+
this.#C(s, r, c, a, _, l ?? {});
|
|
520
|
+
let u = r.style ?? "", f = u + (r.style_hover ?? ""), p = u + (r.style_clicked ?? ""), m = r.r_style ?? "", h = m + (r.r_style_hover ?? ""), g = m + (r.r_style_clicked ?? ""), v = Array.from(n.getElementsByTagName("rt"));
|
|
521
|
+
for (let e of v) e.dataset.st_r_bk = e.style.cssText;
|
|
522
|
+
let y = n.style.cssText, b = (e, t) => {
|
|
523
|
+
n.style.cssText = y + e;
|
|
524
|
+
for (let e of v) e.style.cssText = e.dataset.st_r_bk + t;
|
|
519
525
|
};
|
|
520
|
-
|
|
526
|
+
o(r, "enabled", !0) ? t.#n.button(r, s, () => b(u, m), () => this.canFocus() ? (b(f, h), !0) : !1, () => b(p, g)) : b(u + (r.style_disable ?? "color: gray;"), m + (r.r_style_disable ?? "color: gray;")), this.#a.addChild(s);
|
|
521
527
|
}
|
|
522
528
|
}
|
|
523
|
-
let
|
|
529
|
+
let y = Array.from(this.#i.getElementsByClassName("sn_ch_yet"));
|
|
524
530
|
this.#S = () => {
|
|
525
531
|
this.#S = () => !1;
|
|
526
|
-
for (let e of
|
|
527
|
-
|
|
532
|
+
for (let e of y) e.className = "sn_ch";
|
|
533
|
+
t.#O.position.set(this.#c.break_fixed_left, this.#c.break_fixed_top), t.#O.visible = !0, this.noticeCompTxt();
|
|
528
534
|
let e = this.#_.shift();
|
|
529
535
|
return this.#_.length > 0 && e(), !0;
|
|
530
536
|
};
|
|
531
|
-
for (let e of
|
|
532
|
-
|
|
533
|
-
let
|
|
534
|
-
for (let e =
|
|
535
|
-
let { elm:
|
|
536
|
-
if (
|
|
537
|
-
|
|
537
|
+
for (let e of y) e.className = e.className.replace("sn_ch_yet sn", "go");
|
|
538
|
+
r > 0 && ++r;
|
|
539
|
+
let x;
|
|
540
|
+
for (let e = g - 2; e >= 0; --e) {
|
|
541
|
+
let { elm: t } = this.#v[e];
|
|
542
|
+
if (t.tagName === "SPAN") {
|
|
543
|
+
x = t.parentElement?.tagName === "RUBY" ? t.parentElement.parentElement ?? t : t;
|
|
538
544
|
break;
|
|
539
545
|
}
|
|
540
546
|
}
|
|
541
|
-
if (!
|
|
547
|
+
if (!x || n || r === g) {
|
|
542
548
|
this.#S();
|
|
543
549
|
return;
|
|
544
550
|
}
|
|
545
|
-
let
|
|
546
|
-
|
|
551
|
+
let S = () => {
|
|
552
|
+
x.removeEventListener("animationend", S), this.#S();
|
|
547
553
|
};
|
|
548
|
-
|
|
554
|
+
x.addEventListener("animationend", S, {
|
|
549
555
|
once: !0,
|
|
550
556
|
signal: this.#M.signal
|
|
551
557
|
});
|
|
552
558
|
}
|
|
553
559
|
#S = () => !1;
|
|
554
|
-
#C(e,
|
|
555
|
-
e.alpha = 0,
|
|
556
|
-
let
|
|
560
|
+
#C(e, n, r, i, a, o) {
|
|
561
|
+
e.alpha = 0, n.x && (i.x = n.x.startsWith("=") ? i.x + parseInt(n.x.slice(1)) : parseInt(n.x)), n.y && (i.y = n.y.startsWith("=") ? i.y + parseInt(n.y.slice(1)) : parseInt(n.y)), n.width && (i.width = parseInt(n.width)), n.height && (i.height = parseInt(n.height)), n.wait && (o.wait = n.wait), e.width = i.width, e.height = i.height, o.x ? e.position.set(o.x.startsWith("=") ? i.x + e.width * o.nx : o.nx, o.y.startsWith("=") ? i.y + e.height * o.ny : o.ny) : e.position.set(i.x, i.y);
|
|
562
|
+
let s = new _(e).to({
|
|
557
563
|
alpha: 1,
|
|
558
|
-
x:
|
|
559
|
-
y:
|
|
560
|
-
width:
|
|
561
|
-
height:
|
|
564
|
+
x: i.x,
|
|
565
|
+
y: i.y,
|
|
566
|
+
width: i.width,
|
|
567
|
+
height: i.height,
|
|
562
568
|
angle: 0
|
|
563
|
-
},
|
|
564
|
-
|
|
569
|
+
}, o.wait ?? 0).easing(a).delay((r.wait ?? 0) + (n.delay ?? 0)).onComplete(() => {
|
|
570
|
+
c.tw = void 0;
|
|
565
571
|
}).start();
|
|
566
|
-
|
|
567
|
-
let
|
|
572
|
+
t.grp.add(s);
|
|
573
|
+
let c = {
|
|
568
574
|
sp: e,
|
|
569
|
-
tw:
|
|
575
|
+
tw: s
|
|
570
576
|
};
|
|
571
|
-
this.#w.push(
|
|
577
|
+
this.#w.push(c);
|
|
572
578
|
}
|
|
573
579
|
#w = [];
|
|
574
580
|
skipChIn() {
|
|
575
581
|
let e = this.#S();
|
|
576
|
-
for (let
|
|
582
|
+
for (let t of this.#w) t.tw && (t.tw.stop().end(), e = !0);
|
|
577
583
|
return this.#w = [], e;
|
|
578
584
|
}
|
|
579
585
|
static #T = Object.create(null);
|
|
580
586
|
static #E = /[{\s.,*{]/;
|
|
581
587
|
static initChStyle() {
|
|
582
|
-
|
|
588
|
+
t.#T = Object.create(null), t.#D = Object.create(null);
|
|
583
589
|
}
|
|
584
590
|
static getChInStyle(e) {
|
|
585
|
-
return
|
|
591
|
+
return t.#T[e];
|
|
586
592
|
}
|
|
587
593
|
static ch_in_style(e) {
|
|
588
|
-
let { name:
|
|
589
|
-
if (!
|
|
590
|
-
if (
|
|
591
|
-
if (
|
|
592
|
-
let
|
|
593
|
-
return
|
|
594
|
-
wait:
|
|
595
|
-
alpha:
|
|
596
|
-
x:
|
|
597
|
-
y:
|
|
598
|
-
nx: parseFloat(
|
|
599
|
-
ny: parseFloat(
|
|
600
|
-
scale_x:
|
|
601
|
-
scale_y:
|
|
602
|
-
rotate:
|
|
603
|
-
join:
|
|
594
|
+
let { name: n } = e;
|
|
595
|
+
if (!n) throw "nameは必須です";
|
|
596
|
+
if (t.#E.test(n)) throw `name【${n}】に使えない文字が含まれます`;
|
|
597
|
+
if (n in t.#T) throw `name【${n}】はすでにあります`;
|
|
598
|
+
let r = String(e.x ?? "=0"), a = String(e.y ?? "=0");
|
|
599
|
+
return t.#T[n] = {
|
|
600
|
+
wait: i(e, "wait", 500),
|
|
601
|
+
alpha: i(e, "alpha", 0),
|
|
602
|
+
x: r,
|
|
603
|
+
y: a,
|
|
604
|
+
nx: parseFloat(r.at(0) === "=" ? r.slice(1) : r),
|
|
605
|
+
ny: parseFloat(a.at(0) === "=" ? a.slice(1) : a),
|
|
606
|
+
scale_x: i(e, "scale_x", 1),
|
|
607
|
+
scale_y: i(e, "scale_y", 1),
|
|
608
|
+
rotate: i(e, "rotate", 0),
|
|
609
|
+
join: o(e, "join", !0),
|
|
604
610
|
ease: e.ease ?? "ease-out"
|
|
605
611
|
};
|
|
606
612
|
}
|
|
607
613
|
static #D = Object.create(null);
|
|
608
614
|
static getChOutStyle(e) {
|
|
609
|
-
return
|
|
615
|
+
return t.#D[e];
|
|
610
616
|
}
|
|
611
617
|
static ch_out_style(e) {
|
|
612
|
-
let { name:
|
|
613
|
-
if (!
|
|
614
|
-
if (
|
|
615
|
-
if (
|
|
616
|
-
let
|
|
617
|
-
return
|
|
618
|
-
wait:
|
|
619
|
-
alpha:
|
|
620
|
-
x:
|
|
621
|
-
y:
|
|
622
|
-
nx: parseFloat(
|
|
623
|
-
ny: parseFloat(
|
|
624
|
-
scale_x:
|
|
625
|
-
scale_y:
|
|
626
|
-
rotate:
|
|
627
|
-
join:
|
|
618
|
+
let { name: n } = e;
|
|
619
|
+
if (!n) throw "nameは必須です";
|
|
620
|
+
if (t.#E.test(n)) throw `name【${n}】に使えない文字が含まれます`;
|
|
621
|
+
if (n in t.#D) throw `name【${n}】はすでにあります`;
|
|
622
|
+
let r = String(e.x ?? "=0"), a = String(e.y ?? "=0");
|
|
623
|
+
return t.#D[n] = {
|
|
624
|
+
wait: i(e, "wait", 500),
|
|
625
|
+
alpha: i(e, "alpha", 0),
|
|
626
|
+
x: r,
|
|
627
|
+
y: a,
|
|
628
|
+
nx: parseFloat(r.at(0) === "=" ? r.slice(1) : r),
|
|
629
|
+
ny: parseFloat(a.at(0) === "=" ? a.slice(1) : a),
|
|
630
|
+
scale_x: i(e, "scale_x", 1),
|
|
631
|
+
scale_y: i(e, "scale_y", 1),
|
|
632
|
+
rotate: i(e, "rotate", 0),
|
|
633
|
+
join: o(e, "join", !1),
|
|
628
634
|
ease: e.ease ?? "ease-out"
|
|
629
635
|
};
|
|
630
636
|
}
|
|
631
|
-
static #O = new
|
|
632
|
-
static #k = new
|
|
637
|
+
static #O = new u();
|
|
638
|
+
static #k = new b();
|
|
633
639
|
dispBreak(e) {
|
|
634
|
-
|
|
635
|
-
let
|
|
636
|
-
|
|
637
|
-
|
|
640
|
+
t.delBreak();
|
|
641
|
+
let n = t.#O;
|
|
642
|
+
n.visible = !1, this.addChild(n), t.#k.destroy(), t.#k = new b(e.pic, n, (t) => {
|
|
643
|
+
n.parent ? (t.x = i(e, "x", 0), t.y = i(e, "y", 0), t.width = i(e, "width", this.#u.fontsize), t.height = i(e, "height", this.#u.fontsize)) : n.removeChild(t);
|
|
638
644
|
});
|
|
639
645
|
}
|
|
640
646
|
static delBreak() {
|
|
641
|
-
let e =
|
|
642
|
-
e.parent?.removeChild(e),
|
|
647
|
+
let e = t.#O;
|
|
648
|
+
e.parent?.removeChild(e), t.#k.destroy();
|
|
643
649
|
}
|
|
644
650
|
#A = "Quadratic.Out";
|
|
645
651
|
#j = "Quadratic.Out";
|
|
@@ -648,43 +654,43 @@ var TxtStage = class p extends Container {
|
|
|
648
654
|
this.#o.clear(), this.#v = [], this.#y = 0, this.#_ = [], this.#M.abort(), this.#M = new AbortController(), this.skipChIn();
|
|
649
655
|
let e = document.createElement("span");
|
|
650
656
|
e.style.cssText = this.#i.style.cssText, e.classList.value = this.#i.classList.value;
|
|
651
|
-
let
|
|
652
|
-
|
|
653
|
-
let
|
|
654
|
-
|
|
655
|
-
let
|
|
656
|
-
if (!
|
|
657
|
-
let
|
|
658
|
-
if (
|
|
659
|
-
if (
|
|
657
|
+
let n = this.#i, r = Array.from(n.getElementsByClassName("sn_ch"));
|
|
658
|
+
n.parentElement.insertBefore(e, n);
|
|
659
|
+
let i = 0;
|
|
660
|
+
r.forEach((e) => {
|
|
661
|
+
let n = JSON.parse(e.dataset.add ?? e.children[0]?.getAttribute("data-add") ?? e.children[0]?.children[0]?.getAttribute("data-add") ?? "{}");
|
|
662
|
+
if (!n.ch_out_style) return;
|
|
663
|
+
let r = t.#D[n.ch_out_style];
|
|
664
|
+
if (r) {
|
|
665
|
+
if (r.wait === 0) {
|
|
660
666
|
e.style.display = "none";
|
|
661
667
|
return;
|
|
662
668
|
}
|
|
663
|
-
|
|
669
|
+
i += r.wait, r.join || (e.style.animationDelay = "0ms"), e.classList.add(`go_ch_out_${String(n.ch_out_style)}`);
|
|
664
670
|
}
|
|
665
671
|
});
|
|
666
|
-
let
|
|
667
|
-
|
|
668
|
-
for (let e of this.#a.removeChildren()) e instanceof
|
|
672
|
+
let a = () => {
|
|
673
|
+
n.parentElement.removeChild(n);
|
|
674
|
+
for (let e of this.#a.removeChildren()) e instanceof u && t.#n.unButton(e), e.destroy();
|
|
669
675
|
};
|
|
670
|
-
if (
|
|
676
|
+
if (i === 0) this.#i.textContent = "", this.#i = document.createElement("span"), a();
|
|
671
677
|
else {
|
|
672
|
-
let e =
|
|
678
|
+
let e = n.lastElementChild;
|
|
673
679
|
if (e) {
|
|
674
|
-
let
|
|
675
|
-
e.removeEventListener("animationend",
|
|
680
|
+
let t = () => {
|
|
681
|
+
e.removeEventListener("animationend", t), a();
|
|
676
682
|
};
|
|
677
|
-
e.addEventListener("animationend",
|
|
683
|
+
e.addEventListener("animationend", t, {
|
|
678
684
|
once: !0,
|
|
679
685
|
signal: this.#M.signal
|
|
680
686
|
});
|
|
681
|
-
} else
|
|
687
|
+
} else a();
|
|
682
688
|
}
|
|
683
689
|
this.#i = e;
|
|
684
690
|
}
|
|
685
691
|
reNew() {
|
|
686
692
|
this.#N();
|
|
687
|
-
let e = new
|
|
693
|
+
let e = new t(this.ctn, this.canFocus, this.sys);
|
|
688
694
|
return e.#u = this.#u, e.#i.style.cssText = this.#i.style.cssText, e.#p = this.#p, e.name = this.name, e.#f(), e.#P = this.#P, e.#A = this.#A, e.#j = this.#j, this.#c.reNew(e.#c), this.destroy(), e;
|
|
689
695
|
}
|
|
690
696
|
#P = void 0;
|
|
@@ -709,9 +715,9 @@ var TxtStage = class p extends Container {
|
|
|
709
715
|
this.#i.style.cssText = e;
|
|
710
716
|
}
|
|
711
717
|
#F = void 0;
|
|
712
|
-
snapshot(e,
|
|
713
|
-
|
|
714
|
-
this.#F =
|
|
718
|
+
snapshot(e, t) {
|
|
719
|
+
M((n) => {
|
|
720
|
+
this.#F = d.from(n), this.#m && (this.#F.x += s.stageW - (this.#p + this.#u.$width)), this.#F.y -= this.#g, this.#F.texture.frame = new l(0, 0, Math.min(this.#F.width, this.#u.$width - this.#p), Math.min(this.#F.height, this.#u.$height)), this.#a.addChild(this.#F), e.render(this.#F, { clear: !1 }), t();
|
|
715
721
|
}, this.#i, this.#u, this.#h, this.#g, !1);
|
|
716
722
|
}
|
|
717
723
|
snapshot_end() {
|
|
@@ -720,30 +726,30 @@ var TxtStage = class p extends Container {
|
|
|
720
726
|
makeDesignCast(e) {}
|
|
721
727
|
showDesignCast() {}
|
|
722
728
|
dump() {
|
|
723
|
-
let e = [],
|
|
724
|
-
for (let
|
|
725
|
-
let
|
|
726
|
-
e.push(`"${String(
|
|
729
|
+
let e = [], t = this.#i.style, n = t.length;
|
|
730
|
+
for (let r = 0; r < n; ++r) {
|
|
731
|
+
let n = t[r];
|
|
732
|
+
e.push(`"${String(n)}":"${t[n].replaceAll(/(["\\])/g, "\\$1")}"`);
|
|
727
733
|
}
|
|
728
734
|
return `"txt":"${this.#i.textContent.replaceAll(/(["\\])/g, "\\$1")}", "style":{${e.join(",")}}`;
|
|
729
735
|
}
|
|
730
736
|
destroy() {
|
|
731
|
-
|
|
737
|
+
t.delBreak(), this.#i.parentElement.removeChild(this.#i), this.#i = document.createElement("span"), this.removeChild(this.#a), this.removeChild(this.#o), this.#o.clear(), this.#l = () => {}, this.#_ = [], this.#v = [], this.#y = 0, this.#w = [], this.#M.abort(), this.#P = void 0, super.destroy();
|
|
732
738
|
}
|
|
733
|
-
},
|
|
739
|
+
}, P = class e extends h {
|
|
734
740
|
static #e;
|
|
735
741
|
static #t;
|
|
736
742
|
static #n;
|
|
737
743
|
static #r;
|
|
738
|
-
static init(e,
|
|
739
|
-
this.#e = e,
|
|
744
|
+
static init(e, t, r, i, o, s) {
|
|
745
|
+
this.#e = e, N.init(e, s), this.#t = r, this.#r = i, this.#n = o, r.setDoRecProc((e) => this.chgDoRec(e)), t.autowc = (e) => this.#d(e), t.autowc({
|
|
740
746
|
enabled: !1,
|
|
741
747
|
text: "",
|
|
742
748
|
time: 0
|
|
743
|
-
}),
|
|
749
|
+
}), t.ch_in_style = (e) => this.#i(e), t.ch_out_style = (e) => this.#a(e), N.initChStyle(), n(), a(e.matchPath(".+", p.FONT).flatMap((e) => Object.values(e).map((e) => `
|
|
744
750
|
@font-face {
|
|
745
751
|
font-family: '${String(e)}';
|
|
746
|
-
src: url('${this.#e.searchPath(String(e),
|
|
752
|
+
src: url('${this.#e.searchPath(String(e), p.FONT)}');
|
|
747
753
|
}
|
|
748
754
|
`)).join("") + "\n.sn_tx {\n pointer-events: none;\n user-select: none;\n -webkit-touch-callout: none;\n box-sizing: border-box;\n}\n.sn_ch {\n position: relative;\n display: inline-block;\n}\n"), this.#i({
|
|
749
755
|
name: "default",
|
|
@@ -770,64 +776,64 @@ var TxtStage = class p extends Container {
|
|
|
770
776
|
});
|
|
771
777
|
}
|
|
772
778
|
static #i(e) {
|
|
773
|
-
let { x:
|
|
774
|
-
return
|
|
775
|
-
.sn_ch_in_${
|
|
779
|
+
let { x: t, y: n, nx: r, ny: i, alpha: o, wait: s, ease: c, rotate: l, scale_x: u, scale_y: d } = N.ch_in_style(e), f = t.startsWith("=") ? `${String(r * 100)}%` : `${String(r)}px`, p = n.startsWith("=") ? `${String(i * 100)}%` : `${String(i)}px`, { name: m = "" } = e;
|
|
780
|
+
return a(`
|
|
781
|
+
.sn_ch_in_${m} {
|
|
776
782
|
position: relative;
|
|
777
783
|
display: inline-block;
|
|
778
784
|
}
|
|
779
|
-
.go_ch_in_${
|
|
780
|
-
opacity: ${String(
|
|
785
|
+
.go_ch_in_${m} {
|
|
786
|
+
opacity: ${String(o)};
|
|
781
787
|
position: relative;
|
|
782
788
|
display: inline-block;
|
|
783
|
-
animation: sn_ch_in_${
|
|
789
|
+
animation: sn_ch_in_${m} ${String(s)}ms ${c} 0s both;
|
|
784
790
|
}
|
|
785
|
-
@keyframes sn_ch_in_${
|
|
786
|
-
from {transform: rotate(${String(
|
|
791
|
+
@keyframes sn_ch_in_${m} {
|
|
792
|
+
from {transform: rotate(${String(l)}deg) scale(${String(u)}, ${String(d)}) translate(${f}, ${p})}
|
|
787
793
|
to {opacity: 1; transform: none;}
|
|
788
794
|
}
|
|
789
795
|
`), !1;
|
|
790
796
|
}
|
|
791
797
|
static #a(e) {
|
|
792
|
-
let { x:
|
|
793
|
-
return
|
|
794
|
-
.go_ch_out_${
|
|
798
|
+
let { x: t, y: n, nx: r, ny: i, alpha: o, wait: s, ease: c, rotate: l, scale_x: u, scale_y: d } = N.ch_out_style(e), f = t.startsWith("=") ? `${String(r * 100)}%` : `${String(r)}px`, p = n.startsWith("=") ? `${String(i * 100)}%` : `${String(i)}px`, { name: m = "" } = e;
|
|
799
|
+
return a(`
|
|
800
|
+
.go_ch_out_${m} {
|
|
795
801
|
position: relative;
|
|
796
802
|
display: inline-block;
|
|
797
|
-
animation: go_ch_out_${
|
|
803
|
+
animation: go_ch_out_${m} ${String(s)}ms ${c} 0s both;
|
|
798
804
|
}
|
|
799
|
-
@keyframes go_ch_out_${
|
|
805
|
+
@keyframes go_ch_out_${m} {
|
|
800
806
|
to {
|
|
801
|
-
opacity: ${String(
|
|
802
|
-
transform: rotate(${String(
|
|
807
|
+
opacity: ${String(o)};
|
|
808
|
+
transform: rotate(${String(l)}deg) scale(${String(u)}, ${String(d)}) translate(${f}, ${p});
|
|
803
809
|
}
|
|
804
810
|
`), !1;
|
|
805
811
|
}
|
|
806
812
|
static #o = 10;
|
|
807
|
-
static set msecChWait(
|
|
808
|
-
e.#o =
|
|
813
|
+
static set msecChWait(t) {
|
|
814
|
+
e.#o = t;
|
|
809
815
|
}
|
|
810
816
|
static get msecChWait() {
|
|
811
817
|
return e.#o;
|
|
812
818
|
}
|
|
813
819
|
static #s;
|
|
814
820
|
static #c;
|
|
815
|
-
static setEvtMng(e,
|
|
816
|
-
this.#s = e, this.#c =
|
|
821
|
+
static setEvtMng(e, t, n) {
|
|
822
|
+
this.#s = e, this.#c = t, N.setEvtMng(e, n);
|
|
817
823
|
}
|
|
818
824
|
static #l = !1;
|
|
819
825
|
static #u = {};
|
|
820
826
|
static #d(e) {
|
|
821
|
-
this.#l =
|
|
822
|
-
let { text:
|
|
827
|
+
this.#l = o(e, "enabled", this.#l), this.#t.setVal_Nochk("save", "const.sn.autowc.enabled", this.#l);
|
|
828
|
+
let { text: t } = e;
|
|
823
829
|
if ("text" in e != "time" in e) throw "[autowc] textとtimeは同時指定必須です";
|
|
824
|
-
if (this.#t.setVal_Nochk("save", "const.sn.autowc.text",
|
|
825
|
-
let
|
|
826
|
-
if (this.#l &&
|
|
827
|
-
let
|
|
828
|
-
if (
|
|
830
|
+
if (this.#t.setVal_Nochk("save", "const.sn.autowc.text", t), !t) return this.#t.setVal_Nochk("save", "const.sn.autowc.time", ""), !1;
|
|
831
|
+
let n = t.length;
|
|
832
|
+
if (this.#l && n === 0) throw "[autowc] enabled === false かつ text === \"\" は許されません";
|
|
833
|
+
let i = String(e.time).split(",");
|
|
834
|
+
if (i.length !== n) throw "[autowc] text文字数とtimeに記述された待ち時間(コンマ区切り)は同数にして下さい";
|
|
829
835
|
this.#u = {};
|
|
830
|
-
for (let e = 0; e <
|
|
836
|
+
for (let e = 0; e < n; ++e) this.#u[t[e]] = r(i[e]);
|
|
831
837
|
return this.#t.setVal_Nochk("save", "const.sn.autowc.time", e.time), !1;
|
|
832
838
|
}
|
|
833
839
|
#f = 0;
|
|
@@ -835,8 +841,8 @@ var TxtStage = class p extends Container {
|
|
|
835
841
|
#m = !1;
|
|
836
842
|
#h = void 0;
|
|
837
843
|
#g = "";
|
|
838
|
-
#_ = new
|
|
839
|
-
#v = new
|
|
844
|
+
#_ = new N(this.ctn, () => this.canFocus(), e.#c);
|
|
845
|
+
#v = new S();
|
|
840
846
|
#y = document.createElement("span");
|
|
841
847
|
static #b = {
|
|
842
848
|
"text-align": 0,
|
|
@@ -848,10 +854,10 @@ var TxtStage = class p extends Container {
|
|
|
848
854
|
"padding-top": 0,
|
|
849
855
|
"padding-bottom": 0
|
|
850
856
|
};
|
|
851
|
-
#x = new
|
|
857
|
+
#x = new u();
|
|
852
858
|
constructor() {
|
|
853
859
|
super(), this.ctn.addChild(this.#_), this.#v.init(this.#B), this.ctn.addChild(this.#x), this.#x.name = "cntBtn", this.lay({
|
|
854
|
-
style: `width: ${String(
|
|
860
|
+
style: `width: ${String(s.stageW)}px; height: ${String(s.stageH)}px; font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', '游ゴシック Medium', meiryo, sans-serif; color: white; font-size: 24px; line-height: 1.5; padding: 16px;`,
|
|
855
861
|
in_style: "default",
|
|
856
862
|
out_style: "default",
|
|
857
863
|
back_clear: "true"
|
|
@@ -881,34 +887,34 @@ var TxtStage = class p extends Container {
|
|
|
881
887
|
procSetY(e) {
|
|
882
888
|
this.#_.lay({ y: e });
|
|
883
889
|
}
|
|
884
|
-
lay(
|
|
885
|
-
if (super.lay(
|
|
886
|
-
let
|
|
887
|
-
|
|
888
|
-
let
|
|
889
|
-
for (let
|
|
890
|
-
let
|
|
891
|
-
if (
|
|
892
|
-
|
|
890
|
+
lay(t) {
|
|
891
|
+
if (super.lay(t), h.setXY(this.ctn, t, this.ctn), t[":id_tag"] = this.name_.slice(0, -7), S.setting(t), this.#k(t), this.#_.lay(t), "r_align" in t && (this.#L = t.r_align ?? ""), this.#F = s.isSafari ? this.#_.tategaki ? (e, t) => `text-align: start; height: ${String(t)}em; padding-top: ${e}; padding-bottom: ${e};` : (e, t) => `text-align: start; width: ${String(t)}em; padding-left: ${e}; padding-right: ${e};` : this.#_.tategaki ? (e) => `text-align: justify; text-align-last: justify; padding-top: ${e}; padding-bottom: ${e};` : (e) => `text-align: justify; text-align-last: justify; padding-left: ${e}; padding-right: ${e};`, s.isFirefox && (this.#I = this.#R), "r_style" in t) if (t.r_style) {
|
|
892
|
+
let n = document.createElement("span");
|
|
893
|
+
n.style.cssText = t.r_style;
|
|
894
|
+
let r = n.style.length, i = this.#y.style;
|
|
895
|
+
for (let t = 0; t < r; ++t) {
|
|
896
|
+
let r = n.style[t];
|
|
897
|
+
if (r in e.#b) {
|
|
898
|
+
m.myTrace(`${String(r)}は指定できません`, "W");
|
|
893
899
|
continue;
|
|
894
900
|
}
|
|
895
|
-
let
|
|
896
|
-
|
|
901
|
+
let a = n.style[r];
|
|
902
|
+
a && (i[r] = a);
|
|
897
903
|
}
|
|
898
904
|
} else this.#y.style.cssText = "";
|
|
899
|
-
if ("alpha" in
|
|
900
|
-
this.#S(
|
|
901
|
-
let
|
|
902
|
-
e &&
|
|
905
|
+
if ("alpha" in t) for (let e of this.#x.children) e.alpha = this.ctn.alpha;
|
|
906
|
+
this.#S(t), this.#T(t);
|
|
907
|
+
let n = y.procID + `TxtLayer lay name:${this.name_}`, r = this.#O(t, (e) => {
|
|
908
|
+
e && y.endProc(n);
|
|
903
909
|
});
|
|
904
|
-
return
|
|
910
|
+
return r && y.beginProc(n), r;
|
|
905
911
|
}
|
|
906
912
|
#S(e) {
|
|
907
|
-
let { in_style:
|
|
908
|
-
if (!
|
|
909
|
-
let
|
|
910
|
-
if (!
|
|
911
|
-
this.#C =
|
|
913
|
+
let { in_style: t } = e;
|
|
914
|
+
if (!t) return;
|
|
915
|
+
let n = N.getChInStyle(t);
|
|
916
|
+
if (!n) throw `存在しないin_style【${t}】です`;
|
|
917
|
+
this.#C = t, this.#w = n.join;
|
|
912
918
|
}
|
|
913
919
|
#C = "";
|
|
914
920
|
#w = !0;
|
|
@@ -919,31 +925,31 @@ var TxtStage = class p extends Container {
|
|
|
919
925
|
return this.#_.getHeight;
|
|
920
926
|
}
|
|
921
927
|
#T(e) {
|
|
922
|
-
let { out_style:
|
|
923
|
-
if (
|
|
924
|
-
if (!
|
|
925
|
-
this.#E =
|
|
928
|
+
let { out_style: t } = e;
|
|
929
|
+
if (t) {
|
|
930
|
+
if (!N.getChOutStyle(t)) throw `存在しないout_style【${t}】です`;
|
|
931
|
+
this.#E = t;
|
|
926
932
|
}
|
|
927
933
|
}
|
|
928
934
|
#E = "";
|
|
929
|
-
#D = new
|
|
930
|
-
#O(
|
|
931
|
-
if ("back_clear" in
|
|
932
|
-
this.#p =
|
|
933
|
-
let
|
|
934
|
-
if (
|
|
935
|
-
if (this.#g !==
|
|
936
|
-
this.#h = e, e.name = "back(pic)", e.visible =
|
|
935
|
+
#D = new b();
|
|
936
|
+
#O(n, r) {
|
|
937
|
+
if ("back_clear" in n) return o(n, "back_clear", !1) && (this.#f = 0, this.#p = 0, this.#m = !1, this.#g = ""), r(!1), !1;
|
|
938
|
+
this.#p = i(n, "b_alpha", this.#p), this.#m = o(n, "b_alpha_isfixed", this.#m);
|
|
939
|
+
let a = (this.#m ? 1 : Number(e.#t.getVal("sys:TextLayer.Back.Alpha"))) * this.#p;
|
|
940
|
+
if (n.b_pic) {
|
|
941
|
+
if (this.#g !== n.b_pic) return this.#g = n.b_pic, this.#h && (this.ctn.removeChild(this.#h), this.#h.destroy()), this.#D = new b(this.#g, this.ctn, (e) => {
|
|
942
|
+
this.#h = e, e.name = "back(pic)", e.visible = a > 0, e.alpha = a, this.#_.setMySize(e.width, e.height), this.ctn.setChildIndex(e, 0), r(!0);
|
|
937
943
|
}), this.#D.ret;
|
|
938
|
-
} else "b_color" in
|
|
939
|
-
return this.#h && (this.#h.visible =
|
|
944
|
+
} else "b_color" in n && (this.#f = t(n, "b_color", 0), this.#h && (this.ctn.removeChild(this.#h), this.#h.destroy()), this.#g = "", this.ctn.addChildAt((this.#h = new f()).beginFill(this.#f, a).lineStyle(void 0).drawRect(0, 0, this.#_.getWidth, this.#_.getHeight).endFill(), 0), this.#h.name = "back(color)");
|
|
945
|
+
return this.#h && (this.#h.visible = a > 0, this.#h.alpha = a), r(!1), !1;
|
|
940
946
|
}
|
|
941
947
|
chgBackAlpha(e) {
|
|
942
|
-
let
|
|
943
|
-
this.#h instanceof
|
|
948
|
+
let t = this.#m ? this.#p : e * this.#p;
|
|
949
|
+
this.#h instanceof f && (this.#h && (this.ctn.removeChild(this.#h), this.#h.destroy()), this.ctn.addChildAt((this.#h = new f()).beginFill(this.#f, t).lineStyle(void 0).drawRect(0, 0, this.#_.getWidth, this.#_.getHeight).endFill(), 0), this.#h.name = "back(color)"), this.#h && (this.#h.visible = t > 0, this.#h.alpha = t);
|
|
944
950
|
}
|
|
945
951
|
#k(e) {
|
|
946
|
-
"noffs" in e && (this.#M = e.noffs ?? "", this.#N =
|
|
952
|
+
"noffs" in e && (this.#M = e.noffs ?? "", this.#N = RegExp(`[ ${this.#M}]`)), "ffs" in e && (this.#A ??= "", this.#j = this.#A === "" ? () => "" : (e) => this.#N.test(e) ? "" : ` font-feature-settings: ${this.#A};`);
|
|
947
953
|
}
|
|
948
954
|
#A = "";
|
|
949
955
|
#j = (e) => "";
|
|
@@ -955,62 +961,62 @@ var TxtStage = class p extends Container {
|
|
|
955
961
|
static #P = (e) => e;
|
|
956
962
|
isCur = !1;
|
|
957
963
|
#F = () => "";
|
|
958
|
-
#I = (e,
|
|
959
|
-
if (!
|
|
960
|
-
let
|
|
961
|
-
if (
|
|
962
|
-
let
|
|
963
|
-
switch (
|
|
964
|
+
#I = (e, t, n, r = "") => {
|
|
965
|
+
if (!n) return ` style='${r}'`;
|
|
966
|
+
let i = e.length * 2;
|
|
967
|
+
if (i - t.length < 0) return ` style='text-align: ${n}; ${r}'`;
|
|
968
|
+
let a = "";
|
|
969
|
+
switch (n) {
|
|
964
970
|
case "justify":
|
|
965
|
-
|
|
971
|
+
a = this.#F("0", i);
|
|
966
972
|
break;
|
|
967
973
|
case "121":
|
|
968
|
-
|
|
974
|
+
a = this.#F(`calc(${String((i - t.length) / (t.length * 2))}em)`, i);
|
|
969
975
|
break;
|
|
970
976
|
case "even":
|
|
971
|
-
|
|
977
|
+
a = this.#F(`calc(${String((i - t.length) / (t.length + 1))}em)`, i);
|
|
972
978
|
break;
|
|
973
979
|
case "1ruby":
|
|
974
|
-
|
|
980
|
+
a = this.#F("1em", i);
|
|
975
981
|
break;
|
|
976
|
-
default:
|
|
982
|
+
default: a = `text-align: ${n};`;
|
|
977
983
|
}
|
|
978
|
-
return ` style='${
|
|
984
|
+
return ` style='${a} ${r}'`;
|
|
979
985
|
};
|
|
980
986
|
#L = "";
|
|
981
|
-
#R(e,
|
|
982
|
-
if (!
|
|
983
|
-
let
|
|
984
|
-
if (
|
|
985
|
-
let
|
|
986
|
-
switch (
|
|
987
|
+
#R(e, t, n, r = "") {
|
|
988
|
+
if (!n) return ` style='${r}'`;
|
|
989
|
+
let i = e.length * 2;
|
|
990
|
+
if (i - t.length < 0) return ` style='text-align: ${n}; ${r}'`;
|
|
991
|
+
let a = "";
|
|
992
|
+
switch (n) {
|
|
987
993
|
case "left":
|
|
988
|
-
|
|
994
|
+
a = "ruby-align: start;";
|
|
989
995
|
break;
|
|
990
996
|
case "center":
|
|
991
|
-
|
|
997
|
+
a = "ruby-align: center;";
|
|
992
998
|
break;
|
|
993
999
|
case "right":
|
|
994
|
-
|
|
1000
|
+
a = "ruby-align: start;";
|
|
995
1001
|
break;
|
|
996
1002
|
case "justify":
|
|
997
|
-
|
|
1003
|
+
a = "ruby-align: space-between;";
|
|
998
1004
|
break;
|
|
999
1005
|
case "121":
|
|
1000
|
-
|
|
1006
|
+
a = "ruby-align: space-around;";
|
|
1001
1007
|
break;
|
|
1002
1008
|
case "even":
|
|
1003
1009
|
{
|
|
1004
|
-
let e = ` ${String((
|
|
1005
|
-
|
|
1010
|
+
let e = ` ${String((i - t.length) / (t.length + 1))}em;`;
|
|
1011
|
+
a = "ruby-align: space-between; " + (this.#_.tategaki ? `padding-top:${e} padding-bottom:${e}` : `padding-left:${e} padding-right:${e}`);
|
|
1006
1012
|
}
|
|
1007
1013
|
break;
|
|
1008
1014
|
case "1ruby":
|
|
1009
|
-
|
|
1015
|
+
a = "ruby-align: space-between; " + (this.#_.tategaki ? "padding-top: 1em; padding-bottom: 1em;" : "padding-left: 1em; padding-right: 1em;");
|
|
1010
1016
|
break;
|
|
1011
|
-
default:
|
|
1017
|
+
default: a = `text-align: ${n};`;
|
|
1012
1018
|
}
|
|
1013
|
-
return ` style='${
|
|
1019
|
+
return ` style='${a} ${r}'`;
|
|
1014
1020
|
}
|
|
1015
1021
|
tagCh(e) {
|
|
1016
1022
|
this.#v.putTxt(e);
|
|
@@ -1019,20 +1025,20 @@ var TxtStage = class p extends Container {
|
|
|
1019
1025
|
get needGoTxt() {
|
|
1020
1026
|
return this.#z;
|
|
1021
1027
|
}
|
|
1022
|
-
#B = (
|
|
1023
|
-
let
|
|
1024
|
-
e.#e.oCfg.debug.putCh && console.log(`🖊 文字表示 text:\`${
|
|
1025
|
-
let
|
|
1026
|
-
switch (
|
|
1028
|
+
#B = (t, n) => {
|
|
1029
|
+
let i = n;
|
|
1030
|
+
e.#e.oCfg.debug.putCh && console.log(`🖊 文字表示 text:\`${t}\`(${t.charCodeAt(0).toString(16)}) ruby:\`${i}\` name:\`${this.name_}\``);
|
|
1031
|
+
let a = i.split("|"), o = "", [c, ...l] = a, u = l.join("|");
|
|
1032
|
+
switch (a.length) {
|
|
1027
1033
|
case 1:
|
|
1028
|
-
if (this.#z = !0,
|
|
1029
|
-
this.#W ? (this.#W = !1,
|
|
1034
|
+
if (this.#z = !0, t === "\n") {
|
|
1035
|
+
this.#W ? (this.#W = !1, o = "<ruby> <rt> </rt></ruby><br/>") : o = "<br/>";
|
|
1030
1036
|
break;
|
|
1031
1037
|
}
|
|
1032
|
-
this.#W && (this.#W = !1,
|
|
1038
|
+
this.#W && (this.#W = !1, i === "" && (i = " ")), o = this.#V(t, i, this.#L);
|
|
1033
1039
|
break;
|
|
1034
1040
|
default:
|
|
1035
|
-
switch (
|
|
1041
|
+
switch (c) {
|
|
1036
1042
|
case "start":
|
|
1037
1043
|
case "left":
|
|
1038
1044
|
case "center":
|
|
@@ -1041,15 +1047,15 @@ var TxtStage = class p extends Container {
|
|
|
1041
1047
|
case "121":
|
|
1042
1048
|
case "even":
|
|
1043
1049
|
case "1ruby":
|
|
1044
|
-
this.#W = !1, this.#z = !0,
|
|
1050
|
+
this.#W = !1, this.#z = !0, o = this.#V(t, u, c);
|
|
1045
1051
|
break;
|
|
1046
1052
|
case "gotxt":
|
|
1047
1053
|
this.#J(), this.#z ? (this.isCur && e.#r.recText(this.#G.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;'")), this.#_.goTxt(this.#G, this.#U === 0), this.#z = !1, this.#U = 0) : this.isCur && this.#_.noticeCompTxt();
|
|
1048
1054
|
return;
|
|
1049
1055
|
case "add":
|
|
1050
1056
|
{
|
|
1051
|
-
let e = JSON.parse(
|
|
1052
|
-
this.#G.push(`<span${
|
|
1057
|
+
let e = JSON.parse(u), { style: t = "", wait: n = null } = e, { cl: i, sty: a } = this.#H(!0, n ? r(n) : null);
|
|
1058
|
+
this.#G.push(`<span${i} style='${a} display: inline; ${t}'>`), delete e.style, this.#q(e);
|
|
1053
1059
|
}
|
|
1054
1060
|
return;
|
|
1055
1061
|
case "add_close":
|
|
@@ -1058,64 +1064,64 @@ var TxtStage = class p extends Container {
|
|
|
1058
1064
|
case "grp":
|
|
1059
1065
|
this.#z = !0;
|
|
1060
1066
|
{
|
|
1061
|
-
let e = JSON.parse(
|
|
1067
|
+
let e = JSON.parse(u);
|
|
1062
1068
|
if (e.id ??= String(this.#G.length), e.id === "break") {
|
|
1063
1069
|
this.#_.dispBreak(e);
|
|
1064
1070
|
return;
|
|
1065
1071
|
}
|
|
1066
1072
|
this.#W = !1, e.delay = this.#U, e.r ??= "", e.style ??= "", e.r_style ??= "";
|
|
1067
|
-
let { r:
|
|
1068
|
-
|
|
1073
|
+
let { r: t, wait: n = null, r_style: i } = e, { cl: a, sty: s, lnk: c } = this.#H(!0, n ? r(n) : null);
|
|
1074
|
+
o = `<span${a} style='${s} ${e.style}'><ruby><span data-cmd='grp' data-arg='${JSON.stringify(e)}'${c} style='${s} display: inline;'> </span><rt${c}${this.#I(" ", t, this.#L, this.#y.style.cssText + (this.#K.at(-1)?.o.r_style ?? "") + i)}>${e.r}</rt></ruby></span>`;
|
|
1069
1075
|
}
|
|
1070
1076
|
break;
|
|
1071
1077
|
case "tcy":
|
|
1072
1078
|
this.#W = !1, this.#z = !0;
|
|
1073
1079
|
{
|
|
1074
|
-
let { t:
|
|
1075
|
-
e.#t.doRecLog() && (this.#X +=
|
|
1076
|
-
let
|
|
1077
|
-
|
|
1080
|
+
let { t: n = "", r: a = "", wait: c = null, style: l = "", r_style: d = "" } = JSON.parse(u);
|
|
1081
|
+
e.#t.doRecLog() && (this.#X += t + (i ? `《${i}》` : ""), this.#Z += n);
|
|
1082
|
+
let f = s.isSafari ? a.replaceAll(/[A-Za-z0-9]/g, (e) => String.fromCharCode(e.charCodeAt(0) + 65248)) : a, { cl: p, sty: m, lnk: h } = this.#H(!0, c ? r(c) : null);
|
|
1083
|
+
o = `<span${p} style='${m}${this.#j(n)} ${l}'><ruby><span${h} style='${m} display: inline; text-combine-upright: all;'>${n}</span><rt${h}${this.#I(n, f, this.#L, this.#y.style.cssText + (this.#K.at(-1)?.o.r_style ?? "") + d)}>${f}</rt></ruby></span>`;
|
|
1078
1084
|
}
|
|
1079
1085
|
break;
|
|
1080
1086
|
case "del":
|
|
1081
|
-
|
|
1087
|
+
N.delBreak();
|
|
1082
1088
|
return;
|
|
1083
1089
|
case "span":
|
|
1084
|
-
this.#z = !0, this.#Y(JSON.parse(
|
|
1090
|
+
this.#z = !0, this.#Y(JSON.parse(u));
|
|
1085
1091
|
return;
|
|
1086
1092
|
case "link":
|
|
1087
1093
|
this.#z = !0;
|
|
1088
1094
|
{
|
|
1089
|
-
let e = JSON.parse(
|
|
1095
|
+
let e = JSON.parse(u);
|
|
1090
1096
|
e[":link"] = " data-lnk='@'";
|
|
1091
|
-
let { cl:
|
|
1092
|
-
this.#G.push(`<span${
|
|
1097
|
+
let { cl: t, sty: n, curpos: i } = this.#H(!1, e.wait ? r(e.wait) : null);
|
|
1098
|
+
this.#G.push(`<span${t} style='${n} display: inline; ${e.style ?? ""}' ${i} data-arg='${u}'>`), delete e.style, this.#Y(e);
|
|
1093
1099
|
}
|
|
1094
1100
|
return;
|
|
1095
1101
|
case "endlink":
|
|
1096
1102
|
this.#z = !0, this.#G.push("</span>"), this.#J();
|
|
1097
1103
|
return;
|
|
1098
|
-
default: this.#z = !0,
|
|
1104
|
+
default: this.#z = !0, o = this.#V(t, i, this.#L);
|
|
1099
1105
|
}
|
|
1100
1106
|
break;
|
|
1101
1107
|
}
|
|
1102
|
-
this.#G.push(e.#P(
|
|
1108
|
+
this.#G.push(e.#P(o));
|
|
1103
1109
|
};
|
|
1104
|
-
#V(
|
|
1105
|
-
let
|
|
1106
|
-
e.#t.doRecLog() && (this.#X +=
|
|
1107
|
-
let { cl:
|
|
1108
|
-
return
|
|
1109
|
-
}
|
|
1110
|
-
#H(
|
|
1111
|
-
let
|
|
1112
|
-
e.#s.isSkipping ? this.#U = 0 :
|
|
1113
|
-
let
|
|
1110
|
+
#V(t, n, r) {
|
|
1111
|
+
let i = t === " " ? " " : t === " " ? " " : t;
|
|
1112
|
+
e.#t.doRecLog() && (this.#X += i + (n ? `《${n}》` : ""), t !== " " && (this.#Z += t));
|
|
1113
|
+
let { cl: a, sty: o, lnk: s } = this.#H(!0, null, t);
|
|
1114
|
+
return n ? `<span${a} style='${o} ${this.#j(t)}'><ruby>${Array.from(t).map((e, n) => `<span${a}${s} style='${n > 0 ? this.#H(!0, null, t).sty : o} display: inline;'>${e === " " ? " " : e === " " ? " " : e}</span>`).join("")}<rt${s}${this.#I(t, n, r, this.#y.style.cssText + (this.#K.at(-1)?.o.r_style ?? ""))}>${n}</rt></ruby></span>` : `<span${a} style='${o} ${this.#j(t)}'${s}>${i}</span>`;
|
|
1115
|
+
}
|
|
1116
|
+
#H(t, n, i = "\n") {
|
|
1117
|
+
let a = this.#w ? n ?? this.#K.at(0)?.o.wait ?? (e.#l ? e.#u[i.at(0) ?? ""] ?? 0 : e.msecChWait) : 0;
|
|
1118
|
+
e.#s.isSkipping ? this.#U = 0 : t && this.#w && (this.#U += r(a));
|
|
1119
|
+
let o = `data-add='{"ch_in_style":"${this.#C}", "ch_out_style":"${this.#E}"}'`;
|
|
1114
1120
|
return {
|
|
1115
1121
|
cl: ` class='sn_ch sn_ch_yet sn_ch_in_${this.#C}'`,
|
|
1116
1122
|
sty: `animation-delay: ${String(this.#U)}ms;${this.#K.at(-1)?.o.style ?? ""}`,
|
|
1117
|
-
lnk: (this.#K.at(0)?.o[":link"] ?? "") + " " +
|
|
1118
|
-
curpos:
|
|
1123
|
+
lnk: (this.#K.at(0)?.o[":link"] ?? "") + " " + o,
|
|
1124
|
+
curpos: o
|
|
1119
1125
|
};
|
|
1120
1126
|
}
|
|
1121
1127
|
#U = 0;
|
|
@@ -1135,15 +1141,15 @@ var TxtStage = class p extends Container {
|
|
|
1135
1141
|
e && (this.#L = e.r_align, this.#S({ in_style: e.ch_in_style }), this.#T({ out_style: e.ch_out_style }));
|
|
1136
1142
|
}
|
|
1137
1143
|
#Y(e) {
|
|
1138
|
-
let
|
|
1139
|
-
if (!
|
|
1144
|
+
let t = this.#K.at(-1);
|
|
1145
|
+
if (!t) {
|
|
1140
1146
|
this.#q(e);
|
|
1141
1147
|
return;
|
|
1142
1148
|
}
|
|
1143
|
-
|
|
1144
|
-
...
|
|
1149
|
+
t.o = {
|
|
1150
|
+
...t.o,
|
|
1145
1151
|
...e
|
|
1146
|
-
}, !e.style && !e.r_style && (
|
|
1152
|
+
}, !e.style && !e.r_style && (t.o.style = "", t.o.r_style = ""), e.r_align && (this.#L = e.r_align), this.#S(e), this.#T(e);
|
|
1147
1153
|
}
|
|
1148
1154
|
click = () => !this.ctn.interactiveChildren || !this.ctn.visible ? !1 : this.#_.skipChIn();
|
|
1149
1155
|
clearText() {
|
|
@@ -1163,10 +1169,10 @@ var TxtStage = class p extends Container {
|
|
|
1163
1169
|
set enabled(e) {
|
|
1164
1170
|
this.ctn.interactiveChildren = e;
|
|
1165
1171
|
}
|
|
1166
|
-
addButton = (
|
|
1167
|
-
|
|
1168
|
-
let
|
|
1169
|
-
|
|
1172
|
+
addButton = (t) => new Promise((n) => {
|
|
1173
|
+
t.key = `btn=[${String(this.#x.children.length)}] ` + this.name_, t[":id_tag"] = t.key.slice(0, -7), o(t, "hint_tate", this.#_.tategaki);
|
|
1174
|
+
let r = new x(t, e.#s, () => n(), () => this.canFocus());
|
|
1175
|
+
r.name = JSON.stringify(t).replaceAll("\"", "'"), this.#x.addChild(r);
|
|
1170
1176
|
});
|
|
1171
1177
|
canFocus() {
|
|
1172
1178
|
return (this.ctn.interactiveChildren ?? !1) && this.ctn.visible && e.#n(this);
|
|
@@ -1180,7 +1186,7 @@ var TxtStage = class p extends Container {
|
|
|
1180
1186
|
enabled: this.enabled,
|
|
1181
1187
|
r_cssText: this.#y.style.cssText,
|
|
1182
1188
|
r_align: this.#L,
|
|
1183
|
-
b_do: this.#h === void 0 ? void 0 : this.#h instanceof
|
|
1189
|
+
b_do: this.#h === void 0 ? void 0 : this.#h instanceof d ? "Sprite" : "Graphics",
|
|
1184
1190
|
b_pic: this.#g,
|
|
1185
1191
|
b_color: this.#f,
|
|
1186
1192
|
b_alpha: this.#p,
|
|
@@ -1190,12 +1196,12 @@ var TxtStage = class p extends Container {
|
|
|
1190
1196
|
strNoFFS: this.#M,
|
|
1191
1197
|
btns: this.#x.children.map((e) => e.name)
|
|
1192
1198
|
});
|
|
1193
|
-
playback(e,
|
|
1194
|
-
super.playback(e,
|
|
1195
|
-
let
|
|
1196
|
-
|
|
1197
|
-
e &&
|
|
1198
|
-
}) ||
|
|
1199
|
+
playback(e, t) {
|
|
1200
|
+
super.playback(e, t), this.enabled = e.enabled, this.#y.style.cssText = e.r_cssText, this.#L = e.r_align, this.cvsResize(), this.#k(e), this.#_.playback(e.txs), this.#p = e.b_alpha, this.#m = e.b_alpha_isfixed, t.push(new Promise((t) => {
|
|
1201
|
+
let n = e.b_do ? e.b_do === "Sprite" ? { b_pic: e.b_pic } : { b_color: e.b_color } : { b_pic: "" };
|
|
1202
|
+
n.b_alpha = e.b_alpha, n.b_alpha_isfixed = e.b_alpha_isfixed, this.#O(n, (e) => {
|
|
1203
|
+
e && t();
|
|
1204
|
+
}) || t();
|
|
1199
1205
|
}), ...e.btns.map((e) => this.addButton(JSON.parse(e.replaceAll("'", "\"")))).flat());
|
|
1200
1206
|
}
|
|
1201
1207
|
get cssText() {
|
|
@@ -1204,8 +1210,8 @@ var TxtStage = class p extends Container {
|
|
|
1204
1210
|
set cssText(e) {
|
|
1205
1211
|
this.#_.cssText = e;
|
|
1206
1212
|
}
|
|
1207
|
-
snapshot(e,
|
|
1208
|
-
e.render(this.ctn, { clear: !1 }), this.#_.snapshot(e,
|
|
1213
|
+
snapshot(e, t) {
|
|
1214
|
+
e.render(this.ctn, { clear: !1 }), this.#_.snapshot(e, t);
|
|
1209
1215
|
}
|
|
1210
1216
|
snapshot_end() {
|
|
1211
1217
|
this.#_.snapshot_end();
|
|
@@ -1214,7 +1220,7 @@ var TxtStage = class p extends Container {
|
|
|
1214
1220
|
this.ctn.visible && this.#_.makeDesignCast(e);
|
|
1215
1221
|
}
|
|
1216
1222
|
makeDesignCastChildren(e) {
|
|
1217
|
-
if (this.ctn.visible) for (let
|
|
1223
|
+
if (this.ctn.visible) for (let t of this.#x.children) t.makeDesignCast(e);
|
|
1218
1224
|
}
|
|
1219
1225
|
showDesignCast() {
|
|
1220
1226
|
this.#_.showDesignCast();
|
|
@@ -1223,9 +1229,10 @@ var TxtStage = class p extends Container {
|
|
|
1223
1229
|
for (let e of this.#x.children) e.showDesignCast();
|
|
1224
1230
|
}
|
|
1225
1231
|
dump() {
|
|
1226
|
-
return this.#B("", "gotxt|"), super.dump() + `, "enabled":"${String(this.enabled)}", ${this.#_.dump()}, "b_pic":"${this.#g}", "b_color":"${String(this.#f)}", "b_alpha":${String(this.#p)}, "b_alpha_isfixed":"${String(this.#m)}", "width":${String(this.#_.getWidth)}, "height":${String(this.#_.getHeight)}, "pixi_obj":[${this.ctn.children.map((e) => `{"class":"${e instanceof
|
|
1232
|
+
return this.#B("", "gotxt|"), super.dump() + `, "enabled":"${String(this.enabled)}", ${this.#_.dump()}, "b_pic":"${this.#g}", "b_color":"${String(this.#f)}", "b_alpha":${String(this.#p)}, "b_alpha_isfixed":"${String(this.#m)}", "width":${String(this.#_.getWidth)}, "height":${String(this.#_.getHeight)}, "pixi_obj":[${this.ctn.children.map((e) => `{"class":"${e instanceof d ? "Sprite" : e instanceof f ? "Graphics" : e instanceof u ? "Container" : "?"}", "name":"${e.name}", "alpha":${String(e.alpha)}, "x":${String(e.x)}, "y":${String(e.y)}, "visible":"${String(e.visible)}"}`).join(",")}], "button":[${this.#x.children.map((e) => e.children[0]?.name ?? "{}").join(",")}]`;
|
|
1227
1233
|
}
|
|
1228
1234
|
};
|
|
1229
|
-
|
|
1235
|
+
//#endregion
|
|
1236
|
+
export { P as TxtLayer, N as t };
|
|
1230
1237
|
|
|
1231
1238
|
//# sourceMappingURL=TxtLayer.js.map
|