@mideind/netskrafl-react 1.2.0 → 1.3.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.
@@ -1001,14 +1001,14 @@ div.netskrafl-tile {
1001
1001
  cursor: default;
1002
1002
  }
1003
1003
 
1004
- div.netskrafl-tile.wide,
1005
- div.netskrafl-tile.extra-wide {
1004
+ div.netskrafl-tile.netskrafl-wide,
1005
+ div.netskrafl-tile.netskrafl-extra-wide {
1006
1006
  /* Wide tile in the rack */
1007
1007
  text-indent: -6px;
1008
1008
  }
1009
1009
 
1010
- div.board div.netskrafl-tile.wide,
1011
- div.board div.netskrafl-tile.extra-wide {
1010
+ div.board div.netskrafl-tile.netskrafl-wide,
1011
+ div.board div.netskrafl-tile.netskrafl-extra-wide {
1012
1012
  /* Wide letter tile on the board */
1013
1013
  text-indent: -2px;
1014
1014
  }
@@ -1127,8 +1127,8 @@ div.letterscore {
1127
1127
  vertical-align: bottom;
1128
1128
  }
1129
1129
 
1130
- div.netskrafl-tile.wide div.letterscore,
1131
- div.netskrafl-tile.extra-wide div.letterscore {
1130
+ div.netskrafl-tile.netskrafl-wide div.letterscore,
1131
+ div.netskrafl-tile.netskrafl-extra-wide div.letterscore {
1132
1132
  /* Adjust letter score tracking for wide tiles */
1133
1133
  letter-spacing: -0.5px;
1134
1134
  }
@@ -6408,8 +6408,8 @@ div.netskrafl-container input[type="checkbox"] {
6408
6408
  padding-top: 2px;
6409
6409
  margin-left: 0;
6410
6410
  }
6411
- div.netskrafl-tile.wide,
6412
- div.netskrafl-tile.extra-wide {
6411
+ div.netskrafl-tile.netskrafl-wide,
6412
+ div.netskrafl-tile.netskrafl-extra-wide {
6413
6413
  /* Wide character tile */
6414
6414
  text-indent: -6px;
6415
6415
  margin-left: 0;
@@ -6419,8 +6419,8 @@ div.netskrafl-container input[type="checkbox"] {
6419
6419
  /* Extra wide character tile: Q */
6420
6420
  text-indent: -8px;
6421
6421
  }
6422
- div.board div.netskrafl-tile.wide,
6423
- div.board div.netskrafl-tile.extra-wide {
6422
+ div.board div.netskrafl-tile.netskrafl-wide,
6423
+ div.board div.netskrafl-tile.netskrafl-extra-wide {
6424
6424
  /* Wide letter tile on the board */
6425
6425
  text-indent: -3.5px;
6426
6426
  }
@@ -6444,14 +6444,14 @@ div.netskrafl-container input[type="checkbox"] {
6444
6444
  right: 0px;
6445
6445
  bottom: 1px;
6446
6446
  }
6447
- div.netskrafl-tile.wide div.letterscore,
6448
- div.netskrafl-tile.extra-wide div.letterscore {
6447
+ div.netskrafl-tile.netskrafl-wide div.letterscore,
6448
+ div.netskrafl-tile.netskrafl-extra-wide div.letterscore {
6449
6449
  /* Adjust letter score position for wide tiles */
6450
6450
  right: 1px;
6451
6451
  left: auto;
6452
6452
  }
6453
- .rack div.netskrafl-tile.wide div.letterscore,
6454
- .rack div.netskrafl-tile.extra-wide div.letterscore {
6453
+ .rack div.netskrafl-tile.netskrafl-wide div.letterscore,
6454
+ .rack div.netskrafl-tile.netskrafl-extra-wide div.letterscore {
6455
6455
  /* Adjust letter score position for wide tiles */
6456
6456
  right: 1px;
6457
6457
  left: auto;
@@ -8574,6 +8574,14 @@ div.gatadagsins-board-area.celebrate div.netskrafl-tile.netskrafl-racktile{
8574
8574
  background-color: #f8f8f8;
8575
8575
  }
8576
8576
 
8577
+ .netskrafl-container .tab-icon-wrapper {
8578
+ position: relative;
8579
+ line-height: 1;
8580
+ display: flex;
8581
+ align-items: center;
8582
+ justify-content: center;
8583
+ }
8584
+
8577
8585
  .netskrafl-container .tab-icon {
8578
8586
  line-height: 1;
8579
8587
  display: flex;
@@ -8585,6 +8593,20 @@ div.gatadagsins-board-area.celebrate div.netskrafl-tile.netskrafl-racktile{
8585
8593
  font-size: 22px;
8586
8594
  }
8587
8595
 
8596
+ .netskrafl-container .tab-badge {
8597
+ position: absolute;
8598
+ top: -4px;
8599
+ right: -12px;
8600
+ font-size: 13px;
8601
+ color: var(--malfridur-secondary);
8602
+ line-height: 1;
8603
+ pointer-events: none;
8604
+ }
8605
+
8606
+ .netskrafl-container .tab-badge .glyphicon {
8607
+ font-size: 13px;
8608
+ }
8609
+
8588
8610
  .netskrafl-container .tab-label {
8589
8611
  margin-top: 2px;
8590
8612
  font-size: 12px;
@@ -8967,6 +8989,14 @@ div.gatadagsins-board-area.celebrate div.netskrafl-tile.netskrafl-racktile{
8967
8989
  font-size: 24px;
8968
8990
  }
8969
8991
 
8992
+ .netskrafl-container .tab-badge {
8993
+ font-size: 14px;
8994
+ }
8995
+
8996
+ .netskrafl-container .tab-badge .glyphicon {
8997
+ font-size: 14px;
8998
+ }
8999
+
8970
9000
  .netskrafl-container .tab-label {
8971
9001
  margin-top: 2px;
8972
9002
  font-size: 12px;
package/dist/esm/index.js CHANGED
@@ -36691,8 +36691,11 @@ const TabBar = {
36691
36691
  key: tab.id,
36692
36692
  onclick: () => onTabChange(tab.id)
36693
36693
  }, [
36694
- tab.iconGlyph ? m("span.tab-icon", glyph(tab.iconGlyph)) :
36695
- tab.icon ? m("span.tab-icon", tab.icon) : null,
36694
+ m("span.tab-icon-wrapper", [
36695
+ tab.iconGlyph ? m("span.tab-icon", glyph(tab.iconGlyph)) :
36696
+ tab.icon ? m("span.tab-icon", tab.icon) : null,
36697
+ tab.badgeGlyph ? m("span.tab-badge", glyph(tab.badgeGlyph)) : null
36698
+ ]),
36696
36699
  m("span.tab-label", tab.label)
36697
36700
  ])));
36698
36701
  }
@@ -37061,18 +37064,26 @@ const LeaderboardView = {
37061
37064
  const RightSideTabs = () => {
37062
37065
  // Component-local state for active tab (defaults to performance)
37063
37066
  let activeTab = "performance";
37064
- const tabs = [
37065
- { id: "performance", label: ts("Frammistaða"), iconGlyph: "dashboard" },
37066
- { id: "stats", label: ts("Tölfræði"), iconGlyph: "stats" },
37067
- { id: "leaderboard", label: ts("Stigatafla"), iconGlyph: "tower" }
37068
- ];
37069
37067
  return {
37070
37068
  view: (vnode) => {
37071
37069
  const { view, selectedMoves, bestMove, onMoveClick } = vnode.attrs;
37072
- const { riddle, state } = view.model;
37070
+ const { riddle, state, leaderboard } = view.model;
37073
37071
  if (!riddle) {
37074
37072
  return m(".gatadagsins-right-side-tabs", "");
37075
37073
  }
37074
+ // Check if current user is on the leaderboard
37075
+ const currentUserId = (state === null || state === void 0 ? void 0 : state.userId) || "";
37076
+ const isOnLeaderboard = leaderboard && leaderboard.some(entry => entry.userId === currentUserId);
37077
+ const tabs = [
37078
+ { id: "performance", label: ts("Frammistaða"), iconGlyph: "dashboard" },
37079
+ { id: "stats", label: ts("Tölfræði"), iconGlyph: "stats" },
37080
+ {
37081
+ id: "leaderboard",
37082
+ label: ts("Stigatafla"),
37083
+ iconGlyph: "tower",
37084
+ badgeGlyph: isOnLeaderboard ? "star" : undefined
37085
+ }
37086
+ ];
37076
37087
  const handleTabChange = (tabId) => {
37077
37088
  activeTab = tabId;
37078
37089
  };
@@ -37258,17 +37269,25 @@ const GataDagsinsHelp = {
37258
37269
  const StatsModal = () => {
37259
37270
  // Component-local state for active tab (defaults to stats)
37260
37271
  let activeTab = "stats";
37261
- const tabs = [
37262
- { id: "stats", label: ts("Tölfræði"), iconGlyph: "stats" },
37263
- { id: "leaderboard", label: ts("Stigatafla"), iconGlyph: "tower" }
37264
- ];
37265
37272
  return {
37266
37273
  view: (vnode) => {
37267
37274
  const { view, onClose } = vnode.attrs;
37268
- const { riddle, state } = view.model;
37275
+ const { riddle, state, leaderboard } = view.model;
37269
37276
  if (!riddle) {
37270
37277
  return null;
37271
37278
  }
37279
+ // Check if current user is on the leaderboard
37280
+ const currentUserId = (state === null || state === void 0 ? void 0 : state.userId) || "";
37281
+ const isOnLeaderboard = leaderboard && leaderboard.some(entry => entry.userId === currentUserId);
37282
+ const tabs = [
37283
+ { id: "stats", label: ts("Tölfræði"), iconGlyph: "stats" },
37284
+ {
37285
+ id: "leaderboard",
37286
+ label: ts("Stigatafla"),
37287
+ iconGlyph: "tower",
37288
+ badgeGlyph: isOnLeaderboard ? "star" : undefined
37289
+ }
37290
+ ];
37272
37291
  const handleTabChange = (tabId) => {
37273
37292
  activeTab = tabId;
37274
37293
  };