@datocms/svelte 4.2.4-0 → 4.2.5

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.
@@ -285,15 +285,27 @@ if (decoded) {
285
285
 
286
286
  ### `stripStega`
287
287
 
288
- Removes stega encoding from text, returning clean text:
288
+ Removes stega encoding from any data type:
289
289
 
290
290
  ```typescript
291
291
  import { stripStega } from '@datocms/svelte';
292
292
 
293
- const text = "Hello, world!"; // Contains invisible stega data
294
- const clean = stripStega(text);
293
+ // Works with strings
294
+ stripStega("Hello‎World") // "HelloWorld"
295
+
296
+ // Works with objects
297
+ stripStega({ name: "John‎", age: 30 })
298
+
299
+ // Works with nested structures - removes ALL stega encodings
300
+ stripStega({
301
+ users: [
302
+ { name: "Alice‎", email: "alice‎.com" },
303
+ { name: "Bob‎", email: "bob‎.co" }
304
+ ]
305
+ })
295
306
 
296
- console.log(clean); // "Hello, world!" without encoding
307
+ // Works with arrays
308
+ stripStega(["First‎", "Second‎", "Third‎"])
297
309
  ```
298
310
 
299
311
  These utilities are useful when you need to:
@@ -78,8 +78,10 @@ export let disableTracking = true;
78
78
  let muxPlayerElementImported = false;
79
79
  let muxPlayerElement;
80
80
  let computedProps;
81
+ let alt;
81
82
  $: {
82
- const { muxPlaybackId, playbackId, title, width, height, blurUpThumb } = data || {};
83
+ const { muxPlaybackId, playbackId, title, width, height, blurUpThumb, alt: dataAlt } = data || {};
84
+ alt = dataAlt;
83
85
  computedProps = {
84
86
  ...computedTitle(title) || {},
85
87
  ...computedPlaybackId(muxPlaybackId, playbackId) || {},
@@ -109,6 +111,7 @@ onMount(async () => {
109
111
  <mux-player
110
112
  bind:this={muxPlayerElement}
111
113
  stream-type="on-demand"
114
+ data-datocms-content-link-source={alt}
112
115
  {...toHTMLAttrs(computedProps)}
113
116
  {...toHTMLAttrs($$restProps)}
114
117
  on:abort
@@ -75,6 +75,8 @@ export type MuxPlayerProps = {
75
75
  export type Video = {
76
76
  /** Title attribute (`title`) for the video */
77
77
  title?: Maybe<string>;
78
+ /** Alt attribute used for content link integration (passed as data-datocms-content-link-source) */
79
+ alt?: Maybe<string>;
78
80
  /** The height of the video */
79
81
  height?: Maybe<number>;
80
82
  /** The width of the video */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datocms/svelte",
3
- "version": "4.2.4-0",
3
+ "version": "4.2.5",
4
4
  "description": "A set of components and utilities to work faster with DatoCMS in Svelte",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "type": "module",
68
68
  "dependencies": {
69
- "@datocms/content-link": "^0.3.7",
69
+ "@datocms/content-link": "^0.3.10",
70
70
  "datocms-listen": "^1.0.2",
71
71
  "datocms-structured-text-utils": "^5.1.6",
72
72
  "svelte-intersection-observer": "^1.0.0"