@times-components/article-skeleton 1.85.42 → 1.86.0
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/CHANGELOG.md +11 -0
- package/babel.config.js +13 -2
- package/dist/article-body/article-body-paragraph.js +101 -1
- package/dist/article-body/article-body.js +657 -1
- package/dist/article-body/article-link-tracking-events.js +28 -1
- package/dist/article-body/article-link.js +51 -1
- package/dist/article-body/drop-cap.js +70 -1
- package/dist/article-body/inline-paragraph.js +142 -1
- package/dist/article-body/inset-caption.js +44 -1
- package/dist/article-body/simple-paragraph.js +99 -1
- package/dist/article-skeleton-prop-types.js +38 -1
- package/dist/article-skeleton.js +265 -1
- package/dist/article-topics/index.js +43 -1
- package/dist/body-utils.js +81 -1
- package/dist/contentModifiers/dropcap-util-common.js +117 -1
- package/dist/contentModifiers/dropcap-util.js +28 -1
- package/dist/contentModifiers/inline-ad.js +46 -1
- package/dist/contentModifiers/inline-related-article.js +71 -1
- package/dist/contentModifiers/native-ad.js +56 -1
- package/dist/contentModifiers/newsletter-puff.js +143 -1
- package/dist/data-helper.js +106 -1
- package/dist/gutter.js +43 -1
- package/dist/head.js +472 -1
- package/dist/keylines.js +24 -1
- package/dist/paywall-portal.js +47 -1
- package/dist/sticky-save-and-share-bar.js +60 -1
- package/dist/styles/article-body/article-link.js +18 -1
- package/dist/styles/article-body/index.js +41 -1
- package/dist/styles/article-body/responsive.js +143 -1
- package/dist/styles/article-body/shared.js +124 -1
- package/dist/styles/article-topics/index.js +21 -1
- package/dist/styles/article-topics/responsive.js +21 -1
- package/dist/styles/article-topics/shared.js +24 -1
- package/dist/styles/responsive.js +45 -1
- package/dist/styles/shared.js +20 -1
- package/dist/tracking/article-tracking-context.js +71 -1
- package/dist/tracking/article-tracking-last-paragraph.js +33 -1
- package/package.json +36 -44
- package/rnw.js +1 -1
- package/tsconfig.jest.json +11 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.86.0](https://github.com/newsuk/times-components/compare/@times-components/article-skeleton@1.85.42...@times-components/article-skeleton@1.86.0) (2022-08-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **TDP-1712:** remove react-native foreverrrrr ([#3064](https://github.com/newsuk/times-components/issues/3064)) ([2a20cb5](https://github.com/newsuk/times-components/commit/2a20cb5abc10a4e7ca2d62487967f8fcf4eccb62)), closes [#3037](https://github.com/newsuk/times-components/issues/3037) [#3045](https://github.com/newsuk/times-components/issues/3045) [#3050](https://github.com/newsuk/times-components/issues/3050) [#3056](https://github.com/newsuk/times-components/issues/3056) [#3057](https://github.com/newsuk/times-components/issues/3057) [#3066](https://github.com/newsuk/times-components/issues/3066) [#3065](https://github.com/newsuk/times-components/issues/3065) [#3037](https://github.com/newsuk/times-components/issues/3037) [#3045](https://github.com/newsuk/times-components/issues/3045) [#3045](https://github.com/newsuk/times-components/issues/3045) [#3056](https://github.com/newsuk/times-components/issues/3056) [#3066](https://github.com/newsuk/times-components/issues/3066) [#3069](https://github.com/newsuk/times-components/issues/3069) [#3068](https://github.com/newsuk/times-components/issues/3068) [#3070](https://github.com/newsuk/times-components/issues/3070) [#3072](https://github.com/newsuk/times-components/issues/3072) [#3073](https://github.com/newsuk/times-components/issues/3073) [#3071](https://github.com/newsuk/times-components/issues/3071) [#3074](https://github.com/newsuk/times-components/issues/3074) [#3076](https://github.com/newsuk/times-components/issues/3076) [#3079](https://github.com/newsuk/times-components/issues/3079) [#3078](https://github.com/newsuk/times-components/issues/3078) [#3083](https://github.com/newsuk/times-components/issues/3083) [#3087](https://github.com/newsuk/times-components/issues/3087) [#3091](https://github.com/newsuk/times-components/issues/3091) [#3096](https://github.com/newsuk/times-components/issues/3096) [#3102](https://github.com/newsuk/times-components/issues/3102) [#3105](https://github.com/newsuk/times-components/issues/3105) [#3108](https://github.com/newsuk/times-components/issues/3108) [#3111](https://github.com/newsuk/times-components/issues/3111) [#3112](https://github.com/newsuk/times-components/issues/3112) [#3113](https://github.com/newsuk/times-components/issues/3113) [#3114](https://github.com/newsuk/times-components/issues/3114) [#3120](https://github.com/newsuk/times-components/issues/3120) [#3119](https://github.com/newsuk/times-components/issues/3119) [#3112](https://github.com/newsuk/times-components/issues/3112) [#3126](https://github.com/newsuk/times-components/issues/3126) [#3112](https://github.com/newsuk/times-components/issues/3112) [#3126](https://github.com/newsuk/times-components/issues/3126) [#3127](https://github.com/newsuk/times-components/issues/3127) [#3116](https://github.com/newsuk/times-components/issues/3116) [#3128](https://github.com/newsuk/times-components/issues/3128) [#3132](https://github.com/newsuk/times-components/issues/3132) [#3133](https://github.com/newsuk/times-components/issues/3133)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [1.85.42](https://github.com/newsuk/times-components/compare/@times-components/article-skeleton@1.85.41...@times-components/article-skeleton@1.85.42) (2022-08-15)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @times-components/article-skeleton
|
package/babel.config.js
CHANGED
|
@@ -3,8 +3,19 @@ module.exports = api => {
|
|
|
3
3
|
return {
|
|
4
4
|
plugins: [
|
|
5
5
|
"babel-plugin-styled-components",
|
|
6
|
-
"@babel/plugin-
|
|
6
|
+
"@babel/plugin-proposal-export-default-from"
|
|
7
7
|
],
|
|
8
|
-
presets: [
|
|
8
|
+
presets: [
|
|
9
|
+
[
|
|
10
|
+
"@babel/preset-env",
|
|
11
|
+
{
|
|
12
|
+
targets: {
|
|
13
|
+
esmodules: true
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"@babel/preset-react",
|
|
18
|
+
"@babel/preset-typescript"
|
|
19
|
+
]
|
|
9
20
|
};
|
|
10
21
|
};
|
|
@@ -1 +1,101 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _typeset = require("@times-components/typeset");
|
|
11
|
+
|
|
12
|
+
var _tsStyleguide = require("@times-components/ts-styleguide");
|
|
13
|
+
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
16
|
+
var _dropCap = _interopRequireDefault(require("./drop-cap"));
|
|
17
|
+
|
|
18
|
+
var _inlineParagraph = _interopRequireDefault(require("./inline-paragraph"));
|
|
19
|
+
|
|
20
|
+
var _simpleParagraph = _interopRequireDefault(require("./simple-paragraph"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
28
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
29
|
+
|
|
30
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
31
|
+
|
|
32
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
33
|
+
|
|
34
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
35
|
+
|
|
36
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
37
|
+
|
|
38
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
39
|
+
|
|
40
|
+
const ArticleParagraph = _ref => {
|
|
41
|
+
let key = _ref.key,
|
|
42
|
+
children = _ref.children,
|
|
43
|
+
index = _ref.index,
|
|
44
|
+
tree = _ref.tree,
|
|
45
|
+
scale = _ref.scale,
|
|
46
|
+
dropcapsDisabled = _ref.dropcapsDisabled,
|
|
47
|
+
isTablet = _ref.isTablet,
|
|
48
|
+
defaultFont = _ref.defaultFont,
|
|
49
|
+
onLinkPress = _ref.onLinkPress,
|
|
50
|
+
data = _ref.data,
|
|
51
|
+
dropCapFont = _ref.dropCapFont,
|
|
52
|
+
LinkComponent = _ref.LinkComponent;
|
|
53
|
+
|
|
54
|
+
const str = _typeset.AttributedString.join(children.filter(child => child instanceof _typeset.AttributedString));
|
|
55
|
+
|
|
56
|
+
const _children$filter = children.filter(child => !(child instanceof _typeset.AttributedString)),
|
|
57
|
+
_children$filter2 = _slicedToArray(_children$filter, 1),
|
|
58
|
+
inline = _children$filter2[0];
|
|
59
|
+
|
|
60
|
+
const dropCap = (0, _react.useMemo)(() => !dropcapsDisabled && index === 0 ? (0, _dropCap.default)(scale, _tsStyleguide.colours.section[data.section], dropCapFont, str) : false, [data.section, dropCapFont, dropcapsDisabled, index, scale, str]);
|
|
61
|
+
|
|
62
|
+
if (!inline && !dropCap) {
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(_simpleParagraph.default, {
|
|
64
|
+
tree: tree,
|
|
65
|
+
key: key,
|
|
66
|
+
defaultFont: defaultFont,
|
|
67
|
+
onLinkPress: onLinkPress,
|
|
68
|
+
LinkComponent: LinkComponent
|
|
69
|
+
}, children);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return /*#__PURE__*/_react.default.createElement(_inlineParagraph.default, {
|
|
73
|
+
isTablet: isTablet,
|
|
74
|
+
dropCap: dropCap,
|
|
75
|
+
str: str,
|
|
76
|
+
scale: scale,
|
|
77
|
+
inline: inline,
|
|
78
|
+
tree: tree,
|
|
79
|
+
key: key,
|
|
80
|
+
defaultFont: defaultFont,
|
|
81
|
+
onLinkPress: onLinkPress,
|
|
82
|
+
LinkComponent: LinkComponent
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
ArticleParagraph.propTypes = {
|
|
87
|
+
key: _propTypes.default.string.isRequired,
|
|
88
|
+
children: _propTypes.default.node.isRequired,
|
|
89
|
+
index: _propTypes.default.number.isRequired,
|
|
90
|
+
tree: _propTypes.default.object.isRequired,
|
|
91
|
+
scale: _propTypes.default.string.isRequired,
|
|
92
|
+
dropcapsDisabled: _propTypes.default.bool.isRequired,
|
|
93
|
+
isTablet: _propTypes.default.bool.isRequired,
|
|
94
|
+
defaultFont: _propTypes.default.object.isRequired,
|
|
95
|
+
onLinkPress: _propTypes.default.func.isRequired,
|
|
96
|
+
data: _propTypes.default.object.isRequired,
|
|
97
|
+
dropCapFont: _propTypes.default.object.isRequired,
|
|
98
|
+
LinkComponent: _propTypes.default.func.isRequired
|
|
99
|
+
};
|
|
100
|
+
var _default = ArticleParagraph;
|
|
101
|
+
exports.default = _default;
|