@micromag/element-closed-captions 0.3.824 → 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-element-closed-captions-container{position:relative;text-align:center}.micromag-element-closed-captions-container .micromag-element-closed-captions-captions{background-color:#1c1c1c;color:#fff;display:inline-block;padding:5px;word-break:break-word}
1
+ .container{position:relative;text-align:center}.container .captions{background-color:var(--mm-black);color:var(--mm-white);display:inline-block;padding:5px;word-break:break-word}
package/es/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ClosedCaptionsMedia, TextStyle, BoxStyle } from '@micromag/core';
3
+
4
+ interface ClosedCaptionsProps {
5
+ media?: ClosedCaptionsMedia | null;
6
+ currentTime?: number;
7
+ timeOffset?: string | null;
8
+ textStyle?: TextStyle | null;
9
+ boxStyle?: BoxStyle | null;
10
+ className?: string | null;
11
+ }
12
+ declare function ClosedCaptions({ currentTime, timeOffset, media, textStyle, boxStyle, className, }: ClosedCaptionsProps): react_jsx_runtime.JSX.Element;
13
+
14
+ export { ClosedCaptions as default };
package/es/index.js CHANGED
@@ -2,39 +2,25 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
3
3
  import classNames from 'classnames';
4
4
  import parseSRT from 'parse-srt';
5
- import PropTypes from 'prop-types';
6
5
  import React, { useState, useEffect, useCallback } from 'react';
7
- import { PropTypes as PropTypes$1 } from '@micromag/core';
8
6
  import { getSecondsFromTime, getStyleFromBox } from '@micromag/core/utils';
9
7
  import TextElement from '@micromag/element-text';
10
8
 
11
- var styles = {"container":"micromag-element-closed-captions-container","captions":"micromag-element-closed-captions-captions"};
9
+ var styles = {"container":"container","captions":"captions"};
12
10
 
13
- var propTypes = {
14
- media: PropTypes$1.closedCaptionsMedia,
15
- currentTime: PropTypes.number,
16
- // in seconds
17
- timeOffset: PropTypes.string,
18
- // in srt time format (10:00:01,034)
19
- textStyle: PropTypes$1.textStyle,
20
- boxStyle: PropTypes$1.boxStyle,
21
- className: PropTypes.string
22
- };
23
- var defaultProps = {
24
- media: null,
25
- currentTime: 0,
26
- timeOffset: null,
27
- textStyle: null,
28
- boxStyle: null,
29
- className: null
30
- };
31
- var ClosedCaptions = function ClosedCaptions(_ref) {
32
- var currentTime = _ref.currentTime,
33
- timeOffset = _ref.timeOffset,
34
- media = _ref.media,
35
- textStyle = _ref.textStyle,
36
- boxStyle = _ref.boxStyle,
37
- className = _ref.className;
11
+ function ClosedCaptions(_ref) {
12
+ var _ref$currentTime = _ref.currentTime,
13
+ currentTime = _ref$currentTime === void 0 ? 0 : _ref$currentTime,
14
+ _ref$timeOffset = _ref.timeOffset,
15
+ timeOffset = _ref$timeOffset === void 0 ? null : _ref$timeOffset,
16
+ _ref$media = _ref.media,
17
+ media = _ref$media === void 0 ? null : _ref$media,
18
+ _ref$textStyle = _ref.textStyle,
19
+ textStyle = _ref$textStyle === void 0 ? null : _ref$textStyle,
20
+ _ref$boxStyle = _ref.boxStyle,
21
+ boxStyle = _ref$boxStyle === void 0 ? null : _ref$boxStyle,
22
+ _ref$className = _ref.className,
23
+ className = _ref$className === void 0 ? null : _ref$className;
38
24
  var _ref2 = media || {},
39
25
  _ref2$url = _ref2.url,
40
26
  url = _ref2$url === void 0 ? null : _ref2$url;
@@ -90,8 +76,6 @@ var ClosedCaptions = function ClosedCaptions(_ref) {
90
76
  textStyle: textStyle,
91
77
  body: line.text
92
78
  })) : null);
93
- };
94
- ClosedCaptions.propTypes = propTypes;
95
- ClosedCaptions.defaultProps = defaultProps;
79
+ }
96
80
 
97
81
  export { ClosedCaptions as default };
package/es/styles.css ADDED
@@ -0,0 +1 @@
1
+ .container{position:relative;text-align:center}.container .captions{background-color:var(--mm-black);color:var(--mm-white);display:inline-block;padding:5px;word-break:break-word}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-closed-captions",
3
- "version": "0.3.824",
3
+ "version": "0.4.4",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -34,6 +34,7 @@
34
34
  "module": "es/index.js",
35
35
  "exports": {
36
36
  ".": {
37
+ "types": "./es/index.d.ts",
37
38
  "import": "./es/index.js"
38
39
  },
39
40
  "./assets/css/styles": "./assets/css/styles.css",
@@ -47,29 +48,29 @@
47
48
  "scripts": {
48
49
  "clean": "rm -rf es && rm -rf lib && rm -rf assets",
49
50
  "prepublishOnly": "npm run build",
50
- "build": "../../scripts/prepare-package.sh"
51
+ "build": "../../scripts/prepare-package.sh --types"
51
52
  },
52
53
  "devDependencies": {
53
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
54
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
54
+ "react": "^19.2.0",
55
+ "react-dom": "^18.3.0 || ^19.0.0"
55
56
  },
56
57
  "peerDependencies": {
57
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
58
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
58
+ "react": "^19.2.0",
59
+ "react-dom": "^18.3.0 || ^19.0.0"
59
60
  },
60
61
  "dependencies": {
61
62
  "@babel/runtime": "^7.13.10",
62
- "@micromag/core": "^0.3.824",
63
- "@micromag/element-text": "^0.3.824",
63
+ "@micromag/core": "^0.4.4",
64
+ "@micromag/element-text": "^0.4.4",
64
65
  "classnames": "^2.2.6",
65
66
  "parse-srt": "^1.0.0-alpha",
66
- "prop-types": "^15.7.2",
67
- "react-intl": "^6.6.4",
67
+ "react-intl": "^8.1.3",
68
68
  "uuid": "^9.0.0"
69
69
  },
70
70
  "publishConfig": {
71
71
  "access": "public",
72
72
  "registry": "https://registry.npmjs.org/"
73
73
  },
74
- "gitHead": "e266e480cdc5741c73160840affee2eac7e7c9de"
74
+ "gitHead": "04b8519c3a3ddace5a21497e22faa11865d57f6d",
75
+ "types": "es/index.d.ts"
75
76
  }