@frontastic/common 2.25.0 → 2.25.3
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/CHANGELOG.md +19 -0
- package/composer.json +1 -1
- package/docs/README.md +12 -0
- package/docs/php/AccountApiBundle/Domain/AccountApi/DummyAccountApi.md +290 -0
- package/docs/php/AccountApiBundle/Domain/DummyAccountApiFactory.md +25 -0
- package/docs/php/CartApiBundle/Domain/CartApi/DummyCartApi.md +116 -0
- package/docs/php/CartApiBundle/Domain/DummyCartApiFactory.md +25 -0
- package/docs/php/ContentApiBundle/Domain/ContentApi/DummyContentApi.md +66 -0
- package/docs/php/ContentApiBundle/Domain/DummyContentApiFactory.md +25 -0
- package/docs/php/ProductApiBundle/Domain/DummyProductApiFactory.md +40 -0
- package/docs/php/ProductApiBundle/Domain/ProductApi/DummyProductApi.md +34 -0
- package/docs/php/ProductSearchApiBundle/Domain/DummyProductSearchApiFactory.md +29 -0
- package/docs/php/ProductSearchApiBundle/Domain/ProductSearchApi/DummyProductSearchApi.md +19 -0
- package/docs/php/WishlistApiBundle/Domain/DummyWishlistApiFactory.md +25 -0
- package/docs/php/WishlistApiBundle/Domain/WishlistApi/DummyWishlistApi.md +165 -0
- package/package.json +1 -1
- package/src/js/configuration/schema.js +12 -0
- package/src/js/frontastic-common.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# common Changelog
|
|
2
2
|
|
|
3
|
+
## `2.25.3` (2022-03-02)
|
|
4
|
+
|
|
5
|
+
* fix(api-hub): replace content api with dummy for nextjs projects
|
|
6
|
+
* fix(api-hub): replace wishlist api with dummy for nextjs
|
|
7
|
+
* fix(api-hub): no repeating exception messages in dummy product api and product search api
|
|
8
|
+
* fix(api-hub): use dummy for cart api
|
|
9
|
+
* fix(api-hub): replace repeating exception with function in DummyAccountApi
|
|
10
|
+
* fix(api-hub): add dummy for AccountApi
|
|
11
|
+
* fix(api-hub): fix syntax and add parameter to factory config
|
|
12
|
+
|
|
13
|
+
## `2.25.2` (2022-02-15)
|
|
14
|
+
|
|
15
|
+
* fix(FP-775): Minor refactor, import of SprykerAddress
|
|
16
|
+
* fix(FP-755): Fix Spryker address
|
|
17
|
+
|
|
18
|
+
## `2.25.1` (2022-01-27)
|
|
19
|
+
|
|
20
|
+
* fix: if there's no filter chosen - the error reappears
|
|
21
|
+
|
|
3
22
|
## `2.25.0` (2022-01-24)
|
|
4
23
|
|
|
5
24
|
* fix(FP-838): improved error handling on parse locator for Shopware
|
package/composer.json
CHANGED
package/docs/README.md
CHANGED
|
@@ -22,6 +22,7 @@ Here you find the API documentation for the relevant classes:
|
|
|
22
22
|
* [AccountApi](php/AccountApiBundle/Domain/AccountApi.md)
|
|
23
23
|
* AccountApi
|
|
24
24
|
* [Commercetools](php/AccountApiBundle/Domain/AccountApi/Commercetools.md)
|
|
25
|
+
* [DummyAccountApi](php/AccountApiBundle/Domain/AccountApi/DummyAccountApi.md)
|
|
25
26
|
* [Exception](php/AccountApiBundle/Domain/AccountApi/Exception.md)
|
|
26
27
|
* [LifecycleEventDecorator](php/AccountApiBundle/Domain/AccountApi/LifecycleEventDecorator.md)
|
|
27
28
|
* [AccountApiFactory](php/AccountApiBundle/Domain/AccountApiFactory.md)
|
|
@@ -29,6 +30,7 @@ Here you find the API documentation for the relevant classes:
|
|
|
29
30
|
* [Address](php/AccountApiBundle/Domain/Address.md)
|
|
30
31
|
* [AuthentificationInformation](php/AccountApiBundle/Domain/AuthentificationInformation.md)
|
|
31
32
|
* [DefaultAccountApiFactory](php/AccountApiBundle/Domain/DefaultAccountApiFactory.md)
|
|
33
|
+
* [DummyAccountApiFactory](php/AccountApiBundle/Domain/DummyAccountApiFactory.md)
|
|
32
34
|
* [DuplicateAccountException](php/AccountApiBundle/Domain/DuplicateAccountException.md)
|
|
33
35
|
* [DuplicateAddressException](php/AccountApiBundle/Domain/DuplicateAddressException.md)
|
|
34
36
|
* [Group](php/AccountApiBundle/Domain/Group.md)
|
|
@@ -60,12 +62,14 @@ Here you find the API documentation for the relevant classes:
|
|
|
60
62
|
* [CartApi](php/CartApiBundle/Domain/CartApi.md)
|
|
61
63
|
* CartApi
|
|
62
64
|
* [Commercetools](php/CartApiBundle/Domain/CartApi/Commercetools.md)
|
|
65
|
+
* [DummyCartApi](php/CartApiBundle/Domain/CartApi/DummyCartApi.md)
|
|
63
66
|
* [Exception](php/CartApiBundle/Domain/CartApi/Exception.md)
|
|
64
67
|
* [LifecycleEventDecorator](php/CartApiBundle/Domain/CartApi/LifecycleEventDecorator.md)
|
|
65
68
|
* [CartApiBase](php/CartApiBundle/Domain/CartApiBase.md)
|
|
66
69
|
* [CartApiFactory](php/CartApiBundle/Domain/CartApiFactory.md)
|
|
67
70
|
* [DefaultCartApiFactory](php/CartApiBundle/Domain/DefaultCartApiFactory.md)
|
|
68
71
|
* [Discount](php/CartApiBundle/Domain/Discount.md)
|
|
72
|
+
* [DummyCartApiFactory](php/CartApiBundle/Domain/DummyCartApiFactory.md)
|
|
69
73
|
* [LineItem](php/CartApiBundle/Domain/LineItem.md)
|
|
70
74
|
* LineItem
|
|
71
75
|
* [Variant](php/CartApiBundle/Domain/LineItem/Variant.md)
|
|
@@ -98,6 +102,7 @@ Here you find the API documentation for the relevant classes:
|
|
|
98
102
|
* [CachingContentApi](php/ContentApiBundle/Domain/ContentApi/CachingContentApi.md)
|
|
99
103
|
* [Content](php/ContentApiBundle/Domain/ContentApi/Content.md)
|
|
100
104
|
* [Contentful](php/ContentApiBundle/Domain/ContentApi/Contentful.md)
|
|
105
|
+
* [DummyContentApi](php/ContentApiBundle/Domain/ContentApi/DummyContentApi.md)
|
|
101
106
|
* [Exception](php/ContentApiBundle/Domain/ContentApi/Exception.md)
|
|
102
107
|
* [GraphCMS](php/ContentApiBundle/Domain/ContentApi/GraphCMS.md)
|
|
103
108
|
* [LifecycleEventDecorator](php/ContentApiBundle/Domain/ContentApi/LifecycleEventDecorator.md)
|
|
@@ -105,6 +110,7 @@ Here you find the API documentation for the relevant classes:
|
|
|
105
110
|
* [ContentQueryFactory](php/ContentApiBundle/Domain/ContentQueryFactory.md)
|
|
106
111
|
* [ContentType](php/ContentApiBundle/Domain/ContentType.md)
|
|
107
112
|
* [DefaultContentApiFactory](php/ContentApiBundle/Domain/DefaultContentApiFactory.md)
|
|
113
|
+
* [DummyContentApiFactory](php/ContentApiBundle/Domain/DummyContentApiFactory.md)
|
|
108
114
|
* [Query](php/ContentApiBundle/Domain/Query.md)
|
|
109
115
|
* [Result](php/ContentApiBundle/Domain/Result.md)
|
|
110
116
|
* [FrontasticCommonContentApiBundle](php/ContentApiBundle/FrontasticCommonContentApiBundle.md)
|
|
@@ -196,10 +202,12 @@ Here you find the API documentation for the relevant classes:
|
|
|
196
202
|
* Domain
|
|
197
203
|
* [Category](php/ProductApiBundle/Domain/Category.md)
|
|
198
204
|
* [DefaultProductApiFactory](php/ProductApiBundle/Domain/DefaultProductApiFactory.md)
|
|
205
|
+
* [DummyProductApiFactory](php/ProductApiBundle/Domain/DummyProductApiFactory.md)
|
|
199
206
|
* [Product](php/ProductApiBundle/Domain/Product.md)
|
|
200
207
|
* [ProductApi](php/ProductApiBundle/Domain/ProductApi.md)
|
|
201
208
|
* ProductApi
|
|
202
209
|
* [Commercetools](php/ProductApiBundle/Domain/ProductApi/Commercetools.md)
|
|
210
|
+
* [DummyProductApi](php/ProductApiBundle/Domain/ProductApi/DummyProductApi.md)
|
|
203
211
|
* [EmptyEnabledFacetService](php/ProductApiBundle/Domain/ProductApi/EmptyEnabledFacetService.md)
|
|
204
212
|
* [EnabledFacetService](php/ProductApiBundle/Domain/ProductApi/EnabledFacetService.md)
|
|
205
213
|
* [Exception](php/ProductApiBundle/Domain/ProductApi/Exception.md)
|
|
@@ -221,12 +229,14 @@ Here you find the API documentation for the relevant classes:
|
|
|
221
229
|
* [FrontasticCommonProductSearchApiExtension](php/ProductSearchApiBundle/DependencyInjection/FrontasticCommonProductSearchApiExtension.md)
|
|
222
230
|
* Domain
|
|
223
231
|
* [DefaultProductSearchApiFactory](php/ProductSearchApiBundle/Domain/DefaultProductSearchApiFactory.md)
|
|
232
|
+
* [DummyProductSearchApiFactory](php/ProductSearchApiBundle/Domain/DummyProductSearchApiFactory.md)
|
|
224
233
|
* [LegacyLifecycleEventDecorator](php/ProductSearchApiBundle/Domain/LegacyLifecycleEventDecorator.md)
|
|
225
234
|
* [LifecycleEventDecorator](php/ProductSearchApiBundle/Domain/LifecycleEventDecorator.md)
|
|
226
235
|
* [NoopProductSearchApi](php/ProductSearchApiBundle/Domain/NoopProductSearchApi.md)
|
|
227
236
|
* [ProductSearchApi](php/ProductSearchApiBundle/Domain/ProductSearchApi.md)
|
|
228
237
|
* ProductSearchApi
|
|
229
238
|
* [Commercetools](php/ProductSearchApiBundle/Domain/ProductSearchApi/Commercetools.md)
|
|
239
|
+
* [DummyProductSearchApi](php/ProductSearchApiBundle/Domain/ProductSearchApi/DummyProductSearchApi.md)
|
|
230
240
|
* [ProductSearchApiBase](php/ProductSearchApiBundle/Domain/ProductSearchApiBase.md)
|
|
231
241
|
* [ProductSearchApiFactory](php/ProductSearchApiBundle/Domain/ProductSearchApiFactory.md)
|
|
232
242
|
* [FrontasticCommonProductSearchApiBundle](php/ProductSearchApiBundle/FrontasticCommonProductSearchApiBundle.md)
|
|
@@ -435,6 +445,7 @@ Here you find the API documentation for the relevant classes:
|
|
|
435
445
|
* [FrontasticCommonWishlistApiExtension](php/WishlistApiBundle/DependencyInjection/FrontasticCommonWishlistApiExtension.md)
|
|
436
446
|
* Domain
|
|
437
447
|
* [DefaultWishlistApiFactory](php/WishlistApiBundle/Domain/DefaultWishlistApiFactory.md)
|
|
448
|
+
* [DummyWishlistApiFactory](php/WishlistApiBundle/Domain/DummyWishlistApiFactory.md)
|
|
438
449
|
* [LineItem](php/WishlistApiBundle/Domain/LineItem.md)
|
|
439
450
|
* LineItem
|
|
440
451
|
* [Variant](php/WishlistApiBundle/Domain/LineItem/Variant.md)
|
|
@@ -442,6 +453,7 @@ Here you find the API documentation for the relevant classes:
|
|
|
442
453
|
* [WishlistApi](php/WishlistApiBundle/Domain/WishlistApi.md)
|
|
443
454
|
* WishlistApi
|
|
444
455
|
* [Commercetools](php/WishlistApiBundle/Domain/WishlistApi/Commercetools.md)
|
|
456
|
+
* [DummyWishlistApi](php/WishlistApiBundle/Domain/WishlistApi/DummyWishlistApi.md)
|
|
445
457
|
* [Exception](php/WishlistApiBundle/Domain/WishlistApi/Exception.md)
|
|
446
458
|
* [LifecycleEventDecorator](php/WishlistApiBundle/Domain/WishlistApi/LifecycleEventDecorator.md)
|
|
447
459
|
* [NoWishlistApi](php/WishlistApiBundle/Domain/WishlistApi/NoWishlistApi.md)
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
# DummyAccountApi
|
|
2
|
+
|
|
3
|
+
**Fully Qualified**: [`\Frontastic\Common\AccountApiBundle\Domain\AccountApi\DummyAccountApi`](../../../../../src/php/AccountApiBundle/Domain/AccountApi/DummyAccountApi.php)
|
|
4
|
+
|
|
5
|
+
**Implements**: [`AccountApi`](../AccountApi.md)
|
|
6
|
+
|
|
7
|
+
## Methods
|
|
8
|
+
|
|
9
|
+
* [getSalutations()](#getsalutations)
|
|
10
|
+
* [confirmEmail()](#confirmemail)
|
|
11
|
+
* [create()](#create)
|
|
12
|
+
* [update()](#update)
|
|
13
|
+
* [updatePassword()](#updatepassword)
|
|
14
|
+
* [generatePasswordResetToken()](#generatepasswordresettoken)
|
|
15
|
+
* [resetPassword()](#resetpassword)
|
|
16
|
+
* [login()](#login)
|
|
17
|
+
* [refreshAccount()](#refreshaccount)
|
|
18
|
+
* [getAddresses()](#getaddresses)
|
|
19
|
+
* [addAddress()](#addaddress)
|
|
20
|
+
* [updateAddress()](#updateaddress)
|
|
21
|
+
* [removeAddress()](#removeaddress)
|
|
22
|
+
* [setDefaultBillingAddress()](#setdefaultbillingaddress)
|
|
23
|
+
* [setDefaultShippingAddress()](#setdefaultshippingaddress)
|
|
24
|
+
* [getDangerousInnerClient()](#getdangerousinnerclient)
|
|
25
|
+
|
|
26
|
+
### getSalutations()
|
|
27
|
+
|
|
28
|
+
```php
|
|
29
|
+
public function getSalutations(
|
|
30
|
+
string $locale
|
|
31
|
+
): ?array
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Argument|Type|Default|Description
|
|
35
|
+
--------|----|-------|-----------
|
|
36
|
+
`$locale`|`string`||
|
|
37
|
+
|
|
38
|
+
Return Value: `?array`
|
|
39
|
+
|
|
40
|
+
### confirmEmail()
|
|
41
|
+
|
|
42
|
+
```php
|
|
43
|
+
public function confirmEmail(
|
|
44
|
+
string $token,
|
|
45
|
+
string $locale = null
|
|
46
|
+
): Account
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Argument|Type|Default|Description
|
|
50
|
+
--------|----|-------|-----------
|
|
51
|
+
`$token`|`string`||
|
|
52
|
+
`$locale`|`string`|`null`|
|
|
53
|
+
|
|
54
|
+
Return Value: [`Account`](../Account.md)
|
|
55
|
+
|
|
56
|
+
### create()
|
|
57
|
+
|
|
58
|
+
```php
|
|
59
|
+
public function create(
|
|
60
|
+
Account $account,
|
|
61
|
+
?Cart $cart = null,
|
|
62
|
+
string $locale = null
|
|
63
|
+
): Account
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Argument|Type|Default|Description
|
|
67
|
+
--------|----|-------|-----------
|
|
68
|
+
`$account`|[`Account`](../Account.md)||
|
|
69
|
+
`$cart`|?[`Cart`](../../../CartApiBundle/Domain/Cart.md)|`null`|
|
|
70
|
+
`$locale`|`string`|`null`|
|
|
71
|
+
|
|
72
|
+
Return Value: [`Account`](../Account.md)
|
|
73
|
+
|
|
74
|
+
### update()
|
|
75
|
+
|
|
76
|
+
```php
|
|
77
|
+
public function update(
|
|
78
|
+
Account $account,
|
|
79
|
+
string $locale = null
|
|
80
|
+
): Account
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Argument|Type|Default|Description
|
|
84
|
+
--------|----|-------|-----------
|
|
85
|
+
`$account`|[`Account`](../Account.md)||
|
|
86
|
+
`$locale`|`string`|`null`|
|
|
87
|
+
|
|
88
|
+
Return Value: [`Account`](../Account.md)
|
|
89
|
+
|
|
90
|
+
### updatePassword()
|
|
91
|
+
|
|
92
|
+
```php
|
|
93
|
+
public function updatePassword(
|
|
94
|
+
Account $account,
|
|
95
|
+
string $oldPassword,
|
|
96
|
+
string $newPassword,
|
|
97
|
+
string $locale = null
|
|
98
|
+
): Account
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Argument|Type|Default|Description
|
|
102
|
+
--------|----|-------|-----------
|
|
103
|
+
`$account`|[`Account`](../Account.md)||
|
|
104
|
+
`$oldPassword`|`string`||
|
|
105
|
+
`$newPassword`|`string`||
|
|
106
|
+
`$locale`|`string`|`null`|
|
|
107
|
+
|
|
108
|
+
Return Value: [`Account`](../Account.md)
|
|
109
|
+
|
|
110
|
+
### generatePasswordResetToken()
|
|
111
|
+
|
|
112
|
+
```php
|
|
113
|
+
public function generatePasswordResetToken(
|
|
114
|
+
string $email
|
|
115
|
+
): PasswordResetToken
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Argument|Type|Default|Description
|
|
119
|
+
--------|----|-------|-----------
|
|
120
|
+
`$email`|`string`||
|
|
121
|
+
|
|
122
|
+
Return Value: [`PasswordResetToken`](../PasswordResetToken.md)
|
|
123
|
+
|
|
124
|
+
### resetPassword()
|
|
125
|
+
|
|
126
|
+
```php
|
|
127
|
+
public function resetPassword(
|
|
128
|
+
string $token,
|
|
129
|
+
string $newPassword,
|
|
130
|
+
string $locale = null
|
|
131
|
+
): Account
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Argument|Type|Default|Description
|
|
135
|
+
--------|----|-------|-----------
|
|
136
|
+
`$token`|`string`||
|
|
137
|
+
`$newPassword`|`string`||
|
|
138
|
+
`$locale`|`string`|`null`|
|
|
139
|
+
|
|
140
|
+
Return Value: [`Account`](../Account.md)
|
|
141
|
+
|
|
142
|
+
### login()
|
|
143
|
+
|
|
144
|
+
```php
|
|
145
|
+
public function login(
|
|
146
|
+
Account $account,
|
|
147
|
+
?Cart $cart = null,
|
|
148
|
+
string $locale = null
|
|
149
|
+
): ?Account
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Argument|Type|Default|Description
|
|
153
|
+
--------|----|-------|-----------
|
|
154
|
+
`$account`|[`Account`](../Account.md)||
|
|
155
|
+
`$cart`|?[`Cart`](../../../CartApiBundle/Domain/Cart.md)|`null`|
|
|
156
|
+
`$locale`|`string`|`null`|
|
|
157
|
+
|
|
158
|
+
Return Value: ?[`Account`](../Account.md)
|
|
159
|
+
|
|
160
|
+
### refreshAccount()
|
|
161
|
+
|
|
162
|
+
```php
|
|
163
|
+
public function refreshAccount(
|
|
164
|
+
Account $account,
|
|
165
|
+
string $locale = null
|
|
166
|
+
): Account
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Argument|Type|Default|Description
|
|
170
|
+
--------|----|-------|-----------
|
|
171
|
+
`$account`|[`Account`](../Account.md)||
|
|
172
|
+
`$locale`|`string`|`null`|
|
|
173
|
+
|
|
174
|
+
Return Value: [`Account`](../Account.md)
|
|
175
|
+
|
|
176
|
+
### getAddresses()
|
|
177
|
+
|
|
178
|
+
```php
|
|
179
|
+
public function getAddresses(
|
|
180
|
+
Account $account,
|
|
181
|
+
string $locale = null
|
|
182
|
+
): array
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Argument|Type|Default|Description
|
|
186
|
+
--------|----|-------|-----------
|
|
187
|
+
`$account`|[`Account`](../Account.md)||
|
|
188
|
+
`$locale`|`string`|`null`|
|
|
189
|
+
|
|
190
|
+
Return Value: `array`
|
|
191
|
+
|
|
192
|
+
### addAddress()
|
|
193
|
+
|
|
194
|
+
```php
|
|
195
|
+
public function addAddress(
|
|
196
|
+
Account $account,
|
|
197
|
+
Address $address,
|
|
198
|
+
string $locale = null
|
|
199
|
+
): Account
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Argument|Type|Default|Description
|
|
203
|
+
--------|----|-------|-----------
|
|
204
|
+
`$account`|[`Account`](../Account.md)||
|
|
205
|
+
`$address`|[`Address`](../Address.md)||
|
|
206
|
+
`$locale`|`string`|`null`|
|
|
207
|
+
|
|
208
|
+
Return Value: [`Account`](../Account.md)
|
|
209
|
+
|
|
210
|
+
### updateAddress()
|
|
211
|
+
|
|
212
|
+
```php
|
|
213
|
+
public function updateAddress(
|
|
214
|
+
Account $account,
|
|
215
|
+
Address $address,
|
|
216
|
+
string $locale = null
|
|
217
|
+
): Account
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Argument|Type|Default|Description
|
|
221
|
+
--------|----|-------|-----------
|
|
222
|
+
`$account`|[`Account`](../Account.md)||
|
|
223
|
+
`$address`|[`Address`](../Address.md)||
|
|
224
|
+
`$locale`|`string`|`null`|
|
|
225
|
+
|
|
226
|
+
Return Value: [`Account`](../Account.md)
|
|
227
|
+
|
|
228
|
+
### removeAddress()
|
|
229
|
+
|
|
230
|
+
```php
|
|
231
|
+
public function removeAddress(
|
|
232
|
+
Account $account,
|
|
233
|
+
string $addressId,
|
|
234
|
+
string $locale = null
|
|
235
|
+
): Account
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Argument|Type|Default|Description
|
|
239
|
+
--------|----|-------|-----------
|
|
240
|
+
`$account`|[`Account`](../Account.md)||
|
|
241
|
+
`$addressId`|`string`||
|
|
242
|
+
`$locale`|`string`|`null`|
|
|
243
|
+
|
|
244
|
+
Return Value: [`Account`](../Account.md)
|
|
245
|
+
|
|
246
|
+
### setDefaultBillingAddress()
|
|
247
|
+
|
|
248
|
+
```php
|
|
249
|
+
public function setDefaultBillingAddress(
|
|
250
|
+
Account $account,
|
|
251
|
+
string $addressId,
|
|
252
|
+
string $locale = null
|
|
253
|
+
): Account
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Argument|Type|Default|Description
|
|
257
|
+
--------|----|-------|-----------
|
|
258
|
+
`$account`|[`Account`](../Account.md)||
|
|
259
|
+
`$addressId`|`string`||
|
|
260
|
+
`$locale`|`string`|`null`|
|
|
261
|
+
|
|
262
|
+
Return Value: [`Account`](../Account.md)
|
|
263
|
+
|
|
264
|
+
### setDefaultShippingAddress()
|
|
265
|
+
|
|
266
|
+
```php
|
|
267
|
+
public function setDefaultShippingAddress(
|
|
268
|
+
Account $account,
|
|
269
|
+
string $addressId,
|
|
270
|
+
string $locale = null
|
|
271
|
+
): Account
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Argument|Type|Default|Description
|
|
275
|
+
--------|----|-------|-----------
|
|
276
|
+
`$account`|[`Account`](../Account.md)||
|
|
277
|
+
`$addressId`|`string`||
|
|
278
|
+
`$locale`|`string`|`null`|
|
|
279
|
+
|
|
280
|
+
Return Value: [`Account`](../Account.md)
|
|
281
|
+
|
|
282
|
+
### getDangerousInnerClient()
|
|
283
|
+
|
|
284
|
+
```php
|
|
285
|
+
public function getDangerousInnerClient(): mixed
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Return Value: `mixed`
|
|
289
|
+
|
|
290
|
+
Generated with [Frontastic API Docs](https://github.com/FrontasticGmbH/apidocs).
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# DummyAccountApiFactory
|
|
2
|
+
|
|
3
|
+
**Fully Qualified**: [`\Frontastic\Common\AccountApiBundle\Domain\DummyAccountApiFactory`](../../../../src/php/AccountApiBundle/Domain/DummyAccountApiFactory.php)
|
|
4
|
+
|
|
5
|
+
**Implements**: [`AccountApiFactory`](AccountApiFactory.md)
|
|
6
|
+
|
|
7
|
+
## Methods
|
|
8
|
+
|
|
9
|
+
* [factor()](#factor)
|
|
10
|
+
|
|
11
|
+
### factor()
|
|
12
|
+
|
|
13
|
+
```php
|
|
14
|
+
public function factor(
|
|
15
|
+
Project $project
|
|
16
|
+
): AccountApi
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Argument|Type|Default|Description
|
|
20
|
+
--------|----|-------|-----------
|
|
21
|
+
`$project`|[`Project`](../../ReplicatorBundle/Domain/Project.md)||
|
|
22
|
+
|
|
23
|
+
Return Value: [`AccountApi`](AccountApi.md)
|
|
24
|
+
|
|
25
|
+
Generated with [Frontastic API Docs](https://github.com/FrontasticGmbH/apidocs).
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# DummyCartApi
|
|
2
|
+
|
|
3
|
+
**Fully Qualified**: [`\Frontastic\Common\CartApiBundle\Domain\CartApi\DummyCartApi`](../../../../../src/php/CartApiBundle/Domain/CartApi/DummyCartApi.php)
|
|
4
|
+
|
|
5
|
+
**Extends**: [`CartApiBase`](../CartApiBase.md)
|
|
6
|
+
|
|
7
|
+
## Methods
|
|
8
|
+
|
|
9
|
+
* [getAvailableShippingMethodsImplementation()](#getavailableshippingmethodsimplementation)
|
|
10
|
+
* [getShippingMethodsImplementation()](#getshippingmethodsimplementation)
|
|
11
|
+
* [getDangerousInnerClient()](#getdangerousinnerclient)
|
|
12
|
+
* [getDangerousInnerMapper()](#getdangerousinnermapper)
|
|
13
|
+
* [getDangerousInnerLocaleCreator()](#getdangerousinnerlocalecreator)
|
|
14
|
+
* [updatePaymentStatus()](#updatepaymentstatus)
|
|
15
|
+
* [getPayment()](#getpayment)
|
|
16
|
+
* [updatePaymentInterfaceId()](#updatepaymentinterfaceid)
|
|
17
|
+
|
|
18
|
+
### getAvailableShippingMethodsImplementation()
|
|
19
|
+
|
|
20
|
+
```php
|
|
21
|
+
public function getAvailableShippingMethodsImplementation(
|
|
22
|
+
Cart $cart,
|
|
23
|
+
string $localeString
|
|
24
|
+
): array
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Argument|Type|Default|Description
|
|
28
|
+
--------|----|-------|-----------
|
|
29
|
+
`$cart`|[`Cart`](../Cart.md)||
|
|
30
|
+
`$localeString`|`string`||
|
|
31
|
+
|
|
32
|
+
Return Value: `array`
|
|
33
|
+
|
|
34
|
+
### getShippingMethodsImplementation()
|
|
35
|
+
|
|
36
|
+
```php
|
|
37
|
+
public function getShippingMethodsImplementation(
|
|
38
|
+
string $localeString,
|
|
39
|
+
bool $onlyMatching = false
|
|
40
|
+
): array
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Argument|Type|Default|Description
|
|
44
|
+
--------|----|-------|-----------
|
|
45
|
+
`$localeString`|`string`||
|
|
46
|
+
`$onlyMatching`|`bool`|`false`|
|
|
47
|
+
|
|
48
|
+
Return Value: `array`
|
|
49
|
+
|
|
50
|
+
### getDangerousInnerClient()
|
|
51
|
+
|
|
52
|
+
```php
|
|
53
|
+
public function getDangerousInnerClient(): mixed
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Return Value: `mixed`
|
|
57
|
+
|
|
58
|
+
### getDangerousInnerMapper()
|
|
59
|
+
|
|
60
|
+
```php
|
|
61
|
+
public function getDangerousInnerMapper(): Commercetools\Mapper
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Return Value: [`Commercetools`](Commercetools.md)\Mapper
|
|
65
|
+
|
|
66
|
+
### getDangerousInnerLocaleCreator()
|
|
67
|
+
|
|
68
|
+
```php
|
|
69
|
+
public function getDangerousInnerLocaleCreator(): Commercetools\Locale\CommercetoolsLocaleCreator
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Return Value: [`Commercetools`](../../../ProductApiBundle/Domain/ProductApi/Commercetools.md)\Locale\CommercetoolsLocaleCreator
|
|
73
|
+
|
|
74
|
+
### updatePaymentStatus()
|
|
75
|
+
|
|
76
|
+
```php
|
|
77
|
+
public function updatePaymentStatus(
|
|
78
|
+
Payment $payment
|
|
79
|
+
): void
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Argument|Type|Default|Description
|
|
83
|
+
--------|----|-------|-----------
|
|
84
|
+
`$payment`|[`Payment`](../Payment.md)||
|
|
85
|
+
|
|
86
|
+
Return Value: `void`
|
|
87
|
+
|
|
88
|
+
### getPayment()
|
|
89
|
+
|
|
90
|
+
```php
|
|
91
|
+
public function getPayment(
|
|
92
|
+
string $paymentId
|
|
93
|
+
): ?Payment
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Argument|Type|Default|Description
|
|
97
|
+
--------|----|-------|-----------
|
|
98
|
+
`$paymentId`|`string`||
|
|
99
|
+
|
|
100
|
+
Return Value: ?[`Payment`](../Payment.md)
|
|
101
|
+
|
|
102
|
+
### updatePaymentInterfaceId()
|
|
103
|
+
|
|
104
|
+
```php
|
|
105
|
+
public function updatePaymentInterfaceId(
|
|
106
|
+
Payment $payment
|
|
107
|
+
): void
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Argument|Type|Default|Description
|
|
111
|
+
--------|----|-------|-----------
|
|
112
|
+
`$payment`|[`Payment`](../Payment.md)||
|
|
113
|
+
|
|
114
|
+
Return Value: `void`
|
|
115
|
+
|
|
116
|
+
Generated with [Frontastic API Docs](https://github.com/FrontasticGmbH/apidocs).
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# DummyCartApiFactory
|
|
2
|
+
|
|
3
|
+
**Fully Qualified**: [`\Frontastic\Common\CartApiBundle\Domain\DummyCartApiFactory`](../../../../src/php/CartApiBundle/Domain/DummyCartApiFactory.php)
|
|
4
|
+
|
|
5
|
+
**Implements**: [`CartApiFactory`](CartApiFactory.md)
|
|
6
|
+
|
|
7
|
+
## Methods
|
|
8
|
+
|
|
9
|
+
* [factor()](#factor)
|
|
10
|
+
|
|
11
|
+
### factor()
|
|
12
|
+
|
|
13
|
+
```php
|
|
14
|
+
public function factor(
|
|
15
|
+
Project $project
|
|
16
|
+
): CartApi
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Argument|Type|Default|Description
|
|
20
|
+
--------|----|-------|-----------
|
|
21
|
+
`$project`|[`Project`](../../ReplicatorBundle/Domain/Project.md)||
|
|
22
|
+
|
|
23
|
+
Return Value: [`CartApi`](CartApi.md)
|
|
24
|
+
|
|
25
|
+
Generated with [Frontastic API Docs](https://github.com/FrontasticGmbH/apidocs).
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# DummyContentApi
|
|
2
|
+
|
|
3
|
+
**Fully Qualified**: [`\Frontastic\Common\ContentApiBundle\Domain\ContentApi\DummyContentApi`](../../../../../src/php/ContentApiBundle/Domain/ContentApi/DummyContentApi.php)
|
|
4
|
+
|
|
5
|
+
**Implements**: [`ContentApi`](../ContentApi.md)
|
|
6
|
+
|
|
7
|
+
## Methods
|
|
8
|
+
|
|
9
|
+
* [getContentTypes()](#getcontenttypes)
|
|
10
|
+
* [getContent()](#getcontent)
|
|
11
|
+
* [query()](#query)
|
|
12
|
+
* [getDangerousInnerClient()](#getdangerousinnerclient)
|
|
13
|
+
|
|
14
|
+
### getContentTypes()
|
|
15
|
+
|
|
16
|
+
```php
|
|
17
|
+
public function getContentTypes(): array
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Return Value: `array`
|
|
21
|
+
|
|
22
|
+
### getContent()
|
|
23
|
+
|
|
24
|
+
```php
|
|
25
|
+
public function getContent(
|
|
26
|
+
string $contentId,
|
|
27
|
+
string $locale = null,
|
|
28
|
+
string $mode = self::QUERY_SYNC
|
|
29
|
+
): ?object
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Argument|Type|Default|Description
|
|
33
|
+
--------|----|-------|-----------
|
|
34
|
+
`$contentId`|`string`||
|
|
35
|
+
`$locale`|`string`|`null`|
|
|
36
|
+
`$mode`|`string`|`self::QUERY_SYNC`|
|
|
37
|
+
|
|
38
|
+
Return Value: `?object`
|
|
39
|
+
|
|
40
|
+
### query()
|
|
41
|
+
|
|
42
|
+
```php
|
|
43
|
+
public function query(
|
|
44
|
+
Query $query,
|
|
45
|
+
string $locale = null,
|
|
46
|
+
string $mode = self::QUERY_SYNC
|
|
47
|
+
): ?object
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Argument|Type|Default|Description
|
|
51
|
+
--------|----|-------|-----------
|
|
52
|
+
`$query`|[`Query`](../Query.md)||
|
|
53
|
+
`$locale`|`string`|`null`|
|
|
54
|
+
`$mode`|`string`|`self::QUERY_SYNC`|
|
|
55
|
+
|
|
56
|
+
Return Value: `?object`
|
|
57
|
+
|
|
58
|
+
### getDangerousInnerClient()
|
|
59
|
+
|
|
60
|
+
```php
|
|
61
|
+
public function getDangerousInnerClient(): mixed
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Return Value: `mixed`
|
|
65
|
+
|
|
66
|
+
Generated with [Frontastic API Docs](https://github.com/FrontasticGmbH/apidocs).
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# DummyContentApiFactory
|
|
2
|
+
|
|
3
|
+
**Fully Qualified**: [`\Frontastic\Common\ContentApiBundle\Domain\DummyContentApiFactory`](../../../../src/php/ContentApiBundle/Domain/DummyContentApiFactory.php)
|
|
4
|
+
|
|
5
|
+
**Implements**: [`ContentApiFactory`](ContentApiFactory.md)
|
|
6
|
+
|
|
7
|
+
## Methods
|
|
8
|
+
|
|
9
|
+
* [factor()](#factor)
|
|
10
|
+
|
|
11
|
+
### factor()
|
|
12
|
+
|
|
13
|
+
```php
|
|
14
|
+
public function factor(
|
|
15
|
+
Project $project
|
|
16
|
+
): ContentApi
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Argument|Type|Default|Description
|
|
20
|
+
--------|----|-------|-----------
|
|
21
|
+
`$project`|[`Project`](../../ReplicatorBundle/Domain/Project.md)||
|
|
22
|
+
|
|
23
|
+
Return Value: [`ContentApi`](ContentApi.md)
|
|
24
|
+
|
|
25
|
+
Generated with [Frontastic API Docs](https://github.com/FrontasticGmbH/apidocs).
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# DummyProductApiFactory
|
|
2
|
+
|
|
3
|
+
**Fully Qualified**: [`\Frontastic\Common\ProductApiBundle\Domain\DummyProductApiFactory`](../../../../src/php/ProductApiBundle/Domain/DummyProductApiFactory.php)
|
|
4
|
+
|
|
5
|
+
**Implements**: [`ProductApiFactory`](ProductApiFactory.md)
|
|
6
|
+
|
|
7
|
+
## Methods
|
|
8
|
+
|
|
9
|
+
* [__construct()](#__construct)
|
|
10
|
+
* [factor()](#factor)
|
|
11
|
+
|
|
12
|
+
### __construct()
|
|
13
|
+
|
|
14
|
+
```php
|
|
15
|
+
public function __construct(
|
|
16
|
+
ProductSearchApiFactory $productSearchApiFactory
|
|
17
|
+
): mixed
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Argument|Type|Default|Description
|
|
21
|
+
--------|----|-------|-----------
|
|
22
|
+
`$productSearchApiFactory`|[`ProductSearchApiFactory`](../../ProductSearchApiBundle/Domain/ProductSearchApiFactory.md)||
|
|
23
|
+
|
|
24
|
+
Return Value: `mixed`
|
|
25
|
+
|
|
26
|
+
### factor()
|
|
27
|
+
|
|
28
|
+
```php
|
|
29
|
+
public function factor(
|
|
30
|
+
Project $project
|
|
31
|
+
): ProductApi
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Argument|Type|Default|Description
|
|
35
|
+
--------|----|-------|-----------
|
|
36
|
+
`$project`|[`Project`](../../ReplicatorBundle/Domain/Project.md)||
|
|
37
|
+
|
|
38
|
+
Return Value: [`ProductApi`](ProductApi.md)
|
|
39
|
+
|
|
40
|
+
Generated with [Frontastic API Docs](https://github.com/FrontasticGmbH/apidocs).
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# DummyProductApi
|
|
2
|
+
|
|
3
|
+
**Fully Qualified**: [`\Frontastic\Common\ProductApiBundle\Domain\ProductApi\DummyProductApi`](../../../../../src/php/ProductApiBundle/Domain/ProductApi/DummyProductApi.php)
|
|
4
|
+
|
|
5
|
+
**Extends**: [`ProductApiBase`](../ProductApiBase.md)
|
|
6
|
+
|
|
7
|
+
## Methods
|
|
8
|
+
|
|
9
|
+
* [__construct()](#__construct)
|
|
10
|
+
* [getDangerousInnerClient()](#getdangerousinnerclient)
|
|
11
|
+
|
|
12
|
+
### __construct()
|
|
13
|
+
|
|
14
|
+
```php
|
|
15
|
+
public function __construct(
|
|
16
|
+
ProductSearchApi $productSearchApi
|
|
17
|
+
): mixed
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Argument|Type|Default|Description
|
|
21
|
+
--------|----|-------|-----------
|
|
22
|
+
`$productSearchApi`|[`ProductSearchApi`](../../../ProductSearchApiBundle/Domain/ProductSearchApi.md)||
|
|
23
|
+
|
|
24
|
+
Return Value: `mixed`
|
|
25
|
+
|
|
26
|
+
### getDangerousInnerClient()
|
|
27
|
+
|
|
28
|
+
```php
|
|
29
|
+
public function getDangerousInnerClient(): Commercetools\Client
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Return Value: [`Commercetools`](Commercetools.md)\Client
|
|
33
|
+
|
|
34
|
+
Generated with [Frontastic API Docs](https://github.com/FrontasticGmbH/apidocs).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# DummyProductSearchApiFactory
|
|
2
|
+
|
|
3
|
+
**Fully Qualified**: [`\Frontastic\Common\ProductSearchApiBundle\Domain\DummyProductSearchApiFactory`](../../../../src/php/ProductSearchApiBundle/Domain/DummyProductSearchApiFactory.php)
|
|
4
|
+
|
|
5
|
+
**Implements**: [`ProductSearchApiFactory`](ProductSearchApiFactory.md)
|
|
6
|
+
|
|
7
|
+
It's purpose is to have a placeholder for the Frontastic Next.js projects.
|
|
8
|
+
Because if entries for the different APIs are missing in project.yml, the API
|
|
9
|
+
Hub is not working anymore.
|
|
10
|
+
|
|
11
|
+
## Methods
|
|
12
|
+
|
|
13
|
+
* [factor()](#factor)
|
|
14
|
+
|
|
15
|
+
### factor()
|
|
16
|
+
|
|
17
|
+
```php
|
|
18
|
+
public function factor(
|
|
19
|
+
Project $project
|
|
20
|
+
): ProductSearchApi
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Argument|Type|Default|Description
|
|
24
|
+
--------|----|-------|-----------
|
|
25
|
+
`$project`|[`Project`](../../ReplicatorBundle/Domain/Project.md)||
|
|
26
|
+
|
|
27
|
+
Return Value: [`ProductSearchApi`](ProductSearchApi.md)
|
|
28
|
+
|
|
29
|
+
Generated with [Frontastic API Docs](https://github.com/FrontasticGmbH/apidocs).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# DummyProductSearchApi
|
|
2
|
+
|
|
3
|
+
**Fully Qualified**: [`\Frontastic\Common\ProductSearchApiBundle\Domain\ProductSearchApi\DummyProductSearchApi`](../../../../../src/php/ProductSearchApiBundle/Domain/ProductSearchApi/DummyProductSearchApi.php)
|
|
4
|
+
|
|
5
|
+
**Extends**: [`ProductSearchApiBase`](../ProductSearchApiBase.md)
|
|
6
|
+
|
|
7
|
+
## Methods
|
|
8
|
+
|
|
9
|
+
* [getDangerousInnerClient()](#getdangerousinnerclient)
|
|
10
|
+
|
|
11
|
+
### getDangerousInnerClient()
|
|
12
|
+
|
|
13
|
+
```php
|
|
14
|
+
public function getDangerousInnerClient(): Commercetools\Client
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Return Value: [`Commercetools`](../../../ProductApiBundle/Domain/ProductApi/Commercetools.md)\Client
|
|
18
|
+
|
|
19
|
+
Generated with [Frontastic API Docs](https://github.com/FrontasticGmbH/apidocs).
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# DummyWishlistApiFactory
|
|
2
|
+
|
|
3
|
+
**Fully Qualified**: [`\Frontastic\Common\WishlistApiBundle\Domain\DummyWishlistApiFactory`](../../../../src/php/WishlistApiBundle/Domain/DummyWishlistApiFactory.php)
|
|
4
|
+
|
|
5
|
+
**Implements**: [`WishlistApiFactory`](WishlistApiFactory.md)
|
|
6
|
+
|
|
7
|
+
## Methods
|
|
8
|
+
|
|
9
|
+
* [factor()](#factor)
|
|
10
|
+
|
|
11
|
+
### factor()
|
|
12
|
+
|
|
13
|
+
```php
|
|
14
|
+
public function factor(
|
|
15
|
+
Project $project
|
|
16
|
+
): WishlistApi
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Argument|Type|Default|Description
|
|
20
|
+
--------|----|-------|-----------
|
|
21
|
+
`$project`|[`Project`](../../ReplicatorBundle/Domain/Project.md)||
|
|
22
|
+
|
|
23
|
+
Return Value: [`WishlistApi`](WishlistApi.md)
|
|
24
|
+
|
|
25
|
+
Generated with [Frontastic API Docs](https://github.com/FrontasticGmbH/apidocs).
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# DummyWishlistApi
|
|
2
|
+
|
|
3
|
+
**Fully Qualified**: [`\Frontastic\Common\WishlistApiBundle\Domain\WishlistApi\DummyWishlistApi`](../../../../../src/php/WishlistApiBundle/Domain/WishlistApi/DummyWishlistApi.php)
|
|
4
|
+
|
|
5
|
+
**Implements**: [`WishlistApi`](../WishlistApi.md)
|
|
6
|
+
|
|
7
|
+
## Methods
|
|
8
|
+
|
|
9
|
+
* [getWishlist()](#getwishlist)
|
|
10
|
+
* [getAnonymous()](#getanonymous)
|
|
11
|
+
* [getWishlists()](#getwishlists)
|
|
12
|
+
* [create()](#create)
|
|
13
|
+
* [addToWishlist()](#addtowishlist)
|
|
14
|
+
* [addMultipleToWishlist()](#addmultipletowishlist)
|
|
15
|
+
* [updateLineItem()](#updatelineitem)
|
|
16
|
+
* [removeLineItem()](#removelineitem)
|
|
17
|
+
* [getDangerousInnerClient()](#getdangerousinnerclient)
|
|
18
|
+
|
|
19
|
+
### getWishlist()
|
|
20
|
+
|
|
21
|
+
```php
|
|
22
|
+
public function getWishlist(
|
|
23
|
+
string $wishlistId,
|
|
24
|
+
string $locale
|
|
25
|
+
): Wishlist
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Argument|Type|Default|Description
|
|
29
|
+
--------|----|-------|-----------
|
|
30
|
+
`$wishlistId`|`string`||
|
|
31
|
+
`$locale`|`string`||
|
|
32
|
+
|
|
33
|
+
Return Value: [`Wishlist`](../Wishlist.md)
|
|
34
|
+
|
|
35
|
+
### getAnonymous()
|
|
36
|
+
|
|
37
|
+
```php
|
|
38
|
+
public function getAnonymous(
|
|
39
|
+
string $anonymousId,
|
|
40
|
+
string $locale
|
|
41
|
+
): Wishlist
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Argument|Type|Default|Description
|
|
45
|
+
--------|----|-------|-----------
|
|
46
|
+
`$anonymousId`|`string`||
|
|
47
|
+
`$locale`|`string`||
|
|
48
|
+
|
|
49
|
+
Return Value: [`Wishlist`](../Wishlist.md)
|
|
50
|
+
|
|
51
|
+
### getWishlists()
|
|
52
|
+
|
|
53
|
+
```php
|
|
54
|
+
public function getWishlists(
|
|
55
|
+
string $accountId,
|
|
56
|
+
string $locale
|
|
57
|
+
): array
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Argument|Type|Default|Description
|
|
61
|
+
--------|----|-------|-----------
|
|
62
|
+
`$accountId`|`string`||
|
|
63
|
+
`$locale`|`string`||
|
|
64
|
+
|
|
65
|
+
Return Value: `array`
|
|
66
|
+
|
|
67
|
+
### create()
|
|
68
|
+
|
|
69
|
+
```php
|
|
70
|
+
public function create(
|
|
71
|
+
Wishlist $wishlist,
|
|
72
|
+
string $locale
|
|
73
|
+
): Wishlist
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Argument|Type|Default|Description
|
|
77
|
+
--------|----|-------|-----------
|
|
78
|
+
`$wishlist`|[`Wishlist`](../Wishlist.md)||
|
|
79
|
+
`$locale`|`string`||
|
|
80
|
+
|
|
81
|
+
Return Value: [`Wishlist`](../Wishlist.md)
|
|
82
|
+
|
|
83
|
+
### addToWishlist()
|
|
84
|
+
|
|
85
|
+
```php
|
|
86
|
+
public function addToWishlist(
|
|
87
|
+
Wishlist $wishlist,
|
|
88
|
+
LineItem $lineItem,
|
|
89
|
+
string $locale
|
|
90
|
+
): Wishlist
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Argument|Type|Default|Description
|
|
94
|
+
--------|----|-------|-----------
|
|
95
|
+
`$wishlist`|[`Wishlist`](../Wishlist.md)||
|
|
96
|
+
`$lineItem`|[`LineItem`](../LineItem.md)||
|
|
97
|
+
`$locale`|`string`||
|
|
98
|
+
|
|
99
|
+
Return Value: [`Wishlist`](../Wishlist.md)
|
|
100
|
+
|
|
101
|
+
### addMultipleToWishlist()
|
|
102
|
+
|
|
103
|
+
```php
|
|
104
|
+
public function addMultipleToWishlist(
|
|
105
|
+
Wishlist $wishlist,
|
|
106
|
+
array $lineItems,
|
|
107
|
+
string $locale
|
|
108
|
+
): Wishlist
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Argument|Type|Default|Description
|
|
112
|
+
--------|----|-------|-----------
|
|
113
|
+
`$wishlist`|[`Wishlist`](../Wishlist.md)||
|
|
114
|
+
`$lineItems`|`array`||
|
|
115
|
+
`$locale`|`string`||
|
|
116
|
+
|
|
117
|
+
Return Value: [`Wishlist`](../Wishlist.md)
|
|
118
|
+
|
|
119
|
+
### updateLineItem()
|
|
120
|
+
|
|
121
|
+
```php
|
|
122
|
+
public function updateLineItem(
|
|
123
|
+
Wishlist $wishlist,
|
|
124
|
+
LineItem $lineItem,
|
|
125
|
+
int $count,
|
|
126
|
+
string $locale
|
|
127
|
+
): Wishlist
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Argument|Type|Default|Description
|
|
131
|
+
--------|----|-------|-----------
|
|
132
|
+
`$wishlist`|[`Wishlist`](../Wishlist.md)||
|
|
133
|
+
`$lineItem`|[`LineItem`](../LineItem.md)||
|
|
134
|
+
`$count`|`int`||
|
|
135
|
+
`$locale`|`string`||
|
|
136
|
+
|
|
137
|
+
Return Value: [`Wishlist`](../Wishlist.md)
|
|
138
|
+
|
|
139
|
+
### removeLineItem()
|
|
140
|
+
|
|
141
|
+
```php
|
|
142
|
+
public function removeLineItem(
|
|
143
|
+
Wishlist $wishlist,
|
|
144
|
+
LineItem $lineItem,
|
|
145
|
+
string $locale
|
|
146
|
+
): Wishlist
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Argument|Type|Default|Description
|
|
150
|
+
--------|----|-------|-----------
|
|
151
|
+
`$wishlist`|[`Wishlist`](../Wishlist.md)||
|
|
152
|
+
`$lineItem`|[`LineItem`](../LineItem.md)||
|
|
153
|
+
`$locale`|`string`||
|
|
154
|
+
|
|
155
|
+
Return Value: [`Wishlist`](../Wishlist.md)
|
|
156
|
+
|
|
157
|
+
### getDangerousInnerClient()
|
|
158
|
+
|
|
159
|
+
```php
|
|
160
|
+
public function getDangerousInnerClient(): mixed
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Return Value: `mixed`
|
|
164
|
+
|
|
165
|
+
Generated with [Frontastic API Docs](https://github.com/FrontasticGmbH/apidocs).
|
package/package.json
CHANGED
|
@@ -247,6 +247,18 @@ class ConfigurationSchema {
|
|
|
247
247
|
typeof value.target !== 'string' || value.target === ''
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
+
// If media field has an empty stream object like: {value: null}
|
|
251
|
+
// It should be flagged as a missing required value
|
|
252
|
+
if (schema.type === 'stream' && value) {
|
|
253
|
+
return Object.values(value).some((v) => !v)
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// If media field has an empty media object like: {media: null}
|
|
257
|
+
// It should be flagged as a missing required value
|
|
258
|
+
if (schema.type === 'media' && value) {
|
|
259
|
+
return Object.values(value).some((v) => !v)
|
|
260
|
+
}
|
|
261
|
+
|
|
250
262
|
// If string field has an empty translatable object like: {en_GB@EUR: ""}
|
|
251
263
|
// It should be flagged as a missing required value
|
|
252
264
|
if (schema.type === 'string' && schema.translatable && value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["frontastic-common"]=t():e["frontastic-common"]=t()}(global,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e){e.exports=JSON.parse('{"schema":[{"name":"Value Order","fields":[{"label":"Strip Label Prefix","field":"stripLabelPrefix","type":"boolean","default":false},{"label":"Sort Order","field":"sortOrder","type":"enum","values":[{"value":"sort-undefined","name":"Undefined"},{"value":"sort-ascending","name":"Ascending"},{"value":"sort-descending","name":"Descending"}],"default":"sort-undefined"}]}]}')},function(e){e.exports=JSON.parse('{"schema":[{"name":"Display properties","fields":[{"label":"Highlight menu item","field":"displayHighlightMenuItem","type":"boolean","default":false},{"label":"Highlight category tag","field":"displayHighlightCategoryTag","type":"boolean","default":false},{"label":"Description","field":"displayDescription","type":"string","translatable":true},{"label":"Custom CSS class","field":"displayClassname","type":"string","translatable":false},{"label":"Image","field":"displayMedia","type":"media","options":{"ratio":"4:1"}}]},{"name":"SEO","fields":[{"label":"Title","field":"seoTitle","type":"string","translatable":true},{"label":"Description","field":"seoDescription","type":"string","translatable":true},{"label":"Keywords","field":"seoKeywords","type":"string","translatable":true}]}]}')},function(e){e.exports=JSON.parse('{"schema":[]}')},function(e,t,n){var i=n(4),r=n(6);e.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||i)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[o+a]=s[a];return t||r(s)}},function(e,t,n){var i=n(5);e.exports=function(){return i.randomBytes(16)}},function(e,t){e.exports=require("crypto")},function(e,t){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);e.exports=function(e,t){var i=t||0,r=n;return[r[e[i++]],r[e[i++]],r[e[i++]],r[e[i++]],"-",r[e[i++]],r[e[i++]],"-",r[e[i++]],r[e[i++]],"-",r[e[i++]],r[e[i++]],"-",r[e[i++]],r[e[i++]],r[e[i++]],r[e[i++]],r[e[i++]],r[e[i++]]].join("")}},function(e,t,n){"use strict";n.r(t);const i=["product","product-list","content","content-list"];function r(e,t,n){return void 0!==e?Boolean(e):"stream"===t&&i.includes(n)}function o(e){if(!Array.isArray(e.fields))return{};let t={};for(let n=0;n<e.fields.length;++n){const i=e.fields[n];if(!i.field)continue;const o=i.type||"text";t[i.field]={field:i.field,type:o,sectionName:e.name||"",values:i.values||[],default:c(o,i.default),validate:i.validate||{},fields:i.fields||null,min:void 0===i.min?1:i.min,max:i.max||16,required:r(i.required,o,i.streamType),disabled:!0===i.disabled,translatable:i.translatable}}return t}function s(e,t){let n=e.default;if(void 0!==t[e.field]&&null!==t[e.field]&&(n=t[e.field]),"group"===e.type){let t=(n||[]).slice(0,e.max);for(let n=t.length;n<e.min;++n)t[n]={};return i=t,r=e.fields,(i||[]).map(e=>{null!==e&&"object"==typeof e||(e={});for(let t of r)void 0!==e[t.field]&&null!==e[t.field]||(e[t.field]=t.default||null);return e})}var i,r;return n}function a(e,t,n,i){("object"!=typeof i||Array.isArray(i))&&(i={});let r={};for(let o of Object.values(e))r[o.field]=l(o,t,n,i);return r}function l(e,t,n,i){const r=i[e.field];if("group"===e.type){const i=o(e);return s(e,t).map((e,t)=>{const o=void 0!==r&&r.length>t?r[t]:{};return a(i,e,n,o)})}if(void 0!==r)return r;const l=s(e,t);return"stream"===e.type?n[l]||null:l}function c(e,t){if(void 0!==t)return t;switch(e){case"group":return[];case"decimal":case"integer":case"float":case"number":return 0;case"string":case"text":case"markdown":return"";case"json":return"{}";case"boolean":return!1;default:return null}}class u{constructor(e=[],t={}){this.schema=e,this.setConfiguration(t),this.fields={};for(let e=0;e<this.schema.length;++e)this.fields={...this.fields,...o(this.schema[e])}}setConfiguration(e){this.configuration=Array.isArray(e)?{}:e||{}}set(e,t){if(!this.fields[e])throw new Error("Unknown field "+e+" in this configuration schema.");return new u(this.schema,{...this.configuration,[e]:t})}get(e){const t=this.fields[e];return t?s(t,this.configuration):(console.warn("Unknown field "+e+" in this configuration schema."),this.configuration[e]||null)}getField(e){const t=this.fields[e];if(!t)throw new Error("Unknown field "+e+" in this configuration schema.");return t}has(e){return!!this.fields[e]}getSchema(){return this.schema}getConfiguration(){return this.configuration}isFieldRequired(e){return this.getField(e).required}isFieldDisabled(e){return this.getField(e).disabled}hasMissingRequiredValueInField(e,t=!1){const n=this.getField(e),i=this.get(e);return"group"===n.type?i.some(e=>new u([n],e).hasMissingRequiredFieldValues(t)):!!n.required&&(("stream"!==n.type||!t)&&("reference"===n.type?"object"!=typeof i||null===i||"string"!=typeof i.type||""===i.type||"string"!=typeof i.target||""===i.target:"string"===n.type&&n.translatable&&i?Object.values(i).some(e=>!e):null==i||""===i))}hasMissingRequiredFieldValues(e=!1){return Object.keys(this.fields).some(t=>this.hasMissingRequiredValueInField(t,e))}hasMissingRequiredFieldValuesInSection(e,t=!1){return Object.entries(this.fields).some(([n,i])=>i.sectionName===e&&this.hasMissingRequiredValueInField(n,t))}getConfigurationWithResolvedStreams(e={},t={}){return a(this.fields,this.configuration,e,t)}}var d=u,f={NodeConfigurationSchema:n(1),CellConfigurationSchema:n(2)},h=n(3),g=n.n(h),m=function(){return g()()},p=function(e,t,n){if(!e||"object"!=typeof e)return{text:e,locale:t};if(e[t])return{text:e[t],locale:t};if(e[n])return{text:e[n],locale:n};if(!Object.keys(e).length)return{text:"",locale:null,translated:!1};let i=Object.keys(e)[0];return{text:e[i]||"",locale:i,translated:!1}};const y=e=>{switch(e){case"string":case"text":case"markdown":case"json":return!0;default:return!1}},b=e=>void 0!==e.translatable?e.translatable:y(e.type);let w=function(e){return e=(e+"").toString(),encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")};var v=function(e,t,n){let i,r,o=[],s=function(e,t,n){let i,r=[];if(!0===t?t="1":!1===t&&(t="0"),null!=t){if("object"==typeof t){for(i in t)null!=t[i]&&r.push(s(e+"["+i+"]",t[i],n));return r.join(n)}if("function"!=typeof t)return w(e)+"="+w(t);throw new Error("There was an error processing for httpBuildQuery().")}return""};for(r in n||(n="&"),e){i=e[r],t&&!isNaN(r)&&(r=String(t)+r);let a=s(r,i,n);""!==a&&o.push(a)}return o.join(n)};let I=function(e){if("object"!=typeof e)return!1;let t=0;for(let n of Object.keys(e))if(+n!=t++)return!1;return!0},k=function(e){for(let[t,n]of Object.entries(e))n&&"object"==typeof n&&(e[t]=k(n)),I(n)&&(e[t]=Object.values(n));return e};var S=function(e){let t={};return function(e,t){var n,i,r,o,s,a,l,c,u,d,f,h,g,m=String(e).replace(/^&/,"").replace(/&$/,"").split("&"),p=m.length,y=function(e){return decodeURIComponent(e.replace(/\+/g,"%20"))};for(t||(t=this.window),n=0;n<p;n++){for(u=y((c=m[n].split("="))[0]),d=c.length<2?"":y(c[1]);" "===u.charAt(0);)u=u.slice(1);if(u.indexOf("\0")>-1&&(u=u.slice(0,u.indexOf("\0"))),u&&"["!==u.charAt(0)){for(h=[],f=0,i=0;i<u.length;i++)if("["!==u.charAt(i)||f){if("]"===u.charAt(i)&&f&&(h.length||h.push(u.slice(0,f-1)),h.push(u.substr(f,i-f)),f=0,"["!==u.charAt(i+1)))break}else f=i+1;for(h.length||(h=[u]),i=0;i<h[0].length&&(" "!==(l=h[0].charAt(i))&&"."!==l&&"["!==l||(h[0]=h[0].substr(0,i)+"_"+h[0].substr(i+1)),"["!==l);i++);for(a=t,i=0,g=h.length;i<g;i++)if(u=h[i].replace(/^['"]/,"").replace(/['"]$/,""),i!==h.length-1,s=a,""!==u&&" "!==u||0===i)void 0===a[u]&&(a[u]={}),a=a[u];else{for(o in r=-1,a)a.hasOwnProperty(o)&&+o>r&&o.match(/^\d+$/g)&&(r=+o);u=r+1}s[u]=d}}}(e,t),t=k(t),t};const x=Boolean("undefined"==typeof window||!window.location.hostname||"localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function C(){if("serviceWorker"in navigator){const e=process.env.PUBLIC_URL||"/";if(new URL(e,window.location).origin!==window.location.origin)return;window.addEventListener("load",()=>{const e="/service-worker.js";x?function(e){fetch(e).then(t=>{404===t.status||-1===t.headers.get("content-type").indexOf("javascript")?navigator.serviceWorker.ready.then(e=>{e.unregister().then(()=>{window.location.reload()})}):T(e)}).catch(()=>{console.log("No internet connection found. App is running in offline mode.")})}(e):T(e)})}}function T(e){navigator.serviceWorker.register(e).then(e=>{e.onupdatefound=()=>{const t=e.installing;t.onstatechange=()=>{"installed"===t.state&&(navigator.serviceWorker.controller?console.log("New content is available; please refresh."):console.log("Content is cached for offline use."))}}}).catch(e=>{console.error("Error during service worker registration:",e)})}var O=function(){let e,t,n={};if(this.registerCallBack=function(e,t){let i=null;do{i=Math.floor(65536*(1+Math.random())).toString(16).substring(1)}while(i in n);return n[i]={hidden:e,active:t},i},this.removeCallBack=function(e){delete n[e]},"undefined"==typeof document?(e=!1,t=!1):void 0!==document.hidden?(e="hidden",t="visibilitychange"):void 0!==document.mozHidden?(e="mozHidden",t="mozvisibilitychange"):void 0!==document.msHidden?(e="msHidden",t="msvisibilitychange"):void 0!==document.webkitHidden&&(e="webkitHidden",t="webkitvisibilitychange"),e&&t){let i=function(){for(let t of Object.values(n))document[e]?t.hidden():t.active()};void 0===document.addEventListener||void 0===document[e]?console.warn("This feature requires a browser, such as Google Chrome or Firefox, that supports the Page Visibility API."):document.addEventListener(t,i,!1)}},j=[{size:12,name:"1",icon:"looks_one"},{size:6,name:"1/2",icon:"looks_two"},{size:4,name:"1/3",icon:"looks_3"},{size:8,name:"2/3",icon:"looks_3"},{size:3,name:"1/4",icon:"looks_4"},{size:9,name:"3/4",icon:"looks_4"},{size:2,name:"1/6",icon:"looks_6"}];var E=class{constructor(e={}){this.tasticId=e.tasticId||m(),this.tasticType=e.tasticType,this.configuration=e.configuration||{};let t=[{name:"General settings",folded:!0,fields:[{label:"Name",field:"name",type:"string"},{label:"Show on mobile",field:"mobile",type:"boolean",default:!0},{label:"Show on tablet",field:"tablet",type:"boolean",default:!0},{label:"Show on desktop",field:"desktop",type:"boolean",default:!0},{label:"Anchor",field:"tasticId",type:"string",translatable:!1,disabled:!0,default:"#"+this.tasticId}]}];if(e.schema)for(let n=0;n<e.schema.length;++n)t.push(e.schema[n]);this.schema=new d(t,this.configuration)}export(){return{tasticId:this.tasticId,tasticType:this.tasticType,configuration:this.schema.getConfiguration()}}};var D=class{constructor(e={}){if(this.cellId=e.cellId||m(),this.configuration=e.configuration||{},this.customConfiguration=e.customConfiguration||{},this.schema=new d([{name:"General settings",folded:!0,fields:[{label:"Layout element width",field:"size",type:"enum",values:j&&j.map(e=>({name:e.name,value:e.size})),default:12},{label:"Show on mobile",field:"mobile",type:"boolean",default:!0},{label:"Show on tablet",field:"tablet",type:"boolean",default:!0},{label:"Show on desktop",field:"desktop",type:"boolean",default:!0}]}],this.configuration),this.tastics=[],e.tastics&&e.tastics.length)for(let t=0;t<e.tastics.length;++t)this.tastics.push(new E(e.tastics[t]))}addTastic(e,t={},n=[],i=0){const r=new E({tasticType:e,configuration:t,schema:n});return this.tastics.splice(i,0,r),r}getTastic(e){for(let t of this.tastics)if(t.tasticId===e)return t;throw new Error("Could not find component with ID "+e)}getTasticCount(){return this.tastics.length}export(){return{cellId:this.cellId,configuration:this.schema.getConfiguration(),customConfiguration:this.customConfiguration,tastics:this.tastics.map(e=>e.export())}}};var F=class{constructor(e){if(!e.kitDefinitionId)throw new Error("Missing kitDefinitionId in "+JSON.stringify(e));this.kitDefinitionId=e.kitDefinitionId,this.kitId=e.kitId||m(),this.configuration=e.configuration||{}}export(){return{kitId:this.kitId,kitDefinitionId:this.kitDefinitionId,configuration:this.configuration}}};var N=class{constructor(e={}){if(this.regionId=e.regionId||m(),this.configuration=e.configuration||{},this.schema=new d([{name:"Responsive",folded:!0,fields:[{label:"Show on mobile",field:"mobile",type:"boolean",default:!0},{label:"Show on tablet",field:"tablet",type:"boolean",default:!0},{label:"Show on desktop",field:"desktop",type:"boolean",default:!0}]},{name:"Layout",fields:[{label:"Cell direction",field:"flexDirection",type:"enum",default:"row",values:[{value:"row",name:"Row"},{value:"column",name:"Column"},{value:"row-reverse",name:"Row (reversed)"},{value:"column-reverse",name:"Column (reversed)"}]},{label:"Cell wrapping",field:"flexWrap",type:"enum",default:"wrap",values:[{value:"nowrap",name:"No wrapping"},{value:"wrap",name:"Wrap cells"}]},{label:"Justify cells",field:"justifyContent",type:"enum",default:"space-between",values:[{value:"flex-start",name:"Put at beginning"},{value:"flex-end",name:"Put at end"},{value:"center",name:"Center Cells"},{value:"space-between",name:"Space between cells"},{value:"space-around",name:"Space around cells"},{value:"space-even",name:"Evenly spaced cells"}]},{label:"Cell alignment",field:"alignItems",type:"enum",default:"stretch",values:[{value:"flex-start",name:"Align to start"},{value:"flex-end",name:"Align to end"},{value:"center",name:"Center cells"},{value:"stretch",name:"Stretch cells"},{value:"baseline",name:"Align to baseline"}]},{label:"Align multiple cell rows",field:"alignContent",type:"enum",default:"space-between",values:[{value:"flex-start",name:"Put at beginning"},{value:"flex-end",name:"Put at end"},{value:"center",name:"Center rows"},{value:"stretch",name:"Stretch rows"},{value:"space-between",name:"Space between rows"},{value:"space-around",name:"Space around rows"}]}]}],this.configuration),this.elements=[],e.elements&&e.elements.length)for(let t=0;t<e.elements.length;++t)this.addElement(e.elements[t])}addElement(e){if(e.cellId)return this.addCell(e);if(e.kitId)return this.addKit(e);throw new TypeError("Unknown element type: "+JSON.stringify(e))}addCell(e){return this.elements.push(new D(e)),this.elements[this.elements.length-1]}addKit(e){return this.elements.push(new F(e)),this.elements[this.elements.length-1]}getElement(e){const t=Object.keys(e)[0],n=Object.values(e)[0];for(let e of this.elements)if(e[t]===n)return e;throw new Error("Could not find element with ID "+JSON.stringify(n))}getCells(){return this.elements.filter(e=>e instanceof D)}getKits(){return this.elements.filter(e=>e instanceof F)}export(){return{regionId:this.regionId,configuration:this.schema.getConfiguration(),elements:this.elements.map(e=>e.export())}}};var M=class{constructor(e={},t=[],n=[]){this.pageId=e.pageId||null,this.nodes=e.nodes||[],this.layoutId=e.layoutId||"three_rows",this.name=e.name||"Unnamed Page",this.regions={},this.tasticSchemas=(n||[]).map(e=>e.configurationSchema);for(let n=0;n<t.length;++n){let i=t[n];e.regions&&e.regions[i]&&e.regions[i].elements&&e.regions[i].elements.length&&(e.regions[i].elements=this.mapTastics(e.regions[i].elements)),this.createRegion(i,e.regions&&e.regions[i]||{})}}mapTastics(e){for(let t=0;t<e.length;++t){let n=e[t];if(n.cellId&&(n.tastics&&n.tastics.length))for(let e=0;e<n.tastics.length;++e){let t=n.tastics[e];t.schema={schema:[]};for(let e of this.tasticSchemas)if(e.tasticType===t.tasticType){t.schema=e.schema;break}}}return e}createRegion(e,t){t.regionId=e,this.regions[e]=new N(t)}getRegion(e){if(!this.regions[e])throw new Error("Region with identifier "+e+" unknown.");return this.regions[e]}addCell(e,t={}){return this.getRegion(e).addCell({configuration:t})}duplicateCell(e,t){const n=this.addCell(e,t.configuration);return t.tastics.forEach((t,i)=>{this.addTastic(e,n.cellId,t.tasticType,i,t.configuration)}),n}addKit(e,t){return this.getRegion(e).addKit(t)}findElement(e){const t=Object.keys(e)[0],n=Object.values(e)[0];for(let e in this.regions)for(let[i,r]of Object.entries(this.regions[e].elements))if(r[t]===n)return[e,+i];throw new Error("Could not find element with "+JSON.stringify(e))}hasElement(e){try{return!!this.findElement(e)}catch(e){return!1}}getElement(e){let[t,n]=this.findElement(e);return this.regions[t].elements[n]}removeElement(e){let[t,n]=this.findElement(e);this.regions[t].elements.splice(n,1)}moveElement(e,t){if(!this.regions[t.region])throw new Error("Unknown target region "+t.region);let[n,i]=this.findElement(e),r=this.regions[n].elements.splice(i,1)[0];this.regions[t.region].elements.splice(void 0===t.element?this.regions[t.region].elements.length:t.element-(n===t.region&&t.element>i?1:0),0,r)}addTastic(e,t,n,i,r={}){let o=null;for(let e of this.tasticSchemas)if(e.tasticType===n){o=e;break}return this.getRegion(e).getElement({cellId:t}).addTastic(n,r,o,i)}getTastics(){let e=[];return Object.values(this.regions).forEach(t=>{t.getCells().forEach(t=>{e=e.concat(t.tastics)})}),e}findTastic(e){for(let t in this.regions)for(let n=0;n<this.regions[t].elements.length;++n)for(let i in this.regions[t].elements[n].tastics||[]){if(this.regions[t].elements[n].tastics[i].tasticId===e)return[t,+n,+i]}throw new Error("Could not find tastic with id "+e)}hasTastic(e){try{return!!this.findTastic(e)}catch(e){return!1}}getTastic(e){let[t,n,i]=this.findTastic(e);return this.regions[t].elements[n].tastics[i]}removeTastic(e){let[t,n,i]=this.findTastic(e);this.regions[t].elements[n].tastics.splice(i,1)}moveTastic(e,t){let[n,i,r]=this.findTastic(e),o=this.regions[n].elements[i].tastics.splice(r,1)[0],[s,a]=this.findElement({cellId:t.cell});this.regions[s].elements[a].tastics.splice(void 0===t.tasticDropPosition?this.regions[s].elements[a].tastics.length:t.tasticDropPosition-(n===s&&i===a&&t.tasticDropPosition>=r?1:0),0,o)}duplicateTastic(e,t){const[n,,i]=this.findTastic(e),r=this.getTastic(e);return this.addTastic(n,t,r.tasticType,i+1,r.configuration)}export(){let e={};for(let[t,n]of Object.entries(this.regions))e[t]=n.export();return{pageId:this.pageId,nodes:this.nodes,layoutId:this.layoutId,name:this.name,regions:e}}};const R=(e,t,n)=>{n={resourceType:"image",type:"upload",...n};let i=[];for(let[e,t]of Object.entries(n))switch(e){case"secure":case"resourceType":case"type":break;case"background":case"crop":case"fetch_format":case"gravity":case"height":case"quality":case"width":case"x":case"y":t&&i.push(e[0]+"_"+t);break;default:throw new Error("Unhandled image transformation "+e)}return i.sort(),`https://res.cloudinary.com/${t.cloudName}/${n.resourceType}/${n.type}/${i.join(",")}/${r=e,encodeURI(r).replace(/[?=]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}`;var r};var P=class{constructor(e){this.configuration={cloudName:e.cloudName}}getImageUrl(e,t,n,i={}){return R(e.mediaId,this.configuration,{fetch_format:e.format&&"svg"===e.format?void 0:"auto",width:t,height:n,secure:!0,...this.getQuality(i),...this.getFetchFormat(i),...this.getGravityOptions(i),...this.cropOptions(i)})}getFetchImageUrl(e,t,n,i={}){return e.startsWith("//")&&(e="https:"+e),R(e,this.configuration,{fetch_format:"auto",type:"fetch",width:t,height:n,secure:!0,...this.getQuality(i),...this.getFetchFormat(i),...this.getGravityOptions(i),...this.cropOptions(i)})}getImageUrlWithoutDefaults(e,t,n,i={}){return R(e.mediaId,this.configuration,{width:t,height:n,...i})}getGravityOptions(e){if(e.crop)return{};let t={gravity:"faces:auto"};return e.gravity&&(t.gravity="custom"===e.gravity.mode?"xy_center":e.gravity.mode,e.gravity.coordinates&&(t.x=e.gravity.coordinates.x,t.y=e.gravity.coordinates.y)),t}cropOptions(e){let t={crop:"fill"};return e.crop&&(t.crop=e.crop),e.background&&(t.background=e.background),t}getQuality(e){let t={quality:"auto"};return e.quality&&(t.quality=e.quality),t}getFetchFormat(e){let t={};return e.fetch_format&&(t.fetch_format=e.fetch_format),e.fetchFormat&&(t.fetch_format=e.fetchFormat),t}};var A=class{constructor(){this.imageSizes=[16,32,64,128,256,512,1024,2048]}getImageDimensions(e,t,n,i=null,r=1){let o=this.getFloatRatio(e,i),s=t&&Math.round(+t*r),a=n&&Math.round(+n*r);return s&&i&&(a=Math.round(s*o)),a&&!s&&i&&(s=Math.round(a/o)),[s,a]}getFloatRatio(e=null,t=null){if(!t&&e&&e.width&&e.height)return e.height/e.width;const n=String(t).match(/([0-9]+):([0-9]+)/);return n?n[2]/n[1]:t}getImageLink(e,t,n,i,r,o={},s=1){let a=this.getMediaApi(t),[l,c]=this.getImageDimensions(e,n,i,r,s),u=l/c;if(["fill","pad"].includes(o.crop)){for(let e=0;e<this.imageSizes.length;++e)if(this.imageSizes[e]>=l){l=this.imageSizes[e];break}c=o.autoHeight?null:Math.ceil(l/u)}return"string"==typeof e?a.getFetchImageUrl(e,l,c,o):a.getImageUrl(e,l,c,o)}getMediaApi(e){switch(e.media.engine){case"cloudinary":return new P(e.media);default:throw new Error("No valid media API found.")}}static getElementDimensions(e){let t=0;if(getComputedStyle){let n=getComputedStyle(e);t+=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)}return{width:e.clientWidth-t,height:e.clientHeight}}},_=n(0),U={enum:_,localizedEnum:_},q=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>!t.includes(e))),z=(e,t=null)=>{"undefined"!=typeof PRODUCTION&&PRODUCTION||"undefined"==typeof window||!window||!window.document||console.info("%c🗑 %cDeprecation Notice: %s %s","color: gray","color: orange",t?"["+(t.displayName||t.constructor.name)+"]":"",e)},H=(e,t,n=!1)=>{let i=!1;return function(){let r=this,o=arguments,s=function(){i=null,n||e.apply(r,o)},a=n&&!i;clearTimeout(i),i=setTimeout(s,t),a&&e.apply(r,o)}},W=(e,t)=>{let n=!1;return function(){n||(e.apply(this,arguments),n=!0,setTimeout((function(){n=!1}),t))}};var L=class{constructor(e,t={}){if(this.context={customer:"demo",idDebug:!1,endpoint:"preview",...e},this.messageHandlers=t,!this.context.previewId)throw new Error("context.previewId is required");this.webSocket=null,this.connected=!1,this.connectionFails=0,this.connect()}connect(){this.webSocket=new WebSocket((this.context.isDebug?"ws://":"wss://")+this.context.customer+".frontastic.io"+(this.context.isDebug?".local":"")+`:8080/ws?${this.context.endpoint}=${this.context.previewId}`),this.webSocket.onmessage=this.handleMessage.bind(this),this.webSocket.onopen=()=>{this.connectionFails=0,this.connected=!0},this.webSocket.onclose=()=>{this.webSocket=null,this.connected=!1,setTimeout(this.connect.bind(this),1e3*Math.min(++this.connectionFails,30))}}handleMessage(e){let t=JSON.parse(e.data);if("Ping"!==t.Name)return this.messageHandlers[t.Name]?this.messageHandlers[t.Name](t.Payload,t):void console.info("Unknown WebSocket message",t)}sendMessage(e,t=!1){if(e.Channel=this.context.previewId,e.Payload=e.Payload||[],this.connected)return this.webSocket.send(JSON.stringify(e));t&&setTimeout(()=>{this.sendMessage(e,!0)},100)}};n.d(t,"ConfigurationSchema",(function(){return d})),n.d(t,"DefaultSchemas",(function(){return f})),n.d(t,"generateId",(function(){return m})),n.d(t,"getTranslation",(function(){return p})),n.d(t,"httpBuildQuery",(function(){return v})),n.d(t,"httpParseQuery",(function(){return S})),n.d(t,"isTranslatableByDefault",(function(){return y})),n.d(t,"shouldFieldBeTranslated",(function(){return b})),n.d(t,"registerServiceWorker",(function(){return C})),n.d(t,"VisibilityChange",(function(){return O})),n.d(t,"cellDimensions",(function(){return j})),n.d(t,"Cell",(function(){return D})),n.d(t,"Page",(function(){return M})),n.d(t,"Region",(function(){return N})),n.d(t,"Tastic",(function(){return E})),n.d(t,"MediaApi",(function(){return A})),n.d(t,"FacetTypeSchemaMap",(function(){return U})),n.d(t,"omit",(function(){return q})),n.d(t,"deprecate",(function(){return z})),n.d(t,"debounce",(function(){return H})),n.d(t,"throttle",(function(){return W})),n.d(t,"Notifier",(function(){return L}))}])}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["frontastic-common"]=t():e["frontastic-common"]=t()}(global,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e){e.exports=JSON.parse('{"schema":[{"name":"Value Order","fields":[{"label":"Strip Label Prefix","field":"stripLabelPrefix","type":"boolean","default":false},{"label":"Sort Order","field":"sortOrder","type":"enum","values":[{"value":"sort-undefined","name":"Undefined"},{"value":"sort-ascending","name":"Ascending"},{"value":"sort-descending","name":"Descending"}],"default":"sort-undefined"}]}]}')},function(e){e.exports=JSON.parse('{"schema":[{"name":"Display properties","fields":[{"label":"Highlight menu item","field":"displayHighlightMenuItem","type":"boolean","default":false},{"label":"Highlight category tag","field":"displayHighlightCategoryTag","type":"boolean","default":false},{"label":"Description","field":"displayDescription","type":"string","translatable":true},{"label":"Custom CSS class","field":"displayClassname","type":"string","translatable":false},{"label":"Image","field":"displayMedia","type":"media","options":{"ratio":"4:1"}}]},{"name":"SEO","fields":[{"label":"Title","field":"seoTitle","type":"string","translatable":true},{"label":"Description","field":"seoDescription","type":"string","translatable":true},{"label":"Keywords","field":"seoKeywords","type":"string","translatable":true}]}]}')},function(e){e.exports=JSON.parse('{"schema":[]}')},function(e,t,n){var i=n(4),r=n(6);e.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||i)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[o+a]=s[a];return t||r(s)}},function(e,t,n){var i=n(5);e.exports=function(){return i.randomBytes(16)}},function(e,t){e.exports=require("crypto")},function(e,t){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);e.exports=function(e,t){var i=t||0,r=n;return[r[e[i++]],r[e[i++]],r[e[i++]],r[e[i++]],"-",r[e[i++]],r[e[i++]],"-",r[e[i++]],r[e[i++]],"-",r[e[i++]],r[e[i++]],"-",r[e[i++]],r[e[i++]],r[e[i++]],r[e[i++]],r[e[i++]],r[e[i++]]].join("")}},function(e,t,n){"use strict";n.r(t);const i=["product","product-list","content","content-list"];function r(e,t,n){return void 0!==e?Boolean(e):"stream"===t&&i.includes(n)}function o(e){if(!Array.isArray(e.fields))return{};let t={};for(let n=0;n<e.fields.length;++n){const i=e.fields[n];if(!i.field)continue;const o=i.type||"text";t[i.field]={field:i.field,type:o,sectionName:e.name||"",values:i.values||[],default:c(o,i.default),validate:i.validate||{},fields:i.fields||null,min:void 0===i.min?1:i.min,max:i.max||16,required:r(i.required,o,i.streamType),disabled:!0===i.disabled,translatable:i.translatable}}return t}function s(e,t){let n=e.default;if(void 0!==t[e.field]&&null!==t[e.field]&&(n=t[e.field]),"group"===e.type){let t=(n||[]).slice(0,e.max);for(let n=t.length;n<e.min;++n)t[n]={};return i=t,r=e.fields,(i||[]).map(e=>{null!==e&&"object"==typeof e||(e={});for(let t of r)void 0!==e[t.field]&&null!==e[t.field]||(e[t.field]=t.default||null);return e})}var i,r;return n}function a(e,t,n,i){("object"!=typeof i||Array.isArray(i))&&(i={});let r={};for(let o of Object.values(e))r[o.field]=l(o,t,n,i);return r}function l(e,t,n,i){const r=i[e.field];if("group"===e.type){const i=o(e);return s(e,t).map((e,t)=>{const o=void 0!==r&&r.length>t?r[t]:{};return a(i,e,n,o)})}if(void 0!==r)return r;const l=s(e,t);return"stream"===e.type?n[l]||null:l}function c(e,t){if(void 0!==t)return t;switch(e){case"group":return[];case"decimal":case"integer":case"float":case"number":return 0;case"string":case"text":case"markdown":return"";case"json":return"{}";case"boolean":return!1;default:return null}}class u{constructor(e=[],t={}){this.schema=e,this.setConfiguration(t),this.fields={};for(let e=0;e<this.schema.length;++e)this.fields={...this.fields,...o(this.schema[e])}}setConfiguration(e){this.configuration=Array.isArray(e)?{}:e||{}}set(e,t){if(!this.fields[e])throw new Error("Unknown field "+e+" in this configuration schema.");return new u(this.schema,{...this.configuration,[e]:t})}get(e){const t=this.fields[e];return t?s(t,this.configuration):(console.warn("Unknown field "+e+" in this configuration schema."),this.configuration[e]||null)}getField(e){const t=this.fields[e];if(!t)throw new Error("Unknown field "+e+" in this configuration schema.");return t}has(e){return!!this.fields[e]}getSchema(){return this.schema}getConfiguration(){return this.configuration}isFieldRequired(e){return this.getField(e).required}isFieldDisabled(e){return this.getField(e).disabled}hasMissingRequiredValueInField(e,t=!1){const n=this.getField(e),i=this.get(e);return"group"===n.type?i.some(e=>new u([n],e).hasMissingRequiredFieldValues(t)):!!n.required&&(("stream"!==n.type||!t)&&("reference"===n.type?"object"!=typeof i||null===i||"string"!=typeof i.type||""===i.type||"string"!=typeof i.target||""===i.target:"stream"===n.type&&i||"media"===n.type&&i||"string"===n.type&&n.translatable&&i?Object.values(i).some(e=>!e):null==i||""===i))}hasMissingRequiredFieldValues(e=!1){return Object.keys(this.fields).some(t=>this.hasMissingRequiredValueInField(t,e))}hasMissingRequiredFieldValuesInSection(e,t=!1){return Object.entries(this.fields).some(([n,i])=>i.sectionName===e&&this.hasMissingRequiredValueInField(n,t))}getConfigurationWithResolvedStreams(e={},t={}){return a(this.fields,this.configuration,e,t)}}var d=u,f={NodeConfigurationSchema:n(1),CellConfigurationSchema:n(2)},h=n(3),g=n.n(h),m=function(){return g()()},p=function(e,t,n){if(!e||"object"!=typeof e)return{text:e,locale:t};if(e[t])return{text:e[t],locale:t};if(e[n])return{text:e[n],locale:n};if(!Object.keys(e).length)return{text:"",locale:null,translated:!1};let i=Object.keys(e)[0];return{text:e[i]||"",locale:i,translated:!1}};const y=e=>{switch(e){case"string":case"text":case"markdown":case"json":return!0;default:return!1}},b=e=>void 0!==e.translatable?e.translatable:y(e.type);let w=function(e){return e=(e+"").toString(),encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")};var v=function(e,t,n){let i,r,o=[],s=function(e,t,n){let i,r=[];if(!0===t?t="1":!1===t&&(t="0"),null!=t){if("object"==typeof t){for(i in t)null!=t[i]&&r.push(s(e+"["+i+"]",t[i],n));return r.join(n)}if("function"!=typeof t)return w(e)+"="+w(t);throw new Error("There was an error processing for httpBuildQuery().")}return""};for(r in n||(n="&"),e){i=e[r],t&&!isNaN(r)&&(r=String(t)+r);let a=s(r,i,n);""!==a&&o.push(a)}return o.join(n)};let I=function(e){if("object"!=typeof e)return!1;let t=0;for(let n of Object.keys(e))if(+n!=t++)return!1;return!0},k=function(e){for(let[t,n]of Object.entries(e))n&&"object"==typeof n&&(e[t]=k(n)),I(n)&&(e[t]=Object.values(n));return e};var S=function(e){let t={};return function(e,t){var n,i,r,o,s,a,l,c,u,d,f,h,g,m=String(e).replace(/^&/,"").replace(/&$/,"").split("&"),p=m.length,y=function(e){return decodeURIComponent(e.replace(/\+/g,"%20"))};for(t||(t=this.window),n=0;n<p;n++){for(u=y((c=m[n].split("="))[0]),d=c.length<2?"":y(c[1]);" "===u.charAt(0);)u=u.slice(1);if(u.indexOf("\0")>-1&&(u=u.slice(0,u.indexOf("\0"))),u&&"["!==u.charAt(0)){for(h=[],f=0,i=0;i<u.length;i++)if("["!==u.charAt(i)||f){if("]"===u.charAt(i)&&f&&(h.length||h.push(u.slice(0,f-1)),h.push(u.substr(f,i-f)),f=0,"["!==u.charAt(i+1)))break}else f=i+1;for(h.length||(h=[u]),i=0;i<h[0].length&&(" "!==(l=h[0].charAt(i))&&"."!==l&&"["!==l||(h[0]=h[0].substr(0,i)+"_"+h[0].substr(i+1)),"["!==l);i++);for(a=t,i=0,g=h.length;i<g;i++)if(u=h[i].replace(/^['"]/,"").replace(/['"]$/,""),i!==h.length-1,s=a,""!==u&&" "!==u||0===i)void 0===a[u]&&(a[u]={}),a=a[u];else{for(o in r=-1,a)a.hasOwnProperty(o)&&+o>r&&o.match(/^\d+$/g)&&(r=+o);u=r+1}s[u]=d}}}(e,t),t=k(t),t};const x=Boolean("undefined"==typeof window||!window.location.hostname||"localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function C(){if("serviceWorker"in navigator){const e=process.env.PUBLIC_URL||"/";if(new URL(e,window.location).origin!==window.location.origin)return;window.addEventListener("load",()=>{const e="/service-worker.js";x?function(e){fetch(e).then(t=>{404===t.status||-1===t.headers.get("content-type").indexOf("javascript")?navigator.serviceWorker.ready.then(e=>{e.unregister().then(()=>{window.location.reload()})}):T(e)}).catch(()=>{console.log("No internet connection found. App is running in offline mode.")})}(e):T(e)})}}function T(e){navigator.serviceWorker.register(e).then(e=>{e.onupdatefound=()=>{const t=e.installing;t.onstatechange=()=>{"installed"===t.state&&(navigator.serviceWorker.controller?console.log("New content is available; please refresh."):console.log("Content is cached for offline use."))}}}).catch(e=>{console.error("Error during service worker registration:",e)})}var O=function(){let e,t,n={};if(this.registerCallBack=function(e,t){let i=null;do{i=Math.floor(65536*(1+Math.random())).toString(16).substring(1)}while(i in n);return n[i]={hidden:e,active:t},i},this.removeCallBack=function(e){delete n[e]},"undefined"==typeof document?(e=!1,t=!1):void 0!==document.hidden?(e="hidden",t="visibilitychange"):void 0!==document.mozHidden?(e="mozHidden",t="mozvisibilitychange"):void 0!==document.msHidden?(e="msHidden",t="msvisibilitychange"):void 0!==document.webkitHidden&&(e="webkitHidden",t="webkitvisibilitychange"),e&&t){let i=function(){for(let t of Object.values(n))document[e]?t.hidden():t.active()};void 0===document.addEventListener||void 0===document[e]?console.warn("This feature requires a browser, such as Google Chrome or Firefox, that supports the Page Visibility API."):document.addEventListener(t,i,!1)}},j=[{size:12,name:"1",icon:"looks_one"},{size:6,name:"1/2",icon:"looks_two"},{size:4,name:"1/3",icon:"looks_3"},{size:8,name:"2/3",icon:"looks_3"},{size:3,name:"1/4",icon:"looks_4"},{size:9,name:"3/4",icon:"looks_4"},{size:2,name:"1/6",icon:"looks_6"}];var E=class{constructor(e={}){this.tasticId=e.tasticId||m(),this.tasticType=e.tasticType,this.configuration=e.configuration||{};let t=[{name:"General settings",folded:!0,fields:[{label:"Name",field:"name",type:"string"},{label:"Show on mobile",field:"mobile",type:"boolean",default:!0},{label:"Show on tablet",field:"tablet",type:"boolean",default:!0},{label:"Show on desktop",field:"desktop",type:"boolean",default:!0},{label:"Anchor",field:"tasticId",type:"string",translatable:!1,disabled:!0,default:"#"+this.tasticId}]}];if(e.schema)for(let n=0;n<e.schema.length;++n)t.push(e.schema[n]);this.schema=new d(t,this.configuration)}export(){return{tasticId:this.tasticId,tasticType:this.tasticType,configuration:this.schema.getConfiguration()}}};var D=class{constructor(e={}){if(this.cellId=e.cellId||m(),this.configuration=e.configuration||{},this.customConfiguration=e.customConfiguration||{},this.schema=new d([{name:"General settings",folded:!0,fields:[{label:"Layout element width",field:"size",type:"enum",values:j&&j.map(e=>({name:e.name,value:e.size})),default:12},{label:"Show on mobile",field:"mobile",type:"boolean",default:!0},{label:"Show on tablet",field:"tablet",type:"boolean",default:!0},{label:"Show on desktop",field:"desktop",type:"boolean",default:!0}]}],this.configuration),this.tastics=[],e.tastics&&e.tastics.length)for(let t=0;t<e.tastics.length;++t)this.tastics.push(new E(e.tastics[t]))}addTastic(e,t={},n=[],i=0){const r=new E({tasticType:e,configuration:t,schema:n});return this.tastics.splice(i,0,r),r}getTastic(e){for(let t of this.tastics)if(t.tasticId===e)return t;throw new Error("Could not find component with ID "+e)}getTasticCount(){return this.tastics.length}export(){return{cellId:this.cellId,configuration:this.schema.getConfiguration(),customConfiguration:this.customConfiguration,tastics:this.tastics.map(e=>e.export())}}};var F=class{constructor(e){if(!e.kitDefinitionId)throw new Error("Missing kitDefinitionId in "+JSON.stringify(e));this.kitDefinitionId=e.kitDefinitionId,this.kitId=e.kitId||m(),this.configuration=e.configuration||{}}export(){return{kitId:this.kitId,kitDefinitionId:this.kitDefinitionId,configuration:this.configuration}}};var N=class{constructor(e={}){if(this.regionId=e.regionId||m(),this.configuration=e.configuration||{},this.schema=new d([{name:"Responsive",folded:!0,fields:[{label:"Show on mobile",field:"mobile",type:"boolean",default:!0},{label:"Show on tablet",field:"tablet",type:"boolean",default:!0},{label:"Show on desktop",field:"desktop",type:"boolean",default:!0}]},{name:"Layout",fields:[{label:"Cell direction",field:"flexDirection",type:"enum",default:"row",values:[{value:"row",name:"Row"},{value:"column",name:"Column"},{value:"row-reverse",name:"Row (reversed)"},{value:"column-reverse",name:"Column (reversed)"}]},{label:"Cell wrapping",field:"flexWrap",type:"enum",default:"wrap",values:[{value:"nowrap",name:"No wrapping"},{value:"wrap",name:"Wrap cells"}]},{label:"Justify cells",field:"justifyContent",type:"enum",default:"space-between",values:[{value:"flex-start",name:"Put at beginning"},{value:"flex-end",name:"Put at end"},{value:"center",name:"Center Cells"},{value:"space-between",name:"Space between cells"},{value:"space-around",name:"Space around cells"},{value:"space-even",name:"Evenly spaced cells"}]},{label:"Cell alignment",field:"alignItems",type:"enum",default:"stretch",values:[{value:"flex-start",name:"Align to start"},{value:"flex-end",name:"Align to end"},{value:"center",name:"Center cells"},{value:"stretch",name:"Stretch cells"},{value:"baseline",name:"Align to baseline"}]},{label:"Align multiple cell rows",field:"alignContent",type:"enum",default:"space-between",values:[{value:"flex-start",name:"Put at beginning"},{value:"flex-end",name:"Put at end"},{value:"center",name:"Center rows"},{value:"stretch",name:"Stretch rows"},{value:"space-between",name:"Space between rows"},{value:"space-around",name:"Space around rows"}]}]}],this.configuration),this.elements=[],e.elements&&e.elements.length)for(let t=0;t<e.elements.length;++t)this.addElement(e.elements[t])}addElement(e){if(e.cellId)return this.addCell(e);if(e.kitId)return this.addKit(e);throw new TypeError("Unknown element type: "+JSON.stringify(e))}addCell(e){return this.elements.push(new D(e)),this.elements[this.elements.length-1]}addKit(e){return this.elements.push(new F(e)),this.elements[this.elements.length-1]}getElement(e){const t=Object.keys(e)[0],n=Object.values(e)[0];for(let e of this.elements)if(e[t]===n)return e;throw new Error("Could not find element with ID "+JSON.stringify(n))}getCells(){return this.elements.filter(e=>e instanceof D)}getKits(){return this.elements.filter(e=>e instanceof F)}export(){return{regionId:this.regionId,configuration:this.schema.getConfiguration(),elements:this.elements.map(e=>e.export())}}};var M=class{constructor(e={},t=[],n=[]){this.pageId=e.pageId||null,this.nodes=e.nodes||[],this.layoutId=e.layoutId||"three_rows",this.name=e.name||"Unnamed Page",this.regions={},this.tasticSchemas=(n||[]).map(e=>e.configurationSchema);for(let n=0;n<t.length;++n){let i=t[n];e.regions&&e.regions[i]&&e.regions[i].elements&&e.regions[i].elements.length&&(e.regions[i].elements=this.mapTastics(e.regions[i].elements)),this.createRegion(i,e.regions&&e.regions[i]||{})}}mapTastics(e){for(let t=0;t<e.length;++t){let n=e[t];if(n.cellId&&(n.tastics&&n.tastics.length))for(let e=0;e<n.tastics.length;++e){let t=n.tastics[e];t.schema={schema:[]};for(let e of this.tasticSchemas)if(e.tasticType===t.tasticType){t.schema=e.schema;break}}}return e}createRegion(e,t){t.regionId=e,this.regions[e]=new N(t)}getRegion(e){if(!this.regions[e])throw new Error("Region with identifier "+e+" unknown.");return this.regions[e]}addCell(e,t={}){return this.getRegion(e).addCell({configuration:t})}duplicateCell(e,t){const n=this.addCell(e,t.configuration);return t.tastics.forEach((t,i)=>{this.addTastic(e,n.cellId,t.tasticType,i,t.configuration)}),n}addKit(e,t){return this.getRegion(e).addKit(t)}findElement(e){const t=Object.keys(e)[0],n=Object.values(e)[0];for(let e in this.regions)for(let[i,r]of Object.entries(this.regions[e].elements))if(r[t]===n)return[e,+i];throw new Error("Could not find element with "+JSON.stringify(e))}hasElement(e){try{return!!this.findElement(e)}catch(e){return!1}}getElement(e){let[t,n]=this.findElement(e);return this.regions[t].elements[n]}removeElement(e){let[t,n]=this.findElement(e);this.regions[t].elements.splice(n,1)}moveElement(e,t){if(!this.regions[t.region])throw new Error("Unknown target region "+t.region);let[n,i]=this.findElement(e),r=this.regions[n].elements.splice(i,1)[0];this.regions[t.region].elements.splice(void 0===t.element?this.regions[t.region].elements.length:t.element-(n===t.region&&t.element>i?1:0),0,r)}addTastic(e,t,n,i,r={}){let o=null;for(let e of this.tasticSchemas)if(e.tasticType===n){o=e;break}return this.getRegion(e).getElement({cellId:t}).addTastic(n,r,o,i)}getTastics(){let e=[];return Object.values(this.regions).forEach(t=>{t.getCells().forEach(t=>{e=e.concat(t.tastics)})}),e}findTastic(e){for(let t in this.regions)for(let n=0;n<this.regions[t].elements.length;++n)for(let i in this.regions[t].elements[n].tastics||[]){if(this.regions[t].elements[n].tastics[i].tasticId===e)return[t,+n,+i]}throw new Error("Could not find tastic with id "+e)}hasTastic(e){try{return!!this.findTastic(e)}catch(e){return!1}}getTastic(e){let[t,n,i]=this.findTastic(e);return this.regions[t].elements[n].tastics[i]}removeTastic(e){let[t,n,i]=this.findTastic(e);this.regions[t].elements[n].tastics.splice(i,1)}moveTastic(e,t){let[n,i,r]=this.findTastic(e),o=this.regions[n].elements[i].tastics.splice(r,1)[0],[s,a]=this.findElement({cellId:t.cell});this.regions[s].elements[a].tastics.splice(void 0===t.tasticDropPosition?this.regions[s].elements[a].tastics.length:t.tasticDropPosition-(n===s&&i===a&&t.tasticDropPosition>=r?1:0),0,o)}duplicateTastic(e,t){const[n,,i]=this.findTastic(e),r=this.getTastic(e);return this.addTastic(n,t,r.tasticType,i+1,r.configuration)}export(){let e={};for(let[t,n]of Object.entries(this.regions))e[t]=n.export();return{pageId:this.pageId,nodes:this.nodes,layoutId:this.layoutId,name:this.name,regions:e}}};const R=(e,t,n)=>{n={resourceType:"image",type:"upload",...n};let i=[];for(let[e,t]of Object.entries(n))switch(e){case"secure":case"resourceType":case"type":break;case"background":case"crop":case"fetch_format":case"gravity":case"height":case"quality":case"width":case"x":case"y":t&&i.push(e[0]+"_"+t);break;default:throw new Error("Unhandled image transformation "+e)}return i.sort(),`https://res.cloudinary.com/${t.cloudName}/${n.resourceType}/${n.type}/${i.join(",")}/${r=e,encodeURI(r).replace(/[?=]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}`;var r};var P=class{constructor(e){this.configuration={cloudName:e.cloudName}}getImageUrl(e,t,n,i={}){return R(e.mediaId,this.configuration,{fetch_format:e.format&&"svg"===e.format?void 0:"auto",width:t,height:n,secure:!0,...this.getQuality(i),...this.getFetchFormat(i),...this.getGravityOptions(i),...this.cropOptions(i)})}getFetchImageUrl(e,t,n,i={}){return e.startsWith("//")&&(e="https:"+e),R(e,this.configuration,{fetch_format:"auto",type:"fetch",width:t,height:n,secure:!0,...this.getQuality(i),...this.getFetchFormat(i),...this.getGravityOptions(i),...this.cropOptions(i)})}getImageUrlWithoutDefaults(e,t,n,i={}){return R(e.mediaId,this.configuration,{width:t,height:n,...i})}getGravityOptions(e){if(e.crop)return{};let t={gravity:"faces:auto"};return e.gravity&&(t.gravity="custom"===e.gravity.mode?"xy_center":e.gravity.mode,e.gravity.coordinates&&(t.x=e.gravity.coordinates.x,t.y=e.gravity.coordinates.y)),t}cropOptions(e){let t={crop:"fill"};return e.crop&&(t.crop=e.crop),e.background&&(t.background=e.background),t}getQuality(e){let t={quality:"auto"};return e.quality&&(t.quality=e.quality),t}getFetchFormat(e){let t={};return e.fetch_format&&(t.fetch_format=e.fetch_format),e.fetchFormat&&(t.fetch_format=e.fetchFormat),t}};var A=class{constructor(){this.imageSizes=[16,32,64,128,256,512,1024,2048]}getImageDimensions(e,t,n,i=null,r=1){let o=this.getFloatRatio(e,i),s=t&&Math.round(+t*r),a=n&&Math.round(+n*r);return s&&i&&(a=Math.round(s*o)),a&&!s&&i&&(s=Math.round(a/o)),[s,a]}getFloatRatio(e=null,t=null){if(!t&&e&&e.width&&e.height)return e.height/e.width;const n=String(t).match(/([0-9]+):([0-9]+)/);return n?n[2]/n[1]:t}getImageLink(e,t,n,i,r,o={},s=1){let a=this.getMediaApi(t),[l,c]=this.getImageDimensions(e,n,i,r,s),u=l/c;if(["fill","pad"].includes(o.crop)){for(let e=0;e<this.imageSizes.length;++e)if(this.imageSizes[e]>=l){l=this.imageSizes[e];break}c=o.autoHeight?null:Math.ceil(l/u)}return"string"==typeof e?a.getFetchImageUrl(e,l,c,o):a.getImageUrl(e,l,c,o)}getMediaApi(e){switch(e.media.engine){case"cloudinary":return new P(e.media);default:throw new Error("No valid media API found.")}}static getElementDimensions(e){let t=0;if(getComputedStyle){let n=getComputedStyle(e);t+=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)}return{width:e.clientWidth-t,height:e.clientHeight}}},_=n(0),U={enum:_,localizedEnum:_},q=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>!t.includes(e))),z=(e,t=null)=>{"undefined"!=typeof PRODUCTION&&PRODUCTION||"undefined"==typeof window||!window||!window.document||console.info("%c🗑 %cDeprecation Notice: %s %s","color: gray","color: orange",t?"["+(t.displayName||t.constructor.name)+"]":"",e)},H=(e,t,n=!1)=>{let i=!1;return function(){let r=this,o=arguments,s=function(){i=null,n||e.apply(r,o)},a=n&&!i;clearTimeout(i),i=setTimeout(s,t),a&&e.apply(r,o)}},W=(e,t)=>{let n=!1;return function(){n||(e.apply(this,arguments),n=!0,setTimeout((function(){n=!1}),t))}};var L=class{constructor(e,t={}){if(this.context={customer:"demo",idDebug:!1,endpoint:"preview",...e},this.messageHandlers=t,!this.context.previewId)throw new Error("context.previewId is required");this.webSocket=null,this.connected=!1,this.connectionFails=0,this.connect()}connect(){this.webSocket=new WebSocket((this.context.isDebug?"ws://":"wss://")+this.context.customer+".frontastic.io"+(this.context.isDebug?".local":"")+`:8080/ws?${this.context.endpoint}=${this.context.previewId}`),this.webSocket.onmessage=this.handleMessage.bind(this),this.webSocket.onopen=()=>{this.connectionFails=0,this.connected=!0},this.webSocket.onclose=()=>{this.webSocket=null,this.connected=!1,setTimeout(this.connect.bind(this),1e3*Math.min(++this.connectionFails,30))}}handleMessage(e){let t=JSON.parse(e.data);if("Ping"!==t.Name)return this.messageHandlers[t.Name]?this.messageHandlers[t.Name](t.Payload,t):void console.info("Unknown WebSocket message",t)}sendMessage(e,t=!1){if(e.Channel=this.context.previewId,e.Payload=e.Payload||[],this.connected)return this.webSocket.send(JSON.stringify(e));t&&setTimeout(()=>{this.sendMessage(e,!0)},100)}};n.d(t,"ConfigurationSchema",(function(){return d})),n.d(t,"DefaultSchemas",(function(){return f})),n.d(t,"generateId",(function(){return m})),n.d(t,"getTranslation",(function(){return p})),n.d(t,"httpBuildQuery",(function(){return v})),n.d(t,"httpParseQuery",(function(){return S})),n.d(t,"isTranslatableByDefault",(function(){return y})),n.d(t,"shouldFieldBeTranslated",(function(){return b})),n.d(t,"registerServiceWorker",(function(){return C})),n.d(t,"VisibilityChange",(function(){return O})),n.d(t,"cellDimensions",(function(){return j})),n.d(t,"Cell",(function(){return D})),n.d(t,"Page",(function(){return M})),n.d(t,"Region",(function(){return N})),n.d(t,"Tastic",(function(){return E})),n.d(t,"MediaApi",(function(){return A})),n.d(t,"FacetTypeSchemaMap",(function(){return U})),n.d(t,"omit",(function(){return q})),n.d(t,"deprecate",(function(){return z})),n.d(t,"debounce",(function(){return H})),n.d(t,"throttle",(function(){return W})),n.d(t,"Notifier",(function(){return L}))}])}));
|