oipage 1.8.2 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG CHANGED
@@ -173,4 +173,11 @@ v1.8.2:
173
173
  date:2026-02-07
174
174
  changes:
175
175
  - 修复bug
176
- 1、修复oipage-cli disk --delempty 命令错误
176
+ 1、修复oipage-cli disk --delempty 命令错误
177
+ v1.9.0:
178
+ date:2026-03-04
179
+ changes:
180
+ - 优化改造
181
+ 1、调整打包若干细节
182
+ 2、针对应用市场优化UI设计
183
+ 3、优化oipage-cli disk --delempty 命令路径不存在时提示
@@ -1,8 +1,18 @@
1
- const { readdirSync, lstatSync, rmdirSync } = require("fs");
1
+ const { readdirSync, lstatSync, rmdirSync, existsSync } = require("fs");
2
2
  const { join } = require("path");
3
3
 
4
4
  module.exports = function (rootPath) {
5
- (function deleteEmptyFolder(folderPath) {
5
+
6
+ // 命令地方已经确保是全路径
7
+ // rootPath = path.resolve(rootPath);
8
+
9
+ // 路径不存在,什么也不用干
10
+ if (!existsSync(rootPath)) {
11
+ console.log("路径不存在:\x1b[31m" + rootPath + "\x1b[0m");
12
+ return;
13
+ }
14
+
15
+ ; (function deleteEmptyFolder(folderPath) {
6
16
  let subItems = readdirSync(folderPath);
7
17
  if (subItems.length > 0) {
8
18
  for (let i = 0; i < subItems.length; i++) {
@@ -2,7 +2,8 @@
2
2
  <h2 class="title" z-bind="_props.title"></h2>
3
3
  <div class="tips" z-bind="_props.tips"></div>
4
4
  <div class="file">
5
- <input type="file" multiple id="input" z-on:change.stop="doChange" z-bind:accept="accept" />
5
+ <input type="file" :multiple="_props.multiple?'multiple':'none'" id="input" z-on:change.stop="doChange"
6
+ z-bind:accept="accept" />
6
7
  <label for="input" z-bind="'选择'+_props.type+'文件'"></label>
7
8
  </div>
8
9
  </div>
@@ -18,12 +18,17 @@ export default defineElement({
18
18
  type: String,
19
19
  required: true,
20
20
  },
21
+ multiple: {
22
+ type: Boolean,
23
+ default: true
24
+ }
21
25
  },
22
26
  data() {
23
27
  return {
24
28
  accept: {
25
29
  pdf: "application/pdf",
26
- image: "image/*"
30
+ image: "image/*",
31
+ video: "video/*",
27
32
  }[this._props.type]
28
33
  };
29
34
  },
@@ -1,74 +1,72 @@
1
1
  .chart-view {
2
- &>.content {
3
- position: fixed;
4
- width: 350px;
5
- height: calc(100% - 150px);
6
- border: 2px solid #000000;
7
- left: 50%;
8
- top: 100px;
9
- transform: translateX(-50%);
10
- padding: 5px;
11
- overflow: auto;
12
- border-radius: 10px 10px 0 0;
2
+ padding: 20px 12px 90px;
3
+ box-sizing: border-box;
13
4
 
14
- &::-webkit-scrollbar {
15
- width: 0;
16
- height: 0;
17
- }
5
+ .content {
6
+ margin: 0 auto 12px;
7
+ max-width: 720px;
8
+ height: calc(100vh - 200px);
9
+ background: #ffffff;
10
+ border-radius: 12px;
11
+ padding: 12px;
12
+ overflow: auto;
13
+ box-shadow: 0 8px 20px rgba(15,23,42,0.06);
14
+ }
18
15
 
19
- &>.item {
20
- display: flex;
21
- padding: 5px;
16
+ .content::-webkit-scrollbar { width: 8px; }
17
+ .content::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 8px; }
22
18
 
23
- &[tag="sender"] {
24
- flex-direction: row-reverse;
25
- padding-left: 50px;
26
- }
19
+ .item {
20
+ display: flex;
21
+ margin: 8px 0;
22
+ width: 100%;
23
+ justify-content: flex-start;
24
+ }
27
25
 
28
- &[tag="receiver"] {
29
- flex-direction: row;
30
- padding-right: 50px;
31
- }
26
+ .item[tag="sender"] { justify-content: flex-end; }
32
27
 
33
- &>.text {
34
- background-color: #dfdbdb;
35
- padding: 5px;
36
- width: fit-content;
37
- border-radius: 5px;
38
- font-size: 12px;
39
- }
40
- }
28
+ .item .text {
29
+ background-color: #eef2ff;
30
+ padding: 8px 12px;
31
+ max-width: 68%;
32
+ border-radius: 12px;
33
+ font-size: 14px;
34
+ word-break: break-word;
41
35
  }
42
36
 
43
- &>.input {
37
+ .item[tag="sender"] .text { background-color: #dcfce7; }
38
+
39
+ .input {
44
40
  position: fixed;
45
- width: 350px;
46
- height: 30px;
47
41
  left: 50%;
48
- bottom: 50px;
49
42
  transform: translateX(-50%);
43
+ bottom: 18px;
44
+ width: calc(100% - 32px);
45
+ max-width: 720px;
50
46
  display: flex;
47
+ gap: 8px;
48
+ background: transparent;
49
+ }
51
50
 
52
- &>input {
53
- flex-grow: 1;
54
- resize: none;
55
- outline: none;
56
- border: 2px solid #000000;
57
- border-top-width: 0;
58
- border-radius: 0;
59
- }
51
+ .input > input {
52
+ flex: 1;
53
+ border: 1px solid #e6e9ee;
54
+ border-radius: 10px;
55
+ padding: 8px 12px;
56
+ box-sizing: border-box;
57
+ }
60
58
 
61
- &>button {
62
- width: 70px;
63
- cursor: pointer;
64
- background-color: #000000;
65
- color: white;
66
- outline: none;
67
- border: none;
59
+ .input > button {
60
+ width: 84px;
61
+ border-radius: 10px;
62
+ background: #111827;
63
+ color: #fff;
64
+ border: none;
65
+ }
68
66
 
69
- &:hover {
70
- text-decoration: underline;
71
- }
72
- }
67
+ @media (max-width: 480px) {
68
+ .content { height: calc(100vh - 180px); padding: 10px; }
69
+ .item .text { max-width: 78%; font-size: 13px; }
70
+ .input { width: calc(100% - 24px); bottom: 12px; }
73
71
  }
74
72
  }
@@ -1,22 +1,16 @@
1
1
  <div class="home-view">
2
- <ul>
3
- <li z-on:click.prevent="goto" tag="chart">
4
- <img src="./images/chart.png" />
5
- <h2>
6
- 群聊天
7
- </h2>
2
+ <ul role="list" class="home-list">
3
+ <li role="listitem" z-on:click.prevent="goto" tag="chart">
4
+ <img src="./images/chart.png" alt="群聊天" />
5
+ <h2>群聊天</h2>
8
6
  </li>
9
- <li z-on:click="goto" tag="image-editor">
10
- <img src="./images/image-editor.png" />
11
- <h2>
12
- 图片编辑器
13
- </h2>
7
+ <li role="listitem" z-on:click="goto" tag="image-editor">
8
+ <img src="./images/image-editor.png" alt="图片编辑器" />
9
+ <h2>图片编辑器</h2>
14
10
  </li>
15
- <li z-on:click="goto" tag="img-to-pdf">
16
- <img src="./images/img-to-pdf.svg" />
17
- <h2>
18
- 图片转PDF
19
- </h2>
11
+ <li role="listitem" z-on:click="goto" tag="img-to-pdf">
12
+ <img src="./images/img-to-pdf.svg" alt="图片转PDF" />
13
+ <h2>图片转PDF</h2>
20
14
  </li>
21
15
  </ul>
22
16
  </div>
@@ -1,28 +1,87 @@
1
1
  .home-view {
2
+ max-width: 1100px;
3
+ margin: 0 auto;
4
+ padding: 24px 16px;
5
+ box-sizing: border-box;
6
+
2
7
  ul {
3
- text-align: left;
4
- padding: 20px 10px;
5
-
6
- &>li {
7
- text-align: center;
8
- display: inline-block;
9
- margin: 10px;
10
- width: 90px;
11
-
12
- &:hover {
13
- text-decoration: underline;
14
- cursor: pointer;
15
- }
16
-
17
- &>img {
18
- border-radius: 10px;
19
- width: 50px;
20
- }
21
-
22
- &>h2 {
23
- font-size: 14px;
24
- line-height: 2em;
25
- }
8
+ display: flex;
9
+ flex-wrap: wrap;
10
+ gap: 16px;
11
+ justify-content: center;
12
+ padding: 0;
13
+ margin: 0;
14
+ list-style: none;
15
+ }
16
+
17
+ ul > li {
18
+ background: #ffffff;
19
+ border-radius: 12px;
20
+ box-shadow: 0 6px 18px rgba(15,23,42,0.06);
21
+ padding: 14px;
22
+ width: calc(50% - 16px);
23
+ max-width: 130px;
24
+ text-align: center;
25
+ cursor: pointer;
26
+ transition: transform .18s ease, box-shadow .18s ease;
27
+ display: flex;
28
+ flex-direction: column;
29
+ align-items: center;
30
+ gap: 8px;
31
+ }
32
+
33
+ ul > li:hover {
34
+ transform: translateY(-6px);
35
+ box-shadow: 0 10px 26px rgba(15,23,42,0.12);
36
+ text-decoration: none;
37
+ }
38
+
39
+ ul > li > img {
40
+ border-radius: 10px;
41
+ width: 64px;
42
+ height: 64px;
43
+ object-fit: cover;
44
+ }
45
+
46
+ ul > li > h2 {
47
+ font-size: 14px;
48
+ line-height: 1.2;
49
+ margin: 0;
50
+ color: #111827;
51
+ font-weight: 600;
52
+ }
53
+
54
+ @media (min-width: 768px) {
55
+ ul > li {
56
+ width: calc(33.333% - 16px);
57
+ }
58
+ }
59
+
60
+ @media (min-width: 1024px) {
61
+ ul > li {
62
+ width: calc(25% - 16px);
63
+ }
64
+ }
65
+
66
+ @media (max-width: 420px) {
67
+ padding: 12px;
68
+ ul > li {
69
+ width: 100%;
70
+ max-width: none;
71
+ flex-direction: row;
72
+ align-items: center;
73
+ gap: 12px;
74
+ padding: 12px;
75
+ }
76
+
77
+ ul > li > img {
78
+ width: 48px;
79
+ height: 48px;
80
+ }
81
+
82
+ ul > li > h2 {
83
+ text-align: left;
84
+ font-size: 15px;
26
85
  }
27
86
  }
28
87
 
@@ -1,48 +1,70 @@
1
1
  .image-editor-view {
2
2
  position: relative;
3
- padding-top: 100px;
3
+ padding: 90px 12px 24px;
4
+ box-sizing: border-box;
4
5
 
5
- &>.menu {
6
- position: absolute;
6
+ .menu {
7
+ position: fixed;
8
+ bottom: 10px;
7
9
  left: 50%;
8
- top: 5px;
9
10
  transform: translateX(-50%);
10
- white-space: nowrap;
11
-
12
- &>li {
13
- display: inline-block;
14
- background-color: #FF5722;
15
- color: white;
16
- margin: 0 5px;
17
- border-radius: 5px;
18
-
19
- &>label {
20
- line-height: 30px;
21
- padding: 0 5px;
22
- display: inline-block;
23
- cursor: pointer;
24
- }
25
-
26
- &:hover {
27
- text-decoration: underline;
28
- }
29
- }
11
+ display: flex;
12
+ gap: 8px;
13
+ z-index: 40;
14
+ background: rgba(255, 255, 255, 0.8);
15
+ padding: 6px;
16
+ border-radius:10px;
17
+ box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
18
+ }
19
+
20
+ .menu>li {
21
+ list-style: none;
22
+ }
23
+
24
+ .menu>li>label {
25
+ display: inline-block;
26
+ padding: 8px 10px;
27
+ border-radius: 8px;
28
+ cursor: pointer;
29
+ background: #111827;
30
+ color: #fff;
31
+ font-size: 14px;
30
32
  }
31
33
 
32
- &>.content {
34
+ .content {
33
35
  text-align: center;
36
+ padding-top: 12px;
37
+ }
34
38
 
35
- #drawId {
36
- display: inline-block;
39
+ #drawId {
40
+ display: inline-block;
41
+ max-width: 100%;
42
+ }
37
43
 
38
- &>canvas {
39
- background-image: url("./images/mosaic.png");
40
- outline: 2px solid #CDDC39;
41
- }
42
- }
44
+ #drawId>canvas {
45
+ max-width: 100%;
46
+ height: auto;
47
+ border-radius: 8px;
43
48
  }
44
49
 
45
- &>.no-view {
50
+ .no-view {
46
51
  display: none;
47
52
  }
53
+
54
+ @media (max-width: 600px) {
55
+ .menu {
56
+ left: 12px;
57
+ transform: none;
58
+ top: 8px;
59
+ }
60
+
61
+ .menu>li>label {
62
+ padding: 6px 8px;
63
+ font-size: 13px;
64
+ }
65
+
66
+ .image-editor-view {
67
+ padding-top: 64px;
68
+ }
69
+ }
48
70
  }
@@ -1,5 +1,10 @@
1
1
  .img-to-pdf-view {
2
- iframe {
3
- display: none;
4
- }
2
+ padding: 20px 12px;
3
+ box-sizing: border-box;
4
+
5
+ ui-select-file { display: block; max-width: 720px; margin: 0 auto 12px; }
6
+
7
+ iframe { display: none; width: 100%; height: 600px; border: none; }
8
+
9
+ @media (max-width: 600px) { iframe { height: 320px; } }
5
10
  }
@@ -0,0 +1,44 @@
1
+ /* Global base styles for improved look and responsiveness */
2
+ html, body {
3
+ height: 100%;
4
+ margin: 0;
5
+ padding: 0;
6
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
7
+ background: #f7f9fc;
8
+ color: #0f1723;
9
+ -webkit-font-smoothing: antialiased;
10
+ }
11
+
12
+ .container {
13
+ max-width: 1100px;
14
+ margin: 0 auto;
15
+ padding: 16px;
16
+ box-sizing: border-box;
17
+ }
18
+
19
+ /* Buttons and inputs */
20
+ button {
21
+ font-family: inherit;
22
+ border-radius: 8px;
23
+ padding: 8px 12px;
24
+ background: #111827;
25
+ color: #fff;
26
+ border: none;
27
+ cursor: pointer;
28
+ }
29
+
30
+ input[type="text"], input[type="search"], input, textarea {
31
+ font-family: inherit;
32
+ padding: 8px 10px;
33
+ border-radius: 8px;
34
+ border: 1px solid #e6e9ee;
35
+ outline: none;
36
+ }
37
+
38
+ /* Utility helpers */
39
+ .hidden { display: none !important; }
40
+
41
+ @media (prefers-color-scheme: dark) {
42
+ html, body { background: #0b1220; color: #e6eef8; }
43
+ button { background: #e6eef8; color: #0b1220; }
44
+ }
@@ -1,7 +1,3 @@
1
- /*!
2
- * animation of OIPage v1.8.2
3
- * git+https://github.com/oi-contrib/OIPage.git
4
- */
5
1
 
6
2
  //当前正在运动的动画的tick函数堆栈
7
3
  var $timers = [];
@@ -1,7 +1,3 @@
1
- /*!
2
- * cmdlog of OIPage v1.8.2
3
- * git+https://github.com/oi-contrib/OIPage.git
4
- */
5
1
 
6
2
  // 预定义的常量
7
3
  const MOVE_LEFT = Buffer.from('1b5b3130303044', 'hex').toString();
@@ -1,7 +1,3 @@
1
- /*!
2
- * disk of OIPage v1.8.2
3
- * git+https://github.com/oi-contrib/OIPage.git
4
- */
5
1
 
6
2
  const { join } = require("path");
7
3
  const { existsSync, readdirSync, lstatSync, unlinkSync, rmdirSync, mkdirSync, copyFileSync, symlinkSync } = require("fs");
@@ -1,7 +1,3 @@
1
- /*!
2
- * format of OIPage v1.8.2
3
- * git+https://github.com/oi-contrib/OIPage.git
4
- */
5
1
 
6
2
  function numberFormat(input) {
7
3
  if (!input && input !== 0) {
@@ -1,7 +1,3 @@
1
- /*!
2
- * json of OIPage v1.8.2
3
- * git+https://github.com/oi-contrib/OIPage.git
4
- */
5
1
  const {reader} = require("../reader/index.js");
6
2
  let calcValue = function (word) {
7
3
  if (word.type != 'string' && word.type != 'object') {
@@ -1,7 +1,3 @@
1
- /*!
2
- * logform of OIPage v1.8.2
3
- * git+https://github.com/oi-contrib/OIPage.git
4
- */
5
1
  const {linelog} = require("../cmdlog/index.js");
6
2
  let getTitle = function (title) {
7
3
  return "➤ " + title;
@@ -1,7 +1,3 @@
1
- /*!
2
- * reader of OIPage v1.8.2
3
- * git+https://github.com/oi-contrib/OIPage.git
4
- */
5
1
 
6
2
  function reader(plain) {
7
3
 
@@ -1,7 +1,3 @@
1
- /*!
2
- * throttle of OIPage v1.8.2
3
- * git+https://github.com/oi-contrib/OIPage.git
4
- */
5
1
 
6
2
  function throttle(callback, _option) {
7
3
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oipage",
3
- "version": "1.8.2",
3
+ "version": "1.9.0",
4
4
  "description": "前端网页或应用快速开发助手,包括开发服务器、辅助命令、实用API等",
5
5
  "sideEffects": false,
6
6
  "typings": "./types/index.d.ts",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "homepage": "https://oi-contrib.github.io/OIPage",
41
41
  "dependencies": {
42
- "vislite": "^1.5.0",
42
+ "vislite": "^1.9.0",
43
43
  "xhtml-to-json": "^0.1.0",
44
44
  "zipaper": "^0.2.1"
45
45
  }
@@ -1,7 +1,3 @@
1
- /*!
2
- * XMLHttpRequest of OIPage v1.8.2
3
- * git+https://github.com/oi-contrib/OIPage.git
4
- */
5
1
 
6
2
  export function XHRIntercept(callbackFactory) {
7
3
 
@@ -1,7 +1,3 @@
1
- /*!
2
- * animation of OIPage v1.8.2
3
- * git+https://github.com/oi-contrib/OIPage.git
4
- */
5
1
 
6
2
  //当前正在运动的动画的tick函数堆栈
7
3
  var $timers = [];
@@ -1,7 +1,3 @@
1
- /*!
2
- * format of OIPage v1.8.2
3
- * git+https://github.com/oi-contrib/OIPage.git
4
- */
5
1
 
6
2
  export function numberFormat(input) {
7
3
  if (!input && input !== 0) {
package/web/json/index.js CHANGED
@@ -1,7 +1,3 @@
1
- /*!
2
- * json of OIPage v1.8.2
3
- * git+https://github.com/oi-contrib/OIPage.git
4
- */
5
1
  import {reader} from "../reader/index.js";
6
2
  let calcValue = function (word) {
7
3
  if (word.type != 'string' && word.type != 'object') {
@@ -1,7 +1,3 @@
1
- /*!
2
- * onReady of OIPage v1.8.2
3
- * git+https://github.com/oi-contrib/OIPage.git
4
- */
5
1
 
6
2
  export function onReady(callback) {
7
3
  var readyState = document.readyState;
@@ -1,7 +1,3 @@
1
- /*!
2
- * performChunk of OIPage v1.8.2
3
- * git+https://github.com/oi-contrib/OIPage.git
4
- */
5
1
 
6
2
  export function performChunk(chunkFun) {
7
3
  let isRuning = true;
@@ -1,7 +1,3 @@
1
- /*!
2
- * reader of OIPage v1.8.2
3
- * git+https://github.com/oi-contrib/OIPage.git
4
- */
5
1
 
6
2
  export function reader(plain) {
7
3
 
@@ -1,7 +1,3 @@
1
- /*!
2
- * style of OIPage v1.8.2
3
- * git+https://github.com/oi-contrib/OIPage.git
4
- */
5
1
 
6
2
  export function setStyle(el, styles) {
7
3
  for (var key in styles) {
@@ -1,7 +1,3 @@
1
- /*!
2
- * throttle of OIPage v1.8.2
3
- * git+https://github.com/oi-contrib/OIPage.git
4
- */
5
1
 
6
2
  export function throttle(callback, _option) {
7
3