vue-datocms 7.0.5 → 7.0.6

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 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,7 +75,9 @@ npm run dev
71
75
  ```
72
76
 
73
77
  <!--datocms-autoinclude-footer start-->
74
- -----------------
78
+
79
+ ---
80
+
75
81
  # What is DatoCMS?
76
82
  <a href="https://www.datocms.com/"><img src="https://www.datocms.com/images/full_logo.svg" height="60"></a>
77
83
 
@@ -94,4 +100,5 @@ Trusted by over 25,000 enterprise businesses, agency partners, and individuals a
94
100
  - [DatoCMS Starters](https://www.datocms.com/marketplace/starters) has examples for various Javascript frontend frameworks
95
101
 
96
102
  Or see [all our public repos](https://github.com/orgs/datocms/repositories?q=&type=public&language=&sort=stargazers)
103
+
97
104
  <!--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$7 = Object.getOwnPropertySymbols;
190
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
191
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
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$7.call(b, prop))
195
+ if (__hasOwnProp$6.call(b, prop))
196
196
  __defNormalProp$6(a, prop, b[prop]);
197
- if (__getOwnPropSymbols$7)
198
- for (var prop of __getOwnPropSymbols$7(b)) {
199
- if (__propIsEnum$7.call(b, prop))
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$6 = Object.getOwnPropertySymbols;
238
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
239
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
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$6.call(b, prop))
243
+ if (__hasOwnProp$5.call(b, prop))
244
244
  __defNormalProp$5(a, prop, b[prop]);
245
- if (__getOwnPropSymbols$6)
246
- for (var prop of __getOwnPropSymbols$6(b)) {
247
- if (__propIsEnum$6.call(b, prop))
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$5 = Object.getOwnPropertySymbols;
511
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
512
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
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$5.call(b, prop))
516
+ if (__hasOwnProp$4.call(b, prop))
517
517
  __defNormalProp$4(a, prop, b[prop]);
518
- if (__getOwnPropSymbols$5)
519
- for (var prop of __getOwnPropSymbols$5(b)) {
520
- if (__propIsEnum$5.call(b, prop))
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: hAdapter,
671
- renderMark: hAdapter,
672
- renderFragment: (children, key) => children,
673
- renderText: (text, key) => 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) {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as vue from 'vue';
2
- import { PropType, VNodeProps, VNode, Ref, UnwrapRef, CSSProperties } from 'vue';
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: (tagName: string, props?: VNodeProps, childOrChildren?: AdapterReturn | AdapterReturn[]) => AdapterReturn;
410
- renderMark: (tagName: string, props?: VNodeProps, childOrChildren?: AdapterReturn | AdapterReturn[]) => AdapterReturn;
411
- renderFragment: (children: AdapterReturn[], key: string) => AdapterReturn;
412
- renderText: (text: string, key: string) => AdapterReturn;
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;
@@ -433,15 +433,15 @@ declare const StructuredText: vue.DefineComponent<{
433
433
  };
434
434
  /** @deprecated use customNodeRules **/
435
435
  customRules: {
436
- type: PropType<RenderRule<(tagName: string, props?: VNodeProps, childOrChildren?: AdapterReturn | AdapterReturn[]) => AdapterReturn, (text: string, key: string) => AdapterReturn, (children: AdapterReturn[], key: string) => AdapterReturn>[]>;
436
+ type: PropType<RenderRule<typeof h, (text: string, _key: string) => AdapterReturn, (children: AdapterReturn[], _key: string) => AdapterReturn>[]>;
437
437
  };
438
438
  /** A set of additional rules to convert the document to JSX **/
439
439
  customNodeRules: {
440
- type: PropType<RenderRule<(tagName: string, props?: VNodeProps, childOrChildren?: AdapterReturn | AdapterReturn[]) => AdapterReturn, (text: string, key: string) => AdapterReturn, (children: AdapterReturn[], key: string) => AdapterReturn>[]>;
440
+ type: PropType<RenderRule<typeof h, (text: string, _key: string) => AdapterReturn, (children: AdapterReturn[], _key: string) => AdapterReturn>[]>;
441
441
  };
442
442
  /** A set of additional rules to convert the document to JSX **/
443
443
  customMarkRules: {
444
- type: PropType<RenderMarkRule<(tagName: string, props?: VNodeProps, childOrChildren?: AdapterReturn | AdapterReturn[]) => AdapterReturn, (text: string, key: string) => AdapterReturn, (children: AdapterReturn[], key: string) => AdapterReturn>[]>;
444
+ type: PropType<RenderMarkRule<typeof h, (text: string, _key: string) => AdapterReturn, (children: AdapterReturn[], _key: string) => AdapterReturn>[]>;
445
445
  };
446
446
  /** Fuction that converts an 'inlineItem' node into React **/
447
447
  renderInlineRecord: {
@@ -461,32 +461,32 @@ declare const StructuredText: vue.DefineComponent<{
461
461
  };
462
462
  /** Fuction that converts a simple string text into React **/
463
463
  renderText: {
464
- type: PropType<(text: string, key: string) => AdapterReturn>;
464
+ type: PropType<(text: string, _key: string) => AdapterReturn>;
465
465
  };
466
466
  /** React.createElement-like function to use to convert a node into React **/
467
467
  renderNode: {
468
- type: PropType<(tagName: string, props?: VNodeProps, childOrChildren?: AdapterReturn | AdapterReturn[]) => AdapterReturn>;
468
+ type: PropType<typeof h>;
469
469
  };
470
470
  /** Function to use to generate a React.Fragment **/
471
471
  renderFragment: {
472
- type: PropType<(children: AdapterReturn[], key: string) => AdapterReturn>;
472
+ type: PropType<(children: AdapterReturn[], _key: string) => AdapterReturn>;
473
473
  };
474
- }, () => RenderResult<(tagName: string, props?: VNodeProps, childOrChildren?: AdapterReturn | AdapterReturn[]) => AdapterReturn, (text: string, key: string) => AdapterReturn, (children: AdapterReturn[], key: string) => AdapterReturn>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
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
475
  /** The actual field value you get from DatoCMS **/
476
476
  data: {
477
477
  type: PropType<StructuredText$1<Record$1, Record$1> | Document | Node | null | undefined>;
478
478
  };
479
479
  /** @deprecated use customNodeRules **/
480
480
  customRules: {
481
- type: PropType<RenderRule<(tagName: string, props?: VNodeProps, childOrChildren?: AdapterReturn | AdapterReturn[]) => AdapterReturn, (text: string, key: string) => AdapterReturn, (children: AdapterReturn[], key: string) => AdapterReturn>[]>;
481
+ type: PropType<RenderRule<typeof h, (text: string, _key: string) => AdapterReturn, (children: AdapterReturn[], _key: string) => AdapterReturn>[]>;
482
482
  };
483
483
  /** A set of additional rules to convert the document to JSX **/
484
484
  customNodeRules: {
485
- type: PropType<RenderRule<(tagName: string, props?: VNodeProps, childOrChildren?: AdapterReturn | AdapterReturn[]) => AdapterReturn, (text: string, key: string) => AdapterReturn, (children: AdapterReturn[], key: string) => AdapterReturn>[]>;
485
+ type: PropType<RenderRule<typeof h, (text: string, _key: string) => AdapterReturn, (children: AdapterReturn[], _key: string) => AdapterReturn>[]>;
486
486
  };
487
487
  /** A set of additional rules to convert the document to JSX **/
488
488
  customMarkRules: {
489
- type: PropType<RenderMarkRule<(tagName: string, props?: VNodeProps, childOrChildren?: AdapterReturn | AdapterReturn[]) => AdapterReturn, (text: string, key: string) => AdapterReturn, (children: AdapterReturn[], key: string) => AdapterReturn>[]>;
489
+ type: PropType<RenderMarkRule<typeof h, (text: string, _key: string) => AdapterReturn, (children: AdapterReturn[], _key: string) => AdapterReturn>[]>;
490
490
  };
491
491
  /** Fuction that converts an 'inlineItem' node into React **/
492
492
  renderInlineRecord: {
@@ -506,15 +506,15 @@ declare const StructuredText: vue.DefineComponent<{
506
506
  };
507
507
  /** Fuction that converts a simple string text into React **/
508
508
  renderText: {
509
- type: PropType<(text: string, key: string) => AdapterReturn>;
509
+ type: PropType<(text: string, _key: string) => AdapterReturn>;
510
510
  };
511
511
  /** React.createElement-like function to use to convert a node into React **/
512
512
  renderNode: {
513
- type: PropType<(tagName: string, props?: VNodeProps, childOrChildren?: AdapterReturn | AdapterReturn[]) => AdapterReturn>;
513
+ type: PropType<typeof h>;
514
514
  };
515
515
  /** Function to use to generate a React.Fragment **/
516
516
  renderFragment: {
517
- type: PropType<(children: AdapterReturn[], key: string) => AdapterReturn>;
517
+ type: PropType<(children: AdapterReturn[], _key: string) => AdapterReturn>;
518
518
  };
519
519
  }>>, {}, {}>;
520
520
  declare const DatocmsStructuredTextPlugin: {
@@ -162,17 +162,17 @@ function buildRegularSource(data, sizes, srcSetCandidates) {
162
162
  }
163
163
 
164
164
  var __defProp$6 = Object.defineProperty;
165
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
166
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
167
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
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$7.call(b, prop))
171
+ if (__hasOwnProp$6.call(b, prop))
172
172
  __defNormalProp$6(a, prop, b[prop]);
173
- if (__getOwnPropSymbols$7)
174
- for (var prop of __getOwnPropSymbols$7(b)) {
175
- if (__propIsEnum$7.call(b, prop))
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$6 = Object.getOwnPropertySymbols;
214
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
215
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
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$6.call(b, prop))
219
+ if (__hasOwnProp$5.call(b, prop))
220
220
  __defNormalProp$5(a, prop, b[prop]);
221
- if (__getOwnPropSymbols$6)
222
- for (var prop of __getOwnPropSymbols$6(b)) {
223
- if (__propIsEnum$6.call(b, prop))
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$5 = Object.getOwnPropertySymbols;
487
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
488
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
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$5.call(b, prop))
492
+ if (__hasOwnProp$4.call(b, prop))
493
493
  __defNormalProp$4(a, prop, b[prop]);
494
- if (__getOwnPropSymbols$5)
495
- for (var prop of __getOwnPropSymbols$5(b)) {
496
- if (__propIsEnum$5.call(b, prop))
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: hAdapter,
647
- renderMark: hAdapter,
648
- renderFragment: (children, key) => children,
649
- renderText: (text, key) => 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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-datocms",
3
- "version": "7.0.5",
3
+ "version": "7.0.6",
4
4
  "description": "A set of components and utilities to work faster with DatoCMS in Vue.js environments",
5
5
  "keywords": [
6
6
  "datocms",