@unhead/angular 3.0.1 → 3.0.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.
@@ -1,6 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, inject, DestroyRef, effect, CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
3
3
  import { useHead as useHead$1, useHeadSafe as useHeadSafe$1, useSeoMeta as useSeoMeta$1, useScript as useScript$1 } from 'unhead';
4
+ export { defineLink, defineScript } from 'unhead';
4
5
 
5
6
  const headSymbol = 'usehead';
6
7
  const UnheadInjectionToken = new InjectionToken(headSymbol);
@@ -1 +1 @@
1
- {"version":3,"file":"unhead-angular.mjs","sources":["../../src/context.ts","../../src/composables.ts","../../src/head.component.ts","../../src/public-api.ts","../../src/unhead-angular.ts"],"sourcesContent":["import type { Unhead } from 'unhead/types'\nimport { InjectionToken } from '@angular/core'\n\nexport const headSymbol = 'usehead'\n\nexport const UnheadInjectionToken = new InjectionToken<Unhead>(headSymbol)\n","import type { ActiveHeadEntry, HeadEntryOptions, HeadSafe, Unhead, UseHeadInput, UseScriptInput, UseScriptOptions, UseScriptReturn, UseSeoMetaInput } from 'unhead/types'\nimport { DestroyRef, effect, inject } from '@angular/core'\nimport { useHead as baseHead, useHeadSafe as baseHeadSafe, useSeoMeta as baseSeoMeta, useScript as baseUseScript } from 'unhead'\nimport { UnheadInjectionToken } from './context'\n\nexport function useUnhead() {\n const instance = inject<Unhead>(UnheadInjectionToken)\n if (!instance) {\n throw new Error('useHead() was called without proper injection context.')\n }\n return instance\n}\n\nfunction withSideEffects<T extends ActiveHeadEntry<any>>(input: any, options: any, fn: any): T {\n const head = options.head || useUnhead()\n const entry = fn(head, input, options)\n\n const destroyRef = inject(DestroyRef)\n destroyRef.onDestroy(() => {\n entry.dispose()\n })\n\n return entry\n}\n\nexport function useHead(input: UseHeadInput = {}, options: HeadEntryOptions = {}): ActiveHeadEntry<UseHeadInput> {\n return withSideEffects(input, options, baseHead)\n}\n\nexport function useHeadSafe(input: HeadSafe = {}, options: HeadEntryOptions = {}): ActiveHeadEntry<HeadSafe> {\n return withSideEffects<ActiveHeadEntry<HeadSafe>>(input, options, baseHeadSafe)\n}\n\nexport function useSeoMeta(input: UseSeoMetaInput = {}, options: HeadEntryOptions = {}): ActiveHeadEntry<UseSeoMetaInput> {\n return withSideEffects<ActiveHeadEntry<UseSeoMetaInput>>(input, options, baseSeoMeta)\n}\n\nexport function useScript<T extends Record<symbol | string, any> = Record<symbol | string, any>>(_input: UseScriptInput, _options?: UseScriptOptions<T>): UseScriptReturn<T> {\n const input = (typeof _input === 'string' ? { src: _input } : _input) as UseScriptInput\n const options = _options || {} as UseScriptOptions<T>\n const head = options?.head || useUnhead()\n options.head = head\n\n const mountCbs: (() => void)[] = []\n const sideEffects: (() => void)[] = []\n let isMounted = false\n\n const destroyRef = inject(DestroyRef)\n\n effect(() => {\n isMounted = true\n mountCbs.forEach(i => i())\n })\n\n if (typeof options.trigger === 'undefined') {\n options.trigger = (load) => {\n if (isMounted) {\n load()\n }\n else {\n mountCbs.push(load)\n }\n }\n }\n\n // @ts-expect-error untyped\n const script = baseUseScript(head, input as BaseUseScriptInput, options)\n\n const _registerCb = (key: 'loaded' | 'error', cb: any) => {\n let i: number | null\n const destroy = () => {\n // avoid removing the wrong callback\n if (i) {\n script._cbs[key]?.splice(i - 1, 1)\n i = null\n }\n }\n mountCbs.push(() => {\n if (!script._cbs[key]) {\n cb(script.instance)\n return () => {}\n }\n i = script._cbs[key].push(cb)\n sideEffects.push(destroy)\n return destroy\n })\n }\n\n destroyRef.onDestroy(() => {\n isMounted = false\n script._triggerAbortController?.abort()\n sideEffects.forEach(i => i())\n })\n script.onLoaded = (cb: (instance: T) => void | Promise<void>) => _registerCb('loaded', cb)\n script.onError = (cb: (err?: Error) => void | Promise<void>) => _registerCb('error', cb)\n return script\n}\n","import type { OnDestroy } from '@angular/core'\nimport { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'\nimport { useHead } from './composables'\n\ninterface NodeProps {\n type: string | symbol\n props?: Record<string, any>\n children?: NodeProps[]\n}\n\n@Component({\n selector: 'unhead-head',\n standalone: true,\n template: '<ng-content></ng-content>',\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n})\nexport class Head implements OnDestroy {\n private headEntry = useHead({})\n\n updateHead(nodes: NodeProps[]) {\n const transformed = this.transformNodes(nodes)\n this.headEntry.patch(transformed)\n }\n\n private transformNodes(nodes: NodeProps[]) {\n const result: Record<string, any> = {}\n\n const processNode = (node: NodeProps) => {\n if (typeof node.type === 'symbol') {\n node.children?.forEach(child => processNode(child as NodeProps))\n return\n }\n\n const type = node.type as string\n if (node.children?.length === 1) {\n result[type] = node.children[0]\n }\n else if (Object.keys(node.props || {}).length) {\n result[type] = result[type] || []\n result[type].push(node.props)\n }\n }\n\n nodes.forEach(processNode)\n return result\n }\n\n ngOnDestroy() {\n this.headEntry.dispose()\n }\n}\n","/*\n * Public API Surface of unhead\n */\n\nexport { useHead, useHeadSafe, useScript, useSeoMeta, useUnhead } from './composables'\nexport { headSymbol, UnheadInjectionToken } from './context'\nexport { Head } from './head.component'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["baseHead","baseHeadSafe","baseSeoMeta","baseUseScript"],"mappings":";;;;AAGO,MAAM,UAAU,GAAG;MAEb,oBAAoB,GAAG,IAAI,cAAc,CAAS,UAAU;;SCAzD,SAAS,GAAA;AACvB,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAS,oBAAoB,CAAC;IACrD,IAAI,CAAC,QAAQ,EAAE;AACb,QAAA,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC;IAC3E;AACA,IAAA,OAAO,QAAQ;AACjB;AAEA,SAAS,eAAe,CAAiC,KAAU,EAAE,OAAY,EAAE,EAAO,EAAA;IACxF,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,SAAS,EAAE;IACxC,MAA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O,MAAM;IACf;IAEA,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;IAC1B;uGAjCW,IAAI,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAJ,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,IAAI,uEAHL,2BAA2B,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAG1B,IAAI,EAAA,UAAA,EAAA,CAAA;kBANhB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,2BAA2B;oBACrC,OAAO,EAAE,CAAC,sBAAsB,CAAC;AAClC,iBAAA;;;ACfD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"unhead-angular.mjs","sources":["../../src/context.ts","../../src/composables.ts","../../src/head.component.ts","../../src/public-api.ts","../../src/unhead-angular.ts"],"sourcesContent":["import type { Unhead } from 'unhead/types'\nimport { InjectionToken } from '@angular/core'\n\nexport const headSymbol = 'usehead'\n\nexport const UnheadInjectionToken = new InjectionToken<Unhead>(headSymbol)\n","import type { ActiveHeadEntry, HeadEntryOptions, HeadSafe, Unhead, UseHeadInput, UseScriptInput, UseScriptOptions, UseScriptReturn, UseSeoMetaInput } from 'unhead/types'\nimport { DestroyRef, effect, inject } from '@angular/core'\nimport { useHead as baseHead, useHeadSafe as baseHeadSafe, useSeoMeta as baseSeoMeta, useScript as baseUseScript } from 'unhead'\nimport { UnheadInjectionToken } from './context'\n\nexport function useUnhead() {\n const instance = inject<Unhead>(UnheadInjectionToken)\n if (!instance) {\n throw new Error('useHead() was called without proper injection context.')\n }\n return instance\n}\n\nfunction withSideEffects<T extends ActiveHeadEntry<any>>(input: any, options: any, fn: any): T {\n const head = options.head || useUnhead()\n const entry = fn(head, input, options)\n\n const destroyRef = inject(DestroyRef)\n destroyRef.onDestroy(() => {\n entry.dispose()\n })\n\n return entry\n}\n\nexport function useHead(input: UseHeadInput = {}, options: HeadEntryOptions = {}): ActiveHeadEntry<UseHeadInput> {\n return withSideEffects(input, options, baseHead)\n}\n\nexport function useHeadSafe(input: HeadSafe = {}, options: HeadEntryOptions = {}): ActiveHeadEntry<HeadSafe> {\n return withSideEffects<ActiveHeadEntry<HeadSafe>>(input, options, baseHeadSafe)\n}\n\nexport function useSeoMeta(input: UseSeoMetaInput = {}, options: HeadEntryOptions = {}): ActiveHeadEntry<UseSeoMetaInput> {\n return withSideEffects<ActiveHeadEntry<UseSeoMetaInput>>(input, options, baseSeoMeta)\n}\n\nexport function useScript<T extends Record<symbol | string, any> = Record<symbol | string, any>>(_input: UseScriptInput, _options?: UseScriptOptions<T>): UseScriptReturn<T> {\n const input = (typeof _input === 'string' ? { src: _input } : _input) as UseScriptInput\n const options = _options || {} as UseScriptOptions<T>\n const head = options?.head || useUnhead()\n options.head = head\n\n const mountCbs: (() => void)[] = []\n const sideEffects: (() => void)[] = []\n let isMounted = false\n\n const destroyRef = inject(DestroyRef)\n\n effect(() => {\n isMounted = true\n mountCbs.forEach(i => i())\n })\n\n if (typeof options.trigger === 'undefined') {\n options.trigger = (load) => {\n if (isMounted) {\n load()\n }\n else {\n mountCbs.push(load)\n }\n }\n }\n\n // @ts-expect-error untyped\n const script = baseUseScript(head, input as BaseUseScriptInput, options)\n\n const _registerCb = (key: 'loaded' | 'error', cb: any) => {\n let i: number | null\n const destroy = () => {\n // avoid removing the wrong callback\n if (i) {\n script._cbs[key]?.splice(i - 1, 1)\n i = null\n }\n }\n mountCbs.push(() => {\n if (!script._cbs[key]) {\n cb(script.instance)\n return () => {}\n }\n i = script._cbs[key].push(cb)\n sideEffects.push(destroy)\n return destroy\n })\n }\n\n destroyRef.onDestroy(() => {\n isMounted = false\n script._triggerAbortController?.abort()\n sideEffects.forEach(i => i())\n })\n script.onLoaded = (cb: (instance: T) => void | Promise<void>) => _registerCb('loaded', cb)\n script.onError = (cb: (err?: Error) => void | Promise<void>) => _registerCb('error', cb)\n return script\n}\n","import type { OnDestroy } from '@angular/core'\nimport { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'\nimport { useHead } from './composables'\n\ninterface NodeProps {\n type: string | symbol\n props?: Record<string, any>\n children?: NodeProps[]\n}\n\n@Component({\n selector: 'unhead-head',\n standalone: true,\n template: '<ng-content></ng-content>',\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n})\nexport class Head implements OnDestroy {\n private headEntry = useHead({})\n\n updateHead(nodes: NodeProps[]) {\n const transformed = this.transformNodes(nodes)\n this.headEntry.patch(transformed)\n }\n\n private transformNodes(nodes: NodeProps[]) {\n const result: Record<string, any> = {}\n\n const processNode = (node: NodeProps) => {\n if (typeof node.type === 'symbol') {\n node.children?.forEach(child => processNode(child as NodeProps))\n return\n }\n\n const type = node.type as string\n if (node.children?.length === 1) {\n result[type] = node.children[0]\n }\n else if (Object.keys(node.props || {}).length) {\n result[type] = result[type] || []\n result[type].push(node.props)\n }\n }\n\n nodes.forEach(processNode)\n return result\n }\n\n ngOnDestroy() {\n this.headEntry.dispose()\n }\n}\n","/*\n * Public API Surface of unhead\n */\n\nexport { useHead, useHeadSafe, useScript, useSeoMeta, useUnhead } from './composables'\nexport { headSymbol, UnheadInjectionToken } from './context'\nexport { Head } from './head.component'\nexport { defineLink, defineScript } from 'unhead'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["baseHead","baseHeadSafe","baseSeoMeta","baseUseScript"],"mappings":";;;;;AAGO,MAAM,UAAU,GAAG;MAEb,oBAAoB,GAAG,IAAI,cAAc,CAAS,UAAU;;SCAzD,SAAS,GAAA;AACvB,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAS,oBAAoB,CAAC;IACrD,IAA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AE;gBAC7C,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE;gBACjC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;YAC/B;AACF,QAAA,CAAC;AAED,QAAA,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;AAC1B,QAAA,OAAO,MAAM;IACf;IAEA,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;IAC1B;uGAjCW,IAAI,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAJ,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,IAAI,uEAHL,2BAA2B,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAG1B,IAAI,EAAA,UAAA,EAAA,CAAA;kBANhB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,2BAA2B;oBACrC,OAAO,EAAE,CAAC,sBAAsB,CAAC;AAClC,iBAAA;;;ACfD;;AAEG;;ACFH;;AAEG;;;;"}
@@ -2,6 +2,7 @@ import * as unhead_types from 'unhead/types';
2
2
  import { UseHeadInput, HeadEntryOptions, ActiveHeadEntry, HeadSafe, UseScriptInput, UseScriptOptions, UseScriptReturn, UseSeoMetaInput, Unhead } from 'unhead/types';
3
3
  import * as i0 from '@angular/core';
4
4
  import { InjectionToken, OnDestroy } from '@angular/core';
5
+ export { defineLink, defineScript } from 'unhead';
5
6
 
6
7
  declare function useUnhead(): Unhead<unhead_types.ResolvableHead, unknown>;
7
8
  declare function useHead(input?: UseHeadInput, options?: HeadEntryOptions): ActiveHeadEntry<UseHeadInput>;
@@ -1 +1 @@
1
- {"version":3,"file":"unhead-angular.d.ts","sources":["../../src/composables.ts","../../src/context.ts","../../src/head.component.ts"],"mappings":";;;;;AAKA,iBAAgB,SAAS,IAAA,MAAA,CAAA,YAAA,CAAA,cAAA;AAoBzB,iBAAgB,OAAO,SAAQ,YAAiB,YAAW,gBAAqB,GAAG,eAAe,CAAC,YAAY;AAI/G,iBAAgB,WAAW,SAAQ,QAAa,YAAW,gBAAqB,GAAG,eAAe,CAAC,QAAQ;AAI3G,iBAAgB,UAAU,SAAQ,eAAoB,YAAW,gBAAqB,GAAG,eAAe,CAAC,eAAe;AAIxH,iBAAgB,SAAS,WAAW,MAAM,yBAAyB,MAAM,gCAAgC,cAAc,aAAa,gBAAgB,MAAM,eAAe;;AClCzK,cAAa,UAAU;AAEvB,cAAa,oBAAoB,EAAA,cAAA,CAAA,MAAA,CAAA,YAAA,CAAA,cAAA;;ACDjC,UAAU,SAAS;AACjB;YACQ,MAAM;AACd,eAAW,SAAS;AACrB;AAED,cAMa,IAAK,YAAW,SAAS;;AAGpC,sBAAkB,SAAS;AAK3B;;yCARW,IAAI;2CAAJ,IAAI;AAkChB;;;;","names":[]}
1
+ {"version":3,"file":"unhead-angular.d.ts","sources":["../../src/composables.ts","../../src/context.ts","../../src/head.component.ts"],"mappings":";;;;;;AAKA,iBAAgB,SAAS,IAAA,MAAA,CAAA,YAAA,CAAA,cAAA;AAoBzB,iBAAgB,OAAO,SAAQ,YAAiB,YAAW,gBAAqB,GAAG,eAAe,CAAC,YAAY;AAI/G,iBAAgB,WAAW,SAAQ,QAAa,YAAW,gBAAqB,GAAG,eAAe,CAAC,QAAQ;AAI3G,iBAAgB,UAAU,SAAQ,eAAoB,YAAW,gBAAqB,GAAG,eAAe,CAAC,eAAe;AAIxH,iBAAgB,SAAS,WAAW,MAAM,yBAAyB,MAAM,gCAAgC,cAAc,aAAa,gBAAgB,MAAM,eAAe;;AClCzK,cAAa,UAAU;AAEvB,cAAa,oBAAoB,EAAA,cAAA,CAAA,MAAA,CAAA,YAAA,CAAA,cAAA;;ACDjC,UAAU,SAAS;AACjB;YACQ,MAAM;AACd,eAAW,SAAS;AACrB;AAED,cAMa,IAAK,YAAW,SAAS;;AAGpC,sBAAkB,SAAS;AAK3B;;yCARW,IAAI;2CAAJ,IAAI;AAkChB;;;;","names":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/angular",
3
3
  "type": "module",
4
- "version": "3.0.1",
4
+ "version": "3.0.2",
5
5
  "description": "Full-stack <head> manager built for Angular.",
6
6
  "author": "Harlan Wilton <harlan@harlanzw.com>",
7
7
  "license": "MIT",
@@ -61,7 +61,7 @@
61
61
  },
62
62
  "dependencies": {
63
63
  "tslib": "^2.8.1",
64
- "unhead": "3.0.1"
64
+ "unhead": "3.0.2"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@angular-devkit/build-angular": "^21.2.7",