@wayke-se/components-react 3.0.0-beta.4 → 3.0.0-beta.6
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/dist/index.js +841 -2205
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +822 -2186
- package/dist/index.mjs.map +4 -4
- package/esbuild/lib.js +1 -0
- package/package.json +2 -3
- package/src/components/Gallery/index.tsx +30 -32
- package/src/components/Lightbox/index.tsx +11 -11
package/esbuild/lib.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wayke-se/components-react",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.6",
|
|
4
4
|
"description": "Wayke Components React",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"react": "^18.2.0",
|
|
54
54
|
"react-dom": "^18.2.0",
|
|
55
55
|
"rimraf": "^3.0.2",
|
|
56
|
-
"styled-components": "^5.3.
|
|
56
|
+
"styled-components": "^5.3.5",
|
|
57
57
|
"typescript": "^4.4.4"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
"graphql": "^16.0.1",
|
|
65
65
|
"libphonenumber-js": "^1.9.42",
|
|
66
66
|
"marked": "^4.0.3",
|
|
67
|
-
"pannellum-react": "^1.2.4",
|
|
68
67
|
"react-compound-slider": "^3.3.1",
|
|
69
68
|
"react-lazy-load": "^4.0.1",
|
|
70
69
|
"react-slick": "^0.29.0",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useCallback, useRef, useMemo } from 'react';
|
|
2
2
|
import Slider from 'react-slick';
|
|
3
3
|
import scrollIntoView from 'scroll-into-view-if-needed';
|
|
4
|
-
|
|
4
|
+
/*
|
|
5
5
|
import {
|
|
6
6
|
Wrapper,
|
|
7
7
|
SliderWrapper,
|
|
@@ -22,9 +22,9 @@ import { ButtonSecondary, ButtonContent } from '../Button/index';
|
|
|
22
22
|
import Lightbox from '../Lightbox/index';
|
|
23
23
|
import EmbededVideo from '../Video/EmbededVideo';
|
|
24
24
|
import QuickNavEmbeded from '../Video/QuickNavEmbeded';
|
|
25
|
-
import Sphere from '../Sphere/Sphere';
|
|
26
25
|
import { notEmpty } from '../../utils/formats';
|
|
27
26
|
import ThreeSixty from '../ThreeSixty/ThreeSixty';
|
|
27
|
+
*/
|
|
28
28
|
import { Media } from '../../@types/codegen';
|
|
29
29
|
import PubSub from '../../utils/pubsub/pubsub';
|
|
30
30
|
import { DEFAULT_PLACEHOLDER_IMAGE } from '../../utils/constants';
|
|
@@ -118,6 +118,9 @@ const Gallery = ({ media, placeholderImage }: GalleryProps) => {
|
|
|
118
118
|
[placeholderImage]
|
|
119
119
|
);
|
|
120
120
|
|
|
121
|
+
return <p>heheh</p>;
|
|
122
|
+
|
|
123
|
+
/*
|
|
121
124
|
return (
|
|
122
125
|
<>
|
|
123
126
|
<Wrapper>
|
|
@@ -132,36 +135,30 @@ const Gallery = ({ media, placeholderImage }: GalleryProps) => {
|
|
|
132
135
|
beforeChange={beforeChange}
|
|
133
136
|
>
|
|
134
137
|
{!!media?.length ? (
|
|
135
|
-
media
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
onDisableNavigation={onDisableNavigation}
|
|
160
|
-
navigationDisabled={navigationDisabled}
|
|
161
|
-
/>
|
|
162
|
-
)}
|
|
163
|
-
</Item>
|
|
164
|
-
))
|
|
138
|
+
media
|
|
139
|
+
.filter((x) => x.type !== 'sphere')
|
|
140
|
+
.map((m, i) => (
|
|
141
|
+
<Item key={m.files[0].url || i}>
|
|
142
|
+
{m.type === 'image' && (
|
|
143
|
+
<Image
|
|
144
|
+
src={
|
|
145
|
+
m.files[0].formats.filter(notEmpty).find((x) => x.format === '1170x')
|
|
146
|
+
?.url
|
|
147
|
+
}
|
|
148
|
+
alt={`Bild ${i + 1}`}
|
|
149
|
+
/>
|
|
150
|
+
)}
|
|
151
|
+
{m.type === 'threesixty' && (
|
|
152
|
+
<ThreeSixty
|
|
153
|
+
urls={m.files.map((x) => x.url)}
|
|
154
|
+
visible={i === index}
|
|
155
|
+
onDisableNavigation={onDisableNavigation}
|
|
156
|
+
navigationDisabled={navigationDisabled}
|
|
157
|
+
/>
|
|
158
|
+
)}
|
|
159
|
+
{m.type === 'embedded' && <EmbededVideo src={m.files[0].url} index={i + 1} />}
|
|
160
|
+
</Item>
|
|
161
|
+
))
|
|
165
162
|
) : (
|
|
166
163
|
<Item key={placeholder}>
|
|
167
164
|
<Image src={placeholder} alt={`Bild 1`} />
|
|
@@ -222,6 +219,7 @@ const Gallery = ({ media, placeholderImage }: GalleryProps) => {
|
|
|
222
219
|
)}
|
|
223
220
|
</>
|
|
224
221
|
);
|
|
222
|
+
*/
|
|
225
223
|
};
|
|
226
224
|
|
|
227
225
|
export default Gallery;
|
|
@@ -3,7 +3,6 @@ import React from 'react';
|
|
|
3
3
|
import { Wrapper, UiBlock, Item, Img, CloseBtn } from './wrapper';
|
|
4
4
|
import { IconCancel } from '../Icon/index';
|
|
5
5
|
import EmbeddedVideoLightbox from '../Video/EmbeddedVideoLightbox';
|
|
6
|
-
import SphereLightbox from '../Sphere/SphereLightbox';
|
|
7
6
|
import ThreeSixtyLightbox from '../ThreeSixty/ThreeSixtLightbox';
|
|
8
7
|
import { Media } from '../../@types/codegen';
|
|
9
8
|
|
|
@@ -31,16 +30,17 @@ const Lightbox = ({ index, media, onClose }: LightboxProps) => {
|
|
|
31
30
|
return (
|
|
32
31
|
<Wrapper ref={(ref) => ref?.focus()} onKeyDown={onKeyDown} tabIndex={0}>
|
|
33
32
|
<UiBlock onClick={onClose} aria-hidden />
|
|
34
|
-
{media
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
{media
|
|
34
|
+
.filter((x) => x.type !== 'sphere')
|
|
35
|
+
.map((m, i) => (
|
|
36
|
+
<Item key={i} ref={index === i ? onRef : undefined}>
|
|
37
|
+
{m.type === 'image' && (
|
|
38
|
+
<Img id={`lightbox-image-${i}`} src={m.files[0].url} alt={`Bild ${i + 1}`} />
|
|
39
|
+
)}
|
|
40
|
+
{m.type === 'threesixty' && <ThreeSixtyLightbox urls={m.files.map((x) => x.url)} />}
|
|
41
|
+
{m.type === 'embedded' && <EmbeddedVideoLightbox url={m.files[0].url} />}
|
|
42
|
+
</Item>
|
|
43
|
+
))}
|
|
44
44
|
<CloseBtn onClick={onClose} title="Stäng">
|
|
45
45
|
<IconCancel block />
|
|
46
46
|
</CloseBtn>
|