@saasquatch/vanilla-components 1.2.5 → 1.2.7
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/LICENSE +21 -21
- package/dist/cjs/{WidgetHost-fce29ef5.js → WidgetHost-71b013eb.js} +195 -195
- package/dist/cjs/sqh-close-button.cjs.entry.js +1 -1
- package/dist/cjs/sqh-copy-button_12.cjs.entry.js +147 -147
- package/dist/cjs/sqh-referral-code.cjs.entry.js +1 -1
- package/dist/collection/components/copy-button/copy-button.js +22 -22
- package/dist/collection/components/copy-link-button/copy-link-button.js +15 -15
- package/dist/collection/components/global-container/global-container.js +8 -8
- package/dist/collection/components/image-component/image-component.js +10 -10
- package/dist/collection/components/partner-stat-component/partner-stat-component.js +2 -2
- package/dist/collection/components/referral-list/referral-list.js +51 -51
- package/dist/collection/components/share-button/share-button.js +19 -19
- package/dist/collection/components/stat-component/stat-component.js +2 -2
- package/dist/collection/components/stats-container/stats-container.js +4 -4
- package/dist/collection/components/text-component/text-component.js +13 -13
- package/dist/collection/entrypoint.js +34 -34
- package/dist/collection/services/WidgetHost.js +195 -195
- package/dist/esm/{WidgetHost-903fb7cc.js → WidgetHost-9c337319.js} +195 -195
- package/dist/esm/sqh-close-button.entry.js +1 -1
- package/dist/esm/sqh-copy-button_12.entry.js +147 -147
- package/dist/esm/sqh-referral-code.entry.js +1 -1
- package/dist/esm-es5/sqh-close-button.entry.js +1 -1
- package/dist/esm-es5/sqh-copy-button_12.entry.js +2 -2
- package/dist/esm-es5/sqh-referral-code.entry.js +1 -1
- package/dist/types/saasquatch.d.ts +105 -105
- package/dist/widget-components/entrypoint.js +34 -34
- package/dist/widget-components/{p-50ae8f2b.entry.js → p-366f1663.entry.js} +1 -1
- package/dist/widget-components/{p-131a5c4a.entry.js → p-54ea7a00.entry.js} +1 -1
- package/dist/widget-components/p-58be1132.system.js +1 -1
- package/dist/widget-components/{p-8baa34a0.entry.js → p-71e912a2.entry.js} +6 -6
- package/dist/widget-components/{p-b9fcb846.system.entry.js → p-b17efca4.system.entry.js} +1 -1
- package/dist/widget-components/p-c5f70ddc.system.entry.js +8 -0
- package/dist/widget-components/{p-da180bcd.system.entry.js → p-c8bc8c77.system.entry.js} +1 -1
- package/dist/widget-components/widget-components.esm.js +1 -1
- package/package.json +97 -97
- package/readme.md +52 -52
- package/dist/widget-components/p-1b8f2cfc.system.entry.js +0 -8
- /package/dist/esm-es5/{WidgetHost-903fb7cc.js → WidgetHost-9c337319.js} +0 -0
- /package/dist/widget-components/{p-e692beaf.system.js → p-8e232564.system.js} +0 -0
- /package/dist/widget-components/{p-ffeb02d1.js → p-edd43dbc.js} +0 -0
|
@@ -261,10 +261,10 @@ const API = {
|
|
|
261
261
|
};
|
|
262
262
|
return apolloClient()
|
|
263
263
|
.mutate({
|
|
264
|
-
mutation: gql `
|
|
265
|
-
mutation ($eventMeta: UserAnalyticsEvent!) {
|
|
266
|
-
createUserAnalyticsEvent(eventMeta: $eventMeta)
|
|
267
|
-
}
|
|
264
|
+
mutation: gql `
|
|
265
|
+
mutation ($eventMeta: UserAnalyticsEvent!) {
|
|
266
|
+
createUserAnalyticsEvent(eventMeta: $eventMeta)
|
|
267
|
+
}
|
|
268
268
|
`,
|
|
269
269
|
variables,
|
|
270
270
|
})
|
|
@@ -281,21 +281,21 @@ const API = {
|
|
|
281
281
|
return apolloClient();
|
|
282
282
|
},
|
|
283
283
|
getUserFragment(userFragment, fragmentVariables) {
|
|
284
|
-
const fragment = gql `
|
|
285
|
-
fragment UserFragment on User {
|
|
286
|
-
${userFragment}
|
|
284
|
+
const fragment = gql `
|
|
285
|
+
fragment UserFragment on User {
|
|
286
|
+
${userFragment}
|
|
287
287
|
}`;
|
|
288
288
|
const { userId, accountId } = widgetIdent();
|
|
289
289
|
const variables = Object.assign(Object.assign({}, fragmentVariables), { userId,
|
|
290
290
|
accountId });
|
|
291
291
|
return this.getClient().query({
|
|
292
|
-
query: gql `
|
|
293
|
-
query ($userId: String!, $accountId: String!, $offset: Int) {
|
|
294
|
-
user(id: $userId, accountId: $accountId) {
|
|
295
|
-
...UserFragment
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
${fragment}
|
|
292
|
+
query: gql `
|
|
293
|
+
query ($userId: String!, $accountId: String!, $offset: Int) {
|
|
294
|
+
user(id: $userId, accountId: $accountId) {
|
|
295
|
+
...UserFragment
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
${fragment}
|
|
299
299
|
`,
|
|
300
300
|
variables,
|
|
301
301
|
});
|
|
@@ -313,22 +313,22 @@ const API = {
|
|
|
313
313
|
};
|
|
314
314
|
return this.getClient()
|
|
315
315
|
.query({
|
|
316
|
-
query: gql `
|
|
317
|
-
query (
|
|
318
|
-
$userId: String!
|
|
319
|
-
$accountId: String!
|
|
320
|
-
$programId: ID
|
|
321
|
-
$engagementMedium: UserEngagementMedium!
|
|
322
|
-
) {
|
|
323
|
-
user(id: $userId, accountId: $accountId) {
|
|
324
|
-
shareLink(
|
|
325
|
-
programId: $programId
|
|
326
|
-
engagementMedium: $engagementMedium
|
|
327
|
-
shareMedium: DIRECT
|
|
328
|
-
useCleanLink: true
|
|
329
|
-
)
|
|
330
|
-
}
|
|
331
|
-
}
|
|
316
|
+
query: gql `
|
|
317
|
+
query (
|
|
318
|
+
$userId: String!
|
|
319
|
+
$accountId: String!
|
|
320
|
+
$programId: ID
|
|
321
|
+
$engagementMedium: UserEngagementMedium!
|
|
322
|
+
) {
|
|
323
|
+
user(id: $userId, accountId: $accountId) {
|
|
324
|
+
shareLink(
|
|
325
|
+
programId: $programId
|
|
326
|
+
engagementMedium: $engagementMedium
|
|
327
|
+
shareMedium: DIRECT
|
|
328
|
+
useCleanLink: true
|
|
329
|
+
)
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
332
|
`,
|
|
333
333
|
variables,
|
|
334
334
|
})
|
|
@@ -356,62 +356,62 @@ const API = {
|
|
|
356
356
|
};
|
|
357
357
|
return this.getClient()
|
|
358
358
|
.query({
|
|
359
|
-
query: gql `
|
|
360
|
-
query (
|
|
361
|
-
$userId: String!
|
|
362
|
-
$accountId: String!
|
|
363
|
-
$offset: Int!
|
|
364
|
-
$limit: Int!
|
|
365
|
-
$programId: ID
|
|
366
|
-
$programId_exists: Boolean!
|
|
367
|
-
) {
|
|
368
|
-
user(id: $userId, accountId: $accountId) {
|
|
369
|
-
locale
|
|
370
|
-
referrals(
|
|
371
|
-
limit: $limit
|
|
372
|
-
offset: $offset
|
|
373
|
-
filter: {
|
|
374
|
-
programId_eq: $programId
|
|
375
|
-
programId_exists: $programId_exists
|
|
376
|
-
}
|
|
377
|
-
) {
|
|
378
|
-
totalCount
|
|
379
|
-
data {
|
|
380
|
-
dateConverted
|
|
381
|
-
dateReferralStarted
|
|
382
|
-
referredUser {
|
|
383
|
-
firstName
|
|
384
|
-
lastName
|
|
385
|
-
}
|
|
386
|
-
rewards(
|
|
387
|
-
filter: { userId_eq: $userId, accountId_eq: $accountId }
|
|
388
|
-
) {
|
|
389
|
-
prettyValue
|
|
390
|
-
dateExpires
|
|
391
|
-
statuses
|
|
392
|
-
meta {
|
|
393
|
-
message
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
}
|
|
359
|
+
query: gql `
|
|
360
|
+
query (
|
|
361
|
+
$userId: String!
|
|
362
|
+
$accountId: String!
|
|
363
|
+
$offset: Int!
|
|
364
|
+
$limit: Int!
|
|
365
|
+
$programId: ID
|
|
366
|
+
$programId_exists: Boolean!
|
|
367
|
+
) {
|
|
368
|
+
user(id: $userId, accountId: $accountId) {
|
|
369
|
+
locale
|
|
370
|
+
referrals(
|
|
371
|
+
limit: $limit
|
|
372
|
+
offset: $offset
|
|
373
|
+
filter: {
|
|
374
|
+
programId_eq: $programId
|
|
375
|
+
programId_exists: $programId_exists
|
|
376
|
+
}
|
|
377
|
+
) {
|
|
378
|
+
totalCount
|
|
379
|
+
data {
|
|
380
|
+
dateConverted
|
|
381
|
+
dateReferralStarted
|
|
382
|
+
referredUser {
|
|
383
|
+
firstName
|
|
384
|
+
lastName
|
|
385
|
+
}
|
|
386
|
+
rewards(
|
|
387
|
+
filter: { userId_eq: $userId, accountId_eq: $accountId }
|
|
388
|
+
) {
|
|
389
|
+
prettyValue
|
|
390
|
+
dateExpires
|
|
391
|
+
statuses
|
|
392
|
+
meta {
|
|
393
|
+
message
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
398
|
${showReferrer
|
|
399
|
-
? `referredByReferral(programId: $programId) {
|
|
400
|
-
referrerUser {
|
|
401
|
-
firstName
|
|
402
|
-
lastName
|
|
403
|
-
}
|
|
404
|
-
dateReferralStarted
|
|
405
|
-
rewards(
|
|
406
|
-
filter: { userId_eq: $userId, accountId_eq: $accountId }
|
|
407
|
-
) {
|
|
408
|
-
prettyValue
|
|
409
|
-
statuses
|
|
410
|
-
}
|
|
399
|
+
? `referredByReferral(programId: $programId) {
|
|
400
|
+
referrerUser {
|
|
401
|
+
firstName
|
|
402
|
+
lastName
|
|
403
|
+
}
|
|
404
|
+
dateReferralStarted
|
|
405
|
+
rewards(
|
|
406
|
+
filter: { userId_eq: $userId, accountId_eq: $accountId }
|
|
407
|
+
) {
|
|
408
|
+
prettyValue
|
|
409
|
+
statuses
|
|
410
|
+
}
|
|
411
411
|
}`
|
|
412
|
-
: ""}
|
|
413
|
-
}
|
|
414
|
-
}
|
|
412
|
+
: ""}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
415
|
`,
|
|
416
416
|
variables,
|
|
417
417
|
})
|
|
@@ -442,70 +442,70 @@ const API = {
|
|
|
442
442
|
};
|
|
443
443
|
return this.getClient()
|
|
444
444
|
.query({
|
|
445
|
-
query: gql `
|
|
446
|
-
query (
|
|
447
|
-
$userId: String!
|
|
448
|
-
$accountId: String!
|
|
449
|
-
$programId: ID
|
|
450
|
-
$programId_exists: Boolean!
|
|
451
|
-
) {
|
|
452
|
-
user(id: $userId, accountId: $accountId) {
|
|
453
|
-
referralsCount: referrals(
|
|
454
|
-
filter: {
|
|
455
|
-
programId_eq: $programId
|
|
456
|
-
programId_exists: $programId_exists
|
|
457
|
-
}
|
|
458
|
-
) {
|
|
459
|
-
totalCount
|
|
460
|
-
}
|
|
461
|
-
referralsMonth: referrals(
|
|
462
|
-
filter: {
|
|
463
|
-
programId_eq: $programId
|
|
464
|
-
programId_exists: $programId_exists
|
|
465
|
-
dateReferralStarted_timeframe: "this_month"
|
|
466
|
-
}
|
|
467
|
-
) {
|
|
468
|
-
totalCount
|
|
469
|
-
}
|
|
470
|
-
referralsWeek: referrals(
|
|
471
|
-
filter: {
|
|
472
|
-
programId_eq: $programId
|
|
473
|
-
programId_exists: $programId_exists
|
|
474
|
-
dateReferralStarted_timeframe: "this_week"
|
|
475
|
-
}
|
|
476
|
-
) {
|
|
477
|
-
totalCount
|
|
478
|
-
}
|
|
479
|
-
rewardsCount: rewards(
|
|
480
|
-
filter: {
|
|
481
|
-
programId_eq: $programId
|
|
482
|
-
programId_exists: $programId_exists
|
|
483
|
-
}
|
|
484
|
-
) {
|
|
485
|
-
totalCount
|
|
486
|
-
}
|
|
487
|
-
rewardsMonth: rewards(
|
|
488
|
-
filter: {
|
|
489
|
-
programId_eq: $programId
|
|
490
|
-
programId_exists: $programId_exists
|
|
491
|
-
dateGiven_timeframe: "this_month"
|
|
492
|
-
}
|
|
493
|
-
) {
|
|
494
|
-
totalCount
|
|
495
|
-
}
|
|
496
|
-
rewardsWeek: rewards(
|
|
497
|
-
filter: {
|
|
498
|
-
programId_eq: $programId
|
|
499
|
-
programId_exists: $programId_exists
|
|
500
|
-
dateGiven_timeframe: "this_week"
|
|
501
|
-
}
|
|
502
|
-
) {
|
|
503
|
-
totalCount
|
|
504
|
-
}
|
|
505
|
-
rewardBalances(programId: $programId)
|
|
506
|
-
rewardBalancesGlobal: rewardBalances
|
|
507
|
-
}
|
|
508
|
-
}
|
|
445
|
+
query: gql `
|
|
446
|
+
query (
|
|
447
|
+
$userId: String!
|
|
448
|
+
$accountId: String!
|
|
449
|
+
$programId: ID
|
|
450
|
+
$programId_exists: Boolean!
|
|
451
|
+
) {
|
|
452
|
+
user(id: $userId, accountId: $accountId) {
|
|
453
|
+
referralsCount: referrals(
|
|
454
|
+
filter: {
|
|
455
|
+
programId_eq: $programId
|
|
456
|
+
programId_exists: $programId_exists
|
|
457
|
+
}
|
|
458
|
+
) {
|
|
459
|
+
totalCount
|
|
460
|
+
}
|
|
461
|
+
referralsMonth: referrals(
|
|
462
|
+
filter: {
|
|
463
|
+
programId_eq: $programId
|
|
464
|
+
programId_exists: $programId_exists
|
|
465
|
+
dateReferralStarted_timeframe: "this_month"
|
|
466
|
+
}
|
|
467
|
+
) {
|
|
468
|
+
totalCount
|
|
469
|
+
}
|
|
470
|
+
referralsWeek: referrals(
|
|
471
|
+
filter: {
|
|
472
|
+
programId_eq: $programId
|
|
473
|
+
programId_exists: $programId_exists
|
|
474
|
+
dateReferralStarted_timeframe: "this_week"
|
|
475
|
+
}
|
|
476
|
+
) {
|
|
477
|
+
totalCount
|
|
478
|
+
}
|
|
479
|
+
rewardsCount: rewards(
|
|
480
|
+
filter: {
|
|
481
|
+
programId_eq: $programId
|
|
482
|
+
programId_exists: $programId_exists
|
|
483
|
+
}
|
|
484
|
+
) {
|
|
485
|
+
totalCount
|
|
486
|
+
}
|
|
487
|
+
rewardsMonth: rewards(
|
|
488
|
+
filter: {
|
|
489
|
+
programId_eq: $programId
|
|
490
|
+
programId_exists: $programId_exists
|
|
491
|
+
dateGiven_timeframe: "this_month"
|
|
492
|
+
}
|
|
493
|
+
) {
|
|
494
|
+
totalCount
|
|
495
|
+
}
|
|
496
|
+
rewardsWeek: rewards(
|
|
497
|
+
filter: {
|
|
498
|
+
programId_eq: $programId
|
|
499
|
+
programId_exists: $programId_exists
|
|
500
|
+
dateGiven_timeframe: "this_week"
|
|
501
|
+
}
|
|
502
|
+
) {
|
|
503
|
+
totalCount
|
|
504
|
+
}
|
|
505
|
+
rewardBalances(programId: $programId)
|
|
506
|
+
rewardBalancesGlobal: rewardBalances
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
509
|
`,
|
|
510
510
|
variables,
|
|
511
511
|
})
|
|
@@ -523,12 +523,12 @@ const API = {
|
|
|
523
523
|
};
|
|
524
524
|
return this.getClient()
|
|
525
525
|
.query({
|
|
526
|
-
query: gql `
|
|
527
|
-
query ($userId: String!, $accountId: String!, $programId: ID!) {
|
|
528
|
-
user(id: $userId, accountId: $accountId) {
|
|
529
|
-
referralCode(programId: $programId)
|
|
530
|
-
}
|
|
531
|
-
}
|
|
526
|
+
query: gql `
|
|
527
|
+
query ($userId: String!, $accountId: String!, $programId: ID!) {
|
|
528
|
+
user(id: $userId, accountId: $accountId) {
|
|
529
|
+
referralCode(programId: $programId)
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
532
|
`,
|
|
533
533
|
variables,
|
|
534
534
|
})
|
|
@@ -551,33 +551,33 @@ const API = {
|
|
|
551
551
|
};
|
|
552
552
|
return this.getClient()
|
|
553
553
|
.query({
|
|
554
|
-
query: gql `
|
|
555
|
-
query (
|
|
556
|
-
$userId: String!
|
|
557
|
-
$accountId: String!
|
|
558
|
-
$programId: ID!
|
|
559
|
-
$rewardKey: String!
|
|
560
|
-
) {
|
|
561
|
-
user(id: $userId, accountId: $accountId) {
|
|
562
|
-
referredByReferral(programId: $programId) {
|
|
563
|
-
referrerUser {
|
|
564
|
-
referralCode(programId: $programId)
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
rewards(
|
|
568
|
-
filter: {
|
|
569
|
-
programId_eq: $programId
|
|
570
|
-
programRewardKey_eq: $rewardKey
|
|
571
|
-
}
|
|
572
|
-
) {
|
|
573
|
-
count
|
|
574
|
-
totalCount
|
|
575
|
-
data {
|
|
576
|
-
fuelTankCode
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
}
|
|
554
|
+
query: gql `
|
|
555
|
+
query (
|
|
556
|
+
$userId: String!
|
|
557
|
+
$accountId: String!
|
|
558
|
+
$programId: ID!
|
|
559
|
+
$rewardKey: String!
|
|
560
|
+
) {
|
|
561
|
+
user(id: $userId, accountId: $accountId) {
|
|
562
|
+
referredByReferral(programId: $programId) {
|
|
563
|
+
referrerUser {
|
|
564
|
+
referralCode(programId: $programId)
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
rewards(
|
|
568
|
+
filter: {
|
|
569
|
+
programId_eq: $programId
|
|
570
|
+
programRewardKey_eq: $rewardKey
|
|
571
|
+
}
|
|
572
|
+
) {
|
|
573
|
+
count
|
|
574
|
+
totalCount
|
|
575
|
+
data {
|
|
576
|
+
fuelTankCode
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
581
|
`,
|
|
582
582
|
variables,
|
|
583
583
|
})
|
|
@@ -596,20 +596,20 @@ const API = {
|
|
|
596
596
|
};
|
|
597
597
|
return this.getClient()
|
|
598
598
|
.query({
|
|
599
|
-
query: gql `
|
|
600
|
-
query($userId: String!, $accountId: String!, $programId: ID, $engagementMedium: UserEngagementMedium!) {
|
|
601
|
-
user(id: $userId, accountId: $accountId) {
|
|
602
|
-
${mediums[0]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[0]})
|
|
603
|
-
${mediums[1]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[1]})
|
|
604
|
-
${mediums[2]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[2]})
|
|
605
|
-
${mediums[3]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[3]})
|
|
606
|
-
${mediums[4]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[4]})
|
|
607
|
-
${mediums[5]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[5]})
|
|
608
|
-
${mediums[6]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[6]})
|
|
609
|
-
${mediums[7]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[7]})
|
|
610
|
-
${mediums[8]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[8]})
|
|
611
|
-
}
|
|
612
|
-
}
|
|
599
|
+
query: gql `
|
|
600
|
+
query($userId: String!, $accountId: String!, $programId: ID, $engagementMedium: UserEngagementMedium!) {
|
|
601
|
+
user(id: $userId, accountId: $accountId) {
|
|
602
|
+
${mediums[0]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[0]})
|
|
603
|
+
${mediums[1]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[1]})
|
|
604
|
+
${mediums[2]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[2]})
|
|
605
|
+
${mediums[3]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[3]})
|
|
606
|
+
${mediums[4]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[4]})
|
|
607
|
+
${mediums[5]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[5]})
|
|
608
|
+
${mediums[6]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[6]})
|
|
609
|
+
${mediums[7]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[7]})
|
|
610
|
+
${mediums[8]}:messageLink(programId: $programId, engagementMedium: $engagementMedium, shareMedium: ${mediums[8]})
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
613
|
`,
|
|
614
614
|
variables,
|
|
615
615
|
})
|