Skip to content

Commit

Permalink
v1.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
yArna committed Apr 12, 2023
1 parent bbf8c50 commit 8d28631
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ yarn-error.log
.DS_Store
RefreshAndPredload.log
secret.json
.env
5 changes: 3 additions & 2 deletions build/publish.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Created on 2023/03/26 - 00:39
import { publish } from "@moonvy/deploy"
import { publish, refreshCDN } from "@moonvy/deploy"

publish("web", "./dist", "apps/ops")
await publish("web", "./dist", "apps/ops")
await refreshCDN(["https://moonvy.com/apps/ops/"])
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
{
"name": "@moonvy/open-prompt-studio",
"version": "1.2.2",
"version": "1.2.7",
"license": "MIT",
"type": "module",
"scripts": {
"start":"npm run dev | npm run serve",
"dev": "vite dev --host",
"build": "vite build",
"preview": "vite serve",
"serve": "jiti ./server/index.ts",
"fetch": "node ./data/build.js",
"publish": "npm run build && node ./build/publish.js"
},
"devDependencies": {
"@iconify/vue2": "2.1.0",
"@notionhq/client": "2.2.3",
"@types/express": "4.17.17",
"@types/jest": "29.4.0",
"@types/lodash": "4.14.189",
"@types/node": "16",
Expand All @@ -34,15 +37,16 @@
"axios": "1.3.4",
"copy-image-clipboard": "^2.1.2",
"cors": "2.8.5",
"dotenv": "16.0.3",
"downloadjs": "^1.4.7",
"express": "4.18.2",
"floating-vue": "1.0.0-beta.19",
"fzz": "*",
"html-to-image": "1.11.11",
"http-proxy-agent": "5.0.0",
"jiti": "1.16.0",
"lodash": "4.17.21",
"postcss": "8.4.21",
"puppeteer-google-translate": "1.0.6",
"tencentcloud-sdk-nodejs": "4.0.578",
"v-tooltip": "2.1.3",
"vue": "2.7.14",
"vue-router": "3.6.5",
Expand Down
7 changes: 6 additions & 1 deletion src/Compoents/PromptDict/PromptDict.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,16 @@
overflow: hidden;
height: auto;
flex: none;
width: max-content;
width: auto;
background: #d5d7ef;
button {
background: #d5d7ef;
color: #4545b2;
border-radius: 0;
flex: auto;
min-width: 72px;
white-space: nowrap;
place-content: center;
&.active {
background: #4545b2;
color: #d5d7ef;
Expand Down
20 changes: 15 additions & 5 deletions src/Compoents/PromptEditor/Components/PromptWork/PromptWork.vue
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ import vPromptItem from "../PromptItem/PromptItem.vue"
import vAddButton from "./Components/AddButton.vue"
import vPromptList from "../PromptList/PromptList.vue"
import debounce from "lodash/debounce"
import throttle from "lodash/throttle"
import { PromptItem } from "../../Sub/PromptItem"
import { useClipboard } from "@vueuse/core"
let { copy } = useClipboard()
Expand All @@ -444,20 +445,29 @@ export default Vue.extend({
}
},
created() {
;(<any>this).doImportByInputThrottle = debounce(
() => {
this.doImportByInput()
},
30,
{ maxWait: 50 }
)
;(<any>this).doAddInputDebounce = debounce(() => {
this.doImportByInput()
this.doImportByInputThrottle()
}, 300)
this.inputText = this.promptWork.data.initText ?? ""
this.doImportByInput()
this.doImportByInputThrottle()
},
watch: {
inputParser(val) {
this.promptWork.data.parser = val
this.doImportByInput()
this.doImportByInputThrottle()
},
},
methods: {
doImportByInputThrottle() {},
async doImportByInput() {
console.log("[doImportByInput]")
await this.promptWork.importPrompts(this.inputText, { parser: <any>this.inputParser })
this.doExportPrompt()
},
Expand All @@ -467,7 +477,7 @@ export default Vue.extend({
},
async onUserInput() {
setTimeout(() => {
;(<any>this).doImportByInput()
;(<any>this).doImportByInputThrottle()
}, 0)
},
async onUserInputDebounce() {
Expand All @@ -476,7 +486,7 @@ export default Vue.extend({
},
async doClear() {
this.inputText = ""
await this.doImportByInput()
await this.doImportByInputThrottle()
this.doExportPrompt()
},
doSwitchIO() {
Expand Down

0 comments on commit 8d28631

Please sign in to comment.