diff --git a/docs/owl.js b/docs/owl.js index 02d65d35e..333411d15 100644 --- a/docs/owl.js +++ b/docs/owl.js @@ -4839,10 +4839,10 @@ function parseNode(node, ctx) { parseTCall(node, ctx) || parseTCallBlock(node) || parseTEscNode(node, ctx) || + parseTOutNode(node, ctx) || parseTKey(node, ctx) || parseTTranslation(node, ctx) || parseTSlot(node, ctx) || - parseTOutNode(node, ctx) || parseComponent(node, ctx) || parseDOMNode(node, ctx) || parseTSetNode(node, ctx) || @@ -5032,9 +5032,6 @@ function parseTEscNode(node, ctx) { content: [tesc], }; } - if (ast.type === 11 /* TComponent */) { - throw new OwlError("t-esc is not supported on Component nodes"); - } return tesc; } // ----------------------------------------------------------------------------- @@ -5476,19 +5473,21 @@ function normalizeTIf(el) { * * @param el the element containing the tree that should be normalized */ -function normalizeTEsc(el) { - const elements = [...el.querySelectorAll("[t-esc]")].filter((el) => el.tagName[0] === el.tagName[0].toUpperCase() || el.hasAttribute("t-component")); - for (const el of elements) { - if (el.childNodes.length) { - throw new OwlError("Cannot have t-esc on a component that already has content"); - } - const value = el.getAttribute("t-esc"); - el.removeAttribute("t-esc"); - const t = el.ownerDocument.createElement("t"); - if (value != null) { - t.setAttribute("t-esc", value); +function normalizeTEscTOut(el) { + for (const d of ["t-esc", "t-out"]) { + const elements = [...el.querySelectorAll(`[${d}]`)].filter((el) => el.tagName[0] === el.tagName[0].toUpperCase() || el.hasAttribute("t-component")); + for (const el of elements) { + if (el.childNodes.length) { + throw new OwlError(`Cannot have ${d} on a component that already has content`); + } + const value = el.getAttribute(d); + el.removeAttribute(d); + const t = el.ownerDocument.createElement("t"); + if (value != null) { + t.setAttribute(d, value); + } + el.appendChild(t); } - el.appendChild(t); } } /** @@ -5499,7 +5498,7 @@ function normalizeTEsc(el) { */ function normalizeXML(el) { normalizeTIf(el); - normalizeTEsc(el); + normalizeTEscTOut(el); } /** * Parses an XML string into an XML document, throwing errors on parser errors @@ -5552,7 +5551,7 @@ function compile(template, options = {}) { } // do not modify manually. This file is generated by the release script. -const version = "2.1.4"; +const version = "2.2"; // ----------------------------------------------------------------------------- // Scheduler @@ -5985,6 +5984,6 @@ TemplateSet.prototype._compileTemplate = function _compileTemplate(name, templat export { App, Component, EventBus, OwlError, __info__, blockDom, 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 }; -__info__.date = '2023-07-18T14:07:26.565Z'; -__info__.hash = '836e12b'; +__info__.date = '2023-07-19T13:22:24.480Z'; +__info__.hash = '2e07799'; __info__.url = 'https://github.com/odoo/owl'; diff --git a/package-lock.json b/package-lock.json index f02e8b976..a8578ca9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@odoo/owl", - "version": "2.2", + "version": "2.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 975f3a203..1163cc341 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@odoo/owl", - "version": "2.2", + "version": "2.2.1", "description": "Odoo Web Library (OWL)", "main": "dist/owl.cjs.js", "module": "dist/owl.es.js", diff --git a/src/version.ts b/src/version.ts index b9616cbf4..757a85dcf 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,2 +1,2 @@ // do not modify manually. This file is generated by the release script. -export const version = "2.2"; +export const version = "2.2.1";