@momoyu-ink/kit 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{jsx-dev-runtime-M-Dr-KG3.d.mts → jsx-dev-runtime-CowyIagD.d.mts} +399 -3
- package/dist/{jsx-dev-runtime-M-Dr-KG3.d.ts → jsx-dev-runtime-CowyIagD.d.ts} +399 -3
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-dev-runtime.d.ts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/lib.cjs +4 -2
- package/dist/lib.d.mts +3 -3
- package/dist/lib.d.ts +3 -3
- package/dist/lib.mjs +4 -2
- package/package.json +1 -1
|
@@ -138,6 +138,43 @@ type GamepadCommand = {
|
|
|
138
138
|
params: EffectParams;
|
|
139
139
|
};
|
|
140
140
|
|
|
141
|
+
type Live2dCommand = {
|
|
142
|
+
subCommand: 'startMotion';
|
|
143
|
+
group: string;
|
|
144
|
+
index: number;
|
|
145
|
+
priority?: number;
|
|
146
|
+
fadeIn?: number;
|
|
147
|
+
fadeOut?: number;
|
|
148
|
+
loop?: boolean;
|
|
149
|
+
} | {
|
|
150
|
+
subCommand: 'stopAllMotions';
|
|
151
|
+
} | {
|
|
152
|
+
subCommand: 'setExpression';
|
|
153
|
+
name: string;
|
|
154
|
+
} | {
|
|
155
|
+
subCommand: 'stopExpression';
|
|
156
|
+
} | {
|
|
157
|
+
subCommand: 'setParameter';
|
|
158
|
+
id: string;
|
|
159
|
+
value: number;
|
|
160
|
+
} | {
|
|
161
|
+
subCommand: 'setParameters';
|
|
162
|
+
values: {
|
|
163
|
+
[key in string]: number;
|
|
164
|
+
};
|
|
165
|
+
} | {
|
|
166
|
+
subCommand: 'resetParameters';
|
|
167
|
+
} | {
|
|
168
|
+
subCommand: 'setPartOpacity';
|
|
169
|
+
id: string;
|
|
170
|
+
value: number;
|
|
171
|
+
} | {
|
|
172
|
+
subCommand: 'hitTest';
|
|
173
|
+
area: string;
|
|
174
|
+
x: number;
|
|
175
|
+
y: number;
|
|
176
|
+
};
|
|
177
|
+
|
|
141
178
|
type WarpBoundary = 'before' | 'after';
|
|
142
179
|
|
|
143
180
|
type JsonValue = number | string | boolean | Array<JsonValue> | {
|
|
@@ -147,6 +184,10 @@ type JsonValue = number | string | boolean | Array<JsonValue> | {
|
|
|
147
184
|
type ScenarioCommand = {
|
|
148
185
|
subCommand: 'addStory';
|
|
149
186
|
name: string;
|
|
187
|
+
} | {
|
|
188
|
+
subCommand: 'addStoryFromContent';
|
|
189
|
+
name: string;
|
|
190
|
+
content: string;
|
|
150
191
|
} | {
|
|
151
192
|
subCommand: 'replaceStoryData';
|
|
152
193
|
name: string;
|
|
@@ -297,6 +338,56 @@ type ShaderCommand = {
|
|
|
297
338
|
subCommand: 'reset';
|
|
298
339
|
};
|
|
299
340
|
|
|
341
|
+
type SpineCommand = {
|
|
342
|
+
"subCommand": "setAnimation";
|
|
343
|
+
track: number;
|
|
344
|
+
animation: string;
|
|
345
|
+
loop?: boolean;
|
|
346
|
+
/**
|
|
347
|
+
* Transition duration; negative keeps the runtime's default.
|
|
348
|
+
*/
|
|
349
|
+
mix?: number;
|
|
350
|
+
delay?: number;
|
|
351
|
+
/**
|
|
352
|
+
* Start offset in seconds.
|
|
353
|
+
*/
|
|
354
|
+
time?: number;
|
|
355
|
+
} | {
|
|
356
|
+
"subCommand": "addAnimation";
|
|
357
|
+
track: number;
|
|
358
|
+
animation: string;
|
|
359
|
+
loop?: boolean;
|
|
360
|
+
mix?: number;
|
|
361
|
+
delay?: number;
|
|
362
|
+
time?: number;
|
|
363
|
+
} | {
|
|
364
|
+
"subCommand": "clearTrack";
|
|
365
|
+
track: number;
|
|
366
|
+
mix?: number;
|
|
367
|
+
} | {
|
|
368
|
+
"subCommand": "clearTracks";
|
|
369
|
+
} | {
|
|
370
|
+
"subCommand": "setDefaultMix";
|
|
371
|
+
duration: number;
|
|
372
|
+
} | {
|
|
373
|
+
"subCommand": "setMix";
|
|
374
|
+
from: string;
|
|
375
|
+
to: string;
|
|
376
|
+
duration: number;
|
|
377
|
+
} | {
|
|
378
|
+
"subCommand": "setAttachment";
|
|
379
|
+
slot: string;
|
|
380
|
+
name: string;
|
|
381
|
+
} | {
|
|
382
|
+
"subCommand": "resetToSetupPose";
|
|
383
|
+
} | {
|
|
384
|
+
"subCommand": "resetPhysics";
|
|
385
|
+
} | {
|
|
386
|
+
"subCommand": "hitTest";
|
|
387
|
+
x: number;
|
|
388
|
+
y: number;
|
|
389
|
+
};
|
|
390
|
+
|
|
300
391
|
type OverlayDialog = 'friends' | 'community' | 'players' | 'settings' | 'officialGameGroup' | 'stats' | 'achievements';
|
|
301
392
|
|
|
302
393
|
type OverlayNotificationPosition = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
|
|
@@ -429,7 +520,7 @@ type SteamCommand = {
|
|
|
429
520
|
|
|
430
521
|
type ReadFormat = 'text' | 'binary';
|
|
431
522
|
|
|
432
|
-
type WindowState =
|
|
523
|
+
type WindowState = 'idle' | 'maximized' | 'minimized' | 'fullscreen';
|
|
433
524
|
|
|
434
525
|
type SystemCommand = {
|
|
435
526
|
subCommand: 'setWindowSize';
|
|
@@ -714,6 +805,7 @@ type NodeProps = {
|
|
|
714
805
|
tint?: string;
|
|
715
806
|
opacity?: number;
|
|
716
807
|
interactive?: boolean;
|
|
808
|
+
hitTestSelf?: boolean;
|
|
717
809
|
cursor?: MoyuCursor;
|
|
718
810
|
zIndex?: number;
|
|
719
811
|
excludeFromLayout?: boolean;
|
|
@@ -845,6 +937,7 @@ type SpriteProps = {
|
|
|
845
937
|
nineSliceMode?: NineSliceMode;
|
|
846
938
|
targetWidth?: number;
|
|
847
939
|
targetHeight?: number;
|
|
940
|
+
alphaHitTest?: boolean;
|
|
848
941
|
};
|
|
849
942
|
|
|
850
943
|
/**
|
|
@@ -974,6 +1067,250 @@ type VideoProps = {
|
|
|
974
1067
|
muted?: boolean;
|
|
975
1068
|
};
|
|
976
1069
|
|
|
1070
|
+
/**
|
|
1071
|
+
* Canvas geometry of a model, in canvas pixels.
|
|
1072
|
+
*/
|
|
1073
|
+
type Live2dCanvas = {
|
|
1074
|
+
width: number;
|
|
1075
|
+
height: number;
|
|
1076
|
+
originX: number;
|
|
1077
|
+
originY: number;
|
|
1078
|
+
pixelsPerUnit: number;
|
|
1079
|
+
};
|
|
1080
|
+
|
|
1081
|
+
/**
|
|
1082
|
+
* One expression of the model.
|
|
1083
|
+
*/
|
|
1084
|
+
type Live2dExpression = {
|
|
1085
|
+
name: string;
|
|
1086
|
+
fadeIn: number;
|
|
1087
|
+
fadeOut: number;
|
|
1088
|
+
};
|
|
1089
|
+
|
|
1090
|
+
/**
|
|
1091
|
+
* One motion of the model.
|
|
1092
|
+
*/
|
|
1093
|
+
type Live2dMotion = {
|
|
1094
|
+
group: string;
|
|
1095
|
+
index: number;
|
|
1096
|
+
duration: number;
|
|
1097
|
+
fadeIn: number;
|
|
1098
|
+
fadeOut: number;
|
|
1099
|
+
/**
|
|
1100
|
+
* Sound file path relative to the model directory; absent when the motion
|
|
1101
|
+
* carries no sound.
|
|
1102
|
+
*/
|
|
1103
|
+
sound?: string;
|
|
1104
|
+
};
|
|
1105
|
+
|
|
1106
|
+
/**
|
|
1107
|
+
* One model parameter.
|
|
1108
|
+
*/
|
|
1109
|
+
type Live2dParameter = {
|
|
1110
|
+
id: string;
|
|
1111
|
+
/**
|
|
1112
|
+
* Parameter type: -1 unknown, 0 normal, 1 blend shape.
|
|
1113
|
+
*/
|
|
1114
|
+
kind: number;
|
|
1115
|
+
min: number;
|
|
1116
|
+
max: number;
|
|
1117
|
+
default: number;
|
|
1118
|
+
};
|
|
1119
|
+
|
|
1120
|
+
/**
|
|
1121
|
+
* Everything the `ready` event reports about a loaded model.
|
|
1122
|
+
*/
|
|
1123
|
+
type Live2dMetadata = {
|
|
1124
|
+
canvas: Live2dCanvas;
|
|
1125
|
+
motions: Array<Live2dMotion>;
|
|
1126
|
+
expressions: Array<Live2dExpression>;
|
|
1127
|
+
hitAreas: Array<string>;
|
|
1128
|
+
parameters: Array<Live2dParameter>;
|
|
1129
|
+
};
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* Events emitted by the `live2d` node.
|
|
1133
|
+
*/
|
|
1134
|
+
type Live2dEvent = ({
|
|
1135
|
+
type: 'ready';
|
|
1136
|
+
} & Live2dMetadata) | {
|
|
1137
|
+
type: 'motionFinished';
|
|
1138
|
+
group: string;
|
|
1139
|
+
index: number;
|
|
1140
|
+
} | {
|
|
1141
|
+
type: 'motionEvent';
|
|
1142
|
+
value: string;
|
|
1143
|
+
} | {
|
|
1144
|
+
type: 'blendModeUnsupported';
|
|
1145
|
+
value: number;
|
|
1146
|
+
} | {
|
|
1147
|
+
type: 'hit';
|
|
1148
|
+
area: string;
|
|
1149
|
+
x: number;
|
|
1150
|
+
y: number;
|
|
1151
|
+
} | {
|
|
1152
|
+
type: 'error';
|
|
1153
|
+
code: number;
|
|
1154
|
+
message: string;
|
|
1155
|
+
};
|
|
1156
|
+
|
|
1157
|
+
type Live2dProps = {
|
|
1158
|
+
src: string | null;
|
|
1159
|
+
physics?: boolean;
|
|
1160
|
+
pose?: boolean;
|
|
1161
|
+
blink?: boolean;
|
|
1162
|
+
breath?: boolean;
|
|
1163
|
+
look?: boolean;
|
|
1164
|
+
idle?: boolean;
|
|
1165
|
+
hitTest?: boolean;
|
|
1166
|
+
};
|
|
1167
|
+
|
|
1168
|
+
/**
|
|
1169
|
+
* Identity of one playback.
|
|
1170
|
+
*
|
|
1171
|
+
* `entry` is assigned by the plugin and stays unique within one loaded model;
|
|
1172
|
+
* `epoch` is bumped by the host on every model change. Together they survive a
|
|
1173
|
+
* reload: an entry id is reused after the plugin drops the old model, so a
|
|
1174
|
+
* waiter that only compared `entry` would match the wrong playback.
|
|
1175
|
+
*/
|
|
1176
|
+
type EntryIdentity = {
|
|
1177
|
+
entry: bigint;
|
|
1178
|
+
epoch: bigint;
|
|
1179
|
+
};
|
|
1180
|
+
|
|
1181
|
+
/**
|
|
1182
|
+
* One animation of the model.
|
|
1183
|
+
*/
|
|
1184
|
+
type SpineAnimation = {
|
|
1185
|
+
name: string;
|
|
1186
|
+
/**
|
|
1187
|
+
* Length in seconds; zero for animations that only hold a pose.
|
|
1188
|
+
*/
|
|
1189
|
+
duration: number;
|
|
1190
|
+
};
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* A rectangle in world units with y up.
|
|
1194
|
+
*/
|
|
1195
|
+
type SpineBounds = {
|
|
1196
|
+
x: number;
|
|
1197
|
+
y: number;
|
|
1198
|
+
width: number;
|
|
1199
|
+
height: number;
|
|
1200
|
+
};
|
|
1201
|
+
|
|
1202
|
+
/**
|
|
1203
|
+
* Where the `premultiplied` flag came from.
|
|
1204
|
+
*/
|
|
1205
|
+
type AlphaSource = "atlas" | "image";
|
|
1206
|
+
|
|
1207
|
+
/**
|
|
1208
|
+
* One texture page of the model.
|
|
1209
|
+
*/
|
|
1210
|
+
type SpinePage = {
|
|
1211
|
+
/**
|
|
1212
|
+
* Image path relative to the asset root.
|
|
1213
|
+
*/
|
|
1214
|
+
path: string;
|
|
1215
|
+
width: number;
|
|
1216
|
+
height: number;
|
|
1217
|
+
/**
|
|
1218
|
+
* Whether the source alpha is already premultiplied.
|
|
1219
|
+
*/
|
|
1220
|
+
premultiplied: boolean;
|
|
1221
|
+
/**
|
|
1222
|
+
* How the page declares premultiplied alpha, for diagnostics.
|
|
1223
|
+
*/
|
|
1224
|
+
alphaSource: AlphaSource;
|
|
1225
|
+
};
|
|
1226
|
+
|
|
1227
|
+
/**
|
|
1228
|
+
* Everything the `ready` event reports about a loaded model.
|
|
1229
|
+
*/
|
|
1230
|
+
type SpineMetadata = {
|
|
1231
|
+
/**
|
|
1232
|
+
* Skeleton data version string, as written by the Spine Editor.
|
|
1233
|
+
*
|
|
1234
|
+
* Diagnostic only: it never selects a runtime.
|
|
1235
|
+
*/
|
|
1236
|
+
dataVersion: string;
|
|
1237
|
+
/**
|
|
1238
|
+
* Bounds measured once at load in the setup pose, in world units.
|
|
1239
|
+
*
|
|
1240
|
+
* This is the layout rectangle: it does not follow animations or skin
|
|
1241
|
+
* changes, and it is not a clip boundary.
|
|
1242
|
+
*/
|
|
1243
|
+
bounds: SpineBounds;
|
|
1244
|
+
animations: Array<SpineAnimation>;
|
|
1245
|
+
skins: Array<string>;
|
|
1246
|
+
pages: Array<SpinePage>;
|
|
1247
|
+
boundingBoxes: Array<string>;
|
|
1248
|
+
};
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* Events emitted by the `spine` node.
|
|
1252
|
+
*/
|
|
1253
|
+
type SpineEvent = {
|
|
1254
|
+
"type": "ready";
|
|
1255
|
+
} & SpineMetadata | {
|
|
1256
|
+
"type": "trackStart";
|
|
1257
|
+
track: number;
|
|
1258
|
+
id: EntryIdentity;
|
|
1259
|
+
animation: string;
|
|
1260
|
+
} | {
|
|
1261
|
+
"type": "trackComplete";
|
|
1262
|
+
track: number;
|
|
1263
|
+
id: EntryIdentity;
|
|
1264
|
+
animation: string;
|
|
1265
|
+
} | {
|
|
1266
|
+
"type": "trackEnd";
|
|
1267
|
+
track: number;
|
|
1268
|
+
id: EntryIdentity;
|
|
1269
|
+
animation: string;
|
|
1270
|
+
} | {
|
|
1271
|
+
"type": "trackDispose";
|
|
1272
|
+
track: number;
|
|
1273
|
+
id: EntryIdentity;
|
|
1274
|
+
animation: string;
|
|
1275
|
+
} | {
|
|
1276
|
+
"type": "trackEvent";
|
|
1277
|
+
track: number;
|
|
1278
|
+
id: EntryIdentity;
|
|
1279
|
+
animation: string;
|
|
1280
|
+
name: string;
|
|
1281
|
+
intValue: number;
|
|
1282
|
+
floatValue: number;
|
|
1283
|
+
stringValue: string;
|
|
1284
|
+
audioPath: string;
|
|
1285
|
+
volume: number;
|
|
1286
|
+
balance: number;
|
|
1287
|
+
} | {
|
|
1288
|
+
"type": "hit";
|
|
1289
|
+
epoch: bigint;
|
|
1290
|
+
name: string;
|
|
1291
|
+
x: number;
|
|
1292
|
+
y: number;
|
|
1293
|
+
} | {
|
|
1294
|
+
"type": "error";
|
|
1295
|
+
code: number;
|
|
1296
|
+
message: string;
|
|
1297
|
+
};
|
|
1298
|
+
|
|
1299
|
+
/**
|
|
1300
|
+
* How the runtime advances physics constraints.
|
|
1301
|
+
*/
|
|
1302
|
+
type PhysicsMode = "none" | "pose" | "update";
|
|
1303
|
+
|
|
1304
|
+
type SpineProps = {
|
|
1305
|
+
src: string | null;
|
|
1306
|
+
atlas?: string;
|
|
1307
|
+
skin?: string;
|
|
1308
|
+
timeScale?: number;
|
|
1309
|
+
paused?: boolean;
|
|
1310
|
+
physics?: PhysicsMode;
|
|
1311
|
+
hitArea?: boolean;
|
|
1312
|
+
};
|
|
1313
|
+
|
|
977
1314
|
type Tuple2 = [number, number];
|
|
978
1315
|
type Tuple3 = [number, number, number];
|
|
979
1316
|
type Tuple4 = [number, number, number, number];
|
|
@@ -1044,6 +1381,63 @@ type MoyuVideoAttributes = VideoProps & MoyuNodeAttributes & {
|
|
|
1044
1381
|
onEnded?: () => void;
|
|
1045
1382
|
onStateChange?: (state: string) => void;
|
|
1046
1383
|
};
|
|
1384
|
+
type MoyuLive2dAttributes = Live2dProps & MoyuNodeAttributes & {
|
|
1385
|
+
/** The model finished loading; the payload holds its full metadata. */
|
|
1386
|
+
onReady?: (event: Extract<Live2dEvent, {
|
|
1387
|
+
type: 'ready';
|
|
1388
|
+
}>) => void;
|
|
1389
|
+
onMotionFinished?: (event: Extract<Live2dEvent, {
|
|
1390
|
+
type: 'motionFinished';
|
|
1391
|
+
}>) => void;
|
|
1392
|
+
onMotionEvent?: (event: Extract<Live2dEvent, {
|
|
1393
|
+
type: 'motionEvent';
|
|
1394
|
+
}>) => void;
|
|
1395
|
+
onBlendModeUnsupported?: (event: Extract<Live2dEvent, {
|
|
1396
|
+
type: 'blendModeUnsupported';
|
|
1397
|
+
}>) => void;
|
|
1398
|
+
/**
|
|
1399
|
+
* A press landed on a hit area, reported per area when several overlap.
|
|
1400
|
+
* Requires the `hitTest` prop.
|
|
1401
|
+
*/
|
|
1402
|
+
onHit?: (event: Extract<Live2dEvent, {
|
|
1403
|
+
type: 'hit';
|
|
1404
|
+
}>) => void;
|
|
1405
|
+
onError?: (event: Extract<Live2dEvent, {
|
|
1406
|
+
type: 'error';
|
|
1407
|
+
}>) => void;
|
|
1408
|
+
};
|
|
1409
|
+
type MoyuSpineAttributes = SpineProps & MoyuNodeAttributes & {
|
|
1410
|
+
/** The model finished parsing; the payload holds its full metadata. */
|
|
1411
|
+
onReady?: (event: Extract<SpineEvent, {
|
|
1412
|
+
type: 'ready';
|
|
1413
|
+
}>) => void;
|
|
1414
|
+
onTrackStart?: (event: Extract<SpineEvent, {
|
|
1415
|
+
type: 'trackStart';
|
|
1416
|
+
}>) => void;
|
|
1417
|
+
onTrackComplete?: (event: Extract<SpineEvent, {
|
|
1418
|
+
type: 'trackComplete';
|
|
1419
|
+
}>) => void;
|
|
1420
|
+
onTrackEnd?: (event: Extract<SpineEvent, {
|
|
1421
|
+
type: 'trackEnd';
|
|
1422
|
+
}>) => void;
|
|
1423
|
+
/**
|
|
1424
|
+
* The terminal signal for a playback: it fires for completion,
|
|
1425
|
+
* interruption and cancellation alike, so waiting on it always returns.
|
|
1426
|
+
*/
|
|
1427
|
+
onTrackDispose?: (event: Extract<SpineEvent, {
|
|
1428
|
+
type: 'trackDispose';
|
|
1429
|
+
}>) => void;
|
|
1430
|
+
onTrackEvent?: (event: Extract<SpineEvent, {
|
|
1431
|
+
type: 'trackEvent';
|
|
1432
|
+
}>) => void;
|
|
1433
|
+
/** A press landed inside a named bounding box; requires the `hitArea` prop. */
|
|
1434
|
+
onHit?: (event: Extract<SpineEvent, {
|
|
1435
|
+
type: 'hit';
|
|
1436
|
+
}>) => void;
|
|
1437
|
+
onError?: (event: Extract<SpineEvent, {
|
|
1438
|
+
type: 'error';
|
|
1439
|
+
}>) => void;
|
|
1440
|
+
};
|
|
1047
1441
|
type MoyuSpriteAttributes = SpriteProps & MoyuNodeAttributes;
|
|
1048
1442
|
type MoyuTextAttributes = TextProps & MoyuNodeAttributes & {
|
|
1049
1443
|
onStart?: () => void;
|
|
@@ -1083,6 +1477,8 @@ declare namespace JSX {
|
|
|
1083
1477
|
shader: DetailedMoyuProps<MoyuShaderAttributes>;
|
|
1084
1478
|
'shader-slot': DetailedMoyuProps<MoyuShaderSlotAttributes>;
|
|
1085
1479
|
video: DetailedMoyuProps<MoyuVideoAttributes>;
|
|
1480
|
+
live2d: DetailedMoyuProps<MoyuLive2dAttributes>;
|
|
1481
|
+
spine: DetailedMoyuProps<MoyuSpineAttributes>;
|
|
1086
1482
|
}
|
|
1087
1483
|
}
|
|
1088
1484
|
|
|
@@ -1099,8 +1495,8 @@ type MakeNullOptional<T> = T extends unknown ? {
|
|
|
1099
1495
|
} : never;
|
|
1100
1496
|
declare function mergeEvent<T extends BubbleEvent, K extends BubbleEvent>(handlers: MoyuEventHandler<T> | readonly MoyuEventHandler<T>[] | undefined, defaultHandler?: MoyuEventHandler<K>): (event: T | K) => void;
|
|
1101
1497
|
|
|
1102
|
-
type _Command = AudioCommand | EditableCommand | TextCommand | GamepadCommand | ScenarioCommand | ShaderCommand | SteamCommand | SystemCommand | VideoCommand;
|
|
1498
|
+
type _Command = AudioCommand | EditableCommand | TextCommand | GamepadCommand | Live2dCommand | ScenarioCommand | ShaderCommand | SpineCommand | SteamCommand | SystemCommand | VideoCommand;
|
|
1103
1499
|
type Command = MakeNullOptional<_Command>;
|
|
1104
1500
|
type MaybePromise = any;
|
|
1105
1501
|
|
|
1106
|
-
export { type
|
|
1502
|
+
export { type OverlayStoreFlag as $, type AudioCommand as A, type BubbleEvent as B, type Command as C, type DetailedMoyuProps as D, type EditableState as E, type MoyuContainerAttributes as F, type GamepadCommand as G, type MoyuEditableAttributes as H, type MoyuEventHandler as I, JSX as J, type KeyboardEvent as K, type LayoutEvent as L, type MoyuEvent as M, type MoyuFilterAttributes as N, type MoyuHBoxAttributes as O, type MoyuListenerAttributes as P, type MoyuLive2dAttributes as Q, type MoyuShaderAttributes as R, type ShaderDirection as S, type TouchEvent as T, type MoyuShaderSlotAttributes as U, type MoyuSpineAttributes as V, type WheelEvent as W, type MoyuVideoAttributes as X, Node as Y, type OverlayDialog as Z, type OverlayNotificationPosition as _, type MaybePromise as a, type PlatformInfo as a0, type PointerEventKind as a1, type RetainMode as a2, type ScenarioCommand as a3, type ShaderCommand as a4, type ShaderParam as a5, type ShaderParamType as a6, type ShaderSource as a7, type ShaderTimeControl as a8, type SpineCommand as a9, type SpineEvent as aa, type SpineMetadata as ab, type SteamCommand as ac, type SystemCommand as ad, type TextCommand as ae, type TextInteractionEvent as af, type TextLayoutEvent as ag, type TimelinePossibleClip as ah, type TouchEventKind as ai, type Tuple2 as aj, type Tuple3 as ak, type Tuple4 as al, type VideoCommand as am, type WheelEventDeltaMode as an, type WindowState as ao, createBubbleEvent as ap, getPlatform as aq, getStageSize as ar, mergeEvent as as, type MoyuClipAttributes as b, type MoyuVBoxAttributes as c, type MoyuSpriteAttributes as d, type TextProps as e, type MoyuNodeAttributes as f, type MouseEvent as g, type MoyuTextAttributes as h, type EditableChangeSource as i, type SpriteProps as j, type JsonValue as k, type AudioSettings as l, type EditableCommand as m, type EditableEvent as n, type EffectParams as o, type EntryIdentity as p, type KeyboardEventKind as q, type Live2dCommand as r, type Live2dEvent as s, type Live2dMetadata as t, type MakeNullOptional as u, MouseButton as v, MouseButtons as w, type MouseEventKind as x, type MoyuAnimationAttributes as y, type MoyuBackdropAttributes as z };
|
|
@@ -138,6 +138,43 @@ type GamepadCommand = {
|
|
|
138
138
|
params: EffectParams;
|
|
139
139
|
};
|
|
140
140
|
|
|
141
|
+
type Live2dCommand = {
|
|
142
|
+
subCommand: 'startMotion';
|
|
143
|
+
group: string;
|
|
144
|
+
index: number;
|
|
145
|
+
priority?: number;
|
|
146
|
+
fadeIn?: number;
|
|
147
|
+
fadeOut?: number;
|
|
148
|
+
loop?: boolean;
|
|
149
|
+
} | {
|
|
150
|
+
subCommand: 'stopAllMotions';
|
|
151
|
+
} | {
|
|
152
|
+
subCommand: 'setExpression';
|
|
153
|
+
name: string;
|
|
154
|
+
} | {
|
|
155
|
+
subCommand: 'stopExpression';
|
|
156
|
+
} | {
|
|
157
|
+
subCommand: 'setParameter';
|
|
158
|
+
id: string;
|
|
159
|
+
value: number;
|
|
160
|
+
} | {
|
|
161
|
+
subCommand: 'setParameters';
|
|
162
|
+
values: {
|
|
163
|
+
[key in string]: number;
|
|
164
|
+
};
|
|
165
|
+
} | {
|
|
166
|
+
subCommand: 'resetParameters';
|
|
167
|
+
} | {
|
|
168
|
+
subCommand: 'setPartOpacity';
|
|
169
|
+
id: string;
|
|
170
|
+
value: number;
|
|
171
|
+
} | {
|
|
172
|
+
subCommand: 'hitTest';
|
|
173
|
+
area: string;
|
|
174
|
+
x: number;
|
|
175
|
+
y: number;
|
|
176
|
+
};
|
|
177
|
+
|
|
141
178
|
type WarpBoundary = 'before' | 'after';
|
|
142
179
|
|
|
143
180
|
type JsonValue = number | string | boolean | Array<JsonValue> | {
|
|
@@ -147,6 +184,10 @@ type JsonValue = number | string | boolean | Array<JsonValue> | {
|
|
|
147
184
|
type ScenarioCommand = {
|
|
148
185
|
subCommand: 'addStory';
|
|
149
186
|
name: string;
|
|
187
|
+
} | {
|
|
188
|
+
subCommand: 'addStoryFromContent';
|
|
189
|
+
name: string;
|
|
190
|
+
content: string;
|
|
150
191
|
} | {
|
|
151
192
|
subCommand: 'replaceStoryData';
|
|
152
193
|
name: string;
|
|
@@ -297,6 +338,56 @@ type ShaderCommand = {
|
|
|
297
338
|
subCommand: 'reset';
|
|
298
339
|
};
|
|
299
340
|
|
|
341
|
+
type SpineCommand = {
|
|
342
|
+
"subCommand": "setAnimation";
|
|
343
|
+
track: number;
|
|
344
|
+
animation: string;
|
|
345
|
+
loop?: boolean;
|
|
346
|
+
/**
|
|
347
|
+
* Transition duration; negative keeps the runtime's default.
|
|
348
|
+
*/
|
|
349
|
+
mix?: number;
|
|
350
|
+
delay?: number;
|
|
351
|
+
/**
|
|
352
|
+
* Start offset in seconds.
|
|
353
|
+
*/
|
|
354
|
+
time?: number;
|
|
355
|
+
} | {
|
|
356
|
+
"subCommand": "addAnimation";
|
|
357
|
+
track: number;
|
|
358
|
+
animation: string;
|
|
359
|
+
loop?: boolean;
|
|
360
|
+
mix?: number;
|
|
361
|
+
delay?: number;
|
|
362
|
+
time?: number;
|
|
363
|
+
} | {
|
|
364
|
+
"subCommand": "clearTrack";
|
|
365
|
+
track: number;
|
|
366
|
+
mix?: number;
|
|
367
|
+
} | {
|
|
368
|
+
"subCommand": "clearTracks";
|
|
369
|
+
} | {
|
|
370
|
+
"subCommand": "setDefaultMix";
|
|
371
|
+
duration: number;
|
|
372
|
+
} | {
|
|
373
|
+
"subCommand": "setMix";
|
|
374
|
+
from: string;
|
|
375
|
+
to: string;
|
|
376
|
+
duration: number;
|
|
377
|
+
} | {
|
|
378
|
+
"subCommand": "setAttachment";
|
|
379
|
+
slot: string;
|
|
380
|
+
name: string;
|
|
381
|
+
} | {
|
|
382
|
+
"subCommand": "resetToSetupPose";
|
|
383
|
+
} | {
|
|
384
|
+
"subCommand": "resetPhysics";
|
|
385
|
+
} | {
|
|
386
|
+
"subCommand": "hitTest";
|
|
387
|
+
x: number;
|
|
388
|
+
y: number;
|
|
389
|
+
};
|
|
390
|
+
|
|
300
391
|
type OverlayDialog = 'friends' | 'community' | 'players' | 'settings' | 'officialGameGroup' | 'stats' | 'achievements';
|
|
301
392
|
|
|
302
393
|
type OverlayNotificationPosition = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
|
|
@@ -429,7 +520,7 @@ type SteamCommand = {
|
|
|
429
520
|
|
|
430
521
|
type ReadFormat = 'text' | 'binary';
|
|
431
522
|
|
|
432
|
-
type WindowState =
|
|
523
|
+
type WindowState = 'idle' | 'maximized' | 'minimized' | 'fullscreen';
|
|
433
524
|
|
|
434
525
|
type SystemCommand = {
|
|
435
526
|
subCommand: 'setWindowSize';
|
|
@@ -714,6 +805,7 @@ type NodeProps = {
|
|
|
714
805
|
tint?: string;
|
|
715
806
|
opacity?: number;
|
|
716
807
|
interactive?: boolean;
|
|
808
|
+
hitTestSelf?: boolean;
|
|
717
809
|
cursor?: MoyuCursor;
|
|
718
810
|
zIndex?: number;
|
|
719
811
|
excludeFromLayout?: boolean;
|
|
@@ -845,6 +937,7 @@ type SpriteProps = {
|
|
|
845
937
|
nineSliceMode?: NineSliceMode;
|
|
846
938
|
targetWidth?: number;
|
|
847
939
|
targetHeight?: number;
|
|
940
|
+
alphaHitTest?: boolean;
|
|
848
941
|
};
|
|
849
942
|
|
|
850
943
|
/**
|
|
@@ -974,6 +1067,250 @@ type VideoProps = {
|
|
|
974
1067
|
muted?: boolean;
|
|
975
1068
|
};
|
|
976
1069
|
|
|
1070
|
+
/**
|
|
1071
|
+
* Canvas geometry of a model, in canvas pixels.
|
|
1072
|
+
*/
|
|
1073
|
+
type Live2dCanvas = {
|
|
1074
|
+
width: number;
|
|
1075
|
+
height: number;
|
|
1076
|
+
originX: number;
|
|
1077
|
+
originY: number;
|
|
1078
|
+
pixelsPerUnit: number;
|
|
1079
|
+
};
|
|
1080
|
+
|
|
1081
|
+
/**
|
|
1082
|
+
* One expression of the model.
|
|
1083
|
+
*/
|
|
1084
|
+
type Live2dExpression = {
|
|
1085
|
+
name: string;
|
|
1086
|
+
fadeIn: number;
|
|
1087
|
+
fadeOut: number;
|
|
1088
|
+
};
|
|
1089
|
+
|
|
1090
|
+
/**
|
|
1091
|
+
* One motion of the model.
|
|
1092
|
+
*/
|
|
1093
|
+
type Live2dMotion = {
|
|
1094
|
+
group: string;
|
|
1095
|
+
index: number;
|
|
1096
|
+
duration: number;
|
|
1097
|
+
fadeIn: number;
|
|
1098
|
+
fadeOut: number;
|
|
1099
|
+
/**
|
|
1100
|
+
* Sound file path relative to the model directory; absent when the motion
|
|
1101
|
+
* carries no sound.
|
|
1102
|
+
*/
|
|
1103
|
+
sound?: string;
|
|
1104
|
+
};
|
|
1105
|
+
|
|
1106
|
+
/**
|
|
1107
|
+
* One model parameter.
|
|
1108
|
+
*/
|
|
1109
|
+
type Live2dParameter = {
|
|
1110
|
+
id: string;
|
|
1111
|
+
/**
|
|
1112
|
+
* Parameter type: -1 unknown, 0 normal, 1 blend shape.
|
|
1113
|
+
*/
|
|
1114
|
+
kind: number;
|
|
1115
|
+
min: number;
|
|
1116
|
+
max: number;
|
|
1117
|
+
default: number;
|
|
1118
|
+
};
|
|
1119
|
+
|
|
1120
|
+
/**
|
|
1121
|
+
* Everything the `ready` event reports about a loaded model.
|
|
1122
|
+
*/
|
|
1123
|
+
type Live2dMetadata = {
|
|
1124
|
+
canvas: Live2dCanvas;
|
|
1125
|
+
motions: Array<Live2dMotion>;
|
|
1126
|
+
expressions: Array<Live2dExpression>;
|
|
1127
|
+
hitAreas: Array<string>;
|
|
1128
|
+
parameters: Array<Live2dParameter>;
|
|
1129
|
+
};
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* Events emitted by the `live2d` node.
|
|
1133
|
+
*/
|
|
1134
|
+
type Live2dEvent = ({
|
|
1135
|
+
type: 'ready';
|
|
1136
|
+
} & Live2dMetadata) | {
|
|
1137
|
+
type: 'motionFinished';
|
|
1138
|
+
group: string;
|
|
1139
|
+
index: number;
|
|
1140
|
+
} | {
|
|
1141
|
+
type: 'motionEvent';
|
|
1142
|
+
value: string;
|
|
1143
|
+
} | {
|
|
1144
|
+
type: 'blendModeUnsupported';
|
|
1145
|
+
value: number;
|
|
1146
|
+
} | {
|
|
1147
|
+
type: 'hit';
|
|
1148
|
+
area: string;
|
|
1149
|
+
x: number;
|
|
1150
|
+
y: number;
|
|
1151
|
+
} | {
|
|
1152
|
+
type: 'error';
|
|
1153
|
+
code: number;
|
|
1154
|
+
message: string;
|
|
1155
|
+
};
|
|
1156
|
+
|
|
1157
|
+
type Live2dProps = {
|
|
1158
|
+
src: string | null;
|
|
1159
|
+
physics?: boolean;
|
|
1160
|
+
pose?: boolean;
|
|
1161
|
+
blink?: boolean;
|
|
1162
|
+
breath?: boolean;
|
|
1163
|
+
look?: boolean;
|
|
1164
|
+
idle?: boolean;
|
|
1165
|
+
hitTest?: boolean;
|
|
1166
|
+
};
|
|
1167
|
+
|
|
1168
|
+
/**
|
|
1169
|
+
* Identity of one playback.
|
|
1170
|
+
*
|
|
1171
|
+
* `entry` is assigned by the plugin and stays unique within one loaded model;
|
|
1172
|
+
* `epoch` is bumped by the host on every model change. Together they survive a
|
|
1173
|
+
* reload: an entry id is reused after the plugin drops the old model, so a
|
|
1174
|
+
* waiter that only compared `entry` would match the wrong playback.
|
|
1175
|
+
*/
|
|
1176
|
+
type EntryIdentity = {
|
|
1177
|
+
entry: bigint;
|
|
1178
|
+
epoch: bigint;
|
|
1179
|
+
};
|
|
1180
|
+
|
|
1181
|
+
/**
|
|
1182
|
+
* One animation of the model.
|
|
1183
|
+
*/
|
|
1184
|
+
type SpineAnimation = {
|
|
1185
|
+
name: string;
|
|
1186
|
+
/**
|
|
1187
|
+
* Length in seconds; zero for animations that only hold a pose.
|
|
1188
|
+
*/
|
|
1189
|
+
duration: number;
|
|
1190
|
+
};
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* A rectangle in world units with y up.
|
|
1194
|
+
*/
|
|
1195
|
+
type SpineBounds = {
|
|
1196
|
+
x: number;
|
|
1197
|
+
y: number;
|
|
1198
|
+
width: number;
|
|
1199
|
+
height: number;
|
|
1200
|
+
};
|
|
1201
|
+
|
|
1202
|
+
/**
|
|
1203
|
+
* Where the `premultiplied` flag came from.
|
|
1204
|
+
*/
|
|
1205
|
+
type AlphaSource = "atlas" | "image";
|
|
1206
|
+
|
|
1207
|
+
/**
|
|
1208
|
+
* One texture page of the model.
|
|
1209
|
+
*/
|
|
1210
|
+
type SpinePage = {
|
|
1211
|
+
/**
|
|
1212
|
+
* Image path relative to the asset root.
|
|
1213
|
+
*/
|
|
1214
|
+
path: string;
|
|
1215
|
+
width: number;
|
|
1216
|
+
height: number;
|
|
1217
|
+
/**
|
|
1218
|
+
* Whether the source alpha is already premultiplied.
|
|
1219
|
+
*/
|
|
1220
|
+
premultiplied: boolean;
|
|
1221
|
+
/**
|
|
1222
|
+
* How the page declares premultiplied alpha, for diagnostics.
|
|
1223
|
+
*/
|
|
1224
|
+
alphaSource: AlphaSource;
|
|
1225
|
+
};
|
|
1226
|
+
|
|
1227
|
+
/**
|
|
1228
|
+
* Everything the `ready` event reports about a loaded model.
|
|
1229
|
+
*/
|
|
1230
|
+
type SpineMetadata = {
|
|
1231
|
+
/**
|
|
1232
|
+
* Skeleton data version string, as written by the Spine Editor.
|
|
1233
|
+
*
|
|
1234
|
+
* Diagnostic only: it never selects a runtime.
|
|
1235
|
+
*/
|
|
1236
|
+
dataVersion: string;
|
|
1237
|
+
/**
|
|
1238
|
+
* Bounds measured once at load in the setup pose, in world units.
|
|
1239
|
+
*
|
|
1240
|
+
* This is the layout rectangle: it does not follow animations or skin
|
|
1241
|
+
* changes, and it is not a clip boundary.
|
|
1242
|
+
*/
|
|
1243
|
+
bounds: SpineBounds;
|
|
1244
|
+
animations: Array<SpineAnimation>;
|
|
1245
|
+
skins: Array<string>;
|
|
1246
|
+
pages: Array<SpinePage>;
|
|
1247
|
+
boundingBoxes: Array<string>;
|
|
1248
|
+
};
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* Events emitted by the `spine` node.
|
|
1252
|
+
*/
|
|
1253
|
+
type SpineEvent = {
|
|
1254
|
+
"type": "ready";
|
|
1255
|
+
} & SpineMetadata | {
|
|
1256
|
+
"type": "trackStart";
|
|
1257
|
+
track: number;
|
|
1258
|
+
id: EntryIdentity;
|
|
1259
|
+
animation: string;
|
|
1260
|
+
} | {
|
|
1261
|
+
"type": "trackComplete";
|
|
1262
|
+
track: number;
|
|
1263
|
+
id: EntryIdentity;
|
|
1264
|
+
animation: string;
|
|
1265
|
+
} | {
|
|
1266
|
+
"type": "trackEnd";
|
|
1267
|
+
track: number;
|
|
1268
|
+
id: EntryIdentity;
|
|
1269
|
+
animation: string;
|
|
1270
|
+
} | {
|
|
1271
|
+
"type": "trackDispose";
|
|
1272
|
+
track: number;
|
|
1273
|
+
id: EntryIdentity;
|
|
1274
|
+
animation: string;
|
|
1275
|
+
} | {
|
|
1276
|
+
"type": "trackEvent";
|
|
1277
|
+
track: number;
|
|
1278
|
+
id: EntryIdentity;
|
|
1279
|
+
animation: string;
|
|
1280
|
+
name: string;
|
|
1281
|
+
intValue: number;
|
|
1282
|
+
floatValue: number;
|
|
1283
|
+
stringValue: string;
|
|
1284
|
+
audioPath: string;
|
|
1285
|
+
volume: number;
|
|
1286
|
+
balance: number;
|
|
1287
|
+
} | {
|
|
1288
|
+
"type": "hit";
|
|
1289
|
+
epoch: bigint;
|
|
1290
|
+
name: string;
|
|
1291
|
+
x: number;
|
|
1292
|
+
y: number;
|
|
1293
|
+
} | {
|
|
1294
|
+
"type": "error";
|
|
1295
|
+
code: number;
|
|
1296
|
+
message: string;
|
|
1297
|
+
};
|
|
1298
|
+
|
|
1299
|
+
/**
|
|
1300
|
+
* How the runtime advances physics constraints.
|
|
1301
|
+
*/
|
|
1302
|
+
type PhysicsMode = "none" | "pose" | "update";
|
|
1303
|
+
|
|
1304
|
+
type SpineProps = {
|
|
1305
|
+
src: string | null;
|
|
1306
|
+
atlas?: string;
|
|
1307
|
+
skin?: string;
|
|
1308
|
+
timeScale?: number;
|
|
1309
|
+
paused?: boolean;
|
|
1310
|
+
physics?: PhysicsMode;
|
|
1311
|
+
hitArea?: boolean;
|
|
1312
|
+
};
|
|
1313
|
+
|
|
977
1314
|
type Tuple2 = [number, number];
|
|
978
1315
|
type Tuple3 = [number, number, number];
|
|
979
1316
|
type Tuple4 = [number, number, number, number];
|
|
@@ -1044,6 +1381,63 @@ type MoyuVideoAttributes = VideoProps & MoyuNodeAttributes & {
|
|
|
1044
1381
|
onEnded?: () => void;
|
|
1045
1382
|
onStateChange?: (state: string) => void;
|
|
1046
1383
|
};
|
|
1384
|
+
type MoyuLive2dAttributes = Live2dProps & MoyuNodeAttributes & {
|
|
1385
|
+
/** The model finished loading; the payload holds its full metadata. */
|
|
1386
|
+
onReady?: (event: Extract<Live2dEvent, {
|
|
1387
|
+
type: 'ready';
|
|
1388
|
+
}>) => void;
|
|
1389
|
+
onMotionFinished?: (event: Extract<Live2dEvent, {
|
|
1390
|
+
type: 'motionFinished';
|
|
1391
|
+
}>) => void;
|
|
1392
|
+
onMotionEvent?: (event: Extract<Live2dEvent, {
|
|
1393
|
+
type: 'motionEvent';
|
|
1394
|
+
}>) => void;
|
|
1395
|
+
onBlendModeUnsupported?: (event: Extract<Live2dEvent, {
|
|
1396
|
+
type: 'blendModeUnsupported';
|
|
1397
|
+
}>) => void;
|
|
1398
|
+
/**
|
|
1399
|
+
* A press landed on a hit area, reported per area when several overlap.
|
|
1400
|
+
* Requires the `hitTest` prop.
|
|
1401
|
+
*/
|
|
1402
|
+
onHit?: (event: Extract<Live2dEvent, {
|
|
1403
|
+
type: 'hit';
|
|
1404
|
+
}>) => void;
|
|
1405
|
+
onError?: (event: Extract<Live2dEvent, {
|
|
1406
|
+
type: 'error';
|
|
1407
|
+
}>) => void;
|
|
1408
|
+
};
|
|
1409
|
+
type MoyuSpineAttributes = SpineProps & MoyuNodeAttributes & {
|
|
1410
|
+
/** The model finished parsing; the payload holds its full metadata. */
|
|
1411
|
+
onReady?: (event: Extract<SpineEvent, {
|
|
1412
|
+
type: 'ready';
|
|
1413
|
+
}>) => void;
|
|
1414
|
+
onTrackStart?: (event: Extract<SpineEvent, {
|
|
1415
|
+
type: 'trackStart';
|
|
1416
|
+
}>) => void;
|
|
1417
|
+
onTrackComplete?: (event: Extract<SpineEvent, {
|
|
1418
|
+
type: 'trackComplete';
|
|
1419
|
+
}>) => void;
|
|
1420
|
+
onTrackEnd?: (event: Extract<SpineEvent, {
|
|
1421
|
+
type: 'trackEnd';
|
|
1422
|
+
}>) => void;
|
|
1423
|
+
/**
|
|
1424
|
+
* The terminal signal for a playback: it fires for completion,
|
|
1425
|
+
* interruption and cancellation alike, so waiting on it always returns.
|
|
1426
|
+
*/
|
|
1427
|
+
onTrackDispose?: (event: Extract<SpineEvent, {
|
|
1428
|
+
type: 'trackDispose';
|
|
1429
|
+
}>) => void;
|
|
1430
|
+
onTrackEvent?: (event: Extract<SpineEvent, {
|
|
1431
|
+
type: 'trackEvent';
|
|
1432
|
+
}>) => void;
|
|
1433
|
+
/** A press landed inside a named bounding box; requires the `hitArea` prop. */
|
|
1434
|
+
onHit?: (event: Extract<SpineEvent, {
|
|
1435
|
+
type: 'hit';
|
|
1436
|
+
}>) => void;
|
|
1437
|
+
onError?: (event: Extract<SpineEvent, {
|
|
1438
|
+
type: 'error';
|
|
1439
|
+
}>) => void;
|
|
1440
|
+
};
|
|
1047
1441
|
type MoyuSpriteAttributes = SpriteProps & MoyuNodeAttributes;
|
|
1048
1442
|
type MoyuTextAttributes = TextProps & MoyuNodeAttributes & {
|
|
1049
1443
|
onStart?: () => void;
|
|
@@ -1083,6 +1477,8 @@ declare namespace JSX {
|
|
|
1083
1477
|
shader: DetailedMoyuProps<MoyuShaderAttributes>;
|
|
1084
1478
|
'shader-slot': DetailedMoyuProps<MoyuShaderSlotAttributes>;
|
|
1085
1479
|
video: DetailedMoyuProps<MoyuVideoAttributes>;
|
|
1480
|
+
live2d: DetailedMoyuProps<MoyuLive2dAttributes>;
|
|
1481
|
+
spine: DetailedMoyuProps<MoyuSpineAttributes>;
|
|
1086
1482
|
}
|
|
1087
1483
|
}
|
|
1088
1484
|
|
|
@@ -1099,8 +1495,8 @@ type MakeNullOptional<T> = T extends unknown ? {
|
|
|
1099
1495
|
} : never;
|
|
1100
1496
|
declare function mergeEvent<T extends BubbleEvent, K extends BubbleEvent>(handlers: MoyuEventHandler<T> | readonly MoyuEventHandler<T>[] | undefined, defaultHandler?: MoyuEventHandler<K>): (event: T | K) => void;
|
|
1101
1497
|
|
|
1102
|
-
type _Command = AudioCommand | EditableCommand | TextCommand | GamepadCommand | ScenarioCommand | ShaderCommand | SteamCommand | SystemCommand | VideoCommand;
|
|
1498
|
+
type _Command = AudioCommand | EditableCommand | TextCommand | GamepadCommand | Live2dCommand | ScenarioCommand | ShaderCommand | SpineCommand | SteamCommand | SystemCommand | VideoCommand;
|
|
1103
1499
|
type Command = MakeNullOptional<_Command>;
|
|
1104
1500
|
type MaybePromise = any;
|
|
1105
1501
|
|
|
1106
|
-
export { type
|
|
1502
|
+
export { type OverlayStoreFlag as $, type AudioCommand as A, type BubbleEvent as B, type Command as C, type DetailedMoyuProps as D, type EditableState as E, type MoyuContainerAttributes as F, type GamepadCommand as G, type MoyuEditableAttributes as H, type MoyuEventHandler as I, JSX as J, type KeyboardEvent as K, type LayoutEvent as L, type MoyuEvent as M, type MoyuFilterAttributes as N, type MoyuHBoxAttributes as O, type MoyuListenerAttributes as P, type MoyuLive2dAttributes as Q, type MoyuShaderAttributes as R, type ShaderDirection as S, type TouchEvent as T, type MoyuShaderSlotAttributes as U, type MoyuSpineAttributes as V, type WheelEvent as W, type MoyuVideoAttributes as X, Node as Y, type OverlayDialog as Z, type OverlayNotificationPosition as _, type MaybePromise as a, type PlatformInfo as a0, type PointerEventKind as a1, type RetainMode as a2, type ScenarioCommand as a3, type ShaderCommand as a4, type ShaderParam as a5, type ShaderParamType as a6, type ShaderSource as a7, type ShaderTimeControl as a8, type SpineCommand as a9, type SpineEvent as aa, type SpineMetadata as ab, type SteamCommand as ac, type SystemCommand as ad, type TextCommand as ae, type TextInteractionEvent as af, type TextLayoutEvent as ag, type TimelinePossibleClip as ah, type TouchEventKind as ai, type Tuple2 as aj, type Tuple3 as ak, type Tuple4 as al, type VideoCommand as am, type WheelEventDeltaMode as an, type WindowState as ao, createBubbleEvent as ap, getPlatform as aq, getStageSize as ar, mergeEvent as as, type MoyuClipAttributes as b, type MoyuVBoxAttributes as c, type MoyuSpriteAttributes as d, type TextProps as e, type MoyuNodeAttributes as f, type MouseEvent as g, type MoyuTextAttributes as h, type EditableChangeSource as i, type SpriteProps as j, type JsonValue as k, type AudioSettings as l, type EditableCommand as m, type EditableEvent as n, type EffectParams as o, type EntryIdentity as p, type KeyboardEventKind as q, type Live2dCommand as r, type Live2dEvent as s, type Live2dMetadata as t, type MakeNullOptional as u, MouseButton as v, MouseButtons as w, type MouseEventKind as x, type MoyuAnimationAttributes as y, type MoyuBackdropAttributes as z };
|
package/dist/jsx-runtime.d.mts
CHANGED
package/dist/jsx-runtime.d.ts
CHANGED
package/dist/lib.cjs
CHANGED
|
@@ -1358,6 +1358,7 @@ function Button({
|
|
|
1358
1358
|
anchor,
|
|
1359
1359
|
pivot,
|
|
1360
1360
|
interactive: disabled ? false : interactive,
|
|
1361
|
+
hitTestSelf: false,
|
|
1361
1362
|
onMouseEnter: mergeEvent(onMouseEnter, (event) => {
|
|
1362
1363
|
if (event.targetId === event.currentTargetId) {
|
|
1363
1364
|
event.stopPropagation();
|
|
@@ -1807,6 +1808,7 @@ function Select({
|
|
|
1807
1808
|
anchor,
|
|
1808
1809
|
pivot,
|
|
1809
1810
|
interactive: disabled ? false : containerProps.interactive,
|
|
1811
|
+
hitTestSelf: false,
|
|
1810
1812
|
children: [
|
|
1811
1813
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1812
1814
|
Button,
|
|
@@ -2923,7 +2925,7 @@ async function startRuntimeDebugSession() {
|
|
|
2923
2925
|
}
|
|
2924
2926
|
|
|
2925
2927
|
// src/hooks/useFadeInOut.ts
|
|
2926
|
-
function useFadeInOut(inTime,
|
|
2928
|
+
function useFadeInOut(inTime, keepTime, outTime, pause = false, onFinished) {
|
|
2927
2929
|
const [style, api] = (0, spring_exports.useSpring)(
|
|
2928
2930
|
() => ({
|
|
2929
2931
|
from: { opacity: 0 },
|
|
@@ -2932,7 +2934,7 @@ function useFadeInOut(inTime, _keepTime, _outTime, pause = false, onFinished) {
|
|
|
2932
2934
|
pause,
|
|
2933
2935
|
onRest: (result) => {
|
|
2934
2936
|
if (result.value.opacity === 1) {
|
|
2935
|
-
void api.start({ reverse: true, delay:
|
|
2937
|
+
void api.start({ reverse: true, delay: keepTime, config: { duration: outTime } });
|
|
2936
2938
|
} else {
|
|
2937
2939
|
onFinished?.();
|
|
2938
2940
|
}
|
package/dist/lib.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactElement, Component, ForwardRefExoticComponent, CSSProperties, FC, ReactNode, ComponentType } from 'react';
|
|
3
|
-
import { S as ShaderDirection, M as MoyuEvent, C as Command, a as MaybePromise, J as JSX, L as LayoutEvent, W as WheelEvent, T as TouchEvent, b as MoyuClipAttributes, c as MoyuVBoxAttributes, d as MoyuSpriteAttributes, e as TextProps, f as MoyuNodeAttributes, g as MouseEvent, h as MoyuTextAttributes, E as EditableState, i as EditableChangeSource, j as SpriteProps, k as JsonValue } from './jsx-dev-runtime-
|
|
4
|
-
export { A as AudioCommand, l as AudioSettings, B as BubbleEvent, D as DetailedMoyuProps, m as EditableCommand, n as EditableEvent, o as EffectParams, G as GamepadCommand, K as KeyboardEvent,
|
|
3
|
+
import { S as ShaderDirection, M as MoyuEvent, C as Command, a as MaybePromise, J as JSX, L as LayoutEvent, W as WheelEvent, T as TouchEvent, b as MoyuClipAttributes, c as MoyuVBoxAttributes, d as MoyuSpriteAttributes, e as TextProps, f as MoyuNodeAttributes, g as MouseEvent, h as MoyuTextAttributes, E as EditableState, i as EditableChangeSource, j as SpriteProps, k as JsonValue } from './jsx-dev-runtime-CowyIagD.mjs';
|
|
4
|
+
export { A as AudioCommand, l as AudioSettings, B as BubbleEvent, D as DetailedMoyuProps, m as EditableCommand, n as EditableEvent, o as EffectParams, p as EntryIdentity, G as GamepadCommand, K as KeyboardEvent, q as KeyboardEventKind, r as Live2dCommand, s as Live2dEvent, t as Live2dMetadata, u as MakeNullOptional, v as MouseButton, w as MouseButtons, x as MouseEventKind, y as MoyuAnimationAttributes, z as MoyuBackdropAttributes, F as MoyuContainerAttributes, H as MoyuEditableAttributes, I as MoyuEventHandler, N as MoyuFilterAttributes, O as MoyuHBoxAttributes, P as MoyuListenerAttributes, Q as MoyuLive2dAttributes, R as MoyuShaderAttributes, U as MoyuShaderSlotAttributes, V as MoyuSpineAttributes, X as MoyuVideoAttributes, Y as Node, Z as OverlayDialog, _ as OverlayNotificationPosition, $ as OverlayStoreFlag, a0 as PlatformInfo, a1 as PointerEventKind, a2 as RetainMode, a3 as ScenarioCommand, a4 as ShaderCommand, a5 as ShaderParam, a6 as ShaderParamType, a7 as ShaderSource, a8 as ShaderTimeControl, a9 as SpineCommand, aa as SpineEvent, ab as SpineMetadata, ac as SteamCommand, ad as SystemCommand, ae as TextCommand, af as TextInteractionEvent, ag as TextLayoutEvent, ah as TimelinePossibleClip, ai as TouchEventKind, aj as Tuple2, ak as Tuple3, al as Tuple4, am as VideoCommand, an as WheelEventDeltaMode, ao as WindowState, ap as createBubbleEvent, aq as getPlatform, ar as getStageSize, as as mergeEvent } from './jsx-dev-runtime-CowyIagD.mjs';
|
|
5
5
|
import { FluidValue, addFluidObserver as addFluidObserver$1, removeFluidObserver as removeFluidObserver$1 } from '@react-spring/shared';
|
|
6
6
|
import { ElementType, AssignableKeys, ComponentPropsWithRef } from '@react-spring/types';
|
|
7
7
|
import { Snapshot } from 'valtio';
|
|
@@ -1020,7 +1020,7 @@ declare function useDebugSession(): {
|
|
|
1020
1020
|
declare function stopRuntimeDebugSession(): Promise<void>;
|
|
1021
1021
|
declare function startRuntimeDebugSession(): Promise<void>;
|
|
1022
1022
|
|
|
1023
|
-
declare function useFadeInOut(inTime: number,
|
|
1023
|
+
declare function useFadeInOut(inTime: number, keepTime: number, outTime: number, pause?: boolean, onFinished?: () => void): [SpringValues<{
|
|
1024
1024
|
opacity: number;
|
|
1025
1025
|
}>, SpringRef<{
|
|
1026
1026
|
opacity: number;
|
package/dist/lib.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactElement, Component, ForwardRefExoticComponent, CSSProperties, FC, ReactNode, ComponentType } from 'react';
|
|
3
|
-
import { S as ShaderDirection, M as MoyuEvent, C as Command, a as MaybePromise, J as JSX, L as LayoutEvent, W as WheelEvent, T as TouchEvent, b as MoyuClipAttributes, c as MoyuVBoxAttributes, d as MoyuSpriteAttributes, e as TextProps, f as MoyuNodeAttributes, g as MouseEvent, h as MoyuTextAttributes, E as EditableState, i as EditableChangeSource, j as SpriteProps, k as JsonValue } from './jsx-dev-runtime-
|
|
4
|
-
export { A as AudioCommand, l as AudioSettings, B as BubbleEvent, D as DetailedMoyuProps, m as EditableCommand, n as EditableEvent, o as EffectParams, G as GamepadCommand, K as KeyboardEvent,
|
|
3
|
+
import { S as ShaderDirection, M as MoyuEvent, C as Command, a as MaybePromise, J as JSX, L as LayoutEvent, W as WheelEvent, T as TouchEvent, b as MoyuClipAttributes, c as MoyuVBoxAttributes, d as MoyuSpriteAttributes, e as TextProps, f as MoyuNodeAttributes, g as MouseEvent, h as MoyuTextAttributes, E as EditableState, i as EditableChangeSource, j as SpriteProps, k as JsonValue } from './jsx-dev-runtime-CowyIagD.js';
|
|
4
|
+
export { A as AudioCommand, l as AudioSettings, B as BubbleEvent, D as DetailedMoyuProps, m as EditableCommand, n as EditableEvent, o as EffectParams, p as EntryIdentity, G as GamepadCommand, K as KeyboardEvent, q as KeyboardEventKind, r as Live2dCommand, s as Live2dEvent, t as Live2dMetadata, u as MakeNullOptional, v as MouseButton, w as MouseButtons, x as MouseEventKind, y as MoyuAnimationAttributes, z as MoyuBackdropAttributes, F as MoyuContainerAttributes, H as MoyuEditableAttributes, I as MoyuEventHandler, N as MoyuFilterAttributes, O as MoyuHBoxAttributes, P as MoyuListenerAttributes, Q as MoyuLive2dAttributes, R as MoyuShaderAttributes, U as MoyuShaderSlotAttributes, V as MoyuSpineAttributes, X as MoyuVideoAttributes, Y as Node, Z as OverlayDialog, _ as OverlayNotificationPosition, $ as OverlayStoreFlag, a0 as PlatformInfo, a1 as PointerEventKind, a2 as RetainMode, a3 as ScenarioCommand, a4 as ShaderCommand, a5 as ShaderParam, a6 as ShaderParamType, a7 as ShaderSource, a8 as ShaderTimeControl, a9 as SpineCommand, aa as SpineEvent, ab as SpineMetadata, ac as SteamCommand, ad as SystemCommand, ae as TextCommand, af as TextInteractionEvent, ag as TextLayoutEvent, ah as TimelinePossibleClip, ai as TouchEventKind, aj as Tuple2, ak as Tuple3, al as Tuple4, am as VideoCommand, an as WheelEventDeltaMode, ao as WindowState, ap as createBubbleEvent, aq as getPlatform, ar as getStageSize, as as mergeEvent } from './jsx-dev-runtime-CowyIagD.js';
|
|
5
5
|
import { FluidValue, addFluidObserver as addFluidObserver$1, removeFluidObserver as removeFluidObserver$1 } from '@react-spring/shared';
|
|
6
6
|
import { ElementType, AssignableKeys, ComponentPropsWithRef } from '@react-spring/types';
|
|
7
7
|
import { Snapshot } from 'valtio';
|
|
@@ -1020,7 +1020,7 @@ declare function useDebugSession(): {
|
|
|
1020
1020
|
declare function stopRuntimeDebugSession(): Promise<void>;
|
|
1021
1021
|
declare function startRuntimeDebugSession(): Promise<void>;
|
|
1022
1022
|
|
|
1023
|
-
declare function useFadeInOut(inTime: number,
|
|
1023
|
+
declare function useFadeInOut(inTime: number, keepTime: number, outTime: number, pause?: boolean, onFinished?: () => void): [SpringValues<{
|
|
1024
1024
|
opacity: number;
|
|
1025
1025
|
}>, SpringRef<{
|
|
1026
1026
|
opacity: number;
|
package/dist/lib.mjs
CHANGED
|
@@ -1352,6 +1352,7 @@ function Button({
|
|
|
1352
1352
|
anchor,
|
|
1353
1353
|
pivot,
|
|
1354
1354
|
interactive: disabled ? false : interactive,
|
|
1355
|
+
hitTestSelf: false,
|
|
1355
1356
|
onMouseEnter: mergeEvent(onMouseEnter, (event) => {
|
|
1356
1357
|
if (event.targetId === event.currentTargetId) {
|
|
1357
1358
|
event.stopPropagation();
|
|
@@ -1801,6 +1802,7 @@ function Select({
|
|
|
1801
1802
|
anchor,
|
|
1802
1803
|
pivot,
|
|
1803
1804
|
interactive: disabled ? false : containerProps.interactive,
|
|
1805
|
+
hitTestSelf: false,
|
|
1804
1806
|
children: [
|
|
1805
1807
|
/* @__PURE__ */ jsx(
|
|
1806
1808
|
Button,
|
|
@@ -2917,7 +2919,7 @@ async function startRuntimeDebugSession() {
|
|
|
2917
2919
|
}
|
|
2918
2920
|
|
|
2919
2921
|
// src/hooks/useFadeInOut.ts
|
|
2920
|
-
function useFadeInOut(inTime,
|
|
2922
|
+
function useFadeInOut(inTime, keepTime, outTime, pause = false, onFinished) {
|
|
2921
2923
|
const [style, api] = (0, spring_exports.useSpring)(
|
|
2922
2924
|
() => ({
|
|
2923
2925
|
from: { opacity: 0 },
|
|
@@ -2926,7 +2928,7 @@ function useFadeInOut(inTime, _keepTime, _outTime, pause = false, onFinished) {
|
|
|
2926
2928
|
pause,
|
|
2927
2929
|
onRest: (result) => {
|
|
2928
2930
|
if (result.value.opacity === 1) {
|
|
2929
|
-
void api.start({ reverse: true, delay:
|
|
2931
|
+
void api.start({ reverse: true, delay: keepTime, config: { duration: outTime } });
|
|
2930
2932
|
} else {
|
|
2931
2933
|
onFinished?.();
|
|
2932
2934
|
}
|