This commit is contained in:
Zhiyuan Zheng 2021-02-08 23:47:20 +01:00
parent f5414412d4
commit 383ebc2775
No known key found for this signature in database
GPG Key ID: 078A93AB607D85E0
79 changed files with 150 additions and 137 deletions

View File

@ -11,7 +11,7 @@ import {
View,
ViewStyle
} from 'react-native'
import { Chase } from 'react-native-animated-spinkit'
import { Flow } from 'react-native-animated-spinkit'
export interface Props {
style?: StyleProp<ViewStyle>
@ -62,7 +62,7 @@ const Button: React.FC<Props> = ({
const loadingSpinkit = useMemo(
() => (
<View style={{ position: 'absolute' }}>
<Chase size={StyleConstants.Font.Size[size]} color={theme.secondary} />
<Flow size={StyleConstants.Font.Size[size]} color={theme.secondary} />
</View>
),
[mode]

View File

@ -1,10 +1,9 @@
import Icon from '@components/Icon'
import { StyleConstants } from '@utils/styles/constants'
import layoutAnimation from '@utils/styles/layoutAnimation'
import { useTheme } from '@utils/styles/ThemeManager'
import React, { useEffect, useMemo, useRef } from 'react'
import React, { useMemo } from 'react'
import { Pressable, StyleSheet, Text, View } from 'react-native'
import { Chase } from 'react-native-animated-spinkit'
import { Flow } from 'react-native-animated-spinkit'
export interface Props {
type?: 'icon' | 'text'
@ -27,19 +26,10 @@ const HeaderRight: React.FC<Props> = ({
}) => {
const { theme } = useTheme()
const mounted = useRef(false)
// useEffect(() => {
// if (mounted.current) {
// layoutAnimation()
// } else {
// mounted.current = true
// }
// }, [content, loading, disabled])
const loadingSpinkit = useMemo(
() => (
<View style={{ position: 'absolute' }}>
<Chase
<Flow
size={StyleConstants.Font.Size.M * 1.25}
color={theme.secondary}
/>

View File

@ -4,7 +4,7 @@ import { useTheme } from '@utils/styles/ThemeManager'
import { ColorDefinitions } from '@utils/styles/themes'
import React, { useMemo } from 'react'
import { StyleSheet, Switch, Text, View } from 'react-native'
import { Chase } from 'react-native-animated-spinkit'
import { Flow } from 'react-native-animated-spinkit'
import { State, TapGestureHandler } from 'react-native-gesture-handler'
export interface Props {
@ -45,7 +45,7 @@ const MenuRow: React.FC<Props> = ({
const loadingSpinkit = useMemo(
() => (
<View style={{ position: 'absolute' }}>
<Chase
<Flow
size={StyleConstants.Font.Size.M * 1.25}
color={theme.secondary}
/>

View File

@ -92,6 +92,7 @@ const TimelineConversation: React.FC<Props> = ({
<Pressable
style={[
styles.base,
{ backgroundColor: theme.background },
conversation.unread && {
borderLeftWidth: StyleConstants.Spacing.XS,
borderLeftColor: theme.blue,

View File

@ -1,17 +1,18 @@
import analytics from '@components/analytics'
import TimelineActioned from '@components/Timelines/Timeline/Shared/Actioned'
import TimelineActions from '@components/Timelines/Timeline/Shared/Actions'
import TimelineAttachment from '@components/Timelines/Timeline/Shared/Attachment'
import TimelineAvatar from '@components/Timelines/Timeline/Shared/Avatar'
import TimelineCard from '@components/Timelines/Timeline/Shared/Card'
import TimelineContent from '@components/Timelines/Timeline/Shared/Content'
import TimelineHeaderDefault from '@components/Timelines/Timeline/Shared/HeaderDefault'
import TimelinePoll from '@components/Timelines/Timeline/Shared/Poll'
import TimelineActioned from '@components/Timeline/Shared/Actioned'
import TimelineActions from '@components/Timeline/Shared/Actions'
import TimelineAttachment from '@components/Timeline/Shared/Attachment'
import TimelineAvatar from '@components/Timeline/Shared/Avatar'
import TimelineCard from '@components/Timeline/Shared/Card'
import TimelineContent from '@components/Timeline/Shared/Content'
import TimelineHeaderDefault from '@components/Timeline/Shared/HeaderDefault'
import TimelinePoll from '@components/Timeline/Shared/Poll'
import { useNavigation } from '@react-navigation/native'
import { StackNavigationProp } from '@react-navigation/stack'
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
import { getLocalAccount } from '@utils/slices/instancesSlice'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React, { useCallback } from 'react'
import { Pressable, StyleSheet, View } from 'react-native'
import { useSelector } from 'react-redux'
@ -34,6 +35,7 @@ const TimelineDefault: React.FC<Props> = ({
disableDetails = false,
disableOnPress = false
}) => {
const { theme } = useTheme()
const localAccount = useSelector(getLocalAccount)
const navigation = useNavigation<
StackNavigationProp<Nav.TabLocalStackParamList>
@ -57,6 +59,7 @@ const TimelineDefault: React.FC<Props> = ({
style={[
styles.statusView,
{
backgroundColor: theme.background,
paddingBottom:
disableDetails && disableOnPress
? StyleConstants.Spacing.Global.PagePadding
@ -90,13 +93,14 @@ const TimelineDefault: React.FC<Props> = ({
: StyleConstants.Avatar.M + StyleConstants.Spacing.S
}}
>
{actualStatus.content.length > 0 && (
<TimelineContent
status={actualStatus}
highlighted={highlighted}
disableDetails={disableDetails}
/>
)}
{typeof actualStatus.content === 'string' &&
actualStatus.content.length > 0 && (
<TimelineContent
status={actualStatus}
highlighted={highlighted}
disableDetails={disableDetails}
/>
)}
{queryKey && actualStatus.poll ? (
<TimelinePoll
queryKey={queryKey}

View File

@ -6,7 +6,7 @@ import { useTheme } from '@utils/styles/ThemeManager'
import React, { useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import { StyleSheet, Text, View } from 'react-native'
import { Chase } from 'react-native-animated-spinkit'
import { Circle } from 'react-native-animated-spinkit'
import { QueryStatus } from 'react-query'
export interface Props {
@ -22,7 +22,7 @@ const TimelineEmpty: React.FC<Props> = ({ status, refetch }) => {
switch (status) {
case 'loading':
return (
<Chase size={StyleConstants.Font.Size.L} color={theme.secondary} />
<Circle size={StyleConstants.Font.Size.L} color={theme.secondary} />
)
case 'error':
return (
@ -60,7 +60,12 @@ const TimelineEmpty: React.FC<Props> = ({ status, refetch }) => {
)
}
}, [mode, i18n.language, status])
return <View style={styles.base} children={children} />
return (
<View
style={[styles.base, { backgroundColor: theme.background }]}
children={children}
/>
)
}
const styles = StyleSheet.create({

View File

@ -4,7 +4,7 @@ import { useTheme } from '@utils/styles/ThemeManager'
import React from 'react'
import { Trans } from 'react-i18next'
import { StyleSheet, Text, View } from 'react-native'
import { Chase } from 'react-native-animated-spinkit'
import { Circle } from 'react-native-animated-spinkit'
export interface Props {
hasNextPage?: boolean
@ -16,7 +16,7 @@ const TimelineEnd: React.FC<Props> = ({ hasNextPage }) => {
return (
<View style={styles.base}>
{hasNextPage ? (
<Chase size={StyleConstants.Font.Size.L} color={theme.secondary} />
<Circle size={StyleConstants.Font.Size.L} color={theme.secondary} />
) : (
<Text style={[styles.text, { color: theme.secondary }]}>
<Trans

View File

@ -1,17 +1,18 @@
import analytics from '@components/analytics'
import TimelineActioned from '@components/Timelines/Timeline/Shared/Actioned'
import TimelineActions from '@components/Timelines/Timeline/Shared/Actions'
import TimelineAttachment from '@components/Timelines/Timeline/Shared/Attachment'
import TimelineAvatar from '@components/Timelines/Timeline/Shared/Avatar'
import TimelineCard from '@components/Timelines/Timeline/Shared/Card'
import TimelineContent from '@components/Timelines/Timeline/Shared/Content'
import TimelineHeaderNotification from '@components/Timelines/Timeline/Shared/HeaderNotification'
import TimelinePoll from '@components/Timelines/Timeline/Shared/Poll'
import TimelineActioned from '@components/Timeline/Shared/Actioned'
import TimelineActions from '@components/Timeline/Shared/Actions'
import TimelineAttachment from '@components/Timeline/Shared/Attachment'
import TimelineAvatar from '@components/Timeline/Shared/Avatar'
import TimelineCard from '@components/Timeline/Shared/Card'
import TimelineContent from '@components/Timeline/Shared/Content'
import TimelineHeaderNotification from '@components/Timeline/Shared/HeaderNotification'
import TimelinePoll from '@components/Timeline/Shared/Poll'
import { useNavigation } from '@react-navigation/native'
import { StackNavigationProp } from '@react-navigation/stack'
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
import { getLocalAccount } from '@utils/slices/instancesSlice'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React, { useCallback } from 'react'
import { Pressable, StyleSheet, View } from 'react-native'
import { useSelector } from 'react-redux'
@ -27,6 +28,7 @@ const TimelineNotifications: React.FC<Props> = ({
queryKey,
highlighted = false
}) => {
const { theme } = useTheme()
const localAccount = useSelector(getLocalAccount)
const navigation = useNavigation<
StackNavigationProp<Nav.TabLocalStackParamList>
@ -44,12 +46,17 @@ const TimelineNotifications: React.FC<Props> = ({
}, [])
return (
<Pressable style={styles.notificationView} onPress={onPress}>
<TimelineActioned
action={notification.type}
account={notification.account}
notification
/>
<Pressable
style={[styles.notificationView, { backgroundColor: theme.background }]}
onPress={onPress}
>
{notification.type !== 'mention' ? (
<TimelineActioned
action={notification.type}
account={notification.account}
notification
/>
) : null}
<View
style={{

View File

@ -0,0 +1,36 @@
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React from 'react'
import { StyleSheet, View } from 'react-native'
import { Circle } from 'react-native-animated-spinkit'
export interface Props {
isLoading: boolean
disable?: boolean
}
const TimelineRefresh: React.FC<Props> = ({ isLoading, disable = false }) => {
const { theme } = useTheme()
return !isLoading && !disable ? (
<View
style={styles.base}
children={
<Circle size={StyleConstants.Font.Size.L} color={theme.secondary} />
}
/>
) : null
}
const styles = StyleSheet.create({
base: {
position: 'absolute',
top: 0,
left: 0,
right: 0,
height: StyleConstants.Spacing.XL,
justifyContent: 'center',
alignItems: 'center'
}
})
export default TimelineRefresh

View File

@ -1,17 +1,16 @@
import analytics from '@components/analytics'
import Button from '@components/Button'
import haptics from '@components/haptics'
import AttachmentAudio from '@components/Timelines/Timeline/Shared/Attachment/Audio'
import AttachmentImage from '@components/Timelines/Timeline/Shared/Attachment/Image'
import AttachmentUnsupported from '@components/Timelines/Timeline/Shared/Attachment/Unsupported'
import AttachmentVideo from '@components/Timelines/Timeline/Shared/Attachment/Video'
import AttachmentAudio from '@components/Timeline/Shared/Attachment/Audio'
import AttachmentImage from '@components/Timeline/Shared/Attachment/Image'
import AttachmentUnsupported from '@components/Timeline/Shared/Attachment/Unsupported'
import AttachmentVideo from '@components/Timeline/Shared/Attachment/Video'
import { useNavigation } from '@react-navigation/native'
import { StyleConstants } from '@utils/styles/constants'
import layoutAnimation from '@utils/styles/layoutAnimation'
import React, { useCallback, useMemo, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { Pressable, StyleSheet, View } from 'react-native'
import { IImageInfo } from 'react-native-image-zoom-viewer/built/image-viewer.type'
export interface Props {
status: Pick<Mastodon.Status, 'media_attachments' | 'sensitive'>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
{"version":3,"sources":["../src/htmlParser/state.ts"],"names":[],"mappings":"","file":"state.js","sourcesContent":["/**\n * The subset of the parser states defined in https://www.w3.org/TR/html51/syntax.html\n * which are useful for Autolinker.\n */\nexport const enum State {\n\tData = 0,\n\tTagOpen,\n\tEndTagOpen,\n\tTagName,\n\tBeforeAttributeName,\n\tAttributeName,\n\tAfterAttributeName,\n\tBeforeAttributeValue,\n\tAttributeValueDoubleQuoted,\n\tAttributeValueSingleQuoted,\n\tAttributeValueUnquoted,\n\tAfterAttributeValueQuoted,\n\tSelfClosingStartTag,\n\tMarkupDeclarationOpenState, // When the sequence '<!' is read for an HTML comment or doctype\n\tCommentStart,\n\tCommentStartDash,\n\tComment,\n\tCommentEndDash,\n\tCommentEnd,\n\tCommentEndBang,\n\tDoctype\n}"]}

View File

@ -1 +0,0 @@
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,iFAAiF;AACjF,gFAAgF;AAChF,sCAAsC;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AAErD,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC","file":"index.js","sourcesContent":["// WARNING: This file is modified a bit when it is compiled into index.js in \n// order to support nodejs interoperability with require('autolinker') directly. \n// This is done by the buildSrcFixCommonJsIndexTask() function in the gulpfile. \n// See that function for more details.\n\nexport { default } from './autolinker';\nexport { default as Autolinker } from './autolinker';\n\nexport * from './autolinker';\nexport * from './anchor-tag-builder';\nexport * from './html-tag';\nexport * from './match/index';\nexport * from './matcher/index';\n"]}

View File

@ -1 +0,0 @@
{"version":3,"sources":["../src/match/email-match.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAe,MAAM,SAAS,CAAC;AAE7C;;;;;;;GAOG;AACH;IAAgC,sCAAK;IAUpC;;;;OAIG;IACH,oBAAa,GAAqB;QAAlC,YACC,kBAAO,GAAG,CAAE,SAGZ;QAjBD;;;;WAIG;QACc,WAAK,GAAW,EAAE,CAAC,CAAE,gGAAgG;QAWrI,KAAI,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;;IACxB,CAAC;IAGD;;;;;OAKG;IACH,4BAAO,GAAP;QACC,OAAO,OAAO,CAAC;IAChB,CAAC;IAGD;;;;OAIG;IACH,6BAAQ,GAAR;QACC,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAGD;;;;OAIG;IACH,kCAAa,GAAb;QACC,OAAO,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC;IAC/B,CAAC;IAGD;;;;OAIG;IACH,kCAAa,GAAb;QACC,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAEF,iBAAC;AAAD,CA9DA,AA8DC,CA9D+B,KAAK,GA8DpC","file":"email-match.js","sourcesContent":["import { Match, MatchConfig } from \"./match\";\n\n/**\n * @class Autolinker.match.Email\n * @extends Autolinker.match.Match\n *\n * Represents a Email match found in an input string which should be Autolinked.\n *\n * See this class's superclass ({@link Autolinker.match.Match}) for more details.\n */\nexport class EmailMatch extends Match {\n\n\t/**\n\t * @cfg {String} email (required)\n\t *\n\t * The email address that was matched.\n\t */\n\tprivate readonly email: string = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\n\t/**\n\t * @method constructor\n\t * @param {Object} cfg The configuration properties for the Match\n\t * instance, specified in an Object (map).\n\t */\n\tconstructor( cfg: EmailMatchConfig ) {\n\t\tsuper( cfg );\n\n\t\tthis.email = cfg.email;\n\t}\n\n\n\t/**\n\t * Returns a string name for the type of match that this class represents.\n\t * For the case of EmailMatch, returns 'email'.\n\t *\n\t * @return {String}\n\t */\n\tgetType() {\n\t\treturn 'email';\n\t}\n\n\n\t/**\n\t * Returns the email address that was matched.\n\t *\n\t * @return {String}\n\t */\n\tgetEmail() {\n\t\treturn this.email;\n\t}\n\n\n\t/**\n\t * Returns the anchor href that should be generated for the match.\n\t *\n\t * @return {String}\n\t */\n\tgetAnchorHref() {\n\t\treturn 'mailto:' + this.email;\n\t}\n\n\n\t/**\n\t * Returns the anchor text that should be generated for the match.\n\t *\n\t * @return {String}\n\t */\n\tgetAnchorText() {\n\t\treturn this.email;\n\t}\n\n}\n\n\nexport interface EmailMatchConfig extends MatchConfig {\n\temail: string;\n}"]}

View File

@ -1 +0,0 @@
{"version":3,"sources":["../src/match/hashtag-match.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAe,MAAM,SAAS,CAAC;AAE7C;;;;;;;;;GASG;AACH;IAAkC,wCAAK;IAkBtC;;;;OAIG;IACH,sBAAa,GAAuB;QAApC,YACC,kBAAO,GAAG,CAAE,SAIZ;QA1BD;;;;;WAKG;QACc,iBAAW,GAAW,EAAE,CAAC,CAAE,gGAAgG;QAE5I;;;;WAIG;QACc,aAAO,GAAW,EAAE,CAAC,CAAE,gGAAgG;QAWvI,KAAI,CAAC,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;QACnC,KAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;;IAC5B,CAAC;IAGD;;;;;OAKG;IACH,8BAAO,GAAP;QACC,OAAO,SAAS,CAAC;IAClB,CAAC;IAGD;;;;;OAKG;IACH,qCAAc,GAAd;QACC,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAGD;;;;OAIG;IACH,iCAAU,GAAV;QACC,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAGD;;;;OAIG;IACH,oCAAa,GAAb;QACC,IAAI,WAAW,GAAG,IAAI,CAAC,WAAW,EAC9B,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE3B,QAAQ,WAAW,EAAG;YACrB,KAAK,SAAS;gBACb,OAAO,8BAA8B,GAAG,OAAO,CAAC;YACjD,KAAK,UAAU;gBACd,OAAO,mCAAmC,GAAG,OAAO,CAAC;YACtD,KAAK,WAAW;gBACf,OAAO,qCAAqC,GAAG,OAAO,CAAC;YAExD,SAAW,uGAAuG;gBACjH,MAAM,IAAI,KAAK,CAAE,4CAA4C,GAAG,WAAW,CAAE,CAAC;SAC/E;IACF,CAAC;IAGD;;;;OAIG;IACH,oCAAa,GAAb;QACC,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC;IAC3B,CAAC;IAEF,mBAAC;AAAD,CA/FA,AA+FC,CA/FiC,KAAK,GA+FtC","file":"hashtag-match.js","sourcesContent":["import { Match, MatchConfig } from \"./match\";\n\n/**\n * @class Autolinker.match.Hashtag\n * @extends Autolinker.match.Match\n *\n * Represents a Hashtag match found in an input string which should be\n * Autolinked.\n *\n * See this class's superclass ({@link Autolinker.match.Match}) for more\n * details.\n */\nexport class HashtagMatch extends Match {\n\n\t/**\n\t * @cfg {String} serviceName\n\t *\n\t * The service to point hashtag matches to. See {@link Autolinker#hashtag}\n\t * for available values.\n\t */\n\tprivate readonly serviceName: string = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @cfg {String} hashtag (required)\n\t *\n\t * The HashtagMatch that was matched, without the '#'.\n\t */\n\tprivate readonly hashtag: string = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\n\t/**\n\t * @method constructor\n\t * @param {Object} cfg The configuration properties for the Match\n\t * instance, specified in an Object (map).\n\t */\n\tconstructor( cfg: HashtagMatchConfig ) {\n\t\tsuper( cfg );\n\n\t\tthis.serviceName = cfg.serviceName;\n\t\tthis.hashtag = cfg.hashtag;\n\t}\n\n\n\t/**\n\t * Returns a string name for the type of match that this class represents.\n\t * For the case of HashtagMatch, returns 'hashtag'.\n\t *\n\t * @return {String}\n\t */\n\tgetType() {\n\t\treturn 'hashtag';\n\t}\n\n\n\t/**\n\t * Returns the configured {@link #serviceName} to point the HashtagMatch to.\n\t * Ex: 'facebook', 'twitter'.\n\t *\n\t * @return {String}\n\t */\n\tgetServiceName() {\n\t\treturn this.serviceName;\n\t}\n\n\n\t/**\n\t * Returns the matched hashtag, without the '#' character.\n\t *\n\t * @return {String}\n\t */\n\tgetHashtag() {\n\t\treturn this.hashtag;\n\t}\n\n\n\t/**\n\t * Returns the anchor href that should be generated for the match.\n\t *\n\t * @return {String}\n\t */\n\tgetAnchorHref() {\n\t\tlet serviceName = this.serviceName,\n\t\t hashtag = this.hashtag;\n\n\t\tswitch( serviceName ) {\n\t\t\tcase 'twitter' :\n\t\t\t\treturn 'https://twitter.com/hashtag/' + hashtag;\n\t\t\tcase 'facebook' :\n\t\t\t\treturn 'https://www.facebook.com/hashtag/' + hashtag;\n\t\t\tcase 'instagram' :\n\t\t\t\treturn 'https://instagram.com/explore/tags/' + hashtag;\n\n\t\t\tdefault : // Shouldn't happen because Autolinker's constructor should block any invalid values, but just in case.\n\t\t\t\tthrow new Error( 'Unknown service name to point hashtag to: ' + serviceName );\n\t\t}\n\t}\n\n\n\t/**\n\t * Returns the anchor text that should be generated for the match.\n\t *\n\t * @return {String}\n\t */\n\tgetAnchorText() {\n\t\treturn '#' + this.hashtag;\n\t}\n\n}\n\nexport interface HashtagMatchConfig extends MatchConfig {\n\tserviceName: string;\n\thashtag: string;\n}"]}

View File

@ -1 +0,0 @@
{"version":3,"sources":["../src/match/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC","file":"index.js","sourcesContent":["export * from './email-match';\nexport * from './hashtag-match';\nexport * from './match';\nexport * from './mention-match';\nexport * from './phone-match';\nexport * from './url-match';\n"]}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
{"version":3,"sources":["../src/match/mention-match.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAe,MAAM,SAAS,CAAA;AAG5C;;;;;;;GAOG;AACH;IAAkC,wCAAK;IAgBtC;;;;OAIG;IACH,sBAAa,GAAuB;QAApC,YACC,kBAAM,GAAG,CAAC,SAIV;QAzBD;;;;;WAKG;QACc,iBAAW,GAAoB,SAAS,CAAA,CAAC,gGAAgG;QAE1J;;;;WAIG;QACc,aAAO,GAAW,EAAE,CAAA,CAAC,gGAAgG;QAUrI,KAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAA;QAC1B,KAAI,CAAC,WAAW,GAAG,GAAG,CAAC,WAAW,CAAA;;IACnC,CAAC;IAED;;;;;OAKG;IACH,8BAAO,GAAP;QACC,OAAO,SAAS,CAAA;IACjB,CAAC;IAED;;;;OAIG;IACH,iCAAU,GAAV;QACC,OAAO,IAAI,CAAC,OAAO,CAAA;IACpB,CAAC;IAED;;;;;OAKG;IACH,qCAAc,GAAd;QACC,OAAO,IAAI,CAAC,WAAW,CAAA;IACxB,CAAC;IAED;;;;OAIG;IACH,oCAAa,GAAb;QACC,QAAQ,IAAI,CAAC,WAAW,EAAE;YACzB,KAAK,UAAU;gBACd,OAAO,sBAAsB,GAAG,IAAI,CAAC,OAAO,CAAA;YAC7C,KAAK,SAAS;gBACb,OAAO,sBAAsB,GAAG,IAAI,CAAC,OAAO,CAAA;YAC7C,KAAK,WAAW;gBACf,OAAO,wBAAwB,GAAG,IAAI,CAAC,OAAO,CAAA;YAC/C,KAAK,YAAY;gBAChB,OAAO,yBAAyB,GAAG,IAAI,CAAC,OAAO,CAAA;YAEhD;gBACC,uGAAuG;gBACvG,MAAM,IAAI,KAAK,CACd,4CAA4C,GAAG,IAAI,CAAC,WAAW,CAC/D,CAAA;SACF;IACF,CAAC;IAED;;;;OAIG;IACH,oCAAa,GAAb;QACC,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,CAAA;IAC1B,CAAC;IAED;;;;;;OAMG;IACH,0CAAmB,GAAnB;QACC,IAAI,gBAAgB,GAAG,iBAAM,mBAAmB,WAAE,EACjD,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;QAEpC,IAAI,WAAW,EAAE;YAChB,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;SAClC;QACD,OAAO,gBAAgB,CAAA;IACxB,CAAC;IACF,mBAAC;AAAD,CA1GA,AA0GC,CA1GiC,KAAK,GA0GtC","file":"mention-match.js","sourcesContent":["import { Match, MatchConfig } from './match'\nimport { MentionServices } from '../autolinker'\n\n/**\n * @class Autolinker.match.Mention\n * @extends Autolinker.match.Match\n *\n * Represents a Mention match found in an input string which should be Autolinked.\n *\n * See this class's superclass ({@link Autolinker.match.Match}) for more details.\n */\nexport class MentionMatch extends Match {\n\t/**\n\t * @cfg {String} serviceName\n\t *\n\t * The service to point mention matches to. See {@link Autolinker#mention}\n\t * for available values.\n\t */\n\tprivate readonly serviceName: MentionServices = 'twitter' // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @cfg {String} mention (required)\n\t *\n\t * The Mention that was matched, without the '@' character.\n\t */\n\tprivate readonly mention: string = '' // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @method constructor\n\t * @param {Object} cfg The configuration properties for the Match\n\t * instance, specified in an Object (map).\n\t */\n\tconstructor (cfg: MentionMatchConfig) {\n\t\tsuper(cfg)\n\n\t\tthis.mention = cfg.mention\n\t\tthis.serviceName = cfg.serviceName\n\t}\n\n\t/**\n\t * Returns a string name for the type of match that this class represents.\n\t * For the case of MentionMatch, returns 'mention'.\n\t *\n\t * @return {String}\n\t */\n\tgetType () {\n\t\treturn 'mention'\n\t}\n\n\t/**\n\t * Returns the mention, without the '@' character.\n\t *\n\t * @return {String}\n\t */\n\tgetMention () {\n\t\treturn this.mention\n\t}\n\n\t/**\n\t * Returns the configured {@link #serviceName} to point the mention to.\n\t * Ex: 'instagram', 'twitter', 'soundcloud'.\n\t *\n\t * @return {String}\n\t */\n\tgetServiceName () {\n\t\treturn this.serviceName\n\t}\n\n\t/**\n\t * Returns the anchor href that should be generated for the match.\n\t *\n\t * @return {String}\n\t */\n\tgetAnchorHref () {\n\t\tswitch (this.serviceName) {\n\t\t\tcase 'mastodon':\n\t\t\t\treturn 'https://example.com/' + this.mention\n\t\t\tcase 'twitter':\n\t\t\t\treturn 'https://twitter.com/' + this.mention\n\t\t\tcase 'instagram':\n\t\t\t\treturn 'https://instagram.com/' + this.mention\n\t\t\tcase 'soundcloud':\n\t\t\t\treturn 'https://soundcloud.com/' + this.mention\n\n\t\t\tdefault:\n\t\t\t\t// Shouldn't happen because Autolinker's constructor should block any invalid values, but just in case.\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'Unknown service name to point mention to: ' + this.serviceName\n\t\t\t\t)\n\t\t}\n\t}\n\n\t/**\n\t * Returns the anchor text that should be generated for the match.\n\t *\n\t * @return {String}\n\t */\n\tgetAnchorText () {\n\t\treturn '@' + this.mention\n\t}\n\n\t/**\n\t * Returns the CSS class suffixes that should be used on a tag built with\n\t * the match. See {@link Autolinker.match.Match#getCssClassSuffixes} for\n\t * details.\n\t *\n\t * @return {String[]}\n\t */\n\tgetCssClassSuffixes () {\n\t\tlet cssClassSuffixes = super.getCssClassSuffixes(),\n\t\t\tserviceName = this.getServiceName()\n\n\t\tif (serviceName) {\n\t\t\tcssClassSuffixes.push(serviceName)\n\t\t}\n\t\treturn cssClassSuffixes\n\t}\n}\n\nexport interface MentionMatchConfig extends MatchConfig {\n\tserviceName: MentionServices\n\tmention: string\n}\n"]}

View File

@ -1 +0,0 @@
{"version":3,"sources":["../src/match/phone-match.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAe,MAAM,SAAS,CAAC;AAE7C;;;;;;;;;GASG;AACH;IAAgC,sCAAK;IAwBpC;;;;OAIG;IACH,oBAAa,GAAqB;QAAlC,YACC,kBAAO,GAAG,CAAE,SAIZ;QAhCD;;;;;;;WAOG;QACc,YAAM,GAAW,EAAE,CAAC,CAAE,gGAAgG;QAEvI;;;;;;;;WAQG;QACc,cAAQ,GAAY,KAAK,CAAC,CAAE,gGAAgG;QAW5I,KAAI,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;QACzB,KAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;;IAC9B,CAAC;IAGD;;;;;OAKG;IACH,4BAAO,GAAP;QACC,OAAO,OAAO,CAAC;IAChB,CAAC;IAGD;;;;;;;OAOG;IACH,mCAAc,GAAd;QACC,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAGD;;;;;;;OAOG;IACH,8BAAS,GAAT;QACC,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC;IAC9B,CAAC;IAGD;;;;OAIG;IACH,kCAAa,GAAb;QACC,OAAO,MAAM,GAAG,CAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAE,GAAG,IAAI,CAAC,MAAM,CAAC;IAC5D,CAAC;IAGD;;;;OAIG;IACH,kCAAa,GAAb;QACC,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAEF,iBAAC;AAAD,CA7FA,AA6FC,CA7F+B,KAAK,GA6FpC","file":"phone-match.js","sourcesContent":["import { Match, MatchConfig } from \"./match\";\n\n/**\n * @class Autolinker.match.Phone\n * @extends Autolinker.match.Match\n *\n * Represents a Phone number match found in an input string which should be\n * Autolinked.\n *\n * See this class's superclass ({@link Autolinker.match.Match}) for more\n * details.\n */\nexport class PhoneMatch extends Match {\n\n\t/**\n\t * @protected\n\t * @property {String} number (required)\n\t *\n\t * The phone number that was matched, without any delimiter characters.\n\t *\n\t * Note: This is a string to allow for prefixed 0's.\n\t */\n\tprivate readonly number: string = ''; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\t/**\n\t * @protected\n\t * @property {Boolean} plusSign (required)\n\t *\n\t * `true` if the matched phone number started with a '+' sign. We'll include\n\t * it in the `tel:` URL if so, as this is needed for international numbers.\n\t *\n\t * Ex: '+1 (123) 456 7879'\n\t */\n\tprivate readonly plusSign: boolean = false; // default value just to get the above doc comment in the ES5 output and documentation generator\n\n\n\t/**\n\t * @method constructor\n\t * @param {Object} cfg The configuration properties for the Match\n\t * instance, specified in an Object (map).\n\t */\n\tconstructor( cfg: PhoneMatchConfig ) {\n\t\tsuper( cfg );\n\n\t\tthis.number = cfg.number;\n\t\tthis.plusSign = cfg.plusSign;\n\t}\n\n\n\t/**\n\t * Returns a string name for the type of match that this class represents.\n\t * For the case of PhoneMatch, returns 'phone'.\n\t *\n\t * @return {String}\n\t */\n\tgetType() {\n\t\treturn 'phone';\n\t}\n\n\n\t/**\n\t * Returns the phone number that was matched as a string, without any \n\t * delimiter characters. \n\t *\n\t * Note: This is a string to allow for prefixed 0's.\n\t *\n\t * @return {String}\n\t */\n\tgetPhoneNumber() {\n\t\treturn this.number;\n\t}\n\n\n\t/**\n\t * Alias of {@link #getPhoneNumber}, returns the phone number that was \n\t * matched as a string, without any delimiter characters.\n\t *\n\t * Note: This is a string to allow for prefixed 0's.\n\t *\n\t * @return {String}\n\t */\n\tgetNumber() {\n\t\treturn this.getPhoneNumber();\n\t}\n\n\n\t/**\n\t * Returns the anchor href that should be generated for the match.\n\t *\n\t * @return {String}\n\t */\n\tgetAnchorHref() {\n\t\treturn 'tel:' + ( this.plusSign ? '+' : '' ) + this.number;\n\t}\n\n\n\t/**\n\t * Returns the anchor text that should be generated for the match.\n\t *\n\t * @return {String}\n\t */\n\tgetAnchorText() {\n\t\treturn this.matchedText;\n\t}\n\n}\n\n\nexport interface PhoneMatchConfig extends MatchConfig {\n\tnumber: string;\n\tplusSign: boolean;\n}"]}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
{"version":3,"sources":["../src/matcher/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC","file":"index.js","sourcesContent":["export * from './email-matcher';\nexport * from './hashtag-matcher';\nexport * from './matcher';\nexport * from './mention-matcher';\nexport * from './phone-matcher';\nexport * from './url-matcher';\n"]}

View File

@ -1 +0,0 @@
{"version":3,"sources":["../src/matcher/matcher.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH;IAcC;;;;OAIG;IACH,iBAAa,GAAkB;QAjB/B;;;;;WAKG;QACK,yBAAoB,GAAG,IAAI,CAAC,CAAE,kGAAkG;QAYvI,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;IAClC,CAAC;IAaF,cAAC;AAAD,CAlCA,AAkCC,IAAA","file":"matcher.js","sourcesContent":["import { AnchorTagBuilder } from \"../anchor-tag-builder\";\nimport { Match } from \"../match/match\";\n\n/**\n * @abstract\n * @class Autolinker.matcher.Matcher\n *\n * An abstract class and interface for individual matchers to find matches in\n * an input string with linkified versions of them.\n *\n * Note that Matchers do not take HTML into account - they must be fed the text\n * nodes of any HTML string, which is handled by {@link Autolinker#parse}.\n */\nexport abstract class Matcher {\n\n\t/**\n\t * @cfg {Autolinker.AnchorTagBuilder} tagBuilder (required)\n\t *\n\t * Reference to the AnchorTagBuilder instance to use to generate HTML tags\n\t * for {@link Autolinker.match.Match Matches}.\n\t */\n\tprivate __jsduckDummyDocProp = null; // property used just to get the above doc comment into the ES5 output and documentation generator\n\n\t// Actual property for the above jsdoc comment\n\tprotected tagBuilder: AnchorTagBuilder;\n\n\n\t/**\n\t * @method constructor\n\t * @param {Object} cfg The configuration properties for the Matcher\n\t * instance, specified in an Object (map).\n\t */\n\tconstructor( cfg: MatcherConfig ) {\n\t\tthis.tagBuilder = cfg.tagBuilder;\n\t}\n\n\n\t/**\n\t * Parses the input `text` and returns the array of {@link Autolinker.match.Match Matches}\n\t * for the matcher.\n\t *\n\t * @abstract\n\t * @param {String} text The text to scan and replace matches in.\n\t * @return {Autolinker.match.Match[]}\n\t */\n\tabstract parseMatches( text: string ): Match[];\n\n}\n\nexport interface MatcherConfig {\n\ttagBuilder: AnchorTagBuilder;\n}"]}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
{"version":3,"sources":["../src/matcher/phone-matcher.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,8EAA8E;AAC9E,8EAA8E;AAC9E,yEAAyE;AACzE,6GAA6G;AAC7G,gFAAgF;AAChF,IAAM,iBAAiB,GAAG,uRAAuR,CAAC;AAElT;;;;;;;;GAQG;AACH;IAAkC,wCAAO;IAAzC;QAAA,qEA2DC;QAzDA;;;;;;;;;;;;;;;;;WAiBG;QACO,kBAAY,GAAG,iBAAiB,CAAC;;IAuC5C,CAAC;IArCA;;OAEG;IACH,mCAAY,GAAZ,UAAc,IAAY;QACzB,IAAI,YAAY,GAAG,IAAI,CAAC,YAAY,EACnC,UAAU,GAAG,IAAI,CAAC,UAAU,EAC5B,OAAO,GAAY,EAAE,EACrB,KAA6B,CAAC;QAE/B,OAAO,CAAE,KAAK,GAAG,YAAY,CAAC,IAAI,CAAE,IAAI,CAAE,CAAE,KAAK,IAAI,EAAG;YACvD,qDAAqD;YACrD,IAAI,WAAW,GAAG,KAAK,CAAE,CAAC,CAAE,EAC3B,WAAW,GAAG,WAAW,CAAC,OAAO,CAAE,YAAY,EAAE,EAAE,CAAE,EAAE,+DAA+D;YACtH,QAAQ,GAAG,CAAC,CAAC,CAAE,KAAK,CAAE,CAAC,CAAE,IAAI,KAAK,CAAE,CAAC,CAAE,CAAE,EAAE,sEAAsE;YACjH,MAAM,GAAG,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAE,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAE,EAClE,KAAK,GAAG,IAAI,CAAC,MAAM,CAAE,KAAK,CAAC,KAAK,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,CAAE,EAC1D,YAAY,GAAG,CAAC,MAAM,CAAC,KAAK,CAAE,IAAI,CAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAE,IAAI,CAAE,CAAC;YAE9D,IAAI,IAAI,CAAC,SAAS,CAAE,KAAK,CAAE,CAAC,CAAE,CAAE,IAAI,IAAI,CAAC,SAAS,CAAE,WAAW,CAAE,IAAI,YAAY,EAAG;gBACnF,OAAO,CAAC,IAAI,CAAE,IAAI,UAAU,CAAE;oBAC7B,UAAU,EAAE,UAAU;oBACtB,WAAW,EAAE,WAAW;oBACxB,MAAM,EAAE,KAAK,CAAC,KAAK;oBACnB,MAAM,EAAE,WAAW;oBACnB,QAAQ,EAAE,QAAQ;iBAClB,CAAE,CAAE,CAAC;aACN;SACD;QAED,OAAO,OAAO,CAAC;IAChB,CAAC;IAGS,gCAAS,GAAnB,UAAqB,IAAY;QAChC,OAAO,UAAU,CAAC,IAAI,CAAE,IAAI,CAAE,CAAC;IAChC,CAAC;IAEF,mBAAC;AAAD,CA3DA,AA2DC,CA3DiC,OAAO,GA2DxC","file":"phone-matcher.js","sourcesContent":["import { Matcher } from \"./matcher\";\nimport { PhoneMatch } from \"../match/phone-match\";\nimport { Match } from \"../match/match\";\nimport { nonDigitRe } from '../regex-lib';\n\n// RegExp objects which are shared by all instances of PhoneMatcher. These are\n// here to avoid re-instantiating the RegExp objects if `Autolinker.link()` is\n// called multiple times, thus instantiating PhoneMatcher and its RegExp \n// objects each time (which is very expensive - see https://github.com/gregjacobs/Autolinker.js/issues/314). \n// See descriptions of the properties where they are used for details about them\nconst phoneMatcherRegex = /(?:(?:(?:(\\+)?\\d{1,3}[-\\040.]?)?\\(?\\d{3}\\)?[-\\040.]?\\d{3}[-\\040.]?\\d{4})|(?:(\\+)(?:9[976]\\d|8[987530]\\d|6[987]\\d|5[90]\\d|42\\d|3[875]\\d|2[98654321]\\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\\040.]?(?:\\d[-\\040.]?){6,12}\\d+))([,;]+[0-9]+#?)*/g;\n\n/**\n * @class Autolinker.matcher.Phone\n * @extends Autolinker.matcher.Matcher\n *\n * Matcher to find Phone number matches in an input string.\n *\n * See this class's superclass ({@link Autolinker.matcher.Matcher}) for more\n * details.\n */\nexport class PhoneMatcher extends Matcher {\n\n\t/**\n\t * The regular expression to match Phone numbers. Example matches:\n\t *\n\t * (123) 456-7890\n\t * 123 456 7890\n\t * 123-456-7890\n\t * +18004441234,,;,10226420346#\n\t * +1 (800) 444 1234\n\t * 10226420346#\n\t * 1-800-444-1234,1022,64,20346#\n\t *\n\t * This regular expression has the following capturing groups:\n\t *\n\t * 1 or 2. The prefixed '+' sign, if there is one.\n\t *\n\t * @protected\n\t * @property {RegExp} matcherRegex\n\t */\n\tprotected matcherRegex = phoneMatcherRegex;\n\n\t/**\n\t * @inheritdoc\n\t */\n\tparseMatches( text: string ) {\n\t\tlet matcherRegex = this.matcherRegex,\n\t\t\ttagBuilder = this.tagBuilder,\n\t\t\tmatches: Match[] = [],\n\t\t\tmatch: RegExpExecArray | null;\n\n\t\twhile( ( match = matcherRegex.exec( text ) ) !== null ) {\n\t\t\t// Remove non-numeric values from phone number string\n\t\t\tvar matchedText = match[ 0 ],\n\t\t\t\tcleanNumber = matchedText.replace( /[^0-9,;#]/g, '' ), // strip out non-digit characters exclude comma semicolon and #\n\t\t\t\tplusSign = !!( match[ 1 ] || match[ 2 ] ), // match[ 1 ] or match[ 2 ] is the prefixed plus sign, if there is one\n\t\t\t\tbefore = match.index == 0 ? '' : text.substr( match.index - 1, 1 ),\n\t\t\t\tafter = text.substr( match.index + matchedText.length, 1 ),\n\t\t\t\tcontextClear = !before.match( /\\d/ ) && !after.match( /\\d/ );\n\n\t\t\tif( this.testMatch( match[ 3 ] ) && this.testMatch( matchedText ) && contextClear ) {\n\t\t\t\tmatches.push( new PhoneMatch( {\n\t\t\t\t\ttagBuilder: tagBuilder,\n\t\t\t\t\tmatchedText: matchedText,\n\t\t\t\t\toffset: match.index,\n\t\t\t\t\tnumber: cleanNumber,\n\t\t\t\t\tplusSign: plusSign\n\t\t\t\t} ) );\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t}\n\n\n\tprotected testMatch( text: string ) {\n\t\treturn nonDigitRe.test( text );\n\t}\n\n}\n"]}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
{"version":3,"sources":["../src/truncate/truncate-end.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAE,UAAkB,EAAE,WAAmB,EAAE,aAAsB;IAC3F,OAAO,QAAQ,CAAE,UAAU,EAAE,WAAW,EAAE,aAAa,CAAE,CAAC;AAC3D,CAAC","file":"truncate-end.js","sourcesContent":["import { ellipsis } from \"../utils\";\n\n/**\n * A truncation feature where the ellipsis will be placed at the end of the URL.\n *\n * @param {String} anchorText\n * @param {Number} truncateLen The maximum length of the truncated output URL string.\n * @param {String} ellipsisChars The characters to place within the url, e.g. \"..\".\n * @return {String} The truncated URL.\n */\nexport function truncateEnd( anchorText: string, truncateLen: number, ellipsisChars?: string){\n\treturn ellipsis( anchorText, truncateLen, ellipsisChars );\n}\n"]}

View File

@ -1 +0,0 @@
{"version":3,"sources":["../src/truncate/truncate-middle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc,CAAE,GAAW,EAAE,WAAmB,EAAE,aAAsB;IACtF,IAAI,GAAG,CAAC,MAAM,IAAI,WAAW,EAAE;QAC7B,OAAO,GAAG,CAAC;KACZ;IAED,IAAI,2BAAmC,CAAC;IACxC,IAAI,cAAsB,CAAC;IAE3B,IAAG,aAAa,IAAI,IAAI,EAAE;QACxB,aAAa,GAAG,UAAU,CAAC;QAC3B,2BAA2B,GAAG,CAAC,CAAC;QAChC,cAAc,GAAG,CAAC,CAAC;KACpB;SAAM;QACL,2BAA2B,GAAG,aAAa,CAAC,MAAM,CAAC;QACnD,cAAc,GAAG,aAAa,CAAC,MAAM,CAAC;KACvC;IAED,IAAI,eAAe,GAAG,WAAW,GAAG,cAAc,CAAC;IACnD,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,eAAe,GAAG,CAAC,EAAE;QACvB,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAC,IAAI,CAAC,KAAK,CAAC,eAAe,GAAC,CAAC,CAAC,CAAC,CAAC;KACtD;IACD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe,GAAC,CAAC,CAAC,CAAC,GAAG,aAAa,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,eAAe,GAAG,2BAA2B,CAAC,CAAC;AACtI,CAAC","file":"truncate-middle.js","sourcesContent":["/**\n * Date: 2015-10-05\n * Author: Kasper Søfren <soefritz@gmail.com> (https://github.com/kafoso)\n *\n * A truncation feature, where the ellipsis will be placed in the dead-center of the URL.\n *\n * @param {String} url A URL.\n * @param {Number} truncateLen The maximum length of the truncated output URL string.\n * @param {String} ellipsisChars The characters to place within the url, e.g. \"..\".\n * @return {String} The truncated URL.\n */\nexport function truncateMiddle( url: string, truncateLen: number, ellipsisChars?: string ){\n if (url.length <= truncateLen) {\n return url;\n }\n\n let ellipsisLengthBeforeParsing: number;\n let ellipsisLength: number;\n\n if(ellipsisChars == null) {\n ellipsisChars = '&hellip;';\n ellipsisLengthBeforeParsing = 8;\n ellipsisLength = 3;\n } else {\n ellipsisLengthBeforeParsing = ellipsisChars.length;\n ellipsisLength = ellipsisChars.length;\n }\n\n let availableLength = truncateLen - ellipsisLength;\n let end = \"\";\n if (availableLength > 0) {\n end = url.substr((-1)*Math.floor(availableLength/2));\n }\n return (url.substr(0, Math.ceil(availableLength/2)) + ellipsisChars + end).substr(0, availableLength + ellipsisLengthBeforeParsing);\n}\n"]}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -21,7 +21,7 @@ import {
Text,
View
} from 'react-native'
import { Chase } from 'react-native-animated-spinkit'
import { Circle } from 'react-native-animated-spinkit'
import { FlatList, ScrollView } from 'react-native-gesture-handler'
import { SafeAreaView } from 'react-native-safe-area-context'
@ -191,7 +191,7 @@ const ScreenAnnouncements: React.FC<ScreenAnnouncementsProp> = ({
alignItems: 'center'
}}
>
<Chase size={StyleConstants.Font.Size.L} color={theme.secondary} />
<Circle size={StyleConstants.Font.Size.L} color={theme.secondary} />
</View>
)
}, [])

View File

@ -1,7 +1,7 @@
import client from '@api/client'
import Icon from '@components/Icon'
import ComponentSeparator from '@components/Separator'
import HeaderSharedCreated from '@components/Timelines/Timeline/Shared/HeaderShared/Created'
import HeaderSharedCreated from '@components/Timeline/Shared/HeaderShared/Created'
import { useNavigation } from '@react-navigation/native'
import { getLocalDrafts, removeLocalDraft } from '@utils/slices/instancesSlice'
import { StyleConstants } from '@utils/styles/constants'

View File

@ -1,4 +1,4 @@
import AttachmentVideo from '@components/Timelines/Timeline/Shared/Attachment/Video'
import AttachmentVideo from '@components/Timeline/Shared/Attachment/Video'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React, {

View File

@ -6,7 +6,7 @@ import { useTheme } from '@utils/styles/ThemeManager'
import { forEach, groupBy, sortBy } from 'lodash'
import React, { useCallback, useContext, useEffect, useMemo } from 'react'
import { FlatList, StyleSheet, View } from 'react-native'
import { Chase } from 'react-native-animated-spinkit'
import { Circle } from 'react-native-animated-spinkit'
import ComposeActions from './Root/Actions'
import ComposePosting from './Posting'
import ComposeRootFooter from './Root/Footer'
@ -59,7 +59,7 @@ const ComposeRoot: React.FC = () => {
if (isFetching) {
return (
<View key='listEmpty' style={styles.loading}>
<Chase
<Circle
size={StyleConstants.Font.Size.M * 1.25}
color={theme.secondary}
/>

View File

@ -16,7 +16,7 @@ import React, {
} from 'react'
import { useTranslation } from 'react-i18next'
import { FlatList, Pressable, StyleSheet, Text, View } from 'react-native'
import { Chase } from 'react-native-animated-spinkit'
import { Circle } from 'react-native-animated-spinkit'
import FastImage from 'react-native-fast-image'
import ComposeContext from '../../utils/createContext'
import { ExtendedAttachment } from '../../utils/types'
@ -140,8 +140,8 @@ const ComposeAttachments: React.FC = () => {
{ backgroundColor: theme.backgroundOverlay }
]}
>
<Chase
size={StyleConstants.Font.Size.L * 1.5}
<Circle
size={StyleConstants.Font.Size.L}
color={theme.primaryOverlay}
/>
</View>

View File

@ -1,8 +1,8 @@
import TimelineDefault from '@components/Timeline/Default'
import { useTheme } from '@utils/styles/ThemeManager'
import ComposeContext from '../../utils/createContext'
import React, { useContext } from 'react'
import { StyleSheet, View } from 'react-native'
import TimelineDefault from '@root/components/Timelines/Timeline/Default'
import ComposeContext from '../../utils/createContext'
const ComposeReply: React.FC = () => {
const {

View File

@ -7,7 +7,6 @@ const composeReducer = (
switch (action.type) {
case 'loadDraft':
const draft = action.payload
console.log(draft.text)
return {
...state,
...(draft.spoiler?.length && {

View File

@ -1,6 +1,6 @@
import analytics from '@components/analytics'
import { HeaderCenter, HeaderRight } from '@components/Header'
import Timeline from '@components/Timelines/Timeline'
import Timeline from '@components/Timeline'
import { BottomTabScreenProps } from '@react-navigation/bottom-tabs'
import { ScreenTabsParamList } from '@screens/Tabs'
import { getLocalActiveIndex } from '@utils/slices/instancesSlice'

View File

@ -1,9 +1,11 @@
import Timeline from '@components/Timeline'
import React from 'react'
import Timeline from '@components/Timelines/Timeline'
const ScreenMeBookmarks: React.FC = () => {
return <Timeline page='Bookmarks' />
}
const ScreenMeBookmarks = React.memo(
() => {
return <Timeline page='Bookmarks' />
},
() => true
)
export default ScreenMeBookmarks

View File

@ -1,9 +1,11 @@
import Timeline from '@components/Timeline'
import React from 'react'
import Timeline from '@components/Timelines/Timeline'
const ScreenMeConversations: React.FC = () => {
return <Timeline page='Conversations' />
}
const ScreenMeConversations = React.memo(
() => {
return <Timeline page='Conversations' />
},
() => true
)
export default ScreenMeConversations

View File

@ -1,9 +1,11 @@
import Timeline from '@components/Timeline'
import React from 'react'
import Timeline from '@components/Timelines/Timeline'
const ScreenMeFavourites: React.FC = () => {
return <Timeline page='Favourites' />
}
const ScreenMeFavourites = React.memo(
() => {
return <Timeline page='Favourites' />
},
() => true
)
export default ScreenMeFavourites

View File

@ -1,6 +1,6 @@
import { MenuRow } from '@components/Menu'
import TimelineEmpty from '@components/Timeline/Empty'
import { StackScreenProps } from '@react-navigation/stack'
import TimelineEmpty from '@root/components/Timelines/Timeline/Empty'
import { useListsQuery } from '@utils/queryHooks/lists'
import React, { useMemo } from 'react'

View File

@ -1,18 +1,11 @@
import Timeline from '@components/Timeline'
import { StackScreenProps } from '@react-navigation/stack'
import React from 'react'
import Timeline from '@components/Timelines/Timeline'
// Show remote hashtag? Only when private, show local version?
export interface Props {
route: {
params: {
list: string
}
}
}
const ScreenMeListsList: React.FC<Props> = ({
const ScreenMeListsList: React.FC<StackScreenProps<
Nav.TabMeStackParamList,
'Tab-Me-Lists-List'
>> = ({
route: {
params: { list }
}

View File

@ -25,7 +25,7 @@ const SettingsApp: React.FC = () => {
const settingsLanguage = useSelector(getSettingsLanguage)
const settingsTheme = useSelector(getSettingsTheme)
const settingsBrowser = useSelector(getSettingsBrowser)
console.log(settingsLanguage)
return (
<MenuContainer>
<MenuRow

View File

@ -1,5 +1,5 @@
import { HeaderCenter } from '@components/Header'
import Timeline from '@components/Timelines/Timeline'
import Timeline from '@components/Timeline'
import sharedScreens from '@screens/Tabs/Shared/sharedScreens'
import { updateLocalNotification } from '@utils/slices/instancesSlice'
import React, { useCallback, useMemo } from 'react'

View File

@ -1,6 +1,6 @@
import analytics from '@components/analytics'
import { HeaderRight } from '@components/Header'
import Timeline from '@components/Timelines/Timeline'
import Timeline from '@components/Timeline'
import SegmentedControl from '@react-native-community/segmented-control'
import { useNavigation } from '@react-navigation/native'
import sharedScreens from '@screens/Tabs/Shared/sharedScreens'

View File

@ -1,6 +1,6 @@
import analytics from '@components/analytics'
import { HeaderRight } from '@components/Header'
import Timeline from '@components/Timelines/Timeline'
import Timeline from '@components/Timeline'
import { useAccountQuery } from '@utils/queryHooks/account'
import { useTheme } from '@utils/styles/ThemeManager'
import React, { useCallback, useEffect, useMemo, useReducer } from 'react'

View File

@ -1,4 +1,4 @@
import Timeline from '@components/Timelines/Timeline'
import Timeline from '@components/Timeline'
import React from 'react'
import { SharedAttachmentsProp } from './sharedScreens'

View File

@ -1,4 +1,4 @@
import Timeline from '@components/Timelines/Timeline'
import Timeline from '@components/Timeline'
import React from 'react'
import { SharedHashtagProp } from './sharedScreens'

View File

@ -1,7 +1,7 @@
import ComponentAccount from '@components/Account'
import ComponentSeparator from '@components/Separator'
import TimelineEmpty from '@components/Timelines/Timeline/Empty'
import TimelineEnd from '@components/Timelines/Timeline/End'
import TimelineEmpty from '@components/Timeline/Empty'
import TimelineEnd from '@components/Timeline/End'
import { useScrollToTop } from '@react-navigation/native'
import { useRelationshipsQuery } from '@utils/queryHooks/relationships'
import React, { useCallback, useMemo, useRef } from 'react'

View File

@ -1,7 +1,7 @@
import ComponentAccount from '@components/Account'
import ComponentHashtag from '@components/Hashtag'
import ComponentSeparator from '@components/Separator'
import TimelineDefault from '@components/Timelines/Timeline/Default'
import TimelineDefault from '@components/Timeline/Default'
import { useSearchQuery } from '@utils/queryHooks/search'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
@ -15,7 +15,7 @@ import {
Text,
View
} from 'react-native'
import { Chase } from 'react-native-animated-spinkit'
import { Circle } from 'react-native-animated-spinkit'
export interface Props {
searchTerm: string | undefined
@ -76,7 +76,7 @@ const TabSharedSearch: React.FC<Props> = ({ searchTerm }) => {
<View>
{status === 'loading' ? (
<View style={styles.loading}>
<Chase
<Circle
size={StyleConstants.Font.Size.M * 1.25}
color={theme.secondary}
/>

View File

@ -1,4 +1,4 @@
import Timeline from '@components/Timelines/Timeline'
import Timeline from '@components/Timeline'
import React from 'react'
import { SharedTootProp } from './sharedScreens'