@dcl-regenesislabs/web-editor 0.0.0-stage → 0.1.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/editor.css +1 -0
- package/editor.js +33891 -0
- package/package.json +8 -4
- package/prefabs/admin-tools/composite.json +77 -0
- package/prefabs/admin-tools/data.json +28 -0
- package/prefabs/admin-tools/icons/admin-panel-control-button.png +0 -0
- package/prefabs/admin-tools/icons/admin-panel-moderation-control-button.png +0 -0
- package/prefabs/admin-tools/icons/admin-panel-rewards-control-button.png +0 -0
- package/prefabs/admin-tools/icons/admin-panel-smart-item-control-button.png +0 -0
- package/prefabs/admin-tools/icons/admin-panel-text-announcement-control-button.png +0 -0
- package/prefabs/admin-tools/icons/admin-panel-video-control-button.png +0 -0
- package/prefabs/admin-tools/icons/admin-tool-background.png +0 -0
- package/prefabs/admin-tools/icons/announcements/text-announcement-chat-message.png +0 -0
- package/prefabs/admin-tools/icons/announcements/text-announcement-check.png +0 -0
- package/prefabs/admin-tools/icons/announcements/text-announcement-close-button.png +0 -0
- package/prefabs/admin-tools/icons/moderation/admin-panel-verified-user.png +0 -0
- package/prefabs/admin-tools/icons/moderation/ban.png +0 -0
- package/prefabs/admin-tools/icons/moderation/chevron-back.png +0 -0
- package/prefabs/admin-tools/icons/moderation/chevron-forward.png +0 -0
- package/prefabs/admin-tools/icons/moderation/close.png +0 -0
- package/prefabs/admin-tools/icons/moderation/error.png +0 -0
- package/prefabs/admin-tools/icons/moderation/person-outline.png +0 -0
- package/prefabs/admin-tools/icons/moderation-control-icon.png +0 -0
- package/prefabs/admin-tools/icons/rewards/close.png +0 -0
- package/prefabs/admin-tools/icons/rewards/send.png +0 -0
- package/prefabs/admin-tools/icons/rewards-control.png +0 -0
- package/prefabs/admin-tools/icons/smart-item-control.png +0 -0
- package/prefabs/admin-tools/icons/text-announcement-control.png +0 -0
- package/prefabs/admin-tools/icons/video/chevron-down.png +0 -0
- package/prefabs/admin-tools/icons/video/chevron-up.png +0 -0
- package/prefabs/admin-tools/icons/video/copy-to-clipboard.png +0 -0
- package/prefabs/admin-tools/icons/video/error.png +0 -0
- package/prefabs/admin-tools/icons/video/eye-off.png +0 -0
- package/prefabs/admin-tools/icons/video/eye.png +0 -0
- package/prefabs/admin-tools/icons/video/help.png +0 -0
- package/prefabs/admin-tools/icons/video/info.png +0 -0
- package/prefabs/admin-tools/icons/video/person-outline.png +0 -0
- package/prefabs/admin-tools/icons/video/star.png +0 -0
- package/prefabs/admin-tools/icons/video/video-control-dcl-cast.png +0 -0
- package/prefabs/admin-tools/icons/video/video-control-live.png +0 -0
- package/prefabs/admin-tools/icons/video/video-control-loop.png +0 -0
- package/prefabs/admin-tools/icons/video/video-control-mute.png +0 -0
- package/prefabs/admin-tools/icons/video/video-control-pause-button.png +0 -0
- package/prefabs/admin-tools/icons/video/video-control-play-button.png +0 -0
- package/prefabs/admin-tools/icons/video/video-control-video-icon.png +0 -0
- package/prefabs/admin-tools/icons/video/video-control-volume-minus-button.png +0 -0
- package/prefabs/admin-tools/icons/video/video-control-volume-plus-button.png +0 -0
- package/prefabs/admin-tools/icons/video-control.png +0 -0
- package/prefabs/admin-tools/scripts/actions.ts +206 -0
- package/prefabs/admin-tools/scripts/admin.tsx +253 -0
- package/prefabs/admin-tools/scripts/api.ts +125 -0
- package/prefabs/admin-tools/scripts/components.ts +190 -0
- package/prefabs/admin-tools/scripts/icons.ts +53 -0
- package/prefabs/admin-tools/scripts/message-bus.ts +297 -0
- package/prefabs/admin-tools/scripts/state.ts +69 -0
- package/prefabs/admin-tools/scripts/tabs/Moderation.tsx +155 -0
- package/prefabs/admin-tools/scripts/tabs/Rewards.tsx +136 -0
- package/prefabs/admin-tools/scripts/tabs/SmartItemActions.tsx +167 -0
- package/prefabs/admin-tools/scripts/tabs/TextAnnouncements.tsx +195 -0
- package/prefabs/admin-tools/scripts/tabs/VideoControl.tsx +156 -0
- package/prefabs/admin-tools/scripts/tabs/announcements/Overlay.tsx +94 -0
- package/prefabs/admin-tools/scripts/tabs/announcements/icons.ts +15 -0
- package/prefabs/admin-tools/scripts/tabs/announcements/state.ts +71 -0
- package/prefabs/admin-tools/scripts/tabs/announcements/ui.tsx +37 -0
- package/prefabs/admin-tools/scripts/tabs/moderation/AddUserInput.tsx +184 -0
- package/prefabs/admin-tools/scripts/tabs/moderation/RemoveAdminConfirmation.tsx +93 -0
- package/prefabs/admin-tools/scripts/tabs/moderation/UsersList.tsx +228 -0
- package/prefabs/admin-tools/scripts/tabs/moderation/api.ts +35 -0
- package/prefabs/admin-tools/scripts/tabs/moderation/icons.ts +23 -0
- package/prefabs/admin-tools/scripts/tabs/moderation/kick.ts +95 -0
- package/prefabs/admin-tools/scripts/tabs/moderation/state.ts +69 -0
- package/prefabs/admin-tools/scripts/tabs/moderation/ui.tsx +172 -0
- package/prefabs/admin-tools/scripts/tabs/moderation/utils.ts +88 -0
- package/prefabs/admin-tools/scripts/tabs/rewards/Button.tsx +52 -0
- package/prefabs/admin-tools/scripts/tabs/rewards/Captcha.tsx +88 -0
- package/prefabs/admin-tools/scripts/tabs/rewards/api.ts +138 -0
- package/prefabs/admin-tools/scripts/tabs/rewards/claim.ts +99 -0
- package/prefabs/admin-tools/scripts/tabs/rewards/controller.ts +103 -0
- package/prefabs/admin-tools/scripts/tabs/rewards/icons.ts +13 -0
- package/prefabs/admin-tools/scripts/tabs/rewards/state.ts +32 -0
- package/prefabs/admin-tools/scripts/tabs/smart-items/selection.ts +90 -0
- package/prefabs/admin-tools/scripts/tabs/video/DclCast.tsx +226 -0
- package/prefabs/admin-tools/scripts/tabs/video/LiveStream.tsx +284 -0
- package/prefabs/admin-tools/scripts/tabs/video/SpeakerShowcase.tsx +112 -0
- package/prefabs/admin-tools/scripts/tabs/video/VideoUrl.tsx +107 -0
- package/prefabs/admin-tools/scripts/tabs/video/Volume.tsx +69 -0
- package/prefabs/admin-tools/scripts/tabs/video/api.ts +172 -0
- package/prefabs/admin-tools/scripts/tabs/video/controls.ts +108 -0
- package/prefabs/admin-tools/scripts/tabs/video/icons.ts +59 -0
- package/prefabs/admin-tools/scripts/tabs/video/speakers.ts +43 -0
- package/prefabs/admin-tools/scripts/tabs/video/state.ts +82 -0
- package/prefabs/admin-tools/scripts/tabs/video/ui.tsx +243 -0
- package/prefabs/admin-tools/scripts/types.ts +46 -0
- package/prefabs/admin-tools/scripts/ui.tsx +122 -0
- package/prefabs/admin-tools/thumbnail.png +0 -0
- package/prefabs/announcer/ai.md +76 -0
- package/prefabs/announcer/composite.json +31 -0
- package/prefabs/announcer/data.json +35 -0
- package/prefabs/announcer/scripts/announcer.tsx +79 -0
- package/prefabs/announcer/scripts/pure/toast.ts +30 -0
- package/prefabs/announcer/thumbnail.png +0 -0
- package/prefabs/black-chair/HighBackChair.glb +0 -0
- package/prefabs/black-chair/composite.json +74 -0
- package/prefabs/black-chair/data.json +30 -0
- package/prefabs/black-chair/scripts/seat.ts +191 -0
- package/prefabs/black-chair/thumbnail.png +0 -0
- package/prefabs/catalog.json +1 -0
- package/prefabs/classic-bench/Bench_01.glb +0 -0
- package/prefabs/classic-bench/composite.json +100 -0
- package/prefabs/classic-bench/data.json +34 -0
- package/prefabs/classic-bench/file1.png +0 -0
- package/prefabs/classic-bench/scripts/seat.ts +191 -0
- package/prefabs/classic-bench/thumbnail.png +0 -0
- package/prefabs/classic-bench-armrests/Bench 1.glb +0 -0
- package/prefabs/classic-bench-armrests/composite.json +100 -0
- package/prefabs/classic-bench-armrests/data.json +30 -0
- package/prefabs/classic-bench-armrests/scripts/seat.ts +191 -0
- package/prefabs/classic-bench-armrests/thumbnail.png +0 -0
- package/prefabs/classroom-chair/Chair_02.glb +0 -0
- package/prefabs/classroom-chair/composite.json +74 -0
- package/prefabs/classroom-chair/data.json +34 -0
- package/prefabs/classroom-chair/file1.png +0 -0
- package/prefabs/classroom-chair/scripts/seat.ts +191 -0
- package/prefabs/classroom-chair/thumbnail.png +0 -0
- package/prefabs/court-chair/Chair_Wood_01.glb +0 -0
- package/prefabs/court-chair/FanstasyPack_TX.png +0 -0
- package/prefabs/court-chair/composite.json +74 -0
- package/prefabs/court-chair/data.json +34 -0
- package/prefabs/court-chair/scripts/seat.ts +191 -0
- package/prefabs/court-chair/thumbnail.png +0 -0
- package/prefabs/curved-couch/CurvedCouch.glb +0 -0
- package/prefabs/curved-couch/composite.json +100 -0
- package/prefabs/curved-couch/data.json +30 -0
- package/prefabs/curved-couch/scripts/seat.ts +191 -0
- package/prefabs/curved-couch/thumbnail.png +0 -0
- package/prefabs/game-flow/ai.md +94 -0
- package/prefabs/game-flow/composite.json +45 -0
- package/prefabs/game-flow/data.json +27 -0
- package/prefabs/game-flow/scripts/game-flow.ts +168 -0
- package/prefabs/game-flow/scripts/pure/flow.ts +185 -0
- package/prefabs/game-flow/thumbnail.png +0 -0
- package/prefabs/health-respawn/ai.md +76 -0
- package/prefabs/health-respawn/composite.json +31 -0
- package/prefabs/health-respawn/data.json +38 -0
- package/prefabs/health-respawn/scripts/health-respawn.ts +98 -0
- package/prefabs/health-respawn/scripts/health.ts +22 -0
- package/prefabs/health-respawn/scripts/pure/health.ts +60 -0
- package/prefabs/health-respawn/thumbnail.png +0 -0
- package/prefabs/high-stool/HighStool.glb +0 -0
- package/prefabs/high-stool/composite.json +74 -0
- package/prefabs/high-stool/data.json +30 -0
- package/prefabs/high-stool/scripts/seat.ts +191 -0
- package/prefabs/high-stool/thumbnail.png +0 -0
- package/prefabs/large-couch/ThreeSeater_Couch.glb +0 -0
- package/prefabs/large-couch/composite.json +100 -0
- package/prefabs/large-couch/data.json +30 -0
- package/prefabs/large-couch/scripts/seat.ts +191 -0
- package/prefabs/large-couch/thumbnail.png +0 -0
- package/prefabs/leaderboard/ai.md +75 -0
- package/prefabs/leaderboard/board-panel.glb +0 -0
- package/prefabs/leaderboard/composite.json +82 -0
- package/prefabs/leaderboard/data.json +35 -0
- package/prefabs/leaderboard/scripts/leaderboard.ts +66 -0
- package/prefabs/leaderboard/scripts/pure/board.ts +71 -0
- package/prefabs/leaderboard/thumbnail.png +0 -0
- package/prefabs/loveseat/Couch_01.glb +0 -0
- package/prefabs/loveseat/composite.json +100 -0
- package/prefabs/loveseat/data.json +34 -0
- package/prefabs/loveseat/file1.png +0 -0
- package/prefabs/loveseat/scripts/seat.ts +191 -0
- package/prefabs/loveseat/thumbnail.png +0 -0
- package/prefabs/modern-sofa/ModernSofa.glb +0 -0
- package/prefabs/modern-sofa/composite.json +100 -0
- package/prefabs/modern-sofa/data.json +30 -0
- package/prefabs/modern-sofa/scripts/seat.ts +191 -0
- package/prefabs/modern-sofa/thumbnail.png +0 -0
- package/prefabs/outdoor-chair/Chair_07.glb +0 -0
- package/prefabs/outdoor-chair/composite.json +74 -0
- package/prefabs/outdoor-chair/data.json +34 -0
- package/prefabs/outdoor-chair/file1.png +0 -0
- package/prefabs/outdoor-chair/scripts/seat.ts +191 -0
- package/prefabs/outdoor-chair/thumbnail.png +0 -0
- package/prefabs/rustic-bench/Bench_01.glb +0 -0
- package/prefabs/rustic-bench/PiratesPack_TX.png.png +0 -0
- package/prefabs/rustic-bench/composite.json +100 -0
- package/prefabs/rustic-bench/data.json +34 -0
- package/prefabs/rustic-bench/scripts/seat.ts +191 -0
- package/prefabs/rustic-bench/thumbnail.png +0 -0
- package/prefabs/rustic-round-stool/Chairwood_01.glb +0 -0
- package/prefabs/rustic-round-stool/PiratesPack_TX.png.png +0 -0
- package/prefabs/rustic-round-stool/composite.json +74 -0
- package/prefabs/rustic-round-stool/data.json +34 -0
- package/prefabs/rustic-round-stool/scripts/seat.ts +191 -0
- package/prefabs/rustic-round-stool/thumbnail.png +0 -0
- package/prefabs/rustic-square-stool/Chairwood_02.glb +0 -0
- package/prefabs/rustic-square-stool/PiratesPack_TX.png.png +0 -0
- package/prefabs/rustic-square-stool/composite.json +74 -0
- package/prefabs/rustic-square-stool/data.json +34 -0
- package/prefabs/rustic-square-stool/scripts/seat.ts +191 -0
- package/prefabs/rustic-square-stool/thumbnail.png +0 -0
- package/prefabs/server-clock/ai.md +67 -0
- package/prefabs/server-clock/composite.json +45 -0
- package/prefabs/server-clock/data.json +24 -0
- package/prefabs/server-clock/scripts/clock-hud.tsx +55 -0
- package/prefabs/server-clock/scripts/server-clock.ts +71 -0
- package/prefabs/server-clock/thumbnail.png +0 -0
- package/prefabs/simple-chair/Chair_03.glb +0 -0
- package/prefabs/simple-chair/composite.json +74 -0
- package/prefabs/simple-chair/data.json +34 -0
- package/prefabs/simple-chair/file1.png +0 -0
- package/prefabs/simple-chair/scripts/seat.ts +191 -0
- package/prefabs/simple-chair/thumbnail.png +0 -0
- package/prefabs/sit-spot/composite.json +45 -0
- package/prefabs/sit-spot/data.json +30 -0
- package/prefabs/sit-spot/scripts/seat.ts +191 -0
- package/prefabs/sit-spot/thumbnail.png +0 -0
- package/prefabs/sit-spot-edge/composite.json +42 -0
- package/prefabs/sit-spot-edge/data.json +32 -0
- package/prefabs/sit-spot-edge/emotes/Sit_Edge1_emote.glb +0 -0
- package/prefabs/sit-spot-edge/emotes/Sit_Edge2_emote.glb +0 -0
- package/prefabs/sit-spot-edge/scripts/seat.ts +191 -0
- package/prefabs/sit-spot-edge/thumbnail.png +0 -0
- package/prefabs/small-couch/TwoSeater_Couch.glb +0 -0
- package/prefabs/small-couch/composite.json +100 -0
- package/prefabs/small-couch/data.json +30 -0
- package/prefabs/small-couch/scripts/seat.ts +191 -0
- package/prefabs/small-couch/thumbnail.png +0 -0
- package/prefabs/spawner/ai.md +109 -0
- package/prefabs/spawner/composite.json +73 -0
- package/prefabs/spawner/data.json +22 -0
- package/prefabs/spawner/scripts/spawner.ts +380 -0
- package/prefabs/spawner/thumbnail.png +0 -0
- package/prefabs/steampunk-bench/Steampunk Bench.glb +0 -0
- package/prefabs/steampunk-bench/composite.json +100 -0
- package/prefabs/steampunk-bench/data.json +30 -0
- package/prefabs/steampunk-bench/scripts/seat.ts +191 -0
- package/prefabs/steampunk-bench/thumbnail.png +0 -0
- package/prefabs/steampunk-chair/Steampunk Chair.glb +0 -0
- package/prefabs/steampunk-chair/composite.json +74 -0
- package/prefabs/steampunk-chair/data.json +30 -0
- package/prefabs/steampunk-chair/scripts/seat.ts +191 -0
- package/prefabs/steampunk-chair/thumbnail.png +0 -0
- package/prefabs/tall-stool/Stool_D.glb +0 -0
- package/prefabs/tall-stool/composite.json +74 -0
- package/prefabs/tall-stool/data.json +30 -0
- package/prefabs/tall-stool/scripts/seat.ts +191 -0
- package/prefabs/tall-stool/thumbnail.png +0 -0
- package/prefabs/trigger-zone/ai.md +115 -0
- package/prefabs/trigger-zone/composite.json +52 -0
- package/prefabs/trigger-zone/data.json +31 -0
- package/prefabs/trigger-zone/scripts/trigger-zone.ts +89 -0
- package/prefabs/trigger-zone/thumbnail.png +0 -0
- package/prefabs/video-screen/composite.json +98 -0
- package/prefabs/video-screen/data.json +21 -0
- package/prefabs/video-screen/thumbnail.png +0 -0
- package/prefabs/video-screen/video_player.glb +0 -0
- package/prefabs/wooden-chair/Chair 1.glb +0 -0
- package/prefabs/wooden-chair/composite.json +74 -0
- package/prefabs/wooden-chair/data.json +30 -0
- package/prefabs/wooden-chair/scripts/seat.ts +191 -0
- package/prefabs/wooden-chair/thumbnail.png +0 -0
- package/prefabs/wooden-chair-armrests/Chair 3.glb +0 -0
- package/prefabs/wooden-chair-armrests/composite.json +74 -0
- package/prefabs/wooden-chair-armrests/data.json +30 -0
- package/prefabs/wooden-chair-armrests/scripts/seat.ts +191 -0
- package/prefabs/wooden-chair-armrests/thumbnail.png +0 -0
- package/scene/about +17 -0
- package/scene/bafkreias2w4xuqaic6sdcvblrisayi6xg7drfowzpt5ubjkmrk3mx6czc4 +1 -0
- package/scene/bafkreiby2gmthtauf7cckttphmhpecsueyypi2hzlke4lcodg7fm4cm2sq +23 -0
- package/scene/bafkreidhwqwajqk4nsuffef5fkdrgmp5ql6vnn2knpqsuqalyosv5o6lk4 +1 -0
- package/scene/bafkreihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku +0 -0
- package/scene/bafybeihw3xlbff4sf5sc3kvmlmlwf2visnty5lfymawlunzt5vrkp5fd7u +90 -0
- package/web-build/esbuild.wasm +0 -0
- package/web-build/index.js +3 -0
- package/web-build/sdk-snapshot.json +1 -0
- package/web-build/worker.js +701 -0
- package/README.md +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl-regenesislabs/web-editor",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The Decentraland scene editor for the web explorer: editor.js plus the files it loads beside it. Served by version, not installed.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/dcl-regenesislabs/bevy-editor.git",
|
|
8
|
+
"directory": "packages/web"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"components": [
|
|
4
|
+
{
|
|
5
|
+
"name": "core-schema::Name",
|
|
6
|
+
"data": {
|
|
7
|
+
"0": {
|
|
8
|
+
"json": {
|
|
9
|
+
"value": "Admin Tools"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "asset-packs::AdminTools",
|
|
16
|
+
"data": {
|
|
17
|
+
"0": {
|
|
18
|
+
"json": {
|
|
19
|
+
"adminPermissions": "PUBLIC",
|
|
20
|
+
"authorizedAdminUsers": {
|
|
21
|
+
"me": true,
|
|
22
|
+
"sceneOwners": true,
|
|
23
|
+
"allowList": true,
|
|
24
|
+
"adminAllowList": []
|
|
25
|
+
},
|
|
26
|
+
"moderationControl": {
|
|
27
|
+
"isEnabled": true,
|
|
28
|
+
"kickCoordinates": {
|
|
29
|
+
"x": 0,
|
|
30
|
+
"y": 0,
|
|
31
|
+
"z": 0
|
|
32
|
+
},
|
|
33
|
+
"allowNonOwnersManageAdminAllowList": false
|
|
34
|
+
},
|
|
35
|
+
"textAnnouncementControl": {
|
|
36
|
+
"isEnabled": true,
|
|
37
|
+
"playSoundOnEachAnnouncement": true,
|
|
38
|
+
"showAuthorOnEachAnnouncement": true
|
|
39
|
+
},
|
|
40
|
+
"videoControl": {
|
|
41
|
+
"isEnabled": true,
|
|
42
|
+
"disableVideoPlayersSound": false,
|
|
43
|
+
"showAuthorOnVideoPlayers": true,
|
|
44
|
+
"linkAllVideoPlayers": false,
|
|
45
|
+
"videoPlayers": []
|
|
46
|
+
},
|
|
47
|
+
"smartItemsControl": {
|
|
48
|
+
"isEnabled": true,
|
|
49
|
+
"linkAllSmartItems": false,
|
|
50
|
+
"smartItems": []
|
|
51
|
+
},
|
|
52
|
+
"rewardsControl": {
|
|
53
|
+
"isEnabled": false,
|
|
54
|
+
"rewardItems": []
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "asset-packs::Script",
|
|
62
|
+
"data": {
|
|
63
|
+
"0": {
|
|
64
|
+
"json": {
|
|
65
|
+
"value": [
|
|
66
|
+
{
|
|
67
|
+
"path": "{assetPath}/scripts/admin.tsx",
|
|
68
|
+
"priority": 0,
|
|
69
|
+
"layout": "{\"params\":{},\"actions\":[]}"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "14f55d0a-1691-439c-9017-8903afcce3e3",
|
|
3
|
+
"name": "Admin Tools",
|
|
4
|
+
"description": "In-world admin panel: moderate players, post announcements and control video screens. Only admins you list can open it.",
|
|
5
|
+
"category": "custom",
|
|
6
|
+
"tags": [
|
|
7
|
+
"admin",
|
|
8
|
+
"moderation",
|
|
9
|
+
"video",
|
|
10
|
+
"announcements"
|
|
11
|
+
],
|
|
12
|
+
"version": "1.0.0",
|
|
13
|
+
"changelog": [
|
|
14
|
+
{
|
|
15
|
+
"version": "1.0.0",
|
|
16
|
+
"notes": "Initial release: an in-world panel only the admins you list can open — moderate players, post announcements and control the scene's video screens."
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"origin": {
|
|
20
|
+
"source": "builtin"
|
|
21
|
+
},
|
|
22
|
+
"requiredPermissions": [
|
|
23
|
+
"USE_FETCH",
|
|
24
|
+
"USE_WEB3_API",
|
|
25
|
+
"USE_WEBSOCKET",
|
|
26
|
+
"ALLOW_TO_MOVE_PLAYER_INSIDE_SCENE"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
// A ~100-line stand-in for the Creator Hub's smart-items Actions interpreter.
|
|
2
|
+
// The admin panel only ever needs "read the target entity's asset-packs::Actions
|
|
3
|
+
// and run the one the admin picked", so this reads the component, decodes the
|
|
4
|
+
// action's jsonPayload and applies it. The full interpreter (triggers, states
|
|
5
|
+
// machine, tweens, delays, counters) is deliberately not ported.
|
|
6
|
+
import {
|
|
7
|
+
Animator,
|
|
8
|
+
AudioSource,
|
|
9
|
+
GltfContainer,
|
|
10
|
+
Material,
|
|
11
|
+
MeshCollider,
|
|
12
|
+
VideoPlayer,
|
|
13
|
+
VisibilityComponent,
|
|
14
|
+
type Entity
|
|
15
|
+
} from '@dcl/sdk/ecs'
|
|
16
|
+
import { Actions, States, type ActionEntry } from './components'
|
|
17
|
+
|
|
18
|
+
export enum ActionType {
|
|
19
|
+
PLAY_ANIMATION = 'play_animation',
|
|
20
|
+
PLAY_SOUND = 'play_sound',
|
|
21
|
+
SET_VISIBILITY = 'set_visibility',
|
|
22
|
+
SET_STATE = 'set_state',
|
|
23
|
+
PLAY_VIDEO_STREAM = 'play_video_stream'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const SUPPORTED_ACTIONS: readonly string[] = [
|
|
27
|
+
ActionType.PLAY_ANIMATION,
|
|
28
|
+
ActionType.PLAY_SOUND,
|
|
29
|
+
ActionType.SET_VISIBILITY,
|
|
30
|
+
ActionType.SET_STATE,
|
|
31
|
+
ActionType.PLAY_VIDEO_STREAM
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
type Listener = (action: ActionEntry) => void
|
|
35
|
+
|
|
36
|
+
// Replaces the `mitt` registry from @dcl/asset-packs/src/events.ts: one listener
|
|
37
|
+
// list per entity, so other scripts can observe what the admin panel fires.
|
|
38
|
+
const listeners = new Map<number, Listener[]>()
|
|
39
|
+
|
|
40
|
+
export function onAction(entity: Entity, listener: Listener): () => void {
|
|
41
|
+
const key = entity as number
|
|
42
|
+
const list = listeners.get(key) ?? []
|
|
43
|
+
list.push(listener)
|
|
44
|
+
listeners.set(key, list)
|
|
45
|
+
return () => {
|
|
46
|
+
const current = listeners.get(key)
|
|
47
|
+
if (current === undefined) return
|
|
48
|
+
const index = current.indexOf(listener)
|
|
49
|
+
if (index > -1) current.splice(index, 1)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function notify(entity: Entity, action: ActionEntry): void {
|
|
54
|
+
for (const listener of [...(listeners.get(entity as number) ?? [])]) listener(action)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function getActions(entity: Entity): ActionEntry[] {
|
|
58
|
+
const actions = Actions.getOrNull(entity)
|
|
59
|
+
if (actions === null) return []
|
|
60
|
+
return actions.value.map((action) => ({
|
|
61
|
+
name: action.name,
|
|
62
|
+
type: action.type,
|
|
63
|
+
jsonPayload: action.jsonPayload
|
|
64
|
+
}))
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function getActionNames(entity: Entity): string[] {
|
|
68
|
+
return getActions(entity).map((action) => action.name)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function payloadOf(action: ActionEntry): Record<string, unknown> {
|
|
72
|
+
try {
|
|
73
|
+
const parsed: unknown = JSON.parse(action.jsonPayload === '' ? '{}' : action.jsonPayload)
|
|
74
|
+
return typeof parsed === 'object' && parsed !== null ? (parsed as Record<string, unknown>) : {}
|
|
75
|
+
} catch {
|
|
76
|
+
return {}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function asString(value: unknown, fallback = ''): string {
|
|
81
|
+
return typeof value === 'string' ? value : fallback
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function asNumber(value: unknown, fallback: number): number {
|
|
85
|
+
return typeof value === 'number' && !Number.isNaN(value) ? value : fallback
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function asBoolean(value: unknown, fallback: boolean): boolean {
|
|
89
|
+
return typeof value === 'boolean' ? value : fallback
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Runs the named action on `entity`. Returns false when there is no such action. */
|
|
93
|
+
export function dispatchAction(entity: Entity, name: string): boolean {
|
|
94
|
+
const action = getActions(entity).find((candidate) => candidate.name === name)
|
|
95
|
+
if (action === undefined) return false
|
|
96
|
+
runAction(entity, action)
|
|
97
|
+
return true
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function runAction(entity: Entity, action: ActionEntry): void {
|
|
101
|
+
const payload = payloadOf(action)
|
|
102
|
+
switch (action.type) {
|
|
103
|
+
case ActionType.PLAY_ANIMATION:
|
|
104
|
+
playAnimation(entity, payload)
|
|
105
|
+
break
|
|
106
|
+
case ActionType.PLAY_SOUND:
|
|
107
|
+
playSound(entity, payload)
|
|
108
|
+
break
|
|
109
|
+
case ActionType.SET_VISIBILITY:
|
|
110
|
+
setVisibility(entity, payload)
|
|
111
|
+
break
|
|
112
|
+
case ActionType.SET_STATE:
|
|
113
|
+
setState(entity, payload)
|
|
114
|
+
break
|
|
115
|
+
case ActionType.PLAY_VIDEO_STREAM:
|
|
116
|
+
playVideoStream(entity, payload)
|
|
117
|
+
break
|
|
118
|
+
default:
|
|
119
|
+
console.log(`admin-tools: action type "${action.type}" is not supported by this prefab`)
|
|
120
|
+
}
|
|
121
|
+
notify(entity, action)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function playAnimation(entity: Entity, payload: Record<string, unknown>): void {
|
|
125
|
+
const clipName = asString(payload.animation)
|
|
126
|
+
if (clipName === '') return
|
|
127
|
+
const animator = Animator.getMutableOrNull(entity)
|
|
128
|
+
if (animator === null) return
|
|
129
|
+
if (!animator.states.some((state) => state.clip === clipName)) {
|
|
130
|
+
animator.states = [...animator.states, { clip: clipName }]
|
|
131
|
+
}
|
|
132
|
+
Animator.stopAllAnimations(entity)
|
|
133
|
+
try {
|
|
134
|
+
const clip = Animator.getClip(entity, clipName)
|
|
135
|
+
clip.playing = true
|
|
136
|
+
clip.loop = asBoolean(payload.loop, false)
|
|
137
|
+
clip.weight = 1
|
|
138
|
+
if (payload.shouldReset !== undefined) clip.shouldReset = asBoolean(payload.shouldReset, false)
|
|
139
|
+
} catch (error) {
|
|
140
|
+
console.log('admin-tools: could not play animation', error)
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function playSound(entity: Entity, payload: Record<string, unknown>): void {
|
|
145
|
+
const src = asString(payload.src)
|
|
146
|
+
if (src === '') return
|
|
147
|
+
const loop = asBoolean(payload.loop, false)
|
|
148
|
+
const volume = asNumber(payload.volume, 1)
|
|
149
|
+
const global = asBoolean(payload.global, false)
|
|
150
|
+
if (AudioSource.has(entity)) {
|
|
151
|
+
AudioSource.playSound(entity, src)
|
|
152
|
+
const audio = AudioSource.getMutable(entity)
|
|
153
|
+
audio.loop = loop
|
|
154
|
+
audio.volume = volume
|
|
155
|
+
audio.global = global
|
|
156
|
+
return
|
|
157
|
+
}
|
|
158
|
+
AudioSource.create(entity, { audioClipUrl: src, loop, playing: true, volume, global })
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function setVisibility(entity: Entity, payload: Record<string, unknown>): void {
|
|
162
|
+
const visible = asBoolean(payload.visible, true)
|
|
163
|
+
VisibilityComponent.createOrReplace(entity, { visible })
|
|
164
|
+
if (payload.collider === undefined) return
|
|
165
|
+
const collider = asNumber(payload.collider, 0)
|
|
166
|
+
const gltf = GltfContainer.getMutableOrNull(entity)
|
|
167
|
+
if (gltf !== null) {
|
|
168
|
+
gltf.invisibleMeshesCollisionMask = collider
|
|
169
|
+
if (collider === 0) gltf.visibleMeshesCollisionMask = 0
|
|
170
|
+
return
|
|
171
|
+
}
|
|
172
|
+
const mesh = MeshCollider.getMutableOrNull(entity)
|
|
173
|
+
if (mesh !== null) mesh.collisionMask = collider
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function setState(entity: Entity, payload: Record<string, unknown>): void {
|
|
177
|
+
const states = States.getMutableOrNull(entity)
|
|
178
|
+
if (states === null) return
|
|
179
|
+
const requested = asString(payload.state)
|
|
180
|
+
const fallback = states.defaultValue ?? states.value[0]
|
|
181
|
+
const next = states.value.includes(requested) ? requested : fallback
|
|
182
|
+
states.previousValue = states.currentValue ?? fallback
|
|
183
|
+
states.currentValue = next
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function playVideoStream(entity: Entity, payload: Record<string, unknown>): void {
|
|
187
|
+
const src = asString(payload.src)
|
|
188
|
+
const existing = VideoPlayer.getMutableOrNull(entity)
|
|
189
|
+
if (existing === null) {
|
|
190
|
+
if (src === '') return
|
|
191
|
+
VideoPlayer.createOrReplace(entity, {
|
|
192
|
+
src,
|
|
193
|
+
volume: asNumber(payload.volume, 1),
|
|
194
|
+
loop: asBoolean(payload.loop, false),
|
|
195
|
+
playing: true
|
|
196
|
+
})
|
|
197
|
+
if (Material.getOrNull(entity) === null) {
|
|
198
|
+
Material.setBasicMaterial(entity, { texture: Material.Texture.Video({ videoPlayerEntity: entity }) })
|
|
199
|
+
}
|
|
200
|
+
return
|
|
201
|
+
}
|
|
202
|
+
if (src !== '' && existing.src !== src) existing.src = src
|
|
203
|
+
existing.volume = asNumber(payload.volume, existing.volume ?? 1)
|
|
204
|
+
existing.loop = asBoolean(payload.loop, existing.loop ?? false)
|
|
205
|
+
existing.playing = true
|
|
206
|
+
}
|