@unhead/vue 2.1.9 → 3.0.0-beta.10
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/client.d.mts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.mjs +7 -9
- package/dist/components.mjs +1 -1
- package/dist/index.d.mts +9 -30
- package/dist/index.d.ts +9 -30
- package/dist/index.mjs +5 -9
- package/dist/scripts.d.mts +4 -4
- package/dist/scripts.d.ts +4 -4
- package/dist/scripts.mjs +3 -3
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.mjs +3 -3
- package/dist/shared/{vue.DoxLTFJk.d.mts → vue.9wC_EyGs.d.mts} +25 -17
- package/dist/shared/{vue.DoxLTFJk.d.ts → vue.9wC_EyGs.d.ts} +25 -17
- package/dist/shared/{vue.CVf9mpRR.mjs → vue.BUll6Wuy.mjs} +1 -1
- package/dist/shared/{vue.BM998iwd.mjs → vue.CLCWY4Ey.mjs} +1 -1
- package/dist/shared/{vue.Cr7xSEtD.mjs → vue.DdPIVN-K.mjs} +1 -10
- package/dist/stream/client.d.mts +17 -0
- package/dist/stream/client.d.ts +17 -0
- package/dist/stream/client.mjs +27 -0
- package/dist/stream/server.d.mts +50 -0
- package/dist/stream/server.d.ts +50 -0
- package/dist/stream/server.mjs +43 -0
- package/dist/stream/vite.d.mts +27 -0
- package/dist/stream/vite.d.ts +27 -0
- package/dist/stream/vite.mjs +67 -0
- package/dist/types.d.mts +68 -5
- package/dist/types.d.ts +68 -5
- package/dist/utils.d.mts +1 -6
- package/dist/utils.d.ts +1 -6
- package/dist/utils.mjs +1 -9
- package/package.json +33 -9
- package/dist/legacy.d.mts +0 -34
- package/dist/legacy.d.ts +0 -34
- package/dist/legacy.mjs +0 -114
- package/dist/shared/vue.CzjZUNjB.d.ts +0 -63
- package/dist/shared/vue.DMlT7xkj.d.mts +0 -63
- package/legacy.d.ts +0 -1
package/dist/legacy.mjs
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { createUnhead } from 'unhead';
|
|
2
|
-
import { inject, ref, watchEffect, unref, watch, getCurrentInstance, onBeforeUnmount, onDeactivated, onActivated } from 'vue';
|
|
3
|
-
import { createHead as createHead$1 } from './client.mjs';
|
|
4
|
-
import { h as headSymbol } from './shared/vue.Cr7xSEtD.mjs';
|
|
5
|
-
import { V as VueResolver } from './shared/vue.N9zWjxoK.mjs';
|
|
6
|
-
import { createHead as createHead$2 } from './server.mjs';
|
|
7
|
-
import { walkResolver } from 'unhead/utils';
|
|
8
|
-
import { defineHeadPlugin, DeprecationsPlugin, PromisesPlugin, TemplateParamsPlugin, AliasSortingPlugin, SafeInputPlugin, FlatMetaPlugin } from 'unhead/plugins';
|
|
9
|
-
import 'unhead/client';
|
|
10
|
-
import './shared/vue.BM998iwd.mjs';
|
|
11
|
-
import 'unhead/server';
|
|
12
|
-
|
|
13
|
-
const createHeadCore = createUnhead;
|
|
14
|
-
function resolveUnrefHeadInput(input) {
|
|
15
|
-
return walkResolver(input, VueResolver);
|
|
16
|
-
}
|
|
17
|
-
function CapoPlugin() {
|
|
18
|
-
return defineHeadPlugin({
|
|
19
|
-
key: "capo"
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
function createHead(options = {}) {
|
|
23
|
-
return createHead$1({
|
|
24
|
-
disableCapoSorting: true,
|
|
25
|
-
...options,
|
|
26
|
-
plugins: [
|
|
27
|
-
DeprecationsPlugin,
|
|
28
|
-
PromisesPlugin,
|
|
29
|
-
TemplateParamsPlugin,
|
|
30
|
-
AliasSortingPlugin,
|
|
31
|
-
...options.plugins || []
|
|
32
|
-
]
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function createServerHead(options = {}) {
|
|
36
|
-
return createHead$2({
|
|
37
|
-
disableCapoSorting: true,
|
|
38
|
-
...options,
|
|
39
|
-
plugins: [
|
|
40
|
-
DeprecationsPlugin,
|
|
41
|
-
PromisesPlugin,
|
|
42
|
-
TemplateParamsPlugin,
|
|
43
|
-
AliasSortingPlugin,
|
|
44
|
-
...options.plugins || []
|
|
45
|
-
]
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
function setHeadInjectionHandler(handler) {
|
|
49
|
-
}
|
|
50
|
-
function injectHead() {
|
|
51
|
-
return inject(headSymbol);
|
|
52
|
-
}
|
|
53
|
-
function useHead(input, options = {}) {
|
|
54
|
-
const head = options.head || injectHead();
|
|
55
|
-
if (head) {
|
|
56
|
-
return head.ssr ? head.push(input, options) : clientUseHead(head, input, options);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function clientUseHead(head, input, options = {}) {
|
|
60
|
-
const deactivated = ref(false);
|
|
61
|
-
const resolvedInput = ref({});
|
|
62
|
-
watchEffect(() => {
|
|
63
|
-
resolvedInput.value = deactivated.value ? {} : walkResolver(input, (v) => unref(v));
|
|
64
|
-
});
|
|
65
|
-
const entry = head.push(resolvedInput.value, options);
|
|
66
|
-
watch(resolvedInput, (e) => {
|
|
67
|
-
entry.patch(e);
|
|
68
|
-
});
|
|
69
|
-
const vm = getCurrentInstance();
|
|
70
|
-
if (vm) {
|
|
71
|
-
onBeforeUnmount(() => {
|
|
72
|
-
entry.dispose();
|
|
73
|
-
});
|
|
74
|
-
onDeactivated(() => {
|
|
75
|
-
deactivated.value = true;
|
|
76
|
-
});
|
|
77
|
-
onActivated(() => {
|
|
78
|
-
deactivated.value = false;
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
return entry;
|
|
82
|
-
}
|
|
83
|
-
function useHeadSafe(input, options = {}) {
|
|
84
|
-
const head = options.head || injectHead();
|
|
85
|
-
if (head) {
|
|
86
|
-
head.use(SafeInputPlugin);
|
|
87
|
-
options._safe = true;
|
|
88
|
-
return useHead(input, options);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
function useSeoMeta(input, options) {
|
|
92
|
-
const head = options?.head || injectHead();
|
|
93
|
-
if (head) {
|
|
94
|
-
head.use(FlatMetaPlugin);
|
|
95
|
-
const { title, titleTemplate, ...meta } = input;
|
|
96
|
-
return useHead({
|
|
97
|
-
title,
|
|
98
|
-
titleTemplate,
|
|
99
|
-
// @ts-expect-error runtime type
|
|
100
|
-
_flatMeta: meta
|
|
101
|
-
}, options);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
function useServerHead(input, options = {}) {
|
|
105
|
-
return useHead(input, { ...options, mode: "server" });
|
|
106
|
-
}
|
|
107
|
-
function useServerHeadSafe(input, options = {}) {
|
|
108
|
-
return useHeadSafe(input, { ...options, mode: "server" });
|
|
109
|
-
}
|
|
110
|
-
function useServerSeoMeta(input, options) {
|
|
111
|
-
return useSeoMeta(input, { ...options, mode: "server" });
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export { CapoPlugin, createHead, createHeadCore, createServerHead, injectHead, resolveUnrefHeadInput, setHeadInjectionHandler, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { ResolvableHead, LinkWithoutEvents, DataKeys, SchemaAugmentations, UnheadMeta, Style, ScriptWithoutEvents, TagPriority, TagPosition, ResolvesDuplicates, ProcessesTemplateParams, Noscript, HtmlAttributes, BodyAttributesWithoutEvents } from 'unhead/types';
|
|
2
|
-
import { m as ResolvableValue, o as ResolvableProperties } from './vue.DoxLTFJk.js';
|
|
3
|
-
|
|
4
|
-
type SafeBodyAttr = ResolvableProperties<Pick<BodyAttributesWithoutEvents, 'id' | 'class' | 'style'> & DataKeys & SchemaAugmentations['bodyAttrs']>;
|
|
5
|
-
type SafeHtmlAttr = ResolvableProperties<Pick<HtmlAttributes, 'id' | 'class' | 'style' | 'lang' | 'dir'> & DataKeys & SchemaAugmentations['htmlAttrs']>;
|
|
6
|
-
type SafeMeta = ResolvableProperties<Pick<UnheadMeta, 'id' | 'name' | 'property' | 'charset' | 'content' | 'media'> & DataKeys & SchemaAugmentations['meta']>;
|
|
7
|
-
type SafeLink = ResolvableProperties<Pick<LinkWithoutEvents, 'id' | 'color' | 'crossorigin' | 'fetchpriority' | 'href' | 'hreflang' | 'imagesrcset' | 'imagesizes' | 'integrity' | 'media' | 'referrerpolicy' | 'rel' | 'sizes' | 'type'> & DataKeys & SchemaAugmentations['link']>;
|
|
8
|
-
type SafeScript = ResolvableProperties<Pick<ScriptWithoutEvents, 'id' | 'type' | 'nonce' | 'blocking'> & DataKeys & {
|
|
9
|
-
textContent?: string;
|
|
10
|
-
} & TagPriority & TagPosition & ResolvesDuplicates & ProcessesTemplateParams>;
|
|
11
|
-
type SafeNoscript = ResolvableProperties<Pick<Noscript, 'id'> & DataKeys & Omit<SchemaAugmentations['noscript'], 'innerHTML'>>;
|
|
12
|
-
type SafeStyle = ResolvableProperties<Pick<Style, 'id' | 'media' | 'nonce' | 'title' | 'blocking'> & DataKeys & Omit<SchemaAugmentations['style'], 'innerHTML'>>;
|
|
13
|
-
interface HeadSafe extends Pick<ResolvableHead, 'title' | 'titleTemplate' | 'templateParams'> {
|
|
14
|
-
/**
|
|
15
|
-
* The `<link>` HTML element specifies relationships between the current document and an external resource.
|
|
16
|
-
* This element is most commonly used to link to stylesheets, but is also used to establish site icons
|
|
17
|
-
* (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
|
|
18
|
-
*
|
|
19
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
|
|
20
|
-
*/
|
|
21
|
-
link?: ResolvableValue<ResolvableValue<SafeLink[]>>;
|
|
22
|
-
/**
|
|
23
|
-
* The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
|
|
24
|
-
*
|
|
25
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
|
|
26
|
-
*/
|
|
27
|
-
meta?: ResolvableValue<ResolvableValue<SafeMeta>[]>;
|
|
28
|
-
/**
|
|
29
|
-
* The `<style>` HTML element contains style information for a document, or part of a document.
|
|
30
|
-
* It contains CSS, which is applied to the contents of the document containing the `<style>` element.
|
|
31
|
-
*
|
|
32
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
|
|
33
|
-
*/
|
|
34
|
-
style?: ResolvableValue<ResolvableValue<(SafeStyle | string)>[]>;
|
|
35
|
-
/**
|
|
36
|
-
* The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
|
|
37
|
-
*
|
|
38
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
|
|
39
|
-
*/
|
|
40
|
-
script?: ResolvableValue<ResolvableValue<(SafeScript | string)>[]>;
|
|
41
|
-
/**
|
|
42
|
-
* The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
|
|
43
|
-
* or if scripting is currently turned off in the browser.
|
|
44
|
-
*
|
|
45
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
|
|
46
|
-
*/
|
|
47
|
-
noscript?: ResolvableValue<ResolvableValue<(SafeNoscript | string)>[]>;
|
|
48
|
-
/**
|
|
49
|
-
* Attributes for the `<html>` HTML element.
|
|
50
|
-
*
|
|
51
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
|
|
52
|
-
*/
|
|
53
|
-
htmlAttrs?: ResolvableValue<SafeHtmlAttr>;
|
|
54
|
-
/**
|
|
55
|
-
* Attributes for the `<body>` HTML element.
|
|
56
|
-
*
|
|
57
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
|
|
58
|
-
*/
|
|
59
|
-
bodyAttrs?: ResolvableValue<SafeBodyAttr>;
|
|
60
|
-
}
|
|
61
|
-
type UseHeadSafeInput = ResolvableValue<HeadSafe>;
|
|
62
|
-
|
|
63
|
-
export type { HeadSafe as H, SafeBodyAttr as S, UseHeadSafeInput as U, SafeHtmlAttr as a, SafeMeta as b, SafeLink as c, SafeScript as d, SafeNoscript as e, SafeStyle as f };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { ResolvableHead, LinkWithoutEvents, DataKeys, SchemaAugmentations, UnheadMeta, Style, ScriptWithoutEvents, TagPriority, TagPosition, ResolvesDuplicates, ProcessesTemplateParams, Noscript, HtmlAttributes, BodyAttributesWithoutEvents } from 'unhead/types';
|
|
2
|
-
import { m as ResolvableValue, o as ResolvableProperties } from './vue.DoxLTFJk.mjs';
|
|
3
|
-
|
|
4
|
-
type SafeBodyAttr = ResolvableProperties<Pick<BodyAttributesWithoutEvents, 'id' | 'class' | 'style'> & DataKeys & SchemaAugmentations['bodyAttrs']>;
|
|
5
|
-
type SafeHtmlAttr = ResolvableProperties<Pick<HtmlAttributes, 'id' | 'class' | 'style' | 'lang' | 'dir'> & DataKeys & SchemaAugmentations['htmlAttrs']>;
|
|
6
|
-
type SafeMeta = ResolvableProperties<Pick<UnheadMeta, 'id' | 'name' | 'property' | 'charset' | 'content' | 'media'> & DataKeys & SchemaAugmentations['meta']>;
|
|
7
|
-
type SafeLink = ResolvableProperties<Pick<LinkWithoutEvents, 'id' | 'color' | 'crossorigin' | 'fetchpriority' | 'href' | 'hreflang' | 'imagesrcset' | 'imagesizes' | 'integrity' | 'media' | 'referrerpolicy' | 'rel' | 'sizes' | 'type'> & DataKeys & SchemaAugmentations['link']>;
|
|
8
|
-
type SafeScript = ResolvableProperties<Pick<ScriptWithoutEvents, 'id' | 'type' | 'nonce' | 'blocking'> & DataKeys & {
|
|
9
|
-
textContent?: string;
|
|
10
|
-
} & TagPriority & TagPosition & ResolvesDuplicates & ProcessesTemplateParams>;
|
|
11
|
-
type SafeNoscript = ResolvableProperties<Pick<Noscript, 'id'> & DataKeys & Omit<SchemaAugmentations['noscript'], 'innerHTML'>>;
|
|
12
|
-
type SafeStyle = ResolvableProperties<Pick<Style, 'id' | 'media' | 'nonce' | 'title' | 'blocking'> & DataKeys & Omit<SchemaAugmentations['style'], 'innerHTML'>>;
|
|
13
|
-
interface HeadSafe extends Pick<ResolvableHead, 'title' | 'titleTemplate' | 'templateParams'> {
|
|
14
|
-
/**
|
|
15
|
-
* The `<link>` HTML element specifies relationships between the current document and an external resource.
|
|
16
|
-
* This element is most commonly used to link to stylesheets, but is also used to establish site icons
|
|
17
|
-
* (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
|
|
18
|
-
*
|
|
19
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
|
|
20
|
-
*/
|
|
21
|
-
link?: ResolvableValue<ResolvableValue<SafeLink[]>>;
|
|
22
|
-
/**
|
|
23
|
-
* The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
|
|
24
|
-
*
|
|
25
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
|
|
26
|
-
*/
|
|
27
|
-
meta?: ResolvableValue<ResolvableValue<SafeMeta>[]>;
|
|
28
|
-
/**
|
|
29
|
-
* The `<style>` HTML element contains style information for a document, or part of a document.
|
|
30
|
-
* It contains CSS, which is applied to the contents of the document containing the `<style>` element.
|
|
31
|
-
*
|
|
32
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
|
|
33
|
-
*/
|
|
34
|
-
style?: ResolvableValue<ResolvableValue<(SafeStyle | string)>[]>;
|
|
35
|
-
/**
|
|
36
|
-
* The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
|
|
37
|
-
*
|
|
38
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
|
|
39
|
-
*/
|
|
40
|
-
script?: ResolvableValue<ResolvableValue<(SafeScript | string)>[]>;
|
|
41
|
-
/**
|
|
42
|
-
* The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
|
|
43
|
-
* or if scripting is currently turned off in the browser.
|
|
44
|
-
*
|
|
45
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
|
|
46
|
-
*/
|
|
47
|
-
noscript?: ResolvableValue<ResolvableValue<(SafeNoscript | string)>[]>;
|
|
48
|
-
/**
|
|
49
|
-
* Attributes for the `<html>` HTML element.
|
|
50
|
-
*
|
|
51
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
|
|
52
|
-
*/
|
|
53
|
-
htmlAttrs?: ResolvableValue<SafeHtmlAttr>;
|
|
54
|
-
/**
|
|
55
|
-
* Attributes for the `<body>` HTML element.
|
|
56
|
-
*
|
|
57
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
|
|
58
|
-
*/
|
|
59
|
-
bodyAttrs?: ResolvableValue<SafeBodyAttr>;
|
|
60
|
-
}
|
|
61
|
-
type UseHeadSafeInput = ResolvableValue<HeadSafe>;
|
|
62
|
-
|
|
63
|
-
export type { HeadSafe as H, SafeBodyAttr as S, UseHeadSafeInput as U, SafeHtmlAttr as a, SafeMeta as b, SafeLink as c, SafeScript as d, SafeNoscript as e, SafeStyle as f };
|
package/legacy.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './dist/legacy.js'
|