@unhead/angular 2.0.0-alpha.20 → 2.0.0-alpha.21

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/client.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/client'
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../client/src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAK3D,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,uBAA4B,gDAUtE"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../client/src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAM3D,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,uBAA4B,gDAetE"}
@@ -1,17 +1,23 @@
1
- import { makeEnvironmentProviders } from '@angular/core';
1
+ import { DOCUMENT } from '@angular/common';
2
+ import { makeEnvironmentProviders, inject } from '@angular/core';
2
3
  import { UnheadInjectionToken } from '@unhead/angular';
3
4
  import { createHead, createDebouncedFn, renderDOMHead } from 'unhead/client';
4
5
 
5
6
  function provideClientHead(options = {}) {
6
- const head = createHead({
7
- domOptions: {
8
- render: createDebouncedFn(() => renderDOMHead(head), fn => setTimeout(() => fn(), 0)),
9
- },
10
- ...options,
11
- });
12
- return makeEnvironmentProviders([
13
- { provide: UnheadInjectionToken, useValue: head },
14
- ]);
7
+ return makeEnvironmentProviders([{
8
+ provide: UnheadInjectionToken,
9
+ useFactory: () => {
10
+ const document = inject(DOCUMENT);
11
+ const head = createHead({
12
+ document,
13
+ domOptions: {
14
+ render: createDebouncedFn(() => renderDOMHead(head), fn => setTimeout(() => fn(), 0)),
15
+ },
16
+ ...options,
17
+ });
18
+ return head;
19
+ },
20
+ }]);
15
21
  }
16
22
 
17
23
  /*
@@ -1 +1 @@
1
- {"version":3,"file":"unhead-angular-client.mjs","sources":["../../client/src/client.ts","../../client/src/public_api.ts","../../client/src/unhead-angular-client.ts"],"sourcesContent":["import type { CreateClientHeadOptions } from 'unhead/types'\nimport { makeEnvironmentProviders } from '@angular/core'\nimport { UnheadInjectionToken } from '@unhead/angular'\nimport { createHead as _createClientHead, createDebouncedFn, renderDOMHead } from 'unhead/client'\n\nexport function provideClientHead(options: CreateClientHeadOptions = {}) {\n const head = _createClientHead({\n domOptions: {\n render: createDebouncedFn(() => renderDOMHead(head), fn => setTimeout(() => fn(), 0)),\n },\n ...options,\n })\n return makeEnvironmentProviders([\n { provide: UnheadInjectionToken, useValue: head },\n ])\n}\n","/*\n * Public API Surface of unhead\n */\n\nexport * from './client'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["_createClientHead"],"mappings":";;;;AAKgB,SAAA,iBAAiB,CAAC,OAAA,GAAmC,EAAE,EAAA;IACrE,MAAM,IAAI,GAAGA,UAAiB,CAAC;AAC7B,QAAA,UAAU,EAAE;YACV,MAAM,EAAE,iBAAiB,CAAC,MAAM,aAAa,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;AACtF,SAAA;AACD,QAAA,GAAG,OAAO;AACX,KAAA,CAAC;AACF,IAAA,OAAO,wBAAwB,CAAC;AAC9B,QAAA,EAAE,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,IAAI,EAAE;AAClD,KAAA,CAAC;AACJ;;ACfA;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"unhead-angular-client.mjs","sources":["../../client/src/client.ts","../../client/src/public_api.ts","../../client/src/unhead-angular-client.ts"],"sourcesContent":["import type { CreateClientHeadOptions } from 'unhead/types'\nimport { DOCUMENT } from '@angular/common'\nimport { inject, makeEnvironmentProviders } from '@angular/core'\nimport { UnheadInjectionToken } from '@unhead/angular'\nimport { createHead as _createClientHead, createDebouncedFn, renderDOMHead } from 'unhead/client'\n\nexport function provideClientHead(options: CreateClientHeadOptions = {}) {\n return makeEnvironmentProviders([{\n provide: UnheadInjectionToken,\n useFactory: () => {\n const document = inject(DOCUMENT)\n const head = _createClientHead({\n document,\n domOptions: {\n render: createDebouncedFn(() => renderDOMHead(head), fn => setTimeout(() => fn(), 0)),\n },\n ...options,\n })\n return head\n },\n }])\n}\n","/*\n * Public API Surface of unhead\n */\n\nexport * from './client'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["_createClientHead"],"mappings":";;;;;AAMgB,SAAA,iBAAiB,CAAC,OAAA,GAAmC,EAAE,EAAA;IACrE,OAAO,wBAAwB,CAAC,CAAC;AAC/B,YAAA,OAAO,EAAE,oBAAoB;YAC7B,UAAU,EAAE,MAAK;AACf,gBAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;gBACjC,MAAM,IAAI,GAAGA,UAAiB,CAAC;oBAC7B,QAAQ;AACR,oBAAA,UAAU,EAAE;wBACV,MAAM,EAAE,iBAAiB,CAAC,MAAM,aAAa,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;AACtF,qBAAA;AACD,oBAAA,GAAG,OAAO;AACX,iBAAA,CAAC;AACF,gBAAA,OAAO,IAAI;aACZ;AACF,SAAA,CAAC,CAAC;AACL;;ACrBA;;AAEG;;ACFH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/angular",
3
3
  "type": "module",
4
- "version": "2.0.0-alpha.20",
4
+ "version": "2.0.0-alpha.21",
5
5
  "description": "Full-stack <head> manager built for Angular.",
6
6
  "author": "Harlan Wilton <harlan@harlanzw.com>",
7
7
  "license": "MIT",
@@ -25,22 +25,34 @@
25
25
  "default": "./package.json"
26
26
  },
27
27
  ".": {
28
- "types": "./index.d.ts",
29
- "default": "./fesm2022/unhead-angular.mjs"
28
+ "types": "./dist/index.d.ts",
29
+ "default": "./dist/fesm2022/unhead-angular.mjs"
30
30
  },
31
31
  "./client": {
32
- "types": "./client/index.d.ts",
33
- "default": "./fesm2022/unhead-angular-client.mjs"
32
+ "types": "./dist/client/index.d.ts",
33
+ "default": "./dist/fesm2022/unhead-angular-client.mjs"
34
34
  },
35
35
  "./server": {
36
- "types": "./server/index.d.ts",
37
- "default": "./fesm2022/unhead-angular-server.mjs"
36
+ "types": "./dist/server/index.d.ts",
37
+ "default": "./dist/fesm2022/unhead-angular-server.mjs"
38
38
  }
39
39
  },
40
40
  "module": "dist/fesm2022/unhead-angular.mjs",
41
41
  "types": "dist/index.d.ts",
42
+ "typesVersions": {
43
+ "*": {
44
+ "server": [
45
+ "dist/server"
46
+ ],
47
+ "client": [
48
+ "dist/client"
49
+ ]
50
+ }
51
+ },
42
52
  "files": [
43
- "dist"
53
+ "client.d.ts",
54
+ "dist",
55
+ "server.d.ts"
44
56
  ],
45
57
  "typings": "index.d.ts",
46
58
  "peerDependencies": {
@@ -49,7 +61,7 @@
49
61
  },
50
62
  "dependencies": {
51
63
  "tslib": "^2.8.1",
52
- "unhead": "2.0.0-alpha.20"
64
+ "unhead": "2.0.0-alpha.21"
53
65
  },
54
66
  "devDependencies": {
55
67
  "@angular/platform-browser-dynamic": "^19.1.7",
package/server.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/server'