diff --git a/component/packages/wu-code-monaco-editor/src/index.tsx b/component/packages/wu-code-monaco-editor/src/index.tsx index a0ae4903..d9347c97 100644 --- a/component/packages/wu-code-monaco-editor/src/index.tsx +++ b/component/packages/wu-code-monaco-editor/src/index.tsx @@ -55,14 +55,12 @@ export class WuCodeMonacoEditor extends WuComponent implements OnConnected { const file = new File([ u8arr ], `initialSrcTs.tsx`, { type: "text/plain" }); - console.log(file); const reader = new FileReader(); reader.onload = ()=> { // 语句是为了显示内容换行 // @ts-ignore /*const str = reader.result?.replace(/\n/g,"
"); console.log(str);*/ - console.log(reader.result); resolve(reader.result as string); }; reader.readAsText(file,'utf-8'); diff --git a/component/packages/wu-monaco-editor/.editorconfig b/component/packages/wu-code-playground/.editorconfig similarity index 100% rename from component/packages/wu-monaco-editor/.editorconfig rename to component/packages/wu-code-playground/.editorconfig diff --git a/component/packages/wu-monaco-editor/.eslintignore b/component/packages/wu-code-playground/.eslintignore similarity index 100% rename from component/packages/wu-monaco-editor/.eslintignore rename to component/packages/wu-code-playground/.eslintignore diff --git a/component/packages/wu-monaco-editor/.eslintrc.js b/component/packages/wu-code-playground/.eslintrc.js similarity index 100% rename from component/packages/wu-monaco-editor/.eslintrc.js rename to component/packages/wu-code-playground/.eslintrc.js diff --git a/component/packages/wu-monaco-editor/.prettierrc b/component/packages/wu-code-playground/.prettierrc similarity index 100% rename from component/packages/wu-monaco-editor/.prettierrc rename to component/packages/wu-code-playground/.prettierrc diff --git a/component/packages/wu-monaco-editor/build/webpack_build.config.js b/component/packages/wu-code-playground/build/webpack_build.config.js similarity index 100% rename from component/packages/wu-monaco-editor/build/webpack_build.config.js rename to component/packages/wu-code-playground/build/webpack_build.config.js diff --git a/component/packages/wu-monaco-editor/build/webpack_common.config.js b/component/packages/wu-code-playground/build/webpack_common.config.js similarity index 100% rename from component/packages/wu-monaco-editor/build/webpack_common.config.js rename to component/packages/wu-code-playground/build/webpack_common.config.js diff --git a/component/packages/wu-monaco-editor/build/webpack_dev.config.js b/component/packages/wu-code-playground/build/webpack_dev.config.js similarity index 100% rename from component/packages/wu-monaco-editor/build/webpack_dev.config.js rename to component/packages/wu-code-playground/build/webpack_dev.config.js diff --git a/component/packages/wu-code-playground/deplpy/playground-2022-10-30.html b/component/packages/wu-code-playground/deplpy/playground-2022-10-30.html new file mode 100644 index 00000000..177b12f7 --- /dev/null +++ b/component/packages/wu-code-playground/deplpy/playground-2022-10-30.html @@ -0,0 +1,20 @@ + + + + + wu-component-playground + + + + + + + + + + + diff --git a/component/packages/wu-code-playground/deplpy/static/code_editor/index.umd.js b/component/packages/wu-code-playground/deplpy/static/code_editor/index.umd.js new file mode 100644 index 00000000..86063957 --- /dev/null +++ b/component/packages/wu-code-playground/deplpy/static/code_editor/index.umd.js @@ -0,0 +1 @@ +!function(o,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@wu-component/web-core-plus")):"function"==typeof define&&define.amd?define(["exports","@wu-component/web-core-plus"],e):e((o="undefined"!=typeof globalThis?globalThis:o||self).WuCodeMonacoEditor={},o.webCorePlus)}(this,(function(o,e){"use strict";var t=function(o,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,e){o.__proto__=e}||function(o,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(o[t]=e[t])},t(o,e)};var i=function(){return i=Object.assign||function(o){for(var e,t=1,i=arguments.length;t=0;c--)(n=o[c])&&(a=(r<3?n(a):r>3?n(e,t,a):n(e,t))||a);return r>3&&a&&Object.defineProperty(e,t,a),a}function r(o,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(o,e)}function a(o,e,t,i){return new(t||(t=Promise))((function(n,r){function a(o){try{d(i.next(o))}catch(o){r(o)}}function c(o){try{d(i.throw(o))}catch(o){r(o)}}function d(o){var e;o.done?n(o.value):(e=o.value,e instanceof t?e:new t((function(o){o(e)}))).then(a,c)}d((i=i.apply(o,e||[])).next())}))}function c(o,e){var t,i,n,r,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return r={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function c(r){return function(c){return function(r){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]=0||(n[t]=o[t]);return n}(o,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(o,t)&&(n[t]=o[t])}return n}function h(o,e){(null==e||e>o.length)&&(e=o.length);for(var t=0,i=new Array(e);t=o.length?o.apply(this,n):function(){for(var o=arguments.length,i=new Array(o),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};z.initial(o),z.handler(e);var t={current:o},i=v(j)(t,e),n=v(D)(t),r=v(z.changes)(o),a=v(A)(t);function c(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(o){return o};return z.selector(o),o(t.current)}function d(o){x(i,n,r,a)(o)}return[c,d]}};var N,C={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},q=(N=function(o,e){throw new Error(o[e]||o.default)},function o(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n=N.length?N.apply(this,i):function(){for(var t=arguments.length,n=new Array(t),r=0;r{o=t(e,n,o)||o})),o}(t,e,n,o):"function"==typeof e?function(t,e){return t.reverse().forEach((t=>{const n=t(e);n&&(e=n)})),e}(t,e):void 0},defineMetadata:function(t,e,n,o){r(t,e,n,o)},getMetadata:function(t,e,n){return i(t,e,n)},getOwnMetadata:function(t,e,n){return o(t,e,n)},hasMetadata:function(t,e,n){return!!i(t,e,n)},hasOwnMetadata:function(t,e,n){return!!o(t,e,n)},metadata:function(t,e){return function(n,o){r(t,e,n,o)}}};Object.assign(Reflect,s);var a=function(t,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},a(t,e)};var l=function(){return l=Object.assign||function(t){for(var e,n=1,o=arguments.length;n + * @license MIT + */!function(t){if(!t.WeakMap){var e=Object.prototype.hasOwnProperty,n=Object.defineProperty&&function(){try{return 1===Object.defineProperty({},"x",{value:1}).x}catch(t){}}(),o=function(t,e,o){n?Object.defineProperty(t,e,{configurable:!0,writable:!0,value:o}):t[e]=o};t.WeakMap=function(){function t(){if(void 0===this)throw new TypeError("Constructor WeakMap requires 'new'");if(o(this,"_id",i("_WeakMap")),arguments.length>0)throw new TypeError("WeakMap iterable is not supported")}function n(t,n){if(!r(t)||!e.call(t,"_id"))throw new TypeError(n+" method called on incompatible receiver "+typeof t)}function i(t){return t+"_"+s()+"."+s()}function s(){return Math.random().toString().substring(2)}return o(t.prototype,"delete",(function(t){if(n(this,"delete"),!r(t))return!1;var e=t[this._id];return!(!e||e[0]!==t)&&(delete t[this._id],!0)})),o(t.prototype,"get",(function(t){if(n(this,"get"),r(t)){var e=t[this._id];return e&&e[0]===t?e[1]:void 0}})),o(t.prototype,"has",(function(t){if(n(this,"has"),!r(t))return!1;var e=t[this._id];return!(!e||e[0]!==t)})),o(t.prototype,"set",(function(t,e){if(n(this,"set"),!r(t))throw new TypeError("Invalid value used as weak map key");var i=t[this._id];return i&&i[0]===t?(i[1]=e,this):(o(t,this._id,[t,e]),this)})),o(t,"_polyfill",!0),t}()}function r(t){return Object(t)===t}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:u);var p=function(t){return t.replace(/(?!^)([A-Z])/g," $1").replace(/[_\s]+(?=[a-zA-Z])/g,".").toLowerCase()}; +/** + * @license + * Copyright (c) 2016 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt + */function f(t){var e=document.createElement("style");return e.textContent=t,e}function d(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function h(t){return t.children}function v(t,e){null!=t&&("function"==typeof t?t(e):t.current=e)}function y(t){return"[object Array]"===Object.prototype.toString.call(t)}function m(t){return t.indexOf("-")>-1?t.replace(/(\-([a-z]))/g,(function(t,e,n,o,r){return n.toUpperCase()})):t}function b(t,e,n){var o=void 0;try{if(null!==t)switch(e){case String:o=t;break;case Number:o=Number(t);break;case Boolean:o=!("false"===t||"0"===t||!1===t);break;case Array:case Object:o="string"==typeof t?JSON.parse(t.replace(/'/g,'"')):"[object Array]"===Object.prototype.toString.call(t)||"[object Object]"===Object.prototype.toString.call(t)?t:JSON.parse(t.replace(/(['"])?([a-zA-Z0-9_-]+)(['"])?:([^\/])/g,'"$2":$4').replace(/'([\s\S]*?)'/g,'"$1"').replace(/,(\s*})/g,"$1"));break;default:o=t}else o=n;return o}catch(e){return console.warn("formatValue file, please input element attr",e),function(t){try{return new Function("return "+t)()}catch(t){console.warn("eval fail",t)}}(t)}}!function(){if(void 0!==window.Reflect&&void 0!==window.customElements&&!window.customElements.hasOwnProperty("polyfillWrapFlushCallback")){var t=HTMLElement;window.HTMLElement=function(){return Reflect.construct(t,[],this.constructor)},HTMLElement.prototype=t.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,t)}}(),"function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;var g={store:null,root:self||window||function(){return this}(),mapping:{},vnode:void 0},w="prevProps",S=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,M=Symbol("PROP_META_KEY"),C=Symbol("STATE_META_KEY"),N=Symbol("COMPONENT_CUSTOM_EVENT"),E=Symbol("COMPONENT_CUSTOM_METHOD"),O=Symbol("COMPONENT_CUSTOM_INJECT"),P=Symbol("COMPONENT_CUSTOM_PROVIDE"),j=Symbol("COMPONENT_WATCH");function T(t){var e=t.parentNode;e&&e.removeChild(t)}function k(t,e,n){return"string"==typeof e||"number"==typeof e?void 0!==t.splitText:"string"==typeof e.nodeName?!t._componentConstructor&&_(t,e.nodeName):"function"==typeof e.nodeName?g.mapping[t.nodeName.toLowerCase()]===e.nodeName:n||t._componentConstructor===e.nodeName}function _(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function A(t){return this._listeners[t.type](g.event&&g.event(t)||t)}var L={};function R(t,e,n,o,r,i){if("className"===e&&(e="class"),"o"==e[0]&&"-"==e[1])L[e]&&L[e](t,o,i);else if("key"===e);else if("ref"===e)v(n,null),v(o,t);else if("class"!==e||r)if("style"===e){if(o&&"string"!=typeof o&&"string"!=typeof n||(t.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var s in n)s in o||(t.style[s]="");for(var s in o)t.style[s]="number"==typeof o[s]&&!1===S.test(s)?o[s]+"px":o[s]}}else if("dangerouslySetInnerHTML"===e)o&&(t.innerHTML=o.__html||"");else if("o"==e[0]&&"n"==e[1])!function(t,e,n,o){var r=e!==(e=e.replace(/Capture$/,"")),i=e.toLowerCase();e=(i in t?i:e).slice(2),n?o||t.addEventListener(e,A,r):t.removeEventListener(e,A,r),(t._listeners||(t._listeners={}))[e]=n}(t,e,o,n);else if("INPUT"===t.nodeName&&"value"===e)t[e]=null==o?"":o;else if("list"!==e&&"type"!==e&&"css"!==e&&!r&&e in t&&""!==o){try{t[e]=null==o?"":o}catch(t){}null!=o&&!1!==o||"spellcheck"==e||(t.pureRemoveAttribute?t.pureRemoveAttribute(e):t.removeAttribute(e))}else{var a=r&&e!==(e=e.replace(/^xlink:?/,""));null==o||!1===o?a?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.pureRemoveAttribute?t.pureRemoveAttribute(e):t.removeAttribute(e):"function"!=typeof o&&(a?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),o):t.pureSetAttribute?t.pureSetAttribute(e,o):t.setAttribute(e,o))}else t.className=o||""}t.diffLevel=0;var $=!1,I=!1;function x(e,n,o,r,i){var s;if(e||n)return t.diffLevel++||($=null!=o&&void 0!==o.ownerSVGElement,I=null!=e&&!(w in e)),n&&n.nodeName===h&&(n=n.children),y(n)?o?H(o,n,I,r,i):(s=[],n.forEach((function(t,n){var o=U(0===n?e:null,t,r,i);s.push(o)}))):(y(e)?e.forEach((function(t,e){0===e?s=U(t,n,r,i):W(t,!1)})):s=U(e,n,r,i),o&&s.parentNode!==o&&o.appendChild(s)),--t.diffLevel||(I=!1),s}function U(t,e,n,o){t&&e&&t.props&&(t.props.children=e.children);var r=t,i=$;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||n)?t.nodeValue!=e&&(t.nodeValue=e):(r=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(r,t),W(t,!0))),r.prevProps=!0,r;var s,a,l=e.nodeName;if("function"==typeof l)for(var c in g.mapping)if(g.mapping[c]===l){l=c,e.nodeName=c;break}if($="svg"===l||"foreignObject"!==l&&$,l=String(l),(!t||!_(t,l))&&(s=l,(a=$?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s)).normalizedNodeName=s,r=a,t)){for(;t.firstChild;)r.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(r,t),W(t,!0)}var u=r.firstChild,p=r.prevProps,f=e.children;if(null==p){p=r.prevProps={};for(var h=r.attributes,v=h.length;v--;)p[h[v].name]=h[v].value}return!I&&f&&1===f.length&&"string"==typeof f[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=f[0]&&(u.nodeValue=f[0]):(f&&f.length||null!=u)&&("CustomWebComponent"==r.constructor.is&&r.constructor.noSlot||H(r,f,I||null!=p.dangerouslySetInnerHTML,n,o)),function(t,e,n,o,r){var i,s,a=t.update;t.receiveProps&&(s=Object.assign({},n));for(i in n)e&&null!=e[i]||null==n[i]||(R(t,i,n[i],n[i]=void 0,$,o),a&&delete t.props[i]);for(i in e)if(a&&"object"==typeof e[i]&&"ref"!==i){"style"===i&&R(t,i,n[i],n[i]=e[i],$,o);var l=d(i);t.props[l]=n[l]=e[i]}else if("children"!==i&&(!(i in n)||e[i]!==("value"===i||"checked"===i?t[i]:n[i])))if(R(t,i,n[i],e[i],$,o),-1!==t.nodeName.indexOf("-")){t.props=t.props||{};l=d(i);t.props[l]=n[l]=e[i]}else n[i]=e[i];a&&!r&&t.parentNode&&!1!==t.receiveProps(t.props,s)&&t.update()}(r,e.attributes,p,n,o),r.props&&(r.props.children=e.children),$=i,r}function H(t,e,n,o,r){var i,s,a,l,c,u=t.childNodes,p=[],f={},d=0,h=0,v=(null==u?void 0:u.length)||0,y=0,m=e?e.length:0;if(0!==v)for(var b=0;b0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isProvide",{get:function(){return Object.keys(this.providesMap).length>0},enumerable:!1,configurable:!0}),e.prototype.removeAttribute=function(e){t.prototype.removeAttribute.call(this,e),this.isInstalled&&this.update()},e.prototype.setAttribute=function(e,n){var o;o=n&&"object"==typeof n?JSON.stringify(n):n,t.prototype.setAttribute.call(this,e,o),this.isInstalled&&(this[e]=n)},e.prototype.getAttribute=function(e){var n=this[e];return n||(n=t.prototype.getAttribute.call(this,e)),n},e.prototype.pureRemoveAttribute=function(e){t.prototype.removeAttribute.call(this,e)},e.prototype.pureSetAttribute=function(e,n){t.prototype.setAttribute.call(this,e,n)},e.prototype.attributeChangedCallback=function(t,e,n){this.update([],!1)},e.prototype.update=function(t,e){this.callUpdate(t,e)},e.prototype.callUpdate=function(t,e){if(this.isInstalled&&!this.willUpdate&&this.preBeforeUpdate()){this.willUpdate=!0,this.beforeUpdate(),this.beforeRender(),this.customStyleContent!=this.$options.css&&(this.customStyleContent=this.$options.css);var n=this.render(this.$reactive,this.store);this.rendered(),this.rootNode=x(this.rootNode,n,(null==this?void 0:this.shadowRoot)||this,this,e),this.willUpdate=!1,this.updated()}},e.prototype.initShadowRoot=function(){var t,e,n;if("LightDom"===this.$options.is)n=this;else{n=this.shadowRoot||(null===(t=this.attachShadow)||void 0===t?void 0:t.call(this,{mode:"open"}));for(var o=void 0;o=n.firstChild;)n.removeChild(o)}n=this.initCss(n),this.css&&n.appendChild(f("function"==typeof this.css?this.css():this.css));var r=null===(e=this.$reactive)||void 0===e?void 0:e.css;return r&&(this.customStyleElement=f(r),this.customStyleContent=r,n.appendChild(this.customStyleElement)),n},e.prototype.updateInject=function(t){var e=this;this.isInject&&Promise.resolve().then((function(){for(var n,o,r=e.parentNode;r&&!o;)(o=r.isProvide?r.providesMap:void 0)&&(n=r),r=r.parentNode||r.host;if(o)return e.injectsList.forEach((function(t){var r=o[t.key].functionName;e[t.attr]=n[r]()})),void("function"==typeof t&&t());console.warn("The provide prop was not found on the parent node or the provide type is incorrect. please check ".concat(e.tagName))}))},e.prototype.connectedCallback=function(){var t=this;this.updateInject(this.update.bind(this));var e=this.initShadowRoot();this.attrsToProps(),this.beforeInstall(),this.install(),this.afterInstall(),this.beforeRender();var n=this.render(this.$reactive,this.store);this.rootNode=x(null,n,null,this),!0===this.$options.isMountDom&&(Array.isArray(this.rootNode)?this.rootNode.forEach((function(t){return e.appendChild(t)})):this.rootNode&&e.appendChild(this.rootNode)),this.isInstalled=!0,this.rendered(),this.isInject?Promise.resolve().then((function(){return t.connected(e)})):this.connected(e)},e.prototype.disconnectedCallback=function(){this.disConnected()},e.prototype.connected=function(t){},e.prototype.disConnected=function(){},e.prototype.preBeforeUpdate=function(){return!0},e.prototype.beforeUpdate=function(){},e.prototype.updated=function(){},e.prototype.forceUpdate=function(){this.update([],!0)},e.prototype.updateProps=function(t){var e=this;Object.keys(t).forEach((function(n){e[n]=t[n],e.prevProps&&(e.prevProps[n]=t[n])})),this.forceUpdate()},e.prototype.attrsToProps=function(t){var e=this,n=this,o=function(t){for(var e={},n=0,o=t.attributes.length;n2;)D.push(arguments[i]);for(e&&null!=e.children&&(D.length||D.push(e.children),delete e.children);D.length;)if((o=D.pop())&&void 0!==o.pop)for(i=o.length;i--;)D.push(o[i]);else"boolean"==typeof o&&(o=null),(r="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(r=!1)),r&&n?s[s.length-1]+=o:0===s.length?s=[o]:s.push(o),n=r;if(t===h)return s;var a={nodeName:t,children:s,attributes:null==e?void 0:e,key:null==e?void 0:e.key};return void 0!==g.vnode&&g.vnode(a),a},t.mounts=[],t.recollectNodeTree=W,t.removeChildren=V,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/component/packages/wu-code-playground/deplpy/static/playground/index.umd.js b/component/packages/wu-code-playground/deplpy/static/playground/index.umd.js new file mode 100644 index 00000000..db2e3cb1 --- /dev/null +++ b/component/packages/wu-code-playground/deplpy/static/playground/index.umd.js @@ -0,0 +1 @@ +!function(g,I){"object"==typeof exports&&"undefined"!=typeof module?I(exports,require("@wu-component/web-core-plus")):"function"==typeof define&&define.amd?define(["exports","@wu-component/web-core-plus"],I):I((g="undefined"!=typeof globalThis?globalThis:g||self).WuCodePlayground={},g.webCorePlus)}(this,(function(g,I){"use strict";var C=function(g,I){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,I){g.__proto__=I}||function(g,I){for(var C in I)Object.prototype.hasOwnProperty.call(I,C)&&(g[C]=I[C])},C(g,I)};function A(g,I,C,A){var l,n=arguments.length,V=n<3?I:null===A?A=Object.getOwnPropertyDescriptor(I,C):A;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)V=Reflect.decorate(g,I,C,A);else for(var Z=g.length-1;Z>=0;Z--)(l=g[Z])&&(V=(n<3?l(V):n>3?l(I,C,V):l(I,C))||V);return n>3&&V&&Object.defineProperty(I,C,V),V}function l(g,I){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(g,I)}function n(g,I,C,A){return new(C||(C=Promise))((function(l,n){function V(g){try{c(A.next(g))}catch(g){n(g)}}function Z(g){try{c(A.throw(g))}catch(g){n(g)}}function c(g){var I;g.done?l(g.value):(I=g.value,I instanceof C?I:new C((function(g){g(I)}))).then(V,Z)}c((A=A.apply(g,I||[])).next())}))}function V(g,I){var C,A,l,n,V={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]};return n={next:Z(0),throw:Z(1),return:Z(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function Z(n){return function(Z){return function(n){if(C)throw new TypeError("Generator is already executing.");for(;V;)try{if(C=1,A&&(l=2&n[0]?A.return:n[0]?A.throw||((l=A.return)&&l.call(A),0):A.next)&&!(l=l.call(A,n[1])).done)return l;switch(A=0,l&&(n=[2&n[0],l.value]),n[0]){case 0:case 1:l=n;break;case 4:return V.label++,{value:n[1],done:!1};case 5:V.label++,A=n[1],n=[0];continue;case 7:n=V.ops.pop(),V.trys.pop();continue;default:if(!(l=V.trys,(l=l.length>0&&l[l.length-1])||6!==n[0]&&2!==n[0])){V=0;continue}if(3===n[0]&&(!l||n[1]>l[0]&&n[1]=0;c--)(e=g[c])&&(o=(n<3?e(o):n>3?e(I,C,o):e(I,C))||o);return n>3&&o&&Object.defineProperty(I,C,o),o}function n(g,I){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(g,I)}function o(g,I,C,A){return new(C||(C=Promise))((function(e,n){function o(g){try{t(A.next(g))}catch(g){n(g)}}function c(g){try{t(A.throw(g))}catch(g){n(g)}}function t(g){var I;g.done?e(g.value):(I=g.value,I instanceof C?I:new C((function(g){g(I)}))).then(o,c)}t((A=A.apply(g,I||[])).next())}))}function c(g,I){var C,A,e,n,o={label:0,sent:function(){if(1&e[0])throw e[1];return e[1]},trys:[],ops:[]};return n={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function c(n){return function(c){return function(n){if(C)throw new TypeError("Generator is already executing.");for(;o;)try{if(C=1,A&&(e=2&n[0]?A.return:n[0]?A.throw||((e=A.return)&&e.call(A),0):A.next)&&!(e=e.call(A,n[1])).done)return e;switch(A=0,e&&(n=[2&n[0],e.value]),n[0]){case 0:case 1:e=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,A=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(e=o.trys,(e=e.length>0&&e[e.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!e||n[1]>e[0]&&n[1]0)&&!(A=n.next()).done;)o.push(A.value)}catch(g){e={error:g}}finally{try{A&&!A.done&&(C=n.return)&&C.call(n)}finally{if(e)throw e.error}}return o}(this.pending_cmds.keys()),!1))},g.prototype.handle_repl_message=function(g){if(g.source===this.iframe.contentWindow){var I=g.data,C=I.action,A=I.args;switch(this.handlers.on_default_event(g),C){case"cmd_error":case"cmd_ok":return this.handle_command_message(g.data);case"fetch_progress":return this.handlers.on_fetch_progress(A.remaining);case"error":return this.handlers.on_error(g.data);case"unhandledrejection":return this.handlers.on_unhandled_rejection(g.data);case"console":return this.handlers.on_console(g.data);case"console_group":return this.handlers.on_console_group(g.data);case"console_group_collapsed":return this.handlers.on_console_group_collapsed(g.data);case"console_group_end":return this.handlers.on_console_group_end(g.data)}}},g.prototype.eval=function(g){return this.iframe_command("eval",{script:g})},g.prototype.handle_links=function(){return this.iframe_command("catch_clicks",{})},g.prototype.load_depend=function(g){return this.iframe_command("load_dependencies",g)},g}(),d="CODE_DEPENDENCIES",s="CODE_TYPES",b=function(){function g(g){void 0===g&&(g={dependencies:{},types:{}}),this.code=[],this.init(g)}return g.prototype.init=function(g){var I=g.dependencies,C=void 0===I?{}:I,e=g.types,n=void 0===e?{}:e,o=localStorage.getItem(d)?JSON.parse(localStorage.getItem(d)):{},c=localStorage.getItem(s)?JSON.parse(localStorage.getItem(s)):{};o=A(A({},o),C||{}),c=A(A({},c),{types:n||{}}),localStorage.setItem(d,JSON.stringify(o)),localStorage.setItem(s,JSON.stringify(c)),this.__dependencies=o,this.__types=c},g.prototype.createDependencies=function(g,I){this.__dependencies=A(A({},this.__dependencies),{name:I}),localStorage.setItem(d,JSON.stringify(this.__dependencies))},Object.defineProperty(g.prototype,"dependencies",{get:function(){return this.__dependencies},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"types",{get:function(){return this.__types},enumerable:!1,configurable:!0}),g.prototype.pushStackCode=function(g){this.code.push(g)},g}(),r=function(g){function A(){var I=g.call(this)||this;return I.container=null,I}return function(g,I){if("function"!=typeof I&&null!==I)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");function A(){this.constructor=g}C(g,I),g.prototype=null===I?Object.create(I):(A.prototype=I.prototype,new A)}(A,g),A.prototype.formatFile=function(g){return new Promise((function(I){if(g.startsWith("data:")){for(var C=g.split(","),A=atob(C[1]),e=A.length,n=new Uint8Array(e);e--;)n[e]=A.charCodeAt(e);var o=new File([n],"srcdoc.html",{type:"text/html"}),c=new FileReader;c.onload=function(){I(c.result)},c.readAsText(o,"utf-8")}else I(g)}))},A.prototype.connected=function(g){return o(this,void 0,void 0,(function(){var I,C,A,e,n,o=this;return c(this,(function(c){switch(c.label){case 0:return I=this.props.initialSrcDoc,this.container=g.querySelector("#codeIframe"),C=document.createElement("div"),A={},I?(e=this,[4,this.formatFile(I)]):[3,2];case 1:e.initialSrcDoc=c.sent(),C.innerHTML=this.initialSrcDoc,n=C.querySelector("#dependenciesMap"),A=JSON.parse(n.innerHTML)?JSON.parse(n.innerHTML).imports:{},c.label=2;case 2:return this.previewStore=new b({dependencies:A}),this.proxy=new i(this.container,{on_fetch_progress:function(g){},on_error:function(g){console.log("on_error",g)},on_unhandled_rejection:function(g){console.log("on_unhandled_rejection",g)},on_console:function(g){console.log("log",g)},on_console_group:function(g){},on_console_group_end:function(g){},on_console_group_collapsed:function(g){},on_default_event:function(g){o.emitEvent(g)}}),this.container.addEventListener("load",(function(){o.proxy.handle_links().then((function(g){})),o.proxy.load_depend({dependencies:o.previewStore.dependencies}).then((function(){for(var g=0;g + + + - - diff --git a/component/packages/wu-monaco-editor/nodemon-debug.json b/component/packages/wu-code-playground/nodemon-debug.json similarity index 100% rename from component/packages/wu-monaco-editor/nodemon-debug.json rename to component/packages/wu-code-playground/nodemon-debug.json diff --git a/component/packages/wu-monaco-editor/nodemon.json b/component/packages/wu-code-playground/nodemon.json similarity index 100% rename from component/packages/wu-monaco-editor/nodemon.json rename to component/packages/wu-code-playground/nodemon.json diff --git a/component/packages/wu-monaco-editor/package-lock.json b/component/packages/wu-code-playground/package-lock.json similarity index 100% rename from component/packages/wu-monaco-editor/package-lock.json rename to component/packages/wu-code-playground/package-lock.json diff --git a/component/packages/wu-monaco-editor/package.json b/component/packages/wu-code-playground/package.json similarity index 100% rename from component/packages/wu-monaco-editor/package.json rename to component/packages/wu-code-playground/package.json diff --git a/component/packages/wu-code-playground/public/code_editor/index.umd.js b/component/packages/wu-code-playground/public/code_editor/index.umd.js new file mode 100644 index 00000000..86063957 --- /dev/null +++ b/component/packages/wu-code-playground/public/code_editor/index.umd.js @@ -0,0 +1 @@ +!function(o,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@wu-component/web-core-plus")):"function"==typeof define&&define.amd?define(["exports","@wu-component/web-core-plus"],e):e((o="undefined"!=typeof globalThis?globalThis:o||self).WuCodeMonacoEditor={},o.webCorePlus)}(this,(function(o,e){"use strict";var t=function(o,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,e){o.__proto__=e}||function(o,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(o[t]=e[t])},t(o,e)};var i=function(){return i=Object.assign||function(o){for(var e,t=1,i=arguments.length;t=0;c--)(n=o[c])&&(a=(r<3?n(a):r>3?n(e,t,a):n(e,t))||a);return r>3&&a&&Object.defineProperty(e,t,a),a}function r(o,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(o,e)}function a(o,e,t,i){return new(t||(t=Promise))((function(n,r){function a(o){try{d(i.next(o))}catch(o){r(o)}}function c(o){try{d(i.throw(o))}catch(o){r(o)}}function d(o){var e;o.done?n(o.value):(e=o.value,e instanceof t?e:new t((function(o){o(e)}))).then(a,c)}d((i=i.apply(o,e||[])).next())}))}function c(o,e){var t,i,n,r,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return r={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function c(r){return function(c){return function(r){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]=0||(n[t]=o[t]);return n}(o,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(o,t)&&(n[t]=o[t])}return n}function h(o,e){(null==e||e>o.length)&&(e=o.length);for(var t=0,i=new Array(e);t=o.length?o.apply(this,n):function(){for(var o=arguments.length,i=new Array(o),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};z.initial(o),z.handler(e);var t={current:o},i=v(j)(t,e),n=v(D)(t),r=v(z.changes)(o),a=v(A)(t);function c(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(o){return o};return z.selector(o),o(t.current)}function d(o){x(i,n,r,a)(o)}return[c,d]}};var N,C={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},q=(N=function(o,e){throw new Error(o[e]||o.default)},function o(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n=N.length?N.apply(this,i):function(){for(var t=arguments.length,n=new Array(t),r=0;r - - + + + diff --git a/component/packages/wu-code-playground/public/sandbox/index.umd.js b/component/packages/wu-code-playground/public/sandbox/index.umd.js new file mode 100644 index 00000000..304835ee --- /dev/null +++ b/component/packages/wu-code-playground/public/sandbox/index.umd.js @@ -0,0 +1 @@ +!function(g,I){"object"==typeof exports&&"undefined"!=typeof module?I(exports,require("@wu-component/web-core-plus")):"function"==typeof define&&define.amd?define(["exports","@wu-component/web-core-plus"],I):I((g="undefined"!=typeof globalThis?globalThis:g||self).WuCodeSandbox={},g.webCorePlus)}(this,(function(g,I){"use strict";var C=function(g,I){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,I){g.__proto__=I}||function(g,I){for(var C in I)Object.prototype.hasOwnProperty.call(I,C)&&(g[C]=I[C])},C(g,I)};var A=function(){return A=Object.assign||function(g){for(var I,C=1,A=arguments.length;C=0;c--)(e=g[c])&&(o=(n<3?e(o):n>3?e(I,C,o):e(I,C))||o);return n>3&&o&&Object.defineProperty(I,C,o),o}function n(g,I){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(g,I)}function o(g,I,C,A){return new(C||(C=Promise))((function(e,n){function o(g){try{t(A.next(g))}catch(g){n(g)}}function c(g){try{t(A.throw(g))}catch(g){n(g)}}function t(g){var I;g.done?e(g.value):(I=g.value,I instanceof C?I:new C((function(g){g(I)}))).then(o,c)}t((A=A.apply(g,I||[])).next())}))}function c(g,I){var C,A,e,n,o={label:0,sent:function(){if(1&e[0])throw e[1];return e[1]},trys:[],ops:[]};return n={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function c(n){return function(c){return function(n){if(C)throw new TypeError("Generator is already executing.");for(;o;)try{if(C=1,A&&(e=2&n[0]?A.return:n[0]?A.throw||((e=A.return)&&e.call(A),0):A.next)&&!(e=e.call(A,n[1])).done)return e;switch(A=0,e&&(n=[2&n[0],e.value]),n[0]){case 0:case 1:e=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,A=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(e=o.trys,(e=e.length>0&&e[e.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!e||n[1]>e[0]&&n[1]0)&&!(A=n.next()).done;)o.push(A.value)}catch(g){e={error:g}}finally{try{A&&!A.done&&(C=n.return)&&C.call(n)}finally{if(e)throw e.error}}return o}(this.pending_cmds.keys()),!1))},g.prototype.handle_repl_message=function(g){if(g.source===this.iframe.contentWindow){var I=g.data,C=I.action,A=I.args;switch(this.handlers.on_default_event(g),C){case"cmd_error":case"cmd_ok":return this.handle_command_message(g.data);case"fetch_progress":return this.handlers.on_fetch_progress(A.remaining);case"error":return this.handlers.on_error(g.data);case"unhandledrejection":return this.handlers.on_unhandled_rejection(g.data);case"console":return this.handlers.on_console(g.data);case"console_group":return this.handlers.on_console_group(g.data);case"console_group_collapsed":return this.handlers.on_console_group_collapsed(g.data);case"console_group_end":return this.handlers.on_console_group_end(g.data)}}},g.prototype.eval=function(g){return this.iframe_command("eval",{script:g})},g.prototype.handle_links=function(){return this.iframe_command("catch_clicks",{})},g.prototype.load_depend=function(g){return this.iframe_command("load_dependencies",g)},g}(),d="CODE_DEPENDENCIES",s="CODE_TYPES",b=function(){function g(g){void 0===g&&(g={dependencies:{},types:{}}),this.code=[],this.init(g)}return g.prototype.init=function(g){var I=g.dependencies,C=void 0===I?{}:I,e=g.types,n=void 0===e?{}:e,o=localStorage.getItem(d)?JSON.parse(localStorage.getItem(d)):{},c=localStorage.getItem(s)?JSON.parse(localStorage.getItem(s)):{};o=A(A({},o),C||{}),c=A(A({},c),{types:n||{}}),localStorage.setItem(d,JSON.stringify(o)),localStorage.setItem(s,JSON.stringify(c)),this.__dependencies=o,this.__types=c},g.prototype.createDependencies=function(g,I){this.__dependencies=A(A({},this.__dependencies),{name:I}),localStorage.setItem(d,JSON.stringify(this.__dependencies))},Object.defineProperty(g.prototype,"dependencies",{get:function(){return this.__dependencies},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"types",{get:function(){return this.__types},enumerable:!1,configurable:!0}),g.prototype.pushStackCode=function(g){this.code.push(g)},g}(),r=function(g){function A(){var I=g.call(this)||this;return I.container=null,I}return function(g,I){if("function"!=typeof I&&null!==I)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");function A(){this.constructor=g}C(g,I),g.prototype=null===I?Object.create(I):(A.prototype=I.prototype,new A)}(A,g),A.prototype.formatFile=function(g){return new Promise((function(I){if(g.startsWith("data:")){for(var C=g.split(","),A=atob(C[1]),e=A.length,n=new Uint8Array(e);e--;)n[e]=A.charCodeAt(e);var o=new File([n],"srcdoc.html",{type:"text/html"}),c=new FileReader;c.onload=function(){I(c.result)},c.readAsText(o,"utf-8")}else I(g)}))},A.prototype.connected=function(g){return o(this,void 0,void 0,(function(){var I,C,A,e,n,o=this;return c(this,(function(c){switch(c.label){case 0:return I=this.props.initialSrcDoc,this.container=g.querySelector("#codeIframe"),C=document.createElement("div"),A={},I?(e=this,[4,this.formatFile(I)]):[3,2];case 1:e.initialSrcDoc=c.sent(),C.innerHTML=this.initialSrcDoc,n=C.querySelector("#dependenciesMap"),A=JSON.parse(n.innerHTML)?JSON.parse(n.innerHTML).imports:{},c.label=2;case 2:return this.previewStore=new b({dependencies:A}),this.proxy=new i(this.container,{on_fetch_progress:function(g){},on_error:function(g){console.log("on_error",g)},on_unhandled_rejection:function(g){console.log("on_unhandled_rejection",g)},on_console:function(g){console.log("log",g)},on_console_group:function(g){},on_console_group_end:function(g){},on_console_group_collapsed:function(g){},on_default_event:function(g){o.emitEvent(g)}}),this.container.addEventListener("load",(function(){o.proxy.handle_links().then((function(g){})),o.proxy.load_depend({dependencies:o.previewStore.dependencies}).then((function(){for(var g=0;g + diff --git a/component/packages/wu-code-sandbox/src/index.tsx b/component/packages/wu-code-sandbox/src/index.tsx index 8b98fc22..a75ab2ae 100644 --- a/component/packages/wu-code-sandbox/src/index.tsx +++ b/component/packages/wu-code-sandbox/src/index.tsx @@ -1,8 +1,8 @@ -import { Component, h, OnConnected, Prop, WuComponent } from "@wu-component/web-core-plus"; +import { Component, Emit, h, OnConnected, Prop, WuComponent } from "@wu-component/web-core-plus"; import css from './index.scss'; import { PreviewProxy, LoadDependencies } from "./sandbox"; import { Store } from "./Store"; -import srcdoc from './srcdoc.txt'; +import srcdoc from './srcdoc.html'; @Component({ name: 'wu-code-sandbox', @@ -77,25 +77,35 @@ export class WuMonacoEditorPreview extends WuComponent implements OnConnected { // 示例话沙箱代理 this.proxy = new PreviewProxy(this.container, { on_fetch_progress: (progress: any) => { + // this.emitEvent(progress); // pending_imports = progress; }, on_error: (event: any) => { + // this.emitEvent(event); console.log("on_error", event); }, on_unhandled_rejection: (event: any) => { + // this.emitEvent(event); console.log("on_unhandled_rejection", event); }, on_console: (log: any) => { + // this.emitEvent(log); console.log("log", log); }, on_console_group: (action: any) => { + // this.emitEvent(action); // group_logs(action.label, false); }, - on_console_group_end: () => { + on_console_group_end: (event: any) => { + // this.emitEvent(event); // ungroup_logs(); }, on_console_group_collapsed: (action: any) => { + // this.emitEvent(event); // group_logs(action.label, true); + }, + on_default_event: (event: any) => { + this.emitEvent(event); } }); // 沙箱实例完成 @@ -131,10 +141,22 @@ export class WuMonacoEditorPreview extends WuComponent implements OnConnected { } + /** + * 沙箱加载依赖 + * @param options + */ public loadDependencies(options: LoadDependencies) { return this.proxy.load_depend(options); } + @Emit("message") + public emitEvent(data: any) { + return { + data: data || {} + }; + + } + public override render(_renderProps = {}, _store = {}) { const sandbox = () => [ 'allow-forms', 'allow-modals', 'allow-pointer-lock', 'allow-popups', 'allow-same-origin', 'allow-scripts', 'allow-top-navigation-by-user-activation' ].join(' '); return ( diff --git a/component/packages/wu-code-sandbox/src/sandbox/PreviewProxy.ts b/component/packages/wu-code-sandbox/src/sandbox/PreviewProxy.ts index 2084f4a1..14c37627 100644 --- a/component/packages/wu-code-sandbox/src/sandbox/PreviewProxy.ts +++ b/component/packages/wu-code-sandbox/src/sandbox/PreviewProxy.ts @@ -68,7 +68,7 @@ export class PreviewProxy { if (event.source !== this.iframe.contentWindow) return; const { action, args } = event.data; - + this.handlers.on_default_event(event); switch (action) { case 'cmd_error': case 'cmd_ok': diff --git a/component/packages/wu-code-sandbox/src/srcdoc.txt b/component/packages/wu-code-sandbox/src/srcdoc.html similarity index 100% rename from component/packages/wu-code-sandbox/src/srcdoc.txt rename to component/packages/wu-code-sandbox/src/srcdoc.html diff --git a/component/packages/wu-code-sandbox/types/index.d.ts b/component/packages/wu-code-sandbox/types/index.d.ts index 8cffb1c4..abfff9d9 100644 --- a/component/packages/wu-code-sandbox/types/index.d.ts +++ b/component/packages/wu-code-sandbox/types/index.d.ts @@ -16,6 +16,13 @@ export declare class WuMonacoEditorPreview extends WuComponent implements OnConn * @param code */ runCode(type: string, code: string): void; + /** + * 沙箱加载依赖 + * @param options + */ loadDependencies(options: LoadDependencies): Promise; + emitEvent(data: any): { + data: any; + }; render(_renderProps?: {}, _store?: {}): any; } diff --git a/component/packages/wu-monaco-editor/public/co/index.umd.js b/component/packages/wu-monaco-editor/public/co/index.umd.js deleted file mode 100644 index 95a5c8fd..00000000 --- a/component/packages/wu-monaco-editor/public/co/index.umd.js +++ /dev/null @@ -1,16 +0,0 @@ -!function(o,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((o="undefined"!=typeof globalThis?globalThis:o||self).WuCodeMonacoEditor={})}(this,(function(o){"use strict";var e=function(o,t){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,e){o.__proto__=e}||function(o,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(o[t]=e[t])},e(o,t)};var t=function(){return t=Object.assign||function(o){for(var e,t=1,i=arguments.length;t=0;c--)(n=o[c])&&(a=(r<3?n(a):r>3?n(e,t,a):n(e,t))||a);return r>3&&a&&Object.defineProperty(e,t,a),a}function n(o,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(o,e)}function r(o,e,t,i){return new(t||(t=Promise))((function(n,r){function a(o){try{s(i.next(o))}catch(o){r(o)}}function c(o){try{s(i.throw(o))}catch(o){r(o)}}function s(o){var e;o.done?n(o.value):(e=o.value,e instanceof t?e:new t((function(o){o(e)}))).then(a,c)}s((i=i.apply(o,e||[])).next())}))}function a(o,e){var t,i,n,r,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return r={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function c(r){return function(c){return function(r){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]{i=o(e,t,i)||i})),i}(o,e,t,i):"function"==typeof e?function(o,e){return o.reverse().forEach((o=>{const t=o(e);t&&(e=t)})),e}(o,e):void 0},defineMetadata:function(o,e,t,i){d(o,e,t,i)},getMetadata:function(o,e,t){return p(o,e,t)},getOwnMetadata:function(o,e,t){return l(o,e,t)},hasMetadata:function(o,e,t){return!!p(o,e,t)},hasOwnMetadata:function(o,e,t){return!!l(o,e,t)},metadata:function(o,e){return function(t,i){d(o,e,t,i)}}};Object.assign(Reflect,m);var u=function(o,e){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,e){o.__proto__=e}||function(o,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(o[t]=e[t])},u(o,e)},g=function(){return g=Object.assign||function(o){for(var e,t=1,i=arguments.length;t - * @license MIT - */!function(o){if(!o.WeakMap){var e=Object.prototype.hasOwnProperty,t=Object.defineProperty&&function(){try{return 1===Object.defineProperty({},"x",{value:1}).x}catch(o){}}(),i=function(o,e,i){t?Object.defineProperty(o,e,{configurable:!0,writable:!0,value:i}):o[e]=i};o.WeakMap=function(){function o(){if(void 0===this)throw new TypeError("Constructor WeakMap requires 'new'");if(i(this,"_id",r("_WeakMap")),arguments.length>0)throw new TypeError("WeakMap iterable is not supported")}function t(o,t){if(!n(o)||!e.call(o,"_id"))throw new TypeError(t+" method called on incompatible receiver "+typeof o)}function r(o){return o+"_"+a()+"."+a()}function a(){return Math.random().toString().substring(2)}return i(o.prototype,"delete",(function(o){if(t(this,"delete"),!n(o))return!1;var e=o[this._id];return!(!e||e[0]!==o||(delete o[this._id],0))})),i(o.prototype,"get",(function(o){if(t(this,"get"),n(o)){var e=o[this._id];return e&&e[0]===o?e[1]:void 0}})),i(o.prototype,"has",(function(o){if(t(this,"has"),!n(o))return!1;var e=o[this._id];return!(!e||e[0]!==o)})),i(o.prototype,"set",(function(o,e){if(t(this,"set"),!n(o))throw new TypeError("Invalid value used as weak map key");var r=o[this._id];return r&&r[0]===o?(r[1]=e,this):(i(o,this._id,[o,e]),this)})),i(o,"_polyfill",!0),o}()}function n(o){return Object(o)===o}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:f);var b=function(o){return o.replace(/(?!^)([A-Z])/g," $1").replace(/[_\s]+(?=[a-zA-Z])/g,".").toLowerCase()}; -/** - * @license - * Copyright (c) 2016 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt - */function w(o){var e=document.createElement("style");return e.textContent=o,e}function v(o){return o.replace(/-(\w)/g,(function(o,e){return e.toUpperCase()}))}function x(o){return o.children}function y(o,e){null!=o&&("function"==typeof o?o(e):o.current=e)}function k(o){return"[object Array]"===Object.prototype.toString.call(o)}function M(o){return o.indexOf("-")>-1?o.replace(/(\-([a-z]))/g,(function(o,e,t,i,n){return t.toUpperCase()})):o}!function(){if(void 0!==window.Reflect&&void 0!==window.customElements&&!window.customElements.hasOwnProperty("polyfillWrapFlushCallback")){var o=HTMLElement;window.HTMLElement=function(){return Reflect.construct(o,[],this.constructor)},HTMLElement.prototype=o.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,o)}}(),"function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;var A={store:null,root:self||window||function(){return this}(),mapping:{},vnode:void 0},z=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,j=Symbol("PROP_META_KEY"),N=Symbol("STATE_META_KEY"),C=Symbol("COMPONENT_CUSTOM_EVENT"),D=Symbol("COMPONENT_CUSTOM_INJECT"),O=Symbol("COMPONENT_CUSTOM_PROVIDE"),S=Symbol("COMPONENT_WATCH");function I(o){var e=o.parentNode;e&&e.removeChild(o)}function q(o,e,t){return"string"==typeof e||"number"==typeof e?void 0!==o.splitText:"string"==typeof e.nodeName?!o._componentConstructor&&L(o,e.nodeName):"function"==typeof e.nodeName?A.mapping[o.nodeName.toLowerCase()]===e.nodeName:t||o._componentConstructor===e.nodeName}function L(o,e){return o.normalizedNodeName===e||o.nodeName.toLowerCase()===e.toLowerCase()}function E(o){return this._listeners[o.type](A.event&&A.event(o)||o)}var P={};function T(o,e,t,i,n,r){if("className"===e&&(e="class"),"o"==e[0]&&"-"==e[1])P[e]&&P[e](o,i,r);else if("key"===e);else if("ref"===e)y(t,null),y(i,o);else if("class"!==e||n)if("style"===e){if(i&&"string"!=typeof i&&"string"!=typeof t||(o.style.cssText=i||""),i&&"object"==typeof i){if("string"!=typeof t)for(var a in t)a in i||(o.style[a]="");for(var a in i)o.style[a]="number"==typeof i[a]&&!1===z.test(a)?i[a]+"px":i[a]}}else if("dangerouslySetInnerHTML"===e)i&&(o.innerHTML=i.__html||"");else if("o"==e[0]&&"n"==e[1])!function(o,e,t,i){var n=e!==(e=e.replace(/Capture$/,"")),r=e.toLowerCase();e=(r in o?r:e).slice(2),t?i||o.addEventListener(e,E,n):o.removeEventListener(e,E,n),(o._listeners||(o._listeners={}))[e]=t}(o,e,i,t);else if("INPUT"===o.nodeName&&"value"===e)o[e]=null==i?"":i;else if("list"!==e&&"type"!==e&&"css"!==e&&!n&&e in o&&""!==i){try{o[e]=null==i?"":i}catch(o){}null!=i&&!1!==i||"spellcheck"==e||(o.pureRemoveAttribute?o.pureRemoveAttribute(e):o.removeAttribute(e))}else{var c=n&&e!==(e=e.replace(/^xlink:?/,""));null==i||!1===i?c?o.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):o.pureRemoveAttribute?o.pureRemoveAttribute(e):o.removeAttribute(e):"function"!=typeof i&&(c?o.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),i):o.pureSetAttribute?o.pureSetAttribute(e,i):o.setAttribute(e,i))}else o.className=i||""}var _=0,R=!1,W=!1;function B(o,e,t,i,n){var r;if(o||e)return _++||(R=null!=t&&void 0!==t.ownerSVGElement,W=null!=o&&!("prevProps"in o)),e&&e.nodeName===x&&(e=e.children),k(e)?t?U(t,e,W,i,n):(r=[],e.forEach((function(e,t){var a=Q(0===t?o:null,e,i,n);r.push(a)}))):(k(o)?o.forEach((function(o,t){0===t?r=Q(o,e,i,n):V(o,!1)})):r=Q(o,e,i,n),t&&r.parentNode!==t&&t.appendChild(r)),--_||(W=!1),r}function Q(o,e,t,i){o&&e&&o.props&&(o.props.children=e.children);var n=o,r=R;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return o&&void 0!==o.splitText&&o.parentNode&&(!o._component||t)?o.nodeValue!=e&&(o.nodeValue=e):(n=document.createTextNode(e),o&&(o.parentNode&&o.parentNode.replaceChild(n,o),V(o,!0))),n.prevProps=!0,n;var a,c,s=e.nodeName;if("function"==typeof s)for(var l in A.mapping)if(A.mapping[l]===s){s=l,e.nodeName=l;break}if(R="svg"===s||"foreignObject"!==s&&R,s=String(s),(!o||!L(o,s))&&(a=s,(c=R?document.createElementNS("http://www.w3.org/2000/svg",a):document.createElement(a)).normalizedNodeName=a,n=c,o)){for(;o.firstChild;)n.appendChild(o.firstChild);o.parentNode&&o.parentNode.replaceChild(n,o),V(o,!0)}var d=n.firstChild,p=n.prevProps,m=e.children;if(null==p){p=n.prevProps={};for(var u=n.attributes,g=u.length;g--;)p[u[g].name]=u[g].value}return!W&&m&&1===m.length&&"string"==typeof m[0]&&null!=d&&void 0!==d.splitText&&null==d.nextSibling?d.nodeValue!=m[0]&&(d.nodeValue=m[0]):(m&&m.length||null!=d)&&("CustomWebComponent"==n.constructor.is&&n.constructor.noSlot||U(n,m,W||null!=p.dangerouslySetInnerHTML,t,i)),function(o,e,t,i,n){var r,a,c=o.update;for(r in o.receiveProps&&(a=Object.assign({},t)),t)e&&null!=e[r]||null==t[r]||(T(o,r,t[r],t[r]=void 0,R,i),c&&delete o.props[r]);for(r in e)if(c&&"object"==typeof e[r]&&"ref"!==r){"style"===r&&T(o,r,t[r],t[r]=e[r],R,i);var s=v(r);o.props[s]=t[s]=e[r]}else"children"===r||r in t&&e[r]===("value"===r||"checked"===r?o[r]:t[r])||(T(o,r,t[r],e[r],R,i),-1!==o.nodeName.indexOf("-")?(o.props=o.props||{},s=v(r),o.props[s]=t[s]=e[r]):t[r]=e[r]);c&&!n&&o.parentNode&&!1!==o.receiveProps(o.props,a)&&o.update()}(n,e.attributes,p,t,i),n.props&&(n.props.children=e.children),R=r,n}function U(o,e,t,i,n){var r,a,c,s,l,d=o.childNodes,p=[],m={},u=0,g=0,h=(null==d?void 0:d.length)||0,f=0,b=e?e.length:0;if(0!==h)for(var w=0;w0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isProvide",{get:function(){return Object.keys(this.providesMap).length>0},enumerable:!1,configurable:!0}),e.prototype.removeAttribute=function(e){o.prototype.removeAttribute.call(this,e),this.isInstalled&&this.update()},e.prototype.setAttribute=function(e,t){var i;i=t&&"object"==typeof t?JSON.stringify(t):t,o.prototype.setAttribute.call(this,e,i),this.isInstalled&&(this[e]=t)},e.prototype.getAttribute=function(e){var t=this[e];return t||(t=o.prototype.getAttribute.call(this,e)),t},e.prototype.pureRemoveAttribute=function(e){o.prototype.removeAttribute.call(this,e)},e.prototype.pureSetAttribute=function(e,t){o.prototype.setAttribute.call(this,e,t)},e.prototype.attributeChangedCallback=function(o,e,t){this.update([],!1)},e.prototype.update=function(o,e){this.callUpdate(o,e)},e.prototype.callUpdate=function(o,e){if(this.isInstalled&&!this.willUpdate&&this.preBeforeUpdate()){this.willUpdate=!0,this.beforeUpdate(),this.beforeRender(),this.customStyleContent!=this.$options.css&&(this.customStyleContent=this.$options.css);var t=this.render(this.$reactive,this.store);this.rendered(),this.rootNode=B(this.rootNode,t,(null==this?void 0:this.shadowRoot)||this,this,e),this.willUpdate=!1,this.updated()}},e.prototype.initShadowRoot=function(){var o,e,t;if("LightDom"===this.$options.is)t=this;else{t=this.shadowRoot||(null===(o=this.attachShadow)||void 0===o?void 0:o.call(this,{mode:"open"}));for(var i=void 0;i=t.firstChild;)t.removeChild(i)}t=this.initCss(t),this.css&&t.appendChild(w("function"==typeof this.css?this.css():this.css));var n=null===(e=this.$reactive)||void 0===e?void 0:e.css;return n&&(this.customStyleElement=w(n),this.customStyleContent=n,t.appendChild(this.customStyleElement)),t},e.prototype.updateInject=function(o){var e=this;this.isInject&&Promise.resolve().then((function(){for(var t,i,n=e.parentNode;n&&!i;)(i=n.isProvide?n.providesMap:void 0)&&(t=n),n=n.parentNode||n.host;if(i)return e.injectsList.forEach((function(o){var n=i[o.key].functionName;e[o.attr]=t[n]()})),void("function"==typeof o&&o());console.warn("The provide prop was not found on the parent node or the provide type is incorrect. please check ".concat(e.tagName))}))},e.prototype.connectedCallback=function(){var o=this;this.updateInject(this.update.bind(this));var e=this.initShadowRoot();this.attrsToProps(),this.beforeInstall(),this.install(),this.afterInstall(),this.beforeRender();var t=this.render(this.$reactive,this.store);this.rootNode=B(null,t,null,this),!0===this.$options.isMountDom&&(Array.isArray(this.rootNode)?this.rootNode.forEach((function(o){return e.appendChild(o)})):this.rootNode&&e.appendChild(this.rootNode)),this.isInstalled=!0,this.rendered(),this.isInject?Promise.resolve().then((function(){return o.connected(e)})):this.connected(e)},e.prototype.disconnectedCallback=function(){this.disConnected()},e.prototype.connected=function(o){},e.prototype.disConnected=function(){},e.prototype.preBeforeUpdate=function(){return!0},e.prototype.beforeUpdate=function(){},e.prototype.updated=function(){},e.prototype.forceUpdate=function(){this.update([],!0)},e.prototype.updateProps=function(o){var e=this;Object.keys(o).forEach((function(t){e[t]=o[t],e.prevProps&&(e.prevProps[t]=o[t])})),this.forceUpdate()},e.prototype.attrsToProps=function(o){var e=this,t=this,i=function(o){for(var e={},t=0,i=o.attributes.length;t=0||(n[t]=o[t]);return n}(o,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(o,t)&&(n[t]=o[t])}return n}function wo(o,e){(null==e||e>o.length)&&(e=o.length);for(var t=0,i=new Array(e);t=o.length?o.apply(this,n):function(){for(var o=arguments.length,i=new Array(o),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};No.initial(o),No.handler(e);var t={current:o},i=Mo(Oo)(t,e),n=Mo(Do)(t),r=Mo(No.changes)(o),a=Mo(Co)(t);function c(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(o){return o};return No.selector(o),o(t.current)}function s(o){ko(i,n,r,a)(o)}return[c,s]}};var Io,qo={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},Lo=(Io=function(o,e){throw new Error(o[e]||o.default)},function o(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n=Io.length?Io.apply(this,i):function(){for(var t=arguments.length,n=new Array(t),r=0;r2;)H.push(arguments[r]);for(e&&null!=e.children&&(H.length||H.push(e.children),delete e.children);H.length;)if((i=H.pop())&&void 0!==i.pop)for(r=i.length;r--;)H.push(i[r]);else"boolean"==typeof i&&(i=null),(n="function"!=typeof o)&&(null==i?i="":"number"==typeof i?i=String(i):"string"!=typeof i&&(n=!1)),n&&t?a[a.length-1]+=i:0===a.length?a=[i]:a.push(i),t=n;if(o===x)return a;var c={nodeName:o,children:a,attributes:null==e?void 0:e,key:null==e?void 0:e.key};return void 0!==A.vnode&&A.vnode(c),c}("div",{id:"container"})},i([so({type:String,default:""}),n("design:type",String)],c.prototype,"initialValue",void 0),i([so({type:String,default:"typescript"}),n("design:type",String)],c.prototype,"language",void 0),i([so({type:String,default:"vs-dark"}),n("design:type",String)],c.prototype,"theme",void 0),c=i([lo({name:"wu-code-monaco-editor",css:mo+uo}),n("design:paramtypes",[])],c)}(io);o.WuCodeMonacoEditor=Yo,Object.defineProperty(o,"__esModule",{value:!0})})); diff --git a/component/packages/wu-monaco-editor/public/si/index.umd.js b/component/packages/wu-monaco-editor/public/si/index.umd.js deleted file mode 100644 index bac2de77..00000000 --- a/component/packages/wu-monaco-editor/public/si/index.umd.js +++ /dev/null @@ -1,16 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).WuCodeSandbox={})}(this,(function(e){"use strict";var t=function(e,g){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var g in t)Object.prototype.hasOwnProperty.call(t,g)&&(e[g]=t[g])},t(e,g)};var g=function(){return g=Object.assign||function(e){for(var t,g=1,C=arguments.length;g=0;A--)(I=e[A])&&(o=(n<3?I(o):n>3?I(t,g,o):I(t,g))||o);return n>3&&o&&Object.defineProperty(t,g,o),o}function I(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function n(e,t,g,C){return new(g||(g=Promise))((function(I,n){function o(e){try{r(C.next(e))}catch(e){n(e)}}function A(e){try{r(C.throw(e))}catch(e){n(e)}}function r(e){var t;e.done?I(e.value):(t=e.value,t instanceof g?t:new g((function(e){e(t)}))).then(o,A)}r((C=C.apply(e,t||[])).next())}))}function o(e,t){var g,C,I,n,o={label:0,sent:function(){if(1&I[0])throw I[1];return I[1]},trys:[],ops:[]};return n={next:A(0),throw:A(1),return:A(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function A(n){return function(A){return function(n){if(g)throw new TypeError("Generator is already executing.");for(;o;)try{if(g=1,C&&(I=2&n[0]?C.return:n[0]?C.throw||((I=C.return)&&I.call(C),0):C.next)&&!(I=I.call(C,n[1])).done)return I;switch(C=0,I&&(n=[2&n[0],I.value]),n[0]){case 0:case 1:I=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,C=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(I=o.trys,(I=I.length>0&&I[I.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!I||n[1]>I[0]&&n[1]{C=e(t,g,C)||C})),C}(e,t,g,C):"function"==typeof t?function(e,t){return e.reverse().forEach((e=>{const g=e(t);g&&(t=g)})),t}(e,t):void 0},defineMetadata:function(e,t,g,C){c(e,t,g,C)},getMetadata:function(e,t,g){return l(e,t,g)},getOwnMetadata:function(e,t,g){return i(e,t,g)},hasMetadata:function(e,t,g){return!!l(e,t,g)},hasOwnMetadata:function(e,t,g){return!!i(e,t,g)},metadata:function(e,t){return function(g,C){c(e,t,g,C)}}};Object.assign(Reflect,s);var a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var g in t)Object.prototype.hasOwnProperty.call(t,g)&&(e[g]=t[g])},a(e,t)},u=function(){return u=Object.assign||function(e){for(var t,g=1,C=arguments.length;g - * @license MIT - */!function(e){if(!e.WeakMap){var t=Object.prototype.hasOwnProperty,g=Object.defineProperty&&function(){try{return 1===Object.defineProperty({},"x",{value:1}).x}catch(e){}}(),C=function(e,t,C){g?Object.defineProperty(e,t,{configurable:!0,writable:!0,value:C}):e[t]=C};e.WeakMap=function(){function e(){if(void 0===this)throw new TypeError("Constructor WeakMap requires 'new'");if(C(this,"_id",n("_WeakMap")),arguments.length>0)throw new TypeError("WeakMap iterable is not supported")}function g(e,g){if(!I(e)||!t.call(e,"_id"))throw new TypeError(g+" method called on incompatible receiver "+typeof e)}function n(e){return e+"_"+o()+"."+o()}function o(){return Math.random().toString().substring(2)}return C(e.prototype,"delete",(function(e){if(g(this,"delete"),!I(e))return!1;var t=e[this._id];return!(!t||t[0]!==e||(delete e[this._id],0))})),C(e.prototype,"get",(function(e){if(g(this,"get"),I(e)){var t=e[this._id];return t&&t[0]===e?t[1]:void 0}})),C(e.prototype,"has",(function(e){if(g(this,"has"),!I(e))return!1;var t=e[this._id];return!(!t||t[0]!==e)})),C(e.prototype,"set",(function(e,t){if(g(this,"set"),!I(e))throw new TypeError("Invalid value used as weak map key");var n=e[this._id];return n&&n[0]===e?(n[1]=t,this):(C(e,this._id,[e,t]),this)})),C(e,"_polyfill",!0),e}()}function I(e){return Object(e)===e}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:p);var h=function(e){return e.replace(/(?!^)([A-Z])/g," $1").replace(/[_\s]+(?=[a-zA-Z])/g,".").toLowerCase()}; -/** - * @license - * Copyright (c) 2016 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt - */function f(e){var t=document.createElement("style");return t.textContent=e,t}function b(e){return e.replace(/-(\w)/g,(function(e,t){return t.toUpperCase()}))}function y(e){return e.children}function m(e,t){null!=e&&("function"==typeof e?e(t):e.current=t)}function v(e){return"[object Array]"===Object.prototype.toString.call(e)}function w(e){return e.indexOf("-")>-1?e.replace(/(\-([a-z]))/g,(function(e,t,g,C,I){return g.toUpperCase()})):e}!function(){if(void 0!==window.Reflect&&void 0!==window.customElements&&!window.customElements.hasOwnProperty("polyfillWrapFlushCallback")){var e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}}(),"function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;var N={store:null,root:self||window||function(){return this}(),mapping:{},vnode:void 0},Z=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,W=Symbol("PROP_META_KEY"),G=Symbol("STATE_META_KEY"),B=Symbol("COMPONENT_CUSTOM_EVENT"),S=Symbol("COMPONENT_CUSTOM_INJECT"),V=Symbol("COMPONENT_CUSTOM_PROVIDE"),Y=Symbol("COMPONENT_WATCH");function K(e){var t=e.parentNode;t&&t.removeChild(e)}function H(e,t,g){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&X(e,t.nodeName):"function"==typeof t.nodeName?N.mapping[e.nodeName.toLowerCase()]===t.nodeName:g||e._componentConstructor===t.nodeName}function X(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function k(e){return this._listeners[e.type](N.event&&N.event(e)||e)}var J={};function R(e,t,g,C,I,n){if("className"===t&&(t="class"),"o"==t[0]&&"-"==t[1])J[t]&&J[t](e,C,n);else if("key"===t);else if("ref"===t)m(g,null),m(C,e);else if("class"!==t||I)if("style"===t){if(C&&"string"!=typeof C&&"string"!=typeof g||(e.style.cssText=C||""),C&&"object"==typeof C){if("string"!=typeof g)for(var o in g)o in C||(e.style[o]="");for(var o in C)e.style[o]="number"==typeof C[o]&&!1===Z.test(o)?C[o]+"px":C[o]}}else if("dangerouslySetInnerHTML"===t)C&&(e.innerHTML=C.__html||"");else if("o"==t[0]&&"n"==t[1])!function(e,t,g,C){var I=t!==(t=t.replace(/Capture$/,"")),n=t.toLowerCase();t=(n in e?n:t).slice(2),g?C||e.addEventListener(t,k,I):e.removeEventListener(t,k,I),(e._listeners||(e._listeners={}))[t]=g}(e,t,C,g);else if("INPUT"===e.nodeName&&"value"===t)e[t]=null==C?"":C;else if("list"!==t&&"type"!==t&&"css"!==t&&!I&&t in e&&""!==C){try{e[t]=null==C?"":C}catch(e){}null!=C&&!1!==C||"spellcheck"==t||(e.pureRemoveAttribute?e.pureRemoveAttribute(t):e.removeAttribute(t))}else{var A=I&&t!==(t=t.replace(/^xlink:?/,""));null==C||!1===C?A?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.pureRemoveAttribute?e.pureRemoveAttribute(t):e.removeAttribute(t):"function"!=typeof C&&(A?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),C):e.pureSetAttribute?e.pureSetAttribute(t,C):e.setAttribute(t,C))}else e.className=C||""}var j=0,Q=!1,L=!1;function _(e,t,g,C,I){var n;if(e||t)return j++||(Q=null!=g&&void 0!==g.ownerSVGElement,L=null!=e&&!("prevProps"in e)),t&&t.nodeName===y&&(t=t.children),v(t)?g?O(g,t,L,C,I):(n=[],t.forEach((function(t,g){var o=D(0===g?e:null,t,C,I);n.push(o)}))):(v(e)?e.forEach((function(e,g){0===g?n=D(e,t,C,I):z(e,!1)})):n=D(e,t,C,I),g&&n.parentNode!==g&&g.appendChild(n)),--j||(L=!1),n}function D(e,t,g,C){e&&t&&e.props&&(e.props.children=t.children);var I=e,n=Q;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||g)?e.nodeValue!=t&&(e.nodeValue=t):(I=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(I,e),z(e,!0))),I.prevProps=!0,I;var o,A,r=t.nodeName;if("function"==typeof r)for(var i in N.mapping)if(N.mapping[i]===r){r=i,t.nodeName=i;break}if(Q="svg"===r||"foreignObject"!==r&&Q,r=String(r),(!e||!X(e,r))&&(o=r,(A=Q?document.createElementNS("http://www.w3.org/2000/svg",o):document.createElement(o)).normalizedNodeName=o,I=A,e)){for(;e.firstChild;)I.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(I,e),z(e,!0)}var c=I.firstChild,l=I.prevProps,s=t.children;if(null==l){l=I.prevProps={};for(var a=I.attributes,u=a.length;u--;)l[a[u].name]=a[u].value}return!L&&s&&1===s.length&&"string"==typeof s[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=s[0]&&(c.nodeValue=s[0]):(s&&s.length||null!=c)&&("CustomWebComponent"==I.constructor.is&&I.constructor.noSlot||O(I,s,L||null!=l.dangerouslySetInnerHTML,g,C)),function(e,t,g,C,I){var n,o,A=e.update;for(n in e.receiveProps&&(o=Object.assign({},g)),g)t&&null!=t[n]||null==g[n]||(R(e,n,g[n],g[n]=void 0,Q,C),A&&delete e.props[n]);for(n in t)if(A&&"object"==typeof t[n]&&"ref"!==n){"style"===n&&R(e,n,g[n],g[n]=t[n],Q,C);var r=b(n);e.props[r]=g[r]=t[n]}else"children"===n||n in g&&t[n]===("value"===n||"checked"===n?e[n]:g[n])||(R(e,n,g[n],t[n],Q,C),-1!==e.nodeName.indexOf("-")?(e.props=e.props||{},r=b(n),e.props[r]=g[r]=t[n]):g[n]=t[n]);A&&!I&&e.parentNode&&!1!==e.receiveProps(e.props,o)&&e.update()}(I,t.attributes,l,g,C),I.props&&(I.props.children=t.children),Q=n,I}function O(e,t,g,C,I){var n,o,A,r,i,c=e.childNodes,l=[],s={},a=0,u=0,d=(null==c?void 0:c.length)||0,p=0,h=t?t.length:0;if(0!==d)for(var f=0;f2;)P.push(arguments[n]);for(t&&null!=t.children&&(P.length||P.push(t.children),delete t.children);P.length;)if((C=P.pop())&&void 0!==C.pop)for(n=C.length;n--;)P.push(C[n]);else"boolean"==typeof C&&(C=null),(I="function"!=typeof e)&&(null==C?C="":"number"==typeof C?C=String(C):"string"!=typeof C&&(I=!1)),I&&g?o[o.length-1]+=C:0===o.length?o=[C]:o.push(C),g=I;if(e===y)return o;var A={nodeName:e,children:o,attributes:null==t?void 0:t,key:null==t?void 0:t.key};return void 0!==N.vnode&&N.vnode(A),A}var x=function(){function e(){this.subs=[]}return e.prototype.addSub=function(e){this.subs.includes(e)||this.subs.push(e)},e.prototype.notify=function(){this.subs.forEach((function(e){e.update()}))},e.prototype.depend=function(){e.target&&(this.subs.includes(e.target)||this.subs.push(e.target))},e}(),T="__proto__"in{};function E(e,t,g,C){Object.defineProperty(e,t,{value:g,enumerable:!!C,writable:!0,configurable:!0})}var M=0,U=function(){function e(e,t,g,C){var I=this;if(void 0===C&&(C={}),this.callbacks=[],this.id=M++,this.$vm=e,this.expr=t,this.deep=!!C.deep,this.getter="function"==typeof t?t:function(e){e+=".";for(var t=[],g="",C=0;C0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isProvide",{get:function(){return Object.keys(this.providesMap).length>0},enumerable:!1,configurable:!0}),t.prototype.removeAttribute=function(t){e.prototype.removeAttribute.call(this,t),this.isInstalled&&this.update()},t.prototype.setAttribute=function(t,g){var C;C=g&&"object"==typeof g?JSON.stringify(g):g,e.prototype.setAttribute.call(this,t,C),this.isInstalled&&(this[t]=g)},t.prototype.getAttribute=function(t){var g=this[t];return g||(g=e.prototype.getAttribute.call(this,t)),g},t.prototype.pureRemoveAttribute=function(t){e.prototype.removeAttribute.call(this,t)},t.prototype.pureSetAttribute=function(t,g){e.prototype.setAttribute.call(this,t,g)},t.prototype.attributeChangedCallback=function(e,t,g){this.update([],!1)},t.prototype.update=function(e,t){this.callUpdate(e,t)},t.prototype.callUpdate=function(e,t){if(this.isInstalled&&!this.willUpdate&&this.preBeforeUpdate()){this.willUpdate=!0,this.beforeUpdate(),this.beforeRender(),this.customStyleContent!=this.$options.css&&(this.customStyleContent=this.$options.css);var g=this.render(this.$reactive,this.store);this.rendered(),this.rootNode=_(this.rootNode,g,(null==this?void 0:this.shadowRoot)||this,this,t),this.willUpdate=!1,this.updated()}},t.prototype.initShadowRoot=function(){var e,t,g;if("LightDom"===this.$options.is)g=this;else{g=this.shadowRoot||(null===(e=this.attachShadow)||void 0===e?void 0:e.call(this,{mode:"open"}));for(var C=void 0;C=g.firstChild;)g.removeChild(C)}g=this.initCss(g),this.css&&g.appendChild(f("function"==typeof this.css?this.css():this.css));var I=null===(t=this.$reactive)||void 0===t?void 0:t.css;return I&&(this.customStyleElement=f(I),this.customStyleContent=I,g.appendChild(this.customStyleElement)),g},t.prototype.updateInject=function(e){var t=this;this.isInject&&Promise.resolve().then((function(){for(var g,C,I=t.parentNode;I&&!C;)(C=I.isProvide?I.providesMap:void 0)&&(g=I),I=I.parentNode||I.host;if(C)return t.injectsList.forEach((function(e){var I=C[e.key].functionName;t[e.attr]=g[I]()})),void("function"==typeof e&&e());console.warn("The provide prop was not found on the parent node or the provide type is incorrect. please check ".concat(t.tagName))}))},t.prototype.connectedCallback=function(){var e=this;this.updateInject(this.update.bind(this));var t=this.initShadowRoot();this.attrsToProps(),this.beforeInstall(),this.install(),this.afterInstall(),this.beforeRender();var g=this.render(this.$reactive,this.store);this.rootNode=_(null,g,null,this),!0===this.$options.isMountDom&&(Array.isArray(this.rootNode)?this.rootNode.forEach((function(e){return t.appendChild(e)})):this.rootNode&&t.appendChild(this.rootNode)),this.isInstalled=!0,this.rendered(),this.isInject?Promise.resolve().then((function(){return e.connected(t)})):this.connected(t)},t.prototype.disconnectedCallback=function(){this.disConnected()},t.prototype.connected=function(e){},t.prototype.disConnected=function(){},t.prototype.preBeforeUpdate=function(){return!0},t.prototype.beforeUpdate=function(){},t.prototype.updated=function(){},t.prototype.forceUpdate=function(){this.update([],!0)},t.prototype.updateProps=function(e){var t=this;Object.keys(e).forEach((function(g){t[g]=e[g],t.prevProps&&(t.prevProps[g]=e[g])})),this.forceUpdate()},t.prototype.attrsToProps=function(e){var t=this,g=this,C=function(e){for(var t={},g=0,C=e.attributes.length;g0)&&!(C=n.next()).done;)o.push(C.value)}catch(e){I={error:e}}finally{try{C&&!C.done&&(g=n.return)&&g.call(n)}finally{if(I)throw I.error}}return o}(this.pending_cmds.keys()),!1))},e.prototype.handle_repl_message=function(e){if(e.source===this.iframe.contentWindow){var t=e.data,g=t.action,C=t.args;switch(g){case"cmd_error":case"cmd_ok":return this.handle_command_message(e.data);case"fetch_progress":return this.handlers.on_fetch_progress(C.remaining);case"error":return this.handlers.on_error(e.data);case"unhandledrejection":return this.handlers.on_unhandled_rejection(e.data);case"console":return this.handlers.on_console(e.data);case"console_group":return this.handlers.on_console_group(e.data);case"console_group_collapsed":return this.handlers.on_console_group_collapsed(e.data);case"console_group_end":return this.handlers.on_console_group_end(e.data)}}},e.prototype.eval=function(e){return this.iframe_command("eval",{script:e})},e.prototype.handle_links=function(){return this.iframe_command("catch_clicks",{})},e.prototype.load_depend=function(e){return this.iframe_command("load_dependencies",e)},e}(),ue="CODE_DEPENDENCIES",de="CODE_TYPES",pe=function(){function e(e){void 0===e&&(e={dependencies:{},types:{}}),this.code=[],this.init(e)}return e.prototype.init=function(e){var t=e.dependencies,C=void 0===t?{}:t,I=e.types,n=void 0===I?{}:I,o=localStorage.getItem(ue)?JSON.parse(localStorage.getItem(ue)):{},A=localStorage.getItem(de)?JSON.parse(localStorage.getItem(de)):{};o=g(g({},o),C||{}),A=g(g({},A),{types:n||{}}),localStorage.setItem(ue,JSON.stringify(o)),localStorage.setItem(de,JSON.stringify(A)),this.__dependencies=o,this.__types=A},e.prototype.createDependencies=function(e,t){this.__dependencies=g(g({},this.__dependencies),{name:t}),localStorage.setItem(ue,JSON.stringify(this.__dependencies))},Object.defineProperty(e.prototype,"dependencies",{get:function(){return this.__dependencies},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"types",{get:function(){return this.__types},enumerable:!1,configurable:!0}),e.prototype.pushStackCode=function(e){this.code.push(e)},e}(),he=function(e){function g(){var t=e.call(this)||this;return t.container=null,t}return function(e,g){if("function"!=typeof g&&null!==g)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");function C(){this.constructor=e}t(e,g),e.prototype=null===g?Object.create(g):(C.prototype=g.prototype,new C)}(g,e),g.prototype.formatFile=function(e){return new Promise((function(t){if(e.startsWith("data:text/html;base64")){for(var g=e.split(","),C=atob(g[1]),I=C.length,n=new Uint8Array(I);I--;)n[I]=C.charCodeAt(I);var o=new File([n],"srcdoc.html",{type:"text/html"}),A=new FileReader;A.onload=function(){t(A.result)},A.readAsText(o,"utf-8")}else t(e)}))},g.prototype.connected=function(e){return n(this,void 0,void 0,(function(){var t,g,C,I,n,A=this;return o(this,(function(o){switch(o.label){case 0:return t=this.props.initialSrcDoc,this.container=e.querySelector("#codeIframe"),g=document.createElement("div"),C={},t?(I=this,[4,this.formatFile(t)]):[3,2];case 1:I.initialSrcDoc=o.sent(),g.innerHTML=this.initialSrcDoc,n=g.querySelector("#dependenciesMap"),C=JSON.parse(n.innerHTML)?JSON.parse(n.innerHTML).imports:{},o.label=2;case 2:return this.previewStore=new pe({dependencies:C}),this.proxy=new ae(this.container,{on_fetch_progress:function(e){},on_error:function(e){console.log("on_error",e)},on_unhandled_rejection:function(e){console.log("on_unhandled_rejection",e)},on_console:function(e){console.log("log",e)},on_console_group:function(e){},on_console_group_end:function(){},on_console_group_collapsed:function(e){}}),this.container.addEventListener("load",(function(){A.proxy.handle_links().then((function(e){})),A.proxy.load_depend({dependencies:A.previewStore.dependencies}).then((function(){for(var e=0;e { - loader.config({ monaco }); - loader.init().then((monacoInstance) => { - const editor = monacoInstance.editor.create(editorContainer, options); - resolve(editor); - }).catch(e => { - reject(e); - }); - }); -} - -/** - * 实例化编辑器 - */ -export function createEditorByLoader(editorContainer: HTMLElement, options: monaco.editor.IStandaloneEditorConstructionOptions): Promise<{ editor: monaco.editor, monacoInstance: Monaco }> { - return new Promise((resolve, reject) => { - loader.init().then((monacoInstance) => { - const editor: monaco.editor = monacoInstance.editor.create(editorContainer, options); - resolve({ editor, monacoInstance }); - }).catch(e => { - reject(e); - }); - }); -} diff --git a/component/packages/wu-monaco-editor/src/core/index.ts b/component/packages/wu-monaco-editor/src/core/index.ts deleted file mode 100644 index 26c946e5..00000000 --- a/component/packages/wu-monaco-editor/src/core/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './createEditor'; -export * from './monaco'; -export * from './options'; diff --git a/component/packages/wu-monaco-editor/src/core/monaco.ts b/component/packages/wu-monaco-editor/src/core/monaco.ts deleted file mode 100644 index 7423903f..00000000 --- a/component/packages/wu-monaco-editor/src/core/monaco.ts +++ /dev/null @@ -1,5 +0,0 @@ -// import * as Monaco from 'monaco-editor/esm/vs/editor/editor.main.js'; - -export type IMonaco = typeof import("monaco-editor") - -export const monaco = window.monaco as IMonaco; diff --git a/component/packages/wu-monaco-editor/src/editor/index.scss b/component/packages/wu-monaco-editor/src/editor/index.scss deleted file mode 100644 index 126ce933..00000000 --- a/component/packages/wu-monaco-editor/src/editor/index.scss +++ /dev/null @@ -1,9 +0,0 @@ -#container { - width: 100%; - height: 100%; -} -:host { - width: 100%; - height: 100%; -} - diff --git a/component/packages/wu-monaco-editor/src/editor/index.tsx b/component/packages/wu-monaco-editor/src/editor/index.tsx deleted file mode 100644 index a6ddc365..00000000 --- a/component/packages/wu-monaco-editor/src/editor/index.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import { Component, h, OnConnected, Prop, WuComponent } from "@wu-component/web-core-plus"; -import css from "./index.scss"; -import css1 from "monaco-editor/min/vs/editor/editor.main.css"; -import { createEditorByLoader, tsxCompilerOptions } from "../core"; -import { updateCompilerOptions } from "../core/typescript"; -import type * as monaco from 'monaco-editor/esm/vs/editor/editor.main.js'; - -@Component({ - name: 'wu-monaco-editor', - css: css + css1, -}) -export class WuMonacoEditor extends WuComponent implements OnConnected { - constructor() { - super(); - } - - @Prop({ type: String, default: "" }) - public initialValue: string; - - @Prop({ type: String, default: "typescript" }) - public language: string; - - @Prop({ type: String, default: "vs-dark" }) - public theme: string; - - private __editor: monaco.editor; - - public monacoInstance: monaco; - - get editor(): monaco.editor { - return this.__editor; - } - - set editor(value: monaco.editor) { - if (value) { - this.__editor = value; - } - } - - private async initEditor() { - const { editor, monacoInstance } = await createEditorByLoader(this.shadowRoot.querySelector("#container"), { - value: this.initialValue, - language: this.language, - theme: this.theme - }); - this.editor = editor; - this.monacoInstance = monacoInstance; - window.monaco = monacoInstance; - window.editor = editor; - // updateCompilerOptions({ moduleResolution: 2 }); - updateCompilerOptions(tsxCompilerOptions()); - // await addModuleDeclaration("https://unpkg.com/@wu-component/web-core-plus@0.3.3/dist/index.es.js", "@wu-component/web-core-plus"); - return this.editor; - } - - public override connected(shadowRoot: ShadowRoot): void { - this.initEditor().then(r => {}); - this.addEventListener("resize", (e: MouseEvent) => { - console.log(e); - }); - } - - public override render(_renderProps = {}, _store = {}) { - return ( -
- ); - } -} diff --git a/component/packages/wu-monaco-editor/src/preview/Store.ts b/component/packages/wu-monaco-editor/src/preview/Store.ts deleted file mode 100644 index 0529c631..00000000 --- a/component/packages/wu-monaco-editor/src/preview/Store.ts +++ /dev/null @@ -1,58 +0,0 @@ -export const CODE_DEPENDENCIES = "CODE_DEPENDENCIES"; -export const CODE_TYPES = "CODE_TYPES"; -export class Store { - // 依赖 - private __dependencies: Record; - // 类型管理 - private __types: Record; - // code 執行 - public code: string[] = []; - - constructor(options: { dependencies?: Record, types?: Record} = { dependencies: {}, types: {} }) { - this.init(options); - } - - /** - * 初始化值 - */ - private init({ dependencies = {}, types = {} }) { - let __dependencies = localStorage.getItem(CODE_DEPENDENCIES)? JSON.parse(localStorage.getItem(CODE_DEPENDENCIES)): {}; - let __types = localStorage.getItem(CODE_TYPES)? JSON.parse(localStorage.getItem(CODE_TYPES)): {}; - __dependencies = { ...__dependencies, dependencies: dependencies|| {} }; - __types = { ...__types, types: types|| {} }; - localStorage.setItem(CODE_DEPENDENCIES, JSON.stringify(__dependencies)); - localStorage.setItem(CODE_TYPES, JSON.stringify(__types)); - this.__dependencies = __dependencies; - this.__types = __types; - - } - - /** - * 沙箱环境中追加一个依赖 - * @param name - * @param url - */ - public createDependencies(name: string, url: string) { - this.__dependencies = { - ...this.__dependencies, - name: url - }; - localStorage.setItem(CODE_DEPENDENCIES, JSON.stringify(this.__dependencies)); - } - - get dependencies() { - return this.__dependencies; - } - - get types() { - return this.__types; - } - - /** - * 暂存代码 - * @param code - */ - public pushStackCode(code: string) { - this.code.push(code); - } -} diff --git a/component/packages/wu-monaco-editor/src/preview/index.scss b/component/packages/wu-monaco-editor/src/preview/index.scss deleted file mode 100644 index d361ded1..00000000 --- a/component/packages/wu-monaco-editor/src/preview/index.scss +++ /dev/null @@ -1,14 +0,0 @@ -:host { - width: 100%; - height: 100%; -} -.containerViewer { - width: 100%; - height: 100%; - border: 1px solid #cdcdcd; - box-sizing: border-box; -} -#codeIframe { - width: 100%; - height: 100%; -} diff --git a/component/packages/wu-monaco-editor/src/preview/index.tsx b/component/packages/wu-monaco-editor/src/preview/index.tsx deleted file mode 100644 index 8d291a50..00000000 --- a/component/packages/wu-monaco-editor/src/preview/index.tsx +++ /dev/null @@ -1,107 +0,0 @@ -import { Component, h, OnConnected, Prop, WuComponent } from "@wu-component/web-core-plus"; -import css from './index.scss'; -import { PreviewProxy, LoadDependencies } from "../sandbox"; -import { Store } from "./Store"; - -@Component({ - name: 'wu-code-preview', - css: css, -}) -export class WuMonacoEditorPreview extends WuComponent implements OnConnected { - constructor() { - super(); - } - - @Prop({ type: String, default: "" }) - public initialSrcDoc: string; - - @Prop({ type: Boolean, default: false }) - public isBeforeRefresh: boolean; - - private container: HTMLIFrameElement = null; - - // 沙箱 - private proxy: PreviewProxy - - // 数据管理 - public previewStore: Store - - public override connected(shadowRoot: ShadowRoot): void { - this.container = shadowRoot.querySelector("#codeIframe"); - const fragment = document.createElement("div"); - fragment.innerHTML = this.initialSrcDoc; - const dom = fragment.querySelector("#dependenciesMap"); - // 解析出dom模板中定义的依赖 - const current = JSON.parse(dom.innerHTML)? JSON.parse(dom.innerHTML).imports: {}; - // 依赖项同步到仓库中 - this.previewStore = new Store({ dependencies: current }); - // 示例话沙箱代理 - this.proxy = new PreviewProxy(this.container, { - on_fetch_progress: (progress: any) => { - // pending_imports = progress; - }, - on_error: (event: any) => { - console.log("on_error", event); - }, - on_unhandled_rejection: (event: any) => { - console.log("on_unhandled_rejection", event); - }, - on_console: (log: any) => { - console.log("log", log); - }, - on_console_group: (action: any) => { - // group_logs(action.label, false); - }, - on_console_group_end: () => { - // ungroup_logs(); - }, - on_console_group_collapsed: (action: any) => { - // group_logs(action.label, true); - } - }); - // 沙箱实例完成 - this.container.addEventListener('load', () => { - this.proxy.handle_links().then(r => {}); - // 同步新的依赖到沙箱中 - this.proxy.load_depend({ - "dependencies": this.previewStore.dependencies - }).then(() => { - for (let i = 0; i < this.previewStore.code.length; i ++) { - this.proxy.eval(this.previewStore.code[i]); - } - this.previewStore.code = []; - }); - }); - this.container.setAttribute("srcdoc", this.initialSrcDoc); - } - - /** - * 沙箱执行code - * @param type - * @param code - */ - public runCode(type: string, code: string) { - if (this.isBeforeRefresh) { - // 此处做了定制,webComponent 中无法重复定义元素,所以此处需要重新加载沙箱 - this.container.contentWindow.location.reload(); - // 将需要执行的代码暂存 - this.previewStore.pushStackCode(code); - } else { - this.proxy.eval(code); - } - - } - - public loadDependencies(options: LoadDependencies) { - return this.proxy.load_depend(options); - } - - public override render(_renderProps = {}, _store = {}) { - const sandbox = () => [ 'allow-forms', 'allow-modals', 'allow-pointer-lock', 'allow-popups', 'allow-same-origin', 'allow-scripts', 'allow-top-navigation-by-user-activation' ].join(' '); - return ( -
- -
- ); - } -} diff --git a/component/packages/wu-monaco-editor/src/sandbox/PreviewProxy.ts b/component/packages/wu-monaco-editor/src/sandbox/PreviewProxy.ts deleted file mode 100644 index 2084f4a1..00000000 --- a/component/packages/wu-monaco-editor/src/sandbox/PreviewProxy.ts +++ /dev/null @@ -1,104 +0,0 @@ -// ReplProxy and srcdoc implementation from Svelte REPL -// MIT License https://github.com/sveltejs/svelte-repl/blob/master/LICENSE - -let uid = 1; -export interface LoadDependencies { - dependencies: Record, - types?: Record, - name?:string; -} -export class PreviewProxy { - iframe: HTMLIFrameElement - handlers: Record - pending_cmds: Map< - number, - { resolve: (value: unknown) => void; reject: (reason?: any) => void } - > - handle_event: (e: any) => void - - constructor(iframe: HTMLIFrameElement, handlers: Record) { - this.iframe = iframe; - this.handlers = handlers; - - this.pending_cmds = new Map(); - - this.handle_event = (e) => this.handle_repl_message(e); - window.addEventListener('message', this.handle_event, false); - } - - destroy() { - window.removeEventListener('message', this.handle_event); - } - - iframe_command(action: string, args: any) { - return new Promise((resolve, reject) => { - const cmd_id = uid++; - - this.pending_cmds.set(cmd_id, { resolve, reject }); - - this.iframe.contentWindow!.postMessage({ action, cmd_id, args }, '*'); - }); - } - - handle_command_message(cmd_data: any) { - const action = cmd_data.action; - const id = cmd_data.cmd_id; - const handler = this.pending_cmds.get(id); - - if (handler) { - this.pending_cmds.delete(id); - if (action === 'cmd_error') { - const { message, stack } = cmd_data; - const e = new Error(message); - e.stack = stack; - handler.reject(e); - } - - if (action === 'cmd_ok') { - handler.resolve(cmd_data.args); - } - } else if (action !== 'cmd_error' && action !== 'cmd_ok') { - console.error('command not found', id, cmd_data, [ - ...this.pending_cmds.keys() - ]); - } - } - - handle_repl_message(event: any) { - if (event.source !== this.iframe.contentWindow) return; - - const { action, args } = event.data; - - switch (action) { - case 'cmd_error': - case 'cmd_ok': - return this.handle_command_message(event.data); - case 'fetch_progress': - return this.handlers.on_fetch_progress(args.remaining); - case 'error': - return this.handlers.on_error(event.data); - case 'unhandledrejection': - return this.handlers.on_unhandled_rejection(event.data); - case 'console': - return this.handlers.on_console(event.data); - case 'console_group': - return this.handlers.on_console_group(event.data); - case 'console_group_collapsed': - return this.handlers.on_console_group_collapsed(event.data); - case 'console_group_end': - return this.handlers.on_console_group_end(event.data); - } - } - - eval(script: string | string[]) { - return this.iframe_command('eval', { script }); - } - - handle_links() { - return this.iframe_command('catch_clicks', {}); - } - - load_depend(options: LoadDependencies) { - return this.iframe_command('load_dependencies', options); - } -} diff --git a/component/packages/wu-monaco-editor/src/sandbox/index.ts b/component/packages/wu-monaco-editor/src/sandbox/index.ts deleted file mode 100644 index 7e60a142..00000000 --- a/component/packages/wu-monaco-editor/src/sandbox/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./PreviewProxy"; diff --git a/component/packages/wu-monaco-editor/types/core/createEditor.d.ts b/component/packages/wu-monaco-editor/types/core/createEditor.d.ts deleted file mode 100644 index ee4f8bc0..00000000 --- a/component/packages/wu-monaco-editor/types/core/createEditor.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Monaco } from '@monaco-editor/loader'; -import * as monaco from 'monaco-editor/esm/vs/editor/editor.main.js'; -/** - * 实例化编辑器 - */ -export declare function createEditor(editorContainer: HTMLElement, options: monaco.editor.IStandaloneEditorConstructionOptions): Promise; -/** - * 实例化编辑器 - */ -export declare function createEditorByLoader(editorContainer: HTMLElement, options: monaco.editor.IStandaloneEditorConstructionOptions): Promise<{ - editor: monaco.editor; - monacoInstance: Monaco; -}>; diff --git a/component/packages/wu-monaco-editor/types/core/index.d.ts b/component/packages/wu-monaco-editor/types/core/index.d.ts deleted file mode 100644 index 26c946e5..00000000 --- a/component/packages/wu-monaco-editor/types/core/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './createEditor'; -export * from './monaco'; -export * from './options'; diff --git a/component/packages/wu-monaco-editor/types/core/monaco.d.ts b/component/packages/wu-monaco-editor/types/core/monaco.d.ts deleted file mode 100644 index 698b678c..00000000 --- a/component/packages/wu-monaco-editor/types/core/monaco.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare type IMonaco = typeof import("monaco-editor"); -export declare const monaco: typeof import("monaco-editor"); diff --git a/component/packages/wu-monaco-editor/types/editor/index.d.ts b/component/packages/wu-monaco-editor/types/editor/index.d.ts deleted file mode 100644 index 031f64a5..00000000 --- a/component/packages/wu-monaco-editor/types/editor/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { OnConnected, WuComponent } from "@wu-component/web-core-plus"; -import type * as monaco from 'monaco-editor/esm/vs/editor/editor.main.js'; -export declare class WuMonacoEditor extends WuComponent implements OnConnected { - constructor(); - initialValue: string; - language: string; - theme: string; - private __editor; - monacoInstance: monaco; - get editor(): monaco.editor; - set editor(value: monaco.editor); - private initEditor; - connected(shadowRoot: ShadowRoot): void; - render(_renderProps?: {}, _store?: {}): any; -} diff --git a/component/packages/wu-monaco-editor/types/preview/Store.d.ts b/component/packages/wu-monaco-editor/types/preview/Store.d.ts deleted file mode 100644 index 5c07bb69..00000000 --- a/component/packages/wu-monaco-editor/types/preview/Store.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -export declare const CODE_DEPENDENCIES = "CODE_DEPENDENCIES"; -export declare const CODE_TYPES = "CODE_TYPES"; -export declare class Store { - private __dependencies; - private __types; - code: string[]; - constructor(options?: { - dependencies?: Record; - types?: Record; - }); - /** - * 初始化值 - */ - private init; - /** - * 沙箱环境中追加一个依赖 - * @param name - * @param url - */ - createDependencies(name: string, url: string): void; - get dependencies(): Record; - get types(): Record; - /** - * 暂存代码 - * @param code - */ - pushStackCode(code: string): void; -} diff --git a/component/packages/wu-monaco-editor/types/preview/index.d.ts b/component/packages/wu-monaco-editor/types/preview/index.d.ts deleted file mode 100644 index 7bccc0ed..00000000 --- a/component/packages/wu-monaco-editor/types/preview/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { OnConnected, WuComponent } from "@wu-component/web-core-plus"; -import { LoadDependencies } from "../sandbox"; -import { Store } from "./Store"; -export declare class WuMonacoEditorPreview extends WuComponent implements OnConnected { - constructor(); - initialSrcDoc: string; - isBeforeRefresh: boolean; - private container; - private proxy; - previewStore: Store; - connected(shadowRoot: ShadowRoot): void; - /** - * 沙箱执行code - * @param type - * @param code - */ - runCode(type: string, code: string): void; - loadDependencies(options: LoadDependencies): Promise; - render(_renderProps?: {}, _store?: {}): any; -} diff --git a/component/packages/wu-monaco-editor/types/sandbox/PreviewProxy.d.ts b/component/packages/wu-monaco-editor/types/sandbox/PreviewProxy.d.ts deleted file mode 100644 index 5b6922a5..00000000 --- a/component/packages/wu-monaco-editor/types/sandbox/PreviewProxy.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -export interface LoadDependencies { - dependencies: Record; - types?: Record; - name?: string; -} -export declare class PreviewProxy { - iframe: HTMLIFrameElement; - handlers: Record; - pending_cmds: Map void; - reject: (reason?: any) => void; - }>; - handle_event: (e: any) => void; - constructor(iframe: HTMLIFrameElement, handlers: Record); - destroy(): void; - iframe_command(action: string, args: any): Promise; - handle_command_message(cmd_data: any): void; - handle_repl_message(event: any): any; - eval(script: string | string[]): Promise; - handle_links(): Promise; - load_depend(options: LoadDependencies): Promise; -} diff --git a/component/packages/wu-monaco-editor/types/sandbox/index.d.ts b/component/packages/wu-monaco-editor/types/sandbox/index.d.ts deleted file mode 100644 index 7e60a142..00000000 --- a/component/packages/wu-monaco-editor/types/sandbox/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./PreviewProxy"; diff --git a/component/pnpm-lock.yaml b/component/pnpm-lock.yaml index 634fb063..b1680cfa 100644 --- a/component/pnpm-lock.yaml +++ b/component/pnpm-lock.yaml @@ -573,7 +573,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -679,7 +679,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -794,7 +794,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -909,7 +909,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -1024,7 +1024,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -1139,7 +1139,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -1254,7 +1254,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -1369,7 +1369,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -1484,7 +1484,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -1599,7 +1599,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -1714,7 +1714,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -1829,7 +1829,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -1944,7 +1944,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -2065,7 +2065,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -2106,7 +2106,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-code-sandbox: + packages/wu-code-playground: specifiers: '@babel/preset-typescript': ^7.13.0 '@monaco-editor/loader': ^1.3.2 @@ -2188,7 +2188,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -2229,9 +2229,10 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-col: + packages/wu-code-sandbox: specifiers: '@babel/preset-typescript': ^7.13.0 + '@monaco-editor/loader': ^1.3.2 '@open-wc/testing': ^3.1.6 '@rollup/plugin-commonjs': ^19.0.2 '@rollup/plugin-inject': ^4.0.4 @@ -2260,8 +2261,11 @@ importers: html-webpack-plugin: ^5.5.0 jest: ^23.6.0 live-server: ^1.2.2 + monaco-editor: ^0.34.1 nodemon: ^1.18.9 + postcss-loader: ^7.0.1 prettier: ^1.15.3 + raw-loader: ^4.0.2 reflect-metadata: ^0.1.13 rollup: ^2.74.1 rollup-plugin-filesize: ^9.1.1 @@ -2287,8 +2291,10 @@ importers: webpack-cli: ^4.9.2 webpack-dev-server: ^4.9.0 dependencies: + '@monaco-editor/loader': 1.3.2_monaco-editor@0.34.1 '@wu-component/common': link:../common '@wu-component/web-core-plus': 0.3.6 + monaco-editor: 0.34.1 devDependencies: '@babel/preset-typescript': 7.18.6 '@open-wc/testing': 3.1.6 @@ -2305,7 +2311,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -2318,7 +2324,9 @@ importers: jest: 23.6.0 live-server: 1.2.2 nodemon: 1.19.4 + postcss-loader: 7.0.1_webpack@5.74.0 prettier: 1.19.1 + raw-loader: 4.0.2_webpack@5.74.0 reflect-metadata: 0.1.13 rollup: 2.79.1 rollup-plugin-filesize: 9.1.2 @@ -2344,7 +2352,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-collapse: + packages/wu-col: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -2420,7 +2428,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -2459,7 +2467,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-collapse-item: + packages/wu-collapse: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -2535,7 +2543,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -2574,11 +2582,10 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-color-picker: + packages/wu-collapse-item: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 - '@popperjs/core': ^2.11.5 '@rollup/plugin-commonjs': ^19.0.2 '@rollup/plugin-inject': ^4.0.4 '@rollup/plugin-json': ^4.1.0 @@ -2633,7 +2640,6 @@ importers: webpack-cli: ^4.9.2 webpack-dev-server: ^4.9.0 dependencies: - '@popperjs/core': 2.11.6 '@wu-component/common': link:../common '@wu-component/web-core-plus': 0.3.6 devDependencies: @@ -2652,7 +2658,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -2691,10 +2697,11 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-container: + packages/wu-color-picker: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 + '@popperjs/core': ^2.11.5 '@rollup/plugin-commonjs': ^19.0.2 '@rollup/plugin-inject': ^4.0.4 '@rollup/plugin-json': ^4.1.0 @@ -2749,6 +2756,7 @@ importers: webpack-cli: ^4.9.2 webpack-dev-server: ^4.9.0 dependencies: + '@popperjs/core': 2.11.6 '@wu-component/common': link:../common '@wu-component/web-core-plus': 0.3.6 devDependencies: @@ -2767,7 +2775,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -2806,7 +2814,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-date-picker: + packages/wu-container: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -2882,7 +2890,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -2921,7 +2929,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-dialog: + packages/wu-date-picker: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -2997,7 +3005,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -3036,7 +3044,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-empty: + packages/wu-dialog: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -3112,7 +3120,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -3151,7 +3159,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-footer: + packages/wu-empty: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -3227,7 +3235,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -3266,7 +3274,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-form: + packages/wu-footer: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -3342,7 +3350,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -3381,7 +3389,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-form-item: + packages/wu-form: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -3457,7 +3465,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -3496,7 +3504,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-form-label-wrap: + packages/wu-form-item: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -3572,7 +3580,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -3611,7 +3619,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-form1: + packages/wu-form-label-wrap: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -3687,7 +3695,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -3726,7 +3734,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-header: + packages/wu-form1: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -3802,7 +3810,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -3841,7 +3849,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-icon: + packages/wu-header: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -3917,7 +3925,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -3956,7 +3964,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-image: + packages/wu-icon: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -4032,7 +4040,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -4071,7 +4079,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-inject: + packages/wu-image: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -4147,7 +4155,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -4186,7 +4194,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-input: + packages/wu-inject: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -4262,7 +4270,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -4301,7 +4309,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-input-number: + packages/wu-input: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -4377,7 +4385,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -4416,7 +4424,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-leaflet-map: + packages/wu-input-number: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -4492,7 +4500,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -4531,7 +4539,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-link: + packages/wu-leaflet-map: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -4607,7 +4615,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -4646,7 +4654,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-lottie: + packages/wu-link: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -4677,7 +4685,6 @@ importers: html-webpack-plugin: ^5.5.0 jest: ^23.6.0 live-server: ^1.2.2 - lottie-web: ^5.9.6 nodemon: ^1.18.9 prettier: ^1.15.3 reflect-metadata: ^0.1.13 @@ -4707,7 +4714,6 @@ importers: dependencies: '@wu-component/common': link:../common '@wu-component/web-core-plus': 0.3.6 - lottie-web: 5.9.6 devDependencies: '@babel/preset-typescript': 7.18.6 '@open-wc/testing': 3.1.6 @@ -4724,7 +4730,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -4763,7 +4769,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-main: + packages/wu-lottie: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -4794,6 +4800,7 @@ importers: html-webpack-plugin: ^5.5.0 jest: ^23.6.0 live-server: ^1.2.2 + lottie-web: ^5.9.6 nodemon: ^1.18.9 prettier: ^1.15.3 reflect-metadata: ^0.1.13 @@ -4823,6 +4830,7 @@ importers: dependencies: '@wu-component/common': link:../common '@wu-component/web-core-plus': 0.3.6 + lottie-web: 5.9.6 devDependencies: '@babel/preset-typescript': 7.18.6 '@open-wc/testing': 3.1.6 @@ -4839,7 +4847,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -4878,7 +4886,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-mapbox-map: + packages/wu-main: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -4954,7 +4962,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -4993,7 +5001,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-menu: + packages/wu-mapbox-map: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -5069,7 +5077,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -5108,7 +5116,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-menu-item: + packages/wu-menu: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -5184,7 +5192,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -5223,7 +5231,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-menu-item-group: + packages/wu-menu-item: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -5299,7 +5307,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -5338,7 +5346,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-menu-sub: + packages/wu-menu-item-group: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -5414,7 +5422,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -5453,7 +5461,7 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-message: + packages/wu-menu-sub: specifiers: '@babel/preset-typescript': ^7.13.0 '@open-wc/testing': ^3.1.6 @@ -5529,7 +5537,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -5568,10 +5576,9 @@ importers: webpack-cli: 4.10.0_vnmgq7jx5zjkzolvtfp7mdf5ri webpack-dev-server: 4.11.1_5v66e2inugklgvlh4huuavolfq - packages/wu-monaco-editor: + packages/wu-message: specifiers: '@babel/preset-typescript': ^7.13.0 - '@monaco-editor/loader': ^1.3.2 '@open-wc/testing': ^3.1.6 '@rollup/plugin-commonjs': ^19.0.2 '@rollup/plugin-inject': ^4.0.4 @@ -5600,11 +5607,8 @@ importers: html-webpack-plugin: ^5.5.0 jest: ^23.6.0 live-server: ^1.2.2 - monaco-editor: ^0.34.1 nodemon: ^1.18.9 - postcss-loader: ^7.0.1 prettier: ^1.15.3 - raw-loader: ^4.0.2 reflect-metadata: ^0.1.13 rollup: ^2.74.1 rollup-plugin-filesize: ^9.1.1 @@ -5630,10 +5634,8 @@ importers: webpack-cli: ^4.9.2 webpack-dev-server: ^4.9.0 dependencies: - '@monaco-editor/loader': 1.3.2_monaco-editor@0.34.1 '@wu-component/common': link:../common '@wu-component/web-core-plus': 0.3.6 - monaco-editor: 0.34.1 devDependencies: '@babel/preset-typescript': 7.18.6 '@open-wc/testing': 3.1.6 @@ -5650,7 +5652,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -5663,9 +5665,7 @@ importers: jest: 23.6.0 live-server: 1.2.2 nodemon: 1.19.4 - postcss-loader: 7.0.1_webpack@5.74.0 prettier: 1.19.1 - raw-loader: 4.0.2_webpack@5.74.0 reflect-metadata: 0.1.13 rollup: 2.79.1 rollup-plugin-filesize: 9.1.2 @@ -5767,7 +5767,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -5882,7 +5882,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -5997,7 +5997,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -6114,7 +6114,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -6229,7 +6229,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -6344,7 +6344,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -6459,7 +6459,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -6574,7 +6574,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -6689,7 +6689,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -6804,7 +6804,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -6919,7 +6919,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -7034,7 +7034,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -7149,7 +7149,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -7264,7 +7264,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -7379,7 +7379,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -7494,7 +7494,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -7609,7 +7609,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -7726,7 +7726,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -7841,7 +7841,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -7956,7 +7956,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -8071,7 +8071,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -8186,7 +8186,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -8303,7 +8303,7 @@ importers: '@typescript-eslint/eslint-plugin': 5.41.0_b4mteysxb5yudzzv3kbnwdxmjm '@typescript-eslint/parser': 5.41.0_ofcmriis2sin4t7ptqesxr2wnu '@web/test-runner': 0.13.31 - '@wu-component/wu-build-tools': 0.0.5 + '@wu-component/wu-build-tools': 0.0.6 autoprefixer: 10.4.12 body-parser: 1.20.1 chalk: 4.1.2 @@ -10626,8 +10626,8 @@ packages: weakmap-polyfill: 2.0.4 dev: false - /@wu-component/wu-build-tools/0.0.5: - resolution: {integrity: sha512-UEiGhJsTccwoQjYPonT9FWH83UPdflFpVNA8Ht8qif824BIxCf0VrOeOqwd0wVk48Rf0lMr1WxhXzBIMeX1DhQ==} + /@wu-component/wu-build-tools/0.0.6: + resolution: {integrity: sha512-IpO2mA/eXtYxNp68BPWo/qkTfNs/NYNJWF+vBCidF4lBoh/sbYaIIoVp83QAOkyI167n5cxYUZaN8mawj4ujTg==} engines: {node: '>= 10', npm: '>= 5'} dependencies: cross-env: 7.0.3 diff --git a/packages/wu-build-tools/package.json b/packages/wu-build-tools/package.json index fbbf9803..9c8ee033 100644 --- a/packages/wu-build-tools/package.json +++ b/packages/wu-build-tools/package.json @@ -1,6 +1,6 @@ { "name": "@wu-component/wu-build-tools", - "version": "0.0.5", + "version": "0.0.6", "description": "> TODO: description", "author": "Marvin ", "homepage": "", diff --git a/packages/wu-build-tools/src/config/ConfigTemplete.ts b/packages/wu-build-tools/src/config/ConfigTemplete.ts index 3854be1f..9b930bb1 100644 --- a/packages/wu-build-tools/src/config/ConfigTemplete.ts +++ b/packages/wu-build-tools/src/config/ConfigTemplete.ts @@ -35,7 +35,7 @@ class ConfigTemplete { plugins: [ terser(), url({ - include: ['**/*.svg', '**/*.png', '**/*.jp(e)?g', '**/*.gif', '**/*.webp', '**/*.ttf', '**/*.woff', '**/*?raw'] + include: ['**/*.svg', '**/*.txt', '**/*.html', '**/*.png', '**/*.jp(e)?g', '**/*.gif', '**/*.webp', '**/*.ttf', '**/*.woff', '**/*?raw'] }), nodeResolve(), commonjs(),