@ethlete/contentful 4.0.0-next.10 → 4.0.0-next.12
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 +27 -0
- package/README.md +6 -1
- package/fesm2022/ethlete-contentful.mjs +365 -399
- package/fesm2022/ethlete-contentful.mjs.map +1 -1
- package/generators/generators.json +5 -0
- package/generators/migrate-contentful-default-components/contentful-default-components.js +59 -0
- package/generators/migrate-contentful-default-components/migration.js +57 -0
- package/generators/migrate-contentful-default-components/schema.json +26 -0
- package/migrations.json +8 -0
- package/package.json +1 -1
- package/types/ethlete-contentful.d.ts +75 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @ethlete/contentful
|
|
2
2
|
|
|
3
|
+
## 4.0.0-next.12
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Breaking: `provideContentfulConfig` no longer registers the asset and link components; spread `CONTENTFUL_DEFAULT_COMPONENTS` into it to keep them. `et update` migrates existing calls.
|
|
8
|
+
|
|
9
|
+
## 4.0.0-next.11
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- `generateContentfulImageSources(asset, options)` now takes an options object (`srcsetSizes`, `backgroundColor`, `quality`, `focusArea`, `resizeBehavior`) instead of five positional parameters.
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- `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.
|
|
18
|
+
- `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`.
|
|
19
|
+
- `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.
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- `provideContentfulConfig` now merges `components` and `imageOptions` one level deep, so overriding one component keeps the other defaults.
|
|
24
|
+
- `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`.
|
|
25
|
+
- Rich text renderer: internal render-state failures now throw coded `RuntimeError`s (ET009-ET011) instead of plain `Error`s.
|
|
26
|
+
- 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.
|
|
27
|
+
- The rich text renderer's node lookup tables no longer stay in bundles that do not render rich text.
|
|
28
|
+
- 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.
|
|
29
|
+
|
|
3
30
|
## 4.0.0-next.10
|
|
4
31
|
|
|
5
32
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -13,7 +13,12 @@ yarn add @ethlete/contentful
|
|
|
13
13
|
```ts
|
|
14
14
|
@Component({
|
|
15
15
|
imports: [ContentfulRichTextRendererComponent],
|
|
16
|
-
providers: [
|
|
16
|
+
providers: [
|
|
17
|
+
provideContentfulConfig({
|
|
18
|
+
...CONTENTFUL_DEFAULT_COMPONENTS,
|
|
19
|
+
customComponents: { newsElement: NewsElementComponent },
|
|
20
|
+
}),
|
|
21
|
+
],
|
|
17
22
|
template: `<et-contentful-rich-text-renderer [content]="data()" richTextPath="items[0].fields.html" />`,
|
|
18
23
|
})
|
|
19
24
|
export class NewsArticleComponent {}
|