@zthun/romulator-web 1.1.0 → 1.2.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/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.2.0](https://github.com/zthun/romulator/compare/v1.1.0...v1.2.0) (2025-06-22)
7
+
8
+
9
+ ### Features
10
+
11
+ * systems now show in order of generation and by wheels on the systems page ([09266c3](https://github.com/zthun/romulator/commit/09266c39b1be1ef057c761ae52a2443ee00db17a))
12
+
13
+
14
+
6
15
  ## 1.1.0 (2025-06-21)
7
16
 
8
17
 
@@ -1862,7 +1862,7 @@ function _define_property$4$4(obj, key, value) {
1862
1862
  return ZQuadrilateralBuilder;
1863
1863
  }();
1864
1864
 
1865
- /* istanbul ignore next -- @preserve */ var $global = typeof window === "undefined" ? global : window;
1865
+ /* v8 ignore start -- @preserve */ /* istanbul ignore next -- @preserve */ var $global = typeof window === "undefined" ? global : window; /* v8 ignore end -- @preserve */
1866
1866
 
1867
1867
  /**
1868
1868
  * A set of parameters that can be used for a string join.
@@ -14187,15 +14187,15 @@ function _ts_generator$t(thisArg, body) {
14187
14187
  return ZDataSourceStatic;
14188
14188
  }();
14189
14189
 
14190
- function _array_like_to_array$4$1(arr, len) {
14190
+ function _array_like_to_array$4$2(arr, len) {
14191
14191
  if (len == null || len > arr.length) len = arr.length;
14192
14192
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
14193
14193
  return arr2;
14194
14194
  }
14195
- function _array_with_holes$4$1(arr) {
14195
+ function _array_with_holes$4$2(arr) {
14196
14196
  if (Array.isArray(arr)) return arr;
14197
14197
  }
14198
- function _iterable_to_array_limit$4$1(arr, i) {
14198
+ function _iterable_to_array_limit$4$2(arr, i) {
14199
14199
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
14200
14200
  if (_i == null) return;
14201
14201
  var _arr = [];
@@ -14219,19 +14219,19 @@ function _iterable_to_array_limit$4$1(arr, i) {
14219
14219
  }
14220
14220
  return _arr;
14221
14221
  }
14222
- function _non_iterable_rest$4$1() {
14222
+ function _non_iterable_rest$4$2() {
14223
14223
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
14224
14224
  }
14225
- function _sliced_to_array$4$1(arr, i) {
14226
- return _array_with_holes$4$1(arr) || _iterable_to_array_limit$4$1(arr, i) || _unsupported_iterable_to_array$4$1(arr, i) || _non_iterable_rest$4$1();
14225
+ function _sliced_to_array$4$2(arr, i) {
14226
+ return _array_with_holes$4$2(arr) || _iterable_to_array_limit$4$2(arr, i) || _unsupported_iterable_to_array$4$2(arr, i) || _non_iterable_rest$4$2();
14227
14227
  }
14228
- function _unsupported_iterable_to_array$4$1(o, minLen) {
14228
+ function _unsupported_iterable_to_array$4$2(o, minLen) {
14229
14229
  if (!o) return;
14230
- if (typeof o === "string") return _array_like_to_array$4$1(o, minLen);
14230
+ if (typeof o === "string") return _array_like_to_array$4$2(o, minLen);
14231
14231
  var n = Object.prototype.toString.call(o).slice(8, -1);
14232
14232
  if (n === "Object" && o.constructor) n = o.constructor.name;
14233
14233
  if (n === "Map" || n === "Set") return Array.from(n);
14234
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4$1(o, minLen);
14234
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4$2(o, minLen);
14235
14235
  }
14236
14236
  /**
14237
14237
  * A type of state where the value is used from the props in the case of them being set.
@@ -14256,7 +14256,7 @@ function _unsupported_iterable_to_array$4$1(o, minLen) {
14256
14256
  * A tuple where the first item is the current state and the 2nd item is a mutator
14257
14257
  * method to modify the state.
14258
14258
  */ function useAmbassadorState(current, setCurrent, initial) {
14259
- var _useState = _sliced_to_array$4$1(reactExports.useState(current || initial), 2), localCurrent = _useState[0], setLocalCurrent = _useState[1];
14259
+ var _useState = _sliced_to_array$4$2(reactExports.useState(current || initial), 2), localCurrent = _useState[0], setLocalCurrent = _useState[1];
14260
14260
  var _current = current === undefined ? localCurrent : current;
14261
14261
  var _setCurrent = function(val) {
14262
14262
  setLocalCurrent(val);
@@ -32418,12 +32418,12 @@ function _ts_generator$6(thisArg, body) {
32418
32418
  }(ZCircusComponentModel);
32419
32419
  _define_property$b(ZIconComponentModel, "Selector", ".ZIcon-root");
32420
32420
 
32421
- function _array_like_to_array$4(arr, len) {
32421
+ function _array_like_to_array$4$1(arr, len) {
32422
32422
  if (len == null || len > arr.length) len = arr.length;
32423
32423
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
32424
32424
  return arr2;
32425
32425
  }
32426
- function _array_with_holes$4(arr) {
32426
+ function _array_with_holes$4$1(arr) {
32427
32427
  if (Array.isArray(arr)) return arr;
32428
32428
  }
32429
32429
  function _assert_this_initialized$7(self) {
@@ -32515,7 +32515,7 @@ function _inherits$7(subClass, superClass) {
32515
32515
  });
32516
32516
  if (superClass) _set_prototype_of$7(subClass, superClass);
32517
32517
  }
32518
- function _iterable_to_array_limit$4(arr, i) {
32518
+ function _iterable_to_array_limit$4$1(arr, i) {
32519
32519
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
32520
32520
  if (_i == null) return;
32521
32521
  var _arr = [];
@@ -32539,7 +32539,7 @@ function _iterable_to_array_limit$4(arr, i) {
32539
32539
  }
32540
32540
  return _arr;
32541
32541
  }
32542
- function _non_iterable_rest$4() {
32542
+ function _non_iterable_rest$4$1() {
32543
32543
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
32544
32544
  }
32545
32545
  function _possible_constructor_return$7(self, call) {
@@ -32555,20 +32555,20 @@ function _set_prototype_of$7(o, p) {
32555
32555
  };
32556
32556
  return _set_prototype_of$7(o, p);
32557
32557
  }
32558
- function _sliced_to_array$4(arr, i) {
32559
- return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$4();
32558
+ function _sliced_to_array$4$1(arr, i) {
32559
+ return _array_with_holes$4$1(arr) || _iterable_to_array_limit$4$1(arr, i) || _unsupported_iterable_to_array$4$1(arr, i) || _non_iterable_rest$4$1();
32560
32560
  }
32561
32561
  function _type_of$7(obj) {
32562
32562
  "@swc/helpers - typeof";
32563
32563
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
32564
32564
  }
32565
- function _unsupported_iterable_to_array$4(o, minLen) {
32565
+ function _unsupported_iterable_to_array$4$1(o, minLen) {
32566
32566
  if (!o) return;
32567
- if (typeof o === "string") return _array_like_to_array$4(o, minLen);
32567
+ if (typeof o === "string") return _array_like_to_array$4$1(o, minLen);
32568
32568
  var n = Object.prototype.toString.call(o).slice(8, -1);
32569
32569
  if (n === "Object" && o.constructor) n = o.constructor.name;
32570
32570
  if (n === "Map" || n === "Set") return Array.from(n);
32571
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
32571
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4$1(o, minLen);
32572
32572
  }
32573
32573
  function _is_native_reflect_construct$7() {
32574
32574
  try {
@@ -32707,7 +32707,7 @@ function _ts_generator$5(thisArg, body) {
32707
32707
  this.driver.query("svg")
32708
32708
  ];
32709
32709
  case 1:
32710
- _ref = _sliced_to_array$4.apply(void 0, [
32710
+ _ref = _sliced_to_array$4$1.apply(void 0, [
32711
32711
  _state.sent(),
32712
32712
  1
32713
32713
  ]), tag = _ref[0];
@@ -32738,7 +32738,7 @@ function _ts_generator$5(thisArg, body) {
32738
32738
  this.driver.query("img")
32739
32739
  ];
32740
32740
  case 1:
32741
- _ref = _sliced_to_array$4.apply(void 0, [
32741
+ _ref = _sliced_to_array$4$1.apply(void 0, [
32742
32742
  _state.sent(),
32743
32743
  1
32744
32744
  ]), tag = _ref[0];
@@ -50945,15 +50945,15 @@ function requireClient () {
50945
50945
 
50946
50946
  var clientExports = requireClient();
50947
50947
 
50948
- function _array_like_to_array$3(arr, len) {
50948
+ function _array_like_to_array$4(arr, len) {
50949
50949
  if (len == null || len > arr.length) len = arr.length;
50950
50950
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
50951
50951
  return arr2;
50952
50952
  }
50953
- function _array_with_holes$3(arr) {
50953
+ function _array_with_holes$4(arr) {
50954
50954
  if (Array.isArray(arr)) return arr;
50955
50955
  }
50956
- function _iterable_to_array_limit$3(arr, i) {
50956
+ function _iterable_to_array_limit$4(arr, i) {
50957
50957
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
50958
50958
  if (_i == null) return;
50959
50959
  var _arr = [];
@@ -50977,22 +50977,22 @@ function _iterable_to_array_limit$3(arr, i) {
50977
50977
  }
50978
50978
  return _arr;
50979
50979
  }
50980
- function _non_iterable_rest$3() {
50980
+ function _non_iterable_rest$4() {
50981
50981
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
50982
50982
  }
50983
- function _sliced_to_array$3(arr, i) {
50984
- return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$3();
50983
+ function _sliced_to_array$4(arr, i) {
50984
+ return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$4();
50985
50985
  }
50986
- function _unsupported_iterable_to_array$3(o, minLen) {
50986
+ function _unsupported_iterable_to_array$4(o, minLen) {
50987
50987
  if (!o) return;
50988
- if (typeof o === "string") return _array_like_to_array$3(o, minLen);
50988
+ if (typeof o === "string") return _array_like_to_array$4(o, minLen);
50989
50989
  var n = Object.prototype.toString.call(o).slice(8, -1);
50990
50990
  if (n === "Object" && o.constructor) n = o.constructor.name;
50991
50991
  if (n === "Map" || n === "Set") return Array.from(n);
50992
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
50992
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
50993
50993
  }
50994
50994
  function ZRomulatorMenu() {
50995
- var _useState = _sliced_to_array$3(reactExports.useState(false), 2), expanded = _useState[0], setExpanded = _useState[1];
50995
+ var _useState = _sliced_to_array$4(reactExports.useState(false), 2), expanded = _useState[0], setExpanded = _useState[1];
50996
50996
  var open = reactExports.useMemo(function() {
50997
50997
  return setExpanded.bind(null, true);
50998
50998
  }, []);
@@ -51667,12 +51667,12 @@ var useSetting = function(id) {
51667
51667
  ]);
51668
51668
  };
51669
51669
 
51670
- function _array_like_to_array$2(arr, len) {
51670
+ function _array_like_to_array$3(arr, len) {
51671
51671
  if (len == null || len > arr.length) len = arr.length;
51672
51672
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
51673
51673
  return arr2;
51674
51674
  }
51675
- function _array_with_holes$2(arr) {
51675
+ function _array_with_holes$3(arr) {
51676
51676
  if (Array.isArray(arr)) return arr;
51677
51677
  }
51678
51678
  function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
@@ -51704,7 +51704,7 @@ function _async_to_generator$1(fn) {
51704
51704
  });
51705
51705
  };
51706
51706
  }
51707
- function _iterable_to_array_limit$2(arr, i) {
51707
+ function _iterable_to_array_limit$3(arr, i) {
51708
51708
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
51709
51709
  if (_i == null) return;
51710
51710
  var _arr = [];
@@ -51728,19 +51728,19 @@ function _iterable_to_array_limit$2(arr, i) {
51728
51728
  }
51729
51729
  return _arr;
51730
51730
  }
51731
- function _non_iterable_rest$2() {
51731
+ function _non_iterable_rest$3() {
51732
51732
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
51733
51733
  }
51734
- function _sliced_to_array$2(arr, i) {
51735
- return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
51734
+ function _sliced_to_array$3(arr, i) {
51735
+ return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$3();
51736
51736
  }
51737
- function _unsupported_iterable_to_array$2(o, minLen) {
51737
+ function _unsupported_iterable_to_array$3(o, minLen) {
51738
51738
  if (!o) return;
51739
- if (typeof o === "string") return _array_like_to_array$2(o, minLen);
51739
+ if (typeof o === "string") return _array_like_to_array$3(o, minLen);
51740
51740
  var n = Object.prototype.toString.call(o).slice(8, -1);
51741
51741
  if (n === "Object" && o.constructor) n = o.constructor.name;
51742
51742
  if (n === "Map" || n === "Set") return Array.from(n);
51743
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
51743
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
51744
51744
  }
51745
51745
  function _ts_generator$1(thisArg, body) {
51746
51746
  var f, y, t, _ = {
@@ -51835,7 +51835,7 @@ function _ts_generator$1(thisArg, body) {
51835
51835
  }
51836
51836
  function ZRomulatorSettingPage() {
51837
51837
  var id = useParams().id;
51838
- var _useSetting = _sliced_to_array$2(useSetting(id), 2), setting = _useSetting[0], setSetting = _useSetting[1];
51838
+ var _useSetting = _sliced_to_array$3(useSetting(id), 2), setting = _useSetting[0], setSetting = _useSetting[1];
51839
51839
  var _setting = asStateData(setting);
51840
51840
  var metadata = firstDefined([], _setting === null || _setting === void 0 ? void 0 : _setting.metadata);
51841
51841
  var service = useSettingsService();
@@ -51936,15 +51936,15 @@ function ZRomulatorSettingPage() {
51936
51936
  });
51937
51937
  }
51938
51938
 
51939
- function _array_like_to_array$1(arr, len) {
51939
+ function _array_like_to_array$2(arr, len) {
51940
51940
  if (len == null || len > arr.length) len = arr.length;
51941
51941
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
51942
51942
  return arr2;
51943
51943
  }
51944
- function _array_with_holes$1(arr) {
51944
+ function _array_with_holes$2(arr) {
51945
51945
  if (Array.isArray(arr)) return arr;
51946
51946
  }
51947
- function _iterable_to_array_limit$1(arr, i) {
51947
+ function _iterable_to_array_limit$2(arr, i) {
51948
51948
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
51949
51949
  if (_i == null) return;
51950
51950
  var _arr = [];
@@ -51968,25 +51968,25 @@ function _iterable_to_array_limit$1(arr, i) {
51968
51968
  }
51969
51969
  return _arr;
51970
51970
  }
51971
- function _non_iterable_rest$1() {
51971
+ function _non_iterable_rest$2() {
51972
51972
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
51973
51973
  }
51974
- function _sliced_to_array$1(arr, i) {
51975
- return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest$1();
51974
+ function _sliced_to_array$2(arr, i) {
51975
+ return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
51976
51976
  }
51977
- function _unsupported_iterable_to_array$1(o, minLen) {
51977
+ function _unsupported_iterable_to_array$2(o, minLen) {
51978
51978
  if (!o) return;
51979
- if (typeof o === "string") return _array_like_to_array$1(o, minLen);
51979
+ if (typeof o === "string") return _array_like_to_array$2(o, minLen);
51980
51980
  var n = Object.prototype.toString.call(o).slice(8, -1);
51981
51981
  if (n === "Object" && o.constructor) n = o.constructor.name;
51982
51982
  if (n === "Map" || n === "Set") return Array.from(n);
51983
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
51983
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
51984
51984
  }
51985
51985
  function ZRomulatorSettingsPage() {
51986
51986
  var body = useFashionTheme().body;
51987
51987
  var navigate = useNavigate();
51988
51988
  var settings = useSettingsService();
51989
- var _useState = _sliced_to_array$1(reactExports.useState(new ZDataRequestBuilder().build()), 1), request = _useState[0];
51989
+ var _useState = _sliced_to_array$2(reactExports.useState(new ZDataRequestBuilder().build()), 1), request = _useState[0];
51990
51990
  var renderTile = function(config) {
51991
51991
  return /*#__PURE__*/ jsxRuntimeExports.jsx(ZBox, {
51992
51992
  className: "ZRomulatorSettingsPage-tile",
@@ -52102,26 +52102,43 @@ function _object_spread_props(target, source) {
52102
52102
  }
52103
52103
  return target;
52104
52104
  }
52105
+ function _tagged_template_literal$1(strings, raw) {
52106
+ if (!raw) {
52107
+ raw = strings.slice(0);
52108
+ }
52109
+ return Object.freeze(Object.defineProperties(strings, {
52110
+ raw: {
52111
+ value: Object.freeze(raw)
52112
+ }
52113
+ }));
52114
+ }
52115
+ function _templateObject$1() {
52116
+ var data = _tagged_template_literal$1([
52117
+ "\n &.ZRomulatorSystemCard-root .ZRomulatorSystemCard-avatar {\n height: 100%;\n width: 100%;\n }\n "
52118
+ ]);
52119
+ _templateObject$1 = function _templateObject() {
52120
+ return data;
52121
+ };
52122
+ return data;
52123
+ }
52105
52124
  function ZRomulatorSystemAvatarCard(props) {
52106
52125
  var system = props.system, CardProps = props.CardProps;
52107
- // TODO: Add support for other regions
52108
- var src = "/systems/us/".concat(system.id, "-256x256.png");
52126
+ var src = "/systems/wheel/".concat(system.id, ".png");
52127
+ var _className = useCss(css$1(_templateObject$1()));
52109
52128
  return /*#__PURE__*/ jsxRuntimeExports.jsx(ZCard, _object_spread_props(_object_spread({
52110
- className: "ZRomulatorSystemCard-root",
52111
- TitleProps: {
52112
- avatar: /*#__PURE__*/ jsxRuntimeExports.jsx(ZIconFontAwesome, {
52113
- name: "gamepad",
52114
- width: ZSizeFixed.Small
52115
- }),
52116
- heading: system.short,
52117
- subHeading: system.name
52118
- },
52129
+ className: cssJoinDefined("ZRomulatorSystemCard-root", _className),
52119
52130
  name: system.id
52120
52131
  }, CardProps), {
52121
52132
  children: /*#__PURE__*/ jsxRuntimeExports.jsx(ZStack, {
52133
+ className: "ZRomulatorSystemCard-avatar",
52122
52134
  orientation: ZOrientation.Horizontal,
52123
52135
  justify: {
52124
- content: "center"
52136
+ content: "center",
52137
+ items: "center"
52138
+ },
52139
+ align: {
52140
+ content: "center",
52141
+ items: "center"
52125
52142
  },
52126
52143
  children: /*#__PURE__*/ jsxRuntimeExports.jsx(ZImageSource, {
52127
52144
  src: src,
@@ -52458,15 +52475,15 @@ var useSystem = function(id) {
52458
52475
  ]);
52459
52476
  };
52460
52477
 
52461
- function _array_like_to_array(arr, len) {
52478
+ function _array_like_to_array$1(arr, len) {
52462
52479
  if (len == null || len > arr.length) len = arr.length;
52463
52480
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
52464
52481
  return arr2;
52465
52482
  }
52466
- function _array_with_holes(arr) {
52483
+ function _array_with_holes$1(arr) {
52467
52484
  if (Array.isArray(arr)) return arr;
52468
52485
  }
52469
- function _iterable_to_array_limit(arr, i) {
52486
+ function _iterable_to_array_limit$1(arr, i) {
52470
52487
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
52471
52488
  if (_i == null) return;
52472
52489
  var _arr = [];
@@ -52490,24 +52507,24 @@ function _iterable_to_array_limit(arr, i) {
52490
52507
  }
52491
52508
  return _arr;
52492
52509
  }
52493
- function _non_iterable_rest() {
52510
+ function _non_iterable_rest$1() {
52494
52511
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
52495
52512
  }
52496
- function _sliced_to_array(arr, i) {
52497
- return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
52513
+ function _sliced_to_array$1(arr, i) {
52514
+ return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest$1();
52498
52515
  }
52499
- function _unsupported_iterable_to_array(o, minLen) {
52516
+ function _unsupported_iterable_to_array$1(o, minLen) {
52500
52517
  if (!o) return;
52501
- if (typeof o === "string") return _array_like_to_array(o, minLen);
52518
+ if (typeof o === "string") return _array_like_to_array$1(o, minLen);
52502
52519
  var n = Object.prototype.toString.call(o).slice(8, -1);
52503
52520
  if (n === "Object" && o.constructor) n = o.constructor.name;
52504
52521
  if (n === "Map" || n === "Set") return Array.from(n);
52505
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
52522
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
52506
52523
  }
52507
52524
  function ZRomulatorSystemPage() {
52508
52525
  var id = useParams().id;
52509
52526
  var error = useFashionTheme().error;
52510
- var _useSystem = _sliced_to_array(useSystem(firstDefined("", id)), 1), system = _useSystem[0];
52527
+ var _useSystem = _sliced_to_array$1(useSystem(firstDefined("", id)), 1), system = _useSystem[0];
52511
52528
  var renderSystemInformation = function() {
52512
52529
  if (isStateLoading(system)) {
52513
52530
  return /*#__PURE__*/ jsxRuntimeExports.jsx(ZSuspenseProgress, {
@@ -52535,38 +52552,143 @@ function ZRomulatorSystemPage() {
52535
52552
  });
52536
52553
  }
52537
52554
 
52555
+ function _array_like_to_array(arr, len) {
52556
+ if (len == null || len > arr.length) len = arr.length;
52557
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
52558
+ return arr2;
52559
+ }
52560
+ function _array_with_holes(arr) {
52561
+ if (Array.isArray(arr)) return arr;
52562
+ }
52563
+ function _iterable_to_array_limit(arr, i) {
52564
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
52565
+ if (_i == null) return;
52566
+ var _arr = [];
52567
+ var _n = true;
52568
+ var _d = false;
52569
+ var _s, _e;
52570
+ try {
52571
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
52572
+ _arr.push(_s.value);
52573
+ if (i && _arr.length === i) break;
52574
+ }
52575
+ } catch (err) {
52576
+ _d = true;
52577
+ _e = err;
52578
+ } finally{
52579
+ try {
52580
+ if (!_n && _i["return"] != null) _i["return"]();
52581
+ } finally{
52582
+ if (_d) throw _e;
52583
+ }
52584
+ }
52585
+ return _arr;
52586
+ }
52587
+ function _non_iterable_rest() {
52588
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
52589
+ }
52590
+ function _sliced_to_array(arr, i) {
52591
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
52592
+ }
52593
+ function _tagged_template_literal(strings, raw) {
52594
+ if (!raw) {
52595
+ raw = strings.slice(0);
52596
+ }
52597
+ return Object.freeze(Object.defineProperties(strings, {
52598
+ raw: {
52599
+ value: Object.freeze(raw)
52600
+ }
52601
+ }));
52602
+ }
52603
+ function _unsupported_iterable_to_array(o, minLen) {
52604
+ if (!o) return;
52605
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
52606
+ var n = Object.prototype.toString.call(o).slice(8, -1);
52607
+ if (n === "Object" && o.constructor) n = o.constructor.name;
52608
+ if (n === "Map" || n === "Set") return Array.from(n);
52609
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
52610
+ }
52611
+ function _templateObject() {
52612
+ var data = _tagged_template_literal([
52613
+ "\n & {\n height: 100%;\n }\n "
52614
+ ]);
52615
+ _templateObject = function _templateObject() {
52616
+ return data;
52617
+ };
52618
+ return data;
52619
+ }
52620
+ var DefaultSystemSortOrder = new ZSortBuilder().ascending("generation").ascending("name").build();
52621
+ var DefaultSystemRequest = new ZDataRequestBuilder().sort(DefaultSystemSortOrder).build();
52538
52622
  function ZRomulatorSystemsPage() {
52539
- var secondary = useFashionTheme().secondary;
52623
+ var body = useFashionTheme().body;
52540
52624
  var navigate = useNavigate();
52541
52625
  var source = useSystemsService();
52542
- return /*#__PURE__*/ jsxRuntimeExports.jsx(ZGridView, {
52543
- className: "ZRomulatorSystemsPage-root",
52544
- GridProps: {
52545
- columns: {
52546
- xl: "1fr 1fr 1fr 1fr",
52547
- lg: "1fr 1fr 1fr",
52548
- md: "1fr 1fr",
52549
- sm: "1fr"
52626
+ var _useState = _sliced_to_array(reactExports.useState(DefaultSystemRequest), 2), request = _useState[0], setRequest = _useState[1];
52627
+ var tile = useCss(css$1(_templateObject()));
52628
+ var renderTile = function(system) {
52629
+ var wheel = "/systems/wheel/".concat(system.id, ".png");
52630
+ return /*#__PURE__*/ jsxRuntimeExports.jsx(ZBox, {
52631
+ className: "ZRomulatorSystemsPage-tile",
52632
+ fashion: body,
52633
+ interactive: true,
52634
+ cursor: "pointer",
52635
+ padding: ZSizeFixed.Small,
52636
+ "data-name": system.id,
52637
+ onClick: function() {
52638
+ return navigate(system.id);
52550
52639
  },
52551
- gap: ZSizeFixed.Medium
52552
- },
52553
- dataSource: source,
52554
- renderItem: function(s) {
52555
- return /*#__PURE__*/ jsxRuntimeExports.jsx(ZRomulatorSystemAvatarCard, {
52556
- system: s,
52557
- CardProps: {
52558
- footer: /*#__PURE__*/ jsxRuntimeExports.jsx(ZButton, {
52559
- fashion: secondary,
52560
- label: "More",
52561
- name: "more",
52562
- width: ZSizeVaried.Full,
52563
- onClick: function() {
52564
- return navigate("/systems/".concat(s.id));
52565
- }
52640
+ children: /*#__PURE__*/ jsxRuntimeExports.jsx(ZStack, {
52641
+ className: cssJoinDefined(tile),
52642
+ gap: ZSizeFixed.Medium,
52643
+ orientation: ZOrientation.Horizontal,
52644
+ justify: {
52645
+ content: "center"
52646
+ },
52647
+ align: {
52648
+ items: "center"
52649
+ },
52650
+ children: /*#__PURE__*/ jsxRuntimeExports.jsx(ZContentTitle, {
52651
+ avatar: /*#__PURE__*/ jsxRuntimeExports.jsx(ZImageSource, {
52652
+ src: wheel,
52653
+ height: ZSizeVaried.Full,
52654
+ width: ZSizeVaried.Full
52566
52655
  })
52567
- }
52568
- }, s.id);
52569
- }
52656
+ })
52657
+ })
52658
+ }, system.id);
52659
+ };
52660
+ return /*#__PURE__*/ jsxRuntimeExports.jsxs(ZStack, {
52661
+ gap: ZSizeFixed.Medium,
52662
+ children: [
52663
+ /*#__PURE__*/ jsxRuntimeExports.jsx(ZBreadcrumbsLocation, {}),
52664
+ /*#__PURE__*/ jsxRuntimeExports.jsx(ZCard, {
52665
+ width: ZSizeVaried.Full,
52666
+ TitleProps: {
52667
+ avatar: /*#__PURE__*/ jsxRuntimeExports.jsx(ZIconFontAwesome, {
52668
+ name: "puzzle-piece",
52669
+ width: ZSizeFixed.Medium
52670
+ }),
52671
+ heading: "Systems",
52672
+ subHeading: "Your games organized by system"
52673
+ },
52674
+ children: /*#__PURE__*/ jsxRuntimeExports.jsx(ZGridView, {
52675
+ className: "ZRomulatorSystemsPage-root",
52676
+ GridProps: {
52677
+ columns: {
52678
+ xl: "1fr 1fr 1fr 1fr",
52679
+ lg: "1fr 1fr 1fr",
52680
+ md: "1fr 1fr",
52681
+ sm: "1fr"
52682
+ },
52683
+ gap: ZSizeFixed.Medium
52684
+ },
52685
+ value: request,
52686
+ onValueChange: setRequest,
52687
+ dataSource: source,
52688
+ renderItem: renderTile
52689
+ })
52690
+ })
52691
+ ]
52570
52692
  });
52571
52693
  }
52572
52694
 
package/dist/index.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Romulator: Organize your Games</title>
7
- <script type="module" crossorigin src="/assets/index-CtJiKvl7.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-weK5iOs6.js"></script>
8
8
  </head>
9
9
  <body>
10
10
  <div id="zthunworks-romulator"></div>
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zthun/romulator-web",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Romulator frontend",
5
5
  "author": "Anthony Bonta",
6
6
  "license": "MIT",
@@ -22,14 +22,14 @@
22
22
  "@vitejs/plugin-react-swc": "^3.10.2",
23
23
  "@zthun/cirque": "^7.1.4",
24
24
  "@zthun/cirque-du-react": "^7.1.4",
25
- "@zthun/fashion-boutique": "^10.1.6",
26
- "@zthun/fashion-tailor": "^10.1.6",
27
- "@zthun/fashion-theme": "^10.1.6",
28
- "@zthun/helpful-fn": "^9.3.0",
29
- "@zthun/helpful-query": "^9.3.0",
30
- "@zthun/helpful-react": "^9.3.0",
25
+ "@zthun/fashion-boutique": "^10.2.1",
26
+ "@zthun/fashion-tailor": "^10.2.1",
27
+ "@zthun/fashion-theme": "^10.2.1",
28
+ "@zthun/helpful-fn": "^9.4.0",
29
+ "@zthun/helpful-query": "^9.4.0",
30
+ "@zthun/helpful-react": "^9.4.0",
31
31
  "@zthun/janitor-build-config": "^19.2.4",
32
- "@zthun/romulator-client": "^1.1.0",
32
+ "@zthun/romulator-client": "^1.2.0",
33
33
  "@zthun/webigail-http": "^4.0.3",
34
34
  "@zthun/webigail-rest": "^4.0.3",
35
35
  "@zthun/webigail-url": "^4.0.3",
@@ -44,5 +44,5 @@
44
44
  "vitest": "^3.2.4",
45
45
  "vitest-mock-extended": "^3.1.0"
46
46
  },
47
- "gitHead": "52bd432dd2df0980d450b20de58d7f58c6d0da94"
47
+ "gitHead": "8e51e1660617d8aea4be5cd3c2d666e2bf673f52"
48
48
  }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,12 +1,7 @@
1
1
  import type { IZCard } from "@zthun/fashion-boutique";
2
- import {
3
- ZCard,
4
- ZIconFontAwesome,
5
- ZImageSource,
6
- ZStack,
7
- } from "@zthun/fashion-boutique";
2
+ import { useCss, ZCard, ZImageSource, ZStack } from "@zthun/fashion-boutique";
8
3
  import { ZSizeFixed } from "@zthun/fashion-tailor";
9
- import { ZOrientation } from "@zthun/helpful-fn";
4
+ import { css, cssJoinDefined, ZOrientation } from "@zthun/helpful-fn";
10
5
 
11
6
  export interface IZRomulatorSystemAvatarCard {
12
7
  system: any;
@@ -16,23 +11,26 @@ export interface IZRomulatorSystemAvatarCard {
16
11
 
17
12
  export function ZRomulatorSystemAvatarCard(props: IZRomulatorSystemAvatarCard) {
18
13
  const { system, CardProps } = props;
19
- // TODO: Add support for other regions
20
- const src = `/systems/us/${system.id}-256x256.png`;
14
+ const src = `/systems/wheel/${system.id}.png`;
15
+
16
+ const _className = useCss(css`
17
+ &.ZRomulatorSystemCard-root .ZRomulatorSystemCard-avatar {
18
+ height: 100%;
19
+ width: 100%;
20
+ }
21
+ `);
21
22
 
22
23
  return (
23
24
  <ZCard
24
- className="ZRomulatorSystemCard-root"
25
- TitleProps={{
26
- avatar: <ZIconFontAwesome name="gamepad" width={ZSizeFixed.Small} />,
27
- heading: system.short,
28
- subHeading: system.name,
29
- }}
25
+ className={cssJoinDefined("ZRomulatorSystemCard-root", _className)}
30
26
  name={system.id}
31
27
  {...CardProps}
32
28
  >
33
29
  <ZStack
30
+ className="ZRomulatorSystemCard-avatar"
34
31
  orientation={ZOrientation.Horizontal}
35
- justify={{ content: "center" }}
32
+ justify={{ content: "center", items: "center" }}
33
+ align={{ content: "center", items: "center" }}
36
34
  >
37
35
  <ZImageSource src={src} width={ZSizeFixed.ExtraLarge} />
38
36
  </ZStack>
@@ -1,10 +1,8 @@
1
1
  import { ZCircusBy, ZCircusComponentModel } from "@zthun/cirque";
2
2
  import {
3
- ZButtonComponentModel,
3
+ ZBoxComponentModel,
4
4
  ZGridViewComponentModel,
5
5
  } from "@zthun/fashion-boutique";
6
- import { required } from "@zthun/helpful-fn";
7
- import { ZRomulatorSystemAvatarCardComponentModel } from "./system-avatar-card.cm.mjs";
8
6
 
9
7
  export class ZRomulatorSystemsPageComponentModel extends ZCircusComponentModel {
10
8
  public static readonly Selector = ".ZRomulatorSystemsPage-root";
@@ -13,27 +11,17 @@ export class ZRomulatorSystemsPageComponentModel extends ZCircusComponentModel {
13
11
  return Promise.resolve(new ZGridViewComponentModel(this.driver));
14
12
  }
15
13
 
16
- public async system(
17
- id: string,
18
- ): Promise<ZRomulatorSystemAvatarCardComponentModel | null> {
14
+ public async system(id: string): Promise<ZBoxComponentModel | null> {
19
15
  const grid = await this.grid();
20
- return ZCircusBy.optional(
21
- grid.driver,
22
- ZRomulatorSystemAvatarCardComponentModel,
23
- id,
24
- );
16
+ return ZCircusBy.optional(grid.driver, ZBoxComponentModel, id);
25
17
  }
26
18
 
27
- public async systems(): Promise<ZRomulatorSystemAvatarCardComponentModel[]> {
19
+ public async systems(): Promise<ZBoxComponentModel[]> {
28
20
  const grid = await this.grid();
29
- return ZCircusBy.all(grid.driver, ZRomulatorSystemAvatarCardComponentModel);
30
- }
31
-
32
- public async more(id: string): Promise<ZButtonComponentModel> {
33
- const system = await this.system(id);
34
- const card = await system?.card();
35
- const footer = await required(card?.footer());
36
-
37
- return ZCircusBy.first(footer, ZButtonComponentModel, "more");
21
+ return ZCircusBy.all(
22
+ grid.driver,
23
+ ZBoxComponentModel,
24
+ ".ZRomulatorSystemsPage-tile",
25
+ );
38
26
  }
39
27
  }
@@ -60,22 +60,22 @@ describe("ZRomulatorSystemsPage", () => {
60
60
  const expected = systems.map((s) => s.id);
61
61
 
62
62
  // Act.
63
- const cards = await target.systems();
64
- const actual = await Promise.all(cards.map((s) => s.id()));
65
-
63
+ const tiles = await target.systems();
64
+ const ids = tiles.map((s) => s.driver.attribute("data-name"));
65
+ const actual = await Promise.all(ids);
66
66
  // Assert.
67
67
  expect(actual).toEqual(expected);
68
68
  });
69
69
 
70
- it("should navigate me to the system page when I click on the navigate button", async () => {
70
+ it("should navigate me to the system page when I click on one", async () => {
71
71
  // Arrange.
72
72
  const target = await createTestTarget();
73
73
 
74
74
  // Act.
75
- const more = await target.more(nes.id);
76
- await more.click();
75
+ const system = await target.system(nes.id);
76
+ await system?.click();
77
77
 
78
78
  // Assert.
79
- expect(_history.location.pathname).toEqual(`/systems/${nes.id}`);
79
+ expect(_history.location.pathname).toEqual(`/${nes.id}`);
80
80
  });
81
81
  });
@@ -1,48 +1,108 @@
1
1
  import {
2
+ useCss,
2
3
  useFashionTheme,
3
4
  useNavigate,
4
- ZButton,
5
+ ZBox,
6
+ ZBreadcrumbsLocation,
7
+ ZCard,
8
+ ZContentTitle,
5
9
  ZGridView,
10
+ ZIconFontAwesome,
11
+ ZImageSource,
12
+ ZStack,
6
13
  } from "@zthun/fashion-boutique";
7
14
  import { ZSizeFixed, ZSizeVaried } from "@zthun/fashion-tailor";
8
- import { ZRomulatorSystemAvatarCard } from "./system-avatar-card.js";
15
+ import { css, cssJoinDefined, ZOrientation } from "@zthun/helpful-fn";
16
+ import { ZDataRequestBuilder, ZSortBuilder } from "@zthun/helpful-query";
17
+ import type { IZRomulatorSystem } from "@zthun/romulator-client";
18
+ import { useState } from "react";
9
19
  import { useSystemsService } from "./systems-service.mjs";
10
20
 
21
+ const DefaultSystemSortOrder = new ZSortBuilder()
22
+ .ascending("generation")
23
+ .ascending("name")
24
+ .build();
25
+
26
+ const DefaultSystemRequest = new ZDataRequestBuilder()
27
+ .sort(DefaultSystemSortOrder)
28
+ .build();
29
+
11
30
  export function ZRomulatorSystemsPage() {
12
- const { secondary } = useFashionTheme();
31
+ const { body } = useFashionTheme();
13
32
  const navigate = useNavigate();
14
33
  const source = useSystemsService();
34
+ const [request, setRequest] = useState(DefaultSystemRequest);
15
35
 
16
- return (
17
- <ZGridView
18
- className="ZRomulatorSystemsPage-root"
19
- GridProps={{
20
- columns: {
21
- xl: "1fr 1fr 1fr 1fr",
22
- lg: "1fr 1fr 1fr",
23
- md: "1fr 1fr",
24
- sm: "1fr",
25
- },
26
- gap: ZSizeFixed.Medium,
27
- }}
28
- dataSource={source}
29
- renderItem={(s) => (
30
- <ZRomulatorSystemAvatarCard
31
- key={s.id}
32
- system={s}
33
- CardProps={{
34
- footer: (
35
- <ZButton
36
- fashion={secondary}
37
- label="More"
38
- name="more"
36
+ const tile = useCss(css`
37
+ & {
38
+ height: 100%;
39
+ }
40
+ `);
41
+
42
+ const renderTile = (system: IZRomulatorSystem) => {
43
+ const wheel = `/systems/wheel/${system.id}.png`;
44
+ return (
45
+ <ZBox
46
+ className="ZRomulatorSystemsPage-tile"
47
+ fashion={body}
48
+ interactive
49
+ key={system.id}
50
+ cursor="pointer"
51
+ padding={ZSizeFixed.Small}
52
+ data-name={system.id}
53
+ onClick={() => navigate(system.id)}
54
+ >
55
+ <ZStack
56
+ className={cssJoinDefined(tile)}
57
+ gap={ZSizeFixed.Medium}
58
+ orientation={ZOrientation.Horizontal}
59
+ justify={{ content: "center" }}
60
+ align={{ items: "center" }}
61
+ >
62
+ <ZContentTitle
63
+ avatar={
64
+ <ZImageSource
65
+ src={wheel}
66
+ height={ZSizeVaried.Full}
39
67
  width={ZSizeVaried.Full}
40
- onClick={() => navigate(`/systems/${s.id}`)}
41
68
  />
42
- ),
69
+ }
70
+ />
71
+ </ZStack>
72
+ </ZBox>
73
+ );
74
+ };
75
+
76
+ return (
77
+ <ZStack gap={ZSizeFixed.Medium}>
78
+ <ZBreadcrumbsLocation />
79
+ <ZCard
80
+ width={ZSizeVaried.Full}
81
+ TitleProps={{
82
+ avatar: (
83
+ <ZIconFontAwesome name="puzzle-piece" width={ZSizeFixed.Medium} />
84
+ ),
85
+ heading: "Systems",
86
+ subHeading: "Your games organized by system",
87
+ }}
88
+ >
89
+ <ZGridView
90
+ className="ZRomulatorSystemsPage-root"
91
+ GridProps={{
92
+ columns: {
93
+ xl: "1fr 1fr 1fr 1fr",
94
+ lg: "1fr 1fr 1fr",
95
+ md: "1fr 1fr",
96
+ sm: "1fr",
97
+ },
98
+ gap: ZSizeFixed.Medium,
43
99
  }}
100
+ value={request}
101
+ onValueChange={setRequest}
102
+ dataSource={source}
103
+ renderItem={renderTile}
44
104
  />
45
- )}
46
- />
105
+ </ZCard>
106
+ </ZStack>
47
107
  );
48
108
  }
Binary file
Binary file
Binary file
Binary file