vue-datocms 8.0.0-0 → 8.0.0
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 +41 -15
- package/dist/index.cjs.js +64 -54
- package/dist/index.d.ts +100 -22
- package/dist/index.esm.mjs +64 -54
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
<!--datocms-autoinclude-header start-->
|
|
2
|
+
|
|
2
3
|
<a href="https://www.datocms.com/"><img src="https://www.datocms.com/images/full_logo.svg" height="60"></a>
|
|
3
4
|
|
|
4
5
|
👉 [Visit the DatoCMS homepage](https://www.datocms.com) or see [What is DatoCMS?](#what-is-datocms)
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
5
9
|
<!--datocms-autoinclude-header end-->
|
|
6
10
|
|
|
7
11
|
# vue-datocms
|
|
@@ -71,27 +75,49 @@ npm run dev
|
|
|
71
75
|
```
|
|
72
76
|
|
|
73
77
|
<!--datocms-autoinclude-footer start-->
|
|
74
|
-
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
75
81
|
# What is DatoCMS?
|
|
76
|
-
|
|
82
|
+
|
|
83
|
+
<a href="https://www.datocms.com/"><img src="https://www.datocms.com/images/full_logo.svg" height="60" alt="DatoCMS - The Headless CMS for the Modern Web"></a>
|
|
77
84
|
|
|
78
85
|
[DatoCMS](https://www.datocms.com/) is the REST & GraphQL Headless CMS for the modern web.
|
|
79
86
|
|
|
80
|
-
Trusted by over 25,000 enterprise businesses,
|
|
87
|
+
Trusted by over 25,000 enterprise businesses, agencies, and individuals across the world, DatoCMS users create online content at scale from a central hub and distribute it via API. We ❤️ our [developers](https://www.datocms.com/team/best-cms-for-developers), [content editors](https://www.datocms.com/team/content-creators) and [marketers](https://www.datocms.com/team/cms-digital-marketing)!
|
|
88
|
+
|
|
89
|
+
**Why DatoCMS?**
|
|
90
|
+
|
|
91
|
+
- **API-First Architecture**: Built for both REST and GraphQL, enabling flexible content delivery
|
|
92
|
+
- **Just Enough Features**: We believe in keeping things simple, and giving you [the right feature-set tools](https://www.datocms.com/features) to get the job done
|
|
93
|
+
- **Developer Experience**: First-class TypeScript support with powerful developer tools
|
|
94
|
+
|
|
95
|
+
**Getting Started:**
|
|
96
|
+
|
|
97
|
+
- ⚡️ [Create Free Account](https://dashboard.datocms.com/signup) - Get started with DatoCMS in minutes
|
|
98
|
+
- 🔖 [Documentation](https://www.datocms.com/docs) - Comprehensive guides and API references
|
|
99
|
+
- ⚙️ [Community Support](https://community.datocms.com/) - Get help from our team and community
|
|
100
|
+
- 🆕 [Changelog](https://www.datocms.com/product-updates) - Latest features and improvements
|
|
101
|
+
|
|
102
|
+
**Official Libraries:**
|
|
103
|
+
|
|
104
|
+
- [**Content Delivery Client**](https://github.com/datocms/cda-client) - TypeScript GraphQL client for content fetching
|
|
105
|
+
- [**REST API Clients**](https://github.com/datocms/js-rest-api-clients) - Node.js/Browser clients for content management
|
|
106
|
+
- [**CLI Tools**](https://github.com/datocms/cli) - Command-line utilities for schema migrations (includes [Contentful](https://github.com/datocms/cli/tree/main/packages/cli-plugin-contentful) and [WordPress](https://github.com/datocms/cli/tree/main/packages/cli-plugin-wordpress) importers)
|
|
107
|
+
|
|
108
|
+
**Official Framework Integrations**
|
|
109
|
+
|
|
110
|
+
Helpers to manage SEO, images, video and Structured Text coming from your DatoCMS projects:
|
|
81
111
|
|
|
82
|
-
**
|
|
112
|
+
- [**React Components**](https://github.com/datocms/react-datocms)
|
|
113
|
+
- [**Vue Components**](https://github.com/datocms/vue-datocms)
|
|
114
|
+
- [**Svelte Components**](https://github.com/datocms/datocms-svelte)
|
|
115
|
+
- [**Astro Components**](https://github.com/datocms/astro-datocms)
|
|
83
116
|
|
|
84
|
-
|
|
85
|
-
- 🔖 Go through the [docs](https://www.datocms.com/docs)
|
|
86
|
-
- ⚙️ Get [support from us and the community](https://community.datocms.com/)
|
|
87
|
-
- 🆕 Stay up to date on new features and fixes on the [changelog](https://www.datocms.com/product-updates)
|
|
117
|
+
**Additional Resources:**
|
|
88
118
|
|
|
89
|
-
**
|
|
90
|
-
- [
|
|
91
|
-
- [
|
|
92
|
-
- [datocms/cli](https://github.com/datocms/cli): Command-line interface that includes our [Contentful importer](https://github.com/datocms/cli/tree/main/packages/cli-plugin-contentful) and [Wordpress importer](https://github.com/datocms/cli/tree/main/packages/cli-plugin-wordpress)
|
|
93
|
-
- [datocms/plugins](https://github.com/datocms/plugins): Example plugins we've made that extend the editor/admin dashboard
|
|
94
|
-
- [DatoCMS Starters](https://www.datocms.com/marketplace/starters) has examples for various Javascript frontend frameworks
|
|
119
|
+
- [**Plugin Examples**](https://github.com/datocms/plugins) - Example plugins we've made that extend the editor/admin dashboard
|
|
120
|
+
- [**Starter Projects**](https://www.datocms.com/marketplace/starters) - Example website implementations for popular frameworks
|
|
121
|
+
- [**All Public Repositories**](https://github.com/orgs/datocms/repositories?q=&type=public&language=&sort=stargazers)
|
|
95
122
|
|
|
96
|
-
Or see [all our public repos](https://github.com/orgs/datocms/repositories?q=&type=public&language=&sort=stargazers)
|
|
97
123
|
<!--datocms-autoinclude-footer end-->
|
package/dist/index.cjs.js
CHANGED
|
@@ -186,17 +186,17 @@ function buildRegularSource(data, sizes, srcSetCandidates) {
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
var __defProp$6 = Object.defineProperty;
|
|
189
|
-
var __getOwnPropSymbols$
|
|
190
|
-
var __hasOwnProp$
|
|
191
|
-
var __propIsEnum$
|
|
189
|
+
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
190
|
+
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
191
|
+
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
192
192
|
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
193
193
|
var __spreadValues$6 = (a, b) => {
|
|
194
194
|
for (var prop in b || (b = {}))
|
|
195
|
-
if (__hasOwnProp$
|
|
195
|
+
if (__hasOwnProp$6.call(b, prop))
|
|
196
196
|
__defNormalProp$6(a, prop, b[prop]);
|
|
197
|
-
if (__getOwnPropSymbols$
|
|
198
|
-
for (var prop of __getOwnPropSymbols$
|
|
199
|
-
if (__propIsEnum$
|
|
197
|
+
if (__getOwnPropSymbols$6)
|
|
198
|
+
for (var prop of __getOwnPropSymbols$6(b)) {
|
|
199
|
+
if (__propIsEnum$6.call(b, prop))
|
|
200
200
|
__defNormalProp$6(a, prop, b[prop]);
|
|
201
201
|
}
|
|
202
202
|
return a;
|
|
@@ -234,17 +234,17 @@ const Sizer = vue.defineComponent({
|
|
|
234
234
|
var __defProp$5 = Object.defineProperty;
|
|
235
235
|
var __defProps$3 = Object.defineProperties;
|
|
236
236
|
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
|
237
|
-
var __getOwnPropSymbols$
|
|
238
|
-
var __hasOwnProp$
|
|
239
|
-
var __propIsEnum$
|
|
237
|
+
var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
|
|
238
|
+
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
|
239
|
+
var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
|
|
240
240
|
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
241
241
|
var __spreadValues$5 = (a, b) => {
|
|
242
242
|
for (var prop in b || (b = {}))
|
|
243
|
-
if (__hasOwnProp$
|
|
243
|
+
if (__hasOwnProp$5.call(b, prop))
|
|
244
244
|
__defNormalProp$5(a, prop, b[prop]);
|
|
245
|
-
if (__getOwnPropSymbols$
|
|
246
|
-
for (var prop of __getOwnPropSymbols$
|
|
247
|
-
if (__propIsEnum$
|
|
245
|
+
if (__getOwnPropSymbols$5)
|
|
246
|
+
for (var prop of __getOwnPropSymbols$5(b)) {
|
|
247
|
+
if (__propIsEnum$5.call(b, prop))
|
|
248
248
|
__defNormalProp$5(a, prop, b[prop]);
|
|
249
249
|
}
|
|
250
250
|
return a;
|
|
@@ -507,17 +507,17 @@ const DatocmsImagePlugin = {
|
|
|
507
507
|
};
|
|
508
508
|
|
|
509
509
|
var __defProp$4 = Object.defineProperty;
|
|
510
|
-
var __getOwnPropSymbols$
|
|
511
|
-
var __hasOwnProp$
|
|
512
|
-
var __propIsEnum$
|
|
510
|
+
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
511
|
+
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
512
|
+
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
513
513
|
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
514
514
|
var __spreadValues$4 = (a, b) => {
|
|
515
515
|
for (var prop in b || (b = {}))
|
|
516
|
-
if (__hasOwnProp$
|
|
516
|
+
if (__hasOwnProp$4.call(b, prop))
|
|
517
517
|
__defNormalProp$4(a, prop, b[prop]);
|
|
518
|
-
if (__getOwnPropSymbols$
|
|
519
|
-
for (var prop of __getOwnPropSymbols$
|
|
520
|
-
if (__propIsEnum$
|
|
518
|
+
if (__getOwnPropSymbols$4)
|
|
519
|
+
for (var prop of __getOwnPropSymbols$4(b)) {
|
|
520
|
+
if (__propIsEnum$4.call(b, prop))
|
|
521
521
|
__defNormalProp$4(a, prop, b[prop]);
|
|
522
522
|
}
|
|
523
523
|
return a;
|
|
@@ -643,34 +643,11 @@ const DatocmsNakedImagePlugin = {
|
|
|
643
643
|
}
|
|
644
644
|
};
|
|
645
645
|
|
|
646
|
-
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
647
|
-
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
648
|
-
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
649
|
-
var __objRest$2 = (source, exclude) => {
|
|
650
|
-
var target = {};
|
|
651
|
-
for (var prop in source)
|
|
652
|
-
if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
653
|
-
target[prop] = source[prop];
|
|
654
|
-
if (source != null && __getOwnPropSymbols$4)
|
|
655
|
-
for (var prop of __getOwnPropSymbols$4(source)) {
|
|
656
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
|
|
657
|
-
target[prop] = source[prop];
|
|
658
|
-
}
|
|
659
|
-
return target;
|
|
660
|
-
};
|
|
661
|
-
const hAdapter = (tagName, props, childOrChildren) => {
|
|
662
|
-
const _a = props || {}; __objRest$2(_a, ["href", "target", "rel"]);
|
|
663
|
-
return vue.h(
|
|
664
|
-
tagName,
|
|
665
|
-
props,
|
|
666
|
-
typeof childOrChildren === "undefined" || Array.isArray(childOrChildren) ? childOrChildren : [childOrChildren]
|
|
667
|
-
);
|
|
668
|
-
};
|
|
669
646
|
const defaultAdapter = {
|
|
670
|
-
renderNode:
|
|
671
|
-
renderMark:
|
|
672
|
-
renderFragment: (children,
|
|
673
|
-
renderText: (text,
|
|
647
|
+
renderNode: vue.h,
|
|
648
|
+
renderMark: vue.h,
|
|
649
|
+
renderFragment: (children, _key) => children,
|
|
650
|
+
renderText: (text, _key) => text
|
|
674
651
|
};
|
|
675
652
|
function appendKeyToValidElement(element, key) {
|
|
676
653
|
if (element !== null && typeof element !== "string" && element.key === null) {
|
|
@@ -678,8 +655,36 @@ function appendKeyToValidElement(element, key) {
|
|
|
678
655
|
}
|
|
679
656
|
return element;
|
|
680
657
|
}
|
|
681
|
-
const StructuredText = vue.defineComponent(
|
|
682
|
-
|
|
658
|
+
const StructuredText = vue.defineComponent({
|
|
659
|
+
name: "DatocmsStructuredText",
|
|
660
|
+
props: {
|
|
661
|
+
data: {
|
|
662
|
+
type: Object
|
|
663
|
+
},
|
|
664
|
+
customRules: {
|
|
665
|
+
type: Array
|
|
666
|
+
},
|
|
667
|
+
customNodeRules: {
|
|
668
|
+
type: Array
|
|
669
|
+
},
|
|
670
|
+
customMarkRules: {
|
|
671
|
+
type: Array
|
|
672
|
+
},
|
|
673
|
+
renderInlineRecord: {
|
|
674
|
+
type: Function
|
|
675
|
+
},
|
|
676
|
+
renderLinkToRecord: {
|
|
677
|
+
type: Function
|
|
678
|
+
},
|
|
679
|
+
renderBlock: {
|
|
680
|
+
type: Function
|
|
681
|
+
},
|
|
682
|
+
metaTransformer: { type: Function },
|
|
683
|
+
renderText: { type: Function },
|
|
684
|
+
renderNode: { type: Function },
|
|
685
|
+
renderFragment: { type: Function }
|
|
686
|
+
},
|
|
687
|
+
setup(props) {
|
|
683
688
|
return () => {
|
|
684
689
|
return datocmsStructuredTextGenericHtmlRenderer.render(props.data, {
|
|
685
690
|
adapter: {
|
|
@@ -784,11 +789,8 @@ const StructuredText = vue.defineComponent(
|
|
|
784
789
|
]
|
|
785
790
|
});
|
|
786
791
|
};
|
|
787
|
-
},
|
|
788
|
-
{
|
|
789
|
-
name: "DatocmsStructuredText"
|
|
790
792
|
}
|
|
791
|
-
);
|
|
793
|
+
});
|
|
792
794
|
const DatocmsStructuredTextPlugin = {
|
|
793
795
|
install: (Vue) => {
|
|
794
796
|
Vue.component("DatocmsStructuredText", StructuredText);
|
|
@@ -989,6 +991,11 @@ const VideoPlayer = vue.defineComponent({
|
|
|
989
991
|
required: false,
|
|
990
992
|
default: () => true
|
|
991
993
|
},
|
|
994
|
+
disableTracking: {
|
|
995
|
+
type: Boolean,
|
|
996
|
+
required: false,
|
|
997
|
+
default: () => true
|
|
998
|
+
},
|
|
992
999
|
disablePictureInPicture: {
|
|
993
1000
|
type: Boolean,
|
|
994
1001
|
required: false
|
|
@@ -1186,16 +1193,19 @@ const VideoPlayer = vue.defineComponent({
|
|
|
1186
1193
|
var _b = _a, {
|
|
1187
1194
|
data = {},
|
|
1188
1195
|
disableCookies = true,
|
|
1196
|
+
disableTracking = true,
|
|
1189
1197
|
preload = "metadata"
|
|
1190
1198
|
} = _b, otherProps = __objRest$1(_b, [
|
|
1191
1199
|
"data",
|
|
1192
1200
|
"disableCookies",
|
|
1201
|
+
"disableTracking",
|
|
1193
1202
|
"preload"
|
|
1194
1203
|
]);
|
|
1195
1204
|
Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@mux/mux-player')); });
|
|
1196
1205
|
const muxPlayerRef = vue.ref();
|
|
1197
1206
|
const computedProps = __spreadProps$2(__spreadValues$2({}, useVideoPlayer({ data })), {
|
|
1198
1207
|
disableCookies,
|
|
1208
|
+
disableTracking,
|
|
1199
1209
|
preload
|
|
1200
1210
|
});
|
|
1201
1211
|
return {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import { PropType,
|
|
2
|
+
import { PropType, h, VNode, Ref, UnwrapRef, CSSProperties } from 'vue';
|
|
3
3
|
import { TransformedMeta, RenderMarkRule, TransformMetaFn } from 'datocms-structured-text-generic-html-renderer';
|
|
4
4
|
export { renderMarkRule, renderNodeRule, renderNodeRule as renderRule } from 'datocms-structured-text-generic-html-renderer';
|
|
5
5
|
import { Record as Record$1, RenderResult, StructuredText as StructuredText$1, Document, Node, RenderRule } from 'datocms-structured-text-utils';
|
|
@@ -406,10 +406,10 @@ declare const DatocmsNakedImagePlugin: {
|
|
|
406
406
|
|
|
407
407
|
type AdapterReturn = VNode | string | null;
|
|
408
408
|
declare const defaultAdapter: {
|
|
409
|
-
renderNode:
|
|
410
|
-
renderMark:
|
|
411
|
-
renderFragment: (children: AdapterReturn[],
|
|
412
|
-
renderText: (text: string,
|
|
409
|
+
renderNode: typeof h;
|
|
410
|
+
renderMark: typeof h;
|
|
411
|
+
renderFragment: (children: AdapterReturn[], _key: string) => AdapterReturn;
|
|
412
|
+
renderText: (text: string, _key: string) => AdapterReturn;
|
|
413
413
|
};
|
|
414
414
|
type H = typeof defaultAdapter.renderNode;
|
|
415
415
|
type T = typeof defaultAdapter.renderText;
|
|
@@ -426,31 +426,97 @@ type RenderRecordLinkContext<R extends Record$1 = Record$1> = {
|
|
|
426
426
|
type RenderBlockContext<R extends Record$1 = Record$1> = {
|
|
427
427
|
record: R;
|
|
428
428
|
};
|
|
429
|
-
|
|
429
|
+
declare const StructuredText: vue.DefineComponent<{
|
|
430
430
|
/** The actual field value you get from DatoCMS **/
|
|
431
|
-
data:
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
|
|
431
|
+
data: {
|
|
432
|
+
type: PropType<StructuredText$1<Record$1, Record$1> | Document | Node | null | undefined>;
|
|
433
|
+
};
|
|
434
|
+
/** @deprecated use customNodeRules **/
|
|
435
|
+
customRules: {
|
|
436
|
+
type: PropType<RenderRule<typeof h, (text: string, _key: string) => AdapterReturn, (children: AdapterReturn[], _key: string) => AdapterReturn>[]>;
|
|
437
|
+
};
|
|
438
|
+
/** A set of additional rules to convert the document to JSX **/
|
|
439
|
+
customNodeRules: {
|
|
440
|
+
type: PropType<RenderRule<typeof h, (text: string, _key: string) => AdapterReturn, (children: AdapterReturn[], _key: string) => AdapterReturn>[]>;
|
|
441
|
+
};
|
|
442
|
+
/** A set of additional rules to convert the document to JSX **/
|
|
443
|
+
customMarkRules: {
|
|
444
|
+
type: PropType<RenderMarkRule<typeof h, (text: string, _key: string) => AdapterReturn, (children: AdapterReturn[], _key: string) => AdapterReturn>[]>;
|
|
445
|
+
};
|
|
436
446
|
/** Fuction that converts an 'inlineItem' node into React **/
|
|
437
|
-
renderInlineRecord
|
|
447
|
+
renderInlineRecord: {
|
|
448
|
+
type: PropType<(context: RenderInlineRecordContext<any>) => AdapterReturn>;
|
|
449
|
+
};
|
|
438
450
|
/** Fuction that converts an 'itemLink' node into React **/
|
|
439
|
-
renderLinkToRecord
|
|
451
|
+
renderLinkToRecord: {
|
|
452
|
+
type: PropType<(context: RenderRecordLinkContext<any>) => AdapterReturn>;
|
|
453
|
+
};
|
|
440
454
|
/** Fuction that converts a 'block' node into React **/
|
|
441
|
-
renderBlock
|
|
455
|
+
renderBlock: {
|
|
456
|
+
type: PropType<(context: RenderBlockContext<any>) => AdapterReturn>;
|
|
457
|
+
};
|
|
442
458
|
/** Function that converts 'link' and 'itemLink' `meta` into HTML props */
|
|
443
|
-
metaTransformer
|
|
459
|
+
metaTransformer: {
|
|
460
|
+
type: PropType<TransformMetaFn>;
|
|
461
|
+
};
|
|
444
462
|
/** Fuction that converts a simple string text into React **/
|
|
445
|
-
renderText
|
|
463
|
+
renderText: {
|
|
464
|
+
type: PropType<(text: string, _key: string) => AdapterReturn>;
|
|
465
|
+
};
|
|
446
466
|
/** React.createElement-like function to use to convert a node into React **/
|
|
447
|
-
renderNode
|
|
467
|
+
renderNode: {
|
|
468
|
+
type: PropType<typeof h>;
|
|
469
|
+
};
|
|
448
470
|
/** Function to use to generate a React.Fragment **/
|
|
449
|
-
renderFragment
|
|
471
|
+
renderFragment: {
|
|
472
|
+
type: PropType<(children: AdapterReturn[], _key: string) => AdapterReturn>;
|
|
473
|
+
};
|
|
474
|
+
}, () => 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<{
|
|
475
|
+
/** The actual field value you get from DatoCMS **/
|
|
476
|
+
data: {
|
|
477
|
+
type: PropType<StructuredText$1<Record$1, Record$1> | Document | Node | null | undefined>;
|
|
478
|
+
};
|
|
450
479
|
/** @deprecated use customNodeRules **/
|
|
451
|
-
customRules
|
|
452
|
-
|
|
453
|
-
|
|
480
|
+
customRules: {
|
|
481
|
+
type: PropType<RenderRule<typeof h, (text: string, _key: string) => AdapterReturn, (children: AdapterReturn[], _key: string) => AdapterReturn>[]>;
|
|
482
|
+
};
|
|
483
|
+
/** A set of additional rules to convert the document to JSX **/
|
|
484
|
+
customNodeRules: {
|
|
485
|
+
type: PropType<RenderRule<typeof h, (text: string, _key: string) => AdapterReturn, (children: AdapterReturn[], _key: string) => AdapterReturn>[]>;
|
|
486
|
+
};
|
|
487
|
+
/** A set of additional rules to convert the document to JSX **/
|
|
488
|
+
customMarkRules: {
|
|
489
|
+
type: PropType<RenderMarkRule<typeof h, (text: string, _key: string) => AdapterReturn, (children: AdapterReturn[], _key: string) => AdapterReturn>[]>;
|
|
490
|
+
};
|
|
491
|
+
/** Fuction that converts an 'inlineItem' node into React **/
|
|
492
|
+
renderInlineRecord: {
|
|
493
|
+
type: PropType<(context: RenderInlineRecordContext<any>) => AdapterReturn>;
|
|
494
|
+
};
|
|
495
|
+
/** Fuction that converts an 'itemLink' node into React **/
|
|
496
|
+
renderLinkToRecord: {
|
|
497
|
+
type: PropType<(context: RenderRecordLinkContext<any>) => AdapterReturn>;
|
|
498
|
+
};
|
|
499
|
+
/** Fuction that converts a 'block' node into React **/
|
|
500
|
+
renderBlock: {
|
|
501
|
+
type: PropType<(context: RenderBlockContext<any>) => AdapterReturn>;
|
|
502
|
+
};
|
|
503
|
+
/** Function that converts 'link' and 'itemLink' `meta` into HTML props */
|
|
504
|
+
metaTransformer: {
|
|
505
|
+
type: PropType<TransformMetaFn>;
|
|
506
|
+
};
|
|
507
|
+
/** Fuction that converts a simple string text into React **/
|
|
508
|
+
renderText: {
|
|
509
|
+
type: PropType<(text: string, _key: string) => AdapterReturn>;
|
|
510
|
+
};
|
|
511
|
+
/** React.createElement-like function to use to convert a node into React **/
|
|
512
|
+
renderNode: {
|
|
513
|
+
type: PropType<typeof h>;
|
|
514
|
+
};
|
|
515
|
+
/** Function to use to generate a React.Fragment **/
|
|
516
|
+
renderFragment: {
|
|
517
|
+
type: PropType<(children: AdapterReturn[], _key: string) => AdapterReturn>;
|
|
518
|
+
};
|
|
519
|
+
}>>, {}, {}>;
|
|
454
520
|
declare const DatocmsStructuredTextPlugin: {
|
|
455
521
|
install: (Vue: any) => void;
|
|
456
522
|
};
|
|
@@ -545,6 +611,11 @@ declare const VideoPlayer: vue.DefineComponent<{
|
|
|
545
611
|
required: false;
|
|
546
612
|
default: () => boolean;
|
|
547
613
|
};
|
|
614
|
+
disableTracking: {
|
|
615
|
+
type: BooleanConstructor;
|
|
616
|
+
required: false;
|
|
617
|
+
default: () => boolean;
|
|
618
|
+
};
|
|
548
619
|
disablePictureInPicture: {
|
|
549
620
|
type: BooleanConstructor;
|
|
550
621
|
required: false;
|
|
@@ -714,6 +785,7 @@ declare const VideoPlayer: vue.DefineComponent<{
|
|
|
714
785
|
muxPlayerRef: vue.Ref<MuxPlayerElement | undefined>;
|
|
715
786
|
computedProps: {
|
|
716
787
|
disableCookies: boolean;
|
|
788
|
+
disableTracking: boolean;
|
|
717
789
|
preload: string;
|
|
718
790
|
style?: (vue.CSSProperties | null) | undefined;
|
|
719
791
|
title?: (string | null) | undefined;
|
|
@@ -867,6 +939,11 @@ declare const VideoPlayer: vue.DefineComponent<{
|
|
|
867
939
|
required: false;
|
|
868
940
|
default: () => boolean;
|
|
869
941
|
};
|
|
942
|
+
disableTracking: {
|
|
943
|
+
type: BooleanConstructor;
|
|
944
|
+
required: false;
|
|
945
|
+
default: () => boolean;
|
|
946
|
+
};
|
|
870
947
|
disablePictureInPicture: {
|
|
871
948
|
type: BooleanConstructor;
|
|
872
949
|
required: false;
|
|
@@ -1070,6 +1147,7 @@ declare const VideoPlayer: vue.DefineComponent<{
|
|
|
1070
1147
|
defaultHiddenCaptions: boolean;
|
|
1071
1148
|
defaultShowRemainingTime: boolean;
|
|
1072
1149
|
disableCookies: boolean;
|
|
1150
|
+
disableTracking: boolean;
|
|
1073
1151
|
noVolumePref: boolean;
|
|
1074
1152
|
}, {}>;
|
|
1075
1153
|
declare const DatocmsVideoPlayerPlugin: {
|
|
@@ -1222,4 +1300,4 @@ declare const toHead: (...args: ToMetaTagsType[]) => {
|
|
|
1222
1300
|
}[];
|
|
1223
1301
|
};
|
|
1224
1302
|
|
|
1225
|
-
export { DatocmsImagePlugin, DatocmsNakedImagePlugin, DatocmsStructuredTextPlugin, DatocmsVideoPlayerPlugin, DisabledQueryListenerOptions, EnabledQueryListenerOptions, GenericClient, Image, NakedImage, QueryListenerOptions, RawSearchResult, RenderBlockContext, RenderInlineRecordContext, RenderRecordLinkContext, ResponsiveImageType, SeoMetaTagType, StructuredText,
|
|
1303
|
+
export { DatocmsImagePlugin, DatocmsNakedImagePlugin, DatocmsStructuredTextPlugin, DatocmsVideoPlayerPlugin, DisabledQueryListenerOptions, EnabledQueryListenerOptions, GenericClient, Image, NakedImage, QueryListenerOptions, RawSearchResult, RenderBlockContext, RenderInlineRecordContext, RenderRecordLinkContext, ResponsiveImageType, SeoMetaTagType, StructuredText, SubscribeToQueryOptions, ToMetaTagsType, UseSiteSearchConfig, UseSiteSearchData, UseSiteSearchResult, Video, VideoPlayer, appendKeyToValidElement, defaultAdapter, isKeyOf, isNil, toHead, toNativeAttrName, toNativeAttrValue, useQuerySubscription, useSiteSearch, useVideoPlayer };
|
package/dist/index.esm.mjs
CHANGED
|
@@ -162,17 +162,17 @@ function buildRegularSource(data, sizes, srcSetCandidates) {
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
var __defProp$6 = Object.defineProperty;
|
|
165
|
-
var __getOwnPropSymbols$
|
|
166
|
-
var __hasOwnProp$
|
|
167
|
-
var __propIsEnum$
|
|
165
|
+
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
166
|
+
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
167
|
+
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
168
168
|
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
169
169
|
var __spreadValues$6 = (a, b) => {
|
|
170
170
|
for (var prop in b || (b = {}))
|
|
171
|
-
if (__hasOwnProp$
|
|
171
|
+
if (__hasOwnProp$6.call(b, prop))
|
|
172
172
|
__defNormalProp$6(a, prop, b[prop]);
|
|
173
|
-
if (__getOwnPropSymbols$
|
|
174
|
-
for (var prop of __getOwnPropSymbols$
|
|
175
|
-
if (__propIsEnum$
|
|
173
|
+
if (__getOwnPropSymbols$6)
|
|
174
|
+
for (var prop of __getOwnPropSymbols$6(b)) {
|
|
175
|
+
if (__propIsEnum$6.call(b, prop))
|
|
176
176
|
__defNormalProp$6(a, prop, b[prop]);
|
|
177
177
|
}
|
|
178
178
|
return a;
|
|
@@ -210,17 +210,17 @@ const Sizer = defineComponent({
|
|
|
210
210
|
var __defProp$5 = Object.defineProperty;
|
|
211
211
|
var __defProps$3 = Object.defineProperties;
|
|
212
212
|
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
|
213
|
-
var __getOwnPropSymbols$
|
|
214
|
-
var __hasOwnProp$
|
|
215
|
-
var __propIsEnum$
|
|
213
|
+
var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
|
|
214
|
+
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
|
215
|
+
var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
|
|
216
216
|
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
217
217
|
var __spreadValues$5 = (a, b) => {
|
|
218
218
|
for (var prop in b || (b = {}))
|
|
219
|
-
if (__hasOwnProp$
|
|
219
|
+
if (__hasOwnProp$5.call(b, prop))
|
|
220
220
|
__defNormalProp$5(a, prop, b[prop]);
|
|
221
|
-
if (__getOwnPropSymbols$
|
|
222
|
-
for (var prop of __getOwnPropSymbols$
|
|
223
|
-
if (__propIsEnum$
|
|
221
|
+
if (__getOwnPropSymbols$5)
|
|
222
|
+
for (var prop of __getOwnPropSymbols$5(b)) {
|
|
223
|
+
if (__propIsEnum$5.call(b, prop))
|
|
224
224
|
__defNormalProp$5(a, prop, b[prop]);
|
|
225
225
|
}
|
|
226
226
|
return a;
|
|
@@ -483,17 +483,17 @@ const DatocmsImagePlugin = {
|
|
|
483
483
|
};
|
|
484
484
|
|
|
485
485
|
var __defProp$4 = Object.defineProperty;
|
|
486
|
-
var __getOwnPropSymbols$
|
|
487
|
-
var __hasOwnProp$
|
|
488
|
-
var __propIsEnum$
|
|
486
|
+
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
487
|
+
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
488
|
+
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
489
489
|
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
490
490
|
var __spreadValues$4 = (a, b) => {
|
|
491
491
|
for (var prop in b || (b = {}))
|
|
492
|
-
if (__hasOwnProp$
|
|
492
|
+
if (__hasOwnProp$4.call(b, prop))
|
|
493
493
|
__defNormalProp$4(a, prop, b[prop]);
|
|
494
|
-
if (__getOwnPropSymbols$
|
|
495
|
-
for (var prop of __getOwnPropSymbols$
|
|
496
|
-
if (__propIsEnum$
|
|
494
|
+
if (__getOwnPropSymbols$4)
|
|
495
|
+
for (var prop of __getOwnPropSymbols$4(b)) {
|
|
496
|
+
if (__propIsEnum$4.call(b, prop))
|
|
497
497
|
__defNormalProp$4(a, prop, b[prop]);
|
|
498
498
|
}
|
|
499
499
|
return a;
|
|
@@ -619,34 +619,11 @@ const DatocmsNakedImagePlugin = {
|
|
|
619
619
|
}
|
|
620
620
|
};
|
|
621
621
|
|
|
622
|
-
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
623
|
-
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
624
|
-
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
625
|
-
var __objRest$2 = (source, exclude) => {
|
|
626
|
-
var target = {};
|
|
627
|
-
for (var prop in source)
|
|
628
|
-
if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
629
|
-
target[prop] = source[prop];
|
|
630
|
-
if (source != null && __getOwnPropSymbols$4)
|
|
631
|
-
for (var prop of __getOwnPropSymbols$4(source)) {
|
|
632
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
|
|
633
|
-
target[prop] = source[prop];
|
|
634
|
-
}
|
|
635
|
-
return target;
|
|
636
|
-
};
|
|
637
|
-
const hAdapter = (tagName, props, childOrChildren) => {
|
|
638
|
-
const _a = props || {}; __objRest$2(_a, ["href", "target", "rel"]);
|
|
639
|
-
return h(
|
|
640
|
-
tagName,
|
|
641
|
-
props,
|
|
642
|
-
typeof childOrChildren === "undefined" || Array.isArray(childOrChildren) ? childOrChildren : [childOrChildren]
|
|
643
|
-
);
|
|
644
|
-
};
|
|
645
622
|
const defaultAdapter = {
|
|
646
|
-
renderNode:
|
|
647
|
-
renderMark:
|
|
648
|
-
renderFragment: (children,
|
|
649
|
-
renderText: (text,
|
|
623
|
+
renderNode: h,
|
|
624
|
+
renderMark: h,
|
|
625
|
+
renderFragment: (children, _key) => children,
|
|
626
|
+
renderText: (text, _key) => text
|
|
650
627
|
};
|
|
651
628
|
function appendKeyToValidElement(element, key) {
|
|
652
629
|
if (element !== null && typeof element !== "string" && element.key === null) {
|
|
@@ -654,8 +631,36 @@ function appendKeyToValidElement(element, key) {
|
|
|
654
631
|
}
|
|
655
632
|
return element;
|
|
656
633
|
}
|
|
657
|
-
const StructuredText = defineComponent(
|
|
658
|
-
|
|
634
|
+
const StructuredText = defineComponent({
|
|
635
|
+
name: "DatocmsStructuredText",
|
|
636
|
+
props: {
|
|
637
|
+
data: {
|
|
638
|
+
type: Object
|
|
639
|
+
},
|
|
640
|
+
customRules: {
|
|
641
|
+
type: Array
|
|
642
|
+
},
|
|
643
|
+
customNodeRules: {
|
|
644
|
+
type: Array
|
|
645
|
+
},
|
|
646
|
+
customMarkRules: {
|
|
647
|
+
type: Array
|
|
648
|
+
},
|
|
649
|
+
renderInlineRecord: {
|
|
650
|
+
type: Function
|
|
651
|
+
},
|
|
652
|
+
renderLinkToRecord: {
|
|
653
|
+
type: Function
|
|
654
|
+
},
|
|
655
|
+
renderBlock: {
|
|
656
|
+
type: Function
|
|
657
|
+
},
|
|
658
|
+
metaTransformer: { type: Function },
|
|
659
|
+
renderText: { type: Function },
|
|
660
|
+
renderNode: { type: Function },
|
|
661
|
+
renderFragment: { type: Function }
|
|
662
|
+
},
|
|
663
|
+
setup(props) {
|
|
659
664
|
return () => {
|
|
660
665
|
return render(props.data, {
|
|
661
666
|
adapter: {
|
|
@@ -760,11 +765,8 @@ const StructuredText = defineComponent(
|
|
|
760
765
|
]
|
|
761
766
|
});
|
|
762
767
|
};
|
|
763
|
-
},
|
|
764
|
-
{
|
|
765
|
-
name: "DatocmsStructuredText"
|
|
766
768
|
}
|
|
767
|
-
);
|
|
769
|
+
});
|
|
768
770
|
const DatocmsStructuredTextPlugin = {
|
|
769
771
|
install: (Vue) => {
|
|
770
772
|
Vue.component("DatocmsStructuredText", StructuredText);
|
|
@@ -965,6 +967,11 @@ const VideoPlayer = defineComponent({
|
|
|
965
967
|
required: false,
|
|
966
968
|
default: () => true
|
|
967
969
|
},
|
|
970
|
+
disableTracking: {
|
|
971
|
+
type: Boolean,
|
|
972
|
+
required: false,
|
|
973
|
+
default: () => true
|
|
974
|
+
},
|
|
968
975
|
disablePictureInPicture: {
|
|
969
976
|
type: Boolean,
|
|
970
977
|
required: false
|
|
@@ -1162,16 +1169,19 @@ const VideoPlayer = defineComponent({
|
|
|
1162
1169
|
var _b = _a, {
|
|
1163
1170
|
data = {},
|
|
1164
1171
|
disableCookies = true,
|
|
1172
|
+
disableTracking = true,
|
|
1165
1173
|
preload = "metadata"
|
|
1166
1174
|
} = _b, otherProps = __objRest$1(_b, [
|
|
1167
1175
|
"data",
|
|
1168
1176
|
"disableCookies",
|
|
1177
|
+
"disableTracking",
|
|
1169
1178
|
"preload"
|
|
1170
1179
|
]);
|
|
1171
1180
|
import('@mux/mux-player');
|
|
1172
1181
|
const muxPlayerRef = ref();
|
|
1173
1182
|
const computedProps = __spreadProps$2(__spreadValues$2({}, useVideoPlayer({ data })), {
|
|
1174
1183
|
disableCookies,
|
|
1184
|
+
disableTracking,
|
|
1175
1185
|
preload
|
|
1176
1186
|
});
|
|
1177
1187
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-datocms",
|
|
3
|
-
"version": "8.0.0
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "A set of components and utilities to work faster with DatoCMS in Vue.js environments",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datocms",
|
|
@@ -44,11 +44,12 @@
|
|
|
44
44
|
"datocms-listen": "^0.1.15",
|
|
45
45
|
"datocms-structured-text-generic-html-renderer": "^4.0.1",
|
|
46
46
|
"datocms-structured-text-utils": "^4.0.1",
|
|
47
|
+
"hls.js": "^1.5.17",
|
|
47
48
|
"hyphenate-style-name": "^1.0.4"
|
|
48
49
|
},
|
|
49
50
|
"peerDependencies": {
|
|
50
51
|
"@mux/mux-player": "*",
|
|
51
|
-
"vue": "^3.
|
|
52
|
+
"vue": "^3.0.0"
|
|
52
53
|
},
|
|
53
54
|
"peerDependenciesMeta": {
|
|
54
55
|
"@mux/mux-player": {
|
|
@@ -57,18 +58,20 @@
|
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
60
|
"@biomejs/biome": "^1.6.3",
|
|
60
|
-
"@mux/mux-player": "
|
|
61
|
+
"@mux/mux-player": "^2.5.0",
|
|
61
62
|
"@mux/playback-core": "^0.22.1",
|
|
62
63
|
"@types/hyphenate-style-name": "^1.0.2",
|
|
63
64
|
"@types/jest": "^29.5.11",
|
|
64
65
|
"@types/node": "^14.18.63",
|
|
65
66
|
"@vue/test-utils": "^2.4.3",
|
|
66
67
|
"@vuedx/typescript-plugin-vue": "^0.7.6",
|
|
68
|
+
"doctoc": "^2.0.0",
|
|
67
69
|
"esbuild": "^0.15.18",
|
|
68
70
|
"jest": "^29.7.0",
|
|
69
71
|
"jest-environment-jsdom": "^29.7.0",
|
|
70
72
|
"jest-serializer-vue": "^2.0.2",
|
|
71
73
|
"jsdom": "^19.0.0",
|
|
74
|
+
"matchmedia-polyfill": "^0.3.2",
|
|
72
75
|
"np": "^9.2.0",
|
|
73
76
|
"resize-observer-polyfill": "^1.5.1",
|
|
74
77
|
"rollup": "^2.79.1",
|
|
@@ -77,7 +80,6 @@
|
|
|
77
80
|
"ts-jest": "^29.1.1",
|
|
78
81
|
"tslib": "^2.6.2",
|
|
79
82
|
"typescript": "^4.9.5",
|
|
80
|
-
"vue-tsc": "^0.37.9"
|
|
81
|
-
"doctoc": "^2.0.0"
|
|
83
|
+
"vue-tsc": "^0.37.9"
|
|
82
84
|
}
|
|
83
85
|
}
|