@micromag/screen-gallery 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.
@@ -1 +1 @@
1
- .micromag-screen-gallery-container .micromag-screen-gallery-background,.micromag-screen-gallery-container .micromag-screen-gallery-image,.micromag-screen-gallery-container .micromag-screen-gallery-inner{height:100%;left:0;position:absolute;top:0;width:100%}.micromag-screen-gallery-container{height:100%;overflow:hidden;position:relative;width:100%}.micromag-screen-gallery-disabled.micromag-screen-gallery-container{overflow:hidden;pointer-events:none}.micromag-screen-gallery-hidden.micromag-screen-gallery-container{display:none;visibility:hidden}.micromag-screen-gallery-placeholder.micromag-screen-gallery-container .micromag-screen-gallery-content{padding:6px;position:relative}.micromag-screen-gallery-container .micromag-screen-gallery-emptyCaption,.micromag-screen-gallery-container .micromag-screen-gallery-emptyImage{border:2px dashed #343434;color:#343434;margin:5px auto}.micromag-screen-gallery-container .micromag-screen-gallery-background{z-index:0}.micromag-screen-gallery-container .micromag-screen-gallery-content{z-index:1}.micromag-screen-gallery-container .micromag-screen-gallery-inner{-webkit-transition:padding-bottom .2s ease-out;transition:padding-bottom .2s ease-out}.micromag-screen-gallery-container .micromag-screen-gallery-grid{height:100%;position:relative}.micromag-screen-gallery-container .micromag-screen-gallery-placeholder{height:100%}.micromag-screen-gallery-container .micromag-screen-gallery-emptyCaption,.micromag-screen-gallery-container .micromag-screen-gallery-emptyImage{width:100%}.micromag-screen-gallery-container .micromag-screen-gallery-emptyImage{height:100%}.micromag-screen-gallery-container .micromag-screen-gallery-emptyCaption{height:50px;margin-top:10px}.micromag-screen-gallery-container .micromag-screen-gallery-gridItem{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;position:relative}.micromag-screen-gallery-container .micromag-screen-gallery-imageContainer{position:relative;-ms-flex-positive:1;flex-grow:1;overflow:hidden}.micromag-screen-gallery-container .micromag-screen-gallery-header{top:0}.micromag-screen-gallery-container .micromag-screen-gallery-footer,.micromag-screen-gallery-container .micromag-screen-gallery-header{left:0;position:absolute;-webkit-transition:-webkit-transform .2s ease-out;transition:-webkit-transform .2s ease-out;transition:transform .2s ease-out;transition:transform .2s ease-out,-webkit-transform .2s ease-out;width:100%}.micromag-screen-gallery-container .micromag-screen-gallery-footer{bottom:0}.micromag-screen-gallery-container .micromag-screen-gallery-caption{padding:10px 0;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
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 .inner{height:100%;left:0;position:absolute;top:0;-webkit-transition:padding-bottom .2s ease-out;transition:padding-bottom .2s ease-out;width:100%}.container .grid{height:100%;position:relative}.container .placeholder{height:100%}.container .emptyCaption,.container .emptyImage{border:2px dashed var(--mm-gray-800);color:var(--mm-gray-800);margin:5px auto;width:100%}.container .emptyImage{height:100%}.container .emptyCaption{height:50px;margin-top:10px}.container .gridItem{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;position:relative}.container .imageContainer{overflow:hidden;position:relative;-ms-flex-positive:1;flex-grow:1}.container .header{top:0}.container .footer,.container .header{left:0;position:absolute;-webkit-transition:-webkit-transform .2s ease-out;transition:-webkit-transform .2s ease-out;transition:transform .2s ease-out;transition:transform .2s ease-out,-webkit-transform .2s ease-out;width:100%}.container .footer{bottom:0}.container .image{height:100%;left:0;position:absolute;top:0;width:100%}.container .caption{padding:10px 0;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
package/es/index.d.ts ADDED
@@ -0,0 +1,182 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ImageMedia, ImageElement, TextStyle, BackgroundElement, Header, Footer } from '@micromag/core';
3
+
4
+ interface GalleryScreenProps {
5
+ layout?: 'two-vertical-equal' | 'two-vertical-top' | 'two-vertical-bottom' | 'three-vertical' | 'one-two' | 'two-one' | 'two-by-two' | 'four-vertical' | 'one-two-one' | 'four-mosaic' | 'two-one-two' | 'one-two-two' | 'two-two-one' | 'two-by-three' | 'one-one-two-two' | 'two-two-one-one';
6
+ images?: ImageMedia[] | ImageElement[];
7
+ withCaptions?: boolean;
8
+ imageCaptionStyle?: TextStyle | null;
9
+ spacing?: number;
10
+ captionMaxLines?: number;
11
+ background?: BackgroundElement | null;
12
+ header?: Header | null;
13
+ footer?: Footer | null;
14
+ current?: boolean;
15
+ active?: boolean;
16
+ preload?: boolean;
17
+ className?: string | null;
18
+ }
19
+ declare function GalleryScreen({ layout, images, withCaptions, imageCaptionStyle, background, header, footer, current, active, preload, spacing: initialSpacing, captionMaxLines, className, }: GalleryScreenProps): react_jsx_runtime.JSX.Element;
20
+
21
+ declare function GalleryCaptionsScreen({ ...props }: {
22
+ [x: string]: any;
23
+ }): react_jsx_runtime.JSX.Element;
24
+
25
+ declare const _default: ({
26
+ id: string;
27
+ type: string;
28
+ group: {
29
+ label: {
30
+ defaultMessage: string;
31
+ description: string;
32
+ };
33
+ order: number;
34
+ };
35
+ title: {
36
+ defaultMessage: string;
37
+ description: string;
38
+ };
39
+ component: typeof GalleryScreen;
40
+ layouts: string[];
41
+ fields: ({
42
+ name: string;
43
+ type: string;
44
+ defaultValue: string;
45
+ label: {
46
+ defaultMessage: string;
47
+ description: string;
48
+ };
49
+ theme?: undefined;
50
+ } | {
51
+ name: string;
52
+ type: string;
53
+ label: {
54
+ defaultMessage: string;
55
+ description: string;
56
+ };
57
+ defaultValue?: undefined;
58
+ theme?: 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
+ callToAction?: undefined;
74
+ };
75
+ defaultValue?: undefined;
76
+ } | {
77
+ name: string;
78
+ type: string;
79
+ label: {
80
+ defaultMessage: string;
81
+ description: string;
82
+ };
83
+ theme: {
84
+ callToAction: {
85
+ label: {
86
+ textStyle: string;
87
+ };
88
+ boxStyle: string;
89
+ };
90
+ badge?: undefined;
91
+ };
92
+ defaultValue?: undefined;
93
+ })[];
94
+ } | {
95
+ id: string;
96
+ type: string;
97
+ group: {
98
+ label: {
99
+ defaultMessage: string;
100
+ description: string;
101
+ };
102
+ order: number;
103
+ };
104
+ title: {
105
+ defaultMessage: string;
106
+ description: string;
107
+ };
108
+ component: typeof GalleryCaptionsScreen;
109
+ layouts: string[];
110
+ fields: ({
111
+ name: string;
112
+ type: string;
113
+ defaultValue: string;
114
+ label: {
115
+ defaultMessage: string;
116
+ description: string;
117
+ };
118
+ theme?: undefined;
119
+ } | {
120
+ name: string;
121
+ type: string;
122
+ theme: {
123
+ caption: {
124
+ textStyle: string;
125
+ };
126
+ badge?: undefined;
127
+ callToAction?: undefined;
128
+ };
129
+ label: {
130
+ defaultMessage: string;
131
+ description: string;
132
+ };
133
+ defaultValue?: undefined;
134
+ } | {
135
+ name: string;
136
+ type: string;
137
+ label: {
138
+ defaultMessage: string;
139
+ description: string;
140
+ };
141
+ defaultValue?: undefined;
142
+ theme?: undefined;
143
+ } | {
144
+ name: string;
145
+ type: string;
146
+ label: {
147
+ defaultMessage: string;
148
+ description: string;
149
+ };
150
+ theme: {
151
+ badge: {
152
+ label: {
153
+ textStyle: string;
154
+ };
155
+ boxStyle: string;
156
+ };
157
+ caption?: undefined;
158
+ callToAction?: undefined;
159
+ };
160
+ defaultValue?: undefined;
161
+ } | {
162
+ name: string;
163
+ type: string;
164
+ label: {
165
+ defaultMessage: string;
166
+ description: string;
167
+ };
168
+ theme: {
169
+ callToAction: {
170
+ label: {
171
+ textStyle: string;
172
+ };
173
+ boxStyle: string;
174
+ };
175
+ caption?: undefined;
176
+ badge?: undefined;
177
+ };
178
+ defaultValue?: undefined;
179
+ })[];
180
+ })[];
181
+
182
+ export { GalleryCaptionsScreen, GalleryScreen, _default as default };
package/es/index.js CHANGED
@@ -5,9 +5,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
5
5
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
6
6
  import classNames from 'classnames';
7
7
  import isPlainObject from 'lodash/isPlainObject';
8
- import PropTypes from 'prop-types';
9
8
  import React, { useState, useCallback, useRef, useEffect } from 'react';
10
- import { PropTypes as PropTypes$1 } from '@micromag/core';
11
9
  import { ScreenElement } from '@micromag/core/components';
12
10
  import { useScreenSize, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef, useScreenRenderContext } from '@micromag/core/contexts';
13
11
  import { useDimensionObserver } from '@micromag/core/hooks';
@@ -192,62 +190,35 @@ var layoutProps = {
192
190
  }
193
191
  };
194
192
 
195
- var styles = {"container":"micromag-screen-gallery-container","image":"micromag-screen-gallery-image","inner":"micromag-screen-gallery-inner","background":"micromag-screen-gallery-background","placeholder":"micromag-screen-gallery-placeholder","content":"micromag-screen-gallery-content","emptyImage":"micromag-screen-gallery-emptyImage","emptyCaption":"micromag-screen-gallery-emptyCaption","grid":"micromag-screen-gallery-grid","gridItem":"micromag-screen-gallery-gridItem","imageContainer":"micromag-screen-gallery-imageContainer","header":"micromag-screen-gallery-header","footer":"micromag-screen-gallery-footer","caption":"micromag-screen-gallery-caption"};
193
+ var styles = {"container":"container","background":"background","content":"content","inner":"inner","grid":"grid","placeholder":"placeholder","emptyImage":"emptyImage","emptyCaption":"emptyCaption","gridItem":"gridItem","imageContainer":"imageContainer","header":"header","footer":"footer","image":"image","caption":"caption"};
196
194
 
197
- var propTypes = {
198
- layout: PropTypes.oneOf([
199
- // 2
200
- 'two-vertical-equal', 'two-vertical-top', 'two-vertical-bottom',
201
- // 3
202
- 'three-vertical', 'one-two', 'two-one',
203
- // 4
204
- 'two-by-two', 'four-vertical', 'one-two-one', 'four-mosaic',
205
- // 5
206
- 'two-one-two', 'one-two-two', 'two-two-one',
207
- // 6
208
- 'two-by-three', 'one-one-two-two', 'two-two-one-one']),
209
- images: PropTypes.oneOfType([PropTypes$1.imageMedias, PropTypes$1.imageElements]),
210
- withCaptions: PropTypes.bool,
211
- imageCaptionStyle: PropTypes$1.textStyle,
212
- spacing: PropTypes.number,
213
- captionMaxLines: PropTypes.number,
214
- background: PropTypes$1.backgroundElement,
215
- header: PropTypes$1.header,
216
- footer: PropTypes$1.footer,
217
- current: PropTypes.bool,
218
- active: PropTypes.bool,
219
- preload: PropTypes.bool,
220
- className: PropTypes.string
221
- };
222
- var defaultProps = {
223
- layout: 'four-mosaic',
224
- withCaptions: false,
225
- imageCaptionStyle: null,
226
- images: [],
227
- spacing: 20,
228
- captionMaxLines: 2,
229
- background: null,
230
- header: null,
231
- footer: null,
232
- current: true,
233
- active: true,
234
- preload: true,
235
- className: null
236
- };
237
- var GalleryScreen = function GalleryScreen(_ref) {
238
- var layout = _ref.layout,
239
- images = _ref.images,
240
- withCaptions = _ref.withCaptions,
241
- imageCaptionStyle = _ref.imageCaptionStyle,
242
- background = _ref.background,
243
- header = _ref.header,
244
- footer = _ref.footer,
245
- current = _ref.current,
246
- active = _ref.active,
247
- preload = _ref.preload,
248
- initialSpacing = _ref.spacing,
249
- captionMaxLines = _ref.captionMaxLines,
250
- className = _ref.className;
195
+ function GalleryScreen(_ref) {
196
+ var _ref$layout = _ref.layout,
197
+ layout = _ref$layout === void 0 ? 'four-mosaic' : _ref$layout,
198
+ _ref$images = _ref.images,
199
+ images = _ref$images === void 0 ? [] : _ref$images,
200
+ _ref$withCaptions = _ref.withCaptions,
201
+ withCaptions = _ref$withCaptions === void 0 ? false : _ref$withCaptions,
202
+ _ref$imageCaptionStyl = _ref.imageCaptionStyle,
203
+ imageCaptionStyle = _ref$imageCaptionStyl === void 0 ? null : _ref$imageCaptionStyl,
204
+ _ref$background = _ref.background,
205
+ background = _ref$background === void 0 ? null : _ref$background,
206
+ _ref$header = _ref.header,
207
+ header = _ref$header === void 0 ? null : _ref$header,
208
+ _ref$footer = _ref.footer,
209
+ footer = _ref$footer === void 0 ? null : _ref$footer,
210
+ _ref$current = _ref.current,
211
+ current = _ref$current === void 0 ? true : _ref$current,
212
+ _ref$active = _ref.active,
213
+ active = _ref$active === void 0 ? true : _ref$active,
214
+ _ref$preload = _ref.preload,
215
+ preload = _ref$preload === void 0 ? true : _ref$preload,
216
+ _ref$spacing = _ref.spacing,
217
+ initialSpacing = _ref$spacing === void 0 ? 20 : _ref$spacing,
218
+ _ref$captionMaxLines = _ref.captionMaxLines,
219
+ captionMaxLines = _ref$captionMaxLines === void 0 ? 2 : _ref$captionMaxLines,
220
+ _ref$className = _ref.className,
221
+ className = _ref$className === void 0 ? null : _ref$className;
251
222
  var _useScreenSize = useScreenSize(),
252
223
  width = _useScreenSize.width,
253
224
  height = _useScreenSize.height,
@@ -453,9 +424,7 @@ var GalleryScreen = function GalleryScreen(_ref) {
453
424
  withoutVideo: isPreview,
454
425
  className: styles.background
455
426
  }) : null);
456
- };
457
- GalleryScreen.propTypes = propTypes;
458
- GalleryScreen.defaultProps = defaultProps;
427
+ }
459
428
 
460
429
  function GalleryCaptionsScreen(_ref) {
461
430
  var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
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 .inner{height:100%;left:0;position:absolute;top:0;-webkit-transition:padding-bottom .2s ease-out;transition:padding-bottom .2s ease-out;width:100%}.container .grid{height:100%;position:relative}.container .placeholder{height:100%}.container .emptyCaption,.container .emptyImage{border:2px dashed var(--mm-gray-800);color:var(--mm-gray-800);margin:5px auto;width:100%}.container .emptyImage{height:100%}.container .emptyCaption{height:50px;margin-top:10px}.container .gridItem{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;position:relative}.container .imageContainer{overflow:hidden;position:relative;-ms-flex-positive:1;flex-grow:1}.container .header{top:0}.container .footer,.container .header{left:0;position:absolute;-webkit-transition:-webkit-transform .2s ease-out;transition:-webkit-transform .2s ease-out;transition:transform .2s ease-out;transition:transform .2s ease-out,-webkit-transform .2s ease-out;width:100%}.container .footer{bottom:0}.container .image{height:100%;left:0;position:absolute;top:0;width:100%}.container .caption{padding:10px 0;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-gallery",
3
- "version": "0.3.832",
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,37 +49,37 @@
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": "^16.8.0 || ^17.0.0 || ^18.0.0",
55
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
55
+ "react": "^19.2.0",
56
+ "react-dom": "^18.3.0 || ^19.0.0"
56
57
  },
57
58
  "peerDependencies": {
58
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
59
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
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
- "@micromag/core": "^0.3.832",
64
- "@micromag/element-background": "^0.3.832",
65
- "@micromag/element-container": "^0.3.832",
66
- "@micromag/element-footer": "^0.3.832",
67
- "@micromag/element-grid": "^0.3.832",
68
- "@micromag/element-header": "^0.3.832",
69
- "@micromag/element-layout": "^0.3.832",
70
- "@micromag/element-text": "^0.3.832",
71
- "@micromag/element-visual": "^0.3.832",
72
- "@micromag/transforms": "^0.3.832",
64
+ "@micromag/core": "^0.4.4",
65
+ "@micromag/element-background": "^0.4.4",
66
+ "@micromag/element-container": "^0.4.4",
67
+ "@micromag/element-footer": "^0.4.4",
68
+ "@micromag/element-grid": "^0.4.4",
69
+ "@micromag/element-header": "^0.4.4",
70
+ "@micromag/element-layout": "^0.4.4",
71
+ "@micromag/element-text": "^0.4.4",
72
+ "@micromag/element-visual": "^0.4.4",
73
+ "@micromag/transforms": "^0.4.4",
73
74
  "classnames": "^2.2.6",
74
- "lodash": "^4.17.21",
75
- "prop-types": "^15.7.2",
76
- "react-intl": "^6.6.4",
75
+ "lodash": "^4.17.23",
76
+ "react-intl": "^8.1.3",
77
77
  "uuid": "^9.0.0"
78
78
  },
79
79
  "publishConfig": {
80
80
  "access": "public",
81
81
  "registry": "https://registry.npmjs.org/"
82
82
  },
83
- "gitHead": "4969d64e304334cfd47321e624e5914e0694c55f"
83
+ "gitHead": "04b8519c3a3ddace5a21497e22faa11865d57f6d",
84
+ "types": "es/index.d.ts"
84
85
  }