@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/compile_templates.mjs +81 -26
- package/dist/owl-devtools.zip +0 -0
- package/dist/owl.cjs.js +84 -29
- package/dist/owl.es.js +84 -29
- package/dist/owl.iife.js +84 -29
- 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
|
@@ -486,7 +486,16 @@ class CodeTarget {
|
|
|
486
486
|
return key;
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
|
-
const TRANSLATABLE_ATTRS = [
|
|
489
|
+
const TRANSLATABLE_ATTRS = [
|
|
490
|
+
"alt",
|
|
491
|
+
"aria-label",
|
|
492
|
+
"aria-placeholder",
|
|
493
|
+
"aria-roledescription",
|
|
494
|
+
"aria-valuetext",
|
|
495
|
+
"label",
|
|
496
|
+
"placeholder",
|
|
497
|
+
"title",
|
|
498
|
+
];
|
|
490
499
|
const translationRE = /^(\s*)([\s\S]+?)(\s*)$/;
|
|
491
500
|
class CodeGenerator {
|
|
492
501
|
constructor(ast, options) {
|
|
@@ -1166,7 +1175,7 @@ class CodeGenerator {
|
|
|
1166
1175
|
const isNewBlock = !block || forceNewBlock;
|
|
1167
1176
|
let codeIdx = this.target.code.length;
|
|
1168
1177
|
if (isNewBlock) {
|
|
1169
|
-
const n = ast.content.filter((c) => c.
|
|
1178
|
+
const n = ast.content.filter((c) => !c.hasNoRepresentation).length;
|
|
1170
1179
|
let result = null;
|
|
1171
1180
|
if (n <= 1) {
|
|
1172
1181
|
for (let child of ast.content) {
|
|
@@ -1180,15 +1189,15 @@ class CodeGenerator {
|
|
|
1180
1189
|
let index = 0;
|
|
1181
1190
|
for (let i = 0, l = ast.content.length; i < l; i++) {
|
|
1182
1191
|
const child = ast.content[i];
|
|
1183
|
-
const
|
|
1192
|
+
const forceNewBlock = !child.hasNoRepresentation;
|
|
1184
1193
|
const subCtx = createContext(ctx, {
|
|
1185
1194
|
block,
|
|
1186
1195
|
index,
|
|
1187
|
-
forceNewBlock
|
|
1196
|
+
forceNewBlock,
|
|
1188
1197
|
isLast: ctx.isLast && i === l - 1,
|
|
1189
1198
|
});
|
|
1190
1199
|
this.compileAST(child, subCtx);
|
|
1191
|
-
if (
|
|
1200
|
+
if (forceNewBlock) {
|
|
1192
1201
|
index++;
|
|
1193
1202
|
}
|
|
1194
1203
|
}
|
|
@@ -1640,11 +1649,11 @@ function parseNode(node, ctx) {
|
|
|
1640
1649
|
parseTPortal(node, ctx) ||
|
|
1641
1650
|
parseTCall(node, ctx) ||
|
|
1642
1651
|
parseTCallBlock(node) ||
|
|
1643
|
-
parseTEscNode(node, ctx) ||
|
|
1644
|
-
parseTOutNode(node, ctx) ||
|
|
1645
|
-
parseTKey(node, ctx) ||
|
|
1646
1652
|
parseTTranslation(node, ctx) ||
|
|
1647
1653
|
parseTTranslationContext(node, ctx) ||
|
|
1654
|
+
parseTKey(node, ctx) ||
|
|
1655
|
+
parseTEscNode(node, ctx) ||
|
|
1656
|
+
parseTOutNode(node, ctx) ||
|
|
1648
1657
|
parseTSlot(node, ctx) ||
|
|
1649
1658
|
parseComponent(node, ctx) ||
|
|
1650
1659
|
parseDOMNode(node, ctx) ||
|
|
@@ -1712,19 +1721,29 @@ function parseTCustom(node, ctx) {
|
|
|
1712
1721
|
function parseTDebugLog(node, ctx) {
|
|
1713
1722
|
if (node.hasAttribute("t-debug")) {
|
|
1714
1723
|
node.removeAttribute("t-debug");
|
|
1715
|
-
|
|
1724
|
+
const content = parseNode(node, ctx);
|
|
1725
|
+
const ast = {
|
|
1716
1726
|
type: 12 /* TDebug */,
|
|
1717
|
-
content
|
|
1727
|
+
content,
|
|
1718
1728
|
};
|
|
1729
|
+
if (content === null || content === void 0 ? void 0 : content.hasNoRepresentation) {
|
|
1730
|
+
ast.hasNoRepresentation = true;
|
|
1731
|
+
}
|
|
1732
|
+
return ast;
|
|
1719
1733
|
}
|
|
1720
1734
|
if (node.hasAttribute("t-log")) {
|
|
1721
1735
|
const expr = node.getAttribute("t-log");
|
|
1722
1736
|
node.removeAttribute("t-log");
|
|
1723
|
-
|
|
1737
|
+
const content = parseNode(node, ctx);
|
|
1738
|
+
const ast = {
|
|
1724
1739
|
type: 13 /* TLog */,
|
|
1725
1740
|
expr,
|
|
1726
|
-
content
|
|
1741
|
+
content,
|
|
1727
1742
|
};
|
|
1743
|
+
if (content === null || content === void 0 ? void 0 : content.hasNoRepresentation) {
|
|
1744
|
+
ast.hasNoRepresentation = true;
|
|
1745
|
+
}
|
|
1746
|
+
return ast;
|
|
1728
1747
|
}
|
|
1729
1748
|
return null;
|
|
1730
1749
|
}
|
|
@@ -1954,11 +1973,19 @@ function parseTKey(node, ctx) {
|
|
|
1954
1973
|
}
|
|
1955
1974
|
const key = node.getAttribute("t-key");
|
|
1956
1975
|
node.removeAttribute("t-key");
|
|
1957
|
-
const
|
|
1958
|
-
if (!
|
|
1976
|
+
const content = parseNode(node, ctx);
|
|
1977
|
+
if (!content) {
|
|
1959
1978
|
return null;
|
|
1960
1979
|
}
|
|
1961
|
-
|
|
1980
|
+
const ast = {
|
|
1981
|
+
type: 10 /* TKey */,
|
|
1982
|
+
expr: key,
|
|
1983
|
+
content,
|
|
1984
|
+
};
|
|
1985
|
+
if (content.hasNoRepresentation) {
|
|
1986
|
+
ast.hasNoRepresentation = true;
|
|
1987
|
+
}
|
|
1988
|
+
return ast;
|
|
1962
1989
|
}
|
|
1963
1990
|
// -----------------------------------------------------------------------------
|
|
1964
1991
|
// t-call
|
|
@@ -2067,7 +2094,7 @@ function parseTSetNode(node, ctx) {
|
|
|
2067
2094
|
if (node.textContent !== node.innerHTML) {
|
|
2068
2095
|
body = parseChildren(node, ctx);
|
|
2069
2096
|
}
|
|
2070
|
-
return { type: 6 /* TSet */, name, value, defaultValue, body };
|
|
2097
|
+
return { type: 6 /* TSet */, name, value, defaultValue, body, hasNoRepresentation: true };
|
|
2071
2098
|
}
|
|
2072
2099
|
// -----------------------------------------------------------------------------
|
|
2073
2100
|
// Components
|
|
@@ -2246,30 +2273,51 @@ function parseTSlot(node, ctx) {
|
|
|
2246
2273
|
// -----------------------------------------------------------------------------
|
|
2247
2274
|
// Translation
|
|
2248
2275
|
// -----------------------------------------------------------------------------
|
|
2276
|
+
function wrapInTTranslationAST(r) {
|
|
2277
|
+
const ast = { type: 16 /* TTranslation */, content: r };
|
|
2278
|
+
if (r === null || r === void 0 ? void 0 : r.hasNoRepresentation) {
|
|
2279
|
+
ast.hasNoRepresentation = true;
|
|
2280
|
+
}
|
|
2281
|
+
return ast;
|
|
2282
|
+
}
|
|
2249
2283
|
function parseTTranslation(node, ctx) {
|
|
2250
2284
|
if (node.getAttribute("t-translation") !== "off") {
|
|
2251
2285
|
return null;
|
|
2252
2286
|
}
|
|
2253
2287
|
node.removeAttribute("t-translation");
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
content
|
|
2257
|
-
|
|
2288
|
+
const result = parseNode(node, ctx);
|
|
2289
|
+
if ((result === null || result === void 0 ? void 0 : result.type) === 3 /* Multi */) {
|
|
2290
|
+
const children = result.content.map(wrapInTTranslationAST);
|
|
2291
|
+
return makeASTMulti(children);
|
|
2292
|
+
}
|
|
2293
|
+
return wrapInTTranslationAST(result);
|
|
2258
2294
|
}
|
|
2259
2295
|
// -----------------------------------------------------------------------------
|
|
2260
2296
|
// Translation Context
|
|
2261
2297
|
// -----------------------------------------------------------------------------
|
|
2298
|
+
function wrapInTTranslationContextAST(r, translationCtx) {
|
|
2299
|
+
const ast = {
|
|
2300
|
+
type: 17 /* TTranslationContext */,
|
|
2301
|
+
content: r,
|
|
2302
|
+
translationCtx,
|
|
2303
|
+
};
|
|
2304
|
+
if (r === null || r === void 0 ? void 0 : r.hasNoRepresentation) {
|
|
2305
|
+
ast.hasNoRepresentation = true;
|
|
2306
|
+
}
|
|
2307
|
+
return ast;
|
|
2308
|
+
}
|
|
2262
2309
|
function parseTTranslationContext(node, ctx) {
|
|
2263
2310
|
const translationCtx = node.getAttribute("t-translation-context");
|
|
2264
2311
|
if (!translationCtx) {
|
|
2265
2312
|
return null;
|
|
2266
2313
|
}
|
|
2267
2314
|
node.removeAttribute("t-translation-context");
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
content
|
|
2271
|
-
|
|
2272
|
-
}
|
|
2315
|
+
const result = parseNode(node, ctx);
|
|
2316
|
+
if ((result === null || result === void 0 ? void 0 : result.type) === 3 /* Multi */) {
|
|
2317
|
+
const children = result.content.map((c) => wrapInTTranslationContextAST(c, translationCtx));
|
|
2318
|
+
return makeASTMulti(children);
|
|
2319
|
+
}
|
|
2320
|
+
return wrapInTTranslationContextAST(result, translationCtx);
|
|
2273
2321
|
}
|
|
2274
2322
|
// -----------------------------------------------------------------------------
|
|
2275
2323
|
// Portal
|
|
@@ -2314,6 +2362,13 @@ function parseChildren(node, ctx) {
|
|
|
2314
2362
|
}
|
|
2315
2363
|
return children;
|
|
2316
2364
|
}
|
|
2365
|
+
function makeASTMulti(children) {
|
|
2366
|
+
const ast = { type: 3 /* Multi */, content: children };
|
|
2367
|
+
if (children.every((c) => c.hasNoRepresentation)) {
|
|
2368
|
+
ast.hasNoRepresentation = true;
|
|
2369
|
+
}
|
|
2370
|
+
return ast;
|
|
2371
|
+
}
|
|
2317
2372
|
/**
|
|
2318
2373
|
* Parse all the child nodes of a given node and return an ast if possible.
|
|
2319
2374
|
* In the case there are multiple children, they are wrapped in a astmulti.
|
|
@@ -2326,7 +2381,7 @@ function parseChildNodes(node, ctx) {
|
|
|
2326
2381
|
case 1:
|
|
2327
2382
|
return children[0];
|
|
2328
2383
|
default:
|
|
2329
|
-
return
|
|
2384
|
+
return makeASTMulti(children);
|
|
2330
2385
|
}
|
|
2331
2386
|
}
|
|
2332
2387
|
/**
|
package/dist/owl-devtools.zip
CHANGED
|
Binary file
|
package/dist/owl.cjs.js
CHANGED
|
@@ -3854,7 +3854,16 @@ class CodeTarget {
|
|
|
3854
3854
|
return key;
|
|
3855
3855
|
}
|
|
3856
3856
|
}
|
|
3857
|
-
const TRANSLATABLE_ATTRS = [
|
|
3857
|
+
const TRANSLATABLE_ATTRS = [
|
|
3858
|
+
"alt",
|
|
3859
|
+
"aria-label",
|
|
3860
|
+
"aria-placeholder",
|
|
3861
|
+
"aria-roledescription",
|
|
3862
|
+
"aria-valuetext",
|
|
3863
|
+
"label",
|
|
3864
|
+
"placeholder",
|
|
3865
|
+
"title",
|
|
3866
|
+
];
|
|
3858
3867
|
const translationRE = /^(\s*)([\s\S]+?)(\s*)$/;
|
|
3859
3868
|
class CodeGenerator {
|
|
3860
3869
|
constructor(ast, options) {
|
|
@@ -4534,7 +4543,7 @@ class CodeGenerator {
|
|
|
4534
4543
|
const isNewBlock = !block || forceNewBlock;
|
|
4535
4544
|
let codeIdx = this.target.code.length;
|
|
4536
4545
|
if (isNewBlock) {
|
|
4537
|
-
const n = ast.content.filter((c) => c.
|
|
4546
|
+
const n = ast.content.filter((c) => !c.hasNoRepresentation).length;
|
|
4538
4547
|
let result = null;
|
|
4539
4548
|
if (n <= 1) {
|
|
4540
4549
|
for (let child of ast.content) {
|
|
@@ -4548,15 +4557,15 @@ class CodeGenerator {
|
|
|
4548
4557
|
let index = 0;
|
|
4549
4558
|
for (let i = 0, l = ast.content.length; i < l; i++) {
|
|
4550
4559
|
const child = ast.content[i];
|
|
4551
|
-
const
|
|
4560
|
+
const forceNewBlock = !child.hasNoRepresentation;
|
|
4552
4561
|
const subCtx = createContext(ctx, {
|
|
4553
4562
|
block,
|
|
4554
4563
|
index,
|
|
4555
|
-
forceNewBlock
|
|
4564
|
+
forceNewBlock,
|
|
4556
4565
|
isLast: ctx.isLast && i === l - 1,
|
|
4557
4566
|
});
|
|
4558
4567
|
this.compileAST(child, subCtx);
|
|
4559
|
-
if (
|
|
4568
|
+
if (forceNewBlock) {
|
|
4560
4569
|
index++;
|
|
4561
4570
|
}
|
|
4562
4571
|
}
|
|
@@ -4972,11 +4981,11 @@ function parseNode(node, ctx) {
|
|
|
4972
4981
|
parseTPortal(node, ctx) ||
|
|
4973
4982
|
parseTCall(node, ctx) ||
|
|
4974
4983
|
parseTCallBlock(node) ||
|
|
4975
|
-
parseTEscNode(node, ctx) ||
|
|
4976
|
-
parseTOutNode(node, ctx) ||
|
|
4977
|
-
parseTKey(node, ctx) ||
|
|
4978
4984
|
parseTTranslation(node, ctx) ||
|
|
4979
4985
|
parseTTranslationContext(node, ctx) ||
|
|
4986
|
+
parseTKey(node, ctx) ||
|
|
4987
|
+
parseTEscNode(node, ctx) ||
|
|
4988
|
+
parseTOutNode(node, ctx) ||
|
|
4980
4989
|
parseTSlot(node, ctx) ||
|
|
4981
4990
|
parseComponent(node, ctx) ||
|
|
4982
4991
|
parseDOMNode(node, ctx) ||
|
|
@@ -5044,19 +5053,29 @@ function parseTCustom(node, ctx) {
|
|
|
5044
5053
|
function parseTDebugLog(node, ctx) {
|
|
5045
5054
|
if (node.hasAttribute("t-debug")) {
|
|
5046
5055
|
node.removeAttribute("t-debug");
|
|
5047
|
-
|
|
5056
|
+
const content = parseNode(node, ctx);
|
|
5057
|
+
const ast = {
|
|
5048
5058
|
type: 12 /* TDebug */,
|
|
5049
|
-
content
|
|
5059
|
+
content,
|
|
5050
5060
|
};
|
|
5061
|
+
if (content === null || content === void 0 ? void 0 : content.hasNoRepresentation) {
|
|
5062
|
+
ast.hasNoRepresentation = true;
|
|
5063
|
+
}
|
|
5064
|
+
return ast;
|
|
5051
5065
|
}
|
|
5052
5066
|
if (node.hasAttribute("t-log")) {
|
|
5053
5067
|
const expr = node.getAttribute("t-log");
|
|
5054
5068
|
node.removeAttribute("t-log");
|
|
5055
|
-
|
|
5069
|
+
const content = parseNode(node, ctx);
|
|
5070
|
+
const ast = {
|
|
5056
5071
|
type: 13 /* TLog */,
|
|
5057
5072
|
expr,
|
|
5058
|
-
content
|
|
5073
|
+
content,
|
|
5059
5074
|
};
|
|
5075
|
+
if (content === null || content === void 0 ? void 0 : content.hasNoRepresentation) {
|
|
5076
|
+
ast.hasNoRepresentation = true;
|
|
5077
|
+
}
|
|
5078
|
+
return ast;
|
|
5060
5079
|
}
|
|
5061
5080
|
return null;
|
|
5062
5081
|
}
|
|
@@ -5286,11 +5305,19 @@ function parseTKey(node, ctx) {
|
|
|
5286
5305
|
}
|
|
5287
5306
|
const key = node.getAttribute("t-key");
|
|
5288
5307
|
node.removeAttribute("t-key");
|
|
5289
|
-
const
|
|
5290
|
-
if (!
|
|
5308
|
+
const content = parseNode(node, ctx);
|
|
5309
|
+
if (!content) {
|
|
5291
5310
|
return null;
|
|
5292
5311
|
}
|
|
5293
|
-
|
|
5312
|
+
const ast = {
|
|
5313
|
+
type: 10 /* TKey */,
|
|
5314
|
+
expr: key,
|
|
5315
|
+
content,
|
|
5316
|
+
};
|
|
5317
|
+
if (content.hasNoRepresentation) {
|
|
5318
|
+
ast.hasNoRepresentation = true;
|
|
5319
|
+
}
|
|
5320
|
+
return ast;
|
|
5294
5321
|
}
|
|
5295
5322
|
// -----------------------------------------------------------------------------
|
|
5296
5323
|
// t-call
|
|
@@ -5399,7 +5426,7 @@ function parseTSetNode(node, ctx) {
|
|
|
5399
5426
|
if (node.textContent !== node.innerHTML) {
|
|
5400
5427
|
body = parseChildren(node, ctx);
|
|
5401
5428
|
}
|
|
5402
|
-
return { type: 6 /* TSet */, name, value, defaultValue, body };
|
|
5429
|
+
return { type: 6 /* TSet */, name, value, defaultValue, body, hasNoRepresentation: true };
|
|
5403
5430
|
}
|
|
5404
5431
|
// -----------------------------------------------------------------------------
|
|
5405
5432
|
// Components
|
|
@@ -5578,30 +5605,51 @@ function parseTSlot(node, ctx) {
|
|
|
5578
5605
|
// -----------------------------------------------------------------------------
|
|
5579
5606
|
// Translation
|
|
5580
5607
|
// -----------------------------------------------------------------------------
|
|
5608
|
+
function wrapInTTranslationAST(r) {
|
|
5609
|
+
const ast = { type: 16 /* TTranslation */, content: r };
|
|
5610
|
+
if (r === null || r === void 0 ? void 0 : r.hasNoRepresentation) {
|
|
5611
|
+
ast.hasNoRepresentation = true;
|
|
5612
|
+
}
|
|
5613
|
+
return ast;
|
|
5614
|
+
}
|
|
5581
5615
|
function parseTTranslation(node, ctx) {
|
|
5582
5616
|
if (node.getAttribute("t-translation") !== "off") {
|
|
5583
5617
|
return null;
|
|
5584
5618
|
}
|
|
5585
5619
|
node.removeAttribute("t-translation");
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
content
|
|
5589
|
-
|
|
5620
|
+
const result = parseNode(node, ctx);
|
|
5621
|
+
if ((result === null || result === void 0 ? void 0 : result.type) === 3 /* Multi */) {
|
|
5622
|
+
const children = result.content.map(wrapInTTranslationAST);
|
|
5623
|
+
return makeASTMulti(children);
|
|
5624
|
+
}
|
|
5625
|
+
return wrapInTTranslationAST(result);
|
|
5590
5626
|
}
|
|
5591
5627
|
// -----------------------------------------------------------------------------
|
|
5592
5628
|
// Translation Context
|
|
5593
5629
|
// -----------------------------------------------------------------------------
|
|
5630
|
+
function wrapInTTranslationContextAST(r, translationCtx) {
|
|
5631
|
+
const ast = {
|
|
5632
|
+
type: 17 /* TTranslationContext */,
|
|
5633
|
+
content: r,
|
|
5634
|
+
translationCtx,
|
|
5635
|
+
};
|
|
5636
|
+
if (r === null || r === void 0 ? void 0 : r.hasNoRepresentation) {
|
|
5637
|
+
ast.hasNoRepresentation = true;
|
|
5638
|
+
}
|
|
5639
|
+
return ast;
|
|
5640
|
+
}
|
|
5594
5641
|
function parseTTranslationContext(node, ctx) {
|
|
5595
5642
|
const translationCtx = node.getAttribute("t-translation-context");
|
|
5596
5643
|
if (!translationCtx) {
|
|
5597
5644
|
return null;
|
|
5598
5645
|
}
|
|
5599
5646
|
node.removeAttribute("t-translation-context");
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
content
|
|
5603
|
-
|
|
5604
|
-
}
|
|
5647
|
+
const result = parseNode(node, ctx);
|
|
5648
|
+
if ((result === null || result === void 0 ? void 0 : result.type) === 3 /* Multi */) {
|
|
5649
|
+
const children = result.content.map((c) => wrapInTTranslationContextAST(c, translationCtx));
|
|
5650
|
+
return makeASTMulti(children);
|
|
5651
|
+
}
|
|
5652
|
+
return wrapInTTranslationContextAST(result, translationCtx);
|
|
5605
5653
|
}
|
|
5606
5654
|
// -----------------------------------------------------------------------------
|
|
5607
5655
|
// Portal
|
|
@@ -5646,6 +5694,13 @@ function parseChildren(node, ctx) {
|
|
|
5646
5694
|
}
|
|
5647
5695
|
return children;
|
|
5648
5696
|
}
|
|
5697
|
+
function makeASTMulti(children) {
|
|
5698
|
+
const ast = { type: 3 /* Multi */, content: children };
|
|
5699
|
+
if (children.every((c) => c.hasNoRepresentation)) {
|
|
5700
|
+
ast.hasNoRepresentation = true;
|
|
5701
|
+
}
|
|
5702
|
+
return ast;
|
|
5703
|
+
}
|
|
5649
5704
|
/**
|
|
5650
5705
|
* Parse all the child nodes of a given node and return an ast if possible.
|
|
5651
5706
|
* In the case there are multiple children, they are wrapped in a astmulti.
|
|
@@ -5658,7 +5713,7 @@ function parseChildNodes(node, ctx) {
|
|
|
5658
5713
|
case 1:
|
|
5659
5714
|
return children[0];
|
|
5660
5715
|
default:
|
|
5661
|
-
return
|
|
5716
|
+
return makeASTMulti(children);
|
|
5662
5717
|
}
|
|
5663
5718
|
}
|
|
5664
5719
|
/**
|
|
@@ -5762,7 +5817,7 @@ function compile(template, options = {
|
|
|
5762
5817
|
}
|
|
5763
5818
|
|
|
5764
5819
|
// do not modify manually. This file is generated by the release script.
|
|
5765
|
-
const version = "2.
|
|
5820
|
+
const version = "2.8.1";
|
|
5766
5821
|
|
|
5767
5822
|
// -----------------------------------------------------------------------------
|
|
5768
5823
|
// Scheduler
|
|
@@ -6269,6 +6324,6 @@ exports.whenReady = whenReady;
|
|
|
6269
6324
|
exports.xml = xml;
|
|
6270
6325
|
|
|
6271
6326
|
|
|
6272
|
-
__info__.date = '2025-
|
|
6273
|
-
__info__.hash = '
|
|
6327
|
+
__info__.date = '2025-09-23T07:17:45.055Z';
|
|
6328
|
+
__info__.hash = '5211116';
|
|
6274
6329
|
__info__.url = 'https://github.com/odoo/owl';
|
package/dist/owl.es.js
CHANGED
|
@@ -3850,7 +3850,16 @@ class CodeTarget {
|
|
|
3850
3850
|
return key;
|
|
3851
3851
|
}
|
|
3852
3852
|
}
|
|
3853
|
-
const TRANSLATABLE_ATTRS = [
|
|
3853
|
+
const TRANSLATABLE_ATTRS = [
|
|
3854
|
+
"alt",
|
|
3855
|
+
"aria-label",
|
|
3856
|
+
"aria-placeholder",
|
|
3857
|
+
"aria-roledescription",
|
|
3858
|
+
"aria-valuetext",
|
|
3859
|
+
"label",
|
|
3860
|
+
"placeholder",
|
|
3861
|
+
"title",
|
|
3862
|
+
];
|
|
3854
3863
|
const translationRE = /^(\s*)([\s\S]+?)(\s*)$/;
|
|
3855
3864
|
class CodeGenerator {
|
|
3856
3865
|
constructor(ast, options) {
|
|
@@ -4530,7 +4539,7 @@ class CodeGenerator {
|
|
|
4530
4539
|
const isNewBlock = !block || forceNewBlock;
|
|
4531
4540
|
let codeIdx = this.target.code.length;
|
|
4532
4541
|
if (isNewBlock) {
|
|
4533
|
-
const n = ast.content.filter((c) => c.
|
|
4542
|
+
const n = ast.content.filter((c) => !c.hasNoRepresentation).length;
|
|
4534
4543
|
let result = null;
|
|
4535
4544
|
if (n <= 1) {
|
|
4536
4545
|
for (let child of ast.content) {
|
|
@@ -4544,15 +4553,15 @@ class CodeGenerator {
|
|
|
4544
4553
|
let index = 0;
|
|
4545
4554
|
for (let i = 0, l = ast.content.length; i < l; i++) {
|
|
4546
4555
|
const child = ast.content[i];
|
|
4547
|
-
const
|
|
4556
|
+
const forceNewBlock = !child.hasNoRepresentation;
|
|
4548
4557
|
const subCtx = createContext(ctx, {
|
|
4549
4558
|
block,
|
|
4550
4559
|
index,
|
|
4551
|
-
forceNewBlock
|
|
4560
|
+
forceNewBlock,
|
|
4552
4561
|
isLast: ctx.isLast && i === l - 1,
|
|
4553
4562
|
});
|
|
4554
4563
|
this.compileAST(child, subCtx);
|
|
4555
|
-
if (
|
|
4564
|
+
if (forceNewBlock) {
|
|
4556
4565
|
index++;
|
|
4557
4566
|
}
|
|
4558
4567
|
}
|
|
@@ -4968,11 +4977,11 @@ function parseNode(node, ctx) {
|
|
|
4968
4977
|
parseTPortal(node, ctx) ||
|
|
4969
4978
|
parseTCall(node, ctx) ||
|
|
4970
4979
|
parseTCallBlock(node) ||
|
|
4971
|
-
parseTEscNode(node, ctx) ||
|
|
4972
|
-
parseTOutNode(node, ctx) ||
|
|
4973
|
-
parseTKey(node, ctx) ||
|
|
4974
4980
|
parseTTranslation(node, ctx) ||
|
|
4975
4981
|
parseTTranslationContext(node, ctx) ||
|
|
4982
|
+
parseTKey(node, ctx) ||
|
|
4983
|
+
parseTEscNode(node, ctx) ||
|
|
4984
|
+
parseTOutNode(node, ctx) ||
|
|
4976
4985
|
parseTSlot(node, ctx) ||
|
|
4977
4986
|
parseComponent(node, ctx) ||
|
|
4978
4987
|
parseDOMNode(node, ctx) ||
|
|
@@ -5040,19 +5049,29 @@ function parseTCustom(node, ctx) {
|
|
|
5040
5049
|
function parseTDebugLog(node, ctx) {
|
|
5041
5050
|
if (node.hasAttribute("t-debug")) {
|
|
5042
5051
|
node.removeAttribute("t-debug");
|
|
5043
|
-
|
|
5052
|
+
const content = parseNode(node, ctx);
|
|
5053
|
+
const ast = {
|
|
5044
5054
|
type: 12 /* TDebug */,
|
|
5045
|
-
content
|
|
5055
|
+
content,
|
|
5046
5056
|
};
|
|
5057
|
+
if (content === null || content === void 0 ? void 0 : content.hasNoRepresentation) {
|
|
5058
|
+
ast.hasNoRepresentation = true;
|
|
5059
|
+
}
|
|
5060
|
+
return ast;
|
|
5047
5061
|
}
|
|
5048
5062
|
if (node.hasAttribute("t-log")) {
|
|
5049
5063
|
const expr = node.getAttribute("t-log");
|
|
5050
5064
|
node.removeAttribute("t-log");
|
|
5051
|
-
|
|
5065
|
+
const content = parseNode(node, ctx);
|
|
5066
|
+
const ast = {
|
|
5052
5067
|
type: 13 /* TLog */,
|
|
5053
5068
|
expr,
|
|
5054
|
-
content
|
|
5069
|
+
content,
|
|
5055
5070
|
};
|
|
5071
|
+
if (content === null || content === void 0 ? void 0 : content.hasNoRepresentation) {
|
|
5072
|
+
ast.hasNoRepresentation = true;
|
|
5073
|
+
}
|
|
5074
|
+
return ast;
|
|
5056
5075
|
}
|
|
5057
5076
|
return null;
|
|
5058
5077
|
}
|
|
@@ -5282,11 +5301,19 @@ function parseTKey(node, ctx) {
|
|
|
5282
5301
|
}
|
|
5283
5302
|
const key = node.getAttribute("t-key");
|
|
5284
5303
|
node.removeAttribute("t-key");
|
|
5285
|
-
const
|
|
5286
|
-
if (!
|
|
5304
|
+
const content = parseNode(node, ctx);
|
|
5305
|
+
if (!content) {
|
|
5287
5306
|
return null;
|
|
5288
5307
|
}
|
|
5289
|
-
|
|
5308
|
+
const ast = {
|
|
5309
|
+
type: 10 /* TKey */,
|
|
5310
|
+
expr: key,
|
|
5311
|
+
content,
|
|
5312
|
+
};
|
|
5313
|
+
if (content.hasNoRepresentation) {
|
|
5314
|
+
ast.hasNoRepresentation = true;
|
|
5315
|
+
}
|
|
5316
|
+
return ast;
|
|
5290
5317
|
}
|
|
5291
5318
|
// -----------------------------------------------------------------------------
|
|
5292
5319
|
// t-call
|
|
@@ -5395,7 +5422,7 @@ function parseTSetNode(node, ctx) {
|
|
|
5395
5422
|
if (node.textContent !== node.innerHTML) {
|
|
5396
5423
|
body = parseChildren(node, ctx);
|
|
5397
5424
|
}
|
|
5398
|
-
return { type: 6 /* TSet */, name, value, defaultValue, body };
|
|
5425
|
+
return { type: 6 /* TSet */, name, value, defaultValue, body, hasNoRepresentation: true };
|
|
5399
5426
|
}
|
|
5400
5427
|
// -----------------------------------------------------------------------------
|
|
5401
5428
|
// Components
|
|
@@ -5574,30 +5601,51 @@ function parseTSlot(node, ctx) {
|
|
|
5574
5601
|
// -----------------------------------------------------------------------------
|
|
5575
5602
|
// Translation
|
|
5576
5603
|
// -----------------------------------------------------------------------------
|
|
5604
|
+
function wrapInTTranslationAST(r) {
|
|
5605
|
+
const ast = { type: 16 /* TTranslation */, content: r };
|
|
5606
|
+
if (r === null || r === void 0 ? void 0 : r.hasNoRepresentation) {
|
|
5607
|
+
ast.hasNoRepresentation = true;
|
|
5608
|
+
}
|
|
5609
|
+
return ast;
|
|
5610
|
+
}
|
|
5577
5611
|
function parseTTranslation(node, ctx) {
|
|
5578
5612
|
if (node.getAttribute("t-translation") !== "off") {
|
|
5579
5613
|
return null;
|
|
5580
5614
|
}
|
|
5581
5615
|
node.removeAttribute("t-translation");
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
content
|
|
5585
|
-
|
|
5616
|
+
const result = parseNode(node, ctx);
|
|
5617
|
+
if ((result === null || result === void 0 ? void 0 : result.type) === 3 /* Multi */) {
|
|
5618
|
+
const children = result.content.map(wrapInTTranslationAST);
|
|
5619
|
+
return makeASTMulti(children);
|
|
5620
|
+
}
|
|
5621
|
+
return wrapInTTranslationAST(result);
|
|
5586
5622
|
}
|
|
5587
5623
|
// -----------------------------------------------------------------------------
|
|
5588
5624
|
// Translation Context
|
|
5589
5625
|
// -----------------------------------------------------------------------------
|
|
5626
|
+
function wrapInTTranslationContextAST(r, translationCtx) {
|
|
5627
|
+
const ast = {
|
|
5628
|
+
type: 17 /* TTranslationContext */,
|
|
5629
|
+
content: r,
|
|
5630
|
+
translationCtx,
|
|
5631
|
+
};
|
|
5632
|
+
if (r === null || r === void 0 ? void 0 : r.hasNoRepresentation) {
|
|
5633
|
+
ast.hasNoRepresentation = true;
|
|
5634
|
+
}
|
|
5635
|
+
return ast;
|
|
5636
|
+
}
|
|
5590
5637
|
function parseTTranslationContext(node, ctx) {
|
|
5591
5638
|
const translationCtx = node.getAttribute("t-translation-context");
|
|
5592
5639
|
if (!translationCtx) {
|
|
5593
5640
|
return null;
|
|
5594
5641
|
}
|
|
5595
5642
|
node.removeAttribute("t-translation-context");
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
content
|
|
5599
|
-
|
|
5600
|
-
}
|
|
5643
|
+
const result = parseNode(node, ctx);
|
|
5644
|
+
if ((result === null || result === void 0 ? void 0 : result.type) === 3 /* Multi */) {
|
|
5645
|
+
const children = result.content.map((c) => wrapInTTranslationContextAST(c, translationCtx));
|
|
5646
|
+
return makeASTMulti(children);
|
|
5647
|
+
}
|
|
5648
|
+
return wrapInTTranslationContextAST(result, translationCtx);
|
|
5601
5649
|
}
|
|
5602
5650
|
// -----------------------------------------------------------------------------
|
|
5603
5651
|
// Portal
|
|
@@ -5642,6 +5690,13 @@ function parseChildren(node, ctx) {
|
|
|
5642
5690
|
}
|
|
5643
5691
|
return children;
|
|
5644
5692
|
}
|
|
5693
|
+
function makeASTMulti(children) {
|
|
5694
|
+
const ast = { type: 3 /* Multi */, content: children };
|
|
5695
|
+
if (children.every((c) => c.hasNoRepresentation)) {
|
|
5696
|
+
ast.hasNoRepresentation = true;
|
|
5697
|
+
}
|
|
5698
|
+
return ast;
|
|
5699
|
+
}
|
|
5645
5700
|
/**
|
|
5646
5701
|
* Parse all the child nodes of a given node and return an ast if possible.
|
|
5647
5702
|
* In the case there are multiple children, they are wrapped in a astmulti.
|
|
@@ -5654,7 +5709,7 @@ function parseChildNodes(node, ctx) {
|
|
|
5654
5709
|
case 1:
|
|
5655
5710
|
return children[0];
|
|
5656
5711
|
default:
|
|
5657
|
-
return
|
|
5712
|
+
return makeASTMulti(children);
|
|
5658
5713
|
}
|
|
5659
5714
|
}
|
|
5660
5715
|
/**
|
|
@@ -5758,7 +5813,7 @@ function compile(template, options = {
|
|
|
5758
5813
|
}
|
|
5759
5814
|
|
|
5760
5815
|
// do not modify manually. This file is generated by the release script.
|
|
5761
|
-
const version = "2.
|
|
5816
|
+
const version = "2.8.1";
|
|
5762
5817
|
|
|
5763
5818
|
// -----------------------------------------------------------------------------
|
|
5764
5819
|
// Scheduler
|
|
@@ -6229,6 +6284,6 @@ TemplateSet.prototype._compileTemplate = function _compileTemplate(name, templat
|
|
|
6229
6284
|
export { App, Component, EventBus, OwlError, __info__, batched, blockDom, htmlEscape, loadFile, markRaw, markup, mount, onError, onMounted, onPatched, onRendered, onWillDestroy, onWillPatch, onWillRender, onWillStart, onWillUnmount, onWillUpdateProps, reactive, status, toRaw, useChildSubEnv, useComponent, useEffect, useEnv, useExternalListener, useRef, useState, useSubEnv, validate, validateType, whenReady, xml };
|
|
6230
6285
|
|
|
6231
6286
|
|
|
6232
|
-
__info__.date = '2025-
|
|
6233
|
-
__info__.hash = '
|
|
6287
|
+
__info__.date = '2025-09-23T07:17:45.055Z';
|
|
6288
|
+
__info__.hash = '5211116';
|
|
6234
6289
|
__info__.url = 'https://github.com/odoo/owl';
|