diff --git a/icon.png b/icon.png index 94548831..e321bbfd 100644 Binary files a/icon.png and b/icon.png differ diff --git a/package.json b/package.json index 9df09296..1f52defc 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "zhi-github-middleware": "^0.2.8", "zhi-lib-base": "^0.4.4", "zhi-notion-markdown": "^0.1.4", - "zhi-siyuan-api": "^2.1.5", + "zhi-siyuan-api": "^2.1.6", "zhi-xmlrpc-middleware": "^0.4.22" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e594c37a..6d996522 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -81,8 +81,8 @@ dependencies: specifier: ^0.1.4 version: 0.1.4 zhi-siyuan-api: - specifier: ^2.1.5 - version: 2.1.5 + specifier: ^2.1.6 + version: 2.1.6 zhi-xmlrpc-middleware: specifier: ^0.4.22 version: 0.4.22 @@ -165,8 +165,8 @@ packages: engines: {node: '>=0.10.0'} dev: true - /@adobe/css-tools@4.3.0: - resolution: {integrity: sha512-+RNNcQvw2V1bmnBTPAtOLfW/9mhH2vC67+rUSi5T8EtEWt6lEnGNY2GuhZ1/YwbgikT1TkhvidCDmN5Q5YCo/w==} + /@adobe/css-tools@4.3.1: + resolution: {integrity: sha512-/62yikz7NLScCGAAST5SHdnjaDJQBDq0M2muyRTpf2VQhw6StBg2ALiu73zSJQ4fMVLA+0uBhBHAle7Wg+2kSg==} dev: true /@ampproject/remapping@2.2.1: @@ -1156,7 +1156,7 @@ packages: dotenv: 16.3.1 esbuild: 0.17.19 esbuild-plugin-copy: 2.1.1(esbuild@0.17.19) - esbuild-plugin-d.ts: 1.1.0(postcss@8.4.27)(typescript@5.1.6) + esbuild-plugin-d.ts: 1.1.0(postcss@8.4.28)(typescript@5.1.6) esbuild-plugin-ifdef: 1.0.1 esbuild-plugin-inline-image: 0.0.9 esbuild-plugin-vue3: 0.3.2(cheerio@1.0.0-rc.12) @@ -1842,7 +1842,7 @@ packages: '@vue/shared': 3.3.4 estree-walker: 2.0.2 magic-string: 0.30.2 - postcss: 8.4.27 + postcss: 8.4.28 source-map-js: 1.0.2 /@vue/compiler-ssr@3.3.4: @@ -3348,7 +3348,7 @@ packages: globby: 11.1.0 dev: true - /esbuild-plugin-d.ts@1.1.0(postcss@8.4.27)(typescript@5.1.6): + /esbuild-plugin-d.ts@1.1.0(postcss@8.4.28)(typescript@5.1.6): resolution: {integrity: sha512-3oSR3kUS4fNdKHLYLcST9YOfD2dULe7/UbXnrnu/mRybJYW+jZlYNgklb9Pt7osg6B1qwAYMyr2jTC+Ijj2YbQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -3357,7 +3357,7 @@ packages: chalk: 4.1.2 jju: 1.4.0 tmp: 0.2.1 - tsup: 5.12.9(postcss@8.4.27)(typescript@5.1.6) + tsup: 5.12.9(postcss@8.4.28)(typescript@5.1.6) typescript: 5.1.6 transitivePeerDependencies: - '@swc/core' @@ -3405,8 +3405,8 @@ packages: '@types/sass': 1.45.0 '@types/stylus': 0.48.38 glob: 10.3.3 - postcss: 8.4.27 - postcss-modules: 6.0.0(postcss@8.4.27) + postcss: 8.4.28 + postcss-modules: 6.0.0(postcss@8.4.28) dev: true /esbuild-sunos-64@0.14.47: @@ -3667,9 +3667,9 @@ packages: eslint: 8.47.0 esutils: 2.0.3 known-css-properties: 0.28.0 - postcss: 8.4.27 - postcss-load-config: 3.1.4(postcss@8.4.27) - postcss-safe-parser: 6.0.0(postcss@8.4.27) + postcss: 8.4.28 + postcss-load-config: 3.1.4(postcss@8.4.28) + postcss-safe-parser: 6.0.0(postcss@8.4.28) postcss-selector-parser: 6.0.13 semver: 7.5.4 svelte: 4.2.0 @@ -4321,13 +4321,13 @@ packages: safer-buffer: 2.1.2 dev: true - /icss-utils@5.1.0(postcss@8.4.27): + /icss-utils@5.1.0(postcss@8.4.28): resolution: {integrity: sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==} engines: {node: ^10 || ^12 || >= 14} peerDependencies: postcss: ^8.1.0 dependencies: - postcss: 8.4.27 + postcss: 8.4.28 dev: true /ieee754@1.2.1: @@ -5622,7 +5622,7 @@ packages: pathe: 1.1.1 dev: true - /postcss-load-config@3.1.4(postcss@8.4.27): + /postcss-load-config@3.1.4(postcss@8.4.28): resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} engines: {node: '>= 10'} peerDependencies: @@ -5635,83 +5635,83 @@ packages: optional: true dependencies: lilconfig: 2.1.0 - postcss: 8.4.27 + postcss: 8.4.28 yaml: 1.10.2 dev: true - /postcss-modules-extract-imports@3.0.0(postcss@8.4.27): + /postcss-modules-extract-imports@3.0.0(postcss@8.4.28): resolution: {integrity: sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==} engines: {node: ^10 || ^12 || >= 14} peerDependencies: postcss: ^8.1.0 dependencies: - postcss: 8.4.27 + postcss: 8.4.28 dev: true - /postcss-modules-local-by-default@4.0.3(postcss@8.4.27): + /postcss-modules-local-by-default@4.0.3(postcss@8.4.28): resolution: {integrity: sha512-2/u2zraspoACtrbFRnTijMiQtb4GW4BvatjaG/bCjYQo8kLTdevCUlwuBHx2sCnSyrI3x3qj4ZK1j5LQBgzmwA==} engines: {node: ^10 || ^12 || >= 14} peerDependencies: postcss: ^8.1.0 dependencies: - icss-utils: 5.1.0(postcss@8.4.27) - postcss: 8.4.27 + icss-utils: 5.1.0(postcss@8.4.28) + postcss: 8.4.28 postcss-selector-parser: 6.0.13 postcss-value-parser: 4.2.0 dev: true - /postcss-modules-scope@3.0.0(postcss@8.4.27): + /postcss-modules-scope@3.0.0(postcss@8.4.28): resolution: {integrity: sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg==} engines: {node: ^10 || ^12 || >= 14} peerDependencies: postcss: ^8.1.0 dependencies: - postcss: 8.4.27 + postcss: 8.4.28 postcss-selector-parser: 6.0.13 dev: true - /postcss-modules-values@4.0.0(postcss@8.4.27): + /postcss-modules-values@4.0.0(postcss@8.4.28): resolution: {integrity: sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==} engines: {node: ^10 || ^12 || >= 14} peerDependencies: postcss: ^8.1.0 dependencies: - icss-utils: 5.1.0(postcss@8.4.27) - postcss: 8.4.27 + icss-utils: 5.1.0(postcss@8.4.28) + postcss: 8.4.28 dev: true - /postcss-modules@6.0.0(postcss@8.4.27): + /postcss-modules@6.0.0(postcss@8.4.28): resolution: {integrity: sha512-7DGfnlyi/ju82BRzTIjWS5C4Tafmzl3R79YP/PASiocj+aa6yYphHhhKUOEoXQToId5rgyFgJ88+ccOUydjBXQ==} peerDependencies: postcss: ^8.0.0 dependencies: generic-names: 4.0.0 - icss-utils: 5.1.0(postcss@8.4.27) + icss-utils: 5.1.0(postcss@8.4.28) lodash.camelcase: 4.3.0 - postcss: 8.4.27 - postcss-modules-extract-imports: 3.0.0(postcss@8.4.27) - postcss-modules-local-by-default: 4.0.3(postcss@8.4.27) - postcss-modules-scope: 3.0.0(postcss@8.4.27) - postcss-modules-values: 4.0.0(postcss@8.4.27) + postcss: 8.4.28 + postcss-modules-extract-imports: 3.0.0(postcss@8.4.28) + postcss-modules-local-by-default: 4.0.3(postcss@8.4.28) + postcss-modules-scope: 3.0.0(postcss@8.4.28) + postcss-modules-values: 4.0.0(postcss@8.4.28) string-hash: 1.1.3 dev: true - /postcss-safe-parser@6.0.0(postcss@8.4.27): + /postcss-safe-parser@6.0.0(postcss@8.4.28): resolution: {integrity: sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==} engines: {node: '>=12.0'} peerDependencies: postcss: ^8.3.3 dependencies: - postcss: 8.4.27 + postcss: 8.4.28 dev: true - /postcss-scss@4.0.6(postcss@8.4.27): + /postcss-scss@4.0.6(postcss@8.4.28): resolution: {integrity: sha512-rLDPhJY4z/i4nVFZ27j9GqLxj1pwxE80eAzUNRMXtcpipFYIeowerzBgG3yJhMtObGEXidtIgbUpQ3eLDsf5OQ==} engines: {node: '>=12.0'} peerDependencies: postcss: ^8.4.19 dependencies: - postcss: 8.4.27 + postcss: 8.4.28 dev: true /postcss-selector-parser@6.0.13: @@ -5726,8 +5726,8 @@ packages: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} dev: true - /postcss@8.4.27: - resolution: {integrity: sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==} + /postcss@8.4.28: + resolution: {integrity: sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw==} engines: {node: ^10 || ^12 || >=14} dependencies: nanoid: 3.3.6 @@ -6154,7 +6154,7 @@ packages: zhi-device: 2.3.1 zhi-fetch-middleware: 0.2.28 zhi-lib-base: 0.4.4 - zhi-siyuan-api: 2.1.5 + zhi-siyuan-api: 2.1.6 transitivePeerDependencies: - '@vue/composition-api' - typescript @@ -6289,7 +6289,7 @@ packages: resolution: {integrity: sha512-lQ9w/XIOH5ZHVNuNbWW8D822r+/wBSO/d6XvtyHLF7LW4KaCIDeVbvn5DF8fGCJAUCwVhVi/h6J0NUcnylUEjg==} hasBin: true dependencies: - '@adobe/css-tools': 4.3.0 + '@adobe/css-tools': 4.3.1 debug: 4.3.4 glob: 7.2.3 sax: 1.2.4 @@ -6336,8 +6336,8 @@ packages: eslint-scope: 7.2.2 eslint-visitor-keys: 3.4.3 espree: 9.6.1 - postcss: 8.4.27 - postcss-scss: 4.0.6(postcss@8.4.27) + postcss: 8.4.28 + postcss-scss: 4.0.6(postcss@8.4.28) svelte: 4.2.0 dev: true @@ -6569,7 +6569,7 @@ packages: resolution: {integrity: sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==} dev: true - /tsup@5.12.9(postcss@8.4.27)(typescript@5.1.6): + /tsup@5.12.9(postcss@8.4.28)(typescript@5.1.6): resolution: {integrity: sha512-dUpuouWZYe40lLufo64qEhDpIDsWhRbr2expv5dHEMjwqeKJS2aXA/FPqs1dxO4T6mBojo7rvo3jP9NNzaKyDg==} hasBin: true peerDependencies: @@ -6592,8 +6592,8 @@ packages: execa: 5.1.1 globby: 11.1.0 joycon: 3.1.1 - postcss: 8.4.27 - postcss-load-config: 3.1.4(postcss@8.4.27) + postcss: 8.4.28 + postcss-load-config: 3.1.4(postcss@8.4.28) resolve-from: 5.0.0 rollup: 2.79.1 source-map: 0.8.0-beta.0 @@ -6966,7 +6966,7 @@ packages: dependencies: '@types/node': 18.17.5 esbuild: 0.18.20 - postcss: 8.4.27 + postcss: 8.4.28 rollup: 3.28.0 stylus: 0.59.0 optionalDependencies: @@ -7398,8 +7398,8 @@ packages: - supports-color dev: false - /zhi-siyuan-api@2.1.5: - resolution: {integrity: sha512-ZB7QQ5XRALPnLIF/divuCeFrt3wBehBRaeEWevW9J/DXHe6ynDX6pQ8pV6LXsMn25UNZoYN3cPq5RjfspymApw==} + /zhi-siyuan-api@2.1.6: + resolution: {integrity: sha512-LIPCMlCBVk85OKx7DJPxdHkNztH9CszxEF6GlEhdqSCxvDpVK+E/BXgf+RoeE8dBu+ZR5IO6bMCStX/3i0g2Qw==} dependencies: zhi-blog-api: 1.23.0 zhi-common: 1.17.0 diff --git a/src/adaptors/api/hexo/hexoYamlConverterAdaptor.ts b/src/adaptors/api/hexo/hexoYamlConverterAdaptor.ts index 971cfc00..03c0f1f3 100644 --- a/src/adaptors/api/hexo/hexoYamlConverterAdaptor.ts +++ b/src/adaptors/api/hexo/hexoYamlConverterAdaptor.ts @@ -51,7 +51,7 @@ export class HexoYamlConverterAdaptor extends YamlConvertAdaptor { yamlFormatObj.yamlObj.date = DateUtil.formatIsoToZh(post.dateCreated.toISOString(), true) // updated - yamlFormatObj.yamlObj.updated = DateUtil.formatIsoToZh(new Date().toISOString(), true) + yamlFormatObj.yamlObj.updated = DateUtil.formatIsoToZh(post.dateUpdated.toISOString(), true) // excerpt yamlFormatObj.yamlObj.excerpt = post.shortDesc @@ -108,7 +108,14 @@ export class HexoYamlConverterAdaptor extends YamlConvertAdaptor { convertToAttr(post: Post, yamlFormatObj: YamlFormatObj, cfg?: CommonBlogConfig): Post { this.logger.debug("开始转换YAML到Post", yamlFormatObj) + + // 标题 post.title = yamlFormatObj.yamlObj.title + + // 发布时间 + post.dateCreated = DateUtil.convertStringToDate(yamlFormatObj.yamlObj.date) + post.dateUpdated = DateUtil.convertStringToDate(yamlFormatObj.yamlObj.updated) + // 其他属性 // ... diff --git a/src/components/publish/BatchPublishIndex.vue b/src/components/publish/BatchPublishIndex.vue index b51237dd..fcfe6ad8 100644 --- a/src/components/publish/BatchPublishIndex.vue +++ b/src/components/publish/BatchPublishIndex.vue @@ -27,12 +27,12 @@ import { createAppLogger } from "~/src/utils/appLogger.ts" import PublishTips from "~/src/components/publish/form/PublishTips.vue" import PublishPlatform from "~/src/components/publish/form/PublishPlatform.vue" -import { markRaw, onMounted, reactive } from "vue" +import { markRaw, onMounted, reactive, ref } from "vue" import { usePublish } from "~/src/composables/usePublish.ts" import { useSiyuanApi } from "~/src/composables/useSiyuanApi.ts" import { useVueI18n } from "~/src/composables/useVueI18n.ts" import { ElMessage, ElMessageBox } from "element-plus" -import { StrUtil } from "zhi-common" +import { DateUtil, StrUtil } from "zhi-common" import { pre } from "~/src/utils/import/pre.ts" import { Delete } from "@element-plus/icons-vue" import { BrowserUtil } from "zhi-device" @@ -41,6 +41,7 @@ import { Post } from "zhi-blog-api" import { IPublishCfg } from "~/src/types/IPublishCfg.ts" import { PageEditMode } from "~/src/models/pageEditMode.ts" import EditModeSelect from "~/src/components/publish/form/EditModeSelect.vue" +import PublishTime from "~/src/components/publish/form/PublishTime.vue" const logger = createAppLogger("publisher-index") @@ -210,6 +211,12 @@ const syncDynList = (selectedKeys: string[]) => { logger.debug("syncDynList in batch publish") } +const syncPublishTime = (val1: Date, val2: Date) => { + formData.siyuanPost.dateCreated = val1 + formData.siyuanPost.dateUpdated = val2 + logger.debug("syncPublishTime in batch publish") +} + const handleRefresh = () => { BrowserUtil.reloadPage() } @@ -275,12 +282,20 @@ onMounted(async () => { - - +
+ + + + + + + + + + + + +
- +
+ + + + + + + + + + + + +
+ + + + + + diff --git a/src/components/publish/form/SourceMode.vue b/src/components/publish/form/SourceMode.vue index 135d8592..c18c2feb 100644 --- a/src/components/publish/form/SourceMode.vue +++ b/src/components/publish/form/SourceMode.vue @@ -114,10 +114,10 @@ const onYamlContentFocus = (event: any) => { if (BrowserUtil.isInBrowser) { try { BrowserUtil.copyToClipboardInBrowser(formData.yamlContent) - ElMessage.success(t("main.opt.success")) + ElMessage.success(t("main.copy.success")) } catch (e) { - logger.error(t("main.opt.failure"), e) - ElMessage.error(t("main.opt.failure") + "=>" + e) + logger.error(t("main.copy.failure"), e) + ElMessage.error(t("main.copy.failure") + "=>" + e) } } } @@ -160,10 +160,10 @@ const initPage = async () => { let yfmObj: YamlFormatObj = new YamlFormatObj() const post = formData.siyuanPost formData.cfg = props.cfg as CommonBlogConfig - formData.yamlAdaptor = await Adaptors.getYamlAdaptor(props.apiType, formData.cfg) - if (formData.yamlAdaptor === null) { - formData.readonlyMode = true - } + // 没有平台 Key,不展示 YAML + formData.yamlAdaptor = formData.readonlyMode ? null : await Adaptors.getYamlAdaptor(props.apiType, formData.cfg) + // 如果传了 key ,但是没有 YAML 适配器,还是不能展示 + formData.readonlyMode = formData.yamlAdaptor === null // 批量分发,此时 apiType 为空 if (formData.readonlyMode) { @@ -285,6 +285,7 @@ await initPage() type="warning" /> --> + +