From 56ec766d8676f039bf901c8a8a1238f752a1ce8a Mon Sep 17 00:00:00 2001 From: hensm Date: Tue, 9 Apr 2019 01:11:24 +0100 Subject: [PATCH] Move UI components to ui/ directory --- ext/src/{options => }/defaultOptions.ts | 0 ext/src/main.ts | 4 ++-- ext/src/manifest.json | 2 +- ext/src/{ => ui}/options/Bridge.tsx | 4 ++-- ext/src/{ => ui}/options/EditableList.tsx | 0 ext/src/{ => ui}/options/EditableListItem.tsx | 0 .../{ => ui}/options/assets/icons8-cancel-120.png | Bin ext/src/{ => ui}/options/assets/icons8-ok-120.png | Bin ext/src/{ => ui}/options/assets/icons8-warn-120.png | Bin ext/src/{ => ui}/options/index.html | 0 ext/src/{ => ui}/options/index.tsx | 6 +++--- ext/src/{ => ui}/options/styles/index.css | 0 ext/src/{ => ui}/options/styles/mac.css | 0 ext/src/{ => ui}/popup/index.html | 0 ext/src/{ => ui}/popup/index.tsx | 4 ++-- ext/src/{ => ui}/popup/styles/index.css | 0 ext/src/{ => ui}/popup/styles/mac.css | 0 ext/src/{ => ui}/updater/index.html | 0 ext/src/{ => ui}/updater/index.tsx | 4 ++-- ext/src/{ => ui}/updater/styles/index.css | 0 ext/src/{ => ui}/updater/styles/mac.css | 0 ext/webpack.config.js | 10 +++++++--- 22 files changed, 19 insertions(+), 15 deletions(-) rename ext/src/{options => }/defaultOptions.ts (100%) rename ext/src/{ => ui}/options/Bridge.tsx (99%) rename ext/src/{ => ui}/options/EditableList.tsx (100%) rename ext/src/{ => ui}/options/EditableListItem.tsx (100%) rename ext/src/{ => ui}/options/assets/icons8-cancel-120.png (100%) rename ext/src/{ => ui}/options/assets/icons8-ok-120.png (100%) rename ext/src/{ => ui}/options/assets/icons8-warn-120.png (100%) rename ext/src/{ => ui}/options/index.html (100%) rename ext/src/{ => ui}/options/index.tsx (98%) rename ext/src/{ => ui}/options/styles/index.css (100%) rename ext/src/{ => ui}/options/styles/mac.css (100%) rename ext/src/{ => ui}/popup/index.html (100%) rename ext/src/{ => ui}/popup/index.tsx (98%) rename ext/src/{ => ui}/popup/styles/index.css (100%) rename ext/src/{ => ui}/popup/styles/mac.css (100%) rename ext/src/{ => ui}/updater/index.html (100%) rename ext/src/{ => ui}/updater/index.tsx (98%) rename ext/src/{ => ui}/updater/styles/index.css (100%) rename ext/src/{ => ui}/updater/styles/mac.css (100%) diff --git a/ext/src/options/defaultOptions.ts b/ext/src/defaultOptions.ts similarity index 100% rename from ext/src/options/defaultOptions.ts rename to ext/src/defaultOptions.ts diff --git a/ext/src/main.ts b/ext/src/main.ts index cf87224..ecd77c4 100755 --- a/ext/src/main.ts +++ b/ext/src/main.ts @@ -2,7 +2,7 @@ import getBridgeInfo from "./lib/getBridgeInfo"; import messageRouter from "./lib/messageRouter"; -import defaultOptions, { Options } from "./options/defaultOptions"; +import defaultOptions, { Options } from "./defaultOptions"; import { getChromeUserAgent } from "./lib/userAgents"; import { getWindowCenteredProps } from "./lib/utils"; @@ -365,7 +365,7 @@ async function openPopup (shimId: string) { const centeredProps = getWindowCenteredProps(win, 350, 200); const popup = await browser.windows.create({ - url: "popup/index.html" + url: "ui/popup/index.html" , type: "popup" , ...centeredProps }); diff --git a/ext/src/manifest.json b/ext/src/manifest.json index 37b8e2a..f0c85bb 100755 --- a/ext/src/manifest.json +++ b/ext/src/manifest.json @@ -32,7 +32,7 @@ , "manifest_version": 2 , "options_ui": { - "page": "options/index.html" + "page": "ui/options/index.html" } , "permissions": [ "downloads" diff --git a/ext/src/options/Bridge.tsx b/ext/src/ui/options/Bridge.tsx similarity index 99% rename from ext/src/options/Bridge.tsx rename to ext/src/ui/options/Bridge.tsx index a45d074..41ce7b3 100644 --- a/ext/src/options/Bridge.tsx +++ b/ext/src/ui/options/Bridge.tsx @@ -5,9 +5,9 @@ import React, { Component } from "react"; import semver from "semver"; import { getNextEllipsis - , getWindowCenteredProps } from "../lib/utils"; + , getWindowCenteredProps } from "../../lib/utils"; -import { BridgeInfo } from "../lib/getBridgeInfo"; +import { BridgeInfo } from "../../lib/getBridgeInfo"; const _ = browser.i18n.getMessage; diff --git a/ext/src/options/EditableList.tsx b/ext/src/ui/options/EditableList.tsx similarity index 100% rename from ext/src/options/EditableList.tsx rename to ext/src/ui/options/EditableList.tsx diff --git a/ext/src/options/EditableListItem.tsx b/ext/src/ui/options/EditableListItem.tsx similarity index 100% rename from ext/src/options/EditableListItem.tsx rename to ext/src/ui/options/EditableListItem.tsx diff --git a/ext/src/options/assets/icons8-cancel-120.png b/ext/src/ui/options/assets/icons8-cancel-120.png similarity index 100% rename from ext/src/options/assets/icons8-cancel-120.png rename to ext/src/ui/options/assets/icons8-cancel-120.png diff --git a/ext/src/options/assets/icons8-ok-120.png b/ext/src/ui/options/assets/icons8-ok-120.png similarity index 100% rename from ext/src/options/assets/icons8-ok-120.png rename to ext/src/ui/options/assets/icons8-ok-120.png diff --git a/ext/src/options/assets/icons8-warn-120.png b/ext/src/ui/options/assets/icons8-warn-120.png similarity index 100% rename from ext/src/options/assets/icons8-warn-120.png rename to ext/src/ui/options/assets/icons8-warn-120.png diff --git a/ext/src/options/index.html b/ext/src/ui/options/index.html similarity index 100% rename from ext/src/options/index.html rename to ext/src/ui/options/index.html diff --git a/ext/src/options/index.tsx b/ext/src/ui/options/index.tsx similarity index 98% rename from ext/src/options/index.tsx rename to ext/src/ui/options/index.tsx index 1bc4dbb..6bb67cf 100644 --- a/ext/src/options/index.tsx +++ b/ext/src/ui/options/index.tsx @@ -4,13 +4,13 @@ import React, { Component } from "react"; import ReactDOM from "react-dom"; -import defaultOptions, { Options } from "./defaultOptions"; +import defaultOptions, { Options } from "../../defaultOptions"; import Bridge from "./Bridge"; import EditableList from "./EditableList"; -import getBridgeInfo, { BridgeInfo } from "../lib/getBridgeInfo"; -import { REMOTE_MATCH_PATTERN_REGEX } from "../lib/utils"; +import getBridgeInfo, { BridgeInfo } from "../../lib/getBridgeInfo"; +import { REMOTE_MATCH_PATTERN_REGEX } from "../../lib/utils"; const _ = browser.i18n.getMessage; diff --git a/ext/src/options/styles/index.css b/ext/src/ui/options/styles/index.css similarity index 100% rename from ext/src/options/styles/index.css rename to ext/src/ui/options/styles/index.css diff --git a/ext/src/options/styles/mac.css b/ext/src/ui/options/styles/mac.css similarity index 100% rename from ext/src/options/styles/mac.css rename to ext/src/ui/options/styles/mac.css diff --git a/ext/src/popup/index.html b/ext/src/ui/popup/index.html similarity index 100% rename from ext/src/popup/index.html rename to ext/src/ui/popup/index.html diff --git a/ext/src/popup/index.tsx b/ext/src/ui/popup/index.tsx similarity index 98% rename from ext/src/popup/index.tsx rename to ext/src/ui/popup/index.tsx index c50e789..a0748f3 100755 --- a/ext/src/popup/index.tsx +++ b/ext/src/ui/popup/index.tsx @@ -4,8 +4,8 @@ import React, { Component } from "react"; import ReactDOM from "react-dom"; -import { getNextEllipsis } from "../lib/utils"; -import * as types from "../types"; +import { getNextEllipsis } from "../../lib/utils"; +import * as types from "../../types"; const _ = browser.i18n.getMessage; diff --git a/ext/src/popup/styles/index.css b/ext/src/ui/popup/styles/index.css similarity index 100% rename from ext/src/popup/styles/index.css rename to ext/src/ui/popup/styles/index.css diff --git a/ext/src/popup/styles/mac.css b/ext/src/ui/popup/styles/mac.css similarity index 100% rename from ext/src/popup/styles/mac.css rename to ext/src/ui/popup/styles/mac.css diff --git a/ext/src/updater/index.html b/ext/src/ui/updater/index.html similarity index 100% rename from ext/src/updater/index.html rename to ext/src/ui/updater/index.html diff --git a/ext/src/updater/index.tsx b/ext/src/ui/updater/index.tsx similarity index 98% rename from ext/src/updater/index.tsx rename to ext/src/ui/updater/index.tsx index 5b2e5c9..0f3c2d2 100644 --- a/ext/src/updater/index.tsx +++ b/ext/src/ui/updater/index.tsx @@ -3,8 +3,8 @@ import React, { Component } from "react"; import ReactDOM from "react-dom"; -import { getNextEllipsis } from "../lib/utils"; -import { DownloadDelta, Message } from "../types"; +import { getNextEllipsis } from "../../lib/utils"; +import { DownloadDelta, Message } from "../../types"; const _ = browser.i18n.getMessage; diff --git a/ext/src/updater/styles/index.css b/ext/src/ui/updater/styles/index.css similarity index 100% rename from ext/src/updater/styles/index.css rename to ext/src/ui/updater/styles/index.css diff --git a/ext/src/updater/styles/mac.css b/ext/src/ui/updater/styles/mac.css similarity index 100% rename from ext/src/updater/styles/mac.css rename to ext/src/ui/updater/styles/mac.css diff --git a/ext/webpack.config.js b/ext/webpack.config.js index b160b92..37a5f07 100755 --- a/ext/webpack.config.js +++ b/ext/webpack.config.js @@ -7,9 +7,13 @@ const CopyWebpackPlugin = require("copy-webpack-plugin"); module.exports = (env) => ({ entry: { "main": `${env.includePath}/main.ts` - , "popup/bundle": `${env.includePath}/popup/index.tsx` - , "options/bundle": `${env.includePath}/options/index.tsx` - , "updater/bundle": `${env.includePath}/updater/index.tsx` + + // UI + , "ui/popup/bundle": `${env.includePath}/ui/popup/index.tsx` + , "ui/options/bundle": `${env.includePath}/ui/options/index.tsx` + , "ui/updater/bundle": `${env.includePath}/ui/updater/index.tsx` + + // Sender apps , "mediaCast": `${env.includePath}/mediaCast.js` , "mirroringCast": `${env.includePath}/mirroringCast.js`