@micromag/screen-video-360 0.3.832 → 0.4.4
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/assets/css/styles.css +1 -1
- package/es/index.d.ts +98 -0
- package/es/index.js +23 -43
- package/es/styles.css +1 -0
- package/package.json +20 -19
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.container{height:100%;overflow:hidden;position:relative;width:100%}.container .background{height:100%;left:0;position:absolute;top:0;width:100%;z-index:0}.container .content{z-index:1}.container .empty{border:2px dashed var(--mm-gray-800);color:var(--mm-gray-800);height:100%;margin:0}.container .canvas,.container .canvasButton,.container .inner,.container .video{height:100%;left:0;position:absolute;top:0;width:100%}.container .canvasButton{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:inherit;cursor:pointer;display:inline-block;font-family:inherit;padding:0;position:relative;-ms-touch-action:none;touch-action:none}.container .videoContainer{position:absolute}.container .video{visibility:hidden}.container .video video{height:100%}.container .mediaControls{padding:10px 20px 20px}.container .placeholder{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;left:0;position:absolute;top:0;width:100%;-ms-flex-pack:center;justify-content:center}.container .header{top:0;z-index:1}.container .bottom,.container .header{left:0;position:absolute;-webkit-transition:padding .2s ease-out,-webkit-transform .2s ease-out;transition:padding .2s ease-out,-webkit-transform .2s ease-out;transition:transform .2s ease-out,padding .2s ease-out;transition:transform .2s ease-out,padding .2s ease-out,-webkit-transform .2s ease-out;width:100%}.container .bottom{bottom:0}.container .bottom>*{margin-bottom:10px}.container .bottom>:last-child{margin-bottom:0}.container.showVideo .video{visibility:visible}
|
package/es/index.d.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { VideoElement, Header, Footer, BackgroundElement } from '@micromag/core';
|
|
3
|
+
|
|
4
|
+
interface Video360ScreenProps {
|
|
5
|
+
layout?: 'full';
|
|
6
|
+
video?: VideoElement | null;
|
|
7
|
+
header?: Header | null;
|
|
8
|
+
footer?: Footer | null;
|
|
9
|
+
background?: BackgroundElement | null;
|
|
10
|
+
current?: boolean;
|
|
11
|
+
preload?: boolean;
|
|
12
|
+
type?: string | null;
|
|
13
|
+
spacing?: number;
|
|
14
|
+
mediaRef?: ((...args: unknown[]) => void) | null;
|
|
15
|
+
className?: string | null;
|
|
16
|
+
}
|
|
17
|
+
declare function Video360Screen({ layout, video, header, footer, background, current, preload, type, spacing, mediaRef: customMediaRef, className, }: Video360ScreenProps): react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
declare const _default: {
|
|
20
|
+
id: string;
|
|
21
|
+
type: string;
|
|
22
|
+
group: {
|
|
23
|
+
label: {
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
order: number;
|
|
28
|
+
};
|
|
29
|
+
title: {
|
|
30
|
+
defaultMessage: string;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
component: typeof Video360Screen;
|
|
34
|
+
layouts: string[];
|
|
35
|
+
fields: ({
|
|
36
|
+
name: string;
|
|
37
|
+
type: string;
|
|
38
|
+
theme: {
|
|
39
|
+
color: string;
|
|
40
|
+
badge?: undefined;
|
|
41
|
+
callToAction?: undefined;
|
|
42
|
+
};
|
|
43
|
+
defaultValue: {
|
|
44
|
+
autoPlay: boolean;
|
|
45
|
+
};
|
|
46
|
+
label: {
|
|
47
|
+
defaultMessage: string;
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
} | {
|
|
51
|
+
name: string;
|
|
52
|
+
type: string;
|
|
53
|
+
label: {
|
|
54
|
+
defaultMessage: string;
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
theme?: undefined;
|
|
58
|
+
defaultValue?: undefined;
|
|
59
|
+
} | {
|
|
60
|
+
name: string;
|
|
61
|
+
type: string;
|
|
62
|
+
label: {
|
|
63
|
+
defaultMessage: string;
|
|
64
|
+
description: string;
|
|
65
|
+
};
|
|
66
|
+
theme: {
|
|
67
|
+
badge: {
|
|
68
|
+
label: {
|
|
69
|
+
textStyle: string;
|
|
70
|
+
};
|
|
71
|
+
boxStyle: string;
|
|
72
|
+
};
|
|
73
|
+
color?: undefined;
|
|
74
|
+
callToAction?: undefined;
|
|
75
|
+
};
|
|
76
|
+
defaultValue?: undefined;
|
|
77
|
+
} | {
|
|
78
|
+
name: string;
|
|
79
|
+
type: string;
|
|
80
|
+
label: {
|
|
81
|
+
defaultMessage: string;
|
|
82
|
+
description: string;
|
|
83
|
+
};
|
|
84
|
+
theme: {
|
|
85
|
+
callToAction: {
|
|
86
|
+
label: {
|
|
87
|
+
textStyle: string;
|
|
88
|
+
};
|
|
89
|
+
boxStyle: string;
|
|
90
|
+
};
|
|
91
|
+
color?: undefined;
|
|
92
|
+
badge?: undefined;
|
|
93
|
+
};
|
|
94
|
+
defaultValue?: undefined;
|
|
95
|
+
})[];
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export { Video360Screen, _default as default };
|
package/es/index.js
CHANGED
|
@@ -4,9 +4,7 @@ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
5
|
import { getSizeWithinBounds } from '@folklore/size';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
7
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
9
|
-
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
10
8
|
import { ScreenElement, PlaceholderVideo360 } from '@micromag/core/components';
|
|
11
9
|
import { useViewerInteraction, useViewerNavigation, useViewerContext, useScreenSize, useScreenRenderContext, useViewerWebView, usePlaybackContext, useViewerContainer } from '@micromag/core/contexts';
|
|
12
10
|
import { useTrackScreenEvent, useTrackScreenMedia, useDevicePixelRatio, useActivityDetector, useDebounce, useAnimationFrame } from '@micromag/core/hooks';
|
|
@@ -70,46 +68,30 @@ var useThree = function useThree() {
|
|
|
70
68
|
return loadedPackage;
|
|
71
69
|
};
|
|
72
70
|
|
|
73
|
-
var styles = {"container":"
|
|
71
|
+
var styles = {"container":"container","background":"background","content":"content","empty":"empty","inner":"inner","canvas":"canvas","canvasButton":"canvasButton","video":"video","videoContainer":"videoContainer","placeholder":"placeholder","header":"header","bottom":"bottom","showVideo":"showVideo"};
|
|
74
72
|
|
|
75
|
-
|
|
76
|
-
layout: PropTypes.oneOf(['full']),
|
|
77
|
-
video: PropTypes$1.videoElement,
|
|
78
|
-
header: PropTypes$1.header,
|
|
79
|
-
footer: PropTypes$1.footer,
|
|
80
|
-
background: PropTypes$1.backgroundElement,
|
|
81
|
-
current: PropTypes.bool,
|
|
82
|
-
preload: PropTypes.bool,
|
|
83
|
-
type: PropTypes.string,
|
|
84
|
-
spacing: PropTypes.number,
|
|
85
|
-
mediaRef: PropTypes.func,
|
|
86
|
-
className: PropTypes.string
|
|
87
|
-
};
|
|
88
|
-
var defaultProps = {
|
|
89
|
-
layout: 'full',
|
|
90
|
-
video: null,
|
|
91
|
-
header: null,
|
|
92
|
-
footer: null,
|
|
93
|
-
background: null,
|
|
94
|
-
current: true,
|
|
95
|
-
preload: true,
|
|
96
|
-
type: null,
|
|
97
|
-
spacing: 20,
|
|
98
|
-
mediaRef: null,
|
|
99
|
-
className: null
|
|
100
|
-
};
|
|
101
|
-
var Video360Screen = function Video360Screen(_ref) {
|
|
73
|
+
function Video360Screen(_ref) {
|
|
102
74
|
_ref.layout;
|
|
103
|
-
var video = _ref.video,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
75
|
+
var _ref$video = _ref.video,
|
|
76
|
+
video = _ref$video === void 0 ? null : _ref$video,
|
|
77
|
+
_ref$header = _ref.header,
|
|
78
|
+
header = _ref$header === void 0 ? null : _ref$header,
|
|
79
|
+
_ref$footer = _ref.footer,
|
|
80
|
+
footer = _ref$footer === void 0 ? null : _ref$footer,
|
|
81
|
+
_ref$background = _ref.background,
|
|
82
|
+
background = _ref$background === void 0 ? null : _ref$background,
|
|
83
|
+
_ref$current = _ref.current,
|
|
84
|
+
current = _ref$current === void 0 ? true : _ref$current,
|
|
85
|
+
_ref$preload = _ref.preload,
|
|
86
|
+
preload = _ref$preload === void 0 ? true : _ref$preload,
|
|
87
|
+
_ref$type = _ref.type,
|
|
88
|
+
type = _ref$type === void 0 ? null : _ref$type,
|
|
89
|
+
_ref$spacing = _ref.spacing,
|
|
90
|
+
spacing = _ref$spacing === void 0 ? 20 : _ref$spacing,
|
|
91
|
+
_ref$mediaRef = _ref.mediaRef,
|
|
92
|
+
customMediaRef = _ref$mediaRef === void 0 ? null : _ref$mediaRef,
|
|
93
|
+
_ref$className = _ref.className,
|
|
94
|
+
className = _ref$className === void 0 ? null : _ref$className;
|
|
113
95
|
var THREE = useThree();
|
|
114
96
|
var trackScreenEvent = useTrackScreenEvent(type);
|
|
115
97
|
var trackScreenMedia = useTrackScreenMedia('video_360');
|
|
@@ -644,9 +626,7 @@ var Video360Screen = function Video360Screen(_ref) {
|
|
|
644
626
|
withoutVideo: isPreview,
|
|
645
627
|
className: styles.background
|
|
646
628
|
}) : null);
|
|
647
|
-
}
|
|
648
|
-
Video360Screen.propTypes = propTypes;
|
|
649
|
-
Video360Screen.defaultProps = defaultProps;
|
|
629
|
+
}
|
|
650
630
|
|
|
651
631
|
// import * as transforms from './transforms/index';
|
|
652
632
|
|
package/es/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.container{height:100%;overflow:hidden;position:relative;width:100%}.container .background{height:100%;left:0;position:absolute;top:0;width:100%;z-index:0}.container .content{z-index:1}.container .empty{border:2px dashed var(--mm-gray-800);color:var(--mm-gray-800);height:100%;margin:0}.container .canvas,.container .canvasButton,.container .inner,.container .video{height:100%;left:0;position:absolute;top:0;width:100%}.container .canvasButton{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:inherit;cursor:pointer;display:inline-block;font-family:inherit;padding:0;position:relative;-ms-touch-action:none;touch-action:none}.container .videoContainer{position:absolute}.container .video{visibility:hidden}.container .video video{height:100%}.container .mediaControls{padding:10px 20px 20px}.container .placeholder{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;left:0;position:absolute;top:0;width:100%;-ms-flex-pack:center;justify-content:center}.container .header{top:0;z-index:1}.container .bottom,.container .header{left:0;position:absolute;-webkit-transition:padding .2s ease-out,-webkit-transform .2s ease-out;transition:padding .2s ease-out,-webkit-transform .2s ease-out;transition:transform .2s ease-out,padding .2s ease-out;transition:transform .2s ease-out,padding .2s ease-out,-webkit-transform .2s ease-out;width:100%}.container .bottom{bottom:0}.container .bottom>*{margin-bottom:10px}.container .bottom>:last-child{margin-bottom:0}.container.showVideo .video{visibility:visible}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-video-360",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"style": "assets/css/styles.css",
|
|
36
36
|
"exports": {
|
|
37
37
|
".": {
|
|
38
|
+
"types": "./es/index.d.ts",
|
|
38
39
|
"import": "./es/index.js"
|
|
39
40
|
},
|
|
40
41
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
@@ -48,32 +49,31 @@
|
|
|
48
49
|
"scripts": {
|
|
49
50
|
"clean": "rm -rf es && rm -rf lib && rm -rf assets",
|
|
50
51
|
"prepublishOnly": "npm run build",
|
|
51
|
-
"build": "../../scripts/prepare-package.sh"
|
|
52
|
+
"build": "../../scripts/prepare-package.sh --types"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
|
54
|
-
"react": "^
|
|
55
|
-
"react-dom": "^
|
|
55
|
+
"react": "^19.2.0",
|
|
56
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
|
-
"react": "^
|
|
59
|
-
"react-dom": "^
|
|
59
|
+
"react": "^19.2.0",
|
|
60
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
60
61
|
},
|
|
61
62
|
"dependencies": {
|
|
62
63
|
"@babel/runtime": "^7.13.10",
|
|
63
64
|
"@folklore/size": "^0.1.20",
|
|
64
|
-
"@micromag/core": "^0.
|
|
65
|
-
"@micromag/element-background": "^0.
|
|
66
|
-
"@micromag/element-closed-captions": "^0.
|
|
67
|
-
"@micromag/element-container": "^0.
|
|
68
|
-
"@micromag/element-footer": "^0.
|
|
69
|
-
"@micromag/element-header": "^0.
|
|
70
|
-
"@micromag/element-image": "^0.
|
|
71
|
-
"@micromag/element-video": "^0.
|
|
72
|
-
"@micromag/transforms": "^0.
|
|
65
|
+
"@micromag/core": "^0.4.4",
|
|
66
|
+
"@micromag/element-background": "^0.4.4",
|
|
67
|
+
"@micromag/element-closed-captions": "^0.4.4",
|
|
68
|
+
"@micromag/element-container": "^0.4.4",
|
|
69
|
+
"@micromag/element-footer": "^0.4.4",
|
|
70
|
+
"@micromag/element-header": "^0.4.4",
|
|
71
|
+
"@micromag/element-image": "^0.4.4",
|
|
72
|
+
"@micromag/element-video": "^0.4.4",
|
|
73
|
+
"@micromag/transforms": "^0.4.4",
|
|
73
74
|
"classnames": "^2.2.6",
|
|
74
|
-
"lodash": "^4.17.
|
|
75
|
-
"
|
|
76
|
-
"react-intl": "^6.6.4",
|
|
75
|
+
"lodash": "^4.17.23",
|
|
76
|
+
"react-intl": "^8.1.3",
|
|
77
77
|
"three": "^0.163.0",
|
|
78
78
|
"uuid": "^9.0.0"
|
|
79
79
|
},
|
|
@@ -81,5 +81,6 @@
|
|
|
81
81
|
"access": "public",
|
|
82
82
|
"registry": "https://registry.npmjs.org/"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "04b8519c3a3ddace5a21497e22faa11865d57f6d",
|
|
85
|
+
"types": "es/index.d.ts"
|
|
85
86
|
}
|