@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.
Files changed (95) hide show
  1. package/.eslintrc.js +14 -6
  2. package/.github/workflows/release-to-production.yaml +2 -3
  3. package/.github/workflows/release-to-test.yaml +2 -4
  4. package/.prettierrc +2 -0
  5. package/README.md +35 -2
  6. package/assets/ajax-loader.gif +0 -0
  7. package/assets/default.css +1 -0
  8. package/assets/fonts/slick.eot +0 -0
  9. package/assets/fonts/slick.svg +14 -0
  10. package/assets/fonts/slick.ttf +0 -0
  11. package/assets/fonts/slick.woff +0 -0
  12. package/codegen.yml +1 -1
  13. package/dist/ajax-loader-BOAPMZMT.gif +0 -0
  14. package/dist/index.css +240 -1
  15. package/dist/index.css.map +3 -3
  16. package/dist/index.d.ts +393 -320
  17. package/dist/index.js +6565 -838
  18. package/dist/index.js.map +4 -4
  19. package/dist/index.mjs +6548 -838
  20. package/dist/index.mjs.map +4 -4
  21. package/dist/slick-7CK47X3J.svg +14 -0
  22. package/dist/slick-EVLS6IWX.eot +0 -0
  23. package/dist/slick-MU5EZO5G.woff +0 -0
  24. package/dist/slick-NKQ64RRA.ttf +0 -0
  25. package/esbuild/{lib.js → build.js} +5 -14
  26. package/esbuild/common.js +5 -5
  27. package/esbuild/start.js +12 -11
  28. package/{www → esbuild/www}/index.html +3 -3
  29. package/example/src/@types/global.d.ts +7 -0
  30. package/example/src/@types/react-panellum.d.ts +1 -0
  31. package/example/src/App.tsx +77 -0
  32. package/{www → example/src/assets/style}/ecom.css +3 -0
  33. package/{www → example/src/assets/style}/theme.css +0 -0
  34. package/example/src/index.html +26 -0
  35. package/example/src/index.tsx +11 -0
  36. package/example/src/routes/HashRoute/index.tsx +30 -0
  37. package/example/src/routes/Home/index.tsx +33 -0
  38. package/example/src/routes/NotFound/index.tsx +5 -0
  39. package/example/src/routes/PathRoute/index.tsx +35 -0
  40. package/example/src/routes/Search/index.tsx +28 -0
  41. package/example/src/routes/SearchItem/index.tsx +28 -0
  42. package/example/src/routes/index.tsx +25 -0
  43. package/package.json +68 -17
  44. package/src/@types/{codegen.ts → codegen/types.ts} +0 -0
  45. package/src/@types/react-panellum.d.ts +1 -1
  46. package/src/State/CentralStorage/useCentralStorage.ts +1 -1
  47. package/src/components/ActionList/index.tsx +1 -1
  48. package/src/components/FinancialOptions/LoanModal.tsx +1 -1
  49. package/src/components/FinancialOptions/index.tsx +1 -1
  50. package/src/components/FinancialOptions/leasing.tsx +1 -1
  51. package/src/components/FinancialOptions/loan.tsx +1 -1
  52. package/src/components/Gallery/index.tsx +1 -1
  53. package/src/components/Gallery/wrapper.tsx +0 -70
  54. package/src/components/InsuranceOptions/Insurance.tsx +1 -1
  55. package/src/components/InsuranceOptions/InsuranceFree.tsx +1 -1
  56. package/src/components/InsuranceOptions/InsuranceFreeModal.tsx +1 -1
  57. package/src/components/InsuranceOptions/InsuranceModal.tsx +1 -1
  58. package/src/components/InsuranceOptions/index.tsx +1 -1
  59. package/src/components/Lightbox/index.tsx +1 -1
  60. package/src/components/Map/index.tsx +1 -1
  61. package/src/components/OpeningHours/index.tsx +1 -1
  62. package/src/components/Pdf/index.tsx +1 -1
  63. package/src/components/SortSelect/index.tsx +1 -1
  64. package/src/components/Sphere/SphereLightbox.tsx +1 -3
  65. package/src/components/Sphere/SphereViewer.tsx +44 -8
  66. package/src/components/Sphere/wrapper.tsx +0 -3
  67. package/src/hooks/useInsurance.ts +1 -1
  68. package/src/hooks/useLoan.ts +1 -1
  69. package/src/hooks/useSearchItem.ts +1 -1
  70. package/src/hooks/useSearchItemBranch.ts +1 -1
  71. package/src/index-dev.tsx +32 -134
  72. package/src/index-esbuild.ts +74 -0
  73. package/src/index.ts +8 -6
  74. package/src/layouts/searchItem/Branch.tsx +1 -1
  75. package/src/layouts/searchItem/BranchModal.tsx +1 -1
  76. package/src/layouts/searchItem/CheckList.tsx +1 -1
  77. package/src/layouts/searchItem/ManufacturerPackagesOption.tsx +1 -1
  78. package/src/layouts/searchItem/PackageOptions.tsx +1 -1
  79. package/src/layouts/searchItem/Property.tsx +1 -1
  80. package/src/layouts/searchItem/index.tsx +1 -3
  81. package/src/providers/WaykeItemProvidet.tsx +19 -24
  82. package/src/providers/WaykeProvider.tsx +26 -31
  83. package/src/utils/pubsub/Events.ts +10 -0
  84. package/src/utils/pubsub/pubsub.ts +8 -0
  85. package/src/utils/specification.ts +1 -1
  86. package/src/utils/vehicle-properties/custom-property-adder.ts +1 -1
  87. package/tsconfig.build.json +1 -1
  88. package/tsconfig.eslint.json +11 -0
  89. package/tsconfig.json +9 -6
  90. package/webpack.analyze.js +10 -0
  91. package/webpack.config.js +95 -0
  92. package/.husky/pre-commit +0 -4
  93. package/esbuild/cdn.js +0 -26
  94. package/src/hooks/useEcom.ts +0 -21
  95. package/src/styles.scss +0 -1
@@ -9,7 +9,7 @@ import Modal from '../Modal/index';
9
9
  import { Image, ModalFoldout, ModalFoldoutBody } from '../Modal/wrapper';
10
10
  import Content from '../Content/index';
11
11
  import DataList from '../DataList/index';
12
- import { FinancialOption } from '../../@types/codegen';
12
+ import { FinancialOption } from '../../@types/codegen/types';
13
13
 
14
14
  interface LeasingProps {
15
15
  financialOption: FinancialOption;
@@ -6,7 +6,7 @@ import { UtilityTextPrimary } from '../Utility/index';
6
6
  import { ButtonInline } from '../Button/index';
7
7
  import { numberSeparator } from '../../utils/formats';
8
8
  import useLoanCalculation from '../../hooks/useLoan';
9
- import { FinancialOption } from '../../@types/codegen';
9
+ import { FinancialOption } from '../../@types/codegen/types';
10
10
  import LoanModal from './LoanModal';
11
11
 
12
12
  interface LoanProps {
@@ -25,7 +25,7 @@ import QuickNavEmbeded from '../Video/QuickNavEmbeded';
25
25
  import Sphere from '../Sphere/Sphere';
26
26
  import { notEmpty } from '../../utils/formats';
27
27
  import ThreeSixty from '../ThreeSixty/ThreeSixty';
28
- import { Media } from '../../@types/codegen';
28
+ import { Media } from '../../@types/codegen/types';
29
29
  import PubSub from '../../utils/pubsub/pubsub';
30
30
  import { DEFAULT_PLACEHOLDER_IMAGE } from '../../utils/constants';
31
31
 
@@ -106,76 +106,6 @@ export const SliderWrapper = styled.div`
106
106
  bottom: 0;
107
107
  left: 0;
108
108
  right: 0;
109
- user-select: none;
110
- touch-action: pan-y;
111
- -webkit-tap-highlight-color: transparent;
112
-
113
- .slick-list,
114
- .slick-track {
115
- transform: translate3d(0, 0, 0);
116
- }
117
- }
118
-
119
- .slick-list {
120
- position: relative;
121
- display: block;
122
- margin: 0;
123
- padding: 0;
124
- overflow: hidden;
125
-
126
- &:focus {
127
- outline: none;
128
- }
129
-
130
- &.dragging {
131
- cursor: pointer;
132
- cursor: hand;
133
- }
134
- }
135
-
136
- .slick-track {
137
- position: relative;
138
- top: 0;
139
- left: 0;
140
- display: block;
141
- margin-left: auto;
142
- margin-right: auto;
143
-
144
- &::before,
145
- &::after {
146
- content: '';
147
- display: table;
148
- }
149
-
150
- &::after {
151
- clear: both;
152
- }
153
- }
154
-
155
- .slick-slide {
156
- display: none;
157
- float: left;
158
- min-height: 1px;
159
- }
160
-
161
- .slick-loading {
162
- .slick-track {
163
- visibility: hidden;
164
- }
165
-
166
- img {
167
- display: none;
168
- }
169
- }
170
-
171
- .slick-initialized {
172
- .slick-slide {
173
- display: block;
174
- }
175
- }
176
-
177
- .slick-slide.dragging img {
178
- pointer-events: none;
179
109
  }
180
110
 
181
111
  ${(props) => props.theme.breakpoint.LtMd} {
@@ -4,7 +4,7 @@ import { VisualHeading } from '../Heading/index';
4
4
  import OptionBox from '../OptionBox/index';
5
5
  import { OptionBoxHeading, OptionBoxContent } from '../OptionBox/wrapper';
6
6
  import { ButtonInline } from '../Button/index';
7
- import { InsuranceOption, Branch } from '../../@types/codegen';
7
+ import { InsuranceOption, Branch } from '../../@types/codegen/types';
8
8
  import InsuranceModal from './InsuranceModal';
9
9
 
10
10
  interface InsuranceOptions {
@@ -6,7 +6,7 @@ import { OptionBoxContent } from '../OptionBox/wrapper';
6
6
  import Content from '../Content/index';
7
7
  import { marked } from 'marked';
8
8
  import { ButtonInline } from '../Button/index';
9
- import { InsuranceOption } from '../../@types/codegen';
9
+ import { InsuranceOption } from '../../@types/codegen/types';
10
10
  import InsuranceFreeModal from './InsuranceFreeModal';
11
11
 
12
12
  interface InsuranceOptions {
@@ -5,7 +5,7 @@ import Content from '../Content/index';
5
5
  import { Repeat } from '../Repeat/index';
6
6
  import { ButtonInline } from '../Button/index';
7
7
  import LogoBox from '../LogoBox/index';
8
- import { InsuranceOption } from '../../@types/codegen';
8
+ import { InsuranceOption } from '../../@types/codegen/types';
9
9
  import { marked } from 'marked';
10
10
 
11
11
  interface InsuranceFreeModal {
@@ -21,7 +21,7 @@ import useInsuranceCalculation from '../../hooks/useInsurance';
21
21
  import { ssnIsValid } from '../../utils/ssn';
22
22
  import Loader from '../Loader/index';
23
23
  import { numberSeparator } from '../../utils/formats';
24
- import { DrivingDistance, InsuranceOption, Branch } from '../../@types/codegen';
24
+ import { DrivingDistance, InsuranceOption, Branch } from '../../@types/codegen/types';
25
25
  import PubSub from '../../utils/pubsub/pubsub';
26
26
 
27
27
  interface FormData {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { InsuranceOption, Branch } from '../../@types/codegen';
2
+ import { InsuranceOption, Branch } from '../../@types/codegen/types';
3
3
  import Insurance from './Insurance';
4
4
  import InsuranceFree from './InsuranceFree';
5
5
 
@@ -5,7 +5,7 @@ import { IconCancel } from '../Icon/index';
5
5
  import EmbeddedVideoLightbox from '../Video/EmbeddedVideoLightbox';
6
6
  import SphereLightbox from '../Sphere/SphereLightbox';
7
7
  import ThreeSixtyLightbox from '../ThreeSixty/ThreeSixtLightbox';
8
- import { Media } from '../../@types/codegen';
8
+ import { Media } from '../../@types/codegen/types';
9
9
 
10
10
  interface LightboxProps {
11
11
  index: number;
@@ -3,7 +3,7 @@ import useSettings from '../../State/Settings/useSettings';
3
3
 
4
4
  import { Wrapper, Image, Placeholder, PlaceholderAction } from './wrapper';
5
5
  import { ButtonSecondary, ButtonContent } from '../Button/index';
6
- import { Position, Maybe } from '../../@types/codegen';
6
+ import { Position, Maybe } from '../../@types/codegen/types';
7
7
 
8
8
  interface StaticMapProps {
9
9
  position?: Maybe<Position>;
@@ -4,7 +4,7 @@ import Badge from '../Badge/index';
4
4
  import { TableColumn, TableColumnRow, TableColumnCell } from '../TableColumn/index';
5
5
  import { UtilityTextBold } from '../Utility/index';
6
6
 
7
- import { OpeningHours, Maybe } from '../../@types/codegen';
7
+ import { OpeningHours, Maybe } from '../../@types/codegen/types';
8
8
 
9
9
  type Days = Omit<OpeningHours, '__typename'>;
10
10
  type KeyType = keyof Days;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { Scalars } from '../../@types/codegen';
3
+ import { Scalars } from '../../@types/codegen/types';
4
4
  import {
5
5
  PdfListItem,
6
6
  PdfSubtitle,
@@ -2,7 +2,7 @@ import React from 'react';
2
2
 
3
3
  import { Wrapper, Select, Option, Icon } from './wrapper';
4
4
  import { IconChevronDown } from '../Icon/index';
5
- import { DrivingDistance } from '../../@types/codegen';
5
+ import { DrivingDistance } from '../../@types/codegen/types';
6
6
 
7
7
  export interface OptionProps {
8
8
  value: number | string | DrivingDistance;
@@ -5,8 +5,6 @@ type PropsType = {
5
5
  url: string;
6
6
  };
7
7
 
8
- const SphereLightbox = ({ url }: PropsType) => (
9
- <SphereViewer id={url} src={url} preview={url} autoLoad />
10
- );
8
+ const SphereLightbox = ({ url }: PropsType) => <SphereViewer id={url} src={url} preview={url} />;
11
9
 
12
10
  export default SphereLightbox;
@@ -3,9 +3,41 @@ import React, { lazy, useState, useEffect } from 'react';
3
3
  import { Wrapper } from './wrapper';
4
4
  import Loader from '../Loader/index';
5
5
 
6
- // Skip loading pannellum with video
7
- const ReactPannellum = lazy(() => import('pannellum-react/es/elements/Pannellum'));
6
+ const ReactPannellum = lazy(() => import('react-pannellum'));
8
7
 
8
+ const config = {
9
+ type: 'equirectangular',
10
+ autoRotate: -2,
11
+ autoLoad: true,
12
+ uiText: {
13
+ bylineLabel: 'by %s',
14
+ noPanoramaError: 'No panorama image was specified.',
15
+ fileAccessError: 'The file %s could not be accessed.',
16
+ malformedURLError: 'There is something wrong with the panorama URL.',
17
+ iOS8WebGLError:
18
+ "Due to iOS 8's broken WebGL implementation, only progressive encoded JPEGs work for your device (this panorama uses standard encoding).",
19
+ genericWebGLError:
20
+ 'Your browser does not have the necessary WebGL support to display this panorama.',
21
+ textureSizeError:
22
+ "This panorama is too big for your device! It's %spx wide, but your device only supports images up to %spx wide. Try another device. (If you're the author, try scaling down the image.)",
23
+ unknownError: 'Unknown error. Check developer console.',
24
+ loadButtonLabel: 'Starta 360° interiört',
25
+ loadingLabel: 'Laddar...',
26
+ },
27
+ preview: '/images/placeholders/placeholder_product_card.jpg',
28
+ compass: true,
29
+ showZoomCtrl: true,
30
+ keyboardZoom: false,
31
+ mouseZoom: false,
32
+ hfov: 180,
33
+ };
34
+
35
+ const style = {
36
+ height: 0,
37
+ width: '100%',
38
+ paddingBottom: '66.666%',
39
+ touchAction: 'manipulation',
40
+ };
9
41
  type PropsType = {
10
42
  id: string;
11
43
  src: string;
@@ -25,17 +57,21 @@ const SphereViewer = ({ id, src, preview, autoLoad, onStart }: PropsType) => {
25
57
  }, 100);
26
58
  }, []);
27
59
 
60
+ const c = {
61
+ ...config,
62
+ preview,
63
+ autoLoad,
64
+ };
65
+
28
66
  return (
29
67
  <Wrapper>
30
68
  <React.Suspense fallback={<Loader />}>
31
69
  <ReactPannellum
32
70
  id={`a-${id}-${number}`}
33
- image={src}
34
- hfov={120}
35
- autoLoad={autoLoad}
36
- compass
37
- width={'100%'}
38
- preview={preview}
71
+ sceneId={src}
72
+ imageSource={src}
73
+ config={c}
74
+ style={style}
39
75
  />
40
76
  </React.Suspense>
41
77
  </Wrapper>
@@ -6,14 +6,11 @@ const compassSize = size(4);
6
6
  const controlBtnSize = size(4);
7
7
 
8
8
  export const Wrapper = styled.div`
9
- position: relative;
10
9
  width: 100%;
11
10
  height: 0 !important;
12
11
  padding-bottom: 66.666% !important; // 3:2
13
12
 
14
13
  .pnlm-container {
15
- position: absolute;
16
- height: 100% !important;
17
14
  background-image: none;
18
15
  background-color: ${(props) => props.theme.color.accentDark};
19
16
  }
@@ -1,7 +1,7 @@
1
1
  import { useQuery, QueryResult } from '@apollo/client';
2
2
  import INSURANCE_CALCULATION from '../queries/INSURANCE_CALCULATION';
3
3
 
4
- import { DrivingDistance, QueryInsurancesArgs, Query } from '../@types/codegen';
4
+ import { DrivingDistance, QueryInsurancesArgs, Query } from '../@types/codegen/types';
5
5
 
6
6
  const useInsuranceCalculation = (
7
7
  id: string,
@@ -1,6 +1,6 @@
1
1
  import { useQuery, QueryResult } from '@apollo/client';
2
2
  import LOAN_CALCULATION from '../queries/LOAN_CALCULATION';
3
- import { QueryLoanArgs, Query } from '../@types/codegen';
3
+ import { QueryLoanArgs, Query } from '../@types/codegen/types';
4
4
 
5
5
  const useLoanCalculation = (
6
6
  id: string,
@@ -1,6 +1,6 @@
1
1
  import { useQuery, QueryResult } from '@apollo/client';
2
2
  import SEARCH_ITEM_QUERY from '../queries/SEARCH_ITEM_QUERY';
3
- import { QueryVehicleArgs, Query } from '../@types/codegen';
3
+ import { QueryVehicleArgs, Query } from '../@types/codegen/types';
4
4
 
5
5
  const useSearchItem = (id?: string): QueryResult<Query, QueryVehicleArgs> =>
6
6
  useQuery<Query, QueryVehicleArgs>(SEARCH_ITEM_QUERY, {
@@ -1,6 +1,6 @@
1
1
  import { useQuery, QueryResult } from '@apollo/client';
2
2
  import SEARCH_ITEM_BRANCH_QUERY from '../queries/SEARCH_ITEM_BRANCH_QUERY';
3
- import { QueryVehicleArgs, Query } from '../@types/codegen';
3
+ import { QueryVehicleArgs, Query } from '../@types/codegen/types';
4
4
 
5
5
  const useSearchItemBranch = (
6
6
  id?: string | null,
package/src/index-dev.tsx CHANGED
@@ -1,14 +1,11 @@
1
1
  import React from 'react';
2
2
  import { createRoot } from 'react-dom/client';
3
- import '@wayke-se/ecom-web/dist/index.css';
4
3
 
5
- import WaykeComposite, {
6
- WaykePubSub,
7
- WaykeProvider,
8
- WaykeItemProvider,
9
- WaykeSearch,
10
- WaykeSearchItem,
11
- } from '.';
4
+ import '../example/src/assets/style/theme.css';
5
+ import '../example/src/assets/style/ecom.css';
6
+ import '../assets/default.css';
7
+
8
+ import WaykeComposite, { WaykePubSub } from '.';
12
9
 
13
10
  WaykePubSub.subscribe({
14
11
  eventName: 'All',
@@ -16,129 +13,30 @@ WaykePubSub.subscribe({
16
13
  callback: (eventName, data) => console.log('subscribed All:', eventName, data),
17
14
  });
18
15
 
19
- type InitType = 'hash' | 'default' | 'path' | 'search' | 'item';
20
-
21
- const App = ({ type }: { type: InitType }) => {
22
- switch (type) {
23
- case 'hash':
24
- return (
25
- <WaykeComposite
26
- composite={{
27
- // initialQueryParams,
28
- removeSearchBar: false,
29
- }}
30
- provider={{
31
- graphQlUrl: process.env.WAYKE_GRAPH_QL_URL as string,
32
- url: process.env.WAYKE_SEARCH_URL as string,
33
- urlMlt: process.env.WAYKE_SEARCH_MLT_URL as string,
34
- ecomSettings: {
35
- url: process.env.WAYKE_ECOM_URL as string,
36
- useBankId: true,
37
- serviceLogotypeUrl: 'https://cdn.wayke.se/wui/images/ecom/wayke-logo.svg',
38
- },
39
- //googleMapsApiKey: process.env.GOOGLE_MAPS_API_KEY as string,
40
- googleMapsMarker: 'https://www.wayke.se/images/map/marker.png',
41
- useQueryParamsFromUrl: true,
42
- }}
43
- />
44
- );
45
-
46
- case 'path':
47
- return (
48
- <WaykeComposite
49
- composite={{
50
- // initialQueryParams,
51
- removeSearchBar: false,
52
- pathRoute: '/id/',
53
- modifyDocumentTitleItem: true,
54
- modifyDocumentTitleSearch: 'Wayke',
55
- initialQueryParams: 'modelSeries=A5&modelSeries=A3',
56
- }}
57
- provider={{
58
- graphQlUrl: process.env.WAYKE_GRAPH_QL_URL as string,
59
- url: process.env.WAYKE_SEARCH_URL as string,
60
- urlMlt: process.env.WAYKE_SEARCH_MLT_URL as string,
61
- ecomSettings: {
62
- url: process.env.WAYKE_ECOM_URL as string,
63
- useBankId: true,
64
- serviceLogotypeUrl: 'https://cdn.wayke.se/wui/images/ecom/wayke-logo.svg',
65
- },
66
- //googleMapsApiKey: process.env.GOOGLE_MAPS_API_KEY as string,
67
- googleMapsMarker: 'https://www.wayke.se/images/map/marker.png',
68
- useQueryParamsFromUrl: true,
69
- pathRoute: '/id/',
70
- }}
71
- />
72
- );
73
-
74
- case 'search':
75
- return (
76
- <WaykeProvider
77
- graphQlUrl={process.env.WAYKE_GRAPH_QL_URL as string}
78
- url={process.env.WAYKE_SEARCH_URL as string}
79
- urlMlt={process.env.WAYKE_SEARCH_MLT_URL as string}
80
- ecomSettings={{
81
- url: process.env.WAYKE_ECOM_URL as string,
82
- useBankId: true,
83
- serviceLogotypeUrl: 'https://cdn.wayke.se/wui/images/ecom/wayke-logo.svg',
84
- }}
85
- //googleMapsApiKey={process.env.GOOGLE_MAPS_API_KEY as string}
86
- >
87
- <WaykeSearch
88
- onClickSearchItem={(id: string) => {
89
- //eslint-disable-next-line
90
- console.log(id);
91
- }}
92
- />
93
- </WaykeProvider>
94
- );
95
-
96
- case 'item':
97
- return (
98
- <WaykeItemProvider
99
- graphQlUrl={process.env.WAYKE_GRAPH_QL_URL as string}
100
- url={process.env.WAYKE_SEARCH_URL as string}
101
- urlMlt={process.env.WAYKE_SEARCH_MLT_URL as string}
102
- ecomSettings={{
103
- url: process.env.WAYKE_ECOM_URL as string,
104
- useBankId: true,
105
- serviceLogotypeUrl: 'https://cdn.wayke.se/wui/images/ecom/wayke-logo.svg',
106
- }}
107
- //googleMapsApiKey={process.env.GOOGLE_MAPS_API_KEY as string}
108
- >
109
- <WaykeSearchItem id="6fa0161f-abc9-4544-8ba3-c648613a77b7" />
110
- </WaykeItemProvider>
111
- );
112
-
113
- case 'default':
114
- default:
115
- return (
116
- <WaykeComposite
117
- composite={{
118
- // initialQueryParams,
119
- removeSearchBar: false,
120
- removeFilterOptions: false,
121
- modifyDocumentTitleItem: true,
122
- modifyDocumentTitleSearch: 'Wayke',
123
- }}
124
- provider={{
125
- graphQlUrl: process.env.WAYKE_GRAPH_QL_URL as string,
126
- url: process.env.WAYKE_SEARCH_URL as string,
127
- urlMlt: process.env.WAYKE_SEARCH_MLT_URL as string,
128
- ecomSettings: {
129
- url: process.env.WAYKE_ECOM_URL as string,
130
- useBankId: true,
131
- serviceLogotypeUrl: 'https://cdn.wayke.se/wui/images/ecom/wayke-logo.svg',
132
- },
133
- //googleMapsApiKey: process.env.GOOGLE_MAPS_API_KEY as string,
134
- googleMapsMarker: 'https://www.wayke.se/images/map/marker.png',
135
- useQueryParamsFromUrl: true,
136
- }}
137
- />
138
- );
139
- }
140
- };
141
-
142
- const container = document.getElementById('root');
143
- const root = createRoot(container!);
144
- root.render(<App type="default" />);
16
+ window.addEventListener('DOMContentLoaded', (_) => {
17
+ const container = document.getElementById('root');
18
+ const root = createRoot(container!);
19
+ root.render(
20
+ <WaykeComposite
21
+ composite={{
22
+ removeSearchBar: false,
23
+ removeFilterOptions: false,
24
+ modifyDocumentTitleItem: true,
25
+ modifyDocumentTitleSearch: 'Wayke',
26
+ }}
27
+ provider={{
28
+ graphQlUrl: process.env.WAYKE_GRAPH_QL_URL as string,
29
+ url: process.env.WAYKE_SEARCH_URL as string,
30
+ urlMlt: process.env.WAYKE_SEARCH_MLT_URL as string,
31
+ ecomSettings: {
32
+ url: process.env.WAYKE_ECOM_URL as string,
33
+ useBankId: true,
34
+ serviceLogotypeUrl: 'https://cdn.wayke.se/wui/images/ecom/wayke-logo.svg',
35
+ },
36
+ googleMapsApiKey: process.env.GOOGLE_MAPS_API_KEY as string,
37
+ googleMapsMarker: 'https://www.wayke.se/images/map/marker.png',
38
+ useQueryParamsFromUrl: true,
39
+ }}
40
+ />
41
+ );
42
+ });
@@ -0,0 +1,74 @@
1
+ import '../assets/default.css';
2
+
3
+ import WaykeSearch, { WaykeSearchProps } from './layouts/search/index';
4
+ import WaykeSearchItem, { WaykeSearchItemProps } from './layouts/searchItem/index';
5
+ import WaykeProvider, { WaykeProviderSettings } from './providers/WaykeProvider';
6
+ import WaykeComposite, {
7
+ WaykeCompositeWithProviderProps,
8
+ } from './layouts/WaykeCompositeWithProvider';
9
+ import SearchBar from './components/SearchBar/index';
10
+ import WaykeThemeProvider from './providers/themeProvider';
11
+ import WaykeItemProvider, { WaykeItemProviderSettings } from './providers/WaykeItemProvidet';
12
+ import WaykePubSub, { EventSubscriptions } from './utils/pubsub/pubsub';
13
+ import type { SearchFilterTypes, SearchFilterNameTypes } from './@types/filter';
14
+
15
+ import type {
16
+ EventHashRouteChange,
17
+ EventItemClicked,
18
+ EventEcomOnInit,
19
+ EventEcomOnUser,
20
+ EventEcomOnExit,
21
+ EventImagesClick,
22
+ EventOptionsClick,
23
+ EventPhonenumberVisible,
24
+ EventPhonenumberCall,
25
+ EventMailVisible,
26
+ EventInsuranceInterest,
27
+ EventFinanceInterest,
28
+ EventAll,
29
+ EventType,
30
+ EventNames,
31
+ CallbackHashRouteChange,
32
+ CallbackEventItemClicked,
33
+ CallbackEcomOnUserEvent,
34
+ CallbackEmpty,
35
+ } from './utils/pubsub/Events';
36
+
37
+ export {
38
+ WaykeProvider,
39
+ WaykeItemProvider,
40
+ WaykeSearch,
41
+ WaykeSearchItem,
42
+ SearchBar,
43
+ WaykeThemeProvider,
44
+ WaykeItemProviderSettings,
45
+ WaykePubSub,
46
+ WaykeCompositeWithProviderProps,
47
+ WaykeProviderSettings,
48
+ WaykeSearchProps,
49
+ WaykeSearchItemProps,
50
+ SearchFilterTypes,
51
+ SearchFilterNameTypes,
52
+ EventSubscriptions,
53
+ EventHashRouteChange,
54
+ EventItemClicked,
55
+ EventEcomOnInit,
56
+ EventEcomOnUser,
57
+ EventEcomOnExit,
58
+ EventImagesClick,
59
+ EventOptionsClick,
60
+ EventPhonenumberVisible,
61
+ EventPhonenumberCall,
62
+ EventMailVisible,
63
+ EventInsuranceInterest,
64
+ EventFinanceInterest,
65
+ EventAll,
66
+ EventType,
67
+ EventNames,
68
+ CallbackHashRouteChange,
69
+ CallbackEventItemClicked,
70
+ CallbackEcomOnUserEvent,
71
+ CallbackEmpty,
72
+ };
73
+
74
+ export default WaykeComposite;
package/src/index.ts CHANGED
@@ -1,7 +1,5 @@
1
- import './styles.scss';
2
-
3
- import WaykeSearch, { WaykeSearchProps } from './layouts/search';
4
- import WaykeSearchItem, { WaykeSearchItemProps } from './layouts/searchItem';
1
+ import WaykeSearch, { WaykeSearchProps } from './layouts/search/index';
2
+ import WaykeSearchItem, { WaykeSearchItemProps } from './layouts/searchItem/index';
5
3
  import WaykeProvider, { WaykeProviderSettings } from './providers/WaykeProvider';
6
4
  import WaykeComposite, {
7
5
  WaykeCompositeWithProviderProps,
@@ -10,12 +8,14 @@ import SearchBar from './components/SearchBar/index';
10
8
  import WaykeThemeProvider from './providers/themeProvider';
11
9
  import WaykeItemProvider, { WaykeItemProviderSettings } from './providers/WaykeItemProvidet';
12
10
  import WaykePubSub, { EventSubscriptions } from './utils/pubsub/pubsub';
13
- import { SearchFilterTypes, SearchFilterNameTypes } from './@types/filter';
11
+ import type { SearchFilterTypes, SearchFilterNameTypes } from './@types/filter';
14
12
 
15
- import {
13
+ import type {
16
14
  EventHashRouteChange,
17
15
  EventItemClicked,
16
+ EventEcomOnInit,
18
17
  EventEcomOnUser,
18
+ EventEcomOnExit,
19
19
  EventImagesClick,
20
20
  EventOptionsClick,
21
21
  EventPhonenumberVisible,
@@ -50,7 +50,9 @@ export {
50
50
  EventSubscriptions,
51
51
  EventHashRouteChange,
52
52
  EventItemClicked,
53
+ EventEcomOnInit,
53
54
  EventEcomOnUser,
55
+ EventEcomOnExit,
54
56
  EventImagesClick,
55
57
  EventOptionsClick,
56
58
  EventPhonenumberVisible,
@@ -11,7 +11,7 @@ import OpeningHours from '../../components/OpeningHours/index';
11
11
  import PhoneNumber from '../../components/PhoneNumber/index';
12
12
  import Map from '../../components/Map/index';
13
13
 
14
- import { Branch, Maybe } from '../../@types/codegen';
14
+ import { Branch, Maybe } from '../../@types/codegen/types';
15
15
  import BranchModal from './BranchModal';
16
16
  import { formatPhonenumber } from '../../utils/phonenumbers';
17
17
 
@@ -6,7 +6,7 @@ import { ButtonPrimary, ButtonContent } from '../../components/Button/index';
6
6
  import Modal from '../../components/Modal/index';
7
7
  import Content from '../../components/Content/index';
8
8
  import InputLabel from '../../components/InputLabel/index';
9
- import { BranchConnection } from '../../@types/codegen';
9
+ import { BranchConnection } from '../../@types/codegen/types';
10
10
  import { CentralStorageContext } from '../../State/CentralStorage/CentralStorageContext';
11
11
 
12
12
  interface BranchModalProps {
@@ -12,7 +12,7 @@ import {
12
12
  Ecommerce,
13
13
  ContactOptions,
14
14
  Branch,
15
- } from '../../@types/codegen';
15
+ } from '../../@types/codegen/types';
16
16
  import BranchModal from './BranchModal';
17
17
  import PackageOptionModal, { PackageOptionModalData } from './PackageOptionModal';
18
18