Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

feat: implement indent for list nodes

Steven98762be1e53c
diff --git a/api/v2/markdown_service.go b/api/v2/markdown_service.go
index 88336608a..78a9d735a 100644
--- a/api/v2/markdown_service.go
+++ b/api/v2/markdown_service.go
@@ -54,13 +54,13 @@ func convertFromASTNode(rawNode ast.Node) *apiv2pb.Node {
node.Node = &apiv2pb.Node_BlockquoteNode{BlockquoteNode: &apiv2pb.BlockquoteNode{Children: children}}
case *ast.OrderedList:
children := convertFromASTNodes(n.Children)
- node.Node = &apiv2pb.Node_OrderedListNode{OrderedListNode: &apiv2pb.OrderedListNode{Number: n.Number, Children: children}}
+ node.Node = &apiv2pb.Node_OrderedListNode{OrderedListNode: &apiv2pb.OrderedListNode{Number: n.Number, Indent: int32(n.Indent), Children: children}}
case *ast.UnorderedList:
children := convertFromASTNodes(n.Children)
- node.Node = &apiv2pb.Node_UnorderedListNode{UnorderedListNode: &apiv2pb.UnorderedListNode{Symbol: n.Symbol, Children: children}}
+ node.Node = &apiv2pb.Node_UnorderedListNode{UnorderedListNode: &apiv2pb.UnorderedListNode{Symbol: n.Symbol, Indent: int32(n.Indent), Children: children}}
case *ast.TaskList:
children := convertFromASTNodes(n.Children)
- node.Node = &apiv2pb.Node_TaskListNode{TaskListNode: &apiv2pb.TaskListNode{Symbol: n.Symbol, Complete: n.Complete, Children: children}}
+ node.Node = &apiv2pb.Node_TaskListNode{TaskListNode: &apiv2pb.TaskListNode{Symbol: n.Symbol, Indent: int32(n.Indent), Complete: n.Complete, Children: children}}
case *ast.MathBlock:
node.Node = &apiv2pb.Node_MathBlockNode{MathBlockNode: &apiv2pb.MathBlockNode{Content: n.Content}}
case *ast.Text:
@@ -123,13 +123,13 @@ func convertToASTNode(node *apiv2pb.Node) ast.Node {
return &ast.Blockquote{Children: children}
case *apiv2pb.Node_OrderedListNode:
children := convertToASTNodes(n.OrderedListNode.Children)
- return &ast.OrderedList{Number: n.OrderedListNode.Number, Children: children}
+ return &ast.OrderedList{Number: n.OrderedListNode.Number, Indent: int(n.OrderedListNode.Indent), Children: children}
case *apiv2pb.Node_UnorderedListNode:
children := convertToASTNodes(n.UnorderedListNode.Children)
- return &ast.UnorderedList{Symbol: n.UnorderedListNode.Symbol, Children: children}
+ return &ast.UnorderedList{Symbol: n.UnorderedListNode.Symbol, Indent: int(n.UnorderedListNode.Indent), Children: children}
case *apiv2pb.Node_TaskListNode:
children := convertToASTNodes(n.TaskListNode.Children)
- return &ast.TaskList{Symbol: n.TaskListNode.Symbol, Complete: n.TaskListNode.Complete, Children: children}
+ return &ast.TaskList{Symbol: n.TaskListNode.Symbol, Indent: int(n.TaskListNode.Indent), Complete: n.TaskListNode.Complete, Children: children}
case *apiv2pb.Node_MathBlockNode:
return &ast.MathBlock{Content: n.MathBlockNode.Content}
case *apiv2pb.Node_TextNode:
diff --git a/plugin/gomark/ast/block.go b/plugin/gomark/ast/block.go
index cd43a7f64..f5aa60fb5 100644
--- a/plugin/gomark/ast/block.go
+++ b/plugin/gomark/ast/block.go
@@ -1,6 +1,9 @@
package ast
-import "fmt"
+import (
+ "fmt"
+ "strings"
+)
type BaseBlock struct {
BaseNode
@@ -110,7 +113,10 @@ func (n *Blockquote) Restore() string {
type OrderedList struct {
BaseBlock
- Number string
+ // Number is the number of the list.
+ Number string
+ // Indent is the number of spaces.
+ Indent int
Children []Node
}
@@ -123,14 +129,16 @@ func (n *OrderedList) Restore() string {
for _, child := range n.Children {
result += child.Restore()
}
- return fmt.Sprintf("%s. %s", n.Number, result)
+ return fmt.Sprintf("%s%s. %s", strings.Repeat(" ", n.Indent), n.Number, result)
}
type UnorderedList struct {
BaseBlock
// Symbol is "*" or "-" or "+".
- Symbol string
+ Symbol string
+ // Indent is the number of spaces.
+ Indent int
Children []Node
}
@@ -143,14 +151,16 @@ func (n *UnorderedList) Restore() string {
for _, child := range n.Children {
result += child.Restore()
}
- return fmt.Sprintf("%s %s", n.Symbol, result)
+ return fmt.Sprintf("%s%s %s", strings.Repeat(" ", n.Indent), n.Symbol, result)
}
type TaskList struct {
BaseBlock
// Symbol is "*" or "-" or "+".
- Symbol string
+ Symbol string
+ // Indent is the number of spaces.
+ Indent int
Complete bool
Children []Node
}
@@ -168,7 +178,7 @@ func (n *TaskList) Restore() string {
if n.Complete {
complete = "x"
}
- return fmt.Sprintf("%s [%s] %s", n.Symbol, complete, result)
+ return fmt.Sprintf("%s%s [%s] %s", strings.Repeat(" ", n.Indent), n.Symbol, complete, result)
}
type MathBlock struct {
diff --git a/plugin/gomark/parser/ordered_list.go b/plugin/gomark/parser/ordered_list.go
index da3f71736..7d4ce118c 100644
--- a/plugin/gomark/parser/ordered_list.go
+++ b/plugin/gomark/parser/ordered_list.go
@@ -17,12 +17,22 @@ func (*OrderedListParser) Match(tokens []*tokenizer.Token) (int, bool) {
if len(tokens) < 4 {
return 0, false
}
- if tokens[0].Type != tokenizer.Number || tokens[1].Type != tokenizer.Dot || tokens[2].Type != tokenizer.Space {
+
+ indent := 0
+ for _, token := range tokens {
+ if token.Type == tokenizer.Space {
+ indent++
+ } else {
+ break
+ }
+ }
+ corsor := indent
+ if tokens[corsor].Type != tokenizer.Number || tokens[corsor+1].Type != tokenizer.Dot || tokens[corsor+2].Type != tokenizer.Space {
return 0, false
}
contentTokens := []*tokenizer.Token{}
- for _, token := range tokens[3:] {
+ for _, token := range tokens[corsor+3:] {
if token.Type == tokenizer.Newline {
break
}
@@ -33,7 +43,7 @@ func (*OrderedListParser) Match(tokens []*tokenizer.Token) (int, bool) {
return 0, false
}
- return len(contentTokens) + 3, true
+ return indent + len(contentTokens) + 3, true
}
func (p *OrderedListParser) Parse(tokens []*tokenizer.Token) (ast.Node, error) {
@@ -42,13 +52,22 @@ func (p *OrderedListParser) Parse(tokens []*tokenizer.Token) (ast.Node, error) {
return nil, errors.New("not matched")
}
- contentTokens := tokens[3:size]
+ indent := 0
+ for _, token := range tokens {
+ if token.Type == tokenizer.Space {
+ indent++
+ } else {
+ break
+ }
+ }
+ contentTokens := tokens[indent+3 : size]
children, err := ParseInline(contentTokens)
if err != nil {
return nil, err
}
return &ast.OrderedList{
- Number: tokens[0].Value,
+ Number: tokens[indent].Value,
+ Indent: indent,
Children: children,
}, nil
}
diff --git a/plugin/gomark/parser/ordered_list_test.go b/plugin/gomark/parser/ordered_list_test.go
index 4b1bcbcf5..70376b5fe 100644
--- a/plugin/gomark/parser/ordered_list_test.go
+++ b/plugin/gomark/parser/ordered_list_test.go
@@ -30,6 +30,18 @@ func TestOrderedListParser(t *testing.T) {
},
},
},
+ {
+ text: " 1. Hello World",
+ node: &ast.OrderedList{
+ Number: "1",
+ Indent: 2,
+ Children: []ast.Node{
+ &ast.Text{
+ Content: "Hello World",
+ },
+ },
+ },
+ },
{
text: "1aa. Hello World",
node: nil,
diff --git a/plugin/gomark/parser/paragraph.go b/plugin/gomark/parser/paragraph.go
index 40a6fe42a..942c0763e 100644
--- a/plugin/gomark/parser/paragraph.go
+++ b/plugin/gomark/parser/paragraph.go
@@ -26,9 +26,6 @@ func (*ParagraphParser) Match(tokens []*tokenizer.Token) (int, bool) {
if len(contentTokens) == 0 {
return 0, false
}
- if len(contentTokens) == 1 && contentTokens[0].Type == tokenizer.Newline {
- return 0, false
- }
return len(contentTokens), true
}
diff --git a/plugin/gomark/parser/task_list.go b/plugin/gomark/parser/task_list.go
index b46c1910b..b77a61208 100644
--- a/plugin/gomark/parser/task_list.go
+++ b/plugin/gomark/parser/task_list.go
@@ -18,22 +18,30 @@ func (*TaskListParser) Match(tokens []*tokenizer.Token) (int, bool) {
return 0, false
}
- symbolToken := tokens[0]
+ indent := 0
+ for _, token := range tokens {
+ if token.Type == tokenizer.Space {
+ indent++
+ } else {
+ break
+ }
+ }
+ symbolToken := tokens[indent]
if symbolToken.Type != tokenizer.Hyphen && symbolToken.Type != tokenizer.Asterisk && symbolToken.Type != tokenizer.PlusSign {
return 0, false
}
- if tokens[1].Type != tokenizer.Space {
+ if tokens[indent+1].Type != tokenizer.Space {
return 0, false
}
- if tokens[2].Type != tokenizer.LeftSquareBracket || (tokens[3].Type != tokenizer.Space && tokens[3].Value != "x") || tokens[4].Type != tokenizer.RightSquareBracket {
+ if tokens[indent+2].Type != tokenizer.LeftSquareBracket || (tokens[indent+3].Type != tokenizer.Space && tokens[indent+3].Value != "x") || tokens[indent+4].Type != tokenizer.RightSquareBracket {
return 0, false
}
- if tokens[5].Type != tokenizer.Space {
+ if tokens[indent+5].Type != tokenizer.Space {
return 0, false
}
contentTokens := []*tokenizer.Token{}
- for _, token := range tokens[6:] {
+ for _, token := range tokens[indent+6:] {
if token.Type == tokenizer.Newline {
break
}
@@ -43,7 +51,7 @@ func (*TaskListParser) Match(tokens []*tokenizer.Token) (int, bool) {
return 0, false
}
- return len(contentTokens) + 6, true
+ return indent + len(contentTokens) + 6, true
}
func (p *TaskListParser) Parse(tokens []*tokenizer.Token) (ast.Node, error) {
@@ -52,15 +60,24 @@ func (p *TaskListParser) Parse(tokens []*tokenizer.Token) (ast.Node, error) {
return nil, errors.New("not matched")
}
- symbolToken := tokens[0]
- contentTokens := tokens[6:size]
+ indent := 0
+ for _, token := range tokens {
+ if token.Type == tokenizer.Space {
+ indent++
+ } else {
+ break
+ }
+ }
+ symbolToken := tokens[indent]
+ contentTokens := tokens[indent+6 : size]
children, err := ParseInline(contentTokens)
if err != nil {
return nil, err
}
return &ast.TaskList{
Symbol: symbolToken.Type,
- Complete: tokens[3].Value == "x",
+ Indent: indent,
+ Complete: tokens[indent+3].Value == "x",
Children: children,
}, nil
}
diff --git a/plugin/gomark/parser/task_list_test.go b/plugin/gomark/parser/task_list_test.go
index d92775e47..a67c8b992 100644
--- a/plugin/gomark/parser/task_list_test.go
+++ b/plugin/gomark/parser/task_list_test.go
@@ -31,6 +31,19 @@ func TestTaskListParser(t *testing.T) {
},
},
},
+ {
+ text: " + [ ] Hello World",
+ node: &ast.TaskList{
+ Symbol: tokenizer.PlusSign,
+ Indent: 2,
+ Complete: false,
+ Children: []ast.Node{
+ &ast.Text{
+ Content: "Hello World",
+ },
+ },
+ },
+ },
{
text: "* [x] **Hello**",
node: &ast.TaskList{
diff --git a/plugin/gomark/parser/unordered_list.go b/plugin/gomark/parser/unordered_list.go
index c64daeb17..17582c221 100644
--- a/plugin/gomark/parser/unordered_list.go
+++ b/plugin/gomark/parser/unordered_list.go
@@ -17,13 +17,23 @@ func (*UnorderedListParser) Match(tokens []*tokenizer.Token) (int, bool) {
if len(tokens) < 3 {
return 0, false
}
- symbolToken := tokens[0]
- if (symbolToken.Type != tokenizer.Hyphen && symbolToken.Type != tokenizer.Asterisk && symbolToken.Type != tokenizer.PlusSign) || tokens[1].Type != tokenizer.Space {
+
+ indent := 0
+ for _, token := range tokens {
+ if token.Type == tokenizer.Space {
+ indent++
+ } else {
+ break
+ }
+ }
+ corsor := indent
+ symbolToken := tokens[corsor]
+ if (symbolToken.Type != tokenizer.Hyphen && symbolToken.Type != tokenizer.Asterisk && symbolToken.Type != tokenizer.PlusSign) || tokens[corsor+1].Type != tokenizer.Space {
return 0, false
}
contentTokens := []*tokenizer.Token{}
- for _, token := range tokens[2:] {
+ for _, token := range tokens[corsor+2:] {
if token.Type == tokenizer.Newline {
break
}
@@ -33,7 +43,7 @@ func (*UnorderedListParser) Match(tokens []*tokenizer.Token) (int, bool) {
return 0, false
}
- return len(contentTokens) + 2, true
+ return indent + len(contentTokens) + 2, true
}
func (p *UnorderedListParser) Parse(tokens []*tokenizer.Token) (ast.Node, error) {
@@ -42,14 +52,23 @@ func (p *UnorderedListParser) Parse(tokens []*tokenizer.Token) (ast.Node, error)
return nil, errors.New("not matched")
}
- symbolToken := tokens[0]
- contentTokens := tokens[2:size]
+ indent := 0
+ for _, token := range tokens {
+ if token.Type == tokenizer.Space {
+ indent++
+ } else {
+ break
+ }
+ }
+ symbolToken := tokens[indent]
+ contentTokens := tokens[indent+2 : size]
children, err := ParseInline(contentTokens)
if err != nil {
return nil, err
}
return &ast.UnorderedList{
Symbol: symbolToken.Type,
+ Indent: indent,
Children: children,
}, nil
}
diff --git a/proto/api/v2/markdown_service.proto b/proto/api/v2/markdown_service.proto
index d00062c45..4f28584c1 100644
--- a/proto/api/v2/markdown_service.proto
+++ b/proto/api/v2/markdown_service.proto
@@ -103,18 +103,21 @@ message BlockquoteNode {
message OrderedListNode {
string number = 1;
- repeated Node children = 2;
+ int32 indent = 2;
+ repeated Node children = 3;
}
message UnorderedListNode {
string symbol = 1;
- repeated Node children = 2;
+ int32 indent = 2;
+ repeated Node children = 3;
}
message TaskListNode {
string symbol = 1;
- bool complete = 2;
- repeated Node children = 3;
+ int32 indent = 2;
+ bool complete = 3;
+ repeated Node children = 4;
}
message MathBlockNode {
diff --git a/proto/gen/api/v2/README.md b/proto/gen/api/v2/README.md
index cab6e6c6a..17c028519 100644
--- a/proto/gen/api/v2/README.md
+++ b/proto/gen/api/v2/README.md
@@ -1233,6 +1233,7 @@
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| number | [string](#string) | | |
+| indent | [int32](#int32) | | |
| children | [Node](#memos-api-v2-Node) | repeated | |
@@ -1324,6 +1325,7 @@
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| symbol | [string](#string) | | |
+| indent | [int32](#int32) | | |
| complete | [bool](#bool) | | |
| children | [Node](#memos-api-v2-Node) | repeated | |
@@ -1356,6 +1358,7 @@
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| symbol | [string](#string) | | |
+| indent | [int32](#int32) | | |
| children | [Node](#memos-api-v2-Node) | repeated | |
diff --git a/proto/gen/api/v2/markdown_service.pb.go b/proto/gen/api/v2/markdown_service.pb.go
index 2b7372293..235806430 100644
--- a/proto/gen/api/v2/markdown_service.pb.go
+++ b/proto/gen/api/v2/markdown_service.pb.go
@@ -888,7 +888,8 @@ type OrderedListNode struct {
unknownFields protoimpl.UnknownFields
Number string `protobuf:"bytes,1,opt,name=number,proto3" json:"number,omitempty"`
- Children []*Node `protobuf:"bytes,2,rep,name=children,proto3" json:"children,omitempty"`
+ Indent int32 `protobuf:"varint,2,opt,name=indent,proto3" json:"indent,omitempty"`
+ Children []*Node `protobuf:"bytes,3,rep,name=children,proto3" json:"children,omitempty"`
}
func (x *OrderedListNode) Reset() {
@@ -930,6 +931,13 @@ func (x *OrderedListNode) GetNumber() string {
return ""
}
+func (x *OrderedListNode) GetIndent() int32 {
+ if x != nil {
+ return x.Indent
+ }
+ return 0
+}
+
func (x *OrderedListNode) GetChildren() []*Node {
if x != nil {
return x.Children
@@ -943,7 +951,8 @@ type UnorderedListNode struct {
unknownFields protoimpl.UnknownFields
Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
- Children []*Node `protobuf:"bytes,2,rep,name=children,proto3" json:"children,omitempty"`
+ Indent int32 `protobuf:"varint,2,opt,name=indent,proto3" json:"indent,omitempty"`
+ Children []*Node `protobuf:"bytes,3,rep,name=children,proto3" json:"children,omitempty"`
}
func (x *UnorderedListNode) Reset() {
@@ -985,6 +994,13 @@ func (x *UnorderedListNode) GetSymbol() string {
return ""
}
+func (x *UnorderedListNode) GetIndent() int32 {
+ if x != nil {
+ return x.Indent
+ }
+ return 0
+}
+
func (x *UnorderedListNode) GetChildren() []*Node {
if x != nil {
return x.Children
@@ -998,8 +1014,9 @@ type TaskListNode struct {
unknownFields protoimpl.UnknownFields
Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
- Complete bool `protobuf:"varint,2,opt,name=complete,proto3" json:"complete,omitempty"`
- Children []*Node `protobuf:"bytes,3,rep,name=children,proto3" json:"children,omitempty"`
+ Indent int32 `protobuf:"varint,2,opt,name=indent,proto3" json:"indent,omitempty"`
+ Complete bool `protobuf:"varint,3,opt,name=complete,proto3" json:"complete,omitempty"`
+ Children []*Node `protobuf:"bytes,4,rep,name=children,proto3" json:"children,omitempty"`
}
func (x *TaskListNode) Reset() {
@@ -1041,6 +1058,13 @@ func (x *TaskListNode) GetSymbol() string {
return ""
}
+func (x *TaskListNode) GetIndent() int32 {
+ if x != nil {
+ return x.Indent
+ }
+ return 0
+}
+
func (x *TaskListNode) GetComplete() bool {
if x != nil {
return x.Complete
@@ -1848,111 +1872,115 @@ var file_api_v2_markdown_service_proto_rawDesc = []byte{
0x75, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x2e, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c,
0x64, 0x72, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d,
0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x08,
- 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x22, 0x59, 0x0a, 0x0f, 0x4f, 0x72, 0x64, 0x65,
+ 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x22, 0x71, 0x0a, 0x0f, 0x4f, 0x72, 0x64, 0x65,
0x72, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e,
0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x75, 0x6d,
- 0x62, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18,
- 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70,
- 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64,
- 0x72, 0x65, 0x6e, 0x22, 0x5b, 0x0a, 0x11, 0x55, 0x6e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64,
- 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62,
- 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c,
- 0x12, 0x2e, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x03,
+ 0x62, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x08, 0x63,
+ 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e,
+ 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x6f, 0x64,
+ 0x65, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x22, 0x73, 0x0a, 0x11, 0x55,
+ 0x6e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65,
+ 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x6e, 0x64, 0x65,
+ 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x6e, 0x64, 0x65, 0x6e, 0x74,
+ 0x12, 0x2e, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
0x32, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e,
- 0x22, 0x72, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65,
+ 0x22, 0x8a, 0x01, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64,
+ 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x6e, 0x64,
+ 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x69, 0x6e, 0x64, 0x65, 0x6e,
+ 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x03, 0x20,
+ 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x2e, 0x0a,
+ 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32,
+ 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e,
+ 0x6f, 0x64, 0x65, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x22, 0x29, 0x0a,
+ 0x0d, 0x4d, 0x61, 0x74, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x18,
+ 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x24, 0x0a, 0x08, 0x54, 0x65, 0x78, 0x74,
+ 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x52,
+ 0x0a, 0x08, 0x42, 0x6f, 0x6c, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79,
+ 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62,
+ 0x6f, 0x6c, 0x12, 0x2e, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x02,
+ 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69,
+ 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72,
+ 0x65, 0x6e, 0x22, 0x3e, 0x0a, 0x0a, 0x49, 0x74, 0x61, 0x6c, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65,
0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70,
- 0x6c, 0x65, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x70,
- 0x6c, 0x65, 0x74, 0x65, 0x12, 0x2e, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e,
- 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61,
- 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c,
- 0x64, 0x72, 0x65, 0x6e, 0x22, 0x29, 0x0a, 0x0d, 0x4d, 0x61, 0x74, 0x68, 0x42, 0x6c, 0x6f, 0x63,
- 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
+ 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74,
+ 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65,
+ 0x6e, 0x74, 0x22, 0x42, 0x0a, 0x0e, 0x42, 0x6f, 0x6c, 0x64, 0x49, 0x74, 0x61, 0x6c, 0x69, 0x63,
+ 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x18, 0x0a, 0x07,
+ 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63,
+ 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x24, 0x0a, 0x08, 0x43, 0x6f, 0x64, 0x65, 0x4e, 0x6f,
+ 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x38, 0x0a, 0x09,
+ 0x49, 0x6d, 0x61, 0x67, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x6c, 0x74,
+ 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x6c, 0x74,
+ 0x54, 0x65, 0x78, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28,
+ 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x30, 0x0a, 0x08, 0x4c, 0x69, 0x6e, 0x6b, 0x4e, 0x6f,
+ 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x40, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x6f,
+ 0x4c, 0x69, 0x6e, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1e, 0x0a, 0x0b, 0x69, 0x73,
+ 0x5f, 0x72, 0x61, 0x77, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52,
+ 0x09, 0x69, 0x73, 0x52, 0x61, 0x77, 0x54, 0x65, 0x78, 0x74, 0x22, 0x23, 0x0a, 0x07, 0x54, 0x61,
+ 0x67, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22,
- 0x24, 0x0a, 0x08, 0x54, 0x65, 0x78, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63,
- 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f,
- 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x52, 0x0a, 0x08, 0x42, 0x6f, 0x6c, 0x64, 0x4e, 0x6f, 0x64,
- 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x2e, 0x0a, 0x08, 0x63, 0x68, 0x69,
- 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65,
- 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52,
- 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x22, 0x3e, 0x0a, 0x0a, 0x49, 0x74, 0x61,
- 0x6c, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f,
- 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12,
- 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x42, 0x0a, 0x0e, 0x42, 0x6f, 0x6c,
- 0x64, 0x49, 0x74, 0x61, 0x6c, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73,
- 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d,
- 0x62, 0x6f, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x24, 0x0a,
- 0x08, 0x43, 0x6f, 0x64, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e,
- 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74,
- 0x65, 0x6e, 0x74, 0x22, 0x38, 0x0a, 0x09, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x4e, 0x6f, 0x64, 0x65,
- 0x12, 0x19, 0x0a, 0x08, 0x61, 0x6c, 0x74, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x07, 0x61, 0x6c, 0x74, 0x54, 0x65, 0x78, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75,
- 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x30, 0x0a,
- 0x08, 0x4c, 0x69, 0x6e, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78,
- 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x10, 0x0a,
- 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22,
- 0x40, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x6f, 0x4c, 0x69, 0x6e, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x12,
- 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72,
- 0x6c, 0x12, 0x1e, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x72, 0x61, 0x77, 0x5f, 0x74, 0x65, 0x78, 0x74,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x52, 0x61, 0x77, 0x54, 0x65, 0x78,
- 0x74, 0x22, 0x23, 0x0a, 0x07, 0x54, 0x61, 0x67, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07,
- 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63,
- 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x2d, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x69, 0x6b, 0x65,
- 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63,
+ 0x2d, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x69, 0x6b, 0x65, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68,
+ 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x2f,
+ 0x0a, 0x15, 0x45, 0x73, 0x63, 0x61, 0x70, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63,
+ 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f,
+ 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x22,
+ 0x24, 0x0a, 0x08, 0x4d, 0x61, 0x74, 0x68, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63,
0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f,
- 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x2f, 0x0a, 0x15, 0x45, 0x73, 0x63, 0x61, 0x70, 0x69, 0x6e,
- 0x67, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x16,
- 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
- 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x22, 0x24, 0x0a, 0x08, 0x4d, 0x61, 0x74, 0x68, 0x4e, 0x6f,
- 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2a, 0xe3, 0x02, 0x0a,
- 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x4e, 0x4f, 0x44,
- 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
- 0x0e, 0x0a, 0x0a, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x42, 0x52, 0x45, 0x41, 0x4b, 0x10, 0x01, 0x12,
- 0x0d, 0x0a, 0x09, 0x50, 0x41, 0x52, 0x41, 0x47, 0x52, 0x41, 0x50, 0x48, 0x10, 0x02, 0x12, 0x0e,
- 0x0a, 0x0a, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x03, 0x12, 0x0b,
- 0x0a, 0x07, 0x48, 0x45, 0x41, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x48,
- 0x4f, 0x52, 0x49, 0x5a, 0x4f, 0x4e, 0x54, 0x41, 0x4c, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x10, 0x05,
- 0x12, 0x0e, 0x0a, 0x0a, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x51, 0x55, 0x4f, 0x54, 0x45, 0x10, 0x06,
- 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x45, 0x44, 0x5f, 0x4c, 0x49, 0x53, 0x54,
- 0x10, 0x07, 0x12, 0x12, 0x0a, 0x0e, 0x55, 0x4e, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x45, 0x44, 0x5f,
- 0x4c, 0x49, 0x53, 0x54, 0x10, 0x08, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x4c,
- 0x49, 0x53, 0x54, 0x10, 0x09, 0x12, 0x0e, 0x0a, 0x0a, 0x4d, 0x41, 0x54, 0x48, 0x5f, 0x42, 0x4c,
- 0x4f, 0x43, 0x4b, 0x10, 0x0a, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x45, 0x58, 0x54, 0x10, 0x0b, 0x12,
- 0x08, 0x0a, 0x04, 0x42, 0x4f, 0x4c, 0x44, 0x10, 0x0c, 0x12, 0x0a, 0x0a, 0x06, 0x49, 0x54, 0x41,
- 0x4c, 0x49, 0x43, 0x10, 0x0d, 0x12, 0x0f, 0x0a, 0x0b, 0x42, 0x4f, 0x4c, 0x44, 0x5f, 0x49, 0x54,
- 0x41, 0x4c, 0x49, 0x43, 0x10, 0x0e, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x4f, 0x44, 0x45, 0x10, 0x0f,
- 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x10, 0x10, 0x12, 0x08, 0x0a, 0x04, 0x4c,
- 0x49, 0x4e, 0x4b, 0x10, 0x11, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x4c, 0x49,
- 0x4e, 0x4b, 0x10, 0x12, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x41, 0x47, 0x10, 0x13, 0x12, 0x11, 0x0a,
- 0x0d, 0x53, 0x54, 0x52, 0x49, 0x4b, 0x45, 0x54, 0x48, 0x52, 0x4f, 0x55, 0x47, 0x48, 0x10, 0x14,
- 0x12, 0x16, 0x0a, 0x12, 0x45, 0x53, 0x43, 0x41, 0x50, 0x49, 0x4e, 0x47, 0x5f, 0x43, 0x48, 0x41,
- 0x52, 0x41, 0x43, 0x54, 0x45, 0x52, 0x10, 0x15, 0x12, 0x08, 0x0a, 0x04, 0x4d, 0x41, 0x54, 0x48,
- 0x10, 0x16, 0x32, 0x88, 0x01, 0x0a, 0x0f, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x53,
- 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x75, 0x0a, 0x0d, 0x50, 0x61, 0x72, 0x73, 0x65, 0x4d,
- 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x22, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e,
- 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x4d, 0x61, 0x72, 0x6b,
- 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x65,
- 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65,
- 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
- 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x61, 0x70,
- 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x42, 0xac, 0x01,
- 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e,
- 0x76, 0x32, 0x42, 0x14, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x53, 0x65, 0x72, 0x76,
- 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68,
- 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f,
- 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f,
- 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d,
- 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56,
- 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32,
- 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c,
- 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65,
- 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x33,
+ 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2a, 0xe3, 0x02, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79,
+ 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45,
+ 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4c, 0x49, 0x4e, 0x45,
+ 0x5f, 0x42, 0x52, 0x45, 0x41, 0x4b, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x41, 0x52, 0x41,
+ 0x47, 0x52, 0x41, 0x50, 0x48, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x4f, 0x44, 0x45, 0x5f,
+ 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x48, 0x45, 0x41, 0x44, 0x49,
+ 0x4e, 0x47, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x48, 0x4f, 0x52, 0x49, 0x5a, 0x4f, 0x4e, 0x54,
+ 0x41, 0x4c, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x10, 0x05, 0x12, 0x0e, 0x0a, 0x0a, 0x42, 0x4c, 0x4f,
+ 0x43, 0x4b, 0x51, 0x55, 0x4f, 0x54, 0x45, 0x10, 0x06, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x52, 0x44,
+ 0x45, 0x52, 0x45, 0x44, 0x5f, 0x4c, 0x49, 0x53, 0x54, 0x10, 0x07, 0x12, 0x12, 0x0a, 0x0e, 0x55,
+ 0x4e, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x45, 0x44, 0x5f, 0x4c, 0x49, 0x53, 0x54, 0x10, 0x08, 0x12,
+ 0x0d, 0x0a, 0x09, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x4c, 0x49, 0x53, 0x54, 0x10, 0x09, 0x12, 0x0e,
+ 0x0a, 0x0a, 0x4d, 0x41, 0x54, 0x48, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x0a, 0x12, 0x08,
+ 0x0a, 0x04, 0x54, 0x45, 0x58, 0x54, 0x10, 0x0b, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x4f, 0x4c, 0x44,
+ 0x10, 0x0c, 0x12, 0x0a, 0x0a, 0x06, 0x49, 0x54, 0x41, 0x4c, 0x49, 0x43, 0x10, 0x0d, 0x12, 0x0f,
+ 0x0a, 0x0b, 0x42, 0x4f, 0x4c, 0x44, 0x5f, 0x49, 0x54, 0x41, 0x4c, 0x49, 0x43, 0x10, 0x0e, 0x12,
+ 0x08, 0x0a, 0x04, 0x43, 0x4f, 0x44, 0x45, 0x10, 0x0f, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4d, 0x41,
+ 0x47, 0x45, 0x10, 0x10, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x49, 0x4e, 0x4b, 0x10, 0x11, 0x12, 0x0d,
+ 0x0a, 0x09, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x4c, 0x49, 0x4e, 0x4b, 0x10, 0x12, 0x12, 0x07, 0x0a,
+ 0x03, 0x54, 0x41, 0x47, 0x10, 0x13, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x52, 0x49, 0x4b, 0x45,
+ 0x54, 0x48, 0x52, 0x4f, 0x55, 0x47, 0x48, 0x10, 0x14, 0x12, 0x16, 0x0a, 0x12, 0x45, 0x53, 0x43,
+ 0x41, 0x50, 0x49, 0x4e, 0x47, 0x5f, 0x43, 0x48, 0x41, 0x52, 0x41, 0x43, 0x54, 0x45, 0x52, 0x10,
+ 0x15, 0x12, 0x08, 0x0a, 0x04, 0x4d, 0x41, 0x54, 0x48, 0x10, 0x16, 0x32, 0x88, 0x01, 0x0a, 0x0f,
+ 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
+ 0x75, 0x0a, 0x0d, 0x50, 0x61, 0x72, 0x73, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e,
+ 0x12, 0x22, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e,
+ 0x50, 0x61, 0x72, 0x73, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69,
+ 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77,
+ 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02,
+ 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x61,
+ 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x42, 0xac, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d,
+ 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x14, 0x4d, 0x61, 0x72,
+ 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74,
+ 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
+ 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b,
+ 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65,
+ 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d,
+ 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f,
+ 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61,
+ 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70,
+ 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
diff --git a/web/src/components/MemoContent/OrderedList.tsx b/web/src/components/MemoContent/OrderedList.tsx
index d6484224f..83733a07c 100644
--- a/web/src/components/MemoContent/OrderedList.tsx
+++ b/web/src/components/MemoContent/OrderedList.tsx
@@ -1,23 +1,30 @@
+import { repeat } from "lodash-es";
import { Node } from "@/types/proto/api/v2/markdown_service";
import Renderer from "./Renderer";
import { BaseProps } from "./types";
interface Props extends BaseProps {
number: string;
+ indent: number;
children: Node[];
}
-const OrderedList: React.FC<Props> = ({ number, children }: Props) => {
+const OrderedList: React.FC<Props> = ({ number, indent, children }: Props) => {
return (
<ol>
- <li className="grid grid-cols-[24px_1fr] gap-1">
- <div className="w-7 h-6 flex justify-center items-center">
- <span className="opacity-80">{number}.</span>
+ <li className="w-full flex flex-row">
+ <div className="block font-mono shrink-0">
+ <span>{repeat(" ", indent)}</span>
</div>
- <div>
- {children.map((child, index) => (
- <Renderer key={`${child.type}-${index}`} index={String(index)} node={child} />
- ))}
+ <div className="w-auto grid grid-cols-[24px_1fr] gap-1">
+ <div className="w-7 h-6 flex justify-center items-center">
+ <span className="opacity-80">{number}.</span>
+ </div>
+ <div>
+ {children.map((child, index) => (
+ <Renderer key={`${child.type}-${index}`} index={String(index)} node={child} />
+ ))}
+ </div>
</div>
</li>
</ol>
diff --git a/web/src/components/MemoContent/TaskList.tsx b/web/src/components/MemoContent/TaskList.tsx
index d90a6bdec..3fd9606ee 100644
--- a/web/src/components/MemoContent/TaskList.tsx
+++ b/web/src/components/MemoContent/TaskList.tsx
@@ -1,4 +1,6 @@
import { Checkbox } from "@mui/joy";
+import classNames from "classnames";
+import { repeat } from "lodash-es";
import { useContext } from "react";
import { useMemoStore } from "@/store/v1";
import { Node, NodeType } from "@/types/proto/api/v2/markdown_service";
@@ -8,11 +10,12 @@ import { RendererContext } from "./types";
interface Props {
index: string;
symbol: string;
+ indent: number;
complete: boolean;
children: Node[];
}
-const TaskList: React.FC<Props> = ({ index, complete, children }: Props) => {
+const TaskList: React.FC<Props> = ({ index, indent, complete, children }: Props) => {
const context = useContext(RendererContext);
const memoStore = useMemoStore();
@@ -43,14 +46,19 @@ const TaskList: React.FC<Props> = ({ index, complete, children }: Props) => {
return (
<ul>
- <li className="grid grid-cols-[24px_1fr] gap-1">
- <div className="w-7 h-6 flex justify-center items-center">
- <Checkbox size="sm" checked={complete} disabled={context.readonly} onChange={(e) => handleCheckboxChange(e.target.checked)} />
+ <li className="w-full flex flex-row">
+ <div className="block font-mono shrink-0">
+ <span>{repeat(" ", indent)}</span>
</div>
- <div>
- {children.map((child, subIndex) => (
- <Renderer key={`${child.type}-${subIndex}`} index={`${index}-${subIndex}`} node={child} />
- ))}
+ <div className="w-auto grid grid-cols-[24px_1fr] gap-1">
+ <div className="w-7 h-6 flex justify-center items-center">
+ <Checkbox size="sm" checked={complete} disabled={context.readonly} onChange={(e) => handleCheckboxChange(e.target.checked)} />
+ </div>
+ <div className={classNames(complete && "line-through opacity-80")}>
+ {children.map((child, index) => (
+ <Renderer key={`${child.type}-${index}`} index={String(index)} node={child} />
+ ))}
+ </div>
</div>
</li>
</ul>
diff --git a/web/src/components/MemoContent/UnorderedList.tsx b/web/src/components/MemoContent/UnorderedList.tsx
index 803582edc..d0f5fd79c 100644
--- a/web/src/components/MemoContent/UnorderedList.tsx
+++ b/web/src/components/MemoContent/UnorderedList.tsx
@@ -1,22 +1,29 @@
+import { repeat } from "lodash-es";
import { Node } from "@/types/proto/api/v2/markdown_service";
import Renderer from "./Renderer";
interface Props {
symbol: string;
+ indent: number;
children: Node[];
}
-const UnorderedList: React.FC<Props> = ({ children }: Props) => {
+const UnorderedList: React.FC<Props> = ({ indent, children }: Props) => {
return (
<ul>
- <li className="grid grid-cols-[24px_1fr] gap-1">
- <div className="w-7 h-6 flex justify-center items-center">
- <span className="opacity-80">•</span>
+ <li className="w-full flex flex-row">
+ <div className="block font-mono shrink-0">
+ <span>{repeat(" ", indent)}</span>
</div>
- <div>
- {children.map((child, index) => (
- <Renderer key={`${child.type}-${index}`} index={String(index)} node={child} />
- ))}
+ <div className="w-auto grid grid-cols-[24px_1fr] gap-1">
+ <div className="w-7 h-6 flex justify-center items-center">
+ <span className="opacity-80">•</span>
+ </div>
+ <div>
+ {children.map((child, index) => (
+ <Renderer key={`${child.type}-${index}`} index={String(index)} node={child} />
+ ))}
+ </div>
</div>
</li>
</ul>