├── .eslintrc.json ├── .gitignore ├── .vscode ├── extensions.json └── launch.json ├── .vscodeignore ├── CHANGELOG.CN.md ├── CHANGELOG.md ├── DEVELOP.CN.md ├── LICENSE ├── README.CN.md ├── README.md ├── assets ├── add1.png ├── add1.svg ├── dark │ ├── boolean.svg │ ├── collapse.svg │ ├── dependency.svg │ ├── download.svg │ ├── edit.svg │ ├── file.svg │ ├── folder.svg │ ├── github-web.svg │ ├── github.svg │ ├── number.svg │ ├── omi-eco.svg │ ├── omi.svg │ ├── refresh.svg │ └── string.svg ├── download.svg ├── function │ ├── fun1.gif │ ├── fun10.png │ ├── fun3.gif │ ├── fun4.gif │ ├── fun5.gif │ ├── fun6.gif │ ├── fun7.gif │ ├── fun8.png │ ├── fun9.gif │ ├── function1.png │ ├── function2.png │ ├── function3.png │ ├── function4.png │ ├── omi-demo1.gif │ ├── omi-demo2.gif │ └── omi.gif ├── github-128px.ico ├── github-263px.png ├── github-web.svg ├── github.svg ├── light │ ├── boolean.svg │ ├── collapse.svg │ ├── dependency.svg │ ├── download.svg │ ├── edit.svg │ ├── file.svg │ ├── folder.svg │ ├── github-web.svg │ ├── github.svg │ ├── number.svg │ ├── omi-eco.svg │ ├── omi.svg │ ├── refresh.svg │ └── string.svg ├── omi-use.svg ├── omi.svg ├── omiu │ ├── action-sheet.png │ ├── badge.png │ ├── button.png │ ├── checkbox.png │ ├── date-picker.png │ ├── dialog.png │ ├── dropdown-menu.png │ ├── dropdown.png │ ├── equal-space.png │ ├── icon.png │ ├── input-number.png │ ├── input-table.png │ ├── input.png │ ├── nav.png │ ├── pagination.png │ ├── path-progress.png │ ├── popover.png │ ├── popup.png │ ├── progress.png │ ├── radio.png │ ├── rate.png │ ├── row.png │ ├── select-list.png │ ├── step.png │ ├── switch.png │ ├── tab.png │ ├── table.png │ ├── timeline.png │ └── toast.png ├── set.png ├── set2.png ├── set2.svg ├── tstojs.png ├── tstojs.svg ├── w.png ├── web.svg └── zain.png ├── jsconfig.json ├── omi-2.2.0.vsix ├── omi-vscode.code-workspace ├── package.json ├── src ├── algorithm │ └── index.js ├── completion │ ├── README.CN.md │ ├── README.md │ ├── config │ │ ├── omim-one.json │ │ ├── omim-two.json │ │ ├── omiu.json │ │ └── test │ │ │ └── test.json │ └── index.js ├── ecosystem │ ├── README.md │ ├── index.js │ ├── open-url.js │ ├── packages │ │ ├── omi-cli │ │ │ └── template │ │ │ │ └── app │ │ │ │ ├── .eslintrc │ │ │ │ ├── README.md │ │ │ │ ├── config │ │ │ │ ├── entry.js │ │ │ │ ├── env.js │ │ │ │ ├── jest │ │ │ │ │ ├── cssTransform.js │ │ │ │ │ └── fileTransform.js │ │ │ │ ├── paths.js │ │ │ │ ├── polyfills.js │ │ │ │ ├── webpack.config.dev.js │ │ │ │ ├── webpack.config.prod.js │ │ │ │ └── webpackDevServer.config.js │ │ │ │ ├── gitignore │ │ │ │ ├── package.json │ │ │ │ ├── public │ │ │ │ ├── favicon.ico │ │ │ │ ├── index.html │ │ │ │ └── manifest.json │ │ │ │ ├── scripts │ │ │ │ ├── build.js │ │ │ │ ├── start.js │ │ │ │ └── test.js │ │ │ │ └── src │ │ │ │ ├── admin.js │ │ │ │ ├── assets │ │ │ │ └── index.css │ │ │ │ ├── elements │ │ │ │ ├── app-intro │ │ │ │ │ ├── _index.css │ │ │ │ │ └── index.js │ │ │ │ ├── app-omil │ │ │ │ │ ├── _index.css │ │ │ │ │ ├── index.js │ │ │ │ │ └── index.omi │ │ │ │ ├── app │ │ │ │ │ ├── _index.less │ │ │ │ │ ├── index.js │ │ │ │ │ └── logo.svg │ │ │ │ └── hello │ │ │ │ │ ├── _index.css │ │ │ │ │ ├── index.js │ │ │ │ │ └── omi.png │ │ │ │ ├── index.js │ │ │ │ ├── store │ │ │ │ └── admin-store.js │ │ │ │ └── utils │ │ │ │ ├── mapping-omio.js │ │ │ │ └── mapping.js │ │ └── omi-docs │ │ │ ├── asset-manifest.json │ │ │ ├── cn.html │ │ │ ├── favicon.ico │ │ │ ├── highlight │ │ │ ├── prism.css │ │ │ └── prism.js │ │ │ ├── index.html │ │ │ ├── index1.html │ │ │ ├── js │ │ │ └── remarkable.min.js │ │ │ ├── repl │ │ │ ├── action-sheet.html │ │ │ ├── badge.html │ │ │ ├── button.html │ │ │ ├── checkbox.html │ │ │ ├── date-picker.html │ │ │ ├── dialog.html │ │ │ ├── dropdown-menu.html │ │ │ ├── dropdown.html │ │ │ ├── equal-space.html │ │ │ ├── icon.html │ │ │ ├── index.html │ │ │ ├── input-number.html │ │ │ ├── input-table.html │ │ │ ├── input.html │ │ │ ├── libs │ │ │ │ ├── babel.min.js │ │ │ │ ├── codemirror.css │ │ │ │ ├── codemirror.js │ │ │ │ ├── javascript.js │ │ │ │ ├── normalize.css │ │ │ │ ├── omiu.js │ │ │ │ ├── webcomponents-bundle.js │ │ │ │ └── xml.js │ │ │ ├── nav.html │ │ │ ├── pagination.html │ │ │ ├── path-progress.html │ │ │ ├── popover.html │ │ │ ├── popup.html │ │ │ ├── preview.html │ │ │ ├── progress.html │ │ │ ├── radio.html │ │ │ ├── rate.html │ │ │ ├── row.html │ │ │ ├── select-list.html │ │ │ ├── step.html │ │ │ ├── switch.html │ │ │ ├── tab.html │ │ │ ├── table.html │ │ │ ├── timeline.html │ │ │ └── toast.html │ │ │ ├── service-worker.js │ │ │ └── static │ │ │ ├── css │ │ │ ├── cn.4dd07f49.css │ │ │ ├── cn.4dd07f49.css.map │ │ │ ├── index.4dd07f49.css │ │ │ └── index.4dd07f49.css.map │ │ │ ├── js │ │ │ ├── 0.9d48c206.chunk.js │ │ │ ├── 0.9d48c206.chunk.js.map │ │ │ ├── 1.08295283.chunk.js │ │ │ ├── 1.08295283.chunk.js.map │ │ │ ├── 10.27f188c7.chunk.js │ │ │ ├── 10.27f188c7.chunk.js.map │ │ │ ├── 11.1885c8ec.chunk.js │ │ │ ├── 11.1885c8ec.chunk.js.map │ │ │ ├── 12.99cfd40d.chunk.js │ │ │ ├── 12.99cfd40d.chunk.js.map │ │ │ ├── 13.5d70a745.chunk.js │ │ │ ├── 13.5d70a745.chunk.js.map │ │ │ ├── 14.4ee71391.chunk.js │ │ │ ├── 14.4ee71391.chunk.js.map │ │ │ ├── 15.e804bc91.chunk.js │ │ │ ├── 15.e804bc91.chunk.js.map │ │ │ ├── 16.e084ed27.chunk.js │ │ │ ├── 16.e084ed27.chunk.js.map │ │ │ ├── 17.42ec0c78.chunk.js │ │ │ ├── 17.42ec0c78.chunk.js.map │ │ │ ├── 18.730eeb3b.chunk.js │ │ │ ├── 18.730eeb3b.chunk.js.map │ │ │ ├── 19.e37070eb.chunk.js │ │ │ ├── 19.e37070eb.chunk.js.map │ │ │ ├── 2.82aa1247.chunk.js │ │ │ ├── 2.82aa1247.chunk.js.map │ │ │ ├── 20.7729a37c.chunk.js │ │ │ ├── 20.7729a37c.chunk.js.map │ │ │ ├── 21.4551715a.chunk.js │ │ │ ├── 21.4551715a.chunk.js.map │ │ │ ├── 22.016f3201.chunk.js │ │ │ ├── 22.016f3201.chunk.js.map │ │ │ ├── 23.1f4e3bc1.chunk.js │ │ │ ├── 23.1f4e3bc1.chunk.js.map │ │ │ ├── 24.d7ad68dc.chunk.js │ │ │ ├── 24.d7ad68dc.chunk.js.map │ │ │ ├── 25.734c7748.chunk.js │ │ │ ├── 25.734c7748.chunk.js.map │ │ │ ├── 26.ef88d36f.chunk.js │ │ │ ├── 26.ef88d36f.chunk.js.map │ │ │ ├── 27.e12ca944.chunk.js │ │ │ ├── 27.e12ca944.chunk.js.map │ │ │ ├── 28.23d63cad.chunk.js │ │ │ ├── 28.23d63cad.chunk.js.map │ │ │ ├── 29.fcb31596.chunk.js │ │ │ ├── 29.fcb31596.chunk.js.map │ │ │ ├── 3.d4de73a3.chunk.js │ │ │ ├── 3.d4de73a3.chunk.js.map │ │ │ ├── 30.4ac661da.chunk.js │ │ │ ├── 30.4ac661da.chunk.js.map │ │ │ ├── 31.55b81de7.chunk.js │ │ │ ├── 31.55b81de7.chunk.js.map │ │ │ ├── 4.4af8cac5.chunk.js │ │ │ ├── 4.4af8cac5.chunk.js.map │ │ │ ├── 5.cbce913c.chunk.js │ │ │ ├── 5.cbce913c.chunk.js.map │ │ │ ├── 6.0c7fe731.chunk.js │ │ │ ├── 6.0c7fe731.chunk.js.map │ │ │ ├── 7.106d7946.chunk.js │ │ │ ├── 7.106d7946.chunk.js.map │ │ │ ├── 8.0cfd753d.chunk.js │ │ │ ├── 8.0cfd753d.chunk.js.map │ │ │ ├── 9.d1aba1bc.chunk.js │ │ │ ├── 9.d1aba1bc.chunk.js.map │ │ │ ├── cn.2e0c07c8.js │ │ │ ├── cn.2e0c07c8.js.map │ │ │ ├── index.cfae50a6.js │ │ │ └── index.cfae50a6.js.map │ │ │ └── media │ │ │ └── omi-logo2019.923166c3.svg │ ├── page │ │ ├── .eslintrc │ │ ├── .gitignore │ │ ├── README.md │ │ ├── build │ │ │ ├── admin.html │ │ │ ├── asset-manifest.json │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ ├── manifest.json │ │ │ ├── service-worker.js │ │ │ └── static │ │ │ │ └── js │ │ │ │ ├── admin.307cac3c.js │ │ │ │ ├── admin.307cac3c.js.map │ │ │ │ ├── index.56726421.js │ │ │ │ └── index.56726421.js.map │ │ ├── config │ │ │ ├── entry.js │ │ │ ├── env.js │ │ │ ├── jest │ │ │ │ ├── cssTransform.js │ │ │ │ └── fileTransform.js │ │ │ ├── paths.js │ │ │ ├── polyfills.js │ │ │ ├── webpack.config.dev.js │ │ │ ├── webpack.config.prod.js │ │ │ └── webpackDevServer.config.js │ │ ├── package.json │ │ ├── public │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ └── manifest.json │ │ ├── scripts │ │ │ ├── build.js │ │ │ ├── start.js │ │ │ └── test.js │ │ └── src │ │ │ ├── admin.js │ │ │ ├── assets │ │ │ └── index.css │ │ │ ├── elements │ │ │ ├── app-intro │ │ │ │ ├── _index.css │ │ │ │ └── index.js │ │ │ ├── app │ │ │ │ ├── _index.css │ │ │ │ ├── index.js │ │ │ │ └── logo.svg │ │ │ └── hello │ │ │ │ ├── _index.css │ │ │ │ ├── index.js │ │ │ │ └── omi.png │ │ │ ├── index.js │ │ │ ├── store │ │ │ └── admin-store.js │ │ │ └── utils │ │ │ ├── mapping-omio.js │ │ │ └── mapping.js │ └── text │ │ ├── omi-ecosystem-cn.json │ │ ├── omi-ecosystem-en.json │ │ └── omi-ecosystem-kr.json ├── github │ ├── index.js │ ├── open-url.js │ └── tree-item.js ├── hover │ ├── README.CN.md │ ├── README.md │ ├── config │ │ ├── omi.json │ │ ├── omiu.json │ │ ├── other │ │ │ └── other.json │ │ └── package.json │ └── index.js ├── index.js ├── jump │ └── index.js ├── snippets │ ├── omi.code-snippets │ ├── omi.json │ ├── omiu.json │ └── snippets-bf │ │ ├── omi.code-snippets │ │ ├── omi.json │ │ └── omiu.json ├── syntaxes │ └── omi.tmLanguage.json └── welcome │ ├── index.js │ └── omi-welcome │ ├── .eslintrc │ ├── .gitignore │ ├── README.md │ ├── build │ ├── admin.html │ ├── asset-manifest.json │ ├── favicon.ico │ ├── index.html │ ├── manifest.json │ ├── service-worker.js │ └── static │ │ └── js │ │ ├── admin.307cac3c.js │ │ ├── admin.307cac3c.js.map │ │ ├── index.56726421.js │ │ └── index.56726421.js.map │ ├── config │ ├── entry.js │ ├── env.js │ ├── jest │ │ ├── cssTransform.js │ │ └── fileTransform.js │ ├── paths.js │ ├── polyfills.js │ ├── webpack.config.dev.js │ ├── webpack.config.prod.js │ └── webpackDevServer.config.js │ ├── package-lock.json │ ├── package.json │ ├── public │ ├── favicon.ico │ ├── index.html │ └── manifest.json │ ├── scripts │ ├── build.js │ ├── start.js │ └── test.js │ └── src │ ├── admin.js │ ├── assets │ └── index.css │ ├── elements │ ├── app-intro │ │ ├── _index.css │ │ └── index.js │ ├── app │ │ ├── _index.css │ │ ├── index.js │ │ └── logo.svg │ └── hello │ │ ├── _index.css │ │ ├── index.js │ │ └── omi.png │ ├── index.js │ ├── store │ └── admin-store.js │ └── utils │ ├── mapping-omio.js │ └── mapping.js └── test ├── extension.test.js └── index.js /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": false, 4 | "commonjs": true, 5 | "es6": true, 6 | "node": true 7 | }, 8 | "parserOptions": { 9 | "ecmaFeatures": { 10 | "jsx": true 11 | }, 12 | "sourceType": "module" 13 | }, 14 | "rules": { 15 | "no-const-assign": "warn", 16 | "no-this-before-super": "warn", 17 | "no-undef": "warn", 18 | "no-unreachable": "warn", 19 | "no-unused-vars": "warn", 20 | "constructor-super": "warn", 21 | "valid-typeof": "warn" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .vscode-test/ 3 | .vscode/settings.json 4 | tsconfig.json 5 | src/github/cache 6 | package-lock.json 7 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "dbaeumer.vscode-eslint" 6 | ] 7 | } -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that launches the extension inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [ 8 | { 9 | "name": "Extension", 10 | "type": "extensionHost", 11 | "request": "launch", 12 | "runtimeExecutable": "${execPath}", 13 | "args": [ 14 | "--extensionDevelopmentPath=${workspaceFolder}" 15 | ] 16 | }, 17 | { 18 | "name": "Extension Tests", 19 | "type": "extensionHost", 20 | "request": "launch", 21 | "runtimeExecutable": "${execPath}", 22 | "args": [ 23 | "--extensionDevelopmentPath=${workspaceFolder}", 24 | "--extensionTestsPath=${workspaceFolder}/test" 25 | ] 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | test/** 4 | .gitignore 5 | vsc-extension-quickstart.md 6 | **/jsconfig.json 7 | **/*.map 8 | **/.eslintrc.json 9 | src/welcome/omi-welcome/config 10 | src/welcome/omi-welcome/node_modules 11 | src/welcome/omi-welcome/public 12 | src/welcome/omi-welcome/scripts 13 | src/welcome/omi-welcome/src 14 | src/welcome/omi-welcome/.eslintrc 15 | src/welcome/omi-welcome/.gitignore 16 | src/welcome/omi-welcome/package.json 17 | src/welcome/omi-welcome/package-lock.json 18 | src/welcome/omi-welcome/README.md -------------------------------------------------------------------------------- /DEVELOP.CN.md: -------------------------------------------------------------------------------- 1 | # omi-vscode 开发 2 | 3 | # 1.安装node_modules 4 | 5 | ```cpp 6 | npm install 7 | ``` 8 | 9 | # 2.运行调试 10 | DEBUG 菜单窗口选择 Extension,按 F5 调试。 11 | 12 | # [结构说明] 13 | 14 | >.vscode `[vscode 调试及其它配置]` 15 | >>[extensions.json](./.vscode/extensions.json "extensions.json") `[具体作用暂未知]` 16 | >> 17 | >>[launch.json](./.vscode/launch.json "launch.json") `[运行调试具体配置]` 18 | > 19 | >assets `[资源文件]` 20 | >> 21 | >>... 22 | > 23 | >node_modules `[nodejs 模块库]` 24 | >> 25 | >>... 26 | > 27 | >src `[omi-vscode 所有功能实现代码]` 28 | >> 29 | >>algorithm `[算法库]` 30 | >>> 31 | >>>... 32 | >> 33 | >>completion `[代码补全功能]` 34 | >>> 35 | >>>... 36 | >> 37 | >>index.js `[所有功能代码入口]` 38 | > 39 | >test `[vscode 测试环境调试配置]` 40 | >> 41 | >>... 42 | > 43 | >[.eslintrc.json](./.eslintrc.json ".eslintrc.json") `[匹配工具,代码一致性,避免错误(具体作用暂未知)]` 44 | > 45 | >[.gitignore](./.gitignore ".gitignore") `[git 忽略指定文件或文件夹]` 46 | > 47 | >[.vscodeignore](./.vscodeignore ".vscodeignore") `[vscode 打包忽略指定文件或文件夹]` 48 | > 49 | >[CHANGELOG.CN.md](./CHANGELOG.CN.md "CHANGELOG.CN.md") `[omi-vscode 中文更新日志]` 50 | > 51 | >[CHANGELOG.md](./CHANGELOG.md "CHANGELOG.md") `[omi-vscode 英文更新日志]` 52 | > 53 | >[DEVELOP.CN.md](./DEVELOP.CN.md "DEVELOP.CN.md") `[omi-vscode 开发说明]` 54 | > 55 | >[jsconfig.json](./jsconfig.json "jsconfig.json") `[JavaScript 编译配置文件]` 56 | > 57 | >[LICENSE](./LICENSE "LICENSE") `[许可证]` 58 | > 59 | >[omi-\*.\*.\*.vsix](./ "omi-develop-\*.\*.\*.vsix") `[打包好的扩展文件]` 60 | > 61 | >[package.json](./package.json "package.json") `[omi-vscode 工程配置文件]` 62 | > 63 | >[package-lock.json](./package-lock.json "package-lock.json") `[omi-vscode 工程配置文件(自动生成)]` 64 | > 65 | >[README.CN.md](./README.CN.md "README.CN.md") `[omi-vscode 中文发行说明]` 66 | > 67 | >[README.md](./README.md "README.md") `[omi-vscode 英文发行说明]` 68 | > 69 | >tsconfig.json `[TypeScript编译文件(可用于TypeScript转JavaScript)(当前版本暂时删除)]` 70 | 71 | 72 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | # Omi 2 | Official license. 3 | GitHub: https://github.com/Tencent/omi 4 | -------------------------------------------------------------------------------- /assets/add1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/add1.png -------------------------------------------------------------------------------- /assets/add1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /assets/dark/boolean.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/dark/collapse.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/dark/dependency.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/dark/download.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | background 4 | 5 | 6 | 7 | 8 | Layer 1 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /assets/dark/edit.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/dark/file.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | background 5 | 6 | 7 | 8 | Layer 1 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /assets/dark/folder.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/dark/github.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | background 4 | 5 | 6 | 7 | 8 | Layer 1 9 | 10 | 11 | -------------------------------------------------------------------------------- /assets/dark/omi-eco.svg: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /assets/dark/omi.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/dark/refresh.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/download.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /assets/function/fun1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/function/fun1.gif -------------------------------------------------------------------------------- /assets/function/fun10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/function/fun10.png -------------------------------------------------------------------------------- /assets/function/fun3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/function/fun3.gif -------------------------------------------------------------------------------- /assets/function/fun4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/function/fun4.gif -------------------------------------------------------------------------------- /assets/function/fun5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/function/fun5.gif -------------------------------------------------------------------------------- /assets/function/fun6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/function/fun6.gif -------------------------------------------------------------------------------- /assets/function/fun7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/function/fun7.gif -------------------------------------------------------------------------------- /assets/function/fun8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/function/fun8.png -------------------------------------------------------------------------------- /assets/function/fun9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/function/fun9.gif -------------------------------------------------------------------------------- /assets/function/function1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/function/function1.png -------------------------------------------------------------------------------- /assets/function/function2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/function/function2.png -------------------------------------------------------------------------------- /assets/function/function3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/function/function3.png -------------------------------------------------------------------------------- /assets/function/function4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/function/function4.png -------------------------------------------------------------------------------- /assets/function/omi-demo1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/function/omi-demo1.gif -------------------------------------------------------------------------------- /assets/function/omi-demo2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/function/omi-demo2.gif -------------------------------------------------------------------------------- /assets/function/omi.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/function/omi.gif -------------------------------------------------------------------------------- /assets/github-128px.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/github-128px.ico -------------------------------------------------------------------------------- /assets/github-263px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/github-263px.png -------------------------------------------------------------------------------- /assets/github.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 25 | 26 | -------------------------------------------------------------------------------- /assets/light/boolean.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/light/collapse.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/light/dependency.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/light/download.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | background 4 | 5 | 6 | 7 | 8 | Layer 1 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /assets/light/edit.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/light/file.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | background 5 | 6 | 7 | 8 | Layer 1 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /assets/light/folder.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/light/github.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | background 4 | 5 | 6 | 7 | 8 | Layer 1 9 | 10 | 11 | -------------------------------------------------------------------------------- /assets/light/omi-eco.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/light/omi.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/light/refresh.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/omi-use.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/omi.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/omiu/action-sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/action-sheet.png -------------------------------------------------------------------------------- /assets/omiu/badge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/badge.png -------------------------------------------------------------------------------- /assets/omiu/button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/button.png -------------------------------------------------------------------------------- /assets/omiu/checkbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/checkbox.png -------------------------------------------------------------------------------- /assets/omiu/date-picker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/date-picker.png -------------------------------------------------------------------------------- /assets/omiu/dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/dialog.png -------------------------------------------------------------------------------- /assets/omiu/dropdown-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/dropdown-menu.png -------------------------------------------------------------------------------- /assets/omiu/dropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/dropdown.png -------------------------------------------------------------------------------- /assets/omiu/equal-space.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/equal-space.png -------------------------------------------------------------------------------- /assets/omiu/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/icon.png -------------------------------------------------------------------------------- /assets/omiu/input-number.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/input-number.png -------------------------------------------------------------------------------- /assets/omiu/input-table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/input-table.png -------------------------------------------------------------------------------- /assets/omiu/input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/input.png -------------------------------------------------------------------------------- /assets/omiu/nav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/nav.png -------------------------------------------------------------------------------- /assets/omiu/pagination.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/pagination.png -------------------------------------------------------------------------------- /assets/omiu/path-progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/path-progress.png -------------------------------------------------------------------------------- /assets/omiu/popover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/popover.png -------------------------------------------------------------------------------- /assets/omiu/popup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/popup.png -------------------------------------------------------------------------------- /assets/omiu/progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/progress.png -------------------------------------------------------------------------------- /assets/omiu/radio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/radio.png -------------------------------------------------------------------------------- /assets/omiu/rate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/rate.png -------------------------------------------------------------------------------- /assets/omiu/row.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/row.png -------------------------------------------------------------------------------- /assets/omiu/select-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/select-list.png -------------------------------------------------------------------------------- /assets/omiu/step.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/step.png -------------------------------------------------------------------------------- /assets/omiu/switch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/switch.png -------------------------------------------------------------------------------- /assets/omiu/tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/tab.png -------------------------------------------------------------------------------- /assets/omiu/table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/table.png -------------------------------------------------------------------------------- /assets/omiu/timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/timeline.png -------------------------------------------------------------------------------- /assets/omiu/toast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/omiu/toast.png -------------------------------------------------------------------------------- /assets/set.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/set.png -------------------------------------------------------------------------------- /assets/set2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/set2.png -------------------------------------------------------------------------------- /assets/set2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /assets/tstojs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/tstojs.png -------------------------------------------------------------------------------- /assets/w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/w.png -------------------------------------------------------------------------------- /assets/zain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/assets/zain.png -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "checkJs": true, /* Typecheck .js files. */ 6 | "lib": [ 7 | "es6" 8 | ] 9 | }, 10 | "exclude": [ 11 | "node_modules" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /omi-2.2.0.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/omi-2.2.0.vsix -------------------------------------------------------------------------------- /omi-vscode.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "settings": {} 8 | } -------------------------------------------------------------------------------- /src/completion/README.CN.md: -------------------------------------------------------------------------------- 1 | [English](https://github.com/ZainChen/omi-vscode/blob/master/src/completion/README.md) | 简体中文 2 | 3 | # Omi 代码补全功能 4 | 5 | (PS: 暂只支持 omi 组件补全) 6 | 7 | 支持语言:`omi`, `vue`, `html`, `json`, `javascript`, `javascriptreact`, `typescript`, `typescriptreact`, `tex`, `c`, `cpp`, `css`, `markdown`, `php`, `python`, `jsonc`, `objective-c`, `xml`, `sql`, `java`, `swift`, `go`, `csharp` 8 | 9 | ## 1. 结构 10 | 11 | >config `[代码补全配置库]` 12 | > 13 | >>test `[存放用于测试的代码补全配置文件]` 14 | >>> 15 | >>>test.json `[自定义用于测试的代码补全]` 16 | >> 17 | >>omiu.json `[omiu 相关补全]` 18 | >> 19 | >>omim.json `[omim 相关补全]` 20 | >> 21 | >index.js `[功能实现代码]` 22 | > 23 | >README.CN.md `[中文说明文档]` 24 | > 25 | >README.md `[英文说明文档]` 26 | 27 | ## 2. 用户自定义代码补全信息 28 | 29 | (PS:此方法也适用于在 `omi-vscode` 源码中添加代码补全,欢迎大家贡献:https://github.com/ZainChen/omi-vscode) 30 | 31 | ### 2.1. 安装好 `omi` 扩展后,进入 `omi` 扩展安装目录 32 | 33 | ``` 34 | C:\Users\[你的用户名]\.vscode-insiders[根据vscode版本不同有区别]\extensions\zainchen.omi-*[* 为 omi 版本号]\src\completion\ 35 | ``` 36 | 37 | 源码贡献目录 38 | 39 | ``` 40 | omi-vscode/tree/master/src/completion 41 | ``` 42 | 43 | ### 2.2. 添加自定义代码补全配置文件 44 | 45 | 在 `config` 文件夹中新建 json 文件,文件名随意,按指定文件结构配置即可,支持添加任意子文件夹。 46 | 47 | (PS: 当前行有多个提示信息匹配会依次尾加提示) 48 | 49 | 配置文件结构说明: 50 | 51 | ```js 52 | { 53 | "fileTypes": [ ".*", '.js', 'zain.js' ], // 支持当前配置文件代码补全的文件类型及具体文件,'.*'为任意类型,'.js'为指定后缀名,'zain.js'为指定文件 54 | "completions": { // 所有补全信息 55 | "o-button": { // 一个标签补全信息配置 56 | "label": "o-button", // 匹配关键字 57 | "kind": 24, // 补全类型,决定左侧图标样式 58 | "detail": "...", // 提示信息 59 | "insertText": "${2}", // 插入的内容 60 | "documentation": "...", // Markdown 说明 61 | "sortText": "a", // 权值排序 62 | "cmd": false, // 补全后是否立马开启新的补全提示 63 | "attributes": { // 当前标签所有属性补全信息配置 64 | "type": { // 一个属性补全信息配置 65 | "label": "type", // 匹配关键字 66 | "kind": 22, // 补全类型,决定左侧图标样式 67 | "detail": "[omiu]o-button", // 提示信息 68 | "insertText": "type='${1|primary,default,warn,vcode|}'", // 插入的内容 69 | "documentation": "...", // Markdown 说明 70 | "sortText": "a", // 权值排序 71 | "cmd": false // 补全后是否立马开启新的补全提示 72 | }, 73 | "size": { 74 | ... 75 | } 76 | } 77 | }, 78 | "o-icon": { 79 | ... 80 | } 81 | } 82 | } 83 | ``` -------------------------------------------------------------------------------- /src/completion/config/test/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileTypes": [ ".test" ], 3 | "completions": { 4 | "o-test0": { "label": "o-test0", "kind": 0, "insertText": "${2}" }, 5 | "o-test1": { "label": "o-test1", "kind": 1 }, 6 | "o-test2": { "label": "o-test2", "kind": 2 }, 7 | "o-test3": { "label": "o-test3", "kind": 3 }, 8 | "o-test4": { "label": "o-test4", "kind": 4 }, 9 | "o-test5": { "label": "o-test5", "kind": 5 }, 10 | "o-test6": { "label": "o-test6", "kind": 6 }, 11 | "o-test7": { "label": "o-test7", "kind": 7 }, 12 | "o-test8": { "label": "o-test8", "kind": 8 }, 13 | "o-test9": { "label": "o-test9", "kind": 9 }, 14 | "o-test10": { "label": "o-test10", "kind": 10 }, 15 | "o-test11": { "label": "o-test11", "kind": 11 }, 16 | "o-test12": { "label": "o-test12", "kind": 12 }, 17 | "o-test13": { "label": "o-test13", "kind": 13 }, 18 | "o-test14": { "label": "o-test14", "kind": 14 }, 19 | "o-test15": { "label": "o-test15", "kind": 15 }, 20 | "o-test16": { "label": "o-test16", "kind": 16 }, 21 | "o-test17": { "label": "o-test17", "kind": 17 }, 22 | "o-test18": { "label": "o-test18", "kind": 18 }, 23 | "o-test19": { "label": "o-test19", "kind": 19 }, 24 | "o-test20": { "label": "o-test20", "kind": 20 }, 25 | "o-test21": { "label": "o-test21", "kind": 21 }, 26 | "o-test22": { "label": "o-test22", "kind": 22 }, 27 | "o-test23": { "label": "o-test23", "kind": 23 }, 28 | "o-test24": { "label": "o-test24", "kind": 24 }, 29 | "zain": { 30 | "label": "zain", 31 | "kind": 2, 32 | "detail": "zain", 33 | "insertText": "${2}", 34 | "documentation": "sflajengfieegniewgioiew", 35 | "sortText": "a", 36 | "cmd": false 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /src/ecosystem/README.md: -------------------------------------------------------------------------------- 1 | # omi init template 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/ecosystem/open-url.js: -------------------------------------------------------------------------------- 1 | const vscode = require('vscode'); 2 | const path = require('path'); 3 | 4 | class OpenURL { 5 | constructor(selectedMenuItem, url) { 6 | const panel = vscode.window.createWebviewPanel( 7 | 'webPage', 8 | selectedMenuItem, 9 | vscode.ViewColumn.One, 10 | { 11 | enableScripts: true, 12 | retainContextWhenHidden: true 13 | } 14 | ); 15 | panel.webview.html = this.getWebviewContent(url); 16 | } 17 | getWebviewContent(url) { 18 | let html = ` 19 | 20 | 21 | 22 | 36 | 37 | 38 | 39 | 40 | 41 | `; 42 | if(url.length >= 4 && (url[0] === "h" || url[0] === "H") && (url[1] === "t" || url[1] === "T") && (url[2] === "t" || url[2] === "T") && (url[3] === "p" || url[3] === "P")) { 43 | return html; 44 | } 45 | //vscode不支持直接加载本地资源,需要替换成其专有路径格式,将样式、JS、iframe的路径替换 46 | return html.replace(/( { 47 | return $1 + vscode.Uri.file(path.resolve(url, $2)).with({ scheme: 'vscode-resource' }).toString() + '"'; 48 | }); 49 | } 50 | } 51 | module.exports = OpenURL; 52 | 53 | {/* ${url} */} 54 | {/* */} 55 | {/* */} -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-cli/template/app/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "extends": ["prettier"], 4 | "plugins": ["prettier"], 5 | "env": { 6 | "browser": true, 7 | "mocha": true, 8 | "node": true, 9 | "es6": true 10 | }, 11 | "parserOptions": { 12 | "ecmaFeatures": { 13 | "modules": true, 14 | "jsx": true 15 | } 16 | }, 17 | "globals": { 18 | "sinon": true, 19 | "expect": true 20 | }, 21 | "rules": { 22 | "prettier/prettier": "error", 23 | "no-cond-assign": 1, 24 | "no-empty": 0, 25 | "no-console": 1, 26 | "semi": [1, "never"], 27 | "camelcase": 0, 28 | "comma-style": 2, 29 | "comma-dangle": [2, "never"], 30 | "indent": ["error", 2], 31 | "no-mixed-spaces-and-tabs": [2, "smart-tabs"], 32 | "no-trailing-spaces": [2, { "skipBlankLines": true }], 33 | "max-nested-callbacks": [2, 3], 34 | "no-eval": 2, 35 | "no-implied-eval": 2, 36 | "no-new-func": 2, 37 | "guard-for-in": 0, 38 | "eqeqeq": 0, 39 | "no-else-return": 2, 40 | "no-redeclare": 2, 41 | "no-dupe-keys": 2, 42 | "radix": 2, 43 | "strict": [2, "never"], 44 | "no-shadow": 0, 45 | "callback-return": [1, ["callback", "cb", "next", "done"]], 46 | "no-delete-var": 2, 47 | "no-undef-init": 2, 48 | "no-shadow-restricted-names": 2, 49 | "handle-callback-err": 0, 50 | "no-lonely-if": 2, 51 | "keyword-spacing": 2, 52 | "constructor-super": 2, 53 | "no-this-before-super": 2, 54 | "no-dupe-class-members": 2, 55 | "no-const-assign": 2, 56 | "prefer-spread": 2, 57 | "no-useless-concat": 2, 58 | "no-var": 2, 59 | "object-shorthand": 2, 60 | "prefer-arrow-callback": 2, 61 | "quotes": [1, "single"] 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-cli/template/app/README.md: -------------------------------------------------------------------------------- 1 | ## Develop 2 | 3 | ```bash 4 | npm install 5 | npm start 6 | ``` 7 | 8 | ## Release 9 | 10 | ```bash 11 | npm run build 12 | ``` 13 | 14 | ## Eslint + Prettier 15 | 16 | ``` bash 17 | npm run fix 18 | ``` 19 | 20 | ## Directory description 21 | 22 | ``` 23 | ├─ config 24 | ├─ public 25 | ├─ scripts 26 | ├─ src 27 | │ ├─ assets 28 | │ ├─ elements //Store all custom elements 29 | │ ├─ store //Store all this store of pages 30 | │ ├─ admin.js //Entry js of compiler,will build to admin.html 31 | │ └─ index.js //Entry js of compiler,will build to index.html 32 | ``` 33 | 34 | ## Build Scripts 35 | 36 | ```json 37 | "scripts": { 38 | "start": "node scripts/start.js", 39 | "build": "PUBLIC_URL=. node scripts/build.js", 40 | "build-windows": "set PUBLIC_URL=.&& node scripts/build.js", 41 | "fix": "eslint src --fix" 42 | } 43 | ``` 44 | 45 | You can set up the PUBLIC_URL, such as: 46 | 47 | ```bash 48 | ... 49 | "build": "PUBLIC_URL=https://fe.wxpay.oa.com/dv node scripts/build.js", 50 | "build-windows": "set PUBLIC_URL=https://fe.wxpay.oa.com/dv&& node scripts/build.js", 51 | ... 52 | ``` 53 | 54 | ## Switch omi and omio 55 | 56 | Add or remove the alias config in package.json to switch omi and omio: 57 | 58 | ```js 59 | ... 60 | "alias": { 61 | "omi": "omio" 62 | } 63 | ... 64 | ``` 65 | 66 | ## License 67 | 68 | MIT 69 | 70 | -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-cli/template/app/config/entry.js: -------------------------------------------------------------------------------- 1 | let fs = require('fs'), 2 | fileList = []; 3 | 4 | 5 | if (typeof String.prototype.endsWith != 'function') { 6 | String.prototype.endsWith = function (suffix) { 7 | return this.indexOf(suffix, this.length - suffix.length) !== -1; 8 | }; 9 | } 10 | 11 | function walk(path) { 12 | let dirList = fs.readdirSync(path); 13 | dirList.forEach(function (item) { 14 | if (!fs.statSync(path + '/' + item).isDirectory()) { 15 | if (item.endsWith('\.js')) { 16 | fileList.push(item.substr(0, item.length - 3)); 17 | } 18 | } else { 19 | //walk(path + '/' + item); 20 | } 21 | }); 22 | } 23 | 24 | walk('./src'); 25 | 26 | 27 | 28 | module.exports = fileList; -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-cli/template/app/config/jest/cssTransform.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // This is a custom Jest transformer turning style imports into empty objects. 4 | // http://facebook.github.io/jest/docs/en/webpack.html 5 | 6 | module.exports = { 7 | process() { 8 | return 'module.exports = {};'; 9 | }, 10 | getCacheKey() { 11 | // The output is always the same. 12 | return 'cssTransform'; 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-cli/template/app/config/jest/fileTransform.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | 5 | // This is a custom Jest transformer turning file imports into filenames. 6 | // http://facebook.github.io/jest/docs/en/webpack.html 7 | 8 | module.exports = { 9 | process(src, filename) { 10 | return `module.exports = ${JSON.stringify(path.basename(filename))};`; 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-cli/template/app/config/paths.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | const fs = require('fs'); 5 | const url = require('url'); 6 | 7 | // Make sure any symlinks in the project folder are resolved: 8 | // https://github.com/facebookincubator/create-react-app/issues/637 9 | const appDirectory = fs.realpathSync(process.cwd()); 10 | const resolveApp = relativePath => path.resolve(appDirectory, relativePath); 11 | 12 | const envPublicUrl = process.env.PUBLIC_URL; 13 | 14 | function ensureSlash(path, needsSlash) { 15 | const hasSlash = path.endsWith('/'); 16 | if (hasSlash && !needsSlash) { 17 | return path.substr(path, path.length - 1); 18 | } else if (!hasSlash && needsSlash) { 19 | return `${path}/`; 20 | } else { 21 | return path; 22 | } 23 | } 24 | 25 | const getPublicUrl = appPackageJson => 26 | envPublicUrl || require(appPackageJson).homepage; 27 | 28 | // We use `PUBLIC_URL` environment variable or "homepage" field to infer 29 | // "public path" at which the app is served. 30 | // Webpack needs to know it to put the right 27 | -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-cli/template/app/src/elements/app/_index.less: -------------------------------------------------------------------------------- 1 | @bg-color: #222; 2 | 3 | .app { 4 | text-align: center; 5 | } 6 | 7 | .app-logo { 8 | animation: app-logo-spin infinite 20s linear; 9 | height: 80px; 10 | } 11 | 12 | .app-header { 13 | background-color: @bg-color; 14 | height: 150px; 15 | padding: 20px; 16 | color: white; 17 | } 18 | 19 | .app-title { 20 | font-size: 1.5em; 21 | } 22 | 23 | .app-logo { 24 | cursor: pointer; 25 | } 26 | 27 | @keyframes app-logo-spin { 28 | from { 29 | transform: rotate(0deg); 30 | } 31 | to { 32 | transform: rotate(360deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-cli/template/app/src/elements/app/index.js: -------------------------------------------------------------------------------- 1 | import { define, WeElement } from 'omi' 2 | import logo from './logo.svg' 3 | import '../app-intro' 4 | import '../app-omil' 5 | import 'omiu/button' 6 | 7 | define('my-app', class extends WeElement { 8 | static css = require('./_index.less') 9 | 10 | name = 'Omi' 11 | 12 | clickHandler = () => { 13 | this.name = 'Omio' 14 | this.update() 15 | } 16 | 17 | render() { 18 | return ( 19 |
20 |
21 | 27 |

Welcome to {this.name}

28 |
29 | 30 | I am omiu button. 31 | 32 |
33 | ) 34 | } 35 | }) 36 | -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-cli/template/app/src/elements/app/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-cli/template/app/src/elements/hello/_index.css: -------------------------------------------------------------------------------- 1 | .hello { 2 | text-align: center; 3 | } 4 | 5 | .omi { 6 | width: 143px; 7 | height: 59px; 8 | margin: 0 auto; 9 | background-image: url(./omi.png); 10 | } 11 | -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-cli/template/app/src/elements/hello/index.js: -------------------------------------------------------------------------------- 1 | import { define, WeElement } from 'omi' 2 | 3 | define('hello-element', class extends WeElement { 4 | css = require('./_index.css') 5 | 6 | installed() { 7 | setTimeout(() => { 8 | this.store.name = 'Good Job!' 9 | this.update() 10 | }, 1000) 11 | } 12 | 13 | render(props, data) { 14 | return ( 15 |
16 |

{this.store.name}

17 |
I am hello element.
18 |
19 |
20 | ) 21 | } 22 | }) 23 | -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-cli/template/app/src/elements/hello/omi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/src/ecosystem/packages/omi-cli/template/app/src/elements/hello/omi.png -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-cli/template/app/src/index.js: -------------------------------------------------------------------------------- 1 | import { render } from 'omi' 2 | import './assets/index.css' 3 | import './elements/app' 4 | 5 | render(, '#root') 6 | -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-cli/template/app/src/store/admin-store.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: 'I am admin page', 3 | rename(name) { 4 | this.name = name 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/cn.html: -------------------------------------------------------------------------------- 1 | Omi - Next Front End Framework
-------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/src/ecosystem/packages/omi-docs/favicon.ico -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/index.html: -------------------------------------------------------------------------------- 1 | Omi - Next Front End Framework
-------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/index1.html: -------------------------------------------------------------------------------- 1 | zain -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/repl/preview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 27 | 28 | 29 | 30 | 31 | 38 | 39 | 40 | 41 | 42 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/css/cn.4dd07f49.css: -------------------------------------------------------------------------------- 1 | body,html{background-color:#eee;font-family:proxima-nova,Helvetica Neue,Helvetica,Roboto,PT Sans,DejaVu Sans,Arial,Segoe UI Light,Segoe UI,Microsoft Jhenghei,Mirco Yahei,"sans-serif"}body,html,img,li,ul{margin:0;padding:0;border:0}a{text-decoration:none;color:#0366d6}table{border-collapse:collapse}table,td,th{border:1px solid #ccc}td,th{padding:4px 8px}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);background-color:#f5f5f5}::-webkit-scrollbar{width:12px;height:12px;background-color:#f5f5f5}::-webkit-scrollbar-thumb{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);background-color:#555}@media only screen and (max-width:768px){body,html{overflow-x:hidden}.content img{width:100%}.content code[class*=language-],.content pre[class*=language-]{font-family:Consolas,Liberation Mono,Courier,monospace;line-height:18px;font-size:13px;margin:0;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.content pre[class*=language-]{padding-left:10px}.content p{font-size:14px}.content h1,.content h2,.content h3,.content h4,.content h5,.content p{padding-left:10px;padding-right:10px}.line-highlight:before,.line-highlight[data-end]:after{top:0}}*{-webkit-box-sizing:border-box;box-sizing:border-box}blockquote:before{content:"";position:absolute;left:0;top:0;background-color:#dfe2e5;height:24px;width:4px}blockquote{position:relative;margin:0;padding-left:20px}pre[data-line]{position:relative;padding:1em 0 1em 1em!important}.line-highlight:before,.line-highlight[data-end]:after{display:none}:not(pre)>code[class*=language-],pre[class*=language-]{font-size:.8em}img{max-width:900px}.content ul{padding-left:2em}.content table tr:nth-child(2n){background-color:#f6f8fa} 2 | /*# sourceMappingURL=cn.4dd07f49.css.map*/ -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/css/cn.4dd07f49.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["assets/index.css"],"names":[],"mappings":"AACA,UAIE,sBACA,sJAA4J,CAG9J,oBAPE,SACA,UACA,QAAU,CAWZ,EACE,qBACA,aAAe,CAGjB,MACE,wBAA0B,CAE5B,YACE,qBAAuB,CAGzB,MACE,eAAiB,CAGnB,0BAEC,gDACA,wBAA0B,CAG3B,oBAEE,WACA,YACD,wBAA0B,CAG3B,0BAEC,gDACA,qBAAuB,CAGxB,yCACE,UAEE,iBAAmB,CAGrB,aACI,UAAY,CAIhB,+DAEI,uDACA,iBACA,eACA,SACA,WACA,8BACQ,qBAAuB,CAGnC,+BACI,iBAAmB,CAEvB,WACI,cAAgB,CAEpB,uEACI,kBACA,kBAAmB,CAGvB,uDACI,KAAS,CACZ,CAGH,EACE,8BACQ,qBAAuB,CAIjC,kBACE,WACA,kBACA,OACA,MACA,yBACA,YACA,SAAW,CAGb,WACE,kBACA,SACA,iBAAmB,CAGrB,eACE,kBACA,+BAAkC,CAGpC,uDACE,YAAc,CAGhB,uDACE,cAAiB,CAInB,IACE,eAAiB,CAGnB,YACE,gBAAkB,CAGpB,gCACE,wBAA0B","file":"static/css/cn.4dd07f49.css","sourcesContent":["\nhtml,body{\n margin: 0;\n padding: 0;\n border: 0;\n background-color: #eee;\n font-family:proxima-nova,\"Helvetica Neue\",Helvetica,Roboto, PT Sans, DejaVu Sans, Arial,Segoe UI Light,Segoe UI,Microsoft Jhenghei,Mirco Yahei,'sans-serif';\n}\n\nimg,ul,li{\n margin: 0;\n padding: 0;\n border: 0;\n}\n\na{\n text-decoration: none;\n color: #0366d6;\n}\n\ntable{\n border-collapse: collapse;\n}\ntable,td,th{\n border: 1px solid #ccc;\n}\n\ntd,th{\n padding: 4px 8px;\n}\n\n::-webkit-scrollbar-track\n{\n\t-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);\n\tbackground-color: #F5F5F5;\n}\n\n::-webkit-scrollbar\n{\n width: 12px;\n height: 12px;\n\tbackground-color: #F5F5F5;\n}\n\n::-webkit-scrollbar-thumb\n{\n\t-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);\n\tbackground-color: #555;\n}\n\n@media only screen and (max-width: 768px) {\n html,body{\n\n overflow-x: hidden;\n }\n\n .content img{\n width: 100%;\n }\n\n\n .content code[class*=\"language-\"],\n .content pre[class*=\"language-\"] {\n font-family: Consolas, \"Liberation Mono\", Courier, monospace;\n line-height: 18px;\n font-size: 13px;\n margin: 0;\n width: 100%;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n .content pre[class*=\"language-\"] {\n padding-left: 10px;\n }\n .content p{\n font-size: 14px;\n }\n .content p,.content h1,.content h2,.content h3,.content h4,.content h5{\n padding-left:10px;\n padding-right:10px;\n }\n\n .line-highlight:before, .line-highlight[data-end]:after{\n top: 0em;\n }\n}\n\n*{\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n\n\nblockquote::before{\n content: '';\n position: absolute;\n left: 0;\n top: 0px;\n background-color: #dfe2e5;\n height: 24px;\n width: 4px;\n}\n\nblockquote {\n position: relative;\n margin: 0;\n padding-left: 20px;\n}\n\npre[data-line] {\n position: relative;\n padding: 1em 0 1em 1em !important;\n}\n\n.line-highlight:before, .line-highlight[data-end]:after{\n display: none;\n}\n\n:not(pre) > code[class*=\"language-\"], pre[class*=\"language-\"] {\n font-size: 0.8em;\n}\n\n\nimg{\n max-width: 900px;\n}\n\n.content ul{\n padding-left: 2em;\n}\n\n.content table tr:nth-child(2n) {\n background-color: #f6f8fa;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/assets/index.css"],"sourceRoot":""} -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/css/index.4dd07f49.css: -------------------------------------------------------------------------------- 1 | body,html{background-color:#eee;font-family:proxima-nova,Helvetica Neue,Helvetica,Roboto,PT Sans,DejaVu Sans,Arial,Segoe UI Light,Segoe UI,Microsoft Jhenghei,Mirco Yahei,"sans-serif"}body,html,img,li,ul{margin:0;padding:0;border:0}a{text-decoration:none;color:#0366d6}table{border-collapse:collapse}table,td,th{border:1px solid #ccc}td,th{padding:4px 8px}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);background-color:#f5f5f5}::-webkit-scrollbar{width:12px;height:12px;background-color:#f5f5f5}::-webkit-scrollbar-thumb{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);background-color:#555}@media only screen and (max-width:768px){body,html{overflow-x:hidden}.content img{width:100%}.content code[class*=language-],.content pre[class*=language-]{font-family:Consolas,Liberation Mono,Courier,monospace;line-height:18px;font-size:13px;margin:0;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.content pre[class*=language-]{padding-left:10px}.content p{font-size:14px}.content h1,.content h2,.content h3,.content h4,.content h5,.content p{padding-left:10px;padding-right:10px}.line-highlight:before,.line-highlight[data-end]:after{top:0}}*{-webkit-box-sizing:border-box;box-sizing:border-box}blockquote:before{content:"";position:absolute;left:0;top:0;background-color:#dfe2e5;height:24px;width:4px}blockquote{position:relative;margin:0;padding-left:20px}pre[data-line]{position:relative;padding:1em 0 1em 1em!important}.line-highlight:before,.line-highlight[data-end]:after{display:none}:not(pre)>code[class*=language-],pre[class*=language-]{font-size:.8em}img{max-width:900px}.content ul{padding-left:2em}.content table tr:nth-child(2n){background-color:#f6f8fa} 2 | /*# sourceMappingURL=index.4dd07f49.css.map*/ -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/css/index.4dd07f49.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["assets/index.css"],"names":[],"mappings":"AACA,UAIE,sBACA,sJAA4J,CAG9J,oBAPE,SACA,UACA,QAAU,CAWZ,EACE,qBACA,aAAe,CAGjB,MACE,wBAA0B,CAE5B,YACE,qBAAuB,CAGzB,MACE,eAAiB,CAGnB,0BAEC,gDACA,wBAA0B,CAG3B,oBAEE,WACA,YACD,wBAA0B,CAG3B,0BAEC,gDACA,qBAAuB,CAGxB,yCACE,UAEE,iBAAmB,CAGrB,aACI,UAAY,CAIhB,+DAEI,uDACA,iBACA,eACA,SACA,WACA,8BACQ,qBAAuB,CAGnC,+BACI,iBAAmB,CAEvB,WACI,cAAgB,CAEpB,uEACI,kBACA,kBAAmB,CAGvB,uDACI,KAAS,CACZ,CAGH,EACE,8BACQ,qBAAuB,CAIjC,kBACE,WACA,kBACA,OACA,MACA,yBACA,YACA,SAAW,CAGb,WACE,kBACA,SACA,iBAAmB,CAGrB,eACE,kBACA,+BAAkC,CAGpC,uDACE,YAAc,CAGhB,uDACE,cAAiB,CAInB,IACE,eAAiB,CAGnB,YACE,gBAAkB,CAGpB,gCACE,wBAA0B","file":"static/css/index.4dd07f49.css","sourcesContent":["\nhtml,body{\n margin: 0;\n padding: 0;\n border: 0;\n background-color: #eee;\n font-family:proxima-nova,\"Helvetica Neue\",Helvetica,Roboto, PT Sans, DejaVu Sans, Arial,Segoe UI Light,Segoe UI,Microsoft Jhenghei,Mirco Yahei,'sans-serif';\n}\n\nimg,ul,li{\n margin: 0;\n padding: 0;\n border: 0;\n}\n\na{\n text-decoration: none;\n color: #0366d6;\n}\n\ntable{\n border-collapse: collapse;\n}\ntable,td,th{\n border: 1px solid #ccc;\n}\n\ntd,th{\n padding: 4px 8px;\n}\n\n::-webkit-scrollbar-track\n{\n\t-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);\n\tbackground-color: #F5F5F5;\n}\n\n::-webkit-scrollbar\n{\n width: 12px;\n height: 12px;\n\tbackground-color: #F5F5F5;\n}\n\n::-webkit-scrollbar-thumb\n{\n\t-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);\n\tbackground-color: #555;\n}\n\n@media only screen and (max-width: 768px) {\n html,body{\n\n overflow-x: hidden;\n }\n\n .content img{\n width: 100%;\n }\n\n\n .content code[class*=\"language-\"],\n .content pre[class*=\"language-\"] {\n font-family: Consolas, \"Liberation Mono\", Courier, monospace;\n line-height: 18px;\n font-size: 13px;\n margin: 0;\n width: 100%;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n .content pre[class*=\"language-\"] {\n padding-left: 10px;\n }\n .content p{\n font-size: 14px;\n }\n .content p,.content h1,.content h2,.content h3,.content h4,.content h5{\n padding-left:10px;\n padding-right:10px;\n }\n\n .line-highlight:before, .line-highlight[data-end]:after{\n top: 0em;\n }\n}\n\n*{\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n\n\nblockquote::before{\n content: '';\n position: absolute;\n left: 0;\n top: 0px;\n background-color: #dfe2e5;\n height: 24px;\n width: 4px;\n}\n\nblockquote {\n position: relative;\n margin: 0;\n padding-left: 20px;\n}\n\npre[data-line] {\n position: relative;\n padding: 1em 0 1em 1em !important;\n}\n\n.line-highlight:before, .line-highlight[data-end]:after{\n display: none;\n}\n\n:not(pre) > code[class*=\"language-\"], pre[class*=\"language-\"] {\n font-size: 0.8em;\n}\n\n\nimg{\n max-width: 900px;\n}\n\n.content ul{\n padding-left: 2em;\n}\n\n.content table tr:nth-child(2n) {\n background-color: #f6f8fa;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/assets/index.css"],"sourceRoot":""} -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/0.9d48c206.chunk.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([0],{70:function(n,t){n.exports="\n## Update\n\n`update` \u65b9\u6cd5\u662f\u5185\u7f6e\u7684\u91cd\u8981\u6838\u5fc3\u65b9\u6cd5\uff0c\u7528\u4e8e\u66f4\u65b0\u7ec4\u4ef6\u81ea\u8eab\u3002\u6bd4\u5982:\n\n```js\nthis.update()\n```\n\n\u4e5f\u53ef\u4ee5\u4f20\u9012\u53c2\u6570\uff0c\u51b3\u5b9a\u662f\u5426\u5728 html \u6a21\u5f0f\u4e0b\u5ffd\u7565 attributes\uff0c\u5f3a\u884c\u66f4\u65b0:\n\n```js\nthis.update(true)\n```\n\n\u4e3e\u4e2a\u573a\u666f\uff0c\u6bd4\u5982\u70b9\u51fb\u5f39\u51fa\u5c42\u7684 mask \u5173\u95ed\u5f39\u51fa\uff0c\u5728 react \u4e2d\u9700\u8981\u4f20\u9012\u7ed9\u7236\u7ec4\u4ef6\uff0c\u8ba9\u7236\u7ec4\u4ef6\u66f4\u65b0\uff0c\u800c Omi \u63a8\u5d07\u81ea\u66f4\u65b0\uff0c\u8fd9\u6837 diff \u7684\u533a\u57df\u66f4\u5c0f\u3002\n\n```js\nonMaskClick = ()=> {\n //\u4fee\u6539 props\n this.props.show = false\n //\u9632\u6b62\u7236\u7ec4\u4ef6\u66f4\u65b0 diff \u4e0d\u51fa\u7ed3\u679c\n this.prevProps.show = false\n //\u66f4\u65b0\uff0c\u5e76\u4e14\u5728 html \u6a21\u5f0f\u4e0b\u5ffd\u7565 attributes\n this.update(true)\n //\u89e6\u53d1\u4e8b\u4ef6\uff0c\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u66f4\u6539\u5916\u90e8\u7684\u72b6\u6001\u53d8\u91cf\u6765\u4fdd\u6301\u4e00\u81f4\u6027\uff0c\u4f46\u662f\u5916\u9762\u7684\u7ec4\u4ef6\u4e0d\u7528\u518d\u66f4\u65b0\n this.fire('close')\n}\n```"}}); 2 | //# sourceMappingURL=0.9d48c206.chunk.js.map -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/0.9d48c206.chunk.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../static/js/0.9d48c206.chunk.js","docs/zh-cn/update.md"],"names":["webpackJsonp","70","module","exports"],"mappings":"AAAAA,cAAc,IAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/0.9d48c206.chunk.js","sourcesContent":["webpackJsonp([0],{\n\n/***/ 70:\n/***/ (function(module, exports) {\n\nmodule.exports = \"\\n## Update\\n\\n`update` 方法是内置的重要核心方法,用于更新组件自身。比如:\\n\\n```js\\nthis.update()\\n```\\n\\n也可以传递参数,决定是否在 html 模式下忽略 attributes,强行更新:\\n\\n```js\\nthis.update(true)\\n```\\n\\n举个场景,比如点击弹出层的 mask 关闭弹出,在 react 中需要传递给父组件,让父组件更新,而 Omi 推崇自更新,这样 diff 的区域更小。\\n\\n```js\\nonMaskClick = ()=> {\\n //修改 props\\n this.props.show = false\\n //防止父组件更新 diff 不出结果\\n this.prevProps.show = false\\n //更新,并且在 html 模式下忽略 attributes\\n this.update(true)\\n //触发事件,可以通过这个更改外部的状态变量来保持一致性,但是外面的组件不用再更新\\n this.fire('close')\\n}\\n```\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/0.9d48c206.chunk.js","module.exports = \"\\n## Update\\n\\n`update` 方法是内置的重要核心方法,用于更新组件自身。比如:\\n\\n```js\\nthis.update()\\n```\\n\\n也可以传递参数,决定是否在 html 模式下忽略 attributes,强行更新:\\n\\n```js\\nthis.update(true)\\n```\\n\\n举个场景,比如点击弹出层的 mask 关闭弹出,在 react 中需要传递给父组件,让父组件更新,而 Omi 推崇自更新,这样 diff 的区域更小。\\n\\n```js\\nonMaskClick = ()=> {\\n //修改 props\\n this.props.show = false\\n //防止父组件更新 diff 不出结果\\n this.prevProps.show = false\\n //更新,并且在 html 模式下忽略 attributes\\n this.update(true)\\n //触发事件,可以通过这个更改外部的状态变量来保持一致性,但是外面的组件不用再更新\\n this.fire('close')\\n}\\n```\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/update.md\n// module id = 70\n// module chunks = 0"],"sourceRoot":""} -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/10.27f188c7.chunk.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([10],{60:function(n,e){n.exports="\n### \u751f\u547d\u5468\u671f\n\n| Lifecycle method | When it gets called |\n| ---------------- | -------------------------------------------- |\n| `install` | \u51c6\u5907\u63d2\u5165\u5230\u6587\u6863 |\n| `installed` | \u63d2\u5165\u5230\u6587\u6863\u4e4b\u540e |\n| `uninstall` | \u4ece\u6587\u6863\u4e2d\u79fb\u9664 |\n| `beforeUpdate` | update \u4e4b\u524d |\n| `updated` | update \u4e4b\u540e |\n| `beforeRender` | `render()` \u4e4b\u524d |\n| `receiveProps` | \u7236\u5143\u7d20\u91cd\u65b0\u6e32\u67d3\u89e6\u53d1 |\n\n\u4e3e\u4e2a\u4f8b\u5b50:\n\n```js\nimport { render, WeElement, define } from 'omi'\n\ndefine('my-timer', class extends WeElement {\n data = {\n seconds: 0\n }\n\n tick() {\n this.data.seconds++\n this.update()\n }\n\n install() {\n this.interval = setInterval(() => this.tick(), 1000)\n }\n\n uninstall() {\n clearInterval(this.interval)\n }\n\n render() {\n return
Seconds: {this.data.seconds}
\n }\n})\n\nrender(, 'body')\n```"}}); 2 | //# sourceMappingURL=10.27f188c7.chunk.js.map -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/10.27f188c7.chunk.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../static/js/10.27f188c7.chunk.js","docs/zh-cn/lifecycle.md"],"names":["webpackJsonp","60","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/10.27f188c7.chunk.js","sourcesContent":["webpackJsonp([10],{\n\n/***/ 60:\n/***/ (function(module, exports) {\n\nmodule.exports = \"\\n### 生命周期\\n\\n| Lifecycle method | When it gets called |\\n| ---------------- | -------------------------------------------- |\\n| `install` | 准备插入到文档 |\\n| `installed` | 插入到文档之后 |\\n| `uninstall` | 从文档中移除 |\\n| `beforeUpdate` | update 之前 |\\n| `updated` | update 之后 |\\n| `beforeRender` | `render()` 之前 |\\n| `receiveProps` | 父元素重新渲染触发 |\\n\\n举个例子:\\n\\n```js\\nimport { render, WeElement, define } from 'omi'\\n\\ndefine('my-timer', class extends WeElement {\\n data = {\\n seconds: 0\\n }\\n\\n tick() {\\n this.data.seconds++\\n this.update()\\n }\\n\\n install() {\\n this.interval = setInterval(() => this.tick(), 1000)\\n }\\n\\n uninstall() {\\n clearInterval(this.interval)\\n }\\n\\n render() {\\n return
Seconds: {this.data.seconds}
\\n }\\n})\\n\\nrender(, 'body')\\n```\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/10.27f188c7.chunk.js","module.exports = \"\\n### 生命周期\\n\\n| Lifecycle method | When it gets called |\\n| ---------------- | -------------------------------------------- |\\n| `install` | 准备插入到文档 |\\n| `installed` | 插入到文档之后 |\\n| `uninstall` | 从文档中移除 |\\n| `beforeUpdate` | update 之前 |\\n| `updated` | update 之后 |\\n| `beforeRender` | `render()` 之前 |\\n| `receiveProps` | 父元素重新渲染触发 |\\n\\n举个例子:\\n\\n```js\\nimport { render, WeElement, define } from 'omi'\\n\\ndefine('my-timer', class extends WeElement {\\n data = {\\n seconds: 0\\n }\\n\\n tick() {\\n this.data.seconds++\\n this.update()\\n }\\n\\n install() {\\n this.interval = setInterval(() => this.tick(), 1000)\\n }\\n\\n uninstall() {\\n clearInterval(this.interval)\\n }\\n\\n render() {\\n return
Seconds: {this.data.seconds}
\\n }\\n})\\n\\nrender(, 'body')\\n```\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/lifecycle.md\n// module id = 60\n// module chunks = 10"],"sourceRoot":""} -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/14.4ee71391.chunk.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([14],{56:function(n,e){n.exports="## Event\n\n```jsx\ndefine('my-element', class extends WeElement {\n onClick = (evt) => {\n alert('Hello Omi!')\n }\n\n render() {\n return (\n

Hello, world!

\n )\n }\n})\n```\n\n### Custom Event\n\n```jsx\ndefine('my-element', class extends WeElement {\n onClick = (evt) => {\n this.fire('myevent', { name: 'abc' })\n }\n\n render(props) {\n return (\n

Hello, world!

\n )\n }\n})\n```\n\n\u7136\u540e\u5728\u4f60\u7684\u81ea\u5b9a\u4e49\u5143\u7d20\u4e0a\u7ed1\u5b9a\u4e8b\u4ef6\uff1a\n\n```jsx\n { alert(evt.detail.name) }}>\n```\n\n\u901a\u8fc7 `this.fire` \u89e6\u53d1\u81ea\u5b9a\u4e49\u4e8b\u4ef6\uff0cfire \u7b2c\u4e00\u4e2a\u53c2\u6570\u662f\u4e8b\u4ef6\u540d\u79f0\uff0c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f\u4f20\u9012\u7684\u6570\u636e\u3002\u901a\u8fc7 `evt.detail` \u53ef\u4ee5\u83b7\u53d6\u5230\u4f20\u9012\u7684\u6570\u636e\u3002\n"}}); 2 | //# sourceMappingURL=14.4ee71391.chunk.js.map -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/14.4ee71391.chunk.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../static/js/14.4ee71391.chunk.js","docs/zh-cn/event.md"],"names":["webpackJsonp","56","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/14.4ee71391.chunk.js","sourcesContent":["webpackJsonp([14],{\n\n/***/ 56:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Event\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n onClick = (evt) => {\\n alert('Hello Omi!')\\n }\\n\\n render() {\\n return (\\n

Hello, world!

\\n )\\n }\\n})\\n```\\n\\n### Custom Event\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n onClick = (evt) => {\\n this.fire('myevent', { name: 'abc' })\\n }\\n\\n render(props) {\\n return (\\n

Hello, world!

\\n )\\n }\\n})\\n```\\n\\n然后在你的自定义元素上绑定事件:\\n\\n```jsx\\n { alert(evt.detail.name) }}>\\n```\\n\\n通过 `this.fire` 触发自定义事件,fire 第一个参数是事件名称,第二个参数是传递的数据。通过 `evt.detail` 可以获取到传递的数据。\\n\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/14.4ee71391.chunk.js","module.exports = \"## Event\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n onClick = (evt) => {\\n alert('Hello Omi!')\\n }\\n\\n render() {\\n return (\\n

Hello, world!

\\n )\\n }\\n})\\n```\\n\\n### Custom Event\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n onClick = (evt) => {\\n this.fire('myevent', { name: 'abc' })\\n }\\n\\n render(props) {\\n return (\\n

Hello, world!

\\n )\\n }\\n})\\n```\\n\\n然后在你的自定义元素上绑定事件:\\n\\n```jsx\\n { alert(evt.detail.name) }}>\\n```\\n\\n通过 `this.fire` 触发自定义事件,fire 第一个参数是事件名称,第二个参数是传递的数据。通过 `evt.detail` 可以获取到传递的数据。\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/event.md\n// module id = 56\n// module chunks = 14"],"sourceRoot":""} -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/15.e804bc91.chunk.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([15],{55:function(n,e){n.exports="## CSS\n\n\u8fd9\u91cc\u8bf4\u7684\u662f props \u7684 css\uff0c\u800c\u4e0d\u662f `static css`\uff0c\u5b83\u63d0\u4f9b\u4e86\u4fee\u6539 shadow dom \u5185\u90e8 scoped style \u7684\u80fd\u529b\u3002\n\n### \u4e3e\u4e2a\u4f8b\u5b50\n\n```jsx\ndefine('my-element', class extends WeElement {\n static css = `h1{\n color: red;\n }`\n\n render() {\n return (\n
\n

Look at my color!

\n

\n )\n }\n})\n```\n\n\u4e0a\u9762\u7684 `my-element` \u7684 h1 \u6807\u7b7e\u989c\u8272\u662f\u7ea2\u8272\u3002\u6709\u4ec0\u4e48\u529e\u6cd5\u4fee\u6539\u5417\uff1f\n\n```jsx\ndefine('my-app', class extends WeElement {\n\n myCSS = `\n h1{\n color: green;\n }`\n\n onClick = () => {\n //\u52a8\u6001\u4fee\u6539\n this.myCSS = `\n h1{\n color: blue;\n }`\n this.update()\n }\n\n render() {\n return (\n
\n \n
\n )\n }\n})\n```\n\n\u800c\u4e14\u8fd8\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u65b9\u5f0f\u4fdd\u8bc1\u4e00\u5b9a\u80fd\u591f\u4fee\u6539\uff1a\n\n```css\ncolor: blue!important;\n```\n"}}); 2 | //# sourceMappingURL=15.e804bc91.chunk.js.map -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/15.e804bc91.chunk.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../static/js/15.e804bc91.chunk.js","docs/zh-cn/css.md"],"names":["webpackJsonp","55","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/15.e804bc91.chunk.js","sourcesContent":["webpackJsonp([15],{\n\n/***/ 55:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## CSS\\n\\n这里说的是 props 的 css,而不是 `static css`,它提供了修改 shadow dom 内部 scoped style 的能力。\\n\\n### 举个例子\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n static css = `h1{\\n color: red;\\n }`\\n\\n render() {\\n return (\\n
\\n

Look at my color!

\\n

\\n )\\n }\\n})\\n```\\n\\n上面的 `my-element` 的 h1 标签颜色是红色。有什么办法修改吗?\\n\\n```jsx\\ndefine('my-app', class extends WeElement {\\n\\n myCSS = `\\n h1{\\n color: green;\\n }`\\n\\n onClick = () => {\\n //动态修改\\n this.myCSS = `\\n h1{\\n color: blue;\\n }`\\n this.update()\\n }\\n\\n render() {\\n return (\\n
\\n \\n
\\n )\\n }\\n})\\n```\\n\\n而且还可以通过下面的方式保证一定能够修改:\\n\\n```css\\ncolor: blue!important;\\n```\\n\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/15.e804bc91.chunk.js","module.exports = \"## CSS\\n\\n这里说的是 props 的 css,而不是 `static css`,它提供了修改 shadow dom 内部 scoped style 的能力。\\n\\n### 举个例子\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n static css = `h1{\\n color: red;\\n }`\\n\\n render() {\\n return (\\n
\\n

Look at my color!

\\n

\\n )\\n }\\n})\\n```\\n\\n上面的 `my-element` 的 h1 标签颜色是红色。有什么办法修改吗?\\n\\n```jsx\\ndefine('my-app', class extends WeElement {\\n\\n myCSS = `\\n h1{\\n color: green;\\n }`\\n\\n onClick = () => {\\n //动态修改\\n this.myCSS = `\\n h1{\\n color: blue;\\n }`\\n this.update()\\n }\\n\\n render() {\\n return (\\n
\\n \\n
\\n )\\n }\\n})\\n```\\n\\n而且还可以通过下面的方式保证一定能够修改:\\n\\n```css\\ncolor: blue!important;\\n```\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/css.md\n// module id = 55\n// module chunks = 15"],"sourceRoot":""} -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/16.e084ed27.chunk.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([16],{54:function(s,n){s.exports="## Class\n\nOmi \u6709\u5185\u7f6e\u7684\u4e24\u4e2a class \u65b9\u6cd5 `classNames` \u548c `extractClass`\uff1a\n\n```js\nimport { classNames, extractClass } from 'omi'\n\ndefine('my-element', class extends WeElement {\n render(props) {\n //extractClass \u4f1a\u53d6\u51fa props \u7684 class \u6216 className \u5c5e\u6027\u5e76\u4e0e\u5176\u4ed6 classNames \u5408\u5e76\u5728\u4e00\u8d77\n const cls = extractClass(props, 'o-my-class', {\n 'other-class': true,\n 'other-class-b': this.xxx === 1\n })\n\n return (\n
\n Test\n
\n )\n }\n})\n```\n\n\u4e0a\u9762\u7684 `classNames` \u548c npm \u4e0a\u7684 [classNames](https://www.npmjs.com/package/classnames) \u662f\u4e00\u6837\u7684\u3002"}}); 2 | //# sourceMappingURL=16.e084ed27.chunk.js.map -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/16.e084ed27.chunk.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../static/js/16.e084ed27.chunk.js","docs/zh-cn/class.md"],"names":["webpackJsonp","54","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/16.e084ed27.chunk.js","sourcesContent":["webpackJsonp([16],{\n\n/***/ 54:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Class\\n\\nOmi 有内置的两个 class 方法 `classNames` 和 `extractClass`:\\n\\n```js\\nimport { classNames, extractClass } from 'omi'\\n\\ndefine('my-element', class extends WeElement {\\n render(props) {\\n //extractClass 会取出 props 的 class 或 className 属性并与其他 classNames 合并在一起\\n const cls = extractClass(props, 'o-my-class', {\\n 'other-class': true,\\n 'other-class-b': this.xxx === 1\\n })\\n\\n return (\\n
\\n Test\\n
\\n )\\n }\\n})\\n```\\n\\n上面的 `classNames` 和 npm 上的 [classNames](https://www.npmjs.com/package/classnames) 是一样的。\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/16.e084ed27.chunk.js","module.exports = \"## Class\\n\\nOmi 有内置的两个 class 方法 `classNames` 和 `extractClass`:\\n\\n```js\\nimport { classNames, extractClass } from 'omi'\\n\\ndefine('my-element', class extends WeElement {\\n render(props) {\\n //extractClass 会取出 props 的 class 或 className 属性并与其他 classNames 合并在一起\\n const cls = extractClass(props, 'o-my-class', {\\n 'other-class': true,\\n 'other-class-b': this.xxx === 1\\n })\\n\\n return (\\n
\\n Test\\n
\\n )\\n }\\n})\\n```\\n\\n上面的 `classNames` 和 npm 上的 [classNames](https://www.npmjs.com/package/classnames) 是一样的。\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/zh-cn/class.md\n// module id = 54\n// module chunks = 16"],"sourceRoot":""} -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/17.42ec0c78.chunk.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([17],{53:function(e,t){e.exports="\n## Update\n\n`update` method is an important built-in core method for updating components themselves. For example:\n\n```js\nthis.update()\n```\n\nYou can also pass parameters to decide whether to ignore attributes in html mode and force updates:\n\n```js\nthis.update(true)\n```\n\nFor example, click on the mask of the pop-up layer to close the pop-up, pass it to the parent component in the react, let the parent component update, while Omi advocates self-update, so that the diff area is smaller.\n\n```js\nonMaskClick = ()=> {\n //change props\n this.props.show = false\n //prevent parent component from updating diff without results\n this.prevProps.show = false\n //update self and ignore attributes in html mode\n this.update(true)\n //trigger events, which can be used to change external state variables to maintain consistency, but external components need not be updated\n this.fire('close')\n}\n```"}}); 2 | //# sourceMappingURL=17.42ec0c78.chunk.js.map -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/17.42ec0c78.chunk.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../static/js/17.42ec0c78.chunk.js","docs/en/update.md"],"names":["webpackJsonp","53","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/17.42ec0c78.chunk.js","sourcesContent":["webpackJsonp([17],{\n\n/***/ 53:\n/***/ (function(module, exports) {\n\nmodule.exports = \"\\n## Update\\n\\n`update` method is an important built-in core method for updating components themselves. For example:\\n\\n```js\\nthis.update()\\n```\\n\\nYou can also pass parameters to decide whether to ignore attributes in html mode and force updates:\\n\\n```js\\nthis.update(true)\\n```\\n\\nFor example, click on the mask of the pop-up layer to close the pop-up, pass it to the parent component in the react, let the parent component update, while Omi advocates self-update, so that the diff area is smaller.\\n\\n```js\\nonMaskClick = ()=> {\\n //change props\\n this.props.show = false\\n //prevent parent component from updating diff without results\\n this.prevProps.show = false\\n //update self and ignore attributes in html mode\\n this.update(true)\\n //trigger events, which can be used to change external state variables to maintain consistency, but external components need not be updated\\n this.fire('close')\\n}\\n```\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/17.42ec0c78.chunk.js","module.exports = \"\\n## Update\\n\\n`update` method is an important built-in core method for updating components themselves. For example:\\n\\n```js\\nthis.update()\\n```\\n\\nYou can also pass parameters to decide whether to ignore attributes in html mode and force updates:\\n\\n```js\\nthis.update(true)\\n```\\n\\nFor example, click on the mask of the pop-up layer to close the pop-up, pass it to the parent component in the react, let the parent component update, while Omi advocates self-update, so that the diff area is smaller.\\n\\n```js\\nonMaskClick = ()=> {\\n //change props\\n this.props.show = false\\n //prevent parent component from updating diff without results\\n this.prevProps.show = false\\n //update self and ignore attributes in html mode\\n this.update(true)\\n //trigger events, which can be used to change external state variables to maintain consistency, but external components need not be updated\\n this.fire('close')\\n}\\n```\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/en/update.md\n// module id = 53\n// module chunks = 17"],"sourceRoot":""} -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/19.e37070eb.chunk.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([19],{51:function(n,e){n.exports="## Server-Side Rendering\n\nServer-Side Rendering(SSR) has two advantages:\n\n* Be friendly to SEO\n* Faster First Screen Display Time\n\nServer-side rendering (SSR) also has drawbacks, such as increasing server-side overhead. Developers can weigh whether to use SSR or pre-render directly with [omi-snap](https://github.com/Tencent/omi/blob/master/tutorial/omi-snap.cn.md). Pre-rendering does not require additional server-side overhead and generates skeleton screen directly at the time of construction, so there is no dynamic data content. SSR can return HTML generated by dynamic data, and also the serialization data can be returned with HTML.\n\n## Usage\n\n```bash\n$ npm i omi-cli -g # install cli\n$ omi init-s my-app # init project\n$ cd my-app \n$ npm start # develop\n$ npm run build # release\n```\n\n## Principle\n\nDefine component:\n\n```jsx\nimport { WeElement, define } from 'omio'\n\ndefine('my-element', class extends WeElement {\n install() {\n this.data = { liked: false }\n }\n\n static css = 'button{ color: red; }'\n\n render() {\n if (this.data.liked) {\n return 'You liked this.'\n }\n\n return \n }\n})\n```\n\nNote that omio is used here, SSR can only use omio, not omi, because OMI is web components, node can not render web components.\n\n> Both OMI and omio projects must use omio for SSR\n\nStart a node server:\n\n```jsx\nvar express = require('express')\nvar app = express()\nvar Omi = require('omio')\nrequire('./my-element')\n\napp.get('/', function (req, res) {\n const obj = Omi.renderToString()\n res.end(`\n\n \n Omi SSR\n ${toString(obj.css)}\n \n ${obj.html}\n`)\n})\n\nfunction toString(css){\n return (\n css.map(style => {\n return ``\n }\n ))\n )\n}\n\napp.listen(3000)\n```\n\nRendering HTML structure:\n\n```html\n\n\n \n Omi SSR\n \n \n \n\n```\n\nPreview:\n\n![](https://github.com/Tencent/omi/raw/master/assets/hello-ssr.png)\n\n\n"}}); 2 | //# sourceMappingURL=19.e37070eb.chunk.js.map -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/21.4551715a.chunk.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([21],{49:function(n,e){n.exports="## Ref\n\n```jsx\ndefine('my-element', class extends WeElement {\n onClick = (evt) => {\n console.log(this.h1)\n }\n\n render(props) {\n return (\n
\n

{ this.h1 = e }} onClick={this.onClick}>Hello, world!

\n
\n )\n }\n})\n```\n\nAdd `ref = {e => {this. anyNameYouWant = e} ` to the element, and then you can access the element using `this. anyNameYouWant` in the JS code. You can improve the performance of update in two ways:\n\n* Assignment ahead of time\n* createRef\n\n### Assignment ahead of time\n\n```jsx\ndefine('my-element', class extends WeElement {\n onClick = (evt) => {\n console.log(this.h1)\n }\n\n myRef = e => { this.h1 = e }\n\n render(props) {\n return (\n
\n

Hello, world!

\n
\n )\n }\n})\n```\n\n### createRef\n\n```jsx\ndefine('my-element', class extends WeElement {\n onClick = (evt) => {\n console.log(this.myRef.current) //h1\n }\n\n myRef = createRef()\n\n render(props) {\n return (\n
\n

Hello, world!

\n
\n )\n }\n})\n```"}}); 2 | //# sourceMappingURL=21.4551715a.chunk.js.map -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/21.4551715a.chunk.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../static/js/21.4551715a.chunk.js","docs/en/ref.md"],"names":["webpackJsonp","49","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/21.4551715a.chunk.js","sourcesContent":["webpackJsonp([21],{\n\n/***/ 49:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Ref\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n onClick = (evt) => {\\n console.log(this.h1)\\n }\\n\\n render(props) {\\n return (\\n
\\n

{ this.h1 = e }} onClick={this.onClick}>Hello, world!

\\n
\\n )\\n }\\n})\\n```\\n\\nAdd `ref = {e => {this. anyNameYouWant = e} ` to the element, and then you can access the element using `this. anyNameYouWant` in the JS code. You can improve the performance of update in two ways:\\n\\n* Assignment ahead of time\\n* createRef\\n\\n### Assignment ahead of time\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n onClick = (evt) => {\\n console.log(this.h1)\\n }\\n\\n myRef = e => { this.h1 = e }\\n\\n render(props) {\\n return (\\n
\\n

Hello, world!

\\n
\\n )\\n }\\n})\\n```\\n\\n### createRef\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n onClick = (evt) => {\\n console.log(this.myRef.current) //h1\\n }\\n\\n myRef = createRef()\\n\\n render(props) {\\n return (\\n
\\n

Hello, world!

\\n
\\n )\\n }\\n})\\n```\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/21.4551715a.chunk.js","module.exports = \"## Ref\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n onClick = (evt) => {\\n console.log(this.h1)\\n }\\n\\n render(props) {\\n return (\\n
\\n

{ this.h1 = e }} onClick={this.onClick}>Hello, world!

\\n
\\n )\\n }\\n})\\n```\\n\\nAdd `ref = {e => {this. anyNameYouWant = e} ` to the element, and then you can access the element using `this. anyNameYouWant` in the JS code. You can improve the performance of update in two ways:\\n\\n* Assignment ahead of time\\n* createRef\\n\\n### Assignment ahead of time\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n onClick = (evt) => {\\n console.log(this.h1)\\n }\\n\\n myRef = e => { this.h1 = e }\\n\\n render(props) {\\n return (\\n
\\n

Hello, world!

\\n
\\n )\\n }\\n})\\n```\\n\\n### createRef\\n\\n```jsx\\ndefine('my-element', class extends WeElement {\\n onClick = (evt) => {\\n console.log(this.myRef.current) //h1\\n }\\n\\n myRef = createRef()\\n\\n render(props) {\\n return (\\n
\\n

Hello, world!

\\n
\\n )\\n }\\n})\\n```\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/en/ref.md\n// module id = 49\n// module chunks = 21"],"sourceRoot":""} -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/22.016f3201.chunk.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([22],{48:function(n,e){n.exports="\n## Props\n\nTransfer data to sub elements through props, such as:\n\n```jsx\nimport { WeElement, define, render } from 'omi'\n\ndefine('my-element', class extends WeElement {\n render(props) {\n return (\n

Hello, {props.name}!

\n )\n }\n})\n```\n\nUsing element:\n\n```jsx\n\n```\n\nYou can also pass any type of data to props:\n\n```jsx\ndefine('my-element', class extends WeElement {\n render(props) {\n return (\n

Hello, {props.myObj.name}!

\n )\n }\n})\n```\n\nUsing element:\n\n```jsx\n\n```\n\nYou can set the default value by the `static defaultProps` property\uff0cuse `static propTypes` to set the type:\n\n```jsx\ndefine('my-element', class extends WeElement {\n static defaultProps = {\n\t\tname: 'Omi',\n\t\tmyAge: 18\n\t}\n\n static propTypes = {\n\t\tname: String,\n\t\tmyAge: Number\n }\n \n render(props) {\n return (\n

Hello, {props.name}! Age {props.myAge}

\n )\n }\n})\n```\n\nSpecial attention should be paid to adding `static propTypes` if your custom elements want to be used directly in other frameworks or without frameworks. For example, it can be used directly in the body:\n\n```html\n\n \n\n```\n\n### Once Props\n\n```jsx\ndefine('my-element', class extends WeElement {\n install() {\n this.name = this.props.name\n }\n\n render() {\n return (\n

Hello, {this.name}!

\n )\n }\n})\n```\n\nNext time the parent component updated and changed props, it will not affect the component."}}); 2 | //# sourceMappingURL=22.016f3201.chunk.js.map -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/25.734c7748.chunk.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([25],{45:function(e,n){e.exports="## Lifecycle\n\n| Lifecycle method | When it gets called |\n| ---------------- | -------------------------------------------- |\n| `install` | before the component gets mounted to the DOM |\n| `installed` | after the component gets mounted to the DOM |\n| `uninstall` | prior to removal from the DOM |\n| `beforeUpdate` | before update |\n| `updated` | after update |\n| `beforeRender` | before `render()` |\n| `receiveProps` | parent element re-render will trigger it |\n\nFor example:\n\n```js\nimport { render, WeElement, define } from 'omi'\n\ndefine('my-timer', class extends WeElement {\n static observe = true\n\n data = {\n seconds: 0\n }\n\n tick() {\n this.data.seconds++\n }\n\n install() {\n this.interval = setInterval(() => this.tick(), 1000)\n }\n\n uninstall() {\n clearInterval(this.interval)\n }\n\n render() {\n return
Seconds: {this.data.seconds}
\n }\n})\n\nrender(, 'body')\n```\n"}}); 2 | //# sourceMappingURL=25.734c7748.chunk.js.map -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/25.734c7748.chunk.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../static/js/25.734c7748.chunk.js","docs/en/lifecycle.md"],"names":["webpackJsonp","45","module","exports"],"mappings":"AAAAA,cAAc,KAERC,GACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA","file":"static/js/25.734c7748.chunk.js","sourcesContent":["webpackJsonp([25],{\n\n/***/ 45:\n/***/ (function(module, exports) {\n\nmodule.exports = \"## Lifecycle\\n\\n| Lifecycle method | When it gets called |\\n| ---------------- | -------------------------------------------- |\\n| `install` | before the component gets mounted to the DOM |\\n| `installed` | after the component gets mounted to the DOM |\\n| `uninstall` | prior to removal from the DOM |\\n| `beforeUpdate` | before update |\\n| `updated` | after update |\\n| `beforeRender` | before `render()` |\\n| `receiveProps` | parent element re-render will trigger it |\\n\\nFor example:\\n\\n```js\\nimport { render, WeElement, define } from 'omi'\\n\\ndefine('my-timer', class extends WeElement {\\n static observe = true\\n\\n data = {\\n seconds: 0\\n }\\n\\n tick() {\\n this.data.seconds++\\n }\\n\\n install() {\\n this.interval = setInterval(() => this.tick(), 1000)\\n }\\n\\n uninstall() {\\n clearInterval(this.interval)\\n }\\n\\n render() {\\n return
Seconds: {this.data.seconds}
\\n }\\n})\\n\\nrender(, 'body')\\n```\\n\"\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// static/js/25.734c7748.chunk.js","module.exports = \"## Lifecycle\\n\\n| Lifecycle method | When it gets called |\\n| ---------------- | -------------------------------------------- |\\n| `install` | before the component gets mounted to the DOM |\\n| `installed` | after the component gets mounted to the DOM |\\n| `uninstall` | prior to removal from the DOM |\\n| `beforeUpdate` | before update |\\n| `updated` | after update |\\n| `beforeRender` | before `render()` |\\n| `receiveProps` | parent element re-render will trigger it |\\n\\nFor example:\\n\\n```js\\nimport { render, WeElement, define } from 'omi'\\n\\ndefine('my-timer', class extends WeElement {\\n static observe = true\\n\\n data = {\\n seconds: 0\\n }\\n\\n tick() {\\n this.data.seconds++\\n }\\n\\n install() {\\n this.interval = setInterval(() => this.tick(), 1000)\\n }\\n\\n uninstall() {\\n clearInterval(this.interval)\\n }\\n\\n render() {\\n return
Seconds: {this.data.seconds}
\\n }\\n})\\n\\nrender(, 'body')\\n```\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/docs/en/lifecycle.md\n// module id = 45\n// module chunks = 25"],"sourceRoot":""} -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/26.ef88d36f.chunk.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([26],{44:function(n,e){n.exports="## JSX\n\nJSX is the best UI expression with the least grammatical noise, the strongest expressive ability and Turing complete. The template engine is not complete, the template string is Turing complete, but the grammatical noise is too big. \n\n```js\nJSX > JS\n```\n\n## Hello JSX\n\nWith JSX, closed XML tags can be written in JS to express DOM structures, such as:\n\n```jsx\nconst element =

Hello, world!

\n```\n\n## Data binding\n\nVariables or expressions, or JS statement blocks, are wrapped in single parentheses according to the binding:\n\n```jsx\n

{user.name}

\n```\n\nTry it in Omi's render method:\n\n```jsx\ndefine('my-element', class extends WeElement {\n render(props) {\n return

{props.name}

\n }\n})\n```\n\nUsing element:\n\n```jsx\n\n```\n\nYou can also write expressions:\n\n```jsx\n

{user.age > 18 ? 'Adult' : 'Minor'}

\n```\n\nJSX can also be embedded in expressions:\n\n```jsx\n

{ user.age > 18 ?
Adult
:
Minor
}

\n```\n\nThe above three elements are actually if else. If only if, you can:\n\n```jsx\n

{ user.age > 18 &&
\u6210\u5e74
}

\n```\n\nPowerful!\n\n## List rendering\n\nDatasource:\n\n```js\nconst arr = [{\n message: 'foo',\n}, {\n message: 'bar'\n}]\n```\n\nJSX rendering:\n\n```jsx\n
    \n {arr.map(item =>\n
  • {item.message}
  • \n )}\n
\n```\n\nEquate to:\n\n```jsx\n
    \n {\n arr.map(item => {\n return
  • {item.message}
  • \n })\n }\n
\n```\n\nIf it's a `{}'package, you need `return'. If you need an index:\n\n```jsx\n
    \n {arr.map((item, index) =>\n
  • {index}: {item.message}
  • \n )}\n
\n```\n\n## Comprehensive example\n\nHere is a ninety-nine multiplication table:\n\n```jsx\nimport { define, render, WeElement } from 'omi'\n\ndefine('my-app', class extends WeElement {\n\n static css = `span{\n display: inline-block;\n width: 68px;\n }`\n\n render(props) {\n return (\n
\n {props.numbers.map((a, indexA) =>\n
\n {\n props.numbers.map((b, indexB) => {\n return indexA <= indexB && {a}*{b}={a * b} \n })\n }\n
\n )}\n
\n )\n }\n})\n\nrender(, 'body')\n```\n\nResult display:\n\n![](https://github.com/Tencent/omi/raw/master/assets/99.jpg)\n\n[\u2192 Online Demo](https://tencent.github.io/omi/packages/omi/examples/99/)"}}); 2 | //# sourceMappingURL=26.ef88d36f.chunk.js.map -------------------------------------------------------------------------------- /src/ecosystem/packages/omi-docs/static/js/27.e12ca944.chunk.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([27],{43:function(n,t){n.exports="## What's Omi \uff1f\n\nOmi (pronounced /\u02c8om\u026a/) is next front end framework base on Web Component. One framework. Mobile & desktop & mini program.\n\n Omi looks really neat!
\n\u3000\u3000\u3000\u3000\u2014 [Jason Miller (Creator of Preact)](https://twitter.com/_developit/)\n\n I really like the trend towards \"frameworks\" that:

\"export default class WeElement extends HTMLElement {..}\"

This one, Omi, is from Tencent.
\n\u3000\u3000\u3000\u3000\u2014 [Dion Almaer](https://twitter.com/dalmaer/)\n\n## Add Omi in One Minute\n\nThis page demonstrates using Omi **with no build tooling**:\n\n```html\n -------------------------------------------------------------------------------- /src/ecosystem/page/build/asset-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "admin.js": "./static/js/admin.307cac3c.js", 3 | "admin.js.map": "./static/js/admin.307cac3c.js.map", 4 | "index.js": "./static/js/index.56726421.js", 5 | "index.js.map": "./static/js/index.56726421.js.map", 6 | "admin.html": "./admin.html", 7 | "index.html": "./index.html" 8 | } -------------------------------------------------------------------------------- /src/ecosystem/page/build/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/src/ecosystem/page/build/favicon.ico -------------------------------------------------------------------------------- /src/ecosystem/page/build/index.html: -------------------------------------------------------------------------------- 1 | Omi
-------------------------------------------------------------------------------- /src/ecosystem/page/build/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Omi App", 3 | "name": "Omi Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /src/ecosystem/page/build/service-worker.js: -------------------------------------------------------------------------------- 1 | "use strict";var precacheConfig=[["./admin.html","466b5fc7a126d4a819abb34babb2f46a"],["./index.html","97ac340ba226374d226bbe504fccf73b"],["./static/js/admin.307cac3c.js","895fbea9e978477b543c98b616caad5a"],["./static/js/index.56726421.js","3f7f1ffeb2d9cd2b5fa1d1a2000d8528"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var n=new URL(e);return"/"===n.pathname.slice(-1)&&(n.pathname+=t),n.toString()},cleanResponse=function(e){return e.redirected?("body"in e?Promise.resolve(e.body):e.blob()).then(function(t){return new Response(t,{headers:e.headers,status:e.status,statusText:e.statusText})}):Promise.resolve(e)},createCacheKey=function(e,t,n,r){var a=new URL(e);return r&&a.pathname.match(r)||(a.search+=(a.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(n)),a.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var n=new URL(t).pathname;return e.some(function(e){return n.match(e)})},stripIgnoredUrlParameters=function(e,t){var n=new URL(e);return n.hash="",n.search=n.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(e){return t.every(function(t){return!t.test(e[0])})}).map(function(e){return e.join("=")}).join("&"),n.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],n=e[1],r=new URL(t,self.location),a=createCacheKey(r,hashParamName,n,/\.\w{8}\./);return[r.toString(),a]}));function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(e){return setOfCachedUrls(e).then(function(t){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(n){if(!t.has(n)){var r=new Request(n,{credentials:"same-origin"});return fetch(r).then(function(t){if(!t.ok)throw new Error("Request for "+n+" returned a response with status "+t.status);return cleanResponse(t).then(function(t){return e.put(n,t)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var t=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(e){return e.keys().then(function(n){return Promise.all(n.map(function(n){if(!t.has(n.url))return e.delete(n)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(e){if("GET"===e.request.method){var t,n=stripIgnoredUrlParameters(e.request.url,ignoreUrlParametersMatching);(t=urlsToCacheKeys.has(n))||(n=addDirectoryIndex(n,"index.html"),t=urlsToCacheKeys.has(n));!t&&"navigate"===e.request.mode&&isPathWhitelisted(["^(?!\\/__).*"],e.request.url)&&(n=new URL("./index.html",self.location).toString(),t=urlsToCacheKeys.has(n)),t&&e.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(n)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(t){return console.warn('Couldn\'t serve response for "%s" from cache: %O',e.request.url,t),fetch(e.request)}))}}); -------------------------------------------------------------------------------- /src/ecosystem/page/config/entry.js: -------------------------------------------------------------------------------- 1 | let fs = require('fs'), 2 | fileList = []; 3 | 4 | 5 | if (typeof String.prototype.endsWith != 'function') { 6 | String.prototype.endsWith = function (suffix) { 7 | return this.indexOf(suffix, this.length - suffix.length) !== -1; 8 | }; 9 | } 10 | 11 | function walk(path) { 12 | let dirList = fs.readdirSync(path); 13 | dirList.forEach(function (item) { 14 | if (!fs.statSync(path + '/' + item).isDirectory()) { 15 | if (item.endsWith('\.js')) { 16 | fileList.push(item.substr(0, item.length - 3)); 17 | } 18 | } else { 19 | //walk(path + '/' + item); 20 | } 21 | }); 22 | } 23 | 24 | walk('./src'); 25 | 26 | 27 | 28 | module.exports = fileList; -------------------------------------------------------------------------------- /src/ecosystem/page/config/jest/cssTransform.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // This is a custom Jest transformer turning style imports into empty objects. 4 | // http://facebook.github.io/jest/docs/en/webpack.html 5 | 6 | module.exports = { 7 | process() { 8 | return 'module.exports = {};'; 9 | }, 10 | getCacheKey() { 11 | // The output is always the same. 12 | return 'cssTransform'; 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /src/ecosystem/page/config/jest/fileTransform.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | 5 | // This is a custom Jest transformer turning file imports into filenames. 6 | // http://facebook.github.io/jest/docs/en/webpack.html 7 | 8 | module.exports = { 9 | process(src, filename) { 10 | return `module.exports = ${JSON.stringify(path.basename(filename))};`; 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /src/ecosystem/page/config/paths.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | const fs = require('fs'); 5 | const url = require('url'); 6 | 7 | // Make sure any symlinks in the project folder are resolved: 8 | // https://github.com/facebookincubator/create-react-app/issues/637 9 | const appDirectory = fs.realpathSync(process.cwd()); 10 | const resolveApp = relativePath => path.resolve(appDirectory, relativePath); 11 | 12 | const envPublicUrl = process.env.PUBLIC_URL; 13 | 14 | function ensureSlash(path, needsSlash) { 15 | const hasSlash = path.endsWith('/'); 16 | if (hasSlash && !needsSlash) { 17 | return path.substr(path, path.length - 1); 18 | } else if (!hasSlash && needsSlash) { 19 | return `${path}/`; 20 | } else { 21 | return path; 22 | } 23 | } 24 | 25 | const getPublicUrl = appPackageJson => 26 | envPublicUrl || require(appPackageJson).homepage; 27 | 28 | // We use `PUBLIC_URL` environment variable or "homepage" field to infer 29 | // "public path" at which the app is served. 30 | // Webpack needs to know it to put the right */} 46 | {/* */} -------------------------------------------------------------------------------- /src/github/tree-item.js: -------------------------------------------------------------------------------- 1 | const vscode = require('vscode'); //导入模块并在下面的代码中使用别名vscode引用它(模块“vscode”包含VS代码可扩展性API) 2 | const path = require('path'); 3 | 4 | /** 5 | * omi生态专用菜单树:继承重写 vscode.TreeItem 相关菜单树功能 6 | * @param label 菜单节点主内容(突出显示) 7 | * @param labelAdd 菜单附加内容(不突出显示) 8 | * @param collapsibleState 菜单节点折叠状态(菜单节点是否可折叠) 9 | * @param command 选择菜单树项时应该执行的命令 10 | * @return OmiTreeItem — 整个菜单树节点 11 | */ 12 | class OmiTreeItem extends vscode.TreeItem { 13 | constructor(label, labelAdd, filePathlink, collapsibleState, fileType, command) { 14 | super(label, collapsibleState); //添加菜单节点并设置菜单节点的折叠状态 15 | this.label = label; //菜单节点主内容(突出显示) 16 | this.labelAdd = labelAdd; //菜单附加内容(不突出显示) 17 | this.filePathlink = filePathlink; //文件或文件夹内容所在网址 18 | this.collapsibleState = collapsibleState; //菜单节点折叠状态(菜单节点是否可折叠) 19 | this.fileType = fileType; //文件类型 20 | this.command = command; //选择菜单树项时应该执行的命令 21 | //菜单树图标路径 22 | if(fileType == 'file') { 23 | this.iconPath = { 24 | light: path.join(__filename, '..', '..', '..', 'assets', 'light', 'file.svg'), 25 | dark: path.join(__filename, '..', '..', '..', 'assets', 'dark', 'file.svg') 26 | }; 27 | } else if(fileType == 'directory') { 28 | this.iconPath = { 29 | light: path.join(__filename, '..', '..', '..', 'assets', 'light', 'folder.svg'), 30 | dark: path.join(__filename, '..', '..', '..', 'assets', 'dark', 'folder.svg') 31 | }; 32 | } else if(fileType == 'github') { 33 | this.iconPath = { 34 | light: path.join(__filename, '..', '..', '..', 'assets', 'light', 'github.svg'), 35 | dark: path.join(__filename, '..', '..', '..', 'assets', 'dark', 'github.svg') 36 | }; 37 | } else if(fileType == 'branches') { 38 | this.iconPath = { 39 | light: path.join(__filename, '..', '..', '..', 'assets', 'light', 'dependency.svg'), 40 | dark: path.join(__filename, '..', '..', '..', 'assets', 'dark', 'dependency.svg') 41 | }; 42 | } else if(fileType == 'tags') { 43 | this.iconPath = { 44 | light: path.join(__filename, '..', '..', '..', 'assets', 'light', 'dependency.svg'), 45 | dark: path.join(__filename, '..', '..', '..', 'assets', 'dark', 'dependency.svg') 46 | }; 47 | } 48 | this.contextValue = 'edit'; //树项的上下文值。这可以用于在树中贡献项目(contribute)特定的操作。 49 | } 50 | 51 | /** 52 | * 将鼠标悬停在此项上时的工具提示文本。 53 | */ 54 | get tooltip() { 55 | return `${this.label}-${this.labelAdd}`; 56 | } 57 | 58 | /** 59 | * 菜单栏附加内容插入(一种人类可读的字符串,其显示不太突出。如果为真,则从resourceUri派生,如果为假,则不显示。) 60 | */ 61 | get description() { 62 | return this.labelAdd; 63 | } 64 | } 65 | exports.OmiTreeItem = OmiTreeItem; 66 | 67 | -------------------------------------------------------------------------------- /src/hover/README.CN.md: -------------------------------------------------------------------------------- 1 | [English](https://github.com/ZainChen/omi-vscode/blob/master/src/hover/README.md) | 简体中文 2 | 3 | # Omi 鼠标悬停提示功能 4 | 5 | 支持语言:`omi`, `vue`, `html`, `json`, `javascript`, `javascriptreact`, `typescript`, `typescriptreact`, `tex`, `c`, `cpp`, `css`, `markdown`, `php`, `python`, `jsonc`, `objective-c`, `xml`, `sql`, `java`, `swift`, `go`, `csharp` 6 | 7 | ## 1. 结构 8 | 9 | >config `[鼠标悬停提示信息配置库]` 10 | > 11 | >>other `[存放其它提示信息配置文件]` 12 | >>> 13 | >>>other.json `[自定义其它提示信息]` 14 | >> 15 | >>omi.json `[omi 相关提示]` 16 | >> 17 | >>omiu.json `[omiu 相关提示]` 18 | >> 19 | >>package.json `[package.json 文件相关提示]` 20 | >> 21 | > 22 | >index.js `[功能实现代码]` 23 | > 24 | >README.CN.md `[中文说明文档]` 25 | > 26 | >README.md `[英文说明文档]` 27 | 28 | ## 2. 用户自定义提示信息 29 | 30 | (PS:此方法也适用于在`omi-vscode`源码中添加提示,欢迎大家贡献:https://github.com/ZainChen/omi-vscode) 31 | 32 | ### 2.1. 安装好 `omi` 扩展后,进入 `omi` 扩展安装目录 33 | 34 | ``` 35 | C:\Users\[你的用户名]\.vscode-insiders[根据vscode版本不同有区别]\extensions\zainchen.omi-*[*为omi版本号]\src\hover\ 36 | ``` 37 | 38 | 源码贡献目录 39 | 40 | ``` 41 | omi-vscode/tree/master/src/hover 42 | ``` 43 | 44 | ### 2.2. 添加自定义提示配置文件 45 | 46 | 在 `config` 文件夹中新建 json 文件,文件名随意,按指定文件结构配置即可,支持添加任意子文件夹。 47 | 48 | (PS:当前行有多个提示信息匹配会依次尾加提示) 49 | 50 | 配置文件结构说明: 51 | 52 | ```js 53 | { 54 | "fileTypes": [ ".*", ".js", "zain.js" ], //支持鼠标提示的文件类型及具体文件,'.*'为任意类型,'.js'为指定后缀名,'zain.js'为指定文件 55 | "hovers": { //所有提示信息 56 | "o-button": { //一个提示信息配置 57 | "keyword": "o-button", //提示信息匹配的关键字 58 | "matchingMethod": "line", //匹配模式(line光标所在整行匹配;continuous光标所在不含空格的连续字符串匹配) 59 | "ignoreAZ": false, //是否忽略大小写(true忽略,false不忽略) 60 | "markdownText": "markdown text" //提示文本,支持Markdown 61 | }, 62 | "o-icon": { 63 | ... 64 | } 65 | } 66 | ``` -------------------------------------------------------------------------------- /src/hover/README.md: -------------------------------------------------------------------------------- 1 | English | [简体中文](https://github.com/ZainChen/omi-vscode/blob/master/src/hover/README.CN.md) 2 | 3 | # Omi mouse hover prompt function 4 | 5 | Supported languages: `omi`, `vue`, `html`, `json`, `javascript`, `javascriptreact`, `typescript`, `typescriptreact`, `tex`, `c`, `cpp`, `css`, `markdown`, `php`, `python`, `jsonc`, `objective-c`, `xml`, `sql`, `java`, `swift`, `go`, `csharp` 6 | 7 | ## 1. structure 8 | 9 | >config `[Mouseover prompt information configuration library]` 10 | > 11 | >>other `[Store other prompt information profiles]` 12 | >>> 13 | >>>other.json `[Customize other prompts]` 14 | >> 15 | >>omi.json `[Omi related tips]` 16 | >> 17 | >>omiu.json `[Omiu related tips]` 18 | >> 19 | >>package.json `[package.json file related tips]` 20 | >> 21 | > 22 | >index.js `[Function implementation code]` 23 | > 24 | >README.CN.md `[Chinese documentation]` 25 | > 26 | >README.md `[English documentation]` 27 | 28 | ## 2. User-defined prompt information 29 | 30 | (PS:This method is also suitable for adding hints in the `omi-vscode` source code. Welcome everyone to contribute: https://github.com/ZainChen/omi-vscode) 31 | 32 | ### 2.1. After installing the `omi` extension, go to the `omi` extension installation directory. 33 | 34 | ``` 35 | C:\Users\[your user]\.vscode-insiders[There are differences depending on the version of vscode]\extensions\zainchen.omi-*[* for omi version number]\src\hover\ 36 | ``` 37 | 38 | Source code contribution directory 39 | 40 | ``` 41 | omi-vscode/tree/master/src/hover 42 | ``` 43 | 44 | ### 2.2. Add a custom prompt profile 45 | 46 | Create a new json file in the `config` folder. The file name is free and can be configured according to the specified file structure, support for adding any subfolders. 47 | 48 | (PS:There are multiple prompt information matches in the current line, which will be followed by a prompt) 49 | 50 | Configuration file structure description: 51 | 52 | ```js 53 | { 54 | "fileTypes": [ ".*", ".js", "zain.js" ], //File type that supports mouse prompts and specific documents, '.*' is any type, '.js' is the specified suffix name, and 'zain.js' is the specified file. 55 | "hovers": { //All tips 56 | "o-button": { //A prompt message configuration 57 | "keyword": "o-button", //Keyword matching keyword 58 | "matchingMethod": "line", //Match mode (the entire line of the line cursor matches; continuous string matches the continuous string without spaces) 59 | "ignoreAZ": false, //Whether to ignore case (true ignore, false not ignore) 60 | "markdownText": "markdown text" //Prompt text, support Markdown 61 | }, 62 | "o-icon": { 63 | ... 64 | } 65 | } 66 | ``` -------------------------------------------------------------------------------- /src/hover/config/omi.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileTypes": [ ".*" ], 3 | "hovers": { 4 | "omi": { 5 | "keyword": "omi", 6 | "matchingMethod": "line", 7 | "ignoreAZ": true, 8 | "markdownText": "\n\n* [值] \"omi\":开发者-[dntzhang](https://github.com/dntzhang \"张磊的GitHub\"),项目储存库-[https://github.com/Tencent/omi](https://github.com/Tencent/omi \"omi GitHub\"),下一代 Web 框架,去万物糟粕,合精华为一点点 JS。" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /src/hover/config/other/other.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileTypes": [ ".*" ], 3 | "hovers": { 4 | "zain": { 5 | "keyword": "zain", 6 | "matchingMethod": "line", 7 | "ignoreAZ": true, 8 | "markdownText": "* \"zain\":帅气程序猿^_^,中文名\"志银\",个人网站-[https://zainzy.com/](https://zainzy.com/ \"志银\"),GitHub-[https://github.com/ZainChen](https://github.com/ZainChen \"志银GitHub\")" 9 | }, 10 | "ZainChen": { 11 | "keyword": "ZainChen", 12 | "matchingMethod": "continuous", 13 | "ignoreAZ": true, 14 | "markdownText": "* \"ZainChen\":帅气程序猿^_^,中文名\"志银\",个人网站-[https://zainzy.com/](https://zainzy.com/ \"志银\"),GitHub-[https://github.com/ZainChen](https://github.com/ZainChen \"志银GitHub\")" 15 | }, 16 | "志银": { 17 | "keyword": "志银", 18 | "matchingMethod": "continuous", 19 | "ignoreAZ": true, 20 | "markdownText": "* \"志银\":帅气程序猿^_^,中文名\"志银\",个人网站-[https://zainzy.com/](https://zainzy.com/ \"志银\"),GitHub-[https://github.com/ZainChen](https://github.com/ZainChen \"志银GitHub\")" 21 | }, 22 | "https://github.com/ZainChen/omi-vscode": { 23 | "keyword": "https://github.com/ZainChen/omi-vscode", 24 | "matchingMethod": "continuous", 25 | "ignoreAZ": true, 26 | "markdownText": "* \"[https://github.com/ZainChen/omi-vscode](https://github.com/ZainChen/omi-vscode \"omi-vscode\")\":omi-vscode源码网址" 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/jump/index.js: -------------------------------------------------------------------------------- 1 | const vscode = require('vscode'); //导入模块并在下面的代码中使用别名vscode引用它(模块“vscode”包含VS代码可扩展性API) 2 | const path = require('path'); 3 | const fs = require('fs'); 4 | 5 | const alg = require("../algorithm/index"); //算法模块 6 | 7 | 8 | module.exports = { 9 | provideDefinition 10 | } 11 | 12 | 13 | /** 14 | * 查找文件定义的provider,匹配到了就return一个location,否则不做处理 15 | * 最终效果是,当按住Ctrl键时,如果return了一个location,字符串就会变成一个可以点击的链接,否则无任何效果 16 | * @param {*} document 17 | * @param {*} position 18 | * @param {*} token 19 | */ 20 | function provideDefinition(document, position, token) { 21 | const fileName = document.fileName; 22 | const workDir = path.dirname(fileName); 23 | const word = document.getText(document.getWordRangeAtPosition(position)); 24 | const line = document.lineAt(position); 25 | 26 | // console.log(word, line.text); 27 | 28 | // 只处理package.json文件 29 | if (/package\.json$/.test(fileName)) { 30 | 31 | const json = document.getText(); 32 | if (new RegExp(`"(dependencies|devDependencies)":\\s*?\\{[\\s\\S]*?${word.replace(/\//g, '\\/')}[\\s\\S]*?\\}`, 'gm').test(json)) { 33 | //let destPath = `${workDir}/node_modules/${word.replace(/"/g, '')}/package.json`; 34 | let destPath = `${workDir}/README.md`; 35 | if (fs.existsSync(destPath)) { 36 | // new vscode.Position(0, 0) 表示跳转到某个文件的第一行第一列 37 | return new vscode.Location(vscode.Uri.file(destPath), new vscode.Position(0, 0)); 38 | } 39 | } 40 | } 41 | 42 | //test 43 | // if(alg.strInFindLP(line.text, "define")) { 44 | // let destPath = `${workDir}/omi.js`; 45 | // if (fs.existsSync(destPath)) { 46 | // // new vscode.Position(0, 0) 表示跳转到某个文件的第一行第一列 47 | // return new vscode.Location(vscode.Uri.file(destPath), new vscode.Position(0, 0)); 48 | // } 49 | // } 50 | 51 | 52 | } -------------------------------------------------------------------------------- /src/snippets/omi.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /src/snippets/omi.json: -------------------------------------------------------------------------------- 1 | { 2 | "import": { 3 | "prefix": "omi-import", 4 | "body": "import { ${1:define, WeElement, extractClass} } from '${2:omi}'", 5 | "description": "Omi module" 6 | }, 7 | "define": { 8 | "prefix": "omi-define", 9 | "body": [ 10 | "define('${1}', class extends WeElement {", 11 | "\t", 12 | "\trender() {", 13 | "\t\treturn (", 14 | "\t\t\t${2}", 15 | "\t\t)", 16 | "\t}", 17 | "})" 18 | ], 19 | "description": "Omi function struct" 20 | }, 21 | "render": { 22 | "prefix": "omi-render", 23 | "body": [ 24 | "render(${1}) {", 25 | "\treturn (", 26 | "\t\t${2}", 27 | "\t)", 28 | "}" 29 | ], 30 | "description": "Omi function struct" 31 | } 32 | } -------------------------------------------------------------------------------- /src/snippets/omiu.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /src/snippets/snippets-bf/omi.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /src/snippets/snippets-bf/omi.json: -------------------------------------------------------------------------------- 1 | { 2 | "import": { 3 | "prefix": "omi-import", 4 | "body": "import { ${1:define, WeElement, extractClass} } from '${2:omi}'", 5 | "description": "Omi module" 6 | }, 7 | "define": { 8 | "prefix": "omi-define", 9 | "body": [ 10 | "define('${1}', class extends WeElement {", 11 | "\t", 12 | "\trender() {", 13 | "\t\treturn (", 14 | "\t\t\t${2}", 15 | "\t\t)", 16 | "\t}", 17 | "})" 18 | ], 19 | "description": "Omi function struct" 20 | }, 21 | "render": { 22 | "prefix": "omi-render", 23 | "body": [ 24 | "render(${1}) {", 25 | "\treturn (", 26 | "\t\t${2}", 27 | "\t)", 28 | "}" 29 | ], 30 | "description": "Omi function struct" 31 | } 32 | } -------------------------------------------------------------------------------- /src/syntaxes/omi.tmLanguage.json: -------------------------------------------------------------------------------- 1 | { 2 | "scopeName": "source.omi", 3 | "injectionSelector": "L:meta.attribute, L:meta.tag.attributes, L:meta.tag.other.html, L:meta.tag.custom.start.html, L:meta.class, L:meta.tag.any.html, L:meta.tag.structure, L:source.ts", 4 | "patterns": [ 5 | { 6 | "include": "#omi-attributes-js" 7 | }, 8 | { 9 | "include": "#omi-css-one" 10 | }, 11 | { 12 | "include": "#omi-css-two" 13 | }, 14 | { 15 | "include": "#omi-css-three" 16 | } 17 | ], 18 | "repository": { 19 | "omi-attributes-js": { 20 | "contentName": "meta.embedded.omi.attributes.js", 21 | "begin": "(?x)(\\b(?:\\w+\\.)*(?:(\\s*(=)\\s*(\"|\\')))\\s*)(\\[|\\{)", 22 | "end": "((\\]|\\})\\s*)(\"|\\')", 23 | "beginCaptures": { 24 | "4": { 25 | "name": "string.js" 26 | } 27 | }, 28 | "endCaptures": { 29 | "3": { 30 | "name": "string.js" 31 | } 32 | }, 33 | "patterns": [ 34 | { "include": "source.js" } 35 | ] 36 | }, 37 | "omi-css-one": { 38 | "contentName": "meta.embedded.omi.css.one", 39 | "begin": "(?x)\\b(?:\\w+\\.)*(?:(\\s*((css)\\s*(=))\\s*(\"|\\')))", 40 | "end": "(\"|\\')", 41 | "beginCaptures": { 42 | "3": { 43 | "name": "entity.other.attribute-name.html" 44 | }, 45 | "5": { 46 | "name": "string.js" 47 | } 48 | }, 49 | "endCaptures": { 50 | "0": { 51 | "name": "string.js" 52 | } 53 | }, 54 | "patterns": [ 55 | {"include": "source.css"} 56 | ] 57 | }, 58 | "omi-css-two": { 59 | "contentName": "meta.embedded.omi.css.two", 60 | "begin": "(?x)\\b(?:\\w+\\.)*(?:(\\s*((css)\\s*(=))\\s*(`)))", 61 | "end": "(`)", 62 | "beginCaptures": { 63 | "3": { 64 | "name": "variable.object.property.js" 65 | }, 66 | "5": { 67 | "name": "string.js" 68 | } 69 | }, 70 | "endCaptures": { 71 | "0": { 72 | "name": "string.js" 73 | } 74 | }, 75 | "patterns": [ 76 | {"include": "source.css"} 77 | ] 78 | }, 79 | "omi-css-three": { 80 | "contentName": "meta.embedded.omi.css.three", 81 | "begin": "(?x)\\b(?:\\w+\\.)*(?:(\\s*(css)\\s*(=)\\s*({)\\s*(`)))", 82 | "end": "(`)\\s*(})", 83 | "beginCaptures": { 84 | "2": { 85 | "name": "entity.other.attribute-name.html" 86 | }, 87 | "5": { 88 | "name": "string.js" 89 | } 90 | }, 91 | "endCaptures": { 92 | "1": { 93 | "name": "string.js" 94 | } 95 | }, 96 | "patterns": [ 97 | {"include": "source.css"} 98 | ] 99 | } 100 | } 101 | } -------------------------------------------------------------------------------- /src/welcome/omi-welcome/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "extends": ["prettier"], 4 | "plugins": ["prettier"], 5 | "env": { 6 | "browser": true, 7 | "mocha": true, 8 | "node": true, 9 | "es6": true 10 | }, 11 | "parserOptions": { 12 | "ecmaFeatures": { 13 | "modules": true, 14 | "jsx": true 15 | } 16 | }, 17 | "globals": { 18 | "sinon": true, 19 | "expect": true 20 | }, 21 | "rules": { 22 | "prettier/prettier": "error", 23 | "no-cond-assign": 1, 24 | "no-empty": 0, 25 | "no-console": 1, 26 | "semi": [1, "never"], 27 | "camelcase": 0, 28 | "comma-style": 2, 29 | "comma-dangle": [2, "never"], 30 | "indent": ["error", 2], 31 | "no-mixed-spaces-and-tabs": [2, "smart-tabs"], 32 | "no-trailing-spaces": [2, { "skipBlankLines": true }], 33 | "max-nested-callbacks": [2, 3], 34 | "no-eval": 2, 35 | "no-implied-eval": 2, 36 | "no-new-func": 2, 37 | "guard-for-in": 0, 38 | "eqeqeq": 0, 39 | "no-else-return": 2, 40 | "no-redeclare": 2, 41 | "no-dupe-keys": 2, 42 | "radix": 2, 43 | "strict": [2, "never"], 44 | "no-shadow": 0, 45 | "callback-return": [1, ["callback", "cb", "next", "done"]], 46 | "no-delete-var": 2, 47 | "no-undef-init": 2, 48 | "no-shadow-restricted-names": 2, 49 | "handle-callback-err": 0, 50 | "no-lonely-if": 2, 51 | "keyword-spacing": 2, 52 | "constructor-super": 2, 53 | "no-this-before-super": 2, 54 | "no-dupe-class-members": 2, 55 | "no-const-assign": 2, 56 | "prefer-spread": 2, 57 | "no-useless-concat": 2, 58 | "no-var": 2, 59 | "object-shorthand": 2, 60 | "prefer-arrow-callback": 2, 61 | "quotes": [1, "single"] 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/welcome/omi-welcome/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | # /build 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /src/welcome/omi-welcome/README.md: -------------------------------------------------------------------------------- 1 | ## Develop 2 | 3 | ```bash 4 | npm install 5 | npm start 6 | ``` 7 | 8 | ## Release 9 | 10 | ```bash 11 | npm run build 12 | ``` 13 | 14 | ## Eslint + Prettier 15 | 16 | ``` bash 17 | npm run fix 18 | ``` 19 | 20 | ## Directory description 21 | 22 | ``` 23 | ├─ config 24 | ├─ public 25 | ├─ scripts 26 | ├─ src 27 | │ ├─ assets 28 | │ ├─ elements //Store all custom elements 29 | │ ├─ store //Store all this store of pages 30 | │ ├─ admin.js //Entry js of compiler,will build to admin.html 31 | │ └─ index.js //Entry js of compiler,will build to index.html 32 | ``` 33 | 34 | ## Build Scripts 35 | 36 | ```json 37 | "scripts": { 38 | "start": "node scripts/start.js", 39 | "build": "PUBLIC_URL=. node scripts/build.js", 40 | "build-windows": "set PUBLIC_URL=.&& node scripts/build.js", 41 | "fix": "eslint src --fix" 42 | } 43 | ``` 44 | 45 | You can set up the PUBLIC_URL, such as: 46 | 47 | ```bash 48 | ... 49 | "build": "PUBLIC_URL=https://fe.wxpay.oa.com/dv node scripts/build.js", 50 | "build-windows": "set PUBLIC_URL=https://fe.wxpay.oa.com/dv&& node scripts/build.js", 51 | ... 52 | ``` 53 | 54 | ## Switch omi and omio 55 | 56 | Add or remove the alias config in package.json to switch omi and omio: 57 | 58 | ```js 59 | ... 60 | "alias": { 61 | "omi": "omio" 62 | } 63 | ... 64 | ``` 65 | 66 | ## License 67 | 68 | MIT 69 | 70 | -------------------------------------------------------------------------------- /src/welcome/omi-welcome/build/admin.html: -------------------------------------------------------------------------------- 1 | Omi
-------------------------------------------------------------------------------- /src/welcome/omi-welcome/build/asset-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "admin.js": "./static/js/admin.307cac3c.js", 3 | "admin.js.map": "./static/js/admin.307cac3c.js.map", 4 | "index.js": "./static/js/index.56726421.js", 5 | "index.js.map": "./static/js/index.56726421.js.map", 6 | "admin.html": "./admin.html", 7 | "index.html": "./index.html" 8 | } -------------------------------------------------------------------------------- /src/welcome/omi-welcome/build/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/omi-vscode/b639358ef3ffb2309411f7f7507e68743833a6c3/src/welcome/omi-welcome/build/favicon.ico -------------------------------------------------------------------------------- /src/welcome/omi-welcome/build/index.html: -------------------------------------------------------------------------------- 1 | Omi
-------------------------------------------------------------------------------- /src/welcome/omi-welcome/build/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Omi App", 3 | "name": "Omi Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /src/welcome/omi-welcome/config/entry.js: -------------------------------------------------------------------------------- 1 | let fs = require('fs'), 2 | fileList = []; 3 | 4 | 5 | if (typeof String.prototype.endsWith != 'function') { 6 | String.prototype.endsWith = function (suffix) { 7 | return this.indexOf(suffix, this.length - suffix.length) !== -1; 8 | }; 9 | } 10 | 11 | function walk(path) { 12 | let dirList = fs.readdirSync(path); 13 | dirList.forEach(function (item) { 14 | if (!fs.statSync(path + '/' + item).isDirectory()) { 15 | if (item.endsWith('\.js')) { 16 | fileList.push(item.substr(0, item.length - 3)); 17 | } 18 | } else { 19 | //walk(path + '/' + item); 20 | } 21 | }); 22 | } 23 | 24 | walk('./src'); 25 | 26 | 27 | 28 | module.exports = fileList; -------------------------------------------------------------------------------- /src/welcome/omi-welcome/config/jest/cssTransform.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // This is a custom Jest transformer turning style imports into empty objects. 4 | // http://facebook.github.io/jest/docs/en/webpack.html 5 | 6 | module.exports = { 7 | process() { 8 | return 'module.exports = {};'; 9 | }, 10 | getCacheKey() { 11 | // The output is always the same. 12 | return 'cssTransform'; 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /src/welcome/omi-welcome/config/jest/fileTransform.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | 5 | // This is a custom Jest transformer turning file imports into filenames. 6 | // http://facebook.github.io/jest/docs/en/webpack.html 7 | 8 | module.exports = { 9 | process(src, filename) { 10 | return `module.exports = ${JSON.stringify(path.basename(filename))};`; 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /src/welcome/omi-welcome/config/paths.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | const fs = require('fs'); 5 | const url = require('url'); 6 | 7 | // Make sure any symlinks in the project folder are resolved: 8 | // https://github.com/facebookincubator/create-react-app/issues/637 9 | const appDirectory = fs.realpathSync(process.cwd()); 10 | const resolveApp = relativePath => path.resolve(appDirectory, relativePath); 11 | 12 | const envPublicUrl = process.env.PUBLIC_URL; 13 | 14 | function ensureSlash(path, needsSlash) { 15 | const hasSlash = path.endsWith('/'); 16 | if (hasSlash && !needsSlash) { 17 | return path.substr(path, path.length - 1); 18 | } else if (!hasSlash && needsSlash) { 19 | return `${path}/`; 20 | } else { 21 | return path; 22 | } 23 | } 24 | 25 | const getPublicUrl = appPackageJson => 26 | envPublicUrl || require(appPackageJson).homepage; 27 | 28 | // We use `PUBLIC_URL` environment variable or "homepage" field to infer 29 | // "public path" at which the app is served. 30 | // Webpack needs to know it to put the right