Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
8986c475
Commit
8986c475
authored
Mar 08, 2021
by
Robert Knight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove propTypes declarations from components
Prop-types checking has been replaced by JSDoc + TypeScript.
parent
d2301501
Changes
64
Hide whitespace changes
Inline
Side-by-side
Showing
64 changed files
with
2 additions
and
626 deletions
+2
-626
AdderToolbar.js
src/annotator/components/AdderToolbar.js
+0
-16
Buckets.js
src/annotator/components/Buckets.js
+0
-18
Toolbar.js
src/annotator/components/Toolbar.js
+0
-23
Annotation.js
src/sidebar/components/Annotation/Annotation.js
+0
-11
AnnotationActionBar.js
src/sidebar/components/Annotation/AnnotationActionBar.js
+0
-10
AnnotationBody.js
src/sidebar/components/Annotation/AnnotationBody.js
+0
-6
AnnotationDocumentInfo.js
src/sidebar/components/Annotation/AnnotationDocumentInfo.js
+0
-8
AnnotationEditor.js
src/sidebar/components/Annotation/AnnotationEditor.js
+0
-9
AnnotationHeader.js
src/sidebar/components/Annotation/AnnotationHeader.js
+0
-8
AnnotationLicense.js
src/sidebar/components/Annotation/AnnotationLicense.js
+0
-2
AnnotationPublishControl.js
...sidebar/components/Annotation/AnnotationPublishControl.js
+0
-8
AnnotationQuote.js
src/sidebar/components/Annotation/AnnotationQuote.js
+0
-7
AnnotationReplyToggle.js
src/sidebar/components/Annotation/AnnotationReplyToggle.js
+0
-8
AnnotationShareControl.js
src/sidebar/components/Annotation/AnnotationShareControl.js
+0
-9
AnnotationShareInfo.js
src/sidebar/components/Annotation/AnnotationShareInfo.js
+0
-5
AnnotationTimestamps.js
src/sidebar/components/Annotation/AnnotationTimestamps.js
+0
-8
AnnotationUser.js
src/sidebar/components/Annotation/AnnotationUser.js
+1
-9
AnnotationView.js
src/sidebar/components/AnnotationView.js
+0
-6
AutocompleteList.js
src/sidebar/components/AutocompleteList.js
+0
-11
Button.js
src/sidebar/components/Button.js
+0
-34
Excerpt.js
src/sidebar/components/Excerpt.js
+0
-18
FilterSelect.js
src/sidebar/components/FilterSelect.js
+0
-10
FilterStatus.js
src/sidebar/components/FilterStatus.js
+0
-28
GroupList.js
src/sidebar/components/GroupList.js
+0
-6
GroupListItem.js
src/sidebar/components/GroupListItem.js
+0
-11
GroupListSection.js
src/sidebar/components/GroupListSection.js
+0
-9
HelpPanel.js
src/sidebar/components/HelpPanel.js
+1
-11
HypothesisApp.js
src/sidebar/components/HypothesisApp.js
+0
-10
LoggedOutMessage.js
src/sidebar/components/LoggedOutMessage.js
+0
-6
LoginPromptPanel.js
src/sidebar/components/LoginPromptPanel.js
+0
-7
MarkdownEditor.js
src/sidebar/components/MarkdownEditor.js
+0
-25
MarkdownView.js
src/sidebar/components/MarkdownView.js
+0
-7
Menu.js
src/sidebar/components/Menu.js
+0
-17
MenuItem.js
src/sidebar/components/MenuItem.js
+0
-16
MenuKeyboardNavigation.js
src/sidebar/components/MenuKeyboardNavigation.js
+0
-16
MenuSection.js
src/sidebar/components/MenuSection.js
+0
-6
ModerationBanner.js
src/sidebar/components/ModerationBanner.js
+0
-7
NewNoteBtn.js
src/sidebar/components/NewNoteBtn.js
+0
-6
NotebookFilters.js
src/sidebar/components/NotebookFilters.js
+0
-2
NotebookResultCount.js
src/sidebar/components/NotebookResultCount.js
+0
-9
NotebookView.js
src/sidebar/components/NotebookView.js
+0
-5
PaginatedThreadList.js
src/sidebar/components/PaginatedThreadList.js
+0
-9
PaginationNavigation.js
src/sidebar/components/PaginationNavigation.js
+0
-8
SearchInput.js
src/sidebar/components/SearchInput.js
+0
-7
SelectionTabs.js
src/sidebar/components/SelectionTabs.js
+0
-14
ShareAnnotationsPanel.js
src/sidebar/components/ShareAnnotationsPanel.js
+0
-6
SidebarContentError.js
src/sidebar/components/SidebarContentError.js
+0
-7
SidebarPanel.js
src/sidebar/components/SidebarPanel.js
+0
-9
SidebarView.js
src/sidebar/components/SidebarView.js
+0
-9
Slider.js
src/sidebar/components/Slider.js
+0
-6
SortMenu.js
src/sidebar/components/SortMenu.js
+0
-2
Spinner.js
src/sidebar/components/Spinner.js
+0
-2
StreamSearchInput.js
src/sidebar/components/StreamSearchInput.js
+0
-6
StreamView.js
src/sidebar/components/StreamView.js
+0
-6
TagEditor.js
src/sidebar/components/TagEditor.js
+0
-9
TagList.js
src/sidebar/components/TagList.js
+0
-8
Thread.js
src/sidebar/components/Thread.js
+0
-8
ThreadCard.js
src/sidebar/components/ThreadCard.js
+0
-6
ThreadList.js
src/sidebar/components/ThreadList.js
+0
-6
ToastMessages.js
src/sidebar/components/ToastMessages.js
+0
-10
TopBar.js
src/sidebar/components/TopBar.js
+0
-19
Tutorial.js
src/sidebar/components/Tutorial.js
+0
-5
UserMenu.js
src/sidebar/components/UserMenu.js
+0
-9
VersionInfo.js
src/sidebar/components/VersionInfo.js
+0
-7
No files found.
src/annotator/components/AdderToolbar.js
View file @
8986c475
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
propTypes
from
'prop-types'
;
import
{
useShortcut
}
from
'../../shared/shortcut'
;
import
{
useShortcut
}
from
'../../shared/shortcut'
;
...
@@ -33,14 +32,6 @@ function ToolbarButton({ badgeCount, icon, label, onClick, shortcut }) {
...
@@ -33,14 +32,6 @@ function ToolbarButton({ badgeCount, icon, label, onClick, shortcut }) {
);
);
}
}
ToolbarButton
.
propTypes
=
{
badgeCount
:
propTypes
.
number
,
icon
:
propTypes
.
string
,
label
:
propTypes
.
string
.
isRequired
,
onClick
:
propTypes
.
func
.
isRequired
,
shortcut
:
propTypes
.
string
,
};
/**
/**
* Union of possible toolbar commands.
* Union of possible toolbar commands.
*
*
...
@@ -132,10 +123,3 @@ export default function AdderToolbar({
...
@@ -132,10 +123,3 @@ export default function AdderToolbar({
<
/div
>
<
/div
>
);
);
}
}
AdderToolbar
.
propTypes
=
{
arrowDirection
:
propTypes
.
oneOf
([
'up'
,
'down'
]).
isRequired
,
isVisible
:
propTypes
.
bool
.
isRequired
,
onCommand
:
propTypes
.
func
.
isRequired
,
annotationCount
:
propTypes
.
number
,
};
src/annotator/components/Buckets.js
View file @
8986c475
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
propTypes
from
'prop-types'
;
import
scrollIntoView
from
'scroll-into-view'
;
import
scrollIntoView
from
'scroll-into-view'
;
import
{
setHighlightsFocused
}
from
'../highlighter'
;
import
{
setHighlightsFocused
}
from
'../highlighter'
;
...
@@ -48,11 +47,6 @@ function BucketButton({ bucket, onSelectAnnotations }) {
...
@@ -48,11 +47,6 @@ function BucketButton({ bucket, onSelectAnnotations }) {
);
);
}
}
BucketButton
.
propTypes
=
{
bucket
:
propTypes
.
object
.
isRequired
,
onSelectAnnotations
:
propTypes
.
func
.
isRequired
,
};
/**
/**
* An up- or down-pointing button that will scroll to the next closest bucket
* An up- or down-pointing button that will scroll to the next closest bucket
* of annotations in the given direction.
* of annotations in the given direction.
...
@@ -83,11 +77,6 @@ function NavigationBucketButton({ bucket, direction }) {
...
@@ -83,11 +77,6 @@ function NavigationBucketButton({ bucket, direction }) {
);
);
}
}
NavigationBucketButton
.
propTypes
=
{
bucket
:
propTypes
.
object
.
isRequired
,
direction
:
propTypes
.
string
,
};
/**
/**
* A list of buckets, including up and down navigation (when applicable) and
* A list of buckets, including up and down navigation (when applicable) and
* on-screen buckets
* on-screen buckets
...
@@ -134,10 +123,3 @@ export default function Buckets({
...
@@ -134,10 +123,3 @@ export default function Buckets({
<
/ul
>
<
/ul
>
);
);
}
}
Buckets
.
propTypes
=
{
above
:
propTypes
.
object
.
isRequired
,
below
:
propTypes
.
object
.
isRequired
,
buckets
:
propTypes
.
array
.
isRequired
,
onSelectAnnotations
:
propTypes
.
func
.
isRequired
,
};
src/annotator/components/Toolbar.js
View file @
8986c475
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
propTypes
from
'prop-types'
;
/**
/**
* @param {Object} props
* @param {Object} props
...
@@ -42,16 +41,6 @@ function ToolbarButton({
...
@@ -42,16 +41,6 @@ function ToolbarButton({
);
);
}
}
ToolbarButton
.
propTypes
=
{
buttonRef
:
propTypes
.
any
,
expanded
:
propTypes
.
bool
,
className
:
propTypes
.
string
,
label
:
propTypes
.
string
.
isRequired
,
icon
:
propTypes
.
string
.
isRequired
,
onClick
:
propTypes
.
func
.
isRequired
,
selected
:
propTypes
.
bool
,
};
/**
/**
* @typedef ToolbarProps
* @typedef ToolbarProps
*
*
...
@@ -137,15 +126,3 @@ export default function Toolbar({
...
@@ -137,15 +126,3 @@ export default function Toolbar({
<
/div
>
<
/div
>
);
);
}
}
Toolbar
.
propTypes
=
{
closeSidebar
:
propTypes
.
func
.
isRequired
,
createAnnotation
:
propTypes
.
func
.
isRequired
,
isSidebarOpen
:
propTypes
.
bool
.
isRequired
,
newAnnotationType
:
propTypes
.
oneOf
([
'annotation'
,
'note'
]).
isRequired
,
showHighlights
:
propTypes
.
bool
.
isRequired
,
toggleHighlights
:
propTypes
.
func
.
isRequired
,
toggleSidebar
:
propTypes
.
func
.
isRequired
,
toggleSidebarRef
:
propTypes
.
any
,
useMinimalControls
:
propTypes
.
bool
,
};
src/sidebar/components/Annotation/Annotation.js
View file @
8986c475
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../../store/use-store'
;
import
{
useStoreProxy
}
from
'../../store/use-store'
;
import
{
quote
}
from
'../../helpers/annotation-metadata'
;
import
{
quote
}
from
'../../helpers/annotation-metadata'
;
...
@@ -121,16 +120,6 @@ function Annotation({
...
@@ -121,16 +120,6 @@ function Annotation({
);
);
}
}
Annotation
.
propTypes
=
{
annotation
:
propTypes
.
object
,
hasAppliedFilter
:
propTypes
.
bool
.
isRequired
,
isReply
:
propTypes
.
bool
,
onToggleReplies
:
propTypes
.
func
,
replyCount
:
propTypes
.
number
.
isRequired
,
threadIsCollapsed
:
propTypes
.
bool
.
isRequired
,
annotationsService
:
propTypes
.
object
.
isRequired
,
};
Annotation
.
injectedProps
=
[
'annotationsService'
];
Annotation
.
injectedProps
=
[
'annotationsService'
];
export
default
withServices
(
Annotation
);
export
default
withServices
(
Annotation
);
src/sidebar/components/Annotation/AnnotationActionBar.js
View file @
8986c475
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../../store/use-store'
;
import
{
useStoreProxy
}
from
'../../store/use-store'
;
import
{
import
{
sharingEnabled
,
sharingEnabled
,
...
@@ -121,14 +119,6 @@ function AnnotationActionBar({
...
@@ -121,14 +119,6 @@ function AnnotationActionBar({
);
);
}
}
AnnotationActionBar
.
propTypes
=
{
annotation
:
propTypes
.
object
.
isRequired
,
onReply
:
propTypes
.
func
.
isRequired
,
annotationsService
:
propTypes
.
object
.
isRequired
,
settings
:
propTypes
.
object
.
isRequired
,
toastMessenger
:
propTypes
.
object
.
isRequired
,
};
AnnotationActionBar
.
injectedProps
=
[
AnnotationActionBar
.
injectedProps
=
[
'annotationsService'
,
'annotationsService'
,
'settings'
,
'settings'
,
...
...
src/sidebar/components/Annotation/AnnotationBody.js
View file @
8986c475
import
{
useState
}
from
'preact/hooks'
;
import
{
useState
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../../store/use-store'
;
import
{
useStoreProxy
}
from
'../../store/use-store'
;
import
{
isHidden
}
from
'../../helpers/annotation-metadata'
;
import
{
isHidden
}
from
'../../helpers/annotation-metadata'
;
...
@@ -90,11 +89,6 @@ function AnnotationBody({ annotation, settings }) {
...
@@ -90,11 +89,6 @@ function AnnotationBody({ annotation, settings }) {
);
);
}
}
AnnotationBody
.
propTypes
=
{
annotation
:
propTypes
.
object
.
isRequired
,
settings
:
propTypes
.
object
,
};
AnnotationBody
.
injectedProps
=
[
'settings'
];
AnnotationBody
.
injectedProps
=
[
'settings'
];
export
default
withServices
(
AnnotationBody
);
export
default
withServices
(
AnnotationBody
);
src/sidebar/components/Annotation/AnnotationDocumentInfo.js
View file @
8986c475
import
propTypes
from
'prop-types'
;
/** @typedef {import("../../../types/api").Annotation} Annotation */
/** @typedef {import("../../../types/api").Annotation} Annotation */
/**
/**
...
@@ -33,9 +31,3 @@ export default function AnnotationDocumentInfo({ domain, link, title }) {
...
@@ -33,9 +31,3 @@ export default function AnnotationDocumentInfo({ domain, link, title }) {
<
/div
>
<
/div
>
);
);
}
}
AnnotationDocumentInfo
.
propTypes
=
{
domain
:
propTypes
.
string
,
link
:
propTypes
.
string
,
title
:
propTypes
.
string
.
isRequired
,
};
src/sidebar/components/Annotation/AnnotationEditor.js
View file @
8986c475
import
{
normalizeKeyName
}
from
'@hypothesis/frontend-shared'
;
import
{
normalizeKeyName
}
from
'@hypothesis/frontend-shared'
;
import
{
useState
}
from
'preact/hooks'
;
import
{
useState
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
{
withServices
}
from
'../../service-context'
;
import
{
withServices
}
from
'../../service-context'
;
import
{
applyTheme
}
from
'../../helpers/theme'
;
import
{
applyTheme
}
from
'../../helpers/theme'
;
...
@@ -158,14 +157,6 @@ function AnnotationEditor({
...
@@ -158,14 +157,6 @@ function AnnotationEditor({
);
);
}
}
AnnotationEditor
.
propTypes
=
{
annotation
:
propTypes
.
object
.
isRequired
,
annotationsService
:
propTypes
.
object
,
settings
:
propTypes
.
object
,
tags
:
propTypes
.
object
.
isRequired
,
toastMessenger
:
propTypes
.
object
,
};
AnnotationEditor
.
injectedProps
=
[
AnnotationEditor
.
injectedProps
=
[
'annotationsService'
,
'annotationsService'
,
'settings'
,
'settings'
,
...
...
src/sidebar/components/Annotation/AnnotationHeader.js
View file @
8986c475
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
useMemo
}
from
'preact/hooks'
;
import
{
useMemo
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../../store/use-store'
;
import
{
useStoreProxy
}
from
'../../store/use-store'
;
import
{
import
{
...
@@ -144,10 +143,3 @@ export default function AnnotationHeader({
...
@@ -144,10 +143,3 @@ export default function AnnotationHeader({
<
/header
>
<
/header
>
);
);
}
}
AnnotationHeader
.
propTypes
=
{
annotation
:
propTypes
.
object
.
isRequired
,
isEditing
:
propTypes
.
bool
,
replyCount
:
propTypes
.
number
,
threadIsCollapsed
:
propTypes
.
bool
.
isRequired
,
};
src/sidebar/components/Annotation/AnnotationLicense.js
View file @
8986c475
...
@@ -22,5 +22,3 @@ export default function AnnotationLicense() {
...
@@ -22,5 +22,3 @@ export default function AnnotationLicense() {
<
/div
>
<
/div
>
);
);
}
}
AnnotationLicense
.
propTypes
=
{};
src/sidebar/components/Annotation/AnnotationPublishControl.js
View file @
8986c475
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../../store/use-store'
;
import
{
useStoreProxy
}
from
'../../store/use-store'
;
import
{
isNew
,
isReply
}
from
'../../helpers/annotation-metadata'
;
import
{
isNew
,
isReply
}
from
'../../helpers/annotation-metadata'
;
...
@@ -132,13 +131,6 @@ function AnnotationPublishControl({
...
@@ -132,13 +131,6 @@ function AnnotationPublishControl({
);
);
}
}
AnnotationPublishControl
.
propTypes
=
{
annotation
:
propTypes
.
object
.
isRequired
,
isDisabled
:
propTypes
.
bool
,
onSave
:
propTypes
.
func
.
isRequired
,
settings
:
propTypes
.
object
.
isRequired
,
};
AnnotationPublishControl
.
injectedProps
=
[
'settings'
];
AnnotationPublishControl
.
injectedProps
=
[
'settings'
];
export
default
withServices
(
AnnotationPublishControl
);
export
default
withServices
(
AnnotationPublishControl
);
src/sidebar/components/Annotation/AnnotationQuote.js
View file @
8986c475
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
propTypes
from
'prop-types'
;
import
{
isOrphan
,
quote
}
from
'../../helpers/annotation-metadata'
;
import
{
isOrphan
,
quote
}
from
'../../helpers/annotation-metadata'
;
import
{
withServices
}
from
'../../service-context'
;
import
{
withServices
}
from
'../../service-context'
;
...
@@ -61,12 +60,6 @@ function AnnotationQuote({ annotation, isFocused, settings = {} }) {
...
@@ -61,12 +60,6 @@ function AnnotationQuote({ annotation, isFocused, settings = {} }) {
);
);
}
}
AnnotationQuote
.
propTypes
=
{
annotation
:
propTypes
.
object
.
isRequired
,
isFocused
:
propTypes
.
bool
,
settings
:
propTypes
.
object
,
};
AnnotationQuote
.
injectedProps
=
[
'settings'
];
AnnotationQuote
.
injectedProps
=
[
'settings'
];
export
default
withServices
(
AnnotationQuote
);
export
default
withServices
(
AnnotationQuote
);
src/sidebar/components/Annotation/AnnotationReplyToggle.js
View file @
8986c475
import
propTypes
from
'prop-types'
;
import
Button
from
'../Button'
;
import
Button
from
'../Button'
;
/**
/**
...
@@ -32,10 +30,4 @@ function AnnotationReplyToggle({
...
@@ -32,10 +30,4 @@ function AnnotationReplyToggle({
);
);
}
}
AnnotationReplyToggle
.
propTypes
=
{
onToggleReplies
:
propTypes
.
func
,
replyCount
:
propTypes
.
number
,
threadIsCollapsed
:
propTypes
.
bool
.
isRequired
,
};
export
default
AnnotationReplyToggle
;
export
default
AnnotationReplyToggle
;
src/sidebar/components/Annotation/AnnotationShareControl.js
View file @
8986c475
import
{
SvgIcon
,
useElementShouldClose
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
,
useElementShouldClose
}
from
'@hypothesis/frontend-shared'
;
import
{
useEffect
,
useRef
,
useState
}
from
'preact/hooks'
;
import
{
useEffect
,
useRef
,
useState
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
{
isShareableURI
}
from
'../../helpers/annotation-sharing'
;
import
{
isShareableURI
}
from
'../../helpers/annotation-sharing'
;
import
{
copyText
}
from
'../../util/copy-to-clipboard'
;
import
{
copyText
}
from
'../../util/copy-to-clipboard'
;
...
@@ -181,14 +180,6 @@ function AnnotationShareControl({
...
@@ -181,14 +180,6 @@ function AnnotationShareControl({
);
);
}
}
AnnotationShareControl
.
propTypes
=
{
annotation
:
propTypes
.
object
.
isRequired
,
group
:
propTypes
.
object
,
shareUri
:
propTypes
.
string
.
isRequired
,
analytics
:
propTypes
.
object
.
isRequired
,
toastMessenger
:
propTypes
.
object
.
isRequired
,
};
AnnotationShareControl
.
injectedProps
=
[
'analytics'
,
'toastMessenger'
];
AnnotationShareControl
.
injectedProps
=
[
'analytics'
,
'toastMessenger'
];
export
default
withServices
(
AnnotationShareControl
);
export
default
withServices
(
AnnotationShareControl
);
src/sidebar/components/Annotation/AnnotationShareInfo.js
View file @
8986c475
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../../store/use-store'
;
import
{
useStoreProxy
}
from
'../../store/use-store'
;
import
{
isPrivate
}
from
'../../helpers/permissions'
;
import
{
isPrivate
}
from
'../../helpers/permissions'
;
...
@@ -56,8 +55,4 @@ function AnnotationShareInfo({ annotation }) {
...
@@ -56,8 +55,4 @@ function AnnotationShareInfo({ annotation }) {
);
);
}
}
AnnotationShareInfo
.
propTypes
=
{
annotation
:
propTypes
.
object
.
isRequired
,
};
export
default
AnnotationShareInfo
;
export
default
AnnotationShareInfo
;
src/sidebar/components/Annotation/AnnotationTimestamps.js
View file @
8986c475
import
{
useEffect
,
useMemo
,
useState
}
from
'preact/hooks'
;
import
{
useEffect
,
useMemo
,
useState
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
{
format
as
formatDate
}
from
'../../util/date'
;
import
{
format
as
formatDate
}
from
'../../util/date'
;
import
{
decayingInterval
,
toFuzzyString
}
from
'../../util/time'
;
import
{
decayingInterval
,
toFuzzyString
}
from
'../../util/time'
;
...
@@ -108,10 +107,3 @@ export default function AnnotationTimestamps({
...
@@ -108,10 +107,3 @@ export default function AnnotationTimestamps({
<
/div
>
<
/div
>
);
);
}
}
AnnotationTimestamps
.
propTypes
=
{
annotationCreated
:
propTypes
.
string
,
annotationUpdated
:
propTypes
.
string
,
annotationUrl
:
propTypes
.
string
,
withEditedTimestamp
:
propTypes
.
bool
,
};
src/sidebar/components/Annotation/AnnotationUser.js
View file @
8986c475
import
propTypes
from
'prop-types'
;
import
{
isThirdPartyUser
,
username
}
from
'../../helpers/account-id'
;
import
{
isThirdPartyUser
,
username
}
from
'../../helpers/account-id'
;
import
{
withServices
}
from
'../../service-context'
;
import
{
withServices
}
from
'../../service-context'
;
...
@@ -67,12 +65,6 @@ function AnnotationUser({ annotation, features, serviceUrl, settings }) {
...
@@ -67,12 +65,6 @@ function AnnotationUser({ annotation, features, serviceUrl, settings }) {
);
);
}
}
AnnotationUser
.
propTypes
=
{
annotation
:
propTypes
.
object
.
isRequired
,
features
:
propTypes
.
object
.
isRequired
,
serviceUrl
:
propTypes
.
func
.
isRequired
,
settings
:
propTypes
.
object
.
isRequired
,
};
AnnotationUser
.
injectedProps
=
[
'features'
,
'serviceUrl'
,
'settings'
];
AnnotationUser
.
injectedProps
=
[
'features'
,
'serviceUrl'
,
'settings'
];
export
default
withServices
(
AnnotationUser
);
export
default
withServices
(
AnnotationUser
);
src/sidebar/components/AnnotationView.js
View file @
8986c475
import
{
useEffect
,
useState
}
from
'preact/hooks'
;
import
{
useEffect
,
useState
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
withServices
}
from
'../service-context'
;
import
{
withServices
}
from
'../service-context'
;
...
@@ -93,11 +92,6 @@ function AnnotationView({ loadAnnotationsService, onLogin }) {
...
@@ -93,11 +92,6 @@ function AnnotationView({ loadAnnotationsService, onLogin }) {
);
);
}
}
AnnotationView
.
propTypes
=
{
onLogin
:
propTypes
.
func
.
isRequired
,
loadAnnotationsService
:
propTypes
.
object
,
};
AnnotationView
.
injectedProps
=
[
'loadAnnotationsService'
];
AnnotationView
.
injectedProps
=
[
'loadAnnotationsService'
];
export
default
withServices
(
AnnotationView
);
export
default
withServices
(
AnnotationView
);
src/sidebar/components/AutocompleteList.js
View file @
8986c475
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
{
useMemo
}
from
'preact/hooks'
;
import
{
useMemo
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
const
defaultListFormatter
=
item
=>
item
;
const
defaultListFormatter
=
item
=>
item
;
...
@@ -95,13 +94,3 @@ export default function AutocompleteList({
...
@@ -95,13 +94,3 @@ export default function AutocompleteList({
<
/div
>
<
/div
>
);
);
}
}
AutocompleteList
.
propTypes
=
{
activeItem
:
propTypes
.
number
,
id
:
propTypes
.
string
,
itemPrefixId
:
propTypes
.
string
,
list
:
propTypes
.
array
.
isRequired
,
listFormatter
:
propTypes
.
func
,
onSelectItem
:
propTypes
.
func
.
isRequired
,
open
:
propTypes
.
bool
,
};
src/sidebar/components/Button.js
View file @
8986c475
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
propTypes
from
'prop-types'
;
/**
/**
* @typedef ButtonProps
* @typedef ButtonProps
...
@@ -87,36 +86,3 @@ export default function Button({
...
@@ -87,36 +86,3 @@ export default function Button({
<
/button
>
<
/button
>
);
);
}
}
/**
* Validation callback for `propTypes`. The given `propName` is conditionally
* required depending on the presence or absence of the `buttonText` property. Return
* an `Error` on validation failure, per propTypes API.
*
* @return {Error|undefined}
*/
function
requiredStringIfButtonTextMissing
(
props
,
propName
,
componentName
)
{
if
(
typeof
props
.
buttonText
!==
'string'
&&
typeof
props
[
propName
]
!==
'string'
)
{
return
new
Error
(
`string property '
${
propName
}
' must be supplied to component '
${
componentName
}
'\
if string property 'buttonText' omitted`
);
}
return
undefined
;
}
Button
.
propTypes
=
{
buttonText
:
propTypes
.
string
,
className
:
propTypes
.
string
,
icon
:
requiredStringIfButtonTextMissing
,
iconPosition
:
propTypes
.
string
,
isExpanded
:
propTypes
.
bool
,
isPressed
:
propTypes
.
bool
,
onClick
:
propTypes
.
func
,
disabled
:
propTypes
.
bool
,
style
:
propTypes
.
object
,
title
:
requiredStringIfButtonTextMissing
,
};
src/sidebar/components/Excerpt.js
View file @
8986c475
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
{
useCallback
,
useLayoutEffect
,
useRef
,
useState
}
from
'preact/hooks'
;
import
{
useCallback
,
useLayoutEffect
,
useRef
,
useState
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
observeElementSize
from
'../util/observe-element-size'
;
import
observeElementSize
from
'../util/observe-element-size'
;
import
{
withServices
}
from
'../service-context'
;
import
{
withServices
}
from
'../service-context'
;
...
@@ -39,12 +38,6 @@ function InlineControls({ isCollapsed, setCollapsed, linkStyle = {} }) {
...
@@ -39,12 +38,6 @@ function InlineControls({ isCollapsed, setCollapsed, linkStyle = {} }) {
);
);
}
}
InlineControls
.
propTypes
=
{
isCollapsed
:
propTypes
.
bool
,
setCollapsed
:
propTypes
.
func
,
linkStyle
:
propTypes
.
object
,
};
const
noop
=
()
=>
{};
const
noop
=
()
=>
{};
/**
/**
...
@@ -163,17 +156,6 @@ function Excerpt({
...
@@ -163,17 +156,6 @@ function Excerpt({
);
);
}
}
Excerpt
.
propTypes
=
{
children
:
propTypes
.
object
,
inlineControls
:
propTypes
.
bool
,
collapse
:
propTypes
.
bool
,
collapsedHeight
:
propTypes
.
number
,
overflowThreshold
:
propTypes
.
number
,
onCollapsibleChanged
:
propTypes
.
func
,
onToggleCollapsed
:
propTypes
.
func
,
settings
:
propTypes
.
object
,
};
Excerpt
.
injectedProps
=
[
'settings'
];
Excerpt
.
injectedProps
=
[
'settings'
];
export
default
withServices
(
Excerpt
);
export
default
withServices
(
Excerpt
);
src/sidebar/components/FilterSelect.js
View file @
8986c475
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
propTypes
from
'prop-types'
;
import
Menu
from
'./Menu'
;
import
Menu
from
'./Menu'
;
import
MenuItem
from
'./MenuItem'
;
import
MenuItem
from
'./MenuItem'
;
...
@@ -56,13 +55,4 @@ function FilterSelect({
...
@@ -56,13 +55,4 @@ function FilterSelect({
);
);
}
}
FilterSelect
.
propTypes
=
{
defaultOption
:
propTypes
.
object
,
icon
:
propTypes
.
string
,
onSelect
:
propTypes
.
func
,
options
:
propTypes
.
array
,
selectedOption
:
propTypes
.
object
,
title
:
propTypes
.
string
,
};
export
default
FilterSelect
;
export
default
FilterSelect
;
src/sidebar/components/FilterStatus.js
View file @
8986c475
import
{
useMemo
}
from
'preact/hooks'
;
import
{
useMemo
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
{
countVisible
}
from
'../helpers/thread'
;
import
{
countVisible
}
from
'../helpers/thread'
;
...
@@ -104,16 +103,6 @@ function FilterStatusPanel({
...
@@ -104,16 +103,6 @@ function FilterStatusPanel({
);
);
}
}
FilterStatusPanel
.
propTypes
=
{
resultCount
:
propTypes
.
number
.
isRequired
,
actionButton
:
propTypes
.
object
.
isRequired
,
additionalCount
:
propTypes
.
number
,
entitySingular
:
propTypes
.
string
,
entityPlural
:
propTypes
.
string
,
filterQuery
:
propTypes
.
string
,
focusDisplayName
:
propTypes
.
string
,
};
/**
/**
* This status is used when there are selected annotations (including direct-
* This status is used when there are selected annotations (including direct-
* linked annotations). This status takes precedence over others.
* linked annotations). This status takes precedence over others.
...
@@ -165,11 +154,6 @@ function SelectionFilterStatus({ filterState, rootThread }) {
...
@@ -165,11 +154,6 @@ function SelectionFilterStatus({ filterState, rootThread }) {
);
);
}
}
SelectionFilterStatus
.
propTypes
=
{
filterState
:
propTypes
.
object
.
isRequired
,
rootThread
:
propTypes
.
object
.
isRequired
,
};
/**
/**
* This status is used when there is an applied filter query and
* This status is used when there is an applied filter query and
* `SelectionFilterStatus` does not apply.
* `SelectionFilterStatus` does not apply.
...
@@ -210,11 +194,6 @@ function QueryFilterStatus({ filterState, rootThread }) {
...
@@ -210,11 +194,6 @@ function QueryFilterStatus({ filterState, rootThread }) {
);
);
}
}
QueryFilterStatus
.
propTypes
=
{
filterState
:
propTypes
.
object
.
isRequired
,
rootThread
:
propTypes
.
object
.
isRequired
,
};
/**
/**
* This status is used if user-focus mode is configured and neither
* This status is used if user-focus mode is configured and neither
* `SelectionFilterStatus` nor `QueryFilterStatus` apply.
* `SelectionFilterStatus` nor `QueryFilterStatus` apply.
...
@@ -263,11 +242,6 @@ function FocusFilterStatus({ filterState, rootThread }) {
...
@@ -263,11 +242,6 @@ function FocusFilterStatus({ filterState, rootThread }) {
);
);
}
}
FocusFilterStatus
.
propTypes
=
{
filterState
:
propTypes
.
object
.
isRequired
,
rootThread
:
propTypes
.
object
.
isRequired
,
};
/**
/**
* Determine which (if any) of the filter status variants to render depending
* Determine which (if any) of the filter status variants to render depending
* on current `filterState`. Only one filter status panel is displayed at a time:
* on current `filterState`. Only one filter status panel is displayed at a time:
...
@@ -313,5 +287,3 @@ export default function FilterStatus() {
...
@@ -313,5 +287,3 @@ export default function FilterStatus() {
}
}
return
null
;
return
null
;
}
}
FilterStatus
.
propTypes
=
{};
src/sidebar/components/GroupList.js
View file @
8986c475
import
{
useMemo
,
useState
}
from
'preact/hooks'
;
import
{
useMemo
,
useState
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
serviceConfig
from
'../config/service-config'
;
import
serviceConfig
from
'../config/service-config'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
...
@@ -149,11 +148,6 @@ function GroupList({ serviceUrl, settings }) {
...
@@ -149,11 +148,6 @@ function GroupList({ serviceUrl, settings }) {
);
);
}
}
GroupList
.
propTypes
=
{
serviceUrl
:
propTypes
.
func
,
settings
:
propTypes
.
object
,
};
GroupList
.
injectedProps
=
[
'serviceUrl'
,
'settings'
];
GroupList
.
injectedProps
=
[
'serviceUrl'
,
'settings'
];
export
default
withServices
(
GroupList
);
export
default
withServices
(
GroupList
);
src/sidebar/components/GroupListItem.js
View file @
8986c475
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
copyText
}
from
'../util/copy-to-clipboard'
;
import
{
copyText
}
from
'../util/copy-to-clipboard'
;
import
{
orgName
}
from
'../helpers/group-list-item-common'
;
import
{
orgName
}
from
'../helpers/group-list-item-common'
;
...
@@ -148,15 +146,6 @@ function GroupListItem({
...
@@ -148,15 +146,6 @@ function GroupListItem({
);
);
}
}
GroupListItem
.
propTypes
=
{
group
:
propTypes
.
object
.
isRequired
,
isExpanded
:
propTypes
.
bool
,
onExpand
:
propTypes
.
func
,
analytics
:
propTypes
.
object
.
isRequired
,
groups
:
propTypes
.
object
.
isRequired
,
toastMessenger
:
propTypes
.
object
.
isRequired
,
};
GroupListItem
.
injectedProps
=
[
'analytics'
,
'groups'
,
'toastMessenger'
];
GroupListItem
.
injectedProps
=
[
'analytics'
,
'groups'
,
'toastMessenger'
];
export
default
withServices
(
GroupListItem
);
export
default
withServices
(
GroupListItem
);
src/sidebar/components/GroupListSection.js
View file @
8986c475
import
propTypes
from
'prop-types'
;
import
GroupListItem
from
'./GroupListItem'
;
import
GroupListItem
from
'./GroupListItem'
;
import
MenuSection
from
'./MenuSection'
;
import
MenuSection
from
'./MenuSection'
;
...
@@ -42,10 +40,3 @@ export default function GroupListSection({
...
@@ -42,10 +40,3 @@ export default function GroupListSection({
<
/MenuSection
>
<
/MenuSection
>
);
);
}
}
GroupListSection
.
propTypes
=
{
expandedGroup
:
propTypes
.
object
,
groups
:
propTypes
.
arrayOf
(
propTypes
.
object
),
heading
:
propTypes
.
string
,
onExpandGroup
:
propTypes
.
func
,
};
src/sidebar/components/HelpPanel.js
View file @
8986c475
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
useCallback
,
useMemo
,
useState
}
from
'preact/hooks'
;
import
{
useCallback
,
useMemo
,
useState
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
withServices
}
from
'../service-context'
;
import
{
withServices
}
from
'../service-context'
;
...
@@ -41,11 +40,6 @@ function HelpPanelTab({ linkText, url }) {
...
@@ -41,11 +40,6 @@ function HelpPanelTab({ linkText, url }) {
);
);
}
}
HelpPanelTab
.
propTypes
=
{
linkText
:
propTypes
.
string
.
isRequired
,
url
:
propTypes
.
string
.
isRequired
,
};
/**
/**
* @typedef HelpPanelProps
* @typedef HelpPanelProps
* @prop {AuthState} auth - Object with auth and user information
* @prop {AuthState} auth - Object with auth and user information
...
@@ -160,10 +154,6 @@ function HelpPanel({ auth, session }) {
...
@@ -160,10 +154,6 @@ function HelpPanel({ auth, session }) {
);
);
}
}
HelpPanel
.
propTypes
=
{
auth
:
propTypes
.
object
.
isRequired
,
session
:
propTypes
.
object
.
isRequired
,
};
HelpPanel
.
injectedProps
=
[
'session'
];
HelpPanel
.
injectedProps
=
[
'session'
];
export
default
withServices
(
HelpPanel
);
export
default
withServices
(
HelpPanel
);
src/sidebar/components/HypothesisApp.js
View file @
8986c475
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
{
useEffect
,
useMemo
}
from
'preact/hooks'
;
import
{
useEffect
,
useMemo
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
bridgeEvents
from
'../../shared/bridge-events'
;
import
bridgeEvents
from
'../../shared/bridge-events'
;
import
serviceConfig
from
'../config/service-config'
;
import
serviceConfig
from
'../config/service-config'
;
...
@@ -201,15 +200,6 @@ function HypothesisApp({
...
@@ -201,15 +200,6 @@ function HypothesisApp({
);
);
}
}
HypothesisApp
.
propTypes
=
{
auth
:
propTypes
.
object
,
bridge
:
propTypes
.
object
,
serviceUrl
:
propTypes
.
func
,
settings
:
propTypes
.
object
,
session
:
propTypes
.
object
,
toastMessenger
:
propTypes
.
object
,
};
HypothesisApp
.
injectedProps
=
[
HypothesisApp
.
injectedProps
=
[
'auth'
,
'auth'
,
'bridge'
,
'bridge'
,
...
...
src/sidebar/components/LoggedOutMessage.js
View file @
8986c475
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
propTypes
from
'prop-types'
;
import
{
withServices
}
from
'../service-context'
;
import
{
withServices
}
from
'../service-context'
;
...
@@ -55,11 +54,6 @@ function LoggedOutMessage({ onLogin, serviceUrl }) {
...
@@ -55,11 +54,6 @@ function LoggedOutMessage({ onLogin, serviceUrl }) {
);
);
}
}
LoggedOutMessage
.
propTypes
=
{
onLogin
:
propTypes
.
func
.
isRequired
,
serviceUrl
:
propTypes
.
func
.
isRequired
,
};
LoggedOutMessage
.
injectedProps
=
[
'serviceUrl'
];
LoggedOutMessage
.
injectedProps
=
[
'serviceUrl'
];
export
default
withServices
(
LoggedOutMessage
);
export
default
withServices
(
LoggedOutMessage
);
src/sidebar/components/LoginPromptPanel.js
View file @
8986c475
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
Button
from
'./Button'
;
import
Button
from
'./Button'
;
...
@@ -44,8 +42,3 @@ export default function LoginPromptPanel({ onLogin, onSignUp }) {
...
@@ -44,8 +42,3 @@ export default function LoginPromptPanel({ onLogin, onSignUp }) {
<
/SidebarPanel
>
<
/SidebarPanel
>
);
);
}
}
LoginPromptPanel
.
propTypes
=
{
onLogin
:
propTypes
.
func
.
isRequired
,
onSignUp
:
propTypes
.
func
.
isRequired
,
};
src/sidebar/components/MarkdownEditor.js
View file @
8986c475
...
@@ -2,7 +2,6 @@ import classnames from 'classnames';
...
@@ -2,7 +2,6 @@ import classnames from 'classnames';
import
{
SvgIcon
,
normalizeKeyName
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
,
normalizeKeyName
}
from
'@hypothesis/frontend-shared'
;
import
{
createRef
}
from
'preact'
;
import
{
createRef
}
from
'preact'
;
import
{
useEffect
,
useMemo
,
useRef
,
useState
}
from
'preact/hooks'
;
import
{
useEffect
,
useMemo
,
useRef
,
useState
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
{
import
{
LinkType
,
LinkType
,
...
@@ -147,17 +146,6 @@ function ToolbarButton({
...
@@ -147,17 +146,6 @@ function ToolbarButton({
);
);
}
}
ToolbarButton
.
propTypes
=
{
buttonRef
:
propTypes
.
object
.
isRequired
,
disabled
:
propTypes
.
bool
,
iconName
:
propTypes
.
string
,
label
:
propTypes
.
string
,
onClick
:
propTypes
.
func
.
isRequired
,
shortcutKey
:
propTypes
.
string
,
tabIndex
:
propTypes
.
number
.
isRequired
,
title
:
propTypes
.
string
,
};
/**
/**
* @typedef {'bold'|'italic'|'quote'|'link'|'image'|'math'|'numlist'|'list'|'preview'|'help'} ButtonID
* @typedef {'bold'|'italic'|'quote'|'link'|'image'|'math'|'numlist'|'list'|'preview'|'help'} ButtonID
*/
*/
...
@@ -383,12 +371,6 @@ function Toolbar({ isPreviewing, onCommand, onTogglePreview }) {
...
@@ -383,12 +371,6 @@ function Toolbar({ isPreviewing, onCommand, onTogglePreview }) {
);
);
}
}
Toolbar
.
propTypes
=
{
isPreviewing
:
propTypes
.
bool
,
onCommand
:
propTypes
.
func
,
onTogglePreview
:
propTypes
.
func
,
};
/**
/**
* @typedef MarkdownEditorProps
* @typedef MarkdownEditorProps
* @prop {string} label - An accessible label for the input field.
* @prop {string} label - An accessible label for the input field.
...
@@ -478,10 +460,3 @@ export default function MarkdownEditor({
...
@@ -478,10 +460,3 @@ export default function MarkdownEditor({
<
/div
>
<
/div
>
);
);
}
}
MarkdownEditor
.
propTypes
=
{
textStyle
:
propTypes
.
object
,
label
:
propTypes
.
string
.
isRequired
,
text
:
propTypes
.
string
,
onEditText
:
propTypes
.
func
,
};
src/sidebar/components/MarkdownView.js
View file @
8986c475
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
{
useEffect
,
useMemo
,
useRef
}
from
'preact/hooks'
;
import
{
useEffect
,
useMemo
,
useRef
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
{
replaceLinksWithEmbeds
}
from
'../media-embedder'
;
import
{
replaceLinksWithEmbeds
}
from
'../media-embedder'
;
import
renderMarkdown
from
'../render-markdown'
;
import
renderMarkdown
from
'../render-markdown'
;
...
@@ -52,9 +51,3 @@ export default function MarkdownView({
...
@@ -52,9 +51,3 @@ export default function MarkdownView({
/
>
/
>
);
);
}
}
MarkdownView
.
propTypes
=
{
markdown
:
propTypes
.
string
,
textClass
:
propTypes
.
object
,
textStyle
:
propTypes
.
object
,
};
src/sidebar/components/Menu.js
View file @
8986c475
...
@@ -5,7 +5,6 @@ import {
...
@@ -5,7 +5,6 @@ import {
useElementShouldClose
,
useElementShouldClose
,
}
from
'@hypothesis/frontend-shared'
;
}
from
'@hypothesis/frontend-shared'
;
import
{
useCallback
,
useEffect
,
useRef
,
useState
}
from
'preact/hooks'
;
import
{
useCallback
,
useEffect
,
useRef
,
useState
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
MenuKeyboardNavigation
from
'./MenuKeyboardNavigation'
;
import
MenuKeyboardNavigation
from
'./MenuKeyboardNavigation'
;
...
@@ -207,19 +206,3 @@ export default function Menu({
...
@@ -207,19 +206,3 @@ export default function Menu({
<
/div
>
<
/div
>
);
);
}
}
Menu
.
propTypes
=
{
align
:
propTypes
.
oneOf
([
'left'
,
'right'
]),
arrowClass
:
propTypes
.
string
,
label
:
propTypes
.
oneOfType
([
propTypes
.
object
.
isRequired
,
propTypes
.
string
.
isRequired
,
]),
children
:
propTypes
.
any
,
containerPositioned
:
propTypes
.
bool
,
contentClass
:
propTypes
.
string
,
defaultOpen
:
propTypes
.
bool
,
onOpenChanged
:
propTypes
.
func
,
title
:
propTypes
.
string
.
isRequired
,
menuIndicator
:
propTypes
.
bool
,
};
src/sidebar/components/MenuItem.js
View file @
8986c475
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
{
SvgIcon
,
normalizeKeyName
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
,
normalizeKeyName
}
from
'@hypothesis/frontend-shared'
;
import
{
useEffect
,
useRef
}
from
'preact/hooks'
;
import
{
useEffect
,
useRef
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
MenuKeyboardNavigation
from
'./MenuKeyboardNavigation'
;
import
MenuKeyboardNavigation
from
'./MenuKeyboardNavigation'
;
import
Slider
from
'./Slider'
;
import
Slider
from
'./Slider'
;
...
@@ -230,18 +229,3 @@ export default function MenuItem({
...
@@ -230,18 +229,3 @@ export default function MenuItem({
<
/
>
<
/
>
);
);
}
}
MenuItem
.
propTypes
=
{
href
:
propTypes
.
string
,
iconAlt
:
propTypes
.
string
,
icon
:
propTypes
.
string
,
isDisabled
:
propTypes
.
bool
,
isExpanded
:
propTypes
.
bool
,
isSelected
:
propTypes
.
bool
,
isSubmenuItem
:
propTypes
.
bool
,
isSubmenuVisible
:
propTypes
.
bool
,
label
:
propTypes
.
string
.
isRequired
,
onClick
:
propTypes
.
func
,
onToggleSubmenu
:
propTypes
.
func
,
submenu
:
propTypes
.
any
,
};
src/sidebar/components/MenuKeyboardNavigation.js
View file @
8986c475
import
{
normalizeKeyName
}
from
'@hypothesis/frontend-shared'
;
import
{
normalizeKeyName
}
from
'@hypothesis/frontend-shared'
;
import
{
useEffect
,
useRef
}
from
'preact/hooks'
;
import
{
useEffect
,
useRef
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
function
isElementVisible
(
element
)
{
function
isElementVisible
(
element
)
{
return
element
.
offsetParent
!==
null
;
return
element
.
offsetParent
!==
null
;
...
@@ -110,18 +109,3 @@ export default function MenuKeyboardNavigation({
...
@@ -110,18 +109,3 @@ export default function MenuKeyboardNavigation({
<
/div
>
<
/div
>
);
);
}
}
MenuKeyboardNavigation
.
propTypes
=
{
className
:
propTypes
.
string
,
// Callback when the menu is closed via keyboard input
closeMenu
:
propTypes
.
func
,
// When true`, sets focus on the first item in the list
// which has a role="menuitem" attribute.
visible
:
propTypes
.
bool
,
// Array of nodes which may contain <MenuItems> or any nodes
// that have role set to 'menuitem', 'menuitemradio', or 'menuitemcheckbox'
children
:
propTypes
.
any
.
isRequired
,
};
src/sidebar/components/MenuSection.js
View file @
8986c475
import
{
toChildArray
}
from
'preact'
;
import
{
toChildArray
}
from
'preact'
;
import
propTypes
from
'prop-types'
;
/** @typedef {import("preact").JSX.Element} JSXElement */
/** @typedef {import("preact").JSX.Element} JSXElement */
...
@@ -38,8 +37,3 @@ export default function MenuSection({ heading, children }) {
...
@@ -38,8 +37,3 @@ export default function MenuSection({ heading, children }) {
<
/
>
<
/
>
);
);
}
}
MenuSection
.
propTypes
=
{
heading
:
propTypes
.
string
,
children
:
propTypes
.
any
.
isRequired
,
};
src/sidebar/components/ModerationBanner.js
View file @
8986c475
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
*
as
annotationMetadata
from
'../helpers/annotation-metadata'
;
import
*
as
annotationMetadata
from
'../helpers/annotation-metadata'
;
...
@@ -97,12 +96,6 @@ function ModerationBanner({ annotation, api, toastMessenger }) {
...
@@ -97,12 +96,6 @@ function ModerationBanner({ annotation, api, toastMessenger }) {
);
);
}
}
ModerationBanner
.
propTypes
=
{
annotation
:
propTypes
.
object
.
isRequired
,
api
:
propTypes
.
object
.
isRequired
,
toastMessenger
:
propTypes
.
object
.
isRequired
,
};
ModerationBanner
.
injectedProps
=
[
'api'
,
'toastMessenger'
];
ModerationBanner
.
injectedProps
=
[
'api'
,
'toastMessenger'
];
export
default
withServices
(
ModerationBanner
);
export
default
withServices
(
ModerationBanner
);
src/sidebar/components/NewNoteBtn.js
View file @
8986c475
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
withServices
}
from
'../service-context'
;
import
{
withServices
}
from
'../service-context'
;
import
{
applyTheme
}
from
'../helpers/theme'
;
import
{
applyTheme
}
from
'../helpers/theme'
;
...
@@ -48,10 +46,6 @@ function NewNoteButton({ annotationsService, settings }) {
...
@@ -48,10 +46,6 @@ function NewNoteButton({ annotationsService, settings }) {
<
/div
>
<
/div
>
);
);
}
}
NewNoteButton
.
propTypes
=
{
annotationsService
:
propTypes
.
object
.
isRequired
,
settings
:
propTypes
.
object
.
isRequired
,
};
NewNoteButton
.
injectedProps
=
[
'annotationsService'
,
'settings'
];
NewNoteButton
.
injectedProps
=
[
'annotationsService'
,
'settings'
];
...
...
src/sidebar/components/NotebookFilters.js
View file @
8986c475
...
@@ -28,6 +28,4 @@ function NotebookFilters() {
...
@@ -28,6 +28,4 @@ function NotebookFilters() {
);
);
}
}
NotebookFilters
.
propTypes
=
{};
export
default
NotebookFilters
;
export
default
NotebookFilters
;
src/sidebar/components/NotebookResultCount.js
View file @
8986c475
import
propTypes
from
'prop-types'
;
import
useRootThread
from
'./hooks/use-root-thread'
;
import
useRootThread
from
'./hooks/use-root-thread'
;
import
{
countVisible
}
from
'../helpers/thread'
;
import
{
countVisible
}
from
'../helpers/thread'
;
...
@@ -67,11 +65,4 @@ function NotebookResultCount({
...
@@ -67,11 +65,4 @@ function NotebookResultCount({
);
);
}
}
NotebookResultCount
.
propTypes
=
{
forcedVisibleCount
:
propTypes
.
number
,
isFiltered
:
propTypes
.
bool
,
isLoading
:
propTypes
.
bool
,
resultCount
:
propTypes
.
number
,
};
export
default
NotebookResultCount
;
export
default
NotebookResultCount
;
src/sidebar/components/NotebookView.js
View file @
8986c475
import
{
useEffect
,
useLayoutEffect
,
useRef
,
useState
}
from
'preact/hooks'
;
import
{
useEffect
,
useLayoutEffect
,
useRef
,
useState
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
scrollIntoView
from
'scroll-into-view'
;
import
scrollIntoView
from
'scroll-into-view'
;
import
{
withServices
}
from
'../service-context'
;
import
{
withServices
}
from
'../service-context'
;
...
@@ -105,10 +104,6 @@ function NotebookView({ loadAnnotationsService }) {
...
@@ -105,10 +104,6 @@ function NotebookView({ loadAnnotationsService }) {
);
);
}
}
NotebookView
.
propTypes
=
{
loadAnnotationsService
:
propTypes
.
object
,
};
NotebookView
.
injectedProps
=
[
'loadAnnotationsService'
];
NotebookView
.
injectedProps
=
[
'loadAnnotationsService'
];
export
default
withServices
(
NotebookView
);
export
default
withServices
(
NotebookView
);
src/sidebar/components/PaginatedThreadList.js
View file @
8986c475
import
{
useMemo
}
from
'preact/hooks'
;
import
{
useMemo
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
{
countVisible
}
from
'../helpers/thread'
;
import
{
countVisible
}
from
'../helpers/thread'
;
...
@@ -57,12 +56,4 @@ function PaginatedThreadList({
...
@@ -57,12 +56,4 @@ function PaginatedThreadList({
);
);
}
}
PaginatedThreadList
.
propTypes
=
{
isLoading
:
propTypes
.
bool
,
threads
:
propTypes
.
array
,
currentPage
:
propTypes
.
number
,
onChangePage
:
propTypes
.
func
,
pageSize
:
propTypes
.
number
,
};
export
default
PaginatedThreadList
;
export
default
PaginatedThreadList
;
src/sidebar/components/PaginationNavigation.js
View file @
8986c475
import
propTypes
from
'prop-types'
;
import
{
pageNumberOptions
}
from
'../util/pagination'
;
import
{
pageNumberOptions
}
from
'../util/pagination'
;
import
Button
from
'./Button'
;
import
Button
from
'./Button'
;
...
@@ -80,10 +78,4 @@ function PaginationNavigation({ currentPage, onChangePage, totalPages }) {
...
@@ -80,10 +78,4 @@ function PaginationNavigation({ currentPage, onChangePage, totalPages }) {
);
);
}
}
PaginationNavigation
.
propTypes
=
{
currentPage
:
propTypes
.
number
,
onChangePage
:
propTypes
.
func
,
totalPages
:
propTypes
.
number
,
};
export
default
PaginationNavigation
;
export
default
PaginationNavigation
;
src/sidebar/components/SearchInput.js
View file @
8986c475
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
{
useRef
,
useState
}
from
'preact/hooks'
;
import
{
useRef
,
useState
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
...
@@ -90,9 +89,3 @@ export default function SearchInput({ alwaysExpanded, query, onSearch }) {
...
@@ -90,9 +89,3 @@ export default function SearchInput({ alwaysExpanded, query, onSearch }) {
<
/form
>
<
/form
>
);
);
}
}
SearchInput
.
propTypes
=
{
alwaysExpanded
:
propTypes
.
bool
,
query
:
propTypes
.
string
,
onSearch
:
propTypes
.
func
,
};
src/sidebar/components/SelectionTabs.js
View file @
8986c475
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
withServices
}
from
'../service-context'
;
import
{
withServices
}
from
'../service-context'
;
...
@@ -69,15 +68,6 @@ function Tab({
...
@@ -69,15 +68,6 @@ function Tab({
);
);
}
}
Tab
.
propTypes
=
{
children
:
propTypes
.
node
.
isRequired
,
count
:
propTypes
.
number
.
isRequired
,
isSelected
:
propTypes
.
bool
.
isRequired
,
isWaitingToAnchor
:
propTypes
.
bool
.
isRequired
,
label
:
propTypes
.
string
.
isRequired
,
onSelect
:
propTypes
.
func
.
isRequired
,
};
/**
/**
* @typedef SelectionTabsProps
* @typedef SelectionTabsProps
* @prop {boolean} isLoading - Are we waiting on any annotations from the server?
* @prop {boolean} isLoading - Are we waiting on any annotations from the server?
...
@@ -169,10 +159,6 @@ function SelectionTabs({ isLoading, settings }) {
...
@@ -169,10 +159,6 @@ function SelectionTabs({ isLoading, settings }) {
<
/div
>
<
/div
>
);
);
}
}
SelectionTabs
.
propTypes
=
{
isLoading
:
propTypes
.
bool
.
isRequired
,
settings
:
propTypes
.
object
.
isRequired
,
};
SelectionTabs
.
injectedProps
=
[
'settings'
];
SelectionTabs
.
injectedProps
=
[
'settings'
];
...
...
src/sidebar/components/ShareAnnotationsPanel.js
View file @
8986c475
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
pageSharingLink
}
from
'../helpers/annotation-sharing'
;
import
{
pageSharingLink
}
from
'../helpers/annotation-sharing'
;
...
@@ -123,11 +122,6 @@ function ShareAnnotationsPanel({ analytics, toastMessenger }) {
...
@@ -123,11 +122,6 @@ function ShareAnnotationsPanel({ analytics, toastMessenger }) {
);
);
}
}
ShareAnnotationsPanel
.
propTypes
=
{
analytics
:
propTypes
.
object
.
isRequired
,
toastMessenger
:
propTypes
.
object
.
isRequired
,
};
ShareAnnotationsPanel
.
injectedProps
=
[
'analytics'
,
'toastMessenger'
];
ShareAnnotationsPanel
.
injectedProps
=
[
'analytics'
,
'toastMessenger'
];
export
default
withServices
(
ShareAnnotationsPanel
);
export
default
withServices
(
ShareAnnotationsPanel
);
src/sidebar/components/SidebarContentError.js
View file @
8986c475
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
...
@@ -76,9 +75,3 @@ export default function SidebarContentError({
...
@@ -76,9 +75,3 @@ export default function SidebarContentError({
<
/div
>
<
/div
>
);
);
}
}
SidebarContentError
.
propTypes
=
{
errorType
:
propTypes
.
oneOf
([
'annotation'
,
'group'
]).
isRequired
,
showClearSelection
:
propTypes
.
bool
,
onLoginRequest
:
propTypes
.
func
.
isRequired
,
};
src/sidebar/components/SidebarPanel.js
View file @
8986c475
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
useEffect
,
useRef
}
from
'preact/hooks'
;
import
{
useEffect
,
useRef
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
scrollIntoView
from
'scroll-into-view'
;
import
scrollIntoView
from
'scroll-into-view'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
...
@@ -82,11 +81,3 @@ export default function SidebarPanel({
...
@@ -82,11 +81,3 @@ export default function SidebarPanel({
<
/Slider
>
<
/Slider
>
);
);
}
}
SidebarPanel
.
propTypes
=
{
children
:
propTypes
.
any
,
icon
:
propTypes
.
string
,
panelName
:
propTypes
.
string
.
isRequired
,
title
:
propTypes
.
string
.
isRequired
,
onActiveChanged
:
propTypes
.
func
,
};
src/sidebar/components/SidebarView.js
View file @
8986c475
import
propTypes
from
'prop-types'
;
import
{
useEffect
,
useRef
}
from
'preact/hooks'
;
import
{
useEffect
,
useRef
}
from
'preact/hooks'
;
import
useRootThread
from
'./hooks/use-root-thread'
;
import
useRootThread
from
'./hooks/use-root-thread'
;
...
@@ -158,14 +157,6 @@ function SidebarView({
...
@@ -158,14 +157,6 @@ function SidebarView({
);
);
}
}
SidebarView
.
propTypes
=
{
onLogin
:
propTypes
.
func
.
isRequired
,
onSignUp
:
propTypes
.
func
.
isRequired
,
frameSync
:
propTypes
.
object
,
loadAnnotationsService
:
propTypes
.
object
,
streamer
:
propTypes
.
object
,
};
SidebarView
.
injectedProps
=
[
'frameSync'
,
'loadAnnotationsService'
,
'streamer'
];
SidebarView
.
injectedProps
=
[
'frameSync'
,
'loadAnnotationsService'
,
'streamer'
];
export
default
withServices
(
SidebarView
);
export
default
withServices
(
SidebarView
);
src/sidebar/components/Slider.js
View file @
8986c475
import
{
useCallback
,
useEffect
,
useRef
,
useState
}
from
'preact/hooks'
;
import
{
useCallback
,
useEffect
,
useRef
,
useState
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
/**
/**
* @typedef SliderProps
* @typedef SliderProps
...
@@ -102,8 +101,3 @@ export default function Slider({ children, visible }) {
...
@@ -102,8 +101,3 @@ export default function Slider({ children, visible }) {
<
/div
>
<
/div
>
);
);
}
}
Slider
.
propTypes
=
{
children
:
propTypes
.
any
,
visible
:
propTypes
.
bool
,
};
src/sidebar/components/SortMenu.js
View file @
8986c475
...
@@ -46,5 +46,3 @@ export default function SortMenu() {
...
@@ -46,5 +46,3 @@ export default function SortMenu() {
<
/div
>
<
/div
>
);
);
}
}
SortMenu
.
propTypes
=
{};
src/sidebar/components/Spinner.js
View file @
8986c475
...
@@ -16,5 +16,3 @@ export default function Spinner() {
...
@@ -16,5 +16,3 @@ export default function Spinner() {
<
/div
>
<
/div
>
);
);
}
}
Spinner
.
propTypes
=
{};
src/sidebar/components/StreamSearchInput.js
View file @
8986c475
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
withServices
}
from
'../service-context'
;
import
{
withServices
}
from
'../service-context'
;
...
@@ -31,10 +29,6 @@ function StreamSearchInput({ router }) {
...
@@ -31,10 +29,6 @@ function StreamSearchInput({ router }) {
);
);
}
}
StreamSearchInput
.
propTypes
=
{
router
:
propTypes
.
object
,
};
StreamSearchInput
.
injectedProps
=
[
'router'
];
StreamSearchInput
.
injectedProps
=
[
'router'
];
export
default
withServices
(
StreamSearchInput
);
export
default
withServices
(
StreamSearchInput
);
src/sidebar/components/StreamView.js
View file @
8986c475
import
{
useCallback
,
useEffect
}
from
'preact/hooks'
;
import
{
useCallback
,
useEffect
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
*
as
searchFilter
from
'../util/search-filter'
;
import
*
as
searchFilter
from
'../util/search-filter'
;
import
{
withServices
}
from
'../service-context'
;
import
{
withServices
}
from
'../service-context'
;
...
@@ -67,11 +66,6 @@ function StreamView({ api, toastMessenger }) {
...
@@ -67,11 +66,6 @@ function StreamView({ api, toastMessenger }) {
return
<
ThreadList
threads
=
{
rootThread
.
children
}
/>
;
return
<
ThreadList
threads
=
{
rootThread
.
children
}
/>
;
}
}
StreamView
.
propTypes
=
{
api
:
propTypes
.
object
,
toastMessenger
:
propTypes
.
object
,
};
StreamView
.
injectedProps
=
[
'api'
,
'toastMessenger'
];
StreamView
.
injectedProps
=
[
'api'
,
'toastMessenger'
];
export
default
withServices
(
StreamView
);
export
default
withServices
(
StreamView
);
src/sidebar/components/TagEditor.js
View file @
8986c475
...
@@ -4,7 +4,6 @@ import {
...
@@ -4,7 +4,6 @@ import {
useElementShouldClose
,
useElementShouldClose
,
}
from
'@hypothesis/frontend-shared'
;
}
from
'@hypothesis/frontend-shared'
;
import
{
useRef
,
useState
}
from
'preact/hooks'
;
import
{
useRef
,
useState
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
{
withServices
}
from
'../service-context'
;
import
{
withServices
}
from
'../service-context'
;
...
@@ -339,14 +338,6 @@ function TagEditor({
...
@@ -339,14 +338,6 @@ function TagEditor({
);
);
}
}
TagEditor
.
propTypes
=
{
onAddTag
:
propTypes
.
func
.
isRequired
,
onRemoveTag
:
propTypes
.
func
.
isRequired
,
onTagInput
:
propTypes
.
func
,
tagList
:
propTypes
.
array
.
isRequired
,
tags
:
propTypes
.
object
.
isRequired
,
};
TagEditor
.
injectedProps
=
[
'tags'
];
TagEditor
.
injectedProps
=
[
'tags'
];
export
default
withServices
(
TagEditor
);
export
default
withServices
(
TagEditor
);
src/sidebar/components/TagList.js
View file @
8986c475
import
{
useMemo
}
from
'preact/hooks'
;
import
{
useMemo
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
{
isThirdPartyUser
}
from
'../helpers/account-id'
;
import
{
isThirdPartyUser
}
from
'../helpers/account-id'
;
import
{
withServices
}
from
'../service-context'
;
import
{
withServices
}
from
'../service-context'
;
...
@@ -62,13 +61,6 @@ function TagList({ annotation, serviceUrl, settings, tags }) {
...
@@ -62,13 +61,6 @@ function TagList({ annotation, serviceUrl, settings, tags }) {
);
);
}
}
TagList
.
propTypes
=
{
annotation
:
propTypes
.
object
.
isRequired
,
tags
:
propTypes
.
array
.
isRequired
,
serviceUrl
:
propTypes
.
func
,
settings
:
propTypes
.
object
,
};
TagList
.
injectedProps
=
[
'serviceUrl'
,
'settings'
];
TagList
.
injectedProps
=
[
'serviceUrl'
,
'settings'
];
export
default
withServices
(
TagList
);
export
default
withServices
(
TagList
);
src/sidebar/components/Thread.js
View file @
8986c475
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
{
useCallback
,
useMemo
}
from
'preact/hooks'
;
import
{
useCallback
,
useMemo
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
withServices
}
from
'../service-context'
;
import
{
withServices
}
from
'../service-context'
;
import
{
countHidden
,
countVisible
}
from
'../helpers/thread'
;
import
{
countHidden
,
countVisible
}
from
'../helpers/thread'
;
...
@@ -125,13 +124,6 @@ function Thread({ thread, threadsService }) {
...
@@ -125,13 +124,6 @@ function Thread({ thread, threadsService }) {
);
);
}
}
Thread
.
propTypes
=
{
thread
:
propTypes
.
object
.
isRequired
,
// Injected
threadsService
:
propTypes
.
object
.
isRequired
,
};
Thread
.
injectedProps
=
[
'threadsService'
];
Thread
.
injectedProps
=
[
'threadsService'
];
export
default
withServices
(
Thread
);
export
default
withServices
(
Thread
);
src/sidebar/components/ThreadCard.js
View file @
8986c475
...
@@ -2,7 +2,6 @@ import classnames from 'classnames';
...
@@ -2,7 +2,6 @@ import classnames from 'classnames';
import
debounce
from
'lodash.debounce'
;
import
debounce
from
'lodash.debounce'
;
import
{
useCallback
,
useMemo
}
from
'preact/hooks'
;
import
{
useCallback
,
useMemo
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
withServices
}
from
'../service-context'
;
import
{
withServices
}
from
'../service-context'
;
...
@@ -80,11 +79,6 @@ function ThreadCard({ frameSync, thread }) {
...
@@ -80,11 +79,6 @@ function ThreadCard({ frameSync, thread }) {
);
);
}
}
ThreadCard
.
propTypes
=
{
thread
:
propTypes
.
object
.
isRequired
,
frameSync
:
propTypes
.
object
.
isRequired
,
};
ThreadCard
.
injectedProps
=
[
'frameSync'
];
ThreadCard
.
injectedProps
=
[
'frameSync'
];
export
default
withServices
(
ThreadCard
);
export
default
withServices
(
ThreadCard
);
src/sidebar/components/ThreadList.js
View file @
8986c475
import
{
useEffect
,
useLayoutEffect
,
useMemo
,
useState
}
from
'preact/hooks'
;
import
{
useEffect
,
useLayoutEffect
,
useMemo
,
useState
}
from
'preact/hooks'
;
import
propTypes
from
'prop-types'
;
import
debounce
from
'lodash.debounce'
;
import
debounce
from
'lodash.debounce'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
...
@@ -208,9 +207,4 @@ function ThreadList({ threads }) {
...
@@ -208,9 +207,4 @@ function ThreadList({ threads }) {
);
);
}
}
ThreadList
.
propTypes
=
{
/** Should annotations render extra document metadata? */
threads
:
propTypes
.
array
.
isRequired
,
};
export
default
ThreadList
;
export
default
ThreadList
;
src/sidebar/components/ToastMessages.js
View file @
8986c475
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
propTypes
from
'prop-types'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
withServices
}
from
'../service-context'
;
import
{
withServices
}
from
'../service-context'
;
...
@@ -75,11 +74,6 @@ function ToastMessage({ message, onDismiss }) {
...
@@ -75,11 +74,6 @@ function ToastMessage({ message, onDismiss }) {
);
);
}
}
ToastMessage
.
propTypes
=
{
message
:
propTypes
.
object
.
isRequired
,
onDismiss
:
propTypes
.
func
,
};
/**
/**
* @typedef ToastMessagesProps
* @typedef ToastMessagesProps
* @prop {Object} toastMessenger - Injected service
* @prop {Object} toastMessenger - Injected service
...
@@ -113,10 +107,6 @@ function ToastMessages({ toastMessenger }) {
...
@@ -113,10 +107,6 @@ function ToastMessages({ toastMessenger }) {
);
);
}
}
ToastMessages
.
propTypes
=
{
toastMessenger
:
propTypes
.
object
.
isRequired
,
};
ToastMessages
.
injectedProps
=
[
'toastMessenger'
];
ToastMessages
.
injectedProps
=
[
'toastMessenger'
];
export
default
withServices
(
ToastMessages
);
export
default
withServices
(
ToastMessages
);
src/sidebar/components/TopBar.js
View file @
8986c475
import
propTypes
from
'prop-types'
;
import
bridgeEvents
from
'../../shared/bridge-events'
;
import
bridgeEvents
from
'../../shared/bridge-events'
;
import
serviceConfig
from
'../config/service-config'
;
import
serviceConfig
from
'../config/service-config'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
import
{
useStoreProxy
}
from
'../store/use-store'
;
...
@@ -165,23 +163,6 @@ function TopBar({
...
@@ -165,23 +163,6 @@ function TopBar({
);
);
}
}
TopBar
.
propTypes
=
{
auth
:
propTypes
.
shape
({
status
:
propTypes
.
string
.
isRequired
,
// Additional properties when user is logged in.
displayName
:
propTypes
.
string
,
userid
:
propTypes
.
string
,
username
:
propTypes
.
string
,
}),
bridge
:
propTypes
.
object
.
isRequired
,
isSidebar
:
propTypes
.
bool
,
onLogin
:
propTypes
.
func
,
onLogout
:
propTypes
.
func
,
onSignUp
:
propTypes
.
func
,
settings
:
propTypes
.
object
,
streamer
:
propTypes
.
object
,
};
TopBar
.
injectedProps
=
[
'bridge'
,
'settings'
,
'streamer'
];
TopBar
.
injectedProps
=
[
'bridge'
,
'settings'
,
'streamer'
];
export
default
withServices
(
TopBar
);
export
default
withServices
(
TopBar
);
src/sidebar/components/Tutorial.js
View file @
8986c475
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
propTypes
from
'prop-types'
;
import
isThirdPartyService
from
'../helpers/is-third-party-service'
;
import
isThirdPartyService
from
'../helpers/is-third-party-service'
;
import
{
withServices
}
from
'../service-context'
;
import
{
withServices
}
from
'../service-context'
;
...
@@ -72,10 +71,6 @@ function Tutorial({ settings }) {
...
@@ -72,10 +71,6 @@ function Tutorial({ settings }) {
);
);
}
}
Tutorial
.
propTypes
=
{
settings
:
propTypes
.
object
.
isRequired
,
};
Tutorial
.
injectedProps
=
[
'settings'
];
Tutorial
.
injectedProps
=
[
'settings'
];
export
default
withServices
(
Tutorial
);
export
default
withServices
(
Tutorial
);
src/sidebar/components/UserMenu.js
View file @
8986c475
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
{
SvgIcon
}
from
'@hypothesis/frontend-shared'
;
import
propTypes
from
'prop-types'
;
import
bridgeEvents
from
'../../shared/bridge-events'
;
import
bridgeEvents
from
'../../shared/bridge-events'
;
import
serviceConfig
from
'../config/service-config'
;
import
serviceConfig
from
'../config/service-config'
;
...
@@ -109,14 +108,6 @@ function UserMenu({ auth, bridge, onLogout, serviceUrl, settings }) {
...
@@ -109,14 +108,6 @@ function UserMenu({ auth, bridge, onLogout, serviceUrl, settings }) {
);
);
}
}
UserMenu
.
propTypes
=
{
auth
:
propTypes
.
object
.
isRequired
,
onLogout
:
propTypes
.
func
.
isRequired
,
bridge
:
propTypes
.
object
.
isRequired
,
serviceUrl
:
propTypes
.
func
.
isRequired
,
settings
:
propTypes
.
object
.
isRequired
,
};
UserMenu
.
injectedProps
=
[
'bridge'
,
'serviceUrl'
,
'settings'
];
UserMenu
.
injectedProps
=
[
'bridge'
,
'serviceUrl'
,
'settings'
];
export
default
withServices
(
UserMenu
);
export
default
withServices
(
UserMenu
);
src/sidebar/components/VersionInfo.js
View file @
8986c475
import
propTypes
from
'prop-types'
;
import
{
copyText
}
from
'../util/copy-to-clipboard'
;
import
{
copyText
}
from
'../util/copy-to-clipboard'
;
import
{
withServices
}
from
'../service-context'
;
import
{
withServices
}
from
'../service-context'
;
...
@@ -53,11 +51,6 @@ function VersionInfo({ toastMessenger, versionData }) {
...
@@ -53,11 +51,6 @@ function VersionInfo({ toastMessenger, versionData }) {
);
);
}
}
VersionInfo
.
propTypes
=
{
versionData
:
propTypes
.
object
.
isRequired
,
toastMessenger
:
propTypes
.
object
.
isRequired
,
};
VersionInfo
.
injectedProps
=
[
'toastMessenger'
];
VersionInfo
.
injectedProps
=
[
'toastMessenger'
];
export
default
withServices
(
VersionInfo
);
export
default
withServices
(
VersionInfo
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment