unhead 1.0.16 → 1.0.18

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 CHANGED
@@ -538,7 +538,6 @@ const useTagTitle = (title) => useHead({ title });
538
538
  const useTagBase = (base) => useHead({ base });
539
539
  const useTagMeta = (meta) => useHead({ meta: asArray(meta) });
540
540
  const useTagMetaFlat = (meta) => useTagMeta(unpackMeta(meta));
541
- const useSeoMeta = useTagMetaFlat;
542
541
  const useTagLink = (link) => useHead({ link: asArray(link) });
543
542
  const useTagScript = (script) => useHead({ script: asArray(script) });
544
543
  const useTagStyle = (style) => useHead({ style: asArray(style) });
@@ -562,6 +561,15 @@ const useServerHtmlAttrs = (attrs) => useServerHead({ htmlAttrs: attrs });
562
561
  const useServerBodyAttrs = (attrs) => useServerHead({ bodyAttrs: attrs });
563
562
  const useServerTitleTemplate = (titleTemplate) => useServerHead({ titleTemplate });
564
563
 
564
+ const useSeoMeta = (input) => {
565
+ const { title, titleTemplate, ...meta } = input;
566
+ return useHead({
567
+ title,
568
+ titleTemplate,
569
+ meta: unpackMeta(meta)
570
+ });
571
+ };
572
+
565
573
  const TagEntityBits = 10;
566
574
 
567
575
  async function normaliseEntryTags(e) {
package/dist/index.d.ts CHANGED
@@ -36,7 +36,6 @@ declare const useTagTitle: (title: Title) => ActiveHeadEntry<any> | void;
36
36
  declare const useTagBase: (base: Base) => ActiveHeadEntry<any> | void;
37
37
  declare const useTagMeta: (meta: Arrayable<Meta>) => ActiveHeadEntry<any> | void;
38
38
  declare const useTagMetaFlat: (meta: MetaFlatInput) => ActiveHeadEntry<any> | void;
39
- declare const useSeoMeta: (meta: MetaFlatInput) => ActiveHeadEntry<any> | void;
40
39
  declare const useTagLink: (link: Arrayable<Link>) => ActiveHeadEntry<any> | void;
41
40
  declare const useTagScript: (script: Arrayable<Script>) => ActiveHeadEntry<any> | void;
42
41
  declare const useTagStyle: (style: Arrayable<Style>) => ActiveHeadEntry<any> | void;
@@ -58,6 +57,12 @@ declare const useServerHtmlAttrs: (attrs: HtmlAttributes) => ActiveHeadEntry<any
58
57
  declare const useServerBodyAttrs: (attrs: BodyAttributes) => ActiveHeadEntry<any> | void;
59
58
  declare const useServerTitleTemplate: (titleTemplate: TitleTemplate) => ActiveHeadEntry<any> | void;
60
59
 
60
+ type UseSeoMetaInput = MetaFlatInput & {
61
+ title?: Title;
62
+ titleTemplate?: TitleTemplate;
63
+ };
64
+ declare const useSeoMeta: (input: UseSeoMetaInput) => ActiveHeadEntry<any> | void;
65
+
61
66
  declare let activeHead: Unhead<any> | undefined;
62
67
  declare const setActiveHead: (head: Unhead<any> | undefined) => Unhead<any> | undefined;
63
68
  declare const getActiveHead: () => Unhead<any> | undefined;
@@ -83,4 +88,4 @@ declare const unheadComposablesImports: {
83
88
  imports: string[];
84
89
  }[];
85
90
 
86
- export { Arrayable, CorePlugins, DOMPlugins, DedupesTagsPlugin, DedupesTagsPluginOptions, DeprecatedTagAttrPlugin, EventHandlersPlugin, HasElementTags, PatchDomOnEntryUpdatesPlugin, ProvideTagHashPlugin, SortTagsPlugin, TitleTemplatePlugin, activeHead, asArray, composableNames, createHead, createHeadCore, defineHeadPlugin, getActiveHead, normaliseEntryTags, setActiveHead, unheadComposablesImports, useBodyAttrs, useHead, useHtmlAttrs, useSeoMeta, useServerBodyAttrs, useServerHead, useServerHtmlAttrs, useServerTagBase, useServerTagLink, useServerTagMeta, useServerTagMetaFlat, useServerTagNoscript, useServerTagScript, useServerTagStyle, useServerTagTitle, useServerTitleTemplate, useTagBase, useTagLink, useTagMeta, useTagMetaFlat, useTagNoscript, useTagScript, useTagStyle, useTagTitle, useTitleTemplate };
91
+ export { Arrayable, CorePlugins, DOMPlugins, DedupesTagsPlugin, DedupesTagsPluginOptions, DeprecatedTagAttrPlugin, EventHandlersPlugin, HasElementTags, PatchDomOnEntryUpdatesPlugin, ProvideTagHashPlugin, SortTagsPlugin, TitleTemplatePlugin, UseSeoMetaInput, activeHead, asArray, composableNames, createHead, createHeadCore, defineHeadPlugin, getActiveHead, normaliseEntryTags, setActiveHead, unheadComposablesImports, useBodyAttrs, useHead, useHtmlAttrs, useSeoMeta, useServerBodyAttrs, useServerHead, useServerHtmlAttrs, useServerTagBase, useServerTagLink, useServerTagMeta, useServerTagMetaFlat, useServerTagNoscript, useServerTagScript, useServerTagStyle, useServerTagTitle, useServerTitleTemplate, useTagBase, useTagLink, useTagMeta, useTagMetaFlat, useTagNoscript, useTagScript, useTagStyle, useTagTitle, useTitleTemplate };
package/dist/index.mjs CHANGED
@@ -536,7 +536,6 @@ const useTagTitle = (title) => useHead({ title });
536
536
  const useTagBase = (base) => useHead({ base });
537
537
  const useTagMeta = (meta) => useHead({ meta: asArray(meta) });
538
538
  const useTagMetaFlat = (meta) => useTagMeta(unpackMeta(meta));
539
- const useSeoMeta = useTagMetaFlat;
540
539
  const useTagLink = (link) => useHead({ link: asArray(link) });
541
540
  const useTagScript = (script) => useHead({ script: asArray(script) });
542
541
  const useTagStyle = (style) => useHead({ style: asArray(style) });
@@ -560,6 +559,15 @@ const useServerHtmlAttrs = (attrs) => useServerHead({ htmlAttrs: attrs });
560
559
  const useServerBodyAttrs = (attrs) => useServerHead({ bodyAttrs: attrs });
561
560
  const useServerTitleTemplate = (titleTemplate) => useServerHead({ titleTemplate });
562
561
 
562
+ const useSeoMeta = (input) => {
563
+ const { title, titleTemplate, ...meta } = input;
564
+ return useHead({
565
+ title,
566
+ titleTemplate,
567
+ meta: unpackMeta(meta)
568
+ });
569
+ };
570
+
563
571
  const TagEntityBits = 10;
564
572
 
565
573
  async function normaliseEntryTags(e) {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "unhead",
3
3
  "type": "module",
4
- "version": "1.0.16",
5
- "packageManager": "pnpm@7.25.0",
4
+ "version": "1.0.18",
5
+ "packageManager": "pnpm@7.25.1",
6
6
  "author": "Harlan Wilton <harlan@harlanzw.com>",
7
7
  "license": "MIT",
8
8
  "funding": "https://github.com/sponsors/harlan-zw",
@@ -31,8 +31,8 @@
31
31
  ],
32
32
  "dependencies": {
33
33
  "hookable": "^5.4.2",
34
- "@unhead/dom": "1.0.16",
35
- "@unhead/schema": "1.0.16"
34
+ "@unhead/dom": "1.0.18",
35
+ "@unhead/schema": "1.0.18"
36
36
  },
37
37
  "devDependencies": {
38
38
  "zhead": "^1.0.9"