@ethlete/contentful 4.0.0-next.5 → 4.0.0-next.7
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 +33 -0
- package/README.md +23 -4
- package/fesm2022/ethlete-contentful.mjs +481 -491
- package/fesm2022/ethlete-contentful.mjs.map +1 -1
- package/generators/generators.json +9 -0
- package/generators/migrate-to-contentful-v5/migration-scope.js +35 -0
- package/generators/migrate-to-contentful-v5/migration.js +192 -0
- package/generators/migrate-to-contentful-v5/schema.json +26 -0
- package/package.json +20 -10
- package/types/ethlete-contentful.d.ts +93 -194
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Type, InputSignal, InjectionToken } 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 { PictureSource } from '@ethlete/cdk';
|
|
6
|
+
import * as _ethlete_components from '@ethlete/components';
|
|
7
|
+
import { PictureSource } from '@ethlete/components';
|
|
10
8
|
|
|
11
|
-
declare const GQL_FRAGMENT_CONTENTFUL_ASSET:
|
|
9
|
+
declare const GQL_FRAGMENT_CONTENTFUL_ASSET: GQL;
|
|
12
10
|
type ContentfulGqlAsset = {
|
|
13
11
|
sys: {
|
|
14
12
|
id: string;
|
|
@@ -86,111 +84,54 @@ type ContentfulGqlCollectionFilterVariables<TCustomWhere extends Record<string,
|
|
|
86
84
|
locale?: string;
|
|
87
85
|
};
|
|
88
86
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
readonly NESTING_LEVEL: 1;
|
|
98
|
-
readonly DOM_POSITION: 2;
|
|
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;
|
|
87
|
+
type HtmlOpenRenderCommand = {
|
|
88
|
+
kind: 'htmlOpen';
|
|
89
|
+
nestingLevel: number;
|
|
90
|
+
domPosition: number;
|
|
91
|
+
index: number;
|
|
92
|
+
attributes: Record<string, string>;
|
|
93
|
+
tagName: keyof HTMLElementTagNameMap;
|
|
94
|
+
id: string;
|
|
105
95
|
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
96
|
+
type HtmlCloseRenderCommand = {
|
|
97
|
+
kind: 'htmlClose';
|
|
98
|
+
nestingLevel: number;
|
|
99
|
+
domPosition: number;
|
|
100
|
+
index: number;
|
|
101
|
+
tagName: keyof HTMLElementTagNameMap;
|
|
102
|
+
id: string;
|
|
109
103
|
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
104
|
+
type TextRenderCommand = {
|
|
105
|
+
kind: 'text';
|
|
106
|
+
nestingLevel: number;
|
|
107
|
+
domPosition: number;
|
|
108
|
+
index: number;
|
|
109
|
+
attributes: Record<string, string>;
|
|
110
|
+
markTags: MarkTagName[];
|
|
111
|
+
text: string;
|
|
112
|
+
id: string;
|
|
114
113
|
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
114
|
+
type ComponentRenderCommand = {
|
|
115
|
+
kind: 'component';
|
|
116
|
+
nestingLevel: number;
|
|
117
|
+
domPosition: number;
|
|
118
|
+
index: number;
|
|
119
|
+
component: Type<unknown>;
|
|
120
|
+
inputs: Record<string, unknown>;
|
|
121
|
+
id: string;
|
|
120
122
|
};
|
|
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
123
|
type RenderCommand = HtmlOpenRenderCommand | HtmlCloseRenderCommand | TextRenderCommand | ComponentRenderCommand;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
type RenderInstructionTypeValue = (typeof RENDER_INSTRUCTION_TYPE)[keyof typeof RENDER_INSTRUCTION_TYPE];
|
|
169
|
-
type RenderInstruction = [RenderInstructionTypeValue, RenderCommand];
|
|
124
|
+
type MarkTagName = 'strong' | 'em' | 'u' | 'code' | 's' | 'sub' | 'sup';
|
|
125
|
+
/**
|
|
126
|
+
* Translates contentful text marks into the semantic html elements the marked text is
|
|
127
|
+
* wrapped in, outermost first. Unknown marks are skipped (with a dev-mode warning).
|
|
128
|
+
*/
|
|
129
|
+
declare const marksToTags: (marks: Mark[]) => MarkTagName[];
|
|
130
|
+
/**
|
|
131
|
+
* The classes marked text inside a hyperlink is rendered with, since the link component
|
|
132
|
+
* receives its text as a plain string.
|
|
133
|
+
*/
|
|
170
134
|
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
135
|
declare const ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID = "$$$_et-contentful-any-entry-content-type-sys-id";
|
|
195
136
|
type ContentfulIncludeMap = {
|
|
196
137
|
/**
|
|
@@ -236,54 +177,10 @@ type CreateContentfulIncludeMapConfig = {
|
|
|
236
177
|
*/
|
|
237
178
|
declare const createContentfulIncludeMap: (config: CreateContentfulIncludeMapConfig) => ContentfulIncludeMap;
|
|
238
179
|
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, 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
|
-
moveBefore: (config: {
|
|
272
|
-
newParent: HTMLElement;
|
|
273
|
-
child: HTMLElement;
|
|
274
|
-
before?: Node | null;
|
|
275
|
-
}) => void;
|
|
276
|
-
renderer: _angular_core.Renderer2;
|
|
277
|
-
};
|
|
278
|
-
_elementRef: ElementRef<HTMLElement>;
|
|
279
|
-
_document: Document;
|
|
280
|
-
_config: _ethlete_contentful.ContentfulConfig;
|
|
281
|
-
/**
|
|
282
|
-
* A cache for all executed commands that are not deleted.
|
|
283
|
-
* This is used to keep track of all rendered elements and components.
|
|
284
|
-
* The key is the render command element ID.
|
|
285
|
-
*/
|
|
286
|
-
_executedCommandsCache: Map<string, ExecutedCommandCacheItem>;
|
|
180
|
+
private viewContainerRef;
|
|
181
|
+
private readonly renderer;
|
|
182
|
+
private elementRef;
|
|
183
|
+
private readonly config;
|
|
287
184
|
/**
|
|
288
185
|
* The contentful response gotten via their REST api.
|
|
289
186
|
* @see https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/entries/entries-collection
|
|
@@ -294,6 +191,12 @@ declare class ContentfulRichTextRendererComponent {
|
|
|
294
191
|
* @example "items[0].fields.html"
|
|
295
192
|
*/
|
|
296
193
|
richTextPath: _angular_core.InputSignal<string>;
|
|
194
|
+
/**
|
|
195
|
+
* A cache for all executed commands that are not deleted.
|
|
196
|
+
* This is used to keep track of all rendered elements and components.
|
|
197
|
+
* The key is the render command ID.
|
|
198
|
+
*/
|
|
199
|
+
private readonly executedCommandsCache;
|
|
297
200
|
/**
|
|
298
201
|
* A map of all includes in the contentful response.
|
|
299
202
|
* This is useful for looking up assets and entries that are referenced in the rich text without having to use loops.
|
|
@@ -304,50 +207,49 @@ declare class ContentfulRichTextRendererComponent {
|
|
|
304
207
|
*/
|
|
305
208
|
richTextData: _angular_core.Signal<RichTextResponse | null>;
|
|
306
209
|
renderCommands: _angular_core.Signal<RenderCommand[]>;
|
|
307
|
-
renderCommandHistory
|
|
308
|
-
previousRenderCommandMap
|
|
309
|
-
renderInstructions
|
|
210
|
+
private renderCommandHistory;
|
|
211
|
+
private previousRenderCommandMap;
|
|
212
|
+
private renderInstructions;
|
|
310
213
|
constructor();
|
|
311
|
-
private
|
|
312
|
-
private
|
|
313
|
-
private
|
|
314
|
-
private
|
|
315
|
-
private
|
|
316
|
-
private
|
|
317
|
-
private
|
|
318
|
-
private
|
|
319
|
-
private
|
|
320
|
-
private
|
|
321
|
-
private _renderInsertOrAppend;
|
|
214
|
+
private createRenderCommands;
|
|
215
|
+
private execInstructions;
|
|
216
|
+
private runCreateInstruction;
|
|
217
|
+
private runUpdateInstruction;
|
|
218
|
+
private runMoveInstruction;
|
|
219
|
+
private runDeleteInstruction;
|
|
220
|
+
private getComponentRootNode;
|
|
221
|
+
private findParent;
|
|
222
|
+
private findFollowingElement;
|
|
223
|
+
private renderInsertOrAppend;
|
|
322
224
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentfulRichTextRendererComponent, never>;
|
|
323
225
|
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>;
|
|
324
226
|
}
|
|
325
227
|
|
|
326
228
|
declare const isRichTextRootNode: (node: unknown) => node is RichTextResponse;
|
|
327
|
-
declare const translateContentfulNodeTypeToHtmlTag: (nodeType: "text" | BLOCKS | INLINES) => "
|
|
229
|
+
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";
|
|
328
230
|
|
|
329
231
|
type ContentfulImageResizeBehavior = 'pad' | 'crop' | 'fill' | 'scale' | 'thumb' | 'fit';
|
|
330
232
|
type ContentfulImageFocusArea = 'top' | 'bottom' | 'left' | 'right' | 'center' | 'top_left' | 'top_right' | 'bottom_left' | 'bottom_right' | 'face' | 'faces';
|
|
331
|
-
type ComponentLikeWithAsset =
|
|
233
|
+
type ComponentLikeWithAsset = Type<{
|
|
332
234
|
asset: InputSignal<ContentfulRestAsset | ContentfulGqlAsset | null | undefined>;
|
|
333
235
|
}>;
|
|
334
|
-
type ComponentLikeWithLink =
|
|
236
|
+
type ComponentLikeWithLink = Type<{
|
|
335
237
|
href: InputSignal<string>;
|
|
336
238
|
text: InputSignal<string>;
|
|
337
239
|
textClass: InputSignal<string>;
|
|
338
240
|
}>;
|
|
339
|
-
type ComponentLikeWithContentfulRendererInputs =
|
|
241
|
+
type ComponentLikeWithContentfulRendererInputs = Type<{
|
|
340
242
|
fields?: InputSignal<any>;
|
|
341
243
|
includes?: InputSignal<ContentfulIncludeMap>;
|
|
342
244
|
metadata?: InputSignal<ContentfulMetadata>;
|
|
343
245
|
sys?: InputSignal<ContentfulEntrySys>;
|
|
344
246
|
}>;
|
|
345
247
|
type ContentfulAssetComponents = {
|
|
346
|
-
file
|
|
347
|
-
image
|
|
348
|
-
video
|
|
349
|
-
audio
|
|
350
|
-
link
|
|
248
|
+
file?: ComponentLikeWithAsset;
|
|
249
|
+
image?: ComponentLikeWithAsset;
|
|
250
|
+
video?: ComponentLikeWithAsset;
|
|
251
|
+
audio?: ComponentLikeWithAsset;
|
|
252
|
+
link?: ComponentLikeWithLink;
|
|
351
253
|
};
|
|
352
254
|
type ContentfulConfig = {
|
|
353
255
|
/**
|
|
@@ -358,10 +260,6 @@ type ContentfulConfig = {
|
|
|
358
260
|
* Component for rendering embedded entries
|
|
359
261
|
*/
|
|
360
262
|
customComponents: Record<string, ComponentLikeWithContentfulRendererInputs>;
|
|
361
|
-
/**
|
|
362
|
-
* Determines if the contentful rich text renderer should render the contentful rich text with tailwind css classes
|
|
363
|
-
*/
|
|
364
|
-
useTailwindClasses: boolean;
|
|
365
263
|
/**
|
|
366
264
|
* Additional hostnames that should be treated as internal links (in addition to the current page's host).
|
|
367
265
|
* Useful when the app runs on localhost during development but Contentful content references the production domain.
|
|
@@ -515,29 +413,25 @@ declare class ContentfulFileComponent {
|
|
|
515
413
|
}
|
|
516
414
|
|
|
517
415
|
declare class ContentfulImageComponent {
|
|
518
|
-
|
|
416
|
+
private contentfulConfig;
|
|
519
417
|
asset: _angular_core.InputSignal<ContentfulGqlAsset | ContentfulRestAsset | null | undefined>;
|
|
520
418
|
backgroundColor: _angular_core.InputSignal<string | null>;
|
|
521
419
|
srcsetSizes: _angular_core.InputSignal<string[]>;
|
|
522
420
|
quality: _angular_core.InputSignalWithTransform<number | null, unknown>;
|
|
523
421
|
focusArea: _angular_core.InputSignal<ContentfulImageFocusArea | null>;
|
|
524
422
|
resizeBehavior: _angular_core.InputSignal<ContentfulImageResizeBehavior | null>;
|
|
525
|
-
|
|
526
|
-
imgClass: _angular_core.InputSignal<NgClassType>;
|
|
527
|
-
figureClass: _angular_core.InputSignal<NgClassType>;
|
|
528
|
-
figcaptionClass: _angular_core.InputSignal<NgClassType>;
|
|
529
|
-
pictureClass: _angular_core.InputSignal<NgClassType>;
|
|
423
|
+
priority: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
530
424
|
sizes: _angular_core.InputSignalWithTransform<string | null, string | string[] | null>;
|
|
531
|
-
normalizedAsset: _angular_core.Signal<{
|
|
425
|
+
protected normalizedAsset: _angular_core.Signal<{
|
|
532
426
|
alt: string | null;
|
|
533
427
|
figcaption: string | null;
|
|
534
428
|
width: number | null;
|
|
535
429
|
height: number | null;
|
|
536
430
|
}>;
|
|
537
|
-
|
|
538
|
-
|
|
431
|
+
protected sourcesValue: _angular_core.Signal<_ethlete_components.PictureSource[]>;
|
|
432
|
+
protected defaultSrcValue: _angular_core.Signal<_ethlete_components.PictureSource | null>;
|
|
539
433
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentfulImageComponent, never>;
|
|
540
|
-
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; }; "
|
|
434
|
+
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>;
|
|
541
435
|
}
|
|
542
436
|
|
|
543
437
|
declare const generateDefaultContentfulImageSource: (data: ContentfulRestAsset | ContentfulGqlAsset) => PictureSource;
|
|
@@ -556,8 +450,8 @@ declare const parseContentfulImageSize: (size: string) => {
|
|
|
556
450
|
declare const generateContentfulImageSources: (data: ContentfulRestAsset | ContentfulGqlAsset, srcsetSizes: string[], backgroundColor: string | null, quality: number | null, focusArea: ContentfulImageFocusArea | null, resizeBehavior: ContentfulImageResizeBehavior | null) => PictureSource[];
|
|
557
451
|
|
|
558
452
|
declare class ContentfulLinkComponent {
|
|
559
|
-
private
|
|
560
|
-
private readonly
|
|
453
|
+
private document;
|
|
454
|
+
private readonly config;
|
|
561
455
|
href: _angular_core.InputSignal<string>;
|
|
562
456
|
text: _angular_core.InputSignal<string>;
|
|
563
457
|
textClass: _angular_core.InputSignal<string>;
|
|
@@ -585,6 +479,11 @@ declare const CONTENTFUL_CONFIG: InjectionToken<ContentfulConfig>;
|
|
|
585
479
|
declare const ContentfulImports: readonly [typeof ContentfulAudioComponent, typeof ContentfulFileComponent, typeof ContentfulImageComponent, typeof ContentfulVideoComponent, typeof ContentfulRichTextRendererComponent];
|
|
586
480
|
|
|
587
481
|
declare const createContentfulConfig: (config?: Partial<ContentfulConfig> | null | undefined) => ContentfulConfig;
|
|
482
|
+
/**
|
|
483
|
+
* Reads the contentful config from the current injector. Falls back to a config without
|
|
484
|
+
* any `components` when none was provided via `provideContentfulConfig()`.
|
|
485
|
+
*/
|
|
486
|
+
declare const injectContentfulConfig: () => ContentfulConfig;
|
|
588
487
|
|
|
589
488
|
declare const provideContentfulConfig: (contentfulConfig?: Partial<ContentfulConfig> | null | undefined) => {
|
|
590
489
|
provide: _angular_core.InjectionToken<ContentfulConfig>;
|
|
@@ -592,5 +491,5 @@ declare const provideContentfulConfig: (contentfulConfig?: Partial<ContentfulCon
|
|
|
592
491
|
};
|
|
593
492
|
declare const isContentfulEntryType: <T extends ContentfulEntry>(entry: ContentfulEntry, type: string) => entry is T;
|
|
594
493
|
|
|
595
|
-
export {
|
|
494
|
+
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 };
|
|
596
495
|
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 };
|