@financial-times/cp-content-pipeline-ui 1.4.3 → 2.0.1
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/.babelrc.json +1 -0
- package/CHANGELOG.md +32 -0
- package/jest.config.js +18 -1
- package/lib/client.d.ts +1 -0
- package/lib/client.js +9 -0
- package/lib/client.js.map +1 -0
- package/lib/components/Clip/client/index.d.ts +117 -0
- package/lib/components/Clip/client/index.js +856 -0
- package/lib/components/Clip/client/index.js.map +1 -0
- package/lib/components/Clip/client/progressBar.d.ts +46 -0
- package/lib/components/Clip/client/progressBar.js +205 -0
- package/lib/components/Clip/client/progressBar.js.map +1 -0
- package/lib/components/Clip/client/utils.d.ts +5 -0
- package/lib/components/Clip/client/utils.js +89 -0
- package/lib/components/Clip/client/utils.js.map +1 -0
- package/lib/components/Clip/index.d.ts +1 -1
- package/lib/components/Clip/index.js +5 -2
- package/lib/components/Clip/index.js.map +1 -1
- package/lib/components/Clip/template/component.d.ts +16 -0
- package/lib/components/Clip/template/component.js +74 -0
- package/lib/components/Clip/template/component.js.map +1 -0
- package/lib/components/Clip/template/index.d.ts +3 -0
- package/lib/components/Clip/template/index.js +17 -0
- package/lib/components/Clip/template/index.js.map +1 -0
- package/lib/components/Clip/test/fixtures.d.ts +2 -0
- package/lib/components/Clip/test/fixtures.js +29 -0
- package/lib/components/Clip/test/fixtures.js.map +1 -0
- package/lib/components/Clip/test/index.spec.d.ts +1 -0
- package/lib/components/Clip/test/index.spec.js +793 -0
- package/lib/components/Clip/test/index.spec.js.map +1 -0
- package/lib/components/Clip/test/progressBar.spec.d.ts +1 -0
- package/lib/components/Clip/test/progressBar.spec.js +176 -0
- package/lib/components/Clip/test/progressBar.spec.js.map +1 -0
- package/lib/components/Clip/test/snapshot.spec.d.ts +1 -0
- package/lib/components/Clip/test/snapshot.spec.js +65 -0
- package/lib/components/Clip/test/snapshot.spec.js.map +1 -0
- package/lib/components/Scrollytelling/index.js +20 -1
- package/lib/components/Scrollytelling/index.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/stories/Clip.stories.d.ts +58 -0
- package/lib/stories/Clip.stories.js +124 -0
- package/lib/stories/Clip.stories.js.map +1 -0
- package/package.json +8 -5
- package/src/client.ts +1 -0
- package/src/components/Clip/client/index.ts +1000 -0
- package/src/components/Clip/client/main.scss +356 -0
- package/src/components/Clip/client/progressBar.scss +89 -0
- package/src/components/Clip/client/progressBar.ts +239 -0
- package/src/components/Clip/client/utils.ts +93 -0
- package/src/components/Clip/index.tsx +1 -1
- package/src/components/Clip/template/component.tsx +191 -0
- package/src/components/Clip/template/index.ts +13 -0
- package/src/components/Clip/test/__snapshots__/snapshot.spec.tsx.snap +403 -0
- package/src/components/Clip/test/fixtures.ts +27 -0
- package/src/components/Clip/test/index.spec.ts +905 -0
- package/src/components/Clip/test/progressBar.spec.ts +168 -0
- package/src/components/Clip/test/snapshot.spec.tsx +103 -0
- package/src/components/Scrollytelling/index.tsx +15 -10
- package/src/index.ts +1 -0
- package/src/stories/Clip.stories.scss +311 -1
- package/src/stories/Clip.stories.tsx +241 -0
- package/src/types/o-types.d.ts +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/src/components/Clip/clip.d.ts +0 -16
- package/src/stories/Clip.stories.js +0 -43
package/.babelrc.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -342,6 +342,38 @@
|
|
|
342
342
|
* @financial-times/cp-content-pipeline-client bumped from ^1.3.7 to ^1.3.8
|
|
343
343
|
* @financial-times/cp-content-pipeline-schema bumped from ^1.3.4 to ^1.3.5
|
|
344
344
|
|
|
345
|
+
## [2.0.1](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-ui-v2.0.0...cp-content-pipeline-ui-v2.0.1) (2023-09-20)
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
### Bug Fixes
|
|
349
|
+
|
|
350
|
+
* scrollytelling heading formats ([3a42419](https://github.com/Financial-Times/cp-content-pipeline/commit/3a42419f039a239a728b37e12b5df4caa1547cd6))
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
### Dependencies
|
|
354
|
+
|
|
355
|
+
* The following workspace dependencies were updated
|
|
356
|
+
* devDependencies
|
|
357
|
+
* @financial-times/cp-content-pipeline-client bumped from ^1.3.8 to ^1.3.9
|
|
358
|
+
* @financial-times/cp-content-pipeline-schema bumped from ^1.3.5 to ^1.3.6
|
|
359
|
+
|
|
360
|
+
## [2.0.0](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-ui-v1.4.3...cp-content-pipeline-ui-v2.0.0) (2023-09-20)
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
### ⚠ BREAKING CHANGES
|
|
364
|
+
|
|
365
|
+
* add new Clip version
|
|
366
|
+
|
|
367
|
+
### Features
|
|
368
|
+
|
|
369
|
+
* add new Clip version ([77dfd13](https://github.com/Financial-Times/cp-content-pipeline/commit/77dfd13f1f67884abb53ec7f5585df9cbb611f8d))
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
### Bug Fixes
|
|
373
|
+
|
|
374
|
+
* autoplay progress ([6b58f69](https://github.com/Financial-Times/cp-content-pipeline/commit/6b58f693d263cd904a74c6181030c560c7ca68c1))
|
|
375
|
+
* transcript icon not cut ([44d67c8](https://github.com/Financial-Times/cp-content-pipeline/commit/44d67c86df3734d9d8179d7751f4c528e407f169))
|
|
376
|
+
|
|
345
377
|
## [1.4.2](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-ui-v1.3.6...cp-content-pipeline-ui-v1.4.2) (2023-09-18)
|
|
346
378
|
|
|
347
379
|
|
package/jest.config.js
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
const base = require('../../jest.config.base.js')
|
|
2
|
-
|
|
3
2
|
module.exports = {
|
|
4
3
|
...base,
|
|
5
4
|
testEnvironment: 'jsdom',
|
|
5
|
+
transformIgnorePatterns: [
|
|
6
|
+
// Need to transform all node from the FT
|
|
7
|
+
"/node_modules/(?!@financial-times)"
|
|
8
|
+
],
|
|
9
|
+
transform: {
|
|
10
|
+
...base.transform,
|
|
11
|
+
'.(js)': '@sucrase/jest-plugin'
|
|
12
|
+
},
|
|
13
|
+
moduleNameMapper: {
|
|
14
|
+
...base.moduleNameMapper,
|
|
15
|
+
'^@financial-times/o-expander$':
|
|
16
|
+
'<rootDir>/../../node_modules/@financial-times/o-expander/main.js',
|
|
17
|
+
'^@financial-times/o-viewport$':
|
|
18
|
+
'<rootDir>/../../node_modules/@financial-times/o-viewport/main.js',
|
|
19
|
+
}
|
|
20
|
+
,
|
|
21
|
+
maxWorkers: '50%', // Adjust the number based on your CircleCI resources
|
|
22
|
+
|
|
6
23
|
}
|
package/lib/client.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Clip } from './components/Clip/client/index';
|
package/lib/client.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Clip = void 0;
|
|
7
|
+
var index_1 = require("./components/Clip/client/index");
|
|
8
|
+
Object.defineProperty(exports, "Clip", { enumerable: true, get: function () { return __importDefault(index_1).default; } });
|
|
9
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAgE;AAAvD,8GAAA,OAAO,OAAQ"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import ProgressBar from './progressBar';
|
|
3
|
+
interface Opts {
|
|
4
|
+
autorender?: boolean;
|
|
5
|
+
autoplay?: boolean | string;
|
|
6
|
+
id?: string;
|
|
7
|
+
layout?: string;
|
|
8
|
+
fallbackImage?: boolean;
|
|
9
|
+
mute?: boolean | string;
|
|
10
|
+
noAudio?: boolean | string;
|
|
11
|
+
fadeOutDelay?: number;
|
|
12
|
+
progressBarTimeTriggerTap?: number;
|
|
13
|
+
progressBarTapDelay?: number;
|
|
14
|
+
progressTimeStepSeconds?: number;
|
|
15
|
+
}
|
|
16
|
+
declare class ClipInterface {
|
|
17
|
+
constructor(el: HTMLElement, opts: any);
|
|
18
|
+
init(): void;
|
|
19
|
+
unload(): void;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
}
|
|
22
|
+
declare class Clip extends ClipInterface {
|
|
23
|
+
containerEl: HTMLElement;
|
|
24
|
+
videoEl: HTMLVideoElement;
|
|
25
|
+
amountWatched: number;
|
|
26
|
+
loop: number;
|
|
27
|
+
canAutoplay: boolean;
|
|
28
|
+
useCustomPlayer: boolean;
|
|
29
|
+
started: boolean;
|
|
30
|
+
playStart: number | undefined;
|
|
31
|
+
opts: Opts;
|
|
32
|
+
private isInViewPort;
|
|
33
|
+
private fireWatchedEvent;
|
|
34
|
+
private onResizeEvent;
|
|
35
|
+
private onClickOutsideEvent;
|
|
36
|
+
private onOfflineEvent;
|
|
37
|
+
private onOnlineEvent;
|
|
38
|
+
private onKeyFocusEvent;
|
|
39
|
+
private observer;
|
|
40
|
+
private lastQuarter;
|
|
41
|
+
dispatchedProgress: any;
|
|
42
|
+
private expander;
|
|
43
|
+
private autoplayPaused;
|
|
44
|
+
private offlineMessageEl;
|
|
45
|
+
private progressRing;
|
|
46
|
+
private lastTimeUpdate;
|
|
47
|
+
private muteIcon;
|
|
48
|
+
private controls;
|
|
49
|
+
private playText;
|
|
50
|
+
private progressBar;
|
|
51
|
+
private isMobileDevice;
|
|
52
|
+
constructor(el: HTMLElement, opts: Opts);
|
|
53
|
+
get autoplay(): boolean;
|
|
54
|
+
get muted(): boolean;
|
|
55
|
+
set muted(value: boolean);
|
|
56
|
+
unload(): void;
|
|
57
|
+
init(): Promise<void>;
|
|
58
|
+
checkLoop(progress?: null | number): void;
|
|
59
|
+
checkIfElementInDOM(): boolean;
|
|
60
|
+
fireEvent(action: string, extraDetail?: {}): void;
|
|
61
|
+
getTrackingData(eventType: string): any;
|
|
62
|
+
getProgress(rounded?: boolean): number;
|
|
63
|
+
getRelevantProgress(): number;
|
|
64
|
+
getDuration(): number;
|
|
65
|
+
getAmountWatched(decimalPoints?: number | undefined): number;
|
|
66
|
+
getAmountWatchedPercentage(decimalPoints: number | undefined): number;
|
|
67
|
+
markPlayStart(): void;
|
|
68
|
+
updateAmountWatched(): void;
|
|
69
|
+
destroy(): void;
|
|
70
|
+
hasEnoughBufferToPlay(): boolean;
|
|
71
|
+
isVideoPlaying(): boolean;
|
|
72
|
+
createCustomPlayer(): void;
|
|
73
|
+
createOfflineMessage(): void;
|
|
74
|
+
showOffLineMessage(): void;
|
|
75
|
+
hideOffLineMessage(): void;
|
|
76
|
+
createNoAudioIcon(): HTMLButtonElement;
|
|
77
|
+
visibilityListener([observed]: IntersectionObserverEntry[]): void;
|
|
78
|
+
addEvents(events: Array<string>): void;
|
|
79
|
+
eventListener(ev: Event): void;
|
|
80
|
+
fadeIn(): void;
|
|
81
|
+
fadeOut(immediate?: boolean): NodeJS.Timeout | undefined;
|
|
82
|
+
getClipPathStringFromProgress(percentage: number): string;
|
|
83
|
+
isDirectPauseEvent(): boolean;
|
|
84
|
+
shouldDispatch(): boolean;
|
|
85
|
+
videoHasAudio(): any;
|
|
86
|
+
videoHasNoAudio(hasNoAudio?: boolean): string | boolean | undefined;
|
|
87
|
+
descriptionToggle(): void;
|
|
88
|
+
showDescription(): void;
|
|
89
|
+
onClickOutside(event: MouseEvent): void;
|
|
90
|
+
onKeyFocus: (event: KeyboardEvent) => void;
|
|
91
|
+
resizeControls(): void;
|
|
92
|
+
isFocused(): boolean;
|
|
93
|
+
togglePlay(): void;
|
|
94
|
+
createProgressBar(): ProgressBar;
|
|
95
|
+
static init(rootElParam?: HTMLElement | string | null, config?: Opts): ClipInterface[];
|
|
96
|
+
}
|
|
97
|
+
export declare class ClipFallbackImage extends ClipInterface {
|
|
98
|
+
containerEl: HTMLElement;
|
|
99
|
+
posterUrl: string;
|
|
100
|
+
dataLayout: string;
|
|
101
|
+
opts: Opts;
|
|
102
|
+
private fallbackImage;
|
|
103
|
+
constructor(clipWithPoster: HTMLElement, opts?: {});
|
|
104
|
+
init(): void;
|
|
105
|
+
fireEvent(action: string, extraDetail?: {}): void;
|
|
106
|
+
getTrackingData(eventType: string): {
|
|
107
|
+
category: string;
|
|
108
|
+
action: string;
|
|
109
|
+
video: {
|
|
110
|
+
type: string;
|
|
111
|
+
source_url: string | undefined;
|
|
112
|
+
layout: string | undefined;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
export declare function showImageInsteadOfClipInClient(): void;
|
|
117
|
+
export default Clip;
|