@wayke-se/components-react 3.1.0-beta.1 → 3.1.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 +52 -44
- package/dist-node/index.js +70 -1
- package/dist-node/index.js.map +1 -1
- package/dist-src/components/Gallery/wrapper.js +70 -1
- package/dist-web/index.js +70 -1
- package/dist-web/index.js.map +1 -1
- package/package.json +2 -4
- package/assets/ajax-loader.gif +0 -0
- package/assets/default.css +0 -1
- package/assets/fonts/slick.eot +0 -0
- package/assets/fonts/slick.svg +0 -14
- package/assets/fonts/slick.ttf +0 -0
- package/assets/fonts/slick.woff +0 -0
package/README.md
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
# Components React
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This repository contains components for search and items to use on external websites.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Usage
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Get started using `@wayke-se/components-react`.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### Before you start
|
|
10
10
|
|
|
11
|
-
Install
|
|
11
|
+
**Install**
|
|
12
12
|
```bash
|
|
13
13
|
npm install @wayke-se/components-react
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Install peer dependencies
|
|
16
|
+
**Install peer dependencies**
|
|
17
17
|
```bash
|
|
18
18
|
npm install react react-dom styled-components
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
### Basic usage
|
|
22
|
+
|
|
21
23
|
```javascript
|
|
22
24
|
import React from 'react';
|
|
23
25
|
import WaykeComposite from '@wayke-se/components-react'
|
|
24
|
-
import '@wayke-se/
|
|
25
|
-
// Optional
|
|
26
|
-
import '@wayke-se/ecom-web/dist/index.css';
|
|
26
|
+
import '@wayke-se/ecom-web/dist/index.css'; // Only required if Ecom is activated
|
|
27
27
|
|
|
28
28
|
const ProviderSettings: WaykeProviderSettings = {
|
|
29
29
|
graphQlUrl: "https://gql.wayketech.se/query",
|
|
@@ -66,10 +66,9 @@ const ProviderSettings: WaykeProviderSettings = {
|
|
|
66
66
|
}
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
|
|
70
69
|
### WaykeComposite uses hash-route, i want to use path-route
|
|
71
70
|
|
|
72
|
-
In this case you need to make sure that you are in control of the routing, if the user reloads the page, where same html file is
|
|
71
|
+
In this case you need to make sure that you are in control of the routing, if the user reloads the page, where same html file is
|
|
73
72
|
served for `/your/path/to/this/component` and `/your/path/to/this/component/00000000-0000-0000-0000-000000000000`.
|
|
74
73
|
|
|
75
74
|
Examples given the application is located in `/search/vehicles`:
|
|
@@ -84,9 +83,7 @@ Examples given the application is located in `/search/vehicles`:
|
|
|
84
83
|
```javascript
|
|
85
84
|
import React from 'react';
|
|
86
85
|
import { WaykeCompositePath } from '@wayke-se/components-react'
|
|
87
|
-
import '@wayke
|
|
88
|
-
// Optional
|
|
89
|
-
import '@wayke-se/ecom-web/dist/index.css';
|
|
86
|
+
import '@wayke-se/ecom-web/dist/index.css'; // Only required if Ecom is activated
|
|
90
87
|
|
|
91
88
|
const App = () => (
|
|
92
89
|
<WaykeCompositePath
|
|
@@ -119,7 +116,6 @@ const App = () => {
|
|
|
119
116
|
);
|
|
120
117
|
};
|
|
121
118
|
```
|
|
122
|
-
|
|
123
119
|
### I only want to use the Search Item component
|
|
124
120
|
|
|
125
121
|
It's recomended to place WaykeItemProvider close to app-root in order to keep the cache
|
|
@@ -127,9 +123,7 @@ It's recomended to place WaykeItemProvider close to app-root in order to keep th
|
|
|
127
123
|
```javascript
|
|
128
124
|
import React, { useCallback } from 'react';
|
|
129
125
|
import { WaykeItemProvider, WaykeSearchItem } from '@wayke-se/components-react'
|
|
130
|
-
import '@wayke
|
|
131
|
-
// Optional
|
|
132
|
-
import '@wayke-se/ecom-web/dist/index.css';
|
|
126
|
+
import '@wayke-se/ecom-web/dist/index.css'; // Only required if Ecom is activated
|
|
133
127
|
|
|
134
128
|
const App = ({}) => {
|
|
135
129
|
const id = 'd01f79a3-7552-49c4-9d4d-deb3aa581c31';
|
|
@@ -164,7 +158,7 @@ const App = ({}) => {
|
|
|
164
158
|
| disableResetScrollOnInit | boolean | false | |
|
|
165
159
|
| placeholderImage | string | false | |
|
|
166
160
|
| onClickSearchItem | function | false | (id: string) => void |
|
|
167
|
-
| modifyDocumentTitleItem | boolean | false | |
|
|
161
|
+
| modifyDocumentTitleItem | boolean | false | |
|
|
168
162
|
|
|
169
163
|
* Required
|
|
170
164
|
* `id` - Guid that represents a vehicle.
|
|
@@ -438,7 +432,7 @@ To style the components, copy the following snippet into your *CSS* file and mod
|
|
|
438
432
|
}
|
|
439
433
|
```
|
|
440
434
|
|
|
441
|
-
...or if you want to use it as
|
|
435
|
+
...or if you want to use it as _Sass_ (.scss):
|
|
442
436
|
|
|
443
437
|
```scss
|
|
444
438
|
.wayke__theme {
|
|
@@ -470,17 +464,23 @@ To style the components, copy the following snippet into your *CSS* file and mod
|
|
|
470
464
|
}
|
|
471
465
|
```
|
|
472
466
|
|
|
467
|
+
> **It is highly recommended to *NOT* add or remove any properties defined above in the color selectors**. However, since fonts usually requires more configuration we encourage you to add the necessary font styling required to match your current profile. If you add new properties to the font selectors, please be careful and ensure everything looks as intended before going into production.
|
|
468
|
+
|
|
473
469
|
### Ecom theme
|
|
474
|
-
The default ecom css can be found and imported `node_module/@wayke-se/ecom-web/dist/index.css`.
|
|
475
470
|
|
|
476
|
-
|
|
471
|
+
The default Ecom *CSS* can be found and imported from `@wayke-se/ecom-web/dist/index.css`. This is only necessary if Ecom is activated. If activated and the *CSS* is not imported, the Ecom module will not be displayed correctly.
|
|
472
|
+
|
|
473
|
+
If you want to customize the look of the Ecom module we refer you to the documentation of [@wayke-se/ecom-web](https://www.npmjs.com/package/@wayke-se/ecom-web).
|
|
474
|
+
|
|
475
|
+
## Run example from this repository
|
|
477
476
|
|
|
478
|
-
|
|
479
|
-
This repository contains a example app that uses [@wayke-se/components-react](https://www.npmjs.com/package/@wayke-se/components-react).
|
|
477
|
+
This repository contains an example app that uses [@wayke-se/components-react](https://www.npmjs.com/package/@wayke-se/components-react).
|
|
480
478
|
|
|
481
479
|
|
|
480
|
+
### Setup environment variables
|
|
481
|
+
|
|
482
|
+
To start the example create an `.env` file in root with the following content.
|
|
482
483
|
|
|
483
|
-
To start the example create an `.env` file in root.
|
|
484
484
|
```
|
|
485
485
|
WAYKE_HOST=YOUR_HOST_1,YOUR_HOST_2
|
|
486
486
|
WAYKE_SEARCH_URL=https://test-ext-api.wayketech.se/vehicles
|
|
@@ -491,10 +491,15 @@ WAYKE_ECOM_URL=https://ecom.wayketech.se
|
|
|
491
491
|
GOOGLE_MAPS_API_KEY=YOUR_GOOGLE_MAPS_STATIC_API_KEY
|
|
492
492
|
```
|
|
493
493
|
|
|
494
|
-
|
|
494
|
+
#### Notes
|
|
495
|
+
|
|
496
|
+
* `WAYKE_SEARCH_MLT_URL` - An *optional* flag. Will fetch related vehicles to current vehicle. If not provided
|
|
495
497
|
`WAYKE_SEARCH_URL` will be used instead, but will fetch latest vehicles.
|
|
496
498
|
|
|
497
|
-
|
|
499
|
+
### Start the example app
|
|
500
|
+
|
|
501
|
+
Run the following commands to start the example app.
|
|
502
|
+
|
|
498
503
|
```bash
|
|
499
504
|
npm install
|
|
500
505
|
cd example
|
|
@@ -502,35 +507,38 @@ npm install
|
|
|
502
507
|
npm start
|
|
503
508
|
```
|
|
504
509
|
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
This will change the origin, while still pointing to localhost.
|
|
509
|
-
Start the example and open `test.com.localhost:5000`.
|
|
510
|
+
### Custom host
|
|
511
|
+
|
|
512
|
+
`WAYKE_HOST` can be used instead of using and exposing the `WAYKE_SEARCH_X_API_KEY`. If, for example, your development host is `test.com.localhost`.
|
|
510
513
|
|
|
511
|
-
To
|
|
514
|
+
To do so update your local host file and add:
|
|
515
|
+
```txt
|
|
516
|
+
127.0.0.1 test.com.localhost
|
|
512
517
|
```
|
|
518
|
+
|
|
519
|
+
This will change the origin, while still pointing to `localhost`. Start the example app and open `test.com.localhost:5000` in your browser.
|
|
520
|
+
|
|
521
|
+
### Multiple hosts
|
|
522
|
+
|
|
523
|
+
To add multiple hosts, add all hohsts to your local host file and then update `WAYKE_HOST` in `.env` as a comma separated list.
|
|
524
|
+
|
|
525
|
+
```txt
|
|
513
526
|
WAYKE_HOST=a.com.localhost,b.com.localhost
|
|
514
527
|
```
|
|
515
|
-
`a.com.localhost:5000` and `b.com.localhost:5000` can now be accessed.
|
|
516
528
|
|
|
529
|
+
`a.com.localhost:5000` and `b.com.localhost:5000` can now be accessed.
|
|
517
530
|
|
|
518
|
-
### Available
|
|
531
|
+
### Available routes (independent)
|
|
519
532
|
|
|
520
|
-
|
|
533
|
+
**WaykeComposite**
|
|
521
534
|
[http://localhost:5000](http://localhost:5000)
|
|
522
535
|
|
|
523
|
-
|
|
536
|
+
**WaykeSearch With WaykeProvider**
|
|
524
537
|
[http://localhost:5000/search](http://localhost:5000/search)
|
|
525
538
|
|
|
526
|
-
|
|
539
|
+
**WaykeSearchItem With WaykeProvider**
|
|
527
540
|
[http://localhost:5000/search-item/d01f79a3-7552-49c4-9d4d-deb3aa581c31](http://localhost:5000/search-item/d01f79a3-7552-49c4-9d4d-deb3aa581c31)
|
|
528
541
|
|
|
529
|
-
|
|
530
542
|
## Example repositories
|
|
531
543
|
|
|
532
|
-
|
|
533
|
-
[https://github.com/wayke-se/components-react-boilerplate](https://github.com/wayke-se/components-react-boilerplate)
|
|
534
|
-
|
|
535
|
-
### Non-React with/without Typescript example
|
|
536
|
-
[https://github.com/wayke-se/components-react-example](https://github.com/wayke-se/components-react-example)
|
|
544
|
+
We have setup an example repository where you can see how we've implemented `@wayke-se/components-react`. You'll find the repository here: [https://github.com/wayke-se/components-react-example](https://github.com/wayke-se/components-react-example).
|
package/dist-node/index.js
CHANGED
|
@@ -3457,6 +3457,76 @@ const SliderWrapper = styled__default.div`
|
|
|
3457
3457
|
bottom: 0;
|
|
3458
3458
|
left: 0;
|
|
3459
3459
|
right: 0;
|
|
3460
|
+
user-select: none;
|
|
3461
|
+
touch-action: pan-y;
|
|
3462
|
+
-webkit-tap-highlight-color: transparent;
|
|
3463
|
+
|
|
3464
|
+
.slick-list,
|
|
3465
|
+
.slick-track {
|
|
3466
|
+
transform: translate3d(0, 0, 0);
|
|
3467
|
+
}
|
|
3468
|
+
}
|
|
3469
|
+
|
|
3470
|
+
.slick-list {
|
|
3471
|
+
position: relative;
|
|
3472
|
+
display: block;
|
|
3473
|
+
margin: 0;
|
|
3474
|
+
padding: 0;
|
|
3475
|
+
overflow: hidden;
|
|
3476
|
+
|
|
3477
|
+
&:focus {
|
|
3478
|
+
outline: none;
|
|
3479
|
+
}
|
|
3480
|
+
|
|
3481
|
+
&.dragging {
|
|
3482
|
+
cursor: pointer;
|
|
3483
|
+
cursor: hand;
|
|
3484
|
+
}
|
|
3485
|
+
}
|
|
3486
|
+
|
|
3487
|
+
.slick-track {
|
|
3488
|
+
position: relative;
|
|
3489
|
+
top: 0;
|
|
3490
|
+
left: 0;
|
|
3491
|
+
display: block;
|
|
3492
|
+
margin-left: auto;
|
|
3493
|
+
margin-right: auto;
|
|
3494
|
+
|
|
3495
|
+
&::before,
|
|
3496
|
+
&::after {
|
|
3497
|
+
content: '';
|
|
3498
|
+
display: table;
|
|
3499
|
+
}
|
|
3500
|
+
|
|
3501
|
+
&::after {
|
|
3502
|
+
clear: both;
|
|
3503
|
+
}
|
|
3504
|
+
}
|
|
3505
|
+
|
|
3506
|
+
.slick-slide {
|
|
3507
|
+
display: none;
|
|
3508
|
+
float: left;
|
|
3509
|
+
min-height: 1px;
|
|
3510
|
+
}
|
|
3511
|
+
|
|
3512
|
+
.slick-loading {
|
|
3513
|
+
.slick-track {
|
|
3514
|
+
visibility: hidden;
|
|
3515
|
+
}
|
|
3516
|
+
|
|
3517
|
+
img {
|
|
3518
|
+
display: none;
|
|
3519
|
+
}
|
|
3520
|
+
}
|
|
3521
|
+
|
|
3522
|
+
.slick-initialized {
|
|
3523
|
+
.slick-slide {
|
|
3524
|
+
display: block;
|
|
3525
|
+
}
|
|
3526
|
+
}
|
|
3527
|
+
|
|
3528
|
+
.slick-slide.dragging img {
|
|
3529
|
+
pointer-events: none;
|
|
3460
3530
|
}
|
|
3461
3531
|
|
|
3462
3532
|
${props => props.theme.breakpoint.LtMd} {
|
|
@@ -3469,7 +3539,6 @@ const SliderWrapper = styled__default.div`
|
|
|
3469
3539
|
|
|
3470
3540
|
.slick-slide {
|
|
3471
3541
|
border-right: ${size(1)} solid ${props => props.theme.color.bg};
|
|
3472
|
-
//transform: scale(0.95);
|
|
3473
3542
|
transform-origin: 0 50%;
|
|
3474
3543
|
transition: transform 150ms ease;
|
|
3475
3544
|
}
|