@shoplix-ai/block-kit 4.5.0 → 5.0.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.
Files changed (61) hide show
  1. package/README.md +37 -8
  2. package/dist/account-links.d.ts +47 -0
  3. package/dist/account-links.d.ts.map +1 -0
  4. package/dist/account-links.js +61 -0
  5. package/dist/account-links.js.map +1 -0
  6. package/dist/address-list.d.ts +57 -0
  7. package/dist/address-list.d.ts.map +1 -0
  8. package/dist/address-list.js +57 -0
  9. package/dist/address-list.js.map +1 -0
  10. package/dist/buy-box.d.ts +59 -0
  11. package/dist/buy-box.d.ts.map +1 -0
  12. package/dist/buy-box.js +72 -0
  13. package/dist/buy-box.js.map +1 -0
  14. package/dist/capabilities.d.ts +8 -1
  15. package/dist/capabilities.d.ts.map +1 -1
  16. package/dist/capabilities.js.map +1 -1
  17. package/dist/contract.d.ts +20 -14
  18. package/dist/contract.d.ts.map +1 -1
  19. package/dist/contract.js +3 -2
  20. package/dist/contract.js.map +1 -1
  21. package/dist/hero-banner.d.ts +10 -1
  22. package/dist/hero-banner.d.ts.map +1 -1
  23. package/dist/hero-banner.js +17 -0
  24. package/dist/hero-banner.js.map +1 -1
  25. package/dist/index.d.ts +18 -4
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +10 -3
  28. package/dist/index.js.map +1 -1
  29. package/dist/navigation.d.ts +8 -2
  30. package/dist/navigation.d.ts.map +1 -1
  31. package/dist/orders.d.ts +84 -0
  32. package/dist/orders.d.ts.map +1 -0
  33. package/dist/orders.js +188 -0
  34. package/dist/orders.js.map +1 -0
  35. package/dist/profile-header.d.ts +23 -0
  36. package/dist/profile-header.d.ts.map +1 -0
  37. package/dist/profile-header.js +29 -0
  38. package/dist/profile-header.js.map +1 -0
  39. package/dist/promo-banner.d.ts +11 -1
  40. package/dist/promo-banner.d.ts.map +1 -1
  41. package/dist/promo-banner.js +24 -0
  42. package/dist/promo-banner.js.map +1 -1
  43. package/dist/section-header.d.ts +5 -1
  44. package/dist/section-header.d.ts.map +1 -1
  45. package/dist/section-header.js +5 -1
  46. package/dist/section-header.js.map +1 -1
  47. package/dist/sign-in.d.ts +25 -0
  48. package/dist/sign-in.d.ts.map +1 -0
  49. package/dist/sign-in.js +24 -0
  50. package/dist/sign-in.js.map +1 -0
  51. package/dist/variant-choice.d.ts +14 -0
  52. package/dist/variant-choice.d.ts.map +1 -0
  53. package/dist/variant-choice.js +24 -0
  54. package/dist/variant-choice.js.map +1 -0
  55. package/dist/version.d.ts +2 -2
  56. package/dist/version.js +2 -2
  57. package/dist/words.d.ts +123 -0
  58. package/dist/words.d.ts.map +1 -1
  59. package/dist/words.js +360 -4
  60. package/dist/words.js.map +1 -1
  61. package/package.json +2 -2
@@ -1,5 +1,6 @@
1
1
  import { componentTokenValue } from '@shoplix-ai/sdui-schema';
2
2
  import { partColors } from './part-colors.js';
3
+ import { countedWord, platformWords } from './words.js';
3
4
  /** The parts of a promo card, each with the theme role it draws unless a component token names another. */
4
5
  const PROMO_BANNER_ROLES = {
5
6
  artwork: 'sunken',
@@ -23,4 +24,27 @@ export function promoBannerColors(theme) {
23
24
  export function promoBannerRadius(theme) {
24
25
  return componentTokenValue(theme, 'promo_banner.radius', theme.radius);
25
26
  }
27
+ /** How many promotions a banner stacks, in the form the buyer's language counts them in. */
28
+ export function promoSetLabel(cards, language, defaultLanguage) {
29
+ return countedWord('promo.cards', cards, language, defaultLanguage);
30
+ }
31
+ /**
32
+ * The name a screen reader reads for one promo card. A card in a set of more
33
+ * than one says which of how many it is, beside the merchant's own words where
34
+ * they wrote any and in place of them where they wrote none; a card standing
35
+ * alone is its words, or the platform's word for a promotion. The merchant's
36
+ * words go in last, so text of theirs that looks like a slot stays as written.
37
+ */
38
+ export function promoCardLabel(merchantLabel, cardIndex, cards, language, defaultLanguage) {
39
+ const words = platformWords(language, defaultLanguage);
40
+ if (cards <= 1)
41
+ return merchantLabel === '' ? words.own('promo.promotion') : merchantLabel;
42
+ const slots = {
43
+ position: String(cardIndex + 1),
44
+ count: String(cards),
45
+ label: merchantLabel,
46
+ };
47
+ const pattern = words.own(merchantLabel === '' ? 'promo.card_of' : 'promo.card_named');
48
+ return pattern.replace(/\{(position|count|label)\}/g, (_slot, name) => slots[name]);
49
+ }
26
50
  //# sourceMappingURL=promo-banner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"promo-banner.js","sourceRoot":"","sources":["../src/promo-banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAmB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,2GAA2G;AAC3G,MAAM,kBAAkB,GAAG;IACzB,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,QAAQ;CAC2C,CAAC;AAMhE;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAiB;IACjD,OAAO,UAAU,CAAC,KAAK,EAAE,cAAc,EAAE,kBAAkB,CAAC,CAAC;AAC/D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAiB;IACjD,OAAO,mBAAmB,CAAC,KAAK,EAAE,qBAAqB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;AACzE,CAAC"}
1
+ {"version":3,"file":"promo-banner.js","sourceRoot":"","sources":["../src/promo-banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAoC,MAAM,yBAAyB,CAAC;AAChG,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAExD,2GAA2G;AAC3G,MAAM,kBAAkB,GAAG;IACzB,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,QAAQ;CAC2C,C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1
1
  import type { ThemeStyle } from '@shoplix-ai/sdui-schema';
2
- /** The parts of the section header, each with the theme role it draws unless a component token names another. */
2
+ /**
3
+ * The parts of the section header, each with the theme role it draws unless a
4
+ * component token names another. The collection heading draws the title part
5
+ * alone.
6
+ */
3
7
  declare const SECTION_HEADER_ROLES: {
4
8
  readonly title: "text";
5
9
  readonly link: "action";
@@ -1 +1 @@
1
- {"version":3,"file":"section-header.d.ts","sourceRoot":"","sources":["../src/section-header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAG1D,iHAAiH;AACjH,QAAA,MAAM,oBAAoB;;;CAGqC,CAAC;AAEhE,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,oBAAoB,CAAC;AAElE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,CAAC;AAE9E;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAE1E"}
1
+ {"version":3,"file":"section-header.d.ts","sourceRoot":"","sources":["../src/section-header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAG1D;;;;GAIG;AACH,QAAA,MAAM,oBAAoB;;;CAGqC,CAAC;AAEhE,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,oBAAoB,CAAC;AAElE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,CAAC;AAE9E;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAE1E"}
@@ -1,5 +1,9 @@
1
1
  import { partColors } from './part-colors.js';
2
- /** The parts of the section header, each with the theme role it draws unless a component token names another. */
2
+ /**
3
+ * The parts of the section header, each with the theme role it draws unless a
4
+ * component token names another. The collection heading draws the title part
5
+ * alone.
6
+ */
3
7
  const SECTION_HEADER_ROLES = {
4
8
  title: 'text',
5
9
  link: 'action',
@@ -1 +1 @@
1
- {"version":3,"file":"section-header.js","sourceRoot":"","sources":["../src/section-header.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,iHAAiH;AACjH,MAAM,oBAAoB,GAAG;IAC3B,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,QAAQ;CAC+C,CAAC;AAMhE;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAiB;IACnD,OAAO,UAAU,CAAC,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,CAAC,CAAC;AACnE,CAAC"}
1
+ {"version":3,"file":"section-header.js","sourceRoot":"","sources":["../src/section-header.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;GAIG;AACH,MAAM,oBAAoB,GAAG;IAC3B,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,QAAQ;CAC+C,CAAC;AAMhE;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAiB;IACnD,OAAO,UAAU,CAAC,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,CAAC,CAAC;AACnE,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { ThemeStyle } from '@shoplix-ai/sdui-schema';
2
+ /** The parts of the sign-in block, each with the theme role it draws unless a component token names another. */
3
+ declare const SIGN_IN_ROLES: {
4
+ readonly title: "text";
5
+ readonly subtitle: "muted";
6
+ readonly label: "text";
7
+ readonly field: "surface";
8
+ readonly field_border: "border";
9
+ readonly input: "text";
10
+ readonly placeholder: "subtle";
11
+ readonly error: "warning";
12
+ readonly button: "action";
13
+ readonly note: "muted";
14
+ readonly terms: "text";
15
+ };
16
+ export type SignInPart = keyof typeof SIGN_IN_ROLES;
17
+ export type SignInColors = Readonly<Record<SignInPart, string>>;
18
+ /**
19
+ * Every colour the sign-in block draws, one per part, with `sign_in.<part>` as
20
+ * the escape hatch over each theme role. The words on a solid button are
21
+ * whichever of ink and paper stands out on it.
22
+ */
23
+ export declare function signInColors(theme: ThemeStyle): SignInColors;
24
+ export {};
25
+ //# sourceMappingURL=sign-in.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign-in.d.ts","sourceRoot":"","sources":["../src/sign-in.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAG1D,gHAAgH;AAChH,QAAA,MAAM,aAAa;;;;;;;;;;;;CAY4C,CAAC;AAEhE,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,aAAa,CAAC;AAEpD,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;AAEhE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,YAAY,CAE5D"}
@@ -0,0 +1,24 @@
1
+ import { partColors } from './part-colors.js';
2
+ /** The parts of the sign-in block, each with the theme role it draws unless a component token names another. */
3
+ const SIGN_IN_ROLES = {
4
+ title: 'text',
5
+ subtitle: 'muted',
6
+ label: 'text',
7
+ field: 'surface',
8
+ field_border: 'border',
9
+ input: 'text',
10
+ placeholder: 'subtle',
11
+ error: 'warning',
12
+ button: 'action',
13
+ note: 'muted',
14
+ terms: 'text',
15
+ };
16
+ /**
17
+ * Every colour the sign-in block draws, one per part, with `sign_in.<part>` as
18
+ * the escape hatch over each theme role. The words on a solid button are
19
+ * whichever of ink and paper stands out on it.
20
+ */
21
+ export function signInColors(theme) {
22
+ return partColors(theme, 'sign_in', SIGN_IN_ROLES);
23
+ }
24
+ //# sourceMappingURL=sign-in.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign-in.js","sourceRoot":"","sources":["../src/sign-in.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,gHAAgH;AAChH,MAAM,aAAa,GAAG;IACpB,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,OAAO;IACjB,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,SAAS;IAChB,YAAY,EAAE,QAAQ;IACtB,KAAK,EAAE,MAAM;IACb,WAAW,EAAE,QAAQ;IACrB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,MAAM;CACgD,CAAC;AAMhE;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,KAAiB;IAC5C,OAAO,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;AACrD,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { ProductDisplay, ProductVariantDisplay } from '@shoplix-ai/sdui-schema';
2
+ /**
3
+ * How the buy box turns a subject's options into one purchasable variant.
4
+ * The picker holds only chosen values; everything else derives from the
5
+ * product's own variant list, so the two welded blocks always agree.
6
+ */
7
+ export type OptionSelections = Readonly<Record<string, string>>;
8
+ export declare function defaultSelections(product: ProductDisplay): OptionSelections;
9
+ export declare function effectiveSelections(product: ProductDisplay, chosen: OptionSelections): OptionSelections;
10
+ /** The variant the current choices name, or null when none does. */
11
+ export declare function selectedVariant(product: ProductDisplay, selections: OptionSelections): ProductVariantDisplay | null;
12
+ /** Whether choosing this value, keeping the other choices, can still be bought. */
13
+ export declare function valueAvailable(product: ProductDisplay, selections: OptionSelections, optionName: string, value: string): boolean;
14
+ //# sourceMappingURL=variant-choice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variant-choice.d.ts","sourceRoot":"","sources":["../src/variant-choice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErF;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEhE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,GAAG,gBAAgB,CAS3E;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,gBAAgB,GACvB,gBAAgB,CAElB;AAMD,oEAAoE;AACpE,wBAAgB,eAAe,CAC7B,OAAO,EAAE,cAAc,EACvB,UAAU,EAAE,gBAAgB,GAC3B,qBAAqB,GAAG,IAAI,CAE9B;AAED,mFAAmF;AACnF,wBAAgB,cAAc,CAC5B,OAAO,EAAE,cAAc,EACvB,UAAU,EAAE,gBAAgB,EAC5B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,GACZ,OAAO,CAGT"}
@@ -0,0 +1,24 @@
1
+ export function defaultSelections(product) {
2
+ const variants = product.variants ?? [];
3
+ const first = variants.find((variant) => variant.available) ?? variants[0];
4
+ if (first !== undefined) {
5
+ return Object.fromEntries(first.selectedOptions.map((pair) => [pair.name, pair.value]));
6
+ }
7
+ return Object.fromEntries((product.options ?? []).map((option) => [option.name, option.values[0]]));
8
+ }
9
+ export function effectiveSelections(product, chosen) {
10
+ return { ...defaultSelections(product), ...chosen };
11
+ }
12
+ function matches(variant, selections) {
13
+ return variant.selectedOptions.every((pair) => selections[pair.name] === pair.value);
14
+ }
15
+ /** The variant the current choices name, or null when none does. */
16
+ export function selectedVariant(product, selections) {
17
+ return (product.variants ?? []).find((variant) => matches(variant, selections)) ?? null;
18
+ }
19
+ /** Whether choosing this value, keeping the other choices, can still be bought. */
20
+ export function valueAvailable(product, selections, optionName, value) {
21
+ const asked = { ...selections, [optionName]: value };
22
+ return (product.variants ?? []).some((variant) => variant.available && matches(variant, asked));
23
+ }
24
+ //# sourceMappingURL=variant-choice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variant-choice.js","sourceRoot":"","sources":["../src/variant-choice.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,iBAAiB,CAAC,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,IAAI,IAAI,CAAC;AAC1F,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,cAAc,CAC5B,OAAuB,EACvB,UAA4B,EAC5B,UAAkB,EAClB,KAAa;IAEb,MAAM,KAAK,GAAG,EAAE,GAAG,UAAU,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC;IACrD,OAAO,CAAC,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AAClG,CAAC"}
package/dist/version.d.ts CHANGED
@@ -4,6 +4,6 @@
4
4
  * The major is the compatibility line: a Shop package built against another
5
5
  * major never meets this runtime, and a major bump is an announced event.
6
6
  */
7
- export declare const CONTRACT_VERSION = "4.5.0";
8
- export declare const CONTRACT_MAJOR = 4;
7
+ export declare const CONTRACT_VERSION = "5.0.0";
8
+ export declare const CONTRACT_MAJOR = 5;
9
9
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -4,6 +4,6 @@
4
4
  * The major is the compatibility line: a Shop package built against another
5
5
  * major never meets this runtime, and a major bump is an announced event.
6
6
  */
7
- export const CONTRACT_VERSION = '4.5.0';
8
- export const CONTRACT_MAJOR = 4;
7
+ export const CONTRACT_VERSION = '5.0.0';
8
+ export const CONTRACT_MAJOR = 5;
9
9
  //# sourceMappingURL=version.js.map
package/dist/words.d.ts CHANGED
@@ -53,6 +53,9 @@ declare const ENGLISH_WORDS: {
53
53
  readonly 'product.added_compact': "Added ✓";
54
54
  readonly 'product.notify_me': "Notify me";
55
55
  readonly 'product.notify_me_done': "We will tell you ✓";
56
+ readonly 'product.quantity': "Quantity";
57
+ readonly 'product.total_price': "Total price";
58
+ readonly 'product.buy_now': "Buy now";
56
59
  readonly 'product.sold_out': "Sold out";
57
60
  readonly 'product.in_stock': "In stock";
58
61
  readonly 'product.out_of_stock': "Out of stock";
@@ -71,6 +74,16 @@ declare const ENGLISH_WORDS: {
71
74
  readonly 'header.categories': "Categories";
72
75
  readonly 'header.language_country': "Language & country";
73
76
  readonly 'promo.promotion': "Promotion";
77
+ readonly 'promo.card_of': "Promotion {position} of {count}";
78
+ readonly 'promo.card_named': "{label}, {position} of {count}";
79
+ readonly 'promo.cards_zero': "No promotions";
80
+ readonly 'promo.cards_one': "1 promotion";
81
+ readonly 'promo.cards_two': "{count} promotions";
82
+ readonly 'promo.cards_few': "{count} promotions";
83
+ readonly 'promo.cards_many': "{count} promotions";
84
+ readonly 'promo.cards_other': "{count} promotions";
85
+ readonly 'hero.page_of': "Page {page} of {pages}";
86
+ readonly 'rail.scroll_hint': "Scroll sideways for more";
74
87
  readonly 'shipping.remaining': "Add {amount} more and your shipping is free";
75
88
  readonly 'shipping.reached': "Your shipping is free";
76
89
  readonly 'shipping.fee': "Shipping is {amount} until you do";
@@ -78,6 +91,7 @@ declare const ENGLISH_WORDS: {
78
91
  readonly 'search.placeholder': "Search";
79
92
  readonly 'search.prompt': "Search the shop for a product";
80
93
  readonly 'search.no_results': "Nothing matched your search";
94
+ readonly 'search.searching': "Searching";
81
95
  readonly 'countdown.days': "Days";
82
96
  readonly 'countdown.hours': "Hours";
83
97
  readonly 'countdown.minutes': "Minutes";
@@ -104,12 +118,119 @@ declare const ENGLISH_WORDS: {
104
118
  readonly 'account.notifications': "Notifications";
105
119
  readonly 'account.privacy': "Privacy";
106
120
  readonly 'account.share_diagnostics': "Share app diagnostics";
121
+ readonly 'account.sign_in': "Sign in";
122
+ readonly 'account.sign_out': "Sign out";
123
+ readonly 'account.email': "Email";
124
+ readonly 'account.continue': "Continue";
125
+ readonly 'account.code_note': "Shopify will email you a code on the next step.";
126
+ readonly 'account.greeting': "Hello, {name}";
127
+ readonly 'account.session_ended': "Your session ended. Sign in again when you need your account.";
128
+ readonly 'account.sign_in_failed': "Could not sign in. Please try again.";
129
+ readonly 'account.settings': "Settings";
130
+ readonly 'account.settings_close': "Close";
131
+ readonly 'account.privacy_policy': "Privacy policy";
132
+ readonly 'account.email_invalid': "Enter a valid email address.";
133
+ readonly 'account.edit_profile': "Edit profile";
134
+ readonly 'account.orders': "Orders";
135
+ readonly 'account.addresses': "Addresses";
136
+ readonly 'account.profile': "Profile";
137
+ readonly 'account.delete_account': "Delete account";
138
+ readonly 'account.complete_profile': "Tell us about you";
139
+ readonly 'account.profile_save': "Save";
140
+ readonly 'account.profile_answer_needed': "This answer is needed.";
141
+ readonly 'account.profile_failed': "Could not save your profile. Please try again.";
142
+ readonly 'account.profile_marketing': "Email me offers and news";
143
+ readonly 'account.manage_contact': "Manage email and phone";
144
+ readonly 'account.profile_choose': "Choose";
145
+ readonly 'account.deletion_title': "Delete your account";
146
+ readonly 'account.deletion_erased': "Your profile, your name and your saved addresses are erased.";
147
+ readonly 'account.deletion_orders_kept': "Your orders stay with the store, because the law requires it to keep them.";
148
+ readonly 'account.deletion_delay': "Shopify erases your data 10 days after this request.";
149
+ readonly 'account.deletion_confirm': "Delete my account";
150
+ readonly 'account.deletion_keep': "Keep my account";
151
+ readonly 'account.deletion_failed': "Could not delete your account. Please try again.";
152
+ readonly 'order.empty': "No orders yet";
153
+ readonly 'order.open': "Open order";
154
+ readonly 'order.items': "Items";
155
+ readonly 'order.tax': "Tax";
156
+ readonly 'order.shipping_address': "Shipping address";
157
+ readonly 'order.delivery_status': "Delivery status";
158
+ readonly 'order.shipment': "Shipment";
159
+ readonly 'order.shipment_failed': "Shipment failed";
160
+ readonly 'order.tracking': "Tracking number";
161
+ readonly 'order.track': "Track with the carrier";
162
+ readonly 'order.expected': "Expected {date}";
163
+ readonly 'order.buy_again': "Buy again";
164
+ readonly 'order.nothing_to_buy': "These items are no longer available";
165
+ readonly 'order.more': "More about this order";
166
+ readonly 'order.cancelled': "Cancelled";
167
+ readonly 'order.delivered': "Delivered";
168
+ readonly 'order.fulfillment.unfulfilled': "Processing";
169
+ readonly 'order.fulfillment.partially_fulfilled': "Partly shipped";
170
+ readonly 'order.fulfillment.fulfilled': "Shipped";
171
+ readonly 'order.fulfillment.in_progress': "In progress";
172
+ readonly 'order.fulfillment.on_hold': "On hold";
173
+ readonly 'order.fulfillment.open': "Open";
174
+ readonly 'order.fulfillment.pending_fulfillment': "Pending";
175
+ readonly 'order.fulfillment.restocked': "Restocked";
176
+ readonly 'order.fulfillment.scheduled': "Scheduled";
177
+ readonly 'order.payment.authorized': "Authorized";
178
+ readonly 'order.payment.expired': "Expired";
179
+ readonly 'order.payment.paid': "Paid";
180
+ readonly 'order.payment.partially_paid': "Partly paid";
181
+ readonly 'order.payment.partially_refunded': "Partly refunded";
182
+ readonly 'order.payment.pending': "Payment pending";
183
+ readonly 'order.payment.refunded': "Refunded";
184
+ readonly 'order.payment.voided': "Voided";
185
+ readonly 'order.event.attempted_delivery': "Delivery attempted";
186
+ readonly 'order.event.carrier_picked_up': "Picked up by the carrier";
187
+ readonly 'order.event.confirmed': "Confirmed";
188
+ readonly 'order.event.delayed': "Delayed";
189
+ readonly 'order.event.failure': "Delivery failed";
190
+ readonly 'order.event.in_transit': "In transit";
191
+ readonly 'order.event.label_printed': "Label printed";
192
+ readonly 'order.event.label_purchased': "Label purchased";
193
+ readonly 'order.event.out_for_delivery': "Out for delivery";
194
+ readonly 'order.event.picked_up': "Picked up";
195
+ readonly 'order.event.ready_for_pickup': "Ready for pickup";
196
+ readonly 'address.default': "Default";
197
+ readonly 'address.edit': "Edit";
198
+ readonly 'address.delete': "Delete";
199
+ readonly 'address.set_default': "Set as default";
200
+ readonly 'address.default_before_delete': "Make another address the default before you delete this one.";
201
+ readonly 'address.delete_confirm': "Delete this address?";
202
+ readonly 'address.keep': "Keep";
203
+ readonly 'address.empty': "No saved addresses yet";
204
+ readonly 'address.change_failed': "Could not update your addresses";
205
+ readonly 'address.add_title': "Add an address";
206
+ readonly 'address.edit_title': "Edit address";
207
+ readonly 'address.save': "Save address";
208
+ readonly 'address.save_failed': "Could not save the address";
209
+ readonly 'address.load_failed': "Could not load this address";
210
+ readonly 'address.choose': "Choose";
211
+ readonly 'address.country': "Country/region";
212
+ readonly 'address.first_name': "First name";
213
+ readonly 'address.last_name': "Last name";
214
+ readonly 'address.company': "Company (optional)";
215
+ readonly 'address.address1': "Address";
216
+ readonly 'address.address2': "Apartment, suite, etc (optional)";
217
+ readonly 'address.city': "City";
218
+ readonly 'address.zone': "Region";
219
+ readonly 'address.zip': "Postal code";
220
+ readonly 'address.phone': "Phone (optional)";
107
221
  };
108
222
  export type WordKey = keyof typeof ENGLISH_WORDS;
109
223
  /** Every functional word key, for a caller that walks the catalog. */
110
224
  export declare const WORD_KEYS: readonly WordKey[];
111
225
  /** The languages the catalog answers in its own right. */
112
226
  export declare const CATALOG_LANGUAGES: readonly LocaleCode[];
227
+ /**
228
+ * The three facts the Deletion Sheet draws under the merchant's own words, in
229
+ * the order it draws them: what is erased, what the store keeps and when
230
+ * Shopify acts. The merchant edits the tone above them and never this list, so
231
+ * every reader of the sheet says the same three things.
232
+ */
233
+ export declare const DELETION_FACTS: readonly ["account.deletion_erased", "account.deletion_orders_kept", "account.deletion_delay"];
113
234
  export interface PlatformWords {
114
235
  /** The platform's own word for this key, in the buyer's language. */
115
236
  own(key: WordKey): string;
@@ -119,6 +240,8 @@ export interface PlatformWords {
119
240
  */
120
241
  merchantOr(text: LocalizedText | undefined, key: WordKey): string;
121
242
  }
243
+ /** A number written in the form the buyer's language counts it in, over the six forms a counted word carries. */
244
+ export declare function countedWord(stem: 'cart.items' | 'promo.cards', count: number, language: LocaleCode, defaultLanguage: LocaleCode): string;
122
245
  /**
123
246
  * How many items a cart holds, written in the form the buyer's language counts
124
247
  * that number in. English and Turkish read no item count for an empty cart as
@@ -1 +1 @@
1
- {"version":3,"file":"words.d.ts","sourceRoot":"","sources":["../src/words.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGzE;;;;;;;;;;;GAWG;AACH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