@micromag/screen-article 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-article-container .micromag-screen-article-background{height:100%;left:0;position:absolute;top:0;width:100%}.micromag-screen-article-container .micromag-screen-article-emptyAuthor,.micromag-screen-article-container .micromag-screen-article-emptyDate,.micromag-screen-article-container .micromag-screen-article-emptySubtitle,.micromag-screen-article-container .micromag-screen-article-emptySurtitle,.micromag-screen-article-container .micromag-screen-article-emptyText,.micromag-screen-article-container .micromag-screen-article-emptyTitle{border:2px dashed #343434;color:#343434;margin:5px auto}.micromag-screen-article-container{position:relative}.micromag-screen-article-container .micromag-screen-article-background{z-index:0}.micromag-screen-article-container .micromag-screen-article-content{z-index:1}.micromag-screen-article-container .micromag-screen-article-layout{position:relative}.micromag-screen-article-container .micromag-screen-article-emptyAuthor,.micromag-screen-article-container .micromag-screen-article-emptySubtitle,.micromag-screen-article-container .micromag-screen-article-emptyText,.micromag-screen-article-container .micromag-screen-article-emptyTitle{margin:10px auto;padding:12px 0 10px;width:100%}.micromag-screen-article-container .micromag-screen-article-emptyDate,.micromag-screen-article-container .micromag-screen-article-emptySurtitle{-ms-flex-negative:0;flex-shrink:0;padding:4px 0;width:50%}.micromag-screen-article-container .micromag-screen-article-main.micromag-screen-article-hasText{margin-bottom:30px}.micromag-screen-article-container .micromag-screen-article-visualContainer{height:auto;left:0;position:absolute;top:0;width:100%;z-index:-1}.micromag-screen-article-container .micromag-screen-article-surtitle{font-size:12px;width:100%}.micromag-screen-article-container .micromag-screen-article-subtitle{font-size:12px;margin:10px 0 0;width:100%}.micromag-screen-article-container .micromag-screen-article-date{font-size:12px;text-align:right;width:100%}.micromag-screen-article-container .micromag-screen-article-title{margin:10px 0}.micromag-screen-article-container .micromag-screen-article-author{width:100%}.micromag-screen-article-container .micromag-screen-article-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.micromag-screen-article-container .micromag-screen-article-text blockquote,.micromag-screen-article-container .micromag-screen-article-text h2,.micromag-screen-article-container .micromag-screen-article-text h3,.micromag-screen-article-container .micromag-screen-article-text img,.micromag-screen-article-container .micromag-screen-article-text ol,.micromag-screen-article-container .micromag-screen-article-text p,.micromag-screen-article-container .micromag-screen-article-text ul{margin-bottom:1rem}.micromag-screen-article-container .micromag-screen-article-text blockquote:last-child,.micromag-screen-article-container .micromag-screen-article-text h2:last-child,.micromag-screen-article-container .micromag-screen-article-text h3:last-child,.micromag-screen-article-container .micromag-screen-article-text img:last-child,.micromag-screen-article-container .micromag-screen-article-text ol:last-child,.micromag-screen-article-container .micromag-screen-article-text p:last-child,.micromag-screen-article-container .micromag-screen-article-text ul:last-child{margin-bottom:0}.micromag-screen-article-container .micromag-screen-article-text h2{font-size:2em}.micromag-screen-article-container .micromag-screen-article-text h3{font-size:1.5em}.micromag-screen-article-container .micromag-screen-article-text ol,.micromag-screen-article-container .micromag-screen-article-text ul{list-style-position:inside}.micromag-screen-article-container .micromag-screen-article-text blockquote{border-left:1px solid;padding-left:.5em}.micromag-screen-article-container .micromag-screen-article-topContent{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.micromag-screen-article-container .micromag-screen-article-footer{-webkit-transition:opacity .2s ease-out;transition:opacity .2s ease-out}.micromag-screen-article-container .micromag-screen-article-footer a{padding:0}.micromag-screen-article-container .micromag-screen-article-footer.micromag-screen-article-disabled{opacity:0;pointer-events:none}.micromag-screen-article-container.micromag-screen-article-isPlaceholder .micromag-screen-article-layout{padding:10px}
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 .layout{position:relative}.container .emptyAuthor,.container .emptySubtitle,.container .emptyText,.container .emptyTitle{border:2px dashed var(--mm-gray-800);color:var(--mm-gray-800);margin:10px auto;padding:12px 0 10px;width:100%}.container .emptyDate,.container .emptySurtitle{width:50%;-ms-flex-negative:0;border:2px dashed var(--mm-gray-800);color:var(--mm-gray-800);flex-shrink:0;margin:5px auto;padding:4px 0}.container .main.hasText{margin-bottom:30px}.container .visualContainer{height:auto;left:0;position:absolute;top:0;width:100%;z-index:-1}.container .subtitle,.container .surtitle{font-size:12px;width:100%}.container .subtitle{margin:10px 0 0}.container .date{font-size:12px;text-align:right;width:100%}.container .title{margin:10px 0}.container .author{width:100%}.container .text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.container .text blockquote,.container .text h2,.container .text h3,.container .text img,.container .text ol,.container .text p,.container .text ul{margin-bottom:1rem}.container .text blockquote:last-child,.container .text h2:last-child,.container .text h3:last-child,.container .text img:last-child,.container .text ol:last-child,.container .text p:last-child,.container .text ul:last-child{margin-bottom:0}.container .text h2{font-size:2em}.container .text h3{font-size:1.5em}.container .text ol,.container .text ul{list-style-position:inside}.container .text blockquote{border-left:1px solid;padding-left:.5em}.container .topContent{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.container .footer{-webkit-transition:opacity .2s ease-out;transition:opacity .2s ease-out}.container .footer a{padding:0}.container .footer.disabled{opacity:0;pointer-events:none}.container.isPlaceholder .layout{padding:10px}
package/es/index.d.ts ADDED
@@ -0,0 +1,101 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ImageMedia, Text, BackgroundElement, Header, Footer } from '@micromag/core';
3
+
4
+ interface ArticleScreenProps {
5
+ layout?: 'normal';
6
+ image?: ImageMedia | null;
7
+ title?: Text | null;
8
+ surtitle?: Text | null;
9
+ date?: string | null;
10
+ author?: Record<string, unknown> | null;
11
+ text?: Text | null;
12
+ subtitle?: Text | null;
13
+ spacing?: number;
14
+ background?: BackgroundElement | null;
15
+ header?: Header | null;
16
+ footer?: Footer | null;
17
+ current?: boolean;
18
+ preload?: boolean;
19
+ type?: string | null;
20
+ className?: string | null;
21
+ }
22
+ declare function ArticleScreen({ image, title, surtitle, date, author, subtitle, text, spacing, background, header, footer, current, preload, type, className, }: ArticleScreenProps): react_jsx_runtime.JSX.Element;
23
+
24
+ declare const _default: {
25
+ id: string;
26
+ type: string;
27
+ group: {
28
+ label: {
29
+ defaultMessage: string;
30
+ description: string;
31
+ };
32
+ order: number;
33
+ };
34
+ title: {
35
+ defaultMessage: string;
36
+ description: string;
37
+ };
38
+ component: typeof ArticleScreen;
39
+ layouts: string[];
40
+ fields: ({
41
+ name: string;
42
+ type: string;
43
+ label: {
44
+ defaultMessage: string;
45
+ description: string;
46
+ };
47
+ inline?: undefined;
48
+ theme?: undefined;
49
+ } | {
50
+ name: string;
51
+ type: string;
52
+ inline: boolean;
53
+ theme: {
54
+ textStyle: string;
55
+ badge?: undefined;
56
+ callToAction?: undefined;
57
+ };
58
+ label: {
59
+ defaultMessage: string;
60
+ description: string;
61
+ };
62
+ } | {
63
+ name: string;
64
+ type: string;
65
+ label: {
66
+ defaultMessage: string;
67
+ description: string;
68
+ };
69
+ theme: {
70
+ badge: {
71
+ label: {
72
+ textStyle: string;
73
+ };
74
+ boxStyle: string;
75
+ };
76
+ textStyle?: undefined;
77
+ callToAction?: undefined;
78
+ };
79
+ inline?: undefined;
80
+ } | {
81
+ name: string;
82
+ type: string;
83
+ label: {
84
+ defaultMessage: string;
85
+ description: string;
86
+ };
87
+ theme: {
88
+ callToAction: {
89
+ label: {
90
+ textStyle: string;
91
+ };
92
+ boxStyle: string;
93
+ };
94
+ textStyle?: undefined;
95
+ badge?: undefined;
96
+ };
97
+ inline?: undefined;
98
+ })[];
99
+ }[];
100
+
101
+ export { ArticleScreen, _default as default };
package/es/index.js CHANGED
@@ -3,9 +3,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
3
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
4
  import classNames from 'classnames';
5
5
  import dayjs from 'dayjs';
6
- import PropTypes from 'prop-types';
7
6
  import React, { useMemo, useState, useCallback } from 'react';
8
- import { PropTypes as PropTypes$1 } from '@micromag/core';
9
7
  import { ScreenElement } from '@micromag/core/components';
10
8
  import { useScreenSize, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef, useScreenRenderContext } from '@micromag/core/contexts';
11
9
  import { useTrackScreenEvent, useDimensionObserver } from '@micromag/core/hooks';
@@ -21,61 +19,39 @@ import Scroll from '@micromag/element-scroll';
21
19
  import Text from '@micromag/element-text';
22
20
  import Visual from '@micromag/element-visual';
23
21
 
24
- var styles = {"container":"micromag-screen-article-container","background":"micromag-screen-article-background","emptySurtitle":"micromag-screen-article-emptySurtitle","emptyDate":"micromag-screen-article-emptyDate","emptyTitle":"micromag-screen-article-emptyTitle","emptyAuthor":"micromag-screen-article-emptyAuthor","emptySubtitle":"micromag-screen-article-emptySubtitle","emptyText":"micromag-screen-article-emptyText","content":"micromag-screen-article-content","layout":"micromag-screen-article-layout","main":"micromag-screen-article-main","hasText":"micromag-screen-article-hasText","visualContainer":"micromag-screen-article-visualContainer","surtitle":"micromag-screen-article-surtitle","subtitle":"micromag-screen-article-subtitle","date":"micromag-screen-article-date","title":"micromag-screen-article-title","author":"micromag-screen-article-author","text":"micromag-screen-article-text","topContent":"micromag-screen-article-topContent","footer":"micromag-screen-article-footer","disabled":"micromag-screen-article-disabled","isPlaceholder":"micromag-screen-article-isPlaceholder"};
22
+ var styles = {"container":"container","background":"background","content":"content","layout":"layout","emptyTitle":"emptyTitle","emptyAuthor":"emptyAuthor","emptySubtitle":"emptySubtitle","emptyText":"emptyText","emptySurtitle":"emptySurtitle","emptyDate":"emptyDate","main":"main","hasText":"hasText","visualContainer":"visualContainer","surtitle":"surtitle","subtitle":"subtitle","date":"date","title":"title","author":"author","text":"text","topContent":"topContent","footer":"footer","disabled":"disabled","isPlaceholder":"isPlaceholder"};
25
23
 
26
- var propTypes = {
27
- layout: PropTypes.oneOf(['normal']),
28
- image: PropTypes$1.imageMedia,
29
- title: PropTypes$1.text,
30
- surtitle: PropTypes$1.text,
31
- date: PropTypes.string,
32
- author: PropTypes.shape({}),
33
- // author: MicromagPropTypes.text,
34
- text: PropTypes$1.text,
35
- subtitle: PropTypes$1.text,
36
- spacing: PropTypes.number,
37
- background: PropTypes$1.backgroundElement,
38
- header: PropTypes$1.header,
39
- footer: PropTypes$1.footer,
40
- current: PropTypes.bool,
41
- preload: PropTypes.bool,
42
- type: PropTypes.string,
43
- className: PropTypes.string
44
- };
45
- var defaultProps = {
46
- layout: 'normal',
47
- image: null,
48
- title: null,
49
- surtitle: null,
50
- date: null,
51
- author: null,
52
- subtitle: null,
53
- text: null,
54
- spacing: 20,
55
- background: null,
56
- header: null,
57
- footer: null,
58
- current: true,
59
- preload: true,
60
- type: null,
61
- className: null
62
- };
63
- var ArticleScreen = function ArticleScreen(_ref) {
64
- var image = _ref.image,
65
- title = _ref.title,
66
- surtitle = _ref.surtitle,
67
- date = _ref.date,
68
- author = _ref.author,
69
- subtitle = _ref.subtitle,
70
- text = _ref.text,
71
- spacing = _ref.spacing,
72
- background = _ref.background,
73
- header = _ref.header,
74
- footer = _ref.footer,
75
- current = _ref.current,
76
- preload = _ref.preload,
77
- type = _ref.type,
78
- className = _ref.className;
24
+ function ArticleScreen(_ref) {
25
+ var _ref$image = _ref.image,
26
+ image = _ref$image === void 0 ? null : _ref$image,
27
+ _ref$title = _ref.title,
28
+ title = _ref$title === void 0 ? null : _ref$title,
29
+ _ref$surtitle = _ref.surtitle,
30
+ surtitle = _ref$surtitle === void 0 ? null : _ref$surtitle,
31
+ _ref$date = _ref.date,
32
+ date = _ref$date === void 0 ? null : _ref$date,
33
+ _ref$author = _ref.author,
34
+ author = _ref$author === void 0 ? null : _ref$author,
35
+ _ref$subtitle = _ref.subtitle,
36
+ subtitle = _ref$subtitle === void 0 ? null : _ref$subtitle,
37
+ _ref$text = _ref.text,
38
+ text = _ref$text === void 0 ? null : _ref$text,
39
+ _ref$spacing = _ref.spacing,
40
+ spacing = _ref$spacing === void 0 ? 20 : _ref$spacing,
41
+ _ref$background = _ref.background,
42
+ background = _ref$background === void 0 ? null : _ref$background,
43
+ _ref$header = _ref.header,
44
+ header = _ref$header === void 0 ? null : _ref$header,
45
+ _ref$footer = _ref.footer,
46
+ footer = _ref$footer === void 0 ? null : _ref$footer,
47
+ _ref$current = _ref.current,
48
+ current = _ref$current === void 0 ? true : _ref$current,
49
+ _ref$preload = _ref.preload,
50
+ preload = _ref$preload === void 0 ? true : _ref$preload,
51
+ _ref$type = _ref.type,
52
+ type = _ref$type === void 0 ? null : _ref$type,
53
+ _ref$className = _ref.className,
54
+ className = _ref$className === void 0 ? null : _ref$className;
79
55
  var intl = useIntl();
80
56
  var trackScreenEvent = useTrackScreenEvent(type);
81
57
  var _useScreenSize = useScreenSize(),
@@ -342,9 +318,7 @@ var ArticleScreen = function ArticleScreen(_ref) {
342
318
  withoutVideo: isPreview,
343
319
  className: styles.background
344
320
  }) : null);
345
- };
346
- ArticleScreen.propTypes = propTypes;
347
- ArticleScreen.defaultProps = defaultProps;
321
+ }
348
322
 
349
323
  // import * as transforms from './transforms/index';
350
324
 
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 .layout{position:relative}.container .emptyAuthor,.container .emptySubtitle,.container .emptyText,.container .emptyTitle{border:2px dashed var(--mm-gray-800);color:var(--mm-gray-800);margin:10px auto;padding:12px 0 10px;width:100%}.container .emptyDate,.container .emptySurtitle{width:50%;-ms-flex-negative:0;border:2px dashed var(--mm-gray-800);color:var(--mm-gray-800);flex-shrink:0;margin:5px auto;padding:4px 0}.container .main.hasText{margin-bottom:30px}.container .visualContainer{height:auto;left:0;position:absolute;top:0;width:100%;z-index:-1}.container .subtitle,.container .surtitle{font-size:12px;width:100%}.container .subtitle{margin:10px 0 0}.container .date{font-size:12px;text-align:right;width:100%}.container .title{margin:10px 0}.container .author{width:100%}.container .text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.container .text blockquote,.container .text h2,.container .text h3,.container .text img,.container .text ol,.container .text p,.container .text ul{margin-bottom:1rem}.container .text blockquote:last-child,.container .text h2:last-child,.container .text h3:last-child,.container .text img:last-child,.container .text ol:last-child,.container .text p:last-child,.container .text ul:last-child{margin-bottom:0}.container .text h2{font-size:2em}.container .text h3{font-size:1.5em}.container .text ol,.container .text ul{list-style-position:inside}.container .text blockquote{border-left:1px solid;padding-left:.5em}.container .topContent{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.container .footer{-webkit-transition:opacity .2s ease-out;transition:opacity .2s ease-out}.container .footer a{padding:0}.container .footer.disabled{opacity:0;pointer-events:none}.container.isPlaceholder .layout{padding:10px}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-article",
3
- "version": "0.3.832",
3
+ "version": "0.4.4",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -31,6 +31,7 @@
31
31
  "style": "assets/css/styles.css",
32
32
  "exports": {
33
33
  ".": {
34
+ "types": "./es/index.d.ts",
34
35
  "import": "./es/index.js"
35
36
  },
36
37
  "./assets/css/styles": "./assets/css/styles.css",
@@ -44,41 +45,41 @@
44
45
  "scripts": {
45
46
  "clean": "rm -rf es && rm -rf lib && rm -rf assets",
46
47
  "prepublishOnly": "npm run build",
47
- "build": "../../scripts/prepare-package.sh"
48
+ "build": "../../scripts/prepare-package.sh --types"
48
49
  },
49
50
  "devDependencies": {
50
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
51
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
51
+ "react": "^19.2.0",
52
+ "react-dom": "^18.3.0 || ^19.0.0"
52
53
  },
53
54
  "peerDependencies": {
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
  "dependencies": {
58
59
  "@babel/runtime": "^7.13.10",
59
- "@micromag/core": "^0.3.832",
60
- "@micromag/element-author": "^0.3.832",
61
- "@micromag/element-background": "^0.3.832",
62
- "@micromag/element-container": "^0.3.832",
63
- "@micromag/element-footer": "^0.3.832",
64
- "@micromag/element-header": "^0.3.832",
65
- "@micromag/element-heading": "^0.3.832",
66
- "@micromag/element-layout": "^0.3.832",
67
- "@micromag/element-scroll": "^0.3.832",
68
- "@micromag/element-stack": "^0.3.832",
69
- "@micromag/element-text": "^0.3.832",
70
- "@micromag/element-visual": "^0.3.832",
71
- "@micromag/transforms": "^0.3.832",
60
+ "@micromag/core": "^0.4.4",
61
+ "@micromag/element-author": "^0.4.4",
62
+ "@micromag/element-background": "^0.4.4",
63
+ "@micromag/element-container": "^0.4.4",
64
+ "@micromag/element-footer": "^0.4.4",
65
+ "@micromag/element-header": "^0.4.4",
66
+ "@micromag/element-heading": "^0.4.4",
67
+ "@micromag/element-layout": "^0.4.4",
68
+ "@micromag/element-scroll": "^0.4.4",
69
+ "@micromag/element-stack": "^0.4.4",
70
+ "@micromag/element-text": "^0.4.4",
71
+ "@micromag/element-visual": "^0.4.4",
72
+ "@micromag/transforms": "^0.4.4",
72
73
  "classnames": "^2.2.6",
73
74
  "dayjs": "^1.11.10",
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
  }