@wavemaker/angular-codegen 11.0.1-next.138732 → 11.0.1-next.138735

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.
@@ -44369,7 +44369,7 @@ register('wm-page-content', () => {
44369
44369
  return {
44370
44370
  template: (node) => {
44371
44371
  for (let attr of node.attrs) {
44372
- if (attr.name === 'spa' && attr.value) {
44372
+ if (attr.name === 'spa' && attr.value === 'true') {
44373
44373
  const conditionalNode = createElement$2('ng-container');
44374
44374
  addAtrribute$2(conditionalNode, '*ngIf', 'compilePageContent');
44375
44375
  conditionalNode.children = conditionalNode.children.concat(node.children);
@@ -44369,7 +44369,7 @@ register('wm-page-content', () => {
44369
44369
  return {
44370
44370
  template: (node) => {
44371
44371
  for (let attr of node.attrs) {
44372
- if (attr.name === 'spa' && attr.value) {
44372
+ if (attr.name === 'spa' && attr.value === 'true') {
44373
44373
  const conditionalNode = createElement$2('ng-container');
44374
44374
  addAtrribute$2(conditionalNode, '*ngIf', 'compilePageContent');
44375
44375
  conditionalNode.children = conditionalNode.children.concat(node.children);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/angular-codegen",
3
- "version": "11.0.1-next.138732",
3
+ "version": "11.0.1-next.138735",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1 +1 @@
1
- const{deleteResource:deleteResource,createDir:createDir,writeFile:writeFile,readFile:readFile,getPagesDirPath:getPagesDirPath,getLayoutsDirPath:getLayoutsDirPath}=require("./wm-utils"),{getPagesConfig:getPagesConfig}=require("./project-meta"),util=require("util"),cheerio=require("cheerio"),{safeString:safeString}=require("./handlebar-helpers"),{formatMarkup:formatMarkup}=require("./wm-utils"),path=require("path"),ncp=util.promisify(require("ncp").ncp),createIntermediateAppSkeleton=async(e,t)=>{await deleteResource(t),await createDir(t,{recursive:!0}),await ncp(e,t,{filter:t=>!path.relative(e,t).startsWith("target")})},generateLayoutsAndPages=async e=>{const t=getLayoutsDirPath(e);await createDir(t,{recursive:!0});const a=await getPagesConfig(e),r=getPagesDirPath(e),i=[],n=[];for(let e of a)if("PAGE"===e.type){const a=await readFile(`${r}/${e.name}/${e.name}.html`,"utf8"),o=cheerio.load(a),u=o("wm-page"),s=o("wm-page-content"),l=await getLayoutMarkup(o,u,s,i);l.markup&&(i.push({name:l.name,layoutInfo:l.layoutInfo}),n.push({name:l.name,type:"LAYOUT"}),await createDir(`${t}/${l.name}`,{recursive:!0}),await writeFile(`${t}/${l.name}/${l.name}.html`,l.markup)),e.layout=l.name,s.attr("spa","true"),s.attr("columnwidth","12"),s.attr(u.attr()),s.attr("layout",l.name);const g=formatMarkup(safeString(s.toString()).string);await writeFile(`${r}/${e.name}/${e.name}.html`,g)}await writeFile(`${r}/pages-config.json`,JSON.stringify(a)),await writeFile(`${t}/layouts-config.json`,JSON.stringify(n))},getLayoutMarkup=async(e,t,a,r)=>{const i=getLayoutInfo(e);let n=getLayoutName(i,r);if(n)return{name:n};{const o=r.length+1;n=`layout_${o}`,i.leftNav&&e("wm-left-panel").attr("spa","true");const u=e("<wm-router-outlet>");u.attr("columnwidth",a.attr().columnwidth),e("wm-page-content").replaceWith(u);const s=e("<wm-layout>");return s.attr("name",`layout${o}`),s.append(t.children()),{name:n,markup:formatMarkup(safeString(s.toString()).string),layoutInfo:i}}},getLayoutInfo=e=>{const t={header:e("wm-header"),topNav:e("wm-top-nav"),leftNav:e("wm-left-panel"),rightNav:e("wm-right-panel"),footer:e("wm-footer")},a={};for(const e in t)t.hasOwnProperty(e)&&t[e].length&&(a[e]=t[e].attr().content);return a},getLayoutName=(e,t)=>{for(const a of t)if(JSON.stringify(a.layoutInfo)===JSON.stringify(e))return a.name};module.exports={createIntermediateAppSkeleton:createIntermediateAppSkeleton,generateLayoutsAndPages:generateLayoutsAndPages};
1
+ const{deleteResource:deleteResource,createDir:createDir,writeFile:writeFile,readFile:readFile,getPagesDirPath:getPagesDirPath,getLayoutsDirPath:getLayoutsDirPath}=require("./wm-utils"),{getPagesConfig:getPagesConfig}=require("./project-meta"),util=require("util"),cheerio=require("cheerio"),{safeString:safeString}=require("./handlebar-helpers"),{formatMarkup:formatMarkup}=require("./wm-utils"),path=require("path"),ncp=util.promisify(require("ncp").ncp),createIntermediateAppSkeleton=async(e,t)=>{await deleteResource(t),await createDir(t,{recursive:!0}),await ncp(e,t,{filter:t=>!path.relative(e,t).startsWith("target")})},generateLayoutsAndPages=async e=>{const t=getLayoutsDirPath(e);await createDir(t,{recursive:!0});const a=await getPagesConfig(e),r=getPagesDirPath(e),i=[],n=[];for(let e of a)if("PAGE"===e.type){const a=await readFile(`${r}/${e.name}/${e.name}.html`,"utf8"),o=cheerio.load(a),l=o("wm-page"),u=o("wm-page-content");["wm-alertdialog","wm-confirmdialog","wm-dialog","wm-iframedialog","wm-pagedialog","wm-logindialog"].forEach(e=>{const t=o(e);t.length&&u.append(t)});const s=await getLayoutMarkup(o,l,u,i);s.markup&&(i.push({name:s.name,layoutInfo:s.layoutInfo}),n.push({name:s.name,type:"LAYOUT"}),await createDir(`${t}/${s.name}`,{recursive:!0}),await writeFile(`${t}/${s.name}/${s.name}.html`,s.markup)),e.layout=s.name,u.attr("spa","true"),u.attr("columnwidth","12"),u.attr(l.attr()),u.attr("layout",s.name);const g=formatMarkup(safeString(u.toString()).string);await writeFile(`${r}/${e.name}/${e.name}.html`,g)}await writeFile(`${r}/pages-config.json`,JSON.stringify(a)),await writeFile(`${t}/layouts-config.json`,JSON.stringify(n))},getLayoutMarkup=async(e,t,a,r)=>{const i=getLayoutInfo(e);let n=getLayoutName(i,r);if(n)return{name:n};{const o=r.length+1;n=`layout_${o}`,i.leftNav&&e("wm-left-panel").attr("spa","true");const l=e("<wm-router-outlet>");l.attr("columnwidth",a.attr().columnwidth),e("wm-page-content").replaceWith(l);const u=e("<wm-layout>");return u.attr("name",`layout${o}`),u.append(t.children()),{name:n,markup:formatMarkup(safeString(u.toString()).string),layoutInfo:i}}},getLayoutInfo=e=>{const t={header:e("wm-header"),topNav:e("wm-top-nav"),leftNav:e("wm-left-panel"),rightNav:e("wm-right-panel"),footer:e("wm-footer")},a={};for(const e in t)t.hasOwnProperty(e)&&t[e].length&&(a[e]=t[e].attr().content);return a},getLayoutName=(e,t)=>{for(const a of t)if(JSON.stringify(a.layoutInfo)===JSON.stringify(e))return a.name};module.exports={createIntermediateAppSkeleton:createIntermediateAppSkeleton,generateLayoutsAndPages:generateLayoutsAndPages};