@financial-times/o-topper 5.8.0 → 6.0.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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [6.0.0](https://www.github.com/Financial-Times/origami/compare/o-topper-v5.8.0...o-topper-v6.0.0) (2023-03-07)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * o-topper, remove JS including `n-map-content-to-topper` dependency. (#1031)
9
+
10
+ ### Features
11
+
12
+ * o-topper, remove JS including `n-map-content-to-topper` dependency. ([#1031](https://www.github.com/Financial-Times/origami/issues/1031)) ([a7aa280](https://www.github.com/Financial-Times/origami/commit/a7aa280a363dad91e959903eb36ed7286ffac203))
13
+
3
14
  ## [5.8.0](https://www.github.com/Financial-Times/origami/compare/o-topper-v5.7.4...o-topper-v5.8.0) (2023-03-06)
4
15
 
5
16
 
package/MIGRATION.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Migration guide
2
+ ## Migrating from v5 to v6
2
3
 
4
+ `o-topper` no longer includes JavaScript to select the correct topper for JSON-formatted FT articles and flags. This helper was deeply tied to the FT.com content store, and included hardcoded UUIDs and business logic beyond the scope of Origami. Origami components focus on providing reusable user interfaces – without business logic assumptions which could limit their use outside specific groups or use-cases.
5
+
6
+ To migrate, replace `o-topper` JavaScript with [`n-map-content-to-topper`](https://github.com/Financial-Times/n-map-content-to-topper).
7
+
8
+ ```diff
9
+ -import { mapContentToTopper } from '@financial-times/o-topper';
10
+ +import mapContentToTopper from '@financial-times/n-map-content-to-topper';
11
+ const topper = mapContentToTopper(ftArticle, flags);
12
+ ```
3
13
  ## Migrating from v4 to v5
4
14
 
5
15
  The velvet topper (previously used to indicate life and arts) has been removed.
package/README.md CHANGED
@@ -4,7 +4,6 @@ This component is used for styling the topper sections of an article.
4
4
  - [Usage](#usage)
5
5
  - [Markup](#markup)
6
6
  - [Sass](#sass)
7
- - [JavaScript](#javascript)
8
7
  - [Migration](#migration)
9
8
  - [Contact](#contact)
10
9
  - [Licence](#licence)
@@ -157,28 +156,14 @@ To include o-topper styles granularly specify which elements, themes, and colour
157
156
  )
158
157
  ));
159
158
  ```
160
-
161
- ## JavaScript
162
-
163
- ### Mapping Content to Topper
164
-
165
- This component exports a JavaScript helper from [`n-map-content-to-topper`](https://github.com/Financial-Times/n-map-content-to-topper). Use this helper to select the correct topper for an article given a JSON-formatteed FT article and flags.
166
-
167
- **Note:** This helper is deeply tied to the FT.com content store, and includes hardcoded UUIDs and business logic.
168
-
169
- ```js
170
- import { mapContentToTopper } from '@financial-times/o-topper';
171
-
172
- const topper = mapContentToTopper(ftArticle, flags);
173
- ```
174
-
175
159
  ## Migration
176
160
 
177
161
  State | Major Version | Last Minor Release | Migration guide |
178
162
  :---: | :---: | :---: | :---:
179
- ✨ active | 5 | N/A | [migrate to v5](MIGRATION.md#migrating-from-v4-to-v5) |
180
- ⚠ maintained | 4 | 4.0 | [migrate to v4](MIGRATION.md#migrating-from-v3-to-v4) |
181
- maintained | 3 | 3.1 | [migrate to v3](MIGRATION.md#migrating-from-v2-to-v3) |
163
+ ✨ active | 6 | N/A | [migrate to v6](MIGRATION.md#migrating-from-v5-to-v6) |
164
+ ⚠ maintained | 5 | N/A | [migrate to v5](MIGRATION.md#migrating-from-v4-to-v5) |
165
+ deprecated | 4 | 4.0 | [migrate to v4](MIGRATION.md#migrating-from-v3-to-v4) |
166
+ ╳ deprecated | 3 | 3.1 | [migrate to v3](MIGRATION.md#migrating-from-v2-to-v3) |
182
167
  ╳ deprecated | 2 | 2.7 | [migrate to v2](MIGRATION.md#migrating-from-v1-to-v2) |
183
168
  ╳ deprecated | 1 | 1.2 | - |
184
169
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/o-topper",
3
- "version": "5.8.0",
3
+ "version": "6.0.0",
4
4
  "description": "Article header styling",
5
5
  "keywords": [
6
6
  "topper",
@@ -13,7 +13,6 @@
13
13
  },
14
14
  "license": "MIT",
15
15
  "type": "module",
16
- "browser": "main.js",
17
16
  "scripts": {
18
17
  "start": "npx serve ./demos/local",
19
18
  "build": "bash ../../scripts/component/build.bash",
@@ -35,9 +34,6 @@
35
34
  "@financial-times/o-normalise": "^3.3.0",
36
35
  "@financial-times/o-typography": "^7.2.0"
37
36
  },
38
- "dependencies": {
39
- "@financial-times/n-map-content-to-topper": "^3.2.0"
40
- },
41
37
  "engines": {
42
38
  "npm": "^7 || ^8"
43
39
  },
package/main.js DELETED
@@ -1,3 +0,0 @@
1
- import mapContentToTopper from '@financial-times/n-map-content-to-topper';
2
-
3
- export default mapContentToTopper;