unhead 1.11.14 → 2.0.0-alpha.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.
Files changed (45) hide show
  1. package/client.d.ts +1 -0
  2. package/dist/client.cjs +29 -0
  3. package/dist/client.d.cts +25 -0
  4. package/dist/client.d.mts +25 -0
  5. package/dist/client.d.ts +25 -0
  6. package/dist/client.mjs +24 -0
  7. package/dist/index.cjs +11 -698
  8. package/dist/index.d.cts +10 -44
  9. package/dist/index.d.mts +10 -44
  10. package/dist/index.d.ts +10 -44
  11. package/dist/index.mjs +10 -692
  12. package/dist/legacy.cjs +316 -0
  13. package/dist/legacy.d.cts +107 -0
  14. package/dist/legacy.d.mts +107 -0
  15. package/dist/legacy.d.ts +107 -0
  16. package/dist/legacy.mjs +301 -0
  17. package/dist/plugins.cjs +96 -0
  18. package/dist/plugins.d.cts +41 -0
  19. package/dist/plugins.d.mts +41 -0
  20. package/dist/plugins.d.ts +41 -0
  21. package/dist/plugins.mjs +86 -0
  22. package/dist/server.cjs +119 -0
  23. package/dist/server.d.cts +22 -0
  24. package/dist/server.d.mts +22 -0
  25. package/dist/server.d.ts +22 -0
  26. package/dist/server.mjs +112 -0
  27. package/dist/shared/unhead.9459P6Us.mjs +216 -0
  28. package/dist/shared/unhead.B1vp-BN3.cjs +63 -0
  29. package/dist/shared/unhead.Bkkr-JOb.d.cts +38 -0
  30. package/dist/shared/unhead.Bkkr-JOb.d.mts +38 -0
  31. package/dist/shared/unhead.Bkkr-JOb.d.ts +38 -0
  32. package/dist/shared/unhead.BxCMBVrg.mjs +15 -0
  33. package/dist/shared/unhead.C1knnawv.cjs +246 -0
  34. package/dist/shared/unhead.CU1QS7En.cjs +96 -0
  35. package/dist/shared/unhead.DGQq1RAN.cjs +58 -0
  36. package/dist/shared/unhead.DJ2B9fZW.mjs +94 -0
  37. package/dist/shared/unhead.DTD44cG0.cjs +19 -0
  38. package/dist/shared/unhead.DbMOoWpX.cjs +222 -0
  39. package/dist/shared/unhead.Dk9EcP_t.mjs +60 -0
  40. package/dist/shared/unhead.YfQbj2z7.mjs +55 -0
  41. package/dist/shared/unhead.ovi5lkPs.mjs +241 -0
  42. package/legacy.d.ts +1 -0
  43. package/package.json +41 -7
  44. package/plugins.d.ts +1 -0
  45. package/server.d.ts +1 -0
package/client.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/client'
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ const shared = require('@unhead/shared');
4
+ const context = require('./shared/unhead.DTD44cG0.cjs');
5
+ const createHead$1 = require('./shared/unhead.CU1QS7En.cjs');
6
+ const eventHandlers = require('./shared/unhead.C1knnawv.cjs');
7
+ require('unctx');
8
+ require('hookable');
9
+ require('./shared/unhead.DbMOoWpX.cjs');
10
+
11
+ function createHead(options = {}) {
12
+ const head = createHead$1.createHeadCore({
13
+ document: shared.IsBrowser ? document : undefined,
14
+ ...options,
15
+ plugins: [
16
+ ...options.plugins || [],
17
+ eventHandlers.DomPlugin(options.domOptions),
18
+ eventHandlers.ClientEventHandlerPlugin
19
+ ]
20
+ });
21
+ context.unheadCtx.set(head, true);
22
+ return head;
23
+ }
24
+
25
+ exports.ClientEventHandlerPlugin = eventHandlers.ClientEventHandlerPlugin;
26
+ exports.DomPlugin = eventHandlers.DomPlugin;
27
+ exports.debouncedRenderDOMHead = eventHandlers.debouncedRenderDOMHead;
28
+ exports.renderDOMHead = eventHandlers.renderDOMHead;
29
+ exports.createHead = createHead;
@@ -0,0 +1,25 @@
1
+ import * as _unhead_schema from '@unhead/schema';
2
+ import { Head, CreateClientHeadOptions, Unhead, DomPluginOptions, RenderDomHeadOptions } from '@unhead/schema';
3
+
4
+ declare function createHead<T extends Record<string, any> = Head>(options?: CreateClientHeadOptions): _unhead_schema.Unhead<T>;
5
+
6
+ /**
7
+ * Queue a debounced update of the DOM head.
8
+ */
9
+ declare function debouncedRenderDOMHead<T extends Unhead<any>>(head: T, options?: DomPluginOptions): Promise<void>;
10
+
11
+ declare function DomPlugin(options?: DomPluginOptions): _unhead_schema.HeadPluginInput;
12
+
13
+ /**
14
+ * Supports DOM event handlers (i.e `onload`) as functions.
15
+ *
16
+ * When SSR we need to strip out these values. On CSR we
17
+ */
18
+ declare const ClientEventHandlerPlugin: _unhead_schema.HeadPluginInput;
19
+
20
+ /**
21
+ * Render the head tags to the DOM.
22
+ */
23
+ declare function renderDOMHead<T extends Unhead<any>>(head: T, options?: RenderDomHeadOptions): Promise<void>;
24
+
25
+ export { ClientEventHandlerPlugin, DomPlugin, createHead, debouncedRenderDOMHead, renderDOMHead };
@@ -0,0 +1,25 @@
1
+ import * as _unhead_schema from '@unhead/schema';
2
+ import { Head, CreateClientHeadOptions, Unhead, DomPluginOptions, RenderDomHeadOptions } from '@unhead/schema';
3
+
4
+ declare function createHead<T extends Record<string, any> = Head>(options?: CreateClientHeadOptions): _unhead_schema.Unhead<T>;
5
+
6
+ /**
7
+ * Queue a debounced update of the DOM head.
8
+ */
9
+ declare function debouncedRenderDOMHead<T extends Unhead<any>>(head: T, options?: DomPluginOptions): Promise<void>;
10
+
11
+ declare function DomPlugin(options?: DomPluginOptions): _unhead_schema.HeadPluginInput;
12
+
13
+ /**
14
+ * Supports DOM event handlers (i.e `onload`) as functions.
15
+ *
16
+ * When SSR we need to strip out these values. On CSR we
17
+ */
18
+ declare const ClientEventHandlerPlugin: _unhead_schema.HeadPluginInput;
19
+
20
+ /**
21
+ * Render the head tags to the DOM.
22
+ */
23
+ declare function renderDOMHead<T extends Unhead<any>>(head: T, options?: RenderDomHeadOptions): Promise<void>;
24
+
25
+ export { ClientEventHandlerPlugin, DomPlugin, createHead, debouncedRenderDOMHead, renderDOMHead };
@@ -0,0 +1,25 @@
1
+ import * as _unhead_schema from '@unhead/schema';
2
+ import { Head, CreateClientHeadOptions, Unhead, DomPluginOptions, RenderDomHeadOptions } from '@unhead/schema';
3
+
4
+ declare function createHead<T extends Record<string, any> = Head>(options?: CreateClientHeadOptions): _unhead_schema.Unhead<T>;
5
+
6
+ /**
7
+ * Queue a debounced update of the DOM head.
8
+ */
9
+ declare function debouncedRenderDOMHead<T extends Unhead<any>>(head: T, options?: DomPluginOptions): Promise<void>;
10
+
11
+ declare function DomPlugin(options?: DomPluginOptions): _unhead_schema.HeadPluginInput;
12
+
13
+ /**
14
+ * Supports DOM event handlers (i.e `onload`) as functions.
15
+ *
16
+ * When SSR we need to strip out these values. On CSR we
17
+ */
18
+ declare const ClientEventHandlerPlugin: _unhead_schema.HeadPluginInput;
19
+
20
+ /**
21
+ * Render the head tags to the DOM.
22
+ */
23
+ declare function renderDOMHead<T extends Unhead<any>>(head: T, options?: RenderDomHeadOptions): Promise<void>;
24
+
25
+ export { ClientEventHandlerPlugin, DomPlugin, createHead, debouncedRenderDOMHead, renderDOMHead };
@@ -0,0 +1,24 @@
1
+ import { IsBrowser } from '@unhead/shared';
2
+ import { a as unheadCtx } from './shared/unhead.BxCMBVrg.mjs';
3
+ import { c as createHeadCore } from './shared/unhead.DJ2B9fZW.mjs';
4
+ import { D as DomPlugin, C as ClientEventHandlerPlugin } from './shared/unhead.ovi5lkPs.mjs';
5
+ export { d as debouncedRenderDOMHead, r as renderDOMHead } from './shared/unhead.ovi5lkPs.mjs';
6
+ import 'unctx';
7
+ import 'hookable';
8
+ import './shared/unhead.9459P6Us.mjs';
9
+
10
+ function createHead(options = {}) {
11
+ const head = createHeadCore({
12
+ document: IsBrowser ? document : undefined,
13
+ ...options,
14
+ plugins: [
15
+ ...options.plugins || [],
16
+ DomPlugin(options.domOptions),
17
+ ClientEventHandlerPlugin
18
+ ]
19
+ });
20
+ unheadCtx.set(head, true);
21
+ return head;
22
+ }
23
+
24
+ export { ClientEventHandlerPlugin, DomPlugin, createHead };