@godaddy/gd-commerce-storefront 0.9.0 → 0.10.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.
- package/README.md +29 -4
- package/dist/index.d.ts +48 -9
- package/dist/index.js +543 -186
- package/dist/messages/fr-FR.d.ts +7 -0
- package/dist/messages/fr-FR.js +143 -0
- package/dist/messages-CHl-bWx9.d.ts +152 -0
- package/dist/styles.css +3 -0
- package/package.json +13 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { a as StorefrontMessages } from "../messages-CHl-bWx9.js";
|
|
2
|
+
|
|
3
|
+
//#region src/locales/fr-fr.d.ts
|
|
4
|
+
/** The package's text in French (France). Pass it to `CommerceProvider` as `messages`, with `locale='fr-FR'`. */
|
|
5
|
+
declare const frFR: StorefrontMessages;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { frFR };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
//#region src/locales/fr-fr.ts
|
|
2
|
+
const colon = "\xA0:";
|
|
3
|
+
/** The package's text in French (France). Pass it to `CommerceProvider` as `messages`, with `locale='fr-FR'`. */
|
|
4
|
+
const frFR = {
|
|
5
|
+
locale: "fr-FR",
|
|
6
|
+
errorCodes: {
|
|
7
|
+
invalid_request: "La requête n'est pas valide. Vérifiez votre sélection et réessayez.",
|
|
8
|
+
scope_mismatch: "La boutique connectée a changé. Rechargez la page avant de continuer.",
|
|
9
|
+
not_found: "Élément introuvable. Il a peut-être été supprimé.",
|
|
10
|
+
not_configured: "La configuration de la boutique n'est pas disponible. Terminez la connexion de la boutique avant de continuer.",
|
|
11
|
+
upstream_unauthorized: "La boutique a refusé la requête. Veuillez réessayer plus tard.",
|
|
12
|
+
upstream_error: "La boutique est momentanément indisponible. Veuillez réessayer.",
|
|
13
|
+
internal_error: "Un problème est survenu. Veuillez réessayer."
|
|
14
|
+
},
|
|
15
|
+
connectPrompt: "Connectez une boutique pour afficher les produits.",
|
|
16
|
+
connecting: "Connexion à la boutique…",
|
|
17
|
+
retryConnection: "Réessayer la connexion",
|
|
18
|
+
connectionSlow: "La connexion à la boutique prend trop de temps.",
|
|
19
|
+
invalidConfiguration: "La boutique a renvoyé une configuration non valide.",
|
|
20
|
+
requestFailed: "La requête a échoué. Veuillez réessayer.",
|
|
21
|
+
requestFailedStatus: "La requête a échoué ({status}). Veuillez réessayer.",
|
|
22
|
+
requestTimeout: "Le chargement des informations a pris trop de temps. Veuillez réessayer.",
|
|
23
|
+
unknownError: "Un problème est survenu. Veuillez réessayer.",
|
|
24
|
+
storageUnavailable: "Votre navigateur ne peut pas enregistrer le panier. Gardez cette page ouverte pendant vos achats.",
|
|
25
|
+
invalidAddItem: "Sélectionnez une variante du produit et une quantité positive.",
|
|
26
|
+
addReturnedNoCart: "Aucun panier contenant des articles n'a été renvoyé. Actualisez la page avant de réessayer.",
|
|
27
|
+
itemNotInCart: "Cet article n'est plus dans le panier.",
|
|
28
|
+
invalidQuantity: "La quantité doit être un nombre entier positif.",
|
|
29
|
+
updateReturnedNoCart: "Le panier mis à jour n'a pas été renvoyé. Actualisez la page avant de réessayer.",
|
|
30
|
+
discountMissing: "Ajoutez un article et saisissez un code promo.",
|
|
31
|
+
discountReturnedNoCart: "Le panier mis à jour n'a pas été renvoyé.",
|
|
32
|
+
checkoutDisabled: "Le paiement n'est pas activé pour cette boutique.",
|
|
33
|
+
checkoutEmpty: "Ajoutez un article avant de passer commande.",
|
|
34
|
+
checkoutNoUrl: "Aucune adresse de paiement n'a été renvoyée.",
|
|
35
|
+
checkoutInvalidUrl: "L'adresse de paiement renvoyée n'est pas valide.",
|
|
36
|
+
itemAdded: `Article ajouté à votre panier${colon} {name}.`,
|
|
37
|
+
sampleItemAdded: `Article ajouté à votre panier d'exemple${colon} {name}.`,
|
|
38
|
+
itemRemoved: "Article retiré du panier.",
|
|
39
|
+
quantityUpdated: "Quantité du panier mise à jour.",
|
|
40
|
+
discountsUpdated: "Codes promo mis à jour.",
|
|
41
|
+
sampleQuantityUpdated: "Quantité du panier d'exemple mise à jour.",
|
|
42
|
+
sampleItemRemoved: "Article d'exemple retiré du panier.",
|
|
43
|
+
cartButtonLabel: {
|
|
44
|
+
one: "Panier, {count} article",
|
|
45
|
+
other: "Panier, {count} articles"
|
|
46
|
+
},
|
|
47
|
+
addToCart: "Ajouter au panier",
|
|
48
|
+
addToCartWithPrice: "Ajouter au panier · {price}",
|
|
49
|
+
addToCartWithPriceName: "Ajouter au panier, {price}",
|
|
50
|
+
adding: "Ajout en cours…",
|
|
51
|
+
outOfStock: "Rupture de stock",
|
|
52
|
+
addReasonUnbound: "Connectez une boutique pour ajouter des articles au panier.",
|
|
53
|
+
addReasonError: "La boutique est injoignable.",
|
|
54
|
+
addReasonNoSku: "Cet article ne peut pas être ajouté au panier.",
|
|
55
|
+
loadingCart: "Chargement de votre panier…",
|
|
56
|
+
quantityNotWhole: "Saisissez un nombre entier supérieur ou égal à 1.",
|
|
57
|
+
quantityOverStock: {
|
|
58
|
+
one: "Seulement {count} disponible.",
|
|
59
|
+
other: "Seulement {count} disponibles."
|
|
60
|
+
},
|
|
61
|
+
cartTitle: "Votre panier",
|
|
62
|
+
sampleCartTitle: "Panier d'exemple",
|
|
63
|
+
cartDescription: "Vérifiez vos articles avant de passer commande.",
|
|
64
|
+
sampleCartDescription: "Produits et prix d'exemple en {currency}. Aucun achat n'est possible.",
|
|
65
|
+
closeCart: "Fermer le panier",
|
|
66
|
+
refreshCart: "Actualiser le panier",
|
|
67
|
+
priceUnavailable: "Prix indisponible",
|
|
68
|
+
decreaseQuantity: "Diminuer la quantité de {name}",
|
|
69
|
+
increaseQuantity: "Augmenter la quantité de {name}",
|
|
70
|
+
quantityPrefix: `Quantité${colon} `,
|
|
71
|
+
remove: "Retirer",
|
|
72
|
+
itemOption: `{attribute}${colon} {values}`,
|
|
73
|
+
cartEmpty: "Votre panier est vide",
|
|
74
|
+
cartEmptyHint: "Ajoutez un article qui vous plaît et il apparaîtra ici.",
|
|
75
|
+
sampleCartEmptyHint: "Ajoutez un produit d'exemple pour essayer le panier.",
|
|
76
|
+
browseProducts: "Parcourir les produits",
|
|
77
|
+
subtotal: "Sous-total",
|
|
78
|
+
sampleSubtotal: "Sous-total d'exemple",
|
|
79
|
+
checkoutAdjustments: "Livraison, taxes et remises",
|
|
80
|
+
checkoutAdjustmentsValue: "Calculées au paiement",
|
|
81
|
+
sampleCheckoutNote: "Total d'exemple en {currency}. Le paiement n'est pas encore configuré.",
|
|
82
|
+
checkoutUnavailable: "Le paiement n'est pas encore disponible.",
|
|
83
|
+
checkout: "Passer la commande",
|
|
84
|
+
openingCheckout: "Ouverture du paiement…",
|
|
85
|
+
continueShopping: "Continuer mes achats",
|
|
86
|
+
catalogTitle: "Tous les produits",
|
|
87
|
+
catalogDescription: "Découvrez la collection et trouvez vos favoris.",
|
|
88
|
+
sampleCatalogSummary: "Produits d'exemple · Prix d'exemple en {currency}",
|
|
89
|
+
loadingProducts: "Chargement des produits…",
|
|
90
|
+
productsUnavailable: "Produits indisponibles",
|
|
91
|
+
productCount: {
|
|
92
|
+
one: "{count} produit affiché",
|
|
93
|
+
other: "{count} produits affichés"
|
|
94
|
+
},
|
|
95
|
+
retryProducts: "Recharger les produits",
|
|
96
|
+
noProducts: "Aucun produit disponible.",
|
|
97
|
+
productPages: "Pages de produits",
|
|
98
|
+
firstPage: "Première page",
|
|
99
|
+
nextPage: "Page suivante",
|
|
100
|
+
sampleProductName: "Produit {number}",
|
|
101
|
+
relatedTitle: "Vous aimerez aussi",
|
|
102
|
+
imageUnavailable: `{name}${colon} image indisponible`,
|
|
103
|
+
noImage: "Aucune image disponible",
|
|
104
|
+
sale: "Promo",
|
|
105
|
+
wasPrice: "Prix initial",
|
|
106
|
+
swatchSummary: {
|
|
107
|
+
one: `{count} option de {attribute}${colon} {values}`,
|
|
108
|
+
other: `{count} options de {attribute}${colon} {values}`
|
|
109
|
+
},
|
|
110
|
+
chooseOptions: "Choisir les options",
|
|
111
|
+
viewProduct: "Voir le produit",
|
|
112
|
+
addSampleToCart: "Ajouter {name} au panier d'exemple",
|
|
113
|
+
sampleItemName: "({name}, exemple)",
|
|
114
|
+
loadingProduct: "Chargement du produit…",
|
|
115
|
+
productUnavailable: "Produit indisponible",
|
|
116
|
+
retryProduct: "Recharger le produit",
|
|
117
|
+
productNotFound: "Produit introuvable",
|
|
118
|
+
backToShop: "Retour à la boutique",
|
|
119
|
+
viewImage: "Voir l'image {number}",
|
|
120
|
+
priceFrom: "À partir de {price}",
|
|
121
|
+
selectAllOptions: "Sélectionnez toutes les options pour ajouter cet article à votre panier.",
|
|
122
|
+
checkingVariant: "Vérification de cette variante…",
|
|
123
|
+
variantCheckFailed: "La disponibilité de cette sélection n'a pas pu être vérifiée.",
|
|
124
|
+
combinationUnavailable: "Cette combinaison n'est pas disponible. Choisissez d'autres options.",
|
|
125
|
+
notPurchasable: "Ce produit n'est pas disponible à l'achat pour le moment.",
|
|
126
|
+
selectAttribute: `Choisir${colon} {attribute}`,
|
|
127
|
+
selectAttributeError: `Sélection requise${colon} {attribute}.`,
|
|
128
|
+
selectOption: "Choisir une option",
|
|
129
|
+
skuOptionLabel: "Option",
|
|
130
|
+
soldOutOption: "{label} (épuisé)",
|
|
131
|
+
soldOutChoice: "{label}, épuisé",
|
|
132
|
+
retryAvailability: "Revérifier la disponibilité",
|
|
133
|
+
availableToOrder: "Disponible à la commande",
|
|
134
|
+
variantOutOfStock: "Cette variante est en rupture de stock",
|
|
135
|
+
availableCount: {
|
|
136
|
+
one: "{count} disponible",
|
|
137
|
+
other: "{count} disponibles"
|
|
138
|
+
},
|
|
139
|
+
quantity: "Quantité"
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
//#endregion
|
|
143
|
+
export { frFR };
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
//#region src/messages.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* One piece of package text. `{name}` placeholders are replaced with values, and numbers are formatted for the
|
|
4
|
+
* messages' `locale`. A message with a `count` can be an object of plural forms, chosen with `Intl.PluralRules`.
|
|
5
|
+
*/
|
|
6
|
+
type StorefrontMessage = string | ({
|
|
7
|
+
readonly other: string;
|
|
8
|
+
} & Partial<Record<Intl.LDMLPluralRule, string>>);
|
|
9
|
+
declare const englishText: {
|
|
10
|
+
connectPrompt: string;
|
|
11
|
+
connecting: string;
|
|
12
|
+
retryConnection: string;
|
|
13
|
+
connectionSlow: string;
|
|
14
|
+
invalidConfiguration: string;
|
|
15
|
+
requestFailed: string;
|
|
16
|
+
requestFailedStatus: string;
|
|
17
|
+
requestTimeout: string;
|
|
18
|
+
unknownError: string;
|
|
19
|
+
storageUnavailable: string;
|
|
20
|
+
invalidAddItem: string;
|
|
21
|
+
addReturnedNoCart: string;
|
|
22
|
+
itemNotInCart: string;
|
|
23
|
+
invalidQuantity: string;
|
|
24
|
+
updateReturnedNoCart: string;
|
|
25
|
+
discountMissing: string;
|
|
26
|
+
discountReturnedNoCart: string;
|
|
27
|
+
checkoutDisabled: string;
|
|
28
|
+
checkoutEmpty: string;
|
|
29
|
+
checkoutNoUrl: string;
|
|
30
|
+
checkoutInvalidUrl: string;
|
|
31
|
+
itemAdded: string;
|
|
32
|
+
sampleItemAdded: string;
|
|
33
|
+
itemRemoved: string;
|
|
34
|
+
quantityUpdated: string;
|
|
35
|
+
discountsUpdated: string;
|
|
36
|
+
sampleQuantityUpdated: string;
|
|
37
|
+
sampleItemRemoved: string;
|
|
38
|
+
cartButtonLabel: {
|
|
39
|
+
one: string;
|
|
40
|
+
other: string;
|
|
41
|
+
};
|
|
42
|
+
addToCart: string;
|
|
43
|
+
addToCartWithPrice: string;
|
|
44
|
+
addToCartWithPriceName: string;
|
|
45
|
+
adding: string;
|
|
46
|
+
outOfStock: string;
|
|
47
|
+
addReasonUnbound: string;
|
|
48
|
+
addReasonError: string;
|
|
49
|
+
addReasonNoSku: string;
|
|
50
|
+
loadingCart: string;
|
|
51
|
+
quantityNotWhole: string;
|
|
52
|
+
quantityOverStock: string;
|
|
53
|
+
cartTitle: string;
|
|
54
|
+
sampleCartTitle: string;
|
|
55
|
+
cartDescription: string;
|
|
56
|
+
sampleCartDescription: string;
|
|
57
|
+
closeCart: string;
|
|
58
|
+
refreshCart: string;
|
|
59
|
+
priceUnavailable: string;
|
|
60
|
+
decreaseQuantity: string;
|
|
61
|
+
increaseQuantity: string;
|
|
62
|
+
quantityPrefix: string;
|
|
63
|
+
remove: string;
|
|
64
|
+
itemOption: string;
|
|
65
|
+
cartEmpty: string;
|
|
66
|
+
cartEmptyHint: string;
|
|
67
|
+
sampleCartEmptyHint: string;
|
|
68
|
+
browseProducts: string;
|
|
69
|
+
subtotal: string;
|
|
70
|
+
sampleSubtotal: string;
|
|
71
|
+
checkoutAdjustments: string;
|
|
72
|
+
checkoutAdjustmentsValue: string;
|
|
73
|
+
sampleCheckoutNote: string;
|
|
74
|
+
checkoutUnavailable: string;
|
|
75
|
+
checkout: string;
|
|
76
|
+
openingCheckout: string;
|
|
77
|
+
continueShopping: string;
|
|
78
|
+
catalogTitle: string;
|
|
79
|
+
catalogDescription: string;
|
|
80
|
+
sampleCatalogSummary: string;
|
|
81
|
+
loadingProducts: string;
|
|
82
|
+
productsUnavailable: string;
|
|
83
|
+
productCount: {
|
|
84
|
+
one: string;
|
|
85
|
+
other: string;
|
|
86
|
+
};
|
|
87
|
+
retryProducts: string;
|
|
88
|
+
noProducts: string;
|
|
89
|
+
productPages: string;
|
|
90
|
+
firstPage: string;
|
|
91
|
+
nextPage: string;
|
|
92
|
+
sampleProductName: string;
|
|
93
|
+
relatedTitle: string;
|
|
94
|
+
imageUnavailable: string;
|
|
95
|
+
noImage: string;
|
|
96
|
+
sale: string;
|
|
97
|
+
wasPrice: string;
|
|
98
|
+
swatchSummary: {
|
|
99
|
+
one: string;
|
|
100
|
+
other: string;
|
|
101
|
+
};
|
|
102
|
+
chooseOptions: string;
|
|
103
|
+
viewProduct: string;
|
|
104
|
+
addSampleToCart: string;
|
|
105
|
+
sampleItemName: string;
|
|
106
|
+
loadingProduct: string;
|
|
107
|
+
productUnavailable: string;
|
|
108
|
+
retryProduct: string;
|
|
109
|
+
productNotFound: string;
|
|
110
|
+
backToShop: string;
|
|
111
|
+
viewImage: string;
|
|
112
|
+
priceFrom: string;
|
|
113
|
+
selectAllOptions: string;
|
|
114
|
+
checkingVariant: string;
|
|
115
|
+
variantCheckFailed: string;
|
|
116
|
+
combinationUnavailable: string;
|
|
117
|
+
notPurchasable: string;
|
|
118
|
+
selectAttribute: string;
|
|
119
|
+
selectAttributeError: string;
|
|
120
|
+
selectOption: string;
|
|
121
|
+
skuOptionLabel: string;
|
|
122
|
+
soldOutOption: string;
|
|
123
|
+
soldOutChoice: string;
|
|
124
|
+
retryAvailability: string;
|
|
125
|
+
availableToOrder: string;
|
|
126
|
+
variantOutOfStock: string;
|
|
127
|
+
availableCount: string;
|
|
128
|
+
quantity: string;
|
|
129
|
+
};
|
|
130
|
+
type StorefrontMessageKey = keyof typeof englishText;
|
|
131
|
+
/** Error codes from `@godaddy/gd-commerce-server` failure responses. Other codes may be added. */
|
|
132
|
+
type CommerceErrorCode = 'invalid_request' | 'scope_mismatch' | 'not_found' | 'not_configured' | 'upstream_unauthorized' | 'upstream_error' | 'internal_error';
|
|
133
|
+
/**
|
|
134
|
+
* All of the package's text. Pass a complete set, such as `frFR` from
|
|
135
|
+
* `@godaddy/gd-commerce-storefront/messages/fr-FR`, or only the keys to change, to `CommerceProvider`'s `messages`.
|
|
136
|
+
*/
|
|
137
|
+
type StorefrontMessages = { readonly [Key in StorefrontMessageKey]: StorefrontMessage } & {
|
|
138
|
+
/** The BCP 47 locale the text is written in. Chooses plural forms and formats numbers inside messages. */
|
|
139
|
+
readonly locale: string;
|
|
140
|
+
/**
|
|
141
|
+
* Text for server failures, by the response's `code`. The server's own messages are English, so English text
|
|
142
|
+
* shows them for any code not listed here; text in other languages shows `requestFailed` instead.
|
|
143
|
+
*/
|
|
144
|
+
readonly errorCodes: Partial<Record<CommerceErrorCode | (string & {}), string>>;
|
|
145
|
+
};
|
|
146
|
+
/** The package's English text, the default for every key a site does not set. */
|
|
147
|
+
declare const enUS: StorefrontMessages;
|
|
148
|
+
type MessageValues = Readonly<Record<string, string | number>>;
|
|
149
|
+
/** `key` from `messages`, with its plural form chosen by `values.count` and its placeholders filled in. */
|
|
150
|
+
declare function formatMessage(messages: StorefrontMessages, key: StorefrontMessageKey, values?: MessageValues): string;
|
|
151
|
+
//#endregion
|
|
152
|
+
export { StorefrontMessages as a, StorefrontMessageKey as i, MessageValues as n, enUS as o, StorefrontMessage as r, formatMessage as s, CommerceErrorCode as t };
|
package/dist/styles.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@godaddy/gd-commerce-storefront",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Opinionated React storefront templates for GoDaddy Commerce",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,9 +20,21 @@
|
|
|
20
20
|
"import": "./dist/index.js",
|
|
21
21
|
"default": "./dist/index.js"
|
|
22
22
|
},
|
|
23
|
+
"./messages/fr-FR": {
|
|
24
|
+
"types": "./dist/messages/fr-FR.d.ts",
|
|
25
|
+
"import": "./dist/messages/fr-FR.js",
|
|
26
|
+
"default": "./dist/messages/fr-FR.js"
|
|
27
|
+
},
|
|
23
28
|
"./styles.css": "./dist/styles.css",
|
|
24
29
|
"./package.json": "./package.json"
|
|
25
30
|
},
|
|
31
|
+
"typesVersions": {
|
|
32
|
+
"*": {
|
|
33
|
+
"messages/fr-FR": [
|
|
34
|
+
"./dist/messages/fr-FR.d.ts"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
26
38
|
"peerDependencies": {
|
|
27
39
|
"@tanstack/react-query": "^5.0.0",
|
|
28
40
|
"react": "^18.2.0 || ^19.0.0",
|