@uappi/public-sdk 1.2.8 → 1.2.10
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/.gitlab-ci.yml +43 -0
- package/.husky/pre-push +1 -0
- package/.vscode/extensions.json +4 -4
- package/.vscode/settings.json +6 -6
- package/README.md +67 -0
- package/components/Animations/ExpandTransition.ts +89 -89
- package/components/Animations/index.ts +1 -1
- package/components/ColorTheme/ColorTheme.ts +80 -80
- package/components/ColorTheme/index.ts +1 -1
- package/components/ColorTheme/types.ts +18 -18
- package/components/SocialAuth/FacebookAuth/types.ts +2 -2
- package/components/SocialAuth/GoogleAuth/types.ts +2 -2
- package/components/SocialAuth/index.ts +1 -1
- package/components/index.ts +2 -2
- package/eslint.config.mjs +19 -0
- package/main.ts +4 -4
- package/modules/Api/README.md +469 -469
- package/modules/Api/endpoints/CommonComposable.ts +24 -24
- package/modules/Api/endpoints/CouponComposable.ts +18 -18
- package/modules/Api/endpoints/CustomerComposable.ts +1 -1
- package/modules/Api/endpoints/LoggoutComposable.ts +8 -8
- package/modules/Api/endpoints/MFAComposable.ts +43 -43
- package/modules/Api/endpoints/PaymentComposable.ts +14 -14
- package/modules/Api/endpoints/PublicComposable.ts +8 -8
- package/modules/Api/endpoints/TemplateComposable.ts +7 -7
- package/modules/Api/endpoints/ThirdPartyComposable.ts +13 -13
- package/modules/Api/endpoints/UpsellComposable.ts +17 -18
- package/modules/Api/endpoints/VerifyComposable.ts +7 -7
- package/modules/Api/endpoints/WalletComposable.ts +36 -36
- package/modules/Api/paramsSerializer/encodeWafNormalizer.ts +7 -7
- package/modules/Api/types/context/api-config.types.ts +0 -1
- package/modules/Api/types/endpoints/cart/cart.interfaces.ts +161 -161
- package/modules/Api/types/endpoints/cart/cart.types.ts +27 -27
- package/modules/Api/types/endpoints/common/common.interfaces.ts +21 -21
- package/modules/Api/types/endpoints/country/country.types.ts +7502 -7502
- package/modules/Api/types/endpoints/coupon/coupon.interfaces.ts +13 -13
- package/modules/Api/types/endpoints/discounts/discounts.interfaces.ts +9 -9
- package/modules/Api/types/endpoints/mfa/mfa.interfaces.ts +51 -51
- package/modules/Api/types/endpoints/payment/payment.interfaces.ts +103 -103
- package/modules/Api/types/endpoints/payment/payment.types.ts +27 -27
- package/modules/Api/types/endpoints/price/price.interfaces.ts +21 -21
- package/modules/Api/types/endpoints/template/template.interfaces.ts +29 -29
- package/modules/Api/types/endpoints/third-party/oauth.interfaces.ts +5 -5
- package/modules/Api/types/endpoints/upsell/upsell.interfaces.ts +12 -12
- package/modules/Api/types/endpoints/wallet/wallet-obsearch.ts +8 -8
- package/modules/Api/types/endpoints/wallet/wallet.interfaces.ts +57 -57
- package/modules/Api/types/endpoints/zipcode/zipcode.interfaces.ts +23 -23
- package/modules/Api/types/index.ts +504 -504
- package/modules/Tracking/endpoints/CartComposable.ts +75 -75
- package/modules/Tracking/endpoints/CustomerComposable.ts +71 -71
- package/modules/Tracking/endpoints/types.ts +11 -11
- package/modules/Tracking/events/actions/addPaymentInfo.ts +31 -31
- package/modules/Tracking/events/actions/addShippingInfo.ts +27 -27
- package/modules/Tracking/events/actions/addToCart.ts +35 -35
- package/modules/Tracking/events/actions/beginCheckout.ts +28 -28
- package/modules/Tracking/events/actions/customerProfile.ts +36 -36
- package/modules/Tracking/events/actions/generateLead.ts +12 -12
- package/modules/Tracking/events/actions/login.ts +8 -8
- package/modules/Tracking/events/actions/purchase.ts +42 -42
- package/modules/Tracking/events/actions/removeFromCart.ts +52 -52
- package/modules/Tracking/events/actions/search.ts +8 -8
- package/modules/Tracking/events/actions/selectItem.ts +64 -64
- package/modules/Tracking/events/actions/selectPromotion.ts +24 -24
- package/modules/Tracking/events/actions/shippingCalculation.ts +7 -7
- package/modules/Tracking/events/actions/signup.ts +8 -8
- package/modules/Tracking/events/actions/upsertToCart.ts +62 -62
- package/modules/Tracking/events/views/viewCart.ts +28 -28
- package/modules/Tracking/events/views/viewHome.ts +5 -5
- package/modules/Tracking/events/views/viewItem.ts +31 -31
- package/modules/Tracking/events/views/viewItemList.ts +65 -65
- package/modules/Tracking/events/views/viewNotFound.ts +5 -5
- package/modules/Tracking/events/views/viewOther.ts +5 -5
- package/modules/Tracking/events/views/viewPayment.ts +7 -7
- package/modules/Tracking/events/views/viewPromotion.ts +28 -28
- package/modules/Tracking/events/views/viewShipping.ts +7 -7
- package/modules/Tracking/index.ts +84 -84
- package/modules/Tracking/publicApiTracking.ts +35 -36
- package/modules/Tracking/types/actions/add-payment-info.interfaces.ts +12 -12
- package/modules/Tracking/types/actions/add-shipping-info.interfaces.ts +11 -11
- package/modules/Tracking/types/actions/add-to-cart.interfaces.ts +10 -10
- package/modules/Tracking/types/actions/begin-checkout.interfaces.ts +12 -12
- package/modules/Tracking/types/actions/customer-profile.interfaces.ts +19 -19
- package/modules/Tracking/types/actions/file-download.interfaces.ts +4 -4
- package/modules/Tracking/types/actions/generate-lead.interfaces.ts +12 -12
- package/modules/Tracking/types/actions/login.interfaces.ts +4 -4
- package/modules/Tracking/types/actions/purchase.interfaces.ts +18 -18
- package/modules/Tracking/types/actions/remove-from-cart.interfaces.ts +10 -10
- package/modules/Tracking/types/actions/search.interfaces.ts +4 -4
- package/modules/Tracking/types/actions/select-item.interfaces.ts +16 -16
- package/modules/Tracking/types/actions/select-promotion.interfaces.ts +8 -8
- package/modules/Tracking/types/actions/share.interfaces.ts +4 -4
- package/modules/Tracking/types/actions/shipping-calculation.interfaces.ts +3 -3
- package/modules/Tracking/types/actions/signup.interfaces.ts +4 -4
- package/modules/Tracking/types/event.types.ts +54 -54
- package/modules/Tracking/types/index.ts +37 -37
- package/modules/Tracking/types/item.interfaces.ts +30 -30
- package/modules/Tracking/types/views/view-cart.interfaces.ts +11 -11
- package/modules/Tracking/types/views/view-home.interfaces.ts +3 -3
- package/modules/Tracking/types/views/view-item-list.interfaces.ts +11 -11
- package/modules/Tracking/types/views/view-item.interfaces.ts +15 -15
- package/modules/Tracking/types/views/view-not-found.interfaces.ts +3 -3
- package/modules/Tracking/types/views/view-other.interfaces.ts +3 -3
- package/modules/Tracking/types/views/view-payment.interfaces.ts +3 -3
- package/modules/Tracking/types/views/view-promotion.interfaces.ts +8 -8
- package/modules/Tracking/types/views/view-shipping.interfaces.ts +3 -3
- package/modules/Tracking/utils/cart.ts +100 -100
- package/modules/Tracking/utils/pushDatalayer.ts +7 -7
- package/modules/index.ts +1 -1
- package/package.json +18 -2
- package/scripts/release.sh +34 -0
- package/shims.d.ts +5 -0
- package/tsconfig.json +17 -0
package/.gitlab-ci.yml
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
stages:
|
|
2
|
+
- verify
|
|
3
|
+
- release
|
|
4
|
+
|
|
5
|
+
variables:
|
|
6
|
+
GIT_DEPTH: 0
|
|
7
|
+
|
|
8
|
+
.node-cache:
|
|
9
|
+
cache:
|
|
10
|
+
key:
|
|
11
|
+
files:
|
|
12
|
+
- package-lock.json
|
|
13
|
+
paths:
|
|
14
|
+
- node_modules/
|
|
15
|
+
|
|
16
|
+
verify:
|
|
17
|
+
stage: verify
|
|
18
|
+
image: node:22
|
|
19
|
+
extends: .node-cache
|
|
20
|
+
rules:
|
|
21
|
+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
22
|
+
script:
|
|
23
|
+
- npm ci
|
|
24
|
+
- npm run lint
|
|
25
|
+
- npm run type-check
|
|
26
|
+
|
|
27
|
+
release:
|
|
28
|
+
stage: release
|
|
29
|
+
image: node:22
|
|
30
|
+
extends: .node-cache
|
|
31
|
+
rules:
|
|
32
|
+
- if: '$CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_SOURCE == "push"'
|
|
33
|
+
before_script:
|
|
34
|
+
- apt-get update -qq && apt-get install -y -qq git > /dev/null
|
|
35
|
+
- git config user.name "gitlab-ci"
|
|
36
|
+
- git config user.email "ci@uappi.com.br"
|
|
37
|
+
- git remote set-url origin "https://oauth2:${GITLAB_PUSH_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git"
|
|
38
|
+
- git fetch --tags origin
|
|
39
|
+
script:
|
|
40
|
+
- npm ci
|
|
41
|
+
- npm run lint
|
|
42
|
+
- npm run type-check
|
|
43
|
+
- bash scripts/release.sh
|
package/.husky/pre-push
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npm run prepush
|
package/.vscode/extensions.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"recommendations": [
|
|
3
|
-
"EditorConfig.EditorConfig"
|
|
4
|
-
],
|
|
1
|
+
{
|
|
2
|
+
"recommendations": [
|
|
3
|
+
"EditorConfig.EditorConfig"
|
|
4
|
+
],
|
|
5
5
|
}
|
package/.vscode/settings.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"editor.tabSize": 2,
|
|
3
|
-
"editor.formatOnSave": false,
|
|
4
|
-
"editor.codeActionsOnSave": {
|
|
5
|
-
"source.fixAll.eslint": "explicit"
|
|
6
|
-
},
|
|
1
|
+
{
|
|
2
|
+
"editor.tabSize": 2,
|
|
3
|
+
"editor.formatOnSave": false,
|
|
4
|
+
"editor.codeActionsOnSave": {
|
|
5
|
+
"source.fixAll.eslint": "explicit"
|
|
6
|
+
},
|
|
7
7
|
}
|
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# @uappi/public-sdk
|
|
2
|
+
|
|
3
|
+
Pacotes públicos (composables, tipos e componentes Vue 3) para desenvolvimento do ecossistema Uappi. Publicado como `.ts`/`.vue` cru — sem etapa de build — então os erros de compilação (imports de tipo, `verbatimModuleSyntax`, etc.) só aparecem quando o projeto consumidor faz o type-check. Por isso este repositório valida tudo antes de deixar chegar lá.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npm install
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Isso também instala os git hooks do Husky via `prepare`.
|
|
12
|
+
|
|
13
|
+
## Scripts
|
|
14
|
+
|
|
15
|
+
| Script | O que faz |
|
|
16
|
+
|---|---|
|
|
17
|
+
| `npm run lint` | ESLint (`eslint.config.mjs`), com a regra `@typescript-eslint/consistent-type-imports` — pega imports de tipo sem `type`, que é a causa mais comum de quebrar o build de projetos consumidores com `verbatimModuleSyntax` habilitado. |
|
|
18
|
+
| `npm run type-check` | `tsc --noEmit` usando `tsconfig.json`, que tem `verbatimModuleSyntax: true` propositalmente — reproduz localmente o mesmo erro que apareceria no projeto consumidor. |
|
|
19
|
+
| `npm run prepush` | `lint` + `type-check` juntos. Roda automaticamente antes de qualquer `git push` (hook `.husky/pre-push`). |
|
|
20
|
+
|
|
21
|
+
Se `npm run prepush` falhar, o `git push` é bloqueado. Corrija os erros reportados antes de tentar de novo.
|
|
22
|
+
|
|
23
|
+
## Fluxo de desenvolvimento
|
|
24
|
+
|
|
25
|
+
1. Crie uma branch a partir da `main`.
|
|
26
|
+
2. Faça as alterações. Rode `npm run lint` e `npm run type-check` localmente se quiser adiantar (o pre-push já roda isso antes do push).
|
|
27
|
+
3. Commite usando **Conventional Commits** — o prefixo do commit decide o bump de versão automático quando a MR for mergeada (veja [Versionamento e publicação](#versionamento-e-publicação)):
|
|
28
|
+
- `fix: ...` → patch
|
|
29
|
+
- `feat: ...` → minor
|
|
30
|
+
- `feat!: ...` ou corpo do commit com `BREAKING CHANGE: ...` → major
|
|
31
|
+
- qualquer outro prefixo (`chore:`, `docs:`, `refactor:`, etc.) → patch por padrão
|
|
32
|
+
4. Abra o Merge Request para a `main`. A pipeline roda o job `verify` (lint + type-check) automaticamente na MR.
|
|
33
|
+
5. Após aprovado, faça o merge. Isso dispara o job `release` na `main` — não é preciso bumpar versão nem publicar manualmente.
|
|
34
|
+
|
|
35
|
+
## Versionamento e publicação (CI/CD)
|
|
36
|
+
|
|
37
|
+
O `.gitlab-ci.yml` tem dois jobs:
|
|
38
|
+
|
|
39
|
+
- **`verify`** — roda em toda pipeline de Merge Request. Executa `lint` e `type-check`. É a mesma checagem do hook local, mas visível na revisão do MR.
|
|
40
|
+
- **`release`** — roda apenas em push direto na `main` (ou seja, no merge de uma MR aprovada). Faz, nessa ordem:
|
|
41
|
+
1. Roda `lint` e `type-check` de novo (segurança extra, já que o hook local pode ser pulado com `--no-verify`).
|
|
42
|
+
2. Olha os commits desde a última tag `vX.Y.Z` e decide o bump (patch/minor/major) pelas regras de Conventional Commits acima.
|
|
43
|
+
3. Atualiza a versão no `package.json`.
|
|
44
|
+
4. Publica no npm (`npm publish --access public`).
|
|
45
|
+
5. Só se a publicação funcionar: commita a nova versão e cria a tag `vX.Y.Z` de volta na `main`, com `[skip ci]` no commit para não disparar a pipeline de novo.
|
|
46
|
+
|
|
47
|
+
Se o job `release` falhar (ex: token expirado, lint quebrado), nada é publicado e a versão não muda — corrija o problema e re-rode o job manualmente pela pipeline no GitLab, sem precisar de outra MR.
|
|
48
|
+
|
|
49
|
+
### Variáveis de CI/CD necessárias (Settings → CI/CD → Variables no GitLab)
|
|
50
|
+
|
|
51
|
+
| Variável | Uso | Observação |
|
|
52
|
+
|---|---|---|
|
|
53
|
+
| `NPM_TOKEN` | Autenticação no registry do npm para o `npm publish` | Token do tipo **Granular Access Token**, escopo `@uappi` ou pacote específico, permissão *Read and write*, com expiração — precisa ser rotacionado periodicamente. |
|
|
54
|
+
| `GITLAB_PUSH_TOKEN` | Permite o job `release` dar `git push`/criar tag de volta na `main` protegida | Personal ou Project Access Token, scope `write_repository`, com role que tenha permissão de push na `main` (Maintainer, se a proteção da branch exigir). Também expira — se o `release` começar a falhar com 401, é o primeiro lugar a checar. |
|
|
55
|
+
|
|
56
|
+
Ambas marcadas como **Protected** e **Masked**.
|
|
57
|
+
|
|
58
|
+
### Bootstrap (já feito, só como referência)
|
|
59
|
+
|
|
60
|
+
O job `release` precisa de uma tag de referência para calcular "commits desde o último release". A tag inicial foi criada manualmente uma única vez, apontando para a versão já publicada no npm no momento em que o CI foi introduzido:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
git tag v1.2.9 origin/main
|
|
64
|
+
git push origin v1.2.9
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Não repita esse passo — é só histórico de como o processo começou.
|
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineComponent,
|
|
3
|
-
h,
|
|
4
|
-
Transition,
|
|
5
|
-
type BaseTransitionProps,
|
|
6
|
-
type PropType,
|
|
7
|
-
} from 'vue';
|
|
8
|
-
|
|
9
|
-
export const ExpandTransition = defineComponent({
|
|
10
|
-
name: 'ExpandTransition',
|
|
11
|
-
props: {
|
|
12
|
-
mode: {
|
|
13
|
-
type: String as PropType<BaseTransitionProps<Element>['mode']>,
|
|
14
|
-
default: 'out-in',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
setup(props, { slots }) {
|
|
18
|
-
const beforeEnter = (el: Element) => {
|
|
19
|
-
const element = el as HTMLElement;
|
|
20
|
-
element.style.height = '0';
|
|
21
|
-
element.style.opacity = '0';
|
|
22
|
-
element.style.overflow = 'hidden';
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const enter = (el: Element, done: () => void) => {
|
|
26
|
-
const element = el as HTMLElement;
|
|
27
|
-
element.style.transition = 'none';
|
|
28
|
-
element.style.height = 'auto';
|
|
29
|
-
const targetHeight = element.scrollHeight + 'px';
|
|
30
|
-
element.style.height = '0';
|
|
31
|
-
void element.offsetHeight;
|
|
32
|
-
element.style.transition =
|
|
33
|
-
'height 300ms ease-in-out, opacity 300ms ease-in-out';
|
|
34
|
-
element.style.height = targetHeight;
|
|
35
|
-
element.style.opacity = '1';
|
|
36
|
-
|
|
37
|
-
const cleanup = () => {
|
|
38
|
-
element.style.height = 'auto';
|
|
39
|
-
element.style.overflow = '';
|
|
40
|
-
element.removeEventListener('transitionend', cleanup);
|
|
41
|
-
done();
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
element.addEventListener('transitionend', cleanup);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const leave = (el: Element, done: () => void) => {
|
|
48
|
-
const element = el as HTMLElement;
|
|
49
|
-
const height = element.scrollHeight + 'px';
|
|
50
|
-
element.style.height = height;
|
|
51
|
-
element.style.opacity = '1';
|
|
52
|
-
element.style.overflow = 'hidden';
|
|
53
|
-
void element.offsetHeight;
|
|
54
|
-
element.style.transition =
|
|
55
|
-
'height 300ms ease-in-out, opacity 300ms ease-in-out';
|
|
56
|
-
element.style.height = '0';
|
|
57
|
-
element.style.opacity = '0';
|
|
58
|
-
|
|
59
|
-
const cleanup = () => {
|
|
60
|
-
element.removeEventListener('transitionend', cleanup);
|
|
61
|
-
done();
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
element.addEventListener('transitionend', cleanup);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const cancel = (el: Element) => {
|
|
68
|
-
const element = el as HTMLElement;
|
|
69
|
-
element.style.transition = '';
|
|
70
|
-
element.style.height = 'auto';
|
|
71
|
-
element.style.opacity = '';
|
|
72
|
-
element.style.overflow = '';
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
return () =>
|
|
76
|
-
h(
|
|
77
|
-
Transition,
|
|
78
|
-
{
|
|
79
|
-
mode: props.mode,
|
|
80
|
-
onBeforeEnter: beforeEnter,
|
|
81
|
-
onEnter: enter,
|
|
82
|
-
onLeave: leave,
|
|
83
|
-
onEnterCancelled: cancel,
|
|
84
|
-
onLeaveCancelled: cancel,
|
|
85
|
-
},
|
|
86
|
-
slots,
|
|
87
|
-
);
|
|
88
|
-
},
|
|
89
|
-
});
|
|
1
|
+
import {
|
|
2
|
+
defineComponent,
|
|
3
|
+
h,
|
|
4
|
+
Transition,
|
|
5
|
+
type BaseTransitionProps,
|
|
6
|
+
type PropType,
|
|
7
|
+
} from 'vue';
|
|
8
|
+
|
|
9
|
+
export const ExpandTransition = defineComponent({
|
|
10
|
+
name: 'ExpandTransition',
|
|
11
|
+
props: {
|
|
12
|
+
mode: {
|
|
13
|
+
type: String as PropType<BaseTransitionProps<Element>['mode']>,
|
|
14
|
+
default: 'out-in',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
setup(props, { slots }) {
|
|
18
|
+
const beforeEnter = (el: Element) => {
|
|
19
|
+
const element = el as HTMLElement;
|
|
20
|
+
element.style.height = '0';
|
|
21
|
+
element.style.opacity = '0';
|
|
22
|
+
element.style.overflow = 'hidden';
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const enter = (el: Element, done: () => void) => {
|
|
26
|
+
const element = el as HTMLElement;
|
|
27
|
+
element.style.transition = 'none';
|
|
28
|
+
element.style.height = 'auto';
|
|
29
|
+
const targetHeight = element.scrollHeight + 'px';
|
|
30
|
+
element.style.height = '0';
|
|
31
|
+
void element.offsetHeight;
|
|
32
|
+
element.style.transition =
|
|
33
|
+
'height 300ms ease-in-out, opacity 300ms ease-in-out';
|
|
34
|
+
element.style.height = targetHeight;
|
|
35
|
+
element.style.opacity = '1';
|
|
36
|
+
|
|
37
|
+
const cleanup = () => {
|
|
38
|
+
element.style.height = 'auto';
|
|
39
|
+
element.style.overflow = '';
|
|
40
|
+
element.removeEventListener('transitionend', cleanup);
|
|
41
|
+
done();
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
element.addEventListener('transitionend', cleanup);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const leave = (el: Element, done: () => void) => {
|
|
48
|
+
const element = el as HTMLElement;
|
|
49
|
+
const height = element.scrollHeight + 'px';
|
|
50
|
+
element.style.height = height;
|
|
51
|
+
element.style.opacity = '1';
|
|
52
|
+
element.style.overflow = 'hidden';
|
|
53
|
+
void element.offsetHeight;
|
|
54
|
+
element.style.transition =
|
|
55
|
+
'height 300ms ease-in-out, opacity 300ms ease-in-out';
|
|
56
|
+
element.style.height = '0';
|
|
57
|
+
element.style.opacity = '0';
|
|
58
|
+
|
|
59
|
+
const cleanup = () => {
|
|
60
|
+
element.removeEventListener('transitionend', cleanup);
|
|
61
|
+
done();
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
element.addEventListener('transitionend', cleanup);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const cancel = (el: Element) => {
|
|
68
|
+
const element = el as HTMLElement;
|
|
69
|
+
element.style.transition = '';
|
|
70
|
+
element.style.height = 'auto';
|
|
71
|
+
element.style.opacity = '';
|
|
72
|
+
element.style.overflow = '';
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return () =>
|
|
76
|
+
h(
|
|
77
|
+
Transition,
|
|
78
|
+
{
|
|
79
|
+
mode: props.mode,
|
|
80
|
+
onBeforeEnter: beforeEnter,
|
|
81
|
+
onEnter: enter,
|
|
82
|
+
onLeave: leave,
|
|
83
|
+
onEnterCancelled: cancel,
|
|
84
|
+
onLeaveCancelled: cancel,
|
|
85
|
+
},
|
|
86
|
+
slots,
|
|
87
|
+
);
|
|
88
|
+
},
|
|
89
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ExpandTransition } from './ExpandTransition';
|
|
1
|
+
export { ExpandTransition } from './ExpandTransition';
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import { defineComponent, h, Fragment, onMounted } from 'vue';
|
|
2
|
-
|
|
3
|
-
import type { CSSVariables } from './types';
|
|
4
|
-
|
|
5
|
-
export const ColorTheme = defineComponent({
|
|
6
|
-
name: 'ColorTheme',
|
|
7
|
-
props: {
|
|
8
|
-
variables: {
|
|
9
|
-
type: Object as () => CSSVariables,
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
setup(props, { slots }) {
|
|
13
|
-
function applyColors() {
|
|
14
|
-
if (!props.variables?.colors) return;
|
|
15
|
-
|
|
16
|
-
document.documentElement.style.setProperty(
|
|
17
|
-
'--checkout-cta-default',
|
|
18
|
-
props.variables.colors.CheckoutCTADefault,
|
|
19
|
-
);
|
|
20
|
-
document.documentElement.style.setProperty(
|
|
21
|
-
'--checkout-cta-hover',
|
|
22
|
-
props.variables.colors.CheckoutCTAHover,
|
|
23
|
-
);
|
|
24
|
-
document.documentElement.style.setProperty(
|
|
25
|
-
'--checkout-cta-text',
|
|
26
|
-
props.variables.colors.CheckoutCTAText,
|
|
27
|
-
);
|
|
28
|
-
document.documentElement.style.setProperty(
|
|
29
|
-
'--primary-cta-text',
|
|
30
|
-
props.variables.colors.PrimaryCTAText,
|
|
31
|
-
);
|
|
32
|
-
document.documentElement.style.setProperty(
|
|
33
|
-
'--primary-interactive-default',
|
|
34
|
-
props.variables.colors.PrimaryInteractiveDefault,
|
|
35
|
-
);
|
|
36
|
-
document.documentElement.style.setProperty(
|
|
37
|
-
'--primary-interactive-hover',
|
|
38
|
-
props.variables.colors.PrimaryInteractiveHover,
|
|
39
|
-
);
|
|
40
|
-
document.documentElement.style.setProperty(
|
|
41
|
-
'--primary-interactive-hover-low',
|
|
42
|
-
props.variables.colors.PrimaryInteractiveHoverLow,
|
|
43
|
-
);
|
|
44
|
-
document.documentElement.style.setProperty(
|
|
45
|
-
'--primary-surface-disabled',
|
|
46
|
-
props.variables.colors.PrimarySurfaceDisabled,
|
|
47
|
-
);
|
|
48
|
-
document.documentElement.style.setProperty(
|
|
49
|
-
'--primary-surface-low',
|
|
50
|
-
props.variables.colors.PrimarySurfaceLow,
|
|
51
|
-
);
|
|
52
|
-
document.documentElement.style.setProperty(
|
|
53
|
-
'--primary-text-decorative',
|
|
54
|
-
props.variables.colors.PrimaryTextDecorative,
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function applyFont() {
|
|
59
|
-
if (!props?.variables?.font?.link) return;
|
|
60
|
-
|
|
61
|
-
const fontLink = document.createElement('link');
|
|
62
|
-
fontLink.rel = 'stylesheet';
|
|
63
|
-
fontLink.setAttribute('uappi-custom-font', '');
|
|
64
|
-
fontLink.href = props.variables.font.link;
|
|
65
|
-
document.head.appendChild(fontLink);
|
|
66
|
-
|
|
67
|
-
document.documentElement.style.setProperty(
|
|
68
|
-
'--font-family',
|
|
69
|
-
props.variables.font.family,
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
onMounted(() => {
|
|
74
|
-
applyColors();
|
|
75
|
-
applyFont();
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
return () => h(Fragment, null, slots.default?.());
|
|
79
|
-
},
|
|
80
|
-
});
|
|
1
|
+
import { defineComponent, h, Fragment, onMounted } from 'vue';
|
|
2
|
+
|
|
3
|
+
import type { CSSVariables } from './types';
|
|
4
|
+
|
|
5
|
+
export const ColorTheme = defineComponent({
|
|
6
|
+
name: 'ColorTheme',
|
|
7
|
+
props: {
|
|
8
|
+
variables: {
|
|
9
|
+
type: Object as () => CSSVariables,
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
setup(props, { slots }) {
|
|
13
|
+
function applyColors() {
|
|
14
|
+
if (!props.variables?.colors) return;
|
|
15
|
+
|
|
16
|
+
document.documentElement.style.setProperty(
|
|
17
|
+
'--checkout-cta-default',
|
|
18
|
+
props.variables.colors.CheckoutCTADefault,
|
|
19
|
+
);
|
|
20
|
+
document.documentElement.style.setProperty(
|
|
21
|
+
'--checkout-cta-hover',
|
|
22
|
+
props.variables.colors.CheckoutCTAHover,
|
|
23
|
+
);
|
|
24
|
+
document.documentElement.style.setProperty(
|
|
25
|
+
'--checkout-cta-text',
|
|
26
|
+
props.variables.colors.CheckoutCTAText,
|
|
27
|
+
);
|
|
28
|
+
document.documentElement.style.setProperty(
|
|
29
|
+
'--primary-cta-text',
|
|
30
|
+
props.variables.colors.PrimaryCTAText,
|
|
31
|
+
);
|
|
32
|
+
document.documentElement.style.setProperty(
|
|
33
|
+
'--primary-interactive-default',
|
|
34
|
+
props.variables.colors.PrimaryInteractiveDefault,
|
|
35
|
+
);
|
|
36
|
+
document.documentElement.style.setProperty(
|
|
37
|
+
'--primary-interactive-hover',
|
|
38
|
+
props.variables.colors.PrimaryInteractiveHover,
|
|
39
|
+
);
|
|
40
|
+
document.documentElement.style.setProperty(
|
|
41
|
+
'--primary-interactive-hover-low',
|
|
42
|
+
props.variables.colors.PrimaryInteractiveHoverLow,
|
|
43
|
+
);
|
|
44
|
+
document.documentElement.style.setProperty(
|
|
45
|
+
'--primary-surface-disabled',
|
|
46
|
+
props.variables.colors.PrimarySurfaceDisabled,
|
|
47
|
+
);
|
|
48
|
+
document.documentElement.style.setProperty(
|
|
49
|
+
'--primary-surface-low',
|
|
50
|
+
props.variables.colors.PrimarySurfaceLow,
|
|
51
|
+
);
|
|
52
|
+
document.documentElement.style.setProperty(
|
|
53
|
+
'--primary-text-decorative',
|
|
54
|
+
props.variables.colors.PrimaryTextDecorative,
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function applyFont() {
|
|
59
|
+
if (!props?.variables?.font?.link) return;
|
|
60
|
+
|
|
61
|
+
const fontLink = document.createElement('link');
|
|
62
|
+
fontLink.rel = 'stylesheet';
|
|
63
|
+
fontLink.setAttribute('uappi-custom-font', '');
|
|
64
|
+
fontLink.href = props.variables.font.link;
|
|
65
|
+
document.head.appendChild(fontLink);
|
|
66
|
+
|
|
67
|
+
document.documentElement.style.setProperty(
|
|
68
|
+
'--font-family',
|
|
69
|
+
props.variables.font.family,
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
onMounted(() => {
|
|
74
|
+
applyColors();
|
|
75
|
+
applyFont();
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
return () => h(Fragment, null, slots.default?.());
|
|
79
|
+
},
|
|
80
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ColorTheme } from './ColorTheme';
|
|
1
|
+
export { ColorTheme } from './ColorTheme';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export interface CSSVariables {
|
|
2
|
-
font?: {
|
|
3
|
-
family: string;
|
|
4
|
-
link: string;
|
|
5
|
-
};
|
|
6
|
-
colors?: {
|
|
7
|
-
CheckoutCTADefault: string;
|
|
8
|
-
CheckoutCTAHover: string;
|
|
9
|
-
CheckoutCTAText: string;
|
|
10
|
-
PrimaryCTAText: string;
|
|
11
|
-
PrimaryInteractiveDefault: string;
|
|
12
|
-
PrimaryInteractiveHover: string;
|
|
13
|
-
PrimaryInteractiveHoverLow: string;
|
|
14
|
-
PrimarySurfaceDisabled: string;
|
|
15
|
-
PrimarySurfaceLow: string;
|
|
16
|
-
PrimaryTextDecorative: string;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
1
|
+
export interface CSSVariables {
|
|
2
|
+
font?: {
|
|
3
|
+
family: string;
|
|
4
|
+
link: string;
|
|
5
|
+
};
|
|
6
|
+
colors?: {
|
|
7
|
+
CheckoutCTADefault: string;
|
|
8
|
+
CheckoutCTAHover: string;
|
|
9
|
+
CheckoutCTAText: string;
|
|
10
|
+
PrimaryCTAText: string;
|
|
11
|
+
PrimaryInteractiveDefault: string;
|
|
12
|
+
PrimaryInteractiveHover: string;
|
|
13
|
+
PrimaryInteractiveHoverLow: string;
|
|
14
|
+
PrimarySurfaceDisabled: string;
|
|
15
|
+
PrimarySurfaceLow: string;
|
|
16
|
+
PrimaryTextDecorative: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export interface Props {
|
|
2
|
-
uri: string;
|
|
1
|
+
export interface Props {
|
|
2
|
+
uri: string;
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export interface Props {
|
|
2
|
-
uri: string;
|
|
1
|
+
export interface Props {
|
|
2
|
+
uri: string;
|
|
3
3
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as FacebookAuth } from './FacebookAuth/FacebookAuth.vue';
|
|
1
|
+
export { default as FacebookAuth } from './FacebookAuth/FacebookAuth.vue';
|
|
2
2
|
export { default as GoogleAuth } from './GoogleAuth/GoogleAuth.vue';
|
package/components/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './Animations';
|
|
2
|
-
export * from './ColorTheme';
|
|
1
|
+
export * from './Animations';
|
|
2
|
+
export * from './ColorTheme';
|
|
3
3
|
export * from './SocialAuth';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import tseslint from 'typescript-eslint';
|
|
2
|
+
|
|
3
|
+
export default tseslint.config(
|
|
4
|
+
{
|
|
5
|
+
ignores: ['node_modules/**', 'package-lock.json'],
|
|
6
|
+
},
|
|
7
|
+
...tseslint.configs.recommended,
|
|
8
|
+
{
|
|
9
|
+
files: ['**/*.ts'],
|
|
10
|
+
rules: {
|
|
11
|
+
'@typescript-eslint/consistent-type-imports': [
|
|
12
|
+
'error',
|
|
13
|
+
{ prefer: 'type-imports', fixStyle: 'separate-type-imports' },
|
|
14
|
+
],
|
|
15
|
+
'@typescript-eslint/no-unused-vars': 'off',
|
|
16
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
);
|
package/main.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './modules';
|
|
2
|
-
export * from './components'
|
|
3
|
-
|
|
4
|
-
export type * as ApiTypes from './modules/Api/types'
|
|
1
|
+
export * from './modules';
|
|
2
|
+
export * from './components'
|
|
3
|
+
|
|
4
|
+
export type * as ApiTypes from './modules/Api/types'
|
|
5
5
|
export type * as TrackingTypes from './modules/Tracking/types'
|