vue-datocms 8.1.6 → 8.1.8

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/dist/index.cjs.js CHANGED
@@ -140,10 +140,7 @@ const ContentLink = vue.defineComponent({
140
140
  }
141
141
  },
142
142
  setup(props) {
143
- const {
144
- enableClickToEdit: enableClickToEditFn,
145
- setCurrentPath
146
- } = useContentLink({
143
+ const { enableClickToEdit: enableClickToEditFn, setCurrentPath } = useContentLink({
147
144
  enabled: props.stripStega !== void 0 ? { stripStega: props.stripStega } : true,
148
145
  onNavigateTo: props.onNavigateTo,
149
146
  root: props.root
@@ -1469,6 +1466,7 @@ const VideoPlayer = vue.defineComponent({
1469
1466
  ]);
1470
1467
  import('@mux/mux-player');
1471
1468
  const muxPlayerRef = vue.ref();
1469
+ const { alt } = data;
1472
1470
  const computedProps = __spreadProps$2(__spreadValues$2({}, useVideoPlayer({ data })), {
1473
1471
  disableCookies,
1474
1472
  disableTracking,
@@ -1477,7 +1475,8 @@ const VideoPlayer = vue.defineComponent({
1477
1475
  return {
1478
1476
  muxPlayerRef,
1479
1477
  computedProps,
1480
- otherProps
1478
+ otherProps,
1479
+ alt
1481
1480
  };
1482
1481
  },
1483
1482
  mounted() {
@@ -1562,7 +1561,8 @@ const VideoPlayer = vue.defineComponent({
1562
1561
  render() {
1563
1562
  return vue.h("mux-player", __spreadValues$2(__spreadValues$2({
1564
1563
  ref: "muxPlayerRef",
1565
- "stream-type": "on-demand"
1564
+ "stream-type": "on-demand",
1565
+ "data-datocms-content-link-source": this.alt && contentLink.decodeStega(this.alt) ? this.alt : void 0
1566
1566
  }, toHTMLAttrs(this.computedProps)), toHTMLAttrs(this.otherProps)));
1567
1567
  }
1568
1568
  });
package/dist/index.d.ts CHANGED
@@ -866,6 +866,8 @@ type Possibly<T> = Maybe$1<T> | undefined;
866
866
  type Video = {
867
867
  /** Title attribute (`title`) for the video */
868
868
  title?: Possibly<string>;
869
+ /** Alt attribute used for content link integration (passed as data-datocms-content-link-source) */
870
+ alt?: Possibly<string>;
869
871
  /** The height of the video */
870
872
  height?: Possibly<number>;
871
873
  /** The width of the video */
@@ -1212,6 +1214,7 @@ declare const VideoPlayer: vue.DefineComponent<{
1212
1214
  onCuePointChange: ((...args: any[]) => any) | undefined;
1213
1215
  onCuePointsChange: ((...args: any[]) => any) | undefined;
1214
1216
  };
1217
+ alt: Possibly<string>;
1215
1218
  }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("error" | "seeking" | "ended" | "pause" | "play" | "abort" | "canPlay" | "canPlayThrough" | "emptied" | "loadStart" | "loadedData" | "loadedMetadata" | "progress" | "durationChange" | "volumeChange" | "rateChange" | "resize" | "waiting" | "playing" | "timeUpdate" | "seeked" | "stalled" | "suspend" | "cuePointChange" | "cuePointsChange")[], "error" | "seeking" | "ended" | "pause" | "play" | "abort" | "canPlay" | "canPlayThrough" | "emptied" | "loadStart" | "loadedData" | "loadedMetadata" | "progress" | "durationChange" | "volumeChange" | "rateChange" | "resize" | "waiting" | "playing" | "timeUpdate" | "seeked" | "stalled" | "suspend" | "cuePointChange" | "cuePointsChange", vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
1216
1219
  _hlsConfig: {
1217
1220
  type: PropType<MuxPlayerElement["_hlsConfig"]>;
@@ -1,5 +1,5 @@
1
1
  import { ref, watch, onMounted, onUnmounted, defineComponent, onBeforeUnmount, h, watchEffect, unref, reactive, computed, toRaw } from 'vue';
2
- import { createController } from '@datocms/content-link';
2
+ import { createController, decodeStega } from '@datocms/content-link';
3
3
  export { decodeStega, stripStega } from '@datocms/content-link';
4
4
  import hypenateStyleName from 'hyphenate-style-name';
5
5
  import { render, renderNodeRule, defaultMetaTransformer } from 'datocms-structured-text-generic-html-renderer';
@@ -141,10 +141,7 @@ const ContentLink = defineComponent({
141
141
  }
142
142
  },
143
143
  setup(props) {
144
- const {
145
- enableClickToEdit: enableClickToEditFn,
146
- setCurrentPath
147
- } = useContentLink({
144
+ const { enableClickToEdit: enableClickToEditFn, setCurrentPath } = useContentLink({
148
145
  enabled: props.stripStega !== void 0 ? { stripStega: props.stripStega } : true,
149
146
  onNavigateTo: props.onNavigateTo,
150
147
  root: props.root
@@ -1470,6 +1467,7 @@ const VideoPlayer = defineComponent({
1470
1467
  ]);
1471
1468
  import('@mux/mux-player');
1472
1469
  const muxPlayerRef = ref();
1470
+ const { alt } = data;
1473
1471
  const computedProps = __spreadProps$2(__spreadValues$2({}, useVideoPlayer({ data })), {
1474
1472
  disableCookies,
1475
1473
  disableTracking,
@@ -1478,7 +1476,8 @@ const VideoPlayer = defineComponent({
1478
1476
  return {
1479
1477
  muxPlayerRef,
1480
1478
  computedProps,
1481
- otherProps
1479
+ otherProps,
1480
+ alt
1482
1481
  };
1483
1482
  },
1484
1483
  mounted() {
@@ -1563,7 +1562,8 @@ const VideoPlayer = defineComponent({
1563
1562
  render() {
1564
1563
  return h("mux-player", __spreadValues$2(__spreadValues$2({
1565
1564
  ref: "muxPlayerRef",
1566
- "stream-type": "on-demand"
1565
+ "stream-type": "on-demand",
1566
+ "data-datocms-content-link-source": this.alt && decodeStega(this.alt) ? this.alt : void 0
1567
1567
  }, toHTMLAttrs(this.computedProps)), toHTMLAttrs(this.otherProps)));
1568
1568
  }
1569
1569
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-datocms",
3
- "version": "8.1.6",
3
+ "version": "8.1.8",
4
4
  "type": "module",
5
5
  "description": "A set of components and utilities to work faster with DatoCMS in Vue.js environments",
6
6
  "keywords": [
@@ -42,7 +42,7 @@
42
42
  "toc": "doctoc --github src/components src/lib"
43
43
  },
44
44
  "dependencies": {
45
- "@datocms/content-link": "^0.3.9",
45
+ "@datocms/content-link": "^0.3.10",
46
46
  "datocms-listen": "^1.0.2",
47
47
  "hls.js": "^1.5.17",
48
48
  "datocms-structured-text-generic-html-renderer": "^5.0.0",