ui.shipaid.com 0.3.0 → 0.3.2
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 +8 -0
- package/dist/{it-0759ce74.js → it-108c90b9.js} +4 -2
- package/dist/pt-b1b6ec67.js +42 -0
- package/dist/widget.es.js +464 -270
- package/dist/widget.iife.js +362 -223
- package/dist/widget.umd.js +362 -223
- package/dist-types/common/shopify/index.d.ts +6 -0
- package/dist-types/common/shopify/protection.d.ts +6 -0
- package/dist-types/common/shopify/types/ShopifyCart.d.ts +28 -0
- package/dist-types/common/shopify/types/ShopifyProduct.d.ts +7 -0
- package/dist-types/{types/shipaid.d.ts → common/types/ShipAid.d.ts} +8 -16
- package/dist-types/widget/src/assets/icons.d.ts +7 -0
- package/dist-types/widget/types/shipaid.d.ts +10 -0
- package/dist-types/widget/types/shopify.d.ts +28 -0
- package/package.json +7 -7
- package/dist-types/src/assets/icons.d.ts +0 -3
- package/dist-types/src/components/learn-more-styles.d.ts +0 -2
- package/dist-types/types/shopify.d.ts +0 -151
- /package/dist-types/{src → widget/src}/assets/learn-more-styles.d.ts +0 -0
- /package/dist-types/{src → widget/src}/assets/styles.d.ts +0 -0
- /package/dist-types/{src → widget/src}/components/learn-more-popup.d.ts +0 -0
- /package/dist-types/{src → widget/src}/shipaid-widget.d.ts +0 -0
- /package/dist-types/{types → widget/types}/widget.d.ts +0 -0
package/README.md
CHANGED
|
@@ -71,6 +71,7 @@ This is a list of props that can be used to configure the widget:
|
|
|
71
71
|
| `disablePolling` | Sets whether the cart should disable polling (enabled by default) - should be disabled if integrating manually with an ajax cart. | `boolean` |
|
|
72
72
|
| `pollingInterval` | If polling is enabled, it sets the interval (in ms) between API updates. | `number` in milliseconds |
|
|
73
73
|
| `disableRefresh ` | Sets whether the store cart should be updated when the protection item is added/removed. Add if you want to initially hide the protection product from the cart, even if it has just been added. | `boolean` |
|
|
74
|
+
| `lang ` | Sets the widget language (see the translations section below). This value can be any supported [ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). | `string` defaults to `en` |
|
|
74
75
|
|
|
75
76
|
### Events
|
|
76
77
|
|
|
@@ -130,6 +131,13 @@ If you need to change any of the widget colors to suit a specific theme, there a
|
|
|
130
131
|
|
|
131
132
|
Other variables can be found [here](/widget/src/assets/styles.ts) (`/widget/src/assets/styles.ts`).
|
|
132
133
|
|
|
134
|
+
### Translations
|
|
135
|
+
|
|
136
|
+
This widget also supports multiple languages, using the `lit-translate` plugin. The widget language can be configured using an attribute and would usally be static, but supports reactively swapping the language if a theme needs - i.e. if a user switches the language using a select option in the theme, then the widget language could be updated at the same time by selecting the widget element, and setting the `lang` attribute.
|
|
137
|
+
|
|
138
|
+
To create lang files, you should copy the default `/lang/en.json` file, and rename it to an [ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) - for example `cp /src/lang/en.json /src/lang/fs.json`. You can then go through each key, and translate the existing text to the relevant language. This should be all you need to do - the widget automatically (and lazily, to save bundle size) imports the relevant lang file when it is specified. It will also fallback to the default `en.json` lang file if a certain language doesn't exist yet.
|
|
139
|
+
|
|
140
|
+
|
|
133
141
|
## Contributing
|
|
134
142
|
|
|
135
143
|
### Requirements
|
|
@@ -20,8 +20,10 @@ const it = {
|
|
|
20
20
|
title: "Garanzia di consegna",
|
|
21
21
|
subtitle: "Consentiamo ai tuoi marchi preferiti di offrire una garanzia di consegna perché ogni ordine è prezioso!",
|
|
22
22
|
disclaimer: {
|
|
23
|
-
|
|
24
|
-
subtitle: "
|
|
23
|
+
"subtitle-enable": "Consentiamo ai tuoi marchi preferiti di fornire una garanzia di consegna perché sappiamo che ogni ordine è prezioso e le cose accadono!",
|
|
24
|
+
"subtitle-monitor": "Monitoriamo continuamente il tuo pacco e ti offriamo un comodo portale per monitorare lo stato di avanzamento del tuo ordine in qualsiasi momento!",
|
|
25
|
+
"subtitle-notify": "Riceverai una notifica durante l'intero processo di spedizione, assicurandoti di rimanere aggiornato in ogni fase del processo.",
|
|
26
|
+
"subtitle-resolution": "Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",
|
|
25
27
|
text: "Acquistando questa garanzia di consegna, accetti i nostri Termini di servizio e l'Informativa sulla privacy. Non sei obbligato ad acquistare questa garanzia. Questa garanzia NON è un'assicurazione e non fornisce un indennizzo contro perdite, danni o responsabilità derivanti da un evento contingente o sconosciuto, ma piuttosto, attraverso ShipAid i marchi forniscono una garanzia di consegna in base alla quale se il prodotto ordinato non viene consegnato in condizioni soddisfacenti, il marchio da cui hai ordinato il prodotto può sostituire il prodotto gratuitamente. ShipAid non fornisce alcun prodotto o servizio direttamente ai consumatori, ma fornisce invece un servizio che consente ai marchi di facilitare la sostituzione del prodotto ai propri clienti. L'acquisto di questa garanzia non significa che verrai automaticamente rimborsato per qualsiasi prodotto o costo di spedizione perché il processo di risoluzione e la decisione per il risarcimento sono rigorosamente decisi dal marchio da cui stai acquistando. Il marchio richiederà la prova del danno o del prodotto non consegnato."
|
|
26
28
|
},
|
|
27
29
|
links: {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const loading = "Carregando o widget ShipAid...";
|
|
2
|
+
const title = "Garantia de entrega";
|
|
3
|
+
const description = "em caso de Perda, Danos ou Roubo";
|
|
4
|
+
const footer = {
|
|
5
|
+
button: "Distribuído por"
|
|
6
|
+
};
|
|
7
|
+
const actions = {
|
|
8
|
+
add: "Adicionar",
|
|
9
|
+
remove: "Remover",
|
|
10
|
+
loading: "Carregando..."
|
|
11
|
+
};
|
|
12
|
+
const pt = {
|
|
13
|
+
loading,
|
|
14
|
+
title,
|
|
15
|
+
description,
|
|
16
|
+
footer,
|
|
17
|
+
actions,
|
|
18
|
+
"learn-more-popup": {
|
|
19
|
+
close: "Fechar",
|
|
20
|
+
title: "Garantia de entrega",
|
|
21
|
+
subtitle: "Capacitamos suas marcas favoritas para oferecer uma garantia de entrega porque cada pedido é precioso!",
|
|
22
|
+
disclaimer: {
|
|
23
|
+
"subtitle-enable": "Permitimos que suas marcas favoritas forneçam uma garantia de entrega porque sabemos que cada pedido é precioso e as coisas acontecem!",
|
|
24
|
+
"subtitle-monitor": "Monitoramos continuamente o seu pacote e oferecemos um portal conveniente para você acompanhar o andamento do seu pedido a qualquer momento!",
|
|
25
|
+
"subtitle-notify": "Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",
|
|
26
|
+
"subtitle-resolution": "Você será notificado durante todo o processo de envio, garantindo que você fique atualizado a cada passo do caminho.",
|
|
27
|
+
text: "Ao adquirir esta garantia de entrega, você concorda com nossos Termos de Serviço e Política de Privacidade. Esta garantia não é obrigatória, NÃO é um seguro e não fornece indenização contra perdas, danos ou responsabilidade decorrentes de um contingente ou desconhecido. Caso o produto não seja entregue em condições satisfatórias, a marca da qual você comprou pode substituí-lo gratuitamente. A ShipAid não fornece nenhum produto ou serviço diretamente aos consumidores, mas sim presta um serviço que permite às marcas facilitar a substituição do produto aos seus clientes. Adquirir esta garantia não significa que você será automaticamente reembolsado por qualquer produto ou custos de envio porque o processo de resolução e decisão de compensação é estritamente decidido pela marca que você está comprando. A marca exigirá prova de danos ou produto não entregue."
|
|
28
|
+
},
|
|
29
|
+
links: {
|
|
30
|
+
terms: "Termos de serviço",
|
|
31
|
+
privacy: "Política de Privacidade"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
actions,
|
|
37
|
+
pt as default,
|
|
38
|
+
description,
|
|
39
|
+
footer,
|
|
40
|
+
loading,
|
|
41
|
+
title
|
|
42
|
+
};
|