-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from qonto/test-app-typescript-conversion
refactor: migrate test app package to TypeScript
- Loading branch information
Showing
20 changed files
with
235 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<ul>{{yield}} elephant</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import templateOnlyComponent from '@ember/component/template-only'; | ||
|
||
export interface GroupListItemSignature { | ||
Element: HTMLUListElement; | ||
Blocks: { | ||
default: []; | ||
}; | ||
} | ||
|
||
const GroupListItem = templateOnlyComponent<GroupListItemSignature>(); | ||
|
||
export default GroupListItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<a href={{@node.node.data.url}}>{{yield}}</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import templateOnlyComponent from '@ember/component/template-only'; | ||
|
||
export interface HyperlinkSignature { | ||
Element: HTMLAnchorElement; | ||
// The `node` argument should be a TreeNode, but that type is not exported | ||
// from the package. | ||
// https://github.com/prismicio/prismic-richtext/blob/495456d843ef79153ab9de87cc76b1cc940f6aec/src/types.ts#L136 | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
Args: { node: any }; | ||
Blocks: { | ||
default: []; | ||
}; | ||
} | ||
|
||
const Hyperlink = templateOnlyComponent<HyperlinkSignature>(); | ||
|
||
export default Hyperlink; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<li>{{yield}} banana</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import templateOnlyComponent from '@ember/component/template-only'; | ||
|
||
export interface ListItemSignature { | ||
Element: HTMLUListElement; | ||
Blocks: { | ||
default: []; | ||
}; | ||
} | ||
|
||
const ListItem = templateOnlyComponent<ListItemSignature>(); | ||
|
||
export default ListItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<mark>{{yield}}</mark> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import templateOnlyComponent from '@ember/component/template-only'; | ||
|
||
interface SuperCustomSignature { | ||
Element: HTMLElement; | ||
Blocks: { | ||
default: []; | ||
}; | ||
} | ||
|
||
const SuperCustom = templateOnlyComponent<SuperCustomSignature>(); | ||
|
||
export default SuperCustom; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export default function cleanHtml({ | ||
element, | ||
}: { | ||
element: HTMLElement; | ||
}): string { | ||
const elementHelperIds = / id="[a-zA-Z0-9]*"/g; | ||
const emberViewClass = / class="ember-view"/g; | ||
const extraWhiteSpace = /\s{2,}/g; | ||
const spaceBetweenTags = />(\s+)</g; | ||
const spaceAroundContent = />(\s+)([^<]+)(\s+)</g; | ||
|
||
return element.innerHTML | ||
.replace(elementHelperIds, '') | ||
.replace(emberViewClass, '') | ||
.replace(extraWhiteSpace, ' ') | ||
.replace(spaceBetweenTags, '><') | ||
.replace(spaceAroundContent, '>$2<'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.