mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
🎨 Update attr panel for av
This commit is contained in:
@@ -8,6 +8,9 @@ import {popTextCell} from "./cell";
|
||||
export const genAVValueHTML = (value: IAVCellValue) => {
|
||||
let html = "";
|
||||
switch (value.type) {
|
||||
case "block":
|
||||
html = `<div class="fn__flex-1">${value.block.content}</div>`;
|
||||
break;
|
||||
case "text":
|
||||
html = `<textarea rows="${value.text.content.split("\n").length}" class="b3-text-field b3-text-field--text fn__flex-1">${value.text.content}</textarea>`;
|
||||
break;
|
||||
|
||||
@@ -123,10 +123,6 @@ func GetBlockAttributeViewKeys(blockID string) (ret []*BlockAttributeViewKeys) {
|
||||
|
||||
var keyValues []*av.KeyValues
|
||||
for _, kv := range attrView.KeyValues {
|
||||
if av.KeyTypeBlock == kv.Key.Type {
|
||||
continue
|
||||
}
|
||||
|
||||
kValues := &av.KeyValues{Key: kv.Key}
|
||||
for _, v := range kv.Values {
|
||||
if v.BlockID == blockID {
|
||||
@@ -180,7 +176,11 @@ func GetBlockAttributeViewKeys(blockID string) (ret []*BlockAttributeViewKeys) {
|
||||
switch kv.Key.Type {
|
||||
case av.KeyTypeTemplate:
|
||||
if 0 < len(kv.Values) {
|
||||
ial := GetBlockAttrs(blockID)
|
||||
ial := map[string]string{}
|
||||
block := getRowBlockValue(keyValues)
|
||||
if !block.IsDetached {
|
||||
ial = GetBlockAttrs(blockID)
|
||||
}
|
||||
kv.Values[0].Template.Content = renderTemplateCol(ial, kv.Key.Template, keyValues)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user