@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
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Type, InputSignal, InjectionToken, Provider } from '@angular/core';
|
|
3
|
+
import * as _ethlete_core from '@ethlete/core';
|
|
3
4
|
import { NgClassType } from '@ethlete/core';
|
|
4
|
-
import
|
|
5
|
-
import { ComponentType } from '@angular/cdk/portal';
|
|
5
|
+
import { GQL } from '@ethlete/query';
|
|
6
6
|
import { Mark, BLOCKS, INLINES, NodeData, Block } from '@contentful/rich-text-types';
|
|
7
7
|
import * as _ethlete_contentful from '@ethlete/contentful';
|
|
8
|
-
import * as
|
|
9
|
-
import { PictureSource } from '@ethlete/
|
|
8
|
+
import * as _ethlete_components from '@ethlete/components';
|
|
9
|
+
import { PictureSource } from '@ethlete/components';
|
|
10
|
+
import * as _angular_router from '@angular/router';
|
|
10
11
|
|
|
11
|
-
declare const GQL_FRAGMENT_CONTENTFUL_ASSET:
|
|
12
|
+
declare const GQL_FRAGMENT_CONTENTFUL_ASSET: GQL;
|
|
12
13
|
type ContentfulGqlAsset = {
|
|
13
14
|
sys: {
|
|
14
15
|
id: string;
|
|
15
16
|
};
|
|
16
17
|
title: string | null;
|
|
18
|
+
fileName?: string | null;
|
|
17
19
|
contentType: string | null;
|
|
18
20
|
url: string | null;
|
|
19
21
|
description: string | null;
|
|
@@ -86,111 +88,17 @@ type ContentfulGqlCollectionFilterVariables<TCustomWhere extends Record<string,
|
|
|
86
88
|
locale?: string;
|
|
87
89
|
};
|
|
88
90
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
readonly INDEX: 3;
|
|
100
|
-
};
|
|
101
|
-
declare const HTML_OPEN_RENDER_COMMAND_POSITION: {
|
|
102
|
-
readonly ATTRIBUTES: 4;
|
|
103
|
-
readonly TAG_NAME: 5;
|
|
104
|
-
readonly ELEMENT_ID: 6;
|
|
105
|
-
};
|
|
106
|
-
declare const HTML_CLOSE_RENDER_COMMAND_POSITION: {
|
|
107
|
-
readonly TAG_NAME: 4;
|
|
108
|
-
readonly ELEMENT_ID: 5;
|
|
109
|
-
};
|
|
110
|
-
declare const TEXT_RENDER_COMMAND_POSITION: {
|
|
111
|
-
readonly ATTRIBUTES: 4;
|
|
112
|
-
readonly TEXT: 5;
|
|
113
|
-
readonly TEXT_ID: 6;
|
|
114
|
-
};
|
|
115
|
-
declare const COMPONENT_RENDER_COMMAND_POSITION: {
|
|
116
|
-
readonly ATTRIBUTES: 4;
|
|
117
|
-
readonly COMPONENT: 5;
|
|
118
|
-
readonly INPUTS: 6;
|
|
119
|
-
readonly COMPONENT_ID: 7;
|
|
120
|
-
};
|
|
121
|
-
type HtmlOpenRenderCommand = [
|
|
122
|
-
type: typeof RENDER_COMMAND_TYPE.HTML_OPEN,
|
|
123
|
-
nestingLevel: number,
|
|
124
|
-
domPosition: number,
|
|
125
|
-
index: number,
|
|
126
|
-
attributes: Record<string, string>,
|
|
127
|
-
tagName: keyof HTMLElementTagNameMap,
|
|
128
|
-
textId: string
|
|
129
|
-
];
|
|
130
|
-
type HtmlCloseRenderCommand = [
|
|
131
|
-
type: typeof RENDER_COMMAND_TYPE.HTML_CLOSE,
|
|
132
|
-
nestingLevel: number,
|
|
133
|
-
domPosition: number,
|
|
134
|
-
index: number,
|
|
135
|
-
tagName: keyof HTMLElementTagNameMap,
|
|
136
|
-
elementId: string
|
|
137
|
-
];
|
|
138
|
-
type TextRenderCommand = [
|
|
139
|
-
type: typeof RENDER_COMMAND_TYPE.TEXT,
|
|
140
|
-
nestingLevel: number,
|
|
141
|
-
domPosition: number,
|
|
142
|
-
index: number,
|
|
143
|
-
attributes: Record<string, string>,
|
|
144
|
-
text: string,
|
|
145
|
-
elementId: string
|
|
146
|
-
];
|
|
147
|
-
type ComponentRenderCommand = [
|
|
148
|
-
type: typeof RENDER_COMMAND_TYPE.COMPONENT,
|
|
149
|
-
nestingLevel: number,
|
|
150
|
-
domPosition: number,
|
|
151
|
-
index: number,
|
|
152
|
-
attributes: Record<string, string>,
|
|
153
|
-
component: ComponentType<unknown>,
|
|
154
|
-
inputs: Record<string, unknown>,
|
|
155
|
-
componentId: string
|
|
156
|
-
];
|
|
157
|
-
type RenderCommand = HtmlOpenRenderCommand | HtmlCloseRenderCommand | TextRenderCommand | ComponentRenderCommand;
|
|
158
|
-
declare const RENDER_INSTRUCTION_POSITION: {
|
|
159
|
-
readonly TYPE: 0;
|
|
160
|
-
readonly COMMAND: 1;
|
|
161
|
-
};
|
|
162
|
-
declare const RENDER_INSTRUCTION_TYPE: {
|
|
163
|
-
readonly CREATE: 0;
|
|
164
|
-
readonly UPDATE: 1;
|
|
165
|
-
readonly DELETE: 2;
|
|
166
|
-
readonly MOVE: 3;
|
|
167
|
-
};
|
|
168
|
-
type RenderInstructionTypeValue = (typeof RENDER_INSTRUCTION_TYPE)[keyof typeof RENDER_INSTRUCTION_TYPE];
|
|
169
|
-
type RenderInstruction = [RenderInstructionTypeValue, RenderCommand];
|
|
91
|
+
type MarkTagName = 'strong' | 'em' | 'u' | 'code' | 's' | 'sub' | 'sup';
|
|
92
|
+
/**
|
|
93
|
+
* Translates contentful text marks into the semantic html elements the marked text is
|
|
94
|
+
* wrapped in, outermost first. Unknown marks are skipped (with a dev-mode warning).
|
|
95
|
+
*/
|
|
96
|
+
declare const marksToTags: (marks: Mark[]) => MarkTagName[];
|
|
97
|
+
/**
|
|
98
|
+
* The classes marked text inside a hyperlink is rendered with, since the link component
|
|
99
|
+
* receives its text as a plain string.
|
|
100
|
+
*/
|
|
170
101
|
declare const marksToClass: (marks: Mark[]) => string;
|
|
171
|
-
declare const isHtmlOpenRenderCommand: (command: RenderCommand) => command is HtmlOpenRenderCommand;
|
|
172
|
-
declare const isHtmlCloseRenderCommand: (command: RenderCommand) => command is HtmlCloseRenderCommand;
|
|
173
|
-
declare const isTextRenderCommand: (command: RenderCommand) => command is TextRenderCommand;
|
|
174
|
-
declare const isComponentRenderCommand: (command: RenderCommand) => command is ComponentRenderCommand;
|
|
175
|
-
declare const getRenderCommandId: (command: RenderCommand) => string;
|
|
176
|
-
type ExecutedCommandCacheItemBase = {
|
|
177
|
-
element: HTMLElement;
|
|
178
|
-
};
|
|
179
|
-
type ExecutedComponentCommandCacheItem = {
|
|
180
|
-
command: ComponentRenderCommand;
|
|
181
|
-
componentRef: ComponentRef<unknown>;
|
|
182
|
-
} & ExecutedCommandCacheItemBase;
|
|
183
|
-
type ExecutedHtmlCommandCacheItem = {
|
|
184
|
-
command: HtmlOpenRenderCommand | HtmlCloseRenderCommand;
|
|
185
|
-
} & ExecutedCommandCacheItemBase;
|
|
186
|
-
type ExecutedTextCommandCacheItem = {
|
|
187
|
-
command: TextRenderCommand;
|
|
188
|
-
textNode: unknown;
|
|
189
|
-
} & ExecutedCommandCacheItemBase;
|
|
190
|
-
type ExecutedCommandCacheItem = ExecutedComponentCommandCacheItem | ExecutedHtmlCommandCacheItem | ExecutedTextCommandCacheItem;
|
|
191
|
-
declare const isExecutedComponentCommandCacheItem: (cache: ExecutedCommandCacheItem) => cache is ExecutedComponentCommandCacheItem;
|
|
192
|
-
declare const isExecutedHtmlOrTextCommandCacheItem: (cache: ExecutedCommandCacheItem) => cache is ExecutedHtmlCommandCacheItem;
|
|
193
|
-
declare const isExecutedTextCommandCacheItem: (cache: ExecutedCommandCacheItem) => cache is ExecutedTextCommandCacheItem;
|
|
194
102
|
declare const ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID = "$$$_et-contentful-any-entry-content-type-sys-id";
|
|
195
103
|
type ContentfulIncludeMap = {
|
|
196
104
|
/**
|
|
@@ -236,49 +144,11 @@ type CreateContentfulIncludeMapConfig = {
|
|
|
236
144
|
*/
|
|
237
145
|
declare const createContentfulIncludeMap: (config: CreateContentfulIncludeMapConfig) => ContentfulIncludeMap;
|
|
238
146
|
declare class ContentfulRichTextRendererComponent {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
setStyle: (element: HTMLElement, style: Partial<Record<keyof CSSStyleDeclaration, string | null>>, flags?: _angular_core.RendererStyleFlags2) => void;
|
|
245
|
-
removeStyle: (element: HTMLElement, style: keyof CSSStyleDeclaration | string, flags?: _angular_core.RendererStyleFlags2) => void;
|
|
246
|
-
removeStyles: (element: HTMLElement, ...styles: (keyof CSSStyleDeclaration | string)[]) => void;
|
|
247
|
-
setAttribute: (element: HTMLElement, name: string, value: string | null, namespace?: string | null) => void;
|
|
248
|
-
removeAttribute: (element: HTMLElement, ...names: string[]) => void;
|
|
249
|
-
setProperty: (element: HTMLElement, name: string, value: unknown) => void;
|
|
250
|
-
setProperties: (element: HTMLElement, properties: Record<string, unknown>) => void;
|
|
251
|
-
createElement: <K extends keyof HTMLElementTagNameMap>(tagName: K, namespace?: string | null) => HTMLElementTagNameMap[K];
|
|
252
|
-
createText: (value: string) => globalThis.Text;
|
|
253
|
-
createComment: (value: string) => Comment;
|
|
254
|
-
appendChild: (parent: HTMLElement, newChild: Node) => void;
|
|
255
|
-
insertBefore: (parent: Node, newChild: Node, refChild: Node | null) => void;
|
|
256
|
-
removeChild: (parent: Node, oldChild: Node, isHostElement?: boolean) => void;
|
|
257
|
-
selectRootElement: (selectorOrNode: string | HTMLElement, preserveContent?: boolean) => HTMLElement;
|
|
258
|
-
parentNode: (node: Node) => Node | null;
|
|
259
|
-
nextSibling: (node: Node) => Node | null;
|
|
260
|
-
setValue: (node: Node, value: string) => void;
|
|
261
|
-
listen: (target: HTMLElement | Window | Document | "window" | "document" | "body", eventName: string, callback: (event: Event) => boolean | void) => (() => void);
|
|
262
|
-
destroyNode: (node: Node) => void;
|
|
263
|
-
replaceChild: (parent: Node, newChild: Node, oldChild: Node) => void;
|
|
264
|
-
empty: (element: HTMLElement) => void;
|
|
265
|
-
setTextContent: (element: HTMLElement, text: string) => void;
|
|
266
|
-
setInnerHTML: (element: HTMLElement, html: string) => void;
|
|
267
|
-
setAttributes: (element: HTMLElement, attributes: Record<string, string | null>, namespace?: string | null) => void;
|
|
268
|
-
setDataAttributes: (element: HTMLElement, data: Record<string, string | null>) => void;
|
|
269
|
-
setCssProperty: (element: HTMLElement, name: string, value: string | null) => void;
|
|
270
|
-
setCssProperties: (element: HTMLElement, properties: Record<string, string | null>) => void;
|
|
271
|
-
renderer: _angular_core.Renderer2;
|
|
272
|
-
};
|
|
273
|
-
_elementRef: ElementRef<HTMLElement>;
|
|
274
|
-
_document: Document;
|
|
275
|
-
_config: _ethlete_contentful.ContentfulConfig;
|
|
276
|
-
/**
|
|
277
|
-
* A cache for all executed commands that are not deleted.
|
|
278
|
-
* This is used to keep track of all rendered elements and components.
|
|
279
|
-
* The key is the render command element ID.
|
|
280
|
-
*/
|
|
281
|
-
_executedCommandsCache: Map<string, ExecutedCommandCacheItem>;
|
|
147
|
+
private viewContainerRef;
|
|
148
|
+
private renderer;
|
|
149
|
+
private elementRef;
|
|
150
|
+
private config;
|
|
151
|
+
private document;
|
|
282
152
|
/**
|
|
283
153
|
* The contentful response gotten via their REST api.
|
|
284
154
|
* @see https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/entries/entries-collection
|
|
@@ -289,60 +159,56 @@ declare class ContentfulRichTextRendererComponent {
|
|
|
289
159
|
* @example "items[0].fields.html"
|
|
290
160
|
*/
|
|
291
161
|
richTextPath: _angular_core.InputSignal<string>;
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* The rich text data that should be rendered.
|
|
299
|
-
*/
|
|
300
|
-
richTextData: _angular_core.Signal<RichTextResponse | null>;
|
|
301
|
-
renderCommands: _angular_core.Signal<RenderCommand[]>;
|
|
302
|
-
renderCommandHistory: _angular_core.Signal<[RenderCommand[], RenderCommand[]]>;
|
|
303
|
-
previousRenderCommandMap: _angular_core.Signal<Map<string | number, RenderCommand>>;
|
|
304
|
-
renderInstructions: _angular_core.Signal<RenderInstruction[]>;
|
|
162
|
+
private readonly executedCommandsCache;
|
|
163
|
+
private contentIncludesMap;
|
|
164
|
+
private richTextData;
|
|
165
|
+
private renderCommands;
|
|
166
|
+
private renderInstructions;
|
|
305
167
|
constructor();
|
|
306
|
-
private
|
|
307
|
-
private
|
|
308
|
-
private
|
|
309
|
-
private
|
|
310
|
-
private
|
|
311
|
-
private
|
|
312
|
-
private
|
|
313
|
-
private
|
|
314
|
-
private
|
|
315
|
-
private _findFollowingElement;
|
|
316
|
-
private _renderInsertOrAppend;
|
|
168
|
+
private createRenderCommands;
|
|
169
|
+
private execInstructions;
|
|
170
|
+
private runCreateInstruction;
|
|
171
|
+
private runUpdateInstruction;
|
|
172
|
+
private runMoveInstruction;
|
|
173
|
+
private runDeleteInstruction;
|
|
174
|
+
private getComponentRootNode;
|
|
175
|
+
private findParent;
|
|
176
|
+
private renderInsertAfter;
|
|
317
177
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentfulRichTextRendererComponent, never>;
|
|
318
178
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentfulRichTextRendererComponent, "et-contentful-rich-text-renderer", never, { "content": { "alias": "content"; "required": true; "isSignal": true; }; "richTextPath": { "alias": "richTextPath"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
319
179
|
}
|
|
320
180
|
|
|
321
181
|
declare const isRichTextRootNode: (node: unknown) => node is RichTextResponse;
|
|
322
|
-
|
|
182
|
+
/**
|
|
183
|
+
* The html element a structural rich text node renders as. A node type without an element
|
|
184
|
+
* (an unsupported inline or block) falls back to `span` for inlines and `div` otherwise,
|
|
185
|
+
* with a dev-mode warning.
|
|
186
|
+
*/
|
|
187
|
+
declare const translateContentfulNodeTypeToHtmlTag: (nodeType: "text" | BLOCKS | INLINES) => keyof HTMLElementTagNameMap;
|
|
323
188
|
|
|
324
189
|
type ContentfulImageResizeBehavior = 'pad' | 'crop' | 'fill' | 'scale' | 'thumb' | 'fit';
|
|
325
190
|
type ContentfulImageFocusArea = 'top' | 'bottom' | 'left' | 'right' | 'center' | 'top_left' | 'top_right' | 'bottom_left' | 'bottom_right' | 'face' | 'faces';
|
|
326
|
-
type ComponentLikeWithAsset =
|
|
191
|
+
type ComponentLikeWithAsset = Type<{
|
|
327
192
|
asset: InputSignal<ContentfulRestAsset | ContentfulGqlAsset | null | undefined>;
|
|
328
193
|
}>;
|
|
329
|
-
type ComponentLikeWithLink =
|
|
194
|
+
type ComponentLikeWithLink = Type<{
|
|
330
195
|
href: InputSignal<string>;
|
|
331
196
|
text: InputSignal<string>;
|
|
332
197
|
textClass: InputSignal<string>;
|
|
198
|
+
anchorClass?: InputSignal<string>;
|
|
333
199
|
}>;
|
|
334
|
-
type ComponentLikeWithContentfulRendererInputs =
|
|
200
|
+
type ComponentLikeWithContentfulRendererInputs = Type<{
|
|
335
201
|
fields?: InputSignal<any>;
|
|
336
202
|
includes?: InputSignal<ContentfulIncludeMap>;
|
|
337
203
|
metadata?: InputSignal<ContentfulMetadata>;
|
|
338
204
|
sys?: InputSignal<ContentfulEntrySys>;
|
|
339
205
|
}>;
|
|
340
206
|
type ContentfulAssetComponents = {
|
|
341
|
-
file
|
|
342
|
-
image
|
|
343
|
-
video
|
|
344
|
-
audio
|
|
345
|
-
link
|
|
207
|
+
file?: ComponentLikeWithAsset;
|
|
208
|
+
image?: ComponentLikeWithAsset;
|
|
209
|
+
video?: ComponentLikeWithAsset;
|
|
210
|
+
audio?: ComponentLikeWithAsset;
|
|
211
|
+
link?: ComponentLikeWithLink;
|
|
346
212
|
};
|
|
347
213
|
type ContentfulConfig = {
|
|
348
214
|
/**
|
|
@@ -353,15 +219,11 @@ type ContentfulConfig = {
|
|
|
353
219
|
* Component for rendering embedded entries
|
|
354
220
|
*/
|
|
355
221
|
customComponents: Record<string, ComponentLikeWithContentfulRendererInputs>;
|
|
356
|
-
/**
|
|
357
|
-
* Determines if the contentful rich text renderer should render the contentful rich text with tailwind css classes
|
|
358
|
-
*/
|
|
359
|
-
useTailwindClasses: boolean;
|
|
360
222
|
/**
|
|
361
223
|
* Additional hostnames that should be treated as internal links (in addition to the current page's host).
|
|
362
224
|
* Useful when the app runs on localhost during development but Contentful content references the production domain.
|
|
363
|
-
*
|
|
364
|
-
*
|
|
225
|
+
* A configured hostname also covers its subdomains, so adding "example.com" treats
|
|
226
|
+
* "foo.example.com" as internal without matching unrelated public-suffix siblings.
|
|
365
227
|
*
|
|
366
228
|
* @example ['example.com']
|
|
367
229
|
*/
|
|
@@ -375,7 +237,7 @@ type ContentfulConfig = {
|
|
|
375
237
|
* - `"400"` - 400px width
|
|
376
238
|
* - `"400x300"` - 400px width and 300px height
|
|
377
239
|
* - `"400w"` - 400px width
|
|
378
|
-
* - `"400h"` - 400px height
|
|
240
|
+
* - `"400h"` - 400px height (requires image dimensions to derive a valid width descriptor)
|
|
379
241
|
* - `"400wx300h"` - 400px width and 300px height
|
|
380
242
|
**/
|
|
381
243
|
srcsetSizes: string[];
|
|
@@ -453,7 +315,7 @@ type ContentfulRestAsset = {
|
|
|
453
315
|
fields: {
|
|
454
316
|
title: string;
|
|
455
317
|
description: string;
|
|
456
|
-
file
|
|
318
|
+
file?: ContentfulAssetFileData;
|
|
457
319
|
};
|
|
458
320
|
metadata: ContentfulMetadata;
|
|
459
321
|
};
|
|
@@ -465,9 +327,9 @@ type ContentfulEntry<T = {
|
|
|
465
327
|
metadata: ContentfulMetadata;
|
|
466
328
|
};
|
|
467
329
|
type ContentfulCollection = {
|
|
468
|
-
includes
|
|
469
|
-
Asset
|
|
470
|
-
Entry
|
|
330
|
+
includes?: {
|
|
331
|
+
Asset?: ContentfulRestAsset[];
|
|
332
|
+
Entry?: ContentfulEntry[];
|
|
471
333
|
};
|
|
472
334
|
items: ContentfulEntry[];
|
|
473
335
|
limit: number;
|
|
@@ -488,20 +350,38 @@ declare class ContentfulAudioComponent {
|
|
|
488
350
|
audioClass: _angular_core.InputSignal<NgClassType>;
|
|
489
351
|
figureClass: _angular_core.InputSignal<NgClassType>;
|
|
490
352
|
figcaptionClass: _angular_core.InputSignal<NgClassType>;
|
|
491
|
-
data: _angular_core.Signal<{
|
|
492
|
-
url: string
|
|
353
|
+
protected data: _angular_core.Signal<{
|
|
354
|
+
url: string;
|
|
493
355
|
title: string | null;
|
|
494
356
|
} | null>;
|
|
495
357
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentfulAudioComponent, never>;
|
|
496
358
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentfulAudioComponent, "et-contentful-audio", never, { "asset": { "alias": "asset"; "required": true; "isSignal": true; }; "audioClass": { "alias": "audioClass"; "required": false; "isSignal": true; }; "figureClass": { "alias": "figureClass"; "required": false; "isSignal": true; }; "figcaptionClass": { "alias": "figcaptionClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
497
359
|
}
|
|
498
360
|
|
|
361
|
+
/** Every string `et-contentful-file` renders itself. Override them app-wide with {@link provideContentfulFileLabels}. */
|
|
362
|
+
type ContentfulFileLabels = {
|
|
363
|
+
/** The size shown after the file title, e.g. `'(1.5 MB)'`. */
|
|
364
|
+
fileSize: (bytes: number) => string;
|
|
365
|
+
};
|
|
366
|
+
/** The built-in English labels. */
|
|
367
|
+
declare const DEFAULT_CONTENTFUL_FILE_LABELS: ContentfulFileLabels;
|
|
368
|
+
/**
|
|
369
|
+
* Localize `et-contentful-file` for everything below this injector, and read the set in effect here as a signal.
|
|
370
|
+
* Partial - whatever you leave out keeps its {@link DEFAULT_CONTENTFUL_FILE_LABELS} value.
|
|
371
|
+
*
|
|
372
|
+
* @example
|
|
373
|
+
* provideContentfulFileLabels({ fileSize: (bytes) => `(${new Intl.NumberFormat('de').format(bytes)} Byte)` });
|
|
374
|
+
*/
|
|
375
|
+
declare const provideContentfulFileLabels: (labels: _ethlete_core.LabelsSource<ContentfulFileLabels>) => _angular_core.Provider;
|
|
376
|
+
declare const injectContentfulFileLabels: () => _angular_core.Signal<ContentfulFileLabels>;
|
|
377
|
+
declare const CONTENTFUL_FILE_LABELS: _angular_core.InjectionToken<_ethlete_core.LabelsSource<ContentfulFileLabels>>;
|
|
378
|
+
|
|
499
379
|
declare class ContentfulFileComponent {
|
|
380
|
+
protected labels: _angular_core.Signal<_ethlete_contentful.ContentfulFileLabels>;
|
|
500
381
|
asset: _angular_core.InputSignal<ContentfulGqlAsset | ContentfulRestAsset | null | undefined>;
|
|
501
382
|
fileClass: _angular_core.InputSignal<NgClassType>;
|
|
502
|
-
data: _angular_core.Signal<{
|
|
503
|
-
url: string
|
|
504
|
-
contentType: string | null;
|
|
383
|
+
protected data: _angular_core.Signal<{
|
|
384
|
+
url: string;
|
|
505
385
|
size: number | null;
|
|
506
386
|
title: string | null;
|
|
507
387
|
} | null>;
|
|
@@ -510,29 +390,25 @@ declare class ContentfulFileComponent {
|
|
|
510
390
|
}
|
|
511
391
|
|
|
512
392
|
declare class ContentfulImageComponent {
|
|
513
|
-
|
|
393
|
+
private contentfulConfig;
|
|
514
394
|
asset: _angular_core.InputSignal<ContentfulGqlAsset | ContentfulRestAsset | null | undefined>;
|
|
515
395
|
backgroundColor: _angular_core.InputSignal<string | null>;
|
|
516
396
|
srcsetSizes: _angular_core.InputSignal<string[]>;
|
|
517
397
|
quality: _angular_core.InputSignalWithTransform<number | null, unknown>;
|
|
518
398
|
focusArea: _angular_core.InputSignal<ContentfulImageFocusArea | null>;
|
|
519
399
|
resizeBehavior: _angular_core.InputSignal<ContentfulImageResizeBehavior | null>;
|
|
520
|
-
|
|
521
|
-
imgClass: _angular_core.InputSignal<NgClassType>;
|
|
522
|
-
figureClass: _angular_core.InputSignal<NgClassType>;
|
|
523
|
-
figcaptionClass: _angular_core.InputSignal<NgClassType>;
|
|
524
|
-
pictureClass: _angular_core.InputSignal<NgClassType>;
|
|
400
|
+
priority: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
525
401
|
sizes: _angular_core.InputSignalWithTransform<string | null, string | string[] | null>;
|
|
526
|
-
normalizedAsset: _angular_core.Signal<{
|
|
402
|
+
protected normalizedAsset: _angular_core.Signal<{
|
|
527
403
|
alt: string | null;
|
|
528
404
|
figcaption: string | null;
|
|
529
405
|
width: number | null;
|
|
530
406
|
height: number | null;
|
|
531
407
|
}>;
|
|
532
|
-
|
|
533
|
-
|
|
408
|
+
protected sourcesValue: _angular_core.Signal<_ethlete_components.PictureSource[]>;
|
|
409
|
+
protected defaultSrcValue: _angular_core.Signal<_ethlete_components.PictureSource | null>;
|
|
534
410
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentfulImageComponent, never>;
|
|
535
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentfulImageComponent, "et-contentful-image", never, { "asset": { "alias": "asset"; "required": true; "isSignal": true; }; "backgroundColor": { "alias": "backgroundColor"; "required": false; "isSignal": true; }; "srcsetSizes": { "alias": "srcsetSizes"; "required": false; "isSignal": true; }; "quality": { "alias": "quality"; "required": false; "isSignal": true; }; "focusArea": { "alias": "focusArea"; "required": false; "isSignal": true; }; "resizeBehavior": { "alias": "resizeBehavior"; "required": false; "isSignal": true; }; "
|
|
411
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentfulImageComponent, "et-contentful-image", never, { "asset": { "alias": "asset"; "required": true; "isSignal": true; }; "backgroundColor": { "alias": "backgroundColor"; "required": false; "isSignal": true; }; "srcsetSizes": { "alias": "srcsetSizes"; "required": false; "isSignal": true; }; "quality": { "alias": "quality"; "required": false; "isSignal": true; }; "focusArea": { "alias": "focusArea"; "required": false; "isSignal": true; }; "resizeBehavior": { "alias": "resizeBehavior"; "required": false; "isSignal": true; }; "priority": { "alias": "priority"; "required": false; "isSignal": true; }; "sizes": { "alias": "sizes"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
536
412
|
}
|
|
537
413
|
|
|
538
414
|
declare const generateDefaultContentfulImageSource: (data: ContentfulRestAsset | ContentfulGqlAsset) => PictureSource;
|
|
@@ -548,27 +424,44 @@ declare const parseContentfulImageSize: (size: string) => {
|
|
|
548
424
|
width: number | null;
|
|
549
425
|
height: number | null;
|
|
550
426
|
};
|
|
551
|
-
|
|
427
|
+
type ContentfulImageSourcesOptions = {
|
|
428
|
+
srcsetSizes?: string[];
|
|
429
|
+
backgroundColor?: string | null;
|
|
430
|
+
quality?: number | null;
|
|
431
|
+
focusArea?: ContentfulImageFocusArea | null;
|
|
432
|
+
resizeBehavior?: ContentfulImageResizeBehavior | null;
|
|
433
|
+
};
|
|
434
|
+
/**
|
|
435
|
+
* Builds AVIF and WebP `<source>` entries for a Contentful asset through the Contentful Images API.
|
|
436
|
+
*
|
|
437
|
+
* @example
|
|
438
|
+
* generateContentfulImageSources(asset, { srcsetSizes: ['400w', '800w'], quality: 80 });
|
|
439
|
+
*/
|
|
440
|
+
declare const generateContentfulImageSources: (data: ContentfulRestAsset | ContentfulGqlAsset, options?: ContentfulImageSourcesOptions) => PictureSource[];
|
|
552
441
|
|
|
553
442
|
declare class ContentfulLinkComponent {
|
|
554
|
-
private
|
|
555
|
-
private
|
|
443
|
+
private document;
|
|
444
|
+
private router;
|
|
445
|
+
private config;
|
|
446
|
+
private url;
|
|
556
447
|
href: _angular_core.InputSignal<string>;
|
|
557
448
|
text: _angular_core.InputSignal<string>;
|
|
558
449
|
textClass: _angular_core.InputSignal<string>;
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
450
|
+
anchorClass: _angular_core.InputSignal<string>;
|
|
451
|
+
protected usesRouterLink: _angular_core.Signal<boolean>;
|
|
452
|
+
protected openInNewTab: _angular_core.Signal<boolean>;
|
|
453
|
+
protected internalPath: _angular_core.Signal<string>;
|
|
454
|
+
protected internalUrlTree: _angular_core.Signal<_angular_router.UrlTree>;
|
|
455
|
+
protected linkClass: _angular_core.Signal<string | null>;
|
|
563
456
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentfulLinkComponent, never>;
|
|
564
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentfulLinkComponent, "et-contentful-link", never, { "href": { "alias": "href"; "required": true; "isSignal": true; }; "text": { "alias": "text"; "required": true; "isSignal": true; }; "textClass": { "alias": "textClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
457
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentfulLinkComponent, "et-contentful-link", never, { "href": { "alias": "href"; "required": true; "isSignal": true; }; "text": { "alias": "text"; "required": true; "isSignal": true; }; "textClass": { "alias": "textClass"; "required": false; "isSignal": true; }; "anchorClass": { "alias": "anchorClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
565
458
|
}
|
|
566
459
|
|
|
567
460
|
declare class ContentfulVideoComponent {
|
|
568
461
|
asset: _angular_core.InputSignal<ContentfulGqlAsset | ContentfulRestAsset | null | undefined>;
|
|
569
462
|
videoClass: _angular_core.InputSignal<NgClassType>;
|
|
570
|
-
data: _angular_core.Signal<{
|
|
571
|
-
url: string
|
|
463
|
+
protected data: _angular_core.Signal<{
|
|
464
|
+
url: string;
|
|
572
465
|
contentType: string | null;
|
|
573
466
|
} | null>;
|
|
574
467
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentfulVideoComponent, never>;
|
|
@@ -579,13 +472,15 @@ declare const CONTENTFUL_CONFIG: InjectionToken<ContentfulConfig>;
|
|
|
579
472
|
|
|
580
473
|
declare const ContentfulImports: readonly [typeof ContentfulAudioComponent, typeof ContentfulFileComponent, typeof ContentfulImageComponent, typeof ContentfulVideoComponent, typeof ContentfulRichTextRendererComponent];
|
|
581
474
|
|
|
582
|
-
declare const createContentfulConfig: (config?: Partial<ContentfulConfig> | null
|
|
475
|
+
declare const createContentfulConfig: (config?: Partial<ContentfulConfig> | null) => ContentfulConfig;
|
|
476
|
+
/**
|
|
477
|
+
* Reads the contentful config from the current injector. Falls back to a config without
|
|
478
|
+
* any `components` when none was provided via `provideContentfulConfig()`.
|
|
479
|
+
*/
|
|
480
|
+
declare const injectContentfulConfig: () => ContentfulConfig;
|
|
583
481
|
|
|
584
|
-
declare const provideContentfulConfig: (contentfulConfig?: Partial<ContentfulConfig> | null
|
|
585
|
-
provide: _angular_core.InjectionToken<ContentfulConfig>;
|
|
586
|
-
useValue: ContentfulConfig;
|
|
587
|
-
};
|
|
482
|
+
declare const provideContentfulConfig: (contentfulConfig?: Partial<ContentfulConfig> | null) => Provider;
|
|
588
483
|
declare const isContentfulEntryType: <T extends ContentfulEntry>(entry: ContentfulEntry, type: string) => entry is T;
|
|
589
484
|
|
|
590
|
-
export {
|
|
591
|
-
export type { ComponentLikeWithAsset, ComponentLikeWithContentfulRendererInputs, ComponentLikeWithLink, ContentfulAssetComponents, ContentfulAssetFileData, ContentfulAssetImageData, ContentfulAssetLink, ContentfulAssetLinkItem, ContentfulCollection, ContentfulConfig, ContentfulContentTypeLink, ContentfulEntry, ContentfulEntryLink, ContentfulEntryLinkItem, ContentfulEntrySys, ContentfulEnvironmentLink, ContentfulGqlAsset, ContentfulGqlCollectionFilterVariables, ContentfulGqlOrder, ContentfulGqlWhereFilter, ContentfulImageFocusArea, ContentfulImageResizeBehavior, ContentfulIncludeMap, ContentfulLink, ContentfulLinkType, ContentfulMetadata, ContentfulRestAsset, ContentfulSpaceLink, ContentfulSys, ContentfulTagLink, ContentfulTagLinkItem, CreateContentfulIncludeMapConfig, RichTextResponse };
|
|
485
|
+
export { CONTENTFUL_CONFIG, CONTENTFUL_FILE_LABELS, ContentfulAudioComponent, ContentfulFileComponent, ContentfulImageComponent, ContentfulImports, ContentfulLinkComponent, ContentfulRichTextRendererComponent, ContentfulVideoComponent, DEFAULT_CONTENTFUL_FILE_LABELS, ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID, GQL_FRAGMENT_CONTENTFUL_ASSET, createContentfulConfig, createContentfulIncludeMap, generateContentfulImageSources, generateDefaultContentfulImageSource, injectContentfulConfig, injectContentfulFileLabels, isContentfulEntryType, isContentfulGqlAsset, isRichTextRootNode, marksToClass, marksToTags, parseContentfulImageSize, provideContentfulConfig, provideContentfulFileLabels, translateContentfulNodeTypeToHtmlTag };
|
|
486
|
+
export type { ComponentLikeWithAsset, ComponentLikeWithContentfulRendererInputs, ComponentLikeWithLink, ContentfulAssetComponents, ContentfulAssetFileData, ContentfulAssetImageData, ContentfulAssetLink, ContentfulAssetLinkItem, ContentfulCollection, ContentfulConfig, ContentfulContentTypeLink, ContentfulEntry, ContentfulEntryLink, ContentfulEntryLinkItem, ContentfulEntrySys, ContentfulEnvironmentLink, ContentfulFileLabels, ContentfulGqlAsset, ContentfulGqlCollectionFilterVariables, ContentfulGqlOrder, ContentfulGqlWhereFilter, ContentfulImageFocusArea, ContentfulImageResizeBehavior, ContentfulImageSourcesOptions, ContentfulIncludeMap, ContentfulLink, ContentfulLinkType, ContentfulMetadata, ContentfulRestAsset, ContentfulSpaceLink, ContentfulSys, ContentfulTagLink, ContentfulTagLinkItem, CreateContentfulIncludeMapConfig, RichTextResponse };
|