@workadventure/iframe-api-typings 1.14.5 → 1.14.8
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.
|
@@ -1137,6 +1137,49 @@ export declare const isIframeEventWrapper: z.ZodUnion<[z.ZodObject<{
|
|
|
1137
1137
|
}, {
|
|
1138
1138
|
data?: undefined;
|
|
1139
1139
|
type: "redirectPricing";
|
|
1140
|
+
}>, z.ZodObject<{
|
|
1141
|
+
type: z.ZodLiteral<"addButtonActionBar">;
|
|
1142
|
+
data: z.ZodObject<{
|
|
1143
|
+
id: z.ZodString;
|
|
1144
|
+
label: z.ZodString;
|
|
1145
|
+
}, "strip", z.ZodTypeAny, {
|
|
1146
|
+
id: string;
|
|
1147
|
+
label: string;
|
|
1148
|
+
}, {
|
|
1149
|
+
id: string;
|
|
1150
|
+
label: string;
|
|
1151
|
+
}>;
|
|
1152
|
+
}, "strip", z.ZodTypeAny, {
|
|
1153
|
+
type: "addButtonActionBar";
|
|
1154
|
+
data: {
|
|
1155
|
+
id: string;
|
|
1156
|
+
label: string;
|
|
1157
|
+
};
|
|
1158
|
+
}, {
|
|
1159
|
+
type: "addButtonActionBar";
|
|
1160
|
+
data: {
|
|
1161
|
+
id: string;
|
|
1162
|
+
label: string;
|
|
1163
|
+
};
|
|
1164
|
+
}>, z.ZodObject<{
|
|
1165
|
+
type: z.ZodLiteral<"removeButtonActionBar">;
|
|
1166
|
+
data: z.ZodObject<{
|
|
1167
|
+
id: z.ZodString;
|
|
1168
|
+
}, "strip", z.ZodTypeAny, {
|
|
1169
|
+
id: string;
|
|
1170
|
+
}, {
|
|
1171
|
+
id: string;
|
|
1172
|
+
}>;
|
|
1173
|
+
}, "strip", z.ZodTypeAny, {
|
|
1174
|
+
type: "removeButtonActionBar";
|
|
1175
|
+
data: {
|
|
1176
|
+
id: string;
|
|
1177
|
+
};
|
|
1178
|
+
}, {
|
|
1179
|
+
type: "removeButtonActionBar";
|
|
1180
|
+
data: {
|
|
1181
|
+
id: string;
|
|
1182
|
+
};
|
|
1140
1183
|
}>]>;
|
|
1141
1184
|
export declare type IframeEvent = z.infer<typeof isIframeEventWrapper>;
|
|
1142
1185
|
export declare const isIframeResponseEvent: z.ZodUnion<[z.ZodObject<{
|
|
@@ -2352,6 +2395,69 @@ export declare const isIframeResponseEvent: z.ZodUnion<[z.ZodObject<{
|
|
|
2352
2395
|
}, {
|
|
2353
2396
|
type: "updateWritingStatusChatList";
|
|
2354
2397
|
data: (string | null)[];
|
|
2398
|
+
}>, z.ZodObject<{
|
|
2399
|
+
type: z.ZodLiteral<"buttonActionBarTrigger">;
|
|
2400
|
+
data: z.ZodObject<{
|
|
2401
|
+
id: z.ZodString;
|
|
2402
|
+
label: z.ZodString;
|
|
2403
|
+
}, "strip", z.ZodTypeAny, {
|
|
2404
|
+
id: string;
|
|
2405
|
+
label: string;
|
|
2406
|
+
}, {
|
|
2407
|
+
id: string;
|
|
2408
|
+
label: string;
|
|
2409
|
+
}>;
|
|
2410
|
+
}, "strip", z.ZodTypeAny, {
|
|
2411
|
+
type: "buttonActionBarTrigger";
|
|
2412
|
+
data: {
|
|
2413
|
+
id: string;
|
|
2414
|
+
label: string;
|
|
2415
|
+
};
|
|
2416
|
+
}, {
|
|
2417
|
+
type: "buttonActionBarTrigger";
|
|
2418
|
+
data: {
|
|
2419
|
+
id: string;
|
|
2420
|
+
label: string;
|
|
2421
|
+
};
|
|
2422
|
+
}>, z.ZodObject<{
|
|
2423
|
+
type: z.ZodLiteral<"modalCloseTrigger">;
|
|
2424
|
+
data: z.ZodObject<{
|
|
2425
|
+
src: z.ZodString;
|
|
2426
|
+
allow: z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
2427
|
+
title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
2428
|
+
position: z.ZodDefault<z.ZodOptional<z.ZodEnum<["right", "left", "center"]>>>;
|
|
2429
|
+
allowApi: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
2430
|
+
}, "strip", z.ZodTypeAny, {
|
|
2431
|
+
allowApi: boolean;
|
|
2432
|
+
position: "left" | "right" | "center";
|
|
2433
|
+
allow: string | null;
|
|
2434
|
+
src: string;
|
|
2435
|
+
title: string;
|
|
2436
|
+
}, {
|
|
2437
|
+
allowApi?: boolean | undefined;
|
|
2438
|
+
position?: "left" | "right" | "center" | undefined;
|
|
2439
|
+
allow?: string | null | undefined;
|
|
2440
|
+
title?: string | undefined;
|
|
2441
|
+
src: string;
|
|
2442
|
+
}>;
|
|
2443
|
+
}, "strip", z.ZodTypeAny, {
|
|
2444
|
+
type: "modalCloseTrigger";
|
|
2445
|
+
data: {
|
|
2446
|
+
allowApi: boolean;
|
|
2447
|
+
position: "left" | "right" | "center";
|
|
2448
|
+
allow: string | null;
|
|
2449
|
+
src: string;
|
|
2450
|
+
title: string;
|
|
2451
|
+
};
|
|
2452
|
+
}, {
|
|
2453
|
+
type: "modalCloseTrigger";
|
|
2454
|
+
data: {
|
|
2455
|
+
allowApi?: boolean | undefined;
|
|
2456
|
+
position?: "left" | "right" | "center" | undefined;
|
|
2457
|
+
allow?: string | null | undefined;
|
|
2458
|
+
title?: string | undefined;
|
|
2459
|
+
src: string;
|
|
2460
|
+
};
|
|
2355
2461
|
}>]>;
|
|
2356
2462
|
export declare type IframeResponseEvent = z.infer<typeof isIframeResponseEvent>;
|
|
2357
2463
|
export declare const isLookingLikeIframeEventWrapper: z.ZodObject<{
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const isAddButtonActionBarEvent: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
label: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}, {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
}>;
|
|
12
|
+
export declare type AddButtonActionBarEvent = z.infer<typeof isAddButtonActionBarEvent>;
|
|
13
|
+
export declare type AddActionsButtonActionBarEventCallback = (event: AddButtonActionBarEvent) => void;
|
|
14
|
+
export declare const isRemoveButtonActionBarEvent: z.ZodObject<{
|
|
15
|
+
id: z.ZodString;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
id: string;
|
|
18
|
+
}, {
|
|
19
|
+
id: string;
|
|
20
|
+
}>;
|
|
21
|
+
export declare type RemoveButtonActionBarEvent = z.infer<typeof isRemoveButtonActionBarEvent>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AddButtonActionBarEvent } from "../../Events/Ui/ButtonActionBarEvent";
|
|
2
|
+
import { IframeApiContribution } from "../IframeApiContribution";
|
|
3
|
+
export declare type ButtonActionBarClickedCallback = (buttonActionBar: AddButtonActionBarEvent) => void;
|
|
4
|
+
export declare type ActionBarButtonDescriptor = {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
callback?: ButtonActionBarClickedCallback;
|
|
8
|
+
};
|
|
9
|
+
export declare class WorkAdventureButtonActionBarCommands extends IframeApiContribution<WorkAdventureButtonActionBarCommands> {
|
|
10
|
+
private _callbacks;
|
|
11
|
+
callbacks: {
|
|
12
|
+
type: "buttonActionBarTrigger";
|
|
13
|
+
callback: (event: {
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
}) => void;
|
|
17
|
+
}[];
|
|
18
|
+
/**
|
|
19
|
+
* Add action bar button
|
|
20
|
+
* {@link http://workadventure.localhost/map-building/api-ui.md#add-action-bar | Website documentation}
|
|
21
|
+
*/
|
|
22
|
+
addButton(descriptor: ActionBarButtonDescriptor): void;
|
|
23
|
+
/**
|
|
24
|
+
* Remove action bar button
|
|
25
|
+
* {@link http://workadventure.localhost/map-building/api-ui.md#remove-action-bar | Website documentation}
|
|
26
|
+
*/
|
|
27
|
+
removeButton(id: string): void;
|
|
28
|
+
}
|
|
29
|
+
declare const _default: WorkAdventureButtonActionBarCommands;
|
|
30
|
+
export default _default;
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import { IframeApiContribution } from "../IframeApiContribution";
|
|
2
2
|
import type { ModalEvent } from "../../Events/ModalEvent";
|
|
3
3
|
export declare class WorkadventureModalCommands extends IframeApiContribution<WorkadventureModalCommands> {
|
|
4
|
-
|
|
4
|
+
private _closeCallback?;
|
|
5
|
+
callbacks: {
|
|
6
|
+
type: "modalCloseTrigger";
|
|
7
|
+
callback: (event: {
|
|
8
|
+
allowApi: boolean;
|
|
9
|
+
position: "left" | "right" | "center";
|
|
10
|
+
allow: string | null;
|
|
11
|
+
src: string;
|
|
12
|
+
title: string;
|
|
13
|
+
}) => void;
|
|
14
|
+
}[];
|
|
5
15
|
/**
|
|
6
|
-
* Open instantly the
|
|
7
|
-
* {@link
|
|
16
|
+
* Open instantly the modal window.
|
|
17
|
+
* {@link http://workadventure.localhost/map-building/api-ui.md#open-the-modal-iframe | Website documentation}
|
|
8
18
|
*/
|
|
9
|
-
openModal(modalEvent: ModalEvent): void;
|
|
19
|
+
openModal(modalEvent: ModalEvent, closeCallback?: (arg: ModalEvent) => void): void;
|
|
10
20
|
/**
|
|
11
|
-
* Close instantly the
|
|
12
|
-
* {@link
|
|
21
|
+
* Close instantly the modal window.
|
|
22
|
+
* {@link http://workadventure.localhost/map-building/api-ui.md#close-the-chat-window | Website documentation}
|
|
13
23
|
*/
|
|
14
24
|
closeModal(): void;
|
|
15
25
|
}
|
package/front/Api/Iframe/ui.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { Subject } from "rxjs";
|
|
|
9
9
|
import type { UIWebsiteCommands } from "./Ui/UIWebsite";
|
|
10
10
|
import { RemotePlayer } from "./Players/RemotePlayer";
|
|
11
11
|
import type { WorkadventureModalCommands } from "./Ui/Modal";
|
|
12
|
+
import { WorkAdventureButtonActionBarCommands } from "./Ui/ButtonActionBar";
|
|
12
13
|
interface MenuDescriptor {
|
|
13
14
|
callback?: (commandDescriptor: string) => void;
|
|
14
15
|
iframe?: string;
|
|
@@ -111,6 +112,7 @@ export declare class WorkAdventureUiCommands extends IframeApiContribution<WorkA
|
|
|
111
112
|
displayActionMessage(actionMessageOptions: ActionMessageOptions): ActionMessage;
|
|
112
113
|
get website(): UIWebsiteCommands;
|
|
113
114
|
get modal(): WorkadventureModalCommands;
|
|
115
|
+
get actionBar(): WorkAdventureButtonActionBarCommands;
|
|
114
116
|
}
|
|
115
117
|
declare const _default: WorkAdventureUiCommands;
|
|
116
118
|
export default _default;
|