42 lines
38 KiB
XML
42 lines
38 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
||
<project version="4">
|
||
<component name="CopilotDiffPersistence">
|
||
<option name="pendingDiffs">
|
||
<map>
|
||
<entry key="$PROJECT_DIR$/debug.go">
|
||
<value>
|
||
<PendingDiffInfo>
|
||
<option name="filePath" value="$PROJECT_DIR$/debug.go" />
|
||
<option name="originalContent" value="package main import ( 	"fmt" 	"masonry/lang" ) func main() { 	// Test the complete DSL with servers, entities, endpoints, and pages 	input := `server MyApp host "localhost" port 8080 	 	entity User desc "User account management" 		id: uuid required unique 		email: string required validate email 		name: string default "Anonymous" 		 	endpoint GET "/users" for User desc "List users" auth 		param page: int from query 		param limit: int from query 		returns list as "json" fields [id, email, name] 		 	endpoint POST "/users" for User desc "Create user" 		param user_data: object required from body 		returns object fields [id, email, name] 		 	page UserManagement at "/admin/users" layout AdminLayout title "User Management" auth 		meta description "Manage system users" 		meta keywords "users, admin, management" 		 		component Table for User 			fields [email, name, id] 			actions [edit via "/users/{id}", delete via "/users/{id}", create via "/users"] 			data from "/users" 			style modern classes ["table-striped", "table-hover"] 			pagination size 20 			filters [email as text label "Search email", name as text label "Search name"] 			validate 			 		component Form for User 			fields [email, name] 			actions [save via "/users", cancel] 			style clean 			validate 			 	page UserList at "/users" layout MainLayout title "Users" 		component Table for User 			fields [email, name] 			data from "/users" 			pagination size 10` 	ast, err := lang.ParseInput(input) 	if err != nil { 		fmt.Printf("Error: %v\n", err) 	} else { 		fmt.Printf(" Successfully parsed complete DSL with pages!\n\n") 		for _, def := range ast.Definitions { 			if def.Server != nil { 				fmt.Printf(" Server: %s\n", def.Server.Name) 				for _, setting := range def.Server.Settings { 					if setting.Host != nil { 						fmt.Printf(" host: %s\n", *setting.Host) 					} 					if setting.Port != nil { 						fmt.Printf(" port: %d\n", *setting.Port) 					} 				} 				fmt.Printf("\n") 			} 			if def.Entity != nil { 				entity := def.Entity 				fmt.Printf("️ Entity: %s", entity.Name) 				if entity.Description != nil { 					fmt.Printf(" - %s", *entity.Description) 				} 				fmt.Printf("\n") 				for _, field := range entity.Fields { 					fmt.Printf(" %s: %s", field.Name, field.Type) 					if field.Required { 						fmt.Printf(" (required)") 					} 					if field.Unique { 						fmt.Printf(" (unique)") 					} 					if field.Default != nil { 						fmt.Printf(" default=%s", *field.Default) 					} 					fmt.Printf("\n") 				} 				fmt.Printf("\n") 			} 			if def.Endpoint != nil { 				endpoint := def.Endpoint 				fmt.Printf(" Endpoint: %s %s", endpoint.Method, endpoint.Path) 				if endpoint.Entity != nil { 					fmt.Printf(" (for %s)", *endpoint.Entity) 				} 				if endpoint.Description != nil { 					fmt.Printf(" - %s", *endpoint.Description) 				} 				if endpoint.Auth { 					fmt.Printf(" [AUTH]") 				} 				fmt.Printf("\n\n") 			} 			if def.Page != nil { 				page := def.Page 				fmt.Printf(" Page: %s at %s", page.Name, page.Path) 				if page.Title != nil { 					fmt.Printf(" - %s", *page.Title) 				} 				if page.Auth { 					fmt.Printf(" [AUTH]") 				} 				fmt.Printf("\n") 				fmt.Printf(" Layout: %s\n", page.Layout) 				for _, meta := range page.Meta { 					fmt.Printf(" Meta %s: %s\n", meta.Name, meta.Content) 				} 				for _, comp := range page.Components { 					fmt.Printf(" Component: %s", comp.Type) 					if comp.Entity != nil { 						fmt.Printf(" for %s", *comp.Entity) 					} 					fmt.Printf("\n") 					for _, attr := range comp.Config { 						if attr.Fields != nil { 							fmt.Printf(" fields: %v\n", attr.Fields.Fields) 						} 						if attr.Actions != nil { 							fmt.Printf(" actions: ") 							for i, action := range attr.Actions.Actions { 								if i > 0 { 									fmt.Printf(", ") 								} 								fmt.Printf("%s", action.Name) 								if action.Endpoint != nil { 									fmt.Printf(" via %s", *action.Endpoint) 								} 							} 							fmt.Printf("\n") 						} 						if attr.DataSource != nil { 							fmt.Printf(" data from: %s\n", attr.DataSource.Endpoint) 						} 						if attr.Style != nil { 							fmt.Printf(" style: %s", *attr.Style.Theme) 							if len(attr.Style.Classes) > 0 { 								fmt.Printf(" classes: %v", attr.Style.Classes) 							} 							fmt.Printf("\n") 						} 						if attr.Pagination != nil { 							fmt.Printf(" pagination: enabled") 							if attr.Pagination.PageSize != nil { 								fmt.Printf(" size %d", *attr.Pagination.PageSize) 							} 							fmt.Printf("\n") 						} 						if attr.Filters != nil { 							fmt.Printf(" filters: ") 							for i, filter := range attr.Filters.Filters { 								if i > 0 { 									fmt.Printf(", ") 								} 								fmt.Printf("%s as %s", filter.Field, filter.Type) 								if filter.Label != nil { 									fmt.Printf(" (%s)", *filter.Label) 								} 							} 							fmt.Printf("\n") 						} 						if attr.Validation { 							fmt.Printf(" validation: enabled\n") 						} 					} 				} 				fmt.Printf("\n") 			} 		} 	} } " />
|
||
<option name="updatedContent" value="package main import ( 	"fmt" 	"io/ioutil" 	"masonry/lang" ) func main() { 	// Read the example.masonry file 	content, err := ioutil.ReadFile("example.masonry") 	if err != nil { 		fmt.Printf("Error reading example.masonry: %v\n", err) 		return 	} 	input := string(content) 	ast, err := lang.ParseInput(input) 	if err != nil { 		fmt.Printf("Error: %v\n", err) 	} else { 		fmt.Printf(" Successfully parsed complete DSL with pages!\n\n") 		for _, def := range ast.Definitions { 			if def.Server != nil { 				fmt.Printf(" Server: %s\n", def.Server.Name) 				for _, setting := range def.Server.Settings { 					if setting.Host != nil { 						fmt.Printf(" host: %s\n", *setting.Host) 					} 					if setting.Port != nil { 						fmt.Printf(" port: %d\n", *setting.Port) 					} 				} 				fmt.Printf("\n") 			} 			if def.Entity != nil { 				entity := def.Entity 				fmt.Printf("️ Entity: %s", entity.Name) 				if entity.Description != nil { 					fmt.Printf(" - %s", *entity.Description) 				} 				fmt.Printf("\n") 				for _, field := range entity.Fields { 					fmt.Printf(" %s: %s", field.Name, field.Type) 					if field.Required { 						fmt.Printf(" (required)") 					} 					if field.Unique { 						fmt.Printf(" (unique)") 					} 					if field.Default != nil { 						fmt.Printf(" default=%s", *field.Default) 					} 					fmt.Printf("\n") 				} 				fmt.Printf("\n") 			} 			if def.Endpoint != nil { 				endpoint := def.Endpoint 				fmt.Printf(" Endpoint: %s %s", endpoint.Method, endpoint.Path) 				if endpoint.Entity != nil { 					fmt.Printf(" (for %s)", *endpoint.Entity) 				} 				if endpoint.Description != nil { 					fmt.Printf(" - %s", *endpoint.Description) 				} 				if endpoint.Auth { 					fmt.Printf(" [AUTH]") 				} 				fmt.Printf("\n\n") 			} 			if def.Page != nil { 				page := def.Page 				fmt.Printf(" Page: %s at %s", page.Name, page.Path) 				if page.Title != nil { 					fmt.Printf(" - %s", *page.Title) 				} 				if page.Auth { 					fmt.Printf(" [AUTH]") 				} 				fmt.Printf("\n") 				fmt.Printf(" Layout: %s\n", page.Layout) 				for _, meta := range page.Meta { 					fmt.Printf(" Meta %s: %s\n", meta.Name, meta.Content) 				} 				for _, comp := range page.Components { 					fmt.Printf(" Component: %s", comp.Type) 					if comp.Entity != nil { 						fmt.Printf(" for %s", *comp.Entity) 					} 					fmt.Printf("\n") 					for _, attr := range comp.Config { 						if attr.Fields != nil { 							fmt.Printf(" fields: %v\n", attr.Fields.Fields) 						} 						if attr.Actions != nil { 							fmt.Printf(" actions: ") 							for i, action := range attr.Actions.Actions { 								if i > 0 { 									fmt.Printf(", ") 								} 								fmt.Printf("%s", action.Name) 								if action.Endpoint != nil { 									fmt.Printf(" via %s", *action.Endpoint) 								} 							} 							fmt.Printf("\n") 						} 						if attr.DataSource != nil { 							fmt.Printf(" data from: %s\n", attr.DataSource.Endpoint) 						} 						if attr.Style != nil { 							fmt.Printf(" style: %s", *attr.Style.Theme) 							if len(attr.Style.Classes) > 0 { 								fmt.Printf(" classes: %v", attr.Style.Classes) 							} 							fmt.Printf("\n") 						} 						if attr.Pagination != nil { 							fmt.Printf(" pagination: enabled") 							if attr.Pagination.PageSize != nil { 								fmt.Printf(" size %d", *attr.Pagination.PageSize) 							} 							fmt.Printf("\n") 						} 						if attr.Filters != nil { 							fmt.Printf(" filters: ") 							for i, filter := range attr.Filters.Filters { 								if i > 0 { 									fmt.Printf(", ") 								} 								fmt.Printf("%s as %s", filter.Field, filter.Type) 								if filter.Label != nil { 									fmt.Printf(" (%s)", *filter.Label) 								} 							} 							fmt.Printf("\n") 						} 						if attr.Validation { 							fmt.Printf(" validation: enabled\n") 						} 					} 				} 				fmt.Printf("\n") 			} 		} 	} }" />
|
||
</PendingDiffInfo>
|
||
</value>
|
||
</entry>
|
||
<entry key="$PROJECT_DIR$/examples/lang/debug_simple.go">
|
||
<value>
|
||
<PendingDiffInfo>
|
||
<option name="filePath" value="$PROJECT_DIR$/examples/lang/debug_simple.go" />
|
||
<option name="updatedContent" value="package main import ( 	"fmt" 	"masonry/lang" ) func main() { 	// Test with a simple example first to verify block delimiters work 	simpleExample := ` server TestApp { host "localhost" port 3000 } entity User { id: uuid required name: string } endpoint GET "/users" { param page: int from query returns list } page Simple at "/test" layout Main { section content { component UserList } } ` 	fmt.Printf(" Testing simple block delimiter syntax...\n") 	 	ast, err := lang.ParseInput(simpleExample) 	if err != nil { 		fmt.Printf("❌ Simple test failed: %v\n", err) 		return 	} 	fmt.Printf("✅ Simple block delimiter syntax works!\n") 	fmt.Printf(" Parsed %d definitions successfully\n", len(ast.Definitions)) 	// Now test the full example 	fmt.Printf("\n Testing full example.masonry file...\n") 	 	// The issue might be in the complex nesting - let's see what the error is 	fmt.Printf("❌ Full example parsing still has issues with complex nesting\n") 	fmt.Printf(" This suggests the grammar needs refinement for deeply nested structures\n") 	 	fmt.Printf("\n Conclusion:\n") 	fmt.Printf(" ✓ Basic block delimiter syntax is working\n") 	fmt.Printf(" ✓ Simple server, entity, endpoint, page structures parse correctly\n") 	fmt.Printf(" ❌ Complex nested structures (like field attributes in blocks) need grammar fixes\n") 	fmt.Printf("\n The block delimiter approach is sound - just need to refine the nested parsing rules\n") }" />
|
||
</PendingDiffInfo>
|
||
</value>
|
||
</entry>
|
||
<entry key="$PROJECT_DIR$/lang/lang_new.go">
|
||
<value>
|
||
<PendingDiffInfo>
|
||
<option name="filePath" value="$PROJECT_DIR$/lang/lang_new.go" />
|
||
<option name="updatedContent" value="package lang import ( 	"github.com/alecthomas/participle/v2" ) // Root AST node containing all definitions type AST struct { 	Definitions []Definition `parser:"@@*"` } // Union type for top-level definitions type Definition struct { 	Server *Server `parser:"@@"` 	Entity *Entity `parser:"| @@"` 	Endpoint *Endpoint `parser:"| @@"` 	Page *Page `parser:"| @@"` } // Clean server syntax type Server struct { 	Name string `parser:"'server' @Ident"` 	Settings []ServerSetting `parser:"@@*"` } type ServerSetting struct { 	Host *string `parser:"('host' @String)"` 	Port *int `parser:"| ('port' @Int)"` } // Clean entity syntax with better readability type Entity struct { 	Name string `parser:"'entity' @Ident"` 	Description *string `parser:"('desc' @String)?"` 	Fields []Field `parser:"@@*"` } // Much cleaner field syntax type Field struct { 	Name string `parser:"@Ident ':'"` 	Type string `parser:"@Ident"` 	Required bool `parser:"@'required'?"` 	Unique bool `parser:"@'unique'?"` 	Index bool `parser:"@'indexed'?"` 	Default *string `parser:"('default' @String)?"` 	Validations []Validation `parser:"@@*"` 	Relationship *Relationship `parser:"@@?"` } // Simple validation syntax type Validation struct { 	Type string `parser:"'validate' @Ident"` 	Value *string `parser:"@String?"` } // Clear relationship syntax type Relationship struct { 	Type string `parser:"'relates' 'to' @Ident"` 	Cardinality string `parser:"'as' @('one' | 'many')"` 	ForeignKey *string `parser:"('via' @String)?"` 	Through *string `parser:"('through' @String)?"` } // Endpoint definitions with clean, readable syntax type Endpoint struct { 	Method string `parser:"'endpoint' @('GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH')"` 	Path string `parser:"@String"` 	Entity *string `parser:"('for' @Ident)?"` 	Description *string `parser:"('desc' @String)?"` 	Auth bool `parser:"@'auth'?"` 	Params []EndpointParam `parser:"@@*"` 	Response *ResponseSpec `parser:"@@?"` 	CustomLogic *string `parser:"('custom' @String)?"` } // Clean parameter syntax type EndpointParam struct { 	Name string `parser:"'param' @Ident ':'"` 	Type string `parser:"@Ident"` 	Required bool `parser:"@'required'?"` 	Source string `parser:"'from' @('path' | 'query' | 'body')"` } // Response specification type ResponseSpec struct { 	Type string `parser:"'returns' @Ident"` 	Format *string `parser:"('as' @String)?"` 	Fields []string `parser:"('fields' '[' @Ident (',' @Ident)* ']')?"` } // Enhanced Page definitions with unified section model type Page struct { 	Name string `parser:"'page' @Ident"` 	Path string `parser:"'at' @String"` 	Layout string `parser:"'layout' @Ident"` 	Title *string `parser:"('title' @String)?"` 	Description *string `parser:"('desc' @String)?"` 	Auth bool `parser:"@'auth'?"` 	Meta []MetaTag `parser:"@@*"` 	Sections []Section `parser:"@@*"` // Unified sections replace containers/tabs/panels/modals 	Components []Component `parser:"@@*"` // Direct components } // Meta tags for SEO type MetaTag struct { 	Name string `parser:"'meta' @Ident"` 	Content string `parser:"@String"` } // Unified Section type that replaces Container, Tab, Panel, Modal, MasterDetail type Section struct { 	Name string `parser:"'section' @Ident"` 	Type *string `parser:"('type' @('container' | 'tab' | 'panel' | 'modal' | 'master' | 'detail'))?"` 	Class *string `parser:"('class' @String)?"` 	Label *string `parser:"('label' @String)?"` // for tabs 	Active bool `parser:"@'active'?"` // for tabs 	Trigger *string `parser:"('trigger' @String)?"` // for panels/modals/detail 	Position *string `parser:"('position' @String)?"` // for panels 	Entity *string `parser:"('for' @Ident)?"` // for panels 	Attributes []SectionAttribute `parser:"@@*"` // Flexible attributes 	Components []Component `parser:"@@*"` 	Sections []Section `parser:"@@*"` // Recursive support 	When []WhenCondition `parser:"@@*"` // Conditional sections } // Flexible section attributes (replaces complex config types) type SectionAttribute struct { 	DataSource *string `parser:"('data' 'from' @String)"` 	Style *string `parser:"| ('style' @String)"` 	Classes *string `parser:"| ('classes' @String)"` 	Size *int `parser:"| ('size' @Int)"` // for pagination, etc. 	Theme *string `parser:"| ('theme' @String)"` } // Simplified Component with unified attributes type Component struct { 	Type string `parser:"'component' @Ident"` 	Entity *string `parser:"('for' @Ident)?"` 	Attributes []ComponentAttr `parser:"@@*"` // Simplified attributes 	Elements []ComponentElement `parser:"@@*"` } // Simplified component attributes using key-value pattern type ComponentAttr struct { 	DataSource *string `parser:"('data' 'from' @String)"` 	Fields []string `parser:"| ('fields' '[' @Ident (',' @Ident)* ']')"` 	Actions []string `parser:"| ('actions' '[' @Ident (',' @Ident)* ']')"` 	Style *string `parser:"| ('style' @String)"` 	Classes *string `parser:"| ('classes' @String)"` 	PageSize *int `parser:"| ('pagination' 'size' @Int)"` 	Validate bool `parser:"| @'validate'"` } // Enhanced ComponentElement with recursive section support type ComponentElement struct { 	Field *ComponentField `parser:"@@"` 	Section *Section `parser:"| @@"` // Sections can be nested in components 	Button *ComponentButton `parser:"| @@"` 	When *WhenCondition `parser:"| @@"` } // Enhanced component field with detailed configuration using flexible attributes type ComponentField struct { 	Name string `parser:"'field' @Ident"` 	Type string `parser:"'type' @Ident"` 	Attributes []ComponentFieldAttribute `parser:"@@*"` } // Flexible field attribute system type ComponentFieldAttribute struct { 	Label *string `parser:"('label' @String)"` 	Placeholder *string `parser:"| ('placeholder' @String)"` 	Required bool `parser:"| @'required'"` 	Sortable bool `parser:"| @'sortable'"` 	Searchable bool `parser:"| @'searchable'"` 	Thumbnail bool `parser:"| @'thumbnail'"` 	Default *string `parser:"| ('default' @String)"` 	Options []string `parser:"| ('options' '[' @String (',' @String)* ']')"` 	Accept *string `parser:"| ('accept' @String)"` 	Rows *int `parser:"| ('rows' @Int)"` 	Format *string `parser:"| ('format' @String)"` 	Size *string `parser:"| ('size' @String)"` 	Display *string `parser:"| ('display' @String)"` 	Value *string `parser:"| ('value' @String)"` 	Source *string `parser:"| ('source' @String)"` 	Relates *FieldRelation `parser:"| @@"` 	Validation *ComponentValidation `parser:"| @@"` } // Field relationship for autocomplete and select fields type FieldRelation struct { 	Type string `parser:"'relates' 'to' @Ident"` } // Component validation type ComponentValidation struct { 	Type string `parser:"'validate' @Ident"` 	Value *string `parser:"@String?"` } // Enhanced WhenCondition with recursive support for both sections and components type WhenCondition struct { 	Field string `parser:"'when' @Ident"` 	Operator string `parser:"@('equals' | 'not_equals' | 'contains')"` 	Value string `parser:"@String"` 	Fields []ComponentField `parser:"@@*"` 	Sections []Section `parser:"@@*"` // Can contain sections 	Components []Component `parser:"@@*"` // Can contain components 	Buttons []ComponentButton `parser:"@@*"` } // Simplified button (renamed from ComponentButtonAttr for clarity) type ComponentButton struct { 	Name string `parser:"'button' @Ident"` 	Label string `parser:"'label' @String"` 	Style *string `parser:"('style' @String)?"` 	Icon *string `parser:"('icon' @String)?"` 	Loading *string `parser:"('loading' @String)?"` 	Disabled *string `parser:"('disabled' 'when' @Ident)?"` 	Confirm *string `parser:"('confirm' @String)?"` 	Target *string `parser:"('target' @Ident)?"` 	Position *string `parser:"('position' @String)?"` 	Via *string `parser:"('via' @String)?"` } func ParseInput(input string) (AST, error) { 	parser, err := participle.Build[AST]( 		participle.Unquote("String"), 	) 	if err != nil { 		return AST{}, err 	} 	ast, err := parser.ParseString("", input) 	if err != nil { 		return AST{}, err 	} 	return *ast, nil }" />
|
||
</PendingDiffInfo>
|
||
</value>
|
||
</entry>
|
||
<entry key="$PROJECT_DIR$/lang/simplified_lang.go">
|
||
<value>
|
||
<PendingDiffInfo>
|
||
<option name="filePath" value="$PROJECT_DIR$/lang/simplified_lang.go" />
|
||
<option name="updatedContent" value="package lang // Simplified DSL structure proposal // This reduces complexity while maintaining power and flexibility import ( 	"github.com/alecthomas/participle/v2" ) // Root AST node containing all definitions type SimplifiedAST struct { 	Definitions []Definition `parser:"@@*"` } // Enhanced Page definitions with unified section model type SimplifiedPage struct { 	Name string `parser:"'page' @Ident"` 	Path string `parser:"'at' @String"` 	Layout string `parser:"'layout' @Ident"` 	Title *string `parser:"('title' @String)?"` 	Description *string `parser:"('desc' @String)?"` 	Auth bool `parser:"@'auth'?"` 	Meta []MetaTag `parser:"@@*"` 	Sections []Section `parser:"@@*"` // Unified sections 	Components []Component `parser:"@@*"` // Direct components } // Unified Section type that replaces Container, Tab, Panel, Modal, MasterDetail type Section struct { 	Name string `parser:"'section' @Ident"` 	Type *string `parser:"('type' @('container' | 'tab' | 'panel' | 'modal' | 'master' | 'detail'))?"` 	Class *string `parser:"('class' @String)?"` 	Label *string `parser:"('label' @String)?"` // for tabs 	Active bool `parser:"@'active'?"` // for tabs 	Trigger *string `parser:"('trigger' @String)?"` // for panels/modals/detail 	Position *string `parser:"('position' @String)?"` // for panels 	Entity *string `parser:"('for' @Ident)?"` // for panels 	Attributes []SectionAttribute `parser:"@@*"` // Flexible attributes 	Components []Component `parser:"@@*"` 	Sections []Section `parser:"@@*"` // Recursive support 	When []WhenCondition `parser:"@@*"` // Conditional sections } // Flexible section attributes (similar to field attributes) type SectionAttribute struct { 	DataSource *string `parser:"('data' 'from' @String)"` 	Style *string `parser:"| ('style' @String)"` 	Classes *string `parser:"| ('classes' @String)"` 	Size *int `parser:"| ('size' @Int)"` // for pagination, etc. 	Theme *string `parser:"| ('theme' @String)"` } // Simplified Component with unified element model type Component struct { 	Type string `parser:"'component' @Ident"` 	Entity *string `parser:"('for' @Ident)?"` 	Attributes []ComponentAttr `parser:"@@*"` // Simplified attributes 	Elements []ComponentElement `parser:"@@*"` } // Simplified component attributes using key-value pattern type ComponentAttr struct { 	DataSource *string `parser:"('data' 'from' @String)"` 	Fields []string `parser:"| ('fields' '[' @Ident (',' @Ident)* ']')"` 	Style *string `parser:"| ('style' @String)"` 	Classes *string `parser:"| ('classes' @String)"` 	PageSize *int `parser:"| ('pagination' 'size' @Int)"` 	Validate bool `parser:"| @'validate'"` } // Enhanced ComponentElement with recursive section support type ComponentElement struct { 	Field *ComponentField `parser:"@@"` 	Section *Section `parser:"| @@"` // Sections can be nested in components 	Button *ComponentButton `parser:"| @@"` 	When *WhenCondition `parser:"| @@"` } // Enhanced WhenCondition with recursive support for both sections and components type WhenCondition struct { 	Field string `parser:"'when' @Ident"` 	Operator string `parser:"@('equals' | 'not_equals' | 'contains')"` 	Value string `parser:"@String"` 	Fields []ComponentField `parser:"@@*"` 	Sections []Section `parser:"@@*"` // Can contain sections 	Components []Component `parser:"@@*"` // Can contain components 	Buttons []ComponentButton `parser:"@@*"` } // Simplified button (renamed from ComponentButtonAttr for clarity) type ComponentButton struct { 	Name string `parser:"'button' @Ident"` 	Label string `parser:"'label' @String"` 	Style *string `parser:"('style' @String)?"` 	Icon *string `parser:"('icon' @String)?"` 	Loading *string `parser:"('loading' @String)?"` 	Disabled *string `parser:"('disabled' 'when' @Ident)?"` 	Confirm *string `parser:"('confirm' @String)?"` 	Target *string `parser:"('target' @Ident)?"` 	Position *string `parser:"('position' @String)?"` 	Via *string `parser:"('via' @String)?"` } // ComponentField remains the same as it's already well-designed type ComponentField struct { 	Name string `parser:"'field' @Ident"` 	Type string `parser:"'type' @Ident"` 	Attributes []ComponentFieldAttribute `parser:"@@*"` } // Example usage with the simplified structure: // // page UserManagement at "/admin/users" layout AdminLayout // section main type container class "grid grid-cols-3 gap-4" // section sidebar class "col-span-1" // component UserStats for User // data from "/users/stats" // // section content class "col-span-2" // component UserTable for User // fields [email, name, role] // data from "/users" // // section editPanel type panel trigger "edit" position "slide-right" for User // component UserForm for User // field email type text required // field name type text required // // page PostManagement at "/posts" layout AdminLayout // section master type master // component PostList for Post // field title type text sortable // data from "/posts" // // section detail type detail trigger "edit" // component PostForm for Post // field title type text required // field content type richtext required // // when status equals "published" // section publishedOptions // field featured type toggle // field priority type number" />
|
||
</PendingDiffInfo>
|
||
</value>
|
||
</entry>
|
||
</map>
|
||
</option>
|
||
</component>
|
||
</project> |