diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..c95c3ce Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index e906154..8cdc8fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules *.build.js *.zip +/extension/build/style.css \ No newline at end of file diff --git a/babel.config.js b/babel.config.js index c51e84d..2554df1 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,5 +1,3 @@ - - module.exports = api => { return { presets: [ diff --git a/build.js b/build.js index 94e9d10..17d0fe2 100755 --- a/build.js +++ b/build.js @@ -14,11 +14,12 @@ esbuild 'background.build': './extension/background.js', 'content-script.build': './extension/content-script.js' }, - outdir: './extension', + outdir: './extension/build', sourcemap: prod ? false : 'inline', define: { window: 'self', global: 'self' - } + }, + watch: !prod }) .then(() => console.log('build success.')) diff --git a/extension/.DS_Store b/extension/.DS_Store new file mode 100644 index 0000000..0a6c458 Binary files /dev/null and b/extension/.DS_Store differ diff --git a/extension/background.js b/extension/background.js index 392fbad..14ea95b 100644 --- a/extension/background.js +++ b/extension/background.js @@ -130,8 +130,8 @@ async function handleContentScriptMessage({type, params, host}) { browser.windows.create({ url: `${browser.runtime.getURL('prompt.html')}?${qs.toString()}`, type: 'popup', - width: 340, - height: 360 + width: 600, + height: 600 }) }) diff --git a/extension/icons.jsx b/extension/icons.jsx new file mode 100644 index 0000000..9e81a4f --- /dev/null +++ b/extension/icons.jsx @@ -0,0 +1,87 @@ +import React from 'react' + +export function LogoIcon() { + return ( + + + + + + + + + + + + + + + + + + + ) +} + +export function SettingsIcon(props) { + return ( + + + + + ) +} diff --git a/extension/icons/.DS_Store b/extension/icons/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/extension/icons/.DS_Store differ diff --git a/extension/icons/128x128.png b/extension/icons/128x128.png deleted file mode 100644 index c56914e..0000000 Binary files a/extension/icons/128x128.png and /dev/null differ diff --git a/extension/icons/16x16.png b/extension/icons/16x16.png deleted file mode 100644 index d9dfa68..0000000 Binary files a/extension/icons/16x16.png and /dev/null differ diff --git a/extension/icons/32x32.png b/extension/icons/32x32.png deleted file mode 100644 index 5025055..0000000 Binary files a/extension/icons/32x32.png and /dev/null differ diff --git a/extension/icons/48x48.png b/extension/icons/48x48.png deleted file mode 100644 index 4281674..0000000 Binary files a/extension/icons/48x48.png and /dev/null differ diff --git a/extension/icons/icon128.png b/extension/icons/icon128.png new file mode 100644 index 0000000..80b7cae Binary files /dev/null and b/extension/icons/icon128.png differ diff --git a/extension/icons/icon16.png b/extension/icons/icon16.png new file mode 100644 index 0000000..fe15c11 Binary files /dev/null and b/extension/icons/icon16.png differ diff --git a/extension/icons/icon32.png b/extension/icons/icon32.png new file mode 100644 index 0000000..01d8d80 Binary files /dev/null and b/extension/icons/icon32.png differ diff --git a/extension/icons/icon48.png b/extension/icons/icon48.png new file mode 100644 index 0000000..e0c3136 Binary files /dev/null and b/extension/icons/icon48.png differ diff --git a/extension/manifest.json b/extension/manifest.json index cc25531..f275abe 100644 --- a/extension/manifest.json +++ b/extension/manifest.json @@ -1,27 +1,27 @@ { - "name": "nos2x", + "name": "Nostr Connect", "description": "Nostr Signer Extension", - "version": "2.2.0", - "homepage_url": "https://github.com/fiatjaf/nos2x", + "version": "0.1.0", + "homepage_url": "https://github.com/reyamir/nostr-connect", "manifest_version": 3, "icons": { - "16": "icons/16x16.png", - "32": "icons/32x32.png", - "48": "icons/48x48.png", - "128": "icons/128x128.png" + "16": "icons/icon16.png", + "32": "icons/icon32.png", + "48": "icons/icon48.png", + "128": "icons/icon128.png" }, "options_page": "options.html", "background": { - "service_worker": "background.build.js" + "service_worker": "/build/background.build.js" }, "action": { - "default_title": "nos2x", + "default_title": "Nostr Connect", "default_popup": "popup.html" }, "content_scripts": [ { "matches": [""], - "js": ["content-script.build.js"], + "js": ["/build/content-script.build.js"], "all_frames": true } ], diff --git a/extension/options.html b/extension/options.html index ba7a732..323b24c 100644 --- a/extension/options.html +++ b/extension/options.html @@ -1,24 +1,13 @@ - - -nos2x - - -
- - - - + + + + Nostr Connect + + + + +
+ + + diff --git a/extension/options.jsx b/extension/options.jsx index 690d8d8..96e489d 100644 --- a/extension/options.jsx +++ b/extension/options.jsx @@ -3,8 +3,10 @@ import React, {useState, useCallback, useEffect} from 'react' import {render} from 'react-dom' import {generatePrivateKey, nip19} from 'nostr-tools' import QRCode from 'react-qr-code' - +import * as Tabs from '@radix-ui/react-tabs' +import {LogoIcon} from './icons' import {removePermissions} from './common' +import * as Checkbox from '@radix-ui/react-checkbox' function Options() { let [privKey, setPrivKey] = useState('') @@ -79,252 +81,420 @@ function Options() { } return ( - <> -

nos2x

-

nostr signer extension

-

options

-
-
-
private key: 
-
-
- - {privKey === '' && } - {privKey && hidingPrivateKey && ( - - )} - {privKey && !hidingPrivateKey && ( - - )} -
- {privKey && !isKeyValid() && ( -
private key is invalid!
- )} - {!hidingPrivateKey && isKeyValid() && ( -
- -
- )} +
+
+
+ +
+

Nostr Connect

+

Nostr signer

-
-
preferred relays:
-
- {relays.map(({url, policy}, i) => ( -
- -
- - -
- -
- ))} -
- setNewRelayURL(e.target.value)} - onKeyDown={e => { - if (e.key === 'Enter') addNewRelay() - }} - /> - -
-
-
-
-