@odoo/owl 2.7.0 → 2.8.1

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
@@ -3853,7 +3853,16 @@
3853
3853
  return key;
3854
3854
  }
3855
3855
  }
3856
- const TRANSLATABLE_ATTRS = ["label", "title", "placeholder", "alt"];
3856
+ const TRANSLATABLE_ATTRS = [
3857
+ "alt",
3858
+ "aria-label",
3859
+ "aria-placeholder",
3860
+ "aria-roledescription",
3861
+ "aria-valuetext",
3862
+ "label",
3863
+ "placeholder",
3864
+ "title",
3865
+ ];
3857
3866
  const translationRE = /^(\s*)([\s\S]+?)(\s*)$/;
3858
3867
  class CodeGenerator {
3859
3868
  constructor(ast, options) {
@@ -4533,7 +4542,7 @@
4533
4542
  const isNewBlock = !block || forceNewBlock;
4534
4543
  let codeIdx = this.target.code.length;
4535
4544
  if (isNewBlock) {
4536
- const n = ast.content.filter((c) => c.type !== 6 /* TSet */).length;
4545
+ const n = ast.content.filter((c) => !c.hasNoRepresentation).length;
4537
4546
  let result = null;
4538
4547
  if (n <= 1) {
4539
4548
  for (let child of ast.content) {
@@ -4547,15 +4556,15 @@
4547
4556
  let index = 0;
4548
4557
  for (let i = 0, l = ast.content.length; i < l; i++) {
4549
4558
  const child = ast.content[i];
4550
- const isTSet = child.type === 6 /* TSet */;
4559
+ const forceNewBlock = !child.hasNoRepresentation;
4551
4560
  const subCtx = createContext(ctx, {
4552
4561
  block,
4553
4562
  index,
4554
- forceNewBlock: !isTSet,
4563
+ forceNewBlock,
4555
4564
  isLast: ctx.isLast && i === l - 1,
4556
4565
  });
4557
4566
  this.compileAST(child, subCtx);
4558
- if (!isTSet) {
4567
+ if (forceNewBlock) {
4559
4568
  index++;
4560
4569
  }
4561
4570
  }
@@ -4971,11 +4980,11 @@
4971
4980
  parseTPortal(node, ctx) ||
4972
4981
  parseTCall(node, ctx) ||
4973
4982
  parseTCallBlock(node) ||
4974
- parseTEscNode(node, ctx) ||
4975
- parseTOutNode(node, ctx) ||
4976
- parseTKey(node, ctx) ||
4977
4983
  parseTTranslation(node, ctx) ||
4978
4984
  parseTTranslationContext(node, ctx) ||
4985
+ parseTKey(node, ctx) ||
4986
+ parseTEscNode(node, ctx) ||
4987
+ parseTOutNode(node, ctx) ||
4979
4988
  parseTSlot(node, ctx) ||
4980
4989
  parseComponent(node, ctx) ||
4981
4990
  parseDOMNode(node, ctx) ||
@@ -5043,19 +5052,29 @@
5043
5052
  function parseTDebugLog(node, ctx) {
5044
5053
  if (node.hasAttribute("t-debug")) {
5045
5054
  node.removeAttribute("t-debug");
5046
- return {
5055
+ const content = parseNode(node, ctx);
5056
+ const ast = {
5047
5057
  type: 12 /* TDebug */,
5048
- content: parseNode(node, ctx),
5058
+ content,
5049
5059
  };
5060
+ if (content === null || content === void 0 ? void 0 : content.hasNoRepresentation) {
5061
+ ast.hasNoRepresentation = true;
5062
+ }
5063
+ return ast;
5050
5064
  }
5051
5065
  if (node.hasAttribute("t-log")) {
5052
5066
  const expr = node.getAttribute("t-log");
5053
5067
  node.removeAttribute("t-log");
5054
- return {
5068
+ const content = parseNode(node, ctx);
5069
+ const ast = {
5055
5070
  type: 13 /* TLog */,
5056
5071
  expr,
5057
- content: parseNode(node, ctx),
5072
+ content,
5058
5073
  };
5074
+ if (content === null || content === void 0 ? void 0 : content.hasNoRepresentation) {
5075
+ ast.hasNoRepresentation = true;
5076
+ }
5077
+ return ast;
5059
5078
  }
5060
5079
  return null;
5061
5080
  }
@@ -5285,11 +5304,19 @@
5285
5304
  }
5286
5305
  const key = node.getAttribute("t-key");
5287
5306
  node.removeAttribute("t-key");
5288
- const body = parseNode(node, ctx);
5289
- if (!body) {
5307
+ const content = parseNode(node, ctx);
5308
+ if (!content) {
5290
5309
  return null;
5291
5310
  }
5292
- return { type: 10 /* TKey */, expr: key, content: body };
5311
+ const ast = {
5312
+ type: 10 /* TKey */,
5313
+ expr: key,
5314
+ content,
5315
+ };
5316
+ if (content.hasNoRepresentation) {
5317
+ ast.hasNoRepresentation = true;
5318
+ }
5319
+ return ast;
5293
5320
  }
5294
5321
  // -----------------------------------------------------------------------------
5295
5322
  // t-call
@@ -5398,7 +5425,7 @@
5398
5425
  if (node.textContent !== node.innerHTML) {
5399
5426
  body = parseChildren(node, ctx);
5400
5427
  }
5401
- return { type: 6 /* TSet */, name, value, defaultValue, body };
5428
+ return { type: 6 /* TSet */, name, value, defaultValue, body, hasNoRepresentation: true };
5402
5429
  }
5403
5430
  // -----------------------------------------------------------------------------
5404
5431
  // Components
@@ -5577,30 +5604,51 @@
5577
5604
  // -----------------------------------------------------------------------------
5578
5605
  // Translation
5579
5606
  // -----------------------------------------------------------------------------
5607
+ function wrapInTTranslationAST(r) {
5608
+ const ast = { type: 16 /* TTranslation */, content: r };
5609
+ if (r === null || r === void 0 ? void 0 : r.hasNoRepresentation) {
5610
+ ast.hasNoRepresentation = true;
5611
+ }
5612
+ return ast;
5613
+ }
5580
5614
  function parseTTranslation(node, ctx) {
5581
5615
  if (node.getAttribute("t-translation") !== "off") {
5582
5616
  return null;
5583
5617
  }
5584
5618
  node.removeAttribute("t-translation");
5585
- return {
5586
- type: 16 /* TTranslation */,
5587
- content: parseNode(node, ctx),
5588
- };
5619
+ const result = parseNode(node, ctx);
5620
+ if ((result === null || result === void 0 ? void 0 : result.type) === 3 /* Multi */) {
5621
+ const children = result.content.map(wrapInTTranslationAST);
5622
+ return makeASTMulti(children);
5623
+ }
5624
+ return wrapInTTranslationAST(result);
5589
5625
  }
5590
5626
  // -----------------------------------------------------------------------------
5591
5627
  // Translation Context
5592
5628
  // -----------------------------------------------------------------------------
5629
+ function wrapInTTranslationContextAST(r, translationCtx) {
5630
+ const ast = {
5631
+ type: 17 /* TTranslationContext */,
5632
+ content: r,
5633
+ translationCtx,
5634
+ };
5635
+ if (r === null || r === void 0 ? void 0 : r.hasNoRepresentation) {
5636
+ ast.hasNoRepresentation = true;
5637
+ }
5638
+ return ast;
5639
+ }
5593
5640
  function parseTTranslationContext(node, ctx) {
5594
5641
  const translationCtx = node.getAttribute("t-translation-context");
5595
5642
  if (!translationCtx) {
5596
5643
  return null;
5597
5644
  }
5598
5645
  node.removeAttribute("t-translation-context");
5599
- return {
5600
- type: 17 /* TTranslationContext */,
5601
- content: parseNode(node, ctx),
5602
- translationCtx,
5603
- };
5646
+ const result = parseNode(node, ctx);
5647
+ if ((result === null || result === void 0 ? void 0 : result.type) === 3 /* Multi */) {
5648
+ const children = result.content.map((c) => wrapInTTranslationContextAST(c, translationCtx));
5649
+ return makeASTMulti(children);
5650
+ }
5651
+ return wrapInTTranslationContextAST(result, translationCtx);
5604
5652
  }
5605
5653
  // -----------------------------------------------------------------------------
5606
5654
  // Portal
@@ -5645,6 +5693,13 @@
5645
5693
  }
5646
5694
  return children;
5647
5695
  }
5696
+ function makeASTMulti(children) {
5697
+ const ast = { type: 3 /* Multi */, content: children };
5698
+ if (children.every((c) => c.hasNoRepresentation)) {
5699
+ ast.hasNoRepresentation = true;
5700
+ }
5701
+ return ast;
5702
+ }
5648
5703
  /**
5649
5704
  * Parse all the child nodes of a given node and return an ast if possible.
5650
5705
  * In the case there are multiple children, they are wrapped in a astmulti.
@@ -5657,7 +5712,7 @@
5657
5712
  case 1:
5658
5713
  return children[0];
5659
5714
  default:
5660
- return { type: 3 /* Multi */, content: children };
5715
+ return makeASTMulti(children);
5661
5716
  }
5662
5717
  }
5663
5718
  /**
@@ -5761,7 +5816,7 @@
5761
5816
  }
5762
5817
 
5763
5818
  // do not modify manually. This file is generated by the release script.
5764
- const version = "2.7.0";
5819
+ const version = "2.8.1";
5765
5820
 
5766
5821
  // -----------------------------------------------------------------------------
5767
5822
  // Scheduler
@@ -6270,8 +6325,8 @@
6270
6325
  Object.defineProperty(exports, '__esModule', { value: true });
6271
6326
 
6272
6327
 
6273
- __info__.date = '2025-03-26T12:58:40.935Z';
6274
- __info__.hash = 'e788e36';
6328
+ __info__.date = '2025-09-23T07:17:45.055Z';
6329
+ __info__.hash = '5211116';
6275
6330
  __info__.url = 'https://github.com/odoo/owl';
6276
6331
 
6277
6332