Skip to content

Commit

Permalink
git init
Browse files Browse the repository at this point in the history
  • Loading branch information
maxueming committed Jan 5, 2023
0 parents commit 7a753d7
Show file tree
Hide file tree
Showing 47 changed files with 3,606 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": [
[
"@babel/preset-env", {
"modules": false
}
]
]
}
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/lib/
/dist/
/examples/
/node_modules/
30 changes: 30 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: ['standard'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
rules: {
// 参数后面不允许任何空格
'space-before-function-paren': ['error', 'never'],
// 尾随逗号
'comma-dangle': ['error', 'always-multiline'],
// 禁止在声明前调用 (方法除外)
'no-use-before-define': ['error', { functions: false, classes: true, variables: true }],
// 允许使用中括号来访问变量
'dot-notation': 'off',
// 允许转义字符
'no-useless-escape': 'off',
// 允许 new 不赋值
'no-new': 'off',
// 允许使用 eval
'no-eval': 'off',
},
}
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.DS_Store
node_modules
yarn.lock
package-lock.json
dist

# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

es-module-shims.js
1 change: 1 addition & 0 deletions .nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_sidebar.md
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019-2022 Li Dong Qi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Empty file added README.md
Empty file.
18 changes: 18 additions & 0 deletions _sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

- [**Home & 首页**](/)

- **Usage & 使用**
- [ - 在 javascript 中使用](/docs/usage)
- [ - 在 docsify 中使用](/docs/usage-docsify)
- [ - 在 vuepress 中使用](/docs/usage-vuepress)

- [**Options & 配置选项**](/docs/options)

- **Examples & 示例**
- [ - HTML 模板](/docs/html)
- [ - ~~Vue SFC~~ (内测中)](/docs/vue)
- [ - ~~React SFC~~ (内测中)](/docs/react)

- [**历史更新 & History**](/docs/history)

<!-- - [**测试页**](/docs/test) -->
85 changes: 85 additions & 0 deletions demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mini Sandbox</title>
</head>
<body style="opacity: 1;">
<style>
</style>
<style>
body {
position: relative;
height: 100%;
overflow: hidden;
margin: 0;
}
#my-sandbox {
box-shadow: 0.8rem 0.8rem 1.4rem #c8d0e7,
-0.2rem -0.2rem 1.8rem #dddfea;
width: 100vw;
height: 100vh;
/* border: 2px solid rgb(19, 121, 255); */
border-radius: 5px;
box-sizing: border-box;
}
</style>
<div id="my-sandbox"></div>

<script src="https://unpkg.com/mini-sandbox@0.3.11"></script>

<!-- <script src="./dist/index.umd.js"></script> -->
<!-- <script src="./dist/vue-loader.js"></script> -->
<!-- <script src="./dist/react-loader.js"></script> -->
<script>
var mp = new MiniSandbox({
el: '#my-sandbox',
files: {
'index.html': {
urlField: 'code',
defaultValue: `<style>
button {
color: red;
}
</style>
<button>测试</button>
<script>
const btn = document.querySelector('button')
btn.addEventListener('click', () => {
alert('click 事件')
})
<\/script>`,
},
// 'app.js': {
// module: 'esm',
// defaultValue: `import { getTime } from './utils.js'

// const dom = document.querySelector('.box')
// setInterval(() => {
// dom.innerHTML = '当前时间: ' + getTime()
// }, 1000 / 60)`
// },
// 'utils.js': {
// module: 'esm',
// defaultValue: `const fill = str => ('0' + str).slice(-2)

// export const getTime = (x, y) => {
// const dt = new Date()
// const h = dt.getHours()
// const m = dt.getMinutes()
// const s = dt.getSeconds()
// return \`\${fill(h)}\:\${fill(m)}:\${fill(s)}\`
// }`
// }
},
defaultConfig: {
height: '100vh',
}
})
</script>
</body>
</html>
Binary file added docs/MONACO.TTF
Binary file not shown.
16 changes: 16 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Headline

> An awesome project.


```html
asd
```

876

```html

123
```
1 change: 1 addition & 0 deletions docs/docsify.js

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions docs/history.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

- **`v0.3.14`**
- [x] 新增 `publicConfig.head` 用于在 `<head>` 中设置标签

- **`v0.3.12`**
- [x] 修复切换页面时样式错乱的问题

- **`v0.3.11`**
- [x] 优化 es module 模块缓存问题

- **`v0.3.7`**
- [x] 新增上下 / 左右布局自由切换
- [x] 新增 esm 模块支持按相对路径引入
- [x] 新增 `defaultConfig.toolbar` 属性, 控制工具栏的渲染

- **`v0.3.6`**
- [x] 优化 React SFC 的 CDN 缓存问题

- **`v0.3.5`**
- [x] React SFC 用 `export default` 包装, 隐藏 `ReactDOM.render`
- [x] `editorWidth` 属性改为 `editorRange` 效果不变

- **`v0.3.4`**
- [x] React SFC 单文件组件增加 import 模式

- **`v0.3.3`**
- [x] 修复相同静态资源未能缓存的问题

- **`v0.3.2`**
- [x] 增加对 ES Module 模块的支持
- [x] 修复 docsify-plugin 正则匹配意外换行的问题

- **`v0.3.1`**
- [x] 针对不同语言增加对应的高亮

- **`v0.3.0`**
- [x] 增加 react-loader 用于解析 React 组件
- [x] 增加 docsify-plugin 混合代码块匹配
- [x] 修复 docsify-plugin 反引号打断匹配的问题

- **`v0.2.9`**
- [x] 修复 html-loader 的脚本渲染顺序错误的问题

- **`v0.2.6`**
- [x] 增加多标签页模式, 并实现代码联动

- **`v0.2.4`**
- [x] 增加 vue-loader 用于解析 Vue 组件

- **`v0.2.2`**
- [x] 增加 docsify-plugin

...
Loading

0 comments on commit 7a753d7

Please sign in to comment.