lynkow 3.8.77 → 3.8.78
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/README.md +5 -5
- package/dist/index.d.mts +48 -34
- package/dist/index.d.ts +48 -34
- package/dist/index.js +62 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +62 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Official TypeScript SDK for [Lynkow](https://lynkow.com) Headless CMS.
|
|
|
11
11
|
- **Framework-agnostic** - Works with Next.js, Nuxt, Astro, SvelteKit, etc.
|
|
12
12
|
- **Tree-shakeable** - Only import what you need
|
|
13
13
|
- **Isomorphic** - Works on both browser and server (Node.js, Deno, Bun)
|
|
14
|
-
- **Image Transformations** -
|
|
14
|
+
- **Image Transformations** - Lynkow CDN srcset and responsive image helpers
|
|
15
15
|
- **Built-in Analytics** - Page views, events, and funnel tracking
|
|
16
16
|
- **Cookie Consent** - GDPR-compliant consent banner with preferences
|
|
17
17
|
- **Spam protection** - Built-in honeypot fields for form submissions
|
|
@@ -350,12 +350,12 @@ if (redirect) {
|
|
|
350
350
|
|
|
351
351
|
### Media (Image Transformations)
|
|
352
352
|
|
|
353
|
-
Build optimized image URLs
|
|
353
|
+
Build optimized image URLs backed by the Lynkow image transformation service.
|
|
354
354
|
|
|
355
355
|
```typescript
|
|
356
356
|
// Build a srcset for responsive images
|
|
357
357
|
const srcset = lynkow.media.srcset(content.featuredImage)
|
|
358
|
-
// => "https://cdn.../
|
|
358
|
+
// => "https://cdn.../image/w=400,.../photo.jpg 400w, ...800w, ...1200w, ...1920w"
|
|
359
359
|
|
|
360
360
|
// Custom widths and options
|
|
361
361
|
const srcset = lynkow.media.srcset(content.featuredImage, {
|
|
@@ -399,7 +399,7 @@ The API automatically includes pre-computed image variants:
|
|
|
399
399
|
|
|
400
400
|
| Field | Available on | Presets |
|
|
401
401
|
|-------|-------------|---------|
|
|
402
|
-
| `featuredImageVariants` | Content | `thumbnail`, `card`, `hero`, `og` |
|
|
402
|
+
| `featuredImageVariants` | Content | `thumbnail`, `card`, `medium`, `content`, `hero`, `og` |
|
|
403
403
|
| `ogImageVariants` | Content | `og` |
|
|
404
404
|
| `imageVariants` | Category | `thumbnail`, `card`, `og` |
|
|
405
405
|
|
|
@@ -1137,7 +1137,7 @@ import type {
|
|
|
1137
1137
|
|
|
1138
1138
|
### New in v3.7
|
|
1139
1139
|
|
|
1140
|
-
- **Image Transformations**: New `lynkow.media` service with `srcset()` and `transform()` helpers
|
|
1140
|
+
- **Image Transformations**: New `lynkow.media` service with `srcset()` and `transform()` helpers backed by the Lynkow image transformation service
|
|
1141
1141
|
- **ImageVariants type**: API responses now include pre-computed `featuredImageVariants`, `ogImageVariants`, and `imageVariants` fields
|
|
1142
1142
|
- **Body HTML srcset**: Content body images automatically include `srcset`, `loading="lazy"`, and `decoding="async"` attributes
|
|
1143
1143
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1515,15 +1515,16 @@ interface SearchOptions extends BaseRequestOptions {
|
|
|
1515
1515
|
*/
|
|
1516
1516
|
interface SearchConfig {
|
|
1517
1517
|
/**
|
|
1518
|
-
* Public search
|
|
1519
|
-
*
|
|
1520
|
-
* browser
|
|
1518
|
+
* Public Lynkow search host URL (e.g. `'https://search.lynkow.com'`).
|
|
1519
|
+
* Pass verbatim as the `host` when instantiating a search client in
|
|
1520
|
+
* the browser (for example the `meilisearch-js` npm package, which
|
|
1521
|
+
* speaks the same protocol). Does not include a trailing slash.
|
|
1521
1522
|
*/
|
|
1522
1523
|
host: string;
|
|
1523
1524
|
/** Short-lived tenant token (JWT, 1-hour expiry) scoped to your site's index */
|
|
1524
1525
|
apiKey: string;
|
|
1525
1526
|
/**
|
|
1526
|
-
*
|
|
1527
|
+
* Lynkow search index name for this site, of the form
|
|
1527
1528
|
* `site-<siteId>_<locale>` or `site-<siteId>` for single-locale sites.
|
|
1528
1529
|
* Pass verbatim as the `index` parameter in browser search queries.
|
|
1529
1530
|
*/
|
|
@@ -1784,12 +1785,18 @@ interface LynkowClient {
|
|
|
1784
1785
|
}
|
|
1785
1786
|
|
|
1786
1787
|
/**
|
|
1787
|
-
* CDN image variant URLs generated by
|
|
1788
|
+
* CDN image variant URLs generated by the Lynkow image transformation service.
|
|
1788
1789
|
*
|
|
1789
1790
|
* Each property is a pre-generated URL for a specific size/crop preset.
|
|
1790
|
-
* All URLs
|
|
1791
|
-
* via the `Accept` header.
|
|
1792
|
-
*
|
|
1791
|
+
* All URLs are served through the Lynkow CDN and support WebP/AVIF
|
|
1792
|
+
* auto-negotiation via the `Accept` header. A property is `undefined` only
|
|
1793
|
+
* when the endpoint returning this object excludes that preset from its
|
|
1794
|
+
* response (e.g. category images omit `medium`/`content`). For featured
|
|
1795
|
+
* images on content and pages, the six variants `thumbnail`, `card`,
|
|
1796
|
+
* `medium`, `content`, `hero`, and `og` are always present. The CDN uses
|
|
1797
|
+
* a `scale-down` fit that preserves the original size when the source
|
|
1798
|
+
* image is smaller than the target preset, so every URL is safe to use
|
|
1799
|
+
* in `src` or `srcset` regardless of the source dimensions.
|
|
1793
1800
|
*
|
|
1794
1801
|
* Use the smallest variant that fits your layout to minimize bandwidth.
|
|
1795
1802
|
*
|
|
@@ -1807,52 +1814,48 @@ interface ImageVariants {
|
|
|
1807
1814
|
/**
|
|
1808
1815
|
* 400x300px, cover crop with sharpening.
|
|
1809
1816
|
* Use case: list views, grid thumbnails, small cards.
|
|
1810
|
-
* `undefined` when the original image is smaller than 400x300.
|
|
1811
1817
|
*/
|
|
1812
1818
|
thumbnail?: string;
|
|
1813
1819
|
/**
|
|
1814
1820
|
* 600x400px, cover crop.
|
|
1815
1821
|
* Use case: card layouts, blog post previews, medium-sized list items.
|
|
1816
|
-
* `undefined` when the original image is smaller than 600x400.
|
|
1817
1822
|
*/
|
|
1818
1823
|
card?: string;
|
|
1819
1824
|
/**
|
|
1820
1825
|
* 1200px wide, scaled down proportionally (no crop).
|
|
1821
1826
|
* Use case: inline images within article body content.
|
|
1822
|
-
*
|
|
1827
|
+
* Serves the source at its native size when the original is narrower than 1200px.
|
|
1823
1828
|
*/
|
|
1824
1829
|
content?: string;
|
|
1825
1830
|
/**
|
|
1826
1831
|
* 960px wide, scaled down proportionally (no crop).
|
|
1827
1832
|
* Use case: medium-width displays, sidebar featured images, tablet layouts.
|
|
1828
|
-
*
|
|
1833
|
+
* Serves the source at its native size when the original is narrower than 960px.
|
|
1829
1834
|
*/
|
|
1830
1835
|
medium?: string;
|
|
1831
1836
|
/**
|
|
1832
1837
|
* 1920px wide, scaled down proportionally (no crop).
|
|
1833
1838
|
* Use case: full-width hero banners, page headers, background images.
|
|
1834
|
-
*
|
|
1839
|
+
* Serves the source at its native size when the original is narrower than 1920px.
|
|
1835
1840
|
*/
|
|
1836
1841
|
hero?: string;
|
|
1837
1842
|
/**
|
|
1838
1843
|
* 1200x630px, cover crop.
|
|
1839
1844
|
* Use case: Open Graph images, social media sharing (Facebook, LinkedIn, Twitter).
|
|
1840
1845
|
* Dimensions follow the recommended OG image ratio (1.91:1).
|
|
1841
|
-
* `undefined` when the original image is smaller than 1200x630.
|
|
1842
1846
|
*/
|
|
1843
1847
|
og?: string;
|
|
1844
1848
|
/**
|
|
1845
1849
|
* 128x128px, cover crop with face detection gravity.
|
|
1846
1850
|
* Use case: user avatars, author photos, profile pictures.
|
|
1847
1851
|
* Face detection ensures faces are centered in the crop.
|
|
1848
|
-
* `undefined` when the original image is smaller than 128x128.
|
|
1849
1852
|
*/
|
|
1850
1853
|
avatar?: string;
|
|
1851
1854
|
/**
|
|
1852
1855
|
* 2560px wide, scaled down proportionally (no crop).
|
|
1853
1856
|
* Use case: full-resolution display, lightbox/zoom views, retina hero images.
|
|
1854
|
-
* This is the largest available variant.
|
|
1855
|
-
*
|
|
1857
|
+
* This is the largest available variant. Serves the source at its native size
|
|
1858
|
+
* when the original is narrower than 2560px.
|
|
1856
1859
|
*/
|
|
1857
1860
|
full?: string;
|
|
1858
1861
|
}
|
|
@@ -2536,7 +2539,7 @@ interface Author {
|
|
|
2536
2539
|
fullName: string;
|
|
2537
2540
|
/**
|
|
2538
2541
|
* Absolute URL to the author's avatar image, or `null` if no avatar is set.
|
|
2539
|
-
* When available, points to
|
|
2542
|
+
* When available, points to an image hosted on the Lynkow CDN.
|
|
2540
2543
|
* Use `ImageVariants.avatar` (128x128) for optimized display if available elsewhere.
|
|
2541
2544
|
*/
|
|
2542
2545
|
avatarUrl: string | null;
|
|
@@ -2852,7 +2855,7 @@ interface SeoImage {
|
|
|
2852
2855
|
id: string;
|
|
2853
2856
|
/**
|
|
2854
2857
|
* Absolute URL to the image file.
|
|
2855
|
-
* Points to
|
|
2858
|
+
* Points to an image hosted on the Lynkow CDN. Recommended size: 1200x630px for Open Graph.
|
|
2856
2859
|
* Use this directly in `<meta property="og:image">` or `<meta name="twitter:image">` tags.
|
|
2857
2860
|
*/
|
|
2858
2861
|
url: string;
|
|
@@ -4056,6 +4059,16 @@ interface CookieConfig {
|
|
|
4056
4059
|
* When `false`, only "Accept All" and "Reject All" buttons are shown.
|
|
4057
4060
|
*/
|
|
4058
4061
|
showCustomizeButton?: boolean;
|
|
4062
|
+
/**
|
|
4063
|
+
* Banner layout orientation.
|
|
4064
|
+
* - `'auto'` (default): row layout on screens at least 600px wide,
|
|
4065
|
+
* automatically stacked into a column under 600px.
|
|
4066
|
+
* - `'column'`: forced column layout at every screen size.
|
|
4067
|
+
*
|
|
4068
|
+
* In every mode the banner is height-capped to the viewport with internal
|
|
4069
|
+
* scrolling, so it never overflows the screen.
|
|
4070
|
+
*/
|
|
4071
|
+
orientation?: 'auto' | 'column';
|
|
4059
4072
|
/**
|
|
4060
4073
|
* Per-theme color overrides for light and dark modes.
|
|
4061
4074
|
* Only relevant when {@link theme} is `'auto'`.
|
|
@@ -5522,6 +5535,7 @@ declare class ConsentService {
|
|
|
5522
5535
|
private resolveTheme;
|
|
5523
5536
|
private resolveColors;
|
|
5524
5537
|
private contrastColor;
|
|
5538
|
+
private injectBannerStylesOnce;
|
|
5525
5539
|
private createBannerHTML;
|
|
5526
5540
|
private createPreferencesHTML;
|
|
5527
5541
|
private attachBannerEvents;
|
|
@@ -5781,11 +5795,11 @@ interface SrcsetOptions {
|
|
|
5781
5795
|
*/
|
|
5782
5796
|
widths?: number[];
|
|
5783
5797
|
/**
|
|
5784
|
-
*
|
|
5785
|
-
*
|
|
5786
|
-
*
|
|
5787
|
-
*
|
|
5788
|
-
*
|
|
5798
|
+
* Resize fit mode. `'scale-down'` (default) preserves aspect ratio and
|
|
5799
|
+
* never upscales; `'cover'` fills the box and crops; `'contain'` fits
|
|
5800
|
+
* inside the box with letterboxing; `'crop'` hard crops to the exact
|
|
5801
|
+
* dimensions. Must pair with `gravity` for `'cover'` / `'crop'` when
|
|
5802
|
+
* the subject is not centered.
|
|
5789
5803
|
*/
|
|
5790
5804
|
fit?: 'cover' | 'contain' | 'scale-down' | 'crop';
|
|
5791
5805
|
/**
|
|
@@ -5802,9 +5816,9 @@ interface SrcsetOptions {
|
|
|
5802
5816
|
gravity?: string;
|
|
5803
5817
|
}
|
|
5804
5818
|
/**
|
|
5805
|
-
* Options for building a single transformed URL.
|
|
5806
|
-
*
|
|
5807
|
-
* choose a sensible default.
|
|
5819
|
+
* Options for building a single transformed URL. Each field maps to a
|
|
5820
|
+
* query parameter understood by the Lynkow image transformation service;
|
|
5821
|
+
* omit any value to let the CDN choose a sensible default.
|
|
5808
5822
|
*/
|
|
5809
5823
|
interface TransformOptions {
|
|
5810
5824
|
/**
|
|
@@ -5843,13 +5857,13 @@ interface TransformOptions {
|
|
|
5843
5857
|
dpr?: number;
|
|
5844
5858
|
}
|
|
5845
5859
|
/**
|
|
5846
|
-
* Service for building optimized image URLs
|
|
5860
|
+
* Service for building optimized image URLs backed by the Lynkow image
|
|
5861
|
+
* transformation service.
|
|
5847
5862
|
*
|
|
5848
5863
|
* Accessible via `lynkow.media`. This is a pure utility service (no API calls, no
|
|
5849
|
-
* caching) that constructs
|
|
5864
|
+
* caching) that constructs CDN transformation URLs from Lynkow media URLs.
|
|
5850
5865
|
* Works on both server and browser. Handles both original URLs (`/sites/...`) and
|
|
5851
|
-
* already-transformed URLs
|
|
5852
|
-
* when needed.
|
|
5866
|
+
* already-transformed URLs, re-extracting the original path when needed.
|
|
5853
5867
|
*
|
|
5854
5868
|
* @example
|
|
5855
5869
|
* ```typescript
|
|
@@ -5867,7 +5881,7 @@ declare class MediaHelperService {
|
|
|
5867
5881
|
/**
|
|
5868
5882
|
* Generates an HTML `srcset` attribute value from a Lynkow image URL, suitable
|
|
5869
5883
|
* for use in an `<img srcset="...">` or `<source srcset="...">` tag. Produces
|
|
5870
|
-
* one
|
|
5884
|
+
* one Lynkow CDN transformation URL per width breakpoint.
|
|
5871
5885
|
*
|
|
5872
5886
|
* @param imageUrl - Original image URL from the Lynkow API (e.g. `content.featuredImage`).
|
|
5873
5887
|
* Accepts `null` or `undefined` safely (returns empty string).
|
|
@@ -5892,7 +5906,7 @@ declare class MediaHelperService {
|
|
|
5892
5906
|
*/
|
|
5893
5907
|
srcset(imageUrl: string | null | undefined, options?: SrcsetOptions): string;
|
|
5894
5908
|
/**
|
|
5895
|
-
* Generates a single
|
|
5909
|
+
* Generates a single Lynkow CDN transformation URL from a Lynkow image URL.
|
|
5896
5910
|
* Useful for thumbnails, hero images, or any context where you need a specific
|
|
5897
5911
|
* size/format.
|
|
5898
5912
|
*
|
|
@@ -5905,7 +5919,7 @@ declare class MediaHelperService {
|
|
|
5905
5919
|
* - `format` — output format: `'auto'`, `'webp'`, `'avif'`, or `'jpeg'` (default: `'auto'`)
|
|
5906
5920
|
* - `gravity` — focal point for crop mode (e.g. `'0.5x0.3'`)
|
|
5907
5921
|
* - `dpr` — device pixel ratio 1-4 for retina displays
|
|
5908
|
-
* @returns The transformed
|
|
5922
|
+
* @returns The transformed Lynkow CDN URL, the original URL if transformation is
|
|
5909
5923
|
* not possible (non-Lynkow URL), or an empty string if the URL is null/undefined
|
|
5910
5924
|
*
|
|
5911
5925
|
* @example
|
package/dist/index.d.ts
CHANGED
|
@@ -1515,15 +1515,16 @@ interface SearchOptions extends BaseRequestOptions {
|
|
|
1515
1515
|
*/
|
|
1516
1516
|
interface SearchConfig {
|
|
1517
1517
|
/**
|
|
1518
|
-
* Public search
|
|
1519
|
-
*
|
|
1520
|
-
* browser
|
|
1518
|
+
* Public Lynkow search host URL (e.g. `'https://search.lynkow.com'`).
|
|
1519
|
+
* Pass verbatim as the `host` when instantiating a search client in
|
|
1520
|
+
* the browser (for example the `meilisearch-js` npm package, which
|
|
1521
|
+
* speaks the same protocol). Does not include a trailing slash.
|
|
1521
1522
|
*/
|
|
1522
1523
|
host: string;
|
|
1523
1524
|
/** Short-lived tenant token (JWT, 1-hour expiry) scoped to your site's index */
|
|
1524
1525
|
apiKey: string;
|
|
1525
1526
|
/**
|
|
1526
|
-
*
|
|
1527
|
+
* Lynkow search index name for this site, of the form
|
|
1527
1528
|
* `site-<siteId>_<locale>` or `site-<siteId>` for single-locale sites.
|
|
1528
1529
|
* Pass verbatim as the `index` parameter in browser search queries.
|
|
1529
1530
|
*/
|
|
@@ -1784,12 +1785,18 @@ interface LynkowClient {
|
|
|
1784
1785
|
}
|
|
1785
1786
|
|
|
1786
1787
|
/**
|
|
1787
|
-
* CDN image variant URLs generated by
|
|
1788
|
+
* CDN image variant URLs generated by the Lynkow image transformation service.
|
|
1788
1789
|
*
|
|
1789
1790
|
* Each property is a pre-generated URL for a specific size/crop preset.
|
|
1790
|
-
* All URLs
|
|
1791
|
-
* via the `Accept` header.
|
|
1792
|
-
*
|
|
1791
|
+
* All URLs are served through the Lynkow CDN and support WebP/AVIF
|
|
1792
|
+
* auto-negotiation via the `Accept` header. A property is `undefined` only
|
|
1793
|
+
* when the endpoint returning this object excludes that preset from its
|
|
1794
|
+
* response (e.g. category images omit `medium`/`content`). For featured
|
|
1795
|
+
* images on content and pages, the six variants `thumbnail`, `card`,
|
|
1796
|
+
* `medium`, `content`, `hero`, and `og` are always present. The CDN uses
|
|
1797
|
+
* a `scale-down` fit that preserves the original size when the source
|
|
1798
|
+
* image is smaller than the target preset, so every URL is safe to use
|
|
1799
|
+
* in `src` or `srcset` regardless of the source dimensions.
|
|
1793
1800
|
*
|
|
1794
1801
|
* Use the smallest variant that fits your layout to minimize bandwidth.
|
|
1795
1802
|
*
|
|
@@ -1807,52 +1814,48 @@ interface ImageVariants {
|
|
|
1807
1814
|
/**
|
|
1808
1815
|
* 400x300px, cover crop with sharpening.
|
|
1809
1816
|
* Use case: list views, grid thumbnails, small cards.
|
|
1810
|
-
* `undefined` when the original image is smaller than 400x300.
|
|
1811
1817
|
*/
|
|
1812
1818
|
thumbnail?: string;
|
|
1813
1819
|
/**
|
|
1814
1820
|
* 600x400px, cover crop.
|
|
1815
1821
|
* Use case: card layouts, blog post previews, medium-sized list items.
|
|
1816
|
-
* `undefined` when the original image is smaller than 600x400.
|
|
1817
1822
|
*/
|
|
1818
1823
|
card?: string;
|
|
1819
1824
|
/**
|
|
1820
1825
|
* 1200px wide, scaled down proportionally (no crop).
|
|
1821
1826
|
* Use case: inline images within article body content.
|
|
1822
|
-
*
|
|
1827
|
+
* Serves the source at its native size when the original is narrower than 1200px.
|
|
1823
1828
|
*/
|
|
1824
1829
|
content?: string;
|
|
1825
1830
|
/**
|
|
1826
1831
|
* 960px wide, scaled down proportionally (no crop).
|
|
1827
1832
|
* Use case: medium-width displays, sidebar featured images, tablet layouts.
|
|
1828
|
-
*
|
|
1833
|
+
* Serves the source at its native size when the original is narrower than 960px.
|
|
1829
1834
|
*/
|
|
1830
1835
|
medium?: string;
|
|
1831
1836
|
/**
|
|
1832
1837
|
* 1920px wide, scaled down proportionally (no crop).
|
|
1833
1838
|
* Use case: full-width hero banners, page headers, background images.
|
|
1834
|
-
*
|
|
1839
|
+
* Serves the source at its native size when the original is narrower than 1920px.
|
|
1835
1840
|
*/
|
|
1836
1841
|
hero?: string;
|
|
1837
1842
|
/**
|
|
1838
1843
|
* 1200x630px, cover crop.
|
|
1839
1844
|
* Use case: Open Graph images, social media sharing (Facebook, LinkedIn, Twitter).
|
|
1840
1845
|
* Dimensions follow the recommended OG image ratio (1.91:1).
|
|
1841
|
-
* `undefined` when the original image is smaller than 1200x630.
|
|
1842
1846
|
*/
|
|
1843
1847
|
og?: string;
|
|
1844
1848
|
/**
|
|
1845
1849
|
* 128x128px, cover crop with face detection gravity.
|
|
1846
1850
|
* Use case: user avatars, author photos, profile pictures.
|
|
1847
1851
|
* Face detection ensures faces are centered in the crop.
|
|
1848
|
-
* `undefined` when the original image is smaller than 128x128.
|
|
1849
1852
|
*/
|
|
1850
1853
|
avatar?: string;
|
|
1851
1854
|
/**
|
|
1852
1855
|
* 2560px wide, scaled down proportionally (no crop).
|
|
1853
1856
|
* Use case: full-resolution display, lightbox/zoom views, retina hero images.
|
|
1854
|
-
* This is the largest available variant.
|
|
1855
|
-
*
|
|
1857
|
+
* This is the largest available variant. Serves the source at its native size
|
|
1858
|
+
* when the original is narrower than 2560px.
|
|
1856
1859
|
*/
|
|
1857
1860
|
full?: string;
|
|
1858
1861
|
}
|
|
@@ -2536,7 +2539,7 @@ interface Author {
|
|
|
2536
2539
|
fullName: string;
|
|
2537
2540
|
/**
|
|
2538
2541
|
* Absolute URL to the author's avatar image, or `null` if no avatar is set.
|
|
2539
|
-
* When available, points to
|
|
2542
|
+
* When available, points to an image hosted on the Lynkow CDN.
|
|
2540
2543
|
* Use `ImageVariants.avatar` (128x128) for optimized display if available elsewhere.
|
|
2541
2544
|
*/
|
|
2542
2545
|
avatarUrl: string | null;
|
|
@@ -2852,7 +2855,7 @@ interface SeoImage {
|
|
|
2852
2855
|
id: string;
|
|
2853
2856
|
/**
|
|
2854
2857
|
* Absolute URL to the image file.
|
|
2855
|
-
* Points to
|
|
2858
|
+
* Points to an image hosted on the Lynkow CDN. Recommended size: 1200x630px for Open Graph.
|
|
2856
2859
|
* Use this directly in `<meta property="og:image">` or `<meta name="twitter:image">` tags.
|
|
2857
2860
|
*/
|
|
2858
2861
|
url: string;
|
|
@@ -4056,6 +4059,16 @@ interface CookieConfig {
|
|
|
4056
4059
|
* When `false`, only "Accept All" and "Reject All" buttons are shown.
|
|
4057
4060
|
*/
|
|
4058
4061
|
showCustomizeButton?: boolean;
|
|
4062
|
+
/**
|
|
4063
|
+
* Banner layout orientation.
|
|
4064
|
+
* - `'auto'` (default): row layout on screens at least 600px wide,
|
|
4065
|
+
* automatically stacked into a column under 600px.
|
|
4066
|
+
* - `'column'`: forced column layout at every screen size.
|
|
4067
|
+
*
|
|
4068
|
+
* In every mode the banner is height-capped to the viewport with internal
|
|
4069
|
+
* scrolling, so it never overflows the screen.
|
|
4070
|
+
*/
|
|
4071
|
+
orientation?: 'auto' | 'column';
|
|
4059
4072
|
/**
|
|
4060
4073
|
* Per-theme color overrides for light and dark modes.
|
|
4061
4074
|
* Only relevant when {@link theme} is `'auto'`.
|
|
@@ -5522,6 +5535,7 @@ declare class ConsentService {
|
|
|
5522
5535
|
private resolveTheme;
|
|
5523
5536
|
private resolveColors;
|
|
5524
5537
|
private contrastColor;
|
|
5538
|
+
private injectBannerStylesOnce;
|
|
5525
5539
|
private createBannerHTML;
|
|
5526
5540
|
private createPreferencesHTML;
|
|
5527
5541
|
private attachBannerEvents;
|
|
@@ -5781,11 +5795,11 @@ interface SrcsetOptions {
|
|
|
5781
5795
|
*/
|
|
5782
5796
|
widths?: number[];
|
|
5783
5797
|
/**
|
|
5784
|
-
*
|
|
5785
|
-
*
|
|
5786
|
-
*
|
|
5787
|
-
*
|
|
5788
|
-
*
|
|
5798
|
+
* Resize fit mode. `'scale-down'` (default) preserves aspect ratio and
|
|
5799
|
+
* never upscales; `'cover'` fills the box and crops; `'contain'` fits
|
|
5800
|
+
* inside the box with letterboxing; `'crop'` hard crops to the exact
|
|
5801
|
+
* dimensions. Must pair with `gravity` for `'cover'` / `'crop'` when
|
|
5802
|
+
* the subject is not centered.
|
|
5789
5803
|
*/
|
|
5790
5804
|
fit?: 'cover' | 'contain' | 'scale-down' | 'crop';
|
|
5791
5805
|
/**
|
|
@@ -5802,9 +5816,9 @@ interface SrcsetOptions {
|
|
|
5802
5816
|
gravity?: string;
|
|
5803
5817
|
}
|
|
5804
5818
|
/**
|
|
5805
|
-
* Options for building a single transformed URL.
|
|
5806
|
-
*
|
|
5807
|
-
* choose a sensible default.
|
|
5819
|
+
* Options for building a single transformed URL. Each field maps to a
|
|
5820
|
+
* query parameter understood by the Lynkow image transformation service;
|
|
5821
|
+
* omit any value to let the CDN choose a sensible default.
|
|
5808
5822
|
*/
|
|
5809
5823
|
interface TransformOptions {
|
|
5810
5824
|
/**
|
|
@@ -5843,13 +5857,13 @@ interface TransformOptions {
|
|
|
5843
5857
|
dpr?: number;
|
|
5844
5858
|
}
|
|
5845
5859
|
/**
|
|
5846
|
-
* Service for building optimized image URLs
|
|
5860
|
+
* Service for building optimized image URLs backed by the Lynkow image
|
|
5861
|
+
* transformation service.
|
|
5847
5862
|
*
|
|
5848
5863
|
* Accessible via `lynkow.media`. This is a pure utility service (no API calls, no
|
|
5849
|
-
* caching) that constructs
|
|
5864
|
+
* caching) that constructs CDN transformation URLs from Lynkow media URLs.
|
|
5850
5865
|
* Works on both server and browser. Handles both original URLs (`/sites/...`) and
|
|
5851
|
-
* already-transformed URLs
|
|
5852
|
-
* when needed.
|
|
5866
|
+
* already-transformed URLs, re-extracting the original path when needed.
|
|
5853
5867
|
*
|
|
5854
5868
|
* @example
|
|
5855
5869
|
* ```typescript
|
|
@@ -5867,7 +5881,7 @@ declare class MediaHelperService {
|
|
|
5867
5881
|
/**
|
|
5868
5882
|
* Generates an HTML `srcset` attribute value from a Lynkow image URL, suitable
|
|
5869
5883
|
* for use in an `<img srcset="...">` or `<source srcset="...">` tag. Produces
|
|
5870
|
-
* one
|
|
5884
|
+
* one Lynkow CDN transformation URL per width breakpoint.
|
|
5871
5885
|
*
|
|
5872
5886
|
* @param imageUrl - Original image URL from the Lynkow API (e.g. `content.featuredImage`).
|
|
5873
5887
|
* Accepts `null` or `undefined` safely (returns empty string).
|
|
@@ -5892,7 +5906,7 @@ declare class MediaHelperService {
|
|
|
5892
5906
|
*/
|
|
5893
5907
|
srcset(imageUrl: string | null | undefined, options?: SrcsetOptions): string;
|
|
5894
5908
|
/**
|
|
5895
|
-
* Generates a single
|
|
5909
|
+
* Generates a single Lynkow CDN transformation URL from a Lynkow image URL.
|
|
5896
5910
|
* Useful for thumbnails, hero images, or any context where you need a specific
|
|
5897
5911
|
* size/format.
|
|
5898
5912
|
*
|
|
@@ -5905,7 +5919,7 @@ declare class MediaHelperService {
|
|
|
5905
5919
|
* - `format` — output format: `'auto'`, `'webp'`, `'avif'`, or `'jpeg'` (default: `'auto'`)
|
|
5906
5920
|
* - `gravity` — focal point for crop mode (e.g. `'0.5x0.3'`)
|
|
5907
5921
|
* - `dpr` — device pixel ratio 1-4 for retina displays
|
|
5908
|
-
* @returns The transformed
|
|
5922
|
+
* @returns The transformed Lynkow CDN URL, the original URL if transformation is
|
|
5909
5923
|
* not possible (non-Lynkow URL), or an empty string if the URL is null/undefined
|
|
5910
5924
|
*
|
|
5911
5925
|
* @example
|