@prismicio/vue 3.0.0 → 3.1.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/dist/index.cjs +57 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +19 -162
- package/dist/index.js +57 -19
- package/dist/index.js.map +1 -1
- package/package.json +19 -18
- package/src/components/SliceZone.ts +7 -1
- package/src/createPrismic.ts +5 -2
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ declare type ExtractSliceType<TSlice extends SliceLike> = TSlice extends SliceLi
|
|
|
22
22
|
*/
|
|
23
23
|
declare type SliceLikeRestV2<TSliceType extends string = string> = {
|
|
24
24
|
slice_type: Slice<TSliceType>["slice_type"];
|
|
25
|
+
id?: string;
|
|
25
26
|
};
|
|
26
27
|
/**
|
|
27
28
|
* The minimum required properties to represent a Prismic Slice from the Prismic
|
|
@@ -1042,15 +1043,7 @@ declare type ClientComposableReturnType<TData = unknown> = {
|
|
|
1042
1043
|
* @see Underlying `@prismicio/client` method {@link Client.get}
|
|
1043
1044
|
*/
|
|
1044
1045
|
declare const usePrismicDocuments: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1045
|
-
signal?:
|
|
1046
|
-
aborted: any;
|
|
1047
|
-
addEventListener: any;
|
|
1048
|
-
removeEventListener: any;
|
|
1049
|
-
dispatchEvent: any;
|
|
1050
|
-
onabort: any;
|
|
1051
|
-
reason: any;
|
|
1052
|
-
throwIfAborted: any;
|
|
1053
|
-
} | undefined;
|
|
1046
|
+
signal?: _prismicio_client.AbortSignalLike | undefined;
|
|
1054
1047
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
|
|
1055
1048
|
/**
|
|
1056
1049
|
* A composable that queries content from the Prismic repository and returns
|
|
@@ -1068,15 +1061,7 @@ declare const usePrismicDocuments: <TDocument extends PrismicDocument<Record<str
|
|
|
1068
1061
|
* @see Underlying `@prismicio/client` method {@link Client.getFirst}
|
|
1069
1062
|
*/
|
|
1070
1063
|
declare const useFirstPrismicDocument: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1071
|
-
signal?:
|
|
1072
|
-
aborted: any;
|
|
1073
|
-
addEventListener: any;
|
|
1074
|
-
removeEventListener: any;
|
|
1075
|
-
dispatchEvent: any;
|
|
1076
|
-
onabort: any;
|
|
1077
|
-
reason: any;
|
|
1078
|
-
throwIfAborted: any;
|
|
1079
|
-
} | undefined;
|
|
1064
|
+
signal?: _prismicio_client.AbortSignalLike | undefined;
|
|
1080
1065
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument>;
|
|
1081
1066
|
/**
|
|
1082
1067
|
* A composable that queries a document from the Prismic repository with a specific ID.
|
|
@@ -1094,15 +1079,7 @@ declare const useFirstPrismicDocument: <TDocument extends PrismicDocument<Record
|
|
|
1094
1079
|
* @see Underlying `@prismicio/client` method {@link Client.getByID}
|
|
1095
1080
|
*/
|
|
1096
1081
|
declare const usePrismicDocumentByID: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(id: string, params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1097
|
-
signal?:
|
|
1098
|
-
aborted: any;
|
|
1099
|
-
addEventListener: any;
|
|
1100
|
-
removeEventListener: any;
|
|
1101
|
-
dispatchEvent: any;
|
|
1102
|
-
onabort: any;
|
|
1103
|
-
reason: any;
|
|
1104
|
-
throwIfAborted: any;
|
|
1105
|
-
} | undefined;
|
|
1082
|
+
signal?: _prismicio_client.AbortSignalLike | undefined;
|
|
1106
1083
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument>;
|
|
1107
1084
|
/**
|
|
1108
1085
|
* A composable that queries documents from the Prismic repository with specific IDs.
|
|
@@ -1120,15 +1097,7 @@ declare const usePrismicDocumentByID: <TDocument extends PrismicDocument<Record<
|
|
|
1120
1097
|
* @see Underlying `@prismicio/client` method {@link Client.getByIDs}
|
|
1121
1098
|
*/
|
|
1122
1099
|
declare const usePrismicDocumentsByIDs: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(ids: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1123
|
-
signal?:
|
|
1124
|
-
aborted: any;
|
|
1125
|
-
addEventListener: any;
|
|
1126
|
-
removeEventListener: any;
|
|
1127
|
-
dispatchEvent: any;
|
|
1128
|
-
onabort: any;
|
|
1129
|
-
reason: any;
|
|
1130
|
-
throwIfAborted: any;
|
|
1131
|
-
} | undefined;
|
|
1100
|
+
signal?: _prismicio_client.AbortSignalLike | undefined;
|
|
1132
1101
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
|
|
1133
1102
|
/**
|
|
1134
1103
|
* A composable that queries all documents from the Prismic repository with specific IDs.
|
|
@@ -1148,15 +1117,7 @@ declare const usePrismicDocumentsByIDs: <TDocument extends PrismicDocument<Recor
|
|
|
1148
1117
|
declare const useAllPrismicDocumentsByIDs: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(ids: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1149
1118
|
limit?: number | undefined;
|
|
1150
1119
|
} & {
|
|
1151
|
-
signal?:
|
|
1152
|
-
aborted: any;
|
|
1153
|
-
addEventListener: any;
|
|
1154
|
-
removeEventListener: any;
|
|
1155
|
-
dispatchEvent: any;
|
|
1156
|
-
onabort: any;
|
|
1157
|
-
reason: any;
|
|
1158
|
-
throwIfAborted: any;
|
|
1159
|
-
} | undefined;
|
|
1120
|
+
signal?: _prismicio_client.AbortSignalLike | undefined;
|
|
1160
1121
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
|
|
1161
1122
|
/**
|
|
1162
1123
|
* A composable that queries a document from the Prismic repository with a
|
|
@@ -1176,15 +1137,7 @@ declare const useAllPrismicDocumentsByIDs: <TDocument extends PrismicDocument<Re
|
|
|
1176
1137
|
* @see Underlying `@prismicio/client` method {@link Client.getByUID}
|
|
1177
1138
|
*/
|
|
1178
1139
|
declare const usePrismicDocumentByUID: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(documentType: any, uid: string, params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1179
|
-
signal?:
|
|
1180
|
-
aborted: any;
|
|
1181
|
-
addEventListener: any;
|
|
1182
|
-
removeEventListener: any;
|
|
1183
|
-
dispatchEvent: any;
|
|
1184
|
-
onabort: any;
|
|
1185
|
-
reason: any;
|
|
1186
|
-
throwIfAborted: any;
|
|
1187
|
-
} | undefined;
|
|
1140
|
+
signal?: _prismicio_client.AbortSignalLike | undefined;
|
|
1188
1141
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument>;
|
|
1189
1142
|
/**
|
|
1190
1143
|
* A composable that queries documents from the Prismic repository with specific UIDs.
|
|
@@ -1203,15 +1156,7 @@ declare const usePrismicDocumentByUID: <TDocument extends PrismicDocument<Record
|
|
|
1203
1156
|
* @see Underlying `@prismicio/client` method {@link Client.getByIDs}
|
|
1204
1157
|
*/
|
|
1205
1158
|
declare const usePrismicDocumentsByUIDs: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(documentType: any, uids: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1206
|
-
signal?:
|
|
1207
|
-
aborted: any;
|
|
1208
|
-
addEventListener: any;
|
|
1209
|
-
removeEventListener: any;
|
|
1210
|
-
dispatchEvent: any;
|
|
1211
|
-
onabort: any;
|
|
1212
|
-
reason: any;
|
|
1213
|
-
throwIfAborted: any;
|
|
1214
|
-
} | undefined;
|
|
1159
|
+
signal?: _prismicio_client.AbortSignalLike | undefined;
|
|
1215
1160
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
|
|
1216
1161
|
/**
|
|
1217
1162
|
* A composable that queries all documents from the Prismic repository with specific UIDs.
|
|
@@ -1232,15 +1177,7 @@ declare const usePrismicDocumentsByUIDs: <TDocument extends PrismicDocument<Reco
|
|
|
1232
1177
|
declare const useAllPrismicDocumentsByUIDs: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(documentType: any, ids: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1233
1178
|
limit?: number | undefined;
|
|
1234
1179
|
} & {
|
|
1235
|
-
signal?:
|
|
1236
|
-
aborted: any;
|
|
1237
|
-
addEventListener: any;
|
|
1238
|
-
removeEventListener: any;
|
|
1239
|
-
dispatchEvent: any;
|
|
1240
|
-
onabort: any;
|
|
1241
|
-
reason: any;
|
|
1242
|
-
throwIfAborted: any;
|
|
1243
|
-
} | undefined;
|
|
1180
|
+
signal?: _prismicio_client.AbortSignalLike | undefined;
|
|
1244
1181
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
|
|
1245
1182
|
/**
|
|
1246
1183
|
* A composable that queries a singleton document from the Prismic repository
|
|
@@ -1259,15 +1196,7 @@ declare const useAllPrismicDocumentsByUIDs: <TDocument extends PrismicDocument<R
|
|
|
1259
1196
|
* @see Underlying `@prismicio/client` method {@link Client.getSingle}
|
|
1260
1197
|
*/
|
|
1261
1198
|
declare const useSinglePrismicDocument: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(documentType: any, params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1262
|
-
signal?:
|
|
1263
|
-
aborted: any;
|
|
1264
|
-
addEventListener: any;
|
|
1265
|
-
removeEventListener: any;
|
|
1266
|
-
dispatchEvent: any;
|
|
1267
|
-
onabort: any;
|
|
1268
|
-
reason: any;
|
|
1269
|
-
throwIfAborted: any;
|
|
1270
|
-
} | undefined;
|
|
1199
|
+
signal?: _prismicio_client.AbortSignalLike | undefined;
|
|
1271
1200
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument>;
|
|
1272
1201
|
/**
|
|
1273
1202
|
* A composable that queries documents from the Prismic repository for a
|
|
@@ -1286,15 +1215,7 @@ declare const useSinglePrismicDocument: <TDocument extends PrismicDocument<Recor
|
|
|
1286
1215
|
* @see Underlying `@prismicio/client` method {@link Client.getByType}
|
|
1287
1216
|
*/
|
|
1288
1217
|
declare const usePrismicDocumentsByType: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(documentType: any, params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1289
|
-
signal?:
|
|
1290
|
-
aborted: any;
|
|
1291
|
-
addEventListener: any;
|
|
1292
|
-
removeEventListener: any;
|
|
1293
|
-
dispatchEvent: any;
|
|
1294
|
-
onabort: any;
|
|
1295
|
-
reason: any;
|
|
1296
|
-
throwIfAborted: any;
|
|
1297
|
-
} | undefined;
|
|
1218
|
+
signal?: _prismicio_client.AbortSignalLike | undefined;
|
|
1298
1219
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
|
|
1299
1220
|
/**
|
|
1300
1221
|
* A composable that queries all documents from the Prismic repository for a
|
|
@@ -1315,15 +1236,7 @@ declare const usePrismicDocumentsByType: <TDocument extends PrismicDocument<Reco
|
|
|
1315
1236
|
declare const useAllPrismicDocumentsByType: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(documentType: any, params?: (Partial<Omit<_prismicio_client.BuildQueryURLArgs, "page">> & {
|
|
1316
1237
|
limit?: number | undefined;
|
|
1317
1238
|
} & {
|
|
1318
|
-
signal?:
|
|
1319
|
-
aborted: any;
|
|
1320
|
-
addEventListener: any;
|
|
1321
|
-
removeEventListener: any;
|
|
1322
|
-
dispatchEvent: any;
|
|
1323
|
-
onabort: any;
|
|
1324
|
-
reason: any;
|
|
1325
|
-
throwIfAborted: any;
|
|
1326
|
-
} | undefined;
|
|
1239
|
+
signal?: _prismicio_client.AbortSignalLike | undefined;
|
|
1327
1240
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
|
|
1328
1241
|
/**
|
|
1329
1242
|
* A composable that queries documents from the Prismic repository with a specific tag.
|
|
@@ -1341,15 +1254,7 @@ declare const useAllPrismicDocumentsByType: <TDocument extends PrismicDocument<R
|
|
|
1341
1254
|
* @see Underlying `@prismicio/client` method {@link Client.getByTag}
|
|
1342
1255
|
*/
|
|
1343
1256
|
declare const usePrismicDocumentsByTag: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(tag: string, params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1344
|
-
signal?:
|
|
1345
|
-
aborted: any;
|
|
1346
|
-
addEventListener: any;
|
|
1347
|
-
removeEventListener: any;
|
|
1348
|
-
dispatchEvent: any;
|
|
1349
|
-
onabort: any;
|
|
1350
|
-
reason: any;
|
|
1351
|
-
throwIfAborted: any;
|
|
1352
|
-
} | undefined;
|
|
1257
|
+
signal?: _prismicio_client.AbortSignalLike | undefined;
|
|
1353
1258
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
|
|
1354
1259
|
/**
|
|
1355
1260
|
* A composable that queries all documents from the Prismic repository with a
|
|
@@ -1370,15 +1275,7 @@ declare const usePrismicDocumentsByTag: <TDocument extends PrismicDocument<Recor
|
|
|
1370
1275
|
declare const useAllPrismicDocumentsByTag: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(tag: string, params?: (Partial<Omit<_prismicio_client.BuildQueryURLArgs, "page">> & {
|
|
1371
1276
|
limit?: number | undefined;
|
|
1372
1277
|
} & {
|
|
1373
|
-
signal?:
|
|
1374
|
-
aborted: any;
|
|
1375
|
-
addEventListener: any;
|
|
1376
|
-
removeEventListener: any;
|
|
1377
|
-
dispatchEvent: any;
|
|
1378
|
-
onabort: any;
|
|
1379
|
-
reason: any;
|
|
1380
|
-
throwIfAborted: any;
|
|
1381
|
-
} | undefined;
|
|
1278
|
+
signal?: _prismicio_client.AbortSignalLike | undefined;
|
|
1382
1279
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
|
|
1383
1280
|
/**
|
|
1384
1281
|
* A composable that queries documents from the Prismic repository with specific
|
|
@@ -1397,15 +1294,7 @@ declare const useAllPrismicDocumentsByTag: <TDocument extends PrismicDocument<Re
|
|
|
1397
1294
|
* @see Underlying `@prismicio/client` method {@link Client.getByTags}
|
|
1398
1295
|
*/
|
|
1399
1296
|
declare const usePrismicDocumentsByEveryTag: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(tags: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1400
|
-
signal?:
|
|
1401
|
-
aborted: any;
|
|
1402
|
-
addEventListener: any;
|
|
1403
|
-
removeEventListener: any;
|
|
1404
|
-
dispatchEvent: any;
|
|
1405
|
-
onabort: any;
|
|
1406
|
-
reason: any;
|
|
1407
|
-
throwIfAborted: any;
|
|
1408
|
-
} | undefined;
|
|
1297
|
+
signal?: _prismicio_client.AbortSignalLike | undefined;
|
|
1409
1298
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
|
|
1410
1299
|
/**
|
|
1411
1300
|
* A composable that queries all documents from the Prismic repository with
|
|
@@ -1426,15 +1315,7 @@ declare const usePrismicDocumentsByEveryTag: <TDocument extends PrismicDocument<
|
|
|
1426
1315
|
declare const useAllPrismicDocumentsByEveryTag: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(tags: string[], params?: (Partial<Omit<_prismicio_client.BuildQueryURLArgs, "page">> & {
|
|
1427
1316
|
limit?: number | undefined;
|
|
1428
1317
|
} & {
|
|
1429
|
-
signal?:
|
|
1430
|
-
aborted: any;
|
|
1431
|
-
addEventListener: any;
|
|
1432
|
-
removeEventListener: any;
|
|
1433
|
-
dispatchEvent: any;
|
|
1434
|
-
onabort: any;
|
|
1435
|
-
reason: any;
|
|
1436
|
-
throwIfAborted: any;
|
|
1437
|
-
} | undefined;
|
|
1318
|
+
signal?: _prismicio_client.AbortSignalLike | undefined;
|
|
1438
1319
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
|
|
1439
1320
|
/**
|
|
1440
1321
|
* A composable that queries documents from the Prismic repository with specific
|
|
@@ -1453,15 +1334,7 @@ declare const useAllPrismicDocumentsByEveryTag: <TDocument extends PrismicDocume
|
|
|
1453
1334
|
* @see Underlying `@prismicio/client` method {@link Client.getByTags}
|
|
1454
1335
|
*/
|
|
1455
1336
|
declare const usePrismicDocumentsBySomeTags: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(tags: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1456
|
-
signal?:
|
|
1457
|
-
aborted: any;
|
|
1458
|
-
addEventListener: any;
|
|
1459
|
-
removeEventListener: any;
|
|
1460
|
-
dispatchEvent: any;
|
|
1461
|
-
onabort: any;
|
|
1462
|
-
reason: any;
|
|
1463
|
-
throwIfAborted: any;
|
|
1464
|
-
} | undefined;
|
|
1337
|
+
signal?: _prismicio_client.AbortSignalLike | undefined;
|
|
1465
1338
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
|
|
1466
1339
|
/**
|
|
1467
1340
|
* A composable that queries all documents from the Prismic repository with
|
|
@@ -1483,15 +1356,7 @@ declare const usePrismicDocumentsBySomeTags: <TDocument extends PrismicDocument<
|
|
|
1483
1356
|
declare const useAllPrismicDocumentsBySomeTags: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(tags: string[], params?: (Partial<Omit<_prismicio_client.BuildQueryURLArgs, "page">> & {
|
|
1484
1357
|
limit?: number | undefined;
|
|
1485
1358
|
} & {
|
|
1486
|
-
signal?:
|
|
1487
|
-
aborted: any;
|
|
1488
|
-
addEventListener: any;
|
|
1489
|
-
removeEventListener: any;
|
|
1490
|
-
dispatchEvent: any;
|
|
1491
|
-
onabort: any;
|
|
1492
|
-
reason: any;
|
|
1493
|
-
throwIfAborted: any;
|
|
1494
|
-
} | undefined;
|
|
1359
|
+
signal?: _prismicio_client.AbortSignalLike | undefined;
|
|
1495
1360
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
|
|
1496
1361
|
/**
|
|
1497
1362
|
* **IMPORTANT**: Avoid using `dangerouslyUseAllPrismicDocuments` as it may be
|
|
@@ -1515,15 +1380,7 @@ declare const useAllPrismicDocumentsBySomeTags: <TDocument extends PrismicDocume
|
|
|
1515
1380
|
declare const dangerouslyUseAllPrismicDocuments: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(params?: (Partial<Omit<_prismicio_client.BuildQueryURLArgs, "page">> & {
|
|
1516
1381
|
limit?: number | undefined;
|
|
1517
1382
|
} & {
|
|
1518
|
-
signal?:
|
|
1519
|
-
aborted: any;
|
|
1520
|
-
addEventListener: any;
|
|
1521
|
-
removeEventListener: any;
|
|
1522
|
-
dispatchEvent: any;
|
|
1523
|
-
onabort: any;
|
|
1524
|
-
reason: any;
|
|
1525
|
-
throwIfAborted: any;
|
|
1526
|
-
} | undefined;
|
|
1383
|
+
signal?: _prismicio_client.AbortSignalLike | undefined;
|
|
1527
1384
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
|
|
1528
1385
|
|
|
1529
1386
|
/**
|
package/dist/index.js
CHANGED
|
@@ -65,7 +65,10 @@ const usePrismicImage = (props) => {
|
|
|
65
65
|
const pixelDensities = unref(props.pixelDensities);
|
|
66
66
|
if (widths) {
|
|
67
67
|
if (!__PRODUCTION__ && pixelDensities) {
|
|
68
|
-
console.warn(
|
|
68
|
+
console.warn(
|
|
69
|
+
"[PrismicImage] Only one of `widths` or `pixelDensities` props can be provided. You can resolve this warning by removing either the `widths` or `pixelDensities` prop. `widths` will be used in this case.",
|
|
70
|
+
props
|
|
71
|
+
);
|
|
69
72
|
}
|
|
70
73
|
return asImageWidthSrcSet(field, {
|
|
71
74
|
...imgixParams,
|
|
@@ -276,9 +279,17 @@ const PrismicLinkImpl = /* @__PURE__ */ defineComponent({
|
|
|
276
279
|
const { type, href, target, rel } = usePrismicLink(props);
|
|
277
280
|
return () => {
|
|
278
281
|
const parent = type.value === "a" ? "a" : simplyResolveComponent(type.value);
|
|
279
|
-
const computedSlots = getSlots(
|
|
282
|
+
const computedSlots = getSlots(
|
|
283
|
+
parent,
|
|
284
|
+
slots,
|
|
285
|
+
reactive({ href: href.value })
|
|
286
|
+
);
|
|
280
287
|
if (typeof parent === "string") {
|
|
281
|
-
return h(
|
|
288
|
+
return h(
|
|
289
|
+
parent,
|
|
290
|
+
{ href: href.value, target: target.value, rel: rel.value },
|
|
291
|
+
computedSlots
|
|
292
|
+
);
|
|
282
293
|
} else {
|
|
283
294
|
return h(parent, { to: href.value }, computedSlots);
|
|
284
295
|
}
|
|
@@ -409,13 +420,19 @@ const PrismicRichTextImpl = /* @__PURE__ */ defineComponent({
|
|
|
409
420
|
}
|
|
410
421
|
};
|
|
411
422
|
const removeListeners = () => {
|
|
412
|
-
links.forEach(
|
|
423
|
+
links.forEach(
|
|
424
|
+
({ element, listener }) => element.removeEventListener("click", listener)
|
|
425
|
+
);
|
|
413
426
|
links = [];
|
|
414
427
|
};
|
|
415
|
-
watch(
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
428
|
+
watch(
|
|
429
|
+
html,
|
|
430
|
+
() => {
|
|
431
|
+
removeListeners();
|
|
432
|
+
nextTick(addListeners);
|
|
433
|
+
},
|
|
434
|
+
{ immediate: true }
|
|
435
|
+
);
|
|
419
436
|
onBeforeUnmount(() => {
|
|
420
437
|
removeListeners();
|
|
421
438
|
});
|
|
@@ -452,15 +469,24 @@ const TODOSliceComponent = __PRODUCTION__ ? () => null : /* @__PURE__ */ defineC
|
|
|
452
469
|
name: "TODOSliceComponent",
|
|
453
470
|
props: getSliceComponentProps(),
|
|
454
471
|
setup(props) {
|
|
455
|
-
const type = computed(
|
|
472
|
+
const type = computed(
|
|
473
|
+
() => "slice_type" in props.slice ? props.slice.slice_type : props.slice.type
|
|
474
|
+
);
|
|
456
475
|
watchEffect(() => {
|
|
457
|
-
console.warn(
|
|
476
|
+
console.warn(
|
|
477
|
+
`[SliceZone] Could not find a component for Slice type "${type.value}"`,
|
|
478
|
+
props.slice
|
|
479
|
+
);
|
|
458
480
|
});
|
|
459
481
|
return () => {
|
|
460
|
-
return h(
|
|
461
|
-
"
|
|
462
|
-
|
|
463
|
-
|
|
482
|
+
return h(
|
|
483
|
+
"section",
|
|
484
|
+
{
|
|
485
|
+
"data-slice-zone-todo-component": "",
|
|
486
|
+
"data-slice-type": type.value
|
|
487
|
+
},
|
|
488
|
+
[`Could not find a component for Slice type "${type.value}"`]
|
|
489
|
+
);
|
|
464
490
|
};
|
|
465
491
|
}
|
|
466
492
|
});
|
|
@@ -469,7 +495,9 @@ const defineSliceZoneComponents = (components) => {
|
|
|
469
495
|
let type;
|
|
470
496
|
for (type in components) {
|
|
471
497
|
const component = components[type];
|
|
472
|
-
result[type] = typeof component === "string" ? component : markRaw(
|
|
498
|
+
result[type] = typeof component === "string" ? component : markRaw(
|
|
499
|
+
component
|
|
500
|
+
);
|
|
473
501
|
}
|
|
474
502
|
return result;
|
|
475
503
|
};
|
|
@@ -526,8 +554,9 @@ const SliceZoneImpl = /* @__PURE__ */ defineComponent({
|
|
|
526
554
|
component = resolvedComponent;
|
|
527
555
|
}
|
|
528
556
|
}
|
|
557
|
+
const key = "id" in slice && slice.id ? slice.id : `${index}-${JSON.stringify(slice)}`;
|
|
529
558
|
const p = {
|
|
530
|
-
key
|
|
559
|
+
key,
|
|
531
560
|
slice,
|
|
532
561
|
index,
|
|
533
562
|
context: props.context,
|
|
@@ -578,7 +607,11 @@ const createPrismic = (options) => {
|
|
|
578
607
|
const prismicHelpers = {
|
|
579
608
|
asText,
|
|
580
609
|
asHTML: (richTextField, linkResolver, htmlSerializer) => {
|
|
581
|
-
return asHTML(
|
|
610
|
+
return asHTML(
|
|
611
|
+
richTextField,
|
|
612
|
+
linkResolver || options.linkResolver,
|
|
613
|
+
htmlSerializer || options.htmlSerializer
|
|
614
|
+
);
|
|
582
615
|
},
|
|
583
616
|
asLink: (linkField, linkResolver) => {
|
|
584
617
|
return asLink(linkField, linkResolver || options.linkResolver);
|
|
@@ -622,7 +655,9 @@ const isParams = (value) => {
|
|
|
622
655
|
};
|
|
623
656
|
const useStatefulPrismicClientMethod = (methodName, args) => {
|
|
624
657
|
const { client } = usePrismic();
|
|
625
|
-
const state = ref(
|
|
658
|
+
const state = ref(
|
|
659
|
+
PrismicClientComposableState.Idle
|
|
660
|
+
);
|
|
626
661
|
const data = shallowRef(null);
|
|
627
662
|
const error = ref(null);
|
|
628
663
|
const refresh = async () => {
|
|
@@ -633,7 +668,10 @@ const useStatefulPrismicClientMethod = (methodName, args) => {
|
|
|
633
668
|
data.value = null;
|
|
634
669
|
error.value = null;
|
|
635
670
|
try {
|
|
636
|
-
data.value = await (unref(explicitClient) || client)[methodName](
|
|
671
|
+
data.value = await (unref(explicitClient) || client)[methodName](
|
|
672
|
+
...argsWithoutParams.map((arg) => unref(arg)),
|
|
673
|
+
params
|
|
674
|
+
);
|
|
637
675
|
state.value = PrismicClientComposableState.Success;
|
|
638
676
|
} catch (err) {
|
|
639
677
|
state.value = PrismicClientComposableState.Error;
|