@weareconceptstudio/account 2.1.12 → 2.1.14
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/cli/init-config.js +221 -0
- package/cli/postinstall.js +31 -0
- package/cli/test-user-integration.mjs +150 -0
- package/dist/AccountProvider.d.ts.map +1 -1
- package/dist/AccountProvider.js +14 -11
- package/dist/AccountProvider.js.map +1 -1
- package/dist/components/AccountButton/index.d.ts.map +1 -1
- package/dist/components/AccountButton/index.js +33 -5
- package/dist/components/AccountButton/index.js.map +1 -1
- package/dist/components/AccountButton/style.d.ts +2 -0
- package/dist/components/AccountButton/style.d.ts.map +1 -1
- package/dist/components/AccountButton/style.js +74 -0
- package/dist/components/AccountButton/style.js.map +1 -1
- package/dist/components/CartPageDetector.d.ts.map +1 -1
- package/dist/components/CartPageDetector.js +13 -0
- package/dist/components/CartPageDetector.js.map +1 -1
- package/dist/components/CustomCheckbox/index.d.ts +1 -1
- package/dist/components/CustomCheckbox/index.d.ts.map +1 -1
- package/dist/components/CustomCheckbox/index.js +4 -3
- package/dist/components/CustomCheckbox/index.js.map +1 -1
- package/dist/components/LineItemAttributes/index.d.ts +7 -0
- package/dist/components/LineItemAttributes/index.d.ts.map +1 -0
- package/dist/components/LineItemAttributes/index.js +24 -0
- package/dist/components/LineItemAttributes/index.js.map +1 -0
- package/dist/components/LineItemProductInfo/index.d.ts +14 -0
- package/dist/components/LineItemProductInfo/index.d.ts.map +1 -0
- package/dist/components/LineItemProductInfo/index.js +24 -0
- package/dist/components/LineItemProductInfo/index.js.map +1 -0
- package/dist/components/TotalCheckout/index.js +1 -1
- package/dist/components/TotalCheckout/index.js.map +1 -1
- package/dist/components/WarningMessageForPopup/index.js +3 -3
- package/dist/components/WarningMessageForPopup/index.js.map +1 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +11 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/account/AccountSettingsTemplate/AccountInfo/index.js +1 -1
- package/dist/modules/account/AccountSettingsTemplate/AccountInfo/index.js.map +1 -1
- package/dist/modules/account/AccountSettingsTemplate/AccountPassword/index.js +1 -1
- package/dist/modules/account/AccountSettingsTemplate/AccountPassword/index.js.map +1 -1
- package/dist/modules/account/AccountSettingsTemplate/Subscription/index.js +1 -1
- package/dist/modules/account/AccountSettingsTemplate/Subscription/index.js.map +1 -1
- package/dist/modules/address/AddressForm/index.d.ts.map +1 -1
- package/dist/modules/address/AddressForm/index.js +14 -11
- package/dist/modules/address/AddressForm/index.js.map +1 -1
- package/dist/modules/address/AddressForm/style.d.ts.map +1 -1
- package/dist/modules/address/AddressForm/style.js +71 -0
- package/dist/modules/address/AddressForm/style.js.map +1 -1
- package/dist/modules/address/AddressProvider.d.ts +2 -1
- package/dist/modules/address/AddressProvider.d.ts.map +1 -1
- package/dist/modules/address/AddressProvider.js +3 -2
- package/dist/modules/address/AddressProvider.js.map +1 -1
- package/dist/modules/address/SelectAddressPopup/index.js +1 -1
- package/dist/modules/address/SelectAddressPopup/index.js.map +1 -1
- package/dist/modules/address/ShippingBillingInfo/index.d.ts.map +1 -1
- package/dist/modules/address/ShippingBillingInfo/index.js +4 -33
- package/dist/modules/address/ShippingBillingInfo/index.js.map +1 -1
- package/dist/modules/auth/ForgotPasswordTemplate/index.js +1 -1
- package/dist/modules/auth/ForgotPasswordTemplate/index.js.map +1 -1
- package/dist/modules/auth/ResetPasswordTemplate/index.js +2 -2
- package/dist/modules/auth/ResetPasswordTemplate/index.js.map +1 -1
- package/dist/modules/auth/SignInTemplate/index.js +2 -2
- package/dist/modules/auth/SignInTemplate/index.js.map +1 -1
- package/dist/modules/auth/SignUpTemplate/index.d.ts.map +1 -1
- package/dist/modules/auth/SignUpTemplate/index.js +5 -5
- package/dist/modules/auth/SignUpTemplate/index.js.map +1 -1
- package/dist/modules/auth/SignUpTemplate/style.d.ts.map +1 -1
- package/dist/modules/auth/SignUpTemplate/style.js +6 -0
- package/dist/modules/auth/SignUpTemplate/style.js.map +1 -1
- package/dist/modules/auth/VerifyEmailAddressTemplate/index.js +1 -1
- package/dist/modules/auth/VerifyEmailAddressTemplate/index.js.map +1 -1
- package/dist/modules/cart/CartModificationWarningPopup/index.d.ts +6 -0
- package/dist/modules/cart/CartModificationWarningPopup/index.d.ts.map +1 -0
- package/dist/modules/cart/CartModificationWarningPopup/index.js +17 -0
- package/dist/modules/cart/CartModificationWarningPopup/index.js.map +1 -0
- package/dist/modules/cart/CartModificationWarningPopup/style.d.ts +3 -0
- package/dist/modules/cart/CartModificationWarningPopup/style.d.ts.map +1 -0
- package/dist/modules/cart/CartModificationWarningPopup/style.js +77 -0
- package/dist/modules/cart/CartModificationWarningPopup/style.js.map +1 -0
- package/dist/modules/cart/CartTemplate/index.d.ts +2 -1
- package/dist/modules/cart/CartTemplate/index.d.ts.map +1 -1
- package/dist/modules/cart/CartTemplate/index.js +2 -2
- package/dist/modules/cart/CartTemplate/index.js.map +1 -1
- package/dist/modules/cart/EmptyCart/index.d.ts.map +1 -1
- package/dist/modules/cart/EmptyCart/index.js +7 -3
- package/dist/modules/cart/EmptyCart/index.js.map +1 -1
- package/dist/modules/cart/components/CartItems/Item/EditButton.d.ts.map +1 -1
- package/dist/modules/cart/components/CartItems/Item/EditButton.js +0 -1
- package/dist/modules/cart/components/CartItems/Item/EditButton.js.map +1 -1
- package/dist/modules/cart/components/CartItems/Item/ItemActions.d.ts.map +1 -1
- package/dist/modules/cart/components/CartItems/Item/ItemActions.js +0 -1
- package/dist/modules/cart/components/CartItems/Item/ItemActions.js.map +1 -1
- package/dist/modules/cart/components/CartItems/Item/ItemAttributes.d.ts +3 -1
- package/dist/modules/cart/components/CartItems/Item/ItemAttributes.d.ts.map +1 -1
- package/dist/modules/cart/components/CartItems/Item/ItemAttributes.js +11 -34
- package/dist/modules/cart/components/CartItems/Item/ItemAttributes.js.map +1 -1
- package/dist/modules/cart/components/CartItems/Item/ItemImage.d.ts.map +1 -1
- package/dist/modules/cart/components/CartItems/Item/ItemImage.js +0 -1
- package/dist/modules/cart/components/CartItems/Item/ItemImage.js.map +1 -1
- package/dist/modules/cart/components/CartItems/Item/QuantitySelector.d.ts.map +1 -1
- package/dist/modules/cart/components/CartItems/Item/QuantitySelector.js +3 -12
- package/dist/modules/cart/components/CartItems/Item/QuantitySelector.js.map +1 -1
- package/dist/modules/cart/components/CartItems/Item/index.d.ts.map +1 -1
- package/dist/modules/cart/components/CartItems/Item/index.js +2 -5
- package/dist/modules/cart/components/CartItems/Item/index.js.map +1 -1
- package/dist/modules/cart/components/CartItems/ItemMobile/MobileItemActions.d.ts.map +1 -1
- package/dist/modules/cart/components/CartItems/ItemMobile/MobileItemActions.js +0 -1
- package/dist/modules/cart/components/CartItems/ItemMobile/MobileItemActions.js.map +1 -1
- package/dist/modules/cart/components/CartItems/ItemMobile/MobileItemAttributes.d.ts +3 -1
- package/dist/modules/cart/components/CartItems/ItemMobile/MobileItemAttributes.d.ts.map +1 -1
- package/dist/modules/cart/components/CartItems/ItemMobile/MobileItemAttributes.js +11 -34
- package/dist/modules/cart/components/CartItems/ItemMobile/MobileItemAttributes.js.map +1 -1
- package/dist/modules/cart/components/CartItems/ItemMobile/MobileItemImage.d.ts.map +1 -1
- package/dist/modules/cart/components/CartItems/ItemMobile/MobileItemImage.js +0 -1
- package/dist/modules/cart/components/CartItems/ItemMobile/MobileItemImage.js.map +1 -1
- package/dist/modules/cart/components/CartItems/ItemMobile/MobileItemQuantity.d.ts.map +1 -1
- package/dist/modules/cart/components/CartItems/ItemMobile/MobileItemQuantity.js +3 -12
- package/dist/modules/cart/components/CartItems/ItemMobile/MobileItemQuantity.js.map +1 -1
- package/dist/modules/cart/components/CartItems/ItemMobile/index.d.ts.map +1 -1
- package/dist/modules/cart/components/CartItems/ItemMobile/index.js +2 -5
- package/dist/modules/cart/components/CartItems/ItemMobile/index.js.map +1 -1
- package/dist/modules/cart/components/CartItems/index.d.ts.map +1 -1
- package/dist/modules/cart/components/CartItems/index.js +0 -1
- package/dist/modules/cart/components/CartItems/index.js.map +1 -1
- package/dist/modules/cart/components/CartItems/style.d.ts.map +1 -1
- package/dist/modules/cart/components/CartItems/style.js +6 -3
- package/dist/modules/cart/components/CartItems/style.js.map +1 -1
- package/dist/modules/cart/components/CartItems/util.d.ts.map +1 -1
- package/dist/modules/cart/components/CartItems/util.js +1 -2
- package/dist/modules/cart/components/CartItems/util.js.map +1 -1
- package/dist/modules/cart/index.d.ts +1 -0
- package/dist/modules/cart/index.d.ts.map +1 -1
- package/dist/modules/cart/index.js +1 -0
- package/dist/modules/cart/index.js.map +1 -1
- package/dist/modules/checkout/CheckoutTemplate/StepReview/index.d.ts.map +1 -1
- package/dist/modules/checkout/CheckoutTemplate/StepReview/index.js +2 -6
- package/dist/modules/checkout/CheckoutTemplate/StepReview/index.js.map +1 -1
- package/dist/modules/checkout/CheckoutTemplate/index.d.ts +2 -1
- package/dist/modules/checkout/CheckoutTemplate/index.d.ts.map +1 -1
- package/dist/modules/checkout/CheckoutTemplate/index.js +12 -6
- package/dist/modules/checkout/CheckoutTemplate/index.js.map +1 -1
- package/dist/modules/checkout/CheckoutTemplate/style.d.ts.map +1 -1
- package/dist/modules/checkout/CheckoutTemplate/style.js +6 -1
- package/dist/modules/checkout/CheckoutTemplate/style.js.map +1 -1
- package/dist/modules/checkout/PaymentFailedTemplate/index.d.ts.map +1 -1
- package/dist/modules/checkout/PaymentFailedTemplate/index.js +3 -0
- package/dist/modules/checkout/PaymentFailedTemplate/index.js.map +1 -1
- package/dist/modules/checkout/ThankYouTemplate/index.d.ts.map +1 -1
- package/dist/modules/checkout/ThankYouTemplate/index.js +3 -0
- package/dist/modules/checkout/ThankYouTemplate/index.js.map +1 -1
- package/dist/modules/delivery/DeliveryOptions/index.d.ts.map +1 -1
- package/dist/modules/delivery/DeliveryOptions/index.js +11 -212
- package/dist/modules/delivery/DeliveryOptions/index.js.map +1 -1
- package/dist/modules/index.d.ts +1 -1
- package/dist/modules/index.js +1 -1
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/order/OrderDetails/index.d.ts.map +1 -1
- package/dist/modules/order/OrderDetails/index.js +0 -1
- package/dist/modules/order/OrderDetails/index.js.map +1 -1
- package/dist/modules/order/OrderIndividualTemplate/index.d.ts.map +1 -1
- package/dist/modules/order/OrderIndividualTemplate/index.js +2 -10
- package/dist/modules/order/OrderIndividualTemplate/index.js.map +1 -1
- package/dist/modules/order/OrderedItems/Item/index.d.ts.map +1 -1
- package/dist/modules/order/OrderedItems/Item/index.js +2 -30
- package/dist/modules/order/OrderedItems/Item/index.js.map +1 -1
- package/dist/modules/order/OrderedItems/ItemMobile/index.d.ts.map +1 -1
- package/dist/modules/order/OrderedItems/ItemMobile/index.js +2 -28
- package/dist/modules/order/OrderedItems/ItemMobile/index.js.map +1 -1
- package/dist/modules/order/OrderedItems/Review/Popup/style.js +1 -1
- package/dist/modules/order/OrderedItems/Review/index.js +1 -1
- package/dist/modules/order/OrderedItems/Review/index.js.map +1 -1
- package/dist/modules/order/OrderedItems/index.d.ts.map +1 -1
- package/dist/modules/order/OrderedItems/index.js +0 -1
- package/dist/modules/order/OrderedItems/index.js.map +1 -1
- package/dist/modules/order/OrderedItems/style.d.ts.map +1 -1
- package/dist/modules/order/OrderedItems/style.js +8 -3
- package/dist/modules/order/OrderedItems/style.js.map +1 -1
- package/dist/modules/order/OrdersList/Item/index.d.ts.map +1 -1
- package/dist/modules/order/OrdersList/Item/index.js +0 -1
- package/dist/modules/order/OrdersList/Item/index.js.map +1 -1
- package/dist/modules/order/OrdersList/ItemMobile/index.d.ts.map +1 -1
- package/dist/modules/order/OrdersList/ItemMobile/index.js +0 -1
- package/dist/modules/order/OrdersList/ItemMobile/index.js.map +1 -1
- package/dist/modules/order/OrdersList/index.d.ts.map +1 -1
- package/dist/modules/order/OrdersList/index.js +0 -1
- package/dist/modules/order/OrdersList/index.js.map +1 -1
- package/dist/modules/order/OrdersList/style.d.ts.map +1 -1
- package/dist/modules/order/OrdersList/style.js +0 -1
- package/dist/modules/order/OrdersList/style.js.map +1 -1
- package/dist/modules/payment/PaymentMethodIcon/index.d.ts +8 -0
- package/dist/modules/payment/PaymentMethodIcon/index.d.ts.map +1 -0
- package/dist/modules/payment/PaymentMethodIcon/index.js +17 -0
- package/dist/modules/payment/PaymentMethodIcon/index.js.map +1 -0
- package/dist/modules/payment/PaymentMethodIcon/style.d.ts +3 -0
- package/dist/modules/payment/PaymentMethodIcon/style.d.ts.map +1 -0
- package/dist/modules/payment/PaymentMethodIcon/style.js +25 -0
- package/dist/modules/payment/PaymentMethodIcon/style.js.map +1 -0
- package/dist/modules/payment/PaymentMethodItem/index.d.ts.map +1 -1
- package/dist/modules/payment/PaymentMethodItem/index.js +2 -13
- package/dist/modules/payment/PaymentMethodItem/index.js.map +1 -1
- package/dist/modules/payment/SelectPaymentMethodPopup/index.js +1 -1
- package/dist/modules/payment/SelectPaymentMethodPopup/index.js.map +1 -1
- package/dist/modules/payment/icons.d.ts +2 -0
- package/dist/modules/payment/icons.d.ts.map +1 -1
- package/dist/modules/payment/icons.js +35 -27
- package/dist/modules/payment/icons.js.map +1 -1
- package/dist/modules/payment/index.d.ts +1 -0
- package/dist/modules/payment/index.d.ts.map +1 -1
- package/dist/modules/payment/index.js +1 -0
- package/dist/modules/payment/index.js.map +1 -1
- package/dist/modules/payment/paymentIconMap.d.ts +12 -0
- package/dist/modules/payment/paymentIconMap.d.ts.map +1 -0
- package/dist/modules/payment/paymentIconMap.js +31 -0
- package/dist/modules/payment/paymentIconMap.js.map +1 -0
- package/dist/modules/unsubscribe/UnsubscribeMessage.js +1 -1
- package/dist/modules/unsubscribe/UnsubscribeMessage.js.map +1 -1
- package/dist/modules/unsubscribe/UnsubscribeTemplate.js +1 -1
- package/dist/modules/unsubscribe/UnsubscribeTemplate.js.map +1 -1
- package/dist/server.d.ts +6 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +5 -0
- package/dist/server.js.map +1 -0
- package/dist/stores/orderStore.d.ts.map +1 -1
- package/dist/stores/orderStore.js.map +1 -1
- package/dist/styles/theme.d.ts.map +1 -1
- package/dist/styles/theme.js +5 -0
- package/dist/styles/theme.js.map +1 -1
- package/dist/styles/variables.d.ts.map +1 -1
- package/dist/styles/variables.js +4 -0
- package/dist/styles/variables.js.map +1 -1
- package/dist/translations/en.d.ts +20 -7
- package/dist/translations/en.d.ts.map +1 -1
- package/dist/translations/en.js +21 -8
- package/dist/translations/en.js.map +1 -1
- package/dist/translations/hy.d.ts +2 -7
- package/dist/translations/hy.d.ts.map +1 -1
- package/dist/translations/hy.js +3 -8
- package/dist/translations/hy.js.map +1 -1
- package/dist/translations/index.d.ts +26 -28
- package/dist/translations/index.d.ts.map +1 -1
- package/dist/translations/it.d.ts +2 -7
- package/dist/translations/it.d.ts.map +1 -1
- package/dist/translations/it.js +3 -8
- package/dist/translations/it.js.map +1 -1
- package/dist/translations/ru.d.ts +2 -7
- package/dist/translations/ru.d.ts.map +1 -1
- package/dist/translations/ru.js +3 -8
- package/dist/translations/ru.js.map +1 -1
- package/dist/user/UserProvider.d.ts +6 -0
- package/dist/user/UserProvider.d.ts.map +1 -0
- package/dist/user/UserProvider.js +128 -0
- package/dist/user/UserProvider.js.map +1 -0
- package/dist/user/checkUserRedirection.d.ts +21 -0
- package/dist/user/checkUserRedirection.d.ts.map +1 -0
- package/dist/user/checkUserRedirection.js +62 -0
- package/dist/user/checkUserRedirection.js.map +1 -0
- package/dist/user/createUserMethods.d.ts +21 -0
- package/dist/user/createUserMethods.d.ts.map +1 -0
- package/dist/user/createUserMethods.js +162 -0
- package/dist/user/createUserMethods.js.map +1 -0
- package/dist/user/getUser.d.ts +14 -0
- package/dist/user/getUser.d.ts.map +1 -0
- package/dist/user/getUser.js +60 -0
- package/dist/user/getUser.js.map +1 -0
- package/dist/user/index.d.ts +6 -0
- package/dist/user/index.d.ts.map +1 -0
- package/dist/user/index.js +6 -0
- package/dist/user/index.js.map +1 -0
- package/dist/user/langPath.d.ts +3 -0
- package/dist/user/langPath.d.ts.map +1 -0
- package/dist/user/langPath.js +23 -0
- package/dist/user/langPath.js.map +1 -0
- package/dist/user/types.d.ts +139 -0
- package/dist/user/types.d.ts.map +1 -0
- package/dist/user/types.js +2 -0
- package/dist/user/types.js.map +1 -0
- package/dist/user/userConfig.d.ts +23 -0
- package/dist/user/userConfig.d.ts.map +1 -0
- package/dist/user/userConfig.js +24 -0
- package/dist/user/userConfig.js.map +1 -0
- package/dist/utils/buttonClassNames.d.ts +9 -0
- package/dist/utils/buttonClassNames.d.ts.map +1 -0
- package/dist/utils/buttonClassNames.js +10 -0
- package/dist/utils/buttonClassNames.js.map +1 -0
- package/dist/utils/buttonTypes.d.ts +12 -0
- package/dist/utils/buttonTypes.d.ts.map +1 -0
- package/dist/utils/buttonTypes.js +18 -0
- package/dist/utils/buttonTypes.js.map +1 -0
- package/dist/utils/config.d.ts +14 -7
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +35 -5
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/createAccountButtonEntry.d.ts +5 -0
- package/dist/utils/createAccountButtonEntry.d.ts.map +1 -0
- package/dist/utils/createAccountButtonEntry.js +33 -0
- package/dist/utils/createAccountButtonEntry.js.map +1 -0
- package/dist/utils/lineItemDisplay.d.ts +11 -0
- package/dist/utils/lineItemDisplay.d.ts.map +1 -0
- package/dist/utils/lineItemDisplay.js +165 -0
- package/dist/utils/lineItemDisplay.js.map +1 -0
- package/dist/utils/payment.d.ts +56 -11
- package/dist/utils/payment.d.ts.map +1 -1
- package/dist/utils/payment.js +43 -5
- package/dist/utils/payment.js.map +1 -1
- package/package.json +30 -7
- package/templates/README.md +41 -0
- package/templates/account.config.example.ts +77 -0
- package/templates/address.config.example.ts +55 -0
- package/templates/index.example.ts +24 -0
- package/templates/integrations.config.example.ts +28 -0
- package/templates/routes.config.example.ts +56 -0
- package/templates/user.config.example.ts +45 -0
package/package.json
CHANGED
|
@@ -1,28 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weareconceptstudio/account",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.14",
|
|
4
4
|
"description": "Concept Studio Account",
|
|
5
5
|
"author": "Concept Studio",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
|
-
"sideEffects":
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"**/AccountProvider.js",
|
|
10
|
+
"**/user/UserProvider.js"
|
|
11
|
+
],
|
|
12
|
+
"bin": {
|
|
13
|
+
"account-init": "./cli/init-config.js"
|
|
14
|
+
},
|
|
9
15
|
"files": [
|
|
10
|
-
"dist"
|
|
16
|
+
"dist",
|
|
17
|
+
"cli",
|
|
18
|
+
"templates"
|
|
11
19
|
],
|
|
12
20
|
"exports": {
|
|
13
21
|
".": {
|
|
14
22
|
"types": "./dist/index.d.ts",
|
|
15
23
|
"default": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./config": {
|
|
26
|
+
"types": "./dist/config.d.ts",
|
|
27
|
+
"default": "./dist/config.js"
|
|
28
|
+
},
|
|
29
|
+
"./server": {
|
|
30
|
+
"types": "./dist/server.d.ts",
|
|
31
|
+
"default": "./dist/server.js"
|
|
32
|
+
},
|
|
33
|
+
"./user": {
|
|
34
|
+
"types": "./dist/user/index.d.ts",
|
|
35
|
+
"default": "./dist/user/index.js"
|
|
16
36
|
}
|
|
17
37
|
},
|
|
18
38
|
"scripts": {
|
|
19
39
|
"build": "tsc -m es6",
|
|
20
|
-
"watch": "tsc -m es6 --watch"
|
|
40
|
+
"watch": "tsc -m es6 --watch",
|
|
41
|
+
"init-config": "node ./cli/init-config.js",
|
|
42
|
+
"test:user-integration": "npm run build && node ./cli/test-user-integration.mjs",
|
|
43
|
+
"postinstall": "node ./cli/postinstall.js"
|
|
21
44
|
},
|
|
22
45
|
"dependencies": {
|
|
23
|
-
"@weareconceptstudio/cart": "^0.0.
|
|
24
|
-
"@weareconceptstudio/core": "^0.4.
|
|
25
|
-
"@weareconceptstudio/form": "^0.5.
|
|
46
|
+
"@weareconceptstudio/cart": "^0.0.19",
|
|
47
|
+
"@weareconceptstudio/core": "^0.4.14",
|
|
48
|
+
"@weareconceptstudio/form": "^0.5.13",
|
|
26
49
|
"react-helmet": "6.1.0",
|
|
27
50
|
"payment": "2.4.6"
|
|
28
51
|
},
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Account package config examples
|
|
2
|
+
|
|
3
|
+
Generated by `npx account-init` from `@weareconceptstudio/account`.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
| File | Purpose |
|
|
8
|
+
|------|---------|
|
|
9
|
+
| `routes.config.ts` | Auth + private customer routes |
|
|
10
|
+
| `integrations.config.ts` | API endpoints (account, cart, checkout, order) |
|
|
11
|
+
| `user.config.ts` | `UserProvider` props (`userIntegration`, hooks) |
|
|
12
|
+
| `account.config.ts` | `AccountProvider` overrides (`globalSettings`, cart, checkout, …) |
|
|
13
|
+
| `address.config.ts` | Address form field definitions |
|
|
14
|
+
| `index.ts` | Barrel export |
|
|
15
|
+
|
|
16
|
+
## Layout usage (Next.js)
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { AccountProvider, UserProvider, useUser } from '@weareconceptstudio/account';
|
|
20
|
+
import { accountProviderConfig } from '@/config/account/account.config';
|
|
21
|
+
import { userProviderConfig } from '@/config/account/user.config';
|
|
22
|
+
import { integrationsConfig } from '@/config/account/integrations.config';
|
|
23
|
+
|
|
24
|
+
<UserProvider {...userProviderConfig} initialUser={userData.newState}>
|
|
25
|
+
<AccountProvider
|
|
26
|
+
{...accountProviderConfig}
|
|
27
|
+
useUser={useUser}
|
|
28
|
+
orderIntegration={integrationsConfig.order}
|
|
29
|
+
/>
|
|
30
|
+
</UserProvider>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Custom user methods (e.g. `toggleSubscribe`)
|
|
34
|
+
|
|
35
|
+
Define in a client component wrapper or pass `createMethods` when supported — methods that call `setState` cannot live in static config files.
|
|
36
|
+
|
|
37
|
+
## Re-run
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx account-init --out src/config/account --all --force
|
|
41
|
+
```
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AccountProvider overrides — merged with package defaults in @weareconceptstudio/account.
|
|
3
|
+
*
|
|
4
|
+
* Import createAccountButtonEntry from '@weareconceptstudio/account/config'
|
|
5
|
+
* and pass your project Button component in layout or here.
|
|
6
|
+
*/
|
|
7
|
+
import type { UserIntegrationConfig } from '@weareconceptstudio/account';
|
|
8
|
+
|
|
9
|
+
export const accountProviderConfig = {
|
|
10
|
+
currency: 'USD',
|
|
11
|
+
fontFamily: 'core_Font',
|
|
12
|
+
shopUrl: '/',
|
|
13
|
+
productUrlPrefix: '/products/',
|
|
14
|
+
|
|
15
|
+
auth: {
|
|
16
|
+
social: {
|
|
17
|
+
google: true,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
globalSettings: {
|
|
22
|
+
hasShippingCost: true,
|
|
23
|
+
hasAddresses: true,
|
|
24
|
+
hasAddressType: false,
|
|
25
|
+
supportsGuestCart: true,
|
|
26
|
+
allowGuestCheckout: true,
|
|
27
|
+
hasBalanceSystem: false,
|
|
28
|
+
hasVoucherSystem: false,
|
|
29
|
+
hasPromoCodeSystem: false,
|
|
30
|
+
hasGiftSystem: false,
|
|
31
|
+
hasUtensilsSystem: false,
|
|
32
|
+
hasFreeShippingSystem: false,
|
|
33
|
+
hasCommentSystem: false,
|
|
34
|
+
hasSubscriptionSystem: false,
|
|
35
|
+
hasSubtotal: true,
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
order: {
|
|
39
|
+
hasReorder: true,
|
|
40
|
+
hasReview: true,
|
|
41
|
+
hasQty: true,
|
|
42
|
+
hasSubtotal: true,
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
cart: {
|
|
46
|
+
showShopLinks: true,
|
|
47
|
+
item: {
|
|
48
|
+
edit: { item: false, list: false, mode: 'url' as const },
|
|
49
|
+
remove: true,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
checkout: {
|
|
54
|
+
abandonPaymentEndpoint: null,
|
|
55
|
+
hideInternalPayment: false,
|
|
56
|
+
paymentPlacement: 'review' as const,
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
/** Same shape as UserProvider userIntegration — optional duplicate for reference */
|
|
60
|
+
userIntegration: null as UserIntegrationConfig | null,
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* button: {
|
|
64
|
+
* auth: createAccountButtonEntry(Button, 'auth', { btnType: 'primary' }),
|
|
65
|
+
* form: createAccountButtonEntry(Button, 'form', { btnType: 'primary' }),
|
|
66
|
+
* checkout: createAccountButtonEntry(Button, 'checkout', { btnType: 'primary' }),
|
|
67
|
+
* },
|
|
68
|
+
*/
|
|
69
|
+
button: {},
|
|
70
|
+
|
|
71
|
+
/** import { addressFormFields } from './address.config' */
|
|
72
|
+
addressFormFields: null,
|
|
73
|
+
addressFormFieldsShipping: null,
|
|
74
|
+
addressFormFieldsBilling: null,
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export type AccountProviderConfig = typeof accountProviderConfig;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormBuilder field configs for AddressProvider / account address screens.
|
|
3
|
+
* Pass to AccountProvider as addressFormFields (and optionally shipping/billing variants).
|
|
4
|
+
*
|
|
5
|
+
* @see https://github.com/weareconceptstudio/cs-dev-hub — form package field schema
|
|
6
|
+
*/
|
|
7
|
+
export const addressFormFields = [
|
|
8
|
+
{
|
|
9
|
+
fieldType: 'input',
|
|
10
|
+
labelProps: {
|
|
11
|
+
label: 'account.address_management.firstName',
|
|
12
|
+
name: 'first_name',
|
|
13
|
+
},
|
|
14
|
+
fieldProps: {
|
|
15
|
+
placeholder: 'account.address_management.firstNamePlaceholder',
|
|
16
|
+
},
|
|
17
|
+
rules: [{ required: true }],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
fieldType: 'input',
|
|
21
|
+
labelProps: {
|
|
22
|
+
label: 'account.address_management.lastName',
|
|
23
|
+
name: 'last_name',
|
|
24
|
+
},
|
|
25
|
+
fieldProps: {
|
|
26
|
+
placeholder: 'account.address_management.lastNamePlaceholder',
|
|
27
|
+
},
|
|
28
|
+
rules: [{ required: true }],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
fieldType: 'input',
|
|
32
|
+
labelProps: {
|
|
33
|
+
label: 'account.address_management.phone',
|
|
34
|
+
name: 'phone',
|
|
35
|
+
},
|
|
36
|
+
fieldProps: {
|
|
37
|
+
placeholder: 'account.address_management.phonePlaceholder',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
fieldType: 'input',
|
|
42
|
+
labelProps: {
|
|
43
|
+
label: 'account.address_management.address',
|
|
44
|
+
name: 'address',
|
|
45
|
+
},
|
|
46
|
+
fieldProps: {
|
|
47
|
+
placeholder: 'account.address_management.addressPlaceholder',
|
|
48
|
+
},
|
|
49
|
+
rules: [{ required: true }],
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
/** Use when shipping and billing need different fields */
|
|
54
|
+
export const addressFormFieldsShipping = null;
|
|
55
|
+
export const addressFormFieldsBilling = null;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Barrel file — re-export account config modules for your app.
|
|
3
|
+
* Generated by: npx account-init
|
|
4
|
+
*/
|
|
5
|
+
export { routesConfig } from './routes.config';
|
|
6
|
+
export { integrationsConfig } from './integrations.config';
|
|
7
|
+
export { userProviderConfig } from './user.config';
|
|
8
|
+
export { accountProviderConfig } from './account.config';
|
|
9
|
+
export {
|
|
10
|
+
addressFormFields,
|
|
11
|
+
addressFormFieldsShipping,
|
|
12
|
+
addressFormFieldsBilling,
|
|
13
|
+
} from './address.config';
|
|
14
|
+
|
|
15
|
+
import { routesConfig } from './routes.config';
|
|
16
|
+
import { integrationsConfig } from './integrations.config';
|
|
17
|
+
|
|
18
|
+
/** Full app config shape — extend with your site-specific routes */
|
|
19
|
+
const config = {
|
|
20
|
+
routes: routesConfig,
|
|
21
|
+
integrations: integrationsConfig,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default config;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API endpoint map for account, cart, checkout, and orders.
|
|
3
|
+
* Wire the same values into UserProvider userIntegration where applicable.
|
|
4
|
+
*/
|
|
5
|
+
export const integrationsConfig = {
|
|
6
|
+
account: {
|
|
7
|
+
currentUserEndpoint: 'current-user',
|
|
8
|
+
updateAccountEndpoint: 'update-account',
|
|
9
|
+
updatePasswordEndpoint: 'update-password',
|
|
10
|
+
logoutEndpoint: 'logout',
|
|
11
|
+
},
|
|
12
|
+
cart: {
|
|
13
|
+
getCartEndpoint: 'cart',
|
|
14
|
+
addItemEndpoint: 'toggle-cart-item',
|
|
15
|
+
removeItemEndpoint: 'delete-cart-item',
|
|
16
|
+
clearCartEndpoint: 'clear-cart',
|
|
17
|
+
},
|
|
18
|
+
checkout: {
|
|
19
|
+
checkoutEndpoint: 'checkout',
|
|
20
|
+
},
|
|
21
|
+
order: {
|
|
22
|
+
getOrdersEndpoint: 'orders',
|
|
23
|
+
getOrderEndpoint: 'orders',
|
|
24
|
+
reviewOrderEndpoint: 'order-review',
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type IntegrationsConfig = typeof integrationsConfig;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App routes used by UserProvider guards and account navigation.
|
|
3
|
+
* Copy to your project and adjust paths / private flags.
|
|
4
|
+
*/
|
|
5
|
+
export const routesConfig = {
|
|
6
|
+
home: {
|
|
7
|
+
path: '/',
|
|
8
|
+
name: 'pages.home.name',
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
// ======================== Auth ======================== //
|
|
12
|
+
signIn: {
|
|
13
|
+
path: '/sign-in/',
|
|
14
|
+
name: 'pages.signIn.name',
|
|
15
|
+
},
|
|
16
|
+
signUp: {
|
|
17
|
+
path: '/sign-up/',
|
|
18
|
+
name: 'pages.signUp.name',
|
|
19
|
+
},
|
|
20
|
+
forgotPassword: {
|
|
21
|
+
path: '/forgot-password/',
|
|
22
|
+
name: 'pages.forgotPassword.name',
|
|
23
|
+
},
|
|
24
|
+
resetPassword: {
|
|
25
|
+
path: '/reset-password/',
|
|
26
|
+
name: 'pages.resetPassword.name',
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
// ======================== Customer (private) ======================== //
|
|
30
|
+
account: {
|
|
31
|
+
path: '/account/',
|
|
32
|
+
name: 'account',
|
|
33
|
+
private: true,
|
|
34
|
+
},
|
|
35
|
+
accountAddresses: {
|
|
36
|
+
path: '/account/addresses/',
|
|
37
|
+
name: 'addresses',
|
|
38
|
+
private: true,
|
|
39
|
+
},
|
|
40
|
+
orderHistory: {
|
|
41
|
+
path: '/account/order-history/',
|
|
42
|
+
name: 'orderHistory',
|
|
43
|
+
private: true,
|
|
44
|
+
},
|
|
45
|
+
cart: {
|
|
46
|
+
path: '/cart/',
|
|
47
|
+
name: 'cart',
|
|
48
|
+
},
|
|
49
|
+
checkout: {
|
|
50
|
+
path: '/checkout/',
|
|
51
|
+
name: 'checkout',
|
|
52
|
+
private: true,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export type RoutesConfig = typeof routesConfig;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { UserIntegrationConfig, UserProviderHooks } from '@weareconceptstudio/account';
|
|
2
|
+
import { integrationsConfig } from './integrations.config';
|
|
3
|
+
import { routesConfig } from './routes.config';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Props for <UserProvider /> from @weareconceptstudio/account
|
|
7
|
+
*/
|
|
8
|
+
export const userProviderConfig = {
|
|
9
|
+
routes: routesConfig,
|
|
10
|
+
userIntegration: {
|
|
11
|
+
endpoints: {
|
|
12
|
+
login: 'login',
|
|
13
|
+
register: 'register',
|
|
14
|
+
logout: integrationsConfig.account.logoutEndpoint,
|
|
15
|
+
forgotPassword: 'forgot-password',
|
|
16
|
+
resetPassword: 'reset-password',
|
|
17
|
+
checkPasswordToken: 'check-password-token',
|
|
18
|
+
currentUser: integrationsConfig.account.currentUserEndpoint,
|
|
19
|
+
updateAccount: integrationsConfig.account.updateAccountEndpoint,
|
|
20
|
+
updatePassword: integrationsConfig.account.updatePasswordEndpoint,
|
|
21
|
+
},
|
|
22
|
+
cookieKey: 'accessToken',
|
|
23
|
+
postAuthRedirectRouteKey: 'account',
|
|
24
|
+
signOutRedirectRouteKey: 'home',
|
|
25
|
+
useFullPageReloadOnAuth: false,
|
|
26
|
+
defaultLocale: process.env.NEXT_PUBLIC_DEFAULT_LOCALE || 'en',
|
|
27
|
+
socialRedirectCookieKey: 'socialRedirectUrl',
|
|
28
|
+
} satisfies UserIntegrationConfig,
|
|
29
|
+
|
|
30
|
+
/** Optional project-specific auth hooks */
|
|
31
|
+
hooks: {
|
|
32
|
+
// formatPrevRoute: (pathname, lang) => `/${lang}${pathname}`,
|
|
33
|
+
// mapSignUpUser: (user, response) => user,
|
|
34
|
+
} satisfies UserProviderHooks,
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Optional extra methods (e.g. toggleSubscribe, custom API actions).
|
|
38
|
+
* For methods that need setState, use createMethods in layout — see README.
|
|
39
|
+
*/
|
|
40
|
+
methods: {},
|
|
41
|
+
|
|
42
|
+
methodOverrides: {},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export type UserProviderConfig = typeof userProviderConfig;
|