Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2023-09-25 21:04:20 +08:00
commit 859a541155
12 changed files with 26 additions and 18 deletions

View file

@ -12,6 +12,7 @@ Below are the detailed changes in this version.
### Enhancement
* [Sorting notebooks automatically after creating a new notebook](https://github.com/siyuan-note/siyuan/issues/9213)
* [Improve auth failed tip for browser access on non `127.0.0.1`](https://github.com/siyuan-note/siyuan/issues/9224)
* [Improve traditional indentation when list items contain multiple blocks](https://github.com/siyuan-note/siyuan/issues/9226)
* [Improve the handling of inline-math containing `|` in the table](https://github.com/siyuan-note/siyuan/issues/9227)

View file

@ -12,6 +12,7 @@
### 改進功能
* [建立筆記本後自動刷新排序](https://github.com/siyuan-note/siyuan/issues/9213)
* [改進瀏覽器端使用非 `127.0.0.1` 存取時鑑權失敗提示](https://github.com/siyuan-note/siyuan/issues/9224)
* [改進清單項目下包含多塊時的傳統縮排表現](https://github.com/siyuan-note/siyuan/issues/9226)
* [改進表格中包含 `|` 時行級公式的處理](https://github.com/siyuan-note/siyuan/issues/9227)

View file

@ -12,6 +12,7 @@
### 改进功能
* [创建笔记本后自动刷新排序](https://github.com/siyuan-note/siyuan/issues/9213)
* [改进浏览器端使用非 `127.0.0.1` 访问时鉴权失败提示](https://github.com/siyuan-note/siyuan/issues/9224)
* [改进列表项下包含多块时的传统缩进表现](https://github.com/siyuan-note/siyuan/issues/9226)
* [改进表格中包含 `|` 时行级公式的处理](https://github.com/siyuan-note/siyuan/issues/9227)

View file

@ -20,7 +20,7 @@ import {hideElements} from "../ui/hideElements";
import {genAssetHTML} from "../../asset/renderAssets";
import {unicode2Emoji} from "../../emoji";
import {avRender} from "../render/av/render";
import {needSubscribe} from "../../util/needSubscribe";
import {isPaidUser} from "../../util/needSubscribe";
export const hintSlash = (key: string, protyle: IProtyle) => {
const allList: IHintData[] = [{
@ -48,7 +48,7 @@ export const hintSlash = (key: string, protyle: IProtyle) => {
value: Constants.ZWSP + 5,
html: '<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconSparkles"></use></svg><span class="b3-list-item__text">AI Chat</span></div>',
}]
if (!needSubscribe("")) {
if (isPaidUser()) {
allList.push({
filter: ["数据库", "属性视图", "shujuku", "shuxingshitu", "sjk", "sxst", "database", "attribute view"],
value: '<div data-type="NodeAttributeView" data-av-type="table"></div>',

View file

@ -12,7 +12,8 @@ export const needLogin = (tip = window.siyuan.languages.needLogin) => {
};
export const needSubscribe = (tip = window.siyuan.languages._kernel[29]) => {
if (window.siyuan.user && (window.siyuan.user.userSiYuanProExpireTime === -1 || window.siyuan.user.userSiYuanProExpireTime > 0)) {
if (window.siyuan.user && (window.siyuan.user.userSiYuanProExpireTime === -1 || window.siyuan.user.userSiYuanProExpireTime > 0) ||
window.siyuan.user.userSiYuanOneTimePayStatus === 1) {
return false;
}
if (tip) {
@ -27,3 +28,7 @@ export const needSubscribe = (tip = window.siyuan.languages._kernel[29]) => {
}
return true;
};
export const isPaidUser = () => {
return window.siyuan.user && (0 === window.siyuan.user.userSiYuanSubscriptionStatus || 1 === window.siyuan.user.userSiYuanOneTimePayStatus);
}

File diff suppressed because one or more lines are too long

View file

@ -8,7 +8,7 @@ require (
github.com/88250/css v0.1.2
github.com/88250/epub v0.0.0-20230830085737-c19055cd1f48
github.com/88250/gulu v1.2.3-0.20230615033005-b519d6875346
github.com/88250/lute v1.7.6-0.20230924015311-7fb7ebccc9a3
github.com/88250/lute v1.7.6-0.20230925081541-b99494256742
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ClarkThan/ahocorasick v0.0.0-20230727142813-c94579738c5b

View file

@ -61,8 +61,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5 h1:8HdZozCsXS
github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/88250/gulu v1.2.3-0.20230615033005-b519d6875346 h1:U0wZN6zuf+vUhzdHC6DbZE/bY5FUt3FuCwn/KgObV44=
github.com/88250/gulu v1.2.3-0.20230615033005-b519d6875346/go.mod h1:pTWnjt+6qUqNnP9xltswsJxgCBVu3C7eW09u48LWX0k=
github.com/88250/lute v1.7.6-0.20230924015311-7fb7ebccc9a3 h1:iqanujWKDPUUsPBS2H8JKsg1F4gZ4v3rsnn02fyKxVM=
github.com/88250/lute v1.7.6-0.20230924015311-7fb7ebccc9a3/go.mod h1:+wUqx/1kdFDbWtxn9LYJlaCOAeol2pjSO6w+WJTVQsg=
github.com/88250/lute v1.7.6-0.20230925081541-b99494256742 h1:Yxg7G5oZzTDk195TIku9FBoL5hDQ3zswW6j/XRJ9BKA=
github.com/88250/lute v1.7.6-0.20230925081541-b99494256742/go.mod h1:+wUqx/1kdFDbWtxn9LYJlaCOAeol2pjSO6w+WJTVQsg=
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c h1:Dl/8S9iLyPMTElnWIBxmjaLiWrkI5P4a21ivwAn5pU0=
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4=
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=

View file

@ -450,7 +450,7 @@ func addAttributeViewBlock(blockID string, operation *Operation, tree *parse.Tre
}
}
value := &av.Value{ID: ast.NewNodeID(), KeyID: blockValues.Key.ID, BlockID: blockID, Block: &av.ValueBlock{ID: blockID, Content: getNodeRefText(node)}}
value := &av.Value{ID: ast.NewNodeID(), KeyID: blockValues.Key.ID, BlockID: blockID, Type: av.KeyTypeBlock, Block: &av.ValueBlock{ID: blockID, Content: getNodeRefText(node)}}
blockValues.Values = append(blockValues.Values, value)
attrs := parse.IAL2Map(node.KramdownIAL)

View file

@ -714,12 +714,12 @@ func IsSubscriber() bool {
return nil != Conf.User && (-1 == Conf.User.UserSiYuanProExpireTime || 0 < Conf.User.UserSiYuanProExpireTime) && 0 == Conf.User.UserSiYuanSubscriptionStatus
}
func IsOneTimePaid() bool {
func IsPaidUser() bool {
if IsSubscriber() {
return true
}
return nil != Conf.User // Sign in to use S3/WebDAV data sync https://github.com/siyuan-note/siyuan/issues/8779
// TODO https://github.com/siyuan-note/siyuan/issues/8780
// TODO S3/WebDAV data sync and backup are available for a fee https://github.com/siyuan-note/siyuan/issues/8780
// return nil != Conf.User && 1 == Conf.User.UserSiYuanOneTimePayStatus
}

View file

@ -634,7 +634,7 @@ func DownloadCloudSnapshot(tag, id string) (err error) {
return
}
case conf.ProviderWebDAV, conf.ProviderS3:
if !IsOneTimePaid() {
if !IsPaidUser() {
util.PushErrMsg(Conf.Language(214), 5000)
return
}
@ -676,7 +676,7 @@ func UploadCloudSnapshot(tag, id string) (err error) {
return
}
case conf.ProviderWebDAV, conf.ProviderS3:
if !IsOneTimePaid() {
if !IsPaidUser() {
util.PushErrMsg(Conf.Language(214), 5000)
return
}
@ -722,7 +722,7 @@ func RemoveCloudRepoTag(tag string) (err error) {
return
}
case conf.ProviderWebDAV, conf.ProviderS3:
if !IsOneTimePaid() {
if !IsPaidUser() {
util.PushErrMsg(Conf.Language(214), 5000)
return
}
@ -754,7 +754,7 @@ func GetCloudRepoTagSnapshots() (ret []*dejavu.Log, err error) {
return
}
case conf.ProviderWebDAV, conf.ProviderS3:
if !IsOneTimePaid() {
if !IsPaidUser() {
util.PushErrMsg(Conf.Language(214), 5000)
return
}
@ -790,7 +790,7 @@ func GetCloudRepoSnapshots(page int) (ret []*dejavu.Log, pageCount, totalCount i
return
}
case conf.ProviderWebDAV, conf.ProviderS3:
if !IsOneTimePaid() {
if !IsPaidUser() {
util.PushErrMsg(Conf.Language(214), 5000)
return
}

View file

@ -235,7 +235,7 @@ func checkSync(boot, exit, byHand bool) bool {
return false
}
case conf.ProviderWebDAV, conf.ProviderS3:
if !IsOneTimePaid() {
if !IsPaidUser() {
return false
}
}