@micromag/screen-ranking 0.3.829 → 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 +175 -0
- package/es/index.js +33 -56
- package/es/styles.css +1 -0
- package/package.json +22 -21
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.container{position:relative}.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:50px;margin:5px 10px 5px auto}.container .emptyTitle{height:100px;min-width:100%;width:100%}.container .item{padding:10px 0;position:relative}.container .item:first-child{padding-top:0}.container .rankText{font-size:48px}.container .description,.container .itemTitle{padding:8px 0}.container .callToAction{bottom:0;left:0;position:absolute;-webkit-transition:opacity .2s ease-out;transition:opacity .2s ease-out;width:100%}.container .callToAction a{padding:0}.container .callToAction.disabled{opacity:0;pointer-events:none}.container.sideLayout .elementsContainer{display:table;width:100%}.container.sideLayout .item{display:table-row;padding:0}.container.sideLayout .label,.container.sideLayout .rank{display:table-cell;padding:10px 0;vertical-align:top}.container.sideLayout .rank{padding-right:20px}.container.isPlaceholder .rank{color:hsla(0,0%,100%,.6);font-size:16px;mix-blend-mode:difference;text-align:left}.container.isPlaceholder .scroll{padding:5px}.container.isPlaceholder .description,.container.isPlaceholder .itemTitle{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;padding:0}.container.isPlaceholder .item{padding:1px 0}.container.isPlaceholder.sideLayout .rank{padding-right:4px;padding-top:8px;width:24px}.container.isPlaceholder.sideLayout .label{padding:5px 0}
|
package/es/index.d.ts
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { HeadingElement, TextElement, TextStyle, BackgroundElement, Header, Footer } from '@micromag/core';
|
|
3
|
+
|
|
4
|
+
interface RankingScreenProps {
|
|
5
|
+
layout?: 'side' | 'over';
|
|
6
|
+
title?: HeadingElement | null;
|
|
7
|
+
items?: TextElement[];
|
|
8
|
+
itemTitleStyle?: TextStyle | null;
|
|
9
|
+
itemDescriptionStyle?: TextStyle | null;
|
|
10
|
+
numbersStyle?: TextStyle | null;
|
|
11
|
+
ascending?: boolean;
|
|
12
|
+
spacing?: number;
|
|
13
|
+
background?: BackgroundElement | null;
|
|
14
|
+
header?: Header | null;
|
|
15
|
+
footer?: Footer | null;
|
|
16
|
+
current?: boolean;
|
|
17
|
+
preload?: boolean;
|
|
18
|
+
type?: string | null;
|
|
19
|
+
className?: string | null;
|
|
20
|
+
}
|
|
21
|
+
declare function RankingScreen({ layout, title, items, itemTitleStyle, itemDescriptionStyle, numbersStyle, ascending, spacing, background, header, footer, current, preload, type, className, }: RankingScreenProps): react_jsx_runtime.JSX.Element;
|
|
22
|
+
|
|
23
|
+
declare const _default: {
|
|
24
|
+
id: string;
|
|
25
|
+
type: string;
|
|
26
|
+
group: {
|
|
27
|
+
label: {
|
|
28
|
+
defaultMessage: string;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
order: number;
|
|
32
|
+
};
|
|
33
|
+
title: {
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
component: typeof RankingScreen;
|
|
38
|
+
layouts: string[];
|
|
39
|
+
fields: ({
|
|
40
|
+
name: string;
|
|
41
|
+
type: string;
|
|
42
|
+
defaultValue: string;
|
|
43
|
+
label: {
|
|
44
|
+
defaultMessage: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
theme?: undefined;
|
|
48
|
+
isList?: undefined;
|
|
49
|
+
fields?: undefined;
|
|
50
|
+
} | {
|
|
51
|
+
name: string;
|
|
52
|
+
type: string;
|
|
53
|
+
theme: {
|
|
54
|
+
textStyle: string;
|
|
55
|
+
title?: undefined;
|
|
56
|
+
description?: undefined;
|
|
57
|
+
badge?: undefined;
|
|
58
|
+
callToAction?: undefined;
|
|
59
|
+
};
|
|
60
|
+
label: {
|
|
61
|
+
defaultMessage: string;
|
|
62
|
+
description: string;
|
|
63
|
+
};
|
|
64
|
+
defaultValue?: undefined;
|
|
65
|
+
isList?: undefined;
|
|
66
|
+
fields?: undefined;
|
|
67
|
+
} | {
|
|
68
|
+
name: string;
|
|
69
|
+
type: string;
|
|
70
|
+
theme: {
|
|
71
|
+
title: {
|
|
72
|
+
textStyle: string;
|
|
73
|
+
};
|
|
74
|
+
description: {
|
|
75
|
+
textStyle: string;
|
|
76
|
+
};
|
|
77
|
+
textStyle?: undefined;
|
|
78
|
+
badge?: undefined;
|
|
79
|
+
callToAction?: undefined;
|
|
80
|
+
};
|
|
81
|
+
label: {
|
|
82
|
+
defaultMessage: string;
|
|
83
|
+
description: string;
|
|
84
|
+
};
|
|
85
|
+
defaultValue?: undefined;
|
|
86
|
+
isList?: undefined;
|
|
87
|
+
fields?: undefined;
|
|
88
|
+
} | {
|
|
89
|
+
type: string;
|
|
90
|
+
label: {
|
|
91
|
+
defaultMessage: string;
|
|
92
|
+
description: string;
|
|
93
|
+
};
|
|
94
|
+
isList: boolean;
|
|
95
|
+
fields: ({
|
|
96
|
+
name: string;
|
|
97
|
+
type: string;
|
|
98
|
+
label: {
|
|
99
|
+
defaultMessage: string;
|
|
100
|
+
description: string;
|
|
101
|
+
};
|
|
102
|
+
theme?: undefined;
|
|
103
|
+
} | {
|
|
104
|
+
name: string;
|
|
105
|
+
type: string;
|
|
106
|
+
theme: {
|
|
107
|
+
textStyle: string;
|
|
108
|
+
};
|
|
109
|
+
label: {
|
|
110
|
+
defaultMessage: string;
|
|
111
|
+
description: string;
|
|
112
|
+
};
|
|
113
|
+
})[];
|
|
114
|
+
name?: undefined;
|
|
115
|
+
defaultValue?: undefined;
|
|
116
|
+
theme?: undefined;
|
|
117
|
+
} | {
|
|
118
|
+
name: string;
|
|
119
|
+
type: string;
|
|
120
|
+
label: {
|
|
121
|
+
defaultMessage: string;
|
|
122
|
+
description: string;
|
|
123
|
+
};
|
|
124
|
+
defaultValue?: undefined;
|
|
125
|
+
theme?: undefined;
|
|
126
|
+
isList?: undefined;
|
|
127
|
+
fields?: undefined;
|
|
128
|
+
} | {
|
|
129
|
+
name: string;
|
|
130
|
+
type: string;
|
|
131
|
+
label: {
|
|
132
|
+
defaultMessage: string;
|
|
133
|
+
description: string;
|
|
134
|
+
};
|
|
135
|
+
theme: {
|
|
136
|
+
badge: {
|
|
137
|
+
label: {
|
|
138
|
+
textStyle: string;
|
|
139
|
+
};
|
|
140
|
+
boxStyle: string;
|
|
141
|
+
};
|
|
142
|
+
textStyle?: undefined;
|
|
143
|
+
title?: undefined;
|
|
144
|
+
description?: undefined;
|
|
145
|
+
callToAction?: undefined;
|
|
146
|
+
};
|
|
147
|
+
defaultValue?: undefined;
|
|
148
|
+
isList?: undefined;
|
|
149
|
+
fields?: undefined;
|
|
150
|
+
} | {
|
|
151
|
+
name: string;
|
|
152
|
+
type: string;
|
|
153
|
+
label: {
|
|
154
|
+
defaultMessage: string;
|
|
155
|
+
description: string;
|
|
156
|
+
};
|
|
157
|
+
theme: {
|
|
158
|
+
callToAction: {
|
|
159
|
+
label: {
|
|
160
|
+
textStyle: string;
|
|
161
|
+
};
|
|
162
|
+
boxStyle: string;
|
|
163
|
+
};
|
|
164
|
+
textStyle?: undefined;
|
|
165
|
+
title?: undefined;
|
|
166
|
+
description?: undefined;
|
|
167
|
+
badge?: undefined;
|
|
168
|
+
};
|
|
169
|
+
defaultValue?: undefined;
|
|
170
|
+
isList?: undefined;
|
|
171
|
+
fields?: undefined;
|
|
172
|
+
})[];
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export { RankingScreen, _default as default };
|
package/es/index.js
CHANGED
|
@@ -4,9 +4,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
4
4
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
5
5
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
7
|
import React, { useState, useCallback } from 'react';
|
|
9
|
-
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
10
8
|
import { ScreenElement } from '@micromag/core/components';
|
|
11
9
|
import { useScreenSize, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef, useScreenRenderContext } from '@micromag/core/contexts';
|
|
12
10
|
import { useTrackScreenEvent, useDimensionObserver } from '@micromag/core/hooks';
|
|
@@ -20,58 +18,39 @@ import Layout from '@micromag/element-layout';
|
|
|
20
18
|
import Scroll from '@micromag/element-scroll';
|
|
21
19
|
import Text from '@micromag/element-text';
|
|
22
20
|
|
|
23
|
-
var styles = {"container":"
|
|
21
|
+
var styles = {"container":"container","background":"background","content":"content","empty":"empty","emptyTitle":"emptyTitle","item":"item","rankText":"rankText","itemTitle":"itemTitle","description":"description","callToAction":"callToAction","disabled":"disabled","sideLayout":"sideLayout","elementsContainer":"elementsContainer","rank":"rank","label":"label","isPlaceholder":"isPlaceholder","scroll":"scroll"};
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
layout
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
type: null,
|
|
57
|
-
className: null
|
|
58
|
-
};
|
|
59
|
-
var RankingScreen = function RankingScreen(_ref) {
|
|
60
|
-
var layout = _ref.layout,
|
|
61
|
-
title = _ref.title,
|
|
62
|
-
items = _ref.items,
|
|
63
|
-
itemTitleStyle = _ref.itemTitleStyle,
|
|
64
|
-
itemDescriptionStyle = _ref.itemDescriptionStyle,
|
|
65
|
-
numbersStyle = _ref.numbersStyle,
|
|
66
|
-
ascending = _ref.ascending,
|
|
67
|
-
spacing = _ref.spacing,
|
|
68
|
-
background = _ref.background,
|
|
69
|
-
header = _ref.header,
|
|
70
|
-
footer = _ref.footer,
|
|
71
|
-
current = _ref.current,
|
|
72
|
-
preload = _ref.preload,
|
|
73
|
-
type = _ref.type,
|
|
74
|
-
className = _ref.className;
|
|
23
|
+
function RankingScreen(_ref) {
|
|
24
|
+
var _ref$layout = _ref.layout,
|
|
25
|
+
layout = _ref$layout === void 0 ? 'side' : _ref$layout,
|
|
26
|
+
_ref$title = _ref.title,
|
|
27
|
+
title = _ref$title === void 0 ? null : _ref$title,
|
|
28
|
+
_ref$items = _ref.items,
|
|
29
|
+
items = _ref$items === void 0 ? [null] : _ref$items,
|
|
30
|
+
_ref$itemTitleStyle = _ref.itemTitleStyle,
|
|
31
|
+
itemTitleStyle = _ref$itemTitleStyle === void 0 ? null : _ref$itemTitleStyle,
|
|
32
|
+
_ref$itemDescriptionS = _ref.itemDescriptionStyle,
|
|
33
|
+
itemDescriptionStyle = _ref$itemDescriptionS === void 0 ? null : _ref$itemDescriptionS,
|
|
34
|
+
_ref$numbersStyle = _ref.numbersStyle,
|
|
35
|
+
numbersStyle = _ref$numbersStyle === void 0 ? null : _ref$numbersStyle,
|
|
36
|
+
_ref$ascending = _ref.ascending,
|
|
37
|
+
ascending = _ref$ascending === void 0 ? false : _ref$ascending,
|
|
38
|
+
_ref$spacing = _ref.spacing,
|
|
39
|
+
spacing = _ref$spacing === void 0 ? 20 : _ref$spacing,
|
|
40
|
+
_ref$background = _ref.background,
|
|
41
|
+
background = _ref$background === void 0 ? null : _ref$background,
|
|
42
|
+
_ref$header = _ref.header,
|
|
43
|
+
header = _ref$header === void 0 ? null : _ref$header,
|
|
44
|
+
_ref$footer = _ref.footer,
|
|
45
|
+
footer = _ref$footer === void 0 ? null : _ref$footer,
|
|
46
|
+
_ref$current = _ref.current,
|
|
47
|
+
current = _ref$current === void 0 ? true : _ref$current,
|
|
48
|
+
_ref$preload = _ref.preload,
|
|
49
|
+
preload = _ref$preload === void 0 ? true : _ref$preload,
|
|
50
|
+
_ref$type = _ref.type,
|
|
51
|
+
type = _ref$type === void 0 ? null : _ref$type,
|
|
52
|
+
_ref$className = _ref.className,
|
|
53
|
+
className = _ref$className === void 0 ? null : _ref$className;
|
|
75
54
|
var trackScreenEvent = useTrackScreenEvent(type);
|
|
76
55
|
var _useScreenSize = useScreenSize(),
|
|
77
56
|
width = _useScreenSize.width,
|
|
@@ -269,9 +248,7 @@ var RankingScreen = function RankingScreen(_ref) {
|
|
|
269
248
|
withoutVideo: isPreview,
|
|
270
249
|
className: styles.background
|
|
271
250
|
}) : null);
|
|
272
|
-
}
|
|
273
|
-
RankingScreen.propTypes = propTypes;
|
|
274
|
-
RankingScreen.defaultProps = defaultProps;
|
|
251
|
+
}
|
|
275
252
|
|
|
276
253
|
// import * as transforms from './transforms/index';
|
|
277
254
|
|
package/es/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.container{position:relative}.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:50px;margin:5px 10px 5px auto}.container .emptyTitle{height:100px;min-width:100%;width:100%}.container .item{padding:10px 0;position:relative}.container .item:first-child{padding-top:0}.container .rankText{font-size:48px}.container .description,.container .itemTitle{padding:8px 0}.container .callToAction{bottom:0;left:0;position:absolute;-webkit-transition:opacity .2s ease-out;transition:opacity .2s ease-out;width:100%}.container .callToAction a{padding:0}.container .callToAction.disabled{opacity:0;pointer-events:none}.container.sideLayout .elementsContainer{display:table;width:100%}.container.sideLayout .item{display:table-row;padding:0}.container.sideLayout .label,.container.sideLayout .rank{display:table-cell;padding:10px 0;vertical-align:top}.container.sideLayout .rank{padding-right:20px}.container.isPlaceholder .rank{color:hsla(0,0%,100%,.6);font-size:16px;mix-blend-mode:difference;text-align:left}.container.isPlaceholder .scroll{padding:5px}.container.isPlaceholder .description,.container.isPlaceholder .itemTitle{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;padding:0}.container.isPlaceholder .item{padding:1px 0}.container.isPlaceholder.sideLayout .rank{padding-right:4px;padding-top:8px;width:24px}.container.isPlaceholder.sideLayout .label{padding:5px 0}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-ranking",
|
|
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,38 +49,38 @@
|
|
|
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
|
-
"@micromag/core": "^0.
|
|
64
|
-
"@micromag/data": "^0.
|
|
65
|
-
"@micromag/element-background": "^0.
|
|
66
|
-
"@micromag/element-container": "^0.
|
|
67
|
-
"@micromag/element-footer": "^0.
|
|
68
|
-
"@micromag/element-header": "^0.
|
|
69
|
-
"@micromag/element-heading": "^0.
|
|
70
|
-
"@micromag/element-layout": "^0.
|
|
71
|
-
"@micromag/element-scroll": "^0.
|
|
72
|
-
"@micromag/element-text": "^0.
|
|
73
|
-
"@micromag/transforms": "^0.
|
|
64
|
+
"@micromag/core": "^0.4.4",
|
|
65
|
+
"@micromag/data": "^0.4.4",
|
|
66
|
+
"@micromag/element-background": "^0.4.4",
|
|
67
|
+
"@micromag/element-container": "^0.4.4",
|
|
68
|
+
"@micromag/element-footer": "^0.4.4",
|
|
69
|
+
"@micromag/element-header": "^0.4.4",
|
|
70
|
+
"@micromag/element-heading": "^0.4.4",
|
|
71
|
+
"@micromag/element-layout": "^0.4.4",
|
|
72
|
+
"@micromag/element-scroll": "^0.4.4",
|
|
73
|
+
"@micromag/element-text": "^0.4.4",
|
|
74
|
+
"@micromag/transforms": "^0.4.4",
|
|
74
75
|
"classnames": "^2.2.6",
|
|
75
|
-
"lodash": "^4.17.
|
|
76
|
-
"
|
|
77
|
-
"react-intl": "^6.6.4",
|
|
76
|
+
"lodash": "^4.17.23",
|
|
77
|
+
"react-intl": "^8.1.3",
|
|
78
78
|
"uuid": "^9.0.0"
|
|
79
79
|
},
|
|
80
80
|
"publishConfig": {
|
|
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
|
}
|