vue-datocms 4.0.6 → 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.d.ts +27 -27
- package/package.json +17 -17
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
272
|
-
|
|
273
|
-
|
|
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
|
-
|
|
275
|
+
type RenderInlineRecordContext = {
|
|
276
276
|
record: Record$1;
|
|
277
277
|
};
|
|
278
|
-
|
|
278
|
+
type RenderRecordLinkContext = {
|
|
279
279
|
record: Record$1;
|
|
280
280
|
children: RenderResult<H, T, F>[];
|
|
281
281
|
transformedMeta: TransformedMeta;
|
|
282
282
|
};
|
|
283
|
-
|
|
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
|
-
|
|
382
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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<
|
|
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
|
-
|
|
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
|
-
|
|
421
|
+
type SearchResultInstancesTargetSchema = {
|
|
422
422
|
data: RawSearchResult[];
|
|
423
423
|
meta: {
|
|
424
424
|
total_count: number;
|
|
425
425
|
};
|
|
426
426
|
};
|
|
427
|
-
|
|
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
|
-
|
|
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
|
-
|
|
460
|
+
type HighlightPiece = {
|
|
461
461
|
text: string;
|
|
462
462
|
isMatch: boolean;
|
|
463
463
|
};
|
|
464
|
-
|
|
465
|
-
|
|
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
|
-
|
|
474
|
+
type UseSiteSearchData = {
|
|
475
475
|
pageResults: SearchResult[];
|
|
476
476
|
totalResults: number;
|
|
477
477
|
totalPages: number;
|
|
478
478
|
};
|
|
479
|
-
|
|
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
|
-
|
|
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
|
-
|
|
498
|
+
type ToMetaTagsType = SeoMetaTagType[];
|
|
499
499
|
declare const toHead: (...args: ToMetaTagsType[]) => {
|
|
500
500
|
title: string | null | undefined;
|
|
501
501
|
meta: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-datocms",
|
|
3
|
-
"version": "4.0.
|
|
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.
|
|
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.
|
|
58
|
-
"@types/jest": "^29.
|
|
59
|
-
"@types/node": "^14.
|
|
60
|
-
"@vue/test-utils": "^2.
|
|
61
|
-
"@vuedx/typescript-plugin-vue": "^0.6
|
|
62
|
-
"esbuild": "^0.15.
|
|
63
|
-
"jest": "^29.
|
|
64
|
-
"jest-environment-jsdom": "^29.
|
|
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": "^
|
|
68
|
-
"rollup": "^2.
|
|
69
|
-
"rollup-plugin-dts": "^4.2.
|
|
70
|
-
"rollup-plugin-esbuild": "^4.10.
|
|
71
|
-
"ts-jest": "^29.
|
|
72
|
-
"tslib": "^2.
|
|
73
|
-
"typescript": "^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
|
}
|