@unhead/svelte 2.0.0-alpha.17
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/LICENSE +21 -0
- package/client.d.ts +1 -0
- package/dist/client.d.mts +8 -0
- package/dist/client.d.ts +8 -0
- package/dist/client.mjs +16 -0
- package/dist/index.d.mts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.mjs +38 -0
- package/dist/plugins.d.mts +1 -0
- package/dist/plugins.d.ts +1 -0
- package/dist/plugins.mjs +1 -0
- package/dist/server.d.mts +5 -0
- package/dist/server.d.ts +5 -0
- package/dist/server.mjs +2 -0
- package/dist/shared/svelte.Cczd8v9v.mjs +3 -0
- package/dist/utils.d.mts +2 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.mjs +1 -0
- package/package.json +78 -0
- package/server.d.ts +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Harlan Wilton <harlan@harlanzw.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/client.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/client'
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CreateClientHeadOptions, Unhead } from 'unhead/types';
|
|
2
|
+
export { UnheadContextKey } from './server.mjs';
|
|
3
|
+
export { renderDOMHead } from 'unhead/client';
|
|
4
|
+
import 'unhead/server';
|
|
5
|
+
|
|
6
|
+
declare function createHead(options?: Omit<CreateClientHeadOptions, 'propResolvers'>): Unhead;
|
|
7
|
+
|
|
8
|
+
export { createHead };
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CreateClientHeadOptions, Unhead } from 'unhead/types';
|
|
2
|
+
export { UnheadContextKey } from './server.js';
|
|
3
|
+
export { renderDOMHead } from 'unhead/client';
|
|
4
|
+
import 'unhead/server';
|
|
5
|
+
|
|
6
|
+
declare function createHead(options?: Omit<CreateClientHeadOptions, 'propResolvers'>): Unhead;
|
|
7
|
+
|
|
8
|
+
export { createHead };
|
package/dist/client.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { tick } from 'svelte';
|
|
2
|
+
import { createHead as createHead$1, createDebouncedFn, renderDOMHead } from 'unhead/client';
|
|
3
|
+
export { renderDOMHead } from 'unhead/client';
|
|
4
|
+
export { U as UnheadContextKey } from './shared/svelte.Cczd8v9v.mjs';
|
|
5
|
+
|
|
6
|
+
function createHead(options = {}) {
|
|
7
|
+
const head = createHead$1({
|
|
8
|
+
domOptions: {
|
|
9
|
+
render: createDebouncedFn(() => renderDOMHead(head), (fn) => tick().then(fn))
|
|
10
|
+
},
|
|
11
|
+
...options
|
|
12
|
+
});
|
|
13
|
+
return head;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { createHead };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UseHeadInput, HeadEntryOptions, ActiveHeadEntry, HeadSafe, UseSeoMetaInput, Unhead, Head } from 'unhead/types';
|
|
2
|
+
export { UnheadContextKey } from './server.mjs';
|
|
3
|
+
import 'unhead/server';
|
|
4
|
+
|
|
5
|
+
declare const autoImports: {
|
|
6
|
+
'@unhead/svelte': string[];
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
declare function useUnhead(): Unhead<Head>;
|
|
10
|
+
declare function useHead(input?: UseHeadInput, options?: HeadEntryOptions): ActiveHeadEntry<UseHeadInput>;
|
|
11
|
+
declare function useHeadSafe(input?: HeadSafe, options?: HeadEntryOptions): ActiveHeadEntry<HeadSafe>;
|
|
12
|
+
declare function useSeoMeta(input?: UseSeoMetaInput, options?: HeadEntryOptions): ActiveHeadEntry<UseSeoMetaInput>;
|
|
13
|
+
|
|
14
|
+
export { autoImports, useHead, useHeadSafe, useSeoMeta, useUnhead };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UseHeadInput, HeadEntryOptions, ActiveHeadEntry, HeadSafe, UseSeoMetaInput, Unhead, Head } from 'unhead/types';
|
|
2
|
+
export { UnheadContextKey } from './server.js';
|
|
3
|
+
import 'unhead/server';
|
|
4
|
+
|
|
5
|
+
declare const autoImports: {
|
|
6
|
+
'@unhead/svelte': string[];
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
declare function useUnhead(): Unhead<Head>;
|
|
10
|
+
declare function useHead(input?: UseHeadInput, options?: HeadEntryOptions): ActiveHeadEntry<UseHeadInput>;
|
|
11
|
+
declare function useHeadSafe(input?: HeadSafe, options?: HeadEntryOptions): ActiveHeadEntry<HeadSafe>;
|
|
12
|
+
declare function useSeoMeta(input?: UseSeoMetaInput, options?: HeadEntryOptions): ActiveHeadEntry<UseSeoMetaInput>;
|
|
13
|
+
|
|
14
|
+
export { autoImports, useHead, useHeadSafe, useSeoMeta, useUnhead };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { getContext, onDestroy } from 'svelte';
|
|
2
|
+
import { useHead as useHead$1, useHeadSafe as useHeadSafe$1, useSeoMeta as useSeoMeta$1 } from 'unhead';
|
|
3
|
+
import { U as UnheadContextKey } from './shared/svelte.Cczd8v9v.mjs';
|
|
4
|
+
|
|
5
|
+
const autoImports = {
|
|
6
|
+
"@unhead/svelte": [
|
|
7
|
+
"useUnhead",
|
|
8
|
+
"useHead",
|
|
9
|
+
"useSeoMeta",
|
|
10
|
+
"useHeadSafe",
|
|
11
|
+
"useServerHead"
|
|
12
|
+
]
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
function useUnhead() {
|
|
16
|
+
const instance = getContext(UnheadContextKey);
|
|
17
|
+
if (!instance) {
|
|
18
|
+
throw new Error("useUnhead() was called without provide context.");
|
|
19
|
+
}
|
|
20
|
+
return instance;
|
|
21
|
+
}
|
|
22
|
+
function withSideEffects(instance) {
|
|
23
|
+
onDestroy(() => {
|
|
24
|
+
instance.dispose();
|
|
25
|
+
});
|
|
26
|
+
return instance;
|
|
27
|
+
}
|
|
28
|
+
function useHead(input = {}, options = {}) {
|
|
29
|
+
return withSideEffects(useHead$1(options.head || useUnhead(), input, options));
|
|
30
|
+
}
|
|
31
|
+
function useHeadSafe(input = {}, options = {}) {
|
|
32
|
+
return withSideEffects(useHeadSafe$1(options.head || useUnhead(), input, options));
|
|
33
|
+
}
|
|
34
|
+
function useSeoMeta(input = {}, options = {}) {
|
|
35
|
+
return withSideEffects(useSeoMeta$1(options.head || useUnhead(), input, options));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { UnheadContextKey, autoImports, useHead, useHeadSafe, useSeoMeta, useUnhead };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'unhead/plugins';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'unhead/plugins';
|
package/dist/plugins.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'unhead/plugins';
|
package/dist/server.d.ts
ADDED
package/dist/server.mjs
ADDED
package/dist/utils.d.mts
ADDED
package/dist/utils.d.ts
ADDED
package/dist/utils.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'unhead/utils';
|
package/package.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@unhead/svelte",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "2.0.0-alpha.17",
|
|
5
|
+
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"funding": "https://github.com/sponsors/harlan-zw",
|
|
8
|
+
"homepage": "https://unhead.unjs.io",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/unjs/unhead.git",
|
|
12
|
+
"directory": "packages/svelte"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/unjs/unhead/issues"
|
|
16
|
+
},
|
|
17
|
+
"sideEffects": false,
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.mjs"
|
|
22
|
+
},
|
|
23
|
+
"./server": {
|
|
24
|
+
"types": "./dist/server.d.ts",
|
|
25
|
+
"import": "./dist/server.mjs"
|
|
26
|
+
},
|
|
27
|
+
"./client": {
|
|
28
|
+
"types": "./dist/client.d.ts",
|
|
29
|
+
"import": "./dist/client.mjs"
|
|
30
|
+
},
|
|
31
|
+
"./utils": {
|
|
32
|
+
"types": "./dist/utils.d.ts",
|
|
33
|
+
"import": "./dist/utils.mjs"
|
|
34
|
+
},
|
|
35
|
+
"./plugins": {
|
|
36
|
+
"types": "./dist/plugins.d.ts",
|
|
37
|
+
"import": "./dist/plugins.mjs"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"main": "dist/index.mjs",
|
|
41
|
+
"module": "dist/index.mjs",
|
|
42
|
+
"types": "dist/index.d.ts",
|
|
43
|
+
"typesVersions": {
|
|
44
|
+
"*": {
|
|
45
|
+
"server": [
|
|
46
|
+
"dist/server"
|
|
47
|
+
],
|
|
48
|
+
"client": [
|
|
49
|
+
"dist/client"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"files": [
|
|
54
|
+
"client.d.ts",
|
|
55
|
+
"dist",
|
|
56
|
+
"server.d.ts"
|
|
57
|
+
],
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"svelte": ">=5"
|
|
60
|
+
},
|
|
61
|
+
"build": {
|
|
62
|
+
"external": [
|
|
63
|
+
"svelte"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"unhead": "2.0.0-alpha.17"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@testing-library/svelte": "^5.2.7",
|
|
71
|
+
"svelte": "^5.20.2"
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"build": "unbuild .",
|
|
75
|
+
"stub": "unbuild . --stub",
|
|
76
|
+
"export:sizes": "npx export-size . -r"
|
|
77
|
+
}
|
|
78
|
+
}
|
package/server.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/server'
|