@shoppexio/storefront-react 0.6.3 → 0.6.5

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/dist/index.d.ts CHANGED
@@ -840,6 +840,12 @@ interface SdkCustomerDashboard {
840
840
  licenses: SdkCustomerLicense[];
841
841
  deliverables: SdkCustomerDeliverable[];
842
842
  tickets: SdkCustomerTicketSummary[];
843
+ /**
844
+ * A merchant's portal link opened this session: the API refuses it every
845
+ * action that moves money (converting points among them), so the account
846
+ * shows those as unavailable.
847
+ */
848
+ opened_by_portal_link: boolean;
843
849
  }
844
850
  /** One order row in the paginated list. camelCase, unlike the dashboard. */
845
851
  interface SdkCustomerOrderSummary {
@@ -1815,9 +1821,10 @@ declare function formatSubscriptionCadence(subscription: ProductSubscription): s
1815
1821
  /**
1816
1822
  * The line under a subscription's buy buttons: "Renews every month until you cancel." and, when the
1817
1823
  * producer says the buyer can switch plans, "Switch plans any time in your account." Empty for a plan
1818
- * without an interval. Same wording as the Easy-lane buy boxes.
1824
+ * without an interval. In the page's locale (`lang` defaults to `<html lang>`), with the Easy-lane buy
1825
+ * boxes' words in every one.
1819
1826
  */
1820
- declare function formatSubscriptionRenewal(subscription: ProductSubscription): string;
1827
+ declare function formatSubscriptionRenewal(subscription: ProductSubscription, lang?: string | null): string;
1821
1828
  /**
1822
1829
  * "7-day free trial" for a free trial, "$4.99 for 7 days" for a paid intro
1823
1830
  * (`formatAmount` prints its price); empty when the plan has no trial.
package/dist/index.js CHANGED
@@ -445,6 +445,210 @@ function buildStatusPageModel(products) {
445
445
  return { entries, counts, presentStates, lastUpdatedAt };
446
446
  }
447
447
 
448
+ // src/subscription-renewal-messages.ts
449
+ var SUBSCRIPTION_RENEWAL_MESSAGES = {
450
+ ar: {
451
+ renewsUntilCancel: "\u064A\u062A\u062C\u062F\u062F {interval} \u062D\u062A\u0649 \u062A\u0644\u063A\u064A\u0647.",
452
+ switchPlansInAccount: "\u064A\u0645\u0643\u0646\u0643 \u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u062E\u0637\u0629 \u0641\u064A \u0623\u064A \u0648\u0642\u062A \u0645\u0646 \u062D\u0633\u0627\u0628\u0643.",
453
+ renewEveryDay: "\u0643\u0644 \u064A\u0648\u0645",
454
+ renewEveryDays: "\u0643\u0644 {count} \u064A\u0648\u0645",
455
+ renewEveryWeek: "\u0643\u0644 \u0623\u0633\u0628\u0648\u0639",
456
+ renewEveryWeeks: "\u0643\u0644 {count} \u0623\u0633\u0628\u0648\u0639",
457
+ renewEveryMonth: "\u0643\u0644 \u0634\u0647\u0631",
458
+ renewEveryMonths: "\u0643\u0644 {count} \u0634\u0647\u0631",
459
+ renewEveryYear: "\u0643\u0644 \u0633\u0646\u0629",
460
+ renewEveryYears: "\u0643\u0644 {count} \u0633\u0646\u0629"
461
+ },
462
+ de: {
463
+ renewsUntilCancel: "Verl\xE4ngert sich {interval}, bis du k\xFCndigst.",
464
+ switchPlansInAccount: "Du kannst den Plan jederzeit in deinem Konto wechseln.",
465
+ renewEveryDay: "t\xE4glich",
466
+ renewEveryDays: "alle {count} Tage",
467
+ renewEveryWeek: "w\xF6chentlich",
468
+ renewEveryWeeks: "alle {count} Wochen",
469
+ renewEveryMonth: "monatlich",
470
+ renewEveryMonths: "alle {count} Monate",
471
+ renewEveryYear: "j\xE4hrlich",
472
+ renewEveryYears: "alle {count} Jahre"
473
+ },
474
+ en: {
475
+ renewsUntilCancel: "Renews {interval} until you cancel.",
476
+ switchPlansInAccount: "Switch plans any time in your account.",
477
+ renewEveryDay: "every day",
478
+ renewEveryDays: "every {count} days",
479
+ renewEveryWeek: "every week",
480
+ renewEveryWeeks: "every {count} weeks",
481
+ renewEveryMonth: "every month",
482
+ renewEveryMonths: "every {count} months",
483
+ renewEveryYear: "every year",
484
+ renewEveryYears: "every {count} years"
485
+ },
486
+ es: {
487
+ renewsUntilCancel: "Se renueva {interval} hasta que lo canceles.",
488
+ switchPlansInAccount: "Cambia de plan cuando quieras desde tu cuenta.",
489
+ renewEveryDay: "cada d\xEDa",
490
+ renewEveryDays: "cada {count} d\xEDas",
491
+ renewEveryWeek: "cada semana",
492
+ renewEveryWeeks: "cada {count} semanas",
493
+ renewEveryMonth: "cada mes",
494
+ renewEveryMonths: "cada {count} meses",
495
+ renewEveryYear: "cada a\xF1o",
496
+ renewEveryYears: "cada {count} a\xF1os"
497
+ },
498
+ fi: {
499
+ renewsUntilCancel: "Uusiutuu {interval}, kunnes peruutat.",
500
+ switchPlansInAccount: "Vaihda tilausta milloin tahansa tilill\xE4si.",
501
+ renewEveryDay: "p\xE4ivitt\xE4in",
502
+ renewEveryDays: "{count} p\xE4iv\xE4n v\xE4lein",
503
+ renewEveryWeek: "viikoittain",
504
+ renewEveryWeeks: "{count} viikon v\xE4lein",
505
+ renewEveryMonth: "kuukausittain",
506
+ renewEveryMonths: "{count} kuukauden v\xE4lein",
507
+ renewEveryYear: "vuosittain",
508
+ renewEveryYears: "{count} vuoden v\xE4lein"
509
+ },
510
+ fr: {
511
+ renewsUntilCancel: "Se renouvelle {interval} jusqu'\xE0 ce que vous r\xE9siliiez.",
512
+ switchPlansInAccount: "Changez de formule \xE0 tout moment depuis votre compte.",
513
+ renewEveryDay: "chaque jour",
514
+ renewEveryDays: "tous les {count} jours",
515
+ renewEveryWeek: "chaque semaine",
516
+ renewEveryWeeks: "toutes les {count} semaines",
517
+ renewEveryMonth: "chaque mois",
518
+ renewEveryMonths: "tous les {count} mois",
519
+ renewEveryYear: "chaque ann\xE9e",
520
+ renewEveryYears: "tous les {count} ans"
521
+ },
522
+ hi: {
523
+ renewsUntilCancel: "\u0930\u0926\u094D\u0926 \u0915\u0930\u0928\u0947 \u0924\u0915 {interval} \u0928\u0935\u0940\u0928\u0940\u0915\u0943\u0924 \u0939\u094B\u0924\u093E \u0939\u0948\u0964",
524
+ switchPlansInAccount: "\u0905\u092A\u0928\u0947 \u0916\u093E\u0924\u0947 \u092E\u0947\u0902 \u0915\u092D\u0940 \u092D\u0940 \u092A\u094D\u0932\u093E\u0928 \u092C\u0926\u0932\u0947\u0902\u0964",
525
+ renewEveryDay: "\u0939\u0930 \u0926\u093F\u0928",
526
+ renewEveryDays: "\u0939\u0930 {count} \u0926\u093F\u0928",
527
+ renewEveryWeek: "\u0939\u0930 \u0939\u092B\u093C\u094D\u0924\u0947",
528
+ renewEveryWeeks: "\u0939\u0930 {count} \u0939\u092B\u093C\u094D\u0924\u0947",
529
+ renewEveryMonth: "\u0939\u0930 \u092E\u0939\u0940\u0928\u0947",
530
+ renewEveryMonths: "\u0939\u0930 {count} \u092E\u0939\u0940\u0928\u0947",
531
+ renewEveryYear: "\u0939\u0930 \u0938\u093E\u0932",
532
+ renewEveryYears: "\u0939\u0930 {count} \u0938\u093E\u0932"
533
+ },
534
+ it: {
535
+ renewsUntilCancel: "Si rinnova {interval} finch\xE9 non annulli.",
536
+ switchPlansInAccount: "Cambia piano quando vuoi dal tuo account.",
537
+ renewEveryDay: "ogni giorno",
538
+ renewEveryDays: "ogni {count} giorni",
539
+ renewEveryWeek: "ogni settimana",
540
+ renewEveryWeeks: "ogni {count} settimane",
541
+ renewEveryMonth: "ogni mese",
542
+ renewEveryMonths: "ogni {count} mesi",
543
+ renewEveryYear: "ogni anno",
544
+ renewEveryYears: "ogni {count} anni"
545
+ },
546
+ lt: {
547
+ renewsUntilCancel: "Atnaujinama {interval}, kol at\u0161auksite.",
548
+ switchPlansInAccount: "Plan\u0105 galite bet kada pakeisti savo paskyroje.",
549
+ renewEveryDay: "kasdien",
550
+ renewEveryDays: "kas {count} d.",
551
+ renewEveryWeek: "kas savait\u0119",
552
+ renewEveryWeeks: "kas {count} sav.",
553
+ renewEveryMonth: "kas m\u0117nes\u012F",
554
+ renewEveryMonths: "kas {count} m\u0117n.",
555
+ renewEveryYear: "kasmet",
556
+ renewEveryYears: "kas {count} m."
557
+ },
558
+ nl: {
559
+ renewsUntilCancel: "Wordt {interval} verlengd tot je opzegt.",
560
+ switchPlansInAccount: "Wissel op elk moment van abonnement in je account.",
561
+ renewEveryDay: "elke dag",
562
+ renewEveryDays: "elke {count} dagen",
563
+ renewEveryWeek: "elke week",
564
+ renewEveryWeeks: "elke {count} weken",
565
+ renewEveryMonth: "elke maand",
566
+ renewEveryMonths: "elke {count} maanden",
567
+ renewEveryYear: "elk jaar",
568
+ renewEveryYears: "elke {count} jaar"
569
+ },
570
+ pl: {
571
+ renewsUntilCancel: "Odnawia si\u0119 {interval}, dop\xF3ki nie anulujesz.",
572
+ switchPlansInAccount: "Zmie\u0144 plan w dowolnym momencie na swoim koncie.",
573
+ renewEveryDay: "codziennie",
574
+ renewEveryDays: "co {count} dni",
575
+ renewEveryWeek: "co tydzie\u0144",
576
+ renewEveryWeeks: "co {count} tyg.",
577
+ renewEveryMonth: "co miesi\u0105c",
578
+ renewEveryMonths: "co {count} mies.",
579
+ renewEveryYear: "co roku",
580
+ renewEveryYears: "co {count} l."
581
+ },
582
+ pt: {
583
+ renewsUntilCancel: "Renova {interval} at\xE9 voc\xEA cancelar.",
584
+ switchPlansInAccount: "Troque de plano quando quiser na sua conta.",
585
+ renewEveryDay: "todos os dias",
586
+ renewEveryDays: "a cada {count} dias",
587
+ renewEveryWeek: "toda semana",
588
+ renewEveryWeeks: "a cada {count} semanas",
589
+ renewEveryMonth: "todo m\xEAs",
590
+ renewEveryMonths: "a cada {count} meses",
591
+ renewEveryYear: "todo ano",
592
+ renewEveryYears: "a cada {count} anos"
593
+ },
594
+ ru: {
595
+ renewsUntilCancel: "\u041F\u0440\u043E\u0434\u043B\u0435\u0432\u0430\u0435\u0442\u0441\u044F {interval}, \u043F\u043E\u043A\u0430 \u0432\u044B \u043D\u0435 \u043E\u0442\u043C\u0435\u043D\u0438\u0442\u0435.",
596
+ switchPlansInAccount: "\u0421\u043C\u0435\u043D\u0438\u0442\u044C \u0442\u0430\u0440\u0438\u0444 \u043C\u043E\u0436\u043D\u043E \u0432 \u043B\u044E\u0431\u043E\u0439 \u043C\u043E\u043C\u0435\u043D\u0442 \u0432 \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u0435.",
597
+ renewEveryDay: "\u043A\u0430\u0436\u0434\u044B\u0439 \u0434\u0435\u043D\u044C",
598
+ renewEveryDays: "\u0440\u0430\u0437 \u0432 {count} \u0434\u043D.",
599
+ renewEveryWeek: "\u043A\u0430\u0436\u0434\u0443\u044E \u043D\u0435\u0434\u0435\u043B\u044E",
600
+ renewEveryWeeks: "\u0440\u0430\u0437 \u0432 {count} \u043D\u0435\u0434.",
601
+ renewEveryMonth: "\u043A\u0430\u0436\u0434\u044B\u0439 \u043C\u0435\u0441\u044F\u0446",
602
+ renewEveryMonths: "\u0440\u0430\u0437 \u0432 {count} \u043C\u0435\u0441.",
603
+ renewEveryYear: "\u043A\u0430\u0436\u0434\u044B\u0439 \u0433\u043E\u0434",
604
+ renewEveryYears: "\u0440\u0430\u0437 \u0432 {count} \u0433."
605
+ },
606
+ tr: {
607
+ renewsUntilCancel: "\u0130ptal edene kadar {interval} yenilenir.",
608
+ switchPlansInAccount: "Plan\u0131n\u0131z\u0131 istedi\u011Finiz zaman hesab\u0131n\u0131zdan de\u011Fi\u015Ftirebilirsiniz.",
609
+ renewEveryDay: "her g\xFCn",
610
+ renewEveryDays: "her {count} g\xFCnde bir",
611
+ renewEveryWeek: "her hafta",
612
+ renewEveryWeeks: "her {count} haftada bir",
613
+ renewEveryMonth: "her ay",
614
+ renewEveryMonths: "her {count} ayda bir",
615
+ renewEveryYear: "her y\u0131l",
616
+ renewEveryYears: "her {count} y\u0131lda bir"
617
+ },
618
+ uk: {
619
+ renewsUntilCancel: "\u041F\u043E\u0434\u043E\u0432\u0436\u0443\u0454\u0442\u044C\u0441\u044F {interval}, \u0434\u043E\u043A\u0438 \u0432\u0438 \u043D\u0435 \u0441\u043A\u0430\u0441\u0443\u0454\u0442\u0435.",
620
+ switchPlansInAccount: "\u0417\u043C\u0456\u043D\u0438\u0442\u0438 \u043F\u043B\u0430\u043D \u043C\u043E\u0436\u043D\u0430 \u0431\u0443\u0434\u044C-\u043A\u043E\u043B\u0438 \u0432 \u043E\u0431\u043B\u0456\u043A\u043E\u0432\u043E\u043C\u0443 \u0437\u0430\u043F\u0438\u0441\u0456.",
621
+ renewEveryDay: "\u0449\u043E\u0434\u043D\u044F",
622
+ renewEveryDays: "\u0440\u0430\u0437 \u043D\u0430 {count} \u0434\u043D.",
623
+ renewEveryWeek: "\u0449\u043E\u0442\u0438\u0436\u043D\u044F",
624
+ renewEveryWeeks: "\u0440\u0430\u0437 \u043D\u0430 {count} \u0442\u0438\u0436.",
625
+ renewEveryMonth: "\u0449\u043E\u043C\u0456\u0441\u044F\u0446\u044F",
626
+ renewEveryMonths: "\u0440\u0430\u0437 \u043D\u0430 {count} \u043C\u0456\u0441.",
627
+ renewEveryYear: "\u0449\u043E\u0440\u043E\u043A\u0443",
628
+ renewEveryYears: "\u0440\u0430\u0437 \u043D\u0430 {count} \u0440."
629
+ },
630
+ zh: {
631
+ renewsUntilCancel: "{interval}\u81EA\u52A8\u7EED\u8BA2\uFF0C\u76F4\u5230\u4F60\u53D6\u6D88\u3002",
632
+ switchPlansInAccount: "\u53EF\u968F\u65F6\u5728\u4F60\u7684\u8D26\u6237\u4E2D\u5207\u6362\u65B9\u6848\u3002",
633
+ renewEveryDay: "\u6BCF\u5929",
634
+ renewEveryDays: "\u6BCF {count} \u5929",
635
+ renewEveryWeek: "\u6BCF\u5468",
636
+ renewEveryWeeks: "\u6BCF {count} \u5468",
637
+ renewEveryMonth: "\u6BCF\u6708",
638
+ renewEveryMonths: "\u6BCF {count} \u4E2A\u6708",
639
+ renewEveryYear: "\u6BCF\u5E74",
640
+ renewEveryYears: "\u6BCF {count} \u5E74"
641
+ }
642
+ };
643
+ function resolveSubscriptionRenewalLocale(lang) {
644
+ const base = (lang ?? "").trim().toLowerCase().split(/[-_]/)[0] ?? "";
645
+ return base in SUBSCRIPTION_RENEWAL_MESSAGES ? base : "en";
646
+ }
647
+ function subscriptionRenewalMessage(key, lang) {
648
+ const activeLang = lang === void 0 && typeof document !== "undefined" ? document.documentElement.getAttribute("lang") : lang;
649
+ return SUBSCRIPTION_RENEWAL_MESSAGES[resolveSubscriptionRenewalLocale(activeLang)][key];
650
+ }
651
+
448
652
  // src/video-embed.ts
449
653
  var ALLOWED_VIDEO_EMBED_HOSTS = /* @__PURE__ */ new Set([
450
654
  "www.youtube-nocookie.com",
@@ -575,13 +779,19 @@ function formatSubscriptionCadence(subscription) {
575
779
  const noun = SUBSCRIPTION_INTERVAL_NOUNS[unit];
576
780
  return subscription.intervalCount === 1 ? `per ${noun}` : `every ${subscription.intervalCount} ${noun}s`;
577
781
  }
578
- function formatSubscriptionRenewal(subscription) {
782
+ var RENEWAL_INTERVAL_KEYS = {
783
+ DAY: ["renewEveryDay", "renewEveryDays"],
784
+ WEEK: ["renewEveryWeek", "renewEveryWeeks"],
785
+ MONTH: ["renewEveryMonth", "renewEveryMonths"],
786
+ YEAR: ["renewEveryYear", "renewEveryYears"]
787
+ };
788
+ function formatSubscriptionRenewal(subscription, lang) {
579
789
  const unit = subscription.intervalUnit;
580
790
  if (unit === null) return "";
581
- const noun = SUBSCRIPTION_INTERVAL_NOUNS[unit];
582
- const every = subscription.intervalCount === 1 ? `every ${noun}` : `every ${subscription.intervalCount} ${noun}s`;
583
- const renews = `Renews ${every} until you cancel.`;
584
- return subscription.planChangeOffered ? `${renews} Switch plans any time in your account.` : renews;
791
+ const [one, many] = RENEWAL_INTERVAL_KEYS[unit];
792
+ const interval = subscription.intervalCount === 1 ? subscriptionRenewalMessage(one, lang) : subscriptionRenewalMessage(many, lang).replace("{count}", String(subscription.intervalCount));
793
+ const renews = subscriptionRenewalMessage("renewsUntilCancel", lang).replace("{interval}", interval);
794
+ return subscription.planChangeOffered ? `${renews} ${subscriptionRenewalMessage("switchPlansInAccount", lang)}` : renews;
585
795
  }
586
796
  function formatSubscriptionTrial(subscription, formatAmount) {
587
797
  const trial = subscription.trial;