generated from halo-dev/plugin-starter
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request 'v1.4.0 Releases' (PR#35) from dev into main
- Loading branch information
Showing
21 changed files
with
446 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,28 @@ | ||
import type {I18nLang} from "@/type/i18n"; | ||
import type { I18nLang } from "@/type/i18n"; | ||
|
||
const lang: I18nLang = { | ||
"insert_image": "插入图片" | ||
} | ||
insert_image: "插入图片", | ||
confirm: "确定", | ||
close: "关闭", | ||
default: "默认", | ||
warning: "警告", | ||
danger: "危险", | ||
success: "成功", | ||
info: "信息", | ||
insert_tips: "插入Tips", | ||
type: "类型", | ||
content: "内容", | ||
platform: "平台", | ||
owner: "所有者", | ||
repo: "仓库", | ||
insert_git: "插入Git仓库", | ||
insert_custom: "插入自定义块", | ||
insert_drive: "插入资源链接", | ||
baidu_net_disk: "百度网盘", | ||
ali_drive: "阿里云盘", | ||
title: "标题", | ||
link: "链接", | ||
password: "密码", | ||
}; | ||
|
||
|
||
export default lang | ||
export default lang; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,28 @@ | ||
import type {I18nLang} from "@/type/i18n"; | ||
import type { I18nLang } from "@/type/i18n"; | ||
|
||
const lang: I18nLang = { | ||
"insert_image": "插入圖片" | ||
} | ||
insert_image: "插入圖片", | ||
confirm: "確定", | ||
close: "關閉", | ||
default: "默認", | ||
warning: "警告", | ||
danger: "危險", | ||
success: "成功", | ||
info: "訊息", | ||
insert_tips: "插入Tips", | ||
type: "類型", | ||
content: "內容", | ||
platform: "平臺", | ||
owner: "所有者", | ||
repo: "儲存庫", | ||
insert_git: "插入Git存儲庫", | ||
insert_custom: "插入自定義塊", | ||
insert_drive: "插入資源鏈接", | ||
baidu_net_disk: "百度網盤", | ||
ali_drive: "阿里雲盤", | ||
title: "標題", | ||
link: "鏈接", | ||
password: "密碼", | ||
}; | ||
|
||
export default lang | ||
export default lang; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<script setup lang="ts"> | ||
import { VModal, VButton, VSpace } from "@halo-dev/components"; | ||
import { t } from "@/utils/i18n-utils"; | ||
import { ref } from "vue"; | ||
const props = defineProps<{ | ||
open: boolean; | ||
}>(); | ||
const emit = defineEmits<{ | ||
(event: "done", value: string): void; | ||
(event: "close"): void; | ||
}>(); | ||
const platform = ref("baidu"); | ||
const name = ref(""); | ||
const link = ref(""); | ||
const password = ref(""); | ||
const generateCode = () => { | ||
let code = "\n\n```halo\n"; | ||
code += `drive:${platform.value}\n`; | ||
code += `name: ${name.value}\n`; | ||
code += `link: ${link.value}\n`; | ||
if (password.value) { | ||
code += `password: ${password.value}\n`; | ||
} | ||
emit("done", code + "```\n\n"); | ||
}; | ||
</script> | ||
|
||
<template> | ||
<VModal | ||
:visible="props.open" | ||
:layer-closable="false" | ||
:title="t('insert_drive')" | ||
@close="emit('close')" | ||
> | ||
<v-space align="start" direction="column" spacing="xs" style="width: 100%"> | ||
<label for="type" class="vditor-mde-label"> | ||
<span>{{ t("platform") }}</span> | ||
<select id="platform" v-model="platform" class="vditor-mde-select"> | ||
<option value="baidu">{{ t("baidu_net_disk") }}</option> | ||
<option value="ali">{{ t("ali_drive") }}</option> | ||
</select> | ||
</label> | ||
<label for="name" class="vditor-mde-label"> | ||
<span>{{ t("title") }}</span> | ||
<input id="name" v-model="name" type="text" class="vditor-mde-input" /> | ||
</label> | ||
<label for="link" class="vditor-mde-label"> | ||
<span>{{ t("link") }}</span> | ||
<input id="link" v-model="link" type="text" class="vditor-mde-input" /> | ||
</label> | ||
<label for="password" class="vditor-mde-label"> | ||
<span>{{ t("password") }}</span> | ||
<input | ||
id="password" | ||
v-model="password" | ||
type="text" | ||
class="vditor-mde-input" | ||
/> | ||
</label> | ||
</v-space> | ||
<template #footer> | ||
<v-space align="center" direction="row" spacing="xs"> | ||
<v-button type="primary" @click="generateCode"> | ||
{{ t("confirm") }} | ||
</v-button> | ||
<v-button type="default" @click="emit('close')"> | ||
{{ t("close") }} | ||
</v-button> | ||
</v-space> | ||
</template> | ||
</VModal> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<script setup lang="ts"> | ||
import { VModal, VButton, VSpace } from "@halo-dev/components"; | ||
import { t } from "@/utils/i18n-utils"; | ||
import { ref } from "vue"; | ||
const URL_NOT_SHOW = ["github", "gitee"]; | ||
const props = defineProps<{ | ||
open: boolean; | ||
}>(); | ||
const emit = defineEmits<{ | ||
(event: "done", value: string): void; | ||
(event: "close"): void; | ||
}>(); | ||
const url = ref(""); | ||
const platform = ref("github"); | ||
const owner = ref(""); | ||
const repo = ref(""); | ||
const generateCode = () => { | ||
emit( | ||
"done", | ||
"\n\n```halo\n" + | ||
`git:[${url.value}@${platform.value}/${owner.value}/${repo.value}]` + | ||
"\n```\n\n" | ||
); | ||
}; | ||
</script> | ||
|
||
<template> | ||
<VModal | ||
:visible="props.open" | ||
:layer-closable="false" | ||
:title="t('insert_git')" | ||
@close="emit('close')" | ||
> | ||
<v-space align="start" direction="column" spacing="xs" style="width: 100%"> | ||
<label v-if="URL_NOT_SHOW.indexOf(platform) === -1" for="url"> | ||
<span>URL</span> | ||
<input id="url" v-model="url" type="text" class="vditor-mde-input" /> | ||
</label> | ||
<label for="type" class="vditor-mde-label"> | ||
<span>{{ t("platform") }}</span> | ||
<select id="platform" v-model="platform" class="vditor-mde-select"> | ||
<option value="github">GitHub</option> | ||
<option value="gitee">Gitee</option> | ||
</select> | ||
</label> | ||
<label for="owner" class="vditor-mde-label"> | ||
<span>{{ t("owner") }}</span> | ||
<input id="owner" v-model="owner" type="text" class="vditor-mde-input" /> | ||
</label> | ||
<label for="repo" class="vditor-mde-label"> | ||
<span>{{ t("repo") }}</span> | ||
<input id="repo" v-model="repo" type="text" class="vditor-mde-input" /> | ||
</label> | ||
</v-space> | ||
<template #footer> | ||
<v-space align="center" direction="row" spacing="xs"> | ||
<v-button type="primary" @click="generateCode"> | ||
{{ t("confirm") }} | ||
</v-button> | ||
<v-button type="default" @click="emit('close')"> | ||
{{ t("close") }} | ||
</v-button> | ||
</v-space> | ||
</template> | ||
</VModal> | ||
</template> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<script setup lang="ts"> | ||
import { VModal, VButton, VSpace } from "@halo-dev/components"; | ||
import { ref } from "vue"; | ||
import { t } from "@/utils/i18n-utils"; | ||
const props = defineProps<{ | ||
open: boolean; | ||
}>(); | ||
const emit = defineEmits<{ | ||
(event: "done", value: string): void; | ||
(event: "close"): void; | ||
}>(); | ||
const type = ref("default"); | ||
const content = ref(""); | ||
const generateCode = () => { | ||
emit( | ||
"done", | ||
"\n\n```halo\n" + `tips:${type.value}\n${content.value}\n` + "```\n\n" | ||
); | ||
}; | ||
</script> | ||
|
||
<template> | ||
<VModal | ||
:visible="props.open" | ||
:layer-closable="false" | ||
:title="t('insert_tips')" | ||
@close="emit('close')" | ||
> | ||
<v-space align="start" direction="column" spacing="xs" style="width: 100%"> | ||
<label for="type" class="vditor-mde-label"> | ||
<span>{{ t("type") }}</span> | ||
<select id="type" v-model="type" class="vditor-mde-select"> | ||
<option value="default">{{ t("default") }}</option> | ||
<option value="danger">{{ t("danger") }}</option> | ||
<option value="warn">{{ t("warning") }}</option> | ||
<option value="info">{{ t("info") }}</option> | ||
<option value="success">{{ t("success") }}</option> | ||
</select> | ||
</label> | ||
<label for="content" class="vditor-mde-label"> | ||
<span>{{ t("content") }}</span> | ||
<textarea id="content" v-model="content" class="vditor-mde-textarea" /> | ||
</label> | ||
</v-space> | ||
<template #footer> | ||
<v-space align="center" direction="row" spacing="xs"> | ||
<v-button type="primary" @click="generateCode"> | ||
{{ t("confirm") }} | ||
</v-button> | ||
<v-button type="default" @click="emit('close')"> | ||
{{ t("close") }} | ||
</v-button> | ||
</v-space> | ||
</template> | ||
</VModal> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export const mdiImage = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="m8.5 13.5l2.5 3l3.5-4.5l4.5 6H5m16 1V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2"/></svg>`; | ||
export const mdiGrid = `<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M120-520v-320h320v320H120Zm0 400v-320h320v320H120Zm400-400v-320h320v320H520Zm0 400v-320h320v320H520ZM200-600h160v-160H200v160Zm400 0h160v-160H600v160Zm0 400h160v-160H600v160Zm-400 0h160v-160H200v160Zm400-400Zm0 240Zm-240 0Zm0-240Z"/></svg>`; |
Oops, something went wrong.