@prismicio/vue 2.1.0-alpha.1 → 2.1.2
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 +1 -1
- package/components/common.js +13 -11
- package/components/index.js +13 -11
- package/components/umd.js +13 -11
- package/dist/prismic-vue.common.js +17 -11
- package/dist/prismic-vue.esm.js +17 -11
- package/dist/prismic-vue.js +17 -11
- package/dist/prismic-vue.min.js +1 -1
- package/package.json +1 -1
- package/src/components/Embed.js +1 -1
- package/src/components/Image.js +1 -1
- package/src/components/Link.js +8 -10
- package/src/components/RichText.js +1 -1
- package/src/components/SliceZone.js +1 -1
- package/src/components/Text.js +1 -1
- package/src/index.js +4 -0
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ Whether you're helping us fix bugs, improve the docs, or spread the word, we'd l
|
|
|
54
54
|
## License
|
|
55
55
|
|
|
56
56
|
```
|
|
57
|
-
Copyright 2013-
|
|
57
|
+
Copyright 2013-2022 Prismic <contact@prismic.io> (https://prismic.io)
|
|
58
58
|
|
|
59
59
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
60
60
|
you may not use this file except in compliance with the License.
|
package/components/common.js
CHANGED
|
@@ -70,7 +70,7 @@ var Embed = {
|
|
|
70
70
|
required: true
|
|
71
71
|
},
|
|
72
72
|
wrapper: {
|
|
73
|
-
type: String,
|
|
73
|
+
type: [String, Object, Function],
|
|
74
74
|
required: false,
|
|
75
75
|
"default": 'div'
|
|
76
76
|
}
|
|
@@ -131,7 +131,7 @@ var Image = {
|
|
|
131
131
|
return h('img', Object.assign(data, {
|
|
132
132
|
attrs: _objectSpread2(_objectSpread2({}, data.attrs), {}, {
|
|
133
133
|
src: url,
|
|
134
|
-
alt: alt,
|
|
134
|
+
alt: alt || "",
|
|
135
135
|
copyright: copyright
|
|
136
136
|
})
|
|
137
137
|
}));
|
|
@@ -178,7 +178,7 @@ var Link = (function (_ref) {
|
|
|
178
178
|
},
|
|
179
179
|
blankTargetRelAttribute: {
|
|
180
180
|
type: String,
|
|
181
|
-
"default": "noopener",
|
|
181
|
+
"default": "noopener noreferrer",
|
|
182
182
|
required: false
|
|
183
183
|
}
|
|
184
184
|
},
|
|
@@ -208,14 +208,16 @@ var Link = (function (_ref) {
|
|
|
208
208
|
href: url
|
|
209
209
|
});
|
|
210
210
|
|
|
211
|
-
if (typeof props.target !== "undefined"
|
|
212
|
-
data.attrs.target =
|
|
211
|
+
if (typeof props.target !== "undefined") {
|
|
212
|
+
data.attrs.target = props.target;
|
|
213
|
+
} else if (field.target) {
|
|
214
|
+
data.attrs.target = field.target;
|
|
213
215
|
}
|
|
214
216
|
|
|
215
|
-
if (
|
|
216
|
-
data.attrs.rel = typeof props.rel !== "undefined" ? props.rel : props.blankTargetRelAttribute;
|
|
217
|
-
} else if (typeof props.rel !== "undefined") {
|
|
217
|
+
if (typeof props.rel !== "undefined") {
|
|
218
218
|
data.attrs.rel = props.rel;
|
|
219
|
+
} else if (data.attrs.target === "_blank") {
|
|
220
|
+
data.attrs.rel = props.blankTargetRelAttribute;
|
|
219
221
|
}
|
|
220
222
|
|
|
221
223
|
return h("a", data, children);
|
|
@@ -240,7 +242,7 @@ var RichText = {
|
|
|
240
242
|
required: false
|
|
241
243
|
},
|
|
242
244
|
wrapper: {
|
|
243
|
-
type: String,
|
|
245
|
+
type: [String, Object, Function],
|
|
244
246
|
required: false,
|
|
245
247
|
"default": "div"
|
|
246
248
|
}
|
|
@@ -281,7 +283,7 @@ var Text = {
|
|
|
281
283
|
required: false
|
|
282
284
|
},
|
|
283
285
|
wrapper: {
|
|
284
|
-
type: String,
|
|
286
|
+
type: [String, Object, Function],
|
|
285
287
|
required: false,
|
|
286
288
|
"default": "div"
|
|
287
289
|
}
|
|
@@ -345,7 +347,7 @@ var getSliceComponentProps = function getSliceComponentProps(propsHint) {
|
|
|
345
347
|
};
|
|
346
348
|
};
|
|
347
349
|
var TODOSliceComponent = __PRODUCTION__ ? null : {
|
|
348
|
-
name: "
|
|
350
|
+
name: "TODOSliceComponent",
|
|
349
351
|
functional: true,
|
|
350
352
|
props: getSliceComponentProps(),
|
|
351
353
|
render: function render(h, _ref) {
|
package/components/index.js
CHANGED
|
@@ -62,7 +62,7 @@ var Embed = {
|
|
|
62
62
|
required: true
|
|
63
63
|
},
|
|
64
64
|
wrapper: {
|
|
65
|
-
type: String,
|
|
65
|
+
type: [String, Object, Function],
|
|
66
66
|
required: false,
|
|
67
67
|
"default": 'div'
|
|
68
68
|
}
|
|
@@ -123,7 +123,7 @@ var Image = {
|
|
|
123
123
|
return h('img', Object.assign(data, {
|
|
124
124
|
attrs: _objectSpread2(_objectSpread2({}, data.attrs), {}, {
|
|
125
125
|
src: url,
|
|
126
|
-
alt: alt,
|
|
126
|
+
alt: alt || "",
|
|
127
127
|
copyright: copyright
|
|
128
128
|
})
|
|
129
129
|
}));
|
|
@@ -170,7 +170,7 @@ var Link = (function (_ref) {
|
|
|
170
170
|
},
|
|
171
171
|
blankTargetRelAttribute: {
|
|
172
172
|
type: String,
|
|
173
|
-
"default": "noopener",
|
|
173
|
+
"default": "noopener noreferrer",
|
|
174
174
|
required: false
|
|
175
175
|
}
|
|
176
176
|
},
|
|
@@ -200,14 +200,16 @@ var Link = (function (_ref) {
|
|
|
200
200
|
href: url
|
|
201
201
|
});
|
|
202
202
|
|
|
203
|
-
if (typeof props.target !== "undefined"
|
|
204
|
-
data.attrs.target =
|
|
203
|
+
if (typeof props.target !== "undefined") {
|
|
204
|
+
data.attrs.target = props.target;
|
|
205
|
+
} else if (field.target) {
|
|
206
|
+
data.attrs.target = field.target;
|
|
205
207
|
}
|
|
206
208
|
|
|
207
|
-
if (
|
|
208
|
-
data.attrs.rel = typeof props.rel !== "undefined" ? props.rel : props.blankTargetRelAttribute;
|
|
209
|
-
} else if (typeof props.rel !== "undefined") {
|
|
209
|
+
if (typeof props.rel !== "undefined") {
|
|
210
210
|
data.attrs.rel = props.rel;
|
|
211
|
+
} else if (data.attrs.target === "_blank") {
|
|
212
|
+
data.attrs.rel = props.blankTargetRelAttribute;
|
|
211
213
|
}
|
|
212
214
|
|
|
213
215
|
return h("a", data, children);
|
|
@@ -232,7 +234,7 @@ var RichText = {
|
|
|
232
234
|
required: false
|
|
233
235
|
},
|
|
234
236
|
wrapper: {
|
|
235
|
-
type: String,
|
|
237
|
+
type: [String, Object, Function],
|
|
236
238
|
required: false,
|
|
237
239
|
"default": "div"
|
|
238
240
|
}
|
|
@@ -273,7 +275,7 @@ var Text = {
|
|
|
273
275
|
required: false
|
|
274
276
|
},
|
|
275
277
|
wrapper: {
|
|
276
|
-
type: String,
|
|
278
|
+
type: [String, Object, Function],
|
|
277
279
|
required: false,
|
|
278
280
|
"default": "div"
|
|
279
281
|
}
|
|
@@ -337,7 +339,7 @@ var getSliceComponentProps = function getSliceComponentProps(propsHint) {
|
|
|
337
339
|
};
|
|
338
340
|
};
|
|
339
341
|
var TODOSliceComponent = __PRODUCTION__ ? null : {
|
|
340
|
-
name: "
|
|
342
|
+
name: "TODOSliceComponent",
|
|
341
343
|
functional: true,
|
|
342
344
|
props: getSliceComponentProps(),
|
|
343
345
|
render: function render(h, _ref) {
|
package/components/umd.js
CHANGED
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
required: true
|
|
71
71
|
},
|
|
72
72
|
wrapper: {
|
|
73
|
-
type: String,
|
|
73
|
+
type: [String, Object, Function],
|
|
74
74
|
required: false,
|
|
75
75
|
"default": 'div'
|
|
76
76
|
}
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
return h('img', Object.assign(data, {
|
|
132
132
|
attrs: _objectSpread2(_objectSpread2({}, data.attrs), {}, {
|
|
133
133
|
src: url,
|
|
134
|
-
alt: alt,
|
|
134
|
+
alt: alt || "",
|
|
135
135
|
copyright: copyright
|
|
136
136
|
})
|
|
137
137
|
}));
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
},
|
|
179
179
|
blankTargetRelAttribute: {
|
|
180
180
|
type: String,
|
|
181
|
-
"default": "noopener",
|
|
181
|
+
"default": "noopener noreferrer",
|
|
182
182
|
required: false
|
|
183
183
|
}
|
|
184
184
|
},
|
|
@@ -208,14 +208,16 @@
|
|
|
208
208
|
href: url
|
|
209
209
|
});
|
|
210
210
|
|
|
211
|
-
if (typeof props.target !== "undefined"
|
|
212
|
-
data.attrs.target =
|
|
211
|
+
if (typeof props.target !== "undefined") {
|
|
212
|
+
data.attrs.target = props.target;
|
|
213
|
+
} else if (field.target) {
|
|
214
|
+
data.attrs.target = field.target;
|
|
213
215
|
}
|
|
214
216
|
|
|
215
|
-
if (
|
|
216
|
-
data.attrs.rel = typeof props.rel !== "undefined" ? props.rel : props.blankTargetRelAttribute;
|
|
217
|
-
} else if (typeof props.rel !== "undefined") {
|
|
217
|
+
if (typeof props.rel !== "undefined") {
|
|
218
218
|
data.attrs.rel = props.rel;
|
|
219
|
+
} else if (data.attrs.target === "_blank") {
|
|
220
|
+
data.attrs.rel = props.blankTargetRelAttribute;
|
|
219
221
|
}
|
|
220
222
|
|
|
221
223
|
return h("a", data, children);
|
|
@@ -240,7 +242,7 @@
|
|
|
240
242
|
required: false
|
|
241
243
|
},
|
|
242
244
|
wrapper: {
|
|
243
|
-
type: String,
|
|
245
|
+
type: [String, Object, Function],
|
|
244
246
|
required: false,
|
|
245
247
|
"default": "div"
|
|
246
248
|
}
|
|
@@ -281,7 +283,7 @@
|
|
|
281
283
|
required: false
|
|
282
284
|
},
|
|
283
285
|
wrapper: {
|
|
284
|
-
type: String,
|
|
286
|
+
type: [String, Object, Function],
|
|
285
287
|
required: false,
|
|
286
288
|
"default": "div"
|
|
287
289
|
}
|
|
@@ -345,7 +347,7 @@
|
|
|
345
347
|
};
|
|
346
348
|
};
|
|
347
349
|
var TODOSliceComponent = __PRODUCTION__ ? null : {
|
|
348
|
-
name: "
|
|
350
|
+
name: "TODOSliceComponent",
|
|
349
351
|
functional: true,
|
|
350
352
|
props: getSliceComponentProps(),
|
|
351
353
|
render: function render(h, _ref) {
|
|
@@ -129,7 +129,7 @@ var Embed = {
|
|
|
129
129
|
required: true
|
|
130
130
|
},
|
|
131
131
|
wrapper: {
|
|
132
|
-
type: String,
|
|
132
|
+
type: [String, Object, Function],
|
|
133
133
|
required: false,
|
|
134
134
|
"default": 'div'
|
|
135
135
|
}
|
|
@@ -190,7 +190,7 @@ var Image = {
|
|
|
190
190
|
return h('img', Object.assign(data, {
|
|
191
191
|
attrs: _objectSpread2(_objectSpread2({}, data.attrs), {}, {
|
|
192
192
|
src: url,
|
|
193
|
-
alt: alt,
|
|
193
|
+
alt: alt || "",
|
|
194
194
|
copyright: copyright
|
|
195
195
|
})
|
|
196
196
|
}));
|
|
@@ -237,7 +237,7 @@ var Link = (function (_ref) {
|
|
|
237
237
|
},
|
|
238
238
|
blankTargetRelAttribute: {
|
|
239
239
|
type: String,
|
|
240
|
-
"default": "noopener",
|
|
240
|
+
"default": "noopener noreferrer",
|
|
241
241
|
required: false
|
|
242
242
|
}
|
|
243
243
|
},
|
|
@@ -267,14 +267,16 @@ var Link = (function (_ref) {
|
|
|
267
267
|
href: url
|
|
268
268
|
});
|
|
269
269
|
|
|
270
|
-
if (typeof props.target !== "undefined"
|
|
271
|
-
data.attrs.target =
|
|
270
|
+
if (typeof props.target !== "undefined") {
|
|
271
|
+
data.attrs.target = props.target;
|
|
272
|
+
} else if (field.target) {
|
|
273
|
+
data.attrs.target = field.target;
|
|
272
274
|
}
|
|
273
275
|
|
|
274
|
-
if (
|
|
275
|
-
data.attrs.rel = typeof props.rel !== "undefined" ? props.rel : props.blankTargetRelAttribute;
|
|
276
|
-
} else if (typeof props.rel !== "undefined") {
|
|
276
|
+
if (typeof props.rel !== "undefined") {
|
|
277
277
|
data.attrs.rel = props.rel;
|
|
278
|
+
} else if (data.attrs.target === "_blank") {
|
|
279
|
+
data.attrs.rel = props.blankTargetRelAttribute;
|
|
278
280
|
}
|
|
279
281
|
|
|
280
282
|
return h("a", data, children);
|
|
@@ -299,7 +301,7 @@ var RichText = {
|
|
|
299
301
|
required: false
|
|
300
302
|
},
|
|
301
303
|
wrapper: {
|
|
302
|
-
type: String,
|
|
304
|
+
type: [String, Object, Function],
|
|
303
305
|
required: false,
|
|
304
306
|
"default": "div"
|
|
305
307
|
}
|
|
@@ -340,7 +342,7 @@ var Text = {
|
|
|
340
342
|
required: false
|
|
341
343
|
},
|
|
342
344
|
wrapper: {
|
|
343
|
-
type: String,
|
|
345
|
+
type: [String, Object, Function],
|
|
344
346
|
required: false,
|
|
345
347
|
"default": "div"
|
|
346
348
|
}
|
|
@@ -404,7 +406,7 @@ var getSliceComponentProps = function getSliceComponentProps(propsHint) {
|
|
|
404
406
|
};
|
|
405
407
|
};
|
|
406
408
|
var TODOSliceComponent = __PRODUCTION__ ? null : {
|
|
407
|
-
name: "
|
|
409
|
+
name: "TODOSliceComponent",
|
|
408
410
|
functional: true,
|
|
409
411
|
props: getSliceComponentProps(),
|
|
410
412
|
render: function render(h, _ref) {
|
|
@@ -572,6 +574,10 @@ var PrismicVue = {
|
|
|
572
574
|
var _options$linkType = options.linkType,
|
|
573
575
|
linkType = _options$linkType === void 0 ? "vueRouter" : _options$linkType;
|
|
574
576
|
Vue.prototype.$prismic = prismicJS__default["default"];
|
|
577
|
+
Vue.prototype.$prismic.predicate = prismicJS__default["default"].Predicates;
|
|
578
|
+
Vue.prototype.$prismic.cookie = {
|
|
579
|
+
preview: prismicJS__default["default"].previewCookie
|
|
580
|
+
};
|
|
575
581
|
Vue.prototype.$prismic.endpoint = options.endpoint;
|
|
576
582
|
Vue.prototype.$prismic.linkResolver = options.linkResolver;
|
|
577
583
|
Vue.prototype.$prismic.htmlSerializer = options.htmlSerializer;
|
package/dist/prismic-vue.esm.js
CHANGED
|
@@ -122,7 +122,7 @@ var Embed = {
|
|
|
122
122
|
required: true
|
|
123
123
|
},
|
|
124
124
|
wrapper: {
|
|
125
|
-
type: String,
|
|
125
|
+
type: [String, Object, Function],
|
|
126
126
|
required: false,
|
|
127
127
|
"default": 'div'
|
|
128
128
|
}
|
|
@@ -183,7 +183,7 @@ var Image = {
|
|
|
183
183
|
return h('img', Object.assign(data, {
|
|
184
184
|
attrs: _objectSpread2(_objectSpread2({}, data.attrs), {}, {
|
|
185
185
|
src: url,
|
|
186
|
-
alt: alt,
|
|
186
|
+
alt: alt || "",
|
|
187
187
|
copyright: copyright
|
|
188
188
|
})
|
|
189
189
|
}));
|
|
@@ -230,7 +230,7 @@ var Link = (function (_ref) {
|
|
|
230
230
|
},
|
|
231
231
|
blankTargetRelAttribute: {
|
|
232
232
|
type: String,
|
|
233
|
-
"default": "noopener",
|
|
233
|
+
"default": "noopener noreferrer",
|
|
234
234
|
required: false
|
|
235
235
|
}
|
|
236
236
|
},
|
|
@@ -260,14 +260,16 @@ var Link = (function (_ref) {
|
|
|
260
260
|
href: url
|
|
261
261
|
});
|
|
262
262
|
|
|
263
|
-
if (typeof props.target !== "undefined"
|
|
264
|
-
data.attrs.target =
|
|
263
|
+
if (typeof props.target !== "undefined") {
|
|
264
|
+
data.attrs.target = props.target;
|
|
265
|
+
} else if (field.target) {
|
|
266
|
+
data.attrs.target = field.target;
|
|
265
267
|
}
|
|
266
268
|
|
|
267
|
-
if (
|
|
268
|
-
data.attrs.rel = typeof props.rel !== "undefined" ? props.rel : props.blankTargetRelAttribute;
|
|
269
|
-
} else if (typeof props.rel !== "undefined") {
|
|
269
|
+
if (typeof props.rel !== "undefined") {
|
|
270
270
|
data.attrs.rel = props.rel;
|
|
271
|
+
} else if (data.attrs.target === "_blank") {
|
|
272
|
+
data.attrs.rel = props.blankTargetRelAttribute;
|
|
271
273
|
}
|
|
272
274
|
|
|
273
275
|
return h("a", data, children);
|
|
@@ -292,7 +294,7 @@ var RichText = {
|
|
|
292
294
|
required: false
|
|
293
295
|
},
|
|
294
296
|
wrapper: {
|
|
295
|
-
type: String,
|
|
297
|
+
type: [String, Object, Function],
|
|
296
298
|
required: false,
|
|
297
299
|
"default": "div"
|
|
298
300
|
}
|
|
@@ -333,7 +335,7 @@ var Text = {
|
|
|
333
335
|
required: false
|
|
334
336
|
},
|
|
335
337
|
wrapper: {
|
|
336
|
-
type: String,
|
|
338
|
+
type: [String, Object, Function],
|
|
337
339
|
required: false,
|
|
338
340
|
"default": "div"
|
|
339
341
|
}
|
|
@@ -397,7 +399,7 @@ var getSliceComponentProps = function getSliceComponentProps(propsHint) {
|
|
|
397
399
|
};
|
|
398
400
|
};
|
|
399
401
|
var TODOSliceComponent = __PRODUCTION__ ? null : {
|
|
400
|
-
name: "
|
|
402
|
+
name: "TODOSliceComponent",
|
|
401
403
|
functional: true,
|
|
402
404
|
props: getSliceComponentProps(),
|
|
403
405
|
render: function render(h, _ref) {
|
|
@@ -565,6 +567,10 @@ var PrismicVue = {
|
|
|
565
567
|
var _options$linkType = options.linkType,
|
|
566
568
|
linkType = _options$linkType === void 0 ? "vueRouter" : _options$linkType;
|
|
567
569
|
Vue.prototype.$prismic = prismicJS;
|
|
570
|
+
Vue.prototype.$prismic.predicate = prismicJS.Predicates;
|
|
571
|
+
Vue.prototype.$prismic.cookie = {
|
|
572
|
+
preview: prismicJS.previewCookie
|
|
573
|
+
};
|
|
568
574
|
Vue.prototype.$prismic.endpoint = options.endpoint;
|
|
569
575
|
Vue.prototype.$prismic.linkResolver = options.linkResolver;
|
|
570
576
|
Vue.prototype.$prismic.htmlSerializer = options.htmlSerializer;
|
package/dist/prismic-vue.js
CHANGED
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
required: true
|
|
131
131
|
},
|
|
132
132
|
wrapper: {
|
|
133
|
-
type: String,
|
|
133
|
+
type: [String, Object, Function],
|
|
134
134
|
required: false,
|
|
135
135
|
"default": 'div'
|
|
136
136
|
}
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
return h('img', Object.assign(data, {
|
|
192
192
|
attrs: _objectSpread2(_objectSpread2({}, data.attrs), {}, {
|
|
193
193
|
src: url,
|
|
194
|
-
alt: alt,
|
|
194
|
+
alt: alt || "",
|
|
195
195
|
copyright: copyright
|
|
196
196
|
})
|
|
197
197
|
}));
|
|
@@ -238,7 +238,7 @@
|
|
|
238
238
|
},
|
|
239
239
|
blankTargetRelAttribute: {
|
|
240
240
|
type: String,
|
|
241
|
-
"default": "noopener",
|
|
241
|
+
"default": "noopener noreferrer",
|
|
242
242
|
required: false
|
|
243
243
|
}
|
|
244
244
|
},
|
|
@@ -268,14 +268,16 @@
|
|
|
268
268
|
href: url
|
|
269
269
|
});
|
|
270
270
|
|
|
271
|
-
if (typeof props.target !== "undefined"
|
|
272
|
-
data.attrs.target =
|
|
271
|
+
if (typeof props.target !== "undefined") {
|
|
272
|
+
data.attrs.target = props.target;
|
|
273
|
+
} else if (field.target) {
|
|
274
|
+
data.attrs.target = field.target;
|
|
273
275
|
}
|
|
274
276
|
|
|
275
|
-
if (
|
|
276
|
-
data.attrs.rel = typeof props.rel !== "undefined" ? props.rel : props.blankTargetRelAttribute;
|
|
277
|
-
} else if (typeof props.rel !== "undefined") {
|
|
277
|
+
if (typeof props.rel !== "undefined") {
|
|
278
278
|
data.attrs.rel = props.rel;
|
|
279
|
+
} else if (data.attrs.target === "_blank") {
|
|
280
|
+
data.attrs.rel = props.blankTargetRelAttribute;
|
|
279
281
|
}
|
|
280
282
|
|
|
281
283
|
return h("a", data, children);
|
|
@@ -300,7 +302,7 @@
|
|
|
300
302
|
required: false
|
|
301
303
|
},
|
|
302
304
|
wrapper: {
|
|
303
|
-
type: String,
|
|
305
|
+
type: [String, Object, Function],
|
|
304
306
|
required: false,
|
|
305
307
|
"default": "div"
|
|
306
308
|
}
|
|
@@ -341,7 +343,7 @@
|
|
|
341
343
|
required: false
|
|
342
344
|
},
|
|
343
345
|
wrapper: {
|
|
344
|
-
type: String,
|
|
346
|
+
type: [String, Object, Function],
|
|
345
347
|
required: false,
|
|
346
348
|
"default": "div"
|
|
347
349
|
}
|
|
@@ -405,7 +407,7 @@
|
|
|
405
407
|
};
|
|
406
408
|
};
|
|
407
409
|
var TODOSliceComponent = __PRODUCTION__ ? null : {
|
|
408
|
-
name: "
|
|
410
|
+
name: "TODOSliceComponent",
|
|
409
411
|
functional: true,
|
|
410
412
|
props: getSliceComponentProps(),
|
|
411
413
|
render: function render(h, _ref) {
|
|
@@ -573,6 +575,10 @@
|
|
|
573
575
|
var _options$linkType = options.linkType,
|
|
574
576
|
linkType = _options$linkType === void 0 ? "vueRouter" : _options$linkType;
|
|
575
577
|
Vue.prototype.$prismic = prismicJS__default["default"];
|
|
578
|
+
Vue.prototype.$prismic.predicate = prismicJS__default["default"].Predicates;
|
|
579
|
+
Vue.prototype.$prismic.cookie = {
|
|
580
|
+
preview: prismicJS__default["default"].previewCookie
|
|
581
|
+
};
|
|
576
582
|
Vue.prototype.$prismic.endpoint = options.endpoint;
|
|
577
583
|
Vue.prototype.$prismic.linkResolver = options.linkResolver;
|
|
578
584
|
Vue.prototype.$prismic.htmlSerializer = options.htmlSerializer;
|
package/dist/prismic-vue.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory(require("@prismicio/client"),require("prismic-dom")):typeof define==="function"&&define.amd?define(["@prismicio/client","prismic-dom"],factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,global.PrismicVue=factory(global.prismicJS,global.prismicDOM))})(this,function(prismicJS,PrismicDOM){"use strict";function _interopDefaultLegacy(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var prismicJS__default=_interopDefaultLegacy(prismicJS);var PrismicDOM__default=_interopDefaultLegacy(PrismicDOM);function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _objectSpread2(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(source),true).forEach(function(key){_defineProperty(target,key,source[key])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}}return target}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Embed={name:"PrismicEmbed",functional:true,props:{field:{type:Object,required:true},wrapper:{type:String,required:false,default:"div"}},render:function render(h,_ref){var props=_ref.props,data=_ref.data;var field=props.field,wrapper=props.wrapper;if(!field||!field.html){return null}var embedUrl=field.embed_url,type=field.type,providerName=field.provider_name;var attrs=_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({},data.attrs),embedUrl&&{"data-oembed":embedUrl}),type&&{"data-oembed-type":type}),providerName&&{"data-oembed-provider":providerName});return h(wrapper,_objectSpread2(_objectSpread2({},Object.assign(data,{attrs:attrs})),{},{domProps:{innerHTML:field.html}}))}};var Image={name:"PrismicImage",functional:true,props:{field:{type:Object,required:true}},render:function render(h,_ref){var props=_ref.props,data=_ref.data;var field=props.field;if(!field){return null}var url=field.url,alt=field.alt,copyright=field.copyright;return h("img",Object.assign(data,{attrs:_objectSpread2(_objectSpread2({},data.attrs),{},{src:url,alt:alt,copyright:copyright})}))}};var isInternalURL=function isInternalURL(url){var isInternal=/^\/(?!\/)/.test(url);var isSpecialLink=!isInternal&&!/^https?:\/\//i.test(url);return isInternal&&!isSpecialLink};var Link=function(_ref){var _ref$component=_ref.component,component=_ref$component===void 0?"a":_ref$component;return{name:"PrismicLink",functional:true,props:{field:{type:Object,required:true},linkResolver:{type:Function,required:false},target:{type:String,default:undefined,required:false},rel:{type:String,default:undefined,required:false},blankTargetRelAttribute:{type:String,default:"noopener",required:false}},render:function render(h,_ref2){var props=_ref2.props,data=_ref2.data,children=_ref2.children,parent=_ref2.parent;var field=props.field,linkResolver=props.linkResolver;if(!field){return null}var url=parent.$prismic?parent.$prismic.asLink(field,linkResolver):PrismicDOM__default["default"].Link.url(field,linkResolver||function(){return null});if(isInternalURL(url)&&!props.target){data.props=data.props||{};data.props.to=url;return h(component,data,children)}data.attrs=_objectSpread2(_objectSpread2({},data.attrs),{},{href:url});if(typeof props.target!=="undefined"||field.target){data.attrs.target=typeof props.target!=="undefined"?props.target:field.target}if(data.attrs.target==="_blank"){data.attrs.rel=typeof props.rel!=="undefined"?props.rel:props.blankTargetRelAttribute}else if(typeof props.rel!=="undefined"){data.attrs.rel=props.rel}return h("a",data,children)}}};var RichText={name:"PrismicRichText",functional:true,props:{field:{type:Array,required:true},linkResolver:{type:Function,required:false},htmlSerializer:{type:Function,required:false},wrapper:{type:String,required:false,default:"div"}},render:function render(h,_ref){var props=_ref.props,data=_ref.data,parent=_ref.parent;var field=props.field,linkResolver=props.linkResolver,htmlSerializer=props.htmlSerializer,wrapper=props.wrapper;if(!field){return null}var innerHTML=PrismicDOM.RichText.asHtml(field,linkResolver?linkResolver:parent.$prismic?parent.$prismic.linkResolver:undefined,htmlSerializer?htmlSerializer:parent.$prismic?parent.$prismic.htmlSerializer:undefined);return h(wrapper,_objectSpread2(_objectSpread2({},data),{},{domProps:{innerHTML:innerHTML}}))}};var Text={name:"PrismicText",functional:true,props:{field:{type:Array,required:true},separator:{type:String,default:undefined,required:false},wrapper:{type:String,required:false,default:"div"}},render:function render(h,_ref){var props=_ref.props,data=_ref.data;_ref.children;_ref.parent;var field=props.field,separator=props.separator,wrapper=props.wrapper;if(!field){return null}var innerHTML=PrismicDOM.RichText.asText(field,separator);return h(wrapper,_objectSpread2(_objectSpread2({},data),{},{domProps:{innerHTML:innerHTML}}))}};if(typeof process==="undefined"){globalThis.process={env:{}}}var __PRODUCTION__=process.env.NODE_ENV==="production";var getSliceComponentProps=function getSliceComponentProps(propsHint){return{slice:{type:Object,required:true},index:{type:Number,required:true},slices:{type:Array,required:true},context:{type:null,required:true}}};var TODOSliceComponent=__PRODUCTION__?null:{name:"TODOSliceCOmponent",functional:true,props:getSliceComponentProps(),render:function render(h,_ref){var props=_ref.props,data=_ref.data;console.warn('[SliceZone] Could not find a component for Slice type "'.concat(props.slice.slice_type,'"'),props.slice);return h("section",_objectSpread2(_objectSpread2({},data),{},{attrs:_objectSpread2(_objectSpread2({},data.attrs),{},{"data-slice-zone-todo-component":"","data-slice-type":props.slice.slice_type})}),['Could not find a component for Slice type "'.concat(props.slice.slice_type,'"')])}};var SliceZone={name:"SliceZone",props:{slices:{type:Array,required:true},components:{type:Object,default:undefined,required:false},resolver:{type:Function,default:undefined,required:false},context:{type:null,default:undefined,required:false},defaultComponent:{type:Object,default:undefined,required:false},wrapper:{type:[String,Object,Function],default:"div",required:false}},computed:{renderedSlices:function renderedSlices(){var _this=this;if(!this.slices){return null}return this.slices.map(function(slice,index){var component=_this.components&&slice.slice_type in _this.components?_this.components[slice.slice_type]:_this.defaultComponent||TODOSliceComponent;if(_this.resolver){var resolvedComponent=_this.resolver({slice:slice,sliceName:slice.slice_type,i:index});if(resolvedComponent){component=resolvedComponent}}var p={key:"".concat(slice.slice_type,"-").concat(index),props:{slice:slice,index:index,context:_this.context,slices:_this.slices}};return{component:component,p:p}})}},render:function render(h){if(!this.slices){return null}return h(this.wrapper,this.renderedSlices.map(function(_ref2){var component=_ref2.component,p=_ref2.p;return h(component,p)}))}};var NuxtLink=Link({component:"nuxt-link"});var VueRouterLink=Link({component:"router-link"});var exp={common:{Embed:Embed,Image:Image,RichText:RichText,Text:Text,SliceZone:SliceZone},nuxt:{Link:NuxtLink},vueRouter:{Link:VueRouterLink}};function asHtml(richText,linkResolver,htmlSerializer){if(richText){return PrismicDOM__default["default"].RichText.asHtml(richText,linkResolver,htmlSerializer)}}function asText(richText,joinString){if(richText){return PrismicDOM__default["default"].RichText.asText(richText,joinString)}return""}function asLink(link,linkResolver){if(link){return PrismicDOM__default["default"].Link.url(link,linkResolver)}}function asDate(date){if(date){return PrismicDOM__default["default"].Date(date)}}var client=prismicJS__default["default"].client;function attachMethods(Vue,options){Vue.prototype.$prismic.asHtml=function(richText,linkResolver,htmlSerializer){return asHtml(richText,linkResolver||options.linkResolver,htmlSerializer||options.htmlSerializer)};Vue.prototype.$prismic.asHTML=Vue.prototype.$prismic.asHtml;Vue.prototype.$prismic.asText=asText;Vue.prototype.$prismic.richTextAsPlain=asText;Vue.prototype.$prismic.asDate=asDate;Vue.prototype.$prismic.asLink=function(link,linkResolver){return asLink(link,linkResolver||options.linkResolver)}}var PrismicVue={install:function install(Vue,options){var _options$linkType=options.linkType,linkType=_options$linkType===void 0?"vueRouter":_options$linkType;Vue.prototype.$prismic=prismicJS__default["default"];Vue.prototype.$prismic.endpoint=options.endpoint;Vue.prototype.$prismic.linkResolver=options.linkResolver;Vue.prototype.$prismic.htmlSerializer=options.htmlSerializer;Vue.prototype.$prismic.client=client(options.endpoint,options.apiOptions);attachMethods(Vue,options);var components=_objectSpread2(_objectSpread2({},exp.common),exp[linkType]);Object.entries(components).forEach(function(_ref){var _ref2=_slicedToArray(_ref,2);_ref2[0];var c=_ref2[1];Vue.component(c.name,c)})}};return PrismicVue});
|
|
1
|
+
(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory(require("@prismicio/client"),require("prismic-dom")):typeof define==="function"&&define.amd?define(["@prismicio/client","prismic-dom"],factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,global.PrismicVue=factory(global.prismicJS,global.prismicDOM))})(this,function(prismicJS,PrismicDOM){"use strict";function _interopDefaultLegacy(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var prismicJS__default=_interopDefaultLegacy(prismicJS);var PrismicDOM__default=_interopDefaultLegacy(PrismicDOM);function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _objectSpread2(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(source),true).forEach(function(key){_defineProperty(target,key,source[key])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}}return target}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"]!=null)_i["return"]()}finally{if(_d)throw _e}}return _arr}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Embed={name:"PrismicEmbed",functional:true,props:{field:{type:Object,required:true},wrapper:{type:[String,Object,Function],required:false,default:"div"}},render:function render(h,_ref){var props=_ref.props,data=_ref.data;var field=props.field,wrapper=props.wrapper;if(!field||!field.html){return null}var embedUrl=field.embed_url,type=field.type,providerName=field.provider_name;var attrs=_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({},data.attrs),embedUrl&&{"data-oembed":embedUrl}),type&&{"data-oembed-type":type}),providerName&&{"data-oembed-provider":providerName});return h(wrapper,_objectSpread2(_objectSpread2({},Object.assign(data,{attrs:attrs})),{},{domProps:{innerHTML:field.html}}))}};var Image={name:"PrismicImage",functional:true,props:{field:{type:Object,required:true}},render:function render(h,_ref){var props=_ref.props,data=_ref.data;var field=props.field;if(!field){return null}var url=field.url,alt=field.alt,copyright=field.copyright;return h("img",Object.assign(data,{attrs:_objectSpread2(_objectSpread2({},data.attrs),{},{src:url,alt:alt||"",copyright:copyright})}))}};var isInternalURL=function isInternalURL(url){var isInternal=/^\/(?!\/)/.test(url);var isSpecialLink=!isInternal&&!/^https?:\/\//i.test(url);return isInternal&&!isSpecialLink};var Link=function(_ref){var _ref$component=_ref.component,component=_ref$component===void 0?"a":_ref$component;return{name:"PrismicLink",functional:true,props:{field:{type:Object,required:true},linkResolver:{type:Function,required:false},target:{type:String,default:undefined,required:false},rel:{type:String,default:undefined,required:false},blankTargetRelAttribute:{type:String,default:"noopener noreferrer",required:false}},render:function render(h,_ref2){var props=_ref2.props,data=_ref2.data,children=_ref2.children,parent=_ref2.parent;var field=props.field,linkResolver=props.linkResolver;if(!field){return null}var url=parent.$prismic?parent.$prismic.asLink(field,linkResolver):PrismicDOM__default["default"].Link.url(field,linkResolver||function(){return null});if(isInternalURL(url)&&!props.target){data.props=data.props||{};data.props.to=url;return h(component,data,children)}data.attrs=_objectSpread2(_objectSpread2({},data.attrs),{},{href:url});if(typeof props.target!=="undefined"){data.attrs.target=props.target}else if(field.target){data.attrs.target=field.target}if(typeof props.rel!=="undefined"){data.attrs.rel=props.rel}else if(data.attrs.target==="_blank"){data.attrs.rel=props.blankTargetRelAttribute}return h("a",data,children)}}};var RichText={name:"PrismicRichText",functional:true,props:{field:{type:Array,required:true},linkResolver:{type:Function,required:false},htmlSerializer:{type:Function,required:false},wrapper:{type:[String,Object,Function],required:false,default:"div"}},render:function render(h,_ref){var props=_ref.props,data=_ref.data,parent=_ref.parent;var field=props.field,linkResolver=props.linkResolver,htmlSerializer=props.htmlSerializer,wrapper=props.wrapper;if(!field){return null}var innerHTML=PrismicDOM.RichText.asHtml(field,linkResolver?linkResolver:parent.$prismic?parent.$prismic.linkResolver:undefined,htmlSerializer?htmlSerializer:parent.$prismic?parent.$prismic.htmlSerializer:undefined);return h(wrapper,_objectSpread2(_objectSpread2({},data),{},{domProps:{innerHTML:innerHTML}}))}};var Text={name:"PrismicText",functional:true,props:{field:{type:Array,required:true},separator:{type:String,default:undefined,required:false},wrapper:{type:[String,Object,Function],required:false,default:"div"}},render:function render(h,_ref){var props=_ref.props,data=_ref.data;_ref.children;_ref.parent;var field=props.field,separator=props.separator,wrapper=props.wrapper;if(!field){return null}var innerHTML=PrismicDOM.RichText.asText(field,separator);return h(wrapper,_objectSpread2(_objectSpread2({},data),{},{domProps:{innerHTML:innerHTML}}))}};if(typeof process==="undefined"){globalThis.process={env:{}}}var __PRODUCTION__=process.env.NODE_ENV==="production";var getSliceComponentProps=function getSliceComponentProps(propsHint){return{slice:{type:Object,required:true},index:{type:Number,required:true},slices:{type:Array,required:true},context:{type:null,required:true}}};var TODOSliceComponent=__PRODUCTION__?null:{name:"TODOSliceComponent",functional:true,props:getSliceComponentProps(),render:function render(h,_ref){var props=_ref.props,data=_ref.data;console.warn('[SliceZone] Could not find a component for Slice type "'.concat(props.slice.slice_type,'"'),props.slice);return h("section",_objectSpread2(_objectSpread2({},data),{},{attrs:_objectSpread2(_objectSpread2({},data.attrs),{},{"data-slice-zone-todo-component":"","data-slice-type":props.slice.slice_type})}),['Could not find a component for Slice type "'.concat(props.slice.slice_type,'"')])}};var SliceZone={name:"SliceZone",props:{slices:{type:Array,required:true},components:{type:Object,default:undefined,required:false},resolver:{type:Function,default:undefined,required:false},context:{type:null,default:undefined,required:false},defaultComponent:{type:Object,default:undefined,required:false},wrapper:{type:[String,Object,Function],default:"div",required:false}},computed:{renderedSlices:function renderedSlices(){var _this=this;if(!this.slices){return null}return this.slices.map(function(slice,index){var component=_this.components&&slice.slice_type in _this.components?_this.components[slice.slice_type]:_this.defaultComponent||TODOSliceComponent;if(_this.resolver){var resolvedComponent=_this.resolver({slice:slice,sliceName:slice.slice_type,i:index});if(resolvedComponent){component=resolvedComponent}}var p={key:"".concat(slice.slice_type,"-").concat(index),props:{slice:slice,index:index,context:_this.context,slices:_this.slices}};return{component:component,p:p}})}},render:function render(h){if(!this.slices){return null}return h(this.wrapper,this.renderedSlices.map(function(_ref2){var component=_ref2.component,p=_ref2.p;return h(component,p)}))}};var NuxtLink=Link({component:"nuxt-link"});var VueRouterLink=Link({component:"router-link"});var exp={common:{Embed:Embed,Image:Image,RichText:RichText,Text:Text,SliceZone:SliceZone},nuxt:{Link:NuxtLink},vueRouter:{Link:VueRouterLink}};function asHtml(richText,linkResolver,htmlSerializer){if(richText){return PrismicDOM__default["default"].RichText.asHtml(richText,linkResolver,htmlSerializer)}}function asText(richText,joinString){if(richText){return PrismicDOM__default["default"].RichText.asText(richText,joinString)}return""}function asLink(link,linkResolver){if(link){return PrismicDOM__default["default"].Link.url(link,linkResolver)}}function asDate(date){if(date){return PrismicDOM__default["default"].Date(date)}}var client=prismicJS__default["default"].client;function attachMethods(Vue,options){Vue.prototype.$prismic.asHtml=function(richText,linkResolver,htmlSerializer){return asHtml(richText,linkResolver||options.linkResolver,htmlSerializer||options.htmlSerializer)};Vue.prototype.$prismic.asHTML=Vue.prototype.$prismic.asHtml;Vue.prototype.$prismic.asText=asText;Vue.prototype.$prismic.richTextAsPlain=asText;Vue.prototype.$prismic.asDate=asDate;Vue.prototype.$prismic.asLink=function(link,linkResolver){return asLink(link,linkResolver||options.linkResolver)}}var PrismicVue={install:function install(Vue,options){var _options$linkType=options.linkType,linkType=_options$linkType===void 0?"vueRouter":_options$linkType;Vue.prototype.$prismic=prismicJS__default["default"];Vue.prototype.$prismic.predicate=prismicJS__default["default"].Predicates;Vue.prototype.$prismic.cookie={preview:prismicJS__default["default"].previewCookie};Vue.prototype.$prismic.endpoint=options.endpoint;Vue.prototype.$prismic.linkResolver=options.linkResolver;Vue.prototype.$prismic.htmlSerializer=options.htmlSerializer;Vue.prototype.$prismic.client=client(options.endpoint,options.apiOptions);attachMethods(Vue,options);var components=_objectSpread2(_objectSpread2({},exp.common),exp[linkType]);Object.entries(components).forEach(function(_ref){var _ref2=_slicedToArray(_ref,2);_ref2[0];var c=_ref2[1];Vue.component(c.name,c)})}};return PrismicVue});
|
package/package.json
CHANGED
package/src/components/Embed.js
CHANGED
package/src/components/Image.js
CHANGED
package/src/components/Link.js
CHANGED
|
@@ -37,7 +37,7 @@ export default ({ component = "a" }) => ({
|
|
|
37
37
|
},
|
|
38
38
|
blankTargetRelAttribute: {
|
|
39
39
|
type: String,
|
|
40
|
-
default: "noopener",
|
|
40
|
+
default: "noopener noreferrer",
|
|
41
41
|
required: false,
|
|
42
42
|
},
|
|
43
43
|
},
|
|
@@ -70,18 +70,16 @@ export default ({ component = "a" }) => ({
|
|
|
70
70
|
href: url,
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
if (typeof props.target !== "undefined"
|
|
74
|
-
data.attrs.target =
|
|
75
|
-
|
|
73
|
+
if (typeof props.target !== "undefined") {
|
|
74
|
+
data.attrs.target = props.target;
|
|
75
|
+
} else if (field.target) {
|
|
76
|
+
data.attrs.target = field.target;
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
if (
|
|
79
|
-
data.attrs.rel =
|
|
80
|
-
typeof props.rel !== "undefined"
|
|
81
|
-
? props.rel
|
|
82
|
-
: props.blankTargetRelAttribute;
|
|
83
|
-
} else if (typeof props.rel !== "undefined") {
|
|
79
|
+
if (typeof props.rel !== "undefined") {
|
|
84
80
|
data.attrs.rel = props.rel;
|
|
81
|
+
} else if (data.attrs.target === "_blank") {
|
|
82
|
+
data.attrs.rel = props.blankTargetRelAttribute;
|
|
85
83
|
}
|
|
86
84
|
|
|
87
85
|
return h("a", data, children);
|
|
@@ -33,7 +33,7 @@ export const getSliceComponentProps = (propsHint) => ({
|
|
|
33
33
|
export const TODOSliceComponent = __PRODUCTION__
|
|
34
34
|
? null
|
|
35
35
|
: {
|
|
36
|
-
name: "
|
|
36
|
+
name: "TODOSliceComponent",
|
|
37
37
|
functional: true,
|
|
38
38
|
props: getSliceComponentProps(),
|
|
39
39
|
render(h, { props, data }) {
|
package/src/components/Text.js
CHANGED
package/src/index.js
CHANGED
|
@@ -29,6 +29,10 @@ const PrismicVue = {
|
|
|
29
29
|
install: function (Vue, options) {
|
|
30
30
|
const { linkType = "vueRouter" } = options;
|
|
31
31
|
Vue.prototype.$prismic = prismicJS;
|
|
32
|
+
Vue.prototype.$prismic.predicate = prismicJS.Predicates;
|
|
33
|
+
Vue.prototype.$prismic.cookie = {
|
|
34
|
+
preview: prismicJS.previewCookie,
|
|
35
|
+
};
|
|
32
36
|
Vue.prototype.$prismic.endpoint = options.endpoint;
|
|
33
37
|
Vue.prototype.$prismic.linkResolver = options.linkResolver;
|
|
34
38
|
Vue.prototype.$prismic.htmlSerializer = options.htmlSerializer;
|