@wayke-se/components-react 3.0.0-beta.1 → 3.0.0-beta.11
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/.eslintrc.js +14 -6
- package/.github/workflows/release-to-production.yaml +2 -3
- package/.github/workflows/release-to-test.yaml +2 -4
- package/.prettierrc +2 -0
- package/README.md +35 -2
- package/assets/ajax-loader.gif +0 -0
- package/assets/default.css +1 -0
- package/assets/fonts/slick.eot +0 -0
- package/assets/fonts/slick.svg +14 -0
- package/assets/fonts/slick.ttf +0 -0
- package/assets/fonts/slick.woff +0 -0
- package/codegen.yml +1 -1
- package/dist/ajax-loader-BOAPMZMT.gif +0 -0
- package/dist/index.css +240 -1
- package/dist/index.css.map +3 -3
- package/dist/index.d.ts +393 -320
- package/dist/index.js +6565 -838
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +6548 -838
- package/dist/index.mjs.map +4 -4
- package/dist/slick-7CK47X3J.svg +14 -0
- package/dist/slick-EVLS6IWX.eot +0 -0
- package/dist/slick-MU5EZO5G.woff +0 -0
- package/dist/slick-NKQ64RRA.ttf +0 -0
- package/esbuild/{lib.js → build.js} +5 -14
- package/esbuild/common.js +5 -5
- package/esbuild/start.js +12 -11
- package/{www → esbuild/www}/index.html +3 -3
- package/example/src/@types/global.d.ts +7 -0
- package/example/src/@types/react-panellum.d.ts +1 -0
- package/example/src/App.tsx +77 -0
- package/{www → example/src/assets/style}/ecom.css +3 -0
- package/{www → example/src/assets/style}/theme.css +0 -0
- package/example/src/index.html +26 -0
- package/example/src/index.tsx +11 -0
- package/example/src/routes/HashRoute/index.tsx +30 -0
- package/example/src/routes/Home/index.tsx +33 -0
- package/example/src/routes/NotFound/index.tsx +5 -0
- package/example/src/routes/PathRoute/index.tsx +35 -0
- package/example/src/routes/Search/index.tsx +28 -0
- package/example/src/routes/SearchItem/index.tsx +28 -0
- package/example/src/routes/index.tsx +25 -0
- package/package.json +68 -17
- package/src/@types/{codegen.ts → codegen/types.ts} +0 -0
- package/src/@types/react-panellum.d.ts +1 -1
- package/src/State/CentralStorage/useCentralStorage.ts +1 -1
- package/src/components/ActionList/index.tsx +1 -1
- package/src/components/FinancialOptions/LoanModal.tsx +1 -1
- package/src/components/FinancialOptions/index.tsx +1 -1
- package/src/components/FinancialOptions/leasing.tsx +1 -1
- package/src/components/FinancialOptions/loan.tsx +1 -1
- package/src/components/Gallery/index.tsx +1 -1
- package/src/components/Gallery/wrapper.tsx +0 -70
- package/src/components/InsuranceOptions/Insurance.tsx +1 -1
- package/src/components/InsuranceOptions/InsuranceFree.tsx +1 -1
- package/src/components/InsuranceOptions/InsuranceFreeModal.tsx +1 -1
- package/src/components/InsuranceOptions/InsuranceModal.tsx +1 -1
- package/src/components/InsuranceOptions/index.tsx +1 -1
- package/src/components/Lightbox/index.tsx +1 -1
- package/src/components/Map/index.tsx +1 -1
- package/src/components/OpeningHours/index.tsx +1 -1
- package/src/components/Pdf/index.tsx +1 -1
- package/src/components/SortSelect/index.tsx +1 -1
- package/src/components/Sphere/SphereLightbox.tsx +1 -3
- package/src/components/Sphere/SphereViewer.tsx +44 -8
- package/src/components/Sphere/wrapper.tsx +0 -3
- package/src/hooks/useInsurance.ts +1 -1
- package/src/hooks/useLoan.ts +1 -1
- package/src/hooks/useSearchItem.ts +1 -1
- package/src/hooks/useSearchItemBranch.ts +1 -1
- package/src/index-dev.tsx +32 -134
- package/src/index-esbuild.ts +74 -0
- package/src/index.ts +8 -6
- package/src/layouts/searchItem/Branch.tsx +1 -1
- package/src/layouts/searchItem/BranchModal.tsx +1 -1
- package/src/layouts/searchItem/CheckList.tsx +1 -1
- package/src/layouts/searchItem/ManufacturerPackagesOption.tsx +1 -1
- package/src/layouts/searchItem/PackageOptions.tsx +1 -1
- package/src/layouts/searchItem/Property.tsx +1 -1
- package/src/layouts/searchItem/index.tsx +1 -3
- package/src/providers/WaykeItemProvidet.tsx +19 -24
- package/src/providers/WaykeProvider.tsx +26 -31
- package/src/utils/pubsub/Events.ts +10 -0
- package/src/utils/pubsub/pubsub.ts +8 -0
- package/src/utils/specification.ts +1 -1
- package/src/utils/vehicle-properties/custom-property-adder.ts +1 -1
- package/tsconfig.build.json +1 -1
- package/tsconfig.eslint.json +11 -0
- package/tsconfig.json +9 -6
- package/webpack.analyze.js +10 -0
- package/webpack.config.js +95 -0
- package/.husky/pre-commit +0 -4
- package/esbuild/cdn.js +0 -26
- package/src/hooks/useEcom.ts +0 -21
- package/src/styles.scss +0 -1
|
@@ -7,7 +7,7 @@ import Content from '../../components/Content/index';
|
|
|
7
7
|
import { H2 } from '../../components/Heading/index';
|
|
8
8
|
import { ButtonInline } from '../../components/Button/index';
|
|
9
9
|
import LogoBox from '../../components/LogoBox/index';
|
|
10
|
-
import { Maybe, PackageOption } from '../../@types/codegen';
|
|
10
|
+
import { Maybe, PackageOption } from '../../@types/codegen/types';
|
|
11
11
|
|
|
12
12
|
interface ManufacturerPackageOption {
|
|
13
13
|
packageOption?: Maybe<PackageOption>;
|
|
@@ -7,7 +7,7 @@ import Content from '../../components/Content/index';
|
|
|
7
7
|
import { H2 } from '../../components/Heading/index';
|
|
8
8
|
import { ButtonInline } from '../../components/Button/index';
|
|
9
9
|
import LogoBox from '../../components/LogoBox/index';
|
|
10
|
-
import { PackageOption } from '../../@types/codegen';
|
|
10
|
+
import { PackageOption } from '../../@types/codegen/types';
|
|
11
11
|
|
|
12
12
|
interface PackageOptionsProps {
|
|
13
13
|
packageOptions?: PackageOption[] | null;
|
|
@@ -11,7 +11,7 @@ import { H5 } from '../../components/Heading/index';
|
|
|
11
11
|
import { Repeat } from '../../components/Repeat/index';
|
|
12
12
|
import { TableList } from '../../components/TableList/index';
|
|
13
13
|
import Tabs from '../../components/Tabs/index';
|
|
14
|
-
import { VehicleData } from '../../@types/codegen';
|
|
14
|
+
import { VehicleData } from '../../@types/codegen/types';
|
|
15
15
|
|
|
16
16
|
interface MetadataSubCategoryProps {
|
|
17
17
|
name: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useRef, useCallback, useEffect } from 'react';
|
|
2
2
|
import WaykeEcomWeb from '@wayke-se/ecom-web';
|
|
3
|
-
// import '@wayke-se/ecom-web/dist/index.css';
|
|
4
3
|
|
|
5
4
|
import Container from '../../components/Container/index';
|
|
6
5
|
import UspList from '../../components/UspList/index';
|
|
@@ -29,7 +28,6 @@ import { PortalNamespace, PortalElement } from '../../components/Portal/index';
|
|
|
29
28
|
import Modal from '../../components/Modal/index';
|
|
30
29
|
import FinancialOptions from '../../components/FinancialOptions/index';
|
|
31
30
|
import InsuranceOptions from '../../components/InsuranceOptions/index';
|
|
32
|
-
// import Ecom from '../../components/Ecom/index';
|
|
33
31
|
import ManufacturerPackageOption from './ManufacturerPackagesOption';
|
|
34
32
|
import CheckList from './CheckList';
|
|
35
33
|
import Related from './Related';
|
|
@@ -64,7 +62,6 @@ const WaykeSearchItem = ({
|
|
|
64
62
|
}: WaykeSearchItemProps) => {
|
|
65
63
|
const { ecomSettings } = useSettings();
|
|
66
64
|
const ecomContext = useRef<WaykeEcomWeb | undefined>();
|
|
67
|
-
|
|
68
65
|
const { loading, data: result } = useSearchItem(id);
|
|
69
66
|
const { vehicle: centralStorageVehicle, loading: loadingCentralStorageVehicle } =
|
|
70
67
|
useCentralStorage(result?.vehicle);
|
|
@@ -80,6 +77,7 @@ const WaykeSearchItem = ({
|
|
|
80
77
|
bankIdThumbprint: ecomSettings?.bankIdThumbprint,
|
|
81
78
|
},
|
|
82
79
|
logo: ecomSettings.serviceLogotypeUrl,
|
|
80
|
+
logoX2: ecomSettings.serviceLogotypeUrl,
|
|
83
81
|
onEvent(view, event, currentStep?, data?) {
|
|
84
82
|
PubSub.publish('EcomOnUserEvent', view, event, currentStep, data);
|
|
85
83
|
},
|
|
@@ -4,7 +4,6 @@ import GraphqlProvider from './graphqlProvider';
|
|
|
4
4
|
import Theme from './themeProvider';
|
|
5
5
|
import Root from '../components/Root/index';
|
|
6
6
|
|
|
7
|
-
import useEcom from '../hooks/useEcom';
|
|
8
7
|
import SettingsProvider from '../State/Settings/SettingsProvider';
|
|
9
8
|
import RelatedSearchProvider from '../State/RelatedSearch/RelatedSearchProvider';
|
|
10
9
|
import CentralStorageProvider from '../State/CentralStorage/CentralStorageProvider';
|
|
@@ -41,28 +40,24 @@ const WaykeItemProvider = ({
|
|
|
41
40
|
googleMapsApiKey,
|
|
42
41
|
googleMapsMarker,
|
|
43
42
|
children,
|
|
44
|
-
}: WaykeItemProviderProps) =>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
</SettingsProvider>
|
|
64
|
-
</PathProvider>
|
|
65
|
-
);
|
|
66
|
-
};
|
|
43
|
+
}: WaykeItemProviderProps) => (
|
|
44
|
+
<PathProvider>
|
|
45
|
+
<SettingsProvider
|
|
46
|
+
googleMapsApiKey={googleMapsApiKey}
|
|
47
|
+
googleMapsMarker={googleMapsMarker}
|
|
48
|
+
ecomSettings={ecomSettings}
|
|
49
|
+
>
|
|
50
|
+
<CentralStorageProvider>
|
|
51
|
+
<GraphqlProvider uri={graphQlUrl}>
|
|
52
|
+
<RelatedSearchProvider url={url} urlMlt={urlMlt} apiKey={apiKey}>
|
|
53
|
+
<Theme>
|
|
54
|
+
<Root>{children}</Root>
|
|
55
|
+
</Theme>
|
|
56
|
+
</RelatedSearchProvider>
|
|
57
|
+
</GraphqlProvider>
|
|
58
|
+
</CentralStorageProvider>
|
|
59
|
+
</SettingsProvider>
|
|
60
|
+
</PathProvider>
|
|
61
|
+
);
|
|
67
62
|
|
|
68
63
|
export default WaykeItemProvider;
|
|
@@ -5,7 +5,6 @@ import Theme from './themeProvider';
|
|
|
5
5
|
import SearchProvider from '../State/Search/SearchProvider';
|
|
6
6
|
import Root from '../components/Root/index';
|
|
7
7
|
|
|
8
|
-
import useEcom from '../hooks/useEcom';
|
|
9
8
|
import SettingsProvider from '../State/Settings/SettingsProvider';
|
|
10
9
|
import RelatedSearchProvider from '../State/RelatedSearch/RelatedSearchProvider';
|
|
11
10
|
import CentralStorageProvider from '../State/CentralStorage/CentralStorageProvider';
|
|
@@ -46,35 +45,31 @@ const WaykeProvider = ({
|
|
|
46
45
|
useQueryParamsFromUrl,
|
|
47
46
|
pathRoute,
|
|
48
47
|
children,
|
|
49
|
-
}: WaykeProviderProps) =>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
</SettingsProvider>
|
|
76
|
-
</PathProvider>
|
|
77
|
-
);
|
|
78
|
-
};
|
|
48
|
+
}: WaykeProviderProps) => (
|
|
49
|
+
<PathProvider>
|
|
50
|
+
<SettingsProvider
|
|
51
|
+
googleMapsApiKey={googleMapsApiKey}
|
|
52
|
+
googleMapsMarker={googleMapsMarker}
|
|
53
|
+
ecomSettings={ecomSettings}
|
|
54
|
+
>
|
|
55
|
+
<CentralStorageProvider>
|
|
56
|
+
<GraphqlProvider uri={graphQlUrl}>
|
|
57
|
+
<SearchProvider
|
|
58
|
+
url={url}
|
|
59
|
+
apiKey={apiKey}
|
|
60
|
+
useQueryParamsFromUrl={useQueryParamsFromUrl}
|
|
61
|
+
pathRoute={pathRoute}
|
|
62
|
+
>
|
|
63
|
+
<RelatedSearchProvider url={url} urlMlt={urlMlt} apiKey={apiKey}>
|
|
64
|
+
<Theme>
|
|
65
|
+
<Root>{children}</Root>
|
|
66
|
+
</Theme>
|
|
67
|
+
</RelatedSearchProvider>
|
|
68
|
+
</SearchProvider>
|
|
69
|
+
</GraphqlProvider>
|
|
70
|
+
</CentralStorageProvider>
|
|
71
|
+
</SettingsProvider>
|
|
72
|
+
</PathProvider>
|
|
73
|
+
);
|
|
79
74
|
|
|
80
75
|
export default WaykeProvider;
|
|
@@ -15,11 +15,19 @@ export interface EventItemClicked extends EventBase<CallbackEventItemClicked> {
|
|
|
15
15
|
eventName: 'ItemClicked';
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
export interface EventEcomOnInit extends EventBase<CallbackEmpty> {
|
|
19
|
+
eventName: 'EcomOnInit';
|
|
20
|
+
}
|
|
21
|
+
|
|
18
22
|
export type CallbackEcomOnUserEvent = (userEvent: string, currentStep: string) => void;
|
|
19
23
|
export interface EventEcomOnUser extends EventBase<CallbackEcomOnUserEvent> {
|
|
20
24
|
eventName: 'EcomOnUserEvent';
|
|
21
25
|
}
|
|
22
26
|
|
|
27
|
+
export interface EventEcomOnExit extends EventBase<CallbackEmpty> {
|
|
28
|
+
eventName: 'EcomOnExit';
|
|
29
|
+
}
|
|
30
|
+
|
|
23
31
|
export interface EventImagesClick extends EventBase<CallbackEmpty> {
|
|
24
32
|
eventName: 'ImagesClick';
|
|
25
33
|
}
|
|
@@ -56,7 +64,9 @@ export interface EventAll extends EventBase<CallbackAll> {
|
|
|
56
64
|
export type EventType =
|
|
57
65
|
| EventHashRouteChange
|
|
58
66
|
| EventItemClicked
|
|
67
|
+
| EventEcomOnInit
|
|
59
68
|
| EventEcomOnUser
|
|
69
|
+
| EventEcomOnExit
|
|
60
70
|
| EventImagesClick
|
|
61
71
|
| EventOptionsClick
|
|
62
72
|
| EventPhonenumberVisible
|
|
@@ -8,7 +8,9 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
EventHashRouteChange,
|
|
10
10
|
EventItemClicked,
|
|
11
|
+
EventEcomOnInit,
|
|
11
12
|
EventEcomOnUser,
|
|
13
|
+
EventEcomOnExit,
|
|
12
14
|
EventImagesClick,
|
|
13
15
|
EventOptionsClick,
|
|
14
16
|
EventPhonenumberVisible,
|
|
@@ -28,7 +30,9 @@ import {
|
|
|
28
30
|
export type EventSubscriptions = {
|
|
29
31
|
HashRouteChange: EventHashRouteChange[];
|
|
30
32
|
ItemClicked: EventItemClicked[];
|
|
33
|
+
EcomOnInit: EventEcomOnInit[];
|
|
31
34
|
EcomOnUserEvent: EventEcomOnUser[];
|
|
35
|
+
EcomOnExit: EventEcomOnExit[];
|
|
32
36
|
ImagesClick: EventImagesClick[];
|
|
33
37
|
OptionsClick: EventOptionsClick[];
|
|
34
38
|
PhonenumberVisible: EventPhonenumberVisible[];
|
|
@@ -48,7 +52,9 @@ class PubSub {
|
|
|
48
52
|
private static events: EventSubscriptions = {
|
|
49
53
|
HashRouteChange: [],
|
|
50
54
|
ItemClicked: [],
|
|
55
|
+
EcomOnInit: [],
|
|
51
56
|
EcomOnUserEvent: [],
|
|
57
|
+
EcomOnExit: [],
|
|
52
58
|
ImagesClick: [],
|
|
53
59
|
OptionsClick: [],
|
|
54
60
|
PhonenumberVisible: [],
|
|
@@ -124,6 +130,8 @@ class PubSub {
|
|
|
124
130
|
case 'EcomOnUserEvent':
|
|
125
131
|
(event.callback as CallbackEcomOnUserEvent)(args[0], args[1]);
|
|
126
132
|
break;
|
|
133
|
+
case 'EcomOnInit':
|
|
134
|
+
case 'EcomOnExit':
|
|
127
135
|
case 'ImagesClick':
|
|
128
136
|
case 'OptionsClick':
|
|
129
137
|
case 'PhonenumberVisible':
|
package/tsconfig.build.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"outDir": "
|
|
3
|
+
"outDir": "./build",
|
|
4
4
|
"module": "esNext",
|
|
5
5
|
"target": "es2020",
|
|
6
|
-
"jsx": "react",
|
|
7
6
|
"sourceMap": true,
|
|
8
|
-
"moduleResolution": "
|
|
7
|
+
"moduleResolution": "node",
|
|
8
|
+
"jsx": "react",
|
|
9
9
|
"strict": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
10
|
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"esModuleInterop": true,
|
|
12
13
|
"resolveJsonModule": true,
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
},
|
|
15
|
+
"exclude": [
|
|
16
|
+
"node_modules",
|
|
17
|
+
]
|
|
15
18
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const { merge } = require('webpack-merge');
|
|
2
|
+
const config = require('./webpack.config.js');
|
|
3
|
+
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
|
4
|
+
|
|
5
|
+
module.exports = merge(config, {
|
|
6
|
+
entry: {
|
|
7
|
+
app: './src/index',
|
|
8
|
+
},
|
|
9
|
+
plugins: [new BundleAnalyzerPlugin()],
|
|
10
|
+
});
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
require('dotenv').config();
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const webpack = require('webpack');
|
|
4
|
+
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
5
|
+
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
devtool: 'source-map',
|
|
9
|
+
entry: './example/src/index',
|
|
10
|
+
output: {
|
|
11
|
+
path: path.resolve(__dirname, 'example/build'),
|
|
12
|
+
publicPath: '/',
|
|
13
|
+
filename: 'default.bundle.js',
|
|
14
|
+
},
|
|
15
|
+
target: 'web',
|
|
16
|
+
resolve: {
|
|
17
|
+
extensions: ['.ts', '.tsx', '.js'],
|
|
18
|
+
},
|
|
19
|
+
plugins: [
|
|
20
|
+
new HtmlWebpackPlugin({
|
|
21
|
+
template: './example/src/index.html',
|
|
22
|
+
}),
|
|
23
|
+
new webpack.DefinePlugin({
|
|
24
|
+
'process.env': {
|
|
25
|
+
WAYKE_SEARCH_URL: `"${process.env.WAYKE_SEARCH_URL}"`,
|
|
26
|
+
WAYKE_SEARCH_MLT_URL: `"${process.env.WAYKE_SEARCH_MLT_URL}"`,
|
|
27
|
+
WAYKE_SEARCH_X_API_KEY: `"${process.env.WAYKE_SEARCH_X_API_KEY}"`,
|
|
28
|
+
WAYKE_GRAPH_QL_URL: `"${process.env.WAYKE_GRAPH_QL_URL}"`,
|
|
29
|
+
WAYKE_ECOM_URL: `"${process.env.WAYKE_ECOM_URL}"`,
|
|
30
|
+
GOOGLE_MAPS_API_KEY: `"${process.env.GOOGLE_MAPS_API_KEY}"`,
|
|
31
|
+
},
|
|
32
|
+
}),
|
|
33
|
+
new ForkTsCheckerWebpackPlugin({
|
|
34
|
+
async: false,
|
|
35
|
+
eslint: {
|
|
36
|
+
files: ['./src/**/*.{ts,tsx,js,jsx}', './example/src/**/*.{ts,tsx,js,jsx}'],
|
|
37
|
+
},
|
|
38
|
+
}),
|
|
39
|
+
],
|
|
40
|
+
module: {
|
|
41
|
+
rules: [
|
|
42
|
+
{
|
|
43
|
+
test: /\.js(x?)$/,
|
|
44
|
+
loader: 'babel-loader',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
test: /\.ts(x?)$/,
|
|
48
|
+
use: [
|
|
49
|
+
{
|
|
50
|
+
loader: 'babel-loader',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
loader: 'ts-loader',
|
|
54
|
+
options: {
|
|
55
|
+
transpileOnly: true,
|
|
56
|
+
allowTsInNodeModules: true,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
test: /\.css$/i,
|
|
63
|
+
use: ['style-loader', 'css-loader'],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
enforce: 'pre',
|
|
67
|
+
test: /\.js$/,
|
|
68
|
+
exclude: [/node_modules/, /build/, /__test__/],
|
|
69
|
+
loader: 'source-map-loader',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
test: /\.(png|jpg|woff|woff2|svg|eot|ttf|gif|svg)$/,
|
|
73
|
+
type: 'asset/resource',
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
devServer: {
|
|
78
|
+
allowedHosts: process.env.WAYKE_HOST
|
|
79
|
+
? process.env.WAYKE_HOST.replace(/\s/g, '').split(',')
|
|
80
|
+
: undefined,
|
|
81
|
+
historyApiFallback: true,
|
|
82
|
+
port: 5000,
|
|
83
|
+
client: {
|
|
84
|
+
overlay: false,
|
|
85
|
+
},
|
|
86
|
+
static: {
|
|
87
|
+
publicPath: path.resolve(__dirname, 'example/build'),
|
|
88
|
+
serveIndex: true,
|
|
89
|
+
},
|
|
90
|
+
hot: 'only',
|
|
91
|
+
devMiddleware: {
|
|
92
|
+
writeToDisk: true,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
};
|
package/.husky/pre-commit
DELETED
package/esbuild/cdn.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const { build } = require('esbuild');
|
|
2
|
-
|
|
3
|
-
const shared = {
|
|
4
|
-
entryPoints: ['src/cdn.ts'],
|
|
5
|
-
bundle: true,
|
|
6
|
-
minify: true,
|
|
7
|
-
sourcemap: true,
|
|
8
|
-
logLevel: 'info',
|
|
9
|
-
loader: {
|
|
10
|
-
'.js': 'jsx',
|
|
11
|
-
'.woff': 'file',
|
|
12
|
-
'.woff2': 'file',
|
|
13
|
-
'.eot': 'file',
|
|
14
|
-
'.ttf': 'file',
|
|
15
|
-
'.gif': 'file',
|
|
16
|
-
'.svg': 'dataurl',
|
|
17
|
-
'.png': 'dataurl',
|
|
18
|
-
'.css': 'file',
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
build({
|
|
23
|
-
...shared,
|
|
24
|
-
outfile: 'dist-cdn/index.js',
|
|
25
|
-
format: 'esm',
|
|
26
|
-
});
|
package/src/hooks/useEcom.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { EcomSettings } from '../providers/WaykeProvider';
|
|
2
|
-
|
|
3
|
-
const useEcom = (ecomSettings?: EcomSettings) => {
|
|
4
|
-
if (ecomSettings?.url) {
|
|
5
|
-
import('@wayke-se/ecom').then(({ config }) => {
|
|
6
|
-
config.bind({
|
|
7
|
-
api: {
|
|
8
|
-
address: ecomSettings.url,
|
|
9
|
-
},
|
|
10
|
-
/** Specifying an origin is optional **/
|
|
11
|
-
origin: {
|
|
12
|
-
topic: 'Wayke',
|
|
13
|
-
channel: 'wayke.se',
|
|
14
|
-
},
|
|
15
|
-
bankIdThumbprint: ecomSettings.bankIdThumbprint,
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default useEcom;
|
package/src/styles.scss
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import '@wayke-se/ecom-web/dist/index.css';
|