@wayke-se/components-react 3.5.2 → 3.5.3-beta.1
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 +57 -49
- 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-types/components/InputSearch/index.d.ts +1 -1
- package/dist-web/index.js +70 -1
- package/dist-web/index.js.map +1 -1
- package/package.json +5 -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,34 +1,34 @@
|
|
|
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",
|
|
30
|
-
url: "https://
|
|
31
|
-
urlMlt: "https://
|
|
30
|
+
url: "https://api.wayketech.se/vehicles",
|
|
31
|
+
urlMlt: "https://api.wayketech.se/vehicles-mlt-ext",
|
|
32
32
|
ecomSettings: {
|
|
33
33
|
url: "OPTIONAL_ECOM_URL",
|
|
34
34
|
},
|
|
@@ -46,8 +46,8 @@ const App = () => (
|
|
|
46
46
|
```javascript
|
|
47
47
|
const ProviderSettings: WaykeProviderSettings = {
|
|
48
48
|
graphQlUrl: "https://gql.wayketech.se/query",
|
|
49
|
-
url: "https://
|
|
50
|
-
urlMlt: "https://
|
|
49
|
+
url: "https://api.wayketech.se/vehicles",
|
|
50
|
+
urlMlt: "https://api.wayketech.se/vehicles-mlt-ext",
|
|
51
51
|
ecomSettings: {
|
|
52
52
|
url: "https://ecom.wayketech.se",
|
|
53
53
|
},
|
|
@@ -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';
|
|
@@ -442,7 +436,7 @@ To style the components, copy the following snippet into your *CSS* file and mod
|
|
|
442
436
|
}
|
|
443
437
|
```
|
|
444
438
|
|
|
445
|
-
...or if you want to use it as
|
|
439
|
+
...or if you want to use it as _Sass_ (.scss):
|
|
446
440
|
|
|
447
441
|
```scss
|
|
448
442
|
.wayke__theme {
|
|
@@ -474,31 +468,42 @@ To style the components, copy the following snippet into your *CSS* file and mod
|
|
|
474
468
|
}
|
|
475
469
|
```
|
|
476
470
|
|
|
471
|
+
> **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.
|
|
472
|
+
|
|
477
473
|
### Ecom theme
|
|
478
|
-
The default ecom css can be found and imported `node_module/@wayke-se/ecom-web/dist/index.css`.
|
|
479
474
|
|
|
480
|
-
|
|
475
|
+
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.
|
|
476
|
+
|
|
477
|
+
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).
|
|
478
|
+
|
|
479
|
+
## Run example from this repository
|
|
481
480
|
|
|
482
|
-
|
|
483
|
-
This repository contains a example app that uses [@wayke-se/components-react](https://www.npmjs.com/package/@wayke-se/components-react).
|
|
481
|
+
This repository contains an example app that uses [@wayke-se/components-react](https://www.npmjs.com/package/@wayke-se/components-react).
|
|
484
482
|
|
|
485
483
|
|
|
484
|
+
### Setup environment variables
|
|
485
|
+
|
|
486
|
+
To start the example create an `.env` file in root with the following content.
|
|
486
487
|
|
|
487
|
-
To start the example create an `.env` file in root.
|
|
488
488
|
```
|
|
489
489
|
WAYKE_HOST=YOUR_HOST_1,YOUR_HOST_2
|
|
490
|
-
WAYKE_SEARCH_URL=https://
|
|
491
|
-
WAYKE_SEARCH_MLT_URL=https://
|
|
490
|
+
WAYKE_SEARCH_URL=https://api.wayketech.se/vehicles
|
|
491
|
+
WAYKE_SEARCH_MLT_URL=https://api.wayketech.se/vehicles-mlt-ext
|
|
492
492
|
WAYKE_SEARCH_X_API_KEY=YOUR_API_KEY
|
|
493
493
|
WAYKE_GRAPH_QL_URL=https://gql.wayketech.se/query
|
|
494
494
|
WAYKE_ECOM_URL=https://ecom.wayketech.se
|
|
495
495
|
GOOGLE_MAPS_API_KEY=YOUR_GOOGLE_MAPS_STATIC_API_KEY
|
|
496
496
|
```
|
|
497
497
|
|
|
498
|
-
|
|
498
|
+
#### Notes
|
|
499
|
+
|
|
500
|
+
* `WAYKE_SEARCH_MLT_URL` - An *optional* flag. Will fetch related vehicles to current vehicle. If not provided
|
|
499
501
|
`WAYKE_SEARCH_URL` will be used instead, but will fetch latest vehicles.
|
|
500
502
|
|
|
501
|
-
|
|
503
|
+
### Start the example app
|
|
504
|
+
|
|
505
|
+
Run the following commands to start the example app.
|
|
506
|
+
|
|
502
507
|
```bash
|
|
503
508
|
npm install
|
|
504
509
|
cd example
|
|
@@ -506,35 +511,38 @@ npm install
|
|
|
506
511
|
npm start
|
|
507
512
|
```
|
|
508
513
|
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
This will change the origin, while still pointing to localhost.
|
|
513
|
-
Start the example and open `test.com.localhost:5000`.
|
|
514
|
+
### Custom host
|
|
515
|
+
|
|
516
|
+
`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`.
|
|
514
517
|
|
|
515
|
-
To
|
|
518
|
+
To do so update your local host file and add:
|
|
519
|
+
```txt
|
|
520
|
+
127.0.0.1 test.com.localhost
|
|
516
521
|
```
|
|
522
|
+
|
|
523
|
+
This will change the origin, while still pointing to `localhost`. Start the example app and open `test.com.localhost:5000` in your browser.
|
|
524
|
+
|
|
525
|
+
### Multiple hosts
|
|
526
|
+
|
|
527
|
+
To add multiple hosts, add all hohsts to your local host file and then update `WAYKE_HOST` in `.env` as a comma separated list.
|
|
528
|
+
|
|
529
|
+
```txt
|
|
517
530
|
WAYKE_HOST=a.com.localhost,b.com.localhost
|
|
518
531
|
```
|
|
519
|
-
`a.com.localhost:5000` and `b.com.localhost:5000` can now be accessed.
|
|
520
532
|
|
|
533
|
+
`a.com.localhost:5000` and `b.com.localhost:5000` can now be accessed.
|
|
521
534
|
|
|
522
|
-
### Available
|
|
535
|
+
### Available routes (independent)
|
|
523
536
|
|
|
524
|
-
|
|
537
|
+
**WaykeComposite**
|
|
525
538
|
[http://localhost:5000](http://localhost:5000)
|
|
526
539
|
|
|
527
|
-
|
|
540
|
+
**WaykeSearch With WaykeProvider**
|
|
528
541
|
[http://localhost:5000/search](http://localhost:5000/search)
|
|
529
542
|
|
|
530
|
-
|
|
543
|
+
**WaykeSearchItem With WaykeProvider**
|
|
531
544
|
[http://localhost:5000/search-item/d01f79a3-7552-49c4-9d4d-deb3aa581c31](http://localhost:5000/search-item/d01f79a3-7552-49c4-9d4d-deb3aa581c31)
|
|
532
545
|
|
|
533
|
-
|
|
534
546
|
## Example repositories
|
|
535
547
|
|
|
536
|
-
|
|
537
|
-
[https://github.com/wayke-se/components-react-boilerplate](https://github.com/wayke-se/components-react-boilerplate)
|
|
538
|
-
|
|
539
|
-
### Non-React with/without Typescript example
|
|
540
|
-
[https://github.com/wayke-se/components-react-example](https://github.com/wayke-se/components-react-example)
|
|
548
|
+
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
|
@@ -3366,6 +3366,76 @@ const SliderWrapper = styled__default.div`
|
|
|
3366
3366
|
bottom: 0;
|
|
3367
3367
|
left: 0;
|
|
3368
3368
|
right: 0;
|
|
3369
|
+
user-select: none;
|
|
3370
|
+
touch-action: pan-y;
|
|
3371
|
+
-webkit-tap-highlight-color: transparent;
|
|
3372
|
+
|
|
3373
|
+
.slick-list,
|
|
3374
|
+
.slick-track {
|
|
3375
|
+
transform: translate3d(0, 0, 0);
|
|
3376
|
+
}
|
|
3377
|
+
}
|
|
3378
|
+
|
|
3379
|
+
.slick-list {
|
|
3380
|
+
position: relative;
|
|
3381
|
+
display: block;
|
|
3382
|
+
margin: 0;
|
|
3383
|
+
padding: 0;
|
|
3384
|
+
overflow: hidden;
|
|
3385
|
+
|
|
3386
|
+
&:focus {
|
|
3387
|
+
outline: none;
|
|
3388
|
+
}
|
|
3389
|
+
|
|
3390
|
+
&.dragging {
|
|
3391
|
+
cursor: pointer;
|
|
3392
|
+
cursor: hand;
|
|
3393
|
+
}
|
|
3394
|
+
}
|
|
3395
|
+
|
|
3396
|
+
.slick-track {
|
|
3397
|
+
position: relative;
|
|
3398
|
+
top: 0;
|
|
3399
|
+
left: 0;
|
|
3400
|
+
display: block;
|
|
3401
|
+
margin-left: auto;
|
|
3402
|
+
margin-right: auto;
|
|
3403
|
+
|
|
3404
|
+
&::before,
|
|
3405
|
+
&::after {
|
|
3406
|
+
content: '';
|
|
3407
|
+
display: table;
|
|
3408
|
+
}
|
|
3409
|
+
|
|
3410
|
+
&::after {
|
|
3411
|
+
clear: both;
|
|
3412
|
+
}
|
|
3413
|
+
}
|
|
3414
|
+
|
|
3415
|
+
.slick-slide {
|
|
3416
|
+
display: none;
|
|
3417
|
+
float: left;
|
|
3418
|
+
min-height: 1px;
|
|
3419
|
+
}
|
|
3420
|
+
|
|
3421
|
+
.slick-loading {
|
|
3422
|
+
.slick-track {
|
|
3423
|
+
visibility: hidden;
|
|
3424
|
+
}
|
|
3425
|
+
|
|
3426
|
+
img {
|
|
3427
|
+
display: none;
|
|
3428
|
+
}
|
|
3429
|
+
}
|
|
3430
|
+
|
|
3431
|
+
.slick-initialized {
|
|
3432
|
+
.slick-slide {
|
|
3433
|
+
display: block;
|
|
3434
|
+
}
|
|
3435
|
+
}
|
|
3436
|
+
|
|
3437
|
+
.slick-slide.dragging img {
|
|
3438
|
+
pointer-events: none;
|
|
3369
3439
|
}
|
|
3370
3440
|
|
|
3371
3441
|
${props => props.theme.breakpoint.LtMd} {
|
|
@@ -3378,7 +3448,6 @@ const SliderWrapper = styled__default.div`
|
|
|
3378
3448
|
|
|
3379
3449
|
.slick-slide {
|
|
3380
3450
|
border-right: ${size(1)} solid ${props => props.theme.color.bg};
|
|
3381
|
-
//transform: scale(0.95);
|
|
3382
3451
|
transform-origin: 0 50%;
|
|
3383
3452
|
transition: transform 150ms ease;
|
|
3384
3453
|
}
|