@wayke-se/components-react 6.0.0-beta.0 → 6.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -38
- package/dist/assets/StyreneA-Bold-Web-4CXEYQLA-4CXEYQLA.woff2 +0 -0
- package/dist/assets/StyreneA-Bold-Web-AGBUOKS2-AGBUOKS2.woff +0 -0
- package/dist/assets/StyreneA-Light-Web-DAMPSUFB-DAMPSUFB.woff +0 -0
- package/dist/assets/StyreneA-Light-Web-EE4AJECE-EE4AJECE.woff2 +0 -0
- package/dist/assets/StyreneA-Medium-Web-53Q6X35A-53Q6X35A.woff +0 -0
- package/dist/assets/StyreneA-Medium-Web-7KYQNCKQ-7KYQNCKQ.woff2 +0 -0
- package/dist/assets/StyreneA-Regular-Web-7SAOGHB5-7SAOGHB5.woff2 +0 -0
- package/dist/assets/StyreneA-Regular-Web-XFBCXNPA-XFBCXNPA.woff +0 -0
- package/dist/chunks/chunk-XBJKSIMP.js +2 -0
- package/dist/chunks/chunk-XBJKSIMP.js.map +7 -0
- package/dist/chunks/dist-3TYBTGV5.js +1969 -0
- package/dist/chunks/dist-3TYBTGV5.js.map +7 -0
- package/dist/index.js +753 -2770
- package/dist/index.js.map +4 -4
- package/dist/style.css +11 -0
- package/dist/types/src/State/Settings/settings.d.ts +9 -3
- package/dist/types/src/components/ActionList/index.d.ts +1 -1
- package/dist/types/src/components/Content/index.d.ts +7 -2
- package/dist/types/src/components/FilterPanel/faceSelector.d.ts +3 -1
- package/dist/types/src/components/FilterPanel/rangeFacet.d.ts +3 -1
- package/dist/types/src/components/Gallery/wrapper.d.ts +7 -4
- package/dist/types/src/components/RangeSlider/RangeSliderSimple.d.ts +4 -3
- package/dist/types/src/components/RangeSlider/SliderWithLabel.d.ts +1 -2
- package/dist/types/src/components/RangeSlider/index.d.ts +3 -1
- package/dist/types/src/components/RangeSlider/wrapper.d.ts +11 -10
- package/dist/types/src/components/Sphere/SphereViewer.d.ts +0 -1
- package/dist/types/src/layouts/searchItem/useEcom.d.ts +1 -1
- package/dist/types/src/utils/markdown.d.ts +3 -0
- package/package.json +21 -13
- package/dist/assets/ajax-loader.gif +0 -0
- package/dist/assets/default.css +0 -1
- package/dist/assets/fonts/slick.eot +0 -0
- package/dist/assets/fonts/slick.svg +0 -14
- package/dist/assets/fonts/slick.ttf +0 -0
- package/dist/assets/fonts/slick.woff +0 -0
- package/dist/index.mjs +0 -5387
- package/dist/index.mjs.map +0 -7
- package/dist/types/src/components/RangeSlider/handle.d.ts +0 -9
- package/dist/types/src/components/RangeSlider/track.d.ts +0 -9
package/README.md
CHANGED
|
@@ -17,6 +17,24 @@ Add this where the vehicles should be shown, for example in an HTML block in you
|
|
|
17
17
|
</script>
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
<details>
|
|
21
|
+
<summary>The same snippet for Wayke's test environment</summary>
|
|
22
|
+
|
|
23
|
+
For a staging site or `localhost`, registered in Wayke's test environment. It shows test vehicles, and leads and orders go to test. See [Environments](#environments).
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<div id="wayke"></div>
|
|
27
|
+
<script type="module">
|
|
28
|
+
import { mount } from 'https://cdn.wayke.se/public-assets/wayke-components-react/6.0.0/index.js';
|
|
29
|
+
|
|
30
|
+
mount('#wayke', {
|
|
31
|
+
provider: { environment: 'test' },
|
|
32
|
+
});
|
|
33
|
+
</script>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
</details>
|
|
37
|
+
|
|
20
38
|
Two things to know:
|
|
21
39
|
|
|
22
40
|
* **Your domain has to be registered with Wayke.** Wayke shows the vehicles that belong to your site, and recognizes the site by its domain. Until the domain is registered, the search loads but shows no vehicles. Ask your contact at Wayke to register it, and see [Environments](#environments) for development.
|
|
@@ -63,9 +81,7 @@ There are two ways to load the script. They show the same thing and take the sam
|
|
|
63
81
|
<script type="module" src="https://cdn.wayke.se/public-assets/wayke-components-react/6.0.0/index.js"></script>
|
|
64
82
|
<script>
|
|
65
83
|
window.addEventListener('DOMContentLoaded', () => {
|
|
66
|
-
WaykeComponents.mount('#wayke'
|
|
67
|
-
provider: { ecomSettings: {} },
|
|
68
|
-
});
|
|
84
|
+
WaykeComponents.mount('#wayke');
|
|
69
85
|
});
|
|
70
86
|
</script>
|
|
71
87
|
```
|
|
@@ -93,7 +109,7 @@ To load the stylesheet yourself, add a `<link>` to it with the same URL. The scr
|
|
|
93
109
|
<link rel="stylesheet" href="https://cdn.wayke.se/public-assets/wayke-components-react/6.0.0/index.css">
|
|
94
110
|
```
|
|
95
111
|
|
|
96
|
-
To not load the stylesheet at all, add `disablecssinjection` to the script tag in option B. The
|
|
112
|
+
To not load the stylesheet at all, add `disablecssinjection` to the script tag in option B. The 360 viewer and buy online are then unstyled.
|
|
97
113
|
|
|
98
114
|
```html
|
|
99
115
|
<script type="module" src="https://cdn.wayke.se/public-assets/wayke-components-react/6.0.0/index.js" disablecssinjection></script>
|
|
@@ -101,29 +117,26 @@ To not load the stylesheet at all, add `disablecssinjection` to the script tag i
|
|
|
101
117
|
|
|
102
118
|
### React
|
|
103
119
|
|
|
104
|
-
Install the package and its peer dependencies
|
|
120
|
+
Install the package and its peer dependencies, and import its stylesheet once. The stylesheet covers everything, buy online included, and the code for buy online is only loaded when a buyer opens it. No bundler setup is needed.
|
|
105
121
|
|
|
106
122
|
```bash
|
|
107
123
|
npm install @wayke-se/components-react react react-dom styled-components
|
|
108
|
-
npm install @wayke-se/ecom-web
|
|
109
124
|
```
|
|
110
125
|
|
|
111
126
|
```tsx
|
|
112
127
|
import React from 'react';
|
|
113
128
|
import WaykeComposite, { type WaykeProviderSettings } from '@wayke-se/components-react';
|
|
114
|
-
import '@wayke-se/components-react/
|
|
115
|
-
import '@wayke-se/ecom-web/dist/index.css'; // Only with ecomSettings
|
|
129
|
+
import '@wayke-se/components-react/style.css';
|
|
116
130
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
};
|
|
131
|
+
// All settings are optional, see WaykeProviderSettings.
|
|
132
|
+
const ProviderSettings: WaykeProviderSettings = {};
|
|
120
133
|
|
|
121
134
|
const App = () => <WaykeComposite provider={ProviderSettings} />;
|
|
122
135
|
```
|
|
123
136
|
|
|
124
137
|
The React examples further down use this `ProviderSettings`.
|
|
125
138
|
|
|
126
|
-
|
|
139
|
+
The package is ESM only, with `@wayke-se/components-react` and `@wayke-se/components-react/style.css` as its entry points.
|
|
127
140
|
|
|
128
141
|
### Without React
|
|
129
142
|
|
|
@@ -131,7 +144,6 @@ The components can be added to any element on any website. React is then bundled
|
|
|
131
144
|
|
|
132
145
|
```bash
|
|
133
146
|
npm install @wayke-se/components-react react react-dom styled-components
|
|
134
|
-
npm install @wayke-se/ecom-web # Only with ecomSettings
|
|
135
147
|
```
|
|
136
148
|
|
|
137
149
|
```html
|
|
@@ -143,17 +155,12 @@ npm install @wayke-se/ecom-web # Only with ecomSettings
|
|
|
143
155
|
import { createElement } from 'react';
|
|
144
156
|
import { createRoot } from 'react-dom/client';
|
|
145
157
|
import WaykeComposite from '@wayke-se/components-react';
|
|
146
|
-
import '@wayke-se/components-react/
|
|
147
|
-
import '@wayke-se/ecom-web/dist/index.css'; // Only with ecomSettings
|
|
158
|
+
import '@wayke-se/components-react/style.css';
|
|
148
159
|
|
|
149
|
-
createRoot(document.getElementById('wayke')).render(
|
|
150
|
-
createElement(WaykeComposite, {
|
|
151
|
-
provider: { ecomSettings: {} },
|
|
152
|
-
})
|
|
153
|
-
);
|
|
160
|
+
createRoot(document.getElementById('wayke')).render(createElement(WaykeComposite));
|
|
154
161
|
```
|
|
155
162
|
|
|
156
|
-
`createElement` is used instead of JSX, so no JSX setup is needed.
|
|
163
|
+
`createElement` is used instead of JSX, so no JSX setup is needed.
|
|
157
164
|
|
|
158
165
|
## Environments
|
|
159
166
|
|
|
@@ -233,7 +240,7 @@ Only change the values in the color rules. Adding or removing properties there c
|
|
|
233
240
|
|
|
234
241
|
### Buy online colors
|
|
235
242
|
|
|
236
|
-
Buy online (ecom) has its own styles, scoped under `.waykeecom-root` and built on CSS custom properties. To change its colors, override them in a stylesheet that is loaded after
|
|
243
|
+
Buy online (ecom) has its own styles, scoped under `.waykeecom-root` and built on CSS custom properties. To change its colors, override them in a stylesheet that is loaded after `@wayke-se/components-react/style.css`. On the CDN, that is any stylesheet on your page.
|
|
237
244
|
|
|
238
245
|
```css
|
|
239
246
|
.waykeecom-root {
|
|
@@ -265,7 +272,7 @@ composite: {
|
|
|
265
272
|
|
|
266
273
|
| type | Button | Default style | Shown when |
|
|
267
274
|
|---------------|-----------------------|---------------|----------------------------------------------------|
|
|
268
|
-
| `ecom` | Buy online | primary |
|
|
275
|
+
| `ecom` | Buy online | primary | The dealer sells the vehicle online, unless `ecom.enabled` is `false` |
|
|
269
276
|
| `leadMessage` | Send message (form) | primary | Always |
|
|
270
277
|
| `leadCallMe` | Get a callback (form) | primary | Always |
|
|
271
278
|
| `email` | Show email address | secondary | The branch or contact has an email address |
|
|
@@ -522,7 +529,7 @@ The data types below describe the payloads. In TypeScript they are exported with
|
|
|
522
529
|
| currentStep | EcomStep \| undefined |
|
|
523
530
|
| data | any \| undefined |
|
|
524
531
|
|
|
525
|
-
`EcomView`, `EcomEvent` and `EcomStep` are
|
|
532
|
+
`EcomView`, `EcomEvent` and `EcomStep` are string enums from `@wayke-se/ecom-web`, which is installed with the package. Compare with their values, such as `data.view === 'SUMMARY'`, so buy online is not loaded with your own code.
|
|
526
533
|
|
|
527
534
|
#### SearchData
|
|
528
535
|
| Property | Type |
|
|
@@ -596,7 +603,7 @@ All settings are optional.
|
|
|
596
603
|
| environment | `'production' \| 'test'` | Which Wayke environment to use, see [Environments](#environments). Default `'production'`. |
|
|
597
604
|
| marketCode | `'SE' \| 'NO'` | Language and market, see [Language](#language). Default `'SE'`. |
|
|
598
605
|
| routing | [RoutingSettings](#routingsettings) | How vehicles are opened, see [Routing](#routing). |
|
|
599
|
-
|
|
|
606
|
+
| ecom | [EcomSettings](#ecomsettings) | Buy online. On by default for the vehicles the dealer sells online. |
|
|
600
607
|
| apiKey | string | Identifies the site instead of its domain. Sent as `x-api-key`. |
|
|
601
608
|
| branchGroupId | string | Limits the vehicles to a group of branches. By default the domain or `apiKey` decides which vehicles are shown. |
|
|
602
609
|
| googleMapsApiKey | string | A Google Maps Static API key. With it, the map button on the vehicle page shows a map. Without it, the button opens Google Maps. |
|
|
@@ -616,8 +623,9 @@ All settings are optional.
|
|
|
616
623
|
|
|
617
624
|
| Property | Type | Description |
|
|
618
625
|
|--------------------|---------|-------------|
|
|
626
|
+
| enabled | boolean | `false` hides buy online on your site, for example when you sell online in another way. Default `true`. |
|
|
619
627
|
| url | string | Replaces the ecom API of `environment`. |
|
|
620
|
-
| serviceLogotypeUrl | string | Url to the logo
|
|
628
|
+
| serviceLogotypeUrl | string | Url to the logo at the top of buy online, as an image file (not a `data:` url). Wayke's logo by default. |
|
|
621
629
|
| bankIdThumbprint | string | A custom BankID certificate thumbprint. |
|
|
622
630
|
|
|
623
631
|
See [wayke-ecom-web](https://github.com/wayke-se/wayke-ecom-web) for more about buy online.
|
|
@@ -633,13 +641,13 @@ By default the list is `manufacturer`, `modelSeries`, `fuelType`, `gearboxType`,
|
|
|
633
641
|
|
|
634
642
|
## Migrating from 5.x to 6.0
|
|
635
643
|
|
|
636
|
-
6.0 gets the vehicles from Wayke's public API (`public-api.wayke.com`) instead of `api.wayke.se` and `gql.wayke.se`, and has fewer settings: most sites only set what is different from the defaults. Leads and buy online work as before.
|
|
644
|
+
6.0 gets the vehicles from Wayke's public API (`public-api.wayke.com`) instead of `api.wayke.se` and `gql.wayke.se`, and has fewer settings: most sites only set what is different from the defaults. Leads and buy online work as before, but buy online is now on by default.
|
|
637
645
|
|
|
638
|
-
The old filter names, url parameters and vehicle ids keep working, with a warning in the console, so a site that only changes its settings keeps its links and saved searches.
|
|
646
|
+
The old filter names, url parameters and vehicle ids keep working, with a warning in the console, so a site that only changes its settings keeps its links and saved searches. A removed setting also gives a warning, naming what replaces it.
|
|
639
647
|
|
|
640
648
|
### 1. Provider settings
|
|
641
649
|
|
|
642
|
-
Remove the API urls
|
|
650
|
+
Remove the API urls and `ecomSettings`. Production is the default; set `environment: 'test'` for test.
|
|
643
651
|
|
|
644
652
|
```javascript
|
|
645
653
|
// 5.x
|
|
@@ -650,16 +658,16 @@ provider: {
|
|
|
650
658
|
ecomSettings: { url: 'https://ecom.wayke.se' },
|
|
651
659
|
},
|
|
652
660
|
|
|
653
|
-
// 6.0
|
|
654
|
-
provider: {
|
|
655
|
-
ecomSettings: {},
|
|
656
|
-
},
|
|
661
|
+
// 6.0: nothing to set
|
|
657
662
|
```
|
|
658
663
|
|
|
659
664
|
| 5.x | 6.0 |
|
|
660
665
|
|-----|-----|
|
|
661
666
|
| `url`, `graphQlUrl`, `urlMlt` | Removed. Use `environment` (`publicApiUrl` and `leadUrl` replace single urls if you need to) |
|
|
662
|
-
| `ecomSettings
|
|
667
|
+
| `ecomSettings` set: buy online on | `ecom` (optional): buy online is on by default for the vehicles the dealer sells online |
|
|
668
|
+
| No `ecomSettings`: buy online off | `ecom: { enabled: false }` |
|
|
669
|
+
| `ecomSettings.url` | `ecom.url`, optional, follows `environment` |
|
|
670
|
+
| `ecomSettings.serviceLogotypeUrl`, `ecomSettings.bankIdThumbprint` | `ecom.serviceLogotypeUrl`, `ecom.bankIdThumbprint` |
|
|
663
671
|
| `ecomSettings.useBankId`, `ecomSettings.displayBankIdAlert` | Removed, no effect since 3.0.0 |
|
|
664
672
|
| `useQueryParamsFromUrl` | `routing.syncUrl` |
|
|
665
673
|
| `pathRoute` (provider and composite) | `routing: { mode: 'path', basePath }` |
|
|
@@ -667,7 +675,19 @@ provider: {
|
|
|
667
675
|
| `apiKey` | Unchanged; now also identifies the site to the vehicle API |
|
|
668
676
|
| `WaykeItemProvider`, `WaykeItemProviderSettings` | `WaykeProvider`, `WaykeProviderSettings` |
|
|
669
677
|
|
|
670
|
-
### 2.
|
|
678
|
+
### 2. Install and stylesheet (React and bundlers)
|
|
679
|
+
|
|
680
|
+
The CDN needs no change other than the version in the url.
|
|
681
|
+
|
|
682
|
+
| 5.x | 6.0 |
|
|
683
|
+
|-----|-----|
|
|
684
|
+
| `import '@wayke-se/components-react/dist/assets/default.css'` | `import '@wayke-se/components-react/style.css'`, which also covers buy online |
|
|
685
|
+
| `import '@wayke-se/ecom-web/dist/index.css'` | Remove; it is in `style.css` |
|
|
686
|
+
| `npm install @wayke-se/ecom-web` | Not needed; `npm uninstall @wayke-se/ecom-web` unless you use it yourself |
|
|
687
|
+
| `define` for `process.env` in the bundler, for buy online | Not needed |
|
|
688
|
+
| Imports from `@wayke-se/components-react/dist/...` | Only `@wayke-se/components-react` and `@wayke-se/components-react/style.css` can be imported; the package is ESM only |
|
|
689
|
+
|
|
690
|
+
### 3. Routing and clicks
|
|
671
691
|
|
|
672
692
|
| 5.x | 6.0 |
|
|
673
693
|
|-----|-----|
|
|
@@ -676,7 +696,7 @@ provider: {
|
|
|
676
696
|
| `WaykeSearch` alone without `hashRoute` or `pathRoute`: plain cards | Set `routing: { mode: 'none' }`; the default is now hash links |
|
|
677
697
|
| `onClickSearchItem` (search and item) | Removed; subscribe to the `ItemClicked` event |
|
|
678
698
|
|
|
679
|
-
###
|
|
699
|
+
### 4. Filters and parameters
|
|
680
700
|
|
|
681
701
|
`filterList`, `initialQueryParams`, the `onFilterUpdate` action and the url take the names in [Search parameters](#search-parameters). The old names are translated:
|
|
682
702
|
|
|
@@ -695,7 +715,7 @@ provider: {
|
|
|
695
715
|
|
|
696
716
|
The search field now suggests makes and models. A free text that is exactly a make or model, such as "audi", filters on it.
|
|
697
717
|
|
|
698
|
-
###
|
|
718
|
+
### 5. Events
|
|
699
719
|
|
|
700
720
|
The event names and data are the same. What changes:
|
|
701
721
|
|
|
@@ -703,9 +723,10 @@ The event names and data are the same. What changes:
|
|
|
703
723
|
* `filter` in `FilterApply` is the new filter name, for example `colorName` instead of `color`.
|
|
704
724
|
* `id` is the vehicle's id in the public API. New vehicles have new ids; older ones mostly keep theirs.
|
|
705
725
|
|
|
706
|
-
###
|
|
726
|
+
### 6. Removed
|
|
707
727
|
|
|
708
728
|
* Central storage (switching to another branch on the vehicle page).
|
|
729
|
+
* The image gallery no longer uses react-slick, so CSS aimed at `.slick-*` classes has no effect.
|
|
709
730
|
* The campaign filter. Dealer packages are still shown on the vehicle page.
|
|
710
731
|
* Related vehicles are now the latest vehicles of the same make.
|
|
711
732
|
* A vehicle without a cash price, such as a leasing-only car, shows no price instead of 0 kr.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var h=Object.create;var f=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var m=(a,b,c)=>()=>{if(c)throw c[0];try{return a&&(b=a(a=0)),b}catch(d){throw c=[d],d}};var n=(a,b)=>()=>{try{return b||a((b={exports:{}}).exports,b),b.exports}catch(c){throw b=0,c}},o=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0})},g=(a,b,c,d)=>{if(b&&typeof b=="object"||typeof b=="function")for(let e of j(b))!l.call(a,e)&&e!==c&&f(a,e,{get:()=>b[e],enumerable:!(d=i(b,e))||d.enumerable});return a};var p=(a,b,c)=>(c=a!=null?h(k(a)):{},g(b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c,a)),q=a=>g(f({},"__esModule",{value:!0}),a);export{m as a,n as b,o as c,p as d,q as e};
|
|
2
|
+
//# sourceMappingURL=chunk-XBJKSIMP.js.map
|