@wavemaker-ai/app-ng-runtime 1.0.0-rc.312 → 1.0.0-rc.314

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.
@@ -2035,6 +2035,9 @@
2035
2035
  const child = node && node.children.find(e => (e instanceof compiler.Element && e.name === childName));
2036
2036
  return child;
2037
2037
  };
2038
+ const createElement = name => {
2039
+ return new compiler.Element(name, [], [], [], false, noSpan, noSpan, noSpan, false);
2040
+ };
2038
2041
  const getElementNode = (name, node) => {
2039
2042
  let elementNode;
2040
2043
  if (!node) {
@@ -2053,6 +2056,7 @@
2053
2056
  });
2054
2057
  return elementNode;
2055
2058
  };
2059
+ const noSpan = {};
2056
2060
  const idGen$9 = new core.IDGenerator('wm_page');
2057
2061
  transpiler.register('wm-page', () => {
2058
2062
  return {
@@ -2062,9 +2066,14 @@
2062
2066
  pageContentNode = getElementNode('wm-page-content', getElementNode('wm-content', node));
2063
2067
  }
2064
2068
  if (pageContentNode) {
2065
- // Wrap content in @if block with proper newlines to avoid template syntax errors
2066
- pageContentNode.children.unshift(new compiler.Text('@if (compilePageContent) {\n', null, undefined, undefined));
2067
- pageContentNode.children.push(new compiler.Text('\n{{onPageContentReady()}}\n}', null, undefined, undefined));
2069
+ const conditionalNode = createElement('ng-container');
2070
+ const ifOpenText = new compiler.Text('@if (compilePageContent) {', null, undefined, undefined);
2071
+ conditionalNode.children.push(ifOpenText);
2072
+ conditionalNode.children = conditionalNode.children.concat(pageContentNode.children);
2073
+ conditionalNode.children.push(new compiler.Text('{{onPageContentReady()}}', null, undefined, undefined));
2074
+ const ifCloseText = new compiler.Text('}', null, undefined, undefined);
2075
+ conditionalNode.children.push(ifCloseText);
2076
+ pageContentNode.children = [conditionalNode];
2068
2077
  }
2069
2078
  },
2070
2079
  pre: (attrs) => {
@@ -2036,6 +2036,9 @@ const findChild = (node, childName) => {
2036
2036
  const child = node && node.children.find(e => (e instanceof Element && e.name === childName));
2037
2037
  return child;
2038
2038
  };
2039
+ const createElement = name => {
2040
+ return new Element(name, [], [], [], false, noSpan, noSpan, noSpan, false);
2041
+ };
2039
2042
  const getElementNode = (name, node) => {
2040
2043
  let elementNode;
2041
2044
  if (!node) {
@@ -2064,9 +2067,14 @@ register('wm-page', () => {
2064
2067
  pageContentNode = getElementNode('wm-page-content', getElementNode('wm-content', node));
2065
2068
  }
2066
2069
  if (pageContentNode) {
2067
- // Wrap content in @if block with proper newlines to avoid template syntax errors
2068
- pageContentNode.children.unshift(new Text('@if (compilePageContent) {\n', null, undefined, undefined));
2069
- pageContentNode.children.push(new Text('\n{{onPageContentReady()}}\n}', null, undefined, undefined));
2070
+ const conditionalNode = createElement('ng-container');
2071
+ const ifOpenText = new Text('@if (compilePageContent) {', null, undefined, undefined);
2072
+ conditionalNode.children.push(ifOpenText);
2073
+ conditionalNode.children = conditionalNode.children.concat(pageContentNode.children);
2074
+ conditionalNode.children.push(new Text('{{onPageContentReady()}}', null, undefined, undefined));
2075
+ const ifCloseText = new Text('}', null, undefined, undefined);
2076
+ conditionalNode.children.push(ifCloseText);
2077
+ pageContentNode.children = [conditionalNode];
2070
2078
  }
2071
2079
  },
2072
2080
  pre: (attrs) => {