@financial-times/cp-content-pipeline-ui 13.12.2-beta.2 → 13.13.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 +23 -0
- package/lib/components/content-tree/CustomCodeComponent/client/index.d.ts +1 -5
- package/lib/components/content-tree/CustomCodeComponent/client/index.js +2 -37
- package/lib/components/content-tree/CustomCodeComponent/client/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/content-tree/CustomCodeComponent/client/index.ts +2 -50
- package/src/types/window.d.ts +1 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/components/content-tree/CustomCodeComponent/client/index.spec.d.ts +0 -1
- package/lib/components/content-tree/CustomCodeComponent/client/index.spec.js +0 -89
- package/lib/components/content-tree/CustomCodeComponent/client/index.spec.js.map +0 -1
- package/src/components/content-tree/CustomCodeComponent/client/index.spec.ts +0 -96
package/CHANGELOG.md
CHANGED
|
@@ -574,6 +574,29 @@
|
|
|
574
574
|
* @financial-times/cp-content-pipeline-client bumped from ^3.7.2 to ^3.7.3
|
|
575
575
|
* @financial-times/cp-content-pipeline-schema bumped from ^2.10.1 to ^2.10.2
|
|
576
576
|
|
|
577
|
+
## [13.13.0](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-ui-v13.12.1...cp-content-pipeline-ui-v13.13.0) (2026-11-20)
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
### Features
|
|
581
|
+
|
|
582
|
+
* add the Content Package topper variant ([ce158fd](https://github.com/Financial-Times/cp-content-pipeline/commit/ce158fd6eec8767254bddf99ddb39abc6203b40a))
|
|
583
|
+
* add the Partner Content topper variant ([686931b](https://github.com/Financial-Times/cp-content-pipeline/commit/686931b387df50721573ac2bd6bfe21b37f5bd08))
|
|
584
|
+
* implement TopperLayout and isolate Live Blog into a new variant ([27af56a](https://github.com/Financial-Times/cp-content-pipeline/commit/27af56a4ab1f4a42eff181e7bd067e40c2cddcd7))
|
|
585
|
+
* review and refactor topper modifiers and model logic ([4654e87](https://github.com/Financial-Times/cp-content-pipeline/commit/4654e876343f01887cb8bfa03cdc1afa1fa4bf1b))
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
### Bug Fixes
|
|
589
|
+
|
|
590
|
+
* strengthen tests to capture any HTML structure changes ([2cda0d7](https://github.com/Financial-Times/cp-content-pipeline/commit/2cda0d7d3bc682d8efac958558e77ad766694088))
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
### Dependencies
|
|
594
|
+
|
|
595
|
+
* The following workspace dependencies were updated
|
|
596
|
+
* devDependencies
|
|
597
|
+
* @financial-times/cp-content-pipeline-client bumped from ^7.7.2 to ^7.7.3
|
|
598
|
+
* @financial-times/cp-content-pipeline-schema bumped from ^6.12.0 to ^6.13.0
|
|
599
|
+
|
|
577
600
|
## [13.12.1](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-ui-v13.12.0...cp-content-pipeline-ui-v13.12.1) (2026-11-12)
|
|
578
601
|
|
|
579
602
|
|
|
@@ -10,11 +10,7 @@ declare class CustomCodeComponentClient {
|
|
|
10
10
|
* Track the mount of a custom code component
|
|
11
11
|
*/
|
|
12
12
|
tracking: CustomCodeComponentTracker;
|
|
13
|
-
|
|
14
|
-
element: Element;
|
|
15
|
-
constructor(el: Element, ftAppSwipeGestures?: boolean);
|
|
16
|
-
private cccTouched;
|
|
17
|
-
private cccReleased;
|
|
13
|
+
constructor(el: Element);
|
|
18
14
|
static init(rootEl?: Element): CustomCodeComponentClient[] | void;
|
|
19
15
|
static destroy(components: CustomCodeComponentClient[]): void;
|
|
20
16
|
}
|
|
@@ -12,11 +12,7 @@ class CustomCodeComponentClient {
|
|
|
12
12
|
* Track the mount of a custom code component
|
|
13
13
|
*/
|
|
14
14
|
tracking;
|
|
15
|
-
|
|
16
|
-
element;
|
|
17
|
-
constructor(el, ftAppSwipeGestures) {
|
|
18
|
-
this.element = el;
|
|
19
|
-
this.ftAppSwipeGestures = ftAppSwipeGestures;
|
|
15
|
+
constructor(el) {
|
|
20
16
|
const trackingData = {
|
|
21
17
|
component: {
|
|
22
18
|
id: el.getAttribute('id') ?? '',
|
|
@@ -25,45 +21,14 @@ class CustomCodeComponentClient {
|
|
|
25
21
|
},
|
|
26
22
|
};
|
|
27
23
|
this.tracking = new tracking_1.CustomCodeComponentTracker(el, trackingData);
|
|
28
|
-
// ft-app only: ftAppSwipeGestures is false by default,
|
|
29
|
-
// meaning horizontal swipe gestures navigate to adjacent articles in the swipe flow
|
|
30
|
-
// if set to true, the ccc will signal to ft-app that the component swipe gestures should be given precendence.
|
|
31
|
-
// useful for horizontal scrolling of elements such as carousels
|
|
32
|
-
if (this.ftAppSwipeGestures) {
|
|
33
|
-
el.addEventListener('pointerdown', this.cccTouched);
|
|
34
|
-
el.addEventListener('pointerup', this.cccReleased);
|
|
35
|
-
el.addEventListener('pointercancel', this.cccReleased);
|
|
36
|
-
}
|
|
37
24
|
}
|
|
38
|
-
cccTouched = () => {
|
|
39
|
-
if (!window.ftmob_scrolling) {
|
|
40
|
-
window.ftmob_scrolling = this;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
cccReleased = () => {
|
|
44
|
-
if (window.ftmob_scrolling === this) {
|
|
45
|
-
window.ftmob_scrolling = false;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
25
|
static init(rootEl) {
|
|
49
26
|
const root = rootEl instanceof Element ? rootEl : document;
|
|
50
|
-
return Array.from(root.querySelectorAll('custom-code-component:not([data-initialised])')).map((el) =>
|
|
51
|
-
const ftAppSwipeGestures = el.getAttribute('enable-ft-app-swipe-gestures') === 'true';
|
|
52
|
-
const client = new CustomCodeComponentClient(el, ftAppSwipeGestures);
|
|
53
|
-
return client;
|
|
54
|
-
});
|
|
27
|
+
return Array.from(root.querySelectorAll('custom-code-component:not([data-initialised])')).map((el) => new CustomCodeComponentClient(el));
|
|
55
28
|
}
|
|
56
29
|
static destroy(components) {
|
|
57
30
|
components.forEach((component) => {
|
|
58
31
|
component.tracking.destroy();
|
|
59
|
-
if (component.ftAppSwipeGestures) {
|
|
60
|
-
component.element.removeEventListener('pointerdown', component.cccTouched);
|
|
61
|
-
component.element.removeEventListener('pointerup', component.cccReleased);
|
|
62
|
-
component.element.removeEventListener('pointercancel', component.cccReleased);
|
|
63
|
-
if (window.ftmob_scrolling === component) {
|
|
64
|
-
window.ftmob_scrolling = false;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
32
|
});
|
|
68
33
|
}
|
|
69
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/content-tree/CustomCodeComponent/client/index.ts"],"names":[],"mappings":";;AAAA,yCAAuD;AAEvD;;;;;GAKG;AACH,MAAM,yBAAyB;IAC7B;;OAEG;IACH,QAAQ,CAA4B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/content-tree/CustomCodeComponent/client/index.ts"],"names":[],"mappings":";;AAAA,yCAAuD;AAEvD;;;;;GAKG;AACH,MAAM,yBAAyB;IAC7B;;OAEG;IACH,QAAQ,CAA4B;IAEpC,YAAY,EAAW;QACrB,MAAM,YAAY,GAAG;YACnB,SAAS,EAAE;gBACT,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE;gBAC/B,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE;gBACnC,IAAI,EAAE,uBAAuB;aAC9B;SACF,CAAA;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,qCAA0B,CAC5C,EAAiB,EACjB,YAAY,CACb,CAAA;IACH,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,MAAgB;QAC1B,MAAM,IAAI,GAAG,MAAM,YAAY,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAA;QAC1D,OAAO,KAAK,CAAC,IAAI,CACf,IAAI,CAAC,gBAAgB,CAAC,+CAA+C,CAAC,CACvE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,yBAAyB,CAAC,EAAE,CAAC,CAAC,CAAA;IAClD,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,UAAuC;QACpD,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;YAC/B,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAA;QAC9B,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AAED,kBAAe,yBAAyB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/cp-content-pipeline-ui",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.13.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"@dotcom-tool-kit/npm": "^5.0.1",
|
|
19
19
|
"@financial-times/consent-resolution": "^0.5.0",
|
|
20
20
|
"@financial-times/content-tree": "^0.26.0",
|
|
21
|
-
"@financial-times/cp-content-pipeline-client": "^7.7.
|
|
22
|
-
"@financial-times/cp-content-pipeline-schema": "^6.
|
|
21
|
+
"@financial-times/cp-content-pipeline-client": "^7.7.3",
|
|
22
|
+
"@financial-times/cp-content-pipeline-schema": "^6.13.0",
|
|
23
23
|
"@financial-times/cp-content-pipeline-styles": "^4.12.0",
|
|
24
24
|
"@financial-times/n-scrollytelling-image": "^1.1.0",
|
|
25
25
|
"@financial-times/o-grid": "^6.1.8",
|
|
@@ -11,12 +11,8 @@ class CustomCodeComponentClient {
|
|
|
11
11
|
* Track the mount of a custom code component
|
|
12
12
|
*/
|
|
13
13
|
tracking: CustomCodeComponentTracker
|
|
14
|
-
ftAppSwipeGestures: boolean | undefined
|
|
15
|
-
element: Element
|
|
16
14
|
|
|
17
|
-
constructor(el: Element
|
|
18
|
-
this.element = el
|
|
19
|
-
this.ftAppSwipeGestures = ftAppSwipeGestures
|
|
15
|
+
constructor(el: Element) {
|
|
20
16
|
const trackingData = {
|
|
21
17
|
component: {
|
|
22
18
|
id: el.getAttribute('id') ?? '',
|
|
@@ -28,62 +24,18 @@ class CustomCodeComponentClient {
|
|
|
28
24
|
el as HTMLElement,
|
|
29
25
|
trackingData
|
|
30
26
|
)
|
|
31
|
-
|
|
32
|
-
// ft-app only: ftAppSwipeGestures is false by default,
|
|
33
|
-
// meaning horizontal swipe gestures navigate to adjacent articles in the swipe flow
|
|
34
|
-
// if set to true, the ccc will signal to ft-app that the component swipe gestures should be given precendence.
|
|
35
|
-
// useful for horizontal scrolling of elements such as carousels
|
|
36
|
-
if (this.ftAppSwipeGestures) {
|
|
37
|
-
el.addEventListener('pointerdown', this.cccTouched)
|
|
38
|
-
el.addEventListener('pointerup', this.cccReleased)
|
|
39
|
-
el.addEventListener('pointercancel', this.cccReleased)
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
private cccTouched = (): void => {
|
|
44
|
-
if (!window.ftmob_scrolling) {
|
|
45
|
-
window.ftmob_scrolling = this
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
private cccReleased = (): void => {
|
|
50
|
-
if (window.ftmob_scrolling === this) {
|
|
51
|
-
window.ftmob_scrolling = false
|
|
52
|
-
}
|
|
53
27
|
}
|
|
54
28
|
|
|
55
29
|
static init(rootEl?: Element): CustomCodeComponentClient[] | void {
|
|
56
30
|
const root = rootEl instanceof Element ? rootEl : document
|
|
57
31
|
return Array.from(
|
|
58
32
|
root.querySelectorAll('custom-code-component:not([data-initialised])')
|
|
59
|
-
).map((el) =>
|
|
60
|
-
const ftAppSwipeGestures =
|
|
61
|
-
el.getAttribute('enable-ft-app-swipe-gestures') === 'true'
|
|
62
|
-
const client = new CustomCodeComponentClient(el, ftAppSwipeGestures)
|
|
63
|
-
return client
|
|
64
|
-
})
|
|
33
|
+
).map((el) => new CustomCodeComponentClient(el))
|
|
65
34
|
}
|
|
66
35
|
|
|
67
36
|
static destroy(components: CustomCodeComponentClient[]): void {
|
|
68
37
|
components.forEach((component) => {
|
|
69
38
|
component.tracking.destroy()
|
|
70
|
-
if (component.ftAppSwipeGestures) {
|
|
71
|
-
component.element.removeEventListener(
|
|
72
|
-
'pointerdown',
|
|
73
|
-
component.cccTouched
|
|
74
|
-
)
|
|
75
|
-
component.element.removeEventListener(
|
|
76
|
-
'pointerup',
|
|
77
|
-
component.cccReleased
|
|
78
|
-
)
|
|
79
|
-
component.element.removeEventListener(
|
|
80
|
-
'pointercancel',
|
|
81
|
-
component.cccReleased
|
|
82
|
-
)
|
|
83
|
-
if (window.ftmob_scrolling === component) {
|
|
84
|
-
window.ftmob_scrolling = false
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
39
|
})
|
|
88
40
|
}
|
|
89
41
|
}
|
package/src/types/window.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type CarouselClient from '../components/content-tree/Carousel/client'
|
|
2
|
-
import type CustomCodeComponentClient from '../components/content-tree/CustomCodeComponent/client'
|
|
3
2
|
|
|
4
3
|
export {}
|
|
5
4
|
|
|
6
5
|
declare global {
|
|
7
6
|
interface Window {
|
|
8
|
-
ftmob_scrolling?: CarouselClient |
|
|
7
|
+
ftmob_scrolling?: CarouselClient | false
|
|
9
8
|
}
|
|
10
9
|
}
|