├── .browserslistrc
├── src
├── components
│ ├── tinymce
│ │ ├── README.md
│ │ ├── index.js
│ │ ├── example
│ │ │ └── Index.vue
│ │ ├── config.js
│ │ ├── package.json
│ │ └── index.vue
│ ├── parser
│ │ ├── index.js
│ │ ├── README.md
│ │ └── package.json
│ ├── render
│ │ ├── slots
│ │ │ ├── el-button.js
│ │ │ ├── el-input.js
│ │ │ ├── el-select.js
│ │ │ ├── el-radio-group.js
│ │ │ ├── el-checkbox-group.js
│ │ │ └── el-upload.js
│ │ ├── package.json
│ │ └── render.js
│ ├── generator
│ │ ├── ruleTrigger.js
│ │ ├── css.js
│ │ └── drawingDefalut.js
│ └── SvgIcon
│ │ └── index.vue
├── assets
│ └── logo.png
├── icons
│ ├── index.js
│ └── svg
│ │ ├── slider.svg
│ │ ├── switch.svg
│ │ ├── input.svg
│ │ ├── textarea.svg
│ │ ├── time.svg
│ │ ├── row.svg
│ │ ├── table.svg
│ │ ├── checkbox.svg
│ │ ├── radio.svg
│ │ ├── select.svg
│ │ ├── upload.svg
│ │ ├── rate.svg
│ │ ├── password.svg
│ │ ├── rich-text.svg
│ │ ├── date-range.svg
│ │ ├── cascader.svg
│ │ ├── button.svg
│ │ ├── component.svg
│ │ ├── time-range.svg
│ │ ├── number.svg
│ │ ├── date.svg
│ │ └── color.svg
├── views
│ ├── index
│ │ ├── main.js
│ │ ├── App.vue
│ │ ├── CodeTypeDialog.vue
│ │ ├── ResourceDialog.vue
│ │ ├── IconsDialog.vue
│ │ ├── TreeNodeDialog.vue
│ │ └── JsonDrawer.vue
│ └── preview
│ │ └── main.js
├── utils
│ ├── pluginsConfig.js
│ ├── loadTinymce.js
│ ├── loadBeautifier.js
│ ├── loadMonaco.js
│ ├── db.js
│ ├── loadScript.js
│ └── icon.json
├── styles
│ ├── mixin.scss
│ └── index.scss
└── router
│ └── index.js
├── public
├── favicon.ico
├── libs
│ └── monaco-editor
│ │ └── vs
│ │ ├── base
│ │ └── browser
│ │ │ └── ui
│ │ │ └── codicons
│ │ │ └── codicon
│ │ │ └── codicon.ttf
│ │ └── basic-languages
│ │ ├── azcli
│ │ └── azcli.js
│ │ ├── ini
│ │ └── ini.js
│ │ ├── csp
│ │ └── csp.js
│ │ ├── scheme
│ │ └── scheme.js
│ │ ├── sb
│ │ └── sb.js
│ │ ├── bat
│ │ └── bat.js
│ │ ├── dockerfile
│ │ └── dockerfile.js
│ │ ├── pascaligo
│ │ └── pascaligo.js
│ │ ├── cameligo
│ │ └── cameligo.js
│ │ ├── xml
│ │ └── xml.js
│ │ ├── lua
│ │ └── lua.js
│ │ ├── graphql
│ │ └── graphql.js
│ │ ├── objective-c
│ │ └── objective-c.js
│ │ ├── lexon
│ │ └── lexon.js
│ │ ├── mips
│ │ └── mips.js
│ │ ├── go
│ │ └── go.js
│ │ ├── sophia
│ │ └── sophia.js
│ │ ├── m3
│ │ └── m3.js
│ │ ├── shell
│ │ └── shell.js
│ │ ├── java
│ │ └── java.js
│ │ ├── fsharp
│ │ └── fsharp.js
│ │ ├── pascal
│ │ └── pascal.js
│ │ ├── r
│ │ └── r.js
│ │ ├── python
│ │ └── python.js
│ │ ├── powershell
│ │ └── powershell.js
│ │ ├── kotlin
│ │ └── kotlin.js
│ │ ├── yaml
│ │ └── yaml.js
│ │ ├── redis
│ │ └── redis.js
│ │ ├── tcl
│ │ └── tcl.js
│ │ ├── hcl
│ │ └── hcl.js
│ │ ├── coffee
│ │ └── coffee.js
│ │ ├── markdown
│ │ └── markdown.js
│ │ ├── less
│ │ └── less.js
│ │ ├── rust
│ │ └── rust.js
│ │ ├── apex
│ │ └── apex.js
│ │ └── restructuredtext
│ │ └── restructuredtext.js
├── preview.html
└── index.html
├── babel.config.js
├── .editorconfig
├── .gitignore
├── .github
└── workflows
│ └── ci.yml
├── LICENSE
├── .eslintrc.js
├── package.json
├── vue.config.js
└── README.md
/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 |
--------------------------------------------------------------------------------
/src/components/tinymce/README.md:
--------------------------------------------------------------------------------
1 | ## 简介
2 | 富文本编辑器tinymce的一个vue版本封装。使用cdn动态脚本引入的方式加载。
3 |
4 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dynamic-form/form-generator/dev/public/favicon.ico
--------------------------------------------------------------------------------
/src/components/parser/index.js:
--------------------------------------------------------------------------------
1 | import Parser from './Parser'
2 |
3 | export default Parser
4 |
--------------------------------------------------------------------------------
/src/components/tinymce/index.js:
--------------------------------------------------------------------------------
1 | import Index from './index.vue'
2 |
3 | export default Index
4 |
--------------------------------------------------------------------------------
/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dynamic-form/form-generator/dev/src/assets/logo.png
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/src/components/render/slots/el-button.js:
--------------------------------------------------------------------------------
1 | export default {
2 | default(h, conf, key) {
3 | return conf.__slot__[key]
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/public/libs/monaco-editor/vs/base/browser/ui/codicons/codicon/codicon.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dynamic-form/form-generator/dev/public/libs/monaco-editor/vs/base/browser/ui/codicons/codicon/codicon.ttf
--------------------------------------------------------------------------------
/src/components/render/slots/el-input.js:
--------------------------------------------------------------------------------
1 | export default {
2 | prepend(h, conf, key) {
3 | return {conf.__slot__[key]}
4 | },
5 | append(h, conf, key) {
6 | return {conf.__slot__[key]}
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # http://editorconfig.org
2 |
3 | root = true
4 |
5 | [*]
6 | charset = utf-8
7 | indent_style = space
8 | indent_size = 2
9 | end_of_line = lf
10 | insert_final_newline = true
11 | trim_trailing_whitespace = true
12 |
13 | [*.md]
14 | insert_final_newline = false
15 | trim_trailing_whitespace = false
--------------------------------------------------------------------------------
/src/components/render/slots/el-select.js:
--------------------------------------------------------------------------------
1 | export default {
2 | options(h, conf, key) {
3 | const list = []
4 | conf.__slot__.options.forEach(item => {
5 | list.push()
6 | })
7 | return list
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/icons/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import SvgIcon from '@/components/SvgIcon'// svg component
3 |
4 | // register globally
5 | Vue.component('svg-icon', SvgIcon)
6 |
7 | const req = require.context('./svg', false, /\.svg$/)
8 | const requireAll = requireContext => requireContext.keys().map(requireContext)
9 | requireAll(req)
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 | /src/components/parser/lib
5 | /src/components/render/lib
6 | /src/components/tinymce/lib
7 |
8 | # local env files
9 | .env.local
10 | .env.*.local
11 |
12 | # Log files
13 | npm-debug.log*
14 | yarn-debug.log*
15 | yarn-error.log*
16 |
17 | # Editor directories and files
18 | .idea
19 | .vscode
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
26 | .prettierrc
--------------------------------------------------------------------------------
/src/components/generator/ruleTrigger.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 用于生成表单校验,指定正则规则的触发方式。
3 | * 未在此处声明无触发方式的组件将不生成rule!!
4 | */
5 | export default {
6 | 'el-input': 'blur',
7 | 'el-input-number': 'blur',
8 | 'el-select': 'change',
9 | 'el-radio-group': 'change',
10 | 'el-checkbox-group': 'change',
11 | 'el-cascader': 'change',
12 | 'el-time-picker': 'change',
13 | 'el-date-picker': 'change',
14 | 'el-rate': 'change',
15 | tinymce: 'blur'
16 | }
17 |
--------------------------------------------------------------------------------
/src/components/parser/README.md:
--------------------------------------------------------------------------------
1 | ## form-generator JSON 解析器
2 | >用于将form-generator导出的JSON解析成一个表单。
3 |
4 | ### 安装组件
5 | ```
6 | npm i form-gen-parser
7 | ```
8 | 或者
9 | ```
10 | yarn add form-gen-parser
11 | ```
12 |
13 | ### 使用示例
14 | > [查看在线示例](https://mrhj.gitee.io/form-generator/#/parser)
15 |
16 | 示例代码:
17 | > [src\components\parser\example\Index.vue](https://github.com/JakHuang/form-generator/blob/dev/src/components/parser/example/Index.vue)
18 |
--------------------------------------------------------------------------------
/src/views/index/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 | import router from '@/router'
4 | import '@/styles/index.scss'
5 | import '@/icons'
6 | import axios from 'axios'
7 | import Tinymce from '@/components/tinymce/index.vue'
8 |
9 | Vue.component('tinymce', Tinymce)
10 |
11 | Vue.config.productionTip = false
12 | Vue.prototype.$axios = axios
13 |
14 | new Vue({
15 | router,
16 | render: h => h(App)
17 | }).$mount('#app')
18 |
--------------------------------------------------------------------------------
/src/components/render/slots/el-radio-group.js:
--------------------------------------------------------------------------------
1 | export default {
2 | options(h, conf, key) {
3 | const list = []
4 | conf.__slot__.options.forEach(item => {
5 | if (conf.__config__.optionType === 'button') {
6 | list.push({item.label})
7 | } else {
8 | list.push({item.label})
9 | }
10 | })
11 | return list
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/components/render/slots/el-checkbox-group.js:
--------------------------------------------------------------------------------
1 | export default {
2 | options(h, conf, key) {
3 | const list = []
4 | conf.__slot__.options.forEach(item => {
5 | if (conf.__config__.optionType === 'button') {
6 | list.push({item.label})
7 | } else {
8 | list.push({item.label})
9 | }
10 | })
11 | return list
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/views/index/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
23 |
--------------------------------------------------------------------------------
/src/icons/svg/slider.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 |
8 | jobs:
9 | build-and-deploy:
10 |
11 | runs-on: ubuntu-latest
12 |
13 | steps:
14 | - name: Checkout
15 | uses: actions/checkout@v1
16 |
17 | - name: 打包构建
18 | run: |
19 | npm install
20 | npm run build
21 |
22 | - name: 发布
23 | uses: JamesIves/github-pages-deploy-action@releases/v3
24 | with:
25 | ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
26 | BRANCH: gh-pages
27 | FOLDER: dist
28 |
--------------------------------------------------------------------------------
/src/components/render/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "form-gen-render",
3 | "version": "1.0.4",
4 | "description": "表单核心render",
5 | "main": "lib/form-gen-render.umd.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/JakHuang/form-generator.git"
12 | },
13 | "author": "jakhuang",
14 | "license": "MIT",
15 | "bugs": {
16 | "url": "https://github.com/JakHuang/form-generator/issues"
17 | },
18 | "homepage": "https://github.com/JakHuang/form-generator#readme"
19 | }
20 |
--------------------------------------------------------------------------------
/src/components/generator/css.js:
--------------------------------------------------------------------------------
1 | const styles = {
2 | 'el-rate': '.el-rate{display: inline-block; vertical-align: text-top;}',
3 | 'el-upload': '.el-upload__tip{line-height: 1.2;}'
4 | }
5 |
6 | function addCss(cssList, el) {
7 | const css = styles[el.__config__.tag]
8 | css && cssList.indexOf(css) === -1 && cssList.push(css)
9 | if (el.__config__.children) {
10 | el.__config__.children.forEach(el2 => addCss(cssList, el2))
11 | }
12 | }
13 |
14 | export function makeUpCss(conf) {
15 | const cssList = []
16 | conf.fields.forEach(el => addCss(cssList, el))
17 | return cssList.join('\n')
18 | }
19 |
--------------------------------------------------------------------------------
/src/components/render/slots/el-upload.js:
--------------------------------------------------------------------------------
1 | export default {
2 | 'list-type': (h, conf, key) => {
3 | const list = []
4 | const config = conf.__config__
5 | if (conf['list-type'] === 'picture-card') {
6 | list.push()
7 | } else {
8 | list.push({config.buttonText})
9 | }
10 | if (config.showTip) {
11 | list.push(
12 |
只能上传不超过 {config.fileSize}{config.sizeUnit} 的{conf.accept}文件
13 | )
14 | }
15 | return list
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/components/tinymce/example/Index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
39 |
--------------------------------------------------------------------------------
/src/utils/pluginsConfig.js:
--------------------------------------------------------------------------------
1 | const CDN = 'https://lib.baomitu.com/' // CDN Homepage: https://cdn.baomitu.com/
2 | const publicPath = process.env.BASE_URL
3 |
4 | function splicingPluginUrl(PluginName, version, fileName) {
5 | return `${CDN}${PluginName}/${version}/${fileName}`
6 | }
7 |
8 | export default {
9 | beautifierUrl: splicingPluginUrl('js-beautify', '1.13.5', 'beautifier.min.js'),
10 | // monacoEditorUrl: splicingPluginUrl('monaco-editor', '0.19.3', 'min/vs'), // 使用 monaco-editor CDN 链接
11 | monacoEditorUrl: `${publicPath}libs/monaco-editor/vs`, // 使用 monaco-editor 本地代码
12 | tinymceUrl: splicingPluginUrl('tinymce', '5.7.0', 'tinymce.min.js')
13 | }
14 |
--------------------------------------------------------------------------------
/src/icons/svg/switch.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/components/tinymce/config.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable max-len */
2 |
3 | export const plugins = [
4 | 'advlist anchor autolink autosave code codesample directionality emoticons fullscreen hr image imagetools insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textpattern visualblocks visualchars wordcount'
5 | ]
6 | export const toolbar = [
7 | 'code searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote removeformat subscript superscript codesample hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen'
8 | ]
9 |
--------------------------------------------------------------------------------
/src/styles/mixin.scss:
--------------------------------------------------------------------------------
1 | @mixin action-bar {
2 | .action-bar {
3 | height: 33px;
4 | background: #f2fafb;
5 | padding: 0 15px;
6 | box-sizing: border-box;
7 |
8 | .bar-btn {
9 | display: inline-block;
10 | padding: 0 6px;
11 | line-height: 32px;
12 | color: #8285f5;
13 | cursor: pointer;
14 | font-size: 14px;
15 | user-select: none;
16 | & i {
17 | font-size: 20px;
18 | }
19 | &:hover {
20 | color: #4348d4;
21 | }
22 | }
23 | .bar-btn + .bar-btn {
24 | margin-left: 8px;
25 | }
26 | .delete-btn {
27 | color: #f56c6c;
28 | &:hover {
29 | color: #ea0b30;
30 | }
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import VueRouter from 'vue-router'
3 | import Home from '@/views/index/Home.vue'
4 |
5 | Vue.use(VueRouter)
6 |
7 | const routes = [
8 | {
9 | path: '/',
10 | name: 'home',
11 | component: Home
12 | },
13 | {
14 | path: '/parser',
15 | name: 'parser',
16 | component: () => import(/* webpackChunkName: "parser-example" */'@/components/parser/example/Index.vue')
17 | },
18 | {
19 | path: '/tinymce',
20 | name: 'tinymce',
21 | component: () => import(/* webpackChunkName: "tinymce-example" */'@/components/tinymce/example/Index.vue')
22 | }
23 | ]
24 |
25 | const router = new VueRouter({
26 | routes
27 | })
28 |
29 | export default router
30 |
--------------------------------------------------------------------------------
/src/icons/svg/input.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/utils/loadTinymce.js:
--------------------------------------------------------------------------------
1 | import loadScript from './loadScript'
2 | import ELEMENT from 'element-ui'
3 | import pluginsConfig from './pluginsConfig'
4 |
5 | let tinymceObj
6 |
7 | export default function loadTinymce(cb) {
8 | const { tinymceUrl } = pluginsConfig
9 |
10 | if (tinymceObj) {
11 | cb(tinymceObj)
12 | return
13 | }
14 |
15 | const loading = ELEMENT.Loading.service({
16 | fullscreen: true,
17 | lock: true,
18 | text: '富文本资源加载中...',
19 | spinner: 'el-icon-loading',
20 | background: 'rgba(255, 255, 255, 0.5)'
21 | })
22 |
23 | loadScript(tinymceUrl, () => {
24 | loading.close()
25 | // eslint-disable-next-line no-undef
26 | tinymceObj = tinymce
27 | cb(tinymceObj)
28 | })
29 | }
30 |
--------------------------------------------------------------------------------
/src/components/parser/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "form-gen-parser",
3 | "version": "1.0.3",
4 | "description": "表单json解析器",
5 | "main": "lib/form-gen-parser.umd.js",
6 | "directories": {
7 | "example": "example"
8 | },
9 | "scripts": {
10 | "test": "echo \"Error: no test specified\" && exit 1"
11 | },
12 | "repository": {
13 | "type": "git",
14 | "url": "git+https://github.com/JakHuang/form-generator.git"
15 | },
16 | "dependencies": {
17 | "form-gen-render": "^1.0.0"
18 | },
19 | "author": "jakHuang",
20 | "license": "MIT",
21 | "bugs": {
22 | "url": "https://github.com/JakHuang/form-generator/issues"
23 | },
24 | "homepage": "https://github.com/JakHuang/form-generator/blob/dev/src/components/parser"
25 | }
26 |
--------------------------------------------------------------------------------
/src/utils/loadBeautifier.js:
--------------------------------------------------------------------------------
1 | import loadScript from './loadScript'
2 | import ELEMENT from 'element-ui'
3 | import pluginsConfig from './pluginsConfig'
4 |
5 | let beautifierObj
6 |
7 | export default function loadBeautifier(cb) {
8 | const { beautifierUrl } = pluginsConfig
9 | if (beautifierObj) {
10 | cb(beautifierObj)
11 | return
12 | }
13 |
14 | const loading = ELEMENT.Loading.service({
15 | fullscreen: true,
16 | lock: true,
17 | text: '格式化资源加载中...',
18 | spinner: 'el-icon-loading',
19 | background: 'rgba(255, 255, 255, 0.5)'
20 | })
21 |
22 | loadScript(beautifierUrl, () => {
23 | loading.close()
24 | // eslint-disable-next-line no-undef
25 | beautifierObj = beautifier
26 | cb(beautifierObj)
27 | })
28 | }
29 |
--------------------------------------------------------------------------------
/src/icons/svg/textarea.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/icons/svg/time.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/components/tinymce/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "form-gen-tinymce",
3 | "version": "1.0.0",
4 | "description": "富文本编辑器tinymce的一个vue版本封装。使用cdn动态脚本引入的方式加载。",
5 | "main": "lib/form-gen-tinymce.umd.js",
6 | "directories": {
7 | "example": "example"
8 | },
9 | "scripts": {
10 | "test": "echo \"Error: no test specified\" && exit 1"
11 | },
12 | "repository": {
13 | "type": "git",
14 | "url": "git+https://github.com/JakHuang/form-generator.git"
15 | },
16 | "keywords": [
17 | "tinymce-vue"
18 | ],
19 | "dependencies": {
20 | "throttle-debounce": "^2.1.0"
21 | },
22 | "author": "jakHuang",
23 | "license": "MIT",
24 | "bugs": {
25 | "url": "https://github.com/JakHuang/form-generator/issues"
26 | },
27 | "homepage": "https://github.com/JakHuang/form-generator/blob/dev/src/components/tinymce"
28 | }
29 |
--------------------------------------------------------------------------------
/src/icons/svg/row.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/components/generator/drawingDefalut.js:
--------------------------------------------------------------------------------
1 | export default [
2 | {
3 | __config__: {
4 | label: '单行文本',
5 | labelWidth: null,
6 | showLabel: true,
7 | changeTag: true,
8 | tag: 'el-input',
9 | tagIcon: 'input',
10 | defaultValue: undefined,
11 | required: true,
12 | layout: 'colFormItem',
13 | span: 24,
14 | document: 'https://element.eleme.cn/#/zh-CN/component/input',
15 | // 正则校验规则
16 | regList: [{
17 | pattern: '/^1(3|4|5|7|8|9)\\d{9}$/',
18 | message: '手机号格式错误'
19 | }]
20 | },
21 | // 组件的插槽属性
22 | __slot__: {
23 | prepend: '',
24 | append: ''
25 | },
26 | __vModel__: 'mobile',
27 | placeholder: '请输入手机号',
28 | style: { width: '100%' },
29 | clearable: true,
30 | 'prefix-icon': 'el-icon-mobile',
31 | 'suffix-icon': '',
32 | maxlength: 11,
33 | 'show-word-limit': true,
34 | readonly: false,
35 | disabled: false
36 | }
37 | ]
38 |
--------------------------------------------------------------------------------
/src/icons/svg/table.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/utils/loadMonaco.js:
--------------------------------------------------------------------------------
1 | import loadScript from './loadScript'
2 | import ELEMENT from 'element-ui'
3 | import pluginsConfig from './pluginsConfig'
4 |
5 | // monaco-editor单例
6 | let monacoEidtor
7 |
8 | /**
9 | * 动态加载monaco-editor cdn资源
10 | * @param {Function} cb 回调,必填
11 | */
12 | export default function loadMonaco(cb) {
13 | if (monacoEidtor) {
14 | cb(monacoEidtor)
15 | return
16 | }
17 |
18 | const { monacoEditorUrl: vs } = pluginsConfig
19 |
20 | // 使用element ui实现加载提示
21 | const loading = ELEMENT.Loading.service({
22 | fullscreen: true,
23 | lock: true,
24 | text: '编辑器资源初始化中...',
25 | spinner: 'el-icon-loading',
26 | background: 'rgba(255, 255, 255, 0.5)'
27 | })
28 |
29 | !window.require && (window.require = {})
30 | !window.require.paths && (window.require.paths = {})
31 | window.require.paths.vs = vs
32 |
33 | loadScript(`${vs}/loader.js`, () => {
34 | window.require(['vs/editor/editor.main'], () => {
35 | loading.close()
36 | monacoEidtor = window.monaco
37 | cb(monacoEidtor)
38 | })
39 | })
40 | }
41 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 JakHuang
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | node: true
5 | },
6 | extends: ['plugin:vue/recommended', 'eslint:recommended', 'airbnb-base'],
7 | rules: {
8 | 'linebreak-style': 0,
9 | 'no-console': 'off',
10 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
11 | 'vue/no-unused-components': 0,
12 | 'no-unused-vars': 0,
13 | 'import/order': 0,
14 | 'import/extensions': 0,
15 | 'import/no-unresolved': 0,
16 | 'comma-dangle': [2, 'never'],
17 | semi: [2, 'never'],
18 | 'no-unused-expressions': 0,
19 | 'no-plusplus': 0,
20 | 'import/prefer-default-export': 0,
21 | 'no-use-before-define': 0,
22 | 'no-param-reassign': 0,
23 | 'no-underscore-dangle': 0,
24 | 'arrow-parens': [2, 'as-needed'],
25 | 'vue/max-attributes-per-line': 0,
26 | 'max-len': [
27 | 1,
28 | {
29 | code: 120
30 | }
31 | ],
32 | 'no-eval': 0,
33 | 'no-multi-assign': 0,
34 | 'prefer-rest-params': 0,
35 | 'vue/require-prop-types': 0,
36 | 'no-restricted-globals': 0
37 | },
38 | parserOptions: {
39 | parser: 'babel-eslint'
40 | },
41 | globals: {
42 | location: false
43 | }
44 | };
45 |
--------------------------------------------------------------------------------
/src/icons/svg/checkbox.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/libs/monaco-editor/vs/basic-languages/azcli/azcli.js:
--------------------------------------------------------------------------------
1 | /*!-----------------------------------------------------------------------------
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53)
4 | * Released under the MIT license
5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md
6 | *-----------------------------------------------------------------------------*/
7 | define("vs/basic-languages/azcli/azcli",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={comments:{lineComment:"#"}},t.language={defaultToken:"keyword",ignoreCase:!0,tokenPostfix:".azcli",str:/[^#\s]/,tokenizer:{root:[{include:"@comment"},[/\s-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}],[/^-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}]],type:[{include:"@comment"},[/-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":"key.identifier"}}],[/@str+\s*/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}]],comment:[[/#.*$/,{cases:{"@eos":{token:"comment",next:"@popall"}}}]]}}}));
--------------------------------------------------------------------------------
/src/icons/svg/radio.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/icons/svg/select.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/icons/svg/upload.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/libs/monaco-editor/vs/basic-languages/ini/ini.js:
--------------------------------------------------------------------------------
1 | /*!-----------------------------------------------------------------------------
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53)
4 | * Released under the MIT license
5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md
6 | *-----------------------------------------------------------------------------*/
7 | define("vs/basic-languages/ini/ini",["require","exports"],(function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.language=n.conf=void 0,n.conf={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},n.language={defaultToken:"",tokenPostfix:".ini",escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^\[[^\]]*\]/,"metatag"],[/(^\w+)(\s*)(\=)/,["key","","delimiter"]],{include:"@whitespace"},[/\d+/,"number"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],whitespace:[[/[ \t\r\n]+/,""],[/^\s*[#;].*$/,"comment"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}}}));
--------------------------------------------------------------------------------
/public/preview.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | form-generator-preview
9 |
10 |
11 |
12 |
13 |
30 |
31 |
32 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/src/utils/db.js:
--------------------------------------------------------------------------------
1 | const DRAWING_ITEMS = 'drawingItems'
2 | const DRAWING_ITEMS_VERSION = '1.2'
3 | const DRAWING_ITEMS_VERSION_KEY = 'DRAWING_ITEMS_VERSION'
4 | const DRAWING_ID = 'idGlobal'
5 | const TREE_NODE_ID = 'treeNodeId'
6 | const FORM_CONF = 'formConf'
7 |
8 | export function getDrawingList() {
9 | // 加入缓存版本的概念,保证缓存数据与程序匹配
10 | const version = localStorage.getItem(DRAWING_ITEMS_VERSION_KEY)
11 | if (version !== DRAWING_ITEMS_VERSION) {
12 | localStorage.setItem(DRAWING_ITEMS_VERSION_KEY, DRAWING_ITEMS_VERSION)
13 | saveDrawingList([])
14 | return null
15 | }
16 |
17 | const str = localStorage.getItem(DRAWING_ITEMS)
18 | if (str) return JSON.parse(str)
19 | return null
20 | }
21 |
22 | export function saveDrawingList(list) {
23 | localStorage.setItem(DRAWING_ITEMS, JSON.stringify(list))
24 | }
25 |
26 | export function getIdGlobal() {
27 | const str = localStorage.getItem(DRAWING_ID)
28 | if (str) return parseInt(str, 10)
29 | return 100
30 | }
31 |
32 | export function saveIdGlobal(id) {
33 | localStorage.setItem(DRAWING_ID, `${id}`)
34 | }
35 |
36 | export function getTreeNodeId() {
37 | const str = localStorage.getItem(TREE_NODE_ID)
38 | if (str) return parseInt(str, 10)
39 | return 100
40 | }
41 |
42 | export function saveTreeNodeId(id) {
43 | localStorage.setItem(TREE_NODE_ID, `${id}`)
44 | }
45 |
46 | export function getFormConf() {
47 | const str = localStorage.getItem(FORM_CONF)
48 | if (str) return JSON.parse(str)
49 | return null
50 | }
51 |
52 | export function saveFormConf(obj) {
53 | localStorage.setItem(FORM_CONF, JSON.stringify(obj))
54 | }
55 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "form-generator",
3 | "version": "0.2.0",
4 | "private": true,
5 | "scripts": {
6 | "build": "vue-cli-service build",
7 | "build:report": "vue-cli-service build --report",
8 | "build:render": "vue-cli-service build --target lib --name form-gen-render --dest ./src/components/render/lib/ ./src/components/render/render.js",
9 | "build:parser": "vue-cli-service build --target lib --name form-gen-parser --dest ./src/components/parser/lib/ ./src/components/parser/index.js",
10 | "build:tinymce": "vue-cli-service build --target lib --name form-gen-tinymce --dest ./src/components/tinymce/lib/ ./src/components/tinymce/index.js",
11 | "lint": "vue-cli-service lint",
12 | "dev": "vue-cli-service serve"
13 | },
14 | "dependencies": {
15 | "@babel/parser": "^7.7.4",
16 | "axios": "^0.19.2",
17 | "clipboard": "^2.0.4",
18 | "core-js": "^3.6.5",
19 | "file-saver": "^2.0.2",
20 | "throttle-debounce": "^2.1.0",
21 | "vue": "^2.6.11",
22 | "vuedraggable": "^2.23.2"
23 | },
24 | "devDependencies": {
25 | "@vue/cli-plugin-babel": "~4.4.0",
26 | "@vue/cli-plugin-eslint": "~4.4.0",
27 | "@vue/cli-service": "~4.4.0",
28 | "babel-eslint": "^10.1.0",
29 | "eslint": "^6.8.0",
30 | "eslint-config-airbnb-base": "^14.0.0",
31 | "eslint-plugin-import": "^2.20.0",
32 | "eslint-plugin-vue": "^6.2.2",
33 | "sass": "^1.23.7",
34 | "sass-loader": "^8.0.0",
35 | "svg-sprite-loader": "^4.1.6",
36 | "vue-template-compiler": "^2.6.11"
37 | },
38 | "homepage": "https://jakhuang.github.io/form-generator"
39 | }
40 |
--------------------------------------------------------------------------------
/src/icons/svg/rate.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/components/SvgIcon/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
8 |
16 |
17 |
18 |
58 |
59 |
74 |
--------------------------------------------------------------------------------
/src/utils/loadScript.js:
--------------------------------------------------------------------------------
1 | const callbacks = {}
2 |
3 | /**
4 | * 加载一个远程脚本
5 | * @param {String} src 一个远程脚本
6 | * @param {Function} callback 回调
7 | */
8 | function loadScript(src, callback) {
9 | const existingScript = document.getElementById(src)
10 | const cb = callback || (() => {})
11 | if (!existingScript) {
12 | callbacks[src] = []
13 | const $script = document.createElement('script')
14 | $script.src = src
15 | $script.id = src
16 | $script.async = 1
17 | document.body.appendChild($script)
18 | const onEnd = 'onload' in $script ? stdOnEnd.bind($script) : ieOnEnd.bind($script)
19 | onEnd($script)
20 | }
21 |
22 | callbacks[src].push(cb)
23 |
24 | function stdOnEnd(script) {
25 | script.onload = () => {
26 | this.onerror = this.onload = null
27 | callbacks[src].forEach(item => {
28 | item(null, script)
29 | })
30 | delete callbacks[src]
31 | }
32 | script.onerror = () => {
33 | this.onerror = this.onload = null
34 | cb(new Error(`Failed to load ${src}`), script)
35 | }
36 | }
37 |
38 | function ieOnEnd(script) {
39 | script.onreadystatechange = () => {
40 | if (this.readyState !== 'complete' && this.readyState !== 'loaded') return
41 | this.onreadystatechange = null
42 | callbacks[src].forEach(item => {
43 | item(null, script)
44 | })
45 | delete callbacks[src]
46 | }
47 | }
48 | }
49 |
50 | /**
51 | * 顺序加载一组远程脚本
52 | * @param {Array} list 一组远程脚本
53 | * @param {Function} cb 回调
54 | */
55 | export function loadScriptQueue(list, cb) {
56 | const first = list.shift()
57 | list.length ? loadScript(first, () => loadScriptQueue(list, cb)) : loadScript(first, cb)
58 | }
59 |
60 | export default loadScript
61 |
--------------------------------------------------------------------------------
/src/views/preview/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import { loadScriptQueue } from '@/utils/loadScript'
3 | import axios from 'axios'
4 | import Tinymce from '@/components/tinymce/index.vue'
5 |
6 | Vue.component('tinymce', Tinymce)
7 | Vue.prototype.$axios = axios
8 |
9 | const $previewApp = document.getElementById('previewApp')
10 | const childAttrs = {
11 | file: '',
12 | dialog: ' width="600px" class="dialog-width" v-if="visible" :visible.sync="visible" :modal-append-to-body="false" '
13 | }
14 |
15 | window.addEventListener('message', init, false)
16 |
17 | function buildLinks(links) {
18 | let strs = ''
19 | links.forEach(url => {
20 | strs += ``
21 | })
22 | return strs
23 | }
24 |
25 | function init(event) {
26 | if (event.data.type === 'refreshFrame') {
27 | const code = event.data.data
28 | const attrs = childAttrs[code.generateConf.type]
29 | let links = ''
30 |
31 | if (Array.isArray(code.links) && code.links.length > 0) {
32 | links = buildLinks(code.links)
33 | }
34 |
35 | $previewApp.innerHTML = `${links}`
36 |
37 | if (Array.isArray(code.scripts) && code.scripts.length > 0) {
38 | loadScriptQueue(code.scripts, () => {
39 | newVue(attrs, code.js, code.html)
40 | })
41 | } else {
42 | newVue(attrs, code.js, code.html)
43 | }
44 | }
45 | }
46 |
47 | function newVue(attrs, main, html) {
48 | main = eval(`(${main})`)
49 | main.template = `${html}
`
50 | new Vue({
51 | components: {
52 | child: main
53 | },
54 | data() {
55 | return {
56 | visible: true
57 | }
58 | },
59 | template: `
`
60 | }).$mount('#app')
61 | }
62 |
--------------------------------------------------------------------------------
/vue.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path')
2 |
3 | const minify = process.env.NODE_ENV === 'development' ? false : {
4 | collapseWhitespace: true,
5 | removeComments: true,
6 | removeRedundantAttributes: true,
7 | removeScriptTypeAttributes: true,
8 | removeStyleLinkTypeAttributes: true,
9 | useShortDoctype: true,
10 | minifyCSS: true,
11 | minifyJS: true
12 | }
13 |
14 | function resolve(dir) {
15 | return path.join(__dirname, dir)
16 | }
17 |
18 | module.exports = {
19 | publicPath: process.env.NODE_ENV === 'production'
20 | ? '/form-generator/'
21 | : '/',
22 | pages: {
23 | index: {
24 | entry: 'src/views/index/main.js',
25 | template: 'public/index.html',
26 | filename: 'index.html',
27 | chunks: ['chunk-vendors', 'chunk-common', 'index'],
28 | minify
29 | },
30 | preview: {
31 | entry: 'src/views/preview/main.js',
32 | template: 'public/preview.html',
33 | filename: 'preview.html',
34 | chunks: ['chunk-vendors', 'chunk-common', 'preview'],
35 | minify
36 | }
37 | },
38 | devServer: {
39 | overlay: false
40 | },
41 | productionSourceMap: false,
42 | configureWebpack: {
43 | externals: {
44 | vue: 'Vue',
45 | 'vue-router': 'VueRouter',
46 | 'element-ui': 'ELEMENT'
47 | }
48 | },
49 | chainWebpack(config) {
50 | // set svg-sprite-loader
51 | config.module
52 | .rule('svg')
53 | .exclude.add(resolve('src/icons'))
54 | .end()
55 | config.module
56 | .rule('icons')
57 | .test(/\.svg$/)
58 | .include.add(resolve('src/icons'))
59 | .end()
60 | .use('svg-sprite-loader')
61 | .loader('svg-sprite-loader')
62 | .options({
63 | symbolId: 'icon-[name]'
64 | })
65 | .end()
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/public/libs/monaco-editor/vs/basic-languages/csp/csp.js:
--------------------------------------------------------------------------------
1 | /*!-----------------------------------------------------------------------------
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53)
4 | * Released under the MIT license
5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md
6 | *-----------------------------------------------------------------------------*/
7 | define("vs/basic-languages/csp/csp",["require","exports"],(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.language=e.conf=void 0,e.conf={brackets:[],autoClosingPairs:[],surroundingPairs:[]},e.language={keywords:[],typeKeywords:[],tokenPostfix:".csp",operators:[],symbols:/[=>
--------------------------------------------------------------------------------
/src/icons/svg/rich-text.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/icons/svg/date-range.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/libs/monaco-editor/vs/basic-languages/scheme/scheme.js:
--------------------------------------------------------------------------------
1 | /*!-----------------------------------------------------------------------------
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53)
4 | * Released under the MIT license
5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md
6 | *-----------------------------------------------------------------------------*/
7 | define("vs/basic-languages/scheme/scheme",["require","exports"],(function(e,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.language=o.conf=void 0,o.conf={comments:{lineComment:";",blockComment:["#|","|#"]},brackets:[["(",")"],["{","}"],["[","]"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}]},o.language={defaultToken:"",ignoreCase:!0,tokenPostfix:".scheme",brackets:[{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"}],keywords:["case","do","let","loop","if","else","when","cons","car","cdr","cond","lambda","lambda*","syntax-rules","format","set!","quote","eval","append","list","list?","member?","load"],constants:["#t","#f"],operators:["eq?","eqv?","equal?","and","or","not","null?"],tokenizer:{root:[[/#[xXoObB][0-9a-fA-F]+/,"number.hex"],[/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?/,"number.float"],[/(?:\b(?:(define|define-syntax|define-macro))\b)(\s+)((?:\w|\-|\!|\?)*)/,["keyword","white","variable"]],{include:"@whitespace"},{include:"@strings"},[/[a-zA-Z_#][a-zA-Z0-9_\-\?\!\*]*/,{cases:{"@keywords":"keyword","@constants":"constant","@operators":"operators","@default":"identifier"}}]],comment:[[/[^\|#]+/,"comment"],[/#\|/,"comment","@push"],[/\|#/,"comment","@pop"],[/[\|#]/,"comment"]],whitespace:[[/[ \t\r\n]+/,"white"],[/#\|/,"comment","@comment"],[/;.*$/,"comment"]],strings:[[/"$/,"string","@popall"],[/"(?=.)/,"string","@multiLineString"]],multiLineString:[[/[^\\"]+$/,"string","@popall"],[/[^\\"]+/,"string"],[/\\./,"string.escape"],[/"/,"string","@popall"],[/\\$/,"string"]]}}}));
--------------------------------------------------------------------------------
/src/icons/svg/cascader.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/libs/monaco-editor/vs/basic-languages/sb/sb.js:
--------------------------------------------------------------------------------
1 | /*!-----------------------------------------------------------------------------
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53)
4 | * Released under the MIT license
5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md
6 | *-----------------------------------------------------------------------------*/
7 | define("vs/basic-languages/sb/sb",["require","exports"],(function(e,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.language=o.conf=void 0,o.conf={comments:{lineComment:"'"},brackets:[["(",")"],["[","]"],["If","EndIf"],["While","EndWhile"],["For","EndFor"],["Sub","EndSub"]],autoClosingPairs:[{open:'"',close:'"',notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]}]},o.language={defaultToken:"",tokenPostfix:".sb",ignoreCase:!0,brackets:[{token:"delimiter.array",open:"[",close:"]"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"keyword.tag-if",open:"If",close:"EndIf"},{token:"keyword.tag-while",open:"While",close:"EndWhile"},{token:"keyword.tag-for",open:"For",close:"EndFor"},{token:"keyword.tag-sub",open:"Sub",close:"EndSub"}],keywords:["Else","ElseIf","EndFor","EndIf","EndSub","EndWhile","For","Goto","If","Step","Sub","Then","To","While"],tagwords:["If","Sub","While","For"],operators:[">","<","<>","<=",">=","And","Or","+","-","*","/","="],identifier:/[a-zA-Z_][\w]*/,symbols:/[=><:+\-*\/%\.,]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[{include:"@whitespace"},[/(@identifier)(?=[.])/,"type"],[/@identifier/,{cases:{"@keywords":{token:"keyword.$0"},"@operators":"operator","@default":"variable.name"}}],[/([.])(@identifier)/,{cases:{$2:["delimiter","type.member"],"@default":""}}],[/\d*\.\d+/,"number.float"],[/\d+/,"number"],[/[()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@operators":"operator","@default":"delimiter"}}],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"]],whitespace:[[/[ \t\r\n]+/,""],[/(\').*$/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"C?/,"string","@pop"]]}}}));
--------------------------------------------------------------------------------
/public/libs/monaco-editor/vs/basic-languages/bat/bat.js:
--------------------------------------------------------------------------------
1 | /*!-----------------------------------------------------------------------------
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53)
4 | * Released under the MIT license
5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md
6 | *-----------------------------------------------------------------------------*/
7 | define("vs/basic-languages/bat/bat",["require","exports"],(function(e,s){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.language=s.conf=void 0,s.conf={comments:{lineComment:"REM"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*(::\\s*|REM\\s+)#region"),end:new RegExp("^\\s*(::\\s*|REM\\s+)#endregion")}}},s.language={defaultToken:"",ignoreCase:!0,tokenPostfix:".bat",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:/call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,symbols:/[=>
--------------------------------------------------------------------------------
/src/icons/svg/component.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/libs/monaco-editor/vs/basic-languages/pascaligo/pascaligo.js:
--------------------------------------------------------------------------------
1 | /*!-----------------------------------------------------------------------------
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53)
4 | * Released under the MIT license
5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md
6 | *-----------------------------------------------------------------------------*/
7 | define("vs/basic-languages/pascaligo/pascaligo",["require","exports"],(function(e,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.language=o.conf=void 0,o.conf={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"],["<",">"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"}]},o.language={defaultToken:"",tokenPostfix:".pascaligo",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["begin","block","case","const","else","end","fail","for","from","function","if","is","nil","of","remove","return","skip","then","type","var","while","with","option","None","transaction"],typeKeywords:["bool","int","list","map","nat","record","string","unit","address","map","mtz","xtz"],operators:["=",">","<","<=",">=","<>",":",":=","and","mod","or","+","-","*","/","@","&","^","%"],symbols:/[=><:@\^&|+\-*\/\^%]+/,tokenizer:{root:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\$[0-9a-fA-F]{1,16}/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'/,"string","@string"],[/'[^\\']'/,"string"],[/'/,"string.invalid"],[/\#\d+/,"string"]],comment:[[/[^\(\*]+/,"comment"],[/\*\)/,"comment","@pop"],[/\(\*/,"comment"]],string:[[/[^\\']+/,"string"],[/\\./,"string.escape.invalid"],[/'/,{token:"string.quote",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,"white"],[/\(\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}}}));
--------------------------------------------------------------------------------
/public/libs/monaco-editor/vs/basic-languages/cameligo/cameligo.js:
--------------------------------------------------------------------------------
1 | /*!-----------------------------------------------------------------------------
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53)
4 | * Released under the MIT license
5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md
6 | *-----------------------------------------------------------------------------*/
7 | define("vs/basic-languages/cameligo/cameligo",["require","exports"],(function(e,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.language=o.conf=void 0,o.conf={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"],["<",">"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"}]},o.language={defaultToken:"",tokenPostfix:".cameligo",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["abs","begin","Bytes","Crypto","Current","else","end","failwith","false","fun","if","in","let","let%entry","let%init","List","list","Map","map","match","match%nat","mod","not","operation","Operation","of","Set","set","sender","source","String","then","true","type","with"],typeKeywords:["int","unit","string","tz"],operators:["=",">","<","<=",">=","<>",":",":=","and","mod","or","+","-","*","/","@","&","^","%","->","<-"],symbols:/[=><:@\^&|+\-*\/\^%]+/,tokenizer:{root:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\$[0-9a-fA-F]{1,16}/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'/,"string","@string"],[/'[^\\']'/,"string"],[/'/,"string.invalid"],[/\#\d+/,"string"]],comment:[[/[^\(\*]+/,"comment"],[/\*\)/,"comment","@pop"],[/\(\*/,"comment"]],string:[[/[^\\']+/,"string"],[/\\./,"string.escape.invalid"],[/'/,{token:"string.quote",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,"white"],[/\(\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}}}));
--------------------------------------------------------------------------------
/public/libs/monaco-editor/vs/basic-languages/xml/xml.js:
--------------------------------------------------------------------------------
1 | /*!-----------------------------------------------------------------------------
2 | * Copyright (c) Microsoft Corporation. All rights reserved.
3 | * monaco-languages version: 2.3.0(57af10ae0184db4e0f7f9a92ff972629c39ccb53)
4 | * Released under the MIT license
5 | * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md
6 | *-----------------------------------------------------------------------------*/
7 | define("vs/basic-languages/xml/xml",["require","exports","../fillers/monaco-editor-core"],(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.conf=void 0,t.conf={comments:{blockComment:["\x3c!--","--\x3e"]},brackets:[["<",">"]],autoClosingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],surroundingPairs:[{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],onEnterRules:[{beforeText:new RegExp("<([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$","i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:n.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp("<(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$","i"),action:{indentAction:n.languages.IndentAction.Indent}}]},t.language={defaultToken:"",tokenPostfix:".xml",ignoreCase:!0,qualifiedName:/(?:[\w\.\-]+:)?[\w\.\-]+/,tokenizer:{root:[[/[^<&]+/,""],{include:"@whitespace"},[/(<)(@qualifiedName)/,[{token:"delimiter"},{token:"tag",next:"@tag"}]],[/(<\/)(@qualifiedName)(\s*)(>)/,[{token:"delimiter"},{token:"tag"},"",{token:"delimiter"}]],[/(<\?)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/(<\!)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/<\!\[CDATA\[/,{token:"delimiter.cdata",next:"@cdata"}],[/&\w+;/,"string.escape"]],cdata:[[/[^\]]+/,""],[/\]\]>/,{token:"delimiter.cdata",next:"@pop"}],[/\]/,""]],tag:[[/[ \t\r\n]+/,""],[/(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/,["attribute.name","","attribute.value"]],[/@qualifiedName/,"attribute.name"],[/\?>/,{token:"delimiter",next:"@pop"}],[/(\/)(>)/,[{token:"tag"},{token:"delimiter",next:"@pop"}]],[/>/,{token:"delimiter",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[//,{token:"comment",next:"@pop"}],[//,"comment","@pop"],[/