@odoo/owl 2.8.1 → 2.8.3

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/owl.iife.js CHANGED
@@ -87,10 +87,16 @@
87
87
  class OwlError extends Error {
88
88
  }
89
89
 
90
- const { setAttribute: elemSetAttribute, removeAttribute } = Element.prototype;
91
- const tokenList = DOMTokenList.prototype;
92
- const tokenListAdd = tokenList.add;
93
- const tokenListRemove = tokenList.remove;
90
+ let elemSetAttribute;
91
+ let removeAttribute;
92
+ let tokenListAdd;
93
+ let tokenListRemove;
94
+ if (typeof Element !== "undefined") {
95
+ ({ setAttribute: elemSetAttribute, removeAttribute } = Element.prototype);
96
+ const tokenList = DOMTokenList.prototype;
97
+ tokenListAdd = tokenList.add;
98
+ tokenListRemove = tokenList.remove;
99
+ }
94
100
  const isArray = Array.isArray;
95
101
  const { split, trim } = String.prototype;
96
102
  const wordRegexp = /\s+/;
@@ -469,10 +475,15 @@
469
475
  }
470
476
 
471
477
  const getDescriptor$3 = (o, p) => Object.getOwnPropertyDescriptor(o, p);
472
- const nodeProto$4 = Node.prototype;
473
- const nodeInsertBefore$3 = nodeProto$4.insertBefore;
474
- const nodeSetTextContent$1 = getDescriptor$3(nodeProto$4, "textContent").set;
475
- const nodeRemoveChild$3 = nodeProto$4.removeChild;
478
+ let nodeInsertBefore$3;
479
+ let nodeSetTextContent$1;
480
+ let nodeRemoveChild$3;
481
+ if (typeof Node !== "undefined") {
482
+ const nodeProto = Node.prototype;
483
+ nodeInsertBefore$3 = nodeProto.insertBefore;
484
+ nodeSetTextContent$1 = getDescriptor$3(nodeProto, "textContent").set;
485
+ nodeRemoveChild$3 = nodeProto.removeChild;
486
+ }
476
487
  // -----------------------------------------------------------------------------
477
488
  // Multi NODE
478
489
  // -----------------------------------------------------------------------------
@@ -608,11 +619,15 @@
608
619
  }
609
620
 
610
621
  const getDescriptor$2 = (o, p) => Object.getOwnPropertyDescriptor(o, p);
611
- const nodeProto$3 = Node.prototype;
612
- const characterDataProto$1 = CharacterData.prototype;
613
- const nodeInsertBefore$2 = nodeProto$3.insertBefore;
614
- const characterDataSetData$1 = getDescriptor$2(characterDataProto$1, "data").set;
615
- const nodeRemoveChild$2 = nodeProto$3.removeChild;
622
+ let nodeInsertBefore$2;
623
+ let characterDataSetData$1;
624
+ let nodeRemoveChild$2;
625
+ if (typeof Node !== "undefined") {
626
+ const nodeProto = Node.prototype;
627
+ nodeInsertBefore$2 = nodeProto.insertBefore;
628
+ nodeRemoveChild$2 = nodeProto.removeChild;
629
+ characterDataSetData$1 = getDescriptor$2(CharacterData.prototype, "data").set;
630
+ }
616
631
  class VSimpleNode {
617
632
  constructor(text) {
618
633
  this.text = text;
@@ -678,13 +693,19 @@
678
693
  }
679
694
 
680
695
  const getDescriptor$1 = (o, p) => Object.getOwnPropertyDescriptor(o, p);
681
- const nodeProto$2 = Node.prototype;
682
- const elementProto = Element.prototype;
683
- const characterDataProto = CharacterData.prototype;
684
- const characterDataSetData = getDescriptor$1(characterDataProto, "data").set;
685
- const nodeGetFirstChild = getDescriptor$1(nodeProto$2, "firstChild").get;
686
- const nodeGetNextSibling = getDescriptor$1(nodeProto$2, "nextSibling").get;
687
- const NO_OP = () => { };
696
+ let nodeProto;
697
+ let elementProto;
698
+ let characterDataSetData;
699
+ let nodeGetFirstChild;
700
+ let nodeGetNextSibling;
701
+ if (typeof Node !== "undefined") {
702
+ nodeProto = Node.prototype;
703
+ elementProto = Element.prototype;
704
+ characterDataSetData = getDescriptor$1(CharacterData.prototype, "data").set;
705
+ nodeGetFirstChild = getDescriptor$1(nodeProto, "firstChild").get;
706
+ nodeGetNextSibling = getDescriptor$1(nodeProto, "nextSibling").get;
707
+ }
708
+ const NO_OP$1 = () => { };
688
709
  function makePropSetter(name) {
689
710
  return function setProp(value) {
690
711
  // support 0, fallback to empty string for other falsy values
@@ -1014,7 +1035,7 @@
1014
1035
  idx: info.idx,
1015
1036
  refIdx: info.refIdx,
1016
1037
  setData: makeRefSetter(index, ctx.refList),
1017
- updateData: NO_OP,
1038
+ updateData: NO_OP$1,
1018
1039
  });
1019
1040
  }
1020
1041
  }
@@ -1072,8 +1093,8 @@
1072
1093
  const isDynamic = refN > 0;
1073
1094
  // these values are defined here to make them faster to lookup in the class
1074
1095
  // block scope
1075
- const nodeCloneNode = nodeProto$2.cloneNode;
1076
- const nodeInsertBefore = nodeProto$2.insertBefore;
1096
+ const nodeCloneNode = nodeProto.cloneNode;
1097
+ const nodeInsertBefore = nodeProto.insertBefore;
1077
1098
  const elementRemove = elementProto.remove;
1078
1099
  class Block {
1079
1100
  constructor(data) {
@@ -1202,11 +1223,17 @@
1202
1223
  }
1203
1224
 
1204
1225
  const getDescriptor = (o, p) => Object.getOwnPropertyDescriptor(o, p);
1205
- const nodeProto$1 = Node.prototype;
1206
- const nodeInsertBefore$1 = nodeProto$1.insertBefore;
1207
- const nodeAppendChild = nodeProto$1.appendChild;
1208
- const nodeRemoveChild$1 = nodeProto$1.removeChild;
1209
- const nodeSetTextContent = getDescriptor(nodeProto$1, "textContent").set;
1226
+ let nodeInsertBefore$1;
1227
+ let nodeAppendChild;
1228
+ let nodeRemoveChild$1;
1229
+ let nodeSetTextContent;
1230
+ if (typeof Node !== "undefined") {
1231
+ const nodeProto = Node.prototype;
1232
+ nodeInsertBefore$1 = nodeProto.insertBefore;
1233
+ nodeAppendChild = nodeProto.appendChild;
1234
+ nodeRemoveChild$1 = nodeProto.removeChild;
1235
+ nodeSetTextContent = getDescriptor(nodeProto, "textContent").set;
1236
+ }
1210
1237
  // -----------------------------------------------------------------------------
1211
1238
  // List Node
1212
1239
  // -----------------------------------------------------------------------------
@@ -1418,9 +1445,13 @@
1418
1445
  return mapping;
1419
1446
  }
1420
1447
 
1421
- const nodeProto = Node.prototype;
1422
- const nodeInsertBefore = nodeProto.insertBefore;
1423
- const nodeRemoveChild = nodeProto.removeChild;
1448
+ let nodeInsertBefore;
1449
+ let nodeRemoveChild;
1450
+ if (typeof Node !== "undefined") {
1451
+ const nodeProto = Node.prototype;
1452
+ nodeInsertBefore = nodeProto.insertBefore;
1453
+ nodeRemoveChild = nodeProto.removeChild;
1454
+ }
1424
1455
  class VHtml {
1425
1456
  constructor(html) {
1426
1457
  this.content = [];
@@ -1640,6 +1671,7 @@
1640
1671
  let current = fiber;
1641
1672
  do {
1642
1673
  current.node.fiber = current;
1674
+ fibersInError.set(current, error);
1643
1675
  current = current.parent;
1644
1676
  } while (current);
1645
1677
  fibersInError.set(fiber.root, error);
@@ -2386,13 +2418,19 @@
2386
2418
  const node = getCurrent();
2387
2419
  let render = batchedRenderFunctions.get(node);
2388
2420
  if (!render) {
2389
- render = batched(node.render.bind(node, false));
2421
+ const wrapper = { fn: batched(node.render.bind(node, false)) };
2422
+ render = (...args) => wrapper.fn(...args);
2390
2423
  batchedRenderFunctions.set(node, render);
2391
2424
  // manual implementation of onWillDestroy to break cyclic dependency
2392
- node.willDestroy.push(clearReactivesForCallback.bind(null, render));
2425
+ node.willDestroy.push(cleanupRenderAndReactives.bind(null, wrapper, render));
2393
2426
  }
2394
2427
  return reactive(state, render);
2395
2428
  }
2429
+ const NO_OP = () => { };
2430
+ function cleanupRenderAndReactives(wrapper, render) {
2431
+ wrapper.fn = NO_OP;
2432
+ clearReactivesForCallback(render);
2433
+ }
2396
2434
  class ComponentNode {
2397
2435
  constructor(C, props, app, parent, parentKey) {
2398
2436
  this.fiber = null;
@@ -3697,7 +3735,10 @@
3697
3735
  const whitespaceRE = /\s+/g;
3698
3736
  // using a non-html document so that <inner/outer>HTML serializes as XML instead
3699
3737
  // of HTML (as we will parse it as xml later)
3700
- const xmlDoc = document.implementation.createDocument(null, null, null);
3738
+ let xmlDoc;
3739
+ if (typeof document !== "undefined") {
3740
+ xmlDoc = document.implementation.createDocument(null, null, null);
3741
+ }
3701
3742
  const MODS = new Set(["stop", "capture", "prevent", "self", "synthetic"]);
3702
3743
  let nextDataIds = {};
3703
3744
  function generateId(prefix = "") {
@@ -5816,11 +5857,15 @@
5816
5857
  }
5817
5858
 
5818
5859
  // do not modify manually. This file is generated by the release script.
5819
- const version = "2.8.1";
5860
+ const version = "2.8.3";
5820
5861
 
5821
5862
  // -----------------------------------------------------------------------------
5822
5863
  // Scheduler
5823
5864
  // -----------------------------------------------------------------------------
5865
+ let requestAnimationFrame;
5866
+ if (typeof window !== "undefined") {
5867
+ requestAnimationFrame = window.requestAnimationFrame.bind(window);
5868
+ }
5824
5869
  class Scheduler {
5825
5870
  constructor() {
5826
5871
  this.tasks = new Set();
@@ -5908,11 +5953,13 @@
5908
5953
  }
5909
5954
  // capture the value of requestAnimationFrame as soon as possible, to avoid
5910
5955
  // interactions with other code, such as test frameworks that override them
5911
- Scheduler.requestAnimationFrame = window.requestAnimationFrame.bind(window);
5956
+ Scheduler.requestAnimationFrame = requestAnimationFrame;
5912
5957
 
5913
5958
  let hasBeenLogged = false;
5914
5959
  const apps = new Set();
5915
- window.__OWL_DEVTOOLS__ || (window.__OWL_DEVTOOLS__ = { apps, Fiber, RootFiber, toRaw, reactive });
5960
+ if (typeof window !== "undefined") {
5961
+ window.__OWL_DEVTOOLS__ || (window.__OWL_DEVTOOLS__ = { apps, Fiber, RootFiber, toRaw, reactive });
5962
+ }
5916
5963
  class App extends TemplateSet {
5917
5964
  constructor(Root, config = {}) {
5918
5965
  super(config);
@@ -6325,8 +6372,8 @@
6325
6372
  Object.defineProperty(exports, '__esModule', { value: true });
6326
6373
 
6327
6374
 
6328
- __info__.date = '2025-09-23T07:17:45.055Z';
6329
- __info__.hash = '5211116';
6375
+ __info__.date = '2026-03-30T13:05:32.099Z';
6376
+ __info__.hash = 'efae3e4';
6330
6377
  __info__.url = 'https://github.com/odoo/owl';
6331
6378
 
6332
6379