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

This commit is contained in:
Vanessa 2025-06-26 22:27:19 +08:00
commit a2086f66e0
16 changed files with 77 additions and 19 deletions

View File

@ -1,7 +1,7 @@
{
"hideEmptyFields": "إخفاء الحقول الفارغة",
"displayEmptyFields": "عرض الحقول الفارغة",
"cardAspectRatio": "نسبة العرض إلى الارتفاع للبطاقة",
"cardAspectRatio": "نسبة العرض إلى الارتفاع لمنطقة المعاينة",
"cardPreview1": "معاينة البطاقة",
"contentImage": "صورة المحتوى",
"cardSize": "حجم البطاقة",

View File

@ -1,7 +1,7 @@
{
"hideEmptyFields": "Leere Felder ausblenden",
"displayEmptyFields": "Leere Felder anzeigen",
"cardAspectRatio": "Seitenverhältnis der Karte",
"cardAspectRatio": "Seitenverhältnis des Vorschau-Bereichs",
"cardPreview1": "Kartenansicht",
"contentImage": "Inhaltsbild",
"cardSize": "Kartengröße",

View File

@ -1,7 +1,7 @@
{
"hideEmptyFields": "Hide empty fields",
"displayEmptyFields": "Display empty fields",
"cardAspectRatio": "Card aspect ratio",
"cardAspectRatio": "Preview area aspect ratio",
"cardPreview1": "Card preview",
"contentImage": "Content image",
"cardSize": "Card size",

View File

@ -1,7 +1,7 @@
{
"hideEmptyFields": "Ocultar campos vacíos",
"displayEmptyFields": "Mostrar campos vacíos",
"cardAspectRatio": "Proporción de la tarjeta",
"cardAspectRatio": "Proporción del área de vista previa",
"cardPreview1": "Vista previa de la tarjeta",
"contentImage": "Imagen del contenido",
"cardSize": "Tamaño de la tarjeta",

View File

@ -1,7 +1,7 @@
{
"hideEmptyFields": "Masquer les champs vides",
"displayEmptyFields": "Afficher les champs vides",
"cardAspectRatio": "Proportions de la carte",
"cardAspectRatio": "Proportions de la zone d'aperçu",
"cardPreview1": "Aperçu de la carte",
"contentImage": "Image du contenu",
"cardSize": "Taille de la carte",

View File

@ -1,7 +1,7 @@
{
"hideEmptyFields": "הסתר שדות ריקים",
"displayEmptyFields": "הצג שדות ריקים",
"cardAspectRatio": "יחס גובה-רוחב של כרטיס",
"cardAspectRatio": "יחס גובה-רוחב של אזור התצוגה המקדימה",
"cardPreview1": "תצוגה מקדימה של כרטיס",
"contentImage": "תמונת תוכן",
"cardSize": "גודל כרטיס",

View File

@ -1,7 +1,7 @@
{
"hideEmptyFields": "Nascondi campi vuoti",
"displayEmptyFields": "Mostra campi vuoti",
"cardAspectRatio": "Proporzioni della carta",
"cardAspectRatio": "Proporzioni dell'area di anteprima",
"cardPreview1": "Anteprima della carta",
"contentImage": "Immagine del contenuto",
"cardSize": "Dimensione della carta",

View File

@ -1,7 +1,7 @@
{
"hideEmptyFields": "空のフィールドを非表示",
"displayEmptyFields": "空のフィールドを表示",
"cardAspectRatio": "カードのアスペクト比",
"cardAspectRatio": "プレビューエリアのアスペクト比",
"cardPreview1": "カードプレビュー",
"contentImage": "コンテンツ画像",
"cardSize": "カードサイズ",

View File

@ -1,7 +1,7 @@
{
"hideEmptyFields": "Ukryj puste pola",
"displayEmptyFields": "Pokaż puste pola",
"cardAspectRatio": "Proporcje karty",
"cardAspectRatio": "Proporcje obszaru podglądu",
"cardPreview1": "Podgląd karty",
"contentImage": "Obraz treści",
"cardSize": "Rozmiar karty",

View File

@ -1,7 +1,7 @@
{
"hideEmptyFields": "Ocultar campos vazios",
"displayEmptyFields": "Exibir campos vazios",
"cardAspectRatio": "Proporção da carta",
"cardAspectRatio": "Proporção da área de visualização",
"cardPreview1": "Pré-visualização do cartão",
"contentImage": "Imagem do conteúdo",
"cardSize": "Tamanho do cartão",

View File

@ -1,7 +1,7 @@
{
"hideEmptyFields": "Скрыть пустые поля",
"displayEmptyFields": "Показать пустые поля",
"cardAspectRatio": "Соотношение сторон карточки",
"cardAspectRatio": "Соотношение сторон области предварительного просмотра",
"cardPreview1": "Предпросмотр карты",
"contentImage": "Изображение содержимого",
"cardSize": "Размер карты",

View File

@ -1,7 +1,7 @@
{
"hideEmptyFields": "隱藏空字段",
"displayEmptyFields": "顯示空字段",
"cardAspectRatio": "卡片寬高比",
"cardAspectRatio": "預覽區寬高比",
"cardPreview1": "卡片預覽",
"contentImage": "內容圖片",
"cardSize": "卡片大小",

View File

@ -1,7 +1,7 @@
{
"hideEmptyFields": "隐藏空字段",
"displayEmptyFields": "显示空字段",
"cardAspectRatio": "卡片宽高比",
"cardAspectRatio": "预览区宽高比",
"cardPreview1": "卡片预览",
"contentImage": "内容图",
"cardSize": "卡片大小",

View File

@ -26,18 +26,18 @@ export const getLayoutHTML = (data: IAV) => {
<span class="b3-menu__accelerator">${coverFromTitle}</span>
<svg class="b3-menu__icon b3-menu__icon--small"><use xlink:href="#iconRight"></use></svg>
</button>
<button class="b3-menu__item" data-type="set-gallery-size">
<span class="fn__flex-center">${window.siyuan.languages.cardSize}</span>
<span class="fn__flex-1"></span>
<span class="b3-menu__accelerator">${view.cardSize === 0 ? window.siyuan.languages.small : (view.cardSize === 1 ? window.siyuan.languages.medium : window.siyuan.languages.large)}</span>
<svg class="b3-menu__icon b3-menu__icon--small"><use xlink:href="#iconRight"></use></svg>
</button>
<button class="b3-menu__item" data-type="set-gallery-ratio">
<span class="fn__flex-center">${window.siyuan.languages.cardAspectRatio}</span>
<span class="fn__flex-1"></span>
<span class="b3-menu__accelerator">${getCardAspectRatio(view.cardAspectRatio)}</span>
<svg class="b3-menu__icon b3-menu__icon--small"><use xlink:href="#iconRight"></use></svg>
</button>
<button class="b3-menu__item" data-type="set-gallery-size">
<span class="fn__flex-center">${window.siyuan.languages.cardSize}</span>
<span class="fn__flex-1"></span>
<span class="b3-menu__accelerator">${view.cardSize === 0 ? window.siyuan.languages.small : (view.cardSize === 1 ? window.siyuan.languages.medium : window.siyuan.languages.large)}</span>
<svg class="b3-menu__icon b3-menu__icon--small"><use xlink:href="#iconRight"></use></svg>
</button>
<label class="b3-menu__item">
<span class="fn__flex-center">${window.siyuan.languages.fitImage}</span>
<span class="fn__space fn__flex-1"></span>

57
kernel/av/group.go Normal file
View File

@ -0,0 +1,57 @@
// SiYuan - Refactor your thinking
// Copyright (c) 2020-present, b3log.org
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package av
// Groupable 定义了可分组的视图类型。
type Groupable interface {
// Group 根据视图中设置的分组规则进行分组。
Group(attrView *AttributeView)
}
type ViewGroup struct {
Field string `json:"field"` // 分组字段 ID
Method GroupMethod `json:"method"` // 分组方式
Range *GroupRange `json:"range,omitempty"` // 分组范围
Order GroupOrder `json:"order"` // 分组顺序
}
type GroupMethod int
const (
GroupMethodValue GroupMethod = iota // 按值分组
GroupMethodRangeNum // 按数字范围分组
GroupMethodDateRelative // 按相对日期日期分组
GroupMethodDateDay // 按天日期分组
GroupMethodDateWeek // 按周日期分组
GroupMethodDateMonth // 按月日期分组
GroupMethodDateYear // 按年日期分组
)
// GroupRange 定义了分组范围的结构。
type GroupRange struct {
NumStart float64 `json:"numStart"` // 数字范围起始值
NumEnd float64 `json:"numEnd"` // 数字范围结束值
NumStep float64 `json:"numStep"` // 数字范围步长
}
type GroupOrder string
const (
GroupOrderAsc GroupOrder = "ASC"
GroupOrderDesc GroupOrder = "DESC"
)

View File

@ -242,6 +242,7 @@ func prepareWriteTree(tree *parse.Tree) (data []byte, filePath string, err error
tree.Root.SetIALAttr("type", "doc")
renderer := render.NewJSONRenderer(tree, luteEngine.RenderOptions)
data = renderer.Render()
data = bytes.ReplaceAll(data, []byte("\\u0000"), []byte(""))
if !util.UseSingleLineSave {
buf := bytes.Buffer{}