From ef833e78d72c514f9317f9b22e57feea3c53349a Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Thu, 15 Jul 2021 00:25:11 -0400 Subject: [PATCH 01/19] refactor #markdown tags --- src/default/partials/comment.hbs | 8 ++++---- src/default/partials/member.signature.body.hbs | 2 +- src/default/templates/index.hbs | 4 ++-- src/minimal/layouts/default.hbs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/default/partials/comment.hbs b/src/default/partials/comment.hbs index 1fbd2d78..154f7415 100644 --- a/src/default/partials/comment.hbs +++ b/src/default/partials/comment.hbs @@ -3,20 +3,20 @@
{{#if shortText}}
- {{#markdown}}{{{shortText}}}{{/markdown}} + {{{shortText}}}
{{/if}} {{#if text}} - {{#markdown}}{{{text}}}{{/markdown}} + {{{text}}} {{/if}} {{#if tags}}
{{#each tags}}
{{tagName}}
-
{{#markdown}}{{{text}}}{{/markdown}}
+
{{{text}}}
{{/each}}
{{/if}}
{{/if}} -{{/with}} \ No newline at end of file +{{/with}} diff --git a/src/default/partials/member.signature.body.hbs b/src/default/partials/member.signature.body.hbs index f4157855..5c7b6c18 100644 --- a/src/default/partials/member.signature.body.hbs +++ b/src/default/partials/member.signature.body.hbs @@ -45,7 +45,7 @@

Returns {{#compact}}{{#with type}}{{>type}}{{/with}}{{/compact}}

{{#if comment.returns}} - {{#markdown}}{{{comment.returns}}}{{/markdown}} + {{{comment.returns}}} {{/if}} {{#if type.declaration}} diff --git a/src/default/templates/index.hbs b/src/default/templates/index.hbs index cf79d3d2..21ebf8ab 100644 --- a/src/default/templates/index.hbs +++ b/src/default/templates/index.hbs @@ -1,3 +1,3 @@
- {{#markdown}}{{{model.readme}}}{{/markdown}} -
\ No newline at end of file + {{{model.readme}}} + diff --git a/src/minimal/layouts/default.hbs b/src/minimal/layouts/default.hbs index 51757890..1a7efb6f 100644 --- a/src/minimal/layouts/default.hbs +++ b/src/minimal/layouts/default.hbs @@ -24,7 +24,7 @@
{{#if model.readme}}
- {{#markdown}}{{{model.readme}}}{{/markdown}} + {{{model.readme}}}
{{/if}} From 26fd752065e88f101acc62aab2906920d792e3af Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Thu, 15 Jul 2021 00:40:08 -0400 Subject: [PATCH 02/19] WIP --- src/default/layouts/default.hbs | 10 +- src/default/partials/breadcrumb.hbs | 2 +- src/default/partials/comment.hbs | 4 +- src/default/partials/footer.hbs | 4 +- src/default/partials/header.hbs | 6 +- src/default/partials/hierarchy.hbs | 8 +- src/default/partials/member.declaration.hbs | 18 +-- src/default/partials/member.getterSetter.hbs | 32 ++-- src/default/partials/member.hbs | 10 +- src/default/partials/member.reference.hbs | 4 +- .../partials/member.signature.body.hbs | 28 ++-- .../partials/member.signature.title.hbs | 8 +- src/default/partials/member.signatures.hbs | 4 +- src/default/partials/member.sources.hbs | 8 +- src/default/partials/members.group.hbs | 6 +- src/default/partials/members.hbs | 6 +- src/default/partials/navigation.hbs | 2 +- src/default/partials/parameter.hbs | 92 +++++------ src/default/partials/toc.hbs | 2 +- src/default/partials/toc.root.hbs | 10 +- src/default/partials/type.hbs | 148 +++++++++--------- src/default/partials/typeAndParent.hbs | 17 +- src/default/partials/typeParameters.hbs | 10 +- src/default/templates/reflection.hbs | 44 +++--- src/minimal/layouts/default.hbs | 8 +- src/minimal/partials/member.hbs | 14 +- src/minimal/templates/index.hbs | 16 +- 27 files changed, 261 insertions(+), 260 deletions(-) diff --git a/src/default/layouts/default.hbs b/src/default/layouts/default.hbs index 87722a78..61d702f9 100644 --- a/src/default/layouts/default.hbs +++ b/src/default/layouts/default.hbs @@ -12,7 +12,7 @@ -{{> header}} +{{__partials__ header}}
@@ -23,7 +23,7 @@ @@ -31,7 +31,7 @@ @@ -39,12 +39,12 @@
-{{> footer}} +{{__partials__ footer}}
-{{> analytics}} +{{__partials__ analytics}} diff --git a/src/default/partials/breadcrumb.hbs b/src/default/partials/breadcrumb.hbs index ad63bac7..afd39368 100644 --- a/src/default/partials/breadcrumb.hbs +++ b/src/default/partials/breadcrumb.hbs @@ -1,5 +1,5 @@ {{#if parent}} - {{#with parent}}{{> breadcrumb}}{{/with}} + {{__partials__ breadcrumb}}
  • {{#if url}} {{name}} diff --git a/src/default/partials/comment.hbs b/src/default/partials/comment.hbs index 154f7415..93211837 100644 --- a/src/default/partials/comment.hbs +++ b/src/default/partials/comment.hbs @@ -1,4 +1,4 @@ -{{#with comment}} + {{#if hasVisibleComponent}}
    {{#if shortText}} @@ -19,4 +19,4 @@ {{/if}}
    {{/if}} -{{/with}} +
    diff --git a/src/default/partials/footer.hbs b/src/default/partials/footer.hbs index e5913db4..f39b36c4 100644 --- a/src/default/partials/footer.hbs +++ b/src/default/partials/footer.hbs @@ -6,7 +6,7 @@ {{#each legend}}
      {{#each .}} -
    • {{name}}
    • +
    • {{name}}
    • {{/each}}
    {{/each}} @@ -18,4 +18,4 @@

    Generated using TypeDoc

    -{{/unless}} \ No newline at end of file +{{/unless}} diff --git a/src/default/partials/header.hbs b/src/default/partials/header.hbs index d468949a..6727c447 100644 --- a/src/default/partials/header.hbs +++ b/src/default/partials/header.hbs @@ -48,10 +48,10 @@
    {{#if model.parent}} {{! Don't show breadcrumbs on main project page, it is the root page. !}}
      - {{#with model}}{{> breadcrumb}}{{/with}} + {{__partials__ breadcrumb}}
    {{/if}} -

    {{#compact}} +

    {{#ifCond model.kindString "!==" "Project" }} {{model.kindString}}  {{/ifCond}} @@ -64,7 +64,7 @@ {{/each}} > {{/if}} - {{/compact}}

    +
  • diff --git a/src/default/partials/hierarchy.hbs b/src/default/partials/hierarchy.hbs index c8166bb2..f6d5f40b 100644 --- a/src/default/partials/hierarchy.hbs +++ b/src/default/partials/hierarchy.hbs @@ -4,13 +4,13 @@ {{#if ../isTarget}} {{this}} {{else}} - {{#compact}}{{> type}}{{/compact}} + {{__partials__ type}} {{/if}} {{#if @last}} - {{#with ../next}} - {{> hierarchy}} - {{/with}} + + {{__partials__ hierarchy}} + {{/if}} {{/each}} diff --git a/src/default/partials/member.declaration.hbs b/src/default/partials/member.declaration.hbs index 4dcaa961..2da23d8f 100644 --- a/src/default/partials/member.declaration.hbs +++ b/src/default/partials/member.declaration.hbs @@ -1,4 +1,4 @@ -
    {{#compact}} +
    {{{wbr name}}} {{#if typeParameters}} < @@ -8,29 +8,29 @@ {{/each}} > {{/if}} - {{#if isOptional}}?{{/if}}: {{#with type}}{{>type}}{{/with}} + {{#if isOptional}}?{{/if}}: {{__partials__ type}} {{#if defaultValue}}  =  {{defaultValue}} {{/if}} -{{/compact}}
    +
    -{{> member.sources}} +{{__partials__ member.sources}} -{{> comment}} +{{__partials__ comment}} {{#if typeParameters}}

    Type parameters

    - {{> typeParameters}} + {{__partials__ typeParameters}} {{/if}} {{#if type.declaration}}

    Type declaration

    - {{#with type.declaration}} - {{> parameter}} - {{/with}} + + {{__partials__ parameter}} +
    {{/if}} diff --git a/src/default/partials/member.getterSetter.hbs b/src/default/partials/member.getterSetter.hbs index 902ea4cc..f6cf3386 100644 --- a/src/default/partials/member.getterSetter.hbs +++ b/src/default/partials/member.getterSetter.hbs @@ -1,37 +1,37 @@ diff --git a/src/default/partials/member.hbs b/src/default/partials/member.hbs index 0cf5cacb..749d33bb 100644 --- a/src/default/partials/member.hbs +++ b/src/default/partials/member.hbs @@ -5,19 +5,19 @@ {{/if}} {{#if signatures}} - {{> member.signatures}} + {{__partials__ member.signatures}} {{else}}{{#if hasGetterOrSetter}} - {{> member.getterSetter}} + {{__partials__ member.getterSetter}} {{else}}{{#if isReference}} - {{> member.reference}} + {{__partials__ member.reference}} {{else}} - {{> member.declaration}} + {{__partials__ member.declaration}} {{/if}}{{/if}}{{/if}} {{#each groups}} {{#each children}} {{#unless hasOwnDocument}} - {{> member}} + {{__partials__ member}} {{/unless}} {{/each}} {{/each}} diff --git a/src/default/partials/member.reference.hbs b/src/default/partials/member.reference.hbs index 13aa3cc3..a4f862b7 100644 --- a/src/default/partials/member.reference.hbs +++ b/src/default/partials/member.reference.hbs @@ -1,4 +1,4 @@ -{{#with tryGetTargetReflectionDeep}} + {{#ifCond ../name '===' name}} Re-exports {{name}} {{else if flags.isExported}} @@ -8,4 +8,4 @@ {{/ifCond}} {{else}} Re-exports {{name}} -{{/with}} + diff --git a/src/default/partials/member.signature.body.hbs b/src/default/partials/member.signature.body.hbs index 5c7b6c18..70d842b3 100644 --- a/src/default/partials/member.signature.body.hbs +++ b/src/default/partials/member.signature.body.hbs @@ -1,12 +1,12 @@ {{#unless hideSources}} - {{> member.sources}} + {{__partials__ member.sources}} {{/unless}} -{{> comment}} +{{__partials__ comment}} {{#if typeParameters}}

    Type parameters

    - {{> typeParameters}} + {{__partials__ typeParameters}} {{/if}} {{#if parameters}} @@ -14,27 +14,27 @@ diff --git a/src/default/partials/toc.hbs b/src/default/partials/toc.hbs index 56b1d748..b9a0a065 100644 --- a/src/default/partials/toc.hbs +++ b/src/default/partials/toc.hbs @@ -3,7 +3,7 @@ {{#if children}} {{/if}} diff --git a/src/default/partials/toc.root.hbs b/src/default/partials/toc.root.hbs index cba0d663..cc7daa18 100644 --- a/src/default/partials/toc.root.hbs +++ b/src/default/partials/toc.root.hbs @@ -1,13 +1,13 @@ -{{#if isInPath}} - - }} +{{! {{/if}}

    - {{#ifCond model.kindString "!==" "Project" }} + {{model.kindString}}  - {{/ifCond}} + {{model.name}} {{#if model.typeParameters}} < diff --git a/src/default/partials/member.reference.hbs b/src/default/partials/member.reference.hbs index 637c3baf..e431a439 100644 --- a/src/default/partials/member.reference.hbs +++ b/src/default/partials/member.reference.hbs @@ -1,12 +1,15 @@ {{#if tryGetTargetReflectionDeep}} - {{#ifCond superProps.name '===' name}} + Re-exports {{name}} - {{else if flags.isExported}} - Renames and re-exports {{name}} - {{else}} - Renames and exports {{name}} - {{/ifCond}} + + + {{#if flags.isExported}} + Renames and re-exports {{name}} + {{else}} + Renames and exports {{name}} + {{/if}} + {{else}} Re-exports {{name}} diff --git a/src/default/partials/member.signature.title.hbs b/src/default/partials/member.signature.title.hbs index 78b04c85..1a871891 100644 --- a/src/default/partials/member.signature.title.hbs +++ b/src/default/partials/member.signature.title.hbs @@ -1,12 +1,12 @@ {{#unless hideName}} {{{wbr name}}} {{else}} - {{#ifCond kindString "===" "Constructor signature"}} + {{#if flags.isAbstract}} abstract {{/if}} new - {{/ifCond}} + {{/unless}} {{#if typeParameters}} < diff --git a/src/default/partials/type-inline-partials/array.hbs b/src/default/partials/type-inline-partials/array.hbs new file mode 100644 index 00000000..947d612a --- /dev/null +++ b/src/default/partials/type-inline-partials/array.hbs @@ -0,0 +1,5 @@ + + + {{__partials__.type needsParens=true}} + [] + diff --git a/src/default/partials/type-inline-partials/conditional.hbs b/src/default/partials/type-inline-partials/conditional.hbs new file mode 100644 index 00000000..50483fb9 --- /dev/null +++ b/src/default/partials/type-inline-partials/conditional.hbs @@ -0,0 +1,22 @@ + + {{#if needsParens}} + ( + {{/if}} + + {{__partials__.type needsParens=true}} + + extends + + {{__partials__.type}} + + ? + + {{__partials__.type}} + + : + + {{__partials__.type}} + + {{#if needsParens}} + ) + {{/if}} diff --git a/src/default/partials/type-inline-partials/indexedAccess.hbs b/src/default/partials/type-inline-partials/indexedAccess.hbs new file mode 100644 index 00000000..100aa0ee --- /dev/null +++ b/src/default/partials/type-inline-partials/indexedAccess.hbs @@ -0,0 +1,9 @@ + + + {{__partials__.type}} + + [ + + {{__partials__.type}} + + ] diff --git a/src/default/partials/type-inline-partials/inferred.hbs b/src/default/partials/type-inline-partials/inferred.hbs new file mode 100644 index 00000000..bcc4cbad --- /dev/null +++ b/src/default/partials/type-inline-partials/inferred.hbs @@ -0,0 +1,2 @@ + + infer {{name}} diff --git a/src/default/partials/type-inline-partials/intersection.hbs b/src/default/partials/type-inline-partials/intersection.hbs new file mode 100644 index 00000000..faecc0ab --- /dev/null +++ b/src/default/partials/type-inline-partials/intersection.hbs @@ -0,0 +1,13 @@ + + {{#if needsParens}} + ( + {{/if}} + {{#each types}} + {{#unless @first}} + & + {{/unless}} + {{__partials__.type needsParens=true}} + {{/each}} + {{#if needsParens}} + ) + {{/if}} diff --git a/src/default/partials/type-inline-partials/intrinsic.hbs b/src/default/partials/type-inline-partials/intrinsic.hbs new file mode 100644 index 00000000..15bc6f33 --- /dev/null +++ b/src/default/partials/type-inline-partials/intrinsic.hbs @@ -0,0 +1,2 @@ + + {{name}} diff --git a/src/default/partials/type-inline-partials/literal.hbs b/src/default/partials/type-inline-partials/literal.hbs new file mode 100644 index 00000000..ed583b5a --- /dev/null +++ b/src/default/partials/type-inline-partials/literal.hbs @@ -0,0 +1,2 @@ + + {{stringify value}} diff --git a/src/default/partials/type-inline-partials/mapped.hbs b/src/default/partials/type-inline-partials/mapped.hbs new file mode 100644 index 00000000..3b34cccf --- /dev/null +++ b/src/default/partials/type-inline-partials/mapped.hbs @@ -0,0 +1,42 @@ + + { + + readonly + + + + -readonly + + + + [ + {{parameter}} + in + + + {{__partials__.type}} + + + + as + {{__partials__.type}} + + + ] + + ?: + + + + -?: + + + : + + + + + {{__partials__.type}} + + + } diff --git a/src/default/partials/type-inline-partials/named-tuple-member.hbs b/src/default/partials/type-inline-partials/named-tuple-member.hbs new file mode 100644 index 00000000..ef3a749a --- /dev/null +++ b/src/default/partials/type-inline-partials/named-tuple-member.hbs @@ -0,0 +1,10 @@ + + {{name}} + {{#if isOptional}} + ?: + {{else}} + : + {{/if}} + + {{__partials__.type}} + diff --git a/src/default/partials/type-inline-partials/optional.hbs b/src/default/partials/type-inline-partials/optional.hbs new file mode 100644 index 00000000..9ce1e2a6 --- /dev/null +++ b/src/default/partials/type-inline-partials/optional.hbs @@ -0,0 +1,5 @@ + + + {{__partials__.type}} + + ? diff --git a/src/default/partials/type-inline-partials/predicate.hbs b/src/default/partials/type-inline-partials/predicate.hbs new file mode 100644 index 00000000..df8ceb58 --- /dev/null +++ b/src/default/partials/type-inline-partials/predicate.hbs @@ -0,0 +1,11 @@ + + {{#if asserts}} + asserts + {{/if}} + {{name}} + {{#if targetType}} + is + + {{__partials__.type}} + + {{/if}} diff --git a/src/default/partials/type-inline-partials/query.hbs b/src/default/partials/type-inline-partials/query.hbs new file mode 100644 index 00000000..ebaf7ff7 --- /dev/null +++ b/src/default/partials/type-inline-partials/query.hbs @@ -0,0 +1,5 @@ + + typeof + + {{__partials__.type}} + diff --git a/src/default/partials/type-inline-partials/reference.hbs b/src/default/partials/type-inline-partials/reference.hbs new file mode 100644 index 00000000..279304ff --- /dev/null +++ b/src/default/partials/type-inline-partials/reference.hbs @@ -0,0 +1,20 @@ + + {{#if getReflection}} + + + {{name}} + + + {{else}} + {{name}} + {{/if}} + {{#if typeArguments}} + < + {{#each typeArguments}} + {{#unless @first}} + , + {{/unless}} + {{__partials__.type}} + {{/each}} + > + {{/if}} diff --git a/src/default/partials/type-inline-partials/reflection.hbs b/src/default/partials/type-inline-partials/reflection.hbs new file mode 100644 index 00000000..4baac1cc --- /dev/null +++ b/src/default/partials/type-inline-partials/reflection.hbs @@ -0,0 +1,91 @@ + +{{#if declaration.children}} {{! object literal }} + { + {{#each declaration.children}} + {{#unless @first}} + ; + {{/unless}} + + {{#if getSignature}} + {{#if setSignature}} + {{name}} + : + {{#if getSignature.type}} + + {{__partials__.type}} + + {{else}} + any + {{/if}} + {{else}} + get + {{name}} + (): + {{#if getSignature.type}} + + {{__partials__.type}} + + {{else}} + any + {{/if}} + {{/if}} + {{else}} + {{#if setSignature}} + set + {{name}} + ( + {{! Rather hacky to use each here... but we know there is exactly one. }} + {{#each setSignature.parameters}} + {{name}} + : + {{#if type}} + + {{__partials__.type}} + + {{else}} + any + {{/if}} + {{/each}} + ) + {{else}} + {{name}} + {{#if flags.isOptional }} + ?: + {{else}} + : + {{/if}} + {{#if type}} + + {{__partials__.type}} + + {{else}} + any + {{/if}} + {{/if}} + {{/if}} + {{/each}} + } +{{else if declaration.signatures}} + {{#if "(lookup declaration.signatures 1)" }} {{! more than one signature}} + { + {{#each declaration.signatures}} + {{__partials__.member.signature.title hideName=true}} + {{#unless @last}} + ; + {{/unless}} + {{/each}} + } + {{else}} + {{#if needsParens}} + ( + {{/if}} + + {{__partials__.member.signature.title hideName=true arrowStyle=true}} + + {{#if needsParens}} + ) + {{/if}} + {{/if}} +{{else}} + {} +{{/if}} diff --git a/src/default/partials/type-inline-partials/rest.hbs b/src/default/partials/type-inline-partials/rest.hbs new file mode 100644 index 00000000..5b82d4a3 --- /dev/null +++ b/src/default/partials/type-inline-partials/rest.hbs @@ -0,0 +1,5 @@ + + ... + + {{__partials__.type}} + diff --git a/src/default/partials/type-inline-partials/template-literal.hbs b/src/default/partials/type-inline-partials/template-literal.hbs new file mode 100644 index 00000000..99aa97a5 --- /dev/null +++ b/src/default/partials/type-inline-partials/template-literal.hbs @@ -0,0 +1,16 @@ + + ` + {{#if head}} + {{head}} + {{/if}} + {{#each tail}} + ${ + + {{__partials__.type}} + + } + {{#if this.[1]}} + {{this.[1]}} + {{/if}} + {{/each}} + ` diff --git a/src/default/partials/type-inline-partials/tuple.hbs b/src/default/partials/type-inline-partials/tuple.hbs new file mode 100644 index 00000000..a0821417 --- /dev/null +++ b/src/default/partials/type-inline-partials/tuple.hbs @@ -0,0 +1,9 @@ + + [ + {{#each elements}} + {{#unless @first}} + , + {{/unless}} + {{__partials__.type}} + {{/each}} + ] diff --git a/src/default/partials/type-inline-partials/typeOperator.hbs b/src/default/partials/type-inline-partials/typeOperator.hbs new file mode 100644 index 00000000..e913f4e6 --- /dev/null +++ b/src/default/partials/type-inline-partials/typeOperator.hbs @@ -0,0 +1,5 @@ + + {{operator}} + + {{__partials__.type}} + diff --git a/src/default/partials/type-inline-partials/typeParameter.hbs b/src/default/partials/type-inline-partials/typeParameter.hbs new file mode 100644 index 00000000..15bc6f33 --- /dev/null +++ b/src/default/partials/type-inline-partials/typeParameter.hbs @@ -0,0 +1,2 @@ + + {{name}} diff --git a/src/default/partials/type-inline-partials/union.hbs b/src/default/partials/type-inline-partials/union.hbs new file mode 100644 index 00000000..97d140b2 --- /dev/null +++ b/src/default/partials/type-inline-partials/union.hbs @@ -0,0 +1,13 @@ + + {{#if needsParens}} + ( + {{/if}} + {{#each types}} + {{#unless @first}} + | + {{/unless}} + {{__partials__.type needsParens=true}} + {{/each}} + {{#if needsParens}} + ) + {{/if}} diff --git a/src/default/partials/type-inline-partials/unknown.hbs b/src/default/partials/type-inline-partials/unknown.hbs new file mode 100644 index 00000000..e69de29b diff --git a/src/default/partials/type.hbs b/src/default/partials/type.hbs index b0808a61..595d3ad7 100644 --- a/src/default/partials/type.hbs +++ b/src/default/partials/type.hbs @@ -8,328 +8,8 @@ if an inner type may result in invalid output without them. For example: () => 1 | 2 !== (() => 1) | 2 }} -{{#*inline 'array'}} - - {{__partials__.type needsParens=true}} - [] - -{{/inline}} - -{{#*inline 'conditional'}} - {{#if needsParens}} - ( - {{/if}} - - {{__partials__.type needsParens=true}} - - extends - - {{__partials__.type}} - - ? - - {{__partials__.type}} - - : - - {{__partials__.type}} - - {{#if needsParens}} - ) - {{/if}} -{{/inline}} - -{{#*inline 'indexedAccess'}} - - {{__partials__.type}} - - [ - - {{__partials__.type}} - - ] -{{/inline}} - -{{#*inline 'inferred'}} - infer {{name}} -{{/inline}} - -{{#*inline 'intersection'}} - {{#if needsParens}} - ( - {{/if}} - {{#each types}} - {{#unless @first}} - & - {{/unless}} - {{__partials__.type needsParens=true}} - {{/each}} - {{#if needsParens}} - ) - {{/if}} -{{/inline}} - -{{#*inline 'intrinsic'}} - {{name}} -{{/inline}} - -{{#*inline 'literal'}} - {{stringify value}} -{{/inline}} - -{{#*inline 'mapped'}} - { - {{#ifCond readonlyModifier '===' '+'}} - readonly - {{else}} - {{#ifCond readonlyModifier '===' '-'}} - -readonly - {{/ifCond}} - {{/ifCond}} - - [ - {{parameter}} - in - - - {{__partials__.type}} - - - - as - {{__partials__.type}} - - - ] - {{#ifCond readonlyModifier '===' '+'}} - ?: - {{else}} - {{#ifCond readonlyModifier '===' '-'}} - -?: - {{else}} - : - {{/ifCond}} - {{/ifCond}} - - - {{__partials__.type}} - - - } -{{/inline}} - -{{#*inline 'optional'}} - - {{__partials__.type}} - - ? -{{/inline}} - -{{#*inline 'predicate'}} - {{#if asserts}} - asserts - {{/if}} - {{name}} - {{#if targetType}} - is - - {{__partials__.type}} - - {{/if}} -{{/inline}} - -{{#*inline 'query'}} - typeof - - {{__partials__.type}} - -{{/inline}} - -{{#*inline 'reference'}} - - - {{name}} - - {{else}} - {{name}} - - {{#if typeArguments}} - < - {{#each typeArguments}} - {{#unless @first}} - , - {{/unless}} - {{__partials__.type}} - {{/each}} - > - {{/if}} -{{/inline}} - -{{#*inline 'reflection'}} - {{#if declaration.children}} {{! object literal }} - { - {{#each declaration.children}} - {{#unless @first}} - ; - {{/unless}} - - {{#if getSignature}} - {{#if setSignature}} - {{name}} - : - - {{__partials__.type}} - {{else}} - any - - {{else}} - get - {{name}} - (): - - {{__partials__.type}} - {{else}} - any - - {{/if}} - {{else}} - {{#if setSignature}} - set - {{name}} - ( - {{! Rather hacky to use each here... but we know there is exactly one. }} - {{#each setSignature.parameters}} - {{name}} - : - - {{__partials__.type}} - {{else}} - any - - {{/each}} - ) - {{else}} - {{name}} - {{#if flags.isOptional }} - ?: - {{else}} - : - {{/if}} - - {{__partials__.type}} - {{else}} - any - - {{/if}} - {{/if}} - {{/each}} - } - {{else if declaration.signatures}} - {{#if (lookup declaration.signatures 1) }} {{! more than one signature}} - { - {{#each declaration.signatures}} - {{__partials__.member.signature.title hideName=true}} - {{#unless @last}} - ; - {{/unless}} - {{/each}} - } - {{else}} - {{#if needsParens}} - ( - {{/if}} - - {{__partials__.member.signature.title hideName=true arrowStyle=true}} - - {{#if needsParens}} - ) - {{/if}} - {{/if}} - {{else}} - {} - {{/if}} -{{/inline}} - -{{#*inline 'rest'}} - ... - - {{__partials__.type}} - -{{/inline}} - -{{#*inline 'tuple'}} - [ - {{#each elements}} - {{#unless @first}} - , - {{/unless}} - {{__partials__.type}} - {{/each}} - ] -{{/inline}} - -{{#*inline 'template-literal'}} - ` - {{#if head}} - {{head}} - {{/if}} - {{#each tail}} - ${ - - {{__partials__.type}} - - } - {{#if this.[1]}} - {{this.[1]}} - {{/if}} - {{/each}} - ` -{{/inline}} - -{{#*inline 'typeOperator'}} - {{operator}} - - {{__partials__.type}} - -{{/inline}} - -{{#*inline 'typeParameter'}} - {{name}} -{{/inline}} - -{{#*inline 'union'}} - {{#if needsParens}} - ( - {{/if}} - {{#each types}} - {{#unless @first}} - | - {{/unless}} - {{__partials__.type needsParens=true}} - {{/each}} - {{#if needsParens}} - ) - {{/if}} -{{/inline}} - -{{#*inline 'unknown'}} - {{name}} -{{/inline}} - -{{#*inline 'named-tuple-member'}} - {{name}} - {{#if isOptional}} - ?: - {{else}} - : - {{/if}} - - {{__partials__.type}} - -{{/inline}} - {{#if this}} - {{__partials__.(lookup . 'type') }} + {{__partials__.lookup.dot.typeString }} {{else}} void {{/if}} From a7e5412c60bc191c641f6c2fbd1bb55dd0450b3a Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Thu, 15 Jul 2021 17:57:01 -0400 Subject: [PATCH 06/19] add converted tsx before I muck with it --- src/default/layouts/default.tsx | 48 ++++++++ src/default/partials/analytics.tsx | 11 ++ src/default/partials/breadcrumb.tsx | 10 ++ src/default/partials/comment.tsx | 14 +++ src/default/partials/footer.tsx | 17 +++ src/default/partials/header.tsx | 67 ++++++++++ src/default/partials/hierarchy.tsx | 12 ++ src/default/partials/index.tsx | 32 +++++ src/default/partials/member.declaration.tsx | 28 +++++ src/default/partials/member.getterSetter.tsx | 31 +++++ src/default/partials/member.reference.tsx | 12 ++ .../partials/member.signature.body.tsx | 38 ++++++ .../partials/member.signature.title.tsx | 27 +++++ src/default/partials/member.signatures.tsx | 11 ++ src/default/partials/member.sources.tsx | 11 ++ src/default/partials/member.tsx | 16 +++ src/default/partials/members.group.tsx | 10 ++ src/default/partials/members.tsx | 7 ++ src/default/partials/navigation.tsx | 14 +++ src/default/partials/parameter.tsx | 114 ++++++++++++++++++ src/default/partials/toc.root.tsx | 24 ++++ src/default/partials/toc.tsx | 8 ++ .../partials/type-inline-partials/array.tsx | 7 ++ .../type-inline-partials/conditional.tsx | 20 +++ .../type-inline-partials/indexedAccess.tsx | 11 ++ .../type-inline-partials/inferred.tsx | 4 + .../type-inline-partials/intersection.tsx | 7 ++ .../type-inline-partials/intrinsic.tsx | 4 + .../partials/type-inline-partials/literal.tsx | 4 + .../partials/type-inline-partials/mapped.tsx | 44 +++++++ .../named-tuple-member.tsx | 9 ++ .../type-inline-partials/optional.tsx | 7 ++ .../type-inline-partials/predicate.tsx | 9 ++ .../partials/type-inline-partials/query.tsx | 7 ++ .../type-inline-partials/reference.tsx | 13 ++ .../type-inline-partials/reflection.tsx | 55 +++++++++ .../partials/type-inline-partials/rest.tsx | 7 ++ .../type-inline-partials/template-literal.tsx | 12 ++ .../partials/type-inline-partials/tuple.tsx | 7 ++ .../type-inline-partials/typeOperator.tsx | 7 ++ .../type-inline-partials/typeParameter.tsx | 4 + .../partials/type-inline-partials/union.tsx | 7 ++ .../partials/type-inline-partials/unknown.tsx | 2 + src/default/partials/type.tsx | 17 +++ src/default/partials/typeAndParent.tsx | 23 ++++ src/default/partials/typeParameters.tsx | 13 ++ src/default/templates/index.tsx | 5 + src/default/templates/reflection.tsx | 59 +++++++++ src/minimal/layouts/default.tsx | 41 +++++++ src/minimal/partials/header.tsx | 37 ++++++ src/minimal/partials/member.tsx | 19 +++ src/minimal/templates/index.tsx | 18 +++ 52 files changed, 1041 insertions(+) create mode 100644 src/default/layouts/default.tsx create mode 100644 src/default/partials/analytics.tsx create mode 100644 src/default/partials/breadcrumb.tsx create mode 100644 src/default/partials/comment.tsx create mode 100644 src/default/partials/footer.tsx create mode 100644 src/default/partials/header.tsx create mode 100644 src/default/partials/hierarchy.tsx create mode 100644 src/default/partials/index.tsx create mode 100644 src/default/partials/member.declaration.tsx create mode 100644 src/default/partials/member.getterSetter.tsx create mode 100644 src/default/partials/member.reference.tsx create mode 100644 src/default/partials/member.signature.body.tsx create mode 100644 src/default/partials/member.signature.title.tsx create mode 100644 src/default/partials/member.signatures.tsx create mode 100644 src/default/partials/member.sources.tsx create mode 100644 src/default/partials/member.tsx create mode 100644 src/default/partials/members.group.tsx create mode 100644 src/default/partials/members.tsx create mode 100644 src/default/partials/navigation.tsx create mode 100644 src/default/partials/parameter.tsx create mode 100644 src/default/partials/toc.root.tsx create mode 100644 src/default/partials/toc.tsx create mode 100644 src/default/partials/type-inline-partials/array.tsx create mode 100644 src/default/partials/type-inline-partials/conditional.tsx create mode 100644 src/default/partials/type-inline-partials/indexedAccess.tsx create mode 100644 src/default/partials/type-inline-partials/inferred.tsx create mode 100644 src/default/partials/type-inline-partials/intersection.tsx create mode 100644 src/default/partials/type-inline-partials/intrinsic.tsx create mode 100644 src/default/partials/type-inline-partials/literal.tsx create mode 100644 src/default/partials/type-inline-partials/mapped.tsx create mode 100644 src/default/partials/type-inline-partials/named-tuple-member.tsx create mode 100644 src/default/partials/type-inline-partials/optional.tsx create mode 100644 src/default/partials/type-inline-partials/predicate.tsx create mode 100644 src/default/partials/type-inline-partials/query.tsx create mode 100644 src/default/partials/type-inline-partials/reference.tsx create mode 100644 src/default/partials/type-inline-partials/reflection.tsx create mode 100644 src/default/partials/type-inline-partials/rest.tsx create mode 100644 src/default/partials/type-inline-partials/template-literal.tsx create mode 100644 src/default/partials/type-inline-partials/tuple.tsx create mode 100644 src/default/partials/type-inline-partials/typeOperator.tsx create mode 100644 src/default/partials/type-inline-partials/typeParameter.tsx create mode 100644 src/default/partials/type-inline-partials/union.tsx create mode 100644 src/default/partials/type-inline-partials/unknown.tsx create mode 100644 src/default/partials/type.tsx create mode 100644 src/default/partials/typeAndParent.tsx create mode 100644 src/default/partials/typeParameters.tsx create mode 100644 src/default/templates/index.tsx create mode 100644 src/default/templates/reflection.tsx create mode 100644 src/minimal/layouts/default.tsx create mode 100644 src/minimal/partials/header.tsx create mode 100644 src/minimal/partials/member.tsx create mode 100644 src/minimal/templates/index.tsx diff --git a/src/default/layouts/default.tsx b/src/default/layouts/default.tsx new file mode 100644 index 00000000..a7ff8489 --- /dev/null +++ b/src/default/layouts/default.tsx @@ -0,0 +1,48 @@ +import React from 'react'; +export const component = props => + + + + + <IfCond cond="model.name '==' project.name">{props.project.name}</IfCond><IfNotCond cond="model.name '==' project.name">{props.model.name} | {props.project.name}</IfNotCond> + + + + + + + + + {props.__partials__.header} + +
    +
    +
    + {props.contents} +
    +
    + + + +
    +
    +
    + + {props.__partials__.footer} + +
    + + + {props.__partials__.analytics} + + + +
    ; diff --git a/src/default/partials/analytics.tsx b/src/default/partials/analytics.tsx new file mode 100644 index 00000000..6a346d04 --- /dev/null +++ b/src/default/partials/analytics.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +export const component = props => Boolean(props.settings.gaID) && +; diff --git a/src/default/partials/breadcrumb.tsx b/src/default/partials/breadcrumb.tsx new file mode 100644 index 00000000..423d74d8 --- /dev/null +++ b/src/default/partials/breadcrumb.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +export const component = props => Boolean(props.parent) ? {props.__partials__.breadcrumb} +
  • + {Boolean(props.url) ? {props.name} + : {props.name} + }
  • +
    : Boolean(props.url) &&
  • + {props.name} +
  • +
    ; diff --git a/src/default/partials/comment.tsx b/src/default/partials/comment.tsx new file mode 100644 index 00000000..7b614d4b --- /dev/null +++ b/src/default/partials/comment.tsx @@ -0,0 +1,14 @@ +import React from 'react'; +export const component = props => + {Boolean(props.hasVisibleComponent) &&
    + {Boolean(props.shortText) &&
    + {props.shortText} +
    +
    }{Boolean(props.text) && {props.text} + }{Boolean(props.tags) &&
    + {props.tags.map((item, i) =>
    {item.tagName}
    +
    {item.text}
    +
    )}
    +
    }
    +
    }
    +
    ; diff --git a/src/default/partials/footer.tsx b/src/default/partials/footer.tsx new file mode 100644 index 00000000..fcd6dd10 --- /dev/null +++ b/src/default/partials/footer.tsx @@ -0,0 +1,17 @@ +import React from 'react'; +export const component = props => +
    +
    +

    Legend

    +
    + {props.legend.map((item, i) =>
      + {item.props.map((item, i) =>
    • {item.name}
    • +
      )}
    +
    )}
    +
    +
    + + {!Boolean(props.settings.hideGenerator) &&
    +

    Generated using TypeDoc

    +
    +
    }
    ; diff --git a/src/default/partials/header.tsx b/src/default/partials/header.tsx new file mode 100644 index 00000000..ab4d695a --- /dev/null +++ b/src/default/partials/header.tsx @@ -0,0 +1,67 @@ +import React from 'react'; +export const component = props =>
    +
    +
    +
    + + +
    +
    + Options +
    +
    + All +
      +
    • Public
    • +
    • Public/Protected
    • +
    • All
    • +
    +
    + + + + + {!Boolean(props.settings.excludeExternals) && + + }
    +
    + + Menu +
    +
    +
    +
    +
    +
    + {Boolean(props.model.parent) && { + /* Don't show breadcrumbs on main project page, it is the root page. !*/ + } +
      + {props.__partials__.breadcrumb} +
    +
    }

    + + {props.model.kindString}  + + {props.model.name} + {Boolean(props.model.typeParameters) && < + {props.model.typeParameters.map((item, i) => {Boolean(item.index) && ",\xA0"} + {item.name} + )} > + }

    +
    +
    +
    +
    ; diff --git a/src/default/partials/hierarchy.tsx b/src/default/partials/hierarchy.tsx new file mode 100644 index 00000000..450f0221 --- /dev/null +++ b/src/default/partials/hierarchy.tsx @@ -0,0 +1,12 @@ +import React from 'react'; +export const component = props =>
      + {props.types.map((item, i) =>
    • + {Boolean(item.superProps.isTarget) ? {item} + : {item.__partials__.type} + } + {Boolean(item.last) && + {item.__partials__.hierarchy} + + }
    • +
      )}
    +
    ; diff --git a/src/default/partials/index.tsx b/src/default/partials/index.tsx new file mode 100644 index 00000000..3532a5dd --- /dev/null +++ b/src/default/partials/index.tsx @@ -0,0 +1,32 @@ +import React from 'react'; +export const component = props => Boolean(props.categories) ?
    +

    Index

    +
    +
    + {props.categories.map((item, i) =>
    +

    {item.title}

    + +
    +
    )}
    +
    +
    +
    : Boolean(props.groups) &&
    +

    Index

    +
    +
    + {props.groups.map((item, i) =>
    + {Boolean(item.categories) ? item.categories.map((item, i) =>

    {Boolean(item.title) && {item.title} }{item.superProps.title}

    + +
    ) :

    {item.title}

    + +
    }
    +
    )}
    +
    +
    +
    ; diff --git a/src/default/partials/member.declaration.tsx b/src/default/partials/member.declaration.tsx new file mode 100644 index 00000000..e3a6bdad --- /dev/null +++ b/src/default/partials/member.declaration.tsx @@ -0,0 +1,28 @@ +import React from 'react'; +export const component = props =>
    + {props.wbr} + {Boolean(props.typeParameters) && < + {props.typeParameters.map((item, i) => {Boolean(item.index) && ",\xA0"} + {item.name} + )} > + } {Boolean(props.isOptional) && "?"}: {props.__partials__.type} + {Boolean(props.defaultValue) && +  =  + {props.defaultValue} + + }
    + + {props.__partials__.member.sources} + + {props.__partials__.comment} + + {Boolean(props.typeParameters) &&

    Type parameters

    + {props.__partials__.typeParameters} +
    } + {Boolean(props.type.declaration) &&
    +

    Type declaration

    + + {props.__partials__.parameter} + +
    +
    }
    ; diff --git a/src/default/partials/member.getterSetter.tsx b/src/default/partials/member.getterSetter.tsx new file mode 100644 index 00000000..d294498b --- /dev/null +++ b/src/default/partials/member.getterSetter.tsx @@ -0,0 +1,31 @@ +import React from 'react'; +export const component = props =>
      + {Boolean(props.getSignature) && +
    • + get  + {props.superProps.name} + {props.__partials__.member.signature.title} +
    • +
      +
      }{Boolean(props.setSignature) && +
    • + set  + {props.superProps.name} + {props.__partials__.member.signature.title} +
    • +
      +
      }
    + +
      + {Boolean(props.getSignature) && +
    • + {props.__partials__.member.signature.body} +
    • +
      +
      }{Boolean(props.setSignature) && +
    • + {props.__partials__.member.signature.body} +
    • +
      +
      }
    +
    ; diff --git a/src/default/partials/member.reference.tsx b/src/default/partials/member.reference.tsx new file mode 100644 index 00000000..61512303 --- /dev/null +++ b/src/default/partials/member.reference.tsx @@ -0,0 +1,12 @@ +import React from 'react'; +export const component = props => Boolean(props.tryGetTargetReflectionDeep) ? + + Re-exports {props.name} + + + {Boolean(props.flags.isExported) ? Renames and re-exports {props.name} + : Renames and exports {props.name} + } + + : Re-exports {props.name} +; diff --git a/src/default/partials/member.signature.body.tsx b/src/default/partials/member.signature.body.tsx new file mode 100644 index 00000000..9d3ef1e7 --- /dev/null +++ b/src/default/partials/member.signature.body.tsx @@ -0,0 +1,38 @@ +import React from 'react'; +export const component = props => {!Boolean(props.hideSources) && {props.__partials__.member.sources} + } + {props.__partials__.comment} + + {Boolean(props.typeParameters) &&

    Type parameters

    + {props.__partials__.typeParameters} +
    } + {Boolean(props.parameters) &&

    Parameters

    +
      + {props.parameters.map((item, i) =>
    • +
      + {item.flags.map((item, i) => {item}  + )} {Boolean(item.flags.isRest) && ...} + {item.name}:  + {item.__partials__.type} + {Boolean(item.defaultValue) && +  =  + {item.defaultValue} + + }
      + + {item.__partials__.comment} + + {Boolean(item.type.declaration) && + {item.__partials__.parameter} + + }
    • +
      )}
    +
    } + {Boolean(props.type) &&

    Returns {props.__partials__.type}

    + + {Boolean(props.comment.returns) && {props.comment.returns} + } + {Boolean(props.type.declaration) && + {props.__partials__.parameter} + + }
    }
    ; diff --git a/src/default/partials/member.signature.title.tsx b/src/default/partials/member.signature.title.tsx new file mode 100644 index 00000000..d391732d --- /dev/null +++ b/src/default/partials/member.signature.title.tsx @@ -0,0 +1,27 @@ +import React from 'react'; +export const component = props => {!Boolean(props.hideName) ? {props.wbr} + : + {Boolean(props.flags.isAbstract) && abstract + } new + + }{Boolean(props.typeParameters) && < + {props.typeParameters.map((item, i) => {Boolean(item.index) && ",\xA0"} + {item.name} + )} > + }( + {props.parameters.map((item, i) => {Boolean(item.index) && ",\xA0"} + {Boolean(item.flags.isRest) && ...} + {item.name} + + {Boolean(item.flags.isOptional) && "?"} + {Boolean(item.defaultValue) && "?"} + :  + + {item.__partials__.type} + )}) + {Boolean(props.type) && {Boolean(props.arrowStyle) ? => + : : + } + {props.__partials__.type} + + }; diff --git a/src/default/partials/member.signatures.tsx b/src/default/partials/member.signatures.tsx new file mode 100644 index 00000000..401644cc --- /dev/null +++ b/src/default/partials/member.signatures.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +export const component = props =>
      + {props.signatures.map((item, i) =>
    • {item.__partials__.member.signature.title}
    • +
      )}
    + +
      + {props.signatures.map((item, i) =>
    • + {item.__partials__.member.signature.body} +
    • +
      )}
    +
    ; diff --git a/src/default/partials/member.sources.tsx b/src/default/partials/member.sources.tsx new file mode 100644 index 00000000..ed31b7eb --- /dev/null +++ b/src/default/partials/member.sources.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +export const component = props => +; diff --git a/src/default/partials/member.tsx b/src/default/partials/member.tsx new file mode 100644 index 00000000..0bbb5ab9 --- /dev/null +++ b/src/default/partials/member.tsx @@ -0,0 +1,16 @@ +import React from 'react'; +export const component = props =>
    + + {Boolean(props.name) &&

    {props.flags.map((item, i) => {item} )}{props.wbr}

    +
    } + {Boolean(props.signatures) ? {props.__partials__.member.signatures} + : Boolean(props.hasGetterOrSetter) ? + {props.__partials__.member.getterSetter} + : Boolean(props.isReference) ? + {props.__partials__.member.reference} + : {props.__partials__.member.declaration} + } + + {props.groups.map((item, i) => {item.children.map((item, i) => {!Boolean(item.hasOwnDocument) && {item.__partials__.member} + })})}
    +
    ; diff --git a/src/default/partials/members.group.tsx b/src/default/partials/members.group.tsx new file mode 100644 index 00000000..82a4f9d4 --- /dev/null +++ b/src/default/partials/members.group.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +export const component = props => Boolean(props.categories) ? props.categories.map((item, i) =>
    +

    {Boolean(item.title) && {item.title} }{item.superProps.title}

    + {item.children.map((item, i) => {!Boolean(item.hasOwnDocument) && {item.__partials__.member} + })}
    +
    ) :
    +

    {props.title}

    + {props.children.map((item, i) => {!Boolean(item.hasOwnDocument) && {item.__partials__.member} + })}
    +
    ; diff --git a/src/default/partials/members.tsx b/src/default/partials/members.tsx new file mode 100644 index 00000000..12e2e5b8 --- /dev/null +++ b/src/default/partials/members.tsx @@ -0,0 +1,7 @@ +import React from 'react'; +export const component = props => Boolean(props.categories) ? props.categories.map((item, i) => {!Boolean(item.allChildrenHaveOwnDocument) &&
    +

    {item.title}

    + {item.children.map((item, i) => {!Boolean(item.hasOwnDocument) && {item.__partials__.member} + })}
    +
    }
    ) : props.groups.map((item, i) => {!Boolean(item.allChildrenHaveOwnDocument) && {item.__partials__.members.group} + }); diff --git a/src/default/partials/navigation.tsx b/src/default/partials/navigation.tsx new file mode 100644 index 00000000..595db158 --- /dev/null +++ b/src/default/partials/navigation.tsx @@ -0,0 +1,14 @@ +import React from 'react'; +export const component = props => Boolean(props.isVisible) && (Boolean(props.isLabel) ?
  • + {props.wbr} +
  • +
    : Boolean(props.isGlobals) ?
  • + {props.wbr} +
  • +
    :
  • + {props.wbr} + {Boolean(props.isInPath) && Boolean(props.children) &&
      + {props.children.map((item, i) => {item.__partials__.navigation} + )}
    +
    }
  • +
    ); diff --git a/src/default/partials/parameter.tsx b/src/default/partials/parameter.tsx new file mode 100644 index 00000000..14dc792d --- /dev/null +++ b/src/default/partials/parameter.tsx @@ -0,0 +1,114 @@ +import React from 'react'; +export const component = props =>
      + {Boolean(props.signatures) &&
    • +
        + {props.signatures.map((item, i) =>
      • + {item.__partials__.member.signature.title} +
      • +
        )}
      + +
        + {props.signatures.map((item, i) =>
      • {item.__partials__.member.signature.body}
      • +
        )}
      +
    • +
      }{Boolean(props.indexSignature) &&
    • +
      + [ + {props.indexSignature.parameters.map((item, i) => {Boolean(item.flags.isRest) && ...}{item.name}: {item.__partials__.type} + )} ]:  + {props.__partials__.type} +
      + + + {props.__partials__.comment} + + + {Boolean(props.indexSignature.type.declaration) && + {props.__partials__.parameter} + + }
    • +
      }{props.children.map((item, i) => {Boolean(item.signatures) ?
    • +
      + {Boolean(item.flags.isRest) && ...} + {item.wbr} + + {Boolean(item.isOptional) && "?"} + :  + + function +
      + + {item.__partials__.member.signatures} +
    • +
      : Boolean(item.type) ? { + /* standard type */ + } +
    • +
      + {item.flags.map((item, i) => {item}  + )} {Boolean(item.flags.isRest) && ...} + + {item.wbr} + + {Boolean(item.superProps.flags.isOptional) && "?"} + :  + + {item.__partials__.type} + +
      + + {item.__partials__.comment} + + {Boolean(item.children) && {item.__partials__.parameter} + } + {Boolean(item.type.declaration) && + {item.__partials__.parameter} + + }
    • +
      : { + /* getter/setter */ + } + { + /* getter */ + } +
    • +
      + {item.flags.map((item, i) => {item}  + )} get  + {item.wbr} + ():  + + {item.__partials__.type} + +
      + + {item.__partials__.comment} +
    • +
      + { + /* setter */ + } +
    • +
      + {item.flags.map((item, i) => {item}  + )} set  + {item.wbr} + ( + {item.parameters.map((item, i) => {item.name} + : + {Boolean(item.type) ? + {item.__partials__.type} + + : any + })} ):  + + {item.__partials__.type} + +
      + + {item.__partials__.comment} +
    • +
      +
      } +
      )}
    +
    ; diff --git a/src/default/partials/toc.root.tsx b/src/default/partials/toc.root.tsx new file mode 100644 index 00000000..1b8a43af --- /dev/null +++ b/src/default/partials/toc.root.tsx @@ -0,0 +1,24 @@ +import React from 'react'; +export const component = props => { + /* {{#if isInPath*/ + }{ + /* */ + }{ + /*
      */ + }{ + /* {{/if*/ + }
    • + {props.wbr} + {Boolean(props.children) &&
        + {props.children.map((item, i) => {item.__partials__.toc} + )}
      +
      }
    • + { + /* {{#if isInPath*/ + }{ + /*
    */ + }{ + /*
      */ + }{ + /* {{/if*/ + }; diff --git a/src/default/partials/toc.tsx b/src/default/partials/toc.tsx new file mode 100644 index 00000000..e963838a --- /dev/null +++ b/src/default/partials/toc.tsx @@ -0,0 +1,8 @@ +import React from 'react'; +export const component = props =>
    • + {props.wbr} + {Boolean(props.children) &&
        + {props.children.map((item, i) => {item.__partials__.toc} + )}
      +
      }
    • +
      ; diff --git a/src/default/partials/type-inline-partials/array.tsx b/src/default/partials/type-inline-partials/array.tsx new file mode 100644 index 00000000..ad933715 --- /dev/null +++ b/src/default/partials/type-inline-partials/array.tsx @@ -0,0 +1,7 @@ +import React from 'react'; +export const component = props => + + {props.__partials__.type} + [] + +; diff --git a/src/default/partials/type-inline-partials/conditional.tsx b/src/default/partials/type-inline-partials/conditional.tsx new file mode 100644 index 00000000..b4ee4ad9 --- /dev/null +++ b/src/default/partials/type-inline-partials/conditional.tsx @@ -0,0 +1,20 @@ +import React from 'react'; +export const component = props => + {Boolean(props.needsParens) && ( + } + {props.__partials__.type} + + extends + + {props.__partials__.type} + + ? + + {props.__partials__.type} + + : + + {props.__partials__.type} + + {Boolean(props.needsParens) && ) + }; diff --git a/src/default/partials/type-inline-partials/indexedAccess.tsx b/src/default/partials/type-inline-partials/indexedAccess.tsx new file mode 100644 index 00000000..19f1d407 --- /dev/null +++ b/src/default/partials/type-inline-partials/indexedAccess.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +export const component = props => + + {props.__partials__.type} + + [ + + {props.__partials__.type} + + ] +; diff --git a/src/default/partials/type-inline-partials/inferred.tsx b/src/default/partials/type-inline-partials/inferred.tsx new file mode 100644 index 00000000..919d3041 --- /dev/null +++ b/src/default/partials/type-inline-partials/inferred.tsx @@ -0,0 +1,4 @@ +import React from 'react'; +export const component = props => + infer {props.name} +; diff --git a/src/default/partials/type-inline-partials/intersection.tsx b/src/default/partials/type-inline-partials/intersection.tsx new file mode 100644 index 00000000..f265829f --- /dev/null +++ b/src/default/partials/type-inline-partials/intersection.tsx @@ -0,0 +1,7 @@ +import React from 'react'; +export const component = props => + {Boolean(props.needsParens) && ( + }{props.types.map((item, i) => {!Boolean(item.first) && & + } {item.__partials__.type} + )}{Boolean(props.needsParens) && ) + }; diff --git a/src/default/partials/type-inline-partials/intrinsic.tsx b/src/default/partials/type-inline-partials/intrinsic.tsx new file mode 100644 index 00000000..60d943dd --- /dev/null +++ b/src/default/partials/type-inline-partials/intrinsic.tsx @@ -0,0 +1,4 @@ +import React from 'react'; +export const component = props => + {props.name} +; diff --git a/src/default/partials/type-inline-partials/literal.tsx b/src/default/partials/type-inline-partials/literal.tsx new file mode 100644 index 00000000..621af96d --- /dev/null +++ b/src/default/partials/type-inline-partials/literal.tsx @@ -0,0 +1,4 @@ +import React from 'react'; +export const component = props => + {props.stringify} +; diff --git a/src/default/partials/type-inline-partials/mapped.tsx b/src/default/partials/type-inline-partials/mapped.tsx new file mode 100644 index 00000000..f1d886e3 --- /dev/null +++ b/src/default/partials/type-inline-partials/mapped.tsx @@ -0,0 +1,44 @@ +import React from 'react'; +export const component = props => + {"{"} + + readonly + + + + -readonly + + + + [ + {props.parameter} + in + + + {props.__partials__.type} + + + + as + {props.__partials__.type} + + + ] + + ?: + + + + -?: + + + : + + + + + {props.__partials__.type} + + + {"}"} +; diff --git a/src/default/partials/type-inline-partials/named-tuple-member.tsx b/src/default/partials/type-inline-partials/named-tuple-member.tsx new file mode 100644 index 00000000..859ca27e --- /dev/null +++ b/src/default/partials/type-inline-partials/named-tuple-member.tsx @@ -0,0 +1,9 @@ +import React from 'react'; +export const component = props => + {props.name} + {Boolean(props.isOptional) ? ?: + : : + } + {props.__partials__.type} + +; diff --git a/src/default/partials/type-inline-partials/optional.tsx b/src/default/partials/type-inline-partials/optional.tsx new file mode 100644 index 00000000..092019ae --- /dev/null +++ b/src/default/partials/type-inline-partials/optional.tsx @@ -0,0 +1,7 @@ +import React from 'react'; +export const component = props => + + {props.__partials__.type} + + ? +; diff --git a/src/default/partials/type-inline-partials/predicate.tsx b/src/default/partials/type-inline-partials/predicate.tsx new file mode 100644 index 00000000..de2fa657 --- /dev/null +++ b/src/default/partials/type-inline-partials/predicate.tsx @@ -0,0 +1,9 @@ +import React from 'react'; +export const component = props => + {Boolean(props.asserts) && asserts + } {props.name} + {Boolean(props.targetType) && is + + {props.__partials__.type} + + }; diff --git a/src/default/partials/type-inline-partials/query.tsx b/src/default/partials/type-inline-partials/query.tsx new file mode 100644 index 00000000..1fea8895 --- /dev/null +++ b/src/default/partials/type-inline-partials/query.tsx @@ -0,0 +1,7 @@ +import React from 'react'; +export const component = props => + typeof + + {props.__partials__.type} + +; diff --git a/src/default/partials/type-inline-partials/reference.tsx b/src/default/partials/type-inline-partials/reference.tsx new file mode 100644 index 00000000..8e991516 --- /dev/null +++ b/src/default/partials/type-inline-partials/reference.tsx @@ -0,0 +1,13 @@ +import React from 'react'; +export const component = props => + {Boolean(props.getReflection) ? + + {props.name} + + + : {props.name} + }{Boolean(props.typeArguments) && < + {props.typeArguments.map((item, i) => {!Boolean(item.first) && , + } {item.__partials__.type} + )} > + }; diff --git a/src/default/partials/type-inline-partials/reflection.tsx b/src/default/partials/type-inline-partials/reflection.tsx new file mode 100644 index 00000000..4f790c2d --- /dev/null +++ b/src/default/partials/type-inline-partials/reflection.tsx @@ -0,0 +1,55 @@ +import React from 'react'; +export const component = props => + {Boolean(props.declaration.children) ? { + /* object literal */ + } + {"{"} + {props.declaration.children.map((item, i) => {!Boolean(item.first) && ; + } + {Boolean(item.getSignature) ? Boolean(item.setSignature) ? {item.name} + : + {Boolean(item.getSignature.type) ? + {item.__partials__.type} + + : any + } : get + {item.name} + (): + {Boolean(item.getSignature.type) ? + {item.__partials__.type} + + : any + } : Boolean(item.setSignature) ? set + {item.name} + ( + { + /* Rather hacky to use each here... but we know there is exactly one. */ + }{item.setSignature.parameters.map((item, i) => {item.name} + : + {Boolean(item.type) ? + {item.__partials__.type} + + : any + })} ) + : {item.name} + {Boolean(item.flags.isOptional) ? ?: + : : + }{Boolean(item.type) ? + {item.__partials__.type} + + : any + }})} {"}"} + : Boolean(props.declaration.signatures) ? {Boolean("(lookup declaration.signatures 1)") ? { + /* more than one signature*/ + } + {"{"} + {props.declaration.signatures.map((item, i) => {item.__partials__.member.signature.title} + {!Boolean(item.last) && ; + })} {"}"} + : {Boolean(props.needsParens) && ( + } + {props.__partials__.member.signature.title} + + {Boolean(props.needsParens) && ) + }} : {"{"}{"}"} + }; diff --git a/src/default/partials/type-inline-partials/rest.tsx b/src/default/partials/type-inline-partials/rest.tsx new file mode 100644 index 00000000..2cfc0470 --- /dev/null +++ b/src/default/partials/type-inline-partials/rest.tsx @@ -0,0 +1,7 @@ +import React from 'react'; +export const component = props => + ... + + {props.__partials__.type} + +; diff --git a/src/default/partials/type-inline-partials/template-literal.tsx b/src/default/partials/type-inline-partials/template-literal.tsx new file mode 100644 index 00000000..8e25e8e6 --- /dev/null +++ b/src/default/partials/type-inline-partials/template-literal.tsx @@ -0,0 +1,12 @@ +import React from 'react'; +export const component = props => + ` + {Boolean(props.head) && {props.head} + }{props.tail.map((item, i) => ${"{"} + + {item.__partials__.type} + + {"}"} + {Boolean(item.1) && {item.1} + })} ` +; diff --git a/src/default/partials/type-inline-partials/tuple.tsx b/src/default/partials/type-inline-partials/tuple.tsx new file mode 100644 index 00000000..4bd8cd8c --- /dev/null +++ b/src/default/partials/type-inline-partials/tuple.tsx @@ -0,0 +1,7 @@ +import React from 'react'; +export const component = props => + [ + {props.elements.map((item, i) => {!Boolean(item.first) && , + } {item.__partials__.type} + )} ] +; diff --git a/src/default/partials/type-inline-partials/typeOperator.tsx b/src/default/partials/type-inline-partials/typeOperator.tsx new file mode 100644 index 00000000..74ecdc49 --- /dev/null +++ b/src/default/partials/type-inline-partials/typeOperator.tsx @@ -0,0 +1,7 @@ +import React from 'react'; +export const component = props => + {props.operator} + + {props.__partials__.type} + +; diff --git a/src/default/partials/type-inline-partials/typeParameter.tsx b/src/default/partials/type-inline-partials/typeParameter.tsx new file mode 100644 index 00000000..60d943dd --- /dev/null +++ b/src/default/partials/type-inline-partials/typeParameter.tsx @@ -0,0 +1,4 @@ +import React from 'react'; +export const component = props => + {props.name} +; diff --git a/src/default/partials/type-inline-partials/union.tsx b/src/default/partials/type-inline-partials/union.tsx new file mode 100644 index 00000000..3bc3e2e3 --- /dev/null +++ b/src/default/partials/type-inline-partials/union.tsx @@ -0,0 +1,7 @@ +import React from 'react'; +export const component = props => + {Boolean(props.needsParens) && ( + }{props.types.map((item, i) => {!Boolean(item.first) && | + } {item.__partials__.type} + )}{Boolean(props.needsParens) && ) + }; diff --git a/src/default/partials/type-inline-partials/unknown.tsx b/src/default/partials/type-inline-partials/unknown.tsx new file mode 100644 index 00000000..eb268e48 --- /dev/null +++ b/src/default/partials/type-inline-partials/unknown.tsx @@ -0,0 +1,2 @@ +import React from 'react'; +export const component = props => ; diff --git a/src/default/partials/type.tsx b/src/default/partials/type.tsx new file mode 100644 index 00000000..f52e12ab --- /dev/null +++ b/src/default/partials/type.tsx @@ -0,0 +1,17 @@ +import React from 'react'; +export const component = props => { + /* Each type gets its own inline helper to determine how it is rendered. */ + }{ + /* The name of the helper is the value of the 'type' property on the type.*/ + } + { + /* + The type helper accepts an optional needsParens parameter that is checked + if an inner type may result in invalid output without them. For example: + 1 | 2[] !== (1 | 2)[] + () => 1 | 2 !== (() => 1) | 2 + */ + } + {Boolean(props) ? {props.__partials__.lookup.dot.typeString} + : void + }; diff --git a/src/default/partials/typeAndParent.tsx b/src/default/partials/typeAndParent.tsx new file mode 100644 index 00000000..fb4cf2d3 --- /dev/null +++ b/src/default/partials/typeAndParent.tsx @@ -0,0 +1,23 @@ +import React from 'react'; +export const component = props => + {Boolean(props) ? Boolean(props.elementType) ? + {props.__partials__.typeAndParent} + + [] + : Boolean(props.reflection) ? + {Boolean(props.reflection.parent.parent.url) ? {props.reflection.parent.parent.name} + : {props.reflection.parent.parent.name} + } . + {Boolean(props.reflection.parent.url) ? {props.reflection.parent.name} + : {props.reflection.parent.name} + } + + {Boolean(props.reflection.parent.url) ? {props.reflection.parent.name} + : {props.reflection.parent.name} + } . + {Boolean(props.reflection.url) ? {props.reflection.name} + : {props.reflection.name} + } + : {props} + : " void\n"} +; diff --git a/src/default/partials/typeParameters.tsx b/src/default/partials/typeParameters.tsx new file mode 100644 index 00000000..71e86e51 --- /dev/null +++ b/src/default/partials/typeParameters.tsx @@ -0,0 +1,13 @@ +import React from 'react'; +export const component = props =>
        + {props.typeParameters.map((item, i) =>
      • +

        + {item.name} + {Boolean(item.type) && + {item.__partials__.type} + }{Boolean(item.default) &&  = {item.__partials__.type} + }

        + {item.__partials__.comment} +
      • +
        )}
      +
      ; diff --git a/src/default/templates/index.tsx b/src/default/templates/index.tsx new file mode 100644 index 00000000..623a71f6 --- /dev/null +++ b/src/default/templates/index.tsx @@ -0,0 +1,5 @@ +import React from 'react'; +export const component = props =>
      + {props.model.readme} +
      +
      ; diff --git a/src/default/templates/reflection.tsx b/src/default/templates/reflection.tsx new file mode 100644 index 00000000..1b83b30b --- /dev/null +++ b/src/default/templates/reflection.tsx @@ -0,0 +1,59 @@ +import React from 'react'; +export const component = props => + {Boolean(props.hasComment) &&
      + {props.__partials__.comment} +
      +
      }
      + + {Boolean(props.model.typeParameters) &&
      +

      Type parameters

      + {props.__partials__.typeParameters} +
      +
      } + {Boolean(props.model.typeHierarchy) &&
      +

      Hierarchy

      + {props.__partials__.hierarchy} +
      +
      } + {Boolean(props.model.implementedTypes) &&
      +

      Implements

      +
        + {props.model.implementedTypes.map((item, i) =>
      • {item.__partials__.type}
      • +
        )}
      +
      +
      } + {Boolean(props.model.implementedBy) &&
      +

      Implemented by

      +
        + {props.model.implementedBy.map((item, i) =>
      • {item.__partials__.type}
      • +
        )}
      +
      +
      } + {Boolean(props.model.signatures) &&
      +

      Callable

      + {props.__partials__.member.signatures} +
      +
      } + {Boolean(props.model.indexSignature) &&
      +

      Indexable

      +
      + [ + {props.model.indexSignature.parameters.map((item, i) => {item.name}: {item.__partials__.type} + )} ]:  + {props.__partials__.type} +
      + + + {props.__partials__.comment} + + + {Boolean(props.model.indexSignature.type.declaration) && + {props.__partials__.parameter} + + }
      +
      } + + {props.__partials__.index} + {props.__partials__.members} + +
      ; diff --git a/src/minimal/layouts/default.tsx b/src/minimal/layouts/default.tsx new file mode 100644 index 00000000..a4ee9a82 --- /dev/null +++ b/src/minimal/layouts/default.tsx @@ -0,0 +1,41 @@ +import React from 'react'; +export const component = props => + + + + + {props.model.name} | {props.project.name} + + + + + + + {props.__partials__.header} + + + +
      +
      + {Boolean(props.model.readme) &&
      + {props.model.readme} +
      +
      } + {props.contents} + {props.__partials__.footer} +
      +
      + + + + {props.__partials__.analytics} + + + +
      ; diff --git a/src/minimal/partials/header.tsx b/src/minimal/partials/header.tsx new file mode 100644 index 00000000..c0f24524 --- /dev/null +++ b/src/minimal/partials/header.tsx @@ -0,0 +1,37 @@ +import React from 'react'; +export const component = props =>
      +
      +
      +
      + +
      +
      + Options +
      +
      + All +
        +
      • Public
      • +
      • Public/Protected
      • +
      • All
      • +
      +
      + + + + + {!Boolean(props.settings.excludeExternals) && + + } + + +
      +
      + Menu +
      +
      +
      +
      +
      ; diff --git a/src/minimal/partials/member.tsx b/src/minimal/partials/member.tsx new file mode 100644 index 00000000..3202387b --- /dev/null +++ b/src/minimal/partials/member.tsx @@ -0,0 +1,19 @@ +import React from 'react'; +export const component = props =>
      + + {Boolean(props.name) &&

      {props.flags.map((item, i) => {item} )}{props.wbr}

      +
      } + {Boolean(props.signatures) ? {props.__partials__.member.signatures} + : Boolean(props.hasGetterOrSetter) ? + {props.__partials__.member.getterSetter} + : Boolean(props.tryGetTargetReflectionDeep) ? + {props.__partials__.member.reference} + : {props.__partials__.member.declaration} + } + + {!Boolean(props.isContainer) && props.groups.map((item, i) => {item.children.map((item, i) => {!Boolean(item.hasOwnDocument) && {item.__partials__.member} + })})}
      + + {Boolean(props.isContainer) && {props.__partials__.index} + {props.__partials__.members} + }
      ; diff --git a/src/minimal/templates/index.tsx b/src/minimal/templates/index.tsx new file mode 100644 index 00000000..8f24469b --- /dev/null +++ b/src/minimal/templates/index.tsx @@ -0,0 +1,18 @@ +import React from 'react'; +export const component = props => + {props.__partials__.comment} + + + {Boolean(props.model.typeHierarchy) &&
      +

      Hierarchy

      + {props.__partials__.hierarchy} +
      +
      } + +
      + {props.__partials__.index} + {props.__partials__.members} +
      +
      ; From 1c5ed2ff5539d8a6c04617b74b8e38828bd4d491 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Thu, 15 Jul 2021 18:03:09 -0400 Subject: [PATCH 07/19] replace all react.fragment --- src/default/layouts/default.tsx | 12 ++-- src/default/partials/analytics.tsx | 4 +- src/default/partials/breadcrumb.tsx | 12 ++-- src/default/partials/comment.tsx | 20 +++--- src/default/partials/footer.tsx | 14 ++-- src/default/partials/header.tsx | 22 +++---- src/default/partials/hierarchy.tsx | 18 ++--- src/default/partials/index.tsx | 32 ++++----- src/default/partials/member.declaration.tsx | 24 +++---- src/default/partials/member.getterSetter.tsx | 20 +++--- src/default/partials/member.reference.tsx | 12 ++-- .../partials/member.signature.body.tsx | 42 ++++++------ .../partials/member.signature.title.tsx | 30 ++++----- src/default/partials/member.signatures.tsx | 12 ++-- src/default/partials/member.sources.tsx | 20 +++--- src/default/partials/member.tsx | 22 +++---- src/default/partials/members.group.tsx | 16 ++--- src/default/partials/members.tsx | 10 +-- src/default/partials/navigation.tsx | 16 ++--- src/default/partials/parameter.tsx | 66 +++++++++---------- src/default/partials/toc.root.tsx | 12 ++-- src/default/partials/toc.tsx | 12 ++-- .../partials/type-inline-partials/array.tsx | 4 +- .../type-inline-partials/conditional.tsx | 10 +-- .../type-inline-partials/indexedAccess.tsx | 4 +- .../type-inline-partials/inferred.tsx | 4 +- .../type-inline-partials/intersection.tsx | 12 ++-- .../type-inline-partials/intrinsic.tsx | 4 +- .../partials/type-inline-partials/literal.tsx | 4 +- .../partials/type-inline-partials/mapped.tsx | 4 +- .../named-tuple-member.tsx | 10 +-- .../type-inline-partials/optional.tsx | 4 +- .../type-inline-partials/predicate.tsx | 10 +-- .../partials/type-inline-partials/query.tsx | 4 +- .../type-inline-partials/reference.tsx | 16 ++--- .../type-inline-partials/reflection.tsx | 60 ++++++++--------- .../partials/type-inline-partials/rest.tsx | 4 +- .../type-inline-partials/template-literal.tsx | 12 ++-- .../partials/type-inline-partials/tuple.tsx | 10 +-- .../type-inline-partials/typeOperator.tsx | 4 +- .../type-inline-partials/typeParameter.tsx | 4 +- .../partials/type-inline-partials/union.tsx | 12 ++-- .../partials/type-inline-partials/unknown.tsx | 2 +- src/default/partials/type.tsx | 8 +-- src/default/partials/typeAndParent.tsx | 36 +++++----- src/default/partials/typeParameters.tsx | 14 ++-- src/default/templates/index.tsx | 4 +- src/default/templates/reflection.tsx | 48 +++++++------- src/minimal/layouts/default.tsx | 12 ++-- src/minimal/partials/header.tsx | 4 +- src/minimal/partials/member.tsx | 24 +++---- src/minimal/templates/index.tsx | 8 +-- 52 files changed, 402 insertions(+), 402 deletions(-) diff --git a/src/default/layouts/default.tsx b/src/default/layouts/default.tsx index a7ff8489..7325f757 100644 --- a/src/default/layouts/default.tsx +++ b/src/default/layouts/default.tsx @@ -1,5 +1,5 @@ import React from 'react'; -export const component = props => +export const component = props => <> @@ -23,14 +23,14 @@ export const component = props =>
    @@ -45,4 +45,4 @@ export const component = props => -; +; diff --git a/src/default/partials/analytics.tsx b/src/default/partials/analytics.tsx index 6a346d04..b9e00098 100644 --- a/src/default/partials/analytics.tsx +++ b/src/default/partials/analytics.tsx @@ -1,5 +1,5 @@ import React from 'react'; -export const component = props => Boolean(props.settings.gaID) && -; +; diff --git a/src/default/partials/breadcrumb.tsx b/src/default/partials/breadcrumb.tsx index 423d74d8..db7c4c0b 100644 --- a/src/default/partials/breadcrumb.tsx +++ b/src/default/partials/breadcrumb.tsx @@ -1,10 +1,10 @@ import React from 'react'; -export const component = props => Boolean(props.parent) ? {props.__partials__.breadcrumb} +export const component = props => Boolean(props.parent) ? <> {props.__partials__.breadcrumb}
  • - {Boolean(props.url) ? {props.name} - : {props.name} - }
  • -
    : Boolean(props.url) &&
  • + {Boolean(props.url) ? <> {props.name} + : <> {props.name} + }
  • + : Boolean(props.url) && <>
  • {props.name}
  • -
    ; +; diff --git a/src/default/partials/comment.tsx b/src/default/partials/comment.tsx index 7b614d4b..505f839f 100644 --- a/src/default/partials/comment.tsx +++ b/src/default/partials/comment.tsx @@ -1,14 +1,14 @@ import React from 'react'; -export const component = props => - {Boolean(props.hasVisibleComponent) &&
    - {Boolean(props.shortText) &&
    +export const component = props => <> + {Boolean(props.hasVisibleComponent) && <>
    + {Boolean(props.shortText) && <>
    {props.shortText}
    - }{Boolean(props.text) && {props.text} - }{Boolean(props.tags) &&
    - {props.tags.map((item, i) =>
    {item.tagName}
    + }{Boolean(props.text) && <> {props.text} + }{Boolean(props.tags) && <>
    + {props.tags.map((item, i) => <>
    {item.tagName}
    {item.text}
    - )}
    -
    }
    - }
    -; + )} + }
    + } +; diff --git a/src/default/partials/footer.tsx b/src/default/partials/footer.tsx index fcd6dd10..73bdbe35 100644 --- a/src/default/partials/footer.tsx +++ b/src/default/partials/footer.tsx @@ -1,17 +1,17 @@ import React from 'react'; -export const component = props => +export const component = props => <>

    Legend

    - {props.legend.map((item, i) =>
      - {item.props.map((item, i) =>
    • {item.name}
    • -
      )}
    -
    )}
    + {props.legend.map((item, i) => <>
      + {item.props.map((item, i) => <>
    • {item.name}
    • + )}
    + )}
    - {!Boolean(props.settings.hideGenerator) &&
    + {!Boolean(props.settings.hideGenerator) && <>

    Generated using TypeDoc

    - }; + }; diff --git a/src/default/partials/header.tsx b/src/default/partials/header.tsx index ab4d695a..85dd9ccc 100644 --- a/src/default/partials/header.tsx +++ b/src/default/partials/header.tsx @@ -1,5 +1,5 @@ import React from 'react'; -export const component = props =>
    +export const component = props => <>
    @@ -33,9 +33,9 @@ export const component = props =>
    - {!Boolean(props.settings.excludeExternals) && + {!Boolean(props.settings.excludeExternals) && <> - }
    + }
    Menu @@ -45,23 +45,23 @@ export const component = props =>
    - {Boolean(props.model.parent) && { + {Boolean(props.model.parent) && <> { /* Don't show breadcrumbs on main project page, it is the root page. !*/ }
      {props.__partials__.breadcrumb}
    -
    }

    + }

    - {props.model.kindString}  + {props.model.kindString} {props.model.name} - {Boolean(props.model.typeParameters) && < - {props.model.typeParameters.map((item, i) => {Boolean(item.index) && ",\xA0"} + {Boolean(props.model.typeParameters) && <> < + {props.model.typeParameters.map((item, i) => <> {Boolean(item.index) && ",\xA0"} {item.name} - )} > - }

    + )} > + }

    -
    ; +; diff --git a/src/default/partials/hierarchy.tsx b/src/default/partials/hierarchy.tsx index 450f0221..70175c4e 100644 --- a/src/default/partials/hierarchy.tsx +++ b/src/default/partials/hierarchy.tsx @@ -1,12 +1,12 @@ import React from 'react'; -export const component = props =>
      - {props.types.map((item, i) =>
    • - {Boolean(item.superProps.isTarget) ? {item} - : {item.__partials__.type} - } - {Boolean(item.last) && +export const component = props => <>
        + {props.types.map((item, i) => <>
      • + {Boolean(item.superProps.isTarget) ? <> {item} + : <> {item.__partials__.type} + } + {Boolean(item.last) && <> {item.__partials__.hierarchy} - }
      • - )}
      -
      ; + }
    • + )}
    +; diff --git a/src/default/partials/index.tsx b/src/default/partials/index.tsx index 3532a5dd..56f3154b 100644 --- a/src/default/partials/index.tsx +++ b/src/default/partials/index.tsx @@ -1,32 +1,32 @@ import React from 'react'; -export const component = props => Boolean(props.categories) ?
    +export const component = props => Boolean(props.categories) ? <>

    Index

    - {props.categories.map((item, i) =>
    + {props.categories.map((item, i) => <>

    {item.title}

    + {item.children.map((item, i) => <>
  • {Boolean(item.name) ? item.wbr : {item.wbr}}
  • + )}
    - )}
    + )}
    - : Boolean(props.groups) &&
    + : Boolean(props.groups) && <>

    Index

    - {props.groups.map((item, i) =>
    - {Boolean(item.categories) ? item.categories.map((item, i) =>

    {Boolean(item.title) && {item.title} }{item.superProps.title}

    + {props.groups.map((item, i) => <>
    + {Boolean(item.categories) ? item.categories.map((item, i) => <>

    {Boolean(item.title) && <>{item.title} }{item.superProps.title}

    - ) :

    {item.title}

    + {item.children.map((item, i) => <>
  • {Boolean(item.name) ? item.wbr : {item.wbr}}
  • + )} + ) : <>

    {item.title}

    -
    }
    -
    )}
    + {item.children.map((item, i) => <>
  • {Boolean(item.name) ? item.wbr : {item.wbr}}
  • + )} + }
    + )}
    -
    ; +; diff --git a/src/default/partials/member.declaration.tsx b/src/default/partials/member.declaration.tsx index e3a6bdad..521b6f0b 100644 --- a/src/default/partials/member.declaration.tsx +++ b/src/default/partials/member.declaration.tsx @@ -1,28 +1,28 @@ import React from 'react'; -export const component = props =>
    +export const component = props => <>
    {props.wbr} - {Boolean(props.typeParameters) && < - {props.typeParameters.map((item, i) => {Boolean(item.index) && ",\xA0"} + {Boolean(props.typeParameters) && <> < + {props.typeParameters.map((item, i) => <> {Boolean(item.index) && ",\xA0"} {item.name} - )} > - } {Boolean(props.isOptional) && "?"}: {props.__partials__.type} - {Boolean(props.defaultValue) && -  =  + )} > + } {Boolean(props.isOptional) && "?"}: {props.__partials__.type} + {Boolean(props.defaultValue) && <> +  = {props.defaultValue} - }
    + }
    {props.__partials__.member.sources} {props.__partials__.comment} - {Boolean(props.typeParameters) &&

    Type parameters

    + {Boolean(props.typeParameters) && <>

    Type parameters

    {props.__partials__.typeParameters} -
    } - {Boolean(props.type.declaration) &&
    + } + {Boolean(props.type.declaration) && <>

    Type declaration

    {props.__partials__.parameter}
    - }; + }; diff --git a/src/default/partials/member.getterSetter.tsx b/src/default/partials/member.getterSetter.tsx index d294498b..03513871 100644 --- a/src/default/partials/member.getterSetter.tsx +++ b/src/default/partials/member.getterSetter.tsx @@ -1,31 +1,31 @@ import React from 'react'; -export const component = props =>
      - {Boolean(props.getSignature) && +export const component = props => <>
        + {Boolean(props.getSignature) && <>
      • - get  + get {props.superProps.name} {props.__partials__.member.signature.title}
      • - }{Boolean(props.setSignature) && + }{Boolean(props.setSignature) && <>
      • - set  + set {props.superProps.name} {props.__partials__.member.signature.title}
      • -
        }
      + }
      - {Boolean(props.getSignature) && + {Boolean(props.getSignature) && <>
    • {props.__partials__.member.signature.body}
    • -
      }{Boolean(props.setSignature) && + }{Boolean(props.setSignature) && <>
    • {props.__partials__.member.signature.body}
    • -
      }
    -
    ; + } +; diff --git a/src/default/partials/member.reference.tsx b/src/default/partials/member.reference.tsx index 61512303..56a56832 100644 --- a/src/default/partials/member.reference.tsx +++ b/src/default/partials/member.reference.tsx @@ -1,12 +1,12 @@ import React from 'react'; -export const component = props => Boolean(props.tryGetTargetReflectionDeep) ? +export const component = props => Boolean(props.tryGetTargetReflectionDeep) ? <> Re-exports {props.name} - {Boolean(props.flags.isExported) ? Renames and re-exports {props.name} - : Renames and exports {props.name} - } + {Boolean(props.flags.isExported) ? <> Renames and re-exports {props.name} + : <> Renames and exports {props.name} + } - : Re-exports {props.name} -; + : <> Re-exports {props.name} +; diff --git a/src/default/partials/member.signature.body.tsx b/src/default/partials/member.signature.body.tsx index 9d3ef1e7..304beaaa 100644 --- a/src/default/partials/member.signature.body.tsx +++ b/src/default/partials/member.signature.body.tsx @@ -1,38 +1,38 @@ import React from 'react'; -export const component = props => {!Boolean(props.hideSources) && {props.__partials__.member.sources} - } +export const component = props => <>{!Boolean(props.hideSources) && <> {props.__partials__.member.sources} + } {props.__partials__.comment} - {Boolean(props.typeParameters) &&

    Type parameters

    + {Boolean(props.typeParameters) && <>

    Type parameters

    {props.__partials__.typeParameters} -
    } - {Boolean(props.parameters) &&

    Parameters

    + } + {Boolean(props.parameters) && <>

    Parameters

      - {props.parameters.map((item, i) =>
    • + {props.parameters.map((item, i) => <>
    • - {item.flags.map((item, i) => {item}  - )} {Boolean(item.flags.isRest) && ...} - {item.name}:  + {item.flags.map((item, i) => <> {item} + )} {Boolean(item.flags.isRest) && ...} + {item.name}: {item.__partials__.type} - {Boolean(item.defaultValue) && -  =  + {Boolean(item.defaultValue) && <> +  = {item.defaultValue} - }
      + }

    {item.__partials__.comment} - {Boolean(item.type.declaration) && + {Boolean(item.type.declaration) && <> {item.__partials__.parameter} - } - )} - } - {Boolean(props.type) &&

    Returns {props.__partials__.type}

    + } + )} + } + {Boolean(props.type) && <>

    Returns {props.__partials__.type}

    - {Boolean(props.comment.returns) && {props.comment.returns} - } - {Boolean(props.type.declaration) && + {Boolean(props.comment.returns) && <> {props.comment.returns} + } + {Boolean(props.type.declaration) && <> {props.__partials__.parameter} - }
    }; + }}; diff --git a/src/default/partials/member.signature.title.tsx b/src/default/partials/member.signature.title.tsx index d391732d..402d06c9 100644 --- a/src/default/partials/member.signature.title.tsx +++ b/src/default/partials/member.signature.title.tsx @@ -1,27 +1,27 @@ import React from 'react'; -export const component = props => {!Boolean(props.hideName) ? {props.wbr} - : - {Boolean(props.flags.isAbstract) && abstract - } new +export const component = props => <>{!Boolean(props.hideName) ? <> {props.wbr} + : <> + {Boolean(props.flags.isAbstract) && <> abstract + } new - }{Boolean(props.typeParameters) && < - {props.typeParameters.map((item, i) => {Boolean(item.index) && ",\xA0"} + }{Boolean(props.typeParameters) && <> < + {props.typeParameters.map((item, i) => <> {Boolean(item.index) && ",\xA0"} {item.name} - )} > - }( - {props.parameters.map((item, i) => {Boolean(item.index) && ",\xA0"} + )} > + }( + {props.parameters.map((item, i) => <> {Boolean(item.index) && ",\xA0"} {Boolean(item.flags.isRest) && ...} {item.name} {Boolean(item.flags.isOptional) && "?"} {Boolean(item.defaultValue) && "?"} - :  + : {item.__partials__.type} - )}) - {Boolean(props.type) && {Boolean(props.arrowStyle) ? => - : : - } + )}) + {Boolean(props.type) && <>{Boolean(props.arrowStyle) ? <> => + : <> : + } {props.__partials__.type} - }; + }; diff --git a/src/default/partials/member.signatures.tsx b/src/default/partials/member.signatures.tsx index 401644cc..7c37a425 100644 --- a/src/default/partials/member.signatures.tsx +++ b/src/default/partials/member.signatures.tsx @@ -1,11 +1,11 @@ import React from 'react'; -export const component = props => +export const component = props => <> -; + )} +; diff --git a/src/default/partials/member.sources.tsx b/src/default/partials/member.sources.tsx index ed31b7eb..e4ea1be2 100644 --- a/src/default/partials/member.sources.tsx +++ b/src/default/partials/member.sources.tsx @@ -1,11 +1,11 @@ import React from 'react'; -export const component = props => -; +export const component = props => <> +; diff --git a/src/default/partials/member.tsx b/src/default/partials/member.tsx index 0bbb5ab9..091a91f8 100644 --- a/src/default/partials/member.tsx +++ b/src/default/partials/member.tsx @@ -1,16 +1,16 @@ import React from 'react'; -export const component = props =>
    +export const component = props => <>
    - {Boolean(props.name) &&

    {props.flags.map((item, i) => {item} )}{props.wbr}

    -
    } - {Boolean(props.signatures) ? {props.__partials__.member.signatures} - : Boolean(props.hasGetterOrSetter) ? + {Boolean(props.name) && <>

    {props.flags.map((item, i) => <>{item} )}{props.wbr}

    + } + {Boolean(props.signatures) ? <> {props.__partials__.member.signatures} + : Boolean(props.hasGetterOrSetter) ? <> {props.__partials__.member.getterSetter} -
    : Boolean(props.isReference) ? + : Boolean(props.isReference) ? <> {props.__partials__.member.reference} - : {props.__partials__.member.declaration} - } + : <> {props.__partials__.member.declaration} + } - {props.groups.map((item, i) => {item.children.map((item, i) => {!Boolean(item.hasOwnDocument) && {item.__partials__.member} - })})}
    -; + {props.groups.map((item, i) => <>{item.children.map((item, i) => <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member} + })})}
    +; diff --git a/src/default/partials/members.group.tsx b/src/default/partials/members.group.tsx index 82a4f9d4..18b7e4b2 100644 --- a/src/default/partials/members.group.tsx +++ b/src/default/partials/members.group.tsx @@ -1,10 +1,10 @@ import React from 'react'; -export const component = props => Boolean(props.categories) ? props.categories.map((item, i) =>
    -

    {Boolean(item.title) && {item.title} }{item.superProps.title}

    - {item.children.map((item, i) => {!Boolean(item.hasOwnDocument) && {item.__partials__.member} - })}
    -
    ) :
    +export const component = props => Boolean(props.categories) ? props.categories.map((item, i) => <>
    +

    {Boolean(item.title) && <>{item.title} }{item.superProps.title}

    + {item.children.map((item, i) => <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member} + })}
    +) : <>

    {props.title}

    - {props.children.map((item, i) => {!Boolean(item.hasOwnDocument) && {item.__partials__.member} - })}
    -; + {props.children.map((item, i) => <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member} + })}
    +; diff --git a/src/default/partials/members.tsx b/src/default/partials/members.tsx index 12e2e5b8..28bf05f4 100644 --- a/src/default/partials/members.tsx +++ b/src/default/partials/members.tsx @@ -1,7 +1,7 @@ import React from 'react'; -export const component = props => Boolean(props.categories) ? props.categories.map((item, i) => {!Boolean(item.allChildrenHaveOwnDocument) &&
    +export const component = props => Boolean(props.categories) ? props.categories.map((item, i) => <>{!Boolean(item.allChildrenHaveOwnDocument) && <>

    {item.title}

    - {item.children.map((item, i) => {!Boolean(item.hasOwnDocument) && {item.__partials__.member} - })}
    - }) : props.groups.map((item, i) => {!Boolean(item.allChildrenHaveOwnDocument) && {item.__partials__.members.group} - }); + {item.children.map((item, i) => <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member} + })}
    + }) : props.groups.map((item, i) => <>{!Boolean(item.allChildrenHaveOwnDocument) && <> {item.__partials__.members.group} + }); diff --git a/src/default/partials/navigation.tsx b/src/default/partials/navigation.tsx index 595db158..610d2d4d 100644 --- a/src/default/partials/navigation.tsx +++ b/src/default/partials/navigation.tsx @@ -1,14 +1,14 @@ import React from 'react'; -export const component = props => Boolean(props.isVisible) && (Boolean(props.isLabel) ?
  • +export const component = props => Boolean(props.isVisible) && (Boolean(props.isLabel) ? <>
  • {props.wbr}
  • -
    : Boolean(props.isGlobals) ?
  • + : Boolean(props.isGlobals) ? <>
  • {props.wbr}
  • -
    :
  • + : <>
  • {props.wbr} - {Boolean(props.isInPath) && Boolean(props.children) &&
      - {props.children.map((item, i) => {item.__partials__.navigation} - )}
    -
    }
  • -
    ); + {Boolean(props.isInPath) && Boolean(props.children) && <>
      + {props.children.map((item, i) => <> {item.__partials__.navigation} + )}
    + } +); diff --git a/src/default/partials/parameter.tsx b/src/default/partials/parameter.tsx index 14dc792d..f90150ce 100644 --- a/src/default/partials/parameter.tsx +++ b/src/default/partials/parameter.tsx @@ -1,21 +1,21 @@ import React from 'react'; -export const component = props =>
      - {Boolean(props.signatures) &&
    • +export const component = props => <>
        + {Boolean(props.signatures) && <>
        • - {props.signatures.map((item, i) =>
        • + {props.signatures.map((item, i) => <>
        • {item.__partials__.member.signature.title}
        • -
          )}
        + )}
        - {props.signatures.map((item, i) =>
      • {item.__partials__.member.signature.body}
      • -
        )}
      + {props.signatures.map((item, i) => <>
    • {item.__partials__.member.signature.body}
    • + )}
    -
    }{Boolean(props.indexSignature) &&
  • + }{Boolean(props.indexSignature) && <>
  • [ - {props.indexSignature.parameters.map((item, i) => {Boolean(item.flags.isRest) && ...}{item.name}: {item.__partials__.type} - )} ]:  + {props.indexSignature.parameters.map((item, i) => <> {Boolean(item.flags.isRest) && ...}{item.name}: {item.__partials__.type} + )} ]:  {props.__partials__.type}
    @@ -23,35 +23,35 @@ export const component = props =>
      - {Boolean(props.indexSignature.type.declaration) && + {Boolean(props.indexSignature.type.declaration) && <> {props.__partials__.parameter} - } - }{props.children.map((item, i) => {Boolean(item.signatures) ?
    • + }
    • + }{props.children.map((item, i) => <>{Boolean(item.signatures) ? <>
    • {Boolean(item.flags.isRest) && ...} {item.wbr} {Boolean(item.isOptional) && "?"} - :  + : function
      {item.__partials__.member.signatures}
    • -
      : Boolean(item.type) ? { + : Boolean(item.type) ? <> { /* standard type */ }
    • - {item.flags.map((item, i) => {item}  - )} {Boolean(item.flags.isRest) && ...} + {item.flags.map((item, i) => <> {item} + )} {Boolean(item.flags.isRest) && ...} {item.wbr} {Boolean(item.superProps.flags.isOptional) && "?"} - :  + : {item.__partials__.type} @@ -59,13 +59,13 @@ export const component = props =>
        {item.__partials__.parameter} - } - {Boolean(item.type.declaration) && + {Boolean(item.children) && <> {item.__partials__.parameter} + } + {Boolean(item.type.declaration) && <> {item.__partials__.parameter} - } - : { + } + : <> { /* getter/setter */ } { @@ -73,8 +73,8 @@ export const component = props =>
          - {item.flags.map((item, i) => {item}  - )} get  + {item.flags.map((item, i) => <> {item} + )} get  {item.wbr} ():  @@ -90,17 +90,17 @@ export const component = props =>
            - {item.flags.map((item, i) => {item}  - )} set  + {item.flags.map((item, i) => <> {item} + )} set  {item.wbr} ( - {item.parameters.map((item, i) => {item.name} + {item.parameters.map((item, i) => <> {item.name} : - {Boolean(item.type) ? + {Boolean(item.type) ? <> {item.__partials__.type} - : any - })} ):  + : <> any + })} ):  {item.__partials__.type} @@ -109,6 +109,6 @@ export const component = props =>
              - } - )}
            -
            ; + } + )}
          +; diff --git a/src/default/partials/toc.root.tsx b/src/default/partials/toc.root.tsx index 1b8a43af..6b30fed9 100644 --- a/src/default/partials/toc.root.tsx +++ b/src/default/partials/toc.root.tsx @@ -1,5 +1,5 @@ import React from 'react'; -export const component = props => { +export const component = props => <>{ /* {{#if isInPath*/ }{ /*
        */ @@ -9,10 +9,10 @@ export const component = props => { /* {{/if*/ }
      • {props.wbr} - {Boolean(props.children) &&
          - {props.children.map((item, i) => {item.__partials__.toc} - )}
        -
        }
      • + {Boolean(props.children) && <>
          + {props.children.map((item, i) => <> {item.__partials__.toc} + )}
        + } { /* {{#if isInPath*/ }{ @@ -21,4 +21,4 @@ export const component = props => { /*
          */ }{ /* {{/if*/ - }; + }; diff --git a/src/default/partials/toc.tsx b/src/default/partials/toc.tsx index e963838a..2189f1d5 100644 --- a/src/default/partials/toc.tsx +++ b/src/default/partials/toc.tsx @@ -1,8 +1,8 @@ import React from 'react'; -export const component = props =>
        • +export const component = props => <>
        • {props.wbr} - {Boolean(props.children) &&
            - {props.children.map((item, i) => {item.__partials__.toc} - )}
          -
          }
        • -
          ; + {Boolean(props.children) && <>
            + {props.children.map((item, i) => <> {item.__partials__.toc} + )}
          + } +; diff --git a/src/default/partials/type-inline-partials/array.tsx b/src/default/partials/type-inline-partials/array.tsx index ad933715..ba7b3e78 100644 --- a/src/default/partials/type-inline-partials/array.tsx +++ b/src/default/partials/type-inline-partials/array.tsx @@ -1,7 +1,7 @@ import React from 'react'; -export const component = props => +export const component = props => <> {props.__partials__.type} [] -; +; diff --git a/src/default/partials/type-inline-partials/conditional.tsx b/src/default/partials/type-inline-partials/conditional.tsx index b4ee4ad9..d2dbfb07 100644 --- a/src/default/partials/type-inline-partials/conditional.tsx +++ b/src/default/partials/type-inline-partials/conditional.tsx @@ -1,7 +1,7 @@ import React from 'react'; -export const component = props => - {Boolean(props.needsParens) && ( - } +export const component = props => <> + {Boolean(props.needsParens) && <> ( + } {props.__partials__.type} extends @@ -16,5 +16,5 @@ export const component = props => {props.__partials__.type} - {Boolean(props.needsParens) && ) - }; + {Boolean(props.needsParens) && <> ) + }; diff --git a/src/default/partials/type-inline-partials/indexedAccess.tsx b/src/default/partials/type-inline-partials/indexedAccess.tsx index 19f1d407..12ceb369 100644 --- a/src/default/partials/type-inline-partials/indexedAccess.tsx +++ b/src/default/partials/type-inline-partials/indexedAccess.tsx @@ -1,5 +1,5 @@ import React from 'react'; -export const component = props => +export const component = props => <> {props.__partials__.type} @@ -8,4 +8,4 @@ export const component = props => {props.__partials__.type} ] -; +; diff --git a/src/default/partials/type-inline-partials/inferred.tsx b/src/default/partials/type-inline-partials/inferred.tsx index 919d3041..7dabe131 100644 --- a/src/default/partials/type-inline-partials/inferred.tsx +++ b/src/default/partials/type-inline-partials/inferred.tsx @@ -1,4 +1,4 @@ import React from 'react'; -export const component = props => +export const component = props => <> infer {props.name} -; +; diff --git a/src/default/partials/type-inline-partials/intersection.tsx b/src/default/partials/type-inline-partials/intersection.tsx index f265829f..9b7e5261 100644 --- a/src/default/partials/type-inline-partials/intersection.tsx +++ b/src/default/partials/type-inline-partials/intersection.tsx @@ -1,7 +1,7 @@ import React from 'react'; -export const component = props => - {Boolean(props.needsParens) && ( - }{props.types.map((item, i) => {!Boolean(item.first) && & - } {item.__partials__.type} - )}{Boolean(props.needsParens) && ) - }; +export const component = props => <> + {Boolean(props.needsParens) && <> ( + }{props.types.map((item, i) => <>{!Boolean(item.first) && <> & + } {item.__partials__.type} + )}{Boolean(props.needsParens) && <> ) + }; diff --git a/src/default/partials/type-inline-partials/intrinsic.tsx b/src/default/partials/type-inline-partials/intrinsic.tsx index 60d943dd..547b93cd 100644 --- a/src/default/partials/type-inline-partials/intrinsic.tsx +++ b/src/default/partials/type-inline-partials/intrinsic.tsx @@ -1,4 +1,4 @@ import React from 'react'; -export const component = props => +export const component = props => <> {props.name} -; +; diff --git a/src/default/partials/type-inline-partials/literal.tsx b/src/default/partials/type-inline-partials/literal.tsx index 621af96d..41f35b5d 100644 --- a/src/default/partials/type-inline-partials/literal.tsx +++ b/src/default/partials/type-inline-partials/literal.tsx @@ -1,4 +1,4 @@ import React from 'react'; -export const component = props => +export const component = props => <> {props.stringify} -; +; diff --git a/src/default/partials/type-inline-partials/mapped.tsx b/src/default/partials/type-inline-partials/mapped.tsx index f1d886e3..3309190d 100644 --- a/src/default/partials/type-inline-partials/mapped.tsx +++ b/src/default/partials/type-inline-partials/mapped.tsx @@ -1,5 +1,5 @@ import React from 'react'; -export const component = props => +export const component = props => <> {"{"} readonly @@ -41,4 +41,4 @@ export const component = props => {"}"} -; +; diff --git a/src/default/partials/type-inline-partials/named-tuple-member.tsx b/src/default/partials/type-inline-partials/named-tuple-member.tsx index 859ca27e..930677fc 100644 --- a/src/default/partials/type-inline-partials/named-tuple-member.tsx +++ b/src/default/partials/type-inline-partials/named-tuple-member.tsx @@ -1,9 +1,9 @@ import React from 'react'; -export const component = props => +export const component = props => <> {props.name} - {Boolean(props.isOptional) ? ?: - : : - } + {Boolean(props.isOptional) ? <> ?: + : <> : + } {props.__partials__.type} -; +; diff --git a/src/default/partials/type-inline-partials/optional.tsx b/src/default/partials/type-inline-partials/optional.tsx index 092019ae..8b8ea9d4 100644 --- a/src/default/partials/type-inline-partials/optional.tsx +++ b/src/default/partials/type-inline-partials/optional.tsx @@ -1,7 +1,7 @@ import React from 'react'; -export const component = props => +export const component = props => <> {props.__partials__.type} ? -; +; diff --git a/src/default/partials/type-inline-partials/predicate.tsx b/src/default/partials/type-inline-partials/predicate.tsx index de2fa657..24c5e216 100644 --- a/src/default/partials/type-inline-partials/predicate.tsx +++ b/src/default/partials/type-inline-partials/predicate.tsx @@ -1,9 +1,9 @@ import React from 'react'; -export const component = props => - {Boolean(props.asserts) && asserts - } {props.name} - {Boolean(props.targetType) && is +export const component = props => <> + {Boolean(props.asserts) && <> asserts + } {props.name} + {Boolean(props.targetType) && <> is {props.__partials__.type} - }; + }; diff --git a/src/default/partials/type-inline-partials/query.tsx b/src/default/partials/type-inline-partials/query.tsx index 1fea8895..b3e2592d 100644 --- a/src/default/partials/type-inline-partials/query.tsx +++ b/src/default/partials/type-inline-partials/query.tsx @@ -1,7 +1,7 @@ import React from 'react'; -export const component = props => +export const component = props => <> typeof {props.__partials__.type} -; +; diff --git a/src/default/partials/type-inline-partials/reference.tsx b/src/default/partials/type-inline-partials/reference.tsx index 8e991516..493b9052 100644 --- a/src/default/partials/type-inline-partials/reference.tsx +++ b/src/default/partials/type-inline-partials/reference.tsx @@ -1,13 +1,13 @@ import React from 'react'; -export const component = props => - {Boolean(props.getReflection) ? +export const component = props => <> + {Boolean(props.getReflection) ? <> {props.name} - : {props.name} - }{Boolean(props.typeArguments) && < - {props.typeArguments.map((item, i) => {!Boolean(item.first) && , - } {item.__partials__.type} - )} > - }; + : <> {props.name} + }{Boolean(props.typeArguments) && <> < + {props.typeArguments.map((item, i) => <>{!Boolean(item.first) && <> , + } {item.__partials__.type} + )} > + }; diff --git a/src/default/partials/type-inline-partials/reflection.tsx b/src/default/partials/type-inline-partials/reflection.tsx index 4f790c2d..c8f53741 100644 --- a/src/default/partials/type-inline-partials/reflection.tsx +++ b/src/default/partials/type-inline-partials/reflection.tsx @@ -1,55 +1,55 @@ import React from 'react'; -export const component = props => - {Boolean(props.declaration.children) ? { +export const component = props => <> + {Boolean(props.declaration.children) ? <> { /* object literal */ } {"{"} - {props.declaration.children.map((item, i) => {!Boolean(item.first) && ; - } - {Boolean(item.getSignature) ? Boolean(item.setSignature) ? {item.name} + {props.declaration.children.map((item, i) => <>{!Boolean(item.first) && <> ; + } + {Boolean(item.getSignature) ? Boolean(item.setSignature) ? <> {item.name} : - {Boolean(item.getSignature.type) ? + {Boolean(item.getSignature.type) ? <> {item.__partials__.type} - : any - } : get + : <> any + } : <> get {item.name} (): - {Boolean(item.getSignature.type) ? + {Boolean(item.getSignature.type) ? <> {item.__partials__.type} - : any - } : Boolean(item.setSignature) ? set + : <> any + } : Boolean(item.setSignature) ? <> set {item.name} ( { /* Rather hacky to use each here... but we know there is exactly one. */ - }{item.setSignature.parameters.map((item, i) => {item.name} + }{item.setSignature.parameters.map((item, i) => <> {item.name} : - {Boolean(item.type) ? + {Boolean(item.type) ? <> {item.__partials__.type} - : any - })} ) - : {item.name} - {Boolean(item.flags.isOptional) ? ?: - : : - }{Boolean(item.type) ? + : <> any + })} ) + : <> {item.name} + {Boolean(item.flags.isOptional) ? <> ?: + : <> : + }{Boolean(item.type) ? <> {item.__partials__.type} - : any - }})} {"}"} - : Boolean(props.declaration.signatures) ? {Boolean("(lookup declaration.signatures 1)") ? { + : <> any + }})} {"}"} + : Boolean(props.declaration.signatures) ? <> {Boolean("(lookup declaration.signatures 1)") ? <> { /* more than one signature*/ } {"{"} - {props.declaration.signatures.map((item, i) => {item.__partials__.member.signature.title} - {!Boolean(item.last) && ; - })} {"}"} - : {Boolean(props.needsParens) && ( - } + {props.declaration.signatures.map((item, i) => <> {item.__partials__.member.signature.title} + {!Boolean(item.last) && <> ; + })} {"}"} + : <>{Boolean(props.needsParens) && <> ( + } {props.__partials__.member.signature.title} - {Boolean(props.needsParens) && ) - }} : {"{"}{"}"} - }; + {Boolean(props.needsParens) && <> ) + }} : <> {"{"}{"}"} + }; diff --git a/src/default/partials/type-inline-partials/rest.tsx b/src/default/partials/type-inline-partials/rest.tsx index 2cfc0470..da569073 100644 --- a/src/default/partials/type-inline-partials/rest.tsx +++ b/src/default/partials/type-inline-partials/rest.tsx @@ -1,7 +1,7 @@ import React from 'react'; -export const component = props => +export const component = props => <> ... {props.__partials__.type} -; +; diff --git a/src/default/partials/type-inline-partials/template-literal.tsx b/src/default/partials/type-inline-partials/template-literal.tsx index 8e25e8e6..3c5834b0 100644 --- a/src/default/partials/type-inline-partials/template-literal.tsx +++ b/src/default/partials/type-inline-partials/template-literal.tsx @@ -1,12 +1,12 @@ import React from 'react'; -export const component = props => +export const component = props => <> ` - {Boolean(props.head) && {props.head} - }{props.tail.map((item, i) => ${"{"} + {Boolean(props.head) && <> {props.head} + }{props.tail.map((item, i) => <> ${"{"} {item.__partials__.type} {"}"} - {Boolean(item.1) && {item.1} - })} ` -; + {Boolean(item.1) && <> {item.1} + })} ` +; diff --git a/src/default/partials/type-inline-partials/tuple.tsx b/src/default/partials/type-inline-partials/tuple.tsx index 4bd8cd8c..635e18d4 100644 --- a/src/default/partials/type-inline-partials/tuple.tsx +++ b/src/default/partials/type-inline-partials/tuple.tsx @@ -1,7 +1,7 @@ import React from 'react'; -export const component = props => +export const component = props => <> [ - {props.elements.map((item, i) => {!Boolean(item.first) && , - } {item.__partials__.type} - )} ] -; + {props.elements.map((item, i) => <>{!Boolean(item.first) && <> , + } {item.__partials__.type} + )} ] +; diff --git a/src/default/partials/type-inline-partials/typeOperator.tsx b/src/default/partials/type-inline-partials/typeOperator.tsx index 74ecdc49..13918ef1 100644 --- a/src/default/partials/type-inline-partials/typeOperator.tsx +++ b/src/default/partials/type-inline-partials/typeOperator.tsx @@ -1,7 +1,7 @@ import React from 'react'; -export const component = props => +export const component = props => <> {props.operator} {props.__partials__.type} -; +; diff --git a/src/default/partials/type-inline-partials/typeParameter.tsx b/src/default/partials/type-inline-partials/typeParameter.tsx index 60d943dd..547b93cd 100644 --- a/src/default/partials/type-inline-partials/typeParameter.tsx +++ b/src/default/partials/type-inline-partials/typeParameter.tsx @@ -1,4 +1,4 @@ import React from 'react'; -export const component = props => +export const component = props => <> {props.name} -; +; diff --git a/src/default/partials/type-inline-partials/union.tsx b/src/default/partials/type-inline-partials/union.tsx index 3bc3e2e3..ae67ead8 100644 --- a/src/default/partials/type-inline-partials/union.tsx +++ b/src/default/partials/type-inline-partials/union.tsx @@ -1,7 +1,7 @@ import React from 'react'; -export const component = props => - {Boolean(props.needsParens) && ( - }{props.types.map((item, i) => {!Boolean(item.first) && | - } {item.__partials__.type} - )}{Boolean(props.needsParens) && ) - }; +export const component = props => <> + {Boolean(props.needsParens) && <> ( + }{props.types.map((item, i) => <>{!Boolean(item.first) && <> | + } {item.__partials__.type} + )}{Boolean(props.needsParens) && <> ) + }; diff --git a/src/default/partials/type-inline-partials/unknown.tsx b/src/default/partials/type-inline-partials/unknown.tsx index eb268e48..42c546a0 100644 --- a/src/default/partials/type-inline-partials/unknown.tsx +++ b/src/default/partials/type-inline-partials/unknown.tsx @@ -1,2 +1,2 @@ import React from 'react'; -export const component = props => ; +export const component = props => <>; diff --git a/src/default/partials/type.tsx b/src/default/partials/type.tsx index f52e12ab..dd24863f 100644 --- a/src/default/partials/type.tsx +++ b/src/default/partials/type.tsx @@ -1,5 +1,5 @@ import React from 'react'; -export const component = props => { +export const component = props => <>{ /* Each type gets its own inline helper to determine how it is rendered. */ }{ /* The name of the helper is the value of the 'type' property on the type.*/ @@ -12,6 +12,6 @@ export const component = props => { () => 1 | 2 !== (() => 1) | 2 */ } - {Boolean(props) ? {props.__partials__.lookup.dot.typeString} - : void - }; + {Boolean(props) ? <> {props.__partials__.lookup.dot.typeString} + : <> void + }; diff --git a/src/default/partials/typeAndParent.tsx b/src/default/partials/typeAndParent.tsx index fb4cf2d3..4370dc28 100644 --- a/src/default/partials/typeAndParent.tsx +++ b/src/default/partials/typeAndParent.tsx @@ -1,23 +1,23 @@ import React from 'react'; -export const component = props => - {Boolean(props) ? Boolean(props.elementType) ? +export const component = props => <> + {Boolean(props) ? Boolean(props.elementType) ? <> {props.__partials__.typeAndParent} [] - : Boolean(props.reflection) ? - {Boolean(props.reflection.parent.parent.url) ? {props.reflection.parent.parent.name} - : {props.reflection.parent.parent.name} - } . - {Boolean(props.reflection.parent.url) ? {props.reflection.parent.name} - : {props.reflection.parent.name} - } + : Boolean(props.reflection) ? <> + {Boolean(props.reflection.parent.parent.url) ? <> {props.reflection.parent.parent.name} + : <> {props.reflection.parent.parent.name} + } . + {Boolean(props.reflection.parent.url) ? <> {props.reflection.parent.name} + : <> {props.reflection.parent.name} + } - {Boolean(props.reflection.parent.url) ? {props.reflection.parent.name} - : {props.reflection.parent.name} - } . - {Boolean(props.reflection.url) ? {props.reflection.name} - : {props.reflection.name} - } - : {props} - : " void\n"} -; + {Boolean(props.reflection.parent.url) ? <> {props.reflection.parent.name} + : <> {props.reflection.parent.name} + } . + {Boolean(props.reflection.url) ? <> {props.reflection.name} + : <> {props.reflection.name} + } + : <> {props} + : " void\n"} +; diff --git a/src/default/partials/typeParameters.tsx b/src/default/partials/typeParameters.tsx index 71e86e51..1dde5b5e 100644 --- a/src/default/partials/typeParameters.tsx +++ b/src/default/partials/typeParameters.tsx @@ -1,13 +1,13 @@ import React from 'react'; -export const component = props =>
            - {props.typeParameters.map((item, i) =>
          • +export const component = props => <>
              + {props.typeParameters.map((item, i) => <>
            • {item.name} - {Boolean(item.type) && + {Boolean(item.type) && <> {item.__partials__.type} - }{Boolean(item.default) &&  = {item.__partials__.type} - }

              + }{Boolean(item.default) && <>  = {item.__partials__.type} + }
      {item.__partials__.comment}
    • -
      )}
    -
    ; + )} +; diff --git a/src/default/templates/index.tsx b/src/default/templates/index.tsx index 623a71f6..87894197 100644 --- a/src/default/templates/index.tsx +++ b/src/default/templates/index.tsx @@ -1,5 +1,5 @@ import React from 'react'; -export const component = props =>
    +export const component = props => <>
    {props.model.readme}
    -; +; diff --git a/src/default/templates/reflection.tsx b/src/default/templates/reflection.tsx index 1b83b30b..e820f9d4 100644 --- a/src/default/templates/reflection.tsx +++ b/src/default/templates/reflection.tsx @@ -1,45 +1,45 @@ import React from 'react'; -export const component = props => - {Boolean(props.hasComment) &&
    +export const component = props => <> + {Boolean(props.hasComment) && <>
    {props.__partials__.comment}
    - }
    + } - {Boolean(props.model.typeParameters) &&
    + {Boolean(props.model.typeParameters) && <>

    Type parameters

    {props.__partials__.typeParameters}
    - } - {Boolean(props.model.typeHierarchy) &&
    + } + {Boolean(props.model.typeHierarchy) && <>

    Hierarchy

    {props.__partials__.hierarchy}
    - } - {Boolean(props.model.implementedTypes) &&
    + } + {Boolean(props.model.implementedTypes) && <>

    Implements

      - {props.model.implementedTypes.map((item, i) =>
    • {item.__partials__.type}
    • -
      )}
    + {props.model.implementedTypes.map((item, i) => <>
  • {item.__partials__.type}
  • + )}
    - } - {Boolean(props.model.implementedBy) &&
    + } + {Boolean(props.model.implementedBy) && <>

    Implemented by

      - {props.model.implementedBy.map((item, i) =>
    • {item.__partials__.type}
    • -
      )}
    + {props.model.implementedBy.map((item, i) => <>
  • {item.__partials__.type}
  • + )}
    - } - {Boolean(props.model.signatures) &&
    + } + {Boolean(props.model.signatures) && <>

    Callable

    {props.__partials__.member.signatures}
    - } - {Boolean(props.model.indexSignature) &&
    + } + {Boolean(props.model.indexSignature) && <>

    Indexable

    [ - {props.model.indexSignature.parameters.map((item, i) => {item.name}: {item.__partials__.type} - )} ]:  + {props.model.indexSignature.parameters.map((item, i) => <> {item.name}: {item.__partials__.type} + )} ]:  {props.__partials__.type}
    @@ -47,13 +47,13 @@ export const component = props => - {Boolean(props.model.indexSignature.type.declaration) && + {Boolean(props.model.indexSignature.type.declaration) && <> {props.__partials__.parameter} - }
    - } + }
    + } {props.__partials__.index} {props.__partials__.members} -
    ; +; diff --git a/src/minimal/layouts/default.tsx b/src/minimal/layouts/default.tsx index a4ee9a82..fb1210be 100644 --- a/src/minimal/layouts/default.tsx +++ b/src/minimal/layouts/default.tsx @@ -1,5 +1,5 @@ import React from 'react'; -export const component = props => +export const component = props => <> @@ -15,16 +15,16 @@ export const component = props =>
    - {Boolean(props.model.readme) &&
    + {Boolean(props.model.readme) && <>
    {props.model.readme}
    - } + } {props.contents} {props.__partials__.footer}
    @@ -38,4 +38,4 @@ export const component = props => -; +; diff --git a/src/minimal/partials/header.tsx b/src/minimal/partials/header.tsx index c0f24524..d80a53c9 100644 --- a/src/minimal/partials/header.tsx +++ b/src/minimal/partials/header.tsx @@ -22,9 +22,9 @@ export const component = props =>
    - {!Boolean(props.settings.excludeExternals) && + {!Boolean(props.settings.excludeExternals) && <> - } + }
    diff --git a/src/minimal/partials/member.tsx b/src/minimal/partials/member.tsx index 3202387b..f552f5d0 100644 --- a/src/minimal/partials/member.tsx +++ b/src/minimal/partials/member.tsx @@ -1,19 +1,19 @@ import React from 'react'; -export const component = props =>
    +export const component = props => <>
    - {Boolean(props.name) &&

    {props.flags.map((item, i) => {item} )}{props.wbr}

    -
    } - {Boolean(props.signatures) ? {props.__partials__.member.signatures} - : Boolean(props.hasGetterOrSetter) ? + {Boolean(props.name) && <>

    {props.flags.map((item, i) => <>{item} )}{props.wbr}

    + } + {Boolean(props.signatures) ? <> {props.__partials__.member.signatures} + : Boolean(props.hasGetterOrSetter) ? <> {props.__partials__.member.getterSetter} -
    : Boolean(props.tryGetTargetReflectionDeep) ? + : Boolean(props.tryGetTargetReflectionDeep) ? <> {props.__partials__.member.reference} - : {props.__partials__.member.declaration} - } + : <> {props.__partials__.member.declaration} + } - {!Boolean(props.isContainer) && props.groups.map((item, i) => {item.children.map((item, i) => {!Boolean(item.hasOwnDocument) && {item.__partials__.member} - })})}
    + {!Boolean(props.isContainer) && props.groups.map((item, i) => <>{item.children.map((item, i) => <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member} + })})}
    - {Boolean(props.isContainer) && {props.__partials__.index} + {Boolean(props.isContainer) && <> {props.__partials__.index} {props.__partials__.members} - }
    ; + }; diff --git a/src/minimal/templates/index.tsx b/src/minimal/templates/index.tsx index 8f24469b..7d8bd09b 100644 --- a/src/minimal/templates/index.tsx +++ b/src/minimal/templates/index.tsx @@ -1,13 +1,13 @@ import React from 'react'; -export const component = props => +export const component = props => <> {props.__partials__.comment} - {Boolean(props.model.typeHierarchy) &&
    + {Boolean(props.model.typeHierarchy) && <>

    Hierarchy

    {props.__partials__.hierarchy}
    - } + }
    -; +; From be16010b29a6d4a3e2a16faa4e445254a165aabb Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Thu, 15 Jul 2021 18:27:21 -0400 Subject: [PATCH 08/19] inject imports --- src/default/layouts/default.tsx | 1 + src/default/partials/analytics.tsx | 1 + src/default/partials/breadcrumb.tsx | 1 + src/default/partials/comment.tsx | 1 + src/default/partials/footer.tsx | 1 + src/default/partials/header.tsx | 1 + src/default/partials/hierarchy.tsx | 1 + src/default/partials/index.tsx | 1 + src/default/partials/member.declaration.tsx | 1 + src/default/partials/member.getterSetter.tsx | 1 + src/default/partials/member.reference.tsx | 1 + src/default/partials/member.signature.body.tsx | 1 + src/default/partials/member.signature.title.tsx | 1 + src/default/partials/member.signatures.tsx | 1 + src/default/partials/member.sources.tsx | 1 + src/default/partials/member.tsx | 1 + src/default/partials/members.group.tsx | 1 + src/default/partials/members.tsx | 1 + src/default/partials/navigation.tsx | 1 + src/default/partials/parameter.tsx | 1 + src/default/partials/toc.root.tsx | 1 + src/default/partials/toc.tsx | 1 + .../partials/type-inline-partials/array.tsx | 1 + .../type-inline-partials/conditional.tsx | 1 + .../type-inline-partials/indexedAccess.tsx | 1 + .../partials/type-inline-partials/inferred.tsx | 1 + .../type-inline-partials/intersection.tsx | 1 + .../partials/type-inline-partials/intrinsic.tsx | 1 + .../partials/type-inline-partials/literal.tsx | 1 + .../partials/type-inline-partials/mapped.tsx | 1 + .../type-inline-partials/named-tuple-member.tsx | 1 + .../partials/type-inline-partials/optional.tsx | 1 + .../partials/type-inline-partials/predicate.tsx | 1 + .../partials/type-inline-partials/query.tsx | 1 + .../partials/type-inline-partials/reference.tsx | 1 + .../partials/type-inline-partials/reflection.tsx | 1 + .../partials/type-inline-partials/rest.tsx | 1 + .../type-inline-partials/template-literal.tsx | 1 + .../partials/type-inline-partials/tuple.tsx | 1 + .../type-inline-partials/typeOperator.tsx | 1 + .../type-inline-partials/typeParameter.tsx | 1 + .../partials/type-inline-partials/union.tsx | 1 + .../partials/type-inline-partials/unknown.tsx | 1 + src/default/partials/type.tsx | 1 + src/default/partials/typeAndParent.tsx | 1 + src/default/partials/typeParameters.tsx | 1 + src/default/templates/index.tsx | 1 + src/default/templates/reflection.tsx | 1 + src/lib.tsx | 16 ++++++++++++++++ src/minimal/layouts/default.tsx | 1 + src/minimal/partials/header.tsx | 1 + src/minimal/partials/member.tsx | 1 + src/minimal/templates/index.tsx | 1 + 53 files changed, 68 insertions(+) create mode 100644 src/lib.tsx diff --git a/src/default/layouts/default.tsx b/src/default/layouts/default.tsx index 7325f757..878026b6 100644 --- a/src/default/layouts/default.tsx +++ b/src/default/layouts/default.tsx @@ -1,3 +1,4 @@ +import {With, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; export const component = props => <> diff --git a/src/default/partials/analytics.tsx b/src/default/partials/analytics.tsx index b9e00098..9c0eb29b 100644 --- a/src/default/partials/analytics.tsx +++ b/src/default/partials/analytics.tsx @@ -1,3 +1,4 @@ +import {With, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; export const component = props => Boolean(props.settings.gaID) && <> + diff --git a/src/default/partials/breadcrumb.tsx b/src/default/partials/breadcrumb.tsx index a08ab230..1cbdcb67 100644 --- a/src/default/partials/breadcrumb.tsx +++ b/src/default/partials/breadcrumb.tsx @@ -1,6 +1,6 @@ import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; -export const component = (props, item = props) => Boolean(props.parent) ? <> { With(item || props, (item || props).parent, (superProps, props, item) => (<>{props.__partials__.breadcrumb})) } +export const component = (props, item = props) => Boolean(props.parent) ? <> { With(item, item.parent, (superProps, props, item) => (<>{props.__partials__.breadcrumb})) }
  • {Boolean(props.url) ? <> {props.name} : <> {props.name} diff --git a/src/default/partials/comment.tsx b/src/default/partials/comment.tsx index d737aee0..ebfd224f 100644 --- a/src/default/partials/comment.tsx +++ b/src/default/partials/comment.tsx @@ -1,6 +1,6 @@ import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; -export const component = (props, item = props) => <>{ With(item || props, (item || props).comment, (superProps, props, item) => (<> +export const component = (props, item = props) => <>{ With(item, item.comment, (superProps, props, item) => (<> {Boolean(props.hasVisibleComponent) && <>
    {Boolean(props.shortText) && <>
    {props.shortText} diff --git a/src/default/partials/header.tsx b/src/default/partials/header.tsx index 1079f35c..03799d31 100644 --- a/src/default/partials/header.tsx +++ b/src/default/partials/header.tsx @@ -31,10 +31,10 @@ export const component = (props, item = props) => <>
    - + - {!Boolean(props.settings.excludeExternals) && <> + {!Boolean(props.settings.excludeExternals) && <> }
  • @@ -50,7 +50,7 @@ export const component = (props, item = props) => <>
    /* Don't show breadcrumbs on main project page, it is the root page. !*/ }
      - { With(item || props, (item || props).model, (superProps, props, item) => (<>{props.__partials__.breadcrumb})) } + { With(item, item.model, (superProps, props, item) => (<>{props.__partials__.breadcrumb})) }
    }

    diff --git a/src/default/partials/hierarchy.tsx b/src/default/partials/hierarchy.tsx index 1e88282a..316b1ca6 100644 --- a/src/default/partials/hierarchy.tsx +++ b/src/default/partials/hierarchy.tsx @@ -5,7 +5,7 @@ export const component = (props, item = props) => <>
      {item} : <> {item.__partials__.type} } - {Boolean(item.last) && <> { With(item || props, (item || props).superProps.next, (superProps, props, item) => (<> + {Boolean(item.last) && <> { With(item, item.superProps.next, (superProps, props, item) => (<> {item.__partials__.hierarchy} )) } } diff --git a/src/default/partials/member.declaration.tsx b/src/default/partials/member.declaration.tsx index a2721660..8efc6f83 100644 --- a/src/default/partials/member.declaration.tsx +++ b/src/default/partials/member.declaration.tsx @@ -6,7 +6,7 @@ export const component = (props, item = props) => <>
      )} {'>'} - } {Boolean(props.isOptional) && "?"}: { With(item || props, (item || props).type, (superProps, props, item) => (<>{props.__partials__.type})) } + } {Boolean(props.isOptional) && "?"}: { With(item, item.type, (superProps, props, item) => (<>{props.__partials__.type})) } {Boolean(props.defaultValue) && <>  = {props.defaultValue} @@ -22,7 +22,7 @@ export const component = (props, item = props) => <>

      Type declaration

      - { With(item || props, (item || props).type.declaration, (superProps, props, item) => (<> + { With(item, item.type.declaration, (superProps, props, item) => (<> {props.__partials__.parameter} )) }
      diff --git a/src/default/partials/member.getterSetter.tsx b/src/default/partials/member.getterSetter.tsx index af97a86c..34f473d7 100644 --- a/src/default/partials/member.getterSetter.tsx +++ b/src/default/partials/member.getterSetter.tsx @@ -1,14 +1,14 @@ import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; export const component = (props, item = props) => <>
        - {Boolean(props.getSignature) && <> { With(item || props, (item || props).getSignature, (superProps, props, item) => (<> + {Boolean(props.getSignature) && <> { With(item, item.getSignature, (superProps, props, item) => (<>
      • get {props.superProps.name} {props.__partials__.member.signature.title}
      • )) } - }{Boolean(props.setSignature) && <> { With(item || props, (item || props).setSignature, (superProps, props, item) => (<> + }{Boolean(props.setSignature) && <> { With(item, item.setSignature, (superProps, props, item) => (<>
      • set {props.superProps.name} @@ -18,12 +18,12 @@ export const component = (props, item = props) => <>
          }
          - {Boolean(props.getSignature) && <> { With(item || props, (item || props).getSignature, (superProps, props, item) => (<> + {Boolean(props.getSignature) && <> { With(item, item.getSignature, (superProps, props, item) => (<>
        • {props.__partials__.member.signature.body}
        • )) } - }{Boolean(props.setSignature) && <> { With(item || props, (item || props).setSignature, (superProps, props, item) => (<> + }{Boolean(props.setSignature) && <> { With(item, item.setSignature, (superProps, props, item) => (<>
        • {props.__partials__.member.signature.body}
        • diff --git a/src/default/partials/member.reference.tsx b/src/default/partials/member.reference.tsx index d001e48c..e26008ba 100644 --- a/src/default/partials/member.reference.tsx +++ b/src/default/partials/member.reference.tsx @@ -1,6 +1,6 @@ import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; -export const component = (props, item = props) => Boolean(props.tryGetTargetReflectionDeep) ? <> { With(item || props, (item || props).tryGetTargetReflectionDeep, (superProps, props, item) => (<> +export const component = (props, item = props) => Boolean(props.tryGetTargetReflectionDeep) ? <> { With(item, item.tryGetTargetReflectionDeep, (superProps, props, item) => (<> Re-exports {props.name} diff --git a/src/default/partials/member.signature.body.tsx b/src/default/partials/member.signature.body.tsx index 57e6b383..aa062231 100644 --- a/src/default/partials/member.signature.body.tsx +++ b/src/default/partials/member.signature.body.tsx @@ -14,7 +14,7 @@ export const component = (props, item = props) => <>{!Boolean(props.hideSources) {item.flags.map((item, i) => <> {item} )} {Boolean(item.flags.isRest) && ...} {item.name}: - { With(item || props, (item || props).type, (superProps, props, item) => (<>{item.__partials__.type})) } + { With(item, item.type, (superProps, props, item) => (<>{item.__partials__.type})) } {Boolean(item.defaultValue) && <>  = {item.defaultValue} @@ -23,17 +23,17 @@ export const component = (props, item = props) => <>{!Boolean(props.hideSources) {item.__partials__.comment} - {Boolean(item.type.declaration) && <> { With(item || props, (item || props).type.declaration, (superProps, props, item) => (<> + {Boolean(item.type.declaration) && <> { With(item, item.type.declaration, (superProps, props, item) => (<> {item.__partials__.parameter} )) } } )}
        } - {Boolean(props.type) && <>

        Returns { With(item || props, (item || props).type, (superProps, props, item) => (<>{props.__partials__.type})) }

        + {Boolean(props.type) && <>

        Returns { With(item, item.type, (superProps, props, item) => (<>{props.__partials__.type})) }

        {Boolean(props.comment.returns) && <> {props.comment.returns} } - {Boolean(props.type.declaration) && <> { With(item || props, (item || props).type.declaration, (superProps, props, item) => (<> + {Boolean(props.type.declaration) && <> { With(item, item.type.declaration, (superProps, props, item) => (<> {props.__partials__.parameter} )) } }}; diff --git a/src/default/partials/member.signature.title.tsx b/src/default/partials/member.signature.title.tsx index 48c3fe4d..f8b7eb54 100644 --- a/src/default/partials/member.signature.title.tsx +++ b/src/default/partials/member.signature.title.tsx @@ -18,11 +18,11 @@ export const component = (props, item = props) => <>{!Boolean(props.hideName) ? {Boolean(item.defaultValue) && "?"} : - {With(item || props, (item || props).type, (superProps, props, item) => (<>{item.__partials__.type}))} + {With(item, item.type, (superProps, props, item) => (<>{item.__partials__.type}))} )}) {Boolean(props.type) && <>{Boolean(props.arrowStyle) ? <> ={'>'} : <> : - } {With(item || props, (item || props).type, (superProps, props, item) => (<> + } {With(item, item.type, (superProps, props, item) => (<> {props.__partials__.type} ))} }; diff --git a/src/default/partials/member.sources.tsx b/src/default/partials/member.sources.tsx index 27d24dd2..4f115fd3 100644 --- a/src/default/partials/member.sources.tsx +++ b/src/default/partials/member.sources.tsx @@ -1,9 +1,9 @@ import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; export const component = (props, item = props) => <>

    @@ -86,7 +86,7 @@ export const component = (props, item = props) => <>
      @@ -97,12 +97,12 @@ export const component = (props, item = props) => <>
        ( {item.parameters.map((item, i) => <> {item.name} : - {Boolean(item.type) ? <> { With(item || props, (item || props).type, (superProps, props, item) => (<> + {Boolean(item.type) ? <> { With(item, item.type, (superProps, props, item) => (<> {item.__partials__.type} )) } : <> any })} ):  - { With(item || props, (item || props).type, (superProps, props, item) => (<> + { With(item, item.type, (superProps, props, item) => (<> {item.__partials__.type} )) } diff --git a/src/default/partials/type-inline-partials/array.tsx b/src/default/partials/type-inline-partials/array.tsx index 0e339fc1..1ee939d7 100644 --- a/src/default/partials/type-inline-partials/array.tsx +++ b/src/default/partials/type-inline-partials/array.tsx @@ -1,7 +1,7 @@ import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; export const component = (props, item = props) => <> - { With(item || props, (item || props).elementType, (superProps, props, item) => (<> + { With(item, item.elementType, (superProps, props, item) => (<> {props.__partials__.type} [] )) } diff --git a/src/default/partials/type-inline-partials/conditional.tsx b/src/default/partials/type-inline-partials/conditional.tsx index b12ba5f2..7d628f98 100644 --- a/src/default/partials/type-inline-partials/conditional.tsx +++ b/src/default/partials/type-inline-partials/conditional.tsx @@ -2,19 +2,19 @@ import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; export const component = (props, item = props) => <> {Boolean(props.needsParens) && <> ( - } { With(item || props, (item || props).checkType, (superProps, props, item) => (<> + } { With(item, item.checkType, (superProps, props, item) => (<> {props.__partials__.type} )) } extends - { With(item || props, (item || props).extendsType, (superProps, props, item) => (<> + { With(item, item.extendsType, (superProps, props, item) => (<> {props.__partials__.type} )) } ? - { With(item || props, (item || props).trueType, (superProps, props, item) => (<> + { With(item, item.trueType, (superProps, props, item) => (<> {props.__partials__.type} )) } : - { With(item || props, (item || props).falseType, (superProps, props, item) => (<> + { With(item, item.falseType, (superProps, props, item) => (<> {props.__partials__.type} )) } {Boolean(props.needsParens) && <> ) diff --git a/src/default/partials/type-inline-partials/indexedAccess.tsx b/src/default/partials/type-inline-partials/indexedAccess.tsx index d024cb12..46be8fc6 100644 --- a/src/default/partials/type-inline-partials/indexedAccess.tsx +++ b/src/default/partials/type-inline-partials/indexedAccess.tsx @@ -1,11 +1,11 @@ import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; export const component = (props, item = props) => <> - { With(item || props, (item || props).objectType, (superProps, props, item) => (<> + { With(item, item.objectType, (superProps, props, item) => (<> {props.__partials__.type} )) } [ - { With(item || props, (item || props).indexType, (superProps, props, item) => (<> + { With(item, item.indexType, (superProps, props, item) => (<> {props.__partials__.type} )) } ] diff --git a/src/default/partials/type-inline-partials/mapped.tsx b/src/default/partials/type-inline-partials/mapped.tsx index 5a9c8bc0..b220dcf7 100644 --- a/src/default/partials/type-inline-partials/mapped.tsx +++ b/src/default/partials/type-inline-partials/mapped.tsx @@ -15,11 +15,11 @@ export const component = (props, item = props) => <> {props.parameter} in - { With(item || props, (item || props).parameterType, (superProps, props, item) => (<> + { With(item, item.parameterType, (superProps, props, item) => (<> {props.__partials__.type} )) } - { With(item || props, (item || props).nameType, (superProps, props, item) => (<> + { With(item, item.nameType, (superProps, props, item) => (<> as {props.__partials__.type} )) } @@ -37,7 +37,7 @@ export const component = (props, item = props) => <> - { With(item || props, (item || props).templateType, (superProps, props, item) => (<> + { With(item, item.templateType, (superProps, props, item) => (<> {props.__partials__.type} )) } diff --git a/src/default/partials/type-inline-partials/named-tuple-member.tsx b/src/default/partials/type-inline-partials/named-tuple-member.tsx index a25a5409..81f57e86 100644 --- a/src/default/partials/type-inline-partials/named-tuple-member.tsx +++ b/src/default/partials/type-inline-partials/named-tuple-member.tsx @@ -4,7 +4,7 @@ export const component = (props, item = props) => <> {props.name} {Boolean(props.isOptional) ? <> ?: : <> : - } { With(item || props, (item || props).element, (superProps, props, item) => (<> + } { With(item, item.element, (superProps, props, item) => (<> {props.__partials__.type} )) } ; diff --git a/src/default/partials/type-inline-partials/optional.tsx b/src/default/partials/type-inline-partials/optional.tsx index 830d18e3..7b060166 100644 --- a/src/default/partials/type-inline-partials/optional.tsx +++ b/src/default/partials/type-inline-partials/optional.tsx @@ -1,7 +1,7 @@ import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; export const component = (props, item = props) => <> - { With(item || props, (item || props).elementType, (superProps, props, item) => (<> + { With(item, item.elementType, (superProps, props, item) => (<> {props.__partials__.type} )) } ? diff --git a/src/default/partials/type-inline-partials/predicate.tsx b/src/default/partials/type-inline-partials/predicate.tsx index 80189235..fcc6a6ea 100644 --- a/src/default/partials/type-inline-partials/predicate.tsx +++ b/src/default/partials/type-inline-partials/predicate.tsx @@ -4,7 +4,7 @@ export const component = (props, item = props) => <> {Boolean(props.asserts) && <> asserts } {props.name} {Boolean(props.targetType) && <> is - { With(item || props, (item || props).targetType, (superProps, props, item) => (<> + { With(item, item.targetType, (superProps, props, item) => (<> {props.__partials__.type} )) } }; diff --git a/src/default/partials/type-inline-partials/query.tsx b/src/default/partials/type-inline-partials/query.tsx index 9004e6a6..8a7f319e 100644 --- a/src/default/partials/type-inline-partials/query.tsx +++ b/src/default/partials/type-inline-partials/query.tsx @@ -2,7 +2,7 @@ import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; export const component = (props, item = props) => <> typeof - { With(item || props, (item || props).queryType, (superProps, props, item) => (<> + { With(item, item.queryType, (superProps, props, item) => (<> {props.__partials__.type} )) } ; diff --git a/src/default/partials/type-inline-partials/reference.tsx b/src/default/partials/type-inline-partials/reference.tsx index aac8d1da..4da095b6 100644 --- a/src/default/partials/type-inline-partials/reference.tsx +++ b/src/default/partials/type-inline-partials/reference.tsx @@ -1,7 +1,7 @@ import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; export const component = (props, item = props) => <> - {Boolean(props.getReflection) ? <> { With(item || props, (item || props).getReflection, (superProps, props, item) => (<> + {Boolean(props.getReflection) ? <> { With(item, item.getReflection, (superProps, props, item) => (<> {props.name} diff --git a/src/default/partials/type-inline-partials/reflection.tsx b/src/default/partials/type-inline-partials/reflection.tsx index f2c892a5..3fe310f1 100644 --- a/src/default/partials/type-inline-partials/reflection.tsx +++ b/src/default/partials/type-inline-partials/reflection.tsx @@ -9,14 +9,14 @@ export const component = (props, item = props) => <> } {Boolean(item.getSignature) ? Boolean(item.setSignature) ? <> {item.name} : - {Boolean(item.getSignature.type) ? <> { With(item || props, (item || props).getSignature.type, (superProps, props, item) => (<> + {Boolean(item.getSignature.type) ? <> { With(item, item.getSignature.type, (superProps, props, item) => (<> {item.__partials__.type} )) } : <> any } : <> get {item.name} (): - {Boolean(item.getSignature.type) ? <> { With(item || props, (item || props).getSignature.type, (superProps, props, item) => (<> + {Boolean(item.getSignature.type) ? <> { With(item, item.getSignature.type, (superProps, props, item) => (<> {item.__partials__.type} )) } : <> any @@ -27,7 +27,7 @@ export const component = (props, item = props) => <> /* Rather hacky to use each here... but we know there is exactly one. */ }{item.setSignature.parameters.map((item, i) => <> {item.name} : - {Boolean(item.type) ? <> { With(item || props, (item || props).type, (superProps, props, item) => (<> + {Boolean(item.type) ? <> { With(item, item.type, (superProps, props, item) => (<> {item.__partials__.type} )) } : <> any @@ -35,7 +35,7 @@ export const component = (props, item = props) => <> : <> {item.name} {Boolean(item.flags.isOptional) ? <> ?: : <> : - }{Boolean(item.type) ? <> { With(item || props, (item || props).type, (superProps, props, item) => (<> + }{Boolean(item.type) ? <> { With(item, item.type, (superProps, props, item) => (<> {item.__partials__.type} )) } : <> any @@ -48,7 +48,7 @@ export const component = (props, item = props) => <> {!Boolean(item.last) && <> ; })} {"}"} : <>{Boolean(props.needsParens) && <> ( - } { With(item || props, (item || props).(lookup declaration.signatures '0'), (superProps, props, item) => (<> + } { With(item, item.declaration.signatures[0], (superProps, props, item) => (<> {props.__partials__.member.signature.title} )) } {Boolean(props.needsParens) && <> ) diff --git a/src/default/partials/type-inline-partials/rest.tsx b/src/default/partials/type-inline-partials/rest.tsx index 8e15ae84..e0b0922f 100644 --- a/src/default/partials/type-inline-partials/rest.tsx +++ b/src/default/partials/type-inline-partials/rest.tsx @@ -2,7 +2,7 @@ import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; export const component = (props, item = props) => <> ... - { With(item || props, (item || props).elementType, (superProps, props, item) => (<> + { With(item, item.elementType, (superProps, props, item) => (<> {props.__partials__.type} )) } ; diff --git a/src/default/partials/type-inline-partials/template-literal.tsx b/src/default/partials/type-inline-partials/template-literal.tsx index 464d538f..56497dcd 100644 --- a/src/default/partials/type-inline-partials/template-literal.tsx +++ b/src/default/partials/type-inline-partials/template-literal.tsx @@ -4,7 +4,7 @@ export const component = (props, item = props) => <> ` {Boolean(props.head) && <> {props.head} }{props.tail.map((item, i) => <> ${"{"} - { With(item || props, (item || props).this.[0], (superProps, props, item) => (<> + { With(item, item.this.[0], (superProps, props, item) => (<> {item.__partials__.type} )) } {"}"} diff --git a/src/default/partials/type-inline-partials/typeOperator.tsx b/src/default/partials/type-inline-partials/typeOperator.tsx index 592e5e8a..1a91152d 100644 --- a/src/default/partials/type-inline-partials/typeOperator.tsx +++ b/src/default/partials/type-inline-partials/typeOperator.tsx @@ -2,7 +2,7 @@ import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; export const component = (props, item = props) => <> {props.operator} - { With(item || props, (item || props).target, (superProps, props, item) => (<> + { With(item, item.target, (superProps, props, item) => (<> {props.__partials__.type} )) } ; diff --git a/src/default/partials/typeAndParent.tsx b/src/default/partials/typeAndParent.tsx index c133fb42..e7998efd 100644 --- a/src/default/partials/typeAndParent.tsx +++ b/src/default/partials/typeAndParent.tsx @@ -1,7 +1,7 @@ -import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; +import {With, Compact, IfCond, IfNotCond, Markdown, IfSignature, IfNotSignature} from '../../lib'; import React from 'react'; export const component = (props, item = props) => <> - {Boolean(props) ? Boolean(props.elementType) ? <> { With(item || props, (item || props).elementType, (superProps, props, item) => (<> + {Boolean(props) ? Boolean(props.elementType) ? <> { With(item, item.elementType, (superProps, props, item) => (<> {props.__partials__.typeAndParent} )) } [] diff --git a/src/default/partials/typeParameters.tsx b/src/default/partials/typeParameters.tsx index 8e7d5d49..1848dfe8 100644 --- a/src/default/partials/typeParameters.tsx +++ b/src/default/partials/typeParameters.tsx @@ -5,8 +5,8 @@ export const component = (props, item = props) => <>
          :  - { With(item || props, (item || props).type, (superProps, props, item) => (<>{item.__partials__.type})) } - }{Boolean(item.default) && <>  = { With(item || props, (item || props).default, (superProps, props, item) => (<>{item.__partials__.type})) } + { With(item, item.type, (superProps, props, item) => (<>{item.__partials__.type})) } + }{Boolean(item.default) && <>  = { With(item, item.default, (superProps, props, item) => (<>{item.__partials__.type})) } } {item.__partials__.comment} diff --git a/src/default/templates/reflection.tsx b/src/default/templates/reflection.tsx index 222451e6..e2fcb891 100644 --- a/src/default/templates/reflection.tsx +++ b/src/default/templates/reflection.tsx @@ -1,6 +1,6 @@ import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; -export const component = (props, item = props) => <>{ With(item || props, (item || props).model, (superProps, props, item) => (<> +export const component = (props, item = props) => <>{ With(item, item.model, (superProps, props, item) => (<> {Boolean(props.hasComment) && <>
          {props.__partials__.comment}
          @@ -8,12 +8,12 @@ export const component = (props, item = props) => <>{ With(item || props, (item {Boolean(props.model.typeParameters) && <>

          Type parameters

          - { With(item || props, (item || props).model, (superProps, props, item) => (<>{props.__partials__.typeParameters})) } + { With(item, item.model, (superProps, props, item) => (<>{props.__partials__.typeParameters})) }
          } {Boolean(props.model.typeHierarchy) && <>

          Hierarchy

          - { With(item || props, (item || props).model.typeHierarchy, (superProps, props, item) => (<>{props.__partials__.hierarchy})) } + { With(item, item.model.typeHierarchy, (superProps, props, item) => (<>{props.__partials__.hierarchy})) }
          } {Boolean(props.model.implementedTypes) && <>
          @@ -32,28 +32,28 @@ export const component = (props, item = props) => <>{ With(item || props, (item } {Boolean(props.model.signatures) && <>

          Callable

          - { With(item || props, (item || props).model, (superProps, props, item) => (<>{props.__partials__.member.signatures})) } + { With(item, item.model, (superProps, props, item) => (<>{props.__partials__.member.signatures})) }
          } {Boolean(props.model.indexSignature) && <>

          Indexable

          [ - {props.model.indexSignature.parameters.map((item, i) => <> {item.name}: { With(item || props, (item || props).type, (superProps, props, item) => (<>{item.__partials__.type})) } + {props.model.indexSignature.parameters.map((item, i) => <> {item.name}: { With(item, item.type, (superProps, props, item) => (<>{item.__partials__.type})) } )} ]:  - { With(item || props, (item || props).model.indexSignature.type, (superProps, props, item) => (<>{props.__partials__.type})) } + { With(item, item.model.indexSignature.type, (superProps, props, item) => (<>{props.__partials__.type})) }
          - { With(item || props, (item || props).model.indexSignature, (superProps, props, item) => (<> + { With(item, item.model.indexSignature, (superProps, props, item) => (<> {props.__partials__.comment} )) } - {Boolean(props.model.indexSignature.type.declaration) && <> { With(item || props, (item || props).model.indexSignature.type.declaration, (superProps, props, item) => (<> + {Boolean(props.model.indexSignature.type.declaration) && <> { With(item, item.model.indexSignature.type.declaration, (superProps, props, item) => (<> {props.__partials__.parameter} )) } }
          } - { With(item || props, (item || props).model, (superProps, props, item) => (<> + { With(item, item.model, (superProps, props, item) => (<> {props.__partials__.index} {props.__partials__.members} )) } diff --git a/src/lib.tsx b/src/lib.tsx index ab8d0247..e6952906 100644 --- a/src/lib.tsx +++ b/src/lib.tsx @@ -20,6 +20,7 @@ export class IfNotCond extends React.Component<{cond: string}> { } } +export {IfCond as IfSignature, IfNotCond as IfNotSignature}; declare global { namespace JSX { interface IntrinsicElements { diff --git a/src/minimal/partials/header.tsx b/src/minimal/partials/header.tsx index ca2e62c3..791fd464 100644 --- a/src/minimal/partials/header.tsx +++ b/src/minimal/partials/header.tsx @@ -20,10 +20,10 @@ export const component = (props, item = props) =>
    - + - {!Boolean(props.settings.excludeExternals) && <> + {!Boolean(props.settings.excludeExternals) && <> } diff --git a/src/minimal/templates/index.tsx b/src/minimal/templates/index.tsx index 6ed6826b..31020e0d 100644 --- a/src/minimal/templates/index.tsx +++ b/src/minimal/templates/index.tsx @@ -1,18 +1,18 @@ import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; -export const component = (props, item = props) => <>{ With(item || props, (item || props).model, (superProps, props, item) => (<> +export const component = (props, item = props) => <>{ With(item, item.model, (superProps, props, item) => (<> {props.__partials__.comment} )) } {Boolean(props.model.typeHierarchy) && <>

    Hierarchy

    - { With(item || props, (item || props).model.typeHierarchy, (superProps, props, item) => (<>{props.__partials__.hierarchy})) } + { With(item, item.model.typeHierarchy, (superProps, props, item) => (<>{props.__partials__.hierarchy})) }
    } - { With(item || props, (item || props).model, (superProps, props, item) => (<> + { With(item, item.model, (superProps, props, item) => (<>
    + }}>
    {props.__partials__.index} {props.__partials__.members} )) } From a43507007148b3fd6a80850c17abbca5eaa53909 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Fri, 16 Jul 2021 23:44:56 -0400 Subject: [PATCH 12/19] WIP --- .gitmodules | 3 ++ .prettierrc.json | 4 +- src/default/layouts/default.tsx | 2 +- src/default/partials/header.tsx | 2 +- src/default/partials/member.reference.tsx | 4 +- .../partials/member.signature.title.tsx | 2 +- .../partials/type-inline-partials/index.tsx | 45 +++++++++++++++++++ .../partials/type-inline-partials/mapped.tsx | 16 +++---- src/default/partials/typeAndParent.tsx | 10 ++--- src/lib.tsx | 12 +++-- typedoc | 1 + 11 files changed, 79 insertions(+), 22 deletions(-) create mode 100644 .gitmodules create mode 100644 src/default/partials/type-inline-partials/index.tsx create mode 160000 typedoc diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..fffa63a9 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "typedoc"] + path = typedoc + url = https://github.com/TypeStrong/typedoc diff --git a/.prettierrc.json b/.prettierrc.json index 0967ef42..9fcfde7a 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1 +1,3 @@ -{} +{ + "printWidth": 120 +} diff --git a/src/default/layouts/default.tsx b/src/default/layouts/default.tsx index b5eaab60..547a5a95 100644 --- a/src/default/layouts/default.tsx +++ b/src/default/layouts/default.tsx @@ -5,7 +5,7 @@ export const component = (props, item = props) => <> - <IfCond cond="model.name '==' project.name">{props.project.name}</IfCond><IfNotCond cond="model.name '==' project.name">{props.model.name} | {props.project.name}</IfNotCond> + <IfCond cond={props.model.name === props.project.name}>{props.project.name}</IfCond><IfNotCond cond={props.model.name === props.project.name}>{props.model.name} | {props.project.name}</IfNotCond> diff --git a/src/default/partials/header.tsx b/src/default/partials/header.tsx index 03799d31..486b327f 100644 --- a/src/default/partials/header.tsx +++ b/src/default/partials/header.tsx @@ -53,7 +53,7 @@ export const component = (props, item = props) => <>
    { With(item, item.model, (superProps, props, item) => (<>{props.__partials__.breadcrumb})) } }

    - + {props.model.kindString} {props.model.name} diff --git a/src/default/partials/member.reference.tsx b/src/default/partials/member.reference.tsx index e26008ba..cf82c057 100644 --- a/src/default/partials/member.reference.tsx +++ b/src/default/partials/member.reference.tsx @@ -1,10 +1,10 @@ import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; export const component = (props, item = props) => Boolean(props.tryGetTargetReflectionDeep) ? <> { With(item, item.tryGetTargetReflectionDeep, (superProps, props, item) => (<> - + Re-exports {props.name} - + {Boolean(props.flags.isExported) ? <> Renames and re-exports {props.name} : <> Renames and exports {props.name} } diff --git a/src/default/partials/member.signature.title.tsx b/src/default/partials/member.signature.title.tsx index f8b7eb54..4c0eb05c 100644 --- a/src/default/partials/member.signature.title.tsx +++ b/src/default/partials/member.signature.title.tsx @@ -1,7 +1,7 @@ import { With, IfCond, IfNotCond, Markdown } from '../../lib'; import React from 'react'; export const component = (props, item = props) => <>{!Boolean(props.hideName) ? <> {props.wbr} - : <> + : <> {Boolean(props.flags.isAbstract) && <> abstract } new diff --git a/src/default/partials/type-inline-partials/index.tsx b/src/default/partials/type-inline-partials/index.tsx new file mode 100644 index 00000000..d6caab82 --- /dev/null +++ b/src/default/partials/type-inline-partials/index.tsx @@ -0,0 +1,45 @@ +import { component as array } from "./array"; +import { component as conditional } from "./conditional"; +import { component as indexedAccess } from "./indexedAccess"; +import { component as inferred } from "./inferred"; +import { component as intersection } from "./intersection"; +import { component as intrinsic } from "./intrinsic"; +import { component as literal } from "./literal"; +import { component as mapped } from "./mapped"; +import { component as namedTupleMember } from "./named-tuple-member"; +import { component as optional } from "./optional"; +import { component as predicate } from "./predicate"; +import { component as query } from "./query"; +import { component as reference } from "./reference"; +import { component as reflection } from "./reflection"; +import { component as rest } from "./rest"; +import { component as templateLiteral } from "./template-literal"; +import { component as tuple } from "./tuple"; +import { component as typeOperator } from "./typeOperator"; +import { component as typeParameter } from "./typeParameter"; +import { component as union } from "./union"; +import { component as unknown } from "./unknown"; + +export const typePartials = { + array, + conditional, + indexedAccess, + inferred, + intersection, + intrinsic, + literal, + mapped, + 'named-tuple-member': namedTupleMember, + optional, + predicate, + query, + reference, + reflection, + rest, + 'template-literal': templateLiteral, + tuple, + typeOperator, + typeParameter, + union, + unknown, +}; diff --git a/src/default/partials/type-inline-partials/mapped.tsx b/src/default/partials/type-inline-partials/mapped.tsx index b220dcf7..4be2a0b6 100644 --- a/src/default/partials/type-inline-partials/mapped.tsx +++ b/src/default/partials/type-inline-partials/mapped.tsx @@ -1,12 +1,12 @@ -import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; +import {With, Compact, IfCond, IfNotCond, Markdown} from '../../../lib'; import React from 'react'; export const component = (props, item = props) => <> {"{"} - + readonly - - + + -readonly @@ -25,14 +25,14 @@ export const component = (props, item = props) => <> )) } ] - + ?: - - + + -?: - + : diff --git a/src/default/partials/typeAndParent.tsx b/src/default/partials/typeAndParent.tsx index e7998efd..f24c51d4 100644 --- a/src/default/partials/typeAndParent.tsx +++ b/src/default/partials/typeAndParent.tsx @@ -1,24 +1,24 @@ -import {With, Compact, IfCond, IfNotCond, Markdown, IfSignature, IfNotSignature} from '../../lib'; +import {With, Compact, IfCond, IfNotCond, Markdown, isSignature} from '../../lib'; import React from 'react'; export const component = (props, item = props) => <> {Boolean(props) ? Boolean(props.elementType) ? <> { With(item, item.elementType, (superProps, props, item) => (<> {props.__partials__.typeAndParent} )) } [] - : Boolean(props.reflection) ? <> + : Boolean(props.reflection) ? <> {Boolean(props.reflection.parent.parent.url) ? <> {props.reflection.parent.parent.name} : <> {props.reflection.parent.parent.name} } . {Boolean(props.reflection.parent.url) ? <> {props.reflection.parent.name} : <> {props.reflection.parent.name} - } - + } + {Boolean(props.reflection.parent.url) ? <> {props.reflection.parent.name} : <> {props.reflection.parent.name} } . {Boolean(props.reflection.url) ? <> {props.reflection.name} : <> {props.reflection.name} - } + } : <> {props} : " void\n"} ; diff --git a/src/lib.tsx b/src/lib.tsx index e6952906..13ac5398 100644 --- a/src/lib.tsx +++ b/src/lib.tsx @@ -1,4 +1,6 @@ import React from 'react'; +import {SignatureReflection, Reflection, ReflectionKind} from '../typedoc/src'; + export function With(superProps: A, props: B, cb: (superProps: A, props: B, item: B) => C): C { return cb(superProps, props, props); } @@ -7,20 +9,19 @@ export function With(superProps: A, props: B, cb: (superProps: A, props // if(props.cond) return props.children; // else return undefined; // } -export class IfCond extends React.Component<{cond: string}> { +export class IfCond extends React.Component<{cond: boolean}> { render() { if(this.props.cond) return this.props.children; else return undefined; } } -export class IfNotCond extends React.Component<{cond: string}> { +export class IfNotCond extends React.Component<{cond: boolean}> { render() { if(!this.props.cond) return this.props.children; else return undefined; } } -export {IfCond as IfSignature, IfNotCond as IfNotSignature}; declare global { namespace JSX { interface IntrinsicElements { @@ -32,6 +33,11 @@ declare global { export function Markdown(props: {children: T}) { return {props.children}; } + export function Compact(props: {children: T}) { return {props.children}; } + +export function isSignature(reflection: Reflection): reflection is SignatureReflection { + return !!(reflection.kind & ReflectionKind.SomeSignature); +} diff --git a/typedoc b/typedoc new file mode 160000 index 00000000..8f6992a5 --- /dev/null +++ b/typedoc @@ -0,0 +1 @@ +Subproject commit 8f6992a5e418654ae0353641e5024fa65385d6e5 From 8ce8ecfbc0c0f35cd3ede43de22f22ecc6fcf2cf Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Sat, 17 Jul 2021 00:14:34 -0400 Subject: [PATCH 13/19] more changes! --- src/default/layouts/default.tsx | 8 ++-- src/default/partials/analytics.tsx | 2 +- src/default/partials/breadcrumb.tsx | 4 +- src/default/partials/comment.tsx | 2 +- src/default/partials/footer.tsx | 2 +- src/default/partials/header.tsx | 4 +- src/default/partials/hierarchy.tsx | 2 +- src/default/partials/index.tsx | 2 +- src/default/partials/member.declaration.tsx | 12 +++--- src/default/partials/member.getterSetter.tsx | 10 ++--- src/default/partials/member.reference.tsx | 2 +- .../partials/member.signature.body.tsx | 12 +++--- .../partials/member.signature.title.tsx | 2 +- src/default/partials/member.signatures.tsx | 2 +- src/default/partials/member.sources.tsx | 8 ++-- src/default/partials/member.tsx | 10 ++--- src/default/partials/members.group.tsx | 2 +- src/default/partials/members.tsx | 2 +- src/default/partials/navigation.tsx | 2 +- src/default/partials/parameter.tsx | 12 +++--- src/default/partials/toc.root.tsx | 2 +- src/default/partials/toc.tsx | 2 +- .../partials/type-inline-partials/array.tsx | 4 +- .../type-inline-partials/conditional.tsx | 10 ++--- .../type-inline-partials/indexedAccess.tsx | 6 +-- .../type-inline-partials/inferred.tsx | 2 +- .../type-inline-partials/intersection.tsx | 4 +- .../type-inline-partials/intrinsic.tsx | 2 +- .../partials/type-inline-partials/literal.tsx | 2 +- .../partials/type-inline-partials/mapped.tsx | 8 ++-- .../named-tuple-member.tsx | 4 +- .../type-inline-partials/optional.tsx | 4 +- .../type-inline-partials/predicate.tsx | 4 +- .../partials/type-inline-partials/query.tsx | 4 +- .../type-inline-partials/reference.tsx | 2 +- .../type-inline-partials/reflection.tsx | 6 +-- .../partials/type-inline-partials/rest.tsx | 4 +- .../type-inline-partials/template-literal.tsx | 2 +- .../partials/type-inline-partials/tuple.tsx | 2 +- .../type-inline-partials/typeOperator.tsx | 4 +- .../type-inline-partials/typeParameter.tsx | 2 +- .../partials/type-inline-partials/union.tsx | 37 +++++++++++++++---- .../partials/type-inline-partials/unknown.tsx | 2 +- src/default/partials/type.tsx | 32 +++++++++------- src/default/partials/typeAndParent.tsx | 4 +- src/default/partials/typeParameters.tsx | 2 +- src/default/templates/index.tsx | 2 +- src/default/templates/reflection.tsx | 20 +++++----- src/lib.tsx | 4 ++ src/minimal/layouts/default.tsx | 8 ++-- src/minimal/partials/header.tsx | 2 +- src/minimal/partials/member.tsx | 14 +++---- src/minimal/templates/index.tsx | 10 ++--- 53 files changed, 174 insertions(+), 145 deletions(-) diff --git a/src/default/layouts/default.tsx b/src/default/layouts/default.tsx index 547a5a95..fbd41d98 100644 --- a/src/default/layouts/default.tsx +++ b/src/default/layouts/default.tsx @@ -1,4 +1,4 @@ -import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; +import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; export const component = (props, item = props) => <> @@ -14,7 +14,7 @@ export const component = (props, item = props) => <> - {props.__partials__.header} + {__partials__.header(props)}
    @@ -37,12 +37,12 @@ export const component = (props, item = props) => <>
    - {props.__partials__.footer} + {__partials__.footer(props)}
    - {props.__partials__.analytics} + {__partials__.analytics(props)} diff --git a/src/default/partials/analytics.tsx b/src/default/partials/analytics.tsx index 9c1b631f..39cb1e6e 100644 --- a/src/default/partials/analytics.tsx +++ b/src/default/partials/analytics.tsx @@ -1,4 +1,4 @@ -import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; +import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; export const component = (props, item = props) => Boolean(props.settings.gaID) && <> - {props.__partials__.analytics} + {__partials__.analytics(props)} diff --git a/src/minimal/partials/header.tsx b/src/minimal/partials/header.tsx index 791fd464..6b6a3e00 100644 --- a/src/minimal/partials/header.tsx +++ b/src/minimal/partials/header.tsx @@ -1,4 +1,4 @@ -import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; +import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; export const component = (props, item = props) =>
    diff --git a/src/minimal/partials/member.tsx b/src/minimal/partials/member.tsx index fd7f07be..cd6d5db9 100644 --- a/src/minimal/partials/member.tsx +++ b/src/minimal/partials/member.tsx @@ -1,20 +1,20 @@ -import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; +import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; export const component = (props, item = props) => <>
    {Boolean(props.name) && <>

    {props.flags.map((item, i) => <>{item} )}{props.wbr}

    } - {Boolean(props.signatures) ? <> {props.__partials__.member.signatures} + {Boolean(props.signatures) ? <> {__partials__['member.signatures'](props)} : Boolean(props.hasGetterOrSetter) ? <> - {props.__partials__.member.getterSetter} + {__partials__['member.getterSetter'](props)} : Boolean(props.tryGetTargetReflectionDeep) ? <> - {props.__partials__.member.reference} - : <> {props.__partials__.member.declaration} + {__partials__['member.reference'](props)} + : <> {__partials__['member.declaration'](props)} } {!Boolean(props.isContainer) && props.groups.map((item, i) => <>{item.children.map((item, i) => <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member} })})}
    - {Boolean(props.isContainer) && <> {props.__partials__.index} - {props.__partials__.members} + {Boolean(props.isContainer) && <> {__partials__.index(props)} + {__partials__.members(props)} }; diff --git a/src/minimal/templates/index.tsx b/src/minimal/templates/index.tsx index 31020e0d..7d877da3 100644 --- a/src/minimal/templates/index.tsx +++ b/src/minimal/templates/index.tsx @@ -1,19 +1,19 @@ -import {With, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; +import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; import React from 'react'; export const component = (props, item = props) => <>{ With(item, item.model, (superProps, props, item) => (<> - {props.__partials__.comment} + {__partials__.comment(props)} )) } {Boolean(props.model.typeHierarchy) && <>

    Hierarchy

    - { With(item, item.model.typeHierarchy, (superProps, props, item) => (<>{props.__partials__.hierarchy})) } + { With(item, item.model.typeHierarchy, (superProps, props, item) => (<>{__partials__.hierarchy(props)})) }
    } { With(item, item.model, (superProps, props, item) => (<>
    - {props.__partials__.index} - {props.__partials__.members} + {__partials__.index(props)} + {__partials__.members(props)} )) } ; From a355aeb0c508524a72fb1e63202fe67fe704b542 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Sat, 17 Jul 2021 00:49:43 -0400 Subject: [PATCH 14/19] WIP --- .vscode/settings.json | 10 + src/default/partials/analytics.tsx | 25 +- src/default/partials/breadcrumb.tsx | 44 ++- src/default/partials/comment.tsx | 62 +++- src/default/partials/footer.tsx | 58 +++- src/default/partials/header.tsx | 160 +++++---- src/default/partials/hierarchy.tsx | 47 ++- src/default/partials/index.tsx | 137 ++++++-- src/default/partials/member.declaration.tsx | 84 +++-- src/default/partials/member.getterSetter.tsx | 93 +++-- src/default/partials/member.reference.tsx | 43 ++- .../partials/member.signature.body.tsx | 130 +++++-- .../partials/member.signature.title.tsx | 99 ++++-- src/default/partials/member.signatures.tsx | 35 +- src/default/partials/member.sources.tsx | 82 ++++- src/default/partials/member.tsx | 54 ++- src/default/partials/members.group.tsx | 40 ++- src/default/partials/members.tsx | 30 +- src/default/partials/navigation.tsx | 49 ++- src/default/partials/parameter.tsx | 328 ++++++++++++------ src/default/partials/toc.root.tsx | 54 +-- src/default/partials/toc.tsx | 30 +- .../partials/type-inline-partials/array.tsx | 20 +- .../type-inline-partials/conditional.tsx | 54 +-- .../type-inline-partials/indexedAccess.tsx | 26 +- .../partials/type-inline-partials/mapped.tsx | 76 ++-- .../named-tuple-member.tsx | 31 +- .../type-inline-partials/optional.tsx | 18 +- .../type-inline-partials/predicate.tsx | 32 +- .../partials/type-inline-partials/query.tsx | 18 +- .../type-inline-partials/reference.tsx | 2 +- .../type-inline-partials/reflection.tsx | 230 +++++++++--- .../partials/type-inline-partials/rest.tsx | 18 +- .../type-inline-partials/template-literal.tsx | 2 +- .../type-inline-partials/typeOperator.tsx | 18 +- src/default/partials/type.tsx | 2 +- src/default/partials/typeAndParent.tsx | 89 +++-- src/default/partials/typeParameters.tsx | 53 ++- src/default/templates/reflection.tsx | 193 +++++++---- src/lib.tsx | 39 ++- src/minimal/partials/member.tsx | 64 +++- src/minimal/templates/index.tsx | 51 ++- src/partials.tsx | 51 +++ tsconfig.json | 8 +- 44 files changed, 1940 insertions(+), 849 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 src/partials.tsx diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..fd0ffd8b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "[typescriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, +} diff --git a/src/default/partials/analytics.tsx b/src/default/partials/analytics.tsx index 39cb1e6e..53de4804 100644 --- a/src/default/partials/analytics.tsx +++ b/src/default/partials/analytics.tsx @@ -1,12 +1,15 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => Boolean(props.settings.gaID) && <> -; + {"}"})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', ' + {props.settings.gaID}', '{props.settings.gaSite}'); ga('send', 'pageview'); + + + ); diff --git a/src/default/partials/breadcrumb.tsx b/src/default/partials/breadcrumb.tsx index 35dcb924..80aba5ab 100644 --- a/src/default/partials/breadcrumb.tsx +++ b/src/default/partials/breadcrumb.tsx @@ -1,11 +1,33 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => Boolean(props.parent) ? <> { With(item, item.parent, (superProps, props, item) => (<>{__partials__.breadcrumb(props)})) } -
  • - {Boolean(props.url) ? <> {props.name} - : <> {props.name} - }
  • - : Boolean(props.url) && <>
  • - {props.name} -
  • -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const breadcrumb = (props, item = props) => + Boolean(props.parent) ? ( + <> + {" "} + {With(item, item.parent, (superProps, props, item = props) => ( + <>{__partials__.breadcrumb(props)} + ))} +
  • + {Boolean(props.url) ? ( + <> + {" "} + {props.name} + + ) : ( + <> + {" "} + {props.name} + + )}{" "} +
  • + + ) : ( + Boolean(props.url) && ( + <> + {" "} +
  • + {props.name} +
  • + + ) + ); diff --git a/src/default/partials/comment.tsx b/src/default/partials/comment.tsx index 400c7b03..82ad3c4e 100644 --- a/src/default/partials/comment.tsx +++ b/src/default/partials/comment.tsx @@ -1,15 +1,47 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <>{ With(item, item.comment, (superProps, props, item) => (<> - {Boolean(props.hasVisibleComponent) && <>
    - {Boolean(props.shortText) && <>
    - {props.shortText} -
    - }{Boolean(props.text) && <> {props.text} - }{Boolean(props.tags) && <>
    - {props.tags.map((item, i) => <>
    {item.tagName}
    -
    {item.text}
    - )}
    - }
    - })) } -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const comment = (props, item = props) => ( + <> + {With(item, item.comment, (superProps, props, item = props) => ( + <> + {Boolean(props.hasVisibleComponent) && ( + <> + {" "} +
    + {Boolean(props.shortText) && ( + <> + {" "} +
    + {props.shortText} +
    + + )} + {Boolean(props.text) && ( + <> + {" "} + {props.text} + + )} + {Boolean(props.tags) && ( + <> + {" "} +
    + {props.tags.map((item, i) => ( + <> + {" "} +
    {item.tagName}
    +
    + {item.text} +
    + + ))}{" "} +
    + + )}{" "} +
    + + )} + + ))} + +); diff --git a/src/default/partials/footer.tsx b/src/default/partials/footer.tsx index e8419365..8a04559d 100644 --- a/src/default/partials/footer.tsx +++ b/src/default/partials/footer.tsx @@ -1,18 +1,42 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <> -
    -
    -

    Legend

    -
    - {props.legend.map((item, i) => <>
      - {item.props.map((item, i) => <>
    • {item.name}
    • - )}
    - )}
    -
    -
    +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const footer = (props, item = props) => ( + <> +
    +
    +

    Legend

    +
    + {props.legend.map((item, i) => ( + <> + {" "} +
      + {item.props.map((item, i) => ( + <> + {" "} +
    • + {item.name} +
    • + + ))}{" "} +
    + + ))}{" "} +
    +
    +
    - {!Boolean(props.settings.hideGenerator) && <>
    -

    Generated using TypeDoc

    -
    - }; + {!Boolean(props.settings.hideGenerator) && ( + <> + {" "} +
    +

    + Generated using{" "} + + TypeDoc + +

    +
    + + )} + +); diff --git a/src/default/partials/header.tsx b/src/default/partials/header.tsx index 94f39b32..87b860ba 100644 --- a/src/default/partials/header.tsx +++ b/src/default/partials/header.tsx @@ -1,68 +1,108 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <>
    -
    -
    -
    -
    + +); diff --git a/src/default/partials/hierarchy.tsx b/src/default/partials/hierarchy.tsx index c0e1f7a6..88770aec 100644 --- a/src/default/partials/hierarchy.tsx +++ b/src/default/partials/hierarchy.tsx @@ -1,13 +1,34 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <>
      - {props.types.map((item, i) => <>
    • - {Boolean(item.superProps.isTarget) ? <> {item} - : <> {item.__partials__.type} - } - {Boolean(item.last) && <> { With(item, item.superProps.next, (superProps, props, item) => (<> - {item.__partials__.hierarchy} - )) } - }
    • - )}
    -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const hierarchy = (props, item = props) => ( + <> +
      + {props.types.map((item, i) => ( + <> + {" "} +
    • + {Boolean(item.superProps.isTarget) ? ( + <> + {" "} + {item} + + ) : ( + <> + {" "} + {item.__partials__.type} + + )} + {Boolean(item.last) && ( + <> + {" "} + {With(item, item.superProps.next, (superProps, props, item = props) => ( + <>{item.__partials__.hierarchy} + ))} + + )}{" "} +
    • + + ))} +
    + +); diff --git a/src/default/partials/index.tsx b/src/default/partials/index.tsx index 05db8e4c..eaf129ed 100644 --- a/src/default/partials/index.tsx +++ b/src/default/partials/index.tsx @@ -1,33 +1,106 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => Boolean(props.categories) ? <>
    -

    Index

    -
    -
    - {props.categories.map((item, i) => <>
    -

    {item.title}

    - +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const index = (props, item = props) => + Boolean(props.categories) ? ( + <> + {" "} +
    +

    Index

    +
    +
    + {props.categories.map((item, i) => ( + <> + {" "} +
    +

    {item.title}

    + +
    + + ))}{" "} +
    +
    +
    + + ) : ( + Boolean(props.groups) && ( + <> + {" "} +
    +

    Index

    +
    +
    + {props.groups.map((item, i) => ( + <> + {" "} +
    + {Boolean(item.categories) ? ( + item.categories.map((item, i) => ( + <> + {" "} +

    + {Boolean(item.title) && <>{item.title} } + {item.superProps.title} +

    + + + )) + ) : ( + <> + {" "} +

    {item.title}

    + + + )}{" "} +
    + + ))}{" "} +
    - )}
    -
    -
    - : Boolean(props.groups) && <>
    -

    Index

    -
    -
    - {props.groups.map((item, i) => <>
    - {Boolean(item.categories) ? item.categories.map((item, i) => <>

    {Boolean(item.title) && <>{item.title} }{item.superProps.title}

    - - ) : <>

    {item.title}

    - - }
    - )}
    -
    -
    -; + + + ) + ); diff --git a/src/default/partials/member.declaration.tsx b/src/default/partials/member.declaration.tsx index 3af4190e..ce94b17a 100644 --- a/src/default/partials/member.declaration.tsx +++ b/src/default/partials/member.declaration.tsx @@ -1,29 +1,61 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <>
    - {props.wbr} - {Boolean(props.typeParameters) && <> {"<"} - {props.typeParameters.map((item, i) => <> {Boolean(item.index) && ",\xA0"} - {item.name} - )} {'>'} - } {Boolean(props.isOptional) && "?"}: { With(item, item.type, (superProps, props, item) => (<>{__partials__.type(props)})) } - {Boolean(props.defaultValue) && <> -  = - {props.defaultValue} - - }
    +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const memberDeclaration = (props, item = props) => ( + <> +
    + + {props.wbr} + {Boolean(props.typeParameters) && ( + <> + {" "} + {"<"} + {props.typeParameters.map((item, i) => ( + <> + {" "} + {Boolean(item.index) && ",\xA0"} + {item.name} + + ))}{" "} + {">"} + + )}{" "} + {Boolean(props.isOptional) && "?"}: + {With(item, item.type, (superProps, props, item = props) => ( + <>{__partials__.type(props)} + ))} + {Boolean(props.defaultValue) && ( + <> + {" "} + +  = + {props.defaultValue} + + + )} + +
    - {__partials__['member.sources'](props)} + {__partials__["memberSources"](props)} - {__partials__.comment(props)} + {__partials__.comment(props)} - {Boolean(props.typeParameters) && <>

    Type parameters

    - {__partials__.typeParameters(props)} - } - {Boolean(props.type.declaration) && <>
    -

    Type declaration

    - { With(item, item.type.declaration, (superProps, props, item) => (<> - {__partials__.parameter(props)} - )) } -
    - }; + {Boolean(props.typeParameters) && ( + <> + {" "} +

    Type parameters

    + {__partials__.typeParameters(props)} + + )} + {Boolean(props.type.declaration) && ( + <> + {" "} +
    +

    Type declaration

    + {With(item, item.type.declaration, (superProps, props, item = props) => ( + <>{__partials__.parameter(props)} + ))} +
    + + )} + +); diff --git a/src/default/partials/member.getterSetter.tsx b/src/default/partials/member.getterSetter.tsx index 68dd71a4..d4b7e38d 100644 --- a/src/default/partials/member.getterSetter.tsx +++ b/src/default/partials/member.getterSetter.tsx @@ -1,32 +1,63 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <>
      - {Boolean(props.getSignature) && <> { With(item, item.getSignature, (superProps, props, item) => (<> -
    • - get - {props.superProps.name} - {__partials__['member.signature.title'](props, {hideName: true})} -
    • - )) } - }{Boolean(props.setSignature) && <> { With(item, item.setSignature, (superProps, props, item) => (<> -
    • - set - {props.superProps.name} - {__partials__['member.signature.title'](props, {hideName: true})} -
    • - )) } - }
    +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const memberGetterSetter = (props, item = props) => ( + <> +
      + {Boolean(props.getSignature) && ( + <> + {" "} + {With(item, item.getSignature, (superProps, props, item = props) => ( + <> +
    • + + get + {props.superProps.name} + {__partials__["memberSignatureTitle"](props, { hideName: true })} + +
    • + + ))} + + )} + {Boolean(props.setSignature) && ( + <> + {" "} + {With(item, item.setSignature, (superProps, props, item = props) => ( + <> +
    • + + set + {props.superProps.name} + {__partials__["memberSignatureTitle"](props, { hideName: true })} + +
    • + + ))} + + )} +
    -
      - {Boolean(props.getSignature) && <> { With(item, item.getSignature, (superProps, props, item) => (<> -
    • - {__partials__['member.signature.body'](props)} -
    • - )) } - }{Boolean(props.setSignature) && <> { With(item, item.setSignature, (superProps, props, item) => (<> -
    • - {__partials__['member.signature.body'](props)} -
    • - )) } - }
    -; +
      + {Boolean(props.getSignature) && ( + <> + {" "} + {With(item, item.getSignature, (superProps, props, item = props) => ( + <> +
    • {__partials__["memberSignatureBody"](props)}
    • + + ))} + + )} + {Boolean(props.setSignature) && ( + <> + {" "} + {With(item, item.setSignature, (superProps, props, item = props) => ( + <> +
    • {__partials__["memberSignatureBody"](props)}
    • + + ))} + + )} +
    + +); diff --git a/src/default/partials/member.reference.tsx b/src/default/partials/member.reference.tsx index 08b3c268..f7728ce2 100644 --- a/src/default/partials/member.reference.tsx +++ b/src/default/partials/member.reference.tsx @@ -1,13 +1,30 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => Boolean(props.tryGetTargetReflectionDeep) ? <> { With(item, item.tryGetTargetReflectionDeep, (superProps, props, item) => (<> - - Re-exports {props.name} - - - {Boolean(props.flags.isExported) ? <> Renames and re-exports {props.name} - : <> Renames and exports {props.name} - } - )) } - : <> Re-exports {props.name} -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const memberReference = (props, item = props) => + Boolean(props.tryGetTargetReflectionDeep) ? ( + <> + {" "} + {With(item, item.tryGetTargetReflectionDeep, (superProps, props, item = props) => ( + <> + + Re-exports {props.name} + + + {Boolean(props.flags.isExported) ? ( + <> + {" "} + Renames and re-exports {props.name} + + ) : ( + <> + {" "} + Renames and exports {props.name} + + )}{" "} + + + ))} + + ) : ( + <> Re-exports {props.name} + ); diff --git a/src/default/partials/member.signature.body.tsx b/src/default/partials/member.signature.body.tsx index 478930b4..c088a15e 100644 --- a/src/default/partials/member.signature.body.tsx +++ b/src/default/partials/member.signature.body.tsx @@ -1,39 +1,93 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <>{!Boolean(props.hideSources) && <> {__partials__['member.sources'](props)} - } - {__partials__.comment(props)} +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const memberSignatureBody\ = (props, item = props) => ( + <> + {!Boolean(props.hideSources) && <> {__partials__["memberSources"](props)}} + {__partials__.comment(props)} - {Boolean(props.typeParameters) && <>

    Type parameters

    - {__partials__.typeParameters(props)} - } - {Boolean(props.parameters) && <>

    Parameters

    -
      - {props.parameters.map((item, i) => <>
    • -
      - {item.flags.map((item, i) => <> {item} - )} {Boolean(item.flags.isRest) && ...} - {item.name}: - { With(item, item.type, (superProps, props, item) => (<>{item.__partials__.type})) } - {Boolean(item.defaultValue) && <> -  = - {item.defaultValue} - - }
      - - {item.__partials__.comment} - - {Boolean(item.type.declaration) && <> { With(item, item.type.declaration, (superProps, props, item) => (<> - {item.__partials__.parameter} - )) } - }
    • - )}
    - } - {Boolean(props.type) && <>

    Returns { With(item, item.type, (superProps, props, item) => (<>{__partials__.type(props)})) }

    - - {Boolean(props.comment.returns) && <> {props.comment.returns} - } - {Boolean(props.type.declaration) && <> { With(item, item.type.declaration, (superProps, props, item) => (<> - {__partials__.parameter(props)} - )) } - }}; + {Boolean(props.typeParameters) && ( + <> + {" "} +

    Type parameters

    + {__partials__.typeParameters(props)} + + )} + {Boolean(props.parameters) && ( + <> + {" "} +

    Parameters

    +
      + {props.parameters.map((item, i) => ( + <> + {" "} +
    • +
      + + {item.flags.map((item, i) => ( + <> + {" "} + {item} + + ))}{" "} + {Boolean(item.flags.isRest) && ( + ... + )} + {item.name}: + {With(item, item.type, (superProps, props, item = props) => ( + <>{item.__partials__.type} + ))} + {Boolean(item.defaultValue) && ( + <> + {" "} + +  = + {item.defaultValue} + + + )}{" "} + +
      + {item.__partials__.comment} + {Boolean(item.type.declaration) && ( + <> + {" "} + {With(item, item.type.declaration, (superProps, props, item = props) => ( + <>{item.__partials__.parameter} + ))} + + )}{" "} +
    • + + ))}{" "} +
    + + )} + {Boolean(props.type) && ( + <> + {" "} +

    + Returns{" "} + + {With(item, item.type, (superProps, props, item = props) => ( + <>{__partials__.type(props)} + ))} + +

    + {Boolean(props.comment.returns) && ( + <> + {" "} + {props.comment.returns} + + )} + {Boolean(props.type.declaration) && ( + <> + {" "} + {With(item, item.type.declaration, (superProps, props, item = props) => ( + <>{__partials__.parameter(props)} + ))} + + )} + + )} + +); diff --git a/src/default/partials/member.signature.title.tsx b/src/default/partials/member.signature.title.tsx index f97b3d4d..d9d32b60 100644 --- a/src/default/partials/member.signature.title.tsx +++ b/src/default/partials/member.signature.title.tsx @@ -1,28 +1,71 @@ -import { With, IfCond, IfNotCond, Markdown } from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <>{!Boolean(props.hideName) ? <> {props.wbr} - : <> - {Boolean(props.flags.isAbstract) && <> abstract - } new - -}{Boolean(props.typeParameters) && <> {"<"} - {props.typeParameters.map((item, i) => <> {Boolean(item.index) && ",\xA0"} - {item.name} -)} {">"} -}( - {props.parameters.map((item, i) => <> {Boolean(item.index) && ",\xA0"} - {Boolean(item.flags.isRest) && ...} - {item.name} - - {Boolean(item.flags.isOptional) && "?"} - {Boolean(item.defaultValue) && "?"} - : - - {With(item, item.type, (superProps, props, item) => (<>{item.__partials__.type}))} - )}) - {Boolean(props.type) && <>{Boolean(props.arrowStyle) ? <> ={'>'} - : <> : - } {With(item, item.type, (superProps, props, item) => (<> - {__partials__.type(props)} - ))} - }; +import { With, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const memberSignatureTitle\ = (props, item = props) => ( + <> + {!Boolean(props.hideName) ? ( + <> {props.wbr} + ) : ( + <> + {" "} + + {Boolean(props.flags.isAbstract) && ( + <> + {" "} + abstract + + )}{" "} + new + + + )} + {Boolean(props.typeParameters) && ( + <> + {" "} + {"<"} + {props.typeParameters.map((item, i) => ( + <> + {" "} + {Boolean(item.index) && ",\xA0"} + {item.name} + + ))}{" "} + {">"} + + )} + ( + {props.parameters.map((item, i) => ( + <> + {" "} + {Boolean(item.index) && ",\xA0"} + {Boolean(item.flags.isRest) && ...} + {item.name} + + {Boolean(item.flags.isOptional) && "?"} + {Boolean(item.defaultValue) && "?"}: + + {With(item, item.type, (superProps, props, item = props) => ( + <>{item.__partials__.type} + ))} + + ))} + ) + {Boolean(props.type) && ( + <> + {Boolean(props.arrowStyle) ? ( + <> + {" "} + ={">"} + + ) : ( + <> + {" "} + : + + )}{" "} + {With(item, item.type, (superProps, props, item = props) => ( + <>{__partials__.type(props)} + ))} + + )} + +); diff --git a/src/default/partials/member.signatures.tsx b/src/default/partials/member.signatures.tsx index d0086411..734d873e 100644 --- a/src/default/partials/member.signatures.tsx +++ b/src/default/partials/member.signatures.tsx @@ -1,12 +1,25 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <>
      - {props.signatures.map((item, i) => <>
    • {item.__partials__.member.signature.title}
    • - )}
    +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const memberSignatures = (props, item = props) => ( + <> +
      + {props.signatures.map((item, i) => ( + <> + {" "} +
    • + {item.__partials__.member.signature.title} +
    • + + ))} +
    -
      - {props.signatures.map((item, i) => <>
    • - {item.__partials__.member.signature.body} -
    • - )}
    -; +
      + {props.signatures.map((item, i) => ( + <> + {" "} +
    • {item.__partials__.member.signature.body}
    • + + ))} +
    + +); diff --git a/src/default/partials/member.sources.tsx b/src/default/partials/member.sources.tsx index 094ad3fc..8734715e 100644 --- a/src/default/partials/member.sources.tsx +++ b/src/default/partials/member.sources.tsx @@ -1,12 +1,70 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <> -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const memberSources = (props, item = props) => ( + <> + + +); diff --git a/src/default/partials/member.tsx b/src/default/partials/member.tsx index e14c0267..ff4dee49 100644 --- a/src/default/partials/member.tsx +++ b/src/default/partials/member.tsx @@ -1,17 +1,39 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <>
    - - {Boolean(props.name) && <>

    {props.flags.map((item, i) => <>{item} )}{props.wbr}

    - } - {Boolean(props.signatures) ? <> {__partials__['member.signatures'](props)} - : Boolean(props.hasGetterOrSetter) ? <> - {__partials__['member.getterSetter'](props)} - : Boolean(props.isReference) ? <> - {__partials__['member.reference'](props)} - : <> {__partials__['member.declaration'](props)} - } +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const member = (props, item = props) => ( + <> +
    + + {Boolean(props.name) && ( + <> + {" "} +

    + {props.flags.map((item, i) => ( + <> + {item}{" "} + + ))} + {props.wbr} +

    + + )} + {Boolean(props.signatures) ? ( + <> {__partials__["memberSignatures"](props)} + ) : Boolean(props.hasGetterOrSetter) ? ( + <>{__partials__["memberGetterSetter"](props)} + ) : Boolean(props.isReference) ? ( + <>{__partials__["memberReference"](props)} + ) : ( + <> {__partials__["memberDeclaration"](props)} + )} - {props.groups.map((item, i) => <>{item.children.map((item, i) => <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member} - })})}
    -; + {props.groups.map((item, i) => ( + <> + {item.children.map((item, i) => ( + <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member}} + ))} + + ))} +
    + +); diff --git a/src/default/partials/members.group.tsx b/src/default/partials/members.group.tsx index 362ffc78..ff95a306 100644 --- a/src/default/partials/members.group.tsx +++ b/src/default/partials/members.group.tsx @@ -1,11 +1,29 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => Boolean(props.categories) ? props.categories.map((item, i) => <>
    -

    {Boolean(item.title) && <>{item.title} }{item.superProps.title}

    - {item.children.map((item, i) => <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member} - })}
    -) : <>
    -

    {props.title}

    - {props.children.map((item, i) => <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member} - })}
    -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const membersGroup = (props, item = props) => + Boolean(props.categories) ? ( + props.categories.map((item, i) => ( + <> + {" "} +
    +

    + {Boolean(item.title) && <>{item.title} } + {item.superProps.title} +

    + {item.children.map((item, i) => ( + <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member}} + ))}{" "} +
    + + )) + ) : ( + <> + {" "} +
    +

    {props.title}

    + {props.children.map((item, i) => ( + <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member}} + ))}{" "} +
    + + ); diff --git a/src/default/partials/members.tsx b/src/default/partials/members.tsx index f212e1ff..2ed2f7f9 100644 --- a/src/default/partials/members.tsx +++ b/src/default/partials/members.tsx @@ -1,8 +1,22 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => Boolean(props.categories) ? props.categories.map((item, i) => <>{!Boolean(item.allChildrenHaveOwnDocument) && <>
    -

    {item.title}

    - {item.children.map((item, i) => <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member} - })}
    - }) : props.groups.map((item, i) => <>{!Boolean(item.allChildrenHaveOwnDocument) && <> {item.__partials__.members.group} - }); +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const members = (props, item = props) => + Boolean(props.categories) + ? props.categories.map((item, i) => ( + <> + {!Boolean(item.allChildrenHaveOwnDocument) && ( + <> + {" "} +
    +

    {item.title}

    + {item.children.map((item, i) => ( + <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member}} + ))}{" "} +
    + + )} + + )) + : props.groups.map((item, i) => ( + <>{!Boolean(item.allChildrenHaveOwnDocument) && <> {item.__partials__.members.group}} + )); diff --git a/src/default/partials/navigation.tsx b/src/default/partials/navigation.tsx index f08a0360..6ac845be 100644 --- a/src/default/partials/navigation.tsx +++ b/src/default/partials/navigation.tsx @@ -1,15 +1,38 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => Boolean(props.isVisible) && (Boolean(props.isLabel) ? <>
  • - {props.wbr} -
  • - : Boolean(props.isGlobals) ? <>
  • - {props.wbr} +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const navigation = (props, item = props) => + Boolean(props.isVisible) && + (Boolean(props.isLabel) ? ( + <> + {" "} +
  • + {props.wbr}
  • - : <>
  • + + ) : Boolean(props.isGlobals) ? ( + <> + {" "} +
  • + + {props.wbr} + +
  • + + ) : ( + <> + {" "} +
  • {props.wbr} - {Boolean(props.isInPath) && Boolean(props.children) && <>
      - {props.children.map((item, i) => <> {item.__partials__.navigation} - )}
    - }
  • -); + {Boolean(props.isInPath) && Boolean(props.children) && ( + <> + {" "} +
      + {props.children.map((item, i) => ( + <> {item.__partials__.navigation} + ))}{" "} +
    + + )}{" "} +

  • + + )); diff --git a/src/default/partials/parameter.tsx b/src/default/partials/parameter.tsx index 02d0ab65..691b4135 100644 --- a/src/default/partials/parameter.tsx +++ b/src/default/partials/parameter.tsx @@ -1,115 +1,221 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <>
      - {Boolean(props.signatures) && <>
    • -
        - {props.signatures.map((item, i) => <>
      • - {__partials__['member.signature.title'](item, {hideName: true})} -
      • - )}
      +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const parameter = (props, item = props) => ( + <> +
        + {Boolean(props.signatures) && ( + <> + {" "} +
      • +
          + {props.signatures.map((item, i) => ( + <> + {" "} +
        • + + {__partials__["memberSignatureTitle"](item, { hideName: true })} + +
        • + + ))}{" "} +
        -
          - {props.signatures.map((item, i) => <>
        • {__partials__['member.signature.body'](item, {hideSources: true})}
        • - )}
        -
      • - }{Boolean(props.indexSignature) && <>
      • -
        - [ - {props.indexSignature.parameters.map((item, i) => <> {Boolean(item.flags.isRest) && ...}{item.name}: { With(item, item.type, (superProps, props, item) => (<>{item.__partials__.type})) } - )} ]:  - { With(item, item.indexSignature.type, (superProps, props, item) => (<>{__partials__.type(props)})) } -
        +
          + {props.signatures.map((item, i) => ( + <> + {" "} +
        • + {__partials__["memberSignatureBody"](item, { hideSources: true })} +
        • + + ))}{" "} +
        +
      • + + )} + {Boolean(props.indexSignature) && ( + <> + {" "} +
      • +
        + + [ + {props.indexSignature.parameters.map((item, i) => ( + <> + {" "} + {Boolean(item.flags.isRest) && ( + ... + )} + {item.name}: + {With(item, item.type, (superProps, props, item = props) => ( + <>{item.__partials__.type} + ))} + + ))}{" "} + ]:  + {With(item, item.indexSignature.type, (superProps, props, item = props) => ( + <>{__partials__.type(props)} + ))} + +
        + {With(item, item.indexSignature, (superProps, props, item = props) => ( + <>{__partials__.comment(props)} + ))} + {Boolean(props.indexSignature.type.declaration) && ( + <> + {" "} + {With(item, item.indexSignature.type.declaration, (superProps, props, item = props) => ( + <>{__partials__.parameter(props)} + ))} + + )}{" "} +
      • + + )} + {props.children.map((item, i) => ( + <> + {Boolean(item.signatures) ? ( + <> + {" "} +
      • +
        + + {Boolean(item.flags.isRest) && ( + ... + )} + {item.wbr} + {Boolean(item.isOptional) && "?"}: + function + +
        - { With(item, item.indexSignature, (superProps, props, item) => (<> - {__partials__.comment(props)} - )) } + {item.__partials__.member.signatures} +
      • + + ) : Boolean(item.type) ? ( + <> + {" "} + {/* standard type */} +
      • +
        + + {item.flags.map((item, i) => ( + <> + {" "} + {item} + + ))}{" "} + {Boolean(item.flags.isRest) && ( + ... + )} + {With(item, item.type, (superProps, props, item = props) => ( + <> + {item.wbr} + + {Boolean(item.superProps.flags.isOptional) && "?"}: + + {item.__partials__.type} + + ))} + +
        + {item.__partials__.comment} + {Boolean(item.children) && <> {item.__partials__.parameter}} + {Boolean(item.type.declaration) && ( + <> + {" "} + {With(item, item.type.declaration, (superProps, props, item = props) => ( + <>{item.__partials__.parameter} + ))} + + )}{" "} +
      • + + ) : ( + <> + {" "} + {/* getter/setter */} + {With(item, item.getSignature, (superProps, props, item = props) => ( + <> + {" "} + {/* getter */} +
      • +
        + + {item.flags.map((item, i) => ( + <> + {" "} + {item} + + ))}{" "} + get  + {item.wbr} + ():  + {With(item, item.type, (superProps, props, item = props) => ( + <>{item.__partials__.type} + ))} + +
        - {Boolean(props.indexSignature.type.declaration) && <> { With(item, item.indexSignature.type.declaration, (superProps, props, item) => (<> - {__partials__.parameter(props)} - )) } - }
      • - }{props.children.map((item, i) => <>{Boolean(item.signatures) ? <>
      • -
        - {Boolean(item.flags.isRest) && ...} - {item.wbr} - - {Boolean(item.isOptional) && "?"} - : - - function -
        + {item.__partials__.comment} +
      • + + ))} + {With(item, item.setSignature, (superProps, props, item = props) => ( + <> + {" "} + {/* setter */} +
      • +
        + + {item.flags.map((item, i) => ( + <> + {" "} + {item} + + ))}{" "} + set  + {item.wbr} + ( + {item.parameters.map((item, i) => ( + <> + {" "} + {item.name} + : + {Boolean(item.type) ? ( + <> + {" "} + {With( + item, + item.type, + (superProps, props, item = props) => ( + <>{item.__partials__.type} + ) + )} + + ) : ( + <> + {" "} + any + + )} + + ))}{" "} + ):  + {With(item, item.type, (superProps, props, item = props) => ( + <>{item.__partials__.type} + ))} + +
        - {item.__partials__.member.signatures} -
      • - : Boolean(item.type) ? <> { - /* standard type */ - } -
      • -
        - {item.flags.map((item, i) => <> {item} - )} {Boolean(item.flags.isRest) && ...} - { With(item, item.type, (superProps, props, item) => (<> - {item.wbr} - - {Boolean(item.superProps.flags.isOptional) && "?"} - : - - {item.__partials__.type} - )) } -
        - - {item.__partials__.comment} - - {Boolean(item.children) && <> {item.__partials__.parameter} - } - {Boolean(item.type.declaration) && <> { With(item, item.type.declaration, (superProps, props, item) => (<> - {item.__partials__.parameter} - )) } - }
      • - : <> { - /* getter/setter */ - } - { With(item, item.getSignature, (superProps, props, item) => (<> { - /* getter */ - } -
      • -
        - {item.flags.map((item, i) => <> {item} - )} get  - {item.wbr} - ():  - { With(item, item.type, (superProps, props, item) => (<> - {item.__partials__.type} - )) } -
        - - {item.__partials__.comment} -
      • - )) } - { With(item, item.setSignature, (superProps, props, item) => (<> { - /* setter */ - } -
      • -
        - {item.flags.map((item, i) => <> {item} - )} set  - {item.wbr} - ( - {item.parameters.map((item, i) => <> {item.name} - : - {Boolean(item.type) ? <> { With(item, item.type, (superProps, props, item) => (<> - {item.__partials__.type} - )) } - : <> any - })} ):  - { With(item, item.type, (superProps, props, item) => (<> - {item.__partials__.type} - )) } -
        - - {item.__partials__.comment} -
      • - )) } - } - )}
      -; + {item.__partials__.comment} +
    • + + ))} + + )} + + ))} +
    + +); diff --git a/src/default/partials/toc.root.tsx b/src/default/partials/toc.root.tsx index d2fe7f60..0e2f62fb 100644 --- a/src/default/partials/toc.root.tsx +++ b/src/default/partials/toc.root.tsx @@ -1,25 +1,29 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <>{ - /* {{#if isInPath*/ - }{ - /* */ - }{ - /*
      */ - }{ - /* {{/if*/ - }
    • - {props.wbr} - {Boolean(props.children) && <>
        - {props.children.map((item, i) => <> {item.__partials__.toc} - )}
      - }
    • - { - /* {{#if isInPath*/ - }{ - /*
    */ - }{ - /*
      */ - }{ - /* {{/if*/ - }; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const tocRoot = (props, item = props) => ( + <> + {/* {{#if isInPath*/} + {/*
    */} + {/*
      */} + {/* {{/if*/} +
    • + + {props.wbr} + + {Boolean(props.children) && ( + <> + {" "} +
        + {props.children.map((item, i) => ( + <> {item.__partials__.toc} + ))}{" "} +
      + + )} +
    • + {/* {{#if isInPath*/} + {/*
    */} + {/*
      */} + {/* {{/if*/} + +); diff --git a/src/default/partials/toc.tsx b/src/default/partials/toc.tsx index 353a055a..9b988ed8 100644 --- a/src/default/partials/toc.tsx +++ b/src/default/partials/toc.tsx @@ -1,9 +1,21 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <>
    • - {props.wbr} - {Boolean(props.children) && <>
        - {props.children.map((item, i) => <> {item.__partials__.toc} - )}
      - }
    • -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const toc = (props, item = props) => ( + <> +
    • + + {props.wbr} + + {Boolean(props.children) && ( + <> + {" "} +
        + {props.children.map((item, i) => ( + <> {item.__partials__.toc} + ))}{" "} +
      + + )} +
    • + +); diff --git a/src/default/partials/type-inline-partials/array.tsx b/src/default/partials/type-inline-partials/array.tsx index 42be7f79..b8dae593 100644 --- a/src/default/partials/type-inline-partials/array.tsx +++ b/src/default/partials/type-inline-partials/array.tsx @@ -1,8 +1,12 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../../lib'; -import React from 'react'; -export const component = (props, item = props) => <> - { With(item, item.elementType, (superProps, props, item) => (<> - {__partials__.type(props, {needsParens: true})} - [] - )) } -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../../lib"; +import React from "react"; +export const component = (props, item = props) => ( + <> + {With(item, item.elementType, (superProps, props, item = props) => ( + <> + {__partials__.type(props, { needsParens: true })} + [] + + ))} + +); diff --git a/src/default/partials/type-inline-partials/conditional.tsx b/src/default/partials/type-inline-partials/conditional.tsx index 61736255..bacfc09b 100644 --- a/src/default/partials/type-inline-partials/conditional.tsx +++ b/src/default/partials/type-inline-partials/conditional.tsx @@ -1,21 +1,33 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../../lib'; -import React from 'react'; -export const component = (props, item = props) => <> - {Boolean(props.needsParens) && <> ( - } { With(item, item.checkType, (superProps, props, item) => (<> - {__partials__.type(props, {needsParens: true})} - )) } - extends - { With(item, item.extendsType, (superProps, props, item) => (<> - {__partials__.type(props)} - )) } - ? - { With(item, item.trueType, (superProps, props, item) => (<> - {__partials__.type(props)} - )) } - : - { With(item, item.falseType, (superProps, props, item) => (<> - {__partials__.type(props)} - )) } - {Boolean(props.needsParens) && <> ) - }; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../../lib"; +import React from "react"; +export const component = (props, item = props) => ( + <> + {Boolean(props.needsParens) && ( + <> + {" "} + ( + + )}{" "} + {With(item, item.checkType, (superProps, props, item = props) => ( + <>{__partials__.type(props, { needsParens: true })} + ))} + extends + {With(item, item.extendsType, (superProps, props, item = props) => ( + <>{__partials__.type(props)} + ))} + ? + {With(item, item.trueType, (superProps, props, item = props) => ( + <>{__partials__.type(props)} + ))} + : + {With(item, item.falseType, (superProps, props, item = props) => ( + <>{__partials__.type(props)} + ))} + {Boolean(props.needsParens) && ( + <> + {" "} + ) + + )} + +); diff --git a/src/default/partials/type-inline-partials/indexedAccess.tsx b/src/default/partials/type-inline-partials/indexedAccess.tsx index ddbc2d75..5260fa1d 100644 --- a/src/default/partials/type-inline-partials/indexedAccess.tsx +++ b/src/default/partials/type-inline-partials/indexedAccess.tsx @@ -1,12 +1,14 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../../lib'; -import React from 'react'; -export const component = (props, item = props) => <> - { With(item, item.objectType, (superProps, props, item) => (<> - {__partials__.type(props)} - )) } - [ - { With(item, item.indexType, (superProps, props, item) => (<> - {__partials__.type(props)} - )) } - ] -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../../lib"; +import React from "react"; +export const component = (props, item = props) => ( + <> + {With(item, item.objectType, (superProps, props, item = props) => ( + <>{__partials__.type(props)} + ))} + [ + {With(item, item.indexType, (superProps, props, item = props) => ( + <>{__partials__.type(props)} + ))} + ] + +); diff --git a/src/default/partials/type-inline-partials/mapped.tsx b/src/default/partials/type-inline-partials/mapped.tsx index 9488ea58..a1053d20 100644 --- a/src/default/partials/type-inline-partials/mapped.tsx +++ b/src/default/partials/type-inline-partials/mapped.tsx @@ -1,45 +1,49 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../../lib'; -import React from 'react'; -export const component = (props, item = props) => <> - {"{"} - - readonly - - - - -readonly +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../../lib"; +import React from "react"; +export const component = (props, item = props) => ( + <> + {"{"} + + readonly - + + + -readonly + + - [ - {props.parameter} - in + [ + {props.parameter} + in - { With(item, item.parameterType, (superProps, props, item) => (<> - {__partials__.type(props)} - )) } + {With(item, item.parameterType, (superProps, props, item = props) => ( + <>{__partials__.type(props)} + ))} - { With(item, item.nameType, (superProps, props, item) => (<> - as - {__partials__.type(props)} - )) } + {With(item, item.nameType, (superProps, props, item = props) => ( + <> + as + {__partials__.type(props)} + + ))} - ] - - ?: - - - - -?: + ] + + ?: - - : + + + -?: + + + : + - - { With(item, item.templateType, (superProps, props, item) => (<> - {__partials__.type(props)} - )) } + {With(item, item.templateType, (superProps, props, item = props) => ( + <>{__partials__.type(props)} + ))} - {"}"} -; + {"}"} + +); diff --git a/src/default/partials/type-inline-partials/named-tuple-member.tsx b/src/default/partials/type-inline-partials/named-tuple-member.tsx index 0f095465..0c4e4d87 100644 --- a/src/default/partials/type-inline-partials/named-tuple-member.tsx +++ b/src/default/partials/type-inline-partials/named-tuple-member.tsx @@ -1,10 +1,21 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../../lib'; -import React from 'react'; -export const component = (props, item = props) => <> - {props.name} - {Boolean(props.isOptional) ? <> ?: - : <> : - } { With(item, item.element, (superProps, props, item) => (<> - {__partials__.type(props)} - )) } -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../../lib"; +import React from "react"; +export const component = (props, item = props) => ( + <> + {props.name} + {Boolean(props.isOptional) ? ( + <> + {" "} + ?: + + ) : ( + <> + {" "} + : + + )}{" "} + {With(item, item.element, (superProps, props, item = props) => ( + <>{__partials__.type(props)} + ))} + +); diff --git a/src/default/partials/type-inline-partials/optional.tsx b/src/default/partials/type-inline-partials/optional.tsx index 14822999..a5261e5d 100644 --- a/src/default/partials/type-inline-partials/optional.tsx +++ b/src/default/partials/type-inline-partials/optional.tsx @@ -1,8 +1,10 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../../lib'; -import React from 'react'; -export const component = (props, item = props) => <> - { With(item, item.elementType, (superProps, props, item) => (<> - {__partials__.type(props)} - )) } - ? -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../../lib"; +import React from "react"; +export const component = (props, item = props) => ( + <> + {With(item, item.elementType, (superProps, props, item = props) => ( + <>{__partials__.type(props)} + ))} + ? + +); diff --git a/src/default/partials/type-inline-partials/predicate.tsx b/src/default/partials/type-inline-partials/predicate.tsx index 1ba3f043..1573ad36 100644 --- a/src/default/partials/type-inline-partials/predicate.tsx +++ b/src/default/partials/type-inline-partials/predicate.tsx @@ -1,10 +1,22 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../../lib'; -import React from 'react'; -export const component = (props, item = props) => <> - {Boolean(props.asserts) && <> asserts - } {props.name} - {Boolean(props.targetType) && <> is - { With(item, item.targetType, (superProps, props, item) => (<> - {__partials__.type(props)} - )) } - }; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../../lib"; +import React from "react"; +export const component = (props, item = props) => ( + <> + {Boolean(props.asserts) && ( + <> + {" "} + asserts + + )}{" "} + {props.name} + {Boolean(props.targetType) && ( + <> + {" "} + is + {With(item, item.targetType, (superProps, props, item = props) => ( + <>{__partials__.type(props)} + ))} + + )} + +); diff --git a/src/default/partials/type-inline-partials/query.tsx b/src/default/partials/type-inline-partials/query.tsx index c2d62a4f..29b13996 100644 --- a/src/default/partials/type-inline-partials/query.tsx +++ b/src/default/partials/type-inline-partials/query.tsx @@ -1,8 +1,10 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../../lib'; -import React from 'react'; -export const component = (props, item = props) => <> - typeof - { With(item, item.queryType, (superProps, props, item) => (<> - {__partials__.type(props)} - )) } -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../../lib"; +import React from "react"; +export const component = (props, item = props) => ( + <> + typeof + {With(item, item.queryType, (superProps, props, item = props) => ( + <>{__partials__.type(props)} + ))} + +); diff --git a/src/default/partials/type-inline-partials/reference.tsx b/src/default/partials/type-inline-partials/reference.tsx index 0e82a812..470e29f4 100644 --- a/src/default/partials/type-inline-partials/reference.tsx +++ b/src/default/partials/type-inline-partials/reference.tsx @@ -1,7 +1,7 @@ import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../../lib'; import React from 'react'; export const component = (props, item = props) => <> - {Boolean(props.getReflection) ? <> { With(item, item.getReflection, (superProps, props, item) => (<> + {Boolean(props.getReflection) ? <> { With(item, item.getReflection, (superProps, props, item = props) => (<> {props.name} diff --git a/src/default/partials/type-inline-partials/reflection.tsx b/src/default/partials/type-inline-partials/reflection.tsx index 049863ef..ea75b5a0 100644 --- a/src/default/partials/type-inline-partials/reflection.tsx +++ b/src/default/partials/type-inline-partials/reflection.tsx @@ -1,56 +1,174 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../../lib'; -import React from 'react'; -export const component = (props, item = props) => <> - {Boolean(props.declaration.children) ? <> { - /* object literal */ - } - {"{"} - {props.declaration.children.map((item, i) => <>{!Boolean(item.first) && <> ; - } - {Boolean(item.getSignature) ? Boolean(item.setSignature) ? <> {item.name} - : - {Boolean(item.getSignature.type) ? <> { With(item, item.getSignature.type, (superProps, props, item) => (<> - {item.__partials__.type} - )) } - : <> any - } : <> get - {item.name} - (): - {Boolean(item.getSignature.type) ? <> { With(item, item.getSignature.type, (superProps, props, item) => (<> - {item.__partials__.type} - )) } - : <> any - } : Boolean(item.setSignature) ? <> set - {item.name} - ( - { - /* Rather hacky to use each here... but we know there is exactly one. */ - }{item.setSignature.parameters.map((item, i) => <> {item.name} - : - {Boolean(item.type) ? <> { With(item, item.type, (superProps, props, item) => (<> - {item.__partials__.type} - )) } - : <> any - })} ) - : <> {item.name} - {Boolean(item.flags.isOptional) ? <> ?: - : <> : - }{Boolean(item.type) ? <> { With(item, item.type, (superProps, props, item) => (<> - {item.__partials__.type} - )) } - : <> any - }})} {"}"} - : Boolean(props.declaration.signatures) ? <> {Boolean("(lookup declaration.signatures 1)") ? <> { - /* more than one signature*/ - } - {"{"} - {props.declaration.signatures.map((item, i) => <> {__partials__['member.signature.title'](item, {hideName: true})} - {!Boolean(item.last) && <> ; - })} {"}"} - : <>{Boolean(props.needsParens) && <> ( - } { With(item, item.declaration.signatures[0], (superProps, props, item) => (<> - {__partials__['member.signature.title'](props, {hideName: true, arrowStyle: true})} - )) } - {Boolean(props.needsParens) && <> ) - }} : <> {"{"}{"}"} - }; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../../lib"; +import React from "react"; +export const component = (props, item = props) => ( + <> + {Boolean(props.declaration.children) ? ( + <> + {" "} + {/* object literal */} + {"{"} + {props.declaration.children.map((item, i) => ( + <> + {!Boolean(item.first) && ( + <> + {" "} + ; + + )} + {Boolean(item.getSignature) ? ( + Boolean(item.setSignature) ? ( + <> + {" "} + {item.name} + : + {Boolean(item.getSignature.type) ? ( + <> + {" "} + {With(item, item.getSignature.type, (superProps, props, item = props) => ( + <>{item.__partials__.type} + ))} + + ) : ( + <> + {" "} + any + + )} + + ) : ( + <> + {" "} + get + {item.name} + (): + {Boolean(item.getSignature.type) ? ( + <> + {" "} + {With(item, item.getSignature.type, (superProps, props, item = props) => ( + <>{item.__partials__.type} + ))} + + ) : ( + <> + {" "} + any + + )} + + ) + ) : Boolean(item.setSignature) ? ( + <> + {" "} + set + {item.name} + ( + {/* Rather hacky to use each here... but we know there is exactly one. */} + {item.setSignature.parameters.map((item, i) => ( + <> + {" "} + {item.name} + : + {Boolean(item.type) ? ( + <> + {" "} + {With(item, item.type, (superProps, props, item = props) => ( + <>{item.__partials__.type} + ))} + + ) : ( + <> + {" "} + any + + )} + + ))}{" "} + ) + + ) : ( + <> + {" "} + {item.name} + {Boolean(item.flags.isOptional) ? ( + <> + {" "} + ?: + + ) : ( + <> + {" "} + : + + )} + {Boolean(item.type) ? ( + <> + {" "} + {With(item, item.type, (superProps, props, item = props) => ( + <>{item.__partials__.type} + ))} + + ) : ( + <> + {" "} + any + + )} + + )} + + ))}{" "} + {"}"} + + ) : Boolean(props.declaration.signatures) ? ( + <> + {" "} + {Boolean("(lookup declaration.signatures 1)") ? ( + <> + {" "} + {/* more than one signature*/} + {"{"} + {props.declaration.signatures.map((item, i) => ( + <> + {" "} + {__partials__["memberSignatureTitle"](item, { hideName: true })} + {!Boolean(item.last) && ( + <> + {" "} + ; + + )} + + ))}{" "} + {"}"} + + ) : ( + <> + {Boolean(props.needsParens) && ( + <> + {" "} + ( + + )}{" "} + {With(item, item.declaration.signatures[0], (superProps, props, item = props) => ( + <>{__partials__["memberSignatureTitle"](props, { hideName: true, arrowStyle: true })} + ))} + {Boolean(props.needsParens) && ( + <> + {" "} + ) + + )} + + )} + + ) : ( + <> + {" "} + + {"{"} + {"}"} + + + )} + +); diff --git a/src/default/partials/type-inline-partials/rest.tsx b/src/default/partials/type-inline-partials/rest.tsx index 8328ccbe..57f620c6 100644 --- a/src/default/partials/type-inline-partials/rest.tsx +++ b/src/default/partials/type-inline-partials/rest.tsx @@ -1,8 +1,10 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../../lib'; -import React from 'react'; -export const component = (props, item = props) => <> - ... - { With(item, item.elementType, (superProps, props, item) => (<> - {__partials__.type(props)} - )) } -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../../lib"; +import React from "react"; +export const component = (props, item = props) => ( + <> + ... + {With(item, item.elementType, (superProps, props, item = props) => ( + <>{__partials__.type(props)} + ))} + +); diff --git a/src/default/partials/type-inline-partials/template-literal.tsx b/src/default/partials/type-inline-partials/template-literal.tsx index 8fe24470..68289e50 100644 --- a/src/default/partials/type-inline-partials/template-literal.tsx +++ b/src/default/partials/type-inline-partials/template-literal.tsx @@ -4,7 +4,7 @@ export const component = (props, item = props) => <> ` {Boolean(props.head) && <> {props.head} }{props.tail.map((item, i) => <> ${"{"} - { With(item, item.this.[0], (superProps, props, item) => (<> + { With(item, item.this.[0], (superProps, props, item = props) => (<> {item.__partials__.type} )) } {"}"} diff --git a/src/default/partials/type-inline-partials/typeOperator.tsx b/src/default/partials/type-inline-partials/typeOperator.tsx index 90684933..6142cd42 100644 --- a/src/default/partials/type-inline-partials/typeOperator.tsx +++ b/src/default/partials/type-inline-partials/typeOperator.tsx @@ -1,8 +1,10 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../../lib'; -import React from 'react'; -export const component = (props, item = props) => <> - {props.operator} - { With(item, item.target, (superProps, props, item) => (<> - {__partials__.type(props)} - )) } -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../../lib"; +import React from "react"; +export const component = (props, item = props) => ( + <> + {props.operator} + {With(item, item.target, (superProps, props, item = props) => ( + <>{__partials__.type(props)} + ))} + +); diff --git a/src/default/partials/type.tsx b/src/default/partials/type.tsx index 74c8c80e..7322b1d6 100644 --- a/src/default/partials/type.tsx +++ b/src/default/partials/type.tsx @@ -1,6 +1,6 @@ import { With, Compact, IfCond, IfNotCond, Markdown, __partials__ } from "../../lib"; import React from "react"; -export const component = (props, item = props) => ( +export const type = (props, item = props) => ( <> {/* Each type gets its own inline helper to determine how it is rendered. */} {/* The name of the helper is the value of the 'type' property on the type.*/} diff --git a/src/default/partials/typeAndParent.tsx b/src/default/partials/typeAndParent.tsx index a8309e74..9a35cce0 100644 --- a/src/default/partials/typeAndParent.tsx +++ b/src/default/partials/typeAndParent.tsx @@ -1,24 +1,65 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown, isSignature} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <> - {Boolean(props) ? Boolean(props.elementType) ? <> { With(item, item.elementType, (superProps, props, item) => (<> - {__partials__.typeAndParent(props)} - )) } - [] - : Boolean(props.reflection) ? <> - {Boolean(props.reflection.parent.parent.url) ? <> {props.reflection.parent.parent.name} - : <> {props.reflection.parent.parent.name} - } . - {Boolean(props.reflection.parent.url) ? <> {props.reflection.parent.name} - : <> {props.reflection.parent.name} - } - - {Boolean(props.reflection.parent.url) ? <> {props.reflection.parent.name} - : <> {props.reflection.parent.name} - } . - {Boolean(props.reflection.url) ? <> {props.reflection.name} - : <> {props.reflection.name} - } - : <> {props} - : " void\n"} -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown, isSignature } from "../../lib"; +import React from "react"; +export const typeAndParent = (props, item = props) => ( + <> + + {Boolean(props) ? ( + Boolean(props.elementType) ? ( + <> + {" "} + {With(item, item.elementType, (superProps, props, item = props) => ( + <>{__partials__.typeAndParent(props)} + ))} + [] + + ) : Boolean(props.reflection) ? ( + <> + {" "} + + {Boolean(props.reflection.parent.parent.url) ? ( + <> + {" "} + {props.reflection.parent.parent.name} + + ) : ( + <> {props.reflection.parent.parent.name} + )}{" "} + . + {Boolean(props.reflection.parent.url) ? ( + <> + {" "} + {props.reflection.parent.name} + + ) : ( + <> {props.reflection.parent.name} + )}{" "} + + + {Boolean(props.reflection.parent.url) ? ( + <> + {" "} + {props.reflection.parent.name} + + ) : ( + <> {props.reflection.parent.name} + )}{" "} + . + {Boolean(props.reflection.url) ? ( + <> + {" "} + {props.reflection.name} + + ) : ( + <> {props.reflection.name} + )}{" "} + + + ) : ( + <> {props} + ) + ) : ( + " void\n" + )} + + +); diff --git a/src/default/partials/typeParameters.tsx b/src/default/partials/typeParameters.tsx index 3c4f788a..c074aa8b 100644 --- a/src/default/partials/typeParameters.tsx +++ b/src/default/partials/typeParameters.tsx @@ -1,14 +1,39 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <>
        - {props.typeParameters.map((item, i) => <>
      • -

        - {item.name} - {Boolean(item.type) && <> - { With(item, item.type, (superProps, props, item) => (<>{item.__partials__.type})) } - }{Boolean(item.default) && <>  = { With(item, item.default, (superProps, props, item) => (<>{item.__partials__.type})) } - }

        - {item.__partials__.comment} -
      • - )}
      -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const typeParameters = (props, item = props) => ( + <> +
        + {props.typeParameters.map((item, i) => ( + <> + {" "} +
      • +

        + + {item.name} + {Boolean(item.type) && ( + <> + {" "} + + {With(item, item.type, (superProps, props, item = props) => ( + <>{item.__partials__.type} + ))} + + )} + {Boolean(item.default) && ( + <> + {" "} +  = + {With(item, item.default, (superProps, props, item = props) => ( + <>{item.__partials__.type} + ))} + + )}{" "} + +

        + {item.__partials__.comment} +
      • + + ))} +
      + +); diff --git a/src/default/templates/reflection.tsx b/src/default/templates/reflection.tsx index 7bc92b4f..aa4b1924 100644 --- a/src/default/templates/reflection.tsx +++ b/src/default/templates/reflection.tsx @@ -1,60 +1,135 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <>{ With(item, item.model, (superProps, props, item) => (<> - {Boolean(props.hasComment) && <>
      - {__partials__.comment(props)} -
      - })) } +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const component = (props, item = props) => ( + <> + {With(item, item.model, (superProps, props, item = props) => ( + <> + {Boolean(props.hasComment) && ( + <> + {" "} +
      {__partials__.comment(props)}
      + + )} + + ))} - {Boolean(props.model.typeParameters) && <>
      -

      Type parameters

      - { With(item, item.model, (superProps, props, item) => (<>{__partials__.typeParameters(props)})) } -
      - } - {Boolean(props.model.typeHierarchy) && <>
      -

      Hierarchy

      - { With(item, item.model.typeHierarchy, (superProps, props, item) => (<>{__partials__.hierarchy(props)})) } -
      - } - {Boolean(props.model.implementedTypes) && <>
      -

      Implements

      -
        - {props.model.implementedTypes.map((item, i) => <>
      • {item.__partials__.type}
      • - )}
      -
      - } - {Boolean(props.model.implementedBy) && <>
      -

      Implemented by

      -
        - {props.model.implementedBy.map((item, i) => <>
      • {item.__partials__.type}
      • - )}
      -
      - } - {Boolean(props.model.signatures) && <>
      -

      Callable

      - { With(item, item.model, (superProps, props, item) => (<>{__partials__['member.signatures'](props)})) } -
      - } - {Boolean(props.model.indexSignature) && <>
      -

      Indexable

      -
      - [ - {props.model.indexSignature.parameters.map((item, i) => <> {item.name}: { With(item, item.type, (superProps, props, item) => (<>{item.__partials__.type})) } - )} ]:  - { With(item, item.model.indexSignature.type, (superProps, props, item) => (<>{__partials__.type(props)})) } -
      - - { With(item, item.model.indexSignature, (superProps, props, item) => (<> - {__partials__.comment(props)} - )) } - - {Boolean(props.model.indexSignature.type.declaration) && <> { With(item, item.model.indexSignature.type.declaration, (superProps, props, item) => (<> - {__partials__.parameter(props)} - )) } - }
      - } - { With(item, item.model, (superProps, props, item) => (<> - {__partials__.index(props)} - {__partials__.members(props)} - )) } -; + {Boolean(props.model.typeParameters) && ( + <> + {" "} +
      +

      Type parameters

      + {With(item, item.model, (superProps, props, item = props) => ( + <>{__partials__.typeParameters(props)} + ))} +
      + + )} + {Boolean(props.model.typeHierarchy) && ( + <> + {" "} +
      +

      Hierarchy

      + {With(item, item.model.typeHierarchy, (superProps, props, item = props) => ( + <>{__partials__.hierarchy(props)} + ))} +
      + + )} + {Boolean(props.model.implementedTypes) && ( + <> + {" "} +
      +

      Implements

      +
        + {props.model.implementedTypes.map((item, i) => ( + <> + {" "} +
      • + {item.__partials__.type} +
      • + + ))}{" "} +
      +
      + + )} + {Boolean(props.model.implementedBy) && ( + <> + {" "} +
      +

      Implemented by

      +
        + {props.model.implementedBy.map((item, i) => ( + <> + {" "} +
      • + {item.__partials__.type} +
      • + + ))}{" "} +
      +
      + + )} + {Boolean(props.model.signatures) && ( + <> + {" "} +
      +

      Callable

      + {With(item, item.model, (superProps, props, item = props) => ( + <>{__partials__["memberSignatures"](props)} + ))} +
      + + )} + {Boolean(props.model.indexSignature) && ( + <> + {" "} +
      +

      Indexable

      +
      + + [ + {props.model.indexSignature.parameters.map((item, i) => ( + <> + {" "} + {item.name}: + {With(item, item.type, (superProps, props, item = props) => ( + <>{item.__partials__.type} + ))} + + ))}{" "} + ]:  + {With(item, item.model.indexSignature.type, (superProps, props, item = props) => ( + <>{__partials__.type(props)} + ))} + +
      + {With(item, item.model.indexSignature, (superProps, props, item = props) => ( + <>{__partials__.comment(props)} + ))} + {Boolean(props.model.indexSignature.type.declaration) && ( + <> + {" "} + {With( + ( + superProps = item, + props = item.model.indexSignature.type.declaration, + item = props + ) => ( + <>{__partials__.parameter(props)} + ) + )} + + )}{" "} +
      + + )} + {With(item, item.model, (superProps, props, item = props) => ( + <> + {__partials__.index(props)} + {__partials__.members(props)} + + ))} + +); diff --git a/src/lib.tsx b/src/lib.tsx index bb23f8d2..0103d4ae 100644 --- a/src/lib.tsx +++ b/src/lib.tsx @@ -1,23 +1,34 @@ -import React from 'react'; -import {SignatureReflection, Reflection, ReflectionKind} from '../typedoc/src'; +import React from "react"; +import { SignatureReflection, Reflection, ReflectionKind } from "../typedoc/src"; -export function With(superProps: A, props: B, cb: (superProps: A, props: B, item: B) => C): C { - return cb(superProps, props, props); +/** + * Helper created solely to make it easier to find-and-replace refactor + * all handlebars {{#with}} blocks into JSX. + * + * First two arguments are passed to the callback. Callback's return value is + * returned. + * + * Usage typically looks like this: + * + * { With(props, props.foo, (superProps, props, item = props) => <>Markup) } + */ +export function With(superProps: A, props: B, cb: (superProps: A, props: B) => C): C { + return cb(superProps, props); } // export function IfCond(props: {cond: string, children: T}) { // if(props.cond) return props.children; // else return undefined; // } -export class IfCond extends React.Component<{cond: boolean}> { +export class IfCond extends React.Component<{ cond: boolean }> { render() { - if(this.props.cond) return this.props.children; + if (this.props.cond) return this.props.children; else return undefined; } } -export class IfNotCond extends React.Component<{cond: boolean}> { +export class IfNotCond extends React.Component<{ cond: boolean }> { render() { - if(!this.props.cond) return this.props.children; + if (!this.props.cond) return this.props.children; else return undefined; } } @@ -25,16 +36,16 @@ export class IfNotCond extends React.Component<{cond: boolean}> { declare global { namespace JSX { interface IntrinsicElements { - markdown: {} - compact: {} + markdown: {}; + compact: {}; } } } -export function Markdown(props: {children: T}) { +export function Markdown(props: { children: T }) { return {props.children}; } -export function Compact(props: {children: T}) { +export function Compact(props: { children: T }) { return {props.children}; } @@ -42,6 +53,4 @@ export function isSignature(reflection: Reflection): reflection is SignatureRefl return !!(reflection.kind & ReflectionKind.SomeSignature); } -export const __partials__ = { - -}; +export { __partials__ } from "./partials"; diff --git a/src/minimal/partials/member.tsx b/src/minimal/partials/member.tsx index cd6d5db9..4c20e497 100644 --- a/src/minimal/partials/member.tsx +++ b/src/minimal/partials/member.tsx @@ -1,20 +1,48 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <>
      - - {Boolean(props.name) && <>

      {props.flags.map((item, i) => <>{item} )}{props.wbr}

      - } - {Boolean(props.signatures) ? <> {__partials__['member.signatures'](props)} - : Boolean(props.hasGetterOrSetter) ? <> - {__partials__['member.getterSetter'](props)} - : Boolean(props.tryGetTargetReflectionDeep) ? <> - {__partials__['member.reference'](props)} - : <> {__partials__['member.declaration'](props)} - } +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const component = (props, item = props) => ( + <> +
      + + {Boolean(props.name) && ( + <> + {" "} +

      + {props.flags.map((item, i) => ( + <> + {item}{" "} + + ))} + {props.wbr} +

      + + )} + {Boolean(props.signatures) ? ( + <> {__partials__["memberSignatures"](props)} + ) : Boolean(props.hasGetterOrSetter) ? ( + <>{__partials__["memberGetterSetter"](props)} + ) : Boolean(props.tryGetTargetReflectionDeep) ? ( + <>{__partials__["memberReference"](props)} + ) : ( + <> {__partials__["memberDeclaration"](props)} + )} - {!Boolean(props.isContainer) && props.groups.map((item, i) => <>{item.children.map((item, i) => <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member} - })})}
      + {!Boolean(props.isContainer) && + props.groups.map((item, i) => ( + <> + {item.children.map((item, i) => ( + <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member}} + ))} + + ))} +
      - {Boolean(props.isContainer) && <> {__partials__.index(props)} - {__partials__.members(props)} - }; + {Boolean(props.isContainer) && ( + <> + {" "} + {__partials__.index(props)} + {__partials__.members(props)} + + )} + +); diff --git a/src/minimal/templates/index.tsx b/src/minimal/templates/index.tsx index 7d877da3..72c356d3 100644 --- a/src/minimal/templates/index.tsx +++ b/src/minimal/templates/index.tsx @@ -1,19 +1,34 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <>{ With(item, item.model, (superProps, props, item) => (<> - {__partials__.comment(props)} - )) } +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const component = (props, item = props) => ( + <> + {With(item, item.model, (superProps, props, item = props) => ( + <>{__partials__.comment(props)} + ))} - {Boolean(props.model.typeHierarchy) && <>
      -

      Hierarchy

      - { With(item, item.model.typeHierarchy, (superProps, props, item) => (<>{__partials__.hierarchy(props)})) } -
      - } - { With(item, item.model, (superProps, props, item) => (<> -
      - {__partials__.index(props)} - {__partials__.members(props)} - )) } -; + {Boolean(props.model.typeHierarchy) && ( + <> + {" "} +
      +

      Hierarchy

      + {With(item, item.model.typeHierarchy, (superProps, props, item = props) => ( + <>{__partials__.hierarchy(props)} + ))} +
      + + )} + {With(item, item.model, (superProps, props, item = props) => ( + <> +
      + +
      + {__partials__.index(props)} + {__partials__.members(props)} + + ))} + +); diff --git a/src/partials.tsx b/src/partials.tsx new file mode 100644 index 00000000..741213eb --- /dev/null +++ b/src/partials.tsx @@ -0,0 +1,51 @@ +import { analytics } from "./default/partials/analytics"; +import { breadcrumb } from "./default/partials/breadcrumb"; +import { comment } from "./default/partials/comment"; +import { footer } from "./default/partials/footer"; +import { header } from "./default/partials/header"; +import { hierarchy } from "./default/partials/hierarchy"; +import { index } from "./default/partials/index"; +import { member } from "./default/partials/member"; +import { memberDeclaration } from "./default/partials/member.declaration"; +import { memberGetterSetter } from "./default/partials/member.getterSetter"; +import { memberReference } from "./default/partials/member.reference"; +import { memberSignatureBody } from "./default/partials/member.signature.body"; +import { memberSignatureTitle } from "./default/partials/member.signature.title"; +import { memberSignatures } from "./default/partials/member.signatures"; +import { memberSources } from "./default/partials/member.sources"; +import { members } from "./default/partials/members"; +import { membersGroup } from "./default/partials/members.group"; +import { navigation } from "./default/partials/navigation"; +import { parameter } from "./default/partials/parameter"; +import { toc } from "./default/partials/toc"; +import { tocRoot } from "./default/partials/toc.root"; +import { type } from "./default/partials/type"; +import { typeAndParent } from "./default/partials/typeAndParent"; +import { typeParameters } from "./default/partials/typeParameters"; + +export const __partials__ = { + analytics, + breadcrumb, + comment, + footer, + header, + hierarchy, + index, + member, + memberDeclaration, + memberGetterSetter, + memberReference, + memberSignatureBody, + memberSignatureTitle, + memberSignatures, + memberSources, + members, + membersGroup, + navigation, + parameter, + toc, + tocRoot, + type, + typeAndParent, + typeParameters, +}; diff --git a/tsconfig.json b/tsconfig.json index 7bb08f14..4090e212 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,5 @@ { - "include": ["src/default/assets/js/src/**/*.ts"], + "include": ["src"], "compilerOptions": { "target": "ES5", "module": "ES2015", @@ -9,7 +9,11 @@ "sourceMap": false, "strict": true, "alwaysStrict": false, - "noImplicitUseStrict": true + "noImplicitUseStrict": true, + "noEmit": true, + "allowSyntheticDefaultImports": true, + "jsx": "react", + "moduleResolution": "node" }, "ts-node": { "transpileOnly": true, From 5f7ff3ba39abaf5e9be57403541e0971d817e8c5 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Sat, 17 Jul 2021 21:37:48 -0400 Subject: [PATCH 15/19] WIP --- src/default/partials/member.signature.body.tsx | 2 +- src/default/partials/member.signature.title.tsx | 2 +- .../partials/type-inline-partials/template-literal.tsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/default/partials/member.signature.body.tsx b/src/default/partials/member.signature.body.tsx index c088a15e..fc767b7f 100644 --- a/src/default/partials/member.signature.body.tsx +++ b/src/default/partials/member.signature.body.tsx @@ -1,6 +1,6 @@ import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; import React from "react"; -export const memberSignatureBody\ = (props, item = props) => ( +export const memberSignatureBody = (props, item = props) => ( <> {!Boolean(props.hideSources) && <> {__partials__["memberSources"](props)}} {__partials__.comment(props)} diff --git a/src/default/partials/member.signature.title.tsx b/src/default/partials/member.signature.title.tsx index d9d32b60..3f5fe2ad 100644 --- a/src/default/partials/member.signature.title.tsx +++ b/src/default/partials/member.signature.title.tsx @@ -1,6 +1,6 @@ import { With, IfCond, IfNotCond, Markdown } from "../../lib"; import React from "react"; -export const memberSignatureTitle\ = (props, item = props) => ( +export const memberSignatureTitle = (props, item = props) => ( <> {!Boolean(props.hideName) ? ( <> {props.wbr} diff --git a/src/default/partials/type-inline-partials/template-literal.tsx b/src/default/partials/type-inline-partials/template-literal.tsx index 68289e50..323ff000 100644 --- a/src/default/partials/type-inline-partials/template-literal.tsx +++ b/src/default/partials/type-inline-partials/template-literal.tsx @@ -4,10 +4,10 @@ export const component = (props, item = props) => <> ` {Boolean(props.head) && <> {props.head} }{props.tail.map((item, i) => <> ${"{"} - { With(item, item.this.[0], (superProps, props, item = props) => (<> + { With(item, item.this[0], (superProps, props, item = props) => (<> {item.__partials__.type} )) } {"}"} - {Boolean(item.1) && <> {item.1} + {Boolean(item[1]) && <> {item[1]} })} ` ; From f1873b78cfccf5870a983f087ae58b51272d10a0 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Sat, 17 Jul 2021 21:48:45 -0400 Subject: [PATCH 16/19] WIP --- src/default/layouts/default.tsx | 105 ++++++++++-------- src/default/partials/hierarchy.tsx | 4 +- .../partials/member.signature.body.tsx | 6 +- .../partials/member.signature.title.tsx | 2 +- src/default/partials/member.signatures.tsx | 4 +- src/default/partials/member.tsx | 2 +- src/default/partials/members.group.tsx | 4 +- src/default/partials/members.tsx | 4 +- src/default/partials/navigation.tsx | 2 +- src/default/partials/parameter.tsx | 22 ++-- src/default/partials/toc.root.tsx | 2 +- src/default/partials/toc.tsx | 2 +- .../type-inline-partials/reference.tsx | 2 +- .../type-inline-partials/reflection.tsx | 8 +- .../type-inline-partials/template-literal.tsx | 43 ++++--- .../partials/type-inline-partials/tuple.tsx | 27 +++-- src/default/partials/typeParameters.tsx | 6 +- src/default/templates/reflection.tsx | 6 +- src/lib.tsx | 8 +- src/minimal/layouts/default.tsx | 80 +++++++------ src/minimal/partials/member.tsx | 2 +- 21 files changed, 193 insertions(+), 148 deletions(-) diff --git a/src/default/layouts/default.tsx b/src/default/layouts/default.tsx index fbd41d98..38751ef9 100644 --- a/src/default/layouts/default.tsx +++ b/src/default/layouts/default.tsx @@ -1,49 +1,56 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <> - - - - - <IfCond cond={props.model.name === props.project.name}>{props.project.name}</IfCond><IfNotCond cond={props.model.name === props.project.name}>{props.model.name} | {props.project.name}</IfNotCond> - - - - - - - - - {__partials__.header(props)} - -
      -
      -
      - {props.contents} -
      -
      - - - -
      -
      -
      - - {__partials__.footer(props)} - -
      - - - {__partials__.analytics(props)} - - - -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const component = (props, item = props) => ( + <> + + + + + + <IfCond cond={props.model.name === props.project.name}>{props.project.name}</IfCond> + <IfNotCond cond={props.model.name === props.project.name}> + {props.model.name} | {props.project.name} + </IfNotCond> + + + + + + + + + {__partials__.header(props)} + +
      +
      +
      {props.contents}
      +
      + + + +
      +
      +
      + + {__partials__.footer(props)} + +
      + + + {__partials__.analytics(props)} + + + +); diff --git a/src/default/partials/hierarchy.tsx b/src/default/partials/hierarchy.tsx index 88770aec..7b227317 100644 --- a/src/default/partials/hierarchy.tsx +++ b/src/default/partials/hierarchy.tsx @@ -15,14 +15,14 @@ export const hierarchy = (props, item = props) => ( ) : ( <> {" "} - {item.__partials__.type} + {__partials__.type(item)} )} {Boolean(item.last) && ( <> {" "} {With(item, item.superProps.next, (superProps, props, item = props) => ( - <>{item.__partials__.hierarchy} + <>{__partials__.hierarchy(item)} ))} )}{" "} diff --git a/src/default/partials/member.signature.body.tsx b/src/default/partials/member.signature.body.tsx index fc767b7f..40e1ca83 100644 --- a/src/default/partials/member.signature.body.tsx +++ b/src/default/partials/member.signature.body.tsx @@ -34,7 +34,7 @@ export const memberSignatureBody = (props, item = props) => ( )} {item.name}: {With(item, item.type, (superProps, props, item = props) => ( - <>{item.__partials__.type} + <>{__partials__.type(item)} ))} {Boolean(item.defaultValue) && ( <> @@ -47,12 +47,12 @@ export const memberSignatureBody = (props, item = props) => ( )}{" "} - {item.__partials__.comment} + {__partials__.comment(item)} {Boolean(item.type.declaration) && ( <> {" "} {With(item, item.type.declaration, (superProps, props, item = props) => ( - <>{item.__partials__.parameter} + <>{__partials__.parameter(item)} ))} )}{" "} diff --git a/src/default/partials/member.signature.title.tsx b/src/default/partials/member.signature.title.tsx index 3f5fe2ad..219913b8 100644 --- a/src/default/partials/member.signature.title.tsx +++ b/src/default/partials/member.signature.title.tsx @@ -44,7 +44,7 @@ export const memberSignatureTitle = (props, item = props) => ( {Boolean(item.defaultValue) && "?"}: {With(item, item.type, (superProps, props, item = props) => ( - <>{item.__partials__.type} + <>{__partials__.type(item)} ))} ))} diff --git a/src/default/partials/member.signatures.tsx b/src/default/partials/member.signatures.tsx index 734d873e..8c3ab3b0 100644 --- a/src/default/partials/member.signatures.tsx +++ b/src/default/partials/member.signatures.tsx @@ -7,7 +7,7 @@ export const memberSignatures = (props, item = props) => ( <> {" "}
    • - {item.__partials__.member.signature.title} + {__partials__.memberSignatureTitle(item)}
    • ))} @@ -17,7 +17,7 @@ export const memberSignatures = (props, item = props) => ( {props.signatures.map((item, i) => ( <> {" "} -
    • {item.__partials__.member.signature.body}
    • +
    • {__partials__.memberSignatureBody(item)}
    • ))}
    diff --git a/src/default/partials/member.tsx b/src/default/partials/member.tsx index ff4dee49..867c21fd 100644 --- a/src/default/partials/member.tsx +++ b/src/default/partials/member.tsx @@ -30,7 +30,7 @@ export const member = (props, item = props) => ( {props.groups.map((item, i) => ( <> {item.children.map((item, i) => ( - <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member}} + <>{!Boolean(item.hasOwnDocument) && <> {__partials__.member(item)}} ))} ))} diff --git a/src/default/partials/members.group.tsx b/src/default/partials/members.group.tsx index ff95a306..53f4fcc3 100644 --- a/src/default/partials/members.group.tsx +++ b/src/default/partials/members.group.tsx @@ -11,7 +11,7 @@ export const membersGroup = (props, item = props) => {item.superProps.title} {item.children.map((item, i) => ( - <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member}} + <>{!Boolean(item.hasOwnDocument) && <> {__partials__.member(item)}} ))}{" "} @@ -22,7 +22,7 @@ export const membersGroup = (props, item = props) =>

    {props.title}

    {props.children.map((item, i) => ( - <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member}} + <>{!Boolean(item.hasOwnDocument) && <> {__partials__.member(item)}} ))}{" "}
    diff --git a/src/default/partials/members.tsx b/src/default/partials/members.tsx index 2ed2f7f9..8a55f61b 100644 --- a/src/default/partials/members.tsx +++ b/src/default/partials/members.tsx @@ -10,7 +10,7 @@ export const members = (props, item = props) =>

    {item.title}

    {item.children.map((item, i) => ( - <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member}} + <>{!Boolean(item.hasOwnDocument) && <> {__partials__.member(item)}} ))}{" "}
    @@ -18,5 +18,5 @@ export const members = (props, item = props) => )) : props.groups.map((item, i) => ( - <>{!Boolean(item.allChildrenHaveOwnDocument) && <> {item.__partials__.members.group}} + <>{!Boolean(item.allChildrenHaveOwnDocument) && <> {__partials__.membersGroup(item)}} )); diff --git a/src/default/partials/navigation.tsx b/src/default/partials/navigation.tsx index 6ac845be..ecd3b9c5 100644 --- a/src/default/partials/navigation.tsx +++ b/src/default/partials/navigation.tsx @@ -28,7 +28,7 @@ export const navigation = (props, item = props) => {" "}
      {props.children.map((item, i) => ( - <> {item.__partials__.navigation} + <> {__partials__.navigation(item)} ))}{" "}
    diff --git a/src/default/partials/parameter.tsx b/src/default/partials/parameter.tsx index 691b4135..09100b07 100644 --- a/src/default/partials/parameter.tsx +++ b/src/default/partials/parameter.tsx @@ -48,7 +48,7 @@ export const parameter = (props, item = props) => ( )} {item.name}: {With(item, item.type, (superProps, props, item = props) => ( - <>{item.__partials__.type} + <>{__partials__.type(item)} ))} ))}{" "} @@ -89,7 +89,7 @@ export const parameter = (props, item = props) => ( - {item.__partials__.member.signatures} + {__partials__.memberSignatures(item)} ) : Boolean(item.type) ? ( @@ -114,18 +114,18 @@ export const parameter = (props, item = props) => ( {Boolean(item.superProps.flags.isOptional) && "?"}: - {item.__partials__.type} + {__partials__.type(item)} ))} - {item.__partials__.comment} - {Boolean(item.children) && <> {item.__partials__.parameter}} + {__partials__.comment(item)} + {Boolean(item.children) && <> {__partials__.parameter(item)}} {Boolean(item.type.declaration) && ( <> {" "} {With(item, item.type.declaration, (superProps, props, item = props) => ( - <>{item.__partials__.parameter} + <>{__partials__.parameter(item)} ))} )}{" "} @@ -152,12 +152,12 @@ export const parameter = (props, item = props) => ( {item.wbr} ():  {With(item, item.type, (superProps, props, item = props) => ( - <>{item.__partials__.type} + <>{__partials__.type(item)} ))} - {item.__partials__.comment} + {__partials__.comment(item)} ))} @@ -189,7 +189,7 @@ export const parameter = (props, item = props) => ( item, item.type, (superProps, props, item = props) => ( - <>{item.__partials__.type} + <>{__partials__.type(item)} ) )} @@ -203,12 +203,12 @@ export const parameter = (props, item = props) => ( ))}{" "} ):  {With(item, item.type, (superProps, props, item = props) => ( - <>{item.__partials__.type} + <>{__partials__.type(item)} ))} - {item.__partials__.comment} + {__partials__.comment(item)} ))} diff --git a/src/default/partials/toc.root.tsx b/src/default/partials/toc.root.tsx index 0e2f62fb..f2b1afd2 100644 --- a/src/default/partials/toc.root.tsx +++ b/src/default/partials/toc.root.tsx @@ -15,7 +15,7 @@ export const tocRoot = (props, item = props) => ( {" "}
      {props.children.map((item, i) => ( - <> {item.__partials__.toc} + <> {__partials__.toc(item)} ))}{" "}
    diff --git a/src/default/partials/toc.tsx b/src/default/partials/toc.tsx index 9b988ed8..f5caa4b1 100644 --- a/src/default/partials/toc.tsx +++ b/src/default/partials/toc.tsx @@ -11,7 +11,7 @@ export const toc = (props, item = props) => ( {" "}
      {props.children.map((item, i) => ( - <> {item.__partials__.toc} + <> {__partials__.toc(item)} ))}{" "}
    diff --git a/src/default/partials/type-inline-partials/reference.tsx b/src/default/partials/type-inline-partials/reference.tsx index 470e29f4..6a21b77f 100644 --- a/src/default/partials/type-inline-partials/reference.tsx +++ b/src/default/partials/type-inline-partials/reference.tsx @@ -9,6 +9,6 @@ export const component = (props, item = props) => <> : <> {props.name} }{Boolean(props.typeArguments) && <> < {props.typeArguments.map((item, i) => <>{!Boolean(item.first) && <> , - } {item.__partials__.type} + } {__partials__.type(item)} )} > }; diff --git a/src/default/partials/type-inline-partials/reflection.tsx b/src/default/partials/type-inline-partials/reflection.tsx index ea75b5a0..593cc185 100644 --- a/src/default/partials/type-inline-partials/reflection.tsx +++ b/src/default/partials/type-inline-partials/reflection.tsx @@ -25,7 +25,7 @@ export const component = (props, item = props) => ( <> {" "} {With(item, item.getSignature.type, (superProps, props, item = props) => ( - <>{item.__partials__.type} + <>{__partials__.type(item)} ))} ) : ( @@ -45,7 +45,7 @@ export const component = (props, item = props) => ( <> {" "} {With(item, item.getSignature.type, (superProps, props, item = props) => ( - <>{item.__partials__.type} + <>{__partials__.type(item)} ))} ) : ( @@ -72,7 +72,7 @@ export const component = (props, item = props) => ( <> {" "} {With(item, item.type, (superProps, props, item = props) => ( - <>{item.__partials__.type} + <>{__partials__.type(item)} ))} ) : ( @@ -104,7 +104,7 @@ export const component = (props, item = props) => ( <> {" "} {With(item, item.type, (superProps, props, item = props) => ( - <>{item.__partials__.type} + <>{__partials__.type(item)} ))} ) : ( diff --git a/src/default/partials/type-inline-partials/template-literal.tsx b/src/default/partials/type-inline-partials/template-literal.tsx index 323ff000..cfda8b0a 100644 --- a/src/default/partials/type-inline-partials/template-literal.tsx +++ b/src/default/partials/type-inline-partials/template-literal.tsx @@ -1,13 +1,30 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../../lib'; -import React from 'react'; -export const component = (props, item = props) => <> - ` - {Boolean(props.head) && <> {props.head} - }{props.tail.map((item, i) => <> ${"{"} - { With(item, item.this[0], (superProps, props, item = props) => (<> - {item.__partials__.type} - )) } - {"}"} - {Boolean(item[1]) && <> {item[1]} - })} ` -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../../lib"; +import React from "react"; +export const component = (props, item = props) => ( + <> + ` + {Boolean(props.head) && ( + <> + {" "} + {props.head} + + )} + {props.tail.map((item, i) => ( + <> + {" "} + ${"{"} + {With(item, item.this[0], (superProps, props, item = props) => ( + <>{__partials__.type(item)} + ))} + {"}"} + {Boolean(item[1]) && ( + <> + {" "} + {item[1]} + + )} + + ))}{" "} + ` + +); diff --git a/src/default/partials/type-inline-partials/tuple.tsx b/src/default/partials/type-inline-partials/tuple.tsx index 2c4ea4fb..1d29d4a6 100644 --- a/src/default/partials/type-inline-partials/tuple.tsx +++ b/src/default/partials/type-inline-partials/tuple.tsx @@ -1,8 +1,19 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../../lib'; -import React from 'react'; -export const component = (props, item = props) => <> - [ - {props.elements.map((item, i) => <>{!Boolean(item.first) && <> , - } {item.__partials__.type} - )} ] -; +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../../lib"; +import React from "react"; +export const component = (props, item = props) => ( + <> + [ + {props.elements.map((item, i) => ( + <> + {!Boolean(item.first) && ( + <> + {" "} + , + + )}{" "} + {__partials__.type(item)} + + ))}{" "} + ] + +); diff --git a/src/default/partials/typeParameters.tsx b/src/default/partials/typeParameters.tsx index c074aa8b..3d536fa8 100644 --- a/src/default/partials/typeParameters.tsx +++ b/src/default/partials/typeParameters.tsx @@ -15,7 +15,7 @@ export const typeParameters = (props, item = props) => ( {" "} {With(item, item.type, (superProps, props, item = props) => ( - <>{item.__partials__.type} + <>{__partials__.type(item)} ))} )} @@ -24,13 +24,13 @@ export const typeParameters = (props, item = props) => ( {" "}  = {With(item, item.default, (superProps, props, item = props) => ( - <>{item.__partials__.type} + <>{__partials__.type(item)} ))} )}{" "} - {item.__partials__.comment} + {__partials__.comment(item)} ))} diff --git a/src/default/templates/reflection.tsx b/src/default/templates/reflection.tsx index aa4b1924..2bb78d93 100644 --- a/src/default/templates/reflection.tsx +++ b/src/default/templates/reflection.tsx @@ -45,7 +45,7 @@ export const component = (props, item = props) => ( <> {" "}
  • - {item.__partials__.type} + {__partials__.type(item)}
  • ))}{" "} @@ -63,7 +63,7 @@ export const component = (props, item = props) => ( <> {" "}
  • - {item.__partials__.type} + {__partials__.type(item)}
  • ))}{" "} @@ -95,7 +95,7 @@ export const component = (props, item = props) => ( {" "} {item.name}: {With(item, item.type, (superProps, props, item = props) => ( - <>{item.__partials__.type} + <>{__partials__.type(item)} ))} ))}{" "} diff --git a/src/lib.tsx b/src/lib.tsx index 0103d4ae..f0618e87 100644 --- a/src/lib.tsx +++ b/src/lib.tsx @@ -41,8 +41,8 @@ declare global { } } } -export function Markdown(props: { children: T }) { - return {props.children}; +export function markdown(text: string) { + return <>{text}; } export function Compact(props: { children: T }) { @@ -53,4 +53,8 @@ export function isSignature(reflection: Reflection): reflection is SignatureRefl return !!(reflection.kind & ReflectionKind.SomeSignature); } +export function relativeURL(url: string) { + return url ? this.getRelativeUrl(url) : url; +} + export { __partials__ } from "./partials"; diff --git a/src/minimal/layouts/default.tsx b/src/minimal/layouts/default.tsx index e856c2af..e716d62c 100644 --- a/src/minimal/layouts/default.tsx +++ b/src/minimal/layouts/default.tsx @@ -1,42 +1,48 @@ -import {With, __partials__, Compact, IfCond, IfNotCond, Markdown} from '../../lib'; -import React from 'react'; -export const component = (props, item = props) => <> - - - - - {props.model.name} | {props.project.name} - - - - - +import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import React from "react"; +export const component = (props, item = props) => ( + <> + + + + + + {props.model.name} | {props.project.name} + + + + + + + {__partials__.header(props)} - {__partials__.header(props)} + - - -
    -
    - {Boolean(props.model.readme) && <>
    - {props.model.readme} +
    +
    + {Boolean(props.model.readme) && ( + <> + {" "} +
    + {props.model.readme} +
    + + )} + {props.contents} + {__partials__.footer(props)} +
    - } - {props.contents} - {__partials__.footer(props)} -
    -
    - - - {__partials__.analytics(props)} + - - -; + {__partials__.analytics(props)} + + + +); diff --git a/src/minimal/partials/member.tsx b/src/minimal/partials/member.tsx index 4c20e497..87fdb5ca 100644 --- a/src/minimal/partials/member.tsx +++ b/src/minimal/partials/member.tsx @@ -31,7 +31,7 @@ export const component = (props, item = props) => ( props.groups.map((item, i) => ( <> {item.children.map((item, i) => ( - <>{!Boolean(item.hasOwnDocument) && <> {item.__partials__.member}} + <>{!Boolean(item.hasOwnDocument) && <> {__partials__.member(item)}} ))} ))} From e9ad2334908ff05c24a7d28aa2909547944facbd Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Sat, 17 Jul 2021 18:50:17 -0400 Subject: [PATCH 17/19] WIP --- package.json | 2 + src/default/layouts/default.tsx | 4 +- src/default/partials/analytics.tsx | 6 +- src/default/partials/breadcrumb.tsx | 10 +-- src/default/partials/comment.tsx | 12 +-- src/default/partials/footer.tsx | 4 +- src/default/partials/header.tsx | 12 +-- src/default/partials/hierarchy.tsx | 10 +-- src/default/partials/index.tsx | 25 ++---- src/default/partials/member.declaration.tsx | 18 ++-- src/default/partials/member.getterSetter.tsx | 18 ++-- src/default/partials/member.reference.tsx | 8 +- .../partials/member.signature.body.tsx | 34 ++++--- .../partials/member.signature.title.tsx | 28 +++--- src/default/partials/member.signatures.tsx | 2 +- src/default/partials/member.sources.tsx | 18 ++-- src/default/partials/member.tsx | 12 +-- src/default/partials/members.group.tsx | 10 +-- src/default/partials/members.tsx | 8 +- src/default/partials/navigation.tsx | 8 +- src/default/partials/parameter.tsx | 90 +++++++++---------- src/default/partials/toc.root.tsx | 4 +- src/default/partials/toc.tsx | 4 +- .../partials/type-inline-partials/array.tsx | 6 +- .../type-inline-partials/conditional.tsx | 16 ++-- .../partials/type-inline-partials/index.tsx | 46 +++++----- .../type-inline-partials/indexedAccess.tsx | 8 +- .../type-inline-partials/inferred.tsx | 13 +-- .../type-inline-partials/intersection.tsx | 39 ++++++-- .../type-inline-partials/intrinsic.tsx | 13 +-- .../partials/type-inline-partials/literal.tsx | 13 +-- .../partials/type-inline-partials/mapped.tsx | 10 ++- .../named-tuple-member.tsx | 8 +- .../type-inline-partials/optional.tsx | 6 +- .../partials/type-inline-partials/options.ts | 3 + .../type-inline-partials/predicate.tsx | 10 ++- .../partials/type-inline-partials/query.tsx | 6 +- .../type-inline-partials/reference.tsx | 9 +- .../type-inline-partials/reflection.tsx | 49 +++++----- .../partials/type-inline-partials/rest.tsx | 6 +- .../type-inline-partials/template-literal.tsx | 44 +++------ .../partials/type-inline-partials/tuple.tsx | 6 +- .../type-inline-partials/typeOperator.tsx | 6 +- .../type-inline-partials/typeParameter.tsx | 13 +-- .../partials/type-inline-partials/union.tsx | 14 +-- .../partials/type-inline-partials/unknown.tsx | 8 +- src/default/partials/type.tsx | 4 +- src/default/partials/typeAndParent.tsx | 16 ++-- src/default/partials/typeParameters.tsx | 14 +-- src/default/templates/index.tsx | 16 ++-- src/default/templates/reflection.tsx | 55 ++++++------ src/lib.tsx | 9 +- src/minimal/layouts/default.tsx | 4 +- src/minimal/partials/header.tsx | 82 ++++++++++------- src/minimal/partials/member.tsx | 14 +-- src/minimal/templates/index.tsx | 10 +-- 56 files changed, 493 insertions(+), 430 deletions(-) create mode 100644 src/default/partials/type-inline-partials/options.ts diff --git a/package.json b/package.json index 0c7f8795..8c39386d 100644 --- a/package.json +++ b/package.json @@ -50,10 +50,12 @@ ], "dependencies": { "@types/react": "^17.0.14", + "@types/react-dom": "^17.0.9", "glob": "^7.1.7", "handlebars-to-jsx": "^0.1.4", "outdent": "^0.8.0", "react": "^17.0.2", + "react-dom": "^17.0.2", "ts-node": "^10.1.0" } } diff --git a/src/default/layouts/default.tsx b/src/default/layouts/default.tsx index 38751ef9..c3e1ec8a 100644 --- a/src/default/layouts/default.tsx +++ b/src/default/layouts/default.tsx @@ -1,6 +1,6 @@ -import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import { With, __partials__, IfCond, IfNotCond, Markdown } from "../../lib"; import React from "react"; -export const component = (props, item = props) => ( +export const defaultLayout = (props) => ( <> diff --git a/src/default/partials/analytics.tsx b/src/default/partials/analytics.tsx index 53de4804..8ef70843 100644 --- a/src/default/partials/analytics.tsx +++ b/src/default/partials/analytics.tsx @@ -1,7 +1,7 @@ -import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import { With, __partials__ } from "../../lib"; import React from "react"; -export const analytics = (props, item = props) => - Boolean(props.settings.gaID) && ( +export const analytics = (props) => + !!props.settings.gaID && ( <> {" "} + + {__partials__.header(props)} @@ -47,7 +47,7 @@ export const defaultLayout = (props) => ( {__partials__.footer(props)}
    - + {__partials__.analytics(props)} diff --git a/src/default/partials/analytics.tsx b/src/default/partials/analytics.tsx index 8ef70843..11280029 100644 --- a/src/default/partials/analytics.tsx +++ b/src/default/partials/analytics.tsx @@ -1,4 +1,4 @@ -import { With, __partials__ } from "../../lib"; +import { With, relativeURL, wbr, __partials__ } from "../../lib"; import React from "react"; export const analytics = (props) => !!props.settings.gaID && ( diff --git a/src/default/partials/breadcrumb.tsx b/src/default/partials/breadcrumb.tsx index 55ffd060..c6911954 100644 --- a/src/default/partials/breadcrumb.tsx +++ b/src/default/partials/breadcrumb.tsx @@ -1,4 +1,4 @@ -import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import { With, relativeURL, wbr, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; import React from "react"; export const breadcrumb = (props) => props.parent ? ( @@ -11,7 +11,7 @@ export const breadcrumb = (props) => {!!props.url ? ( <> {" "} - {props.name} + {props.name} ) : ( <> @@ -26,7 +26,7 @@ export const breadcrumb = (props) => <> {" "}
  • - {props.name} + {props.name}
  • ) diff --git a/src/default/partials/comment.tsx b/src/default/partials/comment.tsx index 8a57e758..b31f9074 100644 --- a/src/default/partials/comment.tsx +++ b/src/default/partials/comment.tsx @@ -1,4 +1,4 @@ -import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import { With, relativeURL, wbr, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; import React from "react"; export const comment = (props) => ( <> diff --git a/src/default/partials/footer.tsx b/src/default/partials/footer.tsx index f3c34ebc..93bdbcb2 100644 --- a/src/default/partials/footer.tsx +++ b/src/default/partials/footer.tsx @@ -1,4 +1,4 @@ -import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import { With, relativeURL, wbr, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; import React from "react"; export const footer = (props) => ( <> diff --git a/src/default/partials/header.tsx b/src/default/partials/header.tsx index 781d87fc..2fec0118 100644 --- a/src/default/partials/header.tsx +++ b/src/default/partials/header.tsx @@ -1,4 +1,4 @@ -import { With, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; +import { With, relativeURL, wbr, __partials__, Compact, IfCond, IfNotCond, Markdown } from "../../lib"; import React from "react"; export const header = (props) => ( <> @@ -9,8 +9,8 @@ export const header = (props) => (