@ethlete/contentful 4.0.0-next.1 → 4.0.0-next.11
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 +107 -0
- package/README.md +23 -4
- package/fesm2022/ethlete-contentful.mjs +842 -837
- package/fesm2022/ethlete-contentful.mjs.map +1 -1
- package/generators/generators.json +9 -0
- package/generators/migrate-to-contentful-v5/migration-scope.js +41 -0
- package/generators/migrate-to-contentful-v5/migration.js +256 -0
- package/generators/migrate-to-contentful-v5/schema.json +26 -0
- package/migrations.json +12 -0
- package/package.json +19 -13
- package/types/ethlete-contentful.d.ts +124 -229
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,112 @@
|
|
|
1
1
|
# @ethlete/contentful
|
|
2
2
|
|
|
3
|
+
## 4.0.0-next.11
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- `generateContentfulImageSources(asset, options)` now takes an options object (`srcsetSizes`, `backgroundColor`, `quality`, `focusArea`, `resizeBehavior`) instead of five positional parameters.
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- `ContentfulRestAsset.fields.file` is now optional, so an asset without a file no longer throws. Rich text also keeps moved content in its new parent, and only the current host counts as internal.
|
|
12
|
+
- `et-contentful-file`: the file size now scales to a readable unit (`(1.5 MB)` instead of `(1536000 Bytes)`) and can be localized with `provideContentfulFileLabels`.
|
|
13
|
+
- `et-contentful-link`: the rich-text classes now come from the renderer through a new `anchorClass` input, so a standalone link no longer carries them.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- `provideContentfulConfig` now merges `components` and `imageOptions` one level deep, so overriding one component keeps the other defaults.
|
|
18
|
+
- `et-contentful-link` resolves query-only and relative hrefs against the current router URL. The file link and audio caption fall back to the file name when the asset has no title; the GQL asset fragment selects `fileName`.
|
|
19
|
+
- Rich text renderer: internal render-state failures now throw coded `RuntimeError`s (ET009-ET011) instead of plain `Error`s.
|
|
20
|
+
- The rich-text renderer renders unsupported inlines as `span` and warns about unsupported node types in dev mode, keeps partial marks inside a hyperlink, opens external fallback anchors in a new tab, and finds parents and siblings in constant time.
|
|
21
|
+
- The rich text renderer's node lookup tables no longer stay in bundles that do not render rich text.
|
|
22
|
+
- The rich-text renderer skips an embedded entry or asset missing from `includes`, or an entry without a custom component, with a dev-mode warning instead of throwing ET004-ET006 and rendering nothing.
|
|
23
|
+
|
|
24
|
+
## 4.0.0-next.10
|
|
25
|
+
|
|
26
|
+
### Minor Changes
|
|
27
|
+
|
|
28
|
+
- The Angular peer dependency moves from 22.0.7 to 22.1.6. Angular 22.0.x is affected by
|
|
29
|
+
GHSA-hh8m-fm6v-7cvg, a sanitization bypass through directive host bindings, fixed in 22.1.0.
|
|
30
|
+
|
|
31
|
+
## 4.0.0-next.9
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- [#3075](https://github.com/ethlete-io/ethdk/pull/3075) [`1d38e7e`](https://github.com/ethlete-io/ethdk/commit/1d38e7e0a025769f065d8ca7d506cb75ad89139a) Thanks [@github-actions](https://github.com/apps/github-actions)! - `et update` moves the `@ethlete/*` packages to a newer version, runs the codemods those versions
|
|
36
|
+
declare in their own `migrations.json`, and reports what needs a decision or an agent.
|
|
37
|
+
|
|
38
|
+
## 4.0.0-next.8
|
|
39
|
+
|
|
40
|
+
### Major Changes
|
|
41
|
+
|
|
42
|
+
- [#3069](https://github.com/ethlete-io/ethdk/pull/3069) [`1aabd4e`](https://github.com/ethlete-io/ethdk/commit/1aabd4ebc8b5f28a72b6d5cc2079ccaa6318b842) Thanks [@github-actions](https://github.com/apps/github-actions)! - Contentful: correct rich-text ordering, URL handling, nullable assets and responsive images; the GraphQL asset fragment is now named `ContentfulAssetData` to avoid document collisions.
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- [#3069](https://github.com/ethlete-io/ethdk/pull/3069) [`55736ec`](https://github.com/ethlete-io/ethdk/commit/55736ec21189efa86fd107043579fc4c65e4452e) Thanks [@github-actions](https://github.com/apps/github-actions)! - Correct reactive state mutability declarations across Query, Contentful and Query Devtools.
|
|
47
|
+
|
|
48
|
+
## 4.0.0-next.7
|
|
49
|
+
|
|
50
|
+
### Major Changes
|
|
51
|
+
|
|
52
|
+
- [#3041](https://github.com/ethlete-io/ethdk/pull/3041) [`9c71ed3`](https://github.com/ethlete-io/ethdk/commit/9c71ed3c7d1bd92b58e9a183a3213f3439986844) Thanks [@github-actions](https://github.com/apps/github-actions)! - The built-in embedded components now only exist when `provideContentfulConfig()` is in scope - without it embedded assets are skipped and hyperlinks render as plain `<a href>`. Apps that render embedded content must add the provider (no arguments is enough). In exchange, `ContentfulLinkComponent` and text-only rich text no longer bundle the image/video/audio/file components.
|
|
53
|
+
|
|
54
|
+
- [#3041](https://github.com/ethlete-io/ethdk/pull/3041) [`9c71ed3`](https://github.com/ethlete-io/ethdk/commit/9c71ed3c7d1bd92b58e9a183a3213f3439986844) Thanks [@github-actions](https://github.com/apps/github-actions)! - Rich text: marks now render as semantic elements (`<strong>`, `<em>`, `<u>`, `<code>`, `<s>`, `<sub>`, `<sup>`) instead of Tailwind classes; marks inside hyperlinks become `et-contentful-rich-text-mark-*` classes on the link's `textClass`. `marksToClass` changed accordingly, `marksToTags` is new.
|
|
55
|
+
|
|
56
|
+
- [#3041](https://github.com/ethlete-io/ethdk/pull/3041) [`0817cc8`](https://github.com/ethlete-io/ethdk/commit/0817cc888a4cb5e981437096bf7df5351a4c5de6) Thanks [@github-actions](https://github.com/apps/github-actions)! - Contentful v5: the package peers on `@ethlete/components` instead of `@ethlete/cdk` (and drops
|
|
57
|
+
`@angular/cdk` and `rxjs`). `et-contentful-image` renames `hasPriority` to `priority` and loses its
|
|
58
|
+
`*Class` inputs - style the static `et-picture-*` classes instead. The rich text renderer now diffs
|
|
59
|
+
keyed, so element DOM and embedded component instances survive updates and reorders; the
|
|
60
|
+
`useTailwindClasses` option is gone. Run `nx g @ethlete/contentful:migrate-to-contentful-v5`.
|
|
61
|
+
|
|
62
|
+
### Patch Changes
|
|
63
|
+
|
|
64
|
+
- [#3041](https://github.com/ethlete-io/ethdk/pull/3041) [`9c71ed3`](https://github.com/ethlete-io/ethdk/commit/9c71ed3c7d1bd92b58e9a183a3213f3439986844) Thanks [@github-actions](https://github.com/apps/github-actions)! - Smaller bundles: the rich-text renderer no longer pulls the `@contentful/rich-text-types` runtime enums (~2.4 kB gz), and the renderer error codes plus `GQL_FRAGMENT_CONTENTFUL_ASSET` are now droppable literals. `@contentful/rich-text-types` stays a peer dependency for its types.
|
|
65
|
+
|
|
66
|
+
- [#3041](https://github.com/ethlete-io/ethdk/pull/3041) [`353777b`](https://github.com/ethlete-io/ethdk/commit/353777bb56e42ad1c02058a2ccf694f69c94b025) Thanks [@github-actions](https://github.com/apps/github-actions)! - Mark build-tooling peer dependencies (`vite`, `typescript`, `ts-morph`, `@nx/devkit`, `@analogjs/*`) and feature-scoped runtime peers (`date-fns` in components) as optional via `peerDependenciesMeta`. They are only needed when running the Nx generators or using the date/time components - consumers no longer have to install them just to use the libraries.
|
|
67
|
+
|
|
68
|
+
- [#3041](https://github.com/ethlete-io/ethdk/pull/3041) [`353777b`](https://github.com/ethlete-io/ethdk/commit/353777bb56e42ad1c02058a2ccf694f69c94b025) Thanks [@github-actions](https://github.com/apps/github-actions)! - Adopt the `@ethlete/eslint-plugin` styleguide flat configs in `core`, `query`, `contentful` and
|
|
69
|
+
`types`, and apply the resulting auto-fixes. Runtime behavior is unchanged; three fixes are visible to
|
|
70
|
+
TypeScript consumers: exported `types` shapes are `type` aliases rather than `interface` declarations
|
|
71
|
+
(so they can no longer be extended by declaration merging), `core`'s `PropsDirective.destroyRef` and
|
|
72
|
+
`SeoDirective.parent` are `private`, and `ConsentHandler` is a `type`. The theme name registries stay
|
|
73
|
+
interfaces so consumers can keep augmenting them.
|
|
74
|
+
|
|
75
|
+
## 4.0.0-next.6
|
|
76
|
+
|
|
77
|
+
### Patch Changes
|
|
78
|
+
|
|
79
|
+
- [`4e9f2b4`](https://github.com/ethlete-io/ethdk/commit/4e9f2b4d12335fafef192350aef8ffc584996a91) Thanks [@TomTomB](https://github.com/TomTomB)! - Remove the now-redundant `changeDetection: ChangeDetectionStrategy.OnPush` declaration (and its `ChangeDetectionStrategy` import) from all components. OnPush is the default change detection strategy since Angular 22, so this is a no-op cleanup with no behavioral change.
|
|
80
|
+
|
|
81
|
+
## 4.0.0-next.5
|
|
82
|
+
|
|
83
|
+
### Minor Changes
|
|
84
|
+
|
|
85
|
+
- [`edea44b`](https://github.com/ethlete-io/ethdk/commit/edea44bf1c494420f02b545202f4b24db9a6395c) Thanks [@TomTomB](https://github.com/TomTomB)! - Update to angular 22
|
|
86
|
+
|
|
87
|
+
## 4.0.0-next.4
|
|
88
|
+
|
|
89
|
+
### Patch Changes
|
|
90
|
+
|
|
91
|
+
- [`b73a127`](https://github.com/ethlete-io/ethdk/commit/b73a127002a06e3aa0c4e7e977b1ad1f3e04e7e6) Thanks [@TomTomB](https://github.com/TomTomB)! - Bump yet again, final one for sure, pinky promise
|
|
92
|
+
|
|
93
|
+
## 4.0.0-beta.3
|
|
94
|
+
|
|
95
|
+
### Patch Changes
|
|
96
|
+
|
|
97
|
+
- [`ddb5d09`](https://github.com/ethlete-io/ethdk/commit/ddb5d09e4bc56e18cc8c228aa78a200441e7a766) Thanks [@TomTomB](https://github.com/TomTomB)! - Bump to beta
|
|
98
|
+
|
|
99
|
+
- Updated dependencies [[`ddb5d09`](https://github.com/ethlete-io/ethdk/commit/ddb5d09e4bc56e18cc8c228aa78a200441e7a766)]:
|
|
100
|
+
- @ethlete/query@6.0.0-beta.8
|
|
101
|
+
- @ethlete/core@5.0.0-beta.11
|
|
102
|
+
- @ethlete/cdk@5.0.0-beta.12
|
|
103
|
+
|
|
104
|
+
## 4.0.0-next.2
|
|
105
|
+
|
|
106
|
+
### Patch Changes
|
|
107
|
+
|
|
108
|
+
- [`a690217`](https://github.com/ethlete-io/ethdk/commit/a6902172efd9bd1956a16237e79acbfbd816d946) Thanks [@TomTomB](https://github.com/TomTomB)! - Version bump only
|
|
109
|
+
|
|
3
110
|
## 4.0.0-next.1
|
|
4
111
|
|
|
5
112
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
|
-
# contentful
|
|
1
|
+
# @ethlete/contentful
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Angular components for rendering Contentful content - a diffing rich-text renderer with custom-component support for embedded entries, asset components (image, video, audio, file, link), and typed helpers for the REST and GraphQL APIs.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @ethlete/contentful
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
@Component({
|
|
15
|
+
imports: [ContentfulRichTextRendererComponent],
|
|
16
|
+
providers: [provideContentfulConfig({ customComponents: { newsElement: NewsElementComponent } })],
|
|
17
|
+
template: `<et-contentful-rich-text-renderer [content]="data()" richTextPath="items[0].fields.html" />`,
|
|
18
|
+
})
|
|
19
|
+
export class NewsArticleComponent {}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Documentation
|
|
23
|
+
|
|
24
|
+
Full guide (rich-text rendering, custom components, asset components, config, GQL helpers) on the docs site:
|
|
25
|
+
|
|
26
|
+
- [Overview & usage](https://ethlete-sdk-docs.web.app/contentful/)
|