@ethlete/contentful 4.0.0-next.0 → 4.0.0-next.10
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 +92 -0
- package/README.md +23 -4
- package/fesm2022/ethlete-contentful.mjs +800 -632
- 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 -12
- package/types/ethlete-contentful.d.ts +96 -214
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Type, InputSignal, InjectionToken, Provider } from '@angular/core';
|
|
3
3
|
import { NgClassType } from '@ethlete/core';
|
|
4
|
-
import
|
|
5
|
-
import { ComponentType } from '@angular/cdk/portal';
|
|
4
|
+
import { GQL } from '@ethlete/query';
|
|
6
5
|
import { Mark, BLOCKS, INLINES, NodeData, Block } from '@contentful/rich-text-types';
|
|
7
|
-
import * as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
6
|
+
import * as _ethlete_components from '@ethlete/components';
|
|
7
|
+
import { PictureSource } from '@ethlete/components';
|
|
8
|
+
import * as _angular_router from '@angular/router';
|
|
10
9
|
|
|
11
|
-
declare const GQL_FRAGMENT_CONTENTFUL_ASSET:
|
|
10
|
+
declare const GQL_FRAGMENT_CONTENTFUL_ASSET: GQL;
|
|
12
11
|
type ContentfulGqlAsset = {
|
|
13
12
|
sys: {
|
|
14
13
|
id: string;
|
|
@@ -86,111 +85,17 @@ type ContentfulGqlCollectionFilterVariables<TCustomWhere extends Record<string,
|
|
|
86
85
|
locale?: string;
|
|
87
86
|
};
|
|
88
87
|
|
|
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];
|
|
88
|
+
type MarkTagName = 'strong' | 'em' | 'u' | 'code' | 's' | 'sub' | 'sup';
|
|
89
|
+
/**
|
|
90
|
+
* Translates contentful text marks into the semantic html elements the marked text is
|
|
91
|
+
* wrapped in, outermost first. Unknown marks are skipped (with a dev-mode warning).
|
|
92
|
+
*/
|
|
93
|
+
declare const marksToTags: (marks: Mark[]) => MarkTagName[];
|
|
94
|
+
/**
|
|
95
|
+
* The classes marked text inside a hyperlink is rendered with, since the link component
|
|
96
|
+
* receives its text as a plain string.
|
|
97
|
+
*/
|
|
170
98
|
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
99
|
declare const ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID = "$$$_et-contentful-any-entry-content-type-sys-id";
|
|
195
100
|
type ContentfulIncludeMap = {
|
|
196
101
|
/**
|
|
@@ -236,48 +141,10 @@ type CreateContentfulIncludeMapConfig = {
|
|
|
236
141
|
*/
|
|
237
142
|
declare const createContentfulIncludeMap: (config: CreateContentfulIncludeMapConfig) => ContentfulIncludeMap;
|
|
238
143
|
declare class ContentfulRichTextRendererComponent {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
toggleClass: (element: HTMLElement, className: string, force?: boolean) => boolean;
|
|
244
|
-
setStyle: (element: HTMLElement, style: Partial<Record<keyof CSSStyleDeclaration, string | null>>, flags?: _angular_core.RendererStyleFlags2) => void;
|
|
245
|
-
removeStyle: (element: HTMLElement, ...styles: (keyof CSSStyleDeclaration)[]) => void;
|
|
246
|
-
setAttribute: (element: HTMLElement, name: string, value: string | null, namespace?: string | null) => void;
|
|
247
|
-
removeAttribute: (element: HTMLElement, ...names: string[]) => void;
|
|
248
|
-
setProperty: (element: HTMLElement, name: string, value: unknown) => void;
|
|
249
|
-
setProperties: (element: HTMLElement, properties: Record<string, unknown>) => void;
|
|
250
|
-
createElement: <K extends keyof HTMLElementTagNameMap>(tagName: K, namespace?: string | null) => HTMLElementTagNameMap[K];
|
|
251
|
-
createText: (value: string) => globalThis.Text;
|
|
252
|
-
createComment: (value: string) => Comment;
|
|
253
|
-
appendChild: (parent: HTMLElement, newChild: Node) => void;
|
|
254
|
-
insertBefore: (parent: Node, newChild: Node, refChild: Node | null) => void;
|
|
255
|
-
removeChild: (parent: Node, oldChild: Node, isHostElement?: boolean) => void;
|
|
256
|
-
selectRootElement: (selectorOrNode: string | HTMLElement, preserveContent?: boolean) => HTMLElement;
|
|
257
|
-
parentNode: (node: Node) => Node | null;
|
|
258
|
-
nextSibling: (node: Node) => Node | null;
|
|
259
|
-
setValue: (node: Node, value: string) => void;
|
|
260
|
-
listen: (target: HTMLElement | Window | Document | "window" | "document" | "body", eventName: string, callback: (event: Event) => boolean | void) => (() => void);
|
|
261
|
-
destroyNode: (node: Node) => void;
|
|
262
|
-
replaceChild: (parent: Node, newChild: Node, oldChild: Node) => void;
|
|
263
|
-
empty: (element: HTMLElement) => void;
|
|
264
|
-
setTextContent: (element: HTMLElement, text: string) => void;
|
|
265
|
-
setInnerHTML: (element: HTMLElement, html: string) => void;
|
|
266
|
-
setAttributes: (element: HTMLElement, attributes: Record<string, string | null>, namespace?: string | null) => void;
|
|
267
|
-
setDataAttributes: (element: HTMLElement, data: Record<string, string | null>) => void;
|
|
268
|
-
setCssProperty: (element: HTMLElement, name: string, value: string | null) => void;
|
|
269
|
-
setCssProperties: (element: HTMLElement, properties: Record<string, string | null>) => void;
|
|
270
|
-
renderer: _angular_core.Renderer2;
|
|
271
|
-
};
|
|
272
|
-
_elementRef: ElementRef<HTMLElement>;
|
|
273
|
-
_document: Document;
|
|
274
|
-
_config: _ethlete_contentful.ContentfulConfig;
|
|
275
|
-
/**
|
|
276
|
-
* A cache for all executed commands that are not deleted.
|
|
277
|
-
* This is used to keep track of all rendered elements and components.
|
|
278
|
-
* The key is the render command element ID.
|
|
279
|
-
*/
|
|
280
|
-
_executedCommandsCache: Map<string, ExecutedCommandCacheItem>;
|
|
144
|
+
private viewContainerRef;
|
|
145
|
+
private renderer;
|
|
146
|
+
private elementRef;
|
|
147
|
+
private config;
|
|
281
148
|
/**
|
|
282
149
|
* The contentful response gotten via their REST api.
|
|
283
150
|
* @see https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/entries/entries-collection
|
|
@@ -288,54 +155,51 @@ declare class ContentfulRichTextRendererComponent {
|
|
|
288
155
|
* @example "items[0].fields.html"
|
|
289
156
|
*/
|
|
290
157
|
richTextPath: _angular_core.InputSignal<string>;
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* The rich text data that should be rendered.
|
|
298
|
-
*/
|
|
299
|
-
richTextData: _angular_core.Signal<RichTextResponse | null>;
|
|
300
|
-
renderCommands: _angular_core.Signal<RenderCommand[]>;
|
|
301
|
-
renderCommandHistory: _angular_core.Signal<[RenderCommand[], RenderCommand[]]>;
|
|
302
|
-
previousRenderCommandMap: _angular_core.Signal<Map<string | number, RenderCommand>>;
|
|
303
|
-
renderInstructions: _angular_core.Signal<RenderInstruction[]>;
|
|
158
|
+
private readonly executedCommandsCache;
|
|
159
|
+
private contentIncludesMap;
|
|
160
|
+
private richTextData;
|
|
161
|
+
private renderCommands;
|
|
162
|
+
private renderInstructions;
|
|
304
163
|
constructor();
|
|
305
|
-
private
|
|
306
|
-
private
|
|
307
|
-
private
|
|
308
|
-
private
|
|
309
|
-
private
|
|
310
|
-
private
|
|
311
|
-
private
|
|
312
|
-
private
|
|
313
|
-
private
|
|
314
|
-
private
|
|
315
|
-
private _renderInsertOrAppend;
|
|
164
|
+
private createRenderCommands;
|
|
165
|
+
private execInstructions;
|
|
166
|
+
private runCreateInstruction;
|
|
167
|
+
private runUpdateInstruction;
|
|
168
|
+
private runMoveInstruction;
|
|
169
|
+
private runDeleteInstruction;
|
|
170
|
+
private getComponentRootNode;
|
|
171
|
+
private findParent;
|
|
172
|
+
private findFollowingElement;
|
|
173
|
+
private renderInsertOrAppend;
|
|
316
174
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentfulRichTextRendererComponent, never>;
|
|
317
175
|
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>;
|
|
318
176
|
}
|
|
319
177
|
|
|
320
178
|
declare const isRichTextRootNode: (node: unknown) => node is RichTextResponse;
|
|
321
|
-
declare const translateContentfulNodeTypeToHtmlTag: (nodeType: "text" | BLOCKS | INLINES) => "
|
|
179
|
+
declare const translateContentfulNodeTypeToHtmlTag: (nodeType: "text" | BLOCKS | INLINES) => "hr" | "blockquote" | "table" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "ul" | "ol" | "li" | "tr" | "td" | "th" | "div" | "a" | "span";
|
|
322
180
|
|
|
323
181
|
type ContentfulImageResizeBehavior = 'pad' | 'crop' | 'fill' | 'scale' | 'thumb' | 'fit';
|
|
324
182
|
type ContentfulImageFocusArea = 'top' | 'bottom' | 'left' | 'right' | 'center' | 'top_left' | 'top_right' | 'bottom_left' | 'bottom_right' | 'face' | 'faces';
|
|
325
|
-
type ComponentLikeWithAsset =
|
|
183
|
+
type ComponentLikeWithAsset = Type<{
|
|
326
184
|
asset: InputSignal<ContentfulRestAsset | ContentfulGqlAsset | null | undefined>;
|
|
327
185
|
}>;
|
|
328
|
-
type
|
|
186
|
+
type ComponentLikeWithLink = Type<{
|
|
187
|
+
href: InputSignal<string>;
|
|
188
|
+
text: InputSignal<string>;
|
|
189
|
+
textClass: InputSignal<string>;
|
|
190
|
+
}>;
|
|
191
|
+
type ComponentLikeWithContentfulRendererInputs = Type<{
|
|
329
192
|
fields?: InputSignal<any>;
|
|
330
193
|
includes?: InputSignal<ContentfulIncludeMap>;
|
|
331
194
|
metadata?: InputSignal<ContentfulMetadata>;
|
|
332
195
|
sys?: InputSignal<ContentfulEntrySys>;
|
|
333
196
|
}>;
|
|
334
197
|
type ContentfulAssetComponents = {
|
|
335
|
-
file
|
|
336
|
-
image
|
|
337
|
-
video
|
|
338
|
-
audio
|
|
198
|
+
file?: ComponentLikeWithAsset;
|
|
199
|
+
image?: ComponentLikeWithAsset;
|
|
200
|
+
video?: ComponentLikeWithAsset;
|
|
201
|
+
audio?: ComponentLikeWithAsset;
|
|
202
|
+
link?: ComponentLikeWithLink;
|
|
339
203
|
};
|
|
340
204
|
type ContentfulConfig = {
|
|
341
205
|
/**
|
|
@@ -347,9 +211,14 @@ type ContentfulConfig = {
|
|
|
347
211
|
*/
|
|
348
212
|
customComponents: Record<string, ComponentLikeWithContentfulRendererInputs>;
|
|
349
213
|
/**
|
|
350
|
-
*
|
|
214
|
+
* Additional hostnames that should be treated as internal links (in addition to the current page's host).
|
|
215
|
+
* Useful when the app runs on localhost during development but Contentful content references the production domain.
|
|
216
|
+
* A configured hostname also covers its subdomains, so adding "example.com" treats
|
|
217
|
+
* "foo.example.com" as internal without matching unrelated public-suffix siblings.
|
|
218
|
+
*
|
|
219
|
+
* @example ['example.com']
|
|
351
220
|
*/
|
|
352
|
-
|
|
221
|
+
internalHosts: string[];
|
|
353
222
|
/**
|
|
354
223
|
* Default options for the contentful image api
|
|
355
224
|
*/
|
|
@@ -359,7 +228,7 @@ type ContentfulConfig = {
|
|
|
359
228
|
* - `"400"` - 400px width
|
|
360
229
|
* - `"400x300"` - 400px width and 300px height
|
|
361
230
|
* - `"400w"` - 400px width
|
|
362
|
-
* - `"400h"` - 400px height
|
|
231
|
+
* - `"400h"` - 400px height (requires image dimensions to derive a valid width descriptor)
|
|
363
232
|
* - `"400wx300h"` - 400px width and 300px height
|
|
364
233
|
**/
|
|
365
234
|
srcsetSizes: string[];
|
|
@@ -449,9 +318,9 @@ type ContentfulEntry<T = {
|
|
|
449
318
|
metadata: ContentfulMetadata;
|
|
450
319
|
};
|
|
451
320
|
type ContentfulCollection = {
|
|
452
|
-
includes
|
|
453
|
-
Asset
|
|
454
|
-
Entry
|
|
321
|
+
includes?: {
|
|
322
|
+
Asset?: ContentfulRestAsset[];
|
|
323
|
+
Entry?: ContentfulEntry[];
|
|
455
324
|
};
|
|
456
325
|
items: ContentfulEntry[];
|
|
457
326
|
limit: number;
|
|
@@ -472,8 +341,8 @@ declare class ContentfulAudioComponent {
|
|
|
472
341
|
audioClass: _angular_core.InputSignal<NgClassType>;
|
|
473
342
|
figureClass: _angular_core.InputSignal<NgClassType>;
|
|
474
343
|
figcaptionClass: _angular_core.InputSignal<NgClassType>;
|
|
475
|
-
data: _angular_core.Signal<{
|
|
476
|
-
url: string
|
|
344
|
+
protected data: _angular_core.Signal<{
|
|
345
|
+
url: string;
|
|
477
346
|
title: string | null;
|
|
478
347
|
} | null>;
|
|
479
348
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentfulAudioComponent, never>;
|
|
@@ -483,9 +352,8 @@ declare class ContentfulAudioComponent {
|
|
|
483
352
|
declare class ContentfulFileComponent {
|
|
484
353
|
asset: _angular_core.InputSignal<ContentfulGqlAsset | ContentfulRestAsset | null | undefined>;
|
|
485
354
|
fileClass: _angular_core.InputSignal<NgClassType>;
|
|
486
|
-
data: _angular_core.Signal<{
|
|
487
|
-
url: string
|
|
488
|
-
contentType: string | null;
|
|
355
|
+
protected data: _angular_core.Signal<{
|
|
356
|
+
url: string;
|
|
489
357
|
size: number | null;
|
|
490
358
|
title: string | null;
|
|
491
359
|
} | null>;
|
|
@@ -494,29 +362,25 @@ declare class ContentfulFileComponent {
|
|
|
494
362
|
}
|
|
495
363
|
|
|
496
364
|
declare class ContentfulImageComponent {
|
|
497
|
-
|
|
365
|
+
private contentfulConfig;
|
|
498
366
|
asset: _angular_core.InputSignal<ContentfulGqlAsset | ContentfulRestAsset | null | undefined>;
|
|
499
367
|
backgroundColor: _angular_core.InputSignal<string | null>;
|
|
500
368
|
srcsetSizes: _angular_core.InputSignal<string[]>;
|
|
501
369
|
quality: _angular_core.InputSignalWithTransform<number | null, unknown>;
|
|
502
370
|
focusArea: _angular_core.InputSignal<ContentfulImageFocusArea | null>;
|
|
503
371
|
resizeBehavior: _angular_core.InputSignal<ContentfulImageResizeBehavior | null>;
|
|
504
|
-
|
|
505
|
-
imgClass: _angular_core.InputSignal<NgClassType>;
|
|
506
|
-
figureClass: _angular_core.InputSignal<NgClassType>;
|
|
507
|
-
figcaptionClass: _angular_core.InputSignal<NgClassType>;
|
|
508
|
-
pictureClass: _angular_core.InputSignal<NgClassType>;
|
|
372
|
+
priority: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
509
373
|
sizes: _angular_core.InputSignalWithTransform<string | null, string | string[] | null>;
|
|
510
|
-
normalizedAsset: _angular_core.Signal<{
|
|
374
|
+
protected normalizedAsset: _angular_core.Signal<{
|
|
511
375
|
alt: string | null;
|
|
512
376
|
figcaption: string | null;
|
|
513
377
|
width: number | null;
|
|
514
378
|
height: number | null;
|
|
515
379
|
}>;
|
|
516
|
-
|
|
517
|
-
|
|
380
|
+
protected sourcesValue: _angular_core.Signal<_ethlete_components.PictureSource[]>;
|
|
381
|
+
protected defaultSrcValue: _angular_core.Signal<_ethlete_components.PictureSource | null>;
|
|
518
382
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentfulImageComponent, never>;
|
|
519
|
-
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; }; "
|
|
383
|
+
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>;
|
|
520
384
|
}
|
|
521
385
|
|
|
522
386
|
declare const generateDefaultContentfulImageSource: (data: ContentfulRestAsset | ContentfulGqlAsset) => PictureSource;
|
|
@@ -534,11 +398,27 @@ declare const parseContentfulImageSize: (size: string) => {
|
|
|
534
398
|
};
|
|
535
399
|
declare const generateContentfulImageSources: (data: ContentfulRestAsset | ContentfulGqlAsset, srcsetSizes: string[], backgroundColor: string | null, quality: number | null, focusArea: ContentfulImageFocusArea | null, resizeBehavior: ContentfulImageResizeBehavior | null) => PictureSource[];
|
|
536
400
|
|
|
401
|
+
declare class ContentfulLinkComponent {
|
|
402
|
+
private document;
|
|
403
|
+
private router;
|
|
404
|
+
private config;
|
|
405
|
+
href: _angular_core.InputSignal<string>;
|
|
406
|
+
text: _angular_core.InputSignal<string>;
|
|
407
|
+
textClass: _angular_core.InputSignal<string>;
|
|
408
|
+
protected usesRouterLink: _angular_core.Signal<boolean>;
|
|
409
|
+
protected openInNewTab: _angular_core.Signal<boolean>;
|
|
410
|
+
protected internalPath: _angular_core.Signal<string>;
|
|
411
|
+
protected internalUrlTree: _angular_core.Signal<_angular_router.UrlTree>;
|
|
412
|
+
protected linkClass: _angular_core.Signal<string>;
|
|
413
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentfulLinkComponent, never>;
|
|
414
|
+
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>;
|
|
415
|
+
}
|
|
416
|
+
|
|
537
417
|
declare class ContentfulVideoComponent {
|
|
538
418
|
asset: _angular_core.InputSignal<ContentfulGqlAsset | ContentfulRestAsset | null | undefined>;
|
|
539
419
|
videoClass: _angular_core.InputSignal<NgClassType>;
|
|
540
|
-
data: _angular_core.Signal<{
|
|
541
|
-
url: string
|
|
420
|
+
protected data: _angular_core.Signal<{
|
|
421
|
+
url: string;
|
|
542
422
|
contentType: string | null;
|
|
543
423
|
} | null>;
|
|
544
424
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentfulVideoComponent, never>;
|
|
@@ -549,13 +429,15 @@ declare const CONTENTFUL_CONFIG: InjectionToken<ContentfulConfig>;
|
|
|
549
429
|
|
|
550
430
|
declare const ContentfulImports: readonly [typeof ContentfulAudioComponent, typeof ContentfulFileComponent, typeof ContentfulImageComponent, typeof ContentfulVideoComponent, typeof ContentfulRichTextRendererComponent];
|
|
551
431
|
|
|
552
|
-
declare const createContentfulConfig: (config?: Partial<ContentfulConfig> | null
|
|
432
|
+
declare const createContentfulConfig: (config?: Partial<ContentfulConfig> | null) => ContentfulConfig;
|
|
433
|
+
/**
|
|
434
|
+
* Reads the contentful config from the current injector. Falls back to a config without
|
|
435
|
+
* any `components` when none was provided via `provideContentfulConfig()`.
|
|
436
|
+
*/
|
|
437
|
+
declare const injectContentfulConfig: () => ContentfulConfig;
|
|
553
438
|
|
|
554
|
-
declare const provideContentfulConfig: (contentfulConfig?: Partial<ContentfulConfig> | null
|
|
555
|
-
provide: _angular_core.InjectionToken<ContentfulConfig>;
|
|
556
|
-
useValue: ContentfulConfig;
|
|
557
|
-
};
|
|
439
|
+
declare const provideContentfulConfig: (contentfulConfig?: Partial<ContentfulConfig> | null) => Provider;
|
|
558
440
|
declare const isContentfulEntryType: <T extends ContentfulEntry>(entry: ContentfulEntry, type: string) => entry is T;
|
|
559
441
|
|
|
560
|
-
export {
|
|
561
|
-
export type { ComponentLikeWithAsset, ComponentLikeWithContentfulRendererInputs, 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 };
|
|
442
|
+
export { CONTENTFUL_CONFIG, ContentfulAudioComponent, ContentfulFileComponent, ContentfulImageComponent, ContentfulImports, ContentfulLinkComponent, ContentfulRichTextRendererComponent, ContentfulVideoComponent, ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID, GQL_FRAGMENT_CONTENTFUL_ASSET, createContentfulConfig, createContentfulIncludeMap, generateContentfulImageSources, generateDefaultContentfulImageSource, injectContentfulConfig, isContentfulEntryType, isContentfulGqlAsset, isRichTextRootNode, marksToClass, marksToTags, parseContentfulImageSize, provideContentfulConfig, translateContentfulNodeTypeToHtmlTag };
|
|
443
|
+
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 };
|