@saasquatch/mint-components 1.10.1 → 1.10.2-11

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.
Files changed (46) hide show
  1. package/dist/cjs/{ShadowViewAddon-721bb748.js → ShadowViewAddon-f46aba53.js} +14 -9
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mint-components.cjs.js +1 -1
  4. package/dist/cjs/sqm-big-stat_38.cjs.entry.js +67 -5
  5. package/dist/cjs/sqm-stencilbook.cjs.entry.js +94 -6
  6. package/dist/collection/components/sqm-empty/EmptyState.stories.js +1 -1
  7. package/dist/collection/components/sqm-image/sqm-image-view.js +2 -1
  8. package/dist/collection/components/sqm-image/sqm-image.js +20 -0
  9. package/dist/collection/components/sqm-leaderboard/Leaderboard.stories.js +87 -2
  10. package/dist/collection/components/sqm-leaderboard/sqm-leaderboard-view.js +15 -9
  11. package/dist/collection/components/sqm-leaderboard/sqm-leaderboard.js +93 -3
  12. package/dist/collection/components/sqm-leaderboard/useLeaderboard.js +40 -2
  13. package/dist/esm/{ShadowViewAddon-31eb5b16.js → ShadowViewAddon-5895edd5.js} +14 -9
  14. package/dist/esm/loader.js +1 -1
  15. package/dist/esm/mint-components.js +1 -1
  16. package/dist/esm/sqm-big-stat_38.entry.js +67 -5
  17. package/dist/esm/sqm-stencilbook.entry.js +94 -6
  18. package/dist/esm-es5/ShadowViewAddon-5895edd5.js +1 -0
  19. package/dist/esm-es5/loader.js +1 -1
  20. package/dist/esm-es5/mint-components.js +1 -1
  21. package/dist/esm-es5/sqm-big-stat_38.entry.js +1 -1
  22. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  23. package/dist/mint-components/mint-components.esm.js +1 -1
  24. package/dist/mint-components/{p-d6474614.js → p-1cc0f6ce.js} +1 -1
  25. package/dist/mint-components/p-60b76175.system.js +1 -0
  26. package/dist/mint-components/p-7b1b45e9.entry.js +223 -0
  27. package/dist/mint-components/p-c12e0887.system.entry.js +1 -0
  28. package/dist/mint-components/{p-bf723ae9.entry.js → p-c8af8c3b.entry.js} +2 -2
  29. package/dist/mint-components/p-ed17e637.system.js +1 -1
  30. package/dist/mint-components/p-fc352a1b.system.entry.js +1 -0
  31. package/dist/types/components/sqm-image/sqm-image-view.d.ts +1 -0
  32. package/dist/types/components/sqm-image/sqm-image.d.ts +5 -0
  33. package/dist/types/components/sqm-leaderboard/Leaderboard.stories.d.ts +3 -0
  34. package/dist/types/components/sqm-leaderboard/sqm-leaderboard-view.d.ts +3 -0
  35. package/dist/types/components/sqm-leaderboard/sqm-leaderboard.d.ts +19 -1
  36. package/dist/types/components/sqm-leaderboard/useLeaderboard.d.ts +3 -0
  37. package/dist/types/components.d.ts +42 -2
  38. package/docs/docs.docx +0 -0
  39. package/docs/raisins.json +1 -1
  40. package/grapesjs/grapesjs.js +1 -1
  41. package/package.json +2 -2
  42. package/dist/esm-es5/ShadowViewAddon-31eb5b16.js +0 -1
  43. package/dist/mint-components/p-0d39c815.system.entry.js +0 -1
  44. package/dist/mint-components/p-27bd5535.entry.js +0 -187
  45. package/dist/mint-components/p-b567780d.system.js +0 -1
  46. package/dist/mint-components/p-f1a1e7f3.system.entry.js +0 -1
@@ -28,7 +28,7 @@ const sqmPortalProfileView = require('./sqm-portal-profile-view-fde54e35.js');
28
28
  require('./utilities-cec9dd36.js');
29
29
  const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-96f329ed.js');
30
30
  const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-7ffcc0d4.js');
31
- const ShadowViewAddon = require('./ShadowViewAddon-721bb748.js');
31
+ const ShadowViewAddon = require('./ShadowViewAddon-f46aba53.js');
32
32
  const sqmPortalContainerView = require('./sqm-portal-container-view-5fb2ad49.js');
33
33
  const sqmInvoiceTableView = require('./sqm-invoice-table-view-28b14d28.js');
34
34
 
@@ -1604,8 +1604,8 @@ const SlottedIntoComponent = () => {
1604
1604
  data: {
1605
1605
  rankType: "rowNumber",
1606
1606
  leaderboard: [],
1607
- showUser: true,
1608
1607
  rowNumber: 10,
1608
+ showUser: true,
1609
1609
  userRank: {
1610
1610
  firstName: "Kutay",
1611
1611
  lastInitial: "C",
@@ -1813,7 +1813,7 @@ const BigStat = /*#__PURE__*/Object.freeze({
1813
1813
  MultipleStats: MultipleStats
1814
1814
  });
1815
1815
 
1816
- const scenario$4 = "@owner:noah @author:noah\nFeature: Leaderboard\n\tThe leaderboard supports three main cases\n\t- Top Started Referrers\n\t- Top Converted Referrers\n\t- Top Point Earners\n\tTo display these different types of leaderboards it uses the backends pre-canned options.\n\tThe backend supports filtering on programId and interval, programId is sourced from program context.\n\n Background: A user exists\n Given a user\n And they are viewing the leaderboard\n\n @motivating\n Scenario Outline: Two types of referrals leaderboards can be displayed\n Given a leaderboard has prop \"leaderboard-type\" with <value>\n And there are started referrals on the tenant\n And there are started converted on the tenant\n When the user views the leaderboard\n Then they see the referral <referralType> leaderboard\n\n Examples:\n | value | referralType |\n | topStartedReferrers | started |\n | topConvertedReferrers | converted |\n\n @motivating\n Scenario: The top point earners leaderboard can be displayed\n Given a leaderboard has prop \"leaderboard-type\" with value \"topPointEarners\"\n And there are users with points\n When the user views the leaderboard\n Then they see the top point earners leaderboard\n And text values are displayed for point counts\n\n @minutia\n Scenario Outline: Reward pretty value is used on the top point earners leaderboard\n Given top point earners leaderboard\n And the \"POINT\" reward unit has a pretty value for the following locales\n | locale |\n | en |\n | fr |\n | tr |\n When the user views the leaderboard\n And they have <locale>\n Then they see the translated pretty value in the stat value column\n\n @motivating\n Scenario Outline: Program Context is used by default to filter leaderboard results\n Given a <leaderboardType> leaderboard loaded with program context for \"my-program\"\n When the user views the leaderboard\n Then they only see <results> from \"my-program\"\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario Outline: Program Id context can be overwritten with a prop\n Given a <leaderboardType> leaderboard has prop \"program-Id\" with value \"my-test-program\"\n When the user views the leaderboard\n Then they only see <results> from \"my-test-program\"\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario Outline: Global leaderboards can be displayed by clearing program context\n\t\t#This is important for clients with use cases like StaffTracks global points leaderboard\n\t\t#This can also be done with a program section in a similar manner\n Given a <leaderboardType> leaderboard has prop \"program-Id\" with value \"\"\n When the user views the leaderboard\n Then they see global <results>\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario: Leaderboard results are shown in descending order\n Given there are leaderboard results\n When the user views the leaderboard\n Then they see up to the 10 top leaderboard results\n And leaderboard is in descending order\n\n @motivating\n Scenario Outline: Leaderboard results can be filtered with a time interval\n Given a <leaderboardType> leaderboard\n And it has prop \"interval\" with value \"2021-11-02T07:00:00.000Z/2021-11-07T07:00:00.000Z\"\n When the user views the leaderboard\n Then they only see <results> from within \"2021-11-02T07:00:00.000Z/2021-11-07T07:00:00.000Z\"\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario Outline: Leaderboard rank type can be configured\n Given a leaderboard has prop \"rank-type\" with <value>\n When the user views the leaderboard\n Then their leaderboard rank is their <rank>\n\n Examples:\n | value | rank |\n | rowNumber | row number |\n | denseRank | dense rank |\n | rank | rank |\n\n @minutia\n Scenario Outline: The max number of leaderboard rows displayed can be configured but defaults to 10\n Given a leaderboard has prop \"max-rows\" with <value>\n And the leaderboard has <resultCount>\n When the user views the leaderboard\n Then they see <number> rows\n\n Examples:\n | value | resultCount | number |\n | | 10 | 10 |\n | 5 | 10 | 5 |\n | 3 | 1 | 1 |\n | 25 | 15 | 15 |\n\n @minutiae @ui\n Scenario: Leaderboards with no results show an empty state\n Given a leaderboard has no results\n When the user views the leaderboard\n Then an empty state is dislayed\n And they see an image of a leaderboard\n And below they see \"View your rank in the leaderboard\"\n And below they see \"Be the first to refer a friend and reach the top of the leaderboard\"\n And the text is center aligned\n\n @minutiae @ui\n Scenario: A custom empty state can be provided\n Given a leaderboard has no results\n When the user views the leaderboard\n Then the contents of the \"empty\" slot are displayed\n\n @minutiae @ui\n Scenario: User is on Essentials plan\n Given the user has an Essentials plan\n When they view the leaderboard\n Then a message telling them to upgrade their plan appears:\n \"\"\"\n Contact Support to upgrade your plan and start leveraging\n gamification in your program.\n \"\"\"\n And an empty table image is displayed\n\n @minutiae @ui\n Scenario: Leaderboard headings can be customized\n Given a leaderboard\n And it has the following props\n | prop | value |\n | rankheading | Place |\n | usersheading | Customer |\n | statsheading | Referral Count |\n | show-rank | true |\n When the user views the leaderboard\n Then they see the following columns with headings\n | column | heading |\n | rank | Place |\n | user | Customer |\n | stat | Referral Count |\n\n @motivating @ui\n Scenario Outline: Leaderboard rank can be hidden or shown\n Given a leaderboard\n And it has prop \"show-rank\" with <propValue>\n When the user views the leaderboard\n Then they <maySee> the rank column\n\n Examples:\n | propValue | maySee |\n | true | see |\n | false | don't see |\n | | don't see |\n\n @motivating @ui\n Scenario: Users in the top 10 of the leaderboard results see their leaderboard row highlighted\n Given a user in the top 10 of the leaderboard results\n When they view the leaderboard\n Then they see the row with their name highlighted with brand colour\n\n @motivating @ui\n Scenario Outline: Users not in the top 10 leaderboard results can see their progress at the bottom of the leaderboard\n Given a user <mayHave> completed actions counted by the leaderboard\n And they are not in the top 10 leaderboard results\n And the leaderboard has prop \"show-user\" with <value>\n When they view the leaderboard\n Then they <maySee> \"...\" under the top 10 leaderboard results\n And under \"...\" they <maySee> a row highlighted with brand colour\n And they <maySee> their name\n And they <maySee> their leaderboard value\n And they <maySeeRank>\n\n Examples:\n | mayHave | value | maySee | maySeeRank |\n | has | true | see | see their rank |\n | hasn't | true | see | don't see their rank |\n | N/A | false | don't see | don't see their rank |\n | hasn't | | see | don't see their rank |\n\n @minutiae\n Scenario: Users without names are displayed as an \"Anonymous User\"\n Given a user\n And they do not have a first name\n And they do not have a last initial\n When they view the leaderboard\n Then they see the user displayed as \"Anonymous User\"\n\n @minutiae\n Scenario Outline: If a user only has a first or last name, then only that is displayed\n Given a user\n And they only have a <name>\n When they view the leaderboard\n Then they only see their <name>\n\n Examples:\n | name |\n | firstName |\n | lastName |\n";
1816
+ const scenario$4 = "@owner:noah @author:noah\nFeature: Leaderboard\n\tThe leaderboard supports three main cases\n\t- Top Started Referrers\n\t- Top Converted Referrers\n\t- Top Point Earners\n\tTo display these different types of leaderboards it uses the backends pre-canned options.\n\tThe backend supports filtering on programId and interval, programId is sourced from program context.\n\n Background: A user exists\n Given a user\n And they are viewing the leaderboard\n\n @motivating\n Scenario Outline: Two types of referrals leaderboards can be displayed\n Given a leaderboard has prop \"leaderboard-type\" with <value>\n And there are started referrals on the tenant\n And there are started converted on the tenant\n When the user views the leaderboard\n Then they see the referral <referralType> leaderboard\n\n Examples:\n | value | referralType |\n | topStartedReferrers | started |\n | topConvertedReferrers | converted |\n\n @motivating\n Scenario: The top point earners leaderboard can be displayed\n Given a leaderboard has prop \"leaderboard-type\" with value \"topPointEarners\"\n And there are users with points\n When the user views the leaderboard\n Then they see the top point earners leaderboard\n And text values are displayed for point counts\n\n @minutia\n Scenario Outline: Reward pretty value is used on the top point earners leaderboard\n Given top point earners leaderboard\n And the \"POINT\" reward unit has a pretty value for the following locales\n | locale |\n | en |\n | fr |\n | tr |\n When the user views the leaderboard\n And they have <locale>\n Then they see the translated pretty value in the stat value column\n\n @motivating\n Scenario Outline: Program Context is used by default to filter leaderboard results\n Given a <leaderboardType> leaderboard loaded with program context for \"my-program\"\n When the user views the leaderboard\n Then they only see <results> from \"my-program\"\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario Outline: Program Id context can be overwritten with a prop\n Given a <leaderboardType> leaderboard has prop \"program-Id\" with value \"my-test-program\"\n When the user views the leaderboard\n Then they only see <results> from \"my-test-program\"\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario Outline: Global leaderboards can be displayed by clearing program context\n\t\t#This is important for clients with use cases like StaffTracks global points leaderboard\n\t\t#This can also be done with a program section in a similar manner\n Given a <leaderboardType> leaderboard has prop \"program-Id\" with value \"\"\n When the user views the leaderboard\n Then they see global <results>\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario: Leaderboard results are shown in descending order\n Given there are leaderboard results\n When the user views the leaderboard\n Then they see up to the 10 top leaderboard results\n And leaderboard is in descending order\n\n @motivating\n Scenario Outline: Leaderboard results can be filtered with a time interval\n Given a <leaderboardType> leaderboard\n And it has prop \"interval\" with value \"2021-11-02T07:00:00.000Z/2021-11-07T07:00:00.000Z\"\n When the user views the leaderboard\n Then they only see <results> from within \"2021-11-02T07:00:00.000Z/2021-11-07T07:00:00.000Z\"\n\n Examples:\n | leaderboardType | results |\n | topStartedReferrers | started referrals |\n | topConvertedReferrers | converted referrals |\n | topPointEarners | points earned |\n\n @motivating\n Scenario Outline: Leaderboard rank type can be configured\n Given a leaderboard has prop \"rank-type\" with <value>\n When the user views the leaderboard\n Then their leaderboard rank is their <rank>\n\n Examples:\n | value | rank |\n | rowNumber | row number |\n | denseRank | dense rank |\n | rank | rank |\n\n @minutia\n Scenario Outline: The max number of leaderboard rows displayed can be configured but defaults to 10\n Given a leaderboard has prop \"max-rows\" with <value>\n And the leaderboard has <resultCount>\n When the user views the leaderboard\n Then they see <number> rows\n\n Examples:\n | value | resultCount | number |\n | | 10 | 10 |\n | 5 | 10 | 5 |\n | 3 | 1 | 1 |\n | 25 | 15 | 15 |\n\n @minutiae @ui\n Scenario: Leaderboards with no results show an empty state\n Given a leaderboard has no results\n When the user views the leaderboard\n Then an empty state is dislayed\n And they see an image of a leaderboard\n And below they see \"View your rank in the leaderboard\"\n And below they see \"Be the first to refer a friend and reach the top of the leaderboard\"\n And the text is center aligned\n\n @minutiae @ui\n Scenario: A custom empty state can be provided\n Given a leaderboard has no results\n When the user views the leaderboard\n Then the contents of the \"empty\" slot are displayed\n\n @minutiae @ui\n Scenario: User is on Essentials plan\n Given the user has an Essentials plan\n When they view the leaderboard\n Then a message telling them to upgrade their plan appears:\n \"\"\"\n Contact Support to upgrade your plan and start leveraging\n gamification in your program.\n \"\"\"\n And an empty table image is displayed\n\n @minutiae @ui\n Scenario: Leaderboard headings can be customized\n Given a leaderboard\n And it has the following props\n | prop | value |\n | rankheading | Place |\n | usersheading | Customer |\n | statsheading | Referral Count |\n | show-rank | true |\n When the user views the leaderboard\n Then they see the following columns with headings\n | column | heading |\n | rank | Place |\n | user | Customer |\n | stat | Referral Count |\n\n @motivating @ui\n Scenario Outline: Leaderboard rank can be hidden or shown\n Given a leaderboard\n And it has prop \"show-rank\" with <propValue>\n When the user views the leaderboard\n Then they <maySee> the rank column\n\n Examples:\n | propValue | maySee |\n | true | see |\n | false | don't see |\n | | don't see |\n\n Scenario Outline: Users names can be hidden or shown\n Given a leaderboard\n And it has prop \"hide-names\" with <propValue>\n When the user views the leaderboard\n Then they <maySee> the referrer column\n\n Examples:\n | propValue | maySee |\n | true | don't see |\n | false | see |\n | | see |\n\n @motivating @ui\n Scenario: Users in the top 10 of the leaderboard results see their leaderboard row highlighted\n Given a user in the top 10 of the leaderboard results\n When they view the leaderboard\n Then they see the row with their name highlighted with brand colour\n\n @motivating @ui\n Scenario Outline: Users not in the top 10 leaderboard results can see their progress at the bottom of the leaderboard\n Given a user <mayHave> completed actions counted by the leaderboard\n And they are not in the top 10 leaderboard results\n And the leaderboard has prop \"show-user\" with <value>\n When they view the leaderboard\n Then they <maySee> \"...\" under the top 10 leaderboard results\n And under \"...\" they <maySee> a row highlighted with brand colour\n And they <maySee> their name\n And they <maySee> their leaderboard value\n And they <maySeeRank>\n\n Examples:\n | mayHave | value | maySee | maySeeRank |\n | has | true | see | see their rank |\n | hasn't | true | see | don't see their rank |\n | N/A | false | don't see | don't see their rank |\n | hasn't | | see | don't see their rank |\n\n @minutiae\n Scenario: Users without names are displayed as an \"Anonymous User\"\n Given a user\n And they do not have a first name\n And they do not have a last initial\n When they view the leaderboard\n Then they see the user displayed as \"Anonymous User\"\n\n @minutiae\n Scenario Outline: If a user only has a first or last name, then only that is displayed\n Given a user\n And they only have a <name>\n When they view the leaderboard\n Then they only see their <name>\n\n Examples:\n | name |\n | firstName |\n | lastName |\n";
1817
1817
 
1818
1818
  const Leaderboard_stories = {
1819
1819
  title: "Components/Leaderboard",
@@ -1895,8 +1895,8 @@ const users = [
1895
1895
  ];
1896
1896
  const pointsUsers = [
1897
1897
  {
1898
- firstName: "",
1899
- lastInitial: "",
1898
+ firstName: "Tom",
1899
+ lastInitial: "Smith",
1900
1900
  textValue: "82 Points",
1901
1901
  rank: 1,
1902
1902
  rowNumber: 1,
@@ -1970,6 +1970,7 @@ const defaultStyles$1 = {
1970
1970
  statsheading: "Referrals",
1971
1971
  rankheading: "Rank",
1972
1972
  anonymousUser: "Anonymous User",
1973
+ rankSuffix: "{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}",
1973
1974
  };
1974
1975
  const link = index.h("a", null, "Support");
1975
1976
  const defaultElements$1 = {
@@ -2186,6 +2187,38 @@ const ReferralLeaderboard = () => {
2186
2187
  };
2187
2188
  return index.h(ShadowViewAddon.LeaderboardView, Object.assign({}, props));
2188
2189
  };
2190
+ const ReferralLeaderboardWithMaxWidth = () => {
2191
+ const props = {
2192
+ states: {
2193
+ loading: false,
2194
+ hasLeaders: true,
2195
+ styles: {
2196
+ ...defaultStyles$1,
2197
+ rankheading: "Rank",
2198
+ usersheading: "User",
2199
+ statsheading: "Referrals",
2200
+ showRank: false,
2201
+ maxWidth: "300px",
2202
+ },
2203
+ },
2204
+ data: {
2205
+ rankType: "rowNumber",
2206
+ leaderboard: users,
2207
+ rowNumber: 10,
2208
+ viewerRank: {
2209
+ firstName: "Viktor",
2210
+ lastInitial: "V",
2211
+ textValue: "82",
2212
+ rank: 1,
2213
+ rowNumber: 1,
2214
+ },
2215
+ },
2216
+ elements: {
2217
+ ...defaultElements$1,
2218
+ },
2219
+ };
2220
+ return index.h(ShadowViewAddon.LeaderboardView, Object.assign({}, props));
2221
+ };
2189
2222
  const PointsLeaderboard = () => {
2190
2223
  const props = {
2191
2224
  states: {
@@ -2325,6 +2358,58 @@ const HideViewer = () => {
2325
2358
  };
2326
2359
  return index.h(ShadowViewAddon.LeaderboardView, Object.assign({}, props));
2327
2360
  };
2361
+ const HideNames = () => {
2362
+ const props = {
2363
+ states: {
2364
+ loading: false,
2365
+ hasLeaders: true,
2366
+ rowNumber: 10,
2367
+ styles: {
2368
+ ...defaultStyles$1,
2369
+ showRank: true,
2370
+ hideNames: true,
2371
+ },
2372
+ },
2373
+ data: {
2374
+ rankType: "rowNumber",
2375
+ leaderboard: users,
2376
+ rowNumber: 10,
2377
+ viewerRank: {
2378
+ firstName: "Viktor",
2379
+ lastInitial: "V",
2380
+ textValue: "82",
2381
+ rowNumber: 1,
2382
+ rank: 1,
2383
+ },
2384
+ },
2385
+ elements: {
2386
+ ...defaultElements$1,
2387
+ },
2388
+ };
2389
+ return index.h(ShadowViewAddon.LeaderboardView, Object.assign({}, props));
2390
+ };
2391
+ const LeaderboardWithNoNamesAndGraphic = () => {
2392
+ return (index.h("div", { style: {
2393
+ display: "flex",
2394
+ alignItems: "flex-start",
2395
+ justifyContent: "center",
2396
+ width: "100%",
2397
+ gap: "50px",
2398
+ } },
2399
+ index.h("div", { style: {
2400
+ display: "flex",
2401
+ flexDirection: "column",
2402
+ alignItems: "center",
2403
+ justifyContent: "center",
2404
+ gap: "10px",
2405
+ maxWidth: "30%",
2406
+ } },
2407
+ index.h("sqm-image", { width: "70%", alignment: "center", imageUrl: "https://res.cloudinary.com/saasquatch-staging/image/upload/v1729728469/Leaderboard_image_z87lsm.png" }),
2408
+ index.h("h2", { style: { margin: "auto" } }, " Top Performers"),
2409
+ index.h("p", { style: { margin: "0" } }, "The leaderboard highlights the top performers in real-time. Stay motivated, stay competitive!")),
2410
+ index.h("sqm-leaderboard", { width: "300px", usersheading: "Referrer", statsheading: "Referrals", "rank-type": "rank", "leaderboard-type": "topStartedReferrers", rankheading: "Rank", "show-rank": "true", "hide-names": "true", "hide-viewer": "true" },
2411
+ index.h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png", "empty-state-header": "View your rank in the leaderboard", "empty-state-text": "Be the first to refer a friend and reach the top of the leaderboard" }))));
2412
+ };
2328
2413
 
2329
2414
  const Leaderboard = /*#__PURE__*/Object.freeze({
2330
2415
  __proto__: null,
@@ -2335,11 +2420,14 @@ const Leaderboard = /*#__PURE__*/Object.freeze({
2335
2420
  One: One,
2336
2421
  Five: Five,
2337
2422
  ReferralLeaderboard: ReferralLeaderboard,
2423
+ ReferralLeaderboardWithMaxWidth: ReferralLeaderboardWithMaxWidth,
2338
2424
  PointsLeaderboard: PointsLeaderboard,
2339
2425
  TenWithRank: TenWithRank,
2340
2426
  ViewerOutside: ViewerOutside,
2341
2427
  ViewerAnonymous: ViewerAnonymous,
2342
- HideViewer: HideViewer
2428
+ HideViewer: HideViewer,
2429
+ HideNames: HideNames,
2430
+ LeaderboardWithNoNamesAndGraphic: LeaderboardWithNoNamesAndGraphic
2343
2431
  });
2344
2432
 
2345
2433
  const HookStoryAddon = ({ story }, children) => {
@@ -37,8 +37,8 @@ export const SlottedIntoComponent = () => {
37
37
  data: {
38
38
  rankType: "rowNumber",
39
39
  leaderboard: [],
40
- showUser: true,
41
40
  rowNumber: 10,
41
+ showUser: true,
42
42
  userRank: {
43
43
  firstName: "Kutay",
44
44
  lastInitial: "C",
@@ -5,13 +5,14 @@ export function ImageView(props) {
5
5
  const style = {
6
6
  Container: {
7
7
  display: "flex",
8
+ // width: props.width || "100%",
8
9
  width: "100%",
9
10
  justifyContent: props.alignment || "center",
10
11
  background: props.backgroundColor || "",
11
12
  },
12
13
  Image: {
13
14
  minHeight: props.minHeight || "100%",
14
- width: "100%",
15
+ width: props.width || "100%",
15
16
  maxWidth: "max-content",
16
17
  objectFit: "cover",
17
18
  },
@@ -126,6 +126,26 @@ export class Image {
126
126
  },
127
127
  "attribute": "min-height",
128
128
  "reflect": false
129
+ },
130
+ "width": {
131
+ "type": "string",
132
+ "mutable": false,
133
+ "complexType": {
134
+ "original": "string",
135
+ "resolved": "string",
136
+ "references": {}
137
+ },
138
+ "required": false,
139
+ "optional": true,
140
+ "docs": {
141
+ "tags": [{
142
+ "text": "Width",
143
+ "name": "uiName"
144
+ }],
145
+ "text": "(Optional) Constrains the width of the image. Can be a pixel value or a percentage i.e. \"500px\", \"33%\", etc."
146
+ },
147
+ "attribute": "width",
148
+ "reflect": false
129
149
  }
130
150
  }; }
131
151
  }
@@ -81,8 +81,8 @@ const users = [
81
81
  ];
82
82
  const pointsUsers = [
83
83
  {
84
- firstName: "",
85
- lastInitial: "",
84
+ firstName: "Tom",
85
+ lastInitial: "Smith",
86
86
  textValue: "82 Points",
87
87
  rank: 1,
88
88
  rowNumber: 1,
@@ -156,6 +156,7 @@ const defaultStyles = {
156
156
  statsheading: "Referrals",
157
157
  rankheading: "Rank",
158
158
  anonymousUser: "Anonymous User",
159
+ rankSuffix: "{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}",
159
160
  };
160
161
  const link = h("a", null, "Support");
161
162
  const tag = "Contact" + link + "about upgrading your plan";
@@ -373,6 +374,38 @@ export const ReferralLeaderboard = () => {
373
374
  };
374
375
  return h(LeaderboardView, Object.assign({}, props));
375
376
  };
377
+ export const ReferralLeaderboardWithMaxWidth = () => {
378
+ const props = {
379
+ states: {
380
+ loading: false,
381
+ hasLeaders: true,
382
+ styles: {
383
+ ...defaultStyles,
384
+ rankheading: "Rank",
385
+ usersheading: "User",
386
+ statsheading: "Referrals",
387
+ showRank: false,
388
+ maxWidth: "300px",
389
+ },
390
+ },
391
+ data: {
392
+ rankType: "rowNumber",
393
+ leaderboard: users,
394
+ rowNumber: 10,
395
+ viewerRank: {
396
+ firstName: "Viktor",
397
+ lastInitial: "V",
398
+ textValue: "82",
399
+ rank: 1,
400
+ rowNumber: 1,
401
+ },
402
+ },
403
+ elements: {
404
+ ...defaultElements,
405
+ },
406
+ };
407
+ return h(LeaderboardView, Object.assign({}, props));
408
+ };
376
409
  export const PointsLeaderboard = () => {
377
410
  const props = {
378
411
  states: {
@@ -512,3 +545,55 @@ export const HideViewer = () => {
512
545
  };
513
546
  return h(LeaderboardView, Object.assign({}, props));
514
547
  };
548
+ export const HideNames = () => {
549
+ const props = {
550
+ states: {
551
+ loading: false,
552
+ hasLeaders: true,
553
+ rowNumber: 10,
554
+ styles: {
555
+ ...defaultStyles,
556
+ showRank: true,
557
+ hideNames: true,
558
+ },
559
+ },
560
+ data: {
561
+ rankType: "rowNumber",
562
+ leaderboard: users,
563
+ rowNumber: 10,
564
+ viewerRank: {
565
+ firstName: "Viktor",
566
+ lastInitial: "V",
567
+ textValue: "82",
568
+ rowNumber: 1,
569
+ rank: 1,
570
+ },
571
+ },
572
+ elements: {
573
+ ...defaultElements,
574
+ },
575
+ };
576
+ return h(LeaderboardView, Object.assign({}, props));
577
+ };
578
+ export const LeaderboardWithNoNamesAndGraphic = () => {
579
+ return (h("div", { style: {
580
+ display: "flex",
581
+ alignItems: "flex-start",
582
+ justifyContent: "center",
583
+ width: "100%",
584
+ gap: "50px",
585
+ } },
586
+ h("div", { style: {
587
+ display: "flex",
588
+ flexDirection: "column",
589
+ alignItems: "center",
590
+ justifyContent: "center",
591
+ gap: "10px",
592
+ maxWidth: "30%",
593
+ } },
594
+ h("sqm-image", { width: "70%", alignment: "center", imageUrl: "https://res.cloudinary.com/saasquatch-staging/image/upload/v1729728469/Leaderboard_image_z87lsm.png" }),
595
+ h("h2", { style: { margin: "auto" } }, " Top Performers"),
596
+ h("p", { style: { margin: "0" } }, "The leaderboard highlights the top performers in real-time. Stay motivated, stay competitive!")),
597
+ h("sqm-leaderboard", { width: "300px", usersheading: "Referrer", statsheading: "Referrals", "rank-type": "rank", "leaderboard-type": "topStartedReferrers", rankheading: "Rank", "show-rank": "true", "hide-names": "true", "hide-viewer": "true" },
598
+ h("sqm-empty", { "empty-state-image": "https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png", "empty-state-header": "View your rank in the leaderboard", "empty-state-text": "Be the first to refer a friend and reach the top of the leaderboard" }))));
599
+ };
@@ -1,5 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { createStyleSheet } from "../../styling/JSS";
3
+ import { intl } from "../../global/global";
3
4
  const style = {
4
5
  Leaderboard: {
5
6
  "& table": {
@@ -39,6 +40,9 @@ const style = {
39
40
  width: "auto",
40
41
  whiteSpace: "nowrap",
41
42
  },
43
+ "& .fullWidth": {
44
+ width: "100%",
45
+ },
42
46
  },
43
47
  };
44
48
  const sheet = createStyleSheet(style);
@@ -63,15 +67,14 @@ export function LeaderboardView(props) {
63
67
  if (!states.hasLeaders)
64
68
  return elements.empty;
65
69
  let userSeenFlag = false;
66
- return (h("div", { class: sheet.classes.Leaderboard, part: "sqm-base" },
70
+ return (h("div", { class: sheet.classes.Leaderboard, part: "sqm-base", style: { width: styles.width || "100%" } },
67
71
  h("style", { type: "text/css" },
68
72
  styleString,
69
73
  vanillaStyle),
70
- h("div", null, "Leaderboards"),
71
74
  h("table", { part: "sqm-table" },
72
75
  h("tr", null,
73
- styles.showRank && h("th", { class: "Rank" }, styles.rankheading),
74
- h("th", { class: "User" }, styles.usersheading),
76
+ styles.showRank && (h("th", { class: `Rank ${styles.hideNames ? "fullWidth" : ""}` }, styles.rankheading)),
77
+ !styles.hideNames && h("th", { class: "User" }, styles.usersheading),
75
78
  h("th", { class: "Score" }, styles.statsheading)), (_a = data.leaderboard) === null || _a === void 0 ? void 0 :
76
79
  _a.map((user) => {
77
80
  var _a, _b;
@@ -81,12 +84,15 @@ export function LeaderboardView(props) {
81
84
  user.rowNumber === ((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rowNumber)
82
85
  ? "highlight"
83
86
  : "" },
84
- styles.showRank && h("td", { class: "Rank" }, user.rank),
85
- h("td", { class: "User" }, user.firstName && user.lastInitial
87
+ styles.showRank && (h("td", { class: "Rank" }, intl.formatMessage({
88
+ id: "rank",
89
+ defaultMessage: styles.rankSuffix,
90
+ }, { rank: user.rank }))),
91
+ !styles.hideNames && (h("td", { class: "User" }, user.firstName && user.lastInitial
86
92
  ? user.firstName + " " + user.lastInitial
87
93
  : user.firstName || user.lastInitial
88
94
  ? user.firstName || user.lastInitial
89
- : styles.anonymousUser),
95
+ : styles.anonymousUser)),
90
96
  h("td", { class: "Score" }, user.textValue)));
91
97
  }),
92
98
  !userSeenFlag && !styles.hideViewer && (h("tr", null,
@@ -94,11 +100,11 @@ export function LeaderboardView(props) {
94
100
  h("sl-icon", { name: "three-dots", style: { verticalAlign: "middle" } })))),
95
101
  !userSeenFlag && !styles.hideViewer && (h("tr", { class: "highlight" },
96
102
  styles.showRank && (h("td", { class: "Rank" }, ((_b = data.viewerRank) === null || _b === void 0 ? void 0 : _b.rank) || "-")),
97
- h("td", { class: "User" }, ((_c = data.viewerRank) === null || _c === void 0 ? void 0 : _c.firstName) && ((_d = data.viewerRank) === null || _d === void 0 ? void 0 : _d.lastInitial)
103
+ !styles.hideNames && (h("td", { class: "User" }, ((_c = data.viewerRank) === null || _c === void 0 ? void 0 : _c.firstName) && ((_d = data.viewerRank) === null || _d === void 0 ? void 0 : _d.lastInitial)
98
104
  ? ((_e = data.viewerRank) === null || _e === void 0 ? void 0 : _e.firstName) +
99
105
  " " + ((_f = data.viewerRank) === null || _f === void 0 ? void 0 : _f.lastInitial)
100
106
  : ((_g = data.viewerRank) === null || _g === void 0 ? void 0 : _g.firstName) || ((_h = data.viewerRank) === null || _h === void 0 ? void 0 : _h.lastInitial)
101
107
  ? ((_j = data.viewerRank) === null || _j === void 0 ? void 0 : _j.firstName) || ((_k = data.viewerRank) === null || _k === void 0 ? void 0 : _k.lastInitial)
102
- : styles.anonymousUser),
108
+ : styles.anonymousUser)),
103
109
  h("td", { class: "Score" }, ((_l = data.viewerRank) === null || _l === void 0 ? void 0 : _l.textValue) || "0"))))));
104
110
  }
@@ -13,10 +13,21 @@ import { useLeaderboard } from "./useLeaderboard";
13
13
  * @example Referral Started Leaderboard - <sqm-leaderboard usersheading="Referrer" statsheading="Referrals" rank-type="rank" leaderboard-type="topStartedReferrers" rankheading="Rank" show-rank="true"><sqm-empty empty-state-image="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png" empty-state-header="View your rank in the leaderboard" empty-state-text="Be the first to refer a friend and reach the top of the leaderboard" ></sqm-empty></sqm-leaderboard>
14
14
  * @example Referral Converted Leaderboard - <sqm-leaderboard usersheading="Referrer" statsheading="Referrals" rank-type="rank" leaderboard-type="topConvertedReferrers" rankheading="Rank" show-rank="true"><sqm-empty empty-state-image="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png" empty-state-header="View your rank in the leaderboard" empty-state-text="Be the first to refer a friend and reach the top of the leaderboard" ></sqm-empty></sqm-leaderboard>
15
15
  * @example Points Earned Leaderboard - <sqm-leaderboard usersheading="Name" statsheading="Points" rank-type="rank" leaderboard-type="topPointEarners" rankheading="Rank" show-rank="true"><sqm-empty empty-state-image="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png" empty-state-header="View your rank in the leaderboard" empty-state-text="Be the first to refer a friend and reach the top of the leaderboard" ></sqm-empty></sqm-leaderboard>
16
+ * @example Anonymous Leaderboard - <div style="display: flex; align-items: flex-start; justify-content: center; width: 100%; gap: 50px;"><div style="display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; max-width: 30%;"><sqm-image width="70%" alignment="center" image-url="https://res.cloudinary.com/saasquatch-staging/image/upload/v1729728469/Leaderboard_image_z87lsm.png"></sqm-image><h2 style="margin: auto;">Top Performers</h2><p style="margin: 0;">The leaderboard highlights the top performers in real-time. Stay motivated, stay competitive!</p></div><sqm-leaderboard width="300px" usersheading="Referrer" statsheading="Referrals" rank-type="rank" leaderboard-type="topStartedReferrers" rankheading="Rank" show-rank="true" hide-names="true" hide-viewer="true"><sqm-empty empty-state-image="https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png" empty-state-header="View your rank in the leaderboard" empty-state-text="Be the first to refer a friend and reach the top of the leaderboard"></sqm-empty></sqm-leaderboard></div>
16
17
  * @featureTooltip <div>Motivate your participants by gamifying your program. Contact <a href="mailto:saasquatch-support%40impact.com?subject=Next steps for Leaderboards feature&body=Hi Support Team, %0D%0A%0D%0A I am interested in learning more about how Leaderboards can support the growth of our referral program. Please connect me with a program strategy manager to discuss this feature further, and determine the next steps.%0D%0A%0D%0A%0D%0AThank you,%0D%0A[Add your name here]">Support</a> to upgrade your plan and add a leaderboard.</div>
17
18
  */
18
19
  export class Leaderboard {
19
20
  constructor() {
21
+ /**
22
+ * Restrict the width of the leaderboard (Can be a pixel value or a percentage i.e. "500px", "33%", etc.)
23
+ *
24
+ * @uiName Width
25
+ */
26
+ this.width = "100%";
27
+ /**
28
+ * @uiName Rank Suffix
29
+ */
30
+ this.rankSuffix = "{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}";
20
31
  /**
21
32
  * Hide the viewer's leaderboard row if not in the top results.
22
33
  *
@@ -24,10 +35,17 @@ export class Leaderboard {
24
35
  * @default
25
36
  */
26
37
  this.hideViewer = false;
38
+ /**
39
+ * Hide the Names of users to protect personal identifiable information
40
+ *
41
+ * @uiName Hide users names
42
+ * @default
43
+ */
44
+ this.hideNames = false;
27
45
  /**
28
46
  * Hides the leaderboard if user is on Essentials plan
29
47
  *
30
- * @uiName Hide viewing user
48
+ * @uiName Hide leaderboard for essentials user
31
49
  * @default
32
50
  */
33
51
  this.isEssentials = false;
@@ -62,8 +80,11 @@ export class Leaderboard {
62
80
  anonymousUser: this.anonymousUser,
63
81
  interval: this.interval,
64
82
  hideViewer: this.hideViewer,
83
+ hideNames: this.hideNames,
65
84
  showRank: this.showRank,
66
85
  isEssentials: this.isEssentials,
86
+ rankSuffix: this.rankSuffix,
87
+ width: this.width,
67
88
  };
68
89
  const demoProps = { ...props, demoData: this.demoData };
69
90
  const viewprops = isDemo()
@@ -177,6 +198,48 @@ export class Leaderboard {
177
198
  "attribute": "show-rank",
178
199
  "reflect": false
179
200
  },
201
+ "width": {
202
+ "type": "string",
203
+ "mutable": false,
204
+ "complexType": {
205
+ "original": "string",
206
+ "resolved": "string",
207
+ "references": {}
208
+ },
209
+ "required": false,
210
+ "optional": false,
211
+ "docs": {
212
+ "tags": [{
213
+ "text": "Width",
214
+ "name": "uiName"
215
+ }],
216
+ "text": "Restrict the width of the leaderboard (Can be a pixel value or a percentage i.e. \"500px\", \"33%\", etc.)"
217
+ },
218
+ "attribute": "width",
219
+ "reflect": false,
220
+ "defaultValue": "\"100%\""
221
+ },
222
+ "rankSuffix": {
223
+ "type": "string",
224
+ "mutable": false,
225
+ "complexType": {
226
+ "original": "string",
227
+ "resolved": "string",
228
+ "references": {}
229
+ },
230
+ "required": false,
231
+ "optional": false,
232
+ "docs": {
233
+ "tags": [{
234
+ "text": "Rank Suffix",
235
+ "name": "uiName"
236
+ }],
237
+ "text": ""
238
+ },
239
+ "attribute": "rank-suffix",
240
+ "reflect": false,
241
+ "defaultValue": "\"{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}\""
242
+ },
180
243
  "hideViewer": {
181
244
  "type": "boolean",
182
245
  "mutable": false,
@@ -201,6 +264,30 @@ export class Leaderboard {
201
264
  "reflect": false,
202
265
  "defaultValue": "false"
203
266
  },
267
+ "hideNames": {
268
+ "type": "boolean",
269
+ "mutable": false,
270
+ "complexType": {
271
+ "original": "boolean",
272
+ "resolved": "boolean",
273
+ "references": {}
274
+ },
275
+ "required": false,
276
+ "optional": false,
277
+ "docs": {
278
+ "tags": [{
279
+ "text": "Hide users names",
280
+ "name": "uiName"
281
+ }, {
282
+ "text": undefined,
283
+ "name": "default"
284
+ }],
285
+ "text": "Hide the Names of users to protect personal identifiable information"
286
+ },
287
+ "attribute": "hide-names",
288
+ "reflect": false,
289
+ "defaultValue": "false"
290
+ },
204
291
  "isEssentials": {
205
292
  "type": "boolean",
206
293
  "mutable": false,
@@ -213,7 +300,7 @@ export class Leaderboard {
213
300
  "optional": true,
214
301
  "docs": {
215
302
  "tags": [{
216
- "text": "Hide viewing user",
303
+ "text": "Hide leaderboard for essentials user",
217
304
  "name": "uiName"
218
305
  }, {
219
306
  "text": undefined,
@@ -359,7 +446,7 @@ export class Leaderboard {
359
446
  "mutable": false,
360
447
  "complexType": {
361
448
  "original": "DemoData<LeaderboardViewProps>",
362
- "resolved": "{ states?: { loading: boolean; hasLeaders: boolean; isEssentials?: boolean; styles: { usersheading: string; statsheading: string; rankheading?: string; showRank?: boolean; hideViewer?: boolean; anonymousUser?: string; }; }; data?: { rankType: string; leaderboard: { textValue: string; rank: number; firstName: string; lastInitial: string; rowNumber: number; }[]; viewerRank?: { textValue: string; rank: number; firstName: string; lastInitial: string; rowNumber: number; }; }; elements?: { empty: VNode; essentials: VNode; loadingstate: VNode; }; }",
449
+ "resolved": "{ states?: { loading: boolean; hasLeaders: boolean; isEssentials?: boolean; styles: { usersheading: string; statsheading: string; rankheading?: string; showRank?: boolean; hideViewer?: boolean; hideNames?: boolean; anonymousUser?: string; rankSuffix?: string; width?: string; }; }; data?: { rankType: string; leaderboard: { textValue: string; rank: number; firstName: string; lastInitial: string; rowNumber: number; }[]; viewerRank?: { textValue: string; rank: number; firstName: string; lastInitial: string; rowNumber: number; }; }; elements?: { empty: VNode; essentials: VNode; loadingstate: VNode; }; }",
363
450
  "references": {
364
451
  "DemoData": {
365
452
  "location": "import",
@@ -460,6 +547,9 @@ function useLeaderboardDemo(props) {
460
547
  : "Anonymous User",
461
548
  showRank: props.showRank,
462
549
  hideViewer: props.hideViewer,
550
+ hideNames: props.hideNames,
551
+ rankSuffix: props.rankSuffix,
552
+ width: props.width,
463
553
  },
464
554
  },
465
555
  data: {
@@ -23,6 +23,26 @@ const GET_LEADERBOARD = gql `
23
23
  }
24
24
  }
25
25
  `;
26
+ const GET_LEADERBOARD_WITHOUT_NAMES = gql `
27
+ query (
28
+ $type: String!
29
+ $filter: UserLeaderboardFilterInput
30
+ $locale: RSLocale
31
+ $limit: Int!
32
+ ) {
33
+ userLeaderboard(type: $type, filter: $filter) {
34
+ dateModified
35
+ rows(limit: $limit) {
36
+ textValue(locale: $locale)
37
+ rank {
38
+ rank
39
+ denseRank
40
+ rowNumber
41
+ }
42
+ }
43
+ }
44
+ }
45
+ `;
26
46
  const GET_RANK = gql `
27
47
  query (
28
48
  $type: String!
@@ -43,6 +63,24 @@ const GET_RANK = gql `
43
63
  }
44
64
  }
45
65
  `;
66
+ const GET_RANK_WITHOUT_NAMES = gql `
67
+ query (
68
+ $type: String!
69
+ $filter: UserLeaderboardFilterInput
70
+ $locale: RSLocale
71
+ ) {
72
+ viewer {
73
+ ... on User {
74
+ leaderboardRank(type: $type, filter: $filter) {
75
+ textValue(locale: $locale)
76
+ rank
77
+ denseRank
78
+ rowNumber
79
+ }
80
+ }
81
+ }
82
+ }
83
+ `;
46
84
  export function useLeaderboard(props) {
47
85
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
48
86
  const programIdContext = useProgramId();
@@ -68,8 +106,8 @@ export function useLeaderboard(props) {
68
106
  if (props.maxRows > 0) {
69
107
  variables["limit"] = props.maxRows;
70
108
  }
71
- const { data: leaderboardData, loading: loadingLeaderboard, errors: leaderboardErrors, } = useQuery(GET_LEADERBOARD, variables, !(user === null || user === void 0 ? void 0 : user.jwt), { batch: false });
72
- const { data: rankData } = useQuery(GET_RANK, variables, !(user === null || user === void 0 ? void 0 : user.jwt));
109
+ const { data: leaderboardData, loading: loadingLeaderboard, errors: leaderboardErrors, } = useQuery(props.hideNames ? GET_LEADERBOARD_WITHOUT_NAMES : GET_LEADERBOARD, variables, !(user === null || user === void 0 ? void 0 : user.jwt), { batch: false });
110
+ const { data: rankData } = useQuery(props.hideNames ? GET_RANK_WITHOUT_NAMES : GET_RANK, variables, !(user === null || user === void 0 ? void 0 : user.jwt));
73
111
  const leaderboardRows = (_b = leaderboardData === null || leaderboardData === void 0 ? void 0 : leaderboardData.userLeaderboard) === null || _b === void 0 ? void 0 : _b.rows;
74
112
  const flattenedLeaderboard = getFlattenedLeaderboard(leaderboardRows);
75
113
  const sortedLeaderboard = flattenedLeaderboard === null || flattenedLeaderboard === void 0 ? void 0 : flattenedLeaderboard.sort(function (a, b) {