From dd5a90fdc0690b0d1ec611af2c8fe40e7036d3b2 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 1 Jun 2024 00:08:35 +0800 Subject: [PATCH 01/10] :art: https://github.com/siyuan-note/siyuan/issues/10247 --- app/src/assets/scss/business/_layout.scss | 5 + app/src/boot/globalEvent/click.ts | 41 ++++++-- app/src/layout/dock/index.ts | 119 ++++++++++++++++++++-- app/src/menus/dock.ts | 1 - 4 files changed, 151 insertions(+), 15 deletions(-) diff --git a/app/src/assets/scss/business/_layout.scss b/app/src/assets/scss/business/_layout.scss index 488ffac608..b266e352c9 100644 --- a/app/src/assets/scss/business/_layout.scss +++ b/app/src/assets/scss/business/_layout.scss @@ -368,6 +368,11 @@ border-top: .5px solid var(--b3-border-color); } + &__items { + min-height: 26px; + min-width: 26px; + } + svg { height: 14px; width: 14px; diff --git a/app/src/boot/globalEvent/click.ts b/app/src/boot/globalEvent/click.ts index 4c68a9c270..061296f8b5 100644 --- a/app/src/boot/globalEvent/click.ts +++ b/app/src/boot/globalEvent/click.ts @@ -12,12 +12,39 @@ import {showMessage} from "../../dialog/message"; export const globalClick = (event: MouseEvent & { target: HTMLElement }) => { const ghostElement = document.getElementById("dragGhost"); if (ghostElement) { - const startElement = ghostElement.parentElement.querySelector(`[data-node-id="${ghostElement.getAttribute("data-node-id")}"]`) as HTMLElement; - startElement ? startElement.style.opacity = "" : ""; - ghostElement.parentElement.querySelectorAll(".dragover__top, .dragover__bottom, .dragover").forEach((item: HTMLElement) => { - item.classList.remove("dragover__top", "dragover__bottom", "dragover"); - item.style.opacity = ""; - }); + if (ghostElement.dataset.ghostType === "dock") { + ghostElement.parentElement.querySelectorAll(".dock__item").forEach((item: HTMLElement) => { + item.style.opacity = ""; + item.classList.add("b3-tooltips"); + }); + const original = JSON.parse(ghostElement.getAttribute("data-original")); + let dock + if (original.position === "Left") { + dock = window.siyuan.layout.leftDock; + } else if (original.position === "Right") { + dock = window.siyuan.layout.rightDock; + } else if (original.position === "Bottom") { + dock = window.siyuan.layout.bottomDock; + } + const previousElement = dock.element.querySelector(`.dock__item[data-type="${original.previousType}"]`) + const dockElement = dock.element.querySelector(`.dock__item[data-type="${original.type}"]`) + if (previousElement) { + previousElement.after(dockElement) + } else { + if (original.index === "0") { + dock.element.firstElementChild.prepend(dockElement) + } else { + dock.element.lastElementChild.previousElementSibling.prepend(dockElement) + } + } + } else { + const startElement = ghostElement.parentElement.querySelector(`[data-node-id="${ghostElement.getAttribute("data-node-id")}"]`) as HTMLElement; + startElement ? startElement.style.opacity = "" : ""; + ghostElement.parentElement.querySelectorAll(".dragover__top, .dragover__bottom, .dragover").forEach((item: HTMLElement) => { + item.classList.remove("dragover__top", "dragover__bottom", "dragover"); + item.style.opacity = ""; + }); + } ghostElement.remove(); } if (!window.siyuan.menus.menu.element.contains(event.target) && !hasClosestByAttribute(event.target, "data-menu", "true")) { @@ -48,7 +75,7 @@ export const globalClick = (event: MouseEvent & { target: HTMLElement }) => { window.siyuan.layout.rightDock.hideDock(); } - const protyleElement = hasClosestByClassName(event.target, "protyle", true); + const protyleElement = hasClosestByClassName(event.target, "protyle", true); if (protyleElement) { const wysiwygElement = protyleElement.querySelector(".protyle-wysiwyg"); if (wysiwygElement.getAttribute("data-readonly") === "true" || !wysiwygElement.contains(event.target)) { diff --git a/app/src/layout/dock/index.ts b/app/src/layout/dock/index.ts index 92590871cf..35b04d44b5 100644 --- a/app/src/layout/dock/index.ts +++ b/app/src/layout/dock/index.ts @@ -9,7 +9,7 @@ import {Bookmark} from "./Bookmark"; import {Tag} from "./Tag"; import {Graph} from "./Graph"; import {Model} from "../Model"; -import {setPanelFocus} from "../util"; +import {saveLayout, setPanelFocus} from "../util"; import {getDockByType, resizeTabs} from "../tabUtil"; import {Inbox} from "./Inbox"; import {Protyle} from "../../protyle"; @@ -62,7 +62,7 @@ export class Dock { } this.app = options.app; this.element = document.getElementById("dock" + options.position); - const dockClass = options.position === "Bottom" ? ' class="fn__flex"' : ""; + const dockClass = options.position === "Bottom" ? ' class="fn__flex dock__items"' : ' class="dock__items"'; this.element.innerHTML = `
`; this.position = options.position; this.pin = options.data.pin; @@ -133,6 +133,106 @@ export class Dock { target = target.parentElement; } }); + + this.element.addEventListener("mousedown", (event: MouseEvent) => { + const item = hasClosestByClassName(event.target as HTMLElement, "dock__item"); + if (!item || !item.getAttribute("data-type")) { + return; + } + const documentSelf = document; + documentSelf.ondragstart = () => false; + let ghostElement: HTMLElement; + let selectItem: HTMLElement; + documentSelf.onmousemove = (moveEvent: MouseEvent) => { + if (window.siyuan.config.readonly || + Math.abs(moveEvent.clientY - event.clientY) < 3 && Math.abs(moveEvent.clientX - event.clientX) < 3) { + return; + } + console.log(moveEvent.clientY - event.clientY) + moveEvent.preventDefault(); + moveEvent.stopPropagation(); + if (!ghostElement) { + item.style.opacity = "0.38"; + item.classList.remove("b3-tooltips"); + ghostElement = item.cloneNode(true) as HTMLElement; + ghostElement.setAttribute("data-ghost-type", "dock"); + this.element.append(ghostElement); + ghostElement.setAttribute("data-original", JSON.stringify({ + position: this.position, + index: item.getAttribute("data-index"), + previousType: item.previousElementSibling?.getAttribute("data-type"), + type: item.getAttribute("data-type"), + })); + ghostElement.setAttribute("id", "dragGhost"); + ghostElement.setAttribute("style", `background-color:var(--b3-theme-background-light);position: fixed; top: ${event.clientY}px; left: ${event.clientX}px; z-index:999997;`); + } + if (this.position === "Bottom") { + ghostElement.style.top = (moveEvent.clientY - 40) + "px"; + ghostElement.style.left = (moveEvent.clientX - 20) + "px"; + } else { + ghostElement.style.top = (moveEvent.clientY - 20) + "px"; + if (this.position === "Left") { + ghostElement.style.left = (moveEvent.clientX) + "px"; + } else { + ghostElement.style.left = (moveEvent.clientX - 40) + "px"; + } + } + + const targetItem = hasClosestByClassName(moveEvent.target as HTMLElement, "dock__item") || + hasClosestByClassName(moveEvent.target as HTMLElement, "dock__items") as HTMLElement; + if (targetItem && selectItem && targetItem.isSameNode(selectItem)) { + if (selectItem.classList.contains("dock__item")) { + const selectRect = selectItem.getBoundingClientRect(); + if (selectItem.parentElement.parentElement.id === "dockBottom") { + if (selectRect.left + selectRect.width / 2 > moveEvent.clientX) { + selectItem.before(item); + } else { + selectItem.after(item); + } + } else { + if (selectRect.top + selectRect.height / 2 > moveEvent.clientY) { + selectItem.before(item); + } else { + selectItem.after(item); + } + } + } else if (selectItem.childElementCount === 0) { + selectItem.append(item) + } else if (selectItem.childElementCount === 1 && selectItem.firstElementChild.classList.contains("dock__item--pin")) { + selectItem.insertAdjacentElement("afterbegin", item); + } + return; + } + if (!targetItem || targetItem.classList.contains("dock__item--pin") || targetItem.style.position === "fixed" || targetItem.isSameNode(item)) { + return; + } + selectItem = targetItem; + }; + + documentSelf.onmouseup = () => { + documentSelf.onmousemove = null; + documentSelf.onmouseup = null; + documentSelf.ondragstart = null; + documentSelf.onselectstart = null; + documentSelf.onselect = null; + ghostElement?.remove(); + if (item.classList.contains("b3-tooltips")) { + return; + } + item.style.opacity = ""; + item.classList.add("b3-tooltips"); + let dock + if (item.parentElement.parentElement.id === "dockBottom") { + dock = window.siyuan.layout.bottomDock; + } else if (item.parentElement.parentElement.id === "dockLeft") { + dock = window.siyuan.layout.leftDock; + } else if (item.parentElement.parentElement.id === "dockRight") { + dock = window.siyuan.layout.rightDock; + } + dock.add(item.parentElement.isSameNode(dock.element.firstElementChild) ? 0 : 1, item, item.previousElementSibling?.getAttribute("data-type")); + }; + }); + this.layout.element.addEventListener("mouseleave", (event: MouseEvent & { toElement: HTMLElement }) => { if (event.buttons !== 0 || this.pin || event.toElement?.classList.contains("b3-menu")) { return; @@ -584,7 +684,7 @@ export class Dock { this.showDock(); } - public add(index: number, sourceElement: Element) { + public add(index: number, sourceElement: Element, previousType?:string) { sourceElement.setAttribute("data-height", ""); sourceElement.setAttribute("data-width", ""); const type = sourceElement.getAttribute("data-type"); @@ -608,17 +708,22 @@ export class Dock { sourceElement.classList.remove("b3-tooltips__n", "b3-tooltips__ne", "b3-tooltips__nw", "b3-tooltips__s", "b3-tooltips__se", "b3-tooltips__sw", "b3-tooltips__e", "b3-tooltips__w"); sourceElement.classList.add(`b3-tooltips__${this.getClassDirect(index)}`); sourceElement.setAttribute("data-index", index.toString()); - if (index === 0) { - this.element.firstElementChild.insertAdjacentElement("afterbegin", sourceElement); + if (previousType) { + this.element.querySelector(`[data-type="${previousType}"]`).after(sourceElement); } else { - this.element.lastElementChild.insertAdjacentElement("afterbegin", sourceElement); + if (index === 0) { + this.element.firstElementChild.insertAdjacentElement("afterbegin", sourceElement); + } else { + this.element.lastElementChild.insertAdjacentElement("afterbegin", sourceElement); + } } this.element.classList.remove("fn__none"); resetFloatDockSize(); this.data[type] = true; if (hasActive) { - this.toggleModel(type, true); + this.toggleModel(type, true, false, false, false); } + saveLayout(); } public remove(key: string) { diff --git a/app/src/menus/dock.ts b/app/src/menus/dock.ts index 844903966d..9dd7fa37d2 100644 --- a/app/src/menus/dock.ts +++ b/app/src/menus/dock.ts @@ -13,7 +13,6 @@ const moveMenuItem = (label: string, target: Element) => { } else if (label.indexOf("moveToBottom") > -1) { window.siyuan.layout.bottomDock.add(label.endsWith("Left") ? 0 : 1, target); } - saveLayout(); } }); }; From b8f83c414c102a965b60747944cbce07e4c52662 Mon Sep 17 00:00:00 2001 From: Soltus Date: Sat, 1 Jun 2024 02:22:21 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E9=9B=86=E6=88=90=20jupyter-binder-pytho?= =?UTF-8?q?n=20#650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 0824b1312b..f35d579ba0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -59,6 +59,7 @@ ENV RUN_IN_CONTAINER=true EXPOSE 58131 LABEL maintainer="Soltus<694357845@qq.com>" +# 默认值,用户应当修改 ENV SILLOT_ARGS_KERNEL="--accessAuthCode 58131" ENV SILLOT_ARGS_JUPYTER="--port=8888 --ip=* --no-browser --allow-root" ENTRYPOINT [ "/tini", "--", "/opt/Sillot/Docker_entry.sh" ] From 3a22facf495ebe7cc22473da800eba3e3da9ee7b Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sat, 1 Jun 2024 11:01:29 +0800 Subject: [PATCH 03/10] :fire: CD workflow no longer support 32-bit windows --- .github/workflows/cd.yml | 5 ----- scripts/get-tdm-gcc.sh | 41 ---------------------------------------- 2 files changed, 46 deletions(-) delete mode 100644 scripts/get-tdm-gcc.sh diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d6f67a9276..06990fe97b 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -151,11 +151,6 @@ jobs: with: install: p7zip mingw-w64-x86_64-lua - - name: Set up TDM-GCC - run: msys2 -c "bash go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/scripts/get-tdm-gcc.sh tdm https://github.com/jmeubank/tdm-gcc/releases/download/v10.3.0-tdm-1/tdm-gcc-10.3.0.exe" && echo "CC=${{ github.workspace }}/tdm/bin/gcc.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - if: "contains( matrix.config.goarch, '386')" - working-directory: ${{ github.workspace }} - - name: Set up Go uses: actions/setup-go@v5 with: diff --git a/scripts/get-tdm-gcc.sh b/scripts/get-tdm-gcc.sh deleted file mode 100644 index 21481a9b25..0000000000 --- a/scripts/get-tdm-gcc.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -# This script is to set up tdm-gcc environment for windows ci. -# BE CAREFUL! THIS SCRIPT WILL DESTROY THE ROOT OF TDM-DCC AT FIRST. -# Usage: -# bash /path/to/the/script /path/to/tdm-gcc/sysroot - -BASEDIR=$(rm -rf $1 && mkdir $1 && cd $1 && pwd) -TDM_URL=$2 - -function DecompressTDM () { - echo "Downloading From ${TDM_URL}..." - wget ${TDM_URL} -O "${BASEDIR}/tdm.exe" > /dev/null - echo "Decompress the archive..." - 7z e -y "${BASEDIR}/tdm.exe" -o"${BASEDIR}" > /dev/null - for tarbar in "${BASEDIR}/"*.tar.xz - do - # We can't use tar -Jxvf here, it will cause pipeline hanging. - xz -d "${tarbar}" -c > "${tarbar%.xz}" - tar -xf "${tarbar%.xz}" -C ${BASEDIR} - done -} - - -function CreateFeaturesHeader() { - echo "Creating features.h..." - cat > "${BASEDIR}/include/features.h" < Date: Sat, 1 Jun 2024 11:31:17 +0800 Subject: [PATCH 04/10] :art: fix https://github.com/siyuan-note/siyuan/issues/11605 --- app/src/protyle/wysiwyg/turnIntoList.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/protyle/wysiwyg/turnIntoList.ts b/app/src/protyle/wysiwyg/turnIntoList.ts index 56f12e6864..de3a716647 100644 --- a/app/src/protyle/wysiwyg/turnIntoList.ts +++ b/app/src/protyle/wysiwyg/turnIntoList.ts @@ -57,16 +57,16 @@ export const turnIntoTaskList = (protyle: IProtyle, type: string, blockElement: action: "delete", id: emptyId }], [{ - action: "update", - id, - data: oldHTML, - }, { action: "move", id, previousID: newId, }, { action: "delete", id: newId + }, { + action: "update", + id, + data: oldHTML, }]); blockElement.outerHTML = `
${blockElement.outerHTML}
`; focusByWbr(protyle.wysiwyg.element, range); From f2e76a77b3a964c7d453e6daf3a2c391ee29071e Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 1 Jun 2024 12:08:43 +0800 Subject: [PATCH 05/10] :art: fix https://github.com/siyuan-note/siyuan/issues/11589 --- app/src/assets/scss/protyle/_wysiwyg.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/assets/scss/protyle/_wysiwyg.scss b/app/src/assets/scss/protyle/_wysiwyg.scss index 78da728e76..6edde22c5f 100644 --- a/app/src/assets/scss/protyle/_wysiwyg.scss +++ b/app/src/assets/scss/protyle/_wysiwyg.scss @@ -445,6 +445,11 @@ background-color: var(--b3-theme-primary-lightest) !important; } + // https://github.com/siyuan-note/siyuan/issues/11589 + .hljs wbr { + display: none; + } + &--hl, &--hl .hljs { transition: var(--b3-background-transition); From a8551144bec5fc33cf6f0604250cee846c4d553a Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sat, 1 Jun 2024 17:59:56 +0800 Subject: [PATCH 06/10] :art: Support Linux arm64 https://github.com/siyuan-note/siyuan/issues/11566 --- scripts/linux-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/linux-build.sh b/scripts/linux-build.sh index 91b8325591..7357723365 100755 --- a/scripts/linux-build.sh +++ b/scripts/linux-build.sh @@ -25,7 +25,7 @@ go build --tags fts5 -v -o "../app/kernel-linux/SiYuan-Kernel" -ldflags "-s -w" echo 'Building Kernel arm64' export GOARCH=arm64 -export CC=~/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc +export CC=~/llvm-mingw-20240518-ucrt-ubuntu-20.04-x86_64/bin/aarch64-w64-mingw32-gcc go build --tags fts5 -v -o "../app/kernel-linux-arm64/SiYuan-Kernel" -ldflags "-s -w" . cd .. From baaec946eea552bd57756d2d78ac781911442b9e Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sat, 1 Jun 2024 18:11:11 +0800 Subject: [PATCH 07/10] :art: Support Linux arm64 https://github.com/siyuan-note/siyuan/issues/11566 --- scripts/linux-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/linux-build.sh b/scripts/linux-build.sh index 7357723365..91b8325591 100755 --- a/scripts/linux-build.sh +++ b/scripts/linux-build.sh @@ -25,7 +25,7 @@ go build --tags fts5 -v -o "../app/kernel-linux/SiYuan-Kernel" -ldflags "-s -w" echo 'Building Kernel arm64' export GOARCH=arm64 -export CC=~/llvm-mingw-20240518-ucrt-ubuntu-20.04-x86_64/bin/aarch64-w64-mingw32-gcc +export CC=~/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc go build --tags fts5 -v -o "../app/kernel-linux-arm64/SiYuan-Kernel" -ldflags "-s -w" . cd .. From 81a5df387a07f4cd4d73a71556b33c2789a8f8d9 Mon Sep 17 00:00:00 2001 From: Soltus Date: Sat, 1 Jun 2024 18:15:32 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=F0=9F=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/extensions/Sillot/package.json | 2 +- app/package.json | 2 +- docs/starlight/package.json | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.vscode/extensions/Sillot/package.json b/.vscode/extensions/Sillot/package.json index 8d72b18591..cb71fcee45 100644 --- a/.vscode/extensions/Sillot/package.json +++ b/.vscode/extensions/Sillot/package.json @@ -2,7 +2,7 @@ "name": "sillot", "displayName": "汐洛 Sillot", "description": "汐洛彖夲肜矩阵(Sillot T☳Converbenk Matrix)为智慧新彖务服务。此插件为汐洛官方插件,提供多功能一体化集成。", - "version": "0.35.2297", + "version": "0.35.2300", "preview": true, "repository": "https://github.com/Hi-Windom/Sillot", "publisher": "Hi-Windom", diff --git a/app/package.json b/app/package.json index 3cfee68f55..1f86339407 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "sillot", - "version": "0.35.2297", + "version": "0.35.2300", "syv": "3.1.0", "sypv": "[3.0.16]", "description": "Build Your Eternal Digital Garden", diff --git a/docs/starlight/package.json b/docs/starlight/package.json index 5dcc8418f3..fc6c3ff100 100644 --- a/docs/starlight/package.json +++ b/docs/starlight/package.json @@ -1,7 +1,7 @@ { "name": "starlight", "type": "module", - "version": "0.35.2297", + "version": "0.35.2300", "scripts": { "test": "echo 'Test your sister day by day'", "dev": "astro dev", diff --git a/package.json b/package.json index cce244d990..ac2740f3a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Sillot-workspace", - "version": "0.35.2297", + "version": "0.35.2300", "description": "汐洛 pnpm 工作区", "packageManager": "pnpm@9.1.4", "scripts": { From f3dc90a7cba6509454bcacf43fe6d12344bb9c19 Mon Sep 17 00:00:00 2001 From: Soltus Date: Sat, 1 Jun 2024 18:46:54 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E4=BC=98=E5=8C=96=20github=20release=20b?= =?UTF-8?q?ody=20=E8=BE=93=E5=87=BA=20#802?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/_pkg/Const.py | 97 +++++++++++++------------ scripts/_pkg/Utils.py | 162 +++++++++++++++++++++--------------------- 2 files changed, 129 insertions(+), 130 deletions(-) diff --git a/scripts/_pkg/Const.py b/scripts/_pkg/Const.py index 1ae9bb0500..0c29f8b1ed 100644 --- a/scripts/_pkg/Const.py +++ b/scripts/_pkg/Const.py @@ -1,49 +1,48 @@ -docmap_sillot = { - "Feature": "引入特性 | Feature", - "Enhancement": "改进功能 | Enhancement", - "Bug": "修复错误 | Bugfix", - "Security": "安全相关 | Security", - "Document": "文档相关 | Document", - "Refactor": "开发重构 | Refactor", - "Abolishment": "移除废止 | Abolishment", - "Shinning": "闪亮之名 | Shinning", - "VSCE": "VSCode 扩展相关 | VSCE", -} -# 仅关注核心部分 -docmap_siyuan = { - "Feature": "引入特性 | Feature", - "Enhancement": "改进功能 | Enhancement", - # "Bug": "修复错误 | Bugfix", - # "Document": "文档相关 | Document", - "Refactor": "开发重构 | Refactor", - "Abolishment": "移除废止 | Abolishment", - "Development": "开发者相关 | Development", -} - -repo_siyuan = "siyuan-note/siyuan" -repo_sillot = "Hi-Windom/Sillot" -hostname = "api.github.com" - - -HEADER_sillot = ''' - -# ❤️ 欢迎共建汐洛 694357845@qq.com -# 🚧 汐洛仅用于开发者测试,不要用来存储重要数据! - -🚢 [Docker image](https://hub.docker.com/r/soltus/sillot/tags?page=1&ordering=last_updated) 📦 [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=Hi-Windom.sillot) 📦 [Chromium Browser Extension(维护中)](https://github.com/K-Sillot/Sillot-Be/releases) - - - - - ---- - -''' - -HEADER_siyuan = ''' -''' - -HEADER = { - "siyuan-note/siyuan": HEADER_siyuan, - "Hi-Windom/Sillot": HEADER_sillot -} +docmap_sillot = { + "Feature": "引入特性 | Feature", + "Enhancement": "改进功能 | Enhancement", + "Bug": "修复错误 | Bugfix", + "Security": "安全相关 | Security", + "Document": "文档相关 | Document", + "Refactor": "开发重构 | Refactor", + "Abolishment": "移除废止 | Abolishment", + "Shinning": "闪亮之名 | Shinning", + "VSCE": "VSCode 扩展相关 | VSCE", +} +# 仅关注核心部分 +docmap_siyuan = { + "Feature": "引入特性 | Feature", + "Enhancement": "改进功能 | Enhancement", + # "Bug": "修复错误 | Bugfix", + # "Document": "文档相关 | Document", + "Refactor": "开发重构 | Refactor", + "Abolishment": "移除废止 | Abolishment", + "Development": "开发者相关 | Development", +} + +repo_siyuan = "siyuan-note/siyuan" +repo_sillot = "Hi-Windom/Sillot" +hostname = "api.github.com" + + +HEADER_sillot = ''' + +# 🚧 汐洛仅用于开发者测试,不要用来存储重要数据! + +🚢 [Docker image](https://hub.docker.com/r/soltus/sillot/tags?page=1&ordering=last_updated) 📦 [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=Hi-Windom.sillot) 📦 [Chromium Browser Extension(维护中)](https://github.com/K-Sillot/Sillot-Be/releases) + + + + + +--- + +''' + +HEADER_siyuan = ''' +''' + +HEADER = { + "siyuan-note/siyuan": HEADER_siyuan, + "Hi-Windom/Sillot": HEADER_sillot +} diff --git a/scripts/_pkg/Utils.py b/scripts/_pkg/Utils.py index ec8f9f743e..d94ab3dca5 100644 --- a/scripts/_pkg/Utils.py +++ b/scripts/_pkg/Utils.py @@ -1,81 +1,81 @@ -import re, ast - -def quote_versions_v2(s): - """ - 支持一个或两个点号分隔的版本号,请确保格式正确,本函数不做校验 - 字符串示例: "[3.0.7, 3.0.6, 3.0, 3.1]" - """ - return ast.literal_eval(re.sub(r'(\b\d+(\.\d+){1,2}\b)', r'"\1"', s)) - -def find_milestone(repo, title, len=0): - """Find the milestone in a repository that is similar to milestone title - - Args: - repo (github.repository.Repository): The repository to search - title (str): the title to match - len: 版本号长度限制,默认 0 不限制 - - Returns: - The milestone which title matches the given argument. - If no milestone matches, it will return None - """ - thisRelease = title.split("/")[-1] - pat = re.search("v([0-9.]+)", thisRelease) - if not pat: - return None - if len > 0: - version = ".".join(pat.group(1).split(".")[:len]) - else: - version = ".".join(pat.group(1).split(".")[:]) - - # REF https://docs.github.com/en/rest/issues/milestones?apiVersion=2022-11-28#list-milestones - for milestone in repo.get_milestones(state="all"): - if version in milestone.title: - return milestone - -def generate_msg(desc_mapping, docmap): - """Print changelogs from direction.""" - print() - for header in docmap: - if not desc_mapping[header]: - continue - print(f"#### {docmap[header]}\n") - for item in desc_mapping[header]: - print(f"* [{item['title']}]({item['url']})") - print() - -def get_issue_first_label(issue, docmap): - """Get the first label from issue, if no labels, return empty string.""" - for label in issue.get_labels(): - if label.name in docmap: - return label.name - return "" - -def generate_header_from_repo(repo_name, tag_name, lastestRelease, electron_version, action_file, HEADER=''): - thisRelease = tag_name.split("/")[-1] - pat = re.search("v([0-9.]+)", thisRelease) - if not pat: - return None - - return f''' -

- - -GitHub commits difference between two branches/tags/commits -Electron -

- -{HEADER}''' - -def print_taget2siyuan(tag_name, otherReleaseArray): - print('# [@SiYuan](https://github.com/siyuan-note/siyuan)\n') - arr = quote_versions_v2(otherReleaseArray) - if len(arr) > 0: - print('''### 非目标思源版本更新:''', end="") - for v in arr: - print(f'''[v{v}](https://github.com/siyuan-note/siyuan/releases/tag/{v}) ''', end="") - print(f''' - -## ⚓ [{tag_name}](https://github.com/siyuan-note/siyuan/releases/tag/{tag_name}) 值得注意的变化 - -''') +import re, ast + +def quote_versions_v2(s): + """ + 支持一个或两个点号分隔的版本号,请确保格式正确,本函数不做校验 + 字符串示例: "[3.0.7, 3.0.6, 3.0, 3.1]" + """ + return ast.literal_eval(re.sub(r'(\b\d+(\.\d+){1,2}\b)', r'"\1"', s)) + +def find_milestone(repo, title, len=0): + """Find the milestone in a repository that is similar to milestone title + + Args: + repo (github.repository.Repository): The repository to search + title (str): the title to match + len: 版本号长度限制,默认 0 不限制 + + Returns: + The milestone which title matches the given argument. + If no milestone matches, it will return None + """ + thisRelease = title.split("/")[-1] + pat = re.search("v([0-9.]+)", thisRelease) + if not pat: + return None + if len > 0: + version = ".".join(pat.group(1).split(".")[:len]) + else: + version = ".".join(pat.group(1).split(".")[:]) + + # REF https://docs.github.com/en/rest/issues/milestones?apiVersion=2022-11-28#list-milestones + for milestone in repo.get_milestones(state="all"): + if version in milestone.title: + return milestone + +def generate_msg(desc_mapping, docmap): + """Print changelogs from direction.""" + print() + for header in docmap: + if not desc_mapping[header]: + continue + print(f"#### {docmap[header]}\n") + items = [f"[{item['title']}]({item['url']})" for item in desc_mapping[header]] + print(" | ".join(items)) + print() + +def get_issue_first_label(issue, docmap): + """Get the first label from issue, if no labels, return empty string.""" + for label in issue.get_labels(): + if label.name in docmap: + return label.name + return "" + +def generate_header_from_repo(repo_name, tag_name, lastestRelease, electron_version, action_file, HEADER=''): + thisRelease = tag_name.split("/")[-1] + pat = re.search("v([0-9.]+)", thisRelease) + if not pat: + return None + + return f''' +

+ + +GitHub commits difference between two branches/tags/commits +Electron +

+ +{HEADER}''' + +def print_taget2siyuan(tag_name, otherReleaseArray): + print('# [@SiYuan](https://github.com/siyuan-note/siyuan)\n') + arr = quote_versions_v2(otherReleaseArray) + if len(arr) > 0: + print('''### 非目标思源版本更新:''', end="") + for v in arr: + print(f'''[v{v}](https://github.com/siyuan-note/siyuan/releases/tag/{v}) ''', end="") + print(f''' + +## ⚓ [{tag_name}](https://github.com/siyuan-note/siyuan/releases/tag/{tag_name}) 值得注意的变化 + +''') From c79092e51937fcac467ec13e062aa895dfd8ad6d Mon Sep 17 00:00:00 2001 From: Soltus Date: Sat, 1 Jun 2024 18:48:55 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=F0=9F=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/extensions/Sillot/package.json | 2 +- app/package.json | 2 +- docs/starlight/package.json | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.vscode/extensions/Sillot/package.json b/.vscode/extensions/Sillot/package.json index cb71fcee45..ebf90776f5 100644 --- a/.vscode/extensions/Sillot/package.json +++ b/.vscode/extensions/Sillot/package.json @@ -2,7 +2,7 @@ "name": "sillot", "displayName": "汐洛 Sillot", "description": "汐洛彖夲肜矩阵(Sillot T☳Converbenk Matrix)为智慧新彖务服务。此插件为汐洛官方插件,提供多功能一体化集成。", - "version": "0.35.2300", + "version": "0.35.2310", "preview": true, "repository": "https://github.com/Hi-Windom/Sillot", "publisher": "Hi-Windom", diff --git a/app/package.json b/app/package.json index 1f86339407..18ec36abcc 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "sillot", - "version": "0.35.2300", + "version": "0.35.2310", "syv": "3.1.0", "sypv": "[3.0.16]", "description": "Build Your Eternal Digital Garden", diff --git a/docs/starlight/package.json b/docs/starlight/package.json index fc6c3ff100..8c76d58f3c 100644 --- a/docs/starlight/package.json +++ b/docs/starlight/package.json @@ -1,7 +1,7 @@ { "name": "starlight", "type": "module", - "version": "0.35.2300", + "version": "0.35.2310", "scripts": { "test": "echo 'Test your sister day by day'", "dev": "astro dev", diff --git a/package.json b/package.json index ac2740f3a8..f56db1bcec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Sillot-workspace", - "version": "0.35.2300", + "version": "0.35.2310", "description": "汐洛 pnpm 工作区", "packageManager": "pnpm@9.1.4", "scripts": {