@next-bricks/vb-experiment 0.1.14 → 0.1.15
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/bricks.json +1 -1
- package/dist/chunks/347.5cacbd58.js +2 -0
- package/dist/chunks/{347.5c0ae971.js.map → 347.5cacbd58.js.map} +1 -1
- package/dist/chunks/526.ba2b6d32.js +3 -0
- package/dist/chunks/{134.2149865a.js.map → 526.ba2b6d32.js.map} +1 -1
- package/dist/chunks/644.ea677bc4.js +2 -0
- package/dist/chunks/644.ea677bc4.js.map +1 -0
- package/dist/chunks/export-as-source-files.a9473897.js +2 -0
- package/dist/chunks/export-as-source-files.a9473897.js.map +1 -0
- package/dist/chunks/main.5fbf8fd5.js +2 -0
- package/dist/chunks/{main.9a0e46f7.js.map → main.5fbf8fd5.js.map} +1 -1
- package/dist/{index.f4abe5d7.js → index.2374cf7a.js} +2 -2
- package/dist/{index.f4abe5d7.js.map → index.2374cf7a.js.map} +1 -1
- package/package.json +3 -3
- package/dist/chunks/134.2149865a.js +0 -24
- package/dist/chunks/347.5c0ae971.js +0 -2
- package/dist/chunks/644.a5edc92b.js +0 -2
- package/dist/chunks/644.a5edc92b.js.map +0 -1
- package/dist/chunks/export-as-source-files.d194ee76.js +0 -2
- package/dist/chunks/export-as-source-files.d194ee76.js.map +0 -1
- package/dist/chunks/main.9a0e46f7.js +0 -2
- /package/dist/chunks/{134.2149865a.js.LICENSE.txt → 526.ba2b6d32.js.LICENSE.txt} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_next_bricks_vb_experiment=self.webpackChunk_next_bricks_vb_experiment||[]).push([[347],{1532:e=>{function n(e){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}n.keys=()=>[],n.resolve=n,n.id=1532,e.exports=n},5738:(e,n,t)=>{"use strict";function r(e){var n=[];for(var t of e)s(t,n);return n}function s(e,n){var{name:t,path:r,node:s,nodeType:o}=e,i=n,a=function(e){var n=i.find((n=>n.name===e&&"folder"===n.type));if(n)return i=n.items,"continue";var t={type:"folder",name:e,items:[]};i.push(t),i=t.items};for(var c of r)a(c);var l={type:"file",name:t,node:s,nodeType:o};i.push(l)}t.d(n,{B:()=>r})},4778:(e,n,t)=>{"use strict";t.d(n,{$w:()=>i,CS:()=>r,Vl:()=>o,h8:()=>a,z1:()=>s});var r=["context","exact","path","slot"],s=["id","ref","slot"],o=["proxy","state","name"],i="default:",a=new Set(["break","case","catch","class","continue","const","constructor","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","get","if","import","in","instanceof","let","new","null","return","set","static","super","switch","symbol","this","throw","true","try","typeof","undefined","var","void","while","with","yield","async","await","of"])},9333:(e,n,t)=>{"use strict";t.d(n,{Ao:()=>p,I$:()=>d,LK:()=>m,Pu:()=>u});var r=t(4876),s=t(2159),o=t(2019),i=["routes"],a=["bricks"],c=["slots"],l={properties:["ref","refProperty","extraOneWayRefs","refTransform","mergeType","mergeMethod","mergeArgs","mergeProperty","asVariable"],slots:["ref","refSlot","refPosition"],events:["ref","refEvent"],methods:["ref","refMethod"]},p="--".concat(Math.floor(1e16*Math.random()).toString(36),"--:"),u=new RegExp('"'.concat(p,'((?:[-\\w]+/)*[-\\w]+)"'),"g");function f(e,n){return"".concat(p).concat(e).concat(e?"/":"").concat(n)}function d(e,n,t){return e.map((e=>function(e,n,t){var o,c=[...n,"views"],l=v("route",e.alias,c,t.namePool);g(t.namePool,[...c,l],l),function(e){delete e.alias,delete e.iid,delete e.deviceOwner,delete e.analyticsData,""===e.menu&&delete e.menu,E(e,["redirect","exact"]),"bricks"===e.type&&delete e.type}(e);var p=[...c,l];if("redirect"===e.type)o=e;else if("routes"===e.type){var{routes:u}=e,m=(0,s.Z)(e,i);o=(0,r.Z)((0,r.Z)({},m),{},{children:d(u,n,t)})}else{var{bricks:h}=e,j=(m=(0,s.Z)(e,a),y(h,p,t));t.extracts.push({name:l,path:p,node:j,nodeType:"bricks"}),o=(0,r.Z)((0,r.Z)({},m),{},{view:f("views/".concat(l),l)})}var b=x("context",e.context,l,p,t);return(0,r.Z)((0,r.Z)({},o),{},{context:b})}(e,n,t)))}function m(e,n,t){return e.map((e=>function(e,n,t){if(!e.name.startsWith("tpl-"))throw new Error('Invalid template name: "'.concat(e.name,'"'));var s=e.name.substring(4),i=[...n,s],a=y(e.bricks,i,t),c=x("state",e.state,s,i,t),p=function(e,n,t){if((0,o.isObject)(e)&&Object.keys(e).length>0){var r=v("proxy","proxy",n,t.namePool);return function(e){for(var[n,t]of Object.entries(e))switch(n){case"properties":case"events":case"slots":case"methods":if((0,o.isObject)(t))for(var[r,s]of Object.entries(t))if((0,o.isObject)(s)){var i=Object.keys(s);for(var a of i)l[n].includes(a)||delete s[a];0===i.length&&delete t[r]}break;default:delete e[n]}}(e),t.extracts.push({name:r,path:n,node:e,nodeType:"plain"}),f("",r)}return e}(e.proxy,i,t);return t.extracts.push({name:s,path:i,node:(0,r.Z)((0,r.Z)({},e),{},{bricks:a,state:c,proxy:p}),nodeType:"template"}),f(s,s)}(e,n,t)))}function x(e,n,t,r,s){if(Array.isArray(n)&&n.length>0){for(var o of n)k(o);var i=v(e,e,r,s.namePool);return s.extracts.push({name:i,path:r,node:n,nodeType:"context"}),f("context"===e?"views/".concat(t):"",i)}}function v(e,n,t,r){var s=null==n?void 0:n.toLowerCase();"index"==s&&(s="".concat(s,"_2"));var o=h(r,t),i="route"!==e||"string"==typeof s&&/^[-\w]+$/.test(s)&&"index"!==s;if(!i||o.has(s)){for(var a,c=i?s:e,l=2;o.has(a="".concat(c,"_").concat(l));)l++;s=a}return o.add(s),s}function g(e,n,t){h(e,n).add(t)}function h(e,n){var t=n.join("/"),r=e.get(t);return r||e.set(t,r=new Set),r}function y(e,n,t){return Array.isArray(e)?e.map((e=>j(e,n,t))):e}function j(e,n,t){var i;"string"==typeof e.alias&&/^<[-\w]+>$/.test(e.alias)&&"<index>"!==e.alias&&(i=e.alias.slice(1,-1)),function(e){if("string"==typeof e.properties){var n='The `properties` of brick cannot be a string, received: "'.concat(e.properties,'"');throw console.error("".concat(n,". Check your brick:"),e),new Error(n)}delete e.alias,delete e.iid,delete e.deviceOwner,e.events&&0===Object.keys(e.events).length&&delete e.events,e.lifeCycle&&0===Object.keys(e.lifeCycle).length&&delete e.lifeCycle,E(e,["bg","portal"])}(e),i&&(i=v("brick",i,n,t.namePool),g(t.namePool,[...n,i],i));var a=e,{slots:l}=a,p=(0,s.Z)(a,c),u=[],m=[...n,...i?[i]:[]];if((0,o.isObject)(l)){var x=function(e){if("routes"===j.type){var s,o=d((null!==(s=j.routes)&&void 0!==s?s:[]).map((n=>(0,r.Z)((0,r.Z)({},n),{},{_isRoute:!0,slot:e}))),n,t);u.push(...o)}else{var i,a=y((null!==(i=j.bricks)&&void 0!==i?i:[]).map((n=>(0,r.Z)((0,r.Z)({},n),{},{slot:e}))),m,t);u.push(...a)}};for(var[h,j]of Object.entries(l))x(h)}return(0,o.isObject)(p.properties)&&!Array.isArray(p.properties)&&(p.properties=b(p.properties,m,t)),p.children=u,i?(t.extracts.push({name:i,node:p,path:[...n,i],nodeType:"bricks"}),f(i,i)):p}function b(e,n,t){return Object.fromEntries(Object.entries(e).map((e=>{var[r,s]=e;return[r,_(s,r,n,t)]})))}function _(e,n,t,r){return"useBrick"===n?Array.isArray(e)?y(e,t,r):(0,o.isObject)(e)?j(e,t,r):e:Array.isArray(e)?e.map(((e,n)=>_(e,n,t,r))):(0,o.isObject)(e)?b(e,t,r):e}function k(e){delete e.path,delete e.relatedId,delete e.doc}function E(e,n){for(var t of n)e[t]||delete e[t]}},5794:(e,n,t)=>{"use strict";t.d(n,{R:()=>T});var r=t(4876),s=t(2159),o=t(1483),i=t(4778);function a(e,n,t){var r=e.get(n);r||(r=new Set,e.set(n,r)),r.add(t)}function c(e){return[...e].sort(((e,n)=>Number(e[0].startsWith("."))-Number(n[0].startsWith(".")))).map((e=>{var[n,t]=e,r=[...t];return 1===r.length&&r[0].startsWith(i.$w)?"import ".concat(r[0].substring(i.$w.length),' from "').concat(n,'";'):"import { ".concat(r.join(", "),' } from "').concat(n,'";')}))}var l=t(2019),p=t(9333),u=t(7243),f="transform-pipeline-operator-minimal";(0,u.registerPlugin)(f,(()=>({name:f,inherits:u.availablePlugins["syntax-pipeline-operator"],visitor:{BinaryExpression(e){var{node:n}=e,{operator:t,left:r,right:s}=n;if("|>"===t){var i=o.callExpression(s,[r]);e.replaceWith(i)}}}})));const d=f;var m=t(5541);function x(e,n,t){if(/^\s*<%[~=]?\s/.test(e)&&/\s%>\s*$/.test(e))try{var r,s="",i=e.replace(/^\s*<%([~=])?\s|\s%>\s*$/g,((e,n)=>(n&&(s=n),""))),c="="===s,l="~"===s,p=new Set,f=(0,u.transform)("(".concat(i,")"),{ast:!0,code:!1,plugins:[[d,{proposal:"minimal"}],[m.Z,{imports:p}]]}).ast.program.body[0].expression;for(var x of("SequenceExpression"!==f.type||"StringLiteral"!==(r=f.expressions[0]).type||"track context"!==r.value&&"track state"!==r.value||c||(c=!0,f=f.expressions.length>2?o.sequenceExpression(f.expressions.slice(1)):f.expressions[1]),!c||p.has("STATE")||p.has("CTX")||(c=!1),p))if("FN"===x){for(var v=["resources","functions","index.js"],g=0,h=0;h<v.length&&h<t.length&&(g=h,t[h]===v[h]);h++);a(n,"".concat(1===t.length?".":new Array(t.length-1-g).fill("..").join("/"),"/").concat(v.slice(g).join("/")),"default:FN")}else a(n,"next-jsx/runtime",x);return l&&(a(n,"next-jsx/runtime","recursive"),f=o.callExpression(o.identifier("recursive"),[f])),c&&(a(n,"next-jsx/runtime","bind"),f=o.callExpression(o.identifier("bind"),[f])),f}catch(n){console.warn("Parse expression failed:",e,n)}return null}function v(e,n,t,r,s){var i;return null!==(i=g(e,n,t,r,s))&&void 0!==i?i:o.nullLiteral()}function g(e,n,t,r,s){if(r&&"useBrick"===s){if(Array.isArray(e))return A(e,n,t);if((0,l.isObject)(e))return O(e,n,t)}if(Array.isArray(e))return o.arrayExpression(e.map((e=>g(e,n,t,r))));if("function"==typeof e)return null;if((0,l.isObject)(e))return o.objectExpression(Object.entries(e).map((e=>{var[s,i]=e,a=g(i,n,t,r,s);return null!==a?o.objectProperty(o.stringLiteral(s),a):null})).filter(Boolean));if("string"==typeof e){var i=x(e,n,t);return null!=i?i:o.stringLiteral(e)}return"number"==typeof e?o.numericLiteral(e):"boolean"==typeof e?o.booleanLiteral(e):null===e?o.nullLiteral():null}function h(e,n,t,r,s,i){var a=[],c=[];for(var[u,f]of Object.entries(e))void 0!==f&&(/^[_$a-zA-Z][$\w]*$/.test(u)?a.push([u,f]):c.push(o.objectProperty(o.stringLiteral(s?"".concat(s,":").concat(u):u),v(f,n,t))));var d,m=(r?a.sort((d=r,function(e,n){return d.indexOf(n[0])-d.indexOf(e[0])})):a).map((e=>{var[r,a]=e,c=function(e,n,t,r){if("string"==typeof e){var s=x(e,n,t);if(s)return o.jsxExpressionContainer(s);var i=o.stringLiteral(e);return e.includes(p.Ao)||JSON.stringify(e).includes("\\")?o.jsxExpressionContainer(i):i}if(!0===e)return null;if("useBrick"===r){if(Array.isArray(e))return y(A(e,n,t));if((0,l.isObject)(e))return y(O(e,n,t))}var a=v(e,n,t,!0);return o.jsxExpressionContainer(a)}(a,n,t,i?r:void 0);return o.jsxAttribute(s?o.jsxNamespacedName(o.jsxIdentifier(s),o.jsxIdentifier(r)):o.jsxIdentifier(r),c)}));return c.length>0&&m.push(o.jsxSpreadAttribute(o.objectExpression(c))),m}function y(e){return"StringLiteral"!==e.type?o.jsxExpressionContainer(e):e}var j=["children","slot","_isRoute"];function b(e,n,t){a(n,"next-jsx","Route");var{children:c,slot:l,_isRoute:p}=e,u=(0,s.Z)(e,j),f=null!=c?c:[],d=""===l?void 0:l,m=0===f.length;return o.jsxElement(o.jsxOpeningElement(o.jsxIdentifier("Route"),h((0,r.Z)((0,r.Z)({},u),{},{slot:d}),n,t,i.CS),m),m?null:o.jsxClosingElement(o.jsxIdentifier("Route")),f.map((e=>b(e,n,t))),m)}function _(e){return"StringLiteral"===e.type?o.jsxExpressionContainer(e):e}var k=["brick","children","properties","events","lifeCycle","if","portal","ref","slot"],E=["textContent","children","events","lifeCycle","if","ref"],w=["children"];function A(e,n,t){var r=e.map((e=>O(e,n,t)));return 1===r.length?r[0]:o.jsxFragment(o.jsxOpeningFragment(),o.jsxClosingFragment(),r.map(_))}function O(e,n,t){if("string"==typeof e)return o.stringLiteral(e);if(e.template)return function(e,n,t){a(n,"next-jsx","LegacyTemplate");var{children:r}=e,i=(0,s.Z)(e,w);return o.jsxElement(o.jsxOpeningElement(o.jsxIdentifier("LegacyTemplate"),h(i,n,t),!0),null,[],!0)}(e,n,t);var{brick:c,children:l,properties:p,events:u,lifeCycle:f,if:d,portal:m,ref:x,slot:v}=e,g=(0,s.Z)(e,k);if("string"==typeof c){var y,j,A=!0;switch(c){case":forEach":case":if":case":switch":y="".concat(c[1].toUpperCase()).concat(c.substring(2)),a(n,"next-jsx",y);break;default:A=!1,y=c.replaceAll(".","_")}A&&(j=g.dataSource,delete g.dataSource);var S=""===v?void 0:v,C=null!=p?p:{},{textContent:T,children:I,events:R,lifeCycle:L,if:Z,ref:F}=C,M=(0,s.Z)(C,E),N="string"==typeof T,D=0===l.length&&!N;l.length>0&&N&&console.warn("Invalid brick: mix slotted children and textContent:",e);var $,B=o.jsxOpeningElement(o.jsxIdentifier(y),[...h((0,r.Z)((0,r.Z)({},M),{},{slot:S,events:u,lifeCycle:f,if:!0===d?void 0:d,portal:m,ref:x},A?{value:j}:null),n,t,i.z1,void 0,!0),...h({children:I,events:R,lifeCycle:L,if:Z,ref:F},n,t,void 0,"prop"),...h(g,n,t,void 0,"conf")],D),U=D?null:o.jsxClosingElement(o.jsxIdentifier(y));return $=D?[]:l.length>0?l.map((e=>"string"!=typeof e&&e._isRoute?b(e,n,t):_(O(e,n,t)))):[P(T,n,t)],o.jsxElement(B,U,$,D)}throw new Error("Unexpected brick node: ".concat(JSON.stringify(e)))}function P(e,n,t){var r=x(e,n,t);return r?o.jsxExpressionContainer(r):/[{}<>]|&(?:[a-zA-Z0-9]+|#\d+|#x[\da-fA-F]+);/.test(e)?o.jsxExpressionContainer(o.stringLiteral(e)):o.jsxText(e)}function S(e,n){var t=o.exportDefaultDeclaration(e),{code:r}=(0,u.transformFromAst)(o.program([t],void 0,"module"),void 0,{generatorOpts:{jsescOption:{minimal:!0}},cloneInputAst:!1}),s=function(e){var n=new Set;for(var t of e.values())for(var r of t)n.add(r.startsWith(i.$w)?r.substring(i.$w.length):/\s+as\s+/.test(r)?r.split(/\s+as\s+/)[1]:r);return n}(n),a=c(n),l=r.replace(p.Pu,((e,n)=>{for(var t=n.split("/"),r=t[t.length-1],o=("context"===r&&3===t.length&&"views"===t[0]?"".concat(t[t.length-2],"_").concat(r):r).replaceAll("-","_").replace(/^(\d)/,"_$1"),c=2,l=o;s.has(l)||i.h8.has(l);)l="".concat(o,"_").concat(c++);return s.add(l),a.push("import ".concat(l,' from "./').concat(n,'.js";')),l}));return a.length>0?"".concat(a.join("\n"),"\n\n").concat(l):r}function C(e){return"export default ".concat(JSON.stringify(e),";")}function T(e,n,t){switch(n){case"routes":return function(e,n){var t=new Map;return S(o.jsxFragment(o.jsxOpeningFragment(),o.jsxClosingFragment(),e.map((e=>b(e,t,n)))),t)}(e,t);case"bricks":return function(e,n){var t=new Map;return S(Array.isArray(e)?A(e,t,n):O(e,t,n),t)}(e,t);case"template":return function(e,n){var t=new Map;a(t,"next-jsx","Component");var{bricks:r,name:s,state:c,proxy:l}=e;return S(o.jsxElement(o.jsxOpeningElement(o.jsxIdentifier("Component"),h({name:s,state:c,proxy:l},t,n,i.Vl)),o.jsxClosingElement(o.jsxIdentifier("Component")),(null!=r?r:[]).map((e=>_(O(e,t,n))))),t)}(e,t);case"context":case"menu":return function(e,n){var t=new Map,r=o.exportDefaultDeclaration(v(e,t,n)),s=o.program([r],void 0,"module"),i=c(t),a=(0,u.transformFromAst)(s,void 0,{generatorOpts:{jsescOption:{minimal:!0}},cloneInputAst:!1}).code;return i.length>0?"".concat(i.join("\n"),"\n\n").concat(a):a}(e,t);case"plain":return C(e);case"others":return function(e){var n=C(e),t=new Set,r=[];return n=n.replace(p.Pu,((e,n)=>{for(var s=n.split("/"),o=s[s.length-1].replaceAll("-","_").replace(/^(\d)/,"_$1"),i=2,a=o;t.has(a);)a="".concat(o,"_").concat(i++);return t.add(a),r.push("import ".concat(a,' from "./').concat(n,'.js";')),a})),r.length>0&&(n="".concat(r.join("\n"),"\n\n").concat(n)),n}(e);default:throw new Error("Unknown node type: ".concat(n))}}},5541:(e,n,t)=>{"use strict";t.d(n,{Z:()=>i}),t(1483);var r=t(7243),s=(t(2019),new Set(["_","location","moment","ANCHOR","APP","BASE_URL","CTX","DATA","EVENT","FLAGS","FN","HASH","I18N_TEXT","I18N","IMG","INSTALLED_APPS","ITEM","LOCAL_STORAGE","MEDIA","MISC","PARAMS","PATH_NAME","PATH","PERMISSIONS","PIPES","PROCESSORS","QUERY_ARRAY","QUERY","SESSION_STORAGE","STATE","SYS","THEME","TAG_URL","SAFE_TAG_URL"])),o="smart-imports";(0,r.registerPlugin)(o,((e,n)=>({name:o,visitor:{Identifier(e){var{node:t,scope:r,key:o,parent:i}=e,{name:a}=t;!r.hasGlobal(a)||"undefined"===a||"key"===o&&"ObjectProperty"===i.type&&!i.computed||"property"===o&&"MemberExpression"===i.type&&!i.computed||s.has(a)&&(null==n||n.imports.add(a))}}})));const i=o},1853:(e,n,t)=>{"use strict";t.d(n,{Z:()=>i});var r=t(1483),s=t(7243),o="transform-storyboard-function";(0,s.registerPlugin)(o,(()=>({name:o,visitor:{FunctionDeclaration(e){"Program"===e.parent.type&&e.replaceWith(r.exportDefaultDeclaration(e.node))},TSDeclareFunction(e){"Program"===e.parent.type&&e.replaceWith(r.exportDefaultDeclaration(e.node))}}})));const i=o},7287:e=>{"use strict";e.exports="root = true\n\n[*]\nindent_style = space\nindent_size = 2\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n"},2524:e=>{"use strict";e.exports="node_modules\n/dist\n/temp\n"},3870:e=>{"use strict";e.exports="# __PROJECT_NAME__\n\n## 准备\n\n```bash\nyarn\n```\n\n## 开发\n\n打开两个终端,分别运行 `yarn start` 和 `yarn serve`。\n\n然后浏览器打开 http://localhost:8081__PROJECT_HOMEPAGE__\n\n提示:\n- 运行 `yarn serve` 时按需使用 `--subdir` 和 `--server` 等参数。\n- 也可以选择只使用一个终端运行 `yarn dev`,此时需要把 `yarn serve` 相关的参数定义在 `package.json` 文件中。\n\n## 离线开发\n\n修改 `dev.config.mjs`,取消注释 `mock` 一节的代码,参考对 `GET /api/auth/login` 接口,对其他远端接口进行 mock。\n"},3626:e=>{"use strict";e.exports='declare namespace JSX {\n interface IntrinsicElements {\n "basic-bricks_general-button": BrickProps & {\n buttonName?: string;\n buttonType?: string;\n };\n\n "basic-bricks_micro-view": BrickProps & {\n pageTitle?: string;\n };\n\n "forms_general-input": FormItemProps;\n "forms_general-select": FormItemProps;\n "forms_general-textarea": FormItemProps;\n "forms_general-checkbox": FormItemProps;\n "forms_general-radio": FormItemProps;\n "forms_general-switch": FormItemProps;\n }\n\n interface BrickProps {\n // HTML properties:\n id?: string;\n slot?: string;\n title?: string;\n className?: string;\n style?: import("csstype").Properties;\n\n // Brick configurations:\n ref?: string;\n if?: unknown;\n portal?: unknown;\n events?: import("@next-core/types").BrickEventsMap;\n lifeCycle?: import("@next-core/types").BrickLifeCycle;\n\n // JSX\n children?: any;\n }\n\n interface FormItemProps extends BrickProps {\n name?: string;\n label?: string;\n placeholder?: string;\n value?: unknown\n }\n}\n'},8223:e=>{"use strict";e.exports='// @ts-check\n/** @typedef {import("express").RequestHandler} Mock */\n/** @typedef {{ featureFlags?: Record<string, boolean>; misc?: Record<string, unknown>; [k: string]: unknown; }} Settings */\n/** @type {{ brickFolders?: string[]; mocks?: Mock[]; settings?: Settings }} */\nexport default {\n brickFolders: [\n "./bricks",\n ],\n // NOTE: Uncomment these lines below to enable local mocks:\n // mocks: [\n // (req, res, next) => {\n // switch (`${req.method} ${req.path}`) {\n // case "GET /api/auth/login":\n // res.send({\n // code: 0,\n // data: {\n // loggedIn: true,\n // username: "mock_user",\n // },\n // });\n // return;\n // }\n //\n // next();\n // }\n // ],\n}\n'},4450:e=>{"use strict";e.exports='{\n "compilerOptions": {\n "moduleResolution": "node16"\n },\n "include": ["./src", "./declarations.d.ts"]\n}\n'},3239:e=>{"use strict";e.exports='export default {\n appId: "__APP_ID__"\n};\n'},7040:e=>{"use strict";e.exports='{\n "name": "__APP_ID__",\n "private": true,\n "type": "module",\n "scripts": {\n "dev": "run-p start serve",\n "start": "next-jsx-start",\n "serve": "brick-container-serve --local-micro-apps=\\"__APP_ID__\\" --live-reload"\n },\n "engines": {\n "node": ">=16"\n },\n "devDependencies": {\n "@next-core/brick-container": "^3.5.15",\n "@next-core/types": "^1.6.0",\n "next-jsx": "^0.1.2",\n "npm-run-all": "^4.1.5",\n "csstype": "^3.1.2"\n }\n}\n'},9602:e=>{"use strict";e.exports='import app from "./app.js";\nimport routes from "./routes.js";\nimport components from "./components/index.js";\nimport resources from "./resources/index.js";\n\nexport default {\n app,\n routes,\n components,\n resources,\n};\n'},5125:e=>{"use strict";e.exports='import functions from "./functions/index.js";\nimport menus from "./menus/index.js";\nimport contracts from "./contracts/index.js";\nimport i18n from "./i18n/index.js";\nimport meta from "./meta.js";\n\nexport default {\n functions,\n menus,\n contracts,\n i18n,\n meta,\n};\n'}}]);
|
|
2
|
-
//# sourceMappingURL=347.5c0ae971.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_next_bricks_vb_experiment=self.webpackChunk_next_bricks_vb_experiment||[]).push([[644],{1644:(e,n,t)=>{t.r(n);var a=t(4795),o=t(2019),r=t(1297),i=t.n(r),c=t(6782),s=t(9691),l=t(8483),p=t.n(l),f=t(7243),d=t(9333),u=t(5738),m=t(5794),x=t(5125),h=t(9602),j=t(7287),v=t(2524),g=t(3626),y=t(8223),_=t(4450),b=t(3239),k=t(7040),A=t(3870),w=t(4778),S=t(1853),E=t(5541);function I(){return(I=(0,a.Z)((function*(e){var n,t,a,o,r,s,{projectDetail:l,storyboard:p}=e,I=new(i()),P=I.folder("project"),J=P.folder("src"),C={extracts:[],namePool:new Map},R=(0,d.I$)(p.routes,[],C),F={id:l.appId,name:l.name,homepage:l.appSetting.homepage,layoutType:l.appSetting.layoutType,theme:l.appSetting.theme,noAuthGuard:l.appSetting.noAuthGuard,locales:l.appSetting.locales,defaultConfig:JSON.parse(l.appSetting.defaultConfig||"{}"),menuIcon:JSON.parse(l.appSetting.icon||"null"),standaloneMode:!0};J.file("app.js",N("export default ".concat(JSON.stringify(F,null,2),";")));var M=null!==(n=p.meta)&&void 0!==n?n:{},D=null!==(t=M.customTemplates)&&void 0!==t?t:[],G=null!==(a=M.functions)&&void 0!==a?a:[],U=null!==(o=M.menus)&&void 0!==o?o:[],Z=null!==(r=M.contracts)&&void 0!==r?r:[],z=null!==(s=M.i18n)&&void 0!==s?s:{};delete M.customTemplates,delete M.functions,delete M.menus,delete M.contracts,delete M.i18n,delete M.workflows,delete M.mocks,delete M.userGroups;var W=(0,d.LK)(D,["components"],C);C.extracts.push({name:"index",path:["components"],node:W,nodeType:"others"});var B=(0,u.B)(C.extracts);J.file("index.js",h),J.file("routes.jsx",N((0,m.R)(R,"routes",["routes.jsx"])));var H=J.folder("resources"),K=H.folder("functions"),L=[],$=[];for(var q of G){if("index"===q.name)throw new Error('Unexpected function name: "index"');var Q=new Set,{code:V}=(0,f.transform)(q.source,{filename:"expr.".concat(q.typescript?"ts":"js"),plugins:[...q.typescript?["syntax-typescript"]:[],S.Z,[E.Z,{imports:Q}]]}),X=Q.has("FN");X&&Q.delete("FN");var Y=[];Q.size>0&&Y.push("import { ".concat([...Q].join(", "),' } from "next-jsx/runtime";')),X&&Y.push('import FN from "./index.js";'),Y.length>0&&(V="".concat(Y.join("\n"),"\n\n").concat(V)),K.file("".concat(q.name,".").concat(q.typescript?"ts":"js"),V),$.push("import ".concat(q.name,' from "./').concat(q.name,'.js";')),L.push(q.name)}K.file("index.js",N("".concat($.join("\n"),"\n\nconst FN = { ").concat(L.join(",")," };\n\nexport default FN;")));var ee=H.folder("menus"),ne=[],te=[];for(var ae of U){if(T(ae),"index"===ae.menuId)throw new Error('Unexpected menu id: "index"');var oe="".concat(ae.menuId,".js");ee.file(oe,N((0,m.R)(ae,"menu",["resources","menus",oe])));var re=ae.menuId.replace(/^\d+|[^\w]+/g,"_");w.h8.has(re)&&(re="".concat(re,"__2")),te.push("import ".concat(re,' from "./').concat(oe,'";')),ne.push(re)}ee.file("index.js",N("".concat(te.join("\n"),"\n\nexport default [").concat(ne.join(","),"]")));var ie=H.folder("contracts"),ce=[],se=[];for(var le of Z){if("index"===le.name)throw new Error('Unexpected contract name: "index"');ie.file("".concat(le.name,".js"),N("export default ".concat(JSON.stringify(le),";")));var pe=le.name.replace(/^\d+|[^\w]+/g,"_");se.push("import ".concat(pe,' from "./').concat(le.name,'.js";')),ce.push(pe)}ie.file("index.js",N("".concat(se.join("\n"),"\n\nexport default [").concat(ce.join(","),"]"))),H.folder("i18n").file("index.js",N("export default ".concat(JSON.stringify(z),";"))),H.file("meta.js",N("export default ".concat(JSON.stringify(M,null,2),";"))),H.file("index.js",x),O(B,J,[]),P.folder("mock-micro-apps").folder(l.appId).file(".gitignore","*\n!.gitignore"),P.file(".editorconfig",j),P.file(".gitignore",v),P.file("dev.config.mjs",y),P.file("declarations.d.ts",g),P.file("jsconfig.json",_),P.file("next-jsx.config.js",b.replaceAll("__APP_ID__",l.appId)),P.file("package.json",k.replaceAll("__APP_ID__",l.appId)),P.file("README.md",A.replaceAll("__PROJECT_NAME__",l.name).replaceAll("__PROJECT_HOMEPAGE__",l.appSetting.homepage));var fe=yield I.generateAsync({type:"blob"});(0,c.saveAs)(fe,"project.zip")}))).apply(this,arguments)}function N(e){var{typescript:n,semi:t=!0,printWidth:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,s.format)(e,{parser:n?"babel-ts":"babel",plugins:[p()],semi:t,printWidth:a})}function O(e,n,t){for(var a of e){var o=[...t,a.name];if("folder"===a.type){var r=n.folder(a.name);O(a.items,r,o)}else n.file("".concat(a.name,".js").concat("routes"===a.nodeType||"bricks"===a.nodeType||"template"===a.nodeType?"x":""),N((0,m.R)(a.node,a.nodeType,o)))}}function T(e){for(var[n,t]of Object.entries(e))switch(n){case"items":if(Array.isArray(t))for(var a of t)P(a);break;case"type":"main"===t&&delete e[n];break;case"if":break;case"i18n":0===Object.keys(t).length&&delete e[n];break;default:null!==t&&!1!==t||delete e[n]}}function P(e){for(var[n,t]of Object.entries(e))switch(n){case"children":Array.isArray(t)&&t.length>0&&P(t);break;case"if":break;case"activeExcludes":case"activeIncludes":Array.isArray(t)&&0===t.length&&delete e[n];break;default:null!==t&&!1!==t||delete e[n]}}customElements.define("vb-experiment.export-as-source-files",(0,o.createProviderClass)((function(e){return I.apply(this,arguments)})))}}]);
|
|
2
|
-
//# sourceMappingURL=644.a5edc92b.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunks/644.a5edc92b.js","mappings":"0YA2QC,SAAAA,IAAA,OAAAA,GAAAC,EAAAA,EAAAA,IAzNM,UAAAC,GAGqC,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GAHF,cACxCC,EAAa,WACbC,GACyBR,EACnBS,EAAM,IAAIC,KACVC,EAAUF,EAAIG,OAAO,WACrBC,EAAMF,EAAQC,OAAO,OAErBE,EAA6B,CACjCC,SAAU,GACVC,SAAU,IAAIC,KAEVC,GAAkBC,EAAAA,EAAAA,IAAcX,EAAWY,OAAQ,GAAIN,GAEvDO,EAA0C,CAC9CC,GAAIf,EAAcgB,MAClBC,KAAMjB,EAAciB,KACpBC,SAAUlB,EAAcmB,WAAWD,SACnCE,WAAYpB,EAAcmB,WAAWC,WACrCC,MAAOrB,EAAcmB,WA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QoC,GACN,IAAK,QACH,GAAII,MAAMC,QAAQJ,GAChB,IAAK,IAAMJ,KAAQI,EACjBK,EAAcT,GAGlB,MACF,IAAK,OACW,SAAVI,UACKrC,EAAKoC,GAEd,MACF,IAAK,KACH,MACF,IAAK,OAC+B,IAA9BE,OAAOK,KAAKN,GAAOzC,eACdI,EAAKoC,GAEd,MACF,QACgB,OAAVC,IAA4B,IAAVA,UACbrC,EAAKoC,GAItB,CAEA,SAASM,EAAcE,GACrB,IAAK,IAAOR,EAAKC,KAAUC,OAAOC,QAAQK,GACxC,OAAQR,GACN,IAAK,WACCI,MAAMC,QAAQJ,IAAUA,EAAMzC,OAAS,GACzC8C,EAAcL,GAEhB,MACF,IAAK,KACH,MACF,IAAK,iBACL,IAAK,iBACCG,MAAMC,QAAQJ,IAA2B,IAAjBA,EAAMzC,eACzBgD,EAASR,GAElB,MACF,QACgB,OAAVC,IAA4B,IAAVA,UACbO,EAASR,GAI1B,CAEAS,eAAeC,OACb,wCACAC,EAAAA,EAAAA,sBA9TK,SAAkCC,GAAA,OAAAzI,EAAAiH,MAAC,KAADC,UAAA,I","sources":["webpack:///./src/data-providers/export-as-source-files.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport type { Storyboard, MicroApp, StoryboardMeta } from \"@next-core/types\";\nimport { createProviderClass } from \"@next-core/utils/general\";\nimport JSZip from \"jszip\";\nimport { saveAs } from \"file-saver\";\nimport { format } from \"prettier/standalone.js\";\nimport parserBabel from \"prettier/parser-babel.js\";\nimport { transform } from \"@babel/standalone\";\nimport {\n ExtractState,\n extractRoutes,\n extractTemplates,\n} from \"./utils/extract.js\";\nimport {\n SourceFileOrFolder,\n buildFileStructure,\n} from \"./utils/buildFileStructure.js\";\nimport { generate } from \"./utils/generators/generate.js\";\nimport srcResourcesIndexJs from \"./raws/src/resources/index.js.txt\";\nimport srcIndexJs from \"./raws/src/index.js.txt\";\nimport editorConfig from \"./raws/.editorconfig.txt\";\nimport gitIgnore from \"./raws/.gitignore.txt\";\nimport declarationsDTs from \"./raws/declarations.d.ts.txt\";\nimport devConfigMjs from \"./raws/dev.config.mjs.txt\";\nimport jsconfigJson from \"./raws/jsconfig.json.txt\";\nimport nextJsxConfigJs from \"./raws/next-jsx.config.js.txt\";\nimport packageJson from \"./raws/package.json.txt\";\nimport readmeMd from \"./raws/README.md.txt\";\nimport { JS_RESERVED_WORDS } from \"./utils/constants.js\";\nimport TransformStoryboardFunction from \"./utils/plugins/storyboard-function.js\";\nimport SmartImports from \"./utils/plugins/smart-imports.js\";\n\nexport interface StoryboardAssemblyResult {\n storyboard: Storyboard;\n\n projectDetail: {\n appId: string;\n name: string;\n appSetting: Pick<\n MicroApp,\n \"homepage\" | \"theme\" | \"locales\" | \"noAuthGuard\"\n > & {\n layoutType?: string;\n defaultConfig?: string;\n icon?: string;\n };\n brickNextVersion?: number;\n };\n}\n\nexport async function exportAsSourceFiles({\n projectDetail,\n storyboard,\n}: StoryboardAssemblyResult): Promise<void> {\n const zip = new JSZip();\n const project = zip.folder(\"project\")!;\n const src = project.folder(\"src\")!;\n\n const extractState: ExtractState = {\n extracts: [],\n namePool: new Map(),\n };\n const extractedRoutes = extractRoutes(storyboard.routes, [], extractState);\n\n const app: MicroApp & { layoutType?: string } = {\n id: projectDetail.appId,\n name: projectDetail.name,\n homepage: projectDetail.appSetting.homepage,\n layoutType: projectDetail.appSetting.layoutType,\n theme: projectDetail.appSetting.theme,\n noAuthGuard: projectDetail.appSetting.noAuthGuard,\n locales: projectDetail.appSetting.locales,\n defaultConfig: JSON.parse(projectDetail.appSetting.defaultConfig || \"{}\"),\n menuIcon: JSON.parse(projectDetail.appSetting.icon || \"null\"),\n standaloneMode: true,\n };\n src.file(\n \"app.js\",\n formatJs(`export default ${JSON.stringify(app, null, 2)};`)\n );\n\n const meta = (storyboard.meta ?? {}) as StoryboardMeta & {\n workflows?: unknown;\n userGroups?: unknown;\n };\n const customTemplates = meta.customTemplates ?? [];\n const functions = meta.functions ?? [];\n const menus = meta.menus ?? [];\n const contracts = meta.contracts ?? [];\n const i18n = meta.i18n ?? {};\n delete meta.customTemplates;\n delete meta.functions;\n delete meta.menus;\n delete meta.contracts;\n delete meta.i18n;\n delete meta.workflows;\n delete meta.mocks;\n delete meta.userGroups;\n\n const extractedTemplates = extractTemplates(\n customTemplates,\n [\"components\"],\n extractState\n );\n extractState.extracts.push({\n name: \"index\",\n path: [\"components\"],\n node: extractedTemplates,\n nodeType: \"others\",\n });\n\n const fileStructure = buildFileStructure(extractState.extracts);\n\n src.file(\"index.js\", srcIndexJs);\n\n src.file(\n \"routes.jsx\",\n formatJs(generate(extractedRoutes, \"routes\", [\"routes.jsx\"]))\n );\n\n const resources = src.folder(\"resources\")!;\n\n // Functions\n const fnDir = resources.folder(\"functions\")!;\n const fnNames: string[] = [];\n const fnImports: string[] = [];\n for (const fn of functions) {\n if (fn.name === \"index\") {\n throw new Error('Unexpected function name: \"index\"');\n }\n\n // Prepend with `export default` for functions\n const inferredImports = new Set<string>();\n let { code } = transform(fn.source, {\n filename: `expr.${fn.typescript ? \"ts\" : \"js\"}`,\n plugins: [\n ...(fn.typescript ? [\"syntax-typescript\"] : []),\n TransformStoryboardFunction,\n [\n SmartImports,\n {\n imports: inferredImports,\n },\n ],\n ],\n }) as { code: string };\n const hasFN = inferredImports.has(\"FN\");\n if (hasFN) {\n inferredImports.delete(\"FN\");\n }\n const importStrings: string[] = [];\n if (inferredImports.size > 0) {\n importStrings.push(\n `import { ${[...inferredImports].join(\", \")} } from \"next-jsx/runtime\";`\n );\n }\n if (hasFN) {\n importStrings.push(`import FN from \"./index.js\";`);\n }\n if (importStrings.length > 0) {\n code = `${importStrings.join(\"\\n\")}\\n\\n${code}`;\n }\n\n fnDir.file(`${fn.name}.${fn.typescript ? \"ts\" : \"js\"}`, code);\n fnImports.push(`import ${fn.name} from \"./${fn.name}.js\";`);\n fnNames.push(fn.name);\n }\n fnDir.file(\n \"index.js\",\n formatJs(\n `${fnImports.join(\"\\n\")}\\n\\nconst FN = { ${fnNames.join(\n \",\"\n )} };\\n\\nexport default FN;`\n )\n );\n\n // Menus\n const menusDir = resources.folder(\"menus\")!;\n const menuNames: string[] = [];\n const menuImports: string[] = [];\n for (const menu of menus) {\n cleanMenu(menu);\n if (menu.menuId === \"index\") {\n throw new Error('Unexpected menu id: \"index\"');\n }\n const filename = `${menu.menuId}.js`;\n menusDir.file(\n filename,\n formatJs(generate(menu, \"menu\", [\"resources\", \"menus\", filename]))\n );\n let name = menu.menuId.replace(/^\\d+|[^\\w]+/g, \"_\");\n if (JS_RESERVED_WORDS.has(name)) {\n name = `${name}__2`;\n }\n menuImports.push(`import ${name} from \"./${filename}\";`);\n menuNames.push(name);\n }\n menusDir.file(\n \"index.js\",\n formatJs(\n `${menuImports.join(\"\\n\")}\\n\\nexport default [${menuNames.join(\",\")}]`\n )\n );\n\n // Contracts\n const contractsDir = resources.folder(\"contracts\")!;\n const contractNames: string[] = [];\n const contractImports: string[] = [];\n for (const contract of contracts) {\n if (contract.name === \"index\") {\n throw new Error('Unexpected contract name: \"index\"');\n }\n contractsDir.file(\n `${contract.name}.js`,\n formatJs(`export default ${JSON.stringify(contract)};`)\n );\n const name = contract.name.replace(/^\\d+|[^\\w]+/g, \"_\");\n contractImports.push(`import ${name} from \"./${contract.name}.js\";`);\n contractNames.push(name);\n }\n contractsDir.file(\n \"index.js\",\n formatJs(\n `${contractImports.join(\"\\n\")}\\n\\nexport default [${contractNames.join(\n \",\"\n )}]`\n )\n );\n\n resources\n .folder(\"i18n\")!\n .file(\"index.js\", formatJs(`export default ${JSON.stringify(i18n)};`));\n resources.file(\n \"meta.js\",\n formatJs(`export default ${JSON.stringify(meta, null, 2)};`)\n );\n resources.file(\"index.js\", srcResourcesIndexJs);\n\n generateByFileStructure(fileStructure, src, []);\n\n const appDir = project\n .folder(\"mock-micro-apps\")!\n .folder(projectDetail.appId)!;\n appDir.file(\".gitignore\", \"*\\n!.gitignore\");\n\n project.file(\".editorconfig\", editorConfig);\n project.file(\".gitignore\", gitIgnore);\n project.file(\"dev.config.mjs\", devConfigMjs);\n project.file(\"declarations.d.ts\", declarationsDTs);\n project.file(\"jsconfig.json\", jsconfigJson);\n project.file(\n \"next-jsx.config.js\",\n nextJsxConfigJs.replaceAll(\"__APP_ID__\", projectDetail.appId)\n );\n project.file(\n \"package.json\",\n packageJson.replaceAll(\"__APP_ID__\", projectDetail.appId)\n );\n project.file(\n \"README.md\",\n readmeMd\n .replaceAll(\"__PROJECT_NAME__\", projectDetail.name)\n .replaceAll(\"__PROJECT_HOMEPAGE__\", projectDetail.appSetting.homepage)\n );\n\n const blob = await zip.generateAsync({ type: \"blob\" });\n saveAs(blob, \"project.zip\");\n}\n\ninterface FormatJsOptions {\n typescript?: boolean;\n semi?: boolean;\n printWidth?: number;\n}\n\nfunction formatJs(\n source: string,\n { typescript, semi = true, printWidth }: FormatJsOptions = {}\n): string {\n return format(source, {\n parser: typescript ? \"babel-ts\" : \"babel\",\n plugins: [parserBabel],\n semi,\n printWidth,\n });\n}\n\nfunction generateByFileStructure(\n items: SourceFileOrFolder[],\n folder: JSZip,\n path: string[]\n) {\n for (const item of items) {\n const childPath = [...path, item.name];\n if (item.type === \"folder\") {\n const childFolder = folder.folder(item.name)!;\n generateByFileStructure(item.items, childFolder, childPath);\n } else {\n folder.file(\n `${item.name}.js${\n item.nodeType === \"routes\" ||\n item.nodeType === \"bricks\" ||\n item.nodeType === \"template\"\n ? \"x\"\n : \"\"\n }`,\n formatJs(generate(item.node, item.nodeType, childPath))\n );\n }\n }\n}\n\nfunction cleanMenu(menu: Record<string, any>) {\n for (const [key, value] of Object.entries(menu)) {\n switch (key) {\n case \"items\":\n if (Array.isArray(value)) {\n for (const item of value) {\n cleanMenuItem(item);\n }\n }\n break;\n case \"type\":\n if (value === \"main\") {\n delete menu[key];\n }\n break;\n case \"if\":\n break;\n case \"i18n\":\n if (Object.keys(value).length === 0) {\n delete menu[key];\n }\n break;\n default:\n if (value === null || value === false) {\n delete menu[key];\n }\n }\n }\n}\n\nfunction cleanMenuItem(menuItem: Record<string, any>) {\n for (const [key, value] of Object.entries(menuItem)) {\n switch (key) {\n case \"children\":\n if (Array.isArray(value) && value.length > 0) {\n cleanMenuItem(value);\n }\n break;\n case \"if\":\n break;\n case \"activeExcludes\":\n case \"activeIncludes\":\n if (Array.isArray(value) && value.length === 0) {\n delete menuItem[key];\n }\n break;\n default:\n if (value === null || value === false) {\n delete menuItem[key];\n }\n }\n }\n}\n\ncustomElements.define(\n \"vb-experiment.export-as-source-files\",\n createProviderClass(exportAsSourceFiles)\n);\n"],"names":["_exportAsSourceFiles","_asyncToGenerator","_ref","_storyboard$meta","_meta$customTemplates","_meta$functions","_meta$menus","_meta$contracts","_meta$i18n","projectDetail","storyboard","zip","JSZip","project","folder","src","extractState","extracts","namePool","Map","extractedRoutes","extractRoutes","routes","app","id","appId","name","homepage","appSetting","layoutType","theme","noAuthGuard","locales","defaultConfig","JSON","parse","menuIcon","icon","standaloneMode","file","formatJs","concat","stringify","meta","customTemplates","functions","menus","contracts","i18n","workflows","mocks","userGroups","extractedTemplates","extractTemplates","push","path","node","nodeType","fileStructure","buildFileStructure","srcIndexJs","generate","resources","fnDir","fnNames","fnImports","fn","Error","inferredImports","Set","code","transform","source","filename","typescript","plugins","TransformStoryboardFunction","SmartImports","imports","hasFN","has","delete","importStrings","size","join","length","menusDir","menuNames","menuImports","menu","cleanMenu","menuId","replace","JS_RESERVED_WORDS","contractsDir","contractNames","contractImports","contract","srcResourcesIndexJs","generateByFileStructure","editorConfig","gitIgnore","devConfigMjs","declarationsDTs","jsconfigJson","nextJsxConfigJs","replaceAll","packageJson","readmeMd","blob","generateAsync","type","saveAs","apply","arguments","semi","printWidth","undefined","format","parser","parserBabel","items","item","childPath","childFolder","key","value","Object","entries","Array","isArray","cleanMenuItem","keys","menuItem","customElements","define","createProviderClass","_x"],"sourceRoot":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_next_bricks_vb_experiment=self.webpackChunk_next_bricks_vb_experiment||[]).push([[732],{6264:(e,n,t)=>{t.r(n),t.d(n,{exportAsSourceFiles:()=>I});var o=t(4795),r=t(2019),a=t(1297),i=t.n(a),c=t(6782),s=t(9691),l=t(8483),p=t.n(l),f=t(7243),d=t(9333),u=t(5738),m=t(5794),x=t(5125),h=t(9602),j=t(7287),v=t(2524),g=t(3626),y=t(8223),_=t(4450),b=t(3239),A=t(7040),k=t(3870),w=t(4778),S=t(1853),E=t(5541);function I(e){return N.apply(this,arguments)}function N(){return(N=(0,o.Z)((function*(e){var n,t,o,r,a,s,{projectDetail:l,storyboard:p}=e,I=new(i()),N=I.folder("project"),J=N.folder("src"),C={extracts:[],namePool:new Map},F=(0,d.I$)(p.routes,[],C),R={id:l.appId,name:l.name,homepage:l.appSetting.homepage,layoutType:l.appSetting.layoutType,theme:l.appSetting.theme,noAuthGuard:l.appSetting.noAuthGuard,locales:l.appSetting.locales,defaultConfig:JSON.parse(l.appSetting.defaultConfig||"{}"),menuIcon:JSON.parse(l.appSetting.icon||"null"),standaloneMode:!0};J.file("app.js",O("export default ".concat(JSON.stringify(R,null,2),";")));var M=null!==(n=p.meta)&&void 0!==n?n:{},D=null!==(t=M.customTemplates)&&void 0!==t?t:[],G=null!==(o=M.functions)&&void 0!==o?o:[],U=null!==(r=M.menus)&&void 0!==r?r:[],Z=null!==(a=M.contracts)&&void 0!==a?a:[],z=null!==(s=M.i18n)&&void 0!==s?s:{};delete M.customTemplates,delete M.functions,delete M.menus,delete M.contracts,delete M.i18n,delete M.workflows,delete M.mocks,delete M.userGroups;var W=(0,d.LK)(D,["components"],C);C.extracts.push({name:"index",path:["components"],node:W,nodeType:"others"});var B=(0,u.B)(C.extracts);J.file("index.js",h),J.file("routes.jsx",O((0,m.R)(F,"routes",["routes.jsx"])));var H=J.folder("resources"),K=H.folder("functions"),L=[],$=[];for(var q of G){if("index"===q.name)throw new Error('Unexpected function name: "index"');var Q=new Set,{code:V}=(0,f.transform)(q.source,{filename:"expr.".concat(q.typescript?"ts":"js"),plugins:[...q.typescript?["syntax-typescript"]:[],S.Z,[E.Z,{imports:Q}]]}),X=Q.has("FN");X&&Q.delete("FN");var Y=[];Q.size>0&&Y.push("import { ".concat([...Q].join(", "),' } from "next-jsx/runtime";')),X&&Y.push('import FN from "./index.js";'),Y.length>0&&(V="".concat(Y.join("\n"),"\n\n").concat(V)),K.file("".concat(q.name,".").concat(q.typescript?"ts":"js"),V),$.push("import ".concat(q.name,' from "./').concat(q.name,'.js";')),L.push(q.name)}K.file("index.js",O("".concat($.join("\n"),"\n\nconst FN = { ").concat(L.join(",")," };\n\nexport default FN;")));var ee=H.folder("menus"),ne=[],te=[];for(var oe of U){if(P(oe),"index"===oe.menuId)throw new Error('Unexpected menu id: "index"');var re="".concat(oe.menuId,".js");ee.file(re,O((0,m.R)(oe,"menu",["resources","menus",re])));var ae=oe.menuId.replace(/^\d+|[^\w]+/g,"_");w.h8.has(ae)&&(ae="".concat(ae,"__2")),te.push("import ".concat(ae,' from "./').concat(re,'";')),ne.push(ae)}ee.file("index.js",O("".concat(te.join("\n"),"\n\nexport default [").concat(ne.join(","),"]")));var ie=H.folder("contracts"),ce=[],se=[];for(var le of Z){if("index"===le.name)throw new Error('Unexpected contract name: "index"');ie.file("".concat(le.name,".js"),O("export default ".concat(JSON.stringify(le),";")));var pe=le.name.replace(/^\d+|[^\w]+/g,"_");se.push("import ".concat(pe,' from "./').concat(le.name,'.js";')),ce.push(pe)}ie.file("index.js",O("".concat(se.join("\n"),"\n\nexport default [").concat(ce.join(","),"]"))),H.folder("i18n").file("index.js",O("export default ".concat(JSON.stringify(z),";"))),H.file("meta.js",O("export default ".concat(JSON.stringify(M,null,2),";"))),H.file("index.js",x),T(B,J,[]),N.folder("mock-micro-apps").folder(l.appId).file(".gitignore","*\n!.gitignore"),N.file(".editorconfig",j),N.file(".gitignore",v),N.file("dev.config.mjs",y),N.file("declarations.d.ts",g),N.file("jsconfig.json",_),N.file("next-jsx.config.js",b.replaceAll("__APP_ID__",l.appId)),N.file("package.json",A.replaceAll("__APP_ID__",l.appId)),N.file("README.md",k.replaceAll("__PROJECT_NAME__",l.name).replaceAll("__PROJECT_HOMEPAGE__",l.appSetting.homepage));var fe=yield I.generateAsync({type:"blob"});(0,c.saveAs)(fe,"project.zip")}))).apply(this,arguments)}function O(e){var{typescript:n,semi:t=!0,printWidth:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,s.format)(e,{parser:n?"babel-ts":"babel",plugins:[p()],semi:t,printWidth:o})}function T(e,n,t){for(var o of e){var r=[...t,o.name];if("folder"===o.type){var a=n.folder(o.name);T(o.items,a,r)}else n.file("".concat(o.name,".js").concat("routes"===o.nodeType||"bricks"===o.nodeType||"template"===o.nodeType?"x":""),O((0,m.R)(o.node,o.nodeType,r)))}}function P(e){for(var[n,t]of Object.entries(e))switch(n){case"items":if(Array.isArray(t))for(var o of t)J(o);break;case"type":"main"===t&&delete e[n];break;case"if":break;case"i18n":0===Object.keys(t).length&&delete e[n];break;default:null!==t&&!1!==t||delete e[n]}}function J(e){for(var[n,t]of Object.entries(e))switch(n){case"children":Array.isArray(t)&&t.length>0&&J(t);break;case"if":break;case"activeExcludes":case"activeIncludes":Array.isArray(t)&&0===t.length&&delete e[n];break;default:null!==t&&!1!==t||delete e[n]}}customElements.define("vb-experiment.export-as-source-files",(0,r.createProviderClass)(I))}}]);
|
|
2
|
-
//# sourceMappingURL=export-as-source-files.d194ee76.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunks/export-as-source-files.d194ee76.js","mappings":"6aAkDO,SAAeA,EAAmBC,GAAA,OAAAC,EAAAC,MAAC,KAADC,UAAA,CAyNxC,SAAAF,IAAA,OAAAA,GAAAG,EAAAA,EAAAA,IAzNM,UAAAC,GAGqC,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GAHF,cACxCC,EAAa,WACbC,GACyBR,EACnBS,EAAM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KD,MAAOG,EAAaD,EACnD,MACE3G,EAAOyB,KAAK,GAADE,OACN+E,EAAK9F,KAAI,OAAAe,OACQ,WAAlB+E,EAAK/D,UACa,WAAlB+D,EAAK/D,UACa,aAAlB+D,EAAK/D,SACD,IACA,IAENjB,GAASqB,EAAAA,EAAAA,GAAS2D,EAAKhE,KAAMgE,EAAK/D,SAAUgE,IAGlD,CACF,CAEA,SAAS/B,EAAUD,GACjB,IAAK,IAAOkC,EAAKC,KAAUC,OAAOC,QAAQrC,GACxC,OAAQkC,GACN,IAAK,QACH,GAAII,MAAMC,QAAQJ,GAChB,IAAK,IAAMJ,KAAQI,EACjBK,EAAcT,GAGlB,MACF,IAAK,OACW,SAAVI,UACKnC,EAAKkC,GAEd,MACF,IAAK,KACH,MACF,IAAK,OAC+B,IAA9BE,OAAOK,KAAKN,GAAOvC,eACdI,EAAKkC,GAEd,MACF,QACgB,OAAVC,IAA4B,IAAVA,UACbnC,EAAKkC,GAItB,CAEA,SAASM,EAAcE,GACrB,IAAK,IAAOR,EAAKC,KAAUC,OAAOC,QAAQK,GACxC,OAAQR,GACN,IAAK,WACCI,MAAMC,QAAQJ,IAAUA,EAAMvC,OAAS,GACzC4C,EAAcL,GAEhB,MACF,IAAK,KACH,MACF,IAAK,iBACL,IAAK,iBACCG,MAAMC,QAAQJ,IAA2B,IAAjBA,EAAMvC,eACzB8C,EAASR,GAElB,MACF,QACgB,OAAVC,IAA4B,IAAVA,UACbO,EAASR,GAI1B,CAEAS,eAAeC,OACb,wCACAC,EAAAA,EAAAA,qBAAoB1I,G","sources":["webpack:///./src/data-providers/export-as-source-files.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport type { Storyboard, MicroApp, StoryboardMeta } from \"@next-core/types\";\nimport { createProviderClass } from \"@next-core/utils/general\";\nimport JSZip from \"jszip\";\nimport { saveAs } from \"file-saver\";\nimport { format } from \"prettier/standalone.js\";\nimport parserBabel from \"prettier/parser-babel.js\";\nimport { transform } from \"@babel/standalone\";\nimport {\n ExtractState,\n extractRoutes,\n extractTemplates,\n} from \"./utils/extract.js\";\nimport {\n SourceFileOrFolder,\n buildFileStructure,\n} from \"./utils/buildFileStructure.js\";\nimport { generate } from \"./utils/generators/generate.js\";\nimport srcResourcesIndexJs from \"./raws/src/resources/index.js.txt\";\nimport srcIndexJs from \"./raws/src/index.js.txt\";\nimport editorConfig from \"./raws/.editorconfig.txt\";\nimport gitIgnore from \"./raws/.gitignore.txt\";\nimport declarationsDTs from \"./raws/declarations.d.ts.txt\";\nimport devConfigMjs from \"./raws/dev.config.mjs.txt\";\nimport jsconfigJson from \"./raws/jsconfig.json.txt\";\nimport nextJsxConfigJs from \"./raws/next-jsx.config.js.txt\";\nimport packageJson from \"./raws/package.json.txt\";\nimport readmeMd from \"./raws/README.md.txt\";\nimport { JS_RESERVED_WORDS } from \"./utils/constants.js\";\nimport TransformStoryboardFunction from \"./utils/plugins/storyboard-function.js\";\nimport SmartImports from \"./utils/plugins/smart-imports.js\";\n\nexport interface StoryboardAssemblyResult {\n storyboard: Storyboard;\n\n projectDetail: {\n appId: string;\n name: string;\n appSetting: Pick<\n MicroApp,\n \"homepage\" | \"theme\" | \"locales\" | \"noAuthGuard\"\n > & {\n layoutType?: string;\n defaultConfig?: string;\n icon?: string;\n };\n brickNextVersion?: number;\n };\n}\n\nexport async function exportAsSourceFiles({\n projectDetail,\n storyboard,\n}: StoryboardAssemblyResult): Promise<void> {\n const zip = new JSZip();\n const project = zip.folder(\"project\")!;\n const src = project.folder(\"src\")!;\n\n const extractState: ExtractState = {\n extracts: [],\n namePool: new Map(),\n };\n const extractedRoutes = extractRoutes(storyboard.routes, [], extractState);\n\n const app: MicroApp & { layoutType?: string } = {\n id: projectDetail.appId,\n name: projectDetail.name,\n homepage: projectDetail.appSetting.homepage,\n layoutType: projectDetail.appSetting.layoutType,\n theme: projectDetail.appSetting.theme,\n noAuthGuard: projectDetail.appSetting.noAuthGuard,\n locales: projectDetail.appSetting.locales,\n defaultConfig: JSON.parse(projectDetail.appSetting.defaultConfig || \"{}\"),\n menuIcon: JSON.parse(projectDetail.appSetting.icon || \"null\"),\n standaloneMode: true,\n };\n src.file(\n \"app.js\",\n formatJs(`export default ${JSON.stringify(app, null, 2)};`)\n );\n\n const meta = (storyboard.meta ?? {}) as StoryboardMeta & {\n workflows?: unknown;\n userGroups?: unknown;\n };\n const customTemplates = meta.customTemplates ?? [];\n const functions = meta.functions ?? [];\n const menus = meta.menus ?? [];\n const contracts = meta.contracts ?? [];\n const i18n = meta.i18n ?? {};\n delete meta.customTemplates;\n delete meta.functions;\n delete meta.menus;\n delete meta.contracts;\n delete meta.i18n;\n delete meta.workflows;\n delete meta.mocks;\n delete meta.userGroups;\n\n const extractedTemplates = extractTemplates(\n customTemplates,\n [\"components\"],\n extractState\n );\n extractState.extracts.push({\n name: \"index\",\n path: [\"components\"],\n node: extractedTemplates,\n nodeType: \"others\",\n });\n\n const fileStructure = buildFileStructure(extractState.extracts);\n\n src.file(\"index.js\", srcIndexJs);\n\n src.file(\n \"routes.jsx\",\n formatJs(generate(extractedRoutes, \"routes\", [\"routes.jsx\"]))\n );\n\n const resources = src.folder(\"resources\")!;\n\n // Functions\n const fnDir = resources.folder(\"functions\")!;\n const fnNames: string[] = [];\n const fnImports: string[] = [];\n for (const fn of functions) {\n if (fn.name === \"index\") {\n throw new Error('Unexpected function name: \"index\"');\n }\n\n // Prepend with `export default` for functions\n const inferredImports = new Set<string>();\n let { code } = transform(fn.source, {\n filename: `expr.${fn.typescript ? \"ts\" : \"js\"}`,\n plugins: [\n ...(fn.typescript ? [\"syntax-typescript\"] : []),\n TransformStoryboardFunction,\n [\n SmartImports,\n {\n imports: inferredImports,\n },\n ],\n ],\n }) as { code: string };\n const hasFN = inferredImports.has(\"FN\");\n if (hasFN) {\n inferredImports.delete(\"FN\");\n }\n const importStrings: string[] = [];\n if (inferredImports.size > 0) {\n importStrings.push(\n `import { ${[...inferredImports].join(\", \")} } from \"next-jsx/runtime\";`\n );\n }\n if (hasFN) {\n importStrings.push(`import FN from \"./index.js\";`);\n }\n if (importStrings.length > 0) {\n code = `${importStrings.join(\"\\n\")}\\n\\n${code}`;\n }\n\n fnDir.file(`${fn.name}.${fn.typescript ? \"ts\" : \"js\"}`, code);\n fnImports.push(`import ${fn.name} from \"./${fn.name}.js\";`);\n fnNames.push(fn.name);\n }\n fnDir.file(\n \"index.js\",\n formatJs(\n `${fnImports.join(\"\\n\")}\\n\\nconst FN = { ${fnNames.join(\n \",\"\n )} };\\n\\nexport default FN;`\n )\n );\n\n // Menus\n const menusDir = resources.folder(\"menus\")!;\n const menuNames: string[] = [];\n const menuImports: string[] = [];\n for (const menu of menus) {\n cleanMenu(menu);\n if (menu.menuId === \"index\") {\n throw new Error('Unexpected menu id: \"index\"');\n }\n const filename = `${menu.menuId}.js`;\n menusDir.file(\n filename,\n formatJs(generate(menu, \"menu\", [\"resources\", \"menus\", filename]))\n );\n let name = menu.menuId.replace(/^\\d+|[^\\w]+/g, \"_\");\n if (JS_RESERVED_WORDS.has(name)) {\n name = `${name}__2`;\n }\n menuImports.push(`import ${name} from \"./${filename}\";`);\n menuNames.push(name);\n }\n menusDir.file(\n \"index.js\",\n formatJs(\n `${menuImports.join(\"\\n\")}\\n\\nexport default [${menuNames.join(\",\")}]`\n )\n );\n\n // Contracts\n const contractsDir = resources.folder(\"contracts\")!;\n const contractNames: string[] = [];\n const contractImports: string[] = [];\n for (const contract of contracts) {\n if (contract.name === \"index\") {\n throw new Error('Unexpected contract name: \"index\"');\n }\n contractsDir.file(\n `${contract.name}.js`,\n formatJs(`export default ${JSON.stringify(contract)};`)\n );\n const name = contract.name.replace(/^\\d+|[^\\w]+/g, \"_\");\n contractImports.push(`import ${name} from \"./${contract.name}.js\";`);\n contractNames.push(name);\n }\n contractsDir.file(\n \"index.js\",\n formatJs(\n `${contractImports.join(\"\\n\")}\\n\\nexport default [${contractNames.join(\n \",\"\n )}]`\n )\n );\n\n resources\n .folder(\"i18n\")!\n .file(\"index.js\", formatJs(`export default ${JSON.stringify(i18n)};`));\n resources.file(\n \"meta.js\",\n formatJs(`export default ${JSON.stringify(meta, null, 2)};`)\n );\n resources.file(\"index.js\", srcResourcesIndexJs);\n\n generateByFileStructure(fileStructure, src, []);\n\n const appDir = project\n .folder(\"mock-micro-apps\")!\n .folder(projectDetail.appId)!;\n appDir.file(\".gitignore\", \"*\\n!.gitignore\");\n\n project.file(\".editorconfig\", editorConfig);\n project.file(\".gitignore\", gitIgnore);\n project.file(\"dev.config.mjs\", devConfigMjs);\n project.file(\"declarations.d.ts\", declarationsDTs);\n project.file(\"jsconfig.json\", jsconfigJson);\n project.file(\n \"next-jsx.config.js\",\n nextJsxConfigJs.replaceAll(\"__APP_ID__\", projectDetail.appId)\n );\n project.file(\n \"package.json\",\n packageJson.replaceAll(\"__APP_ID__\", projectDetail.appId)\n );\n project.file(\n \"README.md\",\n readmeMd\n .replaceAll(\"__PROJECT_NAME__\", projectDetail.name)\n .replaceAll(\"__PROJECT_HOMEPAGE__\", projectDetail.appSetting.homepage)\n );\n\n const blob = await zip.generateAsync({ type: \"blob\" });\n saveAs(blob, \"project.zip\");\n}\n\ninterface FormatJsOptions {\n typescript?: boolean;\n semi?: boolean;\n printWidth?: number;\n}\n\nfunction formatJs(\n source: string,\n { typescript, semi = true, printWidth }: FormatJsOptions = {}\n): string {\n return format(source, {\n parser: typescript ? \"babel-ts\" : \"babel\",\n plugins: [parserBabel],\n semi,\n printWidth,\n });\n}\n\nfunction generateByFileStructure(\n items: SourceFileOrFolder[],\n folder: JSZip,\n path: string[]\n) {\n for (const item of items) {\n const childPath = [...path, item.name];\n if (item.type === \"folder\") {\n const childFolder = folder.folder(item.name)!;\n generateByFileStructure(item.items, childFolder, childPath);\n } else {\n folder.file(\n `${item.name}.js${\n item.nodeType === \"routes\" ||\n item.nodeType === \"bricks\" ||\n item.nodeType === \"template\"\n ? \"x\"\n : \"\"\n }`,\n formatJs(generate(item.node, item.nodeType, childPath))\n );\n }\n }\n}\n\nfunction cleanMenu(menu: Record<string, any>) {\n for (const [key, value] of Object.entries(menu)) {\n switch (key) {\n case \"items\":\n if (Array.isArray(value)) {\n for (const item of value) {\n cleanMenuItem(item);\n }\n }\n break;\n case \"type\":\n if (value === \"main\") {\n delete menu[key];\n }\n break;\n case \"if\":\n break;\n case \"i18n\":\n if (Object.keys(value).length === 0) {\n delete menu[key];\n }\n break;\n default:\n if (value === null || value === false) {\n delete menu[key];\n }\n }\n }\n}\n\nfunction cleanMenuItem(menuItem: Record<string, any>) {\n for (const [key, value] of Object.entries(menuItem)) {\n switch (key) {\n case \"children\":\n if (Array.isArray(value) && value.length > 0) {\n cleanMenuItem(value);\n }\n break;\n case \"if\":\n break;\n case \"activeExcludes\":\n case \"activeIncludes\":\n if (Array.isArray(value) && value.length === 0) {\n delete menuItem[key];\n }\n break;\n default:\n if (value === null || value === false) {\n delete menuItem[key];\n }\n }\n }\n}\n\ncustomElements.define(\n \"vb-experiment.export-as-source-files\",\n createProviderClass(exportAsSourceFiles)\n);\n"],"names":["exportAsSourceFiles","_x","_exportAsSourceFiles","apply","arguments","_asyncToGenerator","_ref","_storyboard$meta","_meta$customTemplates","_meta$functions","_meta$menus","_meta$contracts","_meta$i18n","projectDetail","storyboard","zip","JSZip","project","folder","src","extractState","extracts","namePool","Map","extractedRoutes","extractRoutes","routes","app","id","appId","name","homepage","appSetting","layoutType","theme","noAuthGuard","locales","defaultConfig","JSON","parse","menuIcon","icon","standaloneMode","file","formatJs","concat","stringify","meta","customTemplates","functions","menus","contracts","i18n","workflows","mocks","userGroups","extractedTemplates","extractTemplates","push","path","node","nodeType","fileStructure","buildFileStructure","srcIndexJs","generate","resources","fnDir","fnNames","fnImports","fn","Error","inferredImports","Set","code","transform","source","filename","typescript","plugins","TransformStoryboardFunction","SmartImports","imports","hasFN","has","delete","importStrings","size","join","length","menusDir","menuNames","menuImports","menu","cleanMenu","menuId","replace","JS_RESERVED_WORDS","contractsDir","contractNames","contractImports","contract","srcResourcesIndexJs","generateByFileStructure","editorConfig","gitIgnore","devConfigMjs","declarationsDTs","jsconfigJson","nextJsxConfigJs","replaceAll","packageJson","readmeMd","blob","generateAsync","type","saveAs","semi","printWidth","undefined","format","parser","parserBabel","items","item","childPath","childFolder","key","value","Object","entries","Array","isArray","cleanMenuItem","keys","menuItem","customElements","define","createProviderClass"],"sourceRoot":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(()=>{var e,r,t,n,o,a,i,u,l,s,f,p,c,d,h,v={8986:(e,r,t)=>{Promise.all([t.e(134),t.e(347),t.e(644)]).then(t.bind(t,1644))}},b={};function g(e){var r=b[e];if(void 0!==r)return r.exports;var t=b[e]={exports:{}};return v[e].call(t.exports,t,t.exports,g),t.exports}g.m=v,g.c=b,g.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return g.d(r,{a:r}),r},g.d=(e,r)=>{for(var t in r)g.o(r,t)&&!g.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},g.f={},g.e=e=>Promise.all(Object.keys(g.f).reduce(((r,t)=>(g.f[t](e,r),r)),[])),g.u=e=>"chunks/"+e+"."+{110:"78c7f020",134:"2149865a",347:"5c0ae971",644:"a5edc92b"}[e]+".js",g.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),g.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="@next-bricks/vb-experiment:",g.l=(t,n,o,a)=>{if(e[t])e[t].push(n);else{var i,u;if(void 0!==o)for(var l=document.getElementsByTagName("script"),s=0;s<l.length;s++){var f=l[s];if(f.getAttribute("src")==t||f.getAttribute("data-webpack")==r+o){i=f;break}}i||(u=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,g.nc&&i.setAttribute("nonce",g.nc),i.setAttribute("data-webpack",r+o),i.src=t),e[t]=[n];var p=(r,n)=>{i.onerror=i.onload=null,clearTimeout(c);var o=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},c=setTimeout(p.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),u&&document.head.appendChild(i)}},g.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{g.S={};var e={},r={};g.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];g.o(g.S,t)||(g.S[t]={});var a=g.S[t],i="@next-bricks/vb-experiment",u=[];return"default"===t&&((e,r,t,n)=>{var o=a[e]=a[e]||{},u=o[r];(!u||!u.loaded&&(1!=!u.eager?n:i>u.from))&&(o[r]={get:()=>g.e(110).then((()=>()=>g(7110))),from:i,eager:!1})})("@next-core/utils/general","1.5.7"),e[t]=u.length?Promise.all(u).then((()=>e[t]=1)):1}}})(),(()=>{var e;g.g.importScripts&&(e=g.g.location+"");var r=g.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),g.p=e+"../"})(),t=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},n=(e,r)=>{e=t(e),r=t(r);for(var n=0;;){if(n>=e.length)return n<r.length&&"u"!=(typeof r[n])[0];var o=e[n],a=(typeof o)[0];if(n>=r.length)return"u"==a;var i=r[n],u=(typeof i)[0];if(a!=u)return"o"==a&&"n"==u||"s"==u||"u"==a;if("o"!=a&&"u"!=a&&o!=i)return o<i;n++}},o=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,a=1;a<e.length;a++)n--,t+="u"==(typeof(u=e[a]))[0]?"-":(n>0?".":"")+(n=2,u);return t}var i=[];for(a=1;a<e.length;a++){var u=e[a];i.push(0===u?"not("+l()+")":1===u?"("+l()+" || "+l()+")":2===u?i.pop()+" "+i.pop():o(u))}return l();function l(){return i.pop().replace(/^\((.+)\)$/,"$1")}},a=(e,r)=>{if(0 in e){r=t(r);var n=e[0],o=n<0;o&&(n=-n-1);for(var i=0,u=1,l=!0;;u++,i++){var s,f,p=u<e.length?(typeof e[u])[0]:"";if(i>=r.length||"o"==(f=(typeof(s=r[i]))[0]))return!l||("u"==p?u>n&&!o:""==p!=o);if("u"==f){if(!l||"u"!=p)return!1}else if(l)if(p==f)if(u<=n){if(s!=e[u])return!1}else{if(o?s>e[u]:s<e[u])return!1;s!=e[u]&&(l=!1)}else if("s"!=p&&"n"!=p){if(o||u<=n)return!1;l=!1,u--}else{if(u<=n||f<p!=o)return!1;l=!1}else"s"!=p&&"n"!=p&&(l=!1,u--)}}var c=[],d=c.pop.bind(c);for(i=1;i<e.length;i++){var h=e[i];c.push(1==h?d()|d():2==h?d()&d():h?a(h,r):!d())}return!!d()},i=(e,r)=>{var t=e[r];return Object.keys(t).reduce(((e,r)=>!e||!t[e].loaded&&n(e,r)?r:e),0)},u=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+o(n)+")",l=(e,r,t,n)=>{var o=i(e,t);return a(n,o)||s(u(e,t,o,n)),f(e[t][o])},s=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},f=e=>(e.loaded=1,e.get()),p=(e=>function(r,t,n,o){var a=g.I(r);return a&&a.then?a.then(e.bind(e,r,g.S[r],t,n,o)):e(0,g.S[r],t,n,o)})(((e,r,t,n,o)=>r&&g.o(r,t)?l(r,0,t,n):o())),c={},d={2019:()=>p("default","@next-core/utils/general",[1,1,5,7],(()=>g.e(110).then((()=>()=>g(7110)))))},h={347:[2019]},g.f.consumes=(e,r)=>{g.o(h,e)&&h[e].forEach((e=>{if(g.o(c,e))return r.push(c[e]);var t=r=>{c[e]=0,g.m[e]=t=>{delete g.c[e],t.exports=r()}},n=r=>{delete c[e],g.m[e]=t=>{throw delete g.c[e],r}};try{var o=d[e]();o.then?r.push(c[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}))},(()=>{var e={179:0};g.f.j=(r,t)=>{var n=g.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var a=g.p+g.u(r),i=new Error;g.l(a,(t=>{if(g.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[a,i,u]=t,l=0;if(a.some((r=>0!==e[r]))){for(n in i)g.o(i,n)&&(g.m[n]=i[n]);u&&u(g)}for(r&&r(t);l<a.length;l++)o=a[l],g.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=self.webpackChunk_next_bricks_vb_experiment=self.webpackChunk_next_bricks_vb_experiment||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),g(8986)})();
|
|
2
|
-
//# sourceMappingURL=main.9a0e46f7.js.map
|
|
File without changes
|