steam-theming-utils 1.0.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.
@@ -0,0 +1,51 @@
1
+ function findFirstModule(filter, component) {
2
+ const modules = findAllModules(filter);
3
+ const printError = (msg) => {
4
+ console.error("[%s] %s", component, msg);
5
+ };
6
+
7
+ if (modules.length === 0) {
8
+ printError("found no modules");
9
+ }
10
+ if (modules.length > 1) {
11
+ printError("found more than 1 module, returning first found");
12
+ }
13
+
14
+ return modules[0];
15
+ }
16
+
17
+ /**
18
+ * Used only for usage in DevTools to identify modules easier.
19
+ */
20
+ findUniqueKey = (key, index = 0) =>
21
+ Object.keys(findAllModules((mod) => mod[key])[index]).find(
22
+ (mod) => findAllModules((mod2) => mod2[mod]).length === 1,
23
+ );
24
+
25
+ result = {
26
+ ...classModules
27
+ .flatMap((a) => {
28
+ const mod = findFirstModule(a[1], a[0]);
29
+ if (!mod) {
30
+ return {};
31
+ }
32
+
33
+ return {
34
+ [a[0]]: Object.keys(mod || {})
35
+ .filter((e) => !mod[e].match(/^\d+(\.\d+)?(\w{2})?$/))
36
+ .map((e) => Object({ [e]: mod[e] }))
37
+ .reduce((a, b) => Object.assign(a, b)),
38
+ };
39
+ })
40
+ .reduce((a, b) => Object.assign(a, b)),
41
+ ...specialCases,
42
+ };
43
+
44
+ // return
45
+ Object.keys(result)
46
+ .sort()
47
+ .reduce((obj, key) => {
48
+ obj[key] = result[key];
49
+
50
+ return obj;
51
+ }, {});
@@ -0,0 +1,451 @@
1
+ /**
2
+ * Special children that can not be easily identified.
3
+ */
4
+ specialCases = {
5
+ gamepaddialog: findAllModules(
6
+ (e) => e.WithBottomSeparator && !e.GyroButtonPickerDialog,
7
+ )[0],
8
+ cloudfileuploadbutton: findAllModules((e) => e.Ctn)[1],
9
+ image: findAllModules((e) => e.ErrorDiv)[0],
10
+ loyaltyrewarditemembed: findAllModules((e) => e.Ctn)[0],
11
+ saleeventbbcodeparser: findAllModules((e) => e.ErrorDiv)[0],
12
+ // TODO: these are seen in the css loader map, but there are no such modules
13
+ //appdetailsbroadcastsection: (e) => e,
14
+ //awardicon: e => e,
15
+ //balloon: e => e.,
16
+ //broadcast_embeddable: e => e.PopOutVideoTitleBar,
17
+ //broadcastplayer: e => e.BroadcastPlayerLite,
18
+ //broadcastwidgets: e => e.StoreSaleImage_mini,
19
+ //controllerconfiguratorgyrocalibrationdialog: (e) => e,
20
+ //controllerconfiguratormapping: (e) => e,
21
+ //friendactivityfeed: (e) => e,
22
+ //gamenotes: (e) => e.NotesPagedSettings,
23
+ //gamenotespopups: (e) => e.GameNotesPopup,
24
+ //mainmenuapprunning: (e) => e,
25
+ //pmhover: (e) => e,
26
+ //prosemirror: (e) => e,
27
+ //quickaccesscontrols: (e) => e,
28
+ //shorttemplates: (e) => e,
29
+ //soundtrackoverlay: (e) => e,
30
+ //standardtemplates: (e) => e,
31
+ //vrgamepadui: (e) => e,
32
+ };
33
+
34
+ classModules = [
35
+ ["aboutsteamdialog", (e) => e.AboutSteamDialog],
36
+ ["accountpanel", (e) => e.ChangePersonaNameContent],
37
+ ["accountsettings", (e) => e.Avatar && e.EntryLabel],
38
+ ["achievementiconbase", (e) => e.RareAchievementNoAnimation],
39
+ ["achievementsheader", (e) => e.LeaderboardsButton],
40
+ ["achievementslist", (e) => e.UserUnlockDateTime && !e.Page],
41
+ ["achievementspage", (e) => e.UserUnlockDateTime && e.Page],
42
+ ["actionbuttonlegenditem", (e) => e.ActionButtonLabel],
43
+ ["activateproductdialog", (e) => e.ActivateProductHeading],
44
+ ["addnonsteamgamedialog", (e) => e.AddNonSteamGameDialog],
45
+ ["addonpicker", (e) => e.AddonPickerMessage],
46
+ ["addtocartbutton", (e) => e.AddToCartAnchorCtn],
47
+ ["allcollections", (e) => e.CollectionLabelCount],
48
+ ["animatedcallout", (e) => e.AnimatedCallout],
49
+ ["appactionbutton", (e) => e.PlayButtonContainer],
50
+ ["appactivityday", (e) => e.AppActivityDay],
51
+ ["appactivitydlc", (e) => e.CarouselControlsPadding],
52
+ ["appcarouseltrailer", (e) => e.AppCarouselTrailerCtn],
53
+ ["appdetails", (e) => e.AppDetailsOverviewPanel],
54
+ ["appdetailsachievementssection", (e) => e.AchievementHoverContainer],
55
+ ["appdetailsactivitysection", (e) => e.ActivityFeedContainer],
56
+ [
57
+ "appdetailsadditionalcontentsection",
58
+ (e) => e.AdditionalItem && e.Soundtracks,
59
+ ],
60
+ ["appdetailsbutton", (e) => e.AppDetailsButton],
61
+ ["appdetailscommunityfeed", (e) => e.CommunityContentContainer],
62
+ ["appdetailscontrollersupport", (e) => e.ControllerSectionBody],
63
+ ["appdetailsdlcsection", (e) => e.DLCSection],
64
+ ["appdetailsfeatureicon", (e) => e.ExtraMargin],
65
+ ["appdetailsfriendssection", (e) => e.FriendsOverflow],
66
+ ["appdetailsgameinfocontainer", (e) => e.GameInfoShadow],
67
+ ["appdetailsgameinfopanel", (e) => e.GameDescription],
68
+ ["appdetailsheader", (e) => e.AppDetailsHeader],
69
+ ["appdetailshover", (e) => e.AppDetailsHover],
70
+ ["appdetailsinvalidostype", (e) => e.InvalidOSTypeBody],
71
+ ["appdetailsmastersubincluded", (e) => e.IncludedBanner],
72
+ ["appdetailsnotessection", (e) => e.NoteLink],
73
+ ["appdetailsoverview", (e) => e.SeekTarget],
74
+ ["appdetailsplaysection", (e) => e.PermanentlyUnavailable],
75
+ ["appdetailsprimarylinkssection", (e) => e.NavButton],
76
+ ["appdetailsreviewsection", (e) => e.EditMyReview],
77
+ ["appdetailsscreenshotssection", (e) => e.ScreenshotsSection],
78
+ ["appdetailssection", (e) => e.AppDetailsSection],
79
+ ["appdetailssectionheader", (e) => e.SectionHeader],
80
+ [
81
+ "appdetailssectionnonsteam",
82
+ (e) => e.OfflineButton && e.Body && Object.keys(e).length === 3,
83
+ ],
84
+ ["appdetailssectionoffline", (e) => e.OfflineSectionBody],
85
+ ["appdetailssoundtrack", (e) => e.BackgroundBlurArt],
86
+ ["appdetailsspotlight", (e) => e.RatingContainer && e.Info],
87
+ ["appdetailstimedtrialbanner", (e) => e.MasterSubLink],
88
+ ["appdetailstradingcardssection", (e) => e.CardsSection],
89
+ ["appdetailsworkshopsection", (e) => e.WorkshopSection],
90
+ ["appfilterpane", (e) => e.SteamDeckCompatDropDown],
91
+ ["appgrid", (e) => e.LibraryImageBackgroundGlow],
92
+ ["applaunchingdetails", (e) => e.ShowControlOverviewContainerAnimation],
93
+ ["apppartnereventspage", (e) => e.AppBannerBackground],
94
+ ["appportrait", (e) => e.NoCapsuleImage],
95
+ ["appportraithover", (e) => e.AppPortraitHover],
96
+ ["appproperties", (e) => e.AppProperties],
97
+ ["artworkmodal", (e) => e.Creator && e.ShareButton],
98
+ ["audio", (e) => e.VolumeSliderLabel],
99
+ ["audiosettings", (e) => e.AudioAppCtn],
100
+ ["awardmodal", (e) => e.GrantAwardModal],
101
+ ["backbutton", (e) => e.BackButton],
102
+ ["backgroundglass", (e) => e.BackgroundGlass],
103
+ ["backupappsdialog", (e) => e.BackupAppsBrowse],
104
+ ["basicappdetailssectionstyler", (e) => e.AppDetailsContent],
105
+ ["basicgamecarousel", (e) => e.BasicGameCarousel],
106
+ [
107
+ "basiclibrary",
108
+ (e) => e.LibraryContextMenu && e.OverlayTransitionDurationMS,
109
+ ],
110
+ ["basiclibrarysettingszoo", (e) => e.GiantHeading],
111
+ ["basicpartnereventspage", (e) => e.BasicPartnerEventsPage],
112
+ ["bbcode", (e) => e.ChatMessageSteamStore],
113
+ ["bbcodeeditor", (e) => e.DragTarget],
114
+ ["bbcodes", (e) => e.QuoteAuthor],
115
+ ["bbcodesuggestions", (e) => e.BBCode],
116
+ ["bluetoothsettings", (e) => e.NotConnectedLabel],
117
+ ["borrowgamedialog", (e) => e.BorrowGameDialog],
118
+ ["bottombar", (e) => e.BottomBarContainer],
119
+ ["boxcarousel", (e) => e.BoxCarousel],
120
+ ["broadcastchat", (e) => e.BroadcastChat],
121
+ ["broadcastchatannouncement", (e) => e.GiveawayWinnerBox],
122
+ ["broadcastfirsttime", (e) => e.BroadcastFirstTimeDialog],
123
+ ["broadcastsettings", (e) => e.ConfigureMic],
124
+ ["broadcaststatus", (e) => e.BroadcastStatusBody],
125
+ ["browserviewfindinpage", (e) => e.ControlButton],
126
+ ["captiveportaldialog", (e) => e.CaptivePortalBrowserView],
127
+ ["carousel", (e) => e.carouselNavButton],
128
+ ["cdkeysdialog", (e) => e.CDKeyOption],
129
+ ["changeuserdialog", (e) => e.Prompt && e.Warning],
130
+ ["chatentry", (e) => e.chatEntryControls],
131
+ // this is old but v*lve does not ever remove things
132
+ ["chatroom", (e) => e.YuleLog],
133
+ ["chatroomeffects", (e) => e.Snowflake],
134
+ ["chatroomgroupsettings", (e) => e.ChannelsButtons],
135
+ ["chatroommenu", (e) => e.ChatRoomContextNoPermission],
136
+ ["chatroomnotificationsettings", (e) => e.scrollMaskVertical],
137
+ ["chattabs", (e) => e.ChatTabTransitionGroup],
138
+ ["checkforupdatesdialog", (e) => e.CheckForUpdatesDialog],
139
+ ["claimitemshared", (e) => e.DialogCtn],
140
+ ["clanimagechooser", (e) => e.ImagesOuterContainer],
141
+ ["clanimagepickandresize", (e) => e.Image && Object.keys(e).length === 1],
142
+ ["cloudconflict", (e) => e.ConflictChoiceText],
143
+ ["cloudfileuploadprogress", (e) => e.UploadPreviewContainer],
144
+ ["collapseicon", (e) => e.CollapseIconParent],
145
+ ["collectionbanner", (e) => e.CollectionShelfBanner],
146
+ ["collectionview", (e) => e.DynamicCollectionLabelAndButton],
147
+ ["colorsettings", (e) => e.FloatingControls],
148
+ ["comment_thread", (e) => e.ActivityCommentThread],
149
+ ["console", (e) => e.Console],
150
+ ["contentmanagement", (e) => e.ContentManagement],
151
+ ["contextmenu", (e) => e.ContextMenuFocusContainer],
152
+ ["controllerconfigurator", (e) => e.ControllerConfiguratorActionSetSelector],
153
+ ["controllerconfigurator_mouseposition", (e) => e.BackgroundScreenshot],
154
+ [
155
+ "controllerconfiguratoractionsetselector",
156
+ (e) => e.ActionSetNameOverIndicators,
157
+ ],
158
+ ["controllerconfiguratorchoosebinding", (e) => e.CombinedKeyboardContainer],
159
+ ["controllerconfiguratorchooseconfiguration", (e) => e.ConfigurationButton],
160
+ ["controllerconfiguratorgyrobuttonpicker", (e) => e.GyroButtonPickerDialog],
161
+ ["controllerconfiguratoriconpicker", (e) => e.BindingIconImage],
162
+ ["controllerconfiguratorsummary", (e) => e.StandardControl],
163
+ ["controllerconfiguratorvirtualmenus", (e) => e.VirtualMenus],
164
+ [
165
+ "controllerconfiguratorvisualizer_deadzones",
166
+ (e) => e.VisualizerCenterXOffset,
167
+ ],
168
+ ["controllersettings", (e) => e.ControllerName],
169
+ ["creatorhomeembed", (e) => e.DevSummaryCtn],
170
+ ["cropmodal", (e) => e.CropImage],
171
+ ["cssgrid", (e) => e.CSSGrid],
172
+ ["customizationsettings", (e) => e.StartupMoviesSelectionDesc],
173
+ ["debugpointer", (e) => e.DebugPointer],
174
+ ["deckcompaticons", (e) => e.CompatIcon],
175
+ ["decksetuphelp", (e) => e.SetupHelp],
176
+ ["deckverified", (e) => e.CompatibilityDetailsContainerDesktop],
177
+ ["deferredsettinglabel", (e) => e.DeferredSettingLabel],
178
+ ["demobutton", (e) => e.DemoButton && e.DisabledButton],
179
+ ["deskjobpromo", (e) => e.DeskJobPromo],
180
+ ["desktopbrowser", (e) => e.BrowserTabs],
181
+ ["desktopsecuritysettings", (e) => e.SteamGuardIcon],
182
+ ["desktoptoasts", (e) => e.DesktopToastPopup],
183
+ ["dialogs", (e) => e.DialogTitle && e.DialogContent],
184
+ ["discoveryqueuewidget", (e) => e.DiscoveryQueueCarousel],
185
+ ["discoveryqueuewizard", (e) => e.DeckVerifiedLogo],
186
+ ["discussionwidget", (e) => e.DiscussContainer],
187
+ ["displayscaledialog", (e) => e.YouCanChangeThisLater],
188
+ ["displaysettings", (e) => e.TimeRangeControls && !e.BandwidthInput],
189
+ ["downloadgraph", (e) => e.DownloadGraph],
190
+ ["downloads", (e) => e.InProgress],
191
+ ["downloadsettings", (e) => e.BandwidthLimit],
192
+ ["draganddrop", (e) => e.GhostContainer],
193
+ ["dropdown", (e) => e.DialogDropDownMenu],
194
+ ["dropdownlabel", (e) => e.DropDownLabelTitle],
195
+ ["durationcontrol", (e) => e.DurationControlInit],
196
+ ["durationcontroldialog", (e) => e.DurationControlDialog],
197
+ ["eaaccessdialog", (e) => e.Description && e.DialogContainer],
198
+ ["emoticon", (e) => e.StickerHoverSticker],
199
+ ["emoticonsuggestion", (e) => e.Emoticon_Toggle],
200
+ ["errorconditiondesktop", (e) => e.RefreshLoginDialogModal],
201
+ ["errorconditionpanel", (e) => e.ErrorConditionContainer],
202
+ ["euladialog", (e) => e.EulaDialogContent],
203
+ ["eventbbcodeparser", (e) => e.LoyaltyRewardCtn],
204
+ ["eventbbcodesketchfab", (e) => e.sketchfabmodelembedded],
205
+ [
206
+ "eventdescriptionstorecapsule",
207
+ (e) => e.AppSummaryWidgetCtn && Object.keys(e).length === 1,
208
+ ],
209
+ ["eventreminder", (e) => e.ReminderCheck],
210
+ ["expandableimage", (e) => e.PreviewCtn && e.SVG],
211
+ ["facetedbrowse", (e) => e.FacetedBrowseInnerCtn],
212
+ ["familysettings", (e) => e.AuthorizeUserField],
213
+ ["familysharedcomponents", (e) => e.FamilyMemberRowTop],
214
+ ["fastscrolloverlay", (e) => e.FastScrollOverlay],
215
+ ["focusring", (e) => e.FocusRing],
216
+ ["footer", (e) => e.BasicFooter],
217
+ ["footericons", (e) => e.Knockout],
218
+ ["friendinvites", (e) => e.IncomingInvites],
219
+ ["friendslist", (e) => e.FriendsChatsContainer],
220
+ ["friendsnooze", (e) => e.SnoozeZ],
221
+ ["friendssettings", (e) => e.FakeFriend],
222
+ ["gameactions", (e) => e.GotSteamDialog],
223
+ ["gamecapsule", (e) => e.GameCapsule],
224
+ ["gamehover", (e) => e.GameTitle],
225
+ ["gameinfodialog", (e) => e.GameInfoDialogContents],
226
+ ["gamelaunchingdialog", (e) => e.GameLaunchingDialog],
227
+ ["gamelist", (e) => e.NoSearchResultsContainer],
228
+ ["gamelistbar", (e) => e.GameListHomeAndSearch],
229
+ ["gamelistcollectionmenu", (e) => e.CollectionDeleteContainer],
230
+ ["gamelistdropdown", (e) => e.ScrollToTop],
231
+ ["gamelistentry", (e) => e.GameListEntryName],
232
+ ["gamelisthome", (e) => e.CollectionIconBox],
233
+ ["gamelistsearchbar", (e) => e.SearchFilterInputClear],
234
+ ["gamelistsectionheader", (e) => e.SectionHeaderContent],
235
+ ["gamepadcolorpicker", (e) => e.ColorPickerPreview],
236
+ ["gamepadcontextmenu", (e) => e.BasicContextMenuHeader],
237
+ [
238
+ "gamepaddropdown",
239
+ (e) => e.DropDownControlButton && Object.keys(e).length === 2,
240
+ ],
241
+ ["gamepadhome", (e) => e.TabbedContent],
242
+ ["gamepadhomefriends", (e) => e.FavoriteFriend],
243
+ ["gamepadhomerecentgames", (e) => e.RecentGamesBackground],
244
+ ["gamepadhomerecommended", (e) => e.PlayNextCarousel],
245
+ ["gamepadhomewhatsnew", (e) => e.LibraryHomeWhatsNew],
246
+ ["gamepadinput", (e) => e.TogglePasswordVisibilityBtn],
247
+ ["gamepadlibrary", (e) => e.GamepadLibrary],
248
+ ["gamepadpage", (e) => e.GamepadPage && !e.LeftStick],
249
+ ["gamepadpagedsettings", (e) => e.PagedSettingsDialog_PageList_ShowTitle],
250
+ ["gamepadsearch", (e) => e.GamepadSearch],
251
+ ["gamepadslider", (e) => e.DefaultValueIsColorRange],
252
+ ["gamepadtabbedpage", (e) => e.CanBeHeaderBackground],
253
+ ["gamepadtoasts", (e) => e.GamepadToastPlaceholder],
254
+ ["gamepadui", (e) => e.GamepadUIPopupWindowBody],
255
+ ["gamepadui_svg_library", (e) => e.WifiBar1],
256
+ ["gamepaduiappoverlay", (e) => e.OverlayPosition],
257
+ ["gamepaduiappoverlayvirtualmenucontainer", (e) => e.VirtualMenuContainer],
258
+ ["guidedtour", (e) => e.PageIndicator],
259
+ ["gyroscopenoisebar", (e) => e.RotateChilden],
260
+ ["hardwaresurveydialog", (e) => e.HardwareSurveySections],
261
+ ["header", (e) => e.SuppressInteraction],
262
+ ["headerbrowser", (e) => e.HeaderBrowser],
263
+ ["homesettings", (e) => e.AppSelectorButton],
264
+ ["homestorecarousel", (e) => e.StoreCarouselCtn],
265
+ ["hoverposition", (e) => e.HoverPosition],
266
+ ["htmlpopupdialog", (e) => e.HTMLPopupDialog],
267
+ ["index", (e) => e.ThreeDots],
268
+ ["infoicon", (e) => e.MoreInfoIcon],
269
+ ["insetshadow", (e) => e.FriendsListInsetShadowCtn],
270
+ ["installdialog", (e) => e.DownloadItem],
271
+ ["installrequest", (e) => e.AppSizeRequired],
272
+ ["invitedrop", (e) => e.InviteDropMessage],
273
+ ["jumplist", (e) => e.JumpListItemText],
274
+ ["keyboardsettings", (e) => e.KeyboardThemeButtons],
275
+ ["keycapture", (e) => e.Capturing && !e.RecommendedNote],
276
+ ["languagescreen", (e) => e.LanguageScreen],
277
+ ["launchoptionsdialog", (e) => e.LaunchOptionDialog],
278
+ ["library", (e) => e.LibraryContextMenu && !e.OverlayTransitionDurationMS],
279
+ ["libraryassetimage", (e) => e.GreyBackground],
280
+ ["librarydesktopapps", (e) => e.DesktopApps],
281
+ ["libraryhome", (e) => e.LibraryHome],
282
+ ["libraryhomegamereleased", (e) => e.PrePurchaseContainer],
283
+ ["libraryhomemajorupdates", (e) => e.LibraryHomeMajorUpdates],
284
+ ["libraryhomenewupdates", (e) => e.WhatsNewGameListRow],
285
+ ["libraryhomeplaynext", (e) => e.PlayNextSubHead],
286
+ ["libraryhomerecentgames", (e) => e.RecentGames],
287
+ ["libraryhomeshowcases", (e) => e.DragInProgress],
288
+ ["librarysettings", (e) => e.LibrarySettings],
289
+ ["librarywhatsnew", (e) => e.ReadMore],
290
+ ["linkregionbox", (e) => e.LinkRegionDragBox],
291
+ ["loadingthrobber", (e) => e.SpinnerLoaderContainer],
292
+ ["localdateandtime", (e) => e.DateAndTimeInline],
293
+ ["lockscreen", (e) => e.PINClearedQuestion],
294
+ ["login", (e) => e.UserChooser],
295
+ ["loginpanel", (e) => e.LoginBackground],
296
+ ["logsettings", (e) => e.ManualOverlayContainer],
297
+ ["main", (e) => e.throbberContainer],
298
+ ["mainbrowser", (e) => e.MainBrowserContainer],
299
+ ["mainmenu", (e) => e.IsVirtualKeyboardShown],
300
+ ["mainpanelapprunning", (e) => e.MainPanelAppRunning],
301
+ ["managefriends", (e) => e.GenerateLinkButton],
302
+ ["mandatoryupdate", (e) => e.MandatoryUpdateTakeoverContent],
303
+ ["marketingmessages", (e) => e.Seen],
304
+ ["marketingmessagesdialog", (e) => e.MarketingMessagesDialog],
305
+ ["marquee", (e) => e.Marquee],
306
+ ["mediadialog", (e) => e.MM],
307
+ ["mediapage", (e) => e.MediaPage],
308
+ ["menu", (e) => e.MenuWrapper],
309
+ ["messages", (e) => e.MsgWithAddons],
310
+ ["miniprofile", (e) => e.playerContent],
311
+ ["modals", (e) => e.BodyNoScroll],
312
+ ["moveappsdialog", (e) => e.MoveAppsDialog],
313
+ ["mustupdateclientdialog", (e) => e.MustUpdateClientModalContent],
314
+ ["networkconnectiondialog", (e) => e.ConnectionStatus],
315
+ ["networkdiagnosticsdialog", (e) => e.ColumnDisplayName],
316
+ ["networkinfodialog", (e) => e.InfoDialogBody],
317
+ ["networkscreen", (e) => e.NetworkScreen],
318
+ ["networksettings", (e) => e.NetworkWarning && e.OfflineMode],
319
+ ["newlogindialog", (e) => e.MessagingContainer],
320
+ ["newloginpanel", (e) => e.CreateAccountButton],
321
+ ["nogamesdisplay", (e) => e.VisitStore],
322
+ ["nominationandvote", (e) => e.SteamAwardHeader],
323
+ ["nonetworkoverlay", (e) => e.NoNetwork],
324
+ ["notificationcontent", (e) => e.DownloadCompleteText],
325
+ ["notificationssettings", (e) => e.FriendsDescription],
326
+ ["oobecontrols", (e) => e.Icons && e.Label],
327
+ ["oobeerrorscreen", (e) => e.EqualWidthButtonPair],
328
+ ["overflowbox", (e) => e.OverflowBox],
329
+ ["overlappingtransition", (e) => e.ContentWrapper && e.TransitionGroup],
330
+ ["overlaybrowser", (e) => e.OverlayBrowserContainer],
331
+ ["overlaydialogs", (e) => e.Invited],
332
+ ["overlayguides", (e) => e.GuidesHomeHeaderDesc],
333
+ ["overlaytimer", (e) => e.Seconds],
334
+ ["pageablecontainer", (e) => e.HeaderPageControls],
335
+ ["pagedcontent", (e) => e.NavTitle],
336
+ [
337
+ "pagedsettings",
338
+ (e) =>
339
+ e.PagedSettingsDialog_Title && !e.PagedSettingsDialog_PageList_ShowTitle,
340
+ ],
341
+ ["parentalunlockdialog", (e) => e.RemotePlayStoreBlockedDialog],
342
+ ["partnereventdialog", (e) => e.ErrorIconLayout],
343
+ ["partnereventdisplay", (e) => e.EventDetailsPageContainer],
344
+ ["partnereventreferencedapps", (e) => e.ReferencedApps],
345
+ ["partnereventshared", (e) => e.PartnerEventFont],
346
+ ["partnersaledisplay", (e) => e.SalePageLogoSet],
347
+ ["perf", (e) => e.PerfProfileInfo && !e.HDRBadge],
348
+ ["personanameandstatus", (e) => e.statusAndName],
349
+ ["personastatusicons", (e) => e.PersonaStatusIcon],
350
+ ["pininput", (e) => e.DigitInputField],
351
+ ["playersdialog", (e) => e.PlayersDialog],
352
+ ["posttextentry", (e) => e.PostTextEntryArea],
353
+ ["powermenu", (e) => e.SuspendDialog],
354
+ ["presenterpopup", (e) => e.Speaker],
355
+ ["progressbar", (e) => e.ProgressBarFieldStatus],
356
+ ["qrcode", (e) => e.QRBits],
357
+ ["qrlogin", (e) => e.LoginQR],
358
+ [
359
+ "quickaccesscontrollerorder",
360
+ (e) => e.OptedOut && Object.keys(e).length === 2,
361
+ ],
362
+ ["quickaccessmenu", (e) => e.BatteryProjectedValue && e.Up],
363
+ [
364
+ "quickaccessvoicecontrolssteamdeck",
365
+ (e) => e.FriendVoiceChatSliderContainer,
366
+ ],
367
+ ["radio", (e) => e.Button && e.Group],
368
+ ["reactions", (e) => e.ReactorName],
369
+ ["recentchatssteamdeck", (e) => e.RecentChatsList],
370
+ ["recentlycompleted", (e) => e.RecentlyCompleted],
371
+ ["reloadingdialog", (e) => e.Popup && Object.keys(e).length === 1],
372
+ ["remainderlist", (e) => e.ItemWrapper],
373
+ ["remoteplay", (e) => e.ContentForm],
374
+ ["remoteplaydialog", (e) => e.DialogBodyText && Object.keys(e).length === 2],
375
+ ["remoteplaysettings", (e) => e.SubSetting],
376
+ ["removefreeappdialog", (e) => e.RemovingText],
377
+ ["removegamehover", (e) => e.RemoveBoxTransition],
378
+ ["reorderablelist", (e) => e.ReorderableListDialog],
379
+ ["reportaicontentdialog", (e) => e.ReportText],
380
+ ["reportitem", (e) => e.DMCA],
381
+ ["requestplaytime", (e) => e.ErrorText && Object.keys(e).length === 1],
382
+ ["resetcollectionsdialog", (e) => e.AfterResetSummary],
383
+ ["rootmenu", (e) => e.RootMenuButton],
384
+ ["salebanner", (e) => e.Big],
385
+ ["salepreviewwidgets", (e) => e.StoreSaleWidgetContainer],
386
+ ["savecollectiondialog", (e) => e.SaveCollectionContainer],
387
+ ["screenshotmanagerdialog", (e) => e.ScreenshotFormRow],
388
+ ["screenshotpopout", (e) => e.PopupScreenshotModal],
389
+ ["screenshots", (e) => e.ClickableScreenshot],
390
+ ["scrollfade", (e) => e.ScrollFade],
391
+ ["scrollpanel", (e) => e.ScrollPanel],
392
+ ["scrollsnapcarousel", (e) => e.ScrollSnapCarousel],
393
+ ["searchbar", (e) => e.SearchAndTitleContainer],
394
+ ["seasonalsale", (e) => e.SeasonalSale],
395
+ ["segmentedinputs", (e) => e.SegmentedCharacterInput && !e.Text],
396
+ ["serverbrowserdialog", (e) => e.ServerBrowserDialog],
397
+ ["settings", (e) => e.SettingsDialogSubHeader],
398
+ ["shared_common", (e) => e.v6 && e.AvatarImage],
399
+ ["sharedappdetailsheader", (e) => e.BoxSizerDelete],
400
+ ["sharedialog", (e) => e.ShareButton && e.ShareIcon],
401
+ ["sharescreenshotupload", (e) => e.ShareScreenshotDialog],
402
+ ["sharewithfriends", (e) => e.ShareDescription],
403
+ ["shutdowndialog", (e) => e.ShutdownDialog],
404
+ ["sketchfab", (e) => e.sketchfabmodelembedded],
405
+ ["smartscrollcontainer", (e) => e.ScrollToTopButtonPosition],
406
+ ["sortingdropdowncontrolbutton", (e) => e.SortingDropDownControlButton],
407
+ ["soundtrackcontrols", (e) => e.ControlsAndVolume],
408
+ ["spotlight", (e) => e.SpotlightDLC],
409
+ ["spotlightgameplaysummary", (e) => e.GamePlaySummaryContainer],
410
+ ["ssadialog", (e) => e.SSADialog],
411
+ ["steamavatar", (e) => e.avatarFrameImg],
412
+ ["steamchinareviewlauncher", (e) => e.AccountMenu && e.AppStatus],
413
+ ["steamdeckbootupthrobber", (e) => e.MoviePlaying],
414
+ ["steamdeckcompatfilter", (e) => e.SelectedFilterOption],
415
+ ["steamdesktop", (e) => e.FocusBar],
416
+ ["steamdesktopoverlay", (e) => e.BackToGameBtn],
417
+ ["steamos", (e) => e.DestructiveActionButtonIcon],
418
+ ["steamtemplates", (e) => e.AllNotificationsCommentPlus],
419
+ ["suggestdialog", (e) => e.mentionSearchText],
420
+ ["supernav", (e) => e.SuperNav],
421
+ ["supportalerts", (e) => e.BrowserWrapper && Object.keys(e).length === 1],
422
+ ["systemdock", (e) => e.UnplugWarning],
423
+ ["systemmanagement", (e) => e.HDRBadge],
424
+ ["systemreport", (e) => e.SystemReportDialog],
425
+ ["systemsettings", (e) => e.SteamRuntimeSystemInfoDialogContent],
426
+ ["throbber", (e) => e.ThrobberWrapper],
427
+ ["timezonescreen", (e) => e.TimezoneScreen],
428
+ ["titlebarcontrols", (e) => e.NotificationBellAnimation],
429
+ ["toggle", (e) => e.ToggleRow && e.Off],
430
+ ["tooltip", (e) => e.TextToolTip],
431
+ ["topleveltransitionswitch", (e) => e.TopLevelTransition],
432
+ ["uninstalldialog", (e) => e.UninstallDialog],
433
+ ["unreadchatmessagesheadersteamdeck", (e) => e.HasMessages],
434
+ ["unstyledbutton", (e) => e.UnstyledButton],
435
+ ["updatealert", (e) => e.BytesDownloaded],
436
+ ["updaterfield", (e) => e.UpdateBytesRemaining],
437
+ ["virtualkeyboard", (e) => e.Touched],
438
+ ["virtualkeyboardcontainer", (e) => e.VirtualKeyboardContainer],
439
+ // May conflict with other broadcast modules in the future
440
+ ["vodplayer", (e) => e.BroadcastCtn],
441
+ ["voicechatheadersteamdeck", (e) => e.ActiveCall],
442
+ ["voicesettings", (e) => e.HotkeySettingRow],
443
+ // Generic, but returns 1 module
444
+ ["vrdashboard", (e) => e.FadeRight],
445
+ // Generic, but returns 1 module
446
+ ["vrdashboardpopups", (e) => e.PopupRoot],
447
+ // Generic, but returns 1 module
448
+ ["vrinstalldialog", (e) => e.CheckboxContainer],
449
+ ["writereview", (e) => e.WriteReviewContainer],
450
+ ["youtubeembed", (e) => e.DynamicLink_YoutubeViews],
451
+ ];
package/index.js ADDED
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fs from "node:fs";
4
+ import path from "node:path";
5
+ import { connection, packagePath } from "./shared.js";
6
+
7
+ const scriptPath = path.join(packagePath, "lib");
8
+ const files = fs
9
+ .readdirSync(scriptPath)
10
+ .filter((e) => e !== "shared.js")
11
+ .map((e) => e.replace(".js", ""));
12
+ if (!files.some((e) => process.argv[2] === e)) {
13
+ console.error(
14
+ "Usage: %s [%s]",
15
+ path.basename(process.argv[1]),
16
+ files.join("|"),
17
+ );
18
+ process.exit(2);
19
+ }
20
+
21
+ await connection.Runtime.enable();
22
+ connection.Runtime.on("consoleAPICalled", (ev) => {
23
+ if (ev.type !== "error") {
24
+ return;
25
+ }
26
+
27
+ console.error(...ev.args.map((e) => e.description || e.value));
28
+ });
29
+
30
+ const script = await import(path.join(scriptPath, `${process.argv[2]}.js`));
31
+ await script.execute();
32
+ connection.close();
@@ -0,0 +1,29 @@
1
+ import fs from "node:fs";
2
+ import cp from "node:child_process";
3
+ import path from "node:path";
4
+ import { packagePath, readFile, run, runWithResult } from "../shared.js";
5
+
6
+ const CLASS_MAP_FILE = "class_map.json";
7
+ const CDP_FILES_PATH = path.join(packagePath, "cdp");
8
+
9
+ export async function execute() {
10
+ const dflRan = await runWithResult("!!webpackCache");
11
+ if (!dflRan) {
12
+ // No need to directly use DFL
13
+ await run(
14
+ readFile(
15
+ path.join("node_modules", "decky-frontend-lib", "dist", "webpack.js"),
16
+ ).replace(/export /g, ""),
17
+ );
18
+ }
19
+ await run(readFile(path.join(CDP_FILES_PATH, "class_modules_db.js")));
20
+
21
+ const filePath = path.join(process.cwd(), CLASS_MAP_FILE);
22
+ const output = await runWithResult(
23
+ readFile(path.join(CDP_FILES_PATH, "class_modules.js")),
24
+ );
25
+
26
+ fs.writeFileSync(filePath, JSON.stringify(output));
27
+ cp.spawnSync("npx", ["@biomejs/biome", "format", "--write", filePath]);
28
+ console.log("Wrote %o", filePath);
29
+ }
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "steam-theming-utils",
3
+ "version": "1.0.0",
4
+ "description": "A collection of scripts for easier Steam theming",
5
+ "type": "module",
6
+ "bin": {
7
+ "steam-theming-utils": "./index.js"
8
+ },
9
+ "devDependencies": {
10
+ "@biomejs/biome": "^1.8.0"
11
+ },
12
+ "dependencies": {
13
+ "chrome-remote-interface": "^0.33.0",
14
+ "decky-frontend-lib": "^3.25.0"
15
+ }
16
+ }
package/shared.js ADDED
@@ -0,0 +1,29 @@
1
+ import cdp from "chrome-remote-interface";
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ import url from "node:url";
5
+
6
+ export const connection = await cdp({
7
+ host: "127.0.0.1",
8
+ port: 8080,
9
+ target: (e) => e.find((e) => e.title === "SharedJSContext"),
10
+ }).catch((e) => {
11
+ console.log(
12
+ "%s\n%s %o",
13
+ e.message,
14
+ "Try running Steam with",
15
+ "-cef-enable-debugging",
16
+ );
17
+ process.exit(1);
18
+ });
19
+ export const packagePath = path.dirname(url.fileURLToPath(import.meta.url));
20
+
21
+ export const readFile = (file) => fs.readFileSync(file).toString();
22
+ export const run = async (expression) =>
23
+ await connection.Runtime.evaluate({
24
+ expression,
25
+ awaitPromise: true,
26
+ returnByValue: true,
27
+ });
28
+ export const runWithResult = async (expression) =>
29
+ (await run(expression)).result.value;