vue-datocms 4.0.5 → 4.0.7

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
@@ -559,10 +559,10 @@ var __objRest$1 = (source, exclude) => {
559
559
  return target;
560
560
  };
561
561
  const hAdapter = (tagName, props, childOrChildren) => {
562
- const _a = props || {}, { href } = _a, rest = __objRest$1(_a, ["href"]);
562
+ const _a = props || {}, { href, target, rel } = _a, rest = __objRest$1(_a, ["href", "target", "rel"]);
563
563
  return vueDemi.h(
564
564
  tagName,
565
- __spreadValues$2(__spreadValues$2({}, vueDemi.isVue2 && __spreadValues$2({ attrs: { href } }, rest)), vueDemi.isVue3 && props),
565
+ __spreadValues$2(__spreadValues$2({}, vueDemi.isVue2 && __spreadValues$2({ attrs: { href, target, rel } }, rest)), vueDemi.isVue3 && props),
566
566
  typeof childOrChildren === "undefined" || Array.isArray(childOrChildren) ? childOrChildren : [childOrChildren]
567
567
  );
568
568
  };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as vue_demi from 'vue-demi';
2
- import { PropType, VNodeProps, VNode, Ref } from 'vue-demi';
2
+ import { PropType, VNodeProps, VNode, Ref, UnwrapRef } from 'vue-demi';
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';
6
6
  export { RenderError, Document as StructuredTextDocument, StructuredText as StructuredTextGraphQlResponse } from 'datocms-structured-text-utils';
7
7
  import { Options, ConnectionStatus } from 'datocms-listen';
8
8
 
9
- declare type ResponsiveImageType = {
9
+ type ResponsiveImageType = {
10
10
  /** The aspect ratio (width/height) of the image */
11
11
  aspectRatio?: number;
12
12
  /** A base64-encoded thumbnail to offer during image loading */
@@ -256,31 +256,31 @@ declare const Image: vue_demi.DefineComponent<{
256
256
  usePlaceholder: boolean;
257
257
  priority: boolean;
258
258
  srcSetCandidates: unknown[];
259
- }>;
259
+ }, {}>;
260
260
  declare const DatocmsImagePlugin: {
261
261
  install: (Vue: any) => void;
262
262
  };
263
263
 
264
- declare type AdapterReturn = VNode | string | null;
264
+ type AdapterReturn = VNode | string | null;
265
265
  declare const defaultAdapter: {
266
266
  renderNode: (tagName: string, props?: VNodeProps, childOrChildren?: AdapterReturn | AdapterReturn[]) => AdapterReturn;
267
267
  renderMark: (tagName: string, props?: VNodeProps, childOrChildren?: AdapterReturn | AdapterReturn[]) => AdapterReturn;
268
268
  renderFragment: (children: AdapterReturn[], key: string) => AdapterReturn;
269
269
  renderText: (text: string, key: string) => AdapterReturn;
270
270
  };
271
- declare type H = typeof defaultAdapter.renderNode;
272
- declare type T = typeof defaultAdapter.renderText;
273
- declare type F = typeof defaultAdapter.renderFragment;
271
+ type H = typeof defaultAdapter.renderNode;
272
+ type T = typeof defaultAdapter.renderText;
273
+ type F = typeof defaultAdapter.renderFragment;
274
274
  declare function appendKeyToValidElement(element: AdapterReturn, key: string): AdapterReturn;
275
- declare type RenderInlineRecordContext = {
275
+ type RenderInlineRecordContext = {
276
276
  record: Record$1;
277
277
  };
278
- declare type RenderRecordLinkContext = {
278
+ type RenderRecordLinkContext = {
279
279
  record: Record$1;
280
280
  children: RenderResult<H, T, F>[];
281
281
  transformedMeta: TransformedMeta;
282
282
  };
283
- declare type RenderBlockContext = {
283
+ type RenderBlockContext = {
284
284
  record: Record$1;
285
285
  };
286
286
  declare const StructuredText: vue_demi.DefineComponent<{
@@ -373,27 +373,27 @@ declare const StructuredText: vue_demi.DefineComponent<{
373
373
  renderFragment: {
374
374
  type: PropType<(children: AdapterReturn[], key: string) => AdapterReturn>;
375
375
  };
376
- }>>, {}>;
376
+ }>>, {}, {}>;
377
377
  declare const DatocmsStructuredTextPlugin: {
378
378
  install: (Vue: any) => void;
379
379
  };
380
380
 
381
- declare type SubscribeToQueryOptions<QueryResult, QueryVariables> = Omit<Options<QueryResult, QueryVariables>, 'onStatusChange' | 'onUpdate' | 'onChannelError'>;
382
- declare type EnabledQueryListenerOptions<QueryResult, QueryVariables> = {
381
+ type SubscribeToQueryOptions<QueryResult, QueryVariables> = Omit<Options<QueryResult, QueryVariables>, 'onStatusChange' | 'onUpdate' | 'onChannelError'>;
382
+ type EnabledQueryListenerOptions<QueryResult, QueryVariables> = {
383
383
  /** Whether the subscription has to be performed or not */
384
384
  enabled?: true | Ref<boolean>;
385
385
  /** The initial data to use while the initial request is being performed */
386
386
  initialData?: QueryResult;
387
387
  } & SubscribeToQueryOptions<QueryResult, QueryVariables>;
388
- declare type DisabledQueryListenerOptions<QueryResult, QueryVariables> = {
388
+ type DisabledQueryListenerOptions<QueryResult, QueryVariables> = {
389
389
  /** Whether the subscription has to be performed or not */
390
390
  enabled: false | Ref<false>;
391
391
  /** The initial data to use while the initial request is being performed */
392
392
  initialData?: QueryResult;
393
393
  } & Partial<SubscribeToQueryOptions<QueryResult, QueryVariables>>;
394
- declare type QueryListenerOptions<QueryResult, QueryVariables> = EnabledQueryListenerOptions<QueryResult, QueryVariables> | DisabledQueryListenerOptions<QueryResult, QueryVariables>;
394
+ type QueryListenerOptions<QueryResult, QueryVariables> = EnabledQueryListenerOptions<QueryResult, QueryVariables> | DisabledQueryListenerOptions<QueryResult, QueryVariables>;
395
395
  declare const useQuerySubscription: <QueryResult = any, QueryVariables = Record<string, any>>({ enabled, initialData, query, token, ...other }: QueryListenerOptions<QueryResult, QueryVariables>) => {
396
- data: Ref<vue_demi.UnwrapRef<NonNullable<QueryResult>> | null>;
396
+ data: Ref<UnwrapRef<NonNullable<QueryResult>> | null>;
397
397
  status: Ref<ConnectionStatus>;
398
398
  error: Ref<{
399
399
  code: string;
@@ -403,7 +403,7 @@ declare const useQuerySubscription: <QueryResult = any, QueryVariables = Record<
403
403
  } | null>;
404
404
  };
405
405
 
406
- declare type SearchResultInstancesHrefSchema = {
406
+ type SearchResultInstancesHrefSchema = {
407
407
  page?: {
408
408
  offset?: number;
409
409
  limit?: number;
@@ -418,13 +418,13 @@ declare type SearchResultInstancesHrefSchema = {
418
418
  };
419
419
  [k: string]: unknown;
420
420
  };
421
- declare type SearchResultInstancesTargetSchema = {
421
+ type SearchResultInstancesTargetSchema = {
422
422
  data: RawSearchResult[];
423
423
  meta: {
424
424
  total_count: number;
425
425
  };
426
426
  };
427
- declare type RawSearchResult = {
427
+ type RawSearchResult = {
428
428
  type: 'search_result';
429
429
  id: string;
430
430
  attributes: {
@@ -446,7 +446,7 @@ declare class GenericClient {
446
446
  rawList(queryParams: SearchResultInstancesHrefSchema): Promise<SearchResultInstancesTargetSchema>;
447
447
  };
448
448
  }
449
- declare type UseSiteSearchConfig<Client extends GenericClient> = {
449
+ type UseSiteSearchConfig<Client extends GenericClient> = {
450
450
  client: Client;
451
451
  buildTriggerId: string;
452
452
  fuzzySearch?: boolean;
@@ -457,12 +457,12 @@ declare type UseSiteSearchConfig<Client extends GenericClient> = {
457
457
  query?: string;
458
458
  };
459
459
  };
460
- declare type HighlightPiece = {
460
+ type HighlightPiece = {
461
461
  text: string;
462
462
  isMatch: boolean;
463
463
  };
464
- declare type ResultHighlight = HighlightPiece[];
465
- declare type SearchResult = {
464
+ type ResultHighlight = HighlightPiece[];
465
+ type SearchResult = {
466
466
  id: string;
467
467
  title: string;
468
468
  titleHighlights: ResultHighlight[];
@@ -471,12 +471,12 @@ declare type SearchResult = {
471
471
  url: string;
472
472
  raw: RawSearchResult;
473
473
  };
474
- declare type UseSiteSearchData = {
474
+ type UseSiteSearchData = {
475
475
  pageResults: SearchResult[];
476
476
  totalResults: number;
477
477
  totalPages: number;
478
478
  };
479
- declare type UseSiteSearchResult = {
479
+ type UseSiteSearchResult = {
480
480
  state: {
481
481
  query: string;
482
482
  locale: string | undefined;
@@ -487,7 +487,7 @@ declare type UseSiteSearchResult = {
487
487
  };
488
488
  declare function useSiteSearch<Client extends GenericClient>(config: UseSiteSearchConfig<Client>): UseSiteSearchResult;
489
489
 
490
- declare type SeoMetaTagType = {
490
+ type SeoMetaTagType = {
491
491
  /** the tag for the meta information */
492
492
  tag: string;
493
493
  /** the inner content of the meta tag */
@@ -495,7 +495,7 @@ declare type SeoMetaTagType = {
495
495
  /** the HTML attributes to attach to the meta tag */
496
496
  attributes: Record<string, string> | null;
497
497
  };
498
- declare type ToMetaTagsType = SeoMetaTagType[];
498
+ type ToMetaTagsType = SeoMetaTagType[];
499
499
  declare const toHead: (...args: ToMetaTagsType[]) => {
500
500
  title: string | null | undefined;
501
501
  meta: {
@@ -553,10 +553,10 @@ var __objRest$1 = (source, exclude) => {
553
553
  return target;
554
554
  };
555
555
  const hAdapter = (tagName, props, childOrChildren) => {
556
- const _a = props || {}, { href } = _a, rest = __objRest$1(_a, ["href"]);
556
+ const _a = props || {}, { href, target, rel } = _a, rest = __objRest$1(_a, ["href", "target", "rel"]);
557
557
  return h(
558
558
  tagName,
559
- __spreadValues$2(__spreadValues$2({}, isVue2 && __spreadValues$2({ attrs: { href } }, rest)), isVue3 && props),
559
+ __spreadValues$2(__spreadValues$2({}, isVue2 && __spreadValues$2({ attrs: { href, target, rel } }, rest)), isVue3 && props),
560
560
  typeof childOrChildren === "undefined" || Array.isArray(childOrChildren) ? childOrChildren : [childOrChildren]
561
561
  );
562
562
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-datocms",
3
- "version": "4.0.5",
3
+ "version": "4.0.7",
4
4
  "description": "A set of components and utilities to work faster with DatoCMS in Vue.js environments",
5
5
  "keywords": [
6
6
  "datocms",
@@ -38,7 +38,7 @@
38
38
  "test": "jest --coverage"
39
39
  },
40
40
  "dependencies": {
41
- "datocms-listen": "^0.1.10",
41
+ "datocms-listen": "^0.1.15",
42
42
  "datocms-structured-text-generic-html-renderer": "^2.0.4",
43
43
  "datocms-structured-text-utils": "^2.0.4",
44
44
  "hyphenate-style-name": "^1.0.4",
@@ -54,23 +54,23 @@
54
54
  }
55
55
  },
56
56
  "devDependencies": {
57
- "@types/hyphenate-style-name": "^1.0.0",
58
- "@types/jest": "^29.1.1",
59
- "@types/node": "^14.14.41",
60
- "@vue/test-utils": "^2.1.0",
61
- "@vuedx/typescript-plugin-vue": "^0.6.3",
62
- "esbuild": "^0.15.10",
63
- "jest": "^29.1.2",
64
- "jest-environment-jsdom": "^29.1.2",
57
+ "@types/hyphenate-style-name": "^1.0.2",
58
+ "@types/jest": "^29.5.11",
59
+ "@types/node": "^14.18.63",
60
+ "@vue/test-utils": "^2.4.3",
61
+ "@vuedx/typescript-plugin-vue": "^0.7.6",
62
+ "esbuild": "^0.15.18",
63
+ "jest": "^29.7.0",
64
+ "jest-environment-jsdom": "^29.7.0",
65
65
  "jest-serializer-vue": "^2.0.2",
66
66
  "jsdom": "^19.0.0",
67
- "np": "^7.6.1",
68
- "rollup": "^2.45.2",
69
- "rollup-plugin-dts": "^4.2.2",
70
- "rollup-plugin-esbuild": "^4.10.1",
71
- "ts-jest": "^29.0.3",
72
- "tslib": "^2.4.0",
73
- "typescript": "^4.8.4",
67
+ "np": "^9.2.0",
68
+ "rollup": "^2.79.1",
69
+ "rollup-plugin-dts": "^4.2.3",
70
+ "rollup-plugin-esbuild": "^4.10.3",
71
+ "ts-jest": "^29.1.1",
72
+ "tslib": "^2.6.2",
73
+ "typescript": "^4.9.5",
74
74
  "vue": "^3.2.40",
75
75
  "vue-tsc": "^0.37.9"
76
76
  }