diff --git a/src/workbench/browser/angular.json b/src/workbench/browser/angular.json index ec137a620..b33db9023 100644 --- a/src/workbench/browser/angular.json +++ b/src/workbench/browser/angular.json @@ -1 +1,156 @@ -{"$schema":"./node_modules/@angular/cli/lib/config/schema.json","cli":{"analytics":false,"defaultCollection":"@angular-eslint/schematics"},"version":1,"newProjectRoot":"projects","projects":{"eoapi":{"root":"","i18n":{"sourceLocale":{"code":"en"},"locales":{"zh":{"translation":"src/locale/messages.zh.xlf"}}},"sourceRoot":"src","projectType":"application","schematics":{"@schematics/angular:application":{"strict":true}},"architect":{"build":{"builder":"@angular-builders/custom-webpack:browser","options":{"localize":true,"aot":true,"outputPath":"dist","index":"src/index.html","main":"src/main.ts","tsConfig":"src/tsconfig.app.json","polyfills":"src/polyfills.ts","assets":["src/icon.ico","src/assets",{"glob":"**/*","input":"../../../node_modules/monaco-editor/min/vs","output":"/assets/vs/"}],"styles":[{"input":"src/assets/theme/classic_forest.scss","bundleName":"classic_forest","inject":false},"src/assets/theme/antd.less","src/styles.scss","src/assets/font/iconfont.css","src/ng1/index.css"],"scripts":["src/ng1/lib/angular/angular.js","src/ng1/app.module.js","src/ng1/component/select-default.js","src/ng1/component/sort-and-filter.js","src/ng1/component/auto-complete.js","src/ng1/component/list-block.js","src/ng1/directive/get-dom-length.directive.js","src/ng1/directive/drop-down-menu.directive.js","src/ng1/directive/sort.directive.js","src/ng1/directive/drop-change-space.directive.js","src/ng1/directive/inner-html.directive.js","src/ng1/directive/insert-html.directive.js","src/ng1/directive/copy-common.directive.js","src/assets/libs/protocolcheck.js"],"customWebpackConfig":{"path":"./angular.webpack.js","replaceDuplicatePlugins":true},"allowedCommonJsDependencies":["brace","qs","rxjs"]},"configurations":{"dev":{"optimization":false,"outputHashing":"none","sourceMap":true,"namedChunks":false,"localize":false,"extractLicenses":true,"vendorChunk":false,"buildOptimizer":false,"fileReplacements":[{"replace":"src/environments/environment.ts","with":"src/environments/environment.dev.ts"}]},"devCn":{"optimization":false,"outputHashing":"none","sourceMap":true,"namedChunks":false,"localize":["zh"],"extractLicenses":true,"vendorChunk":false,"buildOptimizer":false,"fileReplacements":[{"replace":"src/environments/environment.ts","with":"src/environments/environment.dev.ts"}]},"production":{"optimization":true,"outputHashing":"all","sourceMap":false,"namedChunks":false,"extractLicenses":true,"vendorChunk":false,"buildOptimizer":true,"fileReplacements":[{"replace":"src/environments/environment.ts","with":"src/environments/environment.prod.ts"}]},"docker":{"optimization":true,"outputHashing":"all","sourceMap":false,"namedChunks":false,"extractLicenses":true,"vendorChunk":false,"buildOptimizer":true,"fileReplacements":[{"replace":"src/environments/environment.ts","with":"src/environments/environment.docker.ts"}]}}},"serve":{"builder":"@angular-builders/custom-webpack:dev-server","options":{"browserTarget":"eoapi:build"},"configurations":{"dev":{"browserTarget":"eoapi:build:dev"},"devCn":{"browserTarget":"eoapi:build:devCn"},"production":{"browserTarget":"eoapi:build:production"}}},"extract-i18n":{"builder":"@angular-devkit/build-angular:extract-i18n","options":{"browserTarget":"eoapi:build"}},"test":{"builder":"@angular-builders/custom-webpack:karma","options":{"main":"src/test.ts","polyfills":"src/polyfills-test.ts","tsConfig":"src/tsconfig.spec.json","karmaConfig":"src/karma.conf.js","scripts":[],"styles":["src/styles.scss"],"assets":["src/assets"],"customWebpackConfig":{"path":"./angular.webpack.js","replaceDuplicatePlugins":true}}},"lint":{"builder":"@angular-eslint/builder:lint","options":{"lintFilePatterns":["src/**/*.ts","src/**/*.html"]}}}},"eoapi-e2e":{"root":"e2e","projectType":"application","architect":{"lint":{"builder":"@angular-eslint/builder:lint","options":{"lintFilePatterns":["e2e/**/*.ts"]}}}}},"defaultProject":"eoapi","schematics":{"@schematics/angular:component":{"prefix":"eo","style":"scss"},"@schematics/angular:directive":{"prefix":"eo"}}} \ No newline at end of file +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "cli": { "analytics": false, "defaultCollection": "@angular-eslint/schematics" }, + "version": 1, + "newProjectRoot": "projects", + "projects": { + "eoapi": { + "root": "", + "i18n": { + "sourceLocale": { "code": "en", "baseHref": "" }, + "locales": { "zh": { "translation": "src/locale/messages.zh.xlf", "baseHref": "" } } + }, + "sourceRoot": "src", + "projectType": "application", + "schematics": { "@schematics/angular:application": { "strict": true } }, + "architect": { + "build": { + "builder": "@angular-builders/custom-webpack:browser", + "options": { + "localize": true, + "aot": true, + "outputPath": "dist", + "index": "src/index.html", + "main": "src/main.ts", + "tsConfig": "src/tsconfig.app.json", + "polyfills": "src/polyfills.ts", + "assets": [ + "src/icon.ico", + "src/assets", + { "glob": "**/*", "input": "../../../node_modules/monaco-editor/min/vs", "output": "/assets/vs/" } + ], + "styles": [ + { "input": "src/assets/theme/classic_forest.scss", "bundleName": "classic_forest", "inject": false }, + "src/assets/theme/antd.less", + "src/styles.scss", + "src/assets/font/iconfont.css", + "src/ng1/index.css" + ], + "scripts": [ + "src/ng1/lib/angular/angular.js", + "src/ng1/app.module.js", + "src/ng1/component/select-default.js", + "src/ng1/component/sort-and-filter.js", + "src/ng1/component/auto-complete.js", + "src/ng1/component/list-block.js", + "src/ng1/directive/get-dom-length.directive.js", + "src/ng1/directive/drop-down-menu.directive.js", + "src/ng1/directive/sort.directive.js", + "src/ng1/directive/drop-change-space.directive.js", + "src/ng1/directive/inner-html.directive.js", + "src/ng1/directive/insert-html.directive.js", + "src/ng1/directive/copy-common.directive.js", + "src/assets/libs/protocolcheck.js" + ], + "customWebpackConfig": { "path": "./angular.webpack.js", "replaceDuplicatePlugins": true }, + "allowedCommonJsDependencies": ["brace", "qs", "rxjs"] + }, + "configurations": { + "dev": { + "optimization": false, + "outputHashing": "none", + "sourceMap": true, + "namedChunks": false, + "localize": false, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": false, + "fileReplacements": [ + { "replace": "src/environments/environment.ts", "with": "src/environments/environment.dev.ts" } + ] + }, + "devCn": { + "optimization": false, + "outputHashing": "none", + "sourceMap": true, + "namedChunks": false, + "localize": ["zh"], + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": false, + "fileReplacements": [ + { "replace": "src/environments/environment.ts", "with": "src/environments/environment.dev.ts" } + ] + }, + "production": { + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "namedChunks": false, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "fileReplacements": [ + { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } + ] + }, + "docker": { + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "namedChunks": false, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "fileReplacements": [ + { "replace": "src/environments/environment.ts", "with": "src/environments/environment.docker.ts" } + ] + } + } + }, + "serve": { + "builder": "@angular-builders/custom-webpack:dev-server", + "options": { "browserTarget": "eoapi:build" }, + "configurations": { + "dev": { "browserTarget": "eoapi:build:dev" }, + "devCn": { "browserTarget": "eoapi:build:devCn" }, + "production": { "browserTarget": "eoapi:build:production" } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { "browserTarget": "eoapi:build" } + }, + "test": { + "builder": "@angular-builders/custom-webpack:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills-test.ts", + "tsConfig": "src/tsconfig.spec.json", + "karmaConfig": "src/karma.conf.js", + "scripts": [], + "styles": ["src/styles.scss"], + "assets": ["src/assets"], + "customWebpackConfig": { "path": "./angular.webpack.js", "replaceDuplicatePlugins": true } + } + }, + "lint": { + "builder": "@angular-eslint/builder:lint", + "options": { "lintFilePatterns": ["src/**/*.ts", "src/**/*.html"] } + } + } + }, + "eoapi-e2e": { + "root": "e2e", + "projectType": "application", + "architect": { + "lint": { "builder": "@angular-eslint/builder:lint", "options": { "lintFilePatterns": ["e2e/**/*.ts"] } } + } + } + }, + "defaultProject": "eoapi", + "schematics": { + "@schematics/angular:component": { "prefix": "eo", "style": "scss" }, + "@schematics/angular:directive": { "prefix": "eo" } + } +} diff --git a/src/workbench/browser/src/app/pages/extension/extension.component.ts b/src/workbench/browser/src/app/pages/extension/extension.component.ts index d87428dbc..0a40b77ed 100644 --- a/src/workbench/browser/src/app/pages/extension/extension.component.ts +++ b/src/workbench/browser/src/app/pages/extension/extension.component.ts @@ -22,6 +22,11 @@ export class ExtensionComponent implements OnInit { title: $localize`Official`, isLeaf: true, }, + { + key: 'installed', + title: $localize`Installed`, + isLeaf: true, + }, ]; fixedTreeNode: GroupTreeItem[] | NzTreeNode[] = [ { @@ -53,11 +58,6 @@ export class ExtensionComponent implements OnInit { ngOnInit(): void { this.watchRouterChange(); this.setSelectedKeys(); - this.treeNodes.push({ - key: 'installed', - title: $localize`Installed`, - isLeaf: true, - }); } onSeachChange(keyword) { diff --git a/src/workbench/browser/src/app/pages/extension/extension.service.ts b/src/workbench/browser/src/app/pages/extension/extension.service.ts index b2a70dfe1..3e1679262 100644 --- a/src/workbench/browser/src/app/pages/extension/extension.service.ts +++ b/src/workbench/browser/src/app/pages/extension/extension.service.ts @@ -50,7 +50,12 @@ export class ExtensionService { result.data = [ ...result.data.filter((val) => installList.every((childVal) => childVal.name !== val.name)), //Local debug package - ...installList, + ...installList.map((module) => { + if (installList.find((it) => it.name === module.name)) { + module.i18n = result.data.find((it) => it.name === module.name)?.i18n; + } + return module; + }), ]; result.data = result.data.map((module) => this.translateModule(module)); return result; diff --git a/src/workbench/browser/src/app/pages/extension/list/extension-list.component.ts b/src/workbench/browser/src/app/pages/extension/list/extension-list.component.ts index 4347c9f52..969f3bbec 100644 --- a/src/workbench/browser/src/app/pages/extension/list/extension-list.component.ts +++ b/src/workbench/browser/src/app/pages/extension/list/extension-list.component.ts @@ -54,7 +54,7 @@ export class ExtensionListComponent implements OnInit { const timeStart = Date.now(); try { if (this.type === 'installed') { - const installedList = new ExtensionList(this.extensionService.getInstalledList()); + const installedList = new ExtensionList(this.extensionService.getInstalledList()); return installedList.search(keyword).map((n) => { n.isEnable = this.extensionService.isEnable(n.name); return n; @@ -66,11 +66,6 @@ export class ExtensionListComponent implements OnInit { } return new ExtensionList(res.data).search(keyword); } catch (error) { - this.modal.confirm({ - nzTitle: $localize`Extension list failed to load`, - nzOkText: $localize`Retry`, - nzOnOk: () => this.getPluginList(keyword), - }); } finally { clearTimeout(timer); const timeout = Date.now() - timeStart > 300 ? 0 : 300; diff --git a/src/workbench/browser/src/assets/libs/iconpark.js b/src/workbench/browser/src/assets/libs/iconpark.js new file mode 100644 index 000000000..968e83bf9 --- /dev/null +++ b/src/workbench/browser/src/assets/libs/iconpark.js @@ -0,0 +1 @@ +(function(){window.__iconpark__=window.__iconpark__||{};var obj=JSON.parse("{\"321441\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"321465\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"currentColor\",\"content\":\"\"},\"321466\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"321506\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"321507\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"321516\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"322034\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"329330\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"329331\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"329363\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"346074\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"346319\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"346321\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"346322\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"346892\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"353225\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"353227\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"353292\":{\"viewBox\":\"0 0 24 24\",\"content\":\"\"},\"440699\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"479468\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"479475\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"479649\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"479650\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"479655\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"479656\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"479658\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"479669\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"479670\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"479679\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"479688\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"479693\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"479700\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"479704\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"479710\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"479726\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"485337\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"545521\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"545590\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"546240\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"546241\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"546242\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"546245\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"546246\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"553419\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"553420\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"558717\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"562045\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"576760\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"},\"576764\":{\"viewBox\":\"0 0 48 48\",\"fill\":\"none\",\"content\":\"\"}}");for(var _k in obj){window.__iconpark__[_k] = obj[_k]};var nm={"api":321441,"puzzle":321465,"setting-two":321466,"plus":321506,"home":321507,"help":321516,"left":322034,"link-cloud-faild":329330,"link-cloud-sucess":329331,"home-5kaioboo":329363,"left-bar":346074,"folder-open":346319,"history":346321,"instruction":346322,"delete":346892,"english":353225,"international":353227,"language":353292,"eyes":440699,"down-two":479468,"down-two-63nj75a0":479475,"expand-left":479649,"expand-right":479650,"up":479655,"right":479656,"down":479658,"afferent-three":479669,"efferent-three":479670,"upload-one":479679,"magic":479688,"copy":479693,"search":479700,"clear":479704,"send":479710,"file-text-one":479726,"close-small":485337,"lightning":545521,"more":545590,"check-one":546240,"close-one":546241,"info":546242,"loading-one":546245,"check":546246,"arrow-up":553419,"arrow-down":553420,"check-small":558717,"download":562045,"me":576760,"every-user":576764};for(var _i in nm){window.__iconpark__[_i] = obj[nm[_i]]}})();"object"!=typeof globalThis&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__);(()=>{"use strict";var t={816:(t,e,i)=>{var s,r,o,n;i.d(e,{Vm:()=>z,dy:()=>P,Jb:()=>x,Ld:()=>$,sY:()=>T,YP:()=>A});const l=globalThis.trustedTypes,a=l?l.createPolicy("lit-html",{createHTML:t=>t}):void 0,h=`lit$${(Math.random()+"").slice(9)}$`,c="?"+h,d=`<${c}>`,u=document,p=(t="")=>u.createComment(t),v=t=>null===t||"object"!=typeof t&&"function"!=typeof t,f=Array.isArray,y=t=>{var e;return f(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])},m=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,g=/-->/g,b=/>/g,S=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,w=/'/g,k=/"/g,E=/^(?:script|style|textarea)$/i,C=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),P=C(1),A=C(2),x=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),O=new WeakMap,T=(t,e,i)=>{var s,r;const o=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let n=o._$litPart$;if(void 0===n){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;o._$litPart$=n=new H(e.insertBefore(p(),t),t,void 0,i)}return n.I(t),n},R=u.createTreeWalker(u,129,null,!1),_=(t,e)=>{const i=t.length-1,s=[];let r,o=2===e?"":"",n=m;for(let e=0;e"===a[0]?(n=null!=r?r:m,c=-1):void 0===a[1]?c=-2:(c=n.lastIndex-a[2].length,l=a[1],n=void 0===a[3]?S:'"'===a[3]?k:w):n===k||n===w?n=S:n===g||n===b?n=m:(n=S,r=void 0);const p=n===S&&t[e+1].startsWith("/>")?" ":"";o+=n===m?i+d:c>=0?(s.push(l),i.slice(0,c)+"$lit$"+i.slice(c)+h+p):i+h+(-2===c?(s.push(void 0),e):p)}const l=o+(t[i]||"")+(2===e?"":"");return[void 0!==a?a.createHTML(l):l,s]};class N{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,o=0;const n=t.length-1,a=this.parts,[d,u]=_(t,e);if(this.el=N.createElement(d,i),R.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=R.nextNode())&&a.length0){s.textContent=l?l.emptyScript:"";for(let i=0;i2||""!==i[0]||""!==i[1]?(this.H=Array(i.length-1).fill($),this.strings=i):this.H=$}get tagName(){return this.element.tagName}I(t,e=this,i,s){const r=this.strings;let o=!1;if(void 0===r)t=U(this,t,e,0),o=!v(t)||t!==this.H&&t!==x,o&&(this.H=t);else{const s=t;let n,l;for(t=r[0],n=0;n{i.r(e),i.d(e,{customElement:()=>s,eventOptions:()=>a,property:()=>o,query:()=>h,queryAll:()=>c,queryAssignedNodes:()=>v,queryAsync:()=>d,state:()=>n});const s=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:s}=e;return{kind:i,elements:s,finisher(e){window.customElements.define(t,e)}}})(t,e),r=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function o(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):r(t,e)}function n(t){return o({...t,state:!0,attribute:!1})}const l=({finisher:t,descriptor:e})=>(i,s)=>{var r;if(void 0===s){const s=null!==(r=i.originalKey)&&void 0!==r?r:i.key,o=null!=e?{kind:"method",placement:"prototype",key:s,descriptor:e(i.key)}:{...i,key:s};return null!=t&&(o.finisher=function(e){t(e,s)}),o}{const r=i.constructor;void 0!==e&&Object.defineProperty(i,s,e(s)),null==t||t(r,s)}};function a(t){return l({finisher:(e,i)=>{Object.assign(e.prototype[i],t)}})}function h(t,e){return l({descriptor:i=>{const s={get(){var e;return null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t)},enumerable:!0,configurable:!0};if(e){const e="symbol"==typeof i?Symbol():"__"+i;s.get=function(){var i;return void 0===this[e]&&(this[e]=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(t)),this[e]}}return s}})}function c(t){return l({descriptor:e=>({get(){var e;return null===(e=this.renderRoot)||void 0===e?void 0:e.querySelectorAll(t)},enumerable:!0,configurable:!0})})}function d(t){return l({descriptor:e=>({async get(){var e;return await this.updateComplete,null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t)},enumerable:!0,configurable:!0})})}const u=Element.prototype,p=u.msMatchesSelector||u.webkitMatchesSelector;function v(t="",e=!1,i=""){return l({descriptor:s=>({get(){var s,r;const o="slot"+(t?`[name=${t}]`:":not([name])");let n=null===(r=null===(s=this.renderRoot)||void 0===s?void 0:s.querySelector(o))||void 0===r?void 0:r.assignedNodes({flatten:e});return n&&i&&(n=n.filter((t=>t.nodeType===Node.ELEMENT_NODE&&(t.matches?t.matches(i):p.call(t,i))))),n},enumerable:!0,configurable:!0})})}},23:(t,e,i)=>{i.r(e),i.d(e,{unsafeSVG:()=>l});const s=t=>(...e)=>({_$litDirective$:t,values:e});var r=i(816);class o extends class{constructor(t){}T(t,e,i){this.Σdt=t,this.M=e,this.Σct=i}S(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}{constructor(t){if(super(t),this.vt=r.Ld,2!==t.type)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===r.Ld)return this.Vt=void 0,this.vt=t;if(t===r.Jb)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.vt)return this.Vt;this.vt=t;const e=[t];return e.raw=e,this.Vt={_$litType$:this.constructor.resultType,strings:e,values:[]}}}o.directiveName="unsafeHTML",o.resultType=1,s(o);class n extends o{}n.directiveName="unsafeSVG",n.resultType=2;const l=s(n)},249:(t,e,i)=>{i.r(e),i.d(e,{CSSResult:()=>n,LitElement:()=>x,ReactiveElement:()=>b,UpdatingElement:()=>A,_Σ:()=>s.Vm,_Φ:()=>$,adoptStyles:()=>c,css:()=>h,defaultConverter:()=>y,getCompatibleStyle:()=>d,html:()=>s.dy,noChange:()=>s.Jb,notEqual:()=>m,nothing:()=>s.Ld,render:()=>s.sY,supportsAdoptingStyleSheets:()=>r,svg:()=>s.YP,unsafeCSS:()=>l});var s=i(816);const r=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol();class n{constructor(t,e){if(e!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return r&&void 0===this.t&&(this.t=new CSSStyleSheet,this.t.replaceSync(this.cssText)),this.t}toString(){return this.cssText}}const l=t=>new n(t+"",o),a=new Map,h=(t,...e)=>{const i=e.reduce(((e,i,s)=>e+(t=>{if(t instanceof n)return t.cssText;if("number"==typeof t)return t;throw Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(i)+t[s+1]),t[0]);let s=a.get(i);return void 0===s&&a.set(i,s=new n(i,o)),s},c=(t,e)=>{r?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style");i.textContent=e.cssText,t.appendChild(i)}))},d=r?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return l(e)})(t):t;var u,p,v,f;const y={toAttribute(t,e){switch(e){case Boolean:t=t?"":null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},m=(t,e)=>e!==t&&(e==e||t==t),g={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:m};class b extends HTMLElement{constructor(){super(),this.Πi=new Map,this.Πo=void 0,this.Πl=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.Πh=null,this.u()}static addInitializer(t){var e;null!==(e=this.v)&&void 0!==e||(this.v=[]),this.v.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const s=this.Πp(i,e);void 0!==s&&(this.Πm.set(s,i),t.push(s))})),t}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const r=this[t];this[e]=s,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||g}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this.Πm=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(d(t))}else void 0!==t&&e.push(d(t));return e}static Πp(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this.Πg=new Promise((t=>this.enableUpdating=t)),this.L=new Map,this.Π_(),this.requestUpdate(),null===(t=this.constructor.v)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this.ΠU)&&void 0!==e?e:this.ΠU=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this.ΠU)||void 0===e||e.splice(this.ΠU.indexOf(t)>>>0,1)}Π_(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this.Πi.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return c(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this.ΠU)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)})),this.Πl&&(this.Πl(),this.Πo=this.Πl=void 0)}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this.ΠU)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)})),this.Πo=new Promise((t=>this.Πl=t))}attributeChangedCallback(t,e,i){this.K(t,i)}Πj(t,e,i=g){var s,r;const o=this.constructor.Πp(t,i);if(void 0!==o&&!0===i.reflect){const n=(null!==(r=null===(s=i.converter)||void 0===s?void 0:s.toAttribute)&&void 0!==r?r:y.toAttribute)(e,i.type);this.Πh=t,null==n?this.removeAttribute(o):this.setAttribute(o,n),this.Πh=null}}K(t,e){var i,s,r;const o=this.constructor,n=o.Πm.get(t);if(void 0!==n&&this.Πh!==n){const t=o.getPropertyOptions(n),l=t.converter,a=null!==(r=null!==(s=null===(i=l)||void 0===i?void 0:i.fromAttribute)&&void 0!==s?s:"function"==typeof l?l:null)&&void 0!==r?r:y.fromAttribute;this.Πh=n,this[n]=a(e,t.type),this.Πh=null}}requestUpdate(t,e,i){let s=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||m)(this[t],e)?(this.L.has(t)||this.L.set(t,e),!0===i.reflect&&this.Πh!==t&&(void 0===this.Πk&&(this.Πk=new Map),this.Πk.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this.Πg=this.Πq())}async Πq(){this.isUpdatePending=!0;try{for(await this.Πg;this.Πo;)await this.Πo}catch(t){Promise.reject(t)}const t=this.performUpdate();return null!=t&&await t,!this.isUpdatePending}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this.Πi&&(this.Πi.forEach(((t,e)=>this[e]=t)),this.Πi=void 0);let e=!1;const i=this.L;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this.ΠU)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this.Π$()}catch(t){throw e=!1,this.Π$(),t}e&&this.E(i)}willUpdate(t){}E(t){var e;null===(e=this.ΠU)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}Π$(){this.L=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.Πg}shouldUpdate(t){return!0}update(t){void 0!==this.Πk&&(this.Πk.forEach(((t,e)=>this.Πj(e,this[e],t))),this.Πk=void 0),this.Π$()}updated(t){}firstUpdated(t){}}var S,w,k,E,C,P;b.finalized=!0,b.shadowRootOptions={mode:"open"},null===(p=(u=globalThis).reactiveElementPlatformSupport)||void 0===p||p.call(u,{ReactiveElement:b}),(null!==(v=(f=globalThis).reactiveElementVersions)&&void 0!==v?v:f.reactiveElementVersions=[]).push("1.0.0-rc.1");const A=b;(null!==(S=(P=globalThis).litElementVersions)&&void 0!==S?S:P.litElementVersions=[]).push("3.0.0-rc.1");class x extends b{constructor(){super(...arguments),this.renderOptions={host:this},this.Φt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();super.update(t),this.Φt=(0,s.sY)(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this.Φt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this.Φt)||void 0===t||t.setConnected(!1)}render(){return s.Jb}}x.finalized=!0,x._$litElement$=!0,null===(k=(w=globalThis).litElementHydrateSupport)||void 0===k||k.call(w,{LitElement:x}),null===(C=(E=globalThis).litElementPlatformSupport)||void 0===C||C.call(E,{LitElement:x});const $={K:(t,e,i)=>{t.K(e,i)},L:t=>t.L}},409:function(t,e,i){var s=this&&this.__decorate||function(t,e,i,s){var r,o=arguments.length,n=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(o<3?r(n):o>3?r(e,i,n):r(e,i))||n);return o>3&&n&&Object.defineProperty(e,i,n),n};Object.defineProperty(e,"__esModule",{value:!0}),e.IconparkIconElement=void 0;const r=i(249),o=i(26),n=i(23),l={color:1,fill:1,stroke:1},a={STROKE:{trackAttr:"data-follow-stroke",rawAttr:"stroke"},FILL:{trackAttr:"data-follow-fill",rawAttr:"fill"}};class h extends r.LitElement{constructor(){super(...arguments),this.name="",this.identifyer="",this.size="1em"}get _width(){return this.width||this.size}get _height(){return this.height||this.size}get _stroke(){return this.stroke||this.color}get _fill(){return this.fill||this.color}get SVGConfig(){return(window.__iconpark__||{})[this.identifyer]||(window.__iconpark__||{})[this.name]||{viewBox:"0 0 0 0",content:""}}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.monkeyPatch("STROKE",!0),this.monkeyPatch("FILL",!0)}))}monkeyPatch(t,e){switch(t){case"STROKE":this.updateDOMByHand(this.strokeAppliedNodes,"STROKE",this._stroke,!!e);break;case"FILL":this.updateDOMByHand(this.fillAppliedNodes,"FILL",this._fill,!!e)}}updateDOMByHand(t,e,i,s){!i&&s||t&&t.forEach((t=>{i&&i===t.getAttribute(a[e].rawAttr)||t.setAttribute(a[e].rawAttr,i||t.getAttribute(a[e].trackAttr))}))}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),"name"===t||"identifyer"===t?setTimeout((()=>{this.monkeyPatch("STROKE"),this.monkeyPatch("FILL")})):l[t]&&(this.monkeyPatch("STROKE"),this.monkeyPatch("FILL"))}render(){return r.svg`${n.unsafeSVG(this.SVGConfig.content)}`}}h.styles=r.css`:host {display: inline-flex; align-items: center; justify-content: center;} :host([spin]) svg {animation: iconpark-spin 1s infinite linear;} :host([spin][rtl]) svg {animation: iconpark-spin-rtl 1s infinite linear;} :host([rtl]) svg {transform: scaleX(-1);} @keyframes iconpark-spin {0% { -webkit-transform: rotate(0); transform: rotate(0);} 100% {-webkit-transform: rotate(360deg); transform: rotate(360deg);}} @keyframes iconpark-spin-rtl {0% {-webkit-transform: scaleX(-1) rotate(0); transform: scaleX(-1) rotate(0);} 100% {-webkit-transform: scaleX(-1) rotate(360deg); transform: scaleX(-1) rotate(360deg);}}`,s([o.property({reflect:!0})],h.prototype,"name",void 0),s([o.property({reflect:!0,attribute:"icon-id"})],h.prototype,"identifyer",void 0),s([o.property({reflect:!0})],h.prototype,"color",void 0),s([o.property({reflect:!0})],h.prototype,"stroke",void 0),s([o.property({reflect:!0})],h.prototype,"fill",void 0),s([o.property({reflect:!0})],h.prototype,"size",void 0),s([o.property({reflect:!0})],h.prototype,"width",void 0),s([o.property({reflect:!0})],h.prototype,"height",void 0),s([o.queryAll(`[${a.STROKE.trackAttr}]`)],h.prototype,"strokeAppliedNodes",void 0),s([o.queryAll(`[${a.FILL.trackAttr}]`)],h.prototype,"fillAppliedNodes",void 0),e.IconparkIconElement=h,customElements.get("iconpark-icon")||customElements.define("iconpark-icon",h)}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var o=e[s]={exports:{}};return t[s].call(o.exports,o,o.exports,i),o.exports}i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(409)})(); \ No newline at end of file diff --git a/src/workbench/browser/src/index.html b/src/workbench/browser/src/index.html index 0594a1258..6acac97c0 100644 --- a/src/workbench/browser/src/index.html +++ b/src/workbench/browser/src/index.html @@ -5,7 +5,7 @@ Eoapi - Easy & Open Source API Ecosystem - +