@odoo/owl 2.8.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/compile_templates.mjs +69 -23
- package/dist/owl-devtools.zip +0 -0
- package/dist/owl.cjs.js +72 -26
- package/dist/owl.es.js +72 -26
- package/dist/owl.iife.js +72 -26
- package/dist/owl.iife.min.js +1 -1
- package/dist/types/compiler/parser.d.ts +24 -19
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/owl.iife.js
CHANGED
|
@@ -4542,7 +4542,7 @@
|
|
|
4542
4542
|
const isNewBlock = !block || forceNewBlock;
|
|
4543
4543
|
let codeIdx = this.target.code.length;
|
|
4544
4544
|
if (isNewBlock) {
|
|
4545
|
-
const n = ast.content.filter((c) => c.
|
|
4545
|
+
const n = ast.content.filter((c) => !c.hasNoRepresentation).length;
|
|
4546
4546
|
let result = null;
|
|
4547
4547
|
if (n <= 1) {
|
|
4548
4548
|
for (let child of ast.content) {
|
|
@@ -4556,15 +4556,15 @@
|
|
|
4556
4556
|
let index = 0;
|
|
4557
4557
|
for (let i = 0, l = ast.content.length; i < l; i++) {
|
|
4558
4558
|
const child = ast.content[i];
|
|
4559
|
-
const
|
|
4559
|
+
const forceNewBlock = !child.hasNoRepresentation;
|
|
4560
4560
|
const subCtx = createContext(ctx, {
|
|
4561
4561
|
block,
|
|
4562
4562
|
index,
|
|
4563
|
-
forceNewBlock
|
|
4563
|
+
forceNewBlock,
|
|
4564
4564
|
isLast: ctx.isLast && i === l - 1,
|
|
4565
4565
|
});
|
|
4566
4566
|
this.compileAST(child, subCtx);
|
|
4567
|
-
if (
|
|
4567
|
+
if (forceNewBlock) {
|
|
4568
4568
|
index++;
|
|
4569
4569
|
}
|
|
4570
4570
|
}
|
|
@@ -4982,9 +4982,9 @@
|
|
|
4982
4982
|
parseTCallBlock(node) ||
|
|
4983
4983
|
parseTTranslation(node, ctx) ||
|
|
4984
4984
|
parseTTranslationContext(node, ctx) ||
|
|
4985
|
+
parseTKey(node, ctx) ||
|
|
4985
4986
|
parseTEscNode(node, ctx) ||
|
|
4986
4987
|
parseTOutNode(node, ctx) ||
|
|
4987
|
-
parseTKey(node, ctx) ||
|
|
4988
4988
|
parseTSlot(node, ctx) ||
|
|
4989
4989
|
parseComponent(node, ctx) ||
|
|
4990
4990
|
parseDOMNode(node, ctx) ||
|
|
@@ -5052,19 +5052,29 @@
|
|
|
5052
5052
|
function parseTDebugLog(node, ctx) {
|
|
5053
5053
|
if (node.hasAttribute("t-debug")) {
|
|
5054
5054
|
node.removeAttribute("t-debug");
|
|
5055
|
-
|
|
5055
|
+
const content = parseNode(node, ctx);
|
|
5056
|
+
const ast = {
|
|
5056
5057
|
type: 12 /* TDebug */,
|
|
5057
|
-
content
|
|
5058
|
+
content,
|
|
5058
5059
|
};
|
|
5060
|
+
if (content === null || content === void 0 ? void 0 : content.hasNoRepresentation) {
|
|
5061
|
+
ast.hasNoRepresentation = true;
|
|
5062
|
+
}
|
|
5063
|
+
return ast;
|
|
5059
5064
|
}
|
|
5060
5065
|
if (node.hasAttribute("t-log")) {
|
|
5061
5066
|
const expr = node.getAttribute("t-log");
|
|
5062
5067
|
node.removeAttribute("t-log");
|
|
5063
|
-
|
|
5068
|
+
const content = parseNode(node, ctx);
|
|
5069
|
+
const ast = {
|
|
5064
5070
|
type: 13 /* TLog */,
|
|
5065
5071
|
expr,
|
|
5066
|
-
content
|
|
5072
|
+
content,
|
|
5067
5073
|
};
|
|
5074
|
+
if (content === null || content === void 0 ? void 0 : content.hasNoRepresentation) {
|
|
5075
|
+
ast.hasNoRepresentation = true;
|
|
5076
|
+
}
|
|
5077
|
+
return ast;
|
|
5068
5078
|
}
|
|
5069
5079
|
return null;
|
|
5070
5080
|
}
|
|
@@ -5294,11 +5304,19 @@
|
|
|
5294
5304
|
}
|
|
5295
5305
|
const key = node.getAttribute("t-key");
|
|
5296
5306
|
node.removeAttribute("t-key");
|
|
5297
|
-
const
|
|
5298
|
-
if (!
|
|
5307
|
+
const content = parseNode(node, ctx);
|
|
5308
|
+
if (!content) {
|
|
5299
5309
|
return null;
|
|
5300
5310
|
}
|
|
5301
|
-
|
|
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;
|
|
5302
5320
|
}
|
|
5303
5321
|
// -----------------------------------------------------------------------------
|
|
5304
5322
|
// t-call
|
|
@@ -5407,7 +5425,7 @@
|
|
|
5407
5425
|
if (node.textContent !== node.innerHTML) {
|
|
5408
5426
|
body = parseChildren(node, ctx);
|
|
5409
5427
|
}
|
|
5410
|
-
return { type: 6 /* TSet */, name, value, defaultValue, body };
|
|
5428
|
+
return { type: 6 /* TSet */, name, value, defaultValue, body, hasNoRepresentation: true };
|
|
5411
5429
|
}
|
|
5412
5430
|
// -----------------------------------------------------------------------------
|
|
5413
5431
|
// Components
|
|
@@ -5586,30 +5604,51 @@
|
|
|
5586
5604
|
// -----------------------------------------------------------------------------
|
|
5587
5605
|
// Translation
|
|
5588
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
|
+
}
|
|
5589
5614
|
function parseTTranslation(node, ctx) {
|
|
5590
5615
|
if (node.getAttribute("t-translation") !== "off") {
|
|
5591
5616
|
return null;
|
|
5592
5617
|
}
|
|
5593
5618
|
node.removeAttribute("t-translation");
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
content
|
|
5597
|
-
|
|
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);
|
|
5598
5625
|
}
|
|
5599
5626
|
// -----------------------------------------------------------------------------
|
|
5600
5627
|
// Translation Context
|
|
5601
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
|
+
}
|
|
5602
5640
|
function parseTTranslationContext(node, ctx) {
|
|
5603
5641
|
const translationCtx = node.getAttribute("t-translation-context");
|
|
5604
5642
|
if (!translationCtx) {
|
|
5605
5643
|
return null;
|
|
5606
5644
|
}
|
|
5607
5645
|
node.removeAttribute("t-translation-context");
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
content
|
|
5611
|
-
|
|
5612
|
-
}
|
|
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);
|
|
5613
5652
|
}
|
|
5614
5653
|
// -----------------------------------------------------------------------------
|
|
5615
5654
|
// Portal
|
|
@@ -5654,6 +5693,13 @@
|
|
|
5654
5693
|
}
|
|
5655
5694
|
return children;
|
|
5656
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
|
+
}
|
|
5657
5703
|
/**
|
|
5658
5704
|
* Parse all the child nodes of a given node and return an ast if possible.
|
|
5659
5705
|
* In the case there are multiple children, they are wrapped in a astmulti.
|
|
@@ -5666,7 +5712,7 @@
|
|
|
5666
5712
|
case 1:
|
|
5667
5713
|
return children[0];
|
|
5668
5714
|
default:
|
|
5669
|
-
return
|
|
5715
|
+
return makeASTMulti(children);
|
|
5670
5716
|
}
|
|
5671
5717
|
}
|
|
5672
5718
|
/**
|
|
@@ -5770,7 +5816,7 @@
|
|
|
5770
5816
|
}
|
|
5771
5817
|
|
|
5772
5818
|
// do not modify manually. This file is generated by the release script.
|
|
5773
|
-
const version = "2.8.
|
|
5819
|
+
const version = "2.8.1";
|
|
5774
5820
|
|
|
5775
5821
|
// -----------------------------------------------------------------------------
|
|
5776
5822
|
// Scheduler
|
|
@@ -6279,8 +6325,8 @@
|
|
|
6279
6325
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
6280
6326
|
|
|
6281
6327
|
|
|
6282
|
-
__info__.date = '2025-
|
|
6283
|
-
__info__.hash = '
|
|
6328
|
+
__info__.date = '2025-09-23T07:17:45.055Z';
|
|
6329
|
+
__info__.hash = '5211116';
|
|
6284
6330
|
__info__.url = 'https://github.com/odoo/owl';
|
|
6285
6331
|
|
|
6286
6332
|
|