@odoo/owl 3.0.0-alpha.36 → 3.0.0-alpha.37

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.
@@ -239,9 +239,9 @@ declare function arrayType<T>(elementType: T): Type<StripBrands<T>[]>;
239
239
  declare function constructorType<T extends Constructor>(constructor: T): Type<T>;
240
240
  declare function customValidator<T>(type: T, validator: (value: StripBrands<T>) => boolean, errorMessage?: string): Type<StripBrands<T>>;
241
241
  declare function functionType(): Type<(...parameters: any[]) => any>;
242
- declare function functionType<const P extends any[]>(parameters: P): Type<(...parameters: StripBrandsAll<P>) => void>;
243
- declare function functionType<const P extends any[], R>(): Type<(...parameters: P) => R>;
244
- declare function functionType<const P extends any[], R>(parameters: P, result: R): Type<(...parameters: StripBrandsAll<P>) => StripBrands<R>>;
242
+ declare function functionType<const P extends unknown[]>(parameters: P): Type<(...parameters: StripBrandsAll<P>) => void>;
243
+ declare function functionType<const P extends unknown[], R>(): Type<(...parameters: P) => R>;
244
+ declare function functionType<const P extends unknown[], R>(parameters: P, result: R): Type<(...parameters: StripBrandsAll<P>) => StripBrands<R>>;
245
245
  declare function instanceType<T extends Constructor>(constructor: T): Type<InstanceType<T>>;
246
246
  declare function intersection<T extends any[]>(types: T): Type<UnionToIntersection<StripBrands<T[number]>>>;
247
247
  export type LiteralTypes = number | string | boolean | null | undefined;
@@ -257,8 +257,8 @@ declare function promiseType(): Type<Promise<void>>;
257
257
  declare function promiseType<T>(type: T): Type<Promise<StripBrands<T>>>;
258
258
  declare function recordType(): Type<Record<PropertyKey, any>>;
259
259
  declare function recordType<V>(valueType: V): Type<Record<PropertyKey, StripBrands<V>>>;
260
- declare function tuple<const T extends any[]>(types: T): Type<StripBrandsAll<T>>;
261
- declare function union<T extends any[]>(types: T): Type<StripBrands<T[number]>>;
260
+ declare function tuple<const T extends unknown[]>(types: T): Type<StripBrandsAll<T>>;
261
+ declare function union<T extends unknown[]>(types: T): Type<StripBrands<T[number]>>;
262
262
  declare function reactiveValueType(): Type<ReactiveValue<any>>;
263
263
  declare function reactiveValueType<T>(): Type<ReactiveValue<T>>;
264
264
  declare function reactiveValueType<T>(type: T): Type<ReactiveValue<StripBrands<T>>>;
@@ -638,6 +638,11 @@ declare class ComponentNode extends Scope implements VNode<ComponentNode> {
638
638
  willPatch: LifecycleHook[];
639
639
  patched: LifecycleHook[];
640
640
  signalComputation: ComputationAtom;
641
+ trackedRefs: Map<{
642
+ set(v: null): void;
643
+ }, {
644
+ value: HTMLElement | null;
645
+ }> | null;
641
646
  constructor(C: ComponentConstructor, props: Record<string, any>, app: App, parent: ComponentNode | null, parentKey: string | null);
642
647
  decorate(f: Function, hookName: string): Function;
643
648
  initiateRender(fiber: Fiber | MountFiber): Promise<void>;
@@ -646,6 +651,19 @@ declare class ComponentNode extends Scope implements VNode<ComponentNode> {
646
651
  _cancel(): void;
647
652
  destroy(): void;
648
653
  _destroy(): void;
654
+ /**
655
+ * Unset any tracked t-ref whose element is no longer in the document, and stop
656
+ * tracking it (createRef re-registers it on the next render if the element
657
+ * comes back). `isConnected` is the discriminator: a ref the block's own
658
+ * remove() failed to clear (bulk removal) points at a detached element and is
659
+ * cleared, while a ref a surviving sibling just took over (t-if/t-else with a
660
+ * shared signal) points at a still-connected element and is left alone.
661
+ *
662
+ * Called after this component's dom settles: at the tail of `_patch` (before
663
+ * user `onPatched`), so an element removed in place is caught, and — for the
664
+ * nodes collected during `_destroy` — after a removed subtree is detached.
665
+ */
666
+ sweepRefs(): void;
649
667
  /**
650
668
  * Finds a child that has dom that is not yet updated, and update it. This
651
669
  * method is meant to be used only in the context of repatching the dom after
@@ -656,6 +674,16 @@ declare class ComponentNode extends Scope implements VNode<ComponentNode> {
656
674
  mount(parent: HTMLElement, anchor: ChildNode): void;
657
675
  moveBeforeDOMNode(node: Node | null, parent?: HTMLElement): void;
658
676
  moveBeforeVNode(other: ComponentNode | null, afterNode: Node | null): void;
677
+ /**
678
+ * Register a t-ref signal bound to an element this component hosts, so its
679
+ * lifecycle can clear it (see sweepRefs / _destroy). Idempotent — re-tracking
680
+ * the same signal on each render just refreshes its atom.
681
+ */
682
+ trackRef(ref: {
683
+ set(v: null): void;
684
+ }, atom: {
685
+ value: HTMLElement | null;
686
+ }): void;
659
687
  patch(): void;
660
688
  _patch(): void;
661
689
  beforeRemove(): void;
@@ -810,7 +838,7 @@ export declare class Portal extends Component {
810
838
  slots: {
811
839
  default: any;
812
840
  };
813
- target: any;
841
+ target: string | HTMLElement | ReactiveValue<HTMLElement, HTMLElement>;
814
842
  }>;
815
843
  setup(): void;
816
844
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odoo/owl",
3
- "version": "3.0.0-alpha.36",
3
+ "version": "3.0.0-alpha.37",
4
4
  "description": "Odoo Web Library (OWL)",
5
5
  "main": "dist/owl.cjs.js",
6
6
  "module": "dist/owl.es.js",
@@ -43,9 +43,9 @@
43
43
  },
44
44
  "homepage": "https://github.com/odoo/owl#readme",
45
45
  "devDependencies": {
46
- "@odoo/owl-compiler": "3.0.0-alpha.36",
47
- "@odoo/owl-core": "3.0.0-alpha.36",
48
- "@odoo/owl-runtime": "3.0.0-alpha.36",
46
+ "@odoo/owl-compiler": "3.0.0-alpha.37",
47
+ "@odoo/owl-core": "3.0.0-alpha.37",
48
+ "@odoo/owl-runtime": "3.0.0-alpha.37",
49
49
  "jsdom": "^25.0.1"
50
50
  }
51
51
  }