@unhead/schema 1.2.2 → 1.3.0-beta.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 (2) hide show
  1. package/dist/index.d.ts +23 -30
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -34,12 +34,6 @@ interface TagPosition {
34
34
  * @default 'head'
35
35
  */
36
36
  tagPosition?: ValidTagPositions;
37
- /**
38
- * Render the tag before the body close.
39
- *
40
- * @deprecated Use `tagPosition: 'bodyClose'` instead.
41
- */
42
- body?: true;
43
37
  }
44
38
  type InnerContentVal = string | Record<string, any>;
45
39
  interface InnerContent {
@@ -279,14 +273,17 @@ interface EntryResolveCtx<T> {
279
273
  entries: HeadEntry<T>[];
280
274
  }
281
275
  interface DomRenderTagContext {
282
- renderId: string;
283
- $el?: Element | null;
276
+ id: string;
277
+ $el: Element;
284
278
  shouldRender: boolean;
285
279
  tag: HeadTag;
286
280
  entry?: HeadEntry<any>;
287
281
  markSideEffect: (key: string, fn: () => void) => void;
288
282
  }
289
- interface BeforeRenderContext {
283
+ interface DomBeforeRenderCtx extends ShouldRenderContext {
284
+ tags: DomRenderTagContext[];
285
+ }
286
+ interface ShouldRenderContext {
290
287
  shouldRender: boolean;
291
288
  }
292
289
  interface SSRRenderContext {
@@ -308,10 +305,14 @@ interface HeadHooks {
308
305
  'tags:resolve': (ctx: {
309
306
  tags: HeadTag[];
310
307
  }) => HookResult;
311
- 'dom:beforeRender': (ctx: BeforeRenderContext) => HookResult;
312
- 'dom:beforeRenderTag': (ctx: DomRenderTagContext) => HookResult;
313
- 'dom:renderTag': (ctx: DomRenderTagContext) => HookResult;
314
- 'ssr:beforeRender': (ctx: BeforeRenderContext) => HookResult;
308
+ 'dom:beforeRender': (ctx: ShouldRenderContext & {
309
+ tags: DomRenderTagContext[];
310
+ }) => HookResult;
311
+ 'dom:renderTag': (ctx: DomRenderTagContext, document: Document, track: any) => HookResult;
312
+ 'dom:rendered': (ctx: {
313
+ renders: DomRenderTagContext[];
314
+ }) => HookResult;
315
+ 'ssr:beforeRender': (ctx: ShouldRenderContext) => HookResult;
315
316
  'ssr:render': (ctx: {
316
317
  tags: HeadTag[];
317
318
  }) => HookResult;
@@ -352,12 +353,6 @@ interface HeadEntry<Input> {
352
353
  * @internal
353
354
  */
354
355
  _i: number;
355
- /**
356
- * Side effects
357
- *
358
- * @internal
359
- */
360
- _sde: SideEffectsRecord;
361
356
  /**
362
357
  * Default tag position.
363
358
  *
@@ -395,7 +390,6 @@ interface CreateHeadOptions {
395
390
  document?: Document;
396
391
  plugins?: HeadPlugin[];
397
392
  hooks?: NestedHooks<HeadHooks>;
398
- experimentalHashHydration?: boolean;
399
393
  }
400
394
  interface HeadEntryOptions extends TagPosition, TagPriority {
401
395
  mode?: RuntimeMode;
@@ -426,15 +420,14 @@ interface Unhead<Input extends {} = Head> {
426
420
  * Use a head plugin, loads the plugins hooks.
427
421
  */
428
422
  use: (plugin: HeadPlugin) => void;
429
- /**
430
- * @internal
431
- */
432
- _popSideEffectQueue: () => SideEffectsRecord;
433
- /**
434
- * @internal
435
- */
436
- _elMap: Record<string, Element>;
437
- _hash?: string | false;
423
+ ssr: boolean;
424
+ _dom?: DomState;
425
+ _domUpdatePromise?: Promise<void>;
426
+ }
427
+ interface DomState {
428
+ pendingSideEffects: SideEffectsRecord;
429
+ sideEffects: SideEffectsRecord;
430
+ elMap: Record<string, Element>;
438
431
  }
439
432
 
440
- export { ActiveHeadEntry, Base, BaseBodyAttr, BaseHtmlAttr, BaseMeta, BeforeRenderContext, BodyAttr, BodyAttributes, CreateHeadOptions, DomRenderTagContext, EntryAugmentation, EntryResolveCtx, HasTemplateParams, Head, HeadEntry, HeadEntryOptions, HeadHooks, HeadPlugin, HeadSafe, HeadTag, HeadTagKeys, HeadUtils, HookResult, HtmlAttr, HtmlAttributes, InnerContent, InnerContentVal, Link, MaybeArray, MaybeFunctionEntries, Meta, Never, Noscript, ResolvesDuplicates, RuntimeMode, SSRHeadPayload, SSRRenderContext, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SchemaAugmentations, Script, SideEffectsRecord, Style, TagKey, TagPosition, TagPriority, TagUserProperties, TemplateParams, Title, TitleTemplate, Unhead, UserAttributesConfig, UserTagConfigWithoutInnerContent, ValidTagPositions };
433
+ export { ActiveHeadEntry, Base, BaseBodyAttr, BaseHtmlAttr, BaseMeta, BodyAttr, BodyAttributes, CreateHeadOptions, DomBeforeRenderCtx, DomRenderTagContext, DomState, EntryAugmentation, EntryResolveCtx, HasTemplateParams, Head, HeadEntry, HeadEntryOptions, HeadHooks, HeadPlugin, HeadSafe, HeadTag, HeadTagKeys, HeadUtils, HookResult, HtmlAttr, HtmlAttributes, InnerContent, InnerContentVal, Link, MaybeArray, MaybeFunctionEntries, Meta, Never, Noscript, ResolvesDuplicates, RuntimeMode, SSRHeadPayload, SSRRenderContext, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SchemaAugmentations, Script, ShouldRenderContext, SideEffectsRecord, Style, TagKey, TagPosition, TagPriority, TagUserProperties, TemplateParams, Title, TitleTemplate, Unhead, UserAttributesConfig, UserTagConfigWithoutInnerContent, ValidTagPositions };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/schema",
3
3
  "type": "module",
4
- "version": "1.2.2",
4
+ "version": "1.3.0-beta.0",
5
5
  "author": "Harlan Wilton <harlan@harlanzw.com>",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/harlan-zw",