@@ -4,19 +4,33 @@ import DocsFiche from "./DocsFiche.astro";
44import DocData from " ./DocData.astro" ;
55import { DocType } from " ./Docs.astro" ;
66
7+ /**
8+ * A reference to a different Documentation.
9+ */
10+ export interface DocumentationReference {
11+ name: string ;
12+ id: string ;
13+ }
14+
15+ /**
16+ * A documentation entry.
17+ */
718export interface Documentation {
819 id: string ,
920 new: boolean ;
1021 type: DocType ;
1122 name: string ;
1223 description: string [];
24+ deprecated: boolean ;
25+ cancellable: boolean | null ;
1326 since: string | null ;
1427 requirements: string [] | null ;
15- eventValues: string | null ;
16- returnType: string | null ;
28+ eventValues: DocumentationReference [] | null ;
29+ returnType: DocumentationReference | null ;
1730 events: string [] | null ;
1831 patterns: string [] | null ;
1932 examples: string [] | null ;
33+ keywords: string [] | null ;
2034}
2135
2236interface Props {
@@ -54,7 +68,8 @@ function color(): string {
5468
5569 <div class =" flex flex-col gap-1" >
5670 <div class =" flex flex-row gap-3 flex-wrap" >
57- <h2 >{ docType .name } </h2 >
71+ { docType .deprecated ? <h2 class = " opacity-50 line-through" >{ docType .name } </h2 > : <h2 >{ docType .name } </h2 >}
72+ { [docType .deprecated ].filter (x => x ).map (x => <DocsFiche text = " Deprecated" color = " 520f0f" />)}
5873 { [docType .new ].filter (x => x ).map (x => <DocsFiche text = " New" color = " B10003" />)}
5974
6075 <DocsFiche text ={ docType .type } color ={ color ()} />
@@ -67,7 +82,7 @@ function color(): string {
6782 </svg >
6883 </button >
6984 </div >
70- { docType .description .map ((line : string ) => <p ><Fragment set :html = { line } /></p >)}
85+ { docType .description ? .map ((line : string ) => <p ><Fragment set :html = { line } /></p >)}
7186 </div >
7287
7388 { [docType .patterns ]
@@ -76,10 +91,11 @@ function color(): string {
7691
7792 <div >
7893 <DocData text =" Since" value ={ docType .since } />
94+ <DocData text =" Cancellable" value ={ docType .cancellable != null ? (docType .cancellable ? " Yes" : " No" ) : null } />
7995 <DocData text =" Requirements" value ={ docType .requirements } />
80- <DocData text =" Event values" value ={ docType .eventValues } />
96+ <DocData text =" Event values" value ={ docType .eventValues ?. map ( x => x . name . toLowerCase ()) ?? null } />
8197 <DocData text =" Supported events" value ={ docType .events } />
82- <DocData text =" Returns" value ={ docType .returnType } />
98+ <DocData text =" Returns" value ={ docType .returnType ?. name ?? null } />
8399 </div >
84100
85101 { [docType .examples ]
@@ -98,5 +114,6 @@ function color(): string {
98114 { [docType .examples ]
99115 .filter (x => x !== null )
100116 .map (x => <Code code = { ` ${x ?.join (" \n " )} ` } lang = " applescript" />)}
117+ <span class =" hidden" >{ docType .keywords ?.filter (x => x )} </span >
101118 </div >
102119</section >
0 commit comments