vue-datocms 8.1.0 → 8.1.2
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 +18 -7
- package/dist/index.d.ts +44 -2
- package/dist/index.esm.mjs +18 -7
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -346,6 +346,10 @@ const Image$1 = vue.defineComponent({
|
|
|
346
346
|
return typeof value === "number";
|
|
347
347
|
}),
|
|
348
348
|
default: () => [0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4]
|
|
349
|
+
},
|
|
350
|
+
referrerPolicy: {
|
|
351
|
+
type: String,
|
|
352
|
+
default: "no-referrer-when-downgrade"
|
|
349
353
|
}
|
|
350
354
|
},
|
|
351
355
|
setup(props, { emit, expose }) {
|
|
@@ -460,7 +464,8 @@ const Image$1 = vue.defineComponent({
|
|
|
460
464
|
}, absolutePositioning), {
|
|
461
465
|
objectFit: this.objectFit,
|
|
462
466
|
objectPosition: this.objectPosition
|
|
463
|
-
}), this.imgStyle)
|
|
467
|
+
}), this.imgStyle),
|
|
468
|
+
referrerpolicy: this.referrerPolicy
|
|
464
469
|
})
|
|
465
470
|
]),
|
|
466
471
|
vue.h("noscript", {
|
|
@@ -491,7 +496,8 @@ const Image$1 = vue.defineComponent({
|
|
|
491
496
|
objectPosition: this.objectPosition
|
|
492
497
|
}), this.imgStyle)),
|
|
493
498
|
loading: this.priority ? void 0 : "lazy",
|
|
494
|
-
fetchpriority: this.priority ? "high" : void 0
|
|
499
|
+
fetchpriority: this.priority ? "high" : void 0,
|
|
500
|
+
referrerpolicy: this.referrerPolicy
|
|
495
501
|
})
|
|
496
502
|
]
|
|
497
503
|
)
|
|
@@ -561,6 +567,10 @@ const NakedImage = vue.defineComponent({
|
|
|
561
567
|
imgStyle: {
|
|
562
568
|
type: Object,
|
|
563
569
|
default: () => ({})
|
|
570
|
+
},
|
|
571
|
+
referrerPolicy: {
|
|
572
|
+
type: String,
|
|
573
|
+
default: "no-referrer-when-downgrade"
|
|
564
574
|
}
|
|
565
575
|
},
|
|
566
576
|
setup(_props, { emit, expose }) {
|
|
@@ -631,7 +641,8 @@ const NakedImage = vue.defineComponent({
|
|
|
631
641
|
fetchpriority: this.priority ? "high" : void 0,
|
|
632
642
|
loading: this.priority ? void 0 : "lazy",
|
|
633
643
|
style: __spreadValues$4(__spreadValues$4(__spreadValues$4({}, placeholderStyle), sizingStyle), this.imgStyle || {}),
|
|
634
|
-
class: this.imgClass
|
|
644
|
+
class: this.imgClass,
|
|
645
|
+
referrerpolicy: this.referrerPolicy
|
|
635
646
|
})
|
|
636
647
|
]
|
|
637
648
|
);
|
|
@@ -795,18 +806,18 @@ const StructuredText = vue.defineComponent({
|
|
|
795
806
|
node
|
|
796
807
|
);
|
|
797
808
|
}
|
|
798
|
-
if (!datocmsStructuredTextUtils.isStructuredText(props.data) || !props.data.
|
|
809
|
+
if (!datocmsStructuredTextUtils.isStructuredText(props.data) || !props.data.inlineBlocks) {
|
|
799
810
|
throw new datocmsStructuredTextUtils.RenderError(
|
|
800
|
-
`The Structured Text document contains an 'inlineBlock' node, but .
|
|
811
|
+
`The Structured Text document contains an 'inlineBlock' node, but .inlineBlocks is not present!`,
|
|
801
812
|
node
|
|
802
813
|
);
|
|
803
814
|
}
|
|
804
|
-
const item = props.data.
|
|
815
|
+
const item = props.data.inlineBlocks.find(
|
|
805
816
|
(item2) => item2.id === node.item
|
|
806
817
|
);
|
|
807
818
|
if (!item) {
|
|
808
819
|
throw new datocmsStructuredTextUtils.RenderError(
|
|
809
|
-
`The Structured Text document contains a 'block' node, but cannot find a record with ID ${node.item} inside .
|
|
820
|
+
`The Structured Text document contains a 'block' node, but cannot find a record with ID ${node.item} inside .inlineBlocks!`,
|
|
810
821
|
node
|
|
811
822
|
);
|
|
812
823
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -142,6 +142,16 @@ declare const Image: vue.DefineComponent<{
|
|
|
142
142
|
validator: (values: any[]) => values is number[];
|
|
143
143
|
default: () => number[];
|
|
144
144
|
};
|
|
145
|
+
/**
|
|
146
|
+
* Defines which referrer is sent when fetching the image
|
|
147
|
+
* Read more: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#referrerpolicy
|
|
148
|
+
*
|
|
149
|
+
* Defaults to `no-referrer-when-downgrade` to give more useful stats in DatoCMS Project Usages
|
|
150
|
+
**/
|
|
151
|
+
referrerPolicy: {
|
|
152
|
+
type: StringConstructor;
|
|
153
|
+
default: string;
|
|
154
|
+
};
|
|
145
155
|
}, {
|
|
146
156
|
inView: vue.Ref<boolean>;
|
|
147
157
|
rootRef: vue.Ref<HTMLElement | null>;
|
|
@@ -256,6 +266,16 @@ declare const Image: vue.DefineComponent<{
|
|
|
256
266
|
validator: (values: any[]) => values is number[];
|
|
257
267
|
default: () => number[];
|
|
258
268
|
};
|
|
269
|
+
/**
|
|
270
|
+
* Defines which referrer is sent when fetching the image
|
|
271
|
+
* Read more: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#referrerpolicy
|
|
272
|
+
*
|
|
273
|
+
* Defaults to `no-referrer-when-downgrade` to give more useful stats in DatoCMS Project Usages
|
|
274
|
+
**/
|
|
275
|
+
referrerPolicy: {
|
|
276
|
+
type: StringConstructor;
|
|
277
|
+
default: string;
|
|
278
|
+
};
|
|
259
279
|
}>> & {
|
|
260
280
|
onLoad?: ((...args: any[]) => any) | undefined;
|
|
261
281
|
}, {
|
|
@@ -268,6 +288,7 @@ declare const Image: vue.DefineComponent<{
|
|
|
268
288
|
layout: string;
|
|
269
289
|
usePlaceholder: boolean;
|
|
270
290
|
srcSetCandidates: unknown[];
|
|
291
|
+
referrerPolicy: string;
|
|
271
292
|
}, {}>;
|
|
272
293
|
declare const DatocmsImagePlugin: {
|
|
273
294
|
install: (Vue: any) => void;
|
|
@@ -331,6 +352,16 @@ declare const NakedImage: vue.DefineComponent<{
|
|
|
331
352
|
type: ObjectConstructor;
|
|
332
353
|
default: () => {};
|
|
333
354
|
};
|
|
355
|
+
/**
|
|
356
|
+
* Defines which referrer is sent when fetching the image
|
|
357
|
+
* Read more: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#referrerpolicy
|
|
358
|
+
*
|
|
359
|
+
* Defaults to `no-referrer-when-downgrade` to give more useful stats in DatoCMS Project Usages
|
|
360
|
+
**/
|
|
361
|
+
referrerPolicy: {
|
|
362
|
+
type: StringConstructor;
|
|
363
|
+
default: string;
|
|
364
|
+
};
|
|
334
365
|
}, {
|
|
335
366
|
loaded: vue.Ref<boolean>;
|
|
336
367
|
handleLoad: () => void;
|
|
@@ -393,12 +424,23 @@ declare const NakedImage: vue.DefineComponent<{
|
|
|
393
424
|
type: ObjectConstructor;
|
|
394
425
|
default: () => {};
|
|
395
426
|
};
|
|
427
|
+
/**
|
|
428
|
+
* Defines which referrer is sent when fetching the image
|
|
429
|
+
* Read more: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#referrerpolicy
|
|
430
|
+
*
|
|
431
|
+
* Defaults to `no-referrer-when-downgrade` to give more useful stats in DatoCMS Project Usages
|
|
432
|
+
**/
|
|
433
|
+
referrerPolicy: {
|
|
434
|
+
type: StringConstructor;
|
|
435
|
+
default: string;
|
|
436
|
+
};
|
|
396
437
|
}>>, {
|
|
397
438
|
priority: boolean;
|
|
398
439
|
pictureStyle: Record<string, any>;
|
|
399
440
|
imgStyle: Record<string, any>;
|
|
400
441
|
usePlaceholder: boolean;
|
|
401
442
|
srcSetCandidates: unknown[];
|
|
443
|
+
referrerPolicy: string;
|
|
402
444
|
}, {}>;
|
|
403
445
|
declare const DatocmsNakedImagePlugin: {
|
|
404
446
|
install: (Vue: any) => void;
|
|
@@ -429,7 +471,7 @@ type RenderBlockContext<R extends Record$1 = Record$1> = {
|
|
|
429
471
|
declare const StructuredText: vue.DefineComponent<{
|
|
430
472
|
/** The actual field value you get from DatoCMS **/
|
|
431
473
|
data: {
|
|
432
|
-
type: PropType<StructuredText$1<Record$1, Record$1> | Document | Node | null | undefined>;
|
|
474
|
+
type: PropType<StructuredText$1<Record$1, Record$1, Record$1> | Document | Node | null | undefined>;
|
|
433
475
|
};
|
|
434
476
|
/** @deprecated use customNodeRules **/
|
|
435
477
|
customRules: {
|
|
@@ -478,7 +520,7 @@ declare const StructuredText: vue.DefineComponent<{
|
|
|
478
520
|
}, () => RenderResult<typeof h, (text: string, _key: string) => AdapterReturn, (children: AdapterReturn[], _key: string) => AdapterReturn>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
479
521
|
/** The actual field value you get from DatoCMS **/
|
|
480
522
|
data: {
|
|
481
|
-
type: PropType<StructuredText$1<Record$1, Record$1> | Document | Node | null | undefined>;
|
|
523
|
+
type: PropType<StructuredText$1<Record$1, Record$1, Record$1> | Document | Node | null | undefined>;
|
|
482
524
|
};
|
|
483
525
|
/** @deprecated use customNodeRules **/
|
|
484
526
|
customRules: {
|
package/dist/index.esm.mjs
CHANGED
|
@@ -322,6 +322,10 @@ const Image$1 = defineComponent({
|
|
|
322
322
|
return typeof value === "number";
|
|
323
323
|
}),
|
|
324
324
|
default: () => [0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4]
|
|
325
|
+
},
|
|
326
|
+
referrerPolicy: {
|
|
327
|
+
type: String,
|
|
328
|
+
default: "no-referrer-when-downgrade"
|
|
325
329
|
}
|
|
326
330
|
},
|
|
327
331
|
setup(props, { emit, expose }) {
|
|
@@ -436,7 +440,8 @@ const Image$1 = defineComponent({
|
|
|
436
440
|
}, absolutePositioning), {
|
|
437
441
|
objectFit: this.objectFit,
|
|
438
442
|
objectPosition: this.objectPosition
|
|
439
|
-
}), this.imgStyle)
|
|
443
|
+
}), this.imgStyle),
|
|
444
|
+
referrerpolicy: this.referrerPolicy
|
|
440
445
|
})
|
|
441
446
|
]),
|
|
442
447
|
h("noscript", {
|
|
@@ -467,7 +472,8 @@ const Image$1 = defineComponent({
|
|
|
467
472
|
objectPosition: this.objectPosition
|
|
468
473
|
}), this.imgStyle)),
|
|
469
474
|
loading: this.priority ? void 0 : "lazy",
|
|
470
|
-
fetchpriority: this.priority ? "high" : void 0
|
|
475
|
+
fetchpriority: this.priority ? "high" : void 0,
|
|
476
|
+
referrerpolicy: this.referrerPolicy
|
|
471
477
|
})
|
|
472
478
|
]
|
|
473
479
|
)
|
|
@@ -537,6 +543,10 @@ const NakedImage = defineComponent({
|
|
|
537
543
|
imgStyle: {
|
|
538
544
|
type: Object,
|
|
539
545
|
default: () => ({})
|
|
546
|
+
},
|
|
547
|
+
referrerPolicy: {
|
|
548
|
+
type: String,
|
|
549
|
+
default: "no-referrer-when-downgrade"
|
|
540
550
|
}
|
|
541
551
|
},
|
|
542
552
|
setup(_props, { emit, expose }) {
|
|
@@ -607,7 +617,8 @@ const NakedImage = defineComponent({
|
|
|
607
617
|
fetchpriority: this.priority ? "high" : void 0,
|
|
608
618
|
loading: this.priority ? void 0 : "lazy",
|
|
609
619
|
style: __spreadValues$4(__spreadValues$4(__spreadValues$4({}, placeholderStyle), sizingStyle), this.imgStyle || {}),
|
|
610
|
-
class: this.imgClass
|
|
620
|
+
class: this.imgClass,
|
|
621
|
+
referrerpolicy: this.referrerPolicy
|
|
611
622
|
})
|
|
612
623
|
]
|
|
613
624
|
);
|
|
@@ -771,18 +782,18 @@ const StructuredText = defineComponent({
|
|
|
771
782
|
node
|
|
772
783
|
);
|
|
773
784
|
}
|
|
774
|
-
if (!isStructuredText(props.data) || !props.data.
|
|
785
|
+
if (!isStructuredText(props.data) || !props.data.inlineBlocks) {
|
|
775
786
|
throw new RenderError(
|
|
776
|
-
`The Structured Text document contains an 'inlineBlock' node, but .
|
|
787
|
+
`The Structured Text document contains an 'inlineBlock' node, but .inlineBlocks is not present!`,
|
|
777
788
|
node
|
|
778
789
|
);
|
|
779
790
|
}
|
|
780
|
-
const item = props.data.
|
|
791
|
+
const item = props.data.inlineBlocks.find(
|
|
781
792
|
(item2) => item2.id === node.item
|
|
782
793
|
);
|
|
783
794
|
if (!item) {
|
|
784
795
|
throw new RenderError(
|
|
785
|
-
`The Structured Text document contains a 'block' node, but cannot find a record with ID ${node.item} inside .
|
|
796
|
+
`The Structured Text document contains a 'block' node, but cannot find a record with ID ${node.item} inside .inlineBlocks!`,
|
|
786
797
|
node
|
|
787
798
|
);
|
|
788
799
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-datocms",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.2",
|
|
4
4
|
"description": "A set of components and utilities to work faster with DatoCMS in Vue.js environments",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datocms",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"datocms-listen": "^0.1.15",
|
|
45
45
|
"hls.js": "^1.5.17",
|
|
46
|
-
"datocms-structured-text-generic-html-renderer": "^
|
|
47
|
-
"datocms-structured-text-utils": "^
|
|
46
|
+
"datocms-structured-text-generic-html-renderer": "^5.0.0",
|
|
47
|
+
"datocms-structured-text-utils": "^5.0.0",
|
|
48
48
|
"hyphenate-style-name": "^1.0.4"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|