diff --git a/jest.config.js b/jest.config.js deleted file mode 100644 index 91a2d2c..0000000 --- a/jest.config.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', -}; \ No newline at end of file diff --git a/public/index.html b/public/index.html deleted file mode 100644 index 823d8d4..0000000 --- a/public/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - -
- - - -
- /join{' '}
-
- {link.identifier}
-
-
-
- );
- case LinkKind.UserId:
- return (
-
- Type{' '}
-
- /invite{' '}
-
- {link.identifier}
-
-
-
- );
- default:
- return Nheko doesn't support this kind of link;
- }
- },
- copyString: (link) => {
- switch (link.kind) {
- case LinkKind.Alias:
- case LinkKind.RoomId:
- return `/join ${link.identifier}`;
- case LinkKind.UserId:
- return `/invite ${link.identifier}`;
- default:
- return '';
- }
- },
- linkSupport: (link) => {
- switch (link.kind) {
- case LinkKind.Alias:
- case LinkKind.RoomId:
- case LinkKind.UserId:
- return true;
- default:
- return false;
- }
- },
- description:
- 'A native desktop app for Matrix that feels more like a mainstream chat app.',
- installLinks: [],
-};
-
-export default Nheko;
diff --git a/src/clients/Weechat.tsx b/src/clients/Weechat.tsx
deleted file mode 100644
index 805a4b2..0000000
--- a/src/clients/Weechat.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
-Copyright 2020 The Matrix.org Foundation C.I.C.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-import React from 'react';
-
-import { TextClient, Maturity, ClientKind, ClientId, Platform } from './types';
-
-import { LinkKind } from '../parser/types';
-
-import logo from '../imgs/weechat.svg';
-
-const Weechat: TextClient = {
- kind: ClientKind.TEXT_CLIENT,
- name: 'Weechat',
- logo: logo,
- author: 'Poljar',
- homepage: 'https://github.com/poljar/weechat-matrix',
- maturity: Maturity.LATE_BETA,
- experimental: false,
- platforms: [Platform.Desktop],
- clientId: ClientId.WeeChat,
- toInviteString: (link) => {
- switch (link.kind) {
- case LinkKind.Alias:
- case LinkKind.RoomId:
- return (
-
- Type{' '}
-
- /join{' '}
-
- {link.identifier}
-
-
-
- );
- case LinkKind.UserId:
- return (
-
- Type{' '}
-
- /invite{' '}
-
- {link.identifier}
-
-
-
- );
- default:
- return Weechat doesn't support this kind of link;
- }
- },
- copyString: (link) => {
- switch (link.kind) {
- case LinkKind.Alias:
- case LinkKind.RoomId:
- return `/join ${link.identifier}`;
- case LinkKind.UserId:
- return `/invite ${link.identifier}`;
- default:
- return '';
- }
- },
- linkSupport: (link) => {
- switch (link.kind) {
- case LinkKind.Alias:
- case LinkKind.RoomId:
- case LinkKind.UserId:
- return true;
- default:
- return false;
- }
- },
-
- description: 'Command-line Matrix interface using Weechat',
- installLinks: [],
-};
-
-export default Weechat;
diff --git a/src/clients/index.ts b/src/clients/index.ts
deleted file mode 100644
index a00cd71..0000000
--- a/src/clients/index.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-Copyright 2020 The Matrix.org Foundation C.I.C.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-import { Client } from './types';
-
-import { Element, ElementDevelop } from './Element';
-import Weechat from './Weechat';
-import Nheko from './Nheko';
-import Fractal from './Fractal';
-
-/*
- * All the supported clients of matrix.to
- */
-const clients: Client[] = [Element, Weechat, Nheko, Fractal, ElementDevelop];
-
-/*
- * A map from sharer string to client.
- * Configured by hand so we can change the mappings
- * easily later.
- */
-export const clientMap: { [key: string]: Client } = {
- [Element.clientId]: Element,
- [Weechat.clientId]: Weechat,
- [ElementDevelop.clientId]: ElementDevelop,
- [Nheko.clientId]: Nheko,
- [Fractal.clientId]: Fractal,
-};
-
-/*
- * All the supported clients of matrix.to
- */
-export default clients;
diff --git a/src/clients/types.ts b/src/clients/types.ts
deleted file mode 100644
index 9c4c266..0000000
--- a/src/clients/types.ts
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
-Copyright 2020 The Matrix.org Foundation C.I.C.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-import { SafeLink } from '../parser/types';
-
-/*
- * A collection of descriptive tags that can be added to
- * a clients description.
- */
-export enum Platform {
- iOS = 'iOS',
- Android = 'ANDROID',
- Desktop = 'DESKTOP',
-}
-
-/*
- * A collection of states used for describing a clients maturity.
- */
-export enum Maturity {
- ALPHA = 'ALPHA',
- LATE_ALPHA = 'LATE ALPHA',
- BETA = 'BETA',
- LATE_BETA = 'LATE_BETA',
- STABLE = 'STABLE',
-}
-
-/*
- * Used for constructing the discriminated union of all client types.
- */
-export enum ClientKind {
- LINKED_CLIENT = 'LINKED_CLIENT',
- TEXT_CLIENT = 'TEXT_CLIENT',
-}
-
-export enum ClientId {
- Element = 'element.io',
- ElementDevelop = 'develop.element.io',
- WeeChat = 'weechat',
- Nheko = 'nheko',
- Fractal = 'fractal',
-}
-
-/**
- * Define a native distribution channel for a client.
- * E.g App store for apple, PlayStore or F-Droid for Android
- */
-export interface InstallLink {
- createInstallURL(deepLink: SafeLink) : string;
- // in AppleStoreLink, we can set the cookie here for deeplinking
- // onInstallChosen(deepLink: SafeLink);
- platform: Platform;
- channelId: string;
- description: string;
-}
-
-export class AppleStoreLink implements InstallLink {
- constructor(private org: string, private appId: string) {}
-
- createInstallURL(deepLink: SafeLink) : string {
- return `https://apps.apple.com/app/${encodeURIComponent(this.org)}/${encodeURIComponent(this.appId)}`;
- }
-
- get platform() : Platform {
- return Platform.iOS;
- }
-
- get channelId(): string {
- return "apple-app-store";
- }
-
- get description() {
- return "Download on the App Store";
- }
-}
-
-export class PlayStoreLink implements InstallLink {
- constructor(private appId: string) {}
-
- createInstallURL(deepLink: SafeLink) : string {
- return `https://play.google.com/store/apps/details?id=${encodeURIComponent(this.appId)}&referrer=${encodeURIComponent(deepLink.originalLink)}`;
- }
-
- get platform() : Platform {
- return Platform.Android;
- }
-
- get channelId(): string {
- return "play-store";
- }
-
- get description() {
- return "Get it on Google Play";
- }
-}
-
-export class FDroidLink implements InstallLink {
- constructor(private appId: string) {}
-
- createInstallURL(deepLink: SafeLink) : string {
- return `https://f-droid.org/packages/${encodeURIComponent(this.appId)}`;
- }
-
- get platform() : Platform {
- return Platform.Android;
- }
-
- get channelId(): string {
- return "fdroid";
- }
-
- get description() {
- return "Get it on F-Droid";
- }
-}
-
-/*
- * The descriptive details of a client
- */
-export interface ClientDescription {
- name: string;
- author: string;
- homepage: string;
- logo: string;
- description: string;
- platforms: Platform[];
- maturity: Maturity;
- clientId: ClientId;
- experimental: boolean;
- linkSupport: (link: SafeLink) => boolean;
- installLinks: InstallLink[];
-}
-
-/*
- * A client which can be opened using a link with the matrix resource.
- */
-export interface LinkedClient extends ClientDescription {
- kind: ClientKind.LINKED_CLIENT;
- toUrl(parsedLink: SafeLink): URL;
-}
-
-/*
- * A client which provides isntructions for how to access the descired
- * resource.
- */
-export interface TextClient extends ClientDescription {
- kind: ClientKind.TEXT_CLIENT;
- toInviteString(parsedLink: SafeLink): JSX.Element;
- copyString(parsedLink: SafeLink): string;
-}
-
-/*
- * A description for a client as well as a method for converting matrix.to
- * links to the client's specific representation.
- */
-export type Client = LinkedClient | TextClient;
diff --git a/src/components/Avatar.scss b/src/components/Avatar.scss
deleted file mode 100644
index 6767f2a..0000000
--- a/src/components/Avatar.scss
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-Copyright 2020 The Matrix.org Foundation C.I.C.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-@import '../color-scheme';
-
-.avatar {
- border-radius: 100%;
- border: 1px solid $borders;
- height: 60px;
- width: 60px;
-}
-
-.avatarNoCrop {
- border-radius: 0;
- border: 0;
-}
diff --git a/src/components/Avatar.stories.tsx b/src/components/Avatar.stories.tsx
deleted file mode 100644
index 1032c18..0000000
--- a/src/components/Avatar.stories.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-Copyright 2020 The Matrix.org Foundation C.I.C.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// disable camelcase check because our object keys come
-// from the matrix spec
-/* eslint-disable @typescript-eslint/camelcase */
-
-import React from 'react';
-
-import { UserAvatar } from './Avatar';
-
-export default {
- title: 'Avatar',
- parameters: {
- design: {
- type: 'figma',
- url:
- 'https://www.figma.com/file/WSXjCGc1k6FVI093qhlzOP/04-Recieving-share-link?node-id=143%3A5853',
- },
- },
-};
-
-export const Default: React.FC<{}> = () => (
- {client.toInviteString(link)}
- ) : null; - - const { uaResults } = useContext(UAContext); - - const className = classNames('clientTile', { - clientTileLink: client.kind === ClientKind.LINKED_CLIENT, - }); - - let inviteButton: JSX.Element = <>>; - const matchingInstallLinks = client.installLinks.filter((installLink) => { - if ((uaResults as any).ios) { - return installLink.platform === Platform.iOS; - } else if ((uaResults as any).android) { - return installLink.platform === Platform.Android; - } else { - return false; - } - }); - const hasNativeClient = matchingInstallLinks.length > 0; - let installButtons = undefined; - if (matchingInstallLinks.length) { - installButtons ={matchingInstallLinks.map((installLink) => { - return - - ; - })}
; - } - - if (client.kind === ClientKind.LINKED_CLIENT) { - inviteButton = ; - } else { - const copyString = client.copyString(link); - if (copyString !== '') { - inviteButton = ( - - ); - } - } - - let clientTile = ( -{client.description}
- {installButtons} - {inviteLine} - {inviteButton} -"{event.content}"
-{event.sender}
- > -); - -export default EventPreview; diff --git a/src/components/FakeProgress.scss b/src/components/FakeProgress.scss deleted file mode 100644 index 32cd224..0000000 --- a/src/components/FakeProgress.scss +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2020 The Matrix.org Foundation C.I.C. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -@import '../color-scheme'; - -.fakeProgress { - width: 100%; - height: 4px; - background-color: lighten($grey, 50%); - border-radius: 4px; - - > div { - width: 60%; - height: 100%; - background-color: $foreground; - border-radius: 4px; - } -} diff --git a/src/components/FakeProgress.tsx b/src/components/FakeProgress.tsx deleted file mode 100644 index 587a7e3..0000000 --- a/src/components/FakeProgress.tsx +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2020 The Matrix.org Foundation C.I.C. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import React from 'react'; - -import './FakeProgress.scss'; - -const FakeProgress = () => ( -{description}
: null} -- A homeserver will show you metadata about the link, like - a description. Homeservers will be able to relate your - IP to things you've opened invites for in matrix.to. -
-{client.toInviteString(link)}
; - navigator.clipboard?.writeText(client.copyString(link)); - inviteUseString = `These are instructions for ${client.name}.`; - break; - } - - const advancedButton = ( -
- {inviteUseString}
-
Great, pick a client below to confirm and continue
-- The client that created this link "{clientName}" is not a - recognised client. If this is a mistake and you'd like a - nice advertisement for it here please{' '} - - open a pr - - . -
-You're invited to join
- ); - - return ( -{room.num_joined_members.toLocaleString()} members
- ) : null; - return ( -{roomAlias}
-{room.topic}
: null; - return ( - <> -Some text
-Note the rounded corners
-{userId}
-{userId}
: null} -- That URL doesn't seem right. Links should be in the - format: -
-- {location.host}/#/{'<'}matrix-resourceidentifier{'>'} -
-