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