steam-theming-utils 1.0.0 → 1.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.
@@ -22,7 +22,12 @@ findUniqueKey = (key, index = 0) =>
22
22
  (mod) => findAllModules((mod2) => mod2[mod]).length === 1,
23
23
  );
24
24
 
25
+ // TODO: sort classes
25
26
  result = {
27
+ ...specialModules,
28
+ ...parsedModules
29
+ .map((e) => ({ [e[0]]: e[1] }))
30
+ .reduce((a, b) => Object.assign(a, b)),
26
31
  ...classModules
27
32
  .flatMap((a) => {
28
33
  const mod = findFirstModule(a[1], a[0]);
@@ -38,7 +43,6 @@ result = {
38
43
  };
39
44
  })
40
45
  .reduce((a, b) => Object.assign(a, b)),
41
- ...specialCases,
42
46
  };
43
47
 
44
48
  // return
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Special children that can not be easily identified.
3
3
  */
4
- specialCases = {
4
+ specialModules = {
5
5
  gamepaddialog: findAllModules(
6
6
  (e) => e.WithBottomSeparator && !e.GyroButtonPickerDialog,
7
7
  )[0],
@@ -9,28 +9,74 @@ specialCases = {
9
9
  image: findAllModules((e) => e.ErrorDiv)[0],
10
10
  loyaltyrewarditemembed: findAllModules((e) => e.Ctn)[0],
11
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
12
  };
33
13
 
14
+ // TODO: these are seen in the css loader map, but there are no such modules
15
+ //appdetailsbroadcastsection: (e) => e,
16
+ //balloon: e => e.,
17
+ //controllerconfiguratorgyrocalibrationdialog: (e) => e,
18
+ //controllerconfiguratormapping: (e) => e,
19
+ //friendactivityfeed: (e) => e,
20
+ //mainmenuapprunning: (e) => e,
21
+ //quickaccesscontrols: (e) => e,
22
+ //shorttemplates: (e) => e,
23
+ //soundtrackoverlay: (e) => e,
24
+ //standardtemplates: (e) => e,
25
+ //vrgamepadui: (e) => e,
26
+
27
+ /**
28
+ * These are not seen in webpackCache for some reason.
29
+ * TODO: unify with the rest ?
30
+ * TODO: is absence of top-level await a bug ?
31
+ */
32
+ (async () => {
33
+ window.parsedModules = [
34
+ ...(
35
+ await Promise.all(
36
+ [
37
+ "awardicon",
38
+ "broadcast",
39
+ "chunk~1a96cdf59", // Also broadcast
40
+ "gamenotes",
41
+ "gamerecording",
42
+ ].map(async (e) =>
43
+ (await fetch(`https://steamloopback.host/${e}.js`)).text(),
44
+ ),
45
+ )
46
+ )
47
+ .join("")
48
+ .matchAll(/e\.exports=(.*?\})\}/g),
49
+ ].map((e) => {
50
+ const exists = (c) => keys.some((e) => e === c);
51
+ const mod = JSON.parse(e[1].replace(/(\w+):/g, '"$1":'));
52
+ const keys = Object.keys(mod);
53
+ const name = (() => {
54
+ switch (true) {
55
+ case exists("IconList"):
56
+ return "awardicon";
57
+ case exists("PopOutVideoTitleBar"):
58
+ return "broadcastembeddable";
59
+ case exists("BroadcastPlayerLite"):
60
+ return "broadcastplayer";
61
+ case exists("StoreSaleImage_mini"):
62
+ return "broadcastwidgets";
63
+ case exists("NotesPagedSettings"):
64
+ return "gamenotes";
65
+ case exists("GameNotesPopup"):
66
+ return "gamenotespopups";
67
+ case exists("ClipSavedHint"):
68
+ return "gamerecording";
69
+ case exists("LinkHelp"):
70
+ return "pmhover";
71
+ case exists("CommandButton"):
72
+ return "prosemirror";
73
+ }
74
+ })();
75
+
76
+ return [name, mod];
77
+ });
78
+ })();
79
+
34
80
  classModules = [
35
81
  ["aboutsteamdialog", (e) => e.AboutSteamDialog],
36
82
  ["accountpanel", (e) => e.ChangePersonaNameContent],
@@ -87,7 +133,7 @@ classModules = [
87
133
  ["appdetailstimedtrialbanner", (e) => e.MasterSubLink],
88
134
  ["appdetailstradingcardssection", (e) => e.CardsSection],
89
135
  ["appdetailsworkshopsection", (e) => e.WorkshopSection],
90
- ["appfilterpane", (e) => e.SteamDeckCompatDropDown],
136
+ ["appfilterpane", (e) => e.CompatDropDown],
91
137
  ["appgrid", (e) => e.LibraryImageBackgroundGlow],
92
138
  ["applaunchingdetails", (e) => e.ShowControlOverviewContainerAnimation],
93
139
  ["apppartnereventspage", (e) => e.AppBannerBackground],
@@ -113,7 +159,7 @@ classModules = [
113
159
  ["bbcodeeditor", (e) => e.DragTarget],
114
160
  ["bbcodes", (e) => e.QuoteAuthor],
115
161
  ["bbcodesuggestions", (e) => e.BBCode],
116
- ["bluetoothsettings", (e) => e.NotConnectedLabel],
162
+ ["bluetoothsettings", (e) => e.NotConnectedLabel && e.Header],
117
163
  ["borrowgamedialog", (e) => e.BorrowGameDialog],
118
164
  ["bottombar", (e) => e.BottomBarContainer],
119
165
  ["boxcarousel", (e) => e.BoxCarousel],
@@ -371,7 +417,7 @@ classModules = [
371
417
  ["reloadingdialog", (e) => e.Popup && Object.keys(e).length === 1],
372
418
  ["remainderlist", (e) => e.ItemWrapper],
373
419
  ["remoteplay", (e) => e.ContentForm],
374
- ["remoteplaydialog", (e) => e.DialogBodyText && Object.keys(e).length === 2],
420
+ ["remoteplaydialog", (e) => e.SegmentedInput && Object.keys(e).length === 3],
375
421
  ["remoteplaysettings", (e) => e.SubSetting],
376
422
  ["removefreeappdialog", (e) => e.RemovingText],
377
423
  ["removegamehover", (e) => e.RemoveBoxTransition],
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "steam-theming-utils",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "A collection of scripts for easier Steam theming",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/ricewind012/steam-theming-utils"
8
+ },
5
9
  "type": "module",
6
10
  "bin": {
7
- "steam-theming-utils": "./index.js"
11
+ "steam-theming-utils": "index.js"
8
12
  },
9
13
  "devDependencies": {
10
14
  "@biomejs/biome": "^1.8.0"